diff --git a/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/pojo/PageResult.java b/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/pojo/PageResult.java index 425697a5..0d619785 100644 --- a/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/pojo/PageResult.java +++ b/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/pojo/PageResult.java @@ -17,6 +17,9 @@ public final class PageResult implements Serializable { @Schema(description = "总量", requiredMode = Schema.RequiredMode.REQUIRED) private Long total; + @Schema(description = "总页数") + private Integer totalPages; + public PageResult() { } @@ -25,6 +28,12 @@ public final class PageResult implements Serializable { this.total = total; } + public PageResult(List list, Long total, Integer totalPages) { + this.list = list; + this.total = total; + this.totalPages = totalPages; + } + public PageResult(Long total) { this.list = new ArrayList<>(); this.total = total; diff --git a/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/util/object/BeanUtils.java b/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/util/object/BeanUtils.java index 3c09f460..7b156d78 100644 --- a/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/util/object/BeanUtils.java +++ b/mes-framework/mes-common/src/main/java/com/chanko/yunxi/mes/framework/common/util/object/BeanUtils.java @@ -31,7 +31,7 @@ public class BeanUtils { if (source == null) { return null; } - return new PageResult<>(toBean(source.getList(), targetType), source.getTotal()); + return new PageResult<>(toBean(source.getList(), targetType), source.getTotal(), source.getTotalPages()); } -} \ No newline at end of file +} diff --git a/mes-framework/mes-spring-boot-starter-banner/src/main/java/com/chanko/yunxi/mes/framework/banner/core/BannerApplicationRunner.java b/mes-framework/mes-spring-boot-starter-banner/src/main/java/com/chanko/yunxi/mes/framework/banner/core/BannerApplicationRunner.java index 0bb1e98e..ec5255ae 100644 --- a/mes-framework/mes-spring-boot-starter-banner/src/main/java/com/chanko/yunxi/mes/framework/banner/core/BannerApplicationRunner.java +++ b/mes-framework/mes-spring-boot-starter-banner/src/main/java/com/chanko/yunxi/mes/framework/banner/core/BannerApplicationRunner.java @@ -20,36 +20,12 @@ public class BannerApplicationRunner implements ApplicationRunner { public void run(ApplicationArguments args) { ThreadUtil.execute(() -> { ThreadUtil.sleep(1, TimeUnit.SECONDS); // 延迟 1 秒,保证输出到结尾 - log.info("\n----------------------------------------------------------\n\t" + - "项目启动成功!\n\t" + - "接口文档: \t{} \n\t" + - "开发文档: \t{} \n\t" + - "视频教程: \t{} \n" + + log.info("\n----------------------------------------------------------\n" + + "项目启动成功!\n" + + "\n" + + "{} \n" + "----------------------------------------------------------", - "https://doc.iocoder.cn/api-doc/", - "https://doc.iocoder.cn", - "https://t.zsxq.com/02Yf6M7Qn"); - - // 数据报表 - if (isNotPresent("com.chanko.yunxi.mes.module.report.framework.security.config.SecurityConfiguration")) { - System.out.println("[报表模块 mes-module-report - 已禁用][参考 https://doc.iocoder.cn/report/ 开启]"); - } - // 工作流 - if (isNotPresent("com.chanko.yunxi.mes.framework.flowable.config.MesFlowableConfiguration")) { - System.out.println("[工作流模块 mes-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]"); - } - // 微信公众号 - if (isNotPresent("com.chanko.yunxi.mes.module.mp.framework.mp.config.MpConfiguration")) { - System.out.println("[微信公众号 mes-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]"); - } - // 商城系统 - if (isNotPresent("com.chanko.yunxi.mes.module.trade.framework.web.config.TradeWebConfiguration")) { - System.out.println("[商城系统 mes-module-mall - 已禁用][参考 https://doc.iocoder.cn/mall/build/ 开启]"); - } - // 支付平台 - if (isNotPresent("com.chanko.yunxi.mes.module.pay.framework.pay.config.PayConfiguration")) { - System.out.println("[支付系统 mes-module-pay - 已禁用][参考 https://doc.iocoder.cn/pay/build/ 开启]"); - } + "Copyright ©上海长江云息数字科技有限公司,All Rights Reserved."); }); } diff --git a/mes-framework/mes-spring-boot-starter-biz-operatelog/src/main/java/com/chanko/yunxi/mes/framework/operatelog/core/enums/OperateTypeEnum.java b/mes-framework/mes-spring-boot-starter-biz-operatelog/src/main/java/com/chanko/yunxi/mes/framework/operatelog/core/enums/OperateTypeEnum.java index 5cc561ad..487360f8 100644 --- a/mes-framework/mes-spring-boot-starter-biz-operatelog/src/main/java/com/chanko/yunxi/mes/framework/operatelog/core/enums/OperateTypeEnum.java +++ b/mes-framework/mes-spring-boot-starter-biz-operatelog/src/main/java/com/chanko/yunxi/mes/framework/operatelog/core/enums/OperateTypeEnum.java @@ -80,6 +80,10 @@ public enum OperateTypeEnum { * 取消提交 * */ CANCEL_SUBMIT(16), + /* + * 废弃 + * */ + CANCEL(17), /** * 其它 * diff --git a/mes-framework/mes-spring-boot-starter-mybatis/src/main/java/com/chanko/yunxi/mes/framework/mybatis/core/mapper/BaseMapperX.java b/mes-framework/mes-spring-boot-starter-mybatis/src/main/java/com/chanko/yunxi/mes/framework/mybatis/core/mapper/BaseMapperX.java index 189d9ddb..d1e42260 100644 --- a/mes-framework/mes-spring-boot-starter-mybatis/src/main/java/com/chanko/yunxi/mes/framework/mybatis/core/mapper/BaseMapperX.java +++ b/mes-framework/mes-spring-boot-starter-mybatis/src/main/java/com/chanko/yunxi/mes/framework/mybatis/core/mapper/BaseMapperX.java @@ -1,9 +1,6 @@ package com.chanko.yunxi.mes.framework.mybatis.core.mapper; import cn.hutool.core.collection.CollUtil; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.mybatis.core.util.MyBatisUtils; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -11,10 +8,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.support.SFunction; import com.baomidou.mybatisplus.extension.toolkit.Db; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.util.MyBatisUtils; import com.github.yulichang.base.MPJBaseMapper; import com.github.yulichang.interfaces.MPJBaseJoin; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.Collection; import java.util.List; @@ -37,7 +38,7 @@ public interface BaseMapperX extends MPJBaseMapper { IPage mpPage = MyBatisUtils.buildPage(pageParam); selectPage(mpPage, queryWrapper); // 转换返回 - return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); + return new PageResult<>(mpPage.getRecords(), mpPage.getTotal(), new BigDecimal(mpPage.getTotal()).divide(new BigDecimal(pageParam.getPageSize()),0, BigDecimal.ROUND_CEILING).intValue()); } default PageResult selectJoinPage(PageParam pageParam, Class resultTypeClass, MPJBaseJoin joinQueryWrapper) { diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BoomDetailTypeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BoomDetailTypeEnum.java new file mode 100644 index 00000000..5538fdb0 --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BoomDetailTypeEnum.java @@ -0,0 +1,23 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +/** + * 物料类型 + * @author chenxi + * @date 2024-02-01 04:42 + */ +@Getter +public enum BoomDetailTypeEnum { + + MATERIAL("1", "原材料"), + OTHER("2", "加工件"); + + private String code; + private String description; + + BoomDetailTypeEnum(String code, String description) { + this.code = code; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinesTypeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinesTypeEnum.java index c3f95961..f2017aa7 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinesTypeEnum.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinesTypeEnum.java @@ -14,6 +14,16 @@ public enum BusinesTypeEnum { PROJECT_ORDER_SNAPSHOT("销售订单快照"), DELIVER_ORDER("发货订单"), PROCESS_BOM("工艺BOM"), + TASK_DISPATCH("派工单"), + TASK_DISPATCH_PRODUCTION("生产任务派工单"), + TASK_DISPATCH_ASSEMBLE("装配任务派工单"), + INSPECTION_REPORT("检测报告"), + UNQUALIFIED_NOTIFICATION("品质异常通知单"), + PLAN_TASK("生产任务单"), + FINANCE_MAKE_INVOICE("财务开票"), + FINANCE_RECEIVE_INVOICE("发票接收"), + FINANCE_INVOICE("财务发票"), + MATERIAL("物料"), ; private String description; diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinessFileTypeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinessFileTypeEnum.java index afb5f29f..b97be76b 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinessFileTypeEnum.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/BusinessFileTypeEnum.java @@ -12,7 +12,13 @@ public enum BusinessFileTypeEnum { CONTRACT("合同"), TECHNOLOGY_PROTOCOL("技术协议"), - ID_CARD("身份证照片"); + ID_CARD("身份证照片"), + COMPOSITION_REPORT("材质报告"), + HEAT_TREATMENT_REPORT("热处理报告"), + SCAN_REPORT("扫描报告"), + TRI_LINEAR_COORDINATES_MEASURING("三坐标检测报告"), + CERTIFICATE_OF_QUALIFICATION("合格证"), + ; private String description; diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java index 8d8c3a7a..bfa34277 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java @@ -44,8 +44,13 @@ public enum CodeEnum { PROJECT_ORDER("业务订单", 3, "yyyyMM"), PROJECT_DELIVERY_ORDER("发货单", "HL", 3, "yyyyMM"), PROJECT_PLAN("生产计划", "PP",3, "yyyyMM"), + PROJECT_PLAN_TASK("生产计划任务单", "PT",3, "yyyyMMdd"), MATERIAL_PLAN("物料需求计划", "PR",4, "yyyyMMdd"), PURCHASE_ORDER("采购订单", "PO",4, "yyyyMMdd"), + TASK_DISPATCH_PRODUCTION("生产任务派工单", "PTD", 3, "yyyyMMdd"), + TASK_DISPATCH_ASSEMBLE("装配任务派工单", "ATD", 3, "yyyyMMdd"), + UNQUALIFIED_NOTIFICATION("品质异常通知单", "RN", 4, "yyyyMMdd"), + MATERIAL("物料", 6), ; @@ -56,6 +61,13 @@ public enum CodeEnum { private int sequenceArgsLength; private String dateFormat; + CodeEnum(String description, int sequenceLength){ + this.description = description; + this.sequenceLength = sequenceLength; + this.sequenceArgsLength = 2; + this.sequenceTemplate = "%s%0"+sequenceLength+"d"; + } + CodeEnum(String description, String prefix, int sequenceLength) { this.description = description; this.prefix = prefix; diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/DictTypeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/DictTypeConstants.java new file mode 100644 index 00000000..eef031a7 --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/DictTypeConstants.java @@ -0,0 +1,18 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +@Getter +public enum DictTypeConstants { + + MATERIAL_TYPE("heli_material_type", "物料类型"), + MATERIAL_UNIT("heli_material_unit", "物料单位"); + + private String code; + private String description; + + DictTypeConstants(String code, String description) { + this.code = code; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java index f558439b..dd85bba9 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java @@ -20,13 +20,16 @@ import com.chanko.yunxi.mes.framework.common.exception.ErrorCode; * 007 生产计划 * 008 采购管理 * 009 生产管理 + * 010 质量管理 + * 011 应收应付管理 * 第三段,3 位,错误码 */ public interface ErrorCodeConstants { ErrorCode CODE_REPEAT = new ErrorCode(1_000_001, "编码不能重复"); ErrorCode INVALID_OPERATE = new ErrorCode(1_000_002, "无效操作"); - + ErrorCode IMPORT_ERROR = new ErrorCode(1_000_003, "导入失败:{}"); + ErrorCode DICT_TYPE_ERROR = new ErrorCode(1_000_003, "无法识别枚举类型"); /************基础信息**********/ ErrorCode MATERIAL_NOT_EXISTS = new ErrorCode(1_001_001, "物料不存在"); ErrorCode COMPOSITION_NOT_EXISTS = new ErrorCode(1_001_002, "材质不存在"); @@ -36,6 +39,10 @@ public interface ErrorCodeConstants { ErrorCode PROCEDURE_NOT_EXISTS = new ErrorCode(1_001_006, "工序不存在"); ErrorCode SERIAL_NUMBER_NOT_EXISTS = new ErrorCode(1_001_007, "序列号记录不存在"); ErrorCode EQUIP_NOT_EXISTS = new ErrorCode(1_001_008, "设备信息不存在"); + ErrorCode MATERIAL_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_001_009, "导入物料数据不能为空"); + ErrorCode MATERIAL_IMPORT_CODE_REPEAT = new ErrorCode(1_001_010, "导入物料数据存在重复编码: {}"); + ErrorCode EQUIP_MANUFACTURE_NOT_EXISTS = new ErrorCode(1_001_011, "制造设备不存在"); + ErrorCode MATERIAL_IMPORT_CODE_NOT_STANDARD = new ErrorCode(1_001_012, "物料编码不符合标准"); /*********组织架构************/ ErrorCode WORKSHOP_NOT_EXISTS = new ErrorCode(1_002_001, "车间不存在"); @@ -65,11 +72,25 @@ public interface ErrorCodeConstants { /************生产计划管理***********/ ErrorCode PLAN_NOT_EXISTS = new ErrorCode(1_007_001, "生产计划不存在"); ErrorCode PLAN_SUB_NOT_EXISTS = new ErrorCode(1_007_002, "生产计划子项目不存在"); + ErrorCode PLAN_TASK_NOT_EXISTS = new ErrorCode(1_007_003, "生产计划任务不存在"); + ErrorCode PLAN_TASK_BOM_NOT_EXISTS = new ErrorCode(1_007_004, "生产计划任务Bom不存在"); /************采购管理***********/ ErrorCode MATERIAL_PLAN_NOT_EXISTS = new ErrorCode(1_008_001, "物料需求计划不存在"); ErrorCode MATERIAL_PLAN_DETAIL_NOT_EXISTS = new ErrorCode(1_008_002, "物料需求计划物料详情不存在"); ErrorCode PURCHASE_ORDER_NOT_EXISTS = new ErrorCode(1_008_003, "采购订单不存在"); ErrorCode PURCHASE_ORDER_MATERIAL_NOT_EXISTS = new ErrorCode(1_008_004, "采购单物料不存在"); + ErrorCode MATERIAL_PLAN_BOOM_NOT_EXISTS = new ErrorCode(1_008_005, "物料需求计划加工件明细不存在"); + ErrorCode PURCHASE_ORDER_BOOM_NOT_EXISTS = new ErrorCode(1_008_006, "采购订单加工件明细不存在"); /************生产管理***********/ ErrorCode TASK_DISPATCH_NOT_EXISTS = new ErrorCode(1_009_001, "派工单不存在"); + ErrorCode TASK_REPORT_NOT_EXISTS = new ErrorCode(1_009_002, "任务报工不存在"); + ErrorCode TASK_REPORT_PARAMS_ERROR = new ErrorCode(1_009_003, "报工数量或报工工时不能为空"); + ErrorCode TASK_DISPATCH_TASK_NOT_EXISTS = new ErrorCode(1_009_004, "任务不存在或已完成"); + ErrorCode TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE = new ErrorCode(1_009_005, "任务不满足操作条件"); + ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工"); + /*************质量管理***********/ + ErrorCode UNQUALIFIED_NOTIFICATION_NOT_EXISTS = new ErrorCode(1_010_001, "品质异常通知单审核不存在"); + ErrorCode QUALITY_FEEDBACK_NOT_EXISTS = new ErrorCode(1_010_002, "客户反馈质量不存在"); + /*************应收应付管理***********/ + ErrorCode INVOICE_NOT_EXISTS = new ErrorCode(1_011_001, "财务发票不存在"); } diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/InvoiceStatusEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/InvoiceStatusEnum.java new file mode 100644 index 00000000..9f01ea6b --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/InvoiceStatusEnum.java @@ -0,0 +1,24 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +/** + * 发票状态枚举 + * @author chenxi + * @date 2024-02-26 11:25 + */ +@Getter +public enum InvoiceStatusEnum { + + SAVE(1, "已保存"), + SUBMIT(2, "已提交"), + CANCEL(3, "已作废"); + + private int code; + private String description; + + InvoiceStatusEnum(int code, String description) { + this.code = code; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/MaterialTypeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/MaterialTypeEnum.java index da6d0eff..19d2ccfc 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/MaterialTypeEnum.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/MaterialTypeEnum.java @@ -2,6 +2,8 @@ package com.chanko.yunxi.mes.module.heli.enums; import lombok.Getter; +import java.util.Arrays; + /** * 物料类型 * @author chenxi @@ -10,18 +12,24 @@ import lombok.Getter; @Getter public enum MaterialTypeEnum { - RAW("1", "原材料"), - ACCESSORY("2", "副资材"), - OFFICE("3", "办公/劳保"), - GIVING("4", "赠送物品"), - STANDARD("5", "标准件"), - VIRTUAL("6", "虚拟物料"); + RAW("1", "原材料", "2"), + ACCESSORY("2", "副资材", "4"), + OFFICE("3", "办公/劳保", "3"), + GIVING("4", "赠送物品", "5"), + STANDARD("5", "标准件", "1"), + VIRTUAL("6", "虚拟物料", "0"); private String code; private String description; + private String prefix; - MaterialTypeEnum(String code, String description) { + MaterialTypeEnum(String code, String description, String prefix) { this.code = code; this.description = description; + this.prefix = prefix; + } + + public static MaterialTypeEnum getMaterialType(String code){ + return Arrays.stream(MaterialTypeEnum.values()).filter(materialTypeEnum -> materialTypeEnum.code.equals(code)).findFirst().get(); } } diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/StockInTypeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/StockInTypeEnum.java new file mode 100644 index 00000000..e50d79cd --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/StockInTypeEnum.java @@ -0,0 +1,27 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +/** + * 出库类型 + * @author chenxi + * @date 2024-02-01 02:31 + */ +@Getter +public enum StockInTypeEnum { + + RECEIVE(1, "采购入库"), + GAIN(2, "盘盈入库"), + PRODUCTION(3, "生产入库"), + OTHER(4, "其他入库"), + RETURN(5, "车间退料") + ; + + private int code; + private String description; + + StockInTypeEnum(int code, String description) { + this.code = code; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchProcedureStatusEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchProcedureStatusEnum.java new file mode 100644 index 00000000..d0e733c5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchProcedureStatusEnum.java @@ -0,0 +1,24 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +/** + * 派工单工序状态枚举 + * @author chenxi + * @date 2024-03-04 04:44 + */ +@Getter +public enum TaskDispatchProcedureStatusEnum { + + DEFAULT(0, "默认"), + SUBMITTED(1, "已提交"), + COMPLETED(2, "已完成"); + + private int code; + private String description; + + TaskDispatchProcedureStatusEnum(int code, String description) { + this.code = code; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchStatusEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchStatusEnum.java new file mode 100644 index 00000000..e28d3529 --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchStatusEnum.java @@ -0,0 +1,25 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +/** + * 派工单状态枚举 + * @author chenxi + * @date 2024-02-26 11:25 + */ +@Getter +public enum TaskDispatchStatusEnum { + + SAVE(1, "已保存"), + SUBMIT(2, "已提交"), + CANCEL_SUBMIT(1, "取消提交"), + TERMINATE(3, "已终止"); + + private int code; + private String description; + + TaskDispatchStatusEnum(int code, String description) { + this.code = code; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchTypeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchTypeEnum.java new file mode 100644 index 00000000..e13d0011 --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskDispatchTypeEnum.java @@ -0,0 +1,28 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.TASK_DISPATCH_ASSEMBLE; +import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.TASK_DISPATCH_PRODUCTION; + +/** + * 派工单类型枚举 + * @author chenxi + * @date 2024-03-12 02:28 + */ +@Getter +public enum TaskDispatchTypeEnum { + + PRODUCTION(BusinesTypeEnum.TASK_DISPATCH_PRODUCTION, TASK_DISPATCH_PRODUCTION, "生产任务"), + ASSEMBLE(BusinesTypeEnum.TASK_DISPATCH_ASSEMBLE, TASK_DISPATCH_ASSEMBLE, "装配任务"); + + private BusinesTypeEnum businesTypeEnum; + private CodeEnum codeEnum; + private String description; + + TaskDispatchTypeEnum(BusinesTypeEnum businesTypeEnum, CodeEnum codeEnum, String description) { + this.businesTypeEnum = businesTypeEnum; + this.codeEnum = codeEnum; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskReportOperateEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskReportOperateEnum.java new file mode 100644 index 00000000..0ee908b7 --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/TaskReportOperateEnum.java @@ -0,0 +1,23 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +/** + * 任务报工操作枚举 + * @author chenxi + * @date 2024-03-08 10:03 + */ +@Getter +public enum TaskReportOperateEnum { + START("开始"), + END("结束"), + SUBMIT("提交"), + FINISH("完成") + ; + + private String description; + + TaskReportOperateEnum(String description) { + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/UnqualifiedNotificationStatusEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/UnqualifiedNotificationStatusEnum.java new file mode 100644 index 00000000..eb8bcab7 --- /dev/null +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/UnqualifiedNotificationStatusEnum.java @@ -0,0 +1,24 @@ +package com.chanko.yunxi.mes.module.heli.enums; + +import lombok.Getter; + +/** + * 派工单状态枚举 + * @author chenxi + * @date 2024-02-26 11:25 + */ +@Getter +public enum UnqualifiedNotificationStatusEnum { + + SAVE(1, "已保存"), + SUBMIT(2, "已送审"), + AUDIT(3, "已审核"); + + private int code; + private String description; + + UnqualifiedNotificationStatusEnum(int code, String description) { + this.code = code; + this.description = description; + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/config/HeliWebConfiguration.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/config/HeliWebConfiguration.java new file mode 100644 index 00000000..fd940979 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/config/HeliWebConfiguration.java @@ -0,0 +1,24 @@ +package com.chanko.yunxi.mes.module.heli.config; + +import com.chanko.yunxi.mes.framework.swagger.config.MesSwaggerAutoConfiguration; +import org.springdoc.core.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * system 模块的 web 组件的 Configuration + * + * @author 芋道源码 + */ +@Configuration(proxyBeanMethods = false) +public class HeliWebConfiguration { + + /** + * system 模块的 API 分组 + */ + @Bean + public GroupedOpenApi heliGroupedOpenApi() { + return MesSwaggerAutoConfiguration.buildGroupedOpenApi("heli"); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionPageReqVO.java index f2cdedf8..78f042f8 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionPageReqVO.java @@ -1,10 +1,13 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo; -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; import java.time.LocalDateTime; import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -35,6 +38,6 @@ public class CompositionPageReqVO extends PageParam { private String original; @Schema(description = "密度") - private String density; + private BigDecimal density; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionRespVO.java index a74c4f6b..28bd82c3 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionRespVO.java @@ -1,14 +1,14 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; @Schema(description = "管理后台 - 材质 Response VO") @Data @@ -46,6 +46,6 @@ public class CompositionRespVO { @Schema(description = "密度") @ExcelProperty("密度") - private String density; + private BigDecimal density; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionSaveReqVO.java index bf42308b..c3f1eb49 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/composition/vo/CompositionSaveReqVO.java @@ -1,37 +1,38 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; -import java.util.*; - -@Schema(description = "管理后台 - 材质新增/修改 Request VO") -@Data -public class CompositionSaveReqVO { - - @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "457") - private Long id; - - @Schema(description = "材质名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @NotEmpty(message = "材质名不能为空") - private String name; - - @Schema(description = "材质代号") - private String code; - - @Schema(description = "描述", example = "随便") - private String description; - - @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotNull(message = "状态,1表示正常,2表示禁用不能为空") - private Integer status; - - @Schema(description = "来源", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "来源不能为空") - private String original; - - @Schema(description = "密度") - private String density; - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.composition.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - 材质新增/修改 Request VO") +@Data +public class CompositionSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "457") + private Long id; + + @Schema(description = "材质名", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + @NotEmpty(message = "材质名不能为空") + private String name; + + @Schema(description = "材质代号") + private String code; + + @Schema(description = "描述", example = "随便") + private String description; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + + @Schema(description = "来源", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "来源不能为空") + private String original; + + @Schema(description = "密度") + private BigDecimal density; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerPageReqVO.java index c03e9b22..39c65cdf 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerPageReqVO.java @@ -21,12 +21,15 @@ public class CustomerPageReqVO extends PageParam { @Schema(description = "客户编码") private String code; - @Schema(description = "客户简称") + @Schema(description = "简码") private String brief; - @Schema(description = "客户全称", example = "赵六") + @Schema(description = "客户简称") private String name; + @Schema(description = "客户全称") + private String fullName; + @Schema(description = "所属行业") private String industry; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerRespVO.java index 05e6017d..1cb44f9d 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerRespVO.java @@ -23,13 +23,17 @@ public class CustomerRespVO { @ExcelProperty("客户编码") private String code; + @Schema(description = "简码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("简码") + private String brief; + @Schema(description = "客户简称", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("客户简称") - private String brief; + private String name; - @Schema(description = "客户全称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "客户全称", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("客户全称") - private String name; + private String fullName; @Schema(description = "所属行业") @ExcelProperty("所属行业") diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerSaveReqVO.java index 5fde0b8f..a07f4a81 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/customer/vo/CustomerSaveReqVO.java @@ -16,13 +16,17 @@ public class CustomerSaveReqVO { @Schema(description = "客户编码", requiredMode = Schema.RequiredMode.REQUIRED) private String code; - @Schema(description = "客户简称", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "客户简称不能为空") + @Schema(description = "简码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "简码不能为空") private String brief; + @Schema(description = "客户简称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "客户简称不能为空") + private String name; + @Schema(description = "客户全称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") @NotEmpty(message = "客户全称不能为空") - private String name; + private String fullName; @Schema(description = "所属行业") private String industry; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/EquipManufactureController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/EquipManufactureController.java new file mode 100644 index 00000000..3a1fd0a1 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/EquipManufactureController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO; +import com.chanko.yunxi.mes.module.heli.service.equipmanufacture.EquipManufactureService; + +@Tag(name = "管理后台 - 制造设备") +@RestController +@RequestMapping("/heli/equip-manufacture") +@Validated +public class EquipManufactureController { + + @Resource + private EquipManufactureService equipManufactureService; + + @PostMapping("/create") + @Operation(summary = "创建制造设备") + @PreAuthorize("@ss.hasPermission('heli:equip-manufacture:create')") + public CommonResult createEquipManufacture(@Valid @RequestBody EquipManufactureSaveReqVO createReqVO) { + return success(equipManufactureService.createEquipManufacture(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新制造设备") + @PreAuthorize("@ss.hasPermission('heli:equip-manufacture:update')") + public CommonResult updateEquipManufacture(@Valid @RequestBody EquipManufactureSaveReqVO updateReqVO) { + equipManufactureService.updateEquipManufacture(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除制造设备") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:equip-manufacture:delete')") + public CommonResult deleteEquipManufacture(@RequestParam("id") Long id) { + equipManufactureService.deleteEquipManufacture(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得制造设备") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:equip-manufacture:query')") + public CommonResult getEquipManufacture(@RequestParam("id") Long id) { + EquipManufactureDO equipManufacture = equipManufactureService.getEquipManufacture(id); + return success(BeanUtils.toBean(equipManufacture, EquipManufactureRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得制造设备分页") + @PreAuthorize("@ss.hasPermission('heli:equip-manufacture:query')") + public CommonResult> getEquipManufacturePage(@Valid EquipManufacturePageReqVO pageReqVO) { + PageResult pageResult = equipManufactureService.getEquipManufacturePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, EquipManufactureRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出制造设备 Excel") + @PreAuthorize("@ss.hasPermission('heli:equip-manufacture:export')") + @OperateLog(type = EXPORT) + public void exportEquipManufactureExcel(@Valid EquipManufacturePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = equipManufactureService.getEquipManufacturePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "制造设备.xls", "数据", EquipManufactureRespVO.class, + BeanUtils.toBean(list, EquipManufactureRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufacturePageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufacturePageReqVO.java new file mode 100644 index 00000000..a51f673d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufacturePageReqVO.java @@ -0,0 +1,40 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 制造设备分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class EquipManufacturePageReqVO extends PageParam { + + @Schema(description = "编码 唯一") + private String code; + + @Schema(description = "名称", example = "赵六") + private String name; + + @Schema(description = "类型", example = "2") + private String type; + + @Schema(description = "型号") + private String model; + + @Schema(description = "状态,1表示正常,2表示禁用,默认是1", example = "2") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "编码或名称") + private String codeOrName; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufactureRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufactureRespVO.java new file mode 100644 index 00000000..532d5ebf --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufactureRespVO.java @@ -0,0 +1,44 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 制造设备 Response VO") +@Data +@ExcelIgnoreUnannotated +public class EquipManufactureRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "6775") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "编码 唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("编码 唯一") + private String code; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("名称") + private String name; + + @Schema(description = "类型", example = "2") + @ExcelProperty("类型") + private String type; + + @Schema(description = "型号") + @ExcelProperty("型号") + private String model; + + @Schema(description = "状态,1表示正常,2表示禁用,默认是1", example = "2") + @ExcelProperty("状态,1表示正常,2表示禁用,默认是1") + private Integer status; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufactureSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufactureSaveReqVO.java new file mode 100644 index 00000000..e9f499e5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/equipmanufacture/vo/EquipManufactureSaveReqVO.java @@ -0,0 +1,33 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; + +@Schema(description = "管理后台 - 制造设备新增/修改 Request VO") +@Data +public class EquipManufactureSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "6775") + private Long id; + + @Schema(description = "编码 唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "编码 唯一不能为空") + private String code; + + @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @NotEmpty(message = "名称不能为空") + private String name; + + @Schema(description = "类型", example = "2") + private String type; + + @Schema(description = "型号") + private String model; + + @Schema(description = "状态,1表示正常,2表示禁用,默认是1", example = "2") + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/InvoiceController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/InvoiceController.java new file mode 100644 index 00000000..360eea3e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/InvoiceController.java @@ -0,0 +1,103 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.invoice; + +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo.InvoicePageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo.InvoiceRespVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo.InvoiceSaveReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.invoice.InvoiceDO; +import com.chanko.yunxi.mes.module.heli.service.invoice.InvoiceService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.List; + +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 财务发票") +@RestController +@RequestMapping("/heli/invoice") +@Validated +public class InvoiceController { + + @Resource + private InvoiceService invoiceService; + + @PostMapping("/create") + @Operation(summary = "创建财务发票") + @PreAuthorize("@ss.hasPermission('heli:invoice:create')") + public CommonResult createInvoice(@Valid @RequestBody InvoiceSaveReqVO createReqVO) { + return success(invoiceService.createInvoice(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新财务发票") + @PreAuthorize("@ss.hasPermission('heli:invoice:update')") + public CommonResult updateInvoice(@Valid @RequestBody InvoiceSaveReqVO updateReqVO) { + invoiceService.updateInvoice(updateReqVO); + return success(true); + } + + @PostMapping("/operate") + @Operation(summary = "操作发票") + @PreAuthorize("@ss.hasPermission('heli:invoice:update')") + @OperateLog(enable = false) + @Transactional(rollbackFor = Exception.class) + public CommonResult operate(@Valid @RequestBody InvoiceSaveReqVO operateReqVO) { + return success(invoiceService.operate(operateReqVO)); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除财务发票") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:invoice:delete')") + public CommonResult deleteInvoice(@RequestParam("id") Long id) { + invoiceService.deleteInvoice(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得财务发票") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:invoice:query')") + public CommonResult getInvoice(@RequestParam("id") Long id, @RequestParam("businessType") String businessType) { + InvoiceDO invoice = invoiceService.getInvoice(id, businessType); + return success(BeanUtils.toBean(invoice, InvoiceRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得财务发票分页") + @PreAuthorize("@ss.hasPermission('heli:invoice:query')") + public CommonResult> getInvoicePage(@Valid InvoicePageReqVO pageReqVO) { + PageResult pageResult = invoiceService.getInvoicePage(pageReqVO); + return success(BeanUtils.toBean(pageResult, InvoiceRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出财务发票 Excel") + @PreAuthorize("@ss.hasPermission('heli:invoice:export')") + @OperateLog(type = EXPORT) + public void exportInvoiceExcel(@Valid InvoicePageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = invoiceService.getInvoicePage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "财务发票.xls", "数据", InvoiceRespVO.class, + BeanUtils.toBean(list, InvoiceRespVO.class)); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoicePageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoicePageReqVO.java new file mode 100644 index 00000000..4a55f729 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoicePageReqVO.java @@ -0,0 +1,68 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 财务发票分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class InvoicePageReqVO extends PageParam { + + @Schema(description = "业务类型 FINANCE_MAKE|FINANCE_RECEIVE 开票|收票", example = "2") + private String businessType; + + @Schema(description = "订单id", example = "30302") + private Long orderId; + + @Schema(description = "发票号码") + private String number; + + @Schema(description = "发票类型", example = "1") + private String type; + + @Schema(description = "开票日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] billingDate; + + @Schema(description = "发票金额") + private BigDecimal amount; + + @Schema(description = "税率") + private BigDecimal rate; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "提交人") + private Long submitter; + + @Schema(description = "提交时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] submitTime; + + @Schema(description = "作废人") + private Long canceller; + + @Schema(description = "作废时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] cancelTime; + + @Schema(description = "单据状态 已保存|已提交|已作废 1|2|3", example = "1") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "订单编号", example = "30302") + private String orderCode; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoiceRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoiceRespVO.java new file mode 100644 index 00000000..17f1bcb2 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoiceRespVO.java @@ -0,0 +1,90 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 财务发票 Response VO") +@Data +@ExcelIgnoreUnannotated +public class InvoiceRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "9244") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "业务类型 FINANCE_MAKE|FINANCE_RECEIVE 开票|收票", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("业务类型 FINANCE_MAKE|FINANCE_RECEIVE 开票|收票") + private String businessType; + + @Schema(description = "订单id", example = "30302") + @ExcelProperty("订单id") + private Long orderId; + + @Schema(description = "发票号码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("发票号码") + private String number; + + @Schema(description = "发票类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty(value = "发票类型", converter = DictConvert.class) + @DictFormat("heli_invoice_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String type; + + @Schema(description = "开票日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("开票日期") + private LocalDateTime billingDate; + + @Schema(description = "发票金额", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("发票金额") + private BigDecimal amount; + + @Schema(description = "税率", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("税率") + private BigDecimal rate; + + @Schema(description = "备注", example = "你说的对") + @ExcelProperty("备注") + private String remark; + + @Schema(description = "提交人") + @ExcelProperty("提交人") + private Long submitter; + + @Schema(description = "提交时间") + @ExcelProperty("提交时间") + private LocalDateTime submitTime; + + @Schema(description = "作废人") + @ExcelProperty("作废人") + private Long canceller; + + @Schema(description = "作废时间") + @ExcelProperty("作废时间") + private LocalDateTime cancelTime; + + @Schema(description = "单据状态 已保存|已提交|已作废 1|2|3", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("单据状态 已保存|已提交|已作废 1|2|3") + private Integer status; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "提交人名称") + private String submitterName; + + @Schema(description = "创建人名称") + private String creatorName; + + @Schema(description = "作废人名称") + private String cancellerName; + + @Schema(description = "订单编号") + private String orderCode; +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoiceSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoiceSaveReqVO.java new file mode 100644 index 00000000..913ebad0 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/invoice/vo/InvoiceSaveReqVO.java @@ -0,0 +1,73 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 财务发票新增/修改 Request VO") +@Data +public class InvoiceSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "9244") + private Long id; + + @Schema(description = "业务类型 FINANCE_MAKE|FINANCE_RECEIVE 开票|收票", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "业务类型 FINANCE_MAKE|FINANCE_RECEIVE 开票|收票不能为空") + private String businessType; + + @Schema(description = "订单id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "订单不能为空") + private Long orderId; + + @Schema(description = "发票号码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "发票号码不能为空") + private String number; + + @Schema(description = "发票类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "发票类型不能为空") + private String type; + + @Schema(description = "开票日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "开票日期不能为空") + private LocalDateTime billingDate; + + @Schema(description = "发票金额", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "发票金额不能为空") + private BigDecimal amount; + + @Schema(description = "税率", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "税率不能为空") + private BigDecimal rate; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "提交人") + private Long submitter; + + @Schema(description = "提交时间") + private LocalDateTime submitTime; + + @Schema(description = "作废人") + private Long canceller; + + @Schema(description = "作废时间") + private LocalDateTime cancelTime; + + @Schema(description = "单据状态 已保存|已提交|已作废 1|2|3", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "单据状态 已保存|已提交|已作废 1|2|3不能为空") + private Integer status; + + @Schema(description = "操作类型") + @NotBlank(message = "操作类型不能为空") + private String active; + + @Schema(description = "操作意见") + private String activeOpinion; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/MaterialController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/MaterialController.java index a8cb3b64..2e228592 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/MaterialController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/MaterialController.java @@ -1,33 +1,35 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.material; -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import javax.validation.constraints.*; -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; - +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; import com.chanko.yunxi.mes.framework.common.pojo.PageParam; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; -import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; - import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; - import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; -import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; - -import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialExcelVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialRespVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialSaveReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; import com.chanko.yunxi.mes.module.heli.service.material.MaterialService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; @Tag(name = "管理后台 - 物料") @RestController @@ -107,4 +109,17 @@ public class MaterialController { // 拼接数据 return success(list); } + + @PostMapping("/import") + @Operation(summary = "导入用户") + @Parameters({ + @Parameter(name = "file", description = "Excel 文件", required = true), + @Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true") + }) + public CommonResult importExcel(@RequestParam("file") MultipartFile file, + @RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception { + List list = ExcelUtils.read(file, MaterialExcelVO.class); + materialService.importExcel(list, updateSupport); + return success(null); + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialExcelVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialExcelVO.java new file mode 100644 index 00000000..b4886fbc --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialExcelVO.java @@ -0,0 +1,70 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotBlank; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - 物料 Response VO") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Accessors(chain = false) +public class MaterialExcelVO { + + @NotBlank(message = "物料编码 不能为空") + @ExcelProperty("*物料编码") + private String code; + + @NotBlank(message = "物料名称 不能为空") + @ExcelProperty("*物料名称") + private String name; + + @ExcelProperty(value = "*物料类型", converter = DictConvert.class) + @DictFormat("heli_material_type") + @NotBlank(message = "物料类型 不能为空") + private String materialType; + + @NotBlank(message = "系统单位 不能为空") + @ExcelProperty(value = "*系统单位", converter = DictConvert.class) + @DictFormat("heli_material_unit") + private String unit; + + @ExcelProperty("物料简称") + private String shortName; + + @ExcelProperty("规格/型号") + private String spec; + + @ExcelProperty("品牌") + private String brand; + + @ExcelProperty(value = "物料主要来源", converter = DictConvert.class) + @DictFormat("heli_material_original") + private Integer mainFrom; + + @ExcelProperty("首选供应商") + private String mainSupplierName; + + @ExcelProperty("销项/进项税率(%)") + private BigDecimal outputInputTaxRate; + + @ExcelProperty("安全库存") + private BigDecimal invSafe; + + @ExcelProperty("物料条码") + private String barcode; + + @ExcelProperty("备注") + private String description; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java index d140243e..68650929 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java @@ -15,7 +15,6 @@ public class MaterialSaveReqVO { private Long id; @Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "物料编码不能为空") private String code; @Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/MaterialPlanBoomController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/MaterialPlanBoomController.java new file mode 100644 index 00000000..d47130bd --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/MaterialPlanBoomController.java @@ -0,0 +1,115 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom; + +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.service.processbom.ProcessBomService; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; +import com.chanko.yunxi.mes.module.heli.service.materialplanboom.MaterialPlanBoomService; + +@Tag(name = "管理后台 - 物料需求计划加工件明细") +@RestController +@RequestMapping("/heli/material-plan-boom") +@Validated +public class MaterialPlanBoomController { + + @Resource + private MaterialPlanBoomService materialPlanBoomService; + + + @PostMapping("/create") + @Operation(summary = "创建物料需求计划加工件明细") + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:create')") + public CommonResult createMaterialPlanBoom(@Valid @RequestBody MaterialPlanBoomSaveReqVO createReqVO) { + return success(materialPlanBoomService.createMaterialPlanBoom(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料需求计划加工件明细") + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:update')") + public CommonResult updateMaterialPlanBoom(@Valid @RequestBody MaterialPlanBoomSaveReqVO updateReqVO) { + materialPlanBoomService.updateMaterialPlanBoom(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料需求计划加工件明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:delete')") + public CommonResult deleteMaterialPlanBoom(@RequestParam("id") Long id) { + materialPlanBoomService.deleteMaterialPlanBoom(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料需求计划加工件明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:query')") + public CommonResult getMaterialPlanBoom(@RequestParam("id") Long id) { + MaterialPlanBoomDO materialPlanBoom = materialPlanBoomService.getMaterialPlanBoom(id); + return success(BeanUtils.toBean(materialPlanBoom, MaterialPlanBoomRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料需求计划加工件明细分页") + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:query')") + public CommonResult> getMaterialPlanBoomPage(@Valid MaterialPlanBoomPageReqVO pageReqVO) { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + PageResult pageResult = materialPlanBoomService.getMaterialPlanBoomPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialPlanBoomRespVO.class)); + } + + @GetMapping("/page-sum") + @Operation(summary = "获得物料需求计划加工件明细分页") + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:query')") + public CommonResult> getMaterialPlanBoomSumPage(@Valid MaterialPlanBoomPageReqVO pageReqVO) { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + PageResult pageResult = materialPlanBoomService.getMaterialPlanBoomSumPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialPlanBoomRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料需求计划加工件明细 Excel") + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:export')") + @OperateLog(type = EXPORT) + public void exportMaterialPlanBoomExcel(@Valid MaterialPlanBoomPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialPlanBoomService.getMaterialPlanBoomPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料需求计划加工件明细.xls", "数据", MaterialPlanBoomRespVO.class, + BeanUtils.toBean(list, MaterialPlanBoomRespVO.class)); + } + + @GetMapping("/boom") + @Operation(summary = "获得物料需求计划加工件明细分页") + @PreAuthorize("@ss.hasPermission('heli:material-plan-boom:query')") + public CommonResult> getBoomByProjectPlanId(@Valid ProcessBoomPageReqVO pageReqVO) { + PageResult pageResult = materialPlanBoomService.getProcessBoomDetailList(pageReqVO); + return success(BeanUtils.toBean(pageResult, ProcessBomDetailDO.class)); + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomPageReqVO.java new file mode 100644 index 00000000..11a40efa --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomPageReqVO.java @@ -0,0 +1,54 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料需求计划加工件明细分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MaterialPlanBoomPageReqVO extends PageParam { + + @Schema(description = "自增字段,唯一") + private Long id; + + @Schema(description = "物料需求计划id") + private Long projectMaterialPlanId; + + @Schema(description = "工艺boom明细id,零件类型:加工件") + private Long boomDetailId; + + @Schema(description = "订单子项目id") + private Long projectPlanSubId; + + @Schema(description = "需求数量") + private BigDecimal boomAmount; + + @Schema(description = "需求到货日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] boomArriveDate; + + @Schema(description = "备注") + private String description; + + @Schema(description = "零件名称") + private String materialName; + + @Schema(description = "规格型号") + private String boomSpec; + + @Schema(description = "材质") + private Long compositionId; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomRespVO.java new file mode 100644 index 00000000..3938e7a1 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomRespVO.java @@ -0,0 +1,71 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 物料需求计划加工件明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class MaterialPlanBoomRespVO extends PageParam { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "物料需求计划id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("物料需求计划id") + private Long projectMaterialPlanId; + + @Schema(description = "工艺boom明细id,零件类型:加工件", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("工艺boom明细id,零件类型:加工件") + private Long boomDetailId; + + @Schema(description = "订单子项目id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("订单子项目id") + private Long projectPlanSubId; + + @Schema(description = "需求数量") + @ExcelProperty("需求数量") + private BigDecimal boomAmount; + + @Schema(description = "需求到货日期") + @ExcelProperty("需求到货日期") + private LocalDateTime boomArriveDate; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String description; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "零件名称") + @ExcelProperty("零件名称") + private String materialName; + @Schema(description = "子项目编号") + @ExcelProperty("子项目编号") + private String projectSubCode; + @Schema(description = "规格型号") + @ExcelProperty("规格型号") + private String boomSpec; + @Schema(description = "系统单位") + @ExcelProperty("系统单位") + private String boomUnit; + @Schema(description = "材质") + @ExcelProperty("材质") + private String compositionName; + @Schema(description = "材质id") + @ExcelProperty("材质id") + private Long compositionId; + + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomSaveReqVO.java new file mode 100644 index 00000000..58777c5f --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomSaveReqVO.java @@ -0,0 +1,40 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料需求计划加工件明细新增/修改 Request VO") +@Data +public class MaterialPlanBoomSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "物料需求计划id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "物料需求计划id不能为空") + private Long projectMaterialPlanId; + + @Schema(description = "工艺boom明细id,零件类型:加工件", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "工艺boom明细id,零件类型:加工件不能为空") + private Long boomDetailId; + + @Schema(description = "订单子项目id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "订单子项目id不能为空") + private Long projectPlanSubId; + + @Schema(description = "需求数量") + private BigDecimal boomAmount; + + @Schema(description = "需求到货日期") + private LocalDateTime boomArriveDate; + + @Schema(description = "备注") + private String description; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/ProcessBoomPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/ProcessBoomPageReqVO.java new file mode 100644 index 00000000..1a4a89cd --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/ProcessBoomPageReqVO.java @@ -0,0 +1,30 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 物料需求计划加工件明细分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProcessBoomPageReqVO extends PageParam { + + @Schema(description = "生产计划id") + private Long planId; + + @Schema(description = "加工件名称") + private String materialName; + + @Schema(description = "生产计划子项目编号") + private String projectSubCode; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/ProcessBoomRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/ProcessBoomRespVO.java new file mode 100644 index 00000000..a5c80943 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/ProcessBoomRespVO.java @@ -0,0 +1,57 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 物料需求计划加工件明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ProcessBoomRespVO { + + @Schema(description = "生产计划Id") + private Long planId; + + @Schema(description = "物料Id") + private Long materialId; + + @Schema(description = "零件名称") + private String materialName; + + @Schema(description = "生产计划子项目id") + private Long projectPlanSubId; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "加工件Id") + private Long boomDetailId; + + @Schema(description = "需求数量") + private BigDecimal boomAmount; + + @Schema(description = "需求到货日期") + private LocalDateTime boomArriveDate; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String description; + + @Schema(description = "规格型号") + @ExcelProperty("规格型号") + private String boomSpec; + + @Schema(description = "系统单位") + @ExcelProperty("系统单位") + private String boomUnit; + + @Schema(description = "材质") + @ExcelProperty("材质") + private String compositionName; + + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/MaterialPlanDetailController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/MaterialPlanDetailController.java index 45fcc896..a6928d61 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/MaterialPlanDetailController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/MaterialPlanDetailController.java @@ -1,95 +1,103 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail; - -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import javax.validation.constraints.*; -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; -import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; - -import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; - -import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; -import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; - -import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; -import com.chanko.yunxi.mes.module.heli.service.materialplandetail.MaterialPlanDetailService; - -@Tag(name = "管理后台 - 物料需求计划物料详情") -@RestController -@RequestMapping("/heli/material-plan-detail") -@Validated -public class MaterialPlanDetailController { - - @Resource - private MaterialPlanDetailService materialPlanDetailService; - - @PostMapping("/create") - @Operation(summary = "创建物料需求计划物料详情") - @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:create')") - public CommonResult createMaterialPlanDetail(@Valid @RequestBody MaterialPlanDetailSaveReqVO createReqVO) { - return success(materialPlanDetailService.createMaterialPlanDetail(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新物料需求计划物料详情") - @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:update')") - public CommonResult updateMaterialPlanDetail(@Valid @RequestBody MaterialPlanDetailSaveReqVO updateReqVO) { - materialPlanDetailService.updateMaterialPlanDetail(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除物料需求计划物料详情") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:delete')") - public CommonResult deleteMaterialPlanDetail(@RequestParam("id") Long id) { - materialPlanDetailService.deleteMaterialPlanDetail(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得物料需求计划物料详情") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:query')") - public CommonResult getMaterialPlanDetail(@RequestParam("id") Long id) { - MaterialPlanDetailDO materialPlanDetail = materialPlanDetailService.getMaterialPlanDetail(id); - return success(BeanUtils.toBean(materialPlanDetail, MaterialPlanDetailRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得物料需求计划物料详情分页") - @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:query')") - public CommonResult> getMaterialPlanDetailPage(@Valid MaterialPlanDetailPageReqVO pageReqVO) { - PageResult pageResult = materialPlanDetailService.getMaterialPlanDetailPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, MaterialPlanDetailRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出物料需求计划物料详情 Excel") - @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:export')") - @OperateLog(type = EXPORT) - public void exportMaterialPlanDetailExcel(@Valid MaterialPlanDetailPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = materialPlanDetailService.getMaterialPlanDetailPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "物料需求计划物料详情.xls", "数据", MaterialPlanDetailRespVO.class, - BeanUtils.toBean(list, MaterialPlanDetailRespVO.class)); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; +import com.chanko.yunxi.mes.module.heli.service.materialplandetail.MaterialPlanDetailService; + +@Tag(name = "管理后台 - 物料需求计划物料详情") +@RestController +@RequestMapping("/heli/material-plan-detail") +@Validated +public class MaterialPlanDetailController { + + @Resource + private MaterialPlanDetailService materialPlanDetailService; + + @PostMapping("/create") + @Operation(summary = "创建物料需求计划物料详情") + @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:create')") + public CommonResult createMaterialPlanDetail(@Valid @RequestBody MaterialPlanDetailSaveReqVO createReqVO) { + return success(materialPlanDetailService.createMaterialPlanDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新物料需求计划物料详情") + @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:update')") + public CommonResult updateMaterialPlanDetail(@Valid @RequestBody MaterialPlanDetailSaveReqVO updateReqVO) { + materialPlanDetailService.updateMaterialPlanDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除物料需求计划物料详情") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:delete')") + public CommonResult deleteMaterialPlanDetail(@RequestParam("id") Long id) { + materialPlanDetailService.deleteMaterialPlanDetail(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得物料需求计划物料详情") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:query')") + public CommonResult getMaterialPlanDetail(@RequestParam("id") Long id) { + MaterialPlanDetailDO materialPlanDetail = materialPlanDetailService.getMaterialPlanDetail(id); + return success(BeanUtils.toBean(materialPlanDetail, MaterialPlanDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得物料需求计划物料详情分页") + @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:query')") + public CommonResult> getMaterialPlanDetailPage(@Valid MaterialPlanDetailPageReqVO pageReqVO) { + PageResult pageResult = materialPlanDetailService.getMaterialPlanDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialPlanDetailRespVO.class)); + } + + @GetMapping("/page-sum") + @Operation(summary = "获得物料需求计划物料详情分页") + @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:query')") + public CommonResult> getMaterialPlanDetailSumPage(@Valid MaterialPlanDetailPageReqVO pageReqVO) { + PageResult pageResult = materialPlanDetailService.getMaterialPlanDetailSumPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, MaterialPlanDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出物料需求计划物料详情 Excel") + @PreAuthorize("@ss.hasPermission('heli:material-plan-detail:export')") + @OperateLog(type = EXPORT) + public void exportMaterialPlanDetailExcel(@Valid MaterialPlanDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = materialPlanDetailService.getMaterialPlanDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "物料需求计划物料详情.xls", "数据", MaterialPlanDetailRespVO.class, + BeanUtils.toBean(list, MaterialPlanDetailRespVO.class)); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailPageReqVO.java index 960113f2..bf42adac 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailPageReqVO.java @@ -26,6 +26,15 @@ public class MaterialPlanDetailPageReqVO extends PageParam { @Schema(description = "物料id") private Long materialId; + @Schema(description = "物料名称") + private String matName; + + @Schema(description = "物料编码") + private String matCode; + + @Schema(description = "物料类型") + private Long matType; + @Schema(description = "子项目编号") private Long projectSubId; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailRespVO.java index 03c1bb86..c0ea5387 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplandetail/vo/MaterialPlanDetailRespVO.java @@ -35,6 +35,10 @@ public class MaterialPlanDetailRespVO { @ExcelProperty("需求数量") private BigDecimal requireAmount; + @Schema(description = "库存数量") + @ExcelProperty("库存数量") + private BigDecimal matRest; + @Schema(description = "需求到货日期") @ExcelProperty("需求到货日期") private LocalDateTime requireArriveTime; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java index 84b0d81c..4aac6da2 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plan/vo/PlanSaveReqVO.java @@ -62,7 +62,7 @@ public class PlanSaveReqVO { private String description; @Schema(description = "状态,1未开始,2生产中,3已完成,4已终止 ,默认是1", example = "2") - private Boolean status; + private Integer status; @Schema(description = "项目变更次数") private Integer changeNum; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java index 612fb1cf..d322ed90 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plansub/vo/PlanSubRespVO.java @@ -73,5 +73,7 @@ public class PlanSubRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; + @Schema(description = "子项目名称") + private String projectSubName; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/PlanTaskController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/PlanTaskController.java new file mode 100644 index 00000000..d0dba2b2 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/PlanTaskController.java @@ -0,0 +1,130 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantask; + +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.framework.operatelog.core.service.OperateLogFrameworkService; +import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.time.LocalDateTime; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.plantask.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask.PlanTaskDO; +import com.chanko.yunxi.mes.module.heli.service.plantask.PlanTaskService; + +@Tag(name = "管理后台 - 生产计划任务") +@RestController +@RequestMapping("/heli/plan-task") +@Validated +public class PlanTaskController { + + @Resource + private PlanTaskService planTaskService; + + @Resource + private OperateLogFrameworkService operateLogFrameworkService; + + @Resource + private HttpServletRequest request; + + @PostMapping("/create") + @Operation(summary = "创建生产计划任务") + @PreAuthorize("@ss.hasPermission('heli:plan-task:create')") + public CommonResult createPlanTask(@Valid @RequestBody PlanTaskSaveReqVO createReqVO) { + return success(planTaskService.createPlanTask(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新生产计划任务") + @PreAuthorize("@ss.hasPermission('heli:plan-task:update')") + public CommonResult updatePlanTask(@Valid @RequestBody PlanTaskSaveReqVO updateReqVO) { + LocalDateTime startTime = LocalDateTime.now(); + planTaskService.updatePlanTask(updateReqVO); + + // 手动记录日志 + operateLogFrameworkService.createOperateLog(request, + startTime, + BusinesTypeEnum.PLAN_TASK.name(), + updateReqVO.getId(), + OperateTypeEnum.valueOf(updateReqVO.getActive()).getType(), + ""); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除生产计划任务") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:plan-task:delete')") + public CommonResult deletePlanTask(@RequestParam("id") Long id) { + planTaskService.deletePlanTask(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得生产计划任务") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:plan-task:query')") + public CommonResult getPlanTask(@RequestParam("id") Long id) { + PlanTaskDO planTask = planTaskService.getPlanTask(id); + return success(BeanUtils.toBean(planTask, PlanTaskRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得生产计划任务分页") + @PreAuthorize("@ss.hasPermission('heli:plan-task:query')") + public CommonResult> getPlanTaskPage(@Valid PlanTaskPageReqVO pageReqVO) { + PageResult pageResult = planTaskService.getPlanTaskPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, PlanTaskRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出生产计划任务 Excel") + @PreAuthorize("@ss.hasPermission('heli:plan-task:export')") + @OperateLog(type = EXPORT) + public void exportPlanTaskExcel(@Valid PlanTaskPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = planTaskService.getPlanTaskPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "生产计划任务.xls", "数据", PlanTaskRespVO.class, + BeanUtils.toBean(list, PlanTaskRespVO.class)); + } + + @GetMapping("/get-version-status") + @Operation(summary = "获得bom需要更新的状态") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:plan-task:query')") + public CommonResult getPlanTaskBomStatus(@RequestParam("id") Long id) { + return success(planTaskService.getPlanTaskBomStatus(id)); + } + + @GetMapping("/refresh") + @Operation(summary = "刷新生产计划任务单最新数据") + @Parameter(name = "id", description = "生产计划id", required = true) + @PreAuthorize("@ss.hasPermission('heli:plan-task:query')") + public CommonResult refreshPlanTaskByPlanId(@RequestParam("id") Long id) { + return success(planTaskService.refreshPlanTaskByPlanId(id)); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskPageReqVO.java new file mode 100644 index 00000000..b06c1025 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskPageReqVO.java @@ -0,0 +1,68 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantask.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 生产计划任务分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PlanTaskPageReqVO extends PageParam { + + @Schema(description = "自增字段,唯一") + private Long id; + + @Schema(description = "项目id") + private Long projectId; + + @Schema(description = "生产计划id") + private Long projectPlanId; + + @Schema(description = "生产计划子项目id") + private Long projectPlanSubId; + + @Schema(description = "工艺bomid") + private Long processBomId; + + @Schema(description = "生产计划编号,唯一") + private String taskNo; + + @Schema(description = "bom版本号") + private Integer bomVersion; + + @Schema(description = "备注") + private String description; + + @Schema(description = "状态,1已保存,2已提交,3已终止 ,默认是1") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "生产计划单号") + private String planNo; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "子项目名称") + private String projectSubName; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskRespVO.java new file mode 100644 index 00000000..fb1a9b9e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskRespVO.java @@ -0,0 +1,88 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantask.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 生产计划任务 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PlanTaskRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "项目id") + @ExcelProperty("项目id") + private Long projectId; + + @Schema(description = "生产计划id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("生产计划id") + private Long projectPlanId; + + @Schema(description = "生产计划子项目id") + @ExcelProperty("生产计划子项目id") + private Long projectPlanSubId; + + @Schema(description = "工艺bomid") + @ExcelProperty("工艺bomid") + private Long processBomId; + + @Schema(description = "生产计划编号,唯一") + @ExcelProperty("生产计划编号,唯一") + private String taskNo; + + @Schema(description = "bom版本号") + @ExcelProperty("bom版本号") + private Integer bomVersion; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String description; + + @Schema(description = "状态,1已保存,2已提交,3已终止 ,默认是1") + @ExcelProperty("状态,1已保存,2已提交,3已终止 ,默认是1") + private Integer status; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "客户名称") + @ExcelProperty("客户名称") + private String customerName; + + @Schema(description = "项目编号") + @ExcelProperty("项目编号") + private String projectCode; + + @Schema(description = "项目名称") + @ExcelProperty("项目名称") + private String projectName; + + @Schema(description = "生产计划编号") + @ExcelProperty("生产计划编号") + private String planNo; + + @Schema(description = "子项目编号") + @ExcelProperty("子项目编号") + private String projectSubCode; + + @Schema(description = "子项目名称") + @ExcelProperty("子项目名称") + private String projectSubName; + + @Schema(description = "项目结束时间") + @ExcelProperty("项目结束时间") + private LocalDateTime projectEndTime; + + @Schema(description = "bom编号") + @ExcelProperty("bom编号") + private String bomCode; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskSaveReqVO.java new file mode 100644 index 00000000..683f87cc --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantask/vo/PlanTaskSaveReqVO.java @@ -0,0 +1,49 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantask.vo; + +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; + +@Schema(description = "管理后台 - 生产计划任务新增/修改 Request VO") +@Data +public class PlanTaskSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "项目id") + private Long projectId; + + @Schema(description = "生产计划id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "生产计划id不能为空") + private Long projectPlanId; + + @Schema(description = "生产计划子项目id") + private Long projectPlanSubId; + + @Schema(description = "工艺bomid") + private Long processBomId; + + @Schema(description = "生产计划编号,唯一") + private String taskNo; + + @Schema(description = "bom版本号") + private Integer bomVersion; + + @Schema(description = "备注") + private String description; + + @Schema(description = "状态,1已保存,2已提交,3已终止 ,默认是1") + private Integer status; + + @Schema(description = "操作类型") + private String active; + + @Schema(description = "工艺bom明细列表") + private List bomDetails; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/PlanTaskBomController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/PlanTaskBomController.java new file mode 100644 index 00000000..a9c78f8d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/PlanTaskBomController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; +import com.chanko.yunxi.mes.module.heli.service.plantaskbom.PlanTaskBomService; + +@Tag(name = "管理后台 - 生产计划任务Bom") +@RestController +@RequestMapping("/heli/plan-task-bom") +@Validated +public class PlanTaskBomController { + + @Resource + private PlanTaskBomService planTaskBomService; + + @PostMapping("/create") + @Operation(summary = "创建生产计划任务Bom") + @PreAuthorize("@ss.hasPermission('heli:plan-task-bom:create')") + public CommonResult createPlanTaskBom(@Valid @RequestBody PlanTaskBomSaveReqVO createReqVO) { + return success(planTaskBomService.createPlanTaskBom(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新生产计划任务Bom") + @PreAuthorize("@ss.hasPermission('heli:plan-task-bom:update')") + public CommonResult updatePlanTaskBom(@Valid @RequestBody PlanTaskBomSaveReqVO updateReqVO) { + planTaskBomService.updatePlanTaskBom(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除生产计划任务Bom") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:plan-task-bom:delete')") + public CommonResult deletePlanTaskBom(@RequestParam("id") Long id) { + planTaskBomService.deletePlanTaskBom(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得生产计划任务Bom") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:plan-task-bom:query')") + public CommonResult getPlanTaskBom(@RequestParam("id") Long id) { + PlanTaskBomDO planTaskBom = planTaskBomService.getPlanTaskBom(id); + return success(BeanUtils.toBean(planTaskBom, PlanTaskBomRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得生产计划任务Bom分页") + @PreAuthorize("@ss.hasPermission('heli:plan-task-bom:query')") + public CommonResult> getPlanTaskBomPage(@Valid PlanTaskBomPageReqVO pageReqVO) { + PageResult pageResult = planTaskBomService.getPlanTaskBomPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, PlanTaskBomRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出生产计划任务Bom Excel") + @PreAuthorize("@ss.hasPermission('heli:plan-task-bom:export')") + @OperateLog(type = EXPORT) + public void exportPlanTaskBomExcel(@Valid PlanTaskBomPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = planTaskBomService.getPlanTaskBomPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "生产计划任务Bom.xls", "数据", PlanTaskBomRespVO.class, + BeanUtils.toBean(list, PlanTaskBomRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomPageReqVO.java new file mode 100644 index 00000000..4642f4cb --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomPageReqVO.java @@ -0,0 +1,51 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom.vo; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 生产计划任务Bom分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PlanTaskBomPageReqVO extends PageParam { + + @Schema(description = "自增字段,唯一") + private Long id; + + @Schema(description = "生产任务id") + private Long taskId; + + @Schema(description = "bom明细id") + private Long bomDetailId; + + @Schema(description = "负责人") + private String owner; + + @Schema(description = "要求完成日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] requireEndDate; + + @Schema(description = "项目id") + private Long projectId; + + @Schema(description = "子项目id") + private Long projectSubId; + + @Schema(description = "零件类型 1 标准件|2 其它") + private String materialType; + + private Long projectPlanId; + + private Long projectPlanSubId; + + private Boolean sortByBlueprintNo; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomRespVO.java new file mode 100644 index 00000000..b6d7d692 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomRespVO.java @@ -0,0 +1,69 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 生产计划任务Bom Response VO") +@Data +@ExcelIgnoreUnannotated +public class PlanTaskBomRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "生产任务id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("生产任务id") + private Long taskId; + + @Schema(description = "bom明细id", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("bom明细id") + private Long bomDetailId; + + @Schema(description = "负责人") + @ExcelProperty("负责人") + private String owner; + + @Schema(description = "要求完成日期") + @ExcelProperty("要求完成日期") + private LocalDateTime requireEndDate; + + @Schema(description = "零件名称") + private String materialName; + + @Schema(description = "物料名称") + private String compositionName; + + @Schema(description = "图号") + private String blueprintNo; + + @Schema(description = "零件类型 1 标准件|2 其它") + private String type; + + @Schema(description = "物料id") + private Long materialId; + + @Schema(description = "物料编码") + private String materialCode; + + @Schema(description = "材质id") + private Long compositionId; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "数量") + private Integer amount; + + @Schema(description = "负责人名称") + private String ownerName; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomSaveReqVO.java new file mode 100644 index 00000000..4dcfc998 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/plantaskbom/vo/PlanTaskBomSaveReqVO.java @@ -0,0 +1,32 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 生产计划任务Bom新增/修改 Request VO") +@Data +public class PlanTaskBomSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "生产任务id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "生产任务id不能为空") + private Long taskId; + + @Schema(description = "bom明细id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "bom明细id不能为空") + private Long bomDetailId; + + @Schema(description = "负责人") + private String owner; + + @Schema(description = "要求完成日期") + private LocalDateTime requireEndDate; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/ProcessBomController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/ProcessBomController.java index c81537b9..f50b4cb8 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/ProcessBomController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/ProcessBomController.java @@ -133,4 +133,12 @@ public class ProcessBomController { return success(processBomService.getProcessBomDetailListByBomId(bomId)); } + @DeleteMapping("/process-bom-detail/delete") + @Operation(summary = "删除工艺bom明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:process-bom:delete')") + public CommonResult deleteProcessBomDetail(@RequestParam("id") Long id) { + processBomService.deleteProcessBomDetail(id); + return success(true); + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/vo/ProcessBomRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/vo/ProcessBomRespVO.java index 7dec5645..fba81f64 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/vo/ProcessBomRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processbom/vo/ProcessBomRespVO.java @@ -1,14 +1,13 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; @Schema(description = "管理后台 - 工艺bom Response VO") @Data @@ -76,4 +75,7 @@ public class ProcessBomRespVO { @Schema(description = "项目名称") private String projectName; + @Schema(description = "bom编号") + private String bomCode; + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignRespVO.java index 4508ff79..edf9fe07 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/processdesign/vo/ProcessDesignRespVO.java @@ -123,4 +123,7 @@ public class ProcessDesignRespVO { @Schema(description = "最新进度") private BigDecimal progress; + @Schema(description = "项目状态") + private Integer planStatus; + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/ProjectOrderController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/ProjectOrderController.java index 4a090cbb..88c4dc30 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/ProjectOrderController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/ProjectOrderController.java @@ -8,9 +8,7 @@ import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; import com.chanko.yunxi.mes.framework.operatelog.core.service.OperateLogFrameworkService; -import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO; -import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderRespVO; -import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSaveReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.*; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; @@ -136,8 +134,8 @@ public class ProjectOrderController { pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); List list = projectOrderService.getProjectOrderPage(pageReqVO).getList(); // 导出 Excel - ExcelUtils.write(response, "项目订单.xls", "数据", ProjectOrderRespVO.class, - BeanUtils.toBean(list, ProjectOrderRespVO.class)); + ExcelUtils.write(response, "项目订单.xls", "数据", ProjectOrderExportVO.class, + BeanUtils.toBean(list, ProjectOrderExportVO.class)); } // ==================== 子表(项目订单子项目) ==================== @@ -150,4 +148,21 @@ public class ProjectOrderController { return success(projectOrderService.getProjectOrderSubListByProjectOrderId(projectOrderId)); } + @DeleteMapping("/project-order-sub/delete") + @Operation(summary = "删除项目订单子项目") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:project-order:delete')") + public CommonResult deleteProjectOrderSub(@RequestParam("id") Long id) { + projectOrderService.deleteProjectOrderSub(id); + return success(true); + } + + @GetMapping("/project-order-sub/page") + @Operation(summary = "获得项目订单子项分页") + @PreAuthorize("@ss.hasPermission('heli:project-order:query')") + public CommonResult> getProjectOrderSubPage(@Valid ProjectOrderSubPageReqVO pageReqVO) { + PageResult pageResult = projectOrderService.getProjectOrderSubPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ProjectOrderSubRespVO.class)); + } + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderExportVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderExportVO.java new file mode 100644 index 00000000..89f327fe --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderExportVO.java @@ -0,0 +1,70 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; +import com.chanko.yunxi.mes.framework.excel.core.convert.TimestampToDateConvert; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 项目订单 Export VO") +@Data +@ExcelIgnoreUnannotated +public class ProjectOrderExportVO { + + @Schema(description = "项目编号,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("项目编号") + private String code; + + @Schema(description = "订单日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "订单日期", converter = TimestampToDateConvert.class) + private LocalDateTime orderTime; + + @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "27214") + @ExcelProperty("客户名称") + private String customerName; + + @Schema(description = "合同编号") + @ExcelProperty("合同编号") + private String contractNo; + + @Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @ExcelProperty("项目名称") + private String projectName; + + @Schema(description = "是否有价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "28491") + @ExcelProperty(value = "是否有价格", converter = DictConvert.class) + @DictFormat("heli_common_is_or_not") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer hasPrice; + + @Schema(description = "是否紧急", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "是否紧急", converter = DictConvert.class) + @DictFormat("heli_common_is_or_not") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer isUrgency; + + @Schema(description = "性质", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "性质", converter = DictConvert.class) + @DictFormat("heli_project_property") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer property; + + @Schema(description = "项目开始时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "项目开始时间", converter = TimestampToDateConvert.class) + private LocalDateTime projectStartTime; + + @Schema(description = "项目结束时间") + @ExcelProperty(value = "项目结束时间", converter = TimestampToDateConvert.class) + private LocalDateTime projectEndTime; + + @Schema(description = "单据状态 已保存/已送审/已审核/已启动/已打回/已终止", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty(value = "单据状态", converter = DictConvert.class) + @DictFormat("heli_project_order_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer orderStatus; + + @Schema(description = "发货状态 未发货/部分发货/全部发货", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty(value = "发货状态", converter = DictConvert.class) + @DictFormat("heli_delivery_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer deliveryStatus; +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderPageReqVO.java index 3fc97eb9..a4454a2c 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderPageReqVO.java @@ -133,4 +133,7 @@ public class ProjectOrderPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] snapshotOrderTime; + @Schema(description = "id列表") + private List idList; + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderSubPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderSubPageReqVO.java new file mode 100644 index 00000000..89c88ef4 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderSubPageReqVO.java @@ -0,0 +1,26 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "管理后台 - 项目订单分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProjectOrderSubPageReqVO extends PageParam { + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "项目名称", example = "赵六") + private String projectName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "子项目名称", example = "赵六") + private String projectSubName; +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderSubRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderSubRespVO.java new file mode 100644 index 00000000..d914746c --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/projectorder/vo/ProjectOrderSubRespVO.java @@ -0,0 +1,32 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 项目订单子项 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ProjectOrderSubRespVO { + + @Schema(description = "项目订单id") + private Long projectId; + + @Schema(description = "项目订单子项id") + private Long projectSubId; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "项目名称", example = "赵六") + private String projectName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "子项目名称", example = "赵六") + private String projectSubName; + + @Schema(description = "客户名称", example = "赵六") + private String customerName; +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/PurchaseOrderBoomController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/PurchaseOrderBoomController.java new file mode 100644 index 00000000..359d5b85 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/PurchaseOrderBoomController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO; +import com.chanko.yunxi.mes.module.heli.service.purchaseorderboom.PurchaseOrderBoomService; + +@Tag(name = "管理后台 - 采购订单加工件明细") +@RestController +@RequestMapping("/heli/purchase-order-boom") +@Validated +public class PurchaseOrderBoomController { + + @Resource + private PurchaseOrderBoomService purchaseOrderBoomService; + + @PostMapping("/create") + @Operation(summary = "创建采购订单加工件明细") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-boom:create')") + public CommonResult createPurchaseOrderBoom(@Valid @RequestBody PurchaseOrderBoomSaveReqVO createReqVO) { + return success(purchaseOrderBoomService.createPurchaseOrderBoom(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新采购订单加工件明细") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-boom:update')") + public CommonResult updatePurchaseOrderBoom(@Valid @RequestBody PurchaseOrderBoomSaveReqVO updateReqVO) { + purchaseOrderBoomService.updatePurchaseOrderBoom(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除采购订单加工件明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:purchase-order-boom:delete')") + public CommonResult deletePurchaseOrderBoom(@RequestParam("id") Long id) { + purchaseOrderBoomService.deletePurchaseOrderBoom(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得采购订单加工件明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-boom:query')") + public CommonResult getPurchaseOrderBoom(@RequestParam("id") Long id) { + PurchaseOrderBoomDO purchaseOrderBoom = purchaseOrderBoomService.getPurchaseOrderBoom(id); + return success(BeanUtils.toBean(purchaseOrderBoom, PurchaseOrderBoomRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得采购订单加工件明细分页") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-boom:query')") + public CommonResult> getPurchaseOrderBoomPage(@Valid PurchaseOrderBoomPageReqVO pageReqVO) { + PageResult pageResult = purchaseOrderBoomService.getPurchaseOrderBoomPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, PurchaseOrderBoomRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出采购订单加工件明细 Excel") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-boom:export')") + @OperateLog(type = EXPORT) + public void exportPurchaseOrderBoomExcel(@Valid PurchaseOrderBoomPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = purchaseOrderBoomService.getPurchaseOrderBoomPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "采购订单加工件明细.xls", "数据", PurchaseOrderBoomRespVO.class, + BeanUtils.toBean(list, PurchaseOrderBoomRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomPageReqVO.java new file mode 100644 index 00000000..e159b68e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomPageReqVO.java @@ -0,0 +1,64 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 采购订单加工件明细分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class PurchaseOrderBoomPageReqVO extends PageParam { + + @Schema(description = "自增字段,唯一") + private Long id; + + @Schema(description = "采购单编号") + private Long purchaseOrderId; + + @Schema(description = "加工件boom detail id") + private Long boomDetailId; + + @Schema(description = "零件名称") + private String boomName; + + @Schema(description = "规格型号") + private String boomSpec; + + @Schema(description = "系统单位") + private Integer boomUnit; + + @Schema(description = "材质") + private String composition; + + @Schema(description = "采购数量") + private BigDecimal purchaseAmount; + + @Schema(description = "暂估价金额") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额") + private BigDecimal actualPrice; + + @Schema(description = "预计到期日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] arriveTime; + + @Schema(description = "需求到期日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] requireTime; + + @Schema(description = "备注") + private String description; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomRespVO.java new file mode 100644 index 00000000..b9ebe2e2 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomRespVO.java @@ -0,0 +1,77 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 采购订单加工件明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class PurchaseOrderBoomRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "采购单编号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("采购单编号") + private Long purchaseOrderId; + + @Schema(description = "加工件boom detail id") + @ExcelProperty("加工件boom detail id") + private Long boomDetailId; + + @Schema(description = "零件名称") + @ExcelProperty("零件名称") + private String boomName; + + @Schema(description = "规格型号") + @ExcelProperty("规格型号") + private String boomSpec; + + @Schema(description = "系统单位") + @ExcelProperty("系统单位") + private Integer boomUnit; + + @Schema(description = "材质") + @ExcelProperty("材质") + private String composition; + + @Schema(description = "采购数量") + @ExcelProperty("采购数量") + private BigDecimal purchaseAmount; + + @Schema(description = "需求数量") + @ExcelProperty("需求数量") + private BigDecimal boomAmount; + + @Schema(description = "暂估价金额") + @ExcelProperty("暂估价金额") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额") + @ExcelProperty("实际价金额") + private BigDecimal actualPrice; + + @Schema(description = "预计到期日期") + @ExcelProperty("预计到期日期") + private LocalDateTime arriveTime; + + @Schema(description = "需求到期日期") + @ExcelProperty("需求到期日期") + private LocalDateTime requireTime; + + @Schema(description = "备注") + @ExcelProperty("备注") + private String description; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomSaveReqVO.java new file mode 100644 index 00000000..7d312f8c --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseorderboom/vo/PurchaseOrderBoomSaveReqVO.java @@ -0,0 +1,59 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 采购订单加工件明细新增/修改 Request VO") +@Data +public class PurchaseOrderBoomSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "采购单编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "采购单编号不能为空") + private Long purchaseOrderId; + + @Schema(description = "加工件boom detail id") + private Long boomDetailId; + + @Schema(description = "零件名称") + private String boomName; + + @Schema(description = "规格型号") + private String boomSpec; + + @Schema(description = "系统单位") + private Integer boomUnit; + + @Schema(description = "材质") + private String composition; + + @Schema(description = "采购数量") + private BigDecimal purchaseAmount; + + @Schema(description = "需求数量") + private BigDecimal boomAmount; + + @Schema(description = "暂估价金额") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额") + private BigDecimal actualPrice; + + @Schema(description = "预计到期日期") + private LocalDateTime arriveTime; + + @Schema(description = "需求到期日期") + private LocalDateTime requireTime; + + @Schema(description = "备注") + private String description; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/PurchaseOrderMaterialController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/PurchaseOrderMaterialController.java index c942b26a..de6c1681 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/PurchaseOrderMaterialController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/PurchaseOrderMaterialController.java @@ -1,95 +1,99 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial; - -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import javax.validation.constraints.*; -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; -import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; - -import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; - -import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; -import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; - -import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO; -import com.chanko.yunxi.mes.module.heli.service.purchaseordermaterial.PurchaseOrderMaterialService; - -@Tag(name = "管理后台 - 采购单物料") -@RestController -@RequestMapping("/heli/purchase-order-material") -@Validated -public class PurchaseOrderMaterialController { - - @Resource - private PurchaseOrderMaterialService purchaseOrderMaterialService; - - @PostMapping("/create") - @Operation(summary = "创建采购单物料") - @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:create')") - public CommonResult createPurchaseOrderMaterial(@Valid @RequestBody PurchaseOrderMaterialSaveReqVO createReqVO) { - return success(purchaseOrderMaterialService.createPurchaseOrderMaterial(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新采购单物料") - @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:update')") - public CommonResult updatePurchaseOrderMaterial(@Valid @RequestBody PurchaseOrderMaterialSaveReqVO updateReqVO) { - purchaseOrderMaterialService.updatePurchaseOrderMaterial(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除采购单物料") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:delete')") - public CommonResult deletePurchaseOrderMaterial(@RequestParam("id") Long id) { - purchaseOrderMaterialService.deletePurchaseOrderMaterial(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得采购单物料") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:query')") - public CommonResult getPurchaseOrderMaterial(@RequestParam("id") Long id) { - PurchaseOrderMaterialDO purchaseOrderMaterial = purchaseOrderMaterialService.getPurchaseOrderMaterial(id); - return success(BeanUtils.toBean(purchaseOrderMaterial, PurchaseOrderMaterialRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得采购单物料分页") - @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:query')") - public CommonResult> getPurchaseOrderMaterialPage(@Valid PurchaseOrderMaterialPageReqVO pageReqVO) { - PageResult pageResult = purchaseOrderMaterialService.getPurchaseOrderMaterialPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, PurchaseOrderMaterialRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出采购单物料 Excel") - @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:export')") - @OperateLog(type = EXPORT) - public void exportPurchaseOrderMaterialExcel(@Valid PurchaseOrderMaterialPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = purchaseOrderMaterialService.getPurchaseOrderMaterialPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "采购单物料.xls", "数据", PurchaseOrderMaterialRespVO.class, - BeanUtils.toBean(list, PurchaseOrderMaterialRespVO.class)); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial; + +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO; +import com.chanko.yunxi.mes.module.heli.service.purchaseorder.PurchaseOrderService; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO; +import com.chanko.yunxi.mes.module.heli.service.purchaseordermaterial.PurchaseOrderMaterialService; + +@Tag(name = "管理后台 - 采购单物料") +@RestController +@RequestMapping("/heli/purchase-order-material") +@Validated +public class PurchaseOrderMaterialController { + + @Resource + private PurchaseOrderMaterialService purchaseOrderMaterialService; + + + @PostMapping("/create") + @Operation(summary = "创建采购单物料") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:create')") + public CommonResult createPurchaseOrderMaterial(@Valid @RequestBody PurchaseOrderMaterialSaveReqVO createReqVO) { + return success(purchaseOrderMaterialService.createPurchaseOrderMaterial(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新采购单物料") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:update')") + public CommonResult updatePurchaseOrderMaterial(@Valid @RequestBody PurchaseOrderMaterialSaveReqVO updateReqVO) { + purchaseOrderMaterialService.updatePurchaseOrderMaterial(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除采购单物料") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:delete')") + public CommonResult deletePurchaseOrderMaterial(@RequestParam("id") Long id) { + purchaseOrderMaterialService.deletePurchaseOrderMaterial(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得采购单物料") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:query')") + public CommonResult getPurchaseOrderMaterial(@RequestParam("id") Long id) { + PurchaseOrderMaterialDO purchaseOrderMaterial = purchaseOrderMaterialService.getPurchaseOrderMaterial(id); + return success(BeanUtils.toBean(purchaseOrderMaterial, PurchaseOrderMaterialRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得采购单物料分页") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:query')") + public CommonResult> getPurchaseOrderMaterialPage(@Valid PurchaseOrderMaterialPageReqVO pageReqVO) { + PageResult pageResult = purchaseOrderMaterialService.getPurchaseOrderMaterialPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, PurchaseOrderMaterialRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出采购单物料 Excel") + @PreAuthorize("@ss.hasPermission('heli:purchase-order-material:export')") + @OperateLog(type = EXPORT) + public void exportPurchaseOrderMaterialExcel(@Valid PurchaseOrderMaterialPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = purchaseOrderMaterialService.getPurchaseOrderMaterialPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "采购单物料.xls", "数据", PurchaseOrderMaterialRespVO.class, + BeanUtils.toBean(list, PurchaseOrderMaterialRespVO.class)); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/vo/PurchaseOrderMaterialRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/vo/PurchaseOrderMaterialRespVO.java index d04b44d5..c09063df 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/vo/PurchaseOrderMaterialRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/purchaseordermaterial/vo/PurchaseOrderMaterialRespVO.java @@ -75,4 +75,17 @@ public class PurchaseOrderMaterialRespVO { @ExcelProperty("物料类型") private String matType; + @Schema(description = "库存数量") + @ExcelProperty("库存数量") + private BigDecimal matRest; + + @Schema(description = "需求数量") + @ExcelProperty("需求数量") + private BigDecimal requireAmount; + + @Schema(description = "需求到货日期") + @ExcelProperty("需求到货日期") + private LocalDateTime requireArriveTime; + + } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/QualityFeedbackController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/QualityFeedbackController.java new file mode 100644 index 00000000..082ccb19 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/QualityFeedbackController.java @@ -0,0 +1,92 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback; + +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo.QualityFeedbackPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo.QualityFeedbackRespVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo.QualityFeedbackSaveReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.qualityfeedback.QualityFeedbackDO; +import com.chanko.yunxi.mes.module.heli.service.qualityfeedback.QualityFeedbackService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.List; + +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 客户反馈质量") +@RestController +@RequestMapping("/heli/quality-feedback") +@Validated +public class QualityFeedbackController { + + @Resource + private QualityFeedbackService qualityFeedbackService; + + @PostMapping("/create") + @Operation(summary = "创建客户反馈质量") + @PreAuthorize("@ss.hasPermission('heli:quality-feedback:create')") + public CommonResult createQualityFeedback(@Valid @RequestBody QualityFeedbackSaveReqVO createReqVO) { + return success(qualityFeedbackService.createQualityFeedback(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新客户反馈质量") + @PreAuthorize("@ss.hasPermission('heli:quality-feedback:update')") + public CommonResult updateQualityFeedback(@Valid @RequestBody QualityFeedbackSaveReqVO updateReqVO) { + return success(qualityFeedbackService.updateQualityFeedback(updateReqVO)); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除客户反馈质量") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:quality-feedback:delete')") + public CommonResult deleteQualityFeedback(@RequestParam("id") Long id) { + qualityFeedbackService.deleteQualityFeedback(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得客户反馈质量") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:quality-feedback:query')") + public CommonResult getQualityFeedback(@RequestParam("id") Long id) { + QualityFeedbackDO qualityFeedback = qualityFeedbackService.getQualityFeedback(id); + return success(BeanUtils.toBean(qualityFeedback, QualityFeedbackRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得客户反馈质量分页") + @PreAuthorize("@ss.hasPermission('heli:quality-feedback:query')") + public CommonResult> getQualityFeedbackPage(@Valid QualityFeedbackPageReqVO pageReqVO) { + PageResult pageResult = qualityFeedbackService.getQualityFeedbackPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, QualityFeedbackRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出客户反馈质量 Excel") + @PreAuthorize("@ss.hasPermission('heli:quality-feedback:export')") + @OperateLog(type = EXPORT) + public void exportQualityFeedbackExcel(@Valid QualityFeedbackPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = qualityFeedbackService.getQualityFeedbackPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "客户反馈质量.xls", "数据", QualityFeedbackRespVO.class, + BeanUtils.toBean(list, QualityFeedbackRespVO.class)); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackPageReqVO.java new file mode 100644 index 00000000..17782055 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackPageReqVO.java @@ -0,0 +1,52 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 客户反馈质量分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class QualityFeedbackPageReqVO extends PageParam { + + @Schema(description = "项目订单id", example = "22876") + private Long projectId; + + @Schema(description = "子项目id", example = "8582") + private Long projectSubId; + + @Schema(description = "反馈人") + private String feedbacker; + + @Schema(description = "联系电话") + private String mobile; + + @Schema(description = "反馈内容", example = "你猜") + private String remark; + + @Schema(description = "状态,1表示正常,2表示禁用", example = "2") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "子项目名称") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackRespVO.java new file mode 100644 index 00000000..3906b80a --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackRespVO.java @@ -0,0 +1,73 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 客户反馈质量 Response VO") +@Data +@ExcelIgnoreUnannotated +public class QualityFeedbackRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "17478") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "项目订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22876") + @ExcelProperty("项目订单id") + private Long projectId; + + @Schema(description = "子项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8582") + @ExcelProperty("子项目id") + private Long projectSubId; + + @Schema(description = "反馈人") + @ExcelProperty("反馈人") + private String feedbacker; + + @Schema(description = "联系电话") + @ExcelProperty("联系电话") + private String mobile; + + @Schema(description = "反馈内容", example = "你猜") + @ExcelProperty("反馈内容") + private String remark; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("状态,1表示正常,2表示禁用") + private Integer status; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @ExcelProperty("更新时间") + private LocalDateTime updateTime; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "子项目编号") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "创建人名称") + private String creatorName; + + @Schema(description = "更新人名称") + private String updaterName; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackSaveReqVO.java new file mode 100644 index 00000000..9e42e7bf --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualityfeedback/vo/QualityFeedbackSaveReqVO.java @@ -0,0 +1,37 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; + +@Schema(description = "管理后台 - 客户反馈质量新增/修改 Request VO") +@Data +public class QualityFeedbackSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "17478") + private Long id; + + @Schema(description = "项目订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22876") + @NotNull(message = "项目订单id不能为空") + private Long projectId; + + @Schema(description = "子项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8582") + @NotNull(message = "子项目id不能为空") + private Long projectSubId; + + @Schema(description = "反馈人") + private String feedbacker; + + @Schema(description = "联系电话") + private String mobile; + + @Schema(description = "反馈内容", example = "你猜") + private String remark; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/QualityManagementController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/QualityManagementController.java new file mode 100644 index 00000000..1b83715c --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/QualityManagementController.java @@ -0,0 +1,56 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement; + +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderRespVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo.InspectionReportPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo.InspectionReportRespVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.service.qualitymanagement.QualityManagementService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +/** + * 质量管理 + * + * @author chenxi + * @date 2024-03-11 11:13 + */ +@Tag(name = "管理后台 - 质量管理") +@RestController +@RequestMapping("/heli/quality-management") +@Validated +public class QualityManagementController { + + @Resource + private QualityManagementService qualityManagementService; + + @GetMapping("/inspection-report/page") + @Operation(summary = "获得检验报告分页") + public CommonResult> getInspectionReportPage(@Valid InspectionReportPageReqVO pageReqVO) { + PageResult pageResult = qualityManagementService.getInspectionReportPage(pageReqVO); + return success(pageResult); + } + + @GetMapping("/inspection-report/get") + @Operation(summary = "获得检验报告") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getInspectionReport(@RequestParam("id") Long id) { + InspectionReportRespVO inspectionReport = qualityManagementService.getInspectionReport(id); + return success(inspectionReport); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/vo/InspectionReportPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/vo/InspectionReportPageReqVO.java new file mode 100644 index 00000000..af35e7ef --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/vo/InspectionReportPageReqVO.java @@ -0,0 +1,27 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "管理后台 - 检验报告分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class InspectionReportPageReqVO extends PageParam { + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "子项目名称") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/vo/InspectionReportRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/vo/InspectionReportRespVO.java new file mode 100644 index 00000000..8eec510f --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/qualitymanagement/vo/InspectionReportRespVO.java @@ -0,0 +1,39 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 检验报告 Response VO") +@Data +@ExcelIgnoreUnannotated +public class InspectionReportRespVO { + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19610") + @ExcelProperty("项目id") + private Long projectId; + + @Schema(description = "子项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21985") + @ExcelProperty("子项目id") + private Long projectSubId; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "子项目编号") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "附件数量") + private Integer attachmentCount; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/StorageLogController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/StorageLogController.java index 8ebe9aa4..4bc62f29 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/StorageLogController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/StorageLogController.java @@ -2,6 +2,7 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.storagelog; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogAll.StorageLogAllDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -82,6 +83,30 @@ public class StorageLogController { return success(pageResult); } + @GetMapping("/page-now-all") + @Operation(summary = "获得入/出库日志分页") + @PreAuthorize("@ss.hasPermission('heli:storage-log:query')") + public CommonResult> getStorageLogPageAll(@Valid StorageLogPageReqVO pageReqVO) { + PageResult pageResult = storageLogService.getStorageNowPageAll(pageReqVO); + return success(pageResult); + } + + @GetMapping("/page-material") + @Operation(summary = "获得入/出库日志分页") + @PreAuthorize("@ss.hasPermission('heli:storage-log:query')") + public CommonResult> getStorageLogPageInMaterial(@Valid StorageLogPageReqVO pageReqVO) { + PageResult pageResult = storageLogService.getStorageNowPageInMaterial(pageReqVO); + return success(pageResult); + } + + @GetMapping("/page-material-group") + @Operation(summary = "获得入/出库日志分页") + @PreAuthorize("@ss.hasPermission('heli:storage-log:query')") + public CommonResult> getStorageLogPageGroupMaterial(@Valid StorageLogPageReqVO pageReqVO) { + PageResult pageResult = storageLogService.getStorageNowPageGroupMaterial(pageReqVO); + return success(pageResult); + } + @GetMapping("/now") @Operation(summary = "获得入/出库实时分页") @PreAuthorize("@ss.hasPermission('heli:storage-log:query')") diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageLogPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageLogPageReqVO.java index 17ce94fd..d9dd83b9 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageLogPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageLogPageReqVO.java @@ -25,6 +25,9 @@ public class StorageLogPageReqVO extends PageParam { @Schema(description = "物料类型") private String matType; + @Schema(description = "物料类型") + private String matSpec; + @Schema(description = "批次号") private String lotNo; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageNowAllReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageNowAllReqVO.java index 4df742a7..c3e79bf5 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageNowAllReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagelog/vo/StorageNowAllReqVO.java @@ -16,6 +16,9 @@ public class StorageNowAllReqVO { @Schema(description = "物料类型") private String matType; + @Schema(description = "物料型号") + private String matSpec; + @Schema(description = "是否排除库存为0的物料") private Integer noZero; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/vo/StorageMatRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/vo/StorageMatRespVO.java index f3099b86..052321e9 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/vo/StorageMatRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/vo/StorageMatRespVO.java @@ -50,6 +50,10 @@ public class StorageMatRespVO { @ExcelProperty("子项目编号") private String projectNo; + @Schema(description = "子项目名称") + @ExcelProperty("子项目名称") + private String projectSubName; + @Schema(description = "备注", example = "你猜") @ExcelProperty("备注") private String description; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/TaskDispatchController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/TaskDispatchController.java index 42eb73c6..03a51a8e 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/TaskDispatchController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/TaskDispatchController.java @@ -1,106 +1,161 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch; - -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import javax.validation.constraints.*; -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; -import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; - -import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; - -import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; -import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; - -import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetail.TaskDispatchDetailDO; -import com.chanko.yunxi.mes.module.heli.service.taskdispatch.TaskDispatchService; - -@Tag(name = "管理后台 - 派工单") -@RestController -@RequestMapping("/heli/task-dispatch") -@Validated -public class TaskDispatchController { - - @Resource - private TaskDispatchService taskDispatchService; - - @PostMapping("/create") - @Operation(summary = "创建派工单") - @PreAuthorize("@ss.hasPermission('heli:task-dispatch:create')") - public CommonResult createTaskDispatch(@Valid @RequestBody TaskDispatchSaveReqVO createReqVO) { - return success(taskDispatchService.createTaskDispatch(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新派工单") - @PreAuthorize("@ss.hasPermission('heli:task-dispatch:update')") - public CommonResult updateTaskDispatch(@Valid @RequestBody TaskDispatchSaveReqVO updateReqVO) { - taskDispatchService.updateTaskDispatch(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除派工单") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('heli:task-dispatch:delete')") - public CommonResult deleteTaskDispatch(@RequestParam("id") Long id) { - taskDispatchService.deleteTaskDispatch(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得派工单") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')") - public CommonResult getTaskDispatch(@RequestParam("id") Long id) { - TaskDispatchDO taskDispatch = taskDispatchService.getTaskDispatch(id); - return success(BeanUtils.toBean(taskDispatch, TaskDispatchRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得派工单分页") - @PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')") - public CommonResult> getTaskDispatchPage(@Valid TaskDispatchPageReqVO pageReqVO) { - PageResult pageResult = taskDispatchService.getTaskDispatchPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, TaskDispatchRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出派工单 Excel") - @PreAuthorize("@ss.hasPermission('heli:task-dispatch:export')") - @OperateLog(type = EXPORT) - public void exportTaskDispatchExcel(@Valid TaskDispatchPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = taskDispatchService.getTaskDispatchPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "派工单.xls", "数据", TaskDispatchRespVO.class, - BeanUtils.toBean(list, TaskDispatchRespVO.class)); - } - - // ==================== 子表(派工明细) ==================== - - @GetMapping("/task-dispatch-detail/list-by-dispatch-id") - @Operation(summary = "获得派工明细列表") - @Parameter(name = "dispatchId", description = "派工单id") - @PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')") - public CommonResult> getTaskDispatchDetailListByDispatchId(@RequestParam("dispatchId") Long dispatchId) { - return success(taskDispatchService.getTaskDispatchDetailListByDispatchId(dispatchId)); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch; + +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.framework.operatelog.core.service.OperateLogFrameworkService; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; +import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import com.chanko.yunxi.mes.module.heli.service.taskdispatch.TaskDispatchService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.List; + +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 派工单") +@RestController +@RequestMapping("/heli/task-dispatch") +@Validated +public class TaskDispatchController { + + @Resource + private TaskDispatchService taskDispatchService; + + @Resource + private OperateLogFrameworkService operateLogFrameworkService; + + @Resource + private HttpServletRequest request; + + @PostMapping("/create") + @Operation(summary = "创建派工单") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:create')") + public CommonResult createTaskDispatch(@Valid @RequestBody TaskDispatchSaveReqVO createReqVO) { + return success(taskDispatchService.createTaskDispatch(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新派工单") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:update')") + public CommonResult updateTaskDispatch(@Valid @RequestBody TaskDispatchSaveReqVO updateReqVO) { + taskDispatchService.updateTaskDispatch(updateReqVO); + return success(true); + } + + @PostMapping("/operate") + @Operation(summary = "操作派工单") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:update')") + @OperateLog(enable = false) + @Transactional(rollbackFor = Exception.class) + public CommonResult operate(@Valid @RequestBody TaskDispatchSaveReqVO operateReqVO) { + LocalDateTime startTime = LocalDateTime.now(); + taskDispatchService.operate(operateReqVO); + + // 手动记录日志 + operateLogFrameworkService.createOperateLog(request, + startTime, + BusinesTypeEnum.TASK_DISPATCH.name(), + operateReqVO.getId(), + OperateTypeEnum.valueOf(operateReqVO.getActive()).getType(), + operateReqVO.getActiveOpinion()); + + return success(operateReqVO.getId()); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除派工单") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:delete')") + public CommonResult deleteTaskDispatch(@RequestParam("id") Long id) { + taskDispatchService.deleteTaskDispatch(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得派工单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')") + public CommonResult getTaskDispatch(@RequestParam("id") Long id) { + TaskDispatchDO taskDispatch = taskDispatchService.getTaskDispatch(id); + return success(BeanUtils.toBean(taskDispatch, TaskDispatchRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得派工单分页") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')") + public CommonResult> getTaskDispatchPage(@Valid TaskDispatchPageReqVO pageReqVO) { + PageResult pageResult = taskDispatchService.getTaskDispatchPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, TaskDispatchRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出派工单 Excel") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:export')") + @OperateLog(type = EXPORT) + public void exportTaskDispatchExcel(@Valid TaskDispatchPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = taskDispatchService.getTaskDispatchPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "派工单.xls", "数据", TaskDispatchRespVO.class, + BeanUtils.toBean(list, TaskDispatchRespVO.class)); + } + + // ==================== 子表(派工明细) ==================== + + @GetMapping("/task-dispatch-detail/list-by-dispatch-id") + @Operation(summary = "获得派工明细列表") + @Parameter(name = "dispatchId", description = "派工单id") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')") + public CommonResult> getTaskDispatchDetailListByDispatchId(@RequestParam("dispatchId") Long dispatchId) { + return success(taskDispatchService.getTaskDispatchDetailListByDispatchId(dispatchId)); + } + + @DeleteMapping("/task-dispatch-detail/delete") + @Operation(summary = "删除派工单") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:delete')") + public CommonResult deleteTaskDispatchDetail(@RequestParam("id") Long id) { + taskDispatchService.deleteTaskDispatchDetail(id); + return success(true); + } + + @GetMapping("/task-dispatch-detail/page") + @Operation(summary = "获得派工明细分页") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:query')") + public CommonResult> getTaskDispatchPageDetail(@Valid TaskDispatchDetailPageReqVO pageReqVO) { + PageResult pageResult = taskDispatchService.getTaskDispatchDetailPage(pageReqVO); + return success(pageResult); + } + + @PostMapping("/task-dispatch-detail/operate") + @Operation(summary = "操作派工任务") + @PreAuthorize("@ss.hasPermission('heli:task-dispatch:update')") + @OperateLog(enable = false) + @Transactional(rollbackFor = Exception.class) + public CommonResult operateDetail(@Valid @RequestBody TaskDispatchDetailVO operateReqVO) { + taskDispatchService.operateDetail(operateReqVO); + return success(null); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchDetailPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchDetailPageReqVO.java new file mode 100644 index 00000000..ae27f006 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchDetailPageReqVO.java @@ -0,0 +1,35 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.List; + +@Schema(description = "管理后台 - 派工单分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class TaskDispatchDetailPageReqVO extends PageParam { + + @Schema(description = "负责人id") + private Long owner; + + @Schema(description = "工序完成状态列表") + private List procedureStatusList; + + @Schema(description = "派工类型") + private String dispatchType; + + @Schema(description = "是否需要报工") + private Integer isReport; + + @Schema(description = "生产任务id") + private Long taskId; + + @Schema(description = "bom明细id") + private Long bomDetailId; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchDetailVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchDetailVO.java new file mode 100644 index 00000000..984c1f80 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchDetailVO.java @@ -0,0 +1,35 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Positive; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - 派工单新增/修改 Request VO") +@Data +public class TaskDispatchDetailVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26723") + @NotNull(message = "id不能为空") + private Long id; + + @Min(value = 0, message = "报工数量超出限定范围") + @Schema(description = "报工数量") + private Integer amount; + + @Schema(description = "操作类型") + @NotBlank(message = "操作类型不能为空") + private String active; + + @Schema(description = "操作意见") + private String activeOpinion; + + @Positive(message = "报工工时超出限定范围") + @Schema(description = "报工工时") + private BigDecimal workTime; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchPageReqVO.java index b2a088f0..c5d600f2 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchPageReqVO.java @@ -1,10 +1,12 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo; -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; + import java.time.LocalDateTime; import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -49,4 +51,28 @@ public class TaskDispatchPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; -} \ No newline at end of file + @Schema(description = "生产任务单号") + private String taskCode; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "子项目名称") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "任务负责人") + private String ownerName; + + @Schema(description = "生产计划单号") + private String planCode; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchRespVO.java index f0321c90..06a1d130 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchRespVO.java @@ -1,14 +1,13 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; @Schema(description = "管理后台 - 派工单 Response VO") @Data @@ -65,4 +64,62 @@ public class TaskDispatchRespVO { @ExcelProperty("创建时间") private LocalDateTime createTime; -} \ No newline at end of file + @Schema(description = "生产任务单号") + private String taskCode; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "子项目编号") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "计划单号") + private String planCode; + + @Schema(description = "项目结束日期") + private LocalDateTime projectEndTime; + + @Schema(description = "零件名称") + private String materialName; + + @Schema(description = "物料id") + private Long compositionId; + + @Schema(description = "物料名称") + private String compositionName; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "图号") + private String blueprintNo; + + @Schema(description = "数量") + private Integer amount; + + @Schema(description = "系统单位") + private String unit; + + @Schema(description = "负责人") + private String ownerName; + + @Schema(description = "要求完成时间") + private LocalDateTime requiredCompletedDate; + + @Schema(description = "要求开始日期") + private LocalDateTime requiredStartDate; + + @Schema(description = "要求完成日期") + private LocalDateTime requiredEndDate; + + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchSaveReqVO.java index 2b1f773e..47773093 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskdispatch/vo/TaskDispatchSaveReqVO.java @@ -1,56 +1,63 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; -import java.util.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetail.TaskDispatchDetailDO; - -@Schema(description = "管理后台 - 派工单新增/修改 Request VO") -@Data -public class TaskDispatchSaveReqVO { - - @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "26723") - private Long id; - - @Schema(description = "编号,唯一") - private String code; - - @Schema(description = "派工类型 生产任务|装配任务 PRODUCTION|ASSEMBLE", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotEmpty(message = "派工类型 生产任务|装配任务 PRODUCTION|ASSEMBLE不能为空") - private String dispatchType; - - @Schema(description = "生产任务id", example = "8538") - private Long taskId; - - @Schema(description = "生产计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3259") - @NotNull(message = "生产计划id不能为空") - private Long planId; - - @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19610") - @NotNull(message = "项目id不能为空") - private Long projectId; - - @Schema(description = "子项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21985") - @NotNull(message = "子项目id不能为空") - private Long projectSubId; - - @Schema(description = "bom明细id", example = "15969") - private Long bomDetailId; - - @Schema(description = "派工状态 已保存|已提交|已终止 1|2|3", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotNull(message = "派工状态 已保存|已提交|已终止 1|2|3不能为空") - private Integer dispatchStatus; - - @Schema(description = "备注", example = "你说的对") - private String remark; - - @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotNull(message = "状态,1表示正常,2表示禁用不能为空") - private Integer status; - - @Schema(description = "派工明细列表") - private List taskDispatchDetails; - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; + +@Schema(description = "管理后台 - 派工单新增/修改 Request VO") +@Data +public class TaskDispatchSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "26723") + private Long id; + + @Schema(description = "编号,唯一") + private String code; + + @Schema(description = "派工类型 生产任务|装配任务 PRODUCTION|ASSEMBLE", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "派工类型 生产任务|装配任务 PRODUCTION|ASSEMBLE不能为空") + private String dispatchType; + + @Schema(description = "生产任务id", example = "8538") + private Long taskId; + + @Schema(description = "生产计划id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3259") + @NotNull(message = "生产计划id不能为空") + private Long planId; + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19610") + @NotNull(message = "项目id不能为空") + private Long projectId; + + @Schema(description = "子项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21985") + @NotNull(message = "子项目id不能为空") + private Long projectSubId; + + @Schema(description = "bom明细id", example = "15969") + private Long bomDetailId; + + @Schema(description = "派工状态 已保存|已提交|已终止 1|2|3", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "派工状态 已保存|已提交|已终止 1|2|3不能为空") + private Integer dispatchStatus; + + @Schema(description = "备注", example = "你说的对") + private String remark; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + + @Schema(description = "派工明细列表") + private List taskDispatchDetails; + + @Schema(description = "操作类型") + @NotBlank(message = "操作类型不能为空") + private String active; + + @Schema(description = "操作意见") + private String activeOpinion; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/TaskReportController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/TaskReportController.java new file mode 100644 index 00000000..7928ee31 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/TaskReportController.java @@ -0,0 +1,95 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.taskreport; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; +import com.chanko.yunxi.mes.module.heli.service.taskreport.TaskReportService; + +@Tag(name = "管理后台 - 任务报工") +@RestController +@RequestMapping("/heli/task-report") +@Validated +public class TaskReportController { + + @Resource + private TaskReportService taskReportService; + + @PostMapping("/create") + @Operation(summary = "创建任务报工") + @PreAuthorize("@ss.hasPermission('heli:task-report:create')") + public CommonResult createTaskReport(@Valid @RequestBody TaskReportSaveReqVO createReqVO) { + return success(taskReportService.createTaskReport(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新任务报工") + @PreAuthorize("@ss.hasPermission('heli:task-report:update')") + public CommonResult updateTaskReport(@Valid @RequestBody TaskReportSaveReqVO updateReqVO) { + taskReportService.updateTaskReport(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除任务报工") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:task-report:delete')") + public CommonResult deleteTaskReport(@RequestParam("id") Long id) { + taskReportService.deleteTaskReport(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得任务报工") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:task-report:query')") + public CommonResult getTaskReport(@RequestParam("id") Long id) { + TaskReportDO taskReport = taskReportService.getTaskReport(id); + return success(BeanUtils.toBean(taskReport, TaskReportRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得任务报工分页") + @PreAuthorize("@ss.hasPermission('heli:task-report:query')") + public CommonResult> getTaskReportPage(@Valid TaskReportPageReqVO pageReqVO) { + PageResult pageResult = taskReportService.getTaskReportPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, TaskReportRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出任务报工 Excel") + @PreAuthorize("@ss.hasPermission('heli:task-report:export')") + @OperateLog(type = EXPORT) + public void exportTaskReportExcel(@Valid TaskReportPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = taskReportService.getTaskReportPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "任务报工.xls", "数据", TaskReportRespVO.class, + BeanUtils.toBean(list, TaskReportRespVO.class)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportPageReqVO.java new file mode 100644 index 00000000..a0056f44 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportPageReqVO.java @@ -0,0 +1,68 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 任务报工分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class TaskReportPageReqVO extends PageParam { + + @Schema(description = "派工单任务明细id", example = "23399") + private Long dispatchDetailId; + + @Schema(description = "负责人") + private Long owner; + + @Schema(description = "数量") + private Integer amount; + + @Schema(description = "开始时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] startTime; + + @Schema(description = "结束时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] endTime; + + @Schema(description = "报工时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reportTime; + + @Schema(description = "是否已报工 0 默认否 1 是") + private Integer hasReport; + + @Schema(description = "状态,1表示正常,2表示禁用", example = "2") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "报工工时") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private BigDecimal[] workTime; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "子项目名称") + private String projectSubName; + + @Schema(description = "零件名称") + private String materialName; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportRespVO.java new file mode 100644 index 00000000..29170bf3 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportRespVO.java @@ -0,0 +1,103 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.math.BigDecimal; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 任务报工 Response VO") +@Data +@ExcelIgnoreUnannotated +public class TaskReportRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "7295") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "派工单任务明细id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23399") + @ExcelProperty("派工单任务明细id") + private Long dispatchDetailId; + + @Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("负责人") + private Long owner; + + @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("数量") + private Integer amount; + + @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("开始时间") + private LocalDateTime startTime; + + @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("结束时间") + private LocalDateTime endTime; + + @Schema(description = "报工时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("报工时间") + private LocalDateTime reportTime; + + @Schema(description = "是否已报工 0 默认否 1 是", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "是否已报工 0 默认否 1 是", converter = DictConvert.class) + @DictFormat("heli_common_is_or_not") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer hasReport; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty("状态,1表示正常,2表示禁用") + private Integer status; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "修改时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("修改时间") + private LocalDateTime updateTime; + + @Schema(description = "报工工时", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("报工工时") + private BigDecimal workTime; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "项目编码") + private String projectCode; + + @Schema(description = "子项目名称") + private String projectSubName; + + @Schema(description = "子项目编码") + private String projectSubCode; + + @Schema(description = "派工单号") + private String dispatchCode; + + @Schema(description = "零件名称") + private String materialName; + + @Schema(description = "规格型号") + private String spec; + + @Schema(description = "报工人") + private String ownerName; + + @Schema(description = "报工工序") + private String procedureName; + + @Schema(description = "更新人名称") + private String updaterName; + + @Schema(description = "单位") + private String unit; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportSaveReqVO.java new file mode 100644 index 00000000..491fa20b --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/taskreport/vo/TaskReportSaveReqVO.java @@ -0,0 +1,56 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.math.BigDecimal; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 任务报工新增/修改 Request VO") +@Data +public class TaskReportSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "7295") + private Long id; + + @Schema(description = "派工单任务明细id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23399") + @NotNull(message = "派工单任务明细id不能为空") + private Long dispatchDetailId; + + @Schema(description = "负责人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "负责人不能为空") + private Long owner; + + @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "数量不能为空") + private Integer amount; + + @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "开始时间不能为空") + private LocalDateTime startTime; + + @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "结束时间不能为空") + private LocalDateTime endTime; + + @Schema(description = "报工时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "报工时间不能为空") + private LocalDateTime reportTime; + + @Schema(description = "是否已报工 0 默认否 1 是", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否已报工 0 默认否 1 是不能为空") + private Integer hasReport; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + + @Schema(description = "报工工时", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "报工工时不能为空") + private BigDecimal workTime; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/UnqualifiedNotificationController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/UnqualifiedNotificationController.java new file mode 100644 index 00000000..cef26d8f --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/UnqualifiedNotificationController.java @@ -0,0 +1,116 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification; + +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchSaveReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationRespVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationSaveReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO; +import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import com.chanko.yunxi.mes.module.heli.service.unqualifiednotification.UnqualifiedNotificationService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.List; + +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Tag(name = "管理后台 - 品质异常通知单审核") +@RestController +@RequestMapping("/heli/unqualified-notification") +@Validated +public class UnqualifiedNotificationController { + + @Resource + private UnqualifiedNotificationService unqualifiedNotificationService; + + @PostMapping("/create") + @Operation(summary = "创建品质异常通知单审核") + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:create')") + public CommonResult createUnqualifiedNotification(@Valid @RequestBody UnqualifiedNotificationSaveReqVO createReqVO) { + return success(unqualifiedNotificationService.createUnqualifiedNotification(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新品质异常通知单审核") + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:update')") + public CommonResult updateUnqualifiedNotification(@Valid @RequestBody UnqualifiedNotificationSaveReqVO updateReqVO) { + unqualifiedNotificationService.updateUnqualifiedNotification(updateReqVO); + return success(true); + } + + @PostMapping("/operate") + @Operation(summary = "操作更新品质异常通知单") + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:update')") + @OperateLog(enable = false) + @Transactional(rollbackFor = Exception.class) + public CommonResult operate(@Valid @RequestBody UnqualifiedNotificationSaveReqVO operateReqVO) { + unqualifiedNotificationService.operate(operateReqVO); + return success(operateReqVO.getId()); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除品质异常通知单审核") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:delete')") + public CommonResult deleteUnqualifiedNotification(@RequestParam("id") Long id) { + unqualifiedNotificationService.deleteUnqualifiedNotification(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得品质异常通知单审核") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:query')") + public CommonResult getUnqualifiedNotification(@RequestParam("id") Long id) { + UnqualifiedNotificationDO unqualifiedNotification = unqualifiedNotificationService.getUnqualifiedNotification(id); + return success(BeanUtils.toBean(unqualifiedNotification, UnqualifiedNotificationRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得品质异常通知单审核分页") + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:query')") + public CommonResult> getUnqualifiedNotificationPage(@Valid UnqualifiedNotificationPageReqVO pageReqVO) { + PageResult pageResult = unqualifiedNotificationService.getUnqualifiedNotificationPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, UnqualifiedNotificationRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出品质异常通知单审核 Excel") + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:export')") + @OperateLog(type = EXPORT) + public void exportUnqualifiedNotificationExcel(@Valid UnqualifiedNotificationPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = unqualifiedNotificationService.getUnqualifiedNotificationPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "品质异常通知单审核.xls", "数据", UnqualifiedNotificationRespVO.class, + BeanUtils.toBean(list, UnqualifiedNotificationRespVO.class)); + } + + @GetMapping("/statisticPage") + @Operation(summary = "获得品质异常单统计分页") + @PreAuthorize("@ss.hasPermission('heli:unqualified-notification:query')") + public CommonResult> getUnqualifiedNotificationStatisticPage(@Valid UnqualifiedNotificationPageReqVO pageReqVO) { + PageResult pageResult = unqualifiedNotificationService.getUnqualifiedNotificationStatisticPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, UnqualifiedNotificationRespVO.class)); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationPageReqVO.java new file mode 100644 index 00000000..1bcccd82 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationPageReqVO.java @@ -0,0 +1,92 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 品质异常通知单审核分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class UnqualifiedNotificationPageReqVO extends PageParam { + + @Schema(description = "编号,唯一") + private String code; + + @Schema(description = "质检类型", example = "2") + private String type; + + @Schema(description = "单据状态 已保存|已送审|已审核 1|2|3", example = "1") + private Integer notificationStatus; + + @Schema(description = "项目订单id", example = "26682") + private Long projectId; + + @Schema(description = "子项目id", example = "28456") + private Long projectSubId; + + @Schema(description = "bom明细id", example = "21454") + private Long bomDetailId; + + @Schema(description = "工序id", example = "14739") + private Long procedureId; + + @Schema(description = "异常数量") + private Integer amount; + + @Schema(description = "责任人") + private Long owner; + + @Schema(description = "情况描述", example = "随便") + private String remark; + + @Schema(description = "审核人") + private Long auditor; + + @Schema(description = "审核意见") + private String auditOpinion; + + @Schema(description = "状态,1表示正常,2表示禁用", example = "1") + private Integer status; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "审核时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] auditTime; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "子项目名称") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "责任人名称") + private String ownerName; + + @Schema(description = "创建人名称") + private String creatorName; + + @Schema(description = "最小创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime minCreateTime; + + @Schema(description = "最大创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime maxCreateTime; +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationRespVO.java new file mode 100644 index 00000000..1ef40c7a --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationRespVO.java @@ -0,0 +1,133 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; + +@Schema(description = "管理后台 - 品质异常通知单审核 Response VO") +@Data +@ExcelIgnoreUnannotated +public class UnqualifiedNotificationRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "11880") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "编号,唯一") + @ExcelProperty("编号,唯一") + private String code; + + @Schema(description = "质检类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @ExcelProperty(value = "质检类型", converter = DictConvert.class) + @DictFormat("heli_inspection_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String type; + + @Schema(description = "单据状态 已保存|已送审|已审核 1|2|3", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty(value = "单据状态 已保存|已送审|已审核 1|2|3", converter = DictConvert.class) + @DictFormat("heli_unqualified_notification_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer notificationStatus; + + @Schema(description = "项目订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26682") + @ExcelProperty("项目订单id") + private Long projectId; + + @Schema(description = "子项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28456") + @ExcelProperty("子项目id") + private Long projectSubId; + + @Schema(description = "bom明细id", example = "21454") + @ExcelProperty("bom明细id") + private Long bomDetailId; + + @Schema(description = "工序id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14739") + @ExcelProperty("工序id") + private Long procedureId; + + @Schema(description = "异常数量", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("异常数量") + private Integer amount; + + @Schema(description = "责任人", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("责任人") + private Long owner; + + @Schema(description = "情况描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") + @ExcelProperty("情况描述") + private String remark; + + @Schema(description = "审核人") + @ExcelProperty("审核人") + private Long auditor; + + @Schema(description = "审核意见") + @ExcelProperty(value = "审核意见", converter = DictConvert.class) + @DictFormat("heli_unqualified_notification_opinion") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String auditOpinion; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("状态,1表示正常,2表示禁用") + private Integer status; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "审核时间") + @ExcelProperty("审核时间") + private LocalDateTime auditTime; + + @Schema(description = "项目名称") + private String projectName; + + @Schema(description = "项目编号") + private String projectCode; + + @Schema(description = "客户名称") + private String customerName; + + @Schema(description = "子项目编号") + private String projectSubName; + + @Schema(description = "子项目编号") + private String projectSubCode; + + @Schema(description = "零件名称") + private String materialName; + + @Schema(description = "物料id") + private Long compositionId; + + @Schema(description = "物料名称") + private String compositionName; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "图号") + private String blueprintNo; + + @Schema(description = "系统单位") + private String unit; + + @Schema(description = "工序名称") + private String procedureName; + + @Schema(description = "审核人名称") + private String auditorName; + + @Schema(description = "责任人名称") + private String ownerName; + + @Schema(description = "创建人名称") + private String creatorName; + + @Schema(description = "异常统计数量") + private String statisticAmount; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationSaveReqVO.java new file mode 100644 index 00000000..18131b66 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/unqualifiednotification/vo/UnqualifiedNotificationSaveReqVO.java @@ -0,0 +1,72 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 品质异常通知单审核新增/修改 Request VO") +@Data +public class UnqualifiedNotificationSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "11880") + private Long id; + + @Schema(description = "编号,唯一") + private String code; + + @Schema(description = "质检类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @NotEmpty(message = "质检类型不能为空") + private String type; + + @Schema(description = "单据状态 已保存|已送审|已审核 1|2|3", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "单据状态 已保存|已送审|已审核 1|2|3不能为空") + private Integer notificationStatus; + + @Schema(description = "项目订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26682") + @NotNull(message = "项目订单id不能为空") + private Long projectId; + + @Schema(description = "子项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28456") + @NotNull(message = "子项目id不能为空") + private Long projectSubId; + + @Schema(description = "bom明细id", example = "21454") + private Long bomDetailId; + + @Schema(description = "工序id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14739") + @NotNull(message = "工序id不能为空") + private Long procedureId; + + @Schema(description = "异常数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "异常数量不能为空") + private Integer amount; + + @Schema(description = "责任人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "责任人不能为空") + private Long owner; + + @Schema(description = "情况描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便") + @NotEmpty(message = "情况描述不能为空") + private String remark; + + @Schema(description = "审核人") + private Long auditor; + + @Schema(description = "审核意见") + private String auditOpinion; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + + @Schema(description = "审核时间") + private LocalDateTime auditTime; + + @Schema(description = "操作") + private String active; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/classes/ClassesDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/classes/ClassesDO.java index 1314b6c0..e4939b02 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/classes/ClassesDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/classes/ClassesDO.java @@ -46,6 +46,7 @@ public class ClassesDO extends BaseDO { /** * 负责人 */ + @TableField(fill = FieldFill.UPDATE) private Long leaderUserId; /** * 班组描述 diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/composition/CompositionDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/composition/CompositionDO.java index b6aea84c..790f3080 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/composition/CompositionDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/composition/CompositionDO.java @@ -1,11 +1,12 @@ package com.chanko.yunxi.mes.module.heli.dal.dataobject.composition; -import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; +import lombok.*; + +import java.math.BigDecimal; /** * 材质 DO @@ -52,6 +53,6 @@ public class CompositionDO extends BaseDO { /** * 密度 */ - private String density; + private BigDecimal density; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/customer/CustomerDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/customer/CustomerDO.java index e6f47828..f61ff545 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/customer/CustomerDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/customer/CustomerDO.java @@ -32,13 +32,17 @@ public class CustomerDO extends BaseDO { */ private String code; /** - * 客户简称 + * 简码 */ private String brief; /** - * 客户全称 + * 客户简称 */ private String name; + /** + * 客户全称 + */ + private String fullName; /** * 所属行业 */ @@ -52,6 +56,7 @@ public class CustomerDO extends BaseDO { /** * 联系人ID,对应用户ID */ + @TableField(fill = FieldFill.UPDATE) private String userId; /** * 备注 @@ -148,4 +153,4 @@ public class CustomerDO extends BaseDO { */ private String taxNo; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/equipmanufacture/EquipManufactureDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/equipmanufacture/EquipManufactureDO.java new file mode 100644 index 00000000..f720c7c5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/equipmanufacture/EquipManufactureDO.java @@ -0,0 +1,51 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 制造设备 DO + * + * @author 合立管理员 + */ +@TableName("base_equip_manufacture") +@KeySequence("base_equip_manufacture_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class EquipManufactureDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 编码 唯一 + */ + private String code; + /** + * 名称 + */ + private String name; + /** + * 类型 + */ + private String type; + /** + * 型号 + */ + private String model; + /** + * 状态,1表示正常,2表示禁用,默认是1 + */ + private Integer status; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/invoice/InvoiceDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/invoice/InvoiceDO.java new file mode 100644 index 00000000..c55c8062 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/invoice/InvoiceDO.java @@ -0,0 +1,127 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.invoice; + +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.InvoiceStatusEnum; +import lombok.*; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 财务发票 DO + * + * @author 管理员 + */ +@TableName("finance_invoice") +@KeySequence("finance_invoice_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class InvoiceDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 业务类型 FINANCE_MAKE|FINANCE_RECEIVE 开票|收票 + */ + private String businessType; + /** + * 订单id + */ + private Long orderId; + /** + * 发票号码 + */ + private String number; + /** + * 发票类型 + * + * 枚举 {@link TODO heli_invoice_type 对应的类} + */ + private String type; + /** + * 开票日期 + */ + private LocalDateTime billingDate; + /** + * 发票金额 + */ + private BigDecimal amount; + /** + * 税率 + */ + private BigDecimal rate; + /** + * 备注 + */ + private String remark; + /** + * 提交人 + */ + private Long submitter; + /** + * 提交时间 + */ + private LocalDateTime submitTime; + /** + * 作废人 + */ + private Long canceller; + /** + * 作废时间 + */ + private LocalDateTime cancelTime; + /** + * 单据状态 已保存|已提交|已作废 1|2|3 + */ + private Integer status; + + @TableField(exist = false) + private String submitterName; + + @TableField(exist = false) + private String creatorName; + + @TableField(exist = false) + private String cancellerName; + + @TableField(exist = false) + private String orderCode; + + public boolean canSave(){ + return InvoiceStatusEnum.SAVE.getCode() == this.status.intValue(); + } + + public boolean canSubmit(){ + return InvoiceStatusEnum.SAVE.getCode() == this.status.intValue(); + } + + public boolean canCancel(){ + return InvoiceStatusEnum.SUBMIT.getCode() == this.status.intValue(); + } + + public boolean canOperate(OperateTypeEnum operateTypeEnum) { + switch (operateTypeEnum){ + case SAVE: + return canSave(); + case SUBMIT: + return canSubmit(); + case CANCEL: + return canCancel(); + default: + return false; + } + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java index c664c67e..c04b32d2 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java @@ -1,15 +1,10 @@ package com.chanko.yunxi.mes.module.heli.dal.dataobject.material; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.tenant.core.db.TenantBaseDO; import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import java.math.BigDecimal; -import java.math.BigDecimal; -import java.math.BigDecimal; + import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.*; -import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; /** * 物料 DO @@ -24,7 +19,7 @@ import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; @Builder @NoArgsConstructor @AllArgsConstructor -public class MaterialDO extends BaseDO { +public class MaterialDO extends TenantBaseDO { /** * 自增字段,唯一 @@ -102,6 +97,7 @@ public class MaterialDO extends BaseDO { /** * 首选供应商 */ + @TableField(fill = FieldFill.UPDATE) private Long mainSupplierId; /** * 物料主要来源 diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplan/MaterialPlanDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplan/MaterialPlanDO.java index 30bef219..a2c9bf63 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplan/MaterialPlanDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplan/MaterialPlanDO.java @@ -69,10 +69,6 @@ public class MaterialPlanDO extends BaseDO { */ private String description; - /** - * 创建人 - */ - private String creator; /** * 生产计划单号 */ diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplanboom/MaterialPlanBoomDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplanboom/MaterialPlanBoomDO.java new file mode 100644 index 00000000..3110da18 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplanboom/MaterialPlanBoomDO.java @@ -0,0 +1,69 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 物料需求计划加工件明细 DO + * + * @author 管理员 + */ +@TableName("project_material_plan_boom") +@KeySequence("project_material_plan_boom_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class MaterialPlanBoomDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 物料需求计划id + */ + private Long projectMaterialPlanId; + /** + * 工艺boom明细id,零件类型:加工件 + */ + private Long boomDetailId; + /** + * 订单子项目id + */ + private Long projectPlanSubId; + /** + * 需求数量 + */ + private BigDecimal boomAmount; + /** + * 需求到货日期 + */ + private LocalDateTime boomArriveDate; + /** + * 备注 + */ + private String description; + @TableField(exist = false) + private String materialName; + @TableField(exist = false) + private String projectSubCode; + @TableField(exist = false) + private String boomSpec; + @TableField(exist = false) + private String boomUnit; + @TableField(exist = false) + private String compositionName; + @TableField(exist = false) + private Long compositionId; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplandetail/MaterialPlanDetailDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplandetail/MaterialPlanDetailDO.java index ec4a9050..ff668120 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplandetail/MaterialPlanDetailDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/materialplandetail/MaterialPlanDetailDO.java @@ -67,5 +67,7 @@ public class MaterialPlanDetailDO extends BaseDO { private String matUnit; @TableField(exist = false) private String matType; + @TableField(exist = false) + private BigDecimal matRest; } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java index 0a608460..8e45526d 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plan/PlanDO.java @@ -43,6 +43,7 @@ public class PlanDO extends BaseDO { /** * 项目负责人 */ + @TableField(fill = FieldFill.UPDATE) private Long projectOwner; /** * 是否需要工艺:1表示需要,0表示不需要 @@ -53,6 +54,7 @@ public class PlanDO extends BaseDO { /** * 工艺负责人 */ + @TableField(fill = FieldFill.UPDATE) private Long craftOwner; /** * 工艺开始日期 @@ -69,6 +71,7 @@ public class PlanDO extends BaseDO { /** * 编辑人 */ + @TableField(fill = FieldFill.UPDATE) private Long editor; /** * 编辑日期 @@ -77,6 +80,7 @@ public class PlanDO extends BaseDO { /** * 审核人 */ + @TableField(fill = FieldFill.UPDATE) private Long auditor; /** * 审核日期 @@ -85,6 +89,7 @@ public class PlanDO extends BaseDO { /** * 批准人 */ + @TableField(fill = FieldFill.UPDATE) private Long approver; /** * 批准日期 @@ -138,4 +143,4 @@ public class PlanDO extends BaseDO { @TableField(exist = false) private Integer isUrgency; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java index 787eef1d..5bbf1a05 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plansub/PlanSubDO.java @@ -45,10 +45,12 @@ public class PlanSubDO extends BaseDO { /** * 模具类型id */ + @TableField(fill = FieldFill.UPDATE) private Long mouldId; /** * 设备id */ + @TableField(fill = FieldFill.UPDATE) private Long equipId; /** * 毛坯结束日期 @@ -57,6 +59,7 @@ public class PlanSubDO extends BaseDO { /** * 毛坯负责人 */ + @TableField(fill = FieldFill.UPDATE) private Long blankOwner; /** * 2D结束日期 @@ -65,6 +68,7 @@ public class PlanSubDO extends BaseDO { /** * 2D负责人 */ + @TableField(fill = FieldFill.UPDATE) private Long twoDimOwner; /** * 3D结束日期 @@ -73,6 +77,7 @@ public class PlanSubDO extends BaseDO { /** * 3D负责人 */ + @TableField(fill = FieldFill.UPDATE) private Long threeDimOwner; /** * 子项目简称 @@ -83,4 +88,7 @@ public class PlanSubDO extends BaseDO { */ private String projectSubCode; -} \ No newline at end of file + @TableField(exist = false) + private String projectSubName; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plantask/PlanTaskDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plantask/PlanTaskDO.java new file mode 100644 index 00000000..045cad2a --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plantask/PlanTaskDO.java @@ -0,0 +1,80 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask; + +import cn.hutool.core.date.DateTime; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 生产计划任务 DO + * + * @author 管理员 + */ +@TableName("project_plan_task") +@KeySequence("project_plan_task_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PlanTaskDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 项目id + */ + private Long projectId; + /** + * 生产计划id + */ + private Long projectPlanId; + /** + * 生产计划子项目id + */ + private Long projectPlanSubId; + /** + * 工艺bomid + */ + private Long processBomId; + /** + * 生产计划编号,唯一 + */ + private String taskNo; + /** + * bom版本号 + */ + private Integer bomVersion; + /** + * 备注 + */ + private String description; + /** + * 状态,1已保存,2已提交,3已终止 ,默认是1 + */ + private Integer status; + + @TableField(exist = false) + private String customerName; + @TableField(exist = false) + private String projectCode; + @TableField(exist = false) + private String projectName; + @TableField(exist = false) + private LocalDateTime projectEndTime; + @TableField(exist = false) + private String planNo; + @TableField(exist = false) + private String projectSubCode; + @TableField(exist = false) + private String projectSubName; + @TableField(exist = false) + private String bomCode; +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plantaskbom/PlanTaskBomDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plantaskbom/PlanTaskBomDO.java new file mode 100644 index 00000000..18857176 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/plantaskbom/PlanTaskBomDO.java @@ -0,0 +1,94 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom; + +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; +import lombok.*; + +import java.time.LocalDateTime; + +/** + * 生产计划任务Bom DO + * + * @author 管理员 + */ +@TableName("project_plan_task_bom") +@KeySequence("project_plan_task_bom_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PlanTaskBomDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 生产任务id + */ + private Long taskId; + /** + * bom明细id + */ + private Long bomDetailId; + /** + * 负责人 + */ + private String owner; + /** + * 要求完成日期 + */ + private LocalDateTime requireEndDate; + + @TableField(exist = false) + private String materialName; + + @TableField(exist = false) + private String compositionName; + + @TableField(exist = false) + private String blueprintNo; + + @TableField(exist = false) + private String type; + /** + * 物料id + */ + @TableField(exist = false) + private Long materialId; + /** + * 物料编码 + */ + @TableField(exist = false) + private String materialCode; + /** + * 材质id + */ + @TableField(exist = false) + private Long compositionId; + /** + * 规格 + */ + @TableField(exist = false) + private String spec; + /** + * 单位 + */ + @TableField(exist = false) + private String unit; + /** + * 数量 + */ + @TableField(exist = false) + private Integer amount; + + @TableField(exist = false) + private String ownerName; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDO.java index 030ba032..ffc7c171 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDO.java @@ -1,13 +1,13 @@ package com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum; import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; -import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; /** * 工艺bom DO @@ -81,6 +81,12 @@ public class ProcessBomDO extends BaseDO { @TableField(exist = false) private String projectName; + @TableField(exist = false) + private String bomCode; + + @TableField(exist = false) + private String projectSubCode; + public boolean canSave(){ return ProcessBomStatusEnum.SAVE.getCode() == this.bomStatus.intValue(); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDetailDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDetailDO.java index ea2e5672..93d7f159 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDetailDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processbom/ProcessBomDetailDO.java @@ -1,10 +1,12 @@ package com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom; import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; import lombok.*; +import org.apache.poi.hpsf.Decimal; /** * 工艺bom明细 DO @@ -77,4 +79,22 @@ public class ProcessBomDetailDO extends BaseDO { */ private Integer status; + @TableField(exist = false) + private Long boomDetailId; + @TableField(exist = false) + private Long planId; + @TableField(exist = false) + private Long projectPlanSubId; + @TableField(exist = false) + private String boomSpec; + @TableField(exist = false) + private Integer boomUnit; + @TableField(exist = false) + private String projectSubCode; + @TableField(exist = false) + private String compositionName; + + @TableField(exist = false) + private Decimal boomAmount; + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processdesign/ProcessDesignDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processdesign/ProcessDesignDO.java index cb403820..493bbfb0 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processdesign/ProcessDesignDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/processdesign/ProcessDesignDO.java @@ -1,13 +1,14 @@ package com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; import lombok.*; import java.math.BigDecimal; -import java.util.*; -import java.time.LocalDateTime; import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; -import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; /** * 工艺设计 DO @@ -128,4 +129,7 @@ public class ProcessDesignDO extends BaseDO { @TableField(exist = false) private BigDecimal progress; + @TableField(exist = false) + private Integer planStatus; + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/projectorder/ProjectOrderSubDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/projectorder/ProjectOrderSubDO.java index ba4ac689..7792ba5b 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/projectorder/ProjectOrderSubDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/projectorder/ProjectOrderSubDO.java @@ -1,9 +1,6 @@ package com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; import lombok.*; @@ -40,6 +37,7 @@ public class ProjectOrderSubDO extends BaseDO { /** * 设备型号 */ + @TableField(fill = FieldFill.UPDATE) private String deviceModel; /** * 数量 @@ -62,10 +60,6 @@ public class ProjectOrderSubDO extends BaseDO { */ private String unit; - /** - * 删除 物理删除 - */ - private Boolean deleted; /** * 变更的字段列表 * */ @@ -83,4 +77,31 @@ public class ProjectOrderSubDO extends BaseDO { @TableField(exist = false) private String deviceName; + + @TableField(exist = false) + private Long projectId; + + @TableField(exist = false) + private Long projectSubId; + + @TableField(exist = false) + private String projectName; + + @TableField(exist = false) + private String projectCode; + + @TableField(exist = false) + private String customerName; + + @TableField(exist = false) + private String projectSubName; + + @TableField(exist = false) + private String projectSubCode; + + @TableField(exist = false) + private Integer attachmentCount; + + @TableField(exist = false) + private Integer deliverAmount; } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseorderboom/PurchaseOrderBoomDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseorderboom/PurchaseOrderBoomDO.java new file mode 100644 index 00000000..7e734959 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseorderboom/PurchaseOrderBoomDO.java @@ -0,0 +1,87 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 采购订单加工件明细 DO + * + * @author 管理员 + */ +@TableName("project_purchase_order_boom") +@KeySequence("project_purchase_order_boom_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PurchaseOrderBoomDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 采购单编号 + */ + private Long purchaseOrderId; + /** + * 加工件boom detail id + */ + private Long boomDetailId; + /** + * 零件名称 + */ + private String boomName; + /** + * 规格型号 + */ + private String boomSpec; + /** + * 系统单位 + */ + private Integer boomUnit; + /** + * 材质 + */ + private String composition; + /** + * 采购数量 + */ + private BigDecimal purchaseAmount; + /** + * 暂估价金额 + */ + private BigDecimal estimatedPrice; + /** + * 实际价金额 + */ + private BigDecimal actualPrice; + /** + * 预计到期日期 + */ + private LocalDateTime arriveTime; + /** + * 备注 + */ + private String description; + /** + * 需求数量 + */ + private BigDecimal boomAmount; + /** + * 需求到货日期 + */ + private LocalDateTime requireTime; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseordermaterial/PurchaseOrderMaterialDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseordermaterial/PurchaseOrderMaterialDO.java index 9b7b6e52..de6a9b60 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseordermaterial/PurchaseOrderMaterialDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseordermaterial/PurchaseOrderMaterialDO.java @@ -71,5 +71,11 @@ public class PurchaseOrderMaterialDO extends BaseDO { private String matUnit; @TableField(exist = false) private String matType; + @TableField(exist = false) + private BigDecimal matRest; + @TableField(exist = false) + private BigDecimal requireAmount; + @TableField(exist = false) + private LocalDateTime requireArriveTime; } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/qualityfeedback/QualityFeedbackDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/qualityfeedback/QualityFeedbackDO.java new file mode 100644 index 00000000..8c60f09e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/qualityfeedback/QualityFeedbackDO.java @@ -0,0 +1,75 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.qualityfeedback; + +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 客户反馈质量 DO + * + * @author 管理员 + */ +@TableName("pro_quality_feedback") +@KeySequence("pro_quality_feedback_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class QualityFeedbackDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 项目订单id + */ + private Long projectId; + /** + * 子项目id + */ + private Long projectSubId; + /** + * 反馈人 + */ + private String feedbacker; + /** + * 联系电话 + */ + private String mobile; + /** + * 反馈内容 + */ + private String remark; + /** + * 状态,1表示正常,2表示禁用 + */ + private Integer status; + + @TableField(exist = false) + private String projectName; + + @TableField(exist = false) + private String projectCode; + + @TableField(exist = false) + private String customerName; + + @TableField(exist = false) + private String projectSubName; + + @TableField(exist = false) + private String projectSubCode; + + @TableField(exist = false) + private String creatorName; + + @TableField(exist = false) + private String updaterName; +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagelogNow/StorageLogNowDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagelogNow/StorageLogNowDO.java index d584efad..69063118 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagelogNow/StorageLogNowDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagelogNow/StorageLogNowDO.java @@ -13,7 +13,7 @@ import java.time.LocalDate; * * @author 管理员 */ -@TableName("v_storage_material_now") +@TableName(value ="v_storage_material_now",autoResultMap = true) @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagelogNow/StorageMaterialDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagelogNow/StorageMaterialDO.java new file mode 100644 index 00000000..8ef43496 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagelogNow/StorageMaterialDO.java @@ -0,0 +1,58 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; +import lombok.*; + +import java.math.BigDecimal; + +/** + * 入/出库日志 DO + * + * @author 管理员 + */ +@TableName(value ="v_storage_material_all",autoResultMap = true) +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageMaterialDO extends BaseDO { + + /** + * 主键id + */ + @TableId + private Long id; + + private BigDecimal storageOkQty; + + private String lotNo; + + private String matName; + private String shortName; + private String matCode; + private String matType; + private String matSpec; + private String matBrand; + private String matUnit; + + private Long whId; + private String whName; + + private Long rgId; + private String rgName; + + private Long pnId; + private String pnName; + + @TableField(exist = false) + private String matRest; + + + + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagemat/StorageMatDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagemat/StorageMatDO.java index aff87301..f72ae584 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagemat/StorageMatDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagemat/StorageMatDO.java @@ -65,4 +65,7 @@ public class StorageMatDO extends BaseDO { */ private String description; + @TableField(exist = false) + private String projectSubName; + } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/supplier/SupplierDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/supplier/SupplierDO.java index 75969546..b450895a 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/supplier/SupplierDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/supplier/SupplierDO.java @@ -58,6 +58,7 @@ public class SupplierDO extends BaseDO { /** * 归属人员,对应用户ID */ + @TableField(fill = FieldFill.UPDATE) private Long userId; /** * 备注 @@ -152,4 +153,4 @@ public class SupplierDO extends BaseDO { */ private String taxNo; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDO.java index 75cc0ae1..1c2ab659 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDO.java @@ -1,11 +1,15 @@ package com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch; +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.TaskDispatchStatusEnum; import lombok.*; -import java.util.*; -import java.time.LocalDateTime; + import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; -import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; /** * 派工单 DO @@ -72,4 +76,88 @@ public class TaskDispatchDO extends BaseDO { */ private Integer status; -} \ No newline at end of file + @TableField(exist = false) + private String taskCode; + + @TableField(exist = false) + private String projectName; + + @TableField(exist = false) + private String projectCode; + + @TableField(exist = false) + private String customerName; + + @TableField(exist = false) + private String projectSubName; + + @TableField(exist = false) + private String projectSubCode; + + @TableField(exist = false) + private String planCode; + + @TableField(exist = false) + private LocalDateTime projectEndTime; + + @TableField(exist = false) + private String materialName; + + @TableField(exist = false) + private Long compositionId; + + @TableField(exist = false) + private String compositionName; + + @TableField(exist = false) + private String spec; + + @TableField(exist = false) + private String blueprintNo; + + @TableField(exist = false) + private Integer amount; + + @TableField(exist = false) + private String unit; + + @TableField(exist = false) + private String ownerName; + + @TableField(exist = false) + private LocalDateTime requiredCompletedDate; + + @TableField(exist = false) + private Long requiredStartDate; + + @TableField(exist = false) + private Long requiredEndDate; + + @TableField(exist = false) + private String craftContent; + + public boolean canSave(){ + return TaskDispatchStatusEnum.SAVE.getCode() == this.dispatchStatus.intValue(); + } + + public boolean canSubmit(){ + return TaskDispatchStatusEnum.SAVE.getCode() == this.dispatchStatus.intValue(); + } + + public boolean canCancel(){ + return TaskDispatchStatusEnum.SUBMIT.getCode() == this.dispatchStatus.intValue(); + } + + public boolean canOperate(OperateTypeEnum operateTypeEnum) { + switch (operateTypeEnum){ + case SAVE: + return canSave(); + case SUBMIT: + return canSubmit(); + case CANCEL_SUBMIT: + return canCancel(); + default: + return false; + } + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java index 3d1bc8bb..00e020ac 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskdispatch/TaskDispatchDetailDO.java @@ -1,12 +1,11 @@ -package com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetail; +package com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; import lombok.*; -import java.util.*; + import java.math.BigDecimal; import java.time.LocalDateTime; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; -import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; /** * 派工明细 DO @@ -60,5 +59,49 @@ public class TaskDispatchDetailDO extends BaseDO { * 派工单id */ private Long dispatchId; + /** + * 设备型号 + */ + @TableField(fill = FieldFill.UPDATE) + private Long deviceModel; + /** + * 预计开始日期 + */ + private LocalDateTime startTime; + /** + * 预计结束日期 + */ + private LocalDateTime endTime; + /** + * 工序状态 默认 已提交 已完成 0 1 2 + */ + private Integer procedureStatus; + + @TableField(exist = false) + private String projectName; + + @TableField(exist = false) + private String projectCode; + + @TableField(exist = false) + private String projectSubName; + + @TableField(exist = false) + private String projectSubCode; + + @TableField(exist = false) + private String materialName; + + @TableField(exist = false) + private String procedureName; + + @TableField(exist = false) + private Integer totalReportAmount; + + @TableField(exist = false) + private BigDecimal totalWorkTime; + + @TableField(exist = false) + private String dispatchCode; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskreport/TaskReportDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskreport/TaskReportDO.java new file mode 100644 index 00000000..3ddf6ee2 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/taskreport/TaskReportDO.java @@ -0,0 +1,104 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport; + +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; +import lombok.*; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +/** + * 任务报工 DO + * + * @author 管理员 + */ +@TableName("pro_task_report") +@KeySequence("pro_task_report_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class TaskReportDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 派工单任务明细id + */ + private Long dispatchDetailId; + /** + * 负责人 + */ + private Long owner; + /** + * 数量 + */ + private Integer amount; + /** + * 开始时间 + */ + private LocalDateTime startTime; + /** + * 结束时间 + */ + private LocalDateTime endTime; + /** + * 报工时间 + */ + private LocalDateTime reportTime; + /** + * 是否已报工 0 默认否 1 是 + * + * 枚举 {@link TODO heli_common_is_or_not 对应的类} + */ + private Integer hasReport; + /** + * 状态,1表示正常,2表示禁用 + */ + private Integer status; + /** + * 报工工时 + */ + private BigDecimal workTime; + + @TableField(exist = false) + private String projectName; + + @TableField(exist = false) + private String projectCode; + + @TableField(exist = false) + private String projectSubName; + + @TableField(exist = false) + private String projectSubCode; + + @TableField(exist = false) + private String dispatchCode; + + @TableField(exist = false) + private String materialName; + + @TableField(exist = false) + private String spec; + + @TableField(exist = false) + private String ownerName; + + @TableField(exist = false) + private String procedureName; + + @TableField(exist = false) + private String updaterName; + + @TableField(exist = false) + private String unit; +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/unqualifiednotification/UnqualifiedNotificationDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/unqualifiednotification/UnqualifiedNotificationDO.java new file mode 100644 index 00000000..12afebf4 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/unqualifiednotification/UnqualifiedNotificationDO.java @@ -0,0 +1,171 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification; + +import com.baomidou.mybatisplus.annotation.KeySequence; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.UnqualifiedNotificationStatusEnum; +import lombok.*; + +import java.time.LocalDateTime; + +/** + * 品质异常通知单审核 DO + * + * @author 管理员 + */ +@TableName("pro_unqualified_notification") +@KeySequence("pro_unqualified_notification_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class UnqualifiedNotificationDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 编号,唯一 + */ + private String code; + /** + * 质检类型 + * + * 枚举 {@link TODO heli_inspection_type 对应的类} + */ + private String type; + /** + * 单据状态 已保存|已送审|已审核 1|2|3 + * + * 枚举 {@link TODO heli_unqualified_notification_status 对应的类} + */ + private Integer notificationStatus; + /** + * 项目订单id + */ + private Long projectId; + /** + * 子项目id + */ + private Long projectSubId; + /** + * bom明细id + */ + private Long bomDetailId; + /** + * 工序id + */ + private Long procedureId; + /** + * 异常数量 + */ + private Integer amount; + /** + * 责任人 + */ + private Long owner; + /** + * 情况描述 + */ + private String remark; + /** + * 审核人 + */ + private Long auditor; + /** + * 审核意见 + * + * 枚举 {@link TODO heli_unqualified_notification_opinion 对应的类} + */ + private String auditOpinion; + /** + * 状态,1表示正常,2表示禁用 + */ + private Integer status; + /** + * 审核时间 + */ + private LocalDateTime auditTime; + + @TableField(exist = false) + private String projectName; + + @TableField(exist = false) + private String projectCode; + + @TableField(exist = false) + private String customerName; + + @TableField(exist = false) + private String projectSubName; + + @TableField(exist = false) + private String projectSubCode; + + @TableField(exist = false) + private String materialName; + + @TableField(exist = false) + private Long compositionId; + + @TableField(exist = false) + private String compositionName; + + @TableField(exist = false) + private String spec; + + @TableField(exist = false) + private String blueprintNo; + + @TableField(exist = false) + private String unit; + + @TableField(exist = false) + private String procedureName; + + @TableField(exist = false) + private String auditorName; + + @TableField(exist = false) + private String ownerName; + + @TableField(exist = false) + private String creatorName; + + @TableField(exist = false) + private String statisticAmount; + + public boolean canSave(){ + return UnqualifiedNotificationStatusEnum.SAVE.getCode() == this.notificationStatus.intValue(); + } + + public boolean canSubmit(){ + return UnqualifiedNotificationStatusEnum.SAVE.getCode() == this.notificationStatus.intValue(); + } + + public boolean canAudit(){ + return UnqualifiedNotificationStatusEnum.SUBMIT.getCode() == this.notificationStatus.intValue(); + } + + + public boolean canOperate(OperateTypeEnum operateTypeEnum) { + switch (operateTypeEnum){ + case SAVE: + return canSave(); + case SUBMIT: + return canSubmit(); + case AUDIT: + return canAudit(); + default: + return false; + } + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/warehouse/WarehouseDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/warehouse/WarehouseDO.java index d7fa4170..5923202b 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/warehouse/WarehouseDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/warehouse/WarehouseDO.java @@ -38,10 +38,12 @@ public class WarehouseDO extends BaseDO { /** * 联系人 */ + @TableField(fill = FieldFill.UPDATE) private String contact; /** * 联系电话 */ + @TableField(fill = FieldFill.UPDATE) private String telephone; /** * 状态,1 表示正常,2 表示禁用 @@ -50,4 +52,4 @@ public class WarehouseDO extends BaseDO { */ private Integer whStatus; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/workshop/WorkshopDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/workshop/WorkshopDO.java index e4c68f0b..42b1231f 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/workshop/WorkshopDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/workshop/WorkshopDO.java @@ -42,6 +42,7 @@ public class WorkshopDO extends BaseDO { /** * 负责人 */ + @TableField(fill = FieldFill.UPDATE) private Long leaderUserId; /** * 描述信息 diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/equipmanufacture/EquipManufactureMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/equipmanufacture/EquipManufactureMapper.java new file mode 100644 index 00000000..a05f418d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/equipmanufacture/EquipManufactureMapper.java @@ -0,0 +1,32 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.equipmanufacture; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture.vo.EquipManufacturePageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; + +/** + * 制造设备 Mapper + * + * @author 合立管理员 + */ +@Mapper +public interface EquipManufactureMapper extends BaseMapperX { + + default PageResult selectPage(EquipManufacturePageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(EquipManufactureDO::getCode, reqVO.getCode()) + .likeIfPresent(EquipManufactureDO::getName, reqVO.getName()) + .likeIfPresent(EquipManufactureDO::getType, reqVO.getType()) + .likeIfPresent(EquipManufactureDO::getModel, reqVO.getModel()) + .eqIfPresent(EquipManufactureDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(EquipManufactureDO::getCreateTime, reqVO.getCreateTime()) + .and(!StringUtils.isEmpty(reqVO.getCodeOrName()), + QueryWrapper -> QueryWrapper.like(EquipManufactureDO::getCode, reqVO.getCodeOrName()).or().like(EquipManufactureDO::getName, reqVO.getCodeOrName())) + .orderByDesc(EquipManufactureDO::getId)); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/invoice/InvoiceMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/invoice/InvoiceMapper.java new file mode 100644 index 00000000..4885479e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/invoice/InvoiceMapper.java @@ -0,0 +1,77 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.invoice; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.collection.ArrayUtils; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo.InvoicePageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.invoice.InvoiceDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO; +import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; + +/** + * 财务发票 Mapper + * + * @author 管理员 + */ +@Mapper +public interface InvoiceMapper extends BaseMapperX { + + default PageResult selectPage(InvoicePageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(InvoiceDO.class) + .select("u1.nickname as creatorName", "u2.nickname as submitterName", "u3.nickname as cancellerName") + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, InvoiceDO::getCreator) + .leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, InvoiceDO::getSubmitter) + .leftJoin(AdminUserDO.class, "u3", AdminUserDO::getId, InvoiceDO::getCanceller) + .disableSubLogicDel() + .orderByDesc(InvoiceDO::getId); + if(!StringUtils.isEmpty(reqVO.getBusinessType())){ + BusinesTypeEnum businesTypeEnum = BusinesTypeEnum.valueOf(reqVO.getBusinessType()); + if(BusinesTypeEnum.FINANCE_MAKE_INVOICE == businesTypeEnum){ + query.select("a.code as orderCode") + .leftJoin(ProjectOrderDO.class, "a", ProjectOrderDO::getId, InvoiceDO::getOrderId) + .like(!StringUtils.isEmpty(reqVO.getOrderCode()), ProjectOrderDO::getCode, reqVO.getOrderCode()); + }else if(BusinesTypeEnum.FINANCE_RECEIVE_INVOICE == businesTypeEnum){ + query.select("a.purchase_no as orderCode") + .leftJoin(PurchaseOrderDO.class, "a", PurchaseOrderDO::getId, InvoiceDO::getOrderId) + .like(!StringUtils.isEmpty(reqVO.getOrderCode()), PurchaseOrderDO::getPurchaseNo, reqVO.getOrderCode()); + } + } + + query.eq(!StringUtils.isEmpty(reqVO.getBusinessType()), InvoiceDO::getBusinessType, reqVO.getBusinessType()) + .like(!StringUtils.isEmpty(reqVO.getNumber()), InvoiceDO::getNumber, reqVO.getNumber()) + .between(reqVO.getBillingDate() != null, InvoiceDO::getBillingDate + , ArrayUtils.get(reqVO.getBillingDate(), 0), ArrayUtils.get(reqVO.getBillingDate(), 1)) + .eq(!StringUtils.isEmpty(reqVO.getType()), InvoiceDO::getType, reqVO.getType()); + + return selectPage(reqVO, query); + } + + default InvoiceDO selectByIdAndType(Long id, String businessType) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(InvoiceDO.class) + .select("u1.nickname as creatorName", "u2.nickname as submitterName", "u3.nickname as cancellerName") + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, InvoiceDO::getCreator) + .leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, InvoiceDO::getSubmitter) + .leftJoin(AdminUserDO.class, "u3", AdminUserDO::getId, InvoiceDO::getCanceller) + .disableSubLogicDel() + .eq(InvoiceDO::getId, id) + .last("LIMIT 1"); + + BusinesTypeEnum businesTypeEnum = BusinesTypeEnum.valueOf(businessType); + if(BusinesTypeEnum.FINANCE_MAKE_INVOICE == businesTypeEnum){ + query.select("a.code as orderCode") + .leftJoin(ProjectOrderDO.class, "a", ProjectOrderDO::getId, InvoiceDO::getOrderId); + }else if(BusinesTypeEnum.FINANCE_RECEIVE_INVOICE == businesTypeEnum){ + query.select("a.purchase_no as orderCode") + .leftJoin(PurchaseOrderDO.class, "a", PurchaseOrderDO::getId, InvoiceDO::getOrderId); + } + return selectOne(query); + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/BoomDetailRespVOMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/BoomDetailRespVOMapper.java new file mode 100644 index 00000000..f5e47cad --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/BoomDetailRespVOMapper.java @@ -0,0 +1,27 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom; + +import com.alibaba.druid.util.StringUtils; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.MaterialPlanBoomPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.ProcessBoomPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.ProcessBoomRespVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogAll.StorageLogAllDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 物料需求计划加工件明细 Mapper + * + * @author 管理员 + */ +@Mapper +public interface BoomDetailRespVOMapper extends BaseMapperX { + + List selectBoomList(ProcessBoomPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomDetailMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomDetailMapper.java new file mode 100644 index 00000000..ba25d58b --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomDetailMapper.java @@ -0,0 +1,64 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.MaterialPlanBoomPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.ProcessBoomPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.ProcessBoomRespVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.enums.BoomDetailTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; + +/** + * 物料需求计划加工件明细 Mapper + * + * @author 管理员 + */ +@Mapper +public interface MaterialPlanBoomDetailMapper extends BaseMapperX { + + default PageResult selectBoomDetailPage(ProcessBoomPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(ProcessBomDetailDO.class) + .select("t.id as boomDetailId","pb.plan_id as planId") + .select("pp.id as projectPlanSubId", "pp.project_sub_code as projectSubCode") + .select("t.spec as boomSpec","t.unit as boomUnit","bc.`name` as compositionName") + .leftJoin(ProcessBomDO.class, "pb", ProcessBomDO::getId, ProcessBomDetailDO::getBomId) + .leftJoin(PlanSubDO.class, "pp", PlanSubDO::getProjectSubId, ProcessBomDO::getProjectSubId) + .leftJoin(CompositionDO.class, "bc", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .orderByDesc(ProcessBomDetailDO::getId) + .disableSubLogicDel() + ; + + query.eq(!StringUtils.isEmpty(reqVO.getPlanId()), ProcessBomDO::getPlanId, reqVO.getPlanId()) + .like(!StringUtils.isEmpty(reqVO.getMaterialName()), ProcessBomDetailDO::getMaterialName, reqVO.getMaterialName()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubCode()),"pp.project_sub_code", reqVO.getProjectSubCode()) + .eq(true, ProcessBomDetailDO::getType, BoomDetailTypeEnum.OTHER.getCode()) + .eq(true, ProcessBomDO::getBomStatus, ProcessBomStatusEnum.SUBMIT.getCode()); + + return selectPage(reqVO,query); + } + +// default PageResult selectPage(MaterialPlanBoomPageReqVO reqVO) { +// return selectPage(reqVO, new LambdaQueryWrapperX() +// .eqIfPresent(MaterialPlanBoomDO::getId, reqVO.getId()) +// .eqIfPresent(MaterialPlanBoomDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()) +// .eqIfPresent(MaterialPlanBoomDO::getBoomDetailId, reqVO.getBoomDetailId()) +// .eqIfPresent(MaterialPlanBoomDO::getProjectPlanSubId, reqVO.getProjectPlanSubId()) +// .eqIfPresent(MaterialPlanBoomDO::getBoomAmount, reqVO.getBoomAmount()) +// .betweenIfPresent(MaterialPlanBoomDO::getBoomArriveDate, reqVO.getBoomArriveDate()) +// .eqIfPresent(MaterialPlanBoomDO::getDescription, reqVO.getDescription()) +// .betweenIfPresent(MaterialPlanBoomDO::getCreateTime, reqVO.getCreateTime()) +// .orderByDesc(MaterialPlanBoomDO::getId)); +// } + + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java new file mode 100644 index 00000000..b75379c0 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java @@ -0,0 +1,83 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.enums.BoomDetailTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.*; +import org.springframework.util.StringUtils; + +/** + * 物料需求计划加工件明细 Mapper + * + * @author 管理员 + */ +@Mapper +public interface MaterialPlanBoomMapper extends BaseMapperX { + + default PageResult selectPage(MaterialPlanBoomPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(MaterialPlanBoomDO.class) + .select("pd.material_name as materialName") + .select( "pp.project_sub_code as projectSubCode") + .select("pd.spec as boomSpec","pd.unit as boomUnit","bc.`name` as compositionName") + .leftJoin(ProcessBomDetailDO.class, "pd", ProcessBomDetailDO::getId, MaterialPlanBoomDO::getBoomDetailId) + .leftJoin(PlanSubDO.class, "pp", PlanSubDO::getId, MaterialPlanBoomDO::getProjectPlanSubId) + .leftJoin(CompositionDO.class, "bc", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .orderByDesc(MaterialPlanBoomDO::getId) + .disableSubLogicDel() + ; + + query.eq(reqVO.getProjectMaterialPlanId() != null, MaterialPlanBoomDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()); + + return selectPage(reqVO,query); + } + + default PageResult selectSumPage(MaterialPlanBoomPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(MaterialPlanBoomDO.class) + .select("pd.material_name as materialName") + .select( "pp.project_sub_code as projectSubCode") + .select("pd.spec as boomSpec","pd.unit as boomUnit","bc.`name` as compositionName","pd.`composition_id` as compositionId") + .select("sum(t.boom_amount) as boomAmount","min(t.boom_arrive_date) as boomArriveDate") + .leftJoin(ProcessBomDetailDO.class, "pd", ProcessBomDetailDO::getId, MaterialPlanBoomDO::getBoomDetailId) + .leftJoin(PlanSubDO.class, "pp", PlanSubDO::getId, MaterialPlanBoomDO::getProjectPlanSubId) + .leftJoin(CompositionDO.class, "bc", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .groupBy(MaterialPlanBoomDO::getBoomDetailId) + .orderByDesc(MaterialPlanBoomDO::getId) + .disableSubLogicDel() + ; + + query.eq(reqVO.getProjectMaterialPlanId() != null, MaterialPlanBoomDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()) + .like(!StringUtils.isEmpty(reqVO.getMaterialName()),"pd.material_name",reqVO.getMaterialName()) + .like(!StringUtils.isEmpty(reqVO.getBoomSpec()),"pd.spec",reqVO.getBoomSpec()) + .eq(reqVO.getCompositionId()!=null,"bc.id",reqVO.getCompositionId()); + + return selectPage(reqVO,query); + } + +// default PageResult selectPage(MaterialPlanBoomPageReqVO reqVO) { +// return selectPage(reqVO, new LambdaQueryWrapperX() +// .eqIfPresent(MaterialPlanBoomDO::getId, reqVO.getId()) +// .eqIfPresent(MaterialPlanBoomDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()) +// .eqIfPresent(MaterialPlanBoomDO::getBoomDetailId, reqVO.getBoomDetailId()) +// .eqIfPresent(MaterialPlanBoomDO::getProjectPlanSubId, reqVO.getProjectPlanSubId()) +// .eqIfPresent(MaterialPlanBoomDO::getBoomAmount, reqVO.getBoomAmount()) +// .betweenIfPresent(MaterialPlanBoomDO::getBoomArriveDate, reqVO.getBoomArriveDate()) +// .eqIfPresent(MaterialPlanBoomDO::getDescription, reqVO.getDescription()) +// .betweenIfPresent(MaterialPlanBoomDO::getCreateTime, reqVO.getCreateTime()) +// .orderByDesc(MaterialPlanBoomDO::getId)); +// } + + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplandetail/MaterialPlanDetailMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplandetail/MaterialPlanDetailMapper.java index 2dced6a3..2f937bbb 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplandetail/MaterialPlanDetailMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplandetail/MaterialPlanDetailMapper.java @@ -11,7 +11,9 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlan import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO; import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.mysql.cj.x.protobuf.MysqlxDatatypes; import org.apache.ibatis.annotations.Mapper; import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*; import org.springframework.util.StringUtils; @@ -28,14 +30,38 @@ public interface MaterialPlanDetailMapper extends BaseMapperX query = new MPJLambdaWrapper<>(); query.selectAll(MaterialPlanDetailDO.class) - .select("mat.id as matId","mat.name as matName","mat.code as matCode","mat.spec as matSpec","mat.unit as matUnit","mat.material_type as matType") + .select("mat.id as matId","mat.name as matName","mat.code as matCode","mat.spec as matSpec") + .select("(select label from system_dict_data where dict_type = 'heli_material_unit' and value=mat.unit) as matUnit") + .select("(select label from system_dict_data where dict_type = 'heli_material_type' and value=mat.material_type) as matType") + .select("sum(ifnull(sm.storage_ok_qty,0)) as matRest") .leftJoin(MaterialDO.class, "mat", MaterialDO::getId, MaterialPlanDetailDO::getMaterialId) + .leftJoin(StorageMaterialDO.class,"sm",StorageMaterialDO::getId, MaterialPlanDetailDO::getMaterialId) .disableSubLogicDel() + .groupBy(MaterialPlanDetailDO::getMaterialId) .orderByDesc(MaterialPlanDetailDO::getCreateTime); query.eq(reqVO.getProjectMaterialPlanId()!=null,MaterialPlanDetailDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()).orderByAsc(MaterialPlanDetailDO::getCreateTime); return selectPage(reqVO, query); } + + default PageResult selectSumPage(MaterialPlanDetailPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(MaterialPlanDetailDO.class) + .select("mat.id as matId","mat.name as matName","mat.code as matCode","mat.spec as matSpec","mat.unit as matUnit","mat.material_type as matType") + .select("sum(t.require_amount) as requireAmount","min(t.require_arrive_time) as requireArriveTime") + .leftJoin(MaterialDO.class, "mat", MaterialDO::getId, MaterialPlanDetailDO::getMaterialId) + .disableSubLogicDel() + .groupBy(MaterialPlanDetailDO::getMaterialId) + .orderByDesc(MaterialPlanDetailDO::getCreateTime); + query.eq(reqVO.getProjectMaterialPlanId()!=null,MaterialPlanDetailDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()) + .like(!StringUtils.isEmpty(reqVO.getMatName()), "mat.name", reqVO.getMatName()) + .like(!StringUtils.isEmpty(reqVO.getMatCode()), "mat.code", reqVO.getMatCode()) + .eq(!StringUtils.isEmpty(reqVO.getMatType()), "mat.material_type", reqVO.getMatType()) + .orderByAsc(MaterialPlanDetailDO::getCreateTime); + + return selectPage(reqVO, query); + } // default PageResult selectPage(MaterialPlanDetailPageReqVO reqVO) { // return selectPage(reqVO, new LambdaQueryWrapperX() // .eqIfPresent(MaterialPlanDetailDO::getId, reqVO.getId()) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java index 268f2d6f..a25432a8 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plan/PlanMapper.java @@ -32,6 +32,7 @@ public interface PlanMapper extends BaseMapperX { .leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, PlanDO::getProjectId) .leftJoin(AdminUserDO.class, "u", AdminUserDO::getId, ProjectOrderDO::getBusinessMan) .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(AdminUserDO.class, "f", AdminUserDO::getId, PlanDO::getProjectOwner) .disableSubLogicDel() .orderByDesc(PlanDO::getPlanNo); query.like(!StringUtils.isEmpty(reqVO.getPlanNo()), PlanDO::getPlanNo, reqVO.getPlanNo()) @@ -39,7 +40,7 @@ public interface PlanMapper extends BaseMapperX { .like(!StringUtils.isEmpty(reqVO.getCustomerName()), "e.name", reqVO.getCustomerName()) .like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName()) .like(!StringUtils.isEmpty(reqVO.getBusinessManName()), "u.nickname", reqVO.getBusinessManName()) - .like(!StringUtils.isEmpty(reqVO.getProjectOwner()), PlanDO::getProjectOwner, reqVO.getProjectOwner()) + .like(!StringUtils.isEmpty(reqVO.getProjectOwner()), "f.nickname", reqVO.getProjectOwner()) .eq(reqVO.getBusinessLine() != null, ProjectOrderDO::getBusinessLine, reqVO.getBusinessLine()) .eq(reqVO.getProperty() != null, ProjectOrderDO::getProperty, reqVO.getProperty()) .eq(reqVO.getStatus() != null, PlanDO::getStatus, reqVO.getStatus()); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java index 85af0656..cef58ff7 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plansub/PlanSubMapper.java @@ -6,6 +6,8 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.*; @@ -18,21 +20,15 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.*; public interface PlanSubMapper extends BaseMapperX { default PageResult selectPage(PlanSubPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(PlanSubDO::getId, reqVO.getId()) - .eqIfPresent(PlanSubDO::getProjectPlanId, reqVO.getProjectPlanId()) - .eqIfPresent(PlanSubDO::getProjectId, reqVO.getProjectId()) - .eqIfPresent(PlanSubDO::getProjectSubId, reqVO.getProjectSubId()) - .eqIfPresent(PlanSubDO::getMouldId, reqVO.getMouldId()) - .eqIfPresent(PlanSubDO::getEquipId, reqVO.getEquipId()) - .betweenIfPresent(PlanSubDO::getBlankDate, reqVO.getBlankDate()) - .betweenIfPresent(PlanSubDO::getTwoDimDate, reqVO.getTwoDimDate()) - .eqIfPresent(PlanSubDO::getBlankOwner, reqVO.getBlankOwner()) - .eqIfPresent(PlanSubDO::getTwoDimOwner, reqVO.getTwoDimOwner()) - .betweenIfPresent(PlanSubDO::getThreeDimDate, reqVO.getThreeDimDate()) - .eqIfPresent(PlanSubDO::getThreeDimOwner, reqVO.getThreeDimOwner()) - .betweenIfPresent(PlanSubDO::getCreateTime, reqVO.getCreateTime()) - .orderByAsc(PlanSubDO::getId)); + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(PlanSubDO.class) + .select("a.name as projectSubName") + .leftJoin(ProjectOrderSubDO.class, "a", ProjectOrderSubDO::getId, PlanSubDO::getProjectSubId) + .disableSubLogicDel() + .orderByAsc(PlanSubDO::getId); + + query.eq(reqVO.getProjectPlanId() != null, PlanSubDO::getProjectPlanId, reqVO.getProjectPlanId()); + return selectPage(reqVO, query); } -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plantask/PlanTaskMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plantask/PlanTaskMapper.java new file mode 100644 index 00000000..e32958f8 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plantask/PlanTaskMapper.java @@ -0,0 +1,87 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.plantask; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask.PlanTaskDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.plantask.vo.*; +import org.springframework.util.StringUtils; + +/** + * 生产计划任务 Mapper + * + * @author 管理员 + */ +@Mapper +public interface PlanTaskMapper extends BaseMapperX { + + default PageResult selectPage(PlanTaskPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(PlanTaskDO.class) + .select("e.name as customerName","p.code as projectCode","p.project_name as projectName","p.project_end_time as projectEndTime") + .select("pl.plan_no as planNo","ps.project_sub_code as projectSubCode","po.name as projectSubName","concat('BOM-', ps.project_sub_code) as bomCode") + .leftJoin(PlanDO.class, "pl", PlanDO::getId, PlanTaskDO::getProjectPlanId) + .leftJoin(PlanSubDO.class, "ps", PlanSubDO::getId, PlanTaskDO::getProjectPlanSubId) + .leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, PlanTaskDO::getProjectId) + .leftJoin(ProjectOrderSubDO.class, "po", ProjectOrderSubDO::getId, PlanSubDO::getProjectSubId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(ProcessBomDO.class, "pb", ProcessBomDO::getId, PlanTaskDO::getProcessBomId) + .disableSubLogicDel() + .orderByDesc(PlanTaskDO::getCreateTime); + query.like(!StringUtils.isEmpty(reqVO.getTaskNo()), PlanTaskDO::getTaskNo, reqVO.getTaskNo()) + .like(!StringUtils.isEmpty(reqVO.getProjectCode()), "p.code", reqVO.getProjectCode()) + .like(!StringUtils.isEmpty(reqVO.getCustomerName()), "e.name", reqVO.getCustomerName()) + .like(!StringUtils.isEmpty(reqVO.getProjectName()), "p.project_name", reqVO.getProjectName()) + .like(!StringUtils.isEmpty(reqVO.getPlanNo()), "pl.plan_no", reqVO.getPlanNo()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubCode()), "ps.project_sub_code", reqVO.getProjectSubCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubName()), "po.name", reqVO.getProjectSubName()) + .eq(reqVO.getStatus() != null, PlanTaskDO::getStatus, reqVO.getStatus()); + + return selectPage(reqVO, query); + +// return selectPage(reqVO, new LambdaQueryWrapperX() +// .eqIfPresent(PlanTaskDO::getId, reqVO.getId()) +// .eqIfPresent(PlanTaskDO::getProjectId, reqVO.getProjectId()) +// .eqIfPresent(PlanTaskDO::getProjectPlanId, reqVO.getProjectPlanId()) +// .eqIfPresent(PlanTaskDO::getProjectPlanSubId, reqVO.getProjectPlanSubId()) +// .eqIfPresent(PlanTaskDO::getProcessBomId, reqVO.getProcessBomId()) +// .eqIfPresent(PlanTaskDO::getTaskNo, reqVO.getTaskNo()) +// .eqIfPresent(PlanTaskDO::getBomVersion, reqVO.getBomVersion()) +// .eqIfPresent(PlanTaskDO::getDescription, reqVO.getDescription()) +// .eqIfPresent(PlanTaskDO::getStatus, reqVO.getStatus()) +// .betweenIfPresent(PlanTaskDO::getCreateTime, reqVO.getCreateTime()) +// .orderByDesc(PlanTaskDO::getId)); + } + + default PlanTaskDO selectById(Long id) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(PlanTaskDO.class) + .select("e.name as customerName","p.code as projectCode","p.project_name as projectName","p.project_end_time as projectEndTime") + .select("pl.plan_no as planNo","ps.project_sub_code as projectSubCode","po.name as projectSubName","concat('BOM-', ps.project_sub_code) as bomCode") + .leftJoin(PlanDO.class, "pl", PlanDO::getId, PlanTaskDO::getProjectPlanId) + .leftJoin(PlanSubDO.class, "ps", PlanSubDO::getId, PlanTaskDO::getProjectPlanSubId) + .leftJoin(ProjectOrderDO.class, "p", ProjectOrderDO::getId, PlanTaskDO::getProjectId) + .leftJoin(ProjectOrderSubDO.class, "po", ProjectOrderSubDO::getId, PlanSubDO::getProjectSubId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(ProcessBomDO.class, "pb", ProcessBomDO::getId, PlanTaskDO::getProcessBomId) + .eq(PlanTaskDO::getId, id) + .last("LIMIT 1") + .disableSubLogicDel(); + return selectOne(query); + } + + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plantaskbom/PlanTaskBomMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plantaskbom/PlanTaskBomMapper.java new file mode 100644 index 00000000..9e633f68 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/plantaskbom/PlanTaskBomMapper.java @@ -0,0 +1,58 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.plantaskbom; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom.vo.PlanTaskBomPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask.PlanTaskDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; + +/** + * 生产计划任务Bom Mapper + * + * @author 管理员 + */ +@Mapper +public interface PlanTaskBomMapper extends BaseMapperX { + + default PageResult selectPage(PlanTaskBomPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(PlanTaskBomDO.class) + .select("f.material_name as materialName", "f.blueprint_no as blueprintNo") + .select("f.type as type","f.material_id as materialId","f.material_code as materialCode") + .select("f.composition_id as compositionId","f.spec as spec","f.unit as unit","f.amount as amount") + .select("g.name as compositionName") + .select("u1.nickname as ownerName") + .leftJoin(PlanTaskDO.class, "a", PlanTaskDO::getId, PlanTaskBomDO::getTaskId) + .leftJoin(PlanSubDO.class, "b", PlanSubDO::getId, PlanTaskDO::getProjectPlanSubId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, PlanSubDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, PlanTaskDO::getProjectId) + .leftJoin(ProcessBomDetailDO.class, "f", ProcessBomDetailDO::getId, PlanTaskBomDO::getBomDetailId) + .leftJoin(CompositionDO.class,"g", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, PlanTaskBomDO::getOwner) + .disableSubLogicDel(); + if(reqVO.getSortByBlueprintNo() != null && reqVO.getSortByBlueprintNo()){ + query.orderByAsc(ProcessBomDetailDO::getBlueprintNo); + }else{ + query.orderByDesc(PlanTaskBomDO::getId); + } + + query.eq(reqVO.getTaskId() != null, PlanTaskDO::getId, reqVO.getTaskId()) + .eq(reqVO.getProjectId() != null, PlanTaskDO::getProjectId, reqVO.getProjectId()) + .eq(reqVO.getProjectSubId() != null, ProjectOrderSubDO::getId, reqVO.getProjectSubId()) + .eq(!StringUtils.isEmpty(reqVO.getMaterialType()), ProcessBomDetailDO::getType, reqVO.getMaterialType()) + .eq(reqVO.getProjectPlanId() != null, PlanTaskDO::getProjectPlanId, reqVO.getProjectPlanId()) + .eq(reqVO.getProjectPlanSubId() != null, PlanTaskDO::getProjectPlanSubId, reqVO.getProjectPlanSubId()) + ; + return selectPage(reqVO, query); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processbom/ProcessBomMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processbom/ProcessBomMapper.java index 96e8fd2f..cba8e450 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processbom/ProcessBomMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processbom/ProcessBomMapper.java @@ -7,7 +7,6 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.github.yulichang.wrapper.MPJLambdaWrapper; @@ -25,7 +24,7 @@ public interface ProcessBomMapper extends BaseMapperX { default PageResult selectPage(ProcessBomPageReqVO reqVO) { MPJLambdaWrapper query = new MPJLambdaWrapper<>(); query.selectAll(ProcessBomDO.class) - .select("concat('BOM-', e.project_sub_code) as code") + .select("concat('BOM-', e.project_sub_code) as bomCode", "e.project_sub_code as projectSubCode") .select("a.plan_no as planCode", "b.code as projectCode", "c.name as customerName", "b.project_name as projectName") .select("d.name as projectSubName") .leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessBomDO::getPlanId) @@ -37,7 +36,7 @@ public interface ProcessBomMapper extends BaseMapperX { .disableSubLogicDel() ; - query.like(!StringUtils.isEmpty(reqVO.getCode()), ProcessBomDO::getCode, reqVO.getCode()) + query.and(!StringUtils.isEmpty(reqVO.getCode()), QueryWrapper -> QueryWrapper.apply("locate({0},concat('BOM-', e.project_sub_code )) > 0", reqVO.getCode())) .like(!StringUtils.isEmpty(reqVO.getPlanCode()), PlanDO::getPlanNo, reqVO.getPlanCode()) .like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode()) .like(!StringUtils.isEmpty(reqVO.getCustomerName()), CustomerDO::getName, reqVO.getCustomerName()) @@ -52,7 +51,7 @@ public interface ProcessBomMapper extends BaseMapperX { default ProcessBomDO selectById(Long id) { MPJLambdaWrapper query = new MPJLambdaWrapper<>(); query.selectAll(ProcessBomDO.class) - .select("concat('BOM-', e.project_sub_code) as code") + .select("concat('BOM-', e.project_sub_code) as bomCode", "e.project_sub_code as projectSubCode") .select("a.plan_no as planCode", "b.code as projectCode", "c.name as customerName", "b.project_name as projectName") .select("d.name as projectSubName") .leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessBomDO::getPlanId) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java index 9725b19c..328431ba 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/processdesign/ProcessDesignMapper.java @@ -8,6 +8,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.heli.enums.ProcessDesignTypeEnum; import com.chanko.yunxi.mes.module.heli.enums.ProjectPlanStatusEnum; import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; import com.github.yulichang.wrapper.MPJLambdaWrapper; @@ -25,6 +26,7 @@ public interface ProcessDesignMapper extends BaseMapperX { default PageResult selectPage(ProcessDesignPageReqVO reqVO) { MPJLambdaWrapper query = new MPJLambdaWrapper<>(); query.selectAll(ProcessDesignDO.class) + .select("a.status as planStatus") .select("a.plan_no as planCode","a.has_craft as hasCraft", "a.craft_start_date as craftStartDate", "a.craft_end_date as craftEndDate", "e.name as customerName") .select("d.code as projectCode", "d.project_name as projectName", "d.business_line as businessLine", "d.property","d.is_urgency as isUrgency") .select("u1.nickname as projectOwnerName", "u2.nickname as craftOwnerName") @@ -64,10 +66,16 @@ public interface ProcessDesignMapper extends BaseMapperX { ; if(!StringUtils.isEmpty(reqVO.getOwner())){ - query.and(QueryWrapper -> QueryWrapper.eq("u2.id", reqVO.getOwner()).or().eq("u3.id", reqVO.getOwner()).or().eq("u4.id", reqVO.getOwner()).or().eq("u5.id", reqVO.getOwner())); + query.and(QueryWrapper -> QueryWrapper.apply("u2.id = {0} and t.process_design_type = {1}", reqVO.getOwner(), ProcessDesignTypeEnum.BLUEPRINT_FOUNDRY_TECHNOLOGY.name()) + .or() + .apply("u3.id = {0} and t.process_design_type = {1}", reqVO.getOwner(), ProcessDesignTypeEnum.BLUEPRINT_WORKBLANK.name()) + .or() + .apply("u4.id = {0} and t.process_design_type = {1}", reqVO.getOwner(), ProcessDesignTypeEnum.BLUEPRINT_2D.name()) + .or() + .apply("u5.id = {0} and t.process_design_type = {1}", reqVO.getOwner(), ProcessDesignTypeEnum.BLUEPRINT_3D.name())); } if(reqVO.getUncompletedDesign() != null && reqVO.getUncompletedDesign()){ - query.and(QueryWrapper -> QueryWrapper.lt("z.progress", "100").ne(PlanDO::getStatus, ProjectPlanStatusEnum.TERMINATE.getCode())); + query.and(QueryWrapper -> QueryWrapper.apply("COALESCE(z.progress, 0) < {0}", 100).ne(PlanDO::getStatus, ProjectPlanStatusEnum.TERMINATE.getCode())); } return selectPage(reqVO, query); @@ -76,6 +84,7 @@ public interface ProcessDesignMapper extends BaseMapperX { default ProcessDesignDO selectById(Long id) { MPJLambdaWrapper query = new MPJLambdaWrapper<>(); query.selectAll(ProcessDesignDO.class) + .select("a.status as planStatus") .select("a.plan_no as planCode","a.has_craft as hasCraft", "a.craft_start_date as craftStartDate", "a.craft_end_date as craftEndDate", "e.name as customerName") .select("d.code as projectCode", "d.project_name as projectName", "d.business_line as businessLine", "d.property","d.is_urgency as isUrgency") .select("u1.nickname as projectOwnerName", "u2.nickname as craftOwnerName") @@ -101,9 +110,11 @@ public interface ProcessDesignMapper extends BaseMapperX { default PageResult selectPageOverview(ProcessDesignPageReqVO reqVO) { MPJLambdaWrapper query = new MPJLambdaWrapper<>(); query.select(ProcessDesignDO::getProjectId, ProcessDesignDO::getProjectSubId) + .select("a.status as planStatus") .select("c.name as projectSubName") .select("e.name as customerName") .select("d.code as projectCode", "d.project_name as projectName", "d.business_line as businessLine", "d.property","d.is_urgency as isUrgency") + .leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessDesignDO::getPlanId) .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId) .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId) .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderMapper.java index 8220ffc1..04f033e5 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderMapper.java @@ -1,9 +1,9 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder; +import cn.hutool.core.collection.CollUtil; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO; @@ -41,7 +41,8 @@ public interface ProjectOrderMapper extends BaseMapperX { .in(reqVO.getDeliveryStatusList() != null && !reqVO.getDeliveryStatusList().isEmpty(), ProjectOrderDO::getDeliveryStatus, reqVO.getDeliveryStatusList()) .eq(reqVO.getIsSnapshot() != null, ProjectOrderDO::getIsSnapshot, reqVO.getIsSnapshot()) .eq(reqVO.getHasAlter() != null, ProjectOrderDO::getHasAlter, reqVO.getHasAlter()) - .like(!StringUtils.isEmpty(reqVO.getSnapshotCode()), ProjectOrderDO::getSnapshotCode, reqVO.getSnapshotCode()); + .like(!StringUtils.isEmpty(reqVO.getSnapshotCode()), ProjectOrderDO::getSnapshotCode, reqVO.getSnapshotCode()) + .in(CollUtil.isNotEmpty(reqVO.getIdList()), ProjectOrderDO::getId, reqVO.getIdList()) ; return selectPage(reqVO, query); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderSubMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderSubMapper.java index a903fc62..062bb4ca 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderSubMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/projectorder/ProjectOrderSubMapper.java @@ -1,12 +1,22 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSubPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo.InspectionReportPageReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.equip.EquipDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.ProjectOrderStatusEnum; +import com.chanko.yunxi.mes.module.heli.enums.YesOrNoEnum; +import com.chanko.yunxi.mes.module.infra.dal.dataobject.file.FileDO; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; import java.util.List; @@ -35,4 +45,74 @@ public interface ProjectOrderSubMapper extends BaseMapperX { return delete(ProjectOrderSubDO::getProjectOrderId, projectOrderId); } + default PageResult getInspectionReportPage(InspectionReportPageReqVO pageReqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(ProjectOrderSubDO.class) + .select("t.id as projectSubId", "a.id as projectId") + .select("a.project_name as projectName", "a.code as projectCode") + .select("d.name as customerName") + .select("t.name as projectSubName", "c.project_sub_code as projectSubCode") + .selectCount(FileDO::getId, "attachmentCount") + .leftJoin(ProjectOrderDO.class, "a", ProjectOrderDO::getId, ProjectOrderSubDO::getProjectOrderId) + .leftJoin(FileDO.class, "b", + QueryWrapper -> QueryWrapper.eq(FileDO::getBusinessType, BusinesTypeEnum.INSPECTION_REPORT.name()) + .eq(FileDO::getBusinessId, ProjectOrderSubDO::getId).eq(FileDO::getDeleted, YesOrNoEnum.N.getCode())) + .leftJoin(PlanSubDO.class, "c", PlanSubDO::getProjectSubId, ProjectOrderSubDO::getId) + .leftJoin(CustomerDO.class, "d", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .disableSubLogicDel() + .groupBy(ProjectOrderSubDO::getId) + .orderByDesc(ProjectOrderDO::getId) + ; + query.eq(ProjectOrderDO::getOrderStatus, ProjectOrderStatusEnum.APPROVE.getCode()) + .eq(ProjectOrderDO::getIsSnapshot, YesOrNoEnum.N.getCode()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectName()), ProjectOrderDO::getProjectName, pageReqVO.getProjectName()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), ProjectOrderSubDO::getName, pageReqVO.getProjectSubName()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectSubCode()), PlanSubDO::getProjectSubCode, pageReqVO.getProjectSubCode()); + + return selectPage(pageReqVO, query); + } + + default ProjectOrderSubDO getInspectionReport(Long id) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(ProjectOrderSubDO.class) + .select("t.id as projectSubId", "a.id as projectId") + .select("a.project_name as projectName", "a.code as projectCode") + .select("d.name as customerName") + .select("t.name as projectSubName", "c.project_sub_code as projectSubCode") + .selectCount(FileDO::getId, "attachmentCount") + .leftJoin(ProjectOrderDO.class, "a", ProjectOrderDO::getId, ProjectOrderSubDO::getProjectOrderId) + .leftJoin(PlanSubDO.class, "c", PlanSubDO::getProjectSubId, ProjectOrderSubDO::getId) + .leftJoin(CustomerDO.class, "d", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .disableSubLogicDel() + .eq(ProjectOrderSubDO::getId, id) + .eq(ProjectOrderDO::getIsSnapshot, YesOrNoEnum.N.getCode()) + .groupBy(ProjectOrderSubDO::getId) + .last("LIMIT 1") + ; + return selectOne(query); + } + + default PageResult getProjectOrderSubPage(ProjectOrderSubPageReqVO pageReqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(ProjectOrderSubDO.class) + .select("t.id as projectSubId", "a.id as projectId") + .select("a.project_name as projectName", "a.code as projectCode") + .select("d.name as customerName") + .select("t.name as projectSubName", "c.project_sub_code as projectSubCode") + .leftJoin(ProjectOrderDO.class, "a", ProjectOrderDO::getId, ProjectOrderSubDO::getProjectOrderId) + .leftJoin(PlanSubDO.class, "c", PlanSubDO::getProjectSubId, ProjectOrderSubDO::getId) + .leftJoin(CustomerDO.class, "d", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .disableSubLogicDel() + .orderByDesc(ProjectOrderDO::getId); + + query.eq(ProjectOrderDO::getOrderStatus, ProjectOrderStatusEnum.APPROVE.getCode()) + .eq(ProjectOrderDO::getIsSnapshot, YesOrNoEnum.N.getCode()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectCode()), ProjectOrderDO::getCode, pageReqVO.getProjectCode()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectName()), ProjectOrderDO::getProjectName, pageReqVO.getProjectName()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), ProjectOrderSubDO::getName, pageReqVO.getProjectSubName()) + .like(!StringUtils.isEmpty(pageReqVO.getProjectSubCode()), PlanSubDO::getProjectSubCode, pageReqVO.getProjectSubCode()); + + return selectPage(pageReqVO, query); + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseorderboom/PurchaseOrderBoomMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseorderboom/PurchaseOrderBoomMapper.java new file mode 100644 index 00000000..84e047c0 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseorderboom/PurchaseOrderBoomMapper.java @@ -0,0 +1,56 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorderboom; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.MaterialPlanDetailPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom.vo.*; + +/** + * 采购订单加工件明细 Mapper + * + * @author 管理员 + */ +@Mapper +public interface PurchaseOrderBoomMapper extends BaseMapperX { + +// default PageResult selectPage(PurchaseOrderBoomPageReqVO reqVO) { +// MPJLambdaWrapper query = new MPJLambdaWrapper<>(); +// +// query.selectAll(PurchaseOrderBoomDO.class) +// .orderByDesc(PurchaseOrderBoomDO::getId); +// query.eq(reqVO.getPurchaseOrderId()!=null,PurchaseOrderBoomDO::getPurchaseOrderId, reqVO.getPurchaseOrderId()) +// .eq(true,PurchaseOrderBoomDO::getBoomDetailId,MaterialPlanBoomDO::getBoomDetailId) +// .orderByAsc(PurchaseOrderBoomDO::getCreateTime); +// +// return selectPage(reqVO, query); +// } + default PageResult selectPage(PurchaseOrderBoomPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(PurchaseOrderBoomDO::getId, reqVO.getId()) + .eqIfPresent(PurchaseOrderBoomDO::getPurchaseOrderId, reqVO.getPurchaseOrderId()) + .eqIfPresent(PurchaseOrderBoomDO::getBoomDetailId, reqVO.getBoomDetailId()) + .likeIfPresent(PurchaseOrderBoomDO::getBoomName, reqVO.getBoomName()) + .eqIfPresent(PurchaseOrderBoomDO::getBoomSpec, reqVO.getBoomSpec()) + .eqIfPresent(PurchaseOrderBoomDO::getBoomUnit, reqVO.getBoomUnit()) + .eqIfPresent(PurchaseOrderBoomDO::getComposition, reqVO.getComposition()) + .eqIfPresent(PurchaseOrderBoomDO::getPurchaseAmount, reqVO.getPurchaseAmount()) + .eqIfPresent(PurchaseOrderBoomDO::getEstimatedPrice, reqVO.getEstimatedPrice()) + .eqIfPresent(PurchaseOrderBoomDO::getActualPrice, reqVO.getActualPrice()) + .betweenIfPresent(PurchaseOrderBoomDO::getArriveTime, reqVO.getArriveTime()) + .eqIfPresent(PurchaseOrderBoomDO::getDescription, reqVO.getDescription()) + .betweenIfPresent(PurchaseOrderBoomDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(PurchaseOrderBoomDO::getId)); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordermaterial/PurchaseOrderMaterialMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordermaterial/PurchaseOrderMaterialMapper.java index ffe9c494..a41bdbf2 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordermaterial/PurchaseOrderMaterialMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordermaterial/PurchaseOrderMaterialMapper.java @@ -7,8 +7,12 @@ import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.MaterialPlanDetailPageReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*; @@ -26,10 +30,18 @@ public interface PurchaseOrderMaterialMapper extends BaseMapperX { + + default PageResult selectPage(QualityFeedbackPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(QualityFeedbackDO.class) + .select("e.name as customerName") + .select("d.code as projectCode", "d.project_name as projectName") + .select("c.name as projectSubName", "b.project_sub_code as projectSubCode") + .select("u1.nickname as creatorName", "u2.nickname as updaterName") + .leftJoin(PlanSubDO.class, "b", PlanSubDO::getProjectSubId, QualityFeedbackDO::getProjectSubId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, QualityFeedbackDO::getCreator) + .leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, QualityFeedbackDO::getUpdater) + .disableSubLogicDel() + .orderByDesc(QualityFeedbackDO::getId) + ; + + query.like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName()) + .like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubCode()), PlanSubDO::getProjectSubCode, reqVO.getProjectSubCode()); + + return selectPage(reqVO, query); + } + + default QualityFeedbackDO selectById(Long id) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(QualityFeedbackDO.class) + .select("e.name as customerName") + .select("d.code as projectCode", "d.project_name as projectName") + .select("c.name as projectSubName", "b.project_sub_code as projectSubCode") + .select("u1.nickname as creatorName", "u2.nickname as updaterName") + .leftJoin(PlanSubDO.class, "b", PlanSubDO::getProjectSubId, QualityFeedbackDO::getProjectSubId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, QualityFeedbackDO::getCreator) + .leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, QualityFeedbackDO::getUpdater) + .disableSubLogicDel() + .eq(QualityFeedbackDO::getId, id) + .last("LIMIT 1") + ; + return selectOne(query); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheck/StorageCheckMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheck/StorageCheckMapper.java index c8ced4c5..5838b94d 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheck/StorageCheckMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagecheck/StorageCheckMapper.java @@ -5,9 +5,18 @@ import java.util.*; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSubPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheck.StorageCheckDO; +import com.chanko.yunxi.mes.module.heli.enums.ProjectOrderStatusEnum; +import com.chanko.yunxi.mes.module.heli.enums.YesOrNoEnum; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; import com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.vo.*; +import org.springframework.util.StringUtils; /** * 入/出库盘点 Mapper diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagelog/StorageLogNowMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagelog/StorageLogNowMapper.java index dab54a7b..ca8d63a9 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagelog/StorageLogNowMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagelog/StorageLogNowMapper.java @@ -5,6 +5,7 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageLogPageReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageNowAllReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; @@ -29,6 +30,7 @@ public interface StorageLogNowMapper extends BaseMapperX { .orderByDesc(StorageLogNowDO::getId); query.like(!StringUtils.isEmpty(reqVO.getMatType()),StorageLogNowDO::getMatType, reqVO.getMatType()) + .like(!StringUtils.isEmpty(reqVO.getMatSpec()),StorageLogNowDO::getMatSpec, reqVO.getMatSpec()) .eq(reqVO.getWhId()!= null,StorageLogNowDO::getWhId, reqVO.getWhId()) .eq(reqVO.getRgId()!= null,StorageLogNowDO::getRgId, reqVO.getRgId()) .eq(reqVO.getPnId()!= null,StorageLogNowDO::getPnId, reqVO.getPnId()) @@ -40,8 +42,53 @@ public interface StorageLogNowMapper extends BaseMapperX { return selectPage(reqVO,query); } + default PageResult selectPageAll(StorageLogPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(StorageLogNowDO.class) + .orderByDesc(StorageLogNowDO::getId); + + query.like(!StringUtils.isEmpty(reqVO.getMatType()),StorageLogNowDO::getMatType, reqVO.getMatType()) + .like(!StringUtils.isEmpty(reqVO.getMatSpec()),StorageLogNowDO::getMatSpec, reqVO.getMatSpec()) + .eq(reqVO.getWhId()!= null,StorageLogNowDO::getWhId, reqVO.getWhId()) + .eq(reqVO.getRgId()!= null,StorageLogNowDO::getRgId, reqVO.getRgId()) + .eq(reqVO.getPnId()!= null,StorageLogNowDO::getPnId, reqVO.getPnId()) + .like(!StringUtils.isEmpty(reqVO.getMatName()), StorageLogNowDO::getMatName, reqVO.getMatName()) + .like(!StringUtils.isEmpty(reqVO.getMatCode()), StorageLogNowDO::getMatCode, reqVO.getMatCode()) + .like(!StringUtils.isEmpty(reqVO.getLotNo()),StorageLogNowDO::getLotNo, reqVO.getLotNo()); + + return selectPage(reqVO,query); + } + PageResult selectAllPage(StorageLogPageReqVO reqVO); +// PageResult selectMaterialWithNow(StorageLogPageReqVO reqVO); +// default PageResult selectMaterialWithNow(StorageLogPageReqVO reqVO){ +// MPJLambdaWrapper query = new MPJLambdaWrapper<>(); +// +// query.selectAll(StorageLogNowDO.class) +// .select("mat.*") +// .rightJoin("(select t.deleted,t.id,t.creator,t.updater,t.create_time,t.update_time,t.tenant_id,t.code as mat_code,t.name as mat_name," + +// "(SELECT label FROM system_dict_data where dict_type='heli_material_type' and value=t.`material_type`) as mat_type," + +// "(SELECT label FROM system_dict_data where dict_type='heli_material_unit' and value=t.`unit`) as mat_unit," + +// "t.spec as mat_spec,t.brand as mat_brand,vm.wh_id,vm.wh_name,vm.rg_id,vm.rg_name,vm.pn_id,vm.pn_name,vm.lot_no," + +// "t.short_name,vm.storage_ok_qty" + +// " from v_storage_material_now vm right join base_material t on t.id=vm.id" + +// " where t.virtual_part='N' and t.status=1 ) mat on mat.id= t.id") +// .orderByDesc(StorageLogNowDO::getId); +// +// query.like(!StringUtils.isEmpty(reqVO.getMatType()),StorageLogNowDO::getMatType, reqVO.getMatType()) +// .like(!StringUtils.isEmpty(reqVO.getMatSpec()),StorageLogNowDO::getMatSpec, reqVO.getMatSpec()) +// .eq(reqVO.getWhId()!= null,"t.wh_id",reqVO.getWhId()).or().eq("mat.wh_id is null or mat.wh_id","''") +// .eq(reqVO.getRgId()!= null,StorageLogNowDO::getRgId, reqVO.getRgId()) +// .eq(reqVO.getPnId()!= null,StorageLogNowDO::getPnId, reqVO.getPnId()) +// .like(!StringUtils.isEmpty(reqVO.getMatName()), StorageLogNowDO::getMatName, reqVO.getMatName()) +// .like(!StringUtils.isEmpty(reqVO.getMatCode()), StorageLogNowDO::getMatCode, reqVO.getMatCode()) +// .like(!StringUtils.isEmpty(reqVO.getLotNo()),StorageLogNowDO::getLotNo, reqVO.getLotNo()); +// +// return selectPage(reqVO,query); +// } + List selectNoZero(StorageNowAllReqVO reqVO); List selectNowList(StorageNowAllReqVO reqVO); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagelog/StorageMaterialMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagelog/StorageMaterialMapper.java new file mode 100644 index 00000000..ded6c1e8 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagelog/StorageMaterialMapper.java @@ -0,0 +1,61 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog; + +import com.alibaba.druid.util.StringUtils; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageLogPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagelog.vo.StorageNowAllReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 入/出库日志 Mapper + * + * @author 管理员 + */ +@Mapper +public interface StorageMaterialMapper extends BaseMapperX { + + + +// PageResult selectMaterialWithNow(StorageLogPageReqVO reqVO); + default PageResult selectMaterialWithNow(StorageLogPageReqVO reqVO){ + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(StorageMaterialDO.class) + .orderByDesc(StorageMaterialDO::getId); + + query.like(!StringUtils.isEmpty(reqVO.getMatType()),StorageMaterialDO::getMatType, reqVO.getMatType()) + .like(!StringUtils.isEmpty(reqVO.getMatSpec()),StorageMaterialDO::getMatSpec, reqVO.getMatSpec()) + .eq(reqVO.getWhId()!= null,"t.wh_id",reqVO.getWhId()).or().eq("t.wh_id is null or t.wh_id","''") + .eq(reqVO.getRgId()!= null,StorageMaterialDO::getRgId, reqVO.getRgId()) + .eq(reqVO.getPnId()!= null,StorageMaterialDO::getPnId, reqVO.getPnId()) + .like(!StringUtils.isEmpty(reqVO.getMatName()), StorageMaterialDO::getMatName, reqVO.getMatName()) + .like(!StringUtils.isEmpty(reqVO.getMatCode()), StorageMaterialDO::getMatCode, reqVO.getMatCode()) + .like(!StringUtils.isEmpty(reqVO.getLotNo()),StorageMaterialDO::getLotNo, reqVO.getLotNo()); + + return selectPage(reqVO,query); + } + + default PageResult selectMaterialGroupNow(StorageLogPageReqVO reqVO){ + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(StorageMaterialDO.class) + .select("ifnull(sum(t.storage_ok_qty),0) mat_rest") + .orderByDesc(StorageMaterialDO::getId); + + query.like(!StringUtils.isEmpty(reqVO.getMatType()),StorageMaterialDO::getMatType, reqVO.getMatType()) + .like(!StringUtils.isEmpty(reqVO.getMatSpec()),StorageMaterialDO::getMatSpec, reqVO.getMatSpec()) + .like(!StringUtils.isEmpty(reqVO.getMatName()), StorageMaterialDO::getMatName, reqVO.getMatName()) + .like(!StringUtils.isEmpty(reqVO.getMatCode()), StorageMaterialDO::getMatCode, reqVO.getMatCode()) + .like(!StringUtils.isEmpty(reqVO.getLotNo()),StorageMaterialDO::getLotNo, reqVO.getLotNo()) + .groupBy(StorageMaterialDO::getId).orderByDesc(StorageMaterialDO::getId); + + return selectPage(reqVO,query); + } +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java index 616451e4..1d7a72f3 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java @@ -7,6 +7,7 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO; import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO; import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; @@ -42,7 +43,11 @@ public interface StorageMatMapper extends BaseMapperX { default List selectMatByStorckID(Long stockId) { MPJLambdaWrapper query = new MPJLambdaWrapper<>(); - query.selectAll(StorageMatDO.class).eq(stockId!= null && stockId!= 0,StorageMatDO::getStockId, stockId); + query.selectAll(StorageMatDO.class) + .select("p.name as projectSubName") + .leftJoin(ProjectOrderSubDO.class,"p",ProjectOrderSubDO::getId,StorageMatDO::getProjectNo) + .disableSubLogicDel() + .eq(stockId!= null && stockId!= 0,StorageMatDO::getStockId, stockId); return selectList(query); } List selectStorageMatValid(Long whId); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java index 4a824885..fa6aa665 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskdispatch/TaskDispatchDetailMapper.java @@ -1,13 +1,21 @@ -package com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatchdetail; - -import java.util.*; +package com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch; +import cn.hutool.core.collection.CollUtil; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetail.TaskDispatchDetailDO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; + +import java.util.List; /** * 派工明细 Mapper @@ -17,6 +25,36 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface TaskDispatchDetailMapper extends BaseMapperX { + default PageResult selectPage(TaskDispatchDetailPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(TaskDispatchDetailDO.class) + .select("a.code as dispatchCode") + .select("b.code as projectCode", "b.project_name as projectName", "c.name as projectSubName") + .select("d.material_name as materialName") + .select("e.name as procedureName") + .selectSum(TaskReportDO::getAmount, "totalReportAmount") + .selectSum(TaskReportDO::getWorkTime, "totalWorkTime") + .leftJoin(TaskDispatchDO.class, "a", TaskDispatchDO::getId, TaskDispatchDetailDO::getDispatchId) + .leftJoin(ProjectOrderDO.class, "b", ProjectOrderDO::getId, TaskDispatchDO::getProjectId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, TaskDispatchDO::getProjectSubId) + .leftJoin(ProcessBomDetailDO.class, "d", ProcessBomDetailDO::getId, TaskDispatchDO::getBomDetailId) + .leftJoin(ProcedureDO.class, "e", ProcedureDO::getId, TaskDispatchDetailDO::getProcedureId) + .leftJoin(TaskReportDO.class, "f", TaskReportDO::getDispatchDetailId, TaskDispatchDetailDO::getId) + .groupBy(TaskDispatchDetailDO::getId) + .orderByDesc(TaskDispatchDetailDO::getId) + .disableSubLogicDel(); + + query.eq(reqVO.getOwner() != null, TaskDispatchDetailDO::getOwner, reqVO.getOwner()) + .in(CollUtil.isNotEmpty(reqVO.getProcedureStatusList()), TaskDispatchDetailDO::getProcedureStatus, reqVO.getProcedureStatusList()) + .eq(reqVO.getIsReport() != null, ProcedureDO::getIsReport, reqVO.getIsReport()) + .eq(!StringUtils.isEmpty(reqVO.getDispatchType()), TaskDispatchDO::getDispatchType, reqVO.getDispatchType()) + .eq(reqVO.getTaskId() != null, TaskDispatchDO::getTaskId, reqVO.getTaskId()) + .eq(reqVO.getBomDetailId() != null, TaskDispatchDO::getBomDetailId, reqVO.getBomDetailId()) + ; + + return selectPage(reqVO, query); + } + default List selectListByDispatchId(Long dispatchId) { return selectList(TaskDispatchDetailDO::getDispatchId, dispatchId); } @@ -25,4 +63,4 @@ public interface TaskDispatchDetailMapper extends BaseMapperX { default PageResult selectPage(TaskDispatchPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(TaskDispatchDO::getCode, reqVO.getCode()) - .eqIfPresent(TaskDispatchDO::getDispatchType, reqVO.getDispatchType()) - .eqIfPresent(TaskDispatchDO::getTaskId, reqVO.getTaskId()) - .eqIfPresent(TaskDispatchDO::getPlanId, reqVO.getPlanId()) - .eqIfPresent(TaskDispatchDO::getProjectId, reqVO.getProjectId()) - .eqIfPresent(TaskDispatchDO::getProjectSubId, reqVO.getProjectSubId()) - .eqIfPresent(TaskDispatchDO::getBomDetailId, reqVO.getBomDetailId()) - .eqIfPresent(TaskDispatchDO::getDispatchStatus, reqVO.getDispatchStatus()) - .eqIfPresent(TaskDispatchDO::getRemark, reqVO.getRemark()) - .eqIfPresent(TaskDispatchDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(TaskDispatchDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(TaskDispatchDO::getId)); + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(TaskDispatchDO.class) + .select("a.plan_no as planCode", "e.name as customerName", "a.craft_content as craftContent") + .select("d.code as projectCode", "d.project_name as projectName", "d.project_end_time as projectEndTime") + .select("c.name as projectSubName", "b.project_sub_code as projectSubCode") + .select("f.material_name as materialName", "f.composition_id as compositionId", "f.spec", "f.blueprint_no as blueprintNo") + .select("case when t.dispatch_type='"+ TaskDispatchTypeEnum.ASSEMBLE.name() +"' then c.unit else f.unit end unit", "case when t.dispatch_type='"+ TaskDispatchTypeEnum.ASSEMBLE.name() +"' then c.amount else f.amount end amount") + .select("g.name as compositionName") + .select("h.task_no as taskCode") + .select("i.require_end_date as requiredCompletedDate") + .select("u1.nickname as ownerName") + .leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessDesignDO::getPlanId) + .leftJoin("project_plan_sub b on b.project_plan_id = t.plan_id and b.project_sub_id = t.project_sub_id") + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(ProcessBomDetailDO.class, "f", ProcessBomDetailDO::getId, TaskDispatchDO::getBomDetailId) + .leftJoin(CompositionDO.class,"g", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .leftJoin(PlanTaskDO.class, "h", PlanTaskDO::getId, TaskDispatchDO::getTaskId) + .leftJoin(PlanTaskBomDO.class, "i", wrapper -> wrapper.eq(PlanTaskBomDO::getTaskId, PlanTaskDO::getId).eq(PlanTaskBomDO::getBomDetailId, TaskDispatchDO::getBomDetailId)) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, PlanTaskBomDO::getOwner) + .orderByDesc(TaskDispatchDO::getId) + .disableSubLogicDel(); + + query.like(!StringUtils.isEmpty(reqVO.getCode()), TaskDispatchDO::getCode, reqVO.getCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode()) + .like(!StringUtils.isEmpty(reqVO.getCustomerName()), CustomerDO::getName, reqVO.getCustomerName()) + .like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubCode()), "b.project_sub_code", reqVO.getProjectSubCode()) + .eq(reqVO.getDispatchStatus() != null, TaskDispatchDO::getDispatchStatus, reqVO.getDispatchStatus()) + .eq(!StringUtils.isEmpty(reqVO.getDispatchType()), TaskDispatchDO::getDispatchType, reqVO.getDispatchType()) + .like(!StringUtils.isEmpty(reqVO.getOwnerName()), "u1.nickname", reqVO.getOwnerName()) + .like(!StringUtils.isEmpty(reqVO.getTaskCode()), PlanTaskDO::getTaskNo, reqVO.getTaskCode()) + .like(!StringUtils.isEmpty(reqVO.getPlanCode()), PlanDO::getPlanNo, reqVO.getPlanCode()) + ; + return selectPage(reqVO, query); + } + + default TaskDispatchDO selectById(Long id) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(TaskDispatchDO.class) + .select("a.plan_no as planCode", "e.name as customerName", "a.craft_content as craftContent") + .select("d.code as projectCode", "d.project_name as projectName", "d.project_end_time as projectEndTime") + .select("c.name as projectSubName", "b.project_sub_code as projectSubCode") + .select("f.material_name as materialName", "f.composition_id as compositionId", "f.spec", "f.blueprint_no as blueprintNo") + .select("case when t.dispatch_type='"+ TaskDispatchTypeEnum.ASSEMBLE.name() +"' then c.unit else f.unit end unit", "case when t.dispatch_type='"+ TaskDispatchTypeEnum.ASSEMBLE.name() +"' then c.amount else f.amount end amount") + .select("g.name as compositionName") + .select("h.task_no as taskCode") + .select("i.require_end_date as requiredCompletedDate") + .select("u1.nickname as ownerName") + .leftJoin(PlanDO.class, "a", PlanDO::getId, ProcessDesignDO::getPlanId) + .leftJoin("project_plan_sub b on b.project_plan_id = t.plan_id and b.project_sub_id = t.project_sub_id") + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, ProcessDesignDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProcessDesignDO::getProjectId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(ProcessBomDetailDO.class, "f", ProcessBomDetailDO::getId, TaskDispatchDO::getBomDetailId) + .leftJoin(CompositionDO.class,"g", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .leftJoin(PlanTaskDO.class, "h", PlanTaskDO::getId, TaskDispatchDO::getTaskId) + .leftJoin(PlanTaskBomDO.class, "i", wrapper -> wrapper.eq(PlanTaskBomDO::getTaskId, PlanTaskDO::getId).eq(PlanTaskBomDO::getBomDetailId, TaskDispatchDO::getBomDetailId)) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, PlanTaskBomDO::getOwner) + .eq(TaskDispatchDO::getId, id) + .last("LIMIT 1") + .disableSubLogicDel(); + + return selectOne(query); } -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskreport/TaskReportMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskreport/TaskReportMapper.java new file mode 100644 index 00000000..a619faf0 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/taskreport/TaskReportMapper.java @@ -0,0 +1,54 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.TaskReportPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; + +/** + * 任务报工 Mapper + * + * @author 管理员 + */ +@Mapper +public interface TaskReportMapper extends BaseMapperX { + + default PageResult selectPage(TaskReportPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(TaskReportDO.class) + .select("d.code as projectCode", "d.project_name as projectName", "c.name as projectSubName") + .select("z.code as dispatchCode") + .select("f.material_name as materialName", "f.spec", "f.unit") + .select("y.name as procedureName") + .select("u1.nickname as ownerName", "u2.nickname as updaterName") + .leftJoin(TaskDispatchDetailDO.class, "x", TaskDispatchDetailDO::getId, TaskReportDO::getDispatchDetailId) + .leftJoin(ProcedureDO.class, "y", ProcedureDO::getId, TaskDispatchDetailDO::getProcedureId) + .leftJoin(TaskDispatchDO.class, "z", TaskDispatchDO::getId, TaskDispatchDetailDO::getDispatchId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, TaskDispatchDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, ProjectOrderSubDO::getProjectOrderId) + .leftJoin(ProcessBomDetailDO.class, "f", ProcessBomDetailDO::getId, TaskDispatchDO::getBomDetailId) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, TaskReportDO::getOwner) + .leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, TaskReportDO::getUpdater) + .orderByDesc(TaskReportDO::getId) + .disableSubLogicDel(); + + query.eq(reqVO.getOwner() != null, TaskReportDO::getOwner, reqVO.getOwner()) + .like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName()) + .like(!StringUtils.isEmpty(reqVO.getMaterialName()), ProcessBomDetailDO::getMaterialName, reqVO.getMaterialName()); + + return selectPage(reqVO, query); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/unqualifiednotification/UnqualifiedNotificationMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/unqualifiednotification/UnqualifiedNotificationMapper.java new file mode 100644 index 00000000..94e7a33d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/unqualifiednotification/UnqualifiedNotificationMapper.java @@ -0,0 +1,119 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.unqualifiednotification; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.composition.CompositionDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.procedure.ProcedureDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.util.StringUtils; + +/** + * 品质异常通知单审核 Mapper + * + * @author 管理员 + */ +@Mapper +public interface UnqualifiedNotificationMapper extends BaseMapperX { + + default PageResult selectPage(UnqualifiedNotificationPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(UnqualifiedNotificationDO.class) + .select("d.code as projectCode", "d.project_name as projectName") + .select("c.name as projectSubName", "b.project_sub_code as projectSubCode") + .select("f.material_name as materialName", "f.composition_id as compositionId", "f.spec", "f.unit", "f.blueprint_no as blueprintNo") + .select("g.name as compositionName") + .select("e.name as customerName") + .select("u1.nickname as ownerName", "u2.nickname as creatorName", "u3.nickname as auditorName") + .select("h.name as procedureName") + .leftJoin(PlanSubDO.class, "b", PlanSubDO::getProjectSubId, UnqualifiedNotificationDO::getProjectSubId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, UnqualifiedNotificationDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, UnqualifiedNotificationDO::getProjectId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(ProcessBomDetailDO.class, "f", ProcessBomDetailDO::getId, UnqualifiedNotificationDO::getBomDetailId) + .leftJoin(CompositionDO.class,"g", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .leftJoin(ProcedureDO.class, "h", ProcedureDO::getId, UnqualifiedNotificationDO::getProcedureId) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, UnqualifiedNotificationDO::getOwner) + .leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, UnqualifiedNotificationDO::getCreator) + .leftJoin(AdminUserDO.class, "u3", AdminUserDO::getId, UnqualifiedNotificationDO::getAuditor) + .disableSubLogicDel() + .orderByDesc(UnqualifiedNotificationDO::getId); + + query.like(!StringUtils.isEmpty(reqVO.getCode()), UnqualifiedNotificationDO::getCode, reqVO.getCode()) + .eq(!StringUtils.isEmpty(reqVO.getType()), UnqualifiedNotificationDO::getType, reqVO.getType()) + .like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubCode()), PlanSubDO::getProjectSubCode, reqVO.getProjectSubCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName()) + .eq(reqVO.getProcedureId() != null, UnqualifiedNotificationDO::getProcedureId, reqVO.getProcedureId()) + .like(!StringUtils.isEmpty(reqVO.getOwnerName()), "u1.nickname", reqVO.getOwnerName()) + .like(!StringUtils.isEmpty(reqVO.getCreatorName()), "u2.nickname", reqVO.getCreatorName()) + .eq(reqVO.getNotificationStatus() != null, UnqualifiedNotificationDO::getNotificationStatus, reqVO.getNotificationStatus()) + .eq(!StringUtils.isEmpty(reqVO.getAuditOpinion()), UnqualifiedNotificationDO::getAuditOpinion, reqVO.getAuditOpinion()) + .ge(reqVO.getMinCreateTime() != null, UnqualifiedNotificationDO::getCreateTime, reqVO.getMinCreateTime()) + .le(reqVO.getMaxCreateTime() != null, UnqualifiedNotificationDO::getCreateTime, reqVO.getMaxCreateTime()) + ; + + return selectPage(reqVO, query); + } + + default UnqualifiedNotificationDO selectById(Long id) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(UnqualifiedNotificationDO.class) + .select("d.code as projectCode", "d.project_name as projectName") + .select("c.name as projectSubName", "b.project_sub_code as projectSubCode") + .select("f.material_name as materialName", "f.composition_id as compositionId", "f.spec", "f.unit", "f.amount", "f.blueprint_no as blueprintNo") + .select("g.name as compositionName") + .select("e.name as customerName") + .select("u1.nickname as ownerName", "u2.nickname as creatorName", "u3.nickname as auditorName") + .leftJoin(PlanSubDO.class, "b", PlanSubDO::getProjectSubId, UnqualifiedNotificationDO::getProjectSubId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, UnqualifiedNotificationDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, UnqualifiedNotificationDO::getProjectId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(ProcessBomDetailDO.class, "f", ProcessBomDetailDO::getId, UnqualifiedNotificationDO::getBomDetailId) + .leftJoin(CompositionDO.class,"g", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) + .leftJoin(ProcedureDO.class, "h", ProcedureDO::getId, UnqualifiedNotificationDO::getProcedureId) + .leftJoin(AdminUserDO.class, "u1", AdminUserDO::getId, UnqualifiedNotificationDO::getOwner) + .leftJoin(AdminUserDO.class, "u2", AdminUserDO::getId, UnqualifiedNotificationDO::getCreator) + .leftJoin(AdminUserDO.class, "u3", AdminUserDO::getId, UnqualifiedNotificationDO::getAuditor) + .eq(UnqualifiedNotificationDO::getId, id) + .disableSubLogicDel() + .last("LIMIT 1"); + return selectOne(query); + } + + default PageResult getStatisticPage(UnqualifiedNotificationPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(UnqualifiedNotificationDO.class) + .select("d.code as projectCode", "d.project_name as projectName") + .select("c.name as projectSubName", "b.project_sub_code as projectSubCode") + .select("f.material_name as materialName") + .select("e.name as customerName") + .selectSum(UnqualifiedNotificationDO::getAmount, "statisticAmount") + .leftJoin(PlanSubDO.class, "b", PlanSubDO::getProjectSubId, UnqualifiedNotificationDO::getProjectSubId) + .leftJoin(ProjectOrderSubDO.class, "c", ProjectOrderSubDO::getId, UnqualifiedNotificationDO::getProjectSubId) + .leftJoin(ProjectOrderDO.class, "d", ProjectOrderDO::getId, UnqualifiedNotificationDO::getProjectId) + .leftJoin(CustomerDO.class, "e", CustomerDO::getId, ProjectOrderDO::getCustomerId) + .leftJoin(ProcessBomDetailDO.class, "f", ProcessBomDetailDO::getId, UnqualifiedNotificationDO::getBomDetailId) + .disableSubLogicDel() + .groupBy("t.project_id", "t.project_sub_id", "t.bom_detail_id", "t.type", "t.audit_opinion") + .orderByDesc(ProjectOrderDO::getId); + + query.eq(!StringUtils.isEmpty(reqVO.getType()), UnqualifiedNotificationDO::getType, reqVO.getType()) + .like(!StringUtils.isEmpty(reqVO.getProjectCode()), ProjectOrderDO::getCode, reqVO.getProjectCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectName()), ProjectOrderDO::getProjectName, reqVO.getProjectName()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubCode()), PlanSubDO::getProjectSubCode, reqVO.getProjectSubCode()) + .like(!StringUtils.isEmpty(reqVO.getProjectSubName()), ProjectOrderSubDO::getName, reqVO.getProjectSubName()) + .eq(!StringUtils.isEmpty(reqVO.getAuditOpinion()), UnqualifiedNotificationDO::getAuditOpinion, reqVO.getAuditOpinion()); + + return selectPage(reqVO, query); + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/manager/CrossOrderManager.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/manager/CrossOrderManager.java index 229cf2b8..a2bc2ce7 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/manager/CrossOrderManager.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/manager/CrossOrderManager.java @@ -2,24 +2,34 @@ package com.chanko.yunxi.mes.module.heli.manager; import cn.hutool.core.lang.UUID; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; import com.chanko.yunxi.mes.framework.operatelog.core.service.OperateLogFrameworkService; import com.chanko.yunxi.mes.module.heli.controller.admin.deliverorder.vo.DeliverOrderSaveReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.processbom.vo.ProcessBomSaveReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.processdesign.vo.ProcessDesignSaveReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchSaveReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask.PlanTaskDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processdesign.ProcessDesignDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelog.StorageLogDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; import com.chanko.yunxi.mes.module.heli.dal.mysql.deliverorder.DeliverOrderSubMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.plansub.PlanSubMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.plantask.PlanTaskMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.plantaskbom.PlanTaskBomMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processdesign.ProcessDesignMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper; @@ -27,10 +37,12 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMa import com.chanko.yunxi.mes.module.heli.dal.mysql.storage.StorageMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMapper; import com.chanko.yunxi.mes.module.heli.enums.*; import com.chanko.yunxi.mes.module.heli.service.plan.PlanService; import com.chanko.yunxi.mes.module.heli.service.processbom.ProcessBomService; import com.chanko.yunxi.mes.module.heli.service.processdesign.ProcessDesignService; +import com.chanko.yunxi.mes.module.heli.service.taskdispatch.TaskDispatchService; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -78,6 +90,16 @@ public class CrossOrderManager { private OperateLogFrameworkService operateLogFrameworkService; @Resource private ProcessBomMapper processBomMapper; + @Resource + private TaskDispatchMapper taskDispatchMapper; + @Resource + private PlanTaskMapper planTaskMapper; + @Resource + private PlanTaskBomMapper planTaskBomMapper; + @Resource + private TaskDispatchService taskDispatchService; + @Resource + private PlanSubMapper planSubMapper; /** * 刷新项目订单发货状态 @@ -137,6 +159,7 @@ public class CrossOrderManager { .setStockNo(UUID.fastUUID().toString(true)) .setHeaderNo(updateReqVO.getCode()) .setStatus(StorageStatusEnum.SUBMIT.getCode()) + .setOutboundTime(updateReqVO.getDeliverDate()) .setCreateTime(updateReqVO.getDeliverDate()) .setVMatName(updateReqVO.getDeliverOrderSubs().stream().map(DeliverOrderSubDO::getName).collect(Collectors.joining(","))) .setDescription(String.format("由发货单%s操作发货后自动生成", updateReqVO.getCode())); @@ -183,7 +206,8 @@ public class CrossOrderManager { * @date 2024-02-01 05:32 */ @Transactional(rollbackFor = Exception.class) - public void generateVirtualMaterial(String projectOrderCode, List projectOrderSubs) { + public void generateVirtualMaterial(String projectOrderCode, Long projectId) { + List projectOrderSubs = projectOrderSubMapper.selectListByProjectOrderId(projectId); ArrayList pendingDOList = new ArrayList<>(16); projectOrderSubs.forEach(projectOrderSubDO -> { MaterialDO materialDO = new MaterialDO(); @@ -230,6 +254,10 @@ public class CrossOrderManager { Long planId = planService.generatePlanByProjectId(projectId); // 同时生成工艺设计 generateProcessDesign(projectId, planId); + // 同时生成生产任务单 + planService.generatePlanTaskByPlanId(planId); + // 同时生成装配任务派工单 + generateAssembleTaskDispatch(projectId, planId); } /** @@ -319,6 +347,30 @@ public class CrossOrderManager { planService.updatePlanStatusToTerminateByProjectId(projectId); // 同时更新工艺设计状态 updateProcessDesignStatusToTerminate(projectId); + // 同时更新生产任务状态 + updatePlanTaskStatusToTerminate(projectId); + // 同时更新派工任务状态 + updateTaskDispatchStatusToTerminate(projectId); + } + + /** + * 订单终止 更新生产任务状态 + * @param projectId + */ + public void updatePlanTaskStatusToTerminate(Long projectId) { + UpdateWrapper update = new UpdateWrapper<>(); + update.eq("project_id", projectId).set("status", TaskDispatchStatusEnum.TERMINATE.getCode()); + planTaskMapper.update(update); + } + + /** + * 订单终止 更新派工任务状态 + * @param projectId + */ + public void updateTaskDispatchStatusToTerminate(Long projectId) { + UpdateWrapper update = new UpdateWrapper<>(); + update.eq("project_id", projectId).set("dispatch_status", TaskDispatchStatusEnum.TERMINATE.getCode()); + taskDispatchMapper.update(update); } /** @@ -337,5 +389,133 @@ public class CrossOrderManager { } } + /** + * 生成入库单 + * @param dispatchId + * @param reportTime + * @param reportAmount + */ + @Transactional(rollbackFor = Exception.class) + public void generateStockInOrder(Long dispatchId, LocalDateTime reportTime, Integer reportAmount) { + TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectById(dispatchId); + + + // 出库表处理 + StorageDO storageDO = new StorageDO(); + storageDO.setStockType(StockTypeEnum.IN.getCode()) + .setStockInType(StockInTypeEnum.PRODUCTION.getCode()) + .setStockNo(UUID.fastUUID().toString(true)) + .setHeaderNo(taskDispatchDO.getCode()) + .setStatus(StorageStatusEnum.SUBMIT.getCode()) + .setKeeperTime(reportTime) + .setCreateTime(reportTime) + .setVMatName(taskDispatchDO.getProjectSubName()) + .setDescription(String.format("由派工单s%提交报工后自动生成", taskDispatchDO.getCode())); + storageMapper.insert(storageDO); + storageDO.setStockNo(STOCK_IN.getCode(storageDO.getId().toString())); + storageMapper.updateById(storageDO); + + // 查询物料id + MaterialDO materialDO = materialMapper.selectOne(new LambdaQueryWrapper() {{ + eq(MaterialDO::getCode, String.format("%s-%s", taskDispatchDO.getProjectCode(), taskDispatchDO.getProjectName())) + .eq(MaterialDO::getVirtualPart, YesOrNoEnum.Y.name()) + .last("LIMIT 1"); + }}); + + StorageMatDO storageMatDO = new StorageMatDO(); + storageMatDO.setStockId(storageDO.getId()) + .setMatId(materialDO.getId()) + .setStorageOkQty(new BigDecimal(reportAmount)); + storageMatMapper.insert(storageMatDO); + + // 将物料信息转化日志信息 + StorageLogDO storageLogDO = BeanUtils.toBean(storageMatDO, StorageLogDO.class); + storageLogMapper.insert(storageLogDO); + + } + + /** + * 生成生产派工单 + * @param planTaskId + */ + @Transactional(rollbackFor = Exception.class) + public void generateProductionTaskDispatch(Long planTaskId){ + // 锁住任务数据 + PlanTaskDO planTaskDO = planTaskMapper.selectOne(new LambdaQueryWrapper() {{ + eq(PlanTaskDO::getId, planTaskId).last("LIMIT 1 FOR UPDATE"); + }}); + PlanSubDO planSubDO = planSubMapper.selectById(planTaskDO.getProjectPlanSubId()); + // 获取非标准件明细 + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(PlanTaskBomDO.class) + .leftJoin(PlanTaskDO.class, "a", PlanTaskDO::getId, PlanTaskBomDO::getTaskId) + .leftJoin(ProcessBomDetailDO.class, "b", ProcessBomDetailDO::getId, PlanTaskBomDO::getBomDetailId) + ; + + query.eq(PlanTaskDO::getId, planTaskId).ne(ProcessBomDetailDO::getType, YesOrNoEnum.Y.getCode()); + + List planTaskBomDOList = planTaskBomMapper.selectList(query); + + if(planTaskBomDOList != null && !planTaskBomDOList.isEmpty()){ + // 是否已生成派工任务 + List generatedTaskDispatchList = taskDispatchMapper.selectList(new LambdaQueryWrapper() {{ + eq(TaskDispatchDO::getDispatchType, TaskDispatchTypeEnum.PRODUCTION.name()) + .in(TaskDispatchDO::getBomDetailId, planTaskBomDOList.stream().map(PlanTaskBomDO::getBomDetailId).collect(Collectors.toSet())); + }}); + if(generatedTaskDispatchList.size() == planTaskBomDOList.size()){ + return; + } + if(generatedTaskDispatchList.size() < planTaskBomDOList.size()){ + List goingToGenerateTaskList = planTaskBomDOList.stream().filter(planTaskBomDO -> !generatedTaskDispatchList.stream().anyMatch(taskDispatchDO -> planTaskBomDO.getBomDetailId().longValue() == taskDispatchDO.getBomDetailId().longValue())).collect(Collectors.toList()); + + // 生成派工单 + goingToGenerateTaskList.forEach(planTaskBomDO -> { + TaskDispatchSaveReqVO taskDispatchSaveReqVO = new TaskDispatchSaveReqVO(); + taskDispatchSaveReqVO.setDispatchType(TaskDispatchTypeEnum.PRODUCTION.name()) + .setTaskId(planTaskId) + .setPlanId(planTaskDO.getProjectPlanId()) + .setProjectId(planTaskDO.getProjectId()) + .setProjectSubId(planSubDO.getProjectSubId()) + .setBomDetailId(planTaskBomDO.getBomDetailId()) + .setActive(OperateTypeEnum.SAVE.name()) + .setDispatchStatus(TaskDispatchStatusEnum.SAVE.getCode()) + .setStatus(ValidStatusEnum.VALID.getCode()); + taskDispatchService.createTaskDispatch(taskDispatchSaveReqVO); + }); + } + } + } + + /** + * 生成装配任务派工单 + * @param projectId + * @param planId + */ + @Transactional(rollbackFor = Exception.class) + public void generateAssembleTaskDispatch(Long projectId, Long planId) { + List projectOrderSubDOList = projectOrderSubMapper.selectListByProjectOrderId(projectId); + // 查询是否已经生成派工单 + List generatedTaskDispatchList = taskDispatchMapper.selectList(new LambdaQueryWrapper() {{ + eq(TaskDispatchDO::getDispatchType, TaskDispatchTypeEnum.ASSEMBLE.name()) + .in(TaskDispatchDO::getProjectSubId, projectOrderSubDOList.stream().map(ProjectOrderSubDO::getId).collect(Collectors.toSet())); + }}); + if(projectOrderSubDOList.size() == generatedTaskDispatchList.size()){ + return; + } + if(projectOrderSubDOList.size() > generatedTaskDispatchList.size()){ + List goingToGenerateTaskList = projectOrderSubDOList.stream().filter(projectOrderSubDO -> !generatedTaskDispatchList.stream().anyMatch(taskDispatchDO -> projectOrderSubDO.getId().longValue() == taskDispatchDO.getProjectSubId())).collect(Collectors.toList()); + goingToGenerateTaskList.forEach(projectOrderSubDO -> { + TaskDispatchSaveReqVO taskDispatchSaveReqVO = new TaskDispatchSaveReqVO(); + taskDispatchSaveReqVO.setDispatchType(TaskDispatchTypeEnum.ASSEMBLE.name()) + .setPlanId(planId) + .setProjectId(projectId) + .setProjectSubId(projectOrderSubDO.getId()) + .setActive(OperateTypeEnum.SAVE.name()) + .setDispatchStatus(TaskDispatchStatusEnum.SAVE.getCode()) + .setStatus(ValidStatusEnum.VALID.getCode()); + taskDispatchService.createTaskDispatch(taskDispatchSaveReqVO); + }); + } + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equipmanufacture/EquipManufactureService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equipmanufacture/EquipManufactureService.java new file mode 100644 index 00000000..3a9f39fc --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equipmanufacture/EquipManufactureService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.equipmanufacture; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 制造设备 Service 接口 + * + * @author 合立管理员 + */ +public interface EquipManufactureService { + + /** + * 创建制造设备 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createEquipManufacture(@Valid EquipManufactureSaveReqVO createReqVO); + + /** + * 更新制造设备 + * + * @param updateReqVO 更新信息 + */ + void updateEquipManufacture(@Valid EquipManufactureSaveReqVO updateReqVO); + + /** + * 删除制造设备 + * + * @param id 编号 + */ + void deleteEquipManufacture(Long id); + + /** + * 获得制造设备 + * + * @param id 编号 + * @return 制造设备 + */ + EquipManufactureDO getEquipManufacture(Long id); + + /** + * 获得制造设备分页 + * + * @param pageReqVO 分页查询 + * @return 制造设备分页 + */ + PageResult getEquipManufacturePage(EquipManufacturePageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equipmanufacture/EquipManufactureServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equipmanufacture/EquipManufactureServiceImpl.java new file mode 100644 index 00000000..d35e9954 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/equipmanufacture/EquipManufactureServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.equipmanufacture; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.equipmanufacture.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.equipmanufacture.EquipManufactureDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.equipmanufacture.EquipManufactureMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 制造设备 Service 实现类 + * + * @author 合立管理员 + */ +@Service +@Validated +public class EquipManufactureServiceImpl implements EquipManufactureService { + + @Resource + private EquipManufactureMapper equipManufactureMapper; + + @Override + public Long createEquipManufacture(EquipManufactureSaveReqVO createReqVO) { + // 插入 + EquipManufactureDO equipManufacture = BeanUtils.toBean(createReqVO, EquipManufactureDO.class); + equipManufactureMapper.insert(equipManufacture); + // 返回 + return equipManufacture.getId(); + } + + @Override + public void updateEquipManufacture(EquipManufactureSaveReqVO updateReqVO) { + // 校验存在 + validateEquipManufactureExists(updateReqVO.getId()); + // 更新 + EquipManufactureDO updateObj = BeanUtils.toBean(updateReqVO, EquipManufactureDO.class); + equipManufactureMapper.updateById(updateObj); + } + + @Override + public void deleteEquipManufacture(Long id) { + // 校验存在 + validateEquipManufactureExists(id); + // 删除 + equipManufactureMapper.deleteById(id); + } + + private void validateEquipManufactureExists(Long id) { + if (equipManufactureMapper.selectById(id) == null) { + throw exception(EQUIP_MANUFACTURE_NOT_EXISTS); + } + } + + @Override + public EquipManufactureDO getEquipManufacture(Long id) { + return equipManufactureMapper.selectById(id); + } + + @Override + public PageResult getEquipManufacturePage(EquipManufacturePageReqVO pageReqVO) { + return equipManufactureMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/invoice/InvoiceService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/invoice/InvoiceService.java new file mode 100644 index 00000000..4f534727 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/invoice/InvoiceService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.invoice; + +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.invoice.InvoiceDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; + +/** + * 财务发票 Service 接口 + * + * @author 管理员 + */ +public interface InvoiceService { + + /** + * 创建财务发票 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createInvoice(@Valid InvoiceSaveReqVO createReqVO); + + /** + * 更新财务发票 + * + * @param updateReqVO 更新信息 + */ + void updateInvoice(@Valid InvoiceSaveReqVO updateReqVO); + + /** + * 删除财务发票 + * + * @param id 编号 + */ + void deleteInvoice(Long id); + + /** + * 获得财务发票 + * + * @param id 编号 + * @param businessType + * @return 财务发票 + */ + InvoiceDO getInvoice(Long id, String businessType); + + /** + * 获得财务发票分页 + * + * @param pageReqVO 分页查询 + * @return 财务发票分页 + */ + PageResult getInvoicePage(InvoicePageReqVO pageReqVO); + + Long operate(InvoiceSaveReqVO operateReqVO); +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/invoice/InvoiceServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/invoice/InvoiceServiceImpl.java new file mode 100644 index 00000000..ef6859f1 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/invoice/InvoiceServiceImpl.java @@ -0,0 +1,106 @@ +package com.chanko.yunxi.mes.module.heli.service.invoice; + +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils; +import com.chanko.yunxi.mes.module.heli.enums.InvoiceStatusEnum; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import com.chanko.yunxi.mes.module.heli.controller.admin.invoice.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.invoice.InvoiceDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.invoice.InvoiceMapper; + +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 财务发票 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class InvoiceServiceImpl implements InvoiceService { + + @Resource + private InvoiceMapper invoiceMapper; + + @Override + public Long createInvoice(InvoiceSaveReqVO createReqVO) { + // 插入 + InvoiceDO invoice = BeanUtils.toBean(createReqVO, InvoiceDO.class); + OperateTypeEnum operateTypeEnum = OperateTypeEnum.valueOf(createReqVO.getActive()); + if(!invoice.canOperate(operateTypeEnum)){ + throw exception(INVALID_OPERATE); + } + invoice.setStatus(InvoiceStatusEnum.valueOf(createReqVO.getActive()).getCode()); + invoiceMapper.insert(invoice); + // 返回 + return invoice.getId(); + } + + @Override + public void updateInvoice(InvoiceSaveReqVO updateReqVO) { + // 校验存在 + validateInvoiceExists(updateReqVO.getId()); + // 更新 + InvoiceDO updateObj = BeanUtils.toBean(updateReqVO, InvoiceDO.class); + OperateTypeEnum operateTypeEnum = OperateTypeEnum.valueOf(updateReqVO.getActive()); + if(!updateObj.canOperate(operateTypeEnum)){ + throw exception(INVALID_OPERATE); + } + updateObj.setStatus(InvoiceStatusEnum.valueOf(updateReqVO.getActive()).getCode()); + invoiceMapper.updateById(updateObj); + } + + @Override + public void deleteInvoice(Long id) { + // 校验存在 + validateInvoiceExists(id); + // 删除 + invoiceMapper.deleteById(id); + } + + private void validateInvoiceExists(Long id) { + if (invoiceMapper.selectById(id) == null) { + throw exception(INVOICE_NOT_EXISTS); + } + } + + @Override + public InvoiceDO getInvoice(Long id, String businessType) { + return invoiceMapper.selectByIdAndType(id, businessType); + } + + @Override + public PageResult getInvoicePage(InvoicePageReqVO pageReqVO) { + return invoiceMapper.selectPage(pageReqVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Long operate(InvoiceSaveReqVO operateReqVO) { + OperateTypeEnum operateTypeEnum = OperateTypeEnum.valueOf(operateReqVO.getActive()); + if(operateTypeEnum == OperateTypeEnum.SUBMIT){ + operateReqVO.setSubmitter(SecurityFrameworkUtils.getLoginUser().getId()) + .setSubmitTime(LocalDateTime.now()); + }else if(operateTypeEnum == OperateTypeEnum.CANCEL){ + operateReqVO.setCanceller(SecurityFrameworkUtils.getLoginUser().getId()) + .setCancelTime(LocalDateTime.now()); + } + if(operateReqVO.getId() == null){ + operateReqVO.setId(createInvoice(operateReqVO)); + }else{ + updateInvoice(operateReqVO); + } + return operateReqVO.getId(); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialService.java index a298defd..d75e74db 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialService.java @@ -55,4 +55,5 @@ public interface MaterialService { List> getSimpleList(); List> selectSimpleVirtualList(); + void importExcel(List materialExcelVOList, Boolean updateSupport); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java index 8807cbc4..7b2abe14 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java @@ -1,23 +1,41 @@ package com.chanko.yunxi.mes.module.heli.service.material; +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.mybatis.core.query.MPJLambdaWrapperX; +import com.chanko.yunxi.mes.framework.tenant.core.context.TenantContextHolder; +import com.chanko.yunxi.mes.framework.tenant.core.util.TenantUtils; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialExcelVO; import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialPageReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialSaveReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper; +import com.chanko.yunxi.mes.module.heli.enums.CodeEnum; +import com.chanko.yunxi.mes.module.heli.enums.MaterialTypeEnum; +import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService; +import org.springframework.context.annotation.DependsOn; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; import org.springframework.validation.annotation.Validated; +import javax.annotation.PostConstruct; import javax.annotation.Resource; - +import javax.validation.ConstraintViolation; +import javax.validation.Validator; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.CODE_REPEAT; -import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.MATERIAL_NOT_EXISTS; +import static com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum.MATERIAL; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; /** * 物料 Service 实现类 @@ -26,18 +44,67 @@ import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.MATERIAL */ @Service @Validated +@DependsOn({"tenantLineInnerInterceptor"}) public class MaterialServiceImpl implements MaterialService { @Resource private MaterialMapper materialMapper; + @Resource + private Validator validator; + + @Resource + private SerialNumberService serialNumberService; + + @PostConstruct + public void init(){ + // 对历史导入的序列号提取最大值 + // 更新至序列号表 + TenantContextHolder.setIgnore(true); + List maxCodeGroupByMaterialType = materialMapper.selectList(new MPJLambdaWrapperX() {{ + selectMax(MaterialDO::getCode) + .select(MaterialDO::getMaterialType) + .select(MaterialDO::getTenantId) + .ne(MaterialDO::getMaterialType, MaterialTypeEnum.VIRTUAL.getCode()) + .groupBy(MaterialDO::getMaterialType, MaterialDO::getTenantId); + }}); + for (MaterialDO materialDO : maxCodeGroupByMaterialType){ + TenantUtils.execute(materialDO.getTenantId(), () -> { + MaterialTypeEnum materialTypeEnum = MaterialTypeEnum.getMaterialType(materialDO.getMaterialType()); + SerialNumberDO serialNumber = serialNumberService.getSerialNumber(MATERIAL.name(), materialTypeEnum.getPrefix()); + long serial = Long.parseLong(materialDO.getCode().substring(1)); + if(serialNumber.getSerialNumber() < serial){ + serialNumber.setSerialNumber(serial); + serialNumberService.updateSerialNumber(serialNumber); + } + }); + } + } + @Override public Long createMaterial(MaterialSaveReqVO createReqVO) { // 插入 MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class); - // 重复性判断 - validateMaterialRepeat(material.getCode(), material.getId()); + + MaterialTypeEnum materialType = MaterialTypeEnum.getMaterialType(material.getMaterialType()); + SerialNumberDO serialNumberDO = serialNumberService.getSerialNumber(MATERIAL.name(), materialType.getPrefix()); + Long serialNumber = serialNumberDO.getSerialNumber(); + // 个位数不满5直接到5 满5到10 + String serialNumberStr = String.valueOf(serialNumber); + int serialLength = serialNumberStr.length(); + String prefix = serialNumberStr.substring(0, serialLength - 1); + String suffix = serialNumberStr.substring(serialLength-1); + long digit = Long.parseLong(suffix); + digit = digit < 5 ? 5 : 10; + serialNumber = Long.parseLong(prefix+"0") + digit; + serialNumberDO.setSerialNumber(serialNumber); + + material.setCode(CodeEnum.MATERIAL.getCode(materialType.getPrefix(), serialNumber.toString())); materialMapper.insert(material); + + // 回写序列记录 + serialNumberService.updateSerialNumber(serialNumberDO); + // 返回 return material.getId(); } @@ -97,4 +164,76 @@ public class MaterialServiceImpl implements MaterialService { public List> selectSimpleVirtualList() { return materialMapper.selectSimpleVirtualList(); } + + @Override + @Transactional(rollbackFor = Exception.class) + public void importExcel(List materialExcelVOList, Boolean updateSupport) { + if(CollUtil.isEmpty(materialExcelVOList)){ + throw exception(MATERIAL_IMPORT_LIST_IS_EMPTY); + } + // 数据校验x + checkData(materialExcelVOList); + // 转换入库 + // 计算物料编码各项最大值 同步更新到序列表 + HashMap materialSerialValue = new HashMap<>(8); + materialExcelVOList.forEach(materialExcelVO -> { + MaterialTypeEnum materialType = MaterialTypeEnum.getMaterialType(materialExcelVO.getMaterialType()); + Integer serialNumber = materialSerialValue.get(materialType); + if(serialNumber == null){ + serialNumber = 0; + } + int currentSerial = Integer.parseInt(materialExcelVO.getCode()); + if(currentSerial > serialNumber){ + materialSerialValue.put(materialType, currentSerial); + } + materialMapper.insert(BeanUtils.toBean(materialExcelVO, MaterialDO.class)); + }); + + materialSerialValue.forEach(((materialTypeEnum, serial) -> { + SerialNumberDO serialNumber = serialNumberService.getSerialNumber(MATERIAL.name(), materialTypeEnum.getPrefix()); + if(serialNumber.getSerialNumber() < serial){ + serialNumber.setSerialNumber(Long.parseLong(String.valueOf(serial))); + serialNumberService.updateSerialNumber(serialNumber); + } + })); + } + + private void checkData(List materialExcelVOList) { + // 基础校验 + Set>> validate = validator.validate(materialExcelVOList, MaterialExcelVO.class); + if(!validate.isEmpty()){ + throw exception(IMPORT_ERROR, JSON.toJSONString(validate.toArray())); + } + + // 本次重复数据 + List codeList = materialExcelVOList.stream().map(MaterialExcelVO::getCode).collect(Collectors.toList()); + if(codeList.size() != codeList.stream().collect(Collectors.toSet()).size()){ + throw exception(MATERIAL_IMPORT_CODE_REPEAT); + } + + // 历史重复数据 + List materialDOList = materialMapper.selectList(new LambdaQueryWrapper() {{ + in(MaterialDO::getCode, codeList); + }}); + if(CollUtil.isNotEmpty(materialDOList)){ + throw exception(MATERIAL_IMPORT_CODE_REPEAT, materialDOList.stream().map(MaterialDO::getCode).collect(Collectors.toList())); + } + + // 枚举值校验 + // 物料类型/物料单位 + boolean dictNotMatched = materialExcelVOList.stream().anyMatch(materialExcelVO -> StringUtils.isEmpty(materialExcelVO.getMaterialType()) || StringUtils.isEmpty(materialExcelVO.getUnit())); + if(dictNotMatched){ + throw exception(DICT_TYPE_ERROR); + } + + // 标准编码校验 + boolean notStandardCode = materialExcelVOList.stream().anyMatch(materialExcelVO -> { + String prefix = MaterialTypeEnum.getMaterialType(materialExcelVO.getMaterialType()).getPrefix(); + return !materialExcelVO.getCode().startsWith(prefix); + }); + if(notStandardCode){ + throw exception(MATERIAL_IMPORT_CODE_NOT_STANDARD); + } + + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java index c00cf425..300dd4a7 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java @@ -69,7 +69,7 @@ public class MaterialPlanServiceImpl implements MaterialPlanService { if(updateReqVO.getStatus()==2){ updateObj.setSubmitTime(currTime); } - if(updateReqVO.getStatus()== 3 || updateReqVO.getStatus() == 4){ + if(updateReqVO.getStatus()== 3){ updateObj.setAuditTime(currTime); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomService.java new file mode 100644 index 00000000..278c1482 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomService.java @@ -0,0 +1,60 @@ +package com.chanko.yunxi.mes.module.heli.service.materialplanboom; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; + +/** + * 物料需求计划加工件明细 Service 接口 + * + * @author 管理员 + */ +public interface MaterialPlanBoomService { + + /** + * 创建物料需求计划加工件明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialPlanBoom(@Valid MaterialPlanBoomSaveReqVO createReqVO); + + /** + * 更新物料需求计划加工件明细 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialPlanBoom(@Valid MaterialPlanBoomSaveReqVO updateReqVO); + + /** + * 删除物料需求计划加工件明细 + * + * @param id 编号 + */ + void deleteMaterialPlanBoom(Long id); + + /** + * 获得物料需求计划加工件明细 + * + * @param id 编号 + * @return 物料需求计划加工件明细 + */ + MaterialPlanBoomDO getMaterialPlanBoom(Long id); + + /** + * 获得物料需求计划加工件明细分页 + * + * @param pageReqVO 分页查询 + * @return 物料需求计划加工件明细分页 + */ + PageResult getMaterialPlanBoomPage(MaterialPlanBoomPageReqVO pageReqVO); + + PageResult getMaterialPlanBoomSumPage(MaterialPlanBoomPageReqVO pageReqVO); + + PageResult getProcessBoomDetailList(ProcessBoomPageReqVO pageReqVO); + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomServiceImpl.java new file mode 100644 index 00000000..fa8a4cca --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomServiceImpl.java @@ -0,0 +1,96 @@ +package com.chanko.yunxi.mes.module.heli.service.materialplanboom; + +import cn.binarywang.wx.miniapp.bean.cloud.WxCloudDatabaseQueryResult; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom.BoomDetailRespVOMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom.MaterialPlanBoomDetailMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplanboom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom.MaterialPlanBoomMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 物料需求计划加工件明细 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class MaterialPlanBoomServiceImpl implements MaterialPlanBoomService { + + @Resource + private MaterialPlanBoomMapper materialPlanBoomMapper; + + @Resource + private MaterialPlanBoomDetailMapper materialPlanBoomDetailMapper; + + @Resource + private BoomDetailRespVOMapper boomDetailRespVOMapper; + + @Override + public Long createMaterialPlanBoom(MaterialPlanBoomSaveReqVO createReqVO) { + // 插入 + MaterialPlanBoomDO materialPlanBoom = BeanUtils.toBean(createReqVO, MaterialPlanBoomDO.class); + materialPlanBoomMapper.insert(materialPlanBoom); + // 返回 + return materialPlanBoom.getId(); + } + + @Override + public void updateMaterialPlanBoom(MaterialPlanBoomSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialPlanBoomExists(updateReqVO.getId()); + // 更新 + MaterialPlanBoomDO updateObj = BeanUtils.toBean(updateReqVO, MaterialPlanBoomDO.class); + materialPlanBoomMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialPlanBoom(Long id) { + // 校验存在 + validateMaterialPlanBoomExists(id); + // 删除 + materialPlanBoomMapper.deleteById(id); + } + + private void validateMaterialPlanBoomExists(Long id) { + if (materialPlanBoomMapper.selectById(id) == null) { + throw exception(MATERIAL_PLAN_BOOM_NOT_EXISTS); + } + } + + @Override + public MaterialPlanBoomDO getMaterialPlanBoom(Long id) { + return materialPlanBoomMapper.selectById(id); + } + + @Override + public PageResult getMaterialPlanBoomPage(MaterialPlanBoomPageReqVO pageReqVO) { + return materialPlanBoomMapper.selectPage(pageReqVO); + } + @Override + public PageResult getMaterialPlanBoomSumPage(MaterialPlanBoomPageReqVO pageReqVO) { + return materialPlanBoomMapper.selectSumPage(pageReqVO); + } + + + @Override + public PageResult getProcessBoomDetailList(ProcessBoomPageReqVO pageReqVO){ + return materialPlanBoomDetailMapper.selectBoomDetailPage(pageReqVO); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailService.java index c498f742..bf27eef1 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailService.java @@ -1,55 +1,57 @@ -package com.chanko.yunxi.mes.module.heli.service.materialplandetail; - -import java.util.*; -import javax.validation.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; - -/** - * 物料需求计划物料详情 Service 接口 - * - * @author 管理员 - */ -public interface MaterialPlanDetailService { - - /** - * 创建物料需求计划物料详情 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createMaterialPlanDetail(@Valid MaterialPlanDetailSaveReqVO createReqVO); - - /** - * 更新物料需求计划物料详情 - * - * @param updateReqVO 更新信息 - */ - void updateMaterialPlanDetail(@Valid MaterialPlanDetailSaveReqVO updateReqVO); - - /** - * 删除物料需求计划物料详情 - * - * @param id 编号 - */ - void deleteMaterialPlanDetail(Long id); - - /** - * 获得物料需求计划物料详情 - * - * @param id 编号 - * @return 物料需求计划物料详情 - */ - MaterialPlanDetailDO getMaterialPlanDetail(Long id); - - /** - * 获得物料需求计划物料详情分页 - * - * @param pageReqVO 分页查询 - * @return 物料需求计划物料详情分页 - */ - PageResult getMaterialPlanDetailPage(MaterialPlanDetailPageReqVO pageReqVO); - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.materialplandetail; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 物料需求计划物料详情 Service 接口 + * + * @author 管理员 + */ +public interface MaterialPlanDetailService { + + /** + * 创建物料需求计划物料详情 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createMaterialPlanDetail(@Valid MaterialPlanDetailSaveReqVO createReqVO); + + /** + * 更新物料需求计划物料详情 + * + * @param updateReqVO 更新信息 + */ + void updateMaterialPlanDetail(@Valid MaterialPlanDetailSaveReqVO updateReqVO); + + /** + * 删除物料需求计划物料详情 + * + * @param id 编号 + */ + void deleteMaterialPlanDetail(Long id); + + /** + * 获得物料需求计划物料详情 + * + * @param id 编号 + * @return 物料需求计划物料详情 + */ + MaterialPlanDetailDO getMaterialPlanDetail(Long id); + + /** + * 获得物料需求计划物料详情分页 + * + * @param pageReqVO 分页查询 + * @return 物料需求计划物料详情分页 + */ + PageResult getMaterialPlanDetailPage(MaterialPlanDetailPageReqVO pageReqVO); + + PageResult getMaterialPlanDetailSumPage(MaterialPlanDetailPageReqVO pageReqVO); + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailServiceImpl.java index cd3ecc70..c6d8f7b0 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplandetail/MaterialPlanDetailServiceImpl.java @@ -1,74 +1,79 @@ -package com.chanko.yunxi.mes.module.heli.service.materialplandetail; - -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; - -import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplandetail.MaterialPlanDetailMapper; - -import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; - -/** - * 物料需求计划物料详情 Service 实现类 - * - * @author 管理员 - */ -@Service -@Validated -public class MaterialPlanDetailServiceImpl implements MaterialPlanDetailService { - - @Resource - private MaterialPlanDetailMapper materialPlanDetailMapper; - - @Override - public Long createMaterialPlanDetail(MaterialPlanDetailSaveReqVO createReqVO) { - // 插入 - MaterialPlanDetailDO materialPlanDetail = BeanUtils.toBean(createReqVO, MaterialPlanDetailDO.class); - materialPlanDetailMapper.insert(materialPlanDetail); - // 返回 - return materialPlanDetail.getId(); - } - - @Override - public void updateMaterialPlanDetail(MaterialPlanDetailSaveReqVO updateReqVO) { - // 校验存在 - validateMaterialPlanDetailExists(updateReqVO.getId()); - // 更新 - MaterialPlanDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialPlanDetailDO.class); - materialPlanDetailMapper.updateById(updateObj); - } - - @Override - public void deleteMaterialPlanDetail(Long id) { - // 校验存在 - validateMaterialPlanDetailExists(id); - // 删除 - materialPlanDetailMapper.deleteById(id); - } - - private void validateMaterialPlanDetailExists(Long id) { - if (materialPlanDetailMapper.selectById(id) == null) { - throw exception(MATERIAL_PLAN_DETAIL_NOT_EXISTS); - } - } - - @Override - public MaterialPlanDetailDO getMaterialPlanDetail(Long id) { - return materialPlanDetailMapper.selectById(id); - } - - @Override - public PageResult getMaterialPlanDetailPage(MaterialPlanDetailPageReqVO pageReqVO) { - return materialPlanDetailMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.materialplandetail; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.materialplandetail.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplandetail.MaterialPlanDetailDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplandetail.MaterialPlanDetailMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 物料需求计划物料详情 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class MaterialPlanDetailServiceImpl implements MaterialPlanDetailService { + + @Resource + private MaterialPlanDetailMapper materialPlanDetailMapper; + + @Override + public Long createMaterialPlanDetail(MaterialPlanDetailSaveReqVO createReqVO) { + // 插入 + MaterialPlanDetailDO materialPlanDetail = BeanUtils.toBean(createReqVO, MaterialPlanDetailDO.class); + materialPlanDetailMapper.insert(materialPlanDetail); + // 返回 + return materialPlanDetail.getId(); + } + + @Override + public void updateMaterialPlanDetail(MaterialPlanDetailSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialPlanDetailExists(updateReqVO.getId()); + // 更新 + MaterialPlanDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialPlanDetailDO.class); + materialPlanDetailMapper.updateById(updateObj); + } + + @Override + public void deleteMaterialPlanDetail(Long id) { + // 校验存在 + validateMaterialPlanDetailExists(id); + // 删除 + materialPlanDetailMapper.deleteById(id); + } + + private void validateMaterialPlanDetailExists(Long id) { + if (materialPlanDetailMapper.selectById(id) == null) { + throw exception(MATERIAL_PLAN_DETAIL_NOT_EXISTS); + } + } + + @Override + public MaterialPlanDetailDO getMaterialPlanDetail(Long id) { + return materialPlanDetailMapper.selectById(id); + } + + @Override + public PageResult getMaterialPlanDetailPage(MaterialPlanDetailPageReqVO pageReqVO) { + return materialPlanDetailMapper.selectPage(pageReqVO); + } + + @Override + public PageResult getMaterialPlanDetailSumPage(MaterialPlanDetailPageReqVO pageReqVO) { + return materialPlanDetailMapper.selectSumPage(pageReqVO); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java index efc6028c..1657a1a5 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanService.java @@ -55,6 +55,8 @@ public interface PlanService { PageResult getPlanPageByStatus(PlanPageReqVO pageReqVO); Long generatePlanByProjectId(Long projectId); + void generatePlanTaskByPlanId(Long planId); void updatePlanStatusToTerminateByProjectId(Long projectId); + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java index fbe421c6..a04250c7 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plan/PlanServiceImpl.java @@ -4,16 +4,32 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.chanko.yunxi.mes.framework.common.pojo.PageParam; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.framework.operatelog.core.service.OperateLogFrameworkService; import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.PlanPageReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.plan.vo.PlanSaveReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.plansub.vo.PlanSubPageReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plansub.PlanSubDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask.PlanTaskDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; import com.chanko.yunxi.mes.module.heli.dal.mysql.plan.PlanMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.plansub.PlanSubMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.plantask.PlanTaskMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.plantaskbom.PlanTaskBomMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper; +import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum; import com.chanko.yunxi.mes.module.heli.enums.ProjectPlanStatusEnum; +import com.chanko.yunxi.mes.module.heli.enums.TaskDispatchTypeEnum; import com.chanko.yunxi.mes.module.heli.service.projectorder.ProjectOrderService; import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService; import jodd.util.StringUtil; @@ -24,13 +40,16 @@ import org.springframework.validation.annotation.Validated; import org.thymeleaf.util.StringUtils; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.PROJECT_PLAN; +import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.PROJECT_PLAN_TASK; import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.PLAN_NOT_EXISTS; /** @@ -43,6 +62,12 @@ import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.PLAN_NOT @Validated public class PlanServiceImpl implements PlanService { + @Resource + private OperateLogFrameworkService operateLogFrameworkService; + + @Resource + private HttpServletRequest request; + @Resource private PlanMapper planMapper; @@ -55,6 +80,21 @@ public class PlanServiceImpl implements PlanService { @Resource private SerialNumberService serialNumberService; + @Resource + private ProcessBomMapper processBomMapper; + + @Resource + private PlanTaskMapper planTaskMapper; + + @Resource + private ProjectOrderMapper projectOrderMapper; + + @Resource + private ProcessBomDetailMapper processBomDetailMapper; + + @Resource + private PlanTaskBomMapper planTaskBomMapper; + @Override public Long createPlan(PlanSaveReqVO createReqVO) { // 插入 @@ -117,70 +157,30 @@ public class PlanServiceImpl implements PlanService { public Long generatePlanByProjectId(Long projectId){ Long id = null; // 查询最近归档历史并对比变化字段 - try { - PlanDO planDO = planMapper.selectOne(new LambdaQueryWrapper() {{ - eq(PlanDO::getProjectId, projectId); - orderByDesc(PlanDO::getId); - last("LIMIT 1"); - }}); - // 生成生产计划子项目信息 - List projectOrderSubDOs = projectOrderService.getProjectOrderSubListByProjectOrderId(projectId); - if(planDO != null){ - // 设置项目更新次数 - planDO.setChangeNum(planDO.getChangeNum()+1); - // 设置项目更新时间 - planDO.setChangeLastDate(LocalDateTime.now()); - // 设置生产计划状态 - planDO.setStatus(ProjectPlanStatusEnum.CHANGE.getCode()); - planMapper.updateById(planDO); - - PlanSubPageReqVO pageReqVO = new PlanSubPageReqVO(); - pageReqVO.setPageNo(1); - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = planSubMapper.selectPage(pageReqVO).getList(); - - for(ProjectOrderSubDO item : projectOrderSubDOs){ - if(!list.stream().anyMatch(a ->a.getProjectSubId().equals(item.getId()))) { - PlanSubDO planSubDO = new PlanSubDO(); - planSubDO.setProjectPlanId(planDO.getId()); - planSubDO.setProjectId(projectId); - planSubDO.setProjectSubId(item.getId()); - if(!StringUtils.isEmpty(item.getDeviceModel())){ - planSubDO.setEquipId(Long.parseLong(item.getDeviceModel())); - } - - planSubMapper.insert(planSubDO); - } - else{ - PlanSubDO planSubDO = list.stream().filter(ps -> ps.getProjectSubId().equals(item.getId())).findFirst().get(); - if(!StringUtils.isEmpty(item.getDeviceModel())){ - planSubDO.setEquipId(Long.parseLong(item.getDeviceModel())); - } - planSubMapper.updateById(planSubDO); - } - } + PlanDO planDO = planMapper.selectOne(new LambdaQueryWrapper() {{ + eq(PlanDO::getProjectId, projectId); + orderByDesc(PlanDO::getId); + last("LIMIT 1"); + }}); + // 生成生产计划子项目信息 + List projectOrderSubDOs = projectOrderService.getProjectOrderSubListByProjectOrderId(projectId); + if(planDO != null){ + // 设置项目更新次数 + planDO.setChangeNum(planDO.getChangeNum()+1); + // 设置项目更新时间 + planDO.setChangeLastDate(LocalDateTime.now()); + // 取消设置生产计划状态 + // planDO.setStatus(ProjectPlanStatusEnum.CHANGE.getCode()); + planMapper.updateById(planDO); - }else{ - planDO = new PlanDO(); - planDO.setProjectId(projectId); - // 设置项目更新次数 - planDO.setChangeNum(0); - // 设置生产计划状态 - planDO.setStatus(ProjectPlanStatusEnum.START.getCode()); + PlanSubPageReqVO pageReqVO = new PlanSubPageReqVO(); + pageReqVO.setPageNo(1); + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = planSubMapper.selectPage(pageReqVO).getList(); - // 月度流水号 - SerialNumberDO serialNumberDO = new SerialNumberDO(); - serialNumberDO = serialNumberService.getSerialNumber(PROJECT_PLAN.name(), new SimpleDateFormat("yyyyMM").format(new Date())); - serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1); - - planDO.setPlanNo(PROJECT_PLAN.getCode(serialNumberDO.getSerialNumber().toString())); - - planMapper.insert(planDO); - // 回写序列记录 - serialNumberService.updateSerialNumber(serialNumberDO); - - for(ProjectOrderSubDO item : projectOrderSubDOs){ + for(ProjectOrderSubDO item : projectOrderSubDOs){ + if(!list.stream().anyMatch(a ->a.getProjectSubId().equals(item.getId()))) { PlanSubDO planSubDO = new PlanSubDO(); planSubDO.setProjectPlanId(planDO.getId()); planSubDO.setProjectId(projectId); @@ -188,36 +188,239 @@ public class PlanServiceImpl implements PlanService { if(!StringUtils.isEmpty(item.getDeviceModel())){ planSubDO.setEquipId(Long.parseLong(item.getDeviceModel())); } + planSubMapper.insert(planSubDO); } + else{ + PlanSubDO planSubDO = list.stream().filter(ps -> ps.getProjectSubId().equals(item.getId())).findFirst().get(); + if(!StringUtils.isEmpty(item.getDeviceModel())){ + planSubDO.setEquipId(Long.parseLong(item.getDeviceModel())); + } + + planSubMapper.updateById(planSubDO); + } + } + + }else{ + planDO = new PlanDO(); + planDO.setProjectId(projectId); + // 设置项目更新次数 + planDO.setChangeNum(0); + // 设置生产计划状态 + planDO.setStatus(ProjectPlanStatusEnum.START.getCode()); + + // 月度流水号 + SerialNumberDO serialNumberDO = new SerialNumberDO(); + serialNumberDO = serialNumberService.getSerialNumber(PROJECT_PLAN.name(), new SimpleDateFormat("yyyyMM").format(new Date())); + serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1); + + planDO.setPlanNo(PROJECT_PLAN.getCode(serialNumberDO.getSerialNumber().toString())); + + planMapper.insert(planDO); + // 回写序列记录 + serialNumberService.updateSerialNumber(serialNumberDO); + + for(ProjectOrderSubDO item : projectOrderSubDOs){ + PlanSubDO planSubDO = new PlanSubDO(); + planSubDO.setProjectPlanId(planDO.getId()); + planSubDO.setProjectId(projectId); + planSubDO.setProjectSubId(item.getId()); + if(!StringUtils.isEmpty(item.getDeviceModel())){ + planSubDO.setEquipId(Long.parseLong(item.getDeviceModel())); + } + planSubMapper.insert(planSubDO); } - id = planDO.getId(); - }catch (Exception e){ - log.error("base projectId to generate planDo error, id: {}, exception: {}", projectId, e.getMessage(), e); } + // 同时生成生产任务单 + //generatePlanTaskByPlanId(planDO.getId()); + id = planDO.getId(); + return id; } @Override public void updatePlanStatusToTerminateByProjectId(Long projectId){ // 查询最近归档历史并对比变化字段 - try { - PlanDO planDO = planMapper.selectOne(new LambdaQueryWrapper() {{ - eq(PlanDO::getProjectId, projectId); - orderByDesc(PlanDO::getId); + PlanDO planDO = planMapper.selectOne(new LambdaQueryWrapper() {{ + eq(PlanDO::getProjectId, projectId); + orderByDesc(PlanDO::getId); + last("LIMIT 1"); + }}); + if(planDO != null){ + // 设置项目更新次数 + planDO.setChangeNum(planDO.getChangeNum()+1); + // 设置项目更新时间 + planDO.setChangeLastDate(LocalDateTime.now()); + // 设置生产计划状态 + planDO.setStatus(ProjectPlanStatusEnum.TERMINATE.getCode()); + planMapper.updateById(planDO); + + // 更新生产任务单状态 + updatePlanTaskStatusToTerminateByPlanId(planDO.getId()); + } + } + + /** + * 生成生产任务单 + * @param planId + */ + @Override + public void generatePlanTaskByPlanId(Long planId){ + // 获取生产计划 + PlanDO planDO = planMapper.selectOne(new LambdaQueryWrapper() {{ + eq(PlanDO::getId, planId); + orderByDesc(PlanDO::getId); + last("LIMIT 1"); + }}); + // 获取生产计划子项目信息 + List planSubDOS = planSubMapper.selectList(new LambdaQueryWrapper() {{ + eq(PlanSubDO::getProjectPlanId, planId); + }}); + + // 获取订单信息 + ProjectOrderDO projectOrderDO = projectOrderMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ProjectOrderDO::getId, planDO.getProjectId()); + last("LIMIT 1"); + }}); + + for(PlanSubDO item : planSubDOS){ + + // 获取生产计划bom信息(一个生产计划一个生产计划子项目对应一个bom信息) + ProcessBomDO processBomDO = processBomMapper.selectOne(new LambdaQueryWrapper() {{ + eq(ProcessBomDO::getProjectId, planDO.getProjectId()); + eq(ProcessBomDO::getPlanId, planId); + eq(ProcessBomDO::getProjectSubId, item.getProjectSubId()); + last("LIMIT 1"); + }}); + + PlanTaskDO planTaskDO = planTaskMapper.selectOne(new LambdaQueryWrapper() {{ + eq(PlanTaskDO::getProjectId, planDO.getProjectId()); + eq(PlanTaskDO::getProjectPlanId, planId); + eq(PlanTaskDO::getProjectPlanSubId, item.getId()); + if(processBomDO!=null){ + eq(PlanTaskDO::getProcessBomId, processBomDO.getId()); + } + last("LIMIT 1"); }}); - if(planDO != null){ - // 设置项目更新次数 - planDO.setChangeNum(planDO.getChangeNum()+1); - // 设置项目更新时间 - planDO.setChangeLastDate(LocalDateTime.now()); - // 设置生产计划状态 - planDO.setStatus(ProjectPlanStatusEnum.TERMINATE.getCode()); - planMapper.updateById(planDO); + + // 生产计划任务单存在则更新版本号和状态,不存在则新增 + if(planTaskDO == null){ + + planTaskDO = new PlanTaskDO(); + // 日度流水号 + SerialNumberDO serialNumberDO = new SerialNumberDO(); + serialNumberDO = serialNumberService.getSerialNumber(PROJECT_PLAN_TASK.name(), new SimpleDateFormat("yyyyMMdd").format(new Date())); + serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1); + + // 生产计划任务单编号:PT+年月日+日度顺序号(三位流水) + planTaskDO.setTaskNo(PROJECT_PLAN_TASK.getCode(serialNumberDO.getSerialNumber().toString())); + + // 项目id + planTaskDO.setProjectId(planDO.getProjectId()); + // 生产计划id + planTaskDO.setProjectPlanId(planId); + // 生产计划子项目id + planTaskDO.setProjectPlanSubId(item.getId()); + if(processBomDO != null) { + // bom id + planTaskDO.setProcessBomId(processBomDO.getId()); + // bom 版本号 + planTaskDO.setBomVersion(processBomDO.getVersion()); + } + // 订单状态更新生产计划任务 + planTaskDO.setStatus(projectOrderDO.getStatus()); + + planTaskMapper.insert(planTaskDO); + + // 回写序列记录 + serialNumberService.updateSerialNumber(serialNumberDO); + + }else { + if(processBomDO != null) { + // bom id + planTaskDO.setProcessBomId(processBomDO.getId()); + // bom 版本号 + planTaskDO.setBomVersion(processBomDO.getVersion()); + } + // 订单状态更新生产计划任务 + planTaskDO.setStatus(projectOrderDO.getStatus()); + + planTaskMapper.updateById(planTaskDO); + } + + // 手动记录日志 + LocalDateTime startTime = LocalDateTime.now(); + operateLogFrameworkService.createOperateLog(request, + startTime, + BusinesTypeEnum.PLAN_TASK.name(), + planTaskDO.getId(), + OperateTypeEnum.valueOf("SAVE").getType(), + ""); + // 生成生产计划任务单加工件明细 + generatePlanTaskBom(planTaskDO.getId(),processBomDO); + } + } + + /** + * 生成生产计划任务单加工件明细 + * @param planTaskId + * @param processBomDO + */ + private void generatePlanTaskBom(Long planTaskId,ProcessBomDO processBomDO){ + if(processBomDO != null){ + // 获取bom下的加工件明细 + List processBomDetailDOS = processBomDetailMapper.selectList( + new LambdaQueryWrapper() {{ + eq(ProcessBomDetailDO::getBomId, processBomDO.getId()); + }} + ); + // 获取生产任务单下的加工件明细 + List planTaskBomDOS = planTaskBomMapper.selectList( + new LambdaQueryWrapper() {{ + eq(PlanTaskBomDO::getTaskId, planTaskId); + }} + ); + for(PlanTaskBomDO record : planTaskBomDOS){ + // 生产任务单下加工件是否已删除 + if(!processBomDetailDOS.stream().anyMatch(a ->a.getId().equals(record.getBomDetailId()))) { + planTaskBomMapper.deleteById(record); + } + } + for(ProcessBomDetailDO record : processBomDetailDOS){ + // 生产任务单下不存在该加工件,则插入,否则不处理 + if(!planTaskBomDOS.stream().anyMatch(a ->a.getBomDetailId().equals(record.getId()))) { + PlanTaskBomDO planTaskBomDO = new PlanTaskBomDO(); + + planTaskBomDO.setTaskId(planTaskId); + planTaskBomDO.setBomDetailId(record.getId()); + planTaskBomMapper.insert(planTaskBomDO); + } } - }catch (Exception e){ - log.error("base projectId to update planDo's status error, id: {}, exception: {}", projectId, e.getMessage(), e); } } + /** + * 更新生产任务单状态 + * @param planId + */ + private void updatePlanTaskStatusToTerminateByPlanId(Long planId){ + List planTaskDOS = planTaskMapper.selectList(new LambdaQueryWrapper() {{ + eq(PlanTaskDO::getProjectPlanId, planId); + }}); + + for(PlanTaskDO task :planTaskDOS){ + task.setStatus(ProjectPlanStatusEnum.TERMINATE.getCode()); + + planTaskMapper.updateById(task); + + // 手动记录日志 + LocalDateTime startTime = LocalDateTime.now(); + operateLogFrameworkService.createOperateLog(request, + startTime, + BusinesTypeEnum.PLAN_TASK.name(), + planId, + ProcessBomStatusEnum.TERMINATE.getCode(), + ""); + } + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantask/PlanTaskService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantask/PlanTaskService.java new file mode 100644 index 00000000..c715ce4d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantask/PlanTaskService.java @@ -0,0 +1,65 @@ +package com.chanko.yunxi.mes.module.heli.service.plantask; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.plantask.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask.PlanTaskDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 生产计划任务 Service 接口 + * + * @author 管理员 + */ +public interface PlanTaskService { + + /** + * 创建生产计划任务 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createPlanTask(@Valid PlanTaskSaveReqVO createReqVO); + + /** + * 更新生产计划任务 + * + * @param updateReqVO 更新信息 + */ + void updatePlanTask(@Valid PlanTaskSaveReqVO updateReqVO); + + /** + * 删除生产计划任务 + * + * @param id 编号 + */ + void deletePlanTask(Long id); + + /** + * 获得生产计划任务 + * + * @param id 编号 + * @return 生产计划任务 + */ + PlanTaskDO getPlanTask(Long id); + + /** + * 获得生产计划任务分页 + * + * @param pageReqVO 分页查询 + * @return 生产计划任务分页 + */ + PageResult getPlanTaskPage(PlanTaskPageReqVO pageReqVO); + + /** + * 获得生产计划任务 + * + * @param id 编号 + * @return 是否需要更新,0更新,1不更新 + */ + Integer getPlanTaskBomStatus(Long id); + + Integer refreshPlanTaskByPlanId(Long planId); + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantask/PlanTaskServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantask/PlanTaskServiceImpl.java new file mode 100644 index 00000000..8b2b99af --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantask/PlanTaskServiceImpl.java @@ -0,0 +1,134 @@ +package com.chanko.yunxi.mes.module.heli.service.plantask; + +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.plantaskbom.PlanTaskBomMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomMapper; +import com.chanko.yunxi.mes.module.heli.enums.ProcessBomStatusEnum; +import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager; +import com.chanko.yunxi.mes.module.heli.service.plan.PlanService; +import com.chanko.yunxi.mes.module.heli.service.plan.PlanServiceImpl; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +import com.chanko.yunxi.mes.module.heli.controller.admin.plantask.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantask.PlanTaskDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.plantask.PlanTaskMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 生产计划任务 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class PlanTaskServiceImpl implements PlanTaskService { + + @Resource + private PlanServiceImpl planServiceImpl; + + @Resource + private PlanTaskMapper planTaskMapper; + + @Resource + private PlanTaskBomMapper planTaskBomMapper; + + @Resource + private ProcessBomMapper processBomMapper; + + @Resource + private CrossOrderManager crossOrderManager; + + @Override + public Long createPlanTask(PlanTaskSaveReqVO createReqVO) { + // 插入 + PlanTaskDO planTask = BeanUtils.toBean(createReqVO, PlanTaskDO.class); + planTaskMapper.insert(planTask); + // 返回 + return planTask.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updatePlanTask(PlanTaskSaveReqVO updateReqVO) { + // 校验存在 + validatePlanTaskExists(updateReqVO.getId()); + // 更新 + PlanTaskDO updateObj = BeanUtils.toBean(updateReqVO, PlanTaskDO.class); + planTaskMapper.updateById(updateObj); + + // 更新加工件明细 + List planTaskBomDOS= updateReqVO.getBomDetails().stream().filter(o -> o.getId() != null).collect(Collectors.toList()); + if(planTaskBomDOS.stream().count()>0) { + planTaskBomMapper.updateBatch(planTaskBomDOS); + } + + // 生产任务单提交同时生成派工单 + if(updateObj.getStatus().equals(ProcessBomStatusEnum.SUBMIT.getCode())){ + crossOrderManager.generateProductionTaskDispatch(updateObj.getId()); + } + } + + @Override + public void deletePlanTask(Long id) { + // 校验存在 + validatePlanTaskExists(id); + // 删除 + planTaskMapper.deleteById(id); + } + + private void validatePlanTaskExists(Long id) { + if (planTaskMapper.selectById(id) == null) { + throw exception(PLAN_TASK_NOT_EXISTS); + } + } + + @Override + public PlanTaskDO getPlanTask(Long id) { + return planTaskMapper.selectById(id); + } + + @Override + public PageResult getPlanTaskPage(PlanTaskPageReqVO pageReqVO) { + return planTaskMapper.selectPage(pageReqVO); + } + + @Override + public Integer getPlanTaskBomStatus(Long id){ + + // 刷新状态,1为刷新,0为不刷新 + Integer refreshStatus = 0; + PlanTaskDO planTaskDO = planTaskMapper.selectById(id); + + if(planTaskDO.getProcessBomId()==null){ + // 无bomid时,需要刷新 + refreshStatus = 1; + }else{ + ProcessBomDO processBomDO = processBomMapper.selectById(planTaskDO.getProcessBomId()); + + // 生产任务版本号与bom版本号不同,需要刷新 + if(!planTaskDO.getBomVersion().equals(processBomDO.getVersion())){ + refreshStatus = 1; + } + } + return refreshStatus; + } + + @Override + public Integer refreshPlanTaskByPlanId(Long planId){ + planServiceImpl.generatePlanTaskByPlanId(planId); + return 1; + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantaskbom/PlanTaskBomService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantaskbom/PlanTaskBomService.java new file mode 100644 index 00000000..ee40934a --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantaskbom/PlanTaskBomService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.plantaskbom; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 生产计划任务Bom Service 接口 + * + * @author 管理员 + */ +public interface PlanTaskBomService { + + /** + * 创建生产计划任务Bom + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createPlanTaskBom(@Valid PlanTaskBomSaveReqVO createReqVO); + + /** + * 更新生产计划任务Bom + * + * @param updateReqVO 更新信息 + */ + void updatePlanTaskBom(@Valid PlanTaskBomSaveReqVO updateReqVO); + + /** + * 删除生产计划任务Bom + * + * @param id 编号 + */ + void deletePlanTaskBom(Long id); + + /** + * 获得生产计划任务Bom + * + * @param id 编号 + * @return 生产计划任务Bom + */ + PlanTaskBomDO getPlanTaskBom(Long id); + + /** + * 获得生产计划任务Bom分页 + * + * @param pageReqVO 分页查询 + * @return 生产计划任务Bom分页 + */ + PageResult getPlanTaskBomPage(PlanTaskBomPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantaskbom/PlanTaskBomServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantaskbom/PlanTaskBomServiceImpl.java new file mode 100644 index 00000000..fab9fbd0 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/plantaskbom/PlanTaskBomServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.plantaskbom; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.plantaskbom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.plantaskbom.PlanTaskBomDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.plantaskbom.PlanTaskBomMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 生产计划任务Bom Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class PlanTaskBomServiceImpl implements PlanTaskBomService { + + @Resource + private PlanTaskBomMapper planTaskBomMapper; + + @Override + public Long createPlanTaskBom(PlanTaskBomSaveReqVO createReqVO) { + // 插入 + PlanTaskBomDO planTaskBom = BeanUtils.toBean(createReqVO, PlanTaskBomDO.class); + planTaskBomMapper.insert(planTaskBom); + // 返回 + return planTaskBom.getId(); + } + + @Override + public void updatePlanTaskBom(PlanTaskBomSaveReqVO updateReqVO) { + // 校验存在 + validatePlanTaskBomExists(updateReqVO.getId()); + // 更新 + PlanTaskBomDO updateObj = BeanUtils.toBean(updateReqVO, PlanTaskBomDO.class); + planTaskBomMapper.updateById(updateObj); + } + + @Override + public void deletePlanTaskBom(Long id) { + // 校验存在 + validatePlanTaskBomExists(id); + // 删除 + planTaskBomMapper.deleteById(id); + } + + private void validatePlanTaskBomExists(Long id) { + if (planTaskBomMapper.selectById(id) == null) { + throw exception(PLAN_TASK_BOM_NOT_EXISTS); + } + } + + @Override + public PlanTaskBomDO getPlanTaskBom(Long id) { + return planTaskBomMapper.selectById(id); + } + + @Override + public PageResult getPlanTaskBomPage(PlanTaskBomPageReqVO pageReqVO) { + return planTaskBomMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomService.java index 578f4bca..1b4e4361 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomService.java @@ -65,4 +65,6 @@ public interface ProcessBomService { List getProcessBomDetailListByBomId(Long bomId); void operateProcessBom(ProcessBomSaveReqVO operateReqVO); + + void deleteProcessBomDetail(Long id); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomServiceImpl.java index d8317517..2f9e3270 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processbom/ProcessBomServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; @@ -124,14 +125,22 @@ public class ProcessBomServiceImpl implements ProcessBomService { } } + @Override + public void deleteProcessBomDetail(Long id) { + processBomDetailMapper.deleteById(id); + } + private void createProcessBomDetailList(Long bomId, List list) { list.forEach(o -> o.setBomId(bomId)); - processBomDetailMapper.insertBatch(list); + // 分组更新与插入 + List updateList = list.stream().filter(o -> o.getId() != null).collect(Collectors.toList()); + List insertList = list.stream().filter(o -> o.getId() == null).collect(Collectors.toList()); + + if(!updateList.isEmpty()) processBomDetailMapper.updateBatch(updateList); + if(!insertList.isEmpty()) processBomDetailMapper.insertBatch(insertList); } private void updateProcessBomDetailList(Long bomId, List list) { - deleteProcessBomDetailByBomId(bomId); - list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新 createProcessBomDetailList(bomId, list); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java index 59f94fe2..8c75e7ee 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/processdesign/ProcessDesignServiceImpl.java @@ -156,22 +156,23 @@ public class ProcessDesignServiceImpl implements ProcessDesignService { long betweenMills = 0; String ownerName = ""; + long oneDayMills = 86400000; if(ProcessDesignTypeEnum.BLUEPRINT_WORKBLANK.name().equals(processDesign.getProcessDesignType())){ - betweenMills = Duration.between(now, processDesign.getBlankDate()).toMillis(); + betweenMills = Duration.between(now, processDesign.getBlankDate()).toMillis() + oneDayMills - 1; ownerName = processDesign.getBlankOwnerName(); }else if(ProcessDesignTypeEnum.BLUEPRINT_3D.name().equals(processDesign.getProcessDesignType())){ - betweenMills = Duration.between(now, processDesign.getThreeDimDate()).toMillis(); + betweenMills = Duration.between(now, processDesign.getThreeDimDate()).toMillis() + oneDayMills - 1; ownerName = processDesign.getThreeDimOwnerName(); }else if(ProcessDesignTypeEnum.BLUEPRINT_2D.name().equals(processDesign.getProcessDesignType())){ - betweenMills = Duration.between(now, processDesign.getTwoDimDate()).toMillis(); + betweenMills = Duration.between(now, processDesign.getTwoDimDate()).toMillis() + oneDayMills - 1; ownerName = processDesign.getTwoDimOwnerName(); }else if (ProcessDesignTypeEnum.BLUEPRINT_FOUNDRY_TECHNOLOGY.name().equals(processDesign.getProcessDesignType())){ - betweenMills = Duration.between(now, processDesign.getCraftEndDate()).toMillis(); + betweenMills = Duration.between(now, processDesign.getCraftEndDate()).toMillis() + oneDayMills - 1; ownerName = processDesign.getCraftOwnerName(); } // 时差判断 48小时 - if(betweenMills <= 172800000){ + if(betweenMills <= (2*oneDayMills)){ warningVO.setRemainingTime(betweenMills).setOwnerName(ownerName); warningMessageVO.getWarnings().add(warningVO); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderService.java index 7830eeaf..b2d662e2 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderService.java @@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.service.projectorder; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSaveReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSubPageReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; @@ -75,4 +76,8 @@ public interface ProjectOrderService { * @param operateReqVO */ void createProjectOrderSnapshot(ProjectOrderSaveReqVO operateReqVO); + + void deleteProjectOrderSub(Long id); + + PageResult getProjectOrderSubPage(ProjectOrderSubPageReqVO pageReqVO); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java index 49107418..70ddc4ae 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/projectorder/ProjectOrderServiceImpl.java @@ -1,18 +1,24 @@ package com.chanko.yunxi.mes.module.heli.service.projectorder; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderPageReqVO; import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSaveReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.projectorder.vo.ProjectOrderSubPageReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.deliverorder.DeliverOrderSubMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper; import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.DeliverOrderStatusEnum; import com.chanko.yunxi.mes.module.heli.enums.ProjectOrderStatusEnum; import com.chanko.yunxi.mes.module.heli.enums.YesOrNoEnum; import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager; @@ -23,6 +29,7 @@ import com.chanko.yunxi.mes.module.infra.dal.dataobject.file.FileDO; import com.chanko.yunxi.mes.module.infra.service.file.FileService; import com.github.dadiyang.equator.FieldInfo; import com.github.dadiyang.equator.GetterBaseEquator; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -68,6 +75,9 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { @Resource private CrossOrderManager crossOrderManager; + @Resource + private DeliverOrderSubMapper deliverOrderSubMapper; + @Override @Transactional(rollbackFor = Exception.class) public Long createProjectOrder(ProjectOrderSaveReqVO createReqVO) { @@ -110,8 +120,9 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { ; projectOrderMapper.insert(projectOrder); // 子项目 - createReqVO.getProjectOrderSubs().forEach(projectOrderSubDO -> projectOrderSubDO.setId(null)); - createProjectOrderSubList(projectOrder.getId(), createReqVO.getProjectOrderSubs()); + List projectOrderSubDOList = projectOrderSubMapper.selectListByProjectOrderId(createReqVO.getId()); + projectOrderSubDOList.forEach(projectOrderSubDO -> projectOrderSubDO.setId(null)); + createProjectOrderSubList(projectOrder.getId(), projectOrderSubDOList); // 附件 PageResult filePage = fileService.getFilePage(new FilePageReqVO() {{ setPageNo(1); @@ -132,6 +143,16 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { serialNumberService.updateSerialNumber(serialNumberDO); } + @Override + public void deleteProjectOrderSub(Long id) { + projectOrderSubMapper.deleteById(id); + } + + @Override + public PageResult getProjectOrderSubPage(ProjectOrderSubPageReqVO pageReqVO) { + return projectOrderSubMapper.getProjectOrderSubPage(pageReqVO); + } + @Override @Transactional(rollbackFor = Exception.class) public void updateProjectOrder(ProjectOrderSaveReqVO updateReqVO) { @@ -148,11 +169,11 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { updateReqVO.setOrderStatus(updateObj.getOrderStatus()); // 更新子表 - updateProjectOrderSubList(updateReqVO.getId(), updateReqVO.getProjectOrderSubs()); + if(CollUtil.isNotEmpty(updateReqVO.getProjectOrderSubs())) updateProjectOrderSubList(updateReqVO.getId(), updateReqVO.getProjectOrderSubs()); // 如已启动 按子项目生成虚拟物料数据 if(updateObj.getOrderStatus().intValue() == ProjectOrderStatusEnum.APPROVE.getCode()){ - crossOrderManager.generateVirtualMaterial(updateReqVO.getCode(), updateReqVO.getProjectOrderSubs()); + crossOrderManager.generateVirtualMaterial(updateReqVO.getCode(), updateObj.getId()); } } @@ -271,6 +292,26 @@ public class ProjectOrderServiceImpl implements ProjectOrderService { } } + + if(!projectOrderSubDOList.isEmpty()){ + // 已发货数量 + MPJLambdaWrapper historyDeliveredSubQuery = new MPJLambdaWrapper<>(); + historyDeliveredSubQuery.selectAll(DeliverOrderSubDO.class) + .leftJoin(DeliverOrderDO.class, DeliverOrderDO::getId, DeliverOrderSubDO::getDeliveryOrderId) + .eq(DeliverOrderDO::getDeliverStatus, DeliverOrderStatusEnum.DELIVER.getCode()) + .in(DeliverOrderSubDO::getSaleOrderSubId, projectOrderSubDOList.stream().map(ProjectOrderSubDO::getId).collect(Collectors.toList())); + List historyDeliveredSubList = deliverOrderSubMapper.selectList(historyDeliveredSubQuery); + Map> historyDeliveredSubsGroupBySaleSubId = historyDeliveredSubList.stream().collect(Collectors.groupingBy(DeliverOrderSubDO::getSaleOrderSubId)); + projectOrderSubDOList.forEach(projectOrderSubDO -> { + int deliverAmount = 0; + List deliverOrderSubDOList = historyDeliveredSubsGroupBySaleSubId.get(projectOrderSubDO.getId()); + if(deliverOrderSubDOList != null && !deliverOrderSubDOList.isEmpty()){ + deliverAmount = deliverOrderSubDOList.stream().mapToInt(DeliverOrderSubDO::getAmount).sum(); + } + projectOrderSubDO.setDeliverAmount(deliverAmount); + }); + } + return projectOrderSubDOList; } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorder/PurchaseOrderServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorder/PurchaseOrderServiceImpl.java index 7fb62907..506f658f 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorder/PurchaseOrderServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorder/PurchaseOrderServiceImpl.java @@ -70,7 +70,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService { if(updateReqVO.getStatus()==2){ updateObj.setSubmitTime(currTime); } - if(updateReqVO.getStatus()== 3 || updateReqVO.getStatus() == 4){ + if(updateReqVO.getStatus()== 3){ updateObj.setAuditTime(currTime); } purchaseOrderMapper.updateById(updateObj); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderboom/PurchaseOrderBoomService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderboom/PurchaseOrderBoomService.java new file mode 100644 index 00000000..547cecfc --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderboom/PurchaseOrderBoomService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.purchaseorderboom; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 采购订单加工件明细 Service 接口 + * + * @author 管理员 + */ +public interface PurchaseOrderBoomService { + + /** + * 创建采购订单加工件明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createPurchaseOrderBoom(@Valid PurchaseOrderBoomSaveReqVO createReqVO); + + /** + * 更新采购订单加工件明细 + * + * @param updateReqVO 更新信息 + */ + void updatePurchaseOrderBoom(@Valid PurchaseOrderBoomSaveReqVO updateReqVO); + + /** + * 删除采购订单加工件明细 + * + * @param id 编号 + */ + void deletePurchaseOrderBoom(Long id); + + /** + * 获得采购订单加工件明细 + * + * @param id 编号 + * @return 采购订单加工件明细 + */ + PurchaseOrderBoomDO getPurchaseOrderBoom(Long id); + + /** + * 获得采购订单加工件明细分页 + * + * @param pageReqVO 分页查询 + * @return 采购订单加工件明细分页 + */ + PageResult getPurchaseOrderBoomPage(PurchaseOrderBoomPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderboom/PurchaseOrderBoomServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderboom/PurchaseOrderBoomServiceImpl.java new file mode 100644 index 00000000..12a73808 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderboom/PurchaseOrderBoomServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.purchaseorderboom; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseorderboom.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderboom.PurchaseOrderBoomDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorderboom.PurchaseOrderBoomMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 采购订单加工件明细 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class PurchaseOrderBoomServiceImpl implements PurchaseOrderBoomService { + + @Resource + private PurchaseOrderBoomMapper purchaseOrderBoomMapper; + + @Override + public Long createPurchaseOrderBoom(PurchaseOrderBoomSaveReqVO createReqVO) { + // 插入 + PurchaseOrderBoomDO purchaseOrderBoom = BeanUtils.toBean(createReqVO, PurchaseOrderBoomDO.class); + purchaseOrderBoomMapper.insert(purchaseOrderBoom); + // 返回 + return purchaseOrderBoom.getId(); + } + + @Override + public void updatePurchaseOrderBoom(PurchaseOrderBoomSaveReqVO updateReqVO) { + // 校验存在 + validatePurchaseOrderBoomExists(updateReqVO.getId()); + // 更新 + PurchaseOrderBoomDO updateObj = BeanUtils.toBean(updateReqVO, PurchaseOrderBoomDO.class); + purchaseOrderBoomMapper.updateById(updateObj); + } + + @Override + public void deletePurchaseOrderBoom(Long id) { + // 校验存在 + validatePurchaseOrderBoomExists(id); + // 删除 + purchaseOrderBoomMapper.deleteById(id); + } + + private void validatePurchaseOrderBoomExists(Long id) { + if (purchaseOrderBoomMapper.selectById(id) == null) { + throw exception(PURCHASE_ORDER_BOOM_NOT_EXISTS); + } + } + + @Override + public PurchaseOrderBoomDO getPurchaseOrderBoom(Long id) { + return purchaseOrderBoomMapper.selectById(id); + } + + @Override + public PageResult getPurchaseOrderBoomPage(PurchaseOrderBoomPageReqVO pageReqVO) { + return purchaseOrderBoomMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialService.java index c2e75dbd..609a77d9 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialService.java @@ -1,55 +1,55 @@ -package com.chanko.yunxi.mes.module.heli.service.purchaseordermaterial; - -import java.util.*; -import javax.validation.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; - -/** - * 采购单物料 Service 接口 - * - * @author 管理员 - */ -public interface PurchaseOrderMaterialService { - - /** - * 创建采购单物料 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createPurchaseOrderMaterial(@Valid PurchaseOrderMaterialSaveReqVO createReqVO); - - /** - * 更新采购单物料 - * - * @param updateReqVO 更新信息 - */ - void updatePurchaseOrderMaterial(@Valid PurchaseOrderMaterialSaveReqVO updateReqVO); - - /** - * 删除采购单物料 - * - * @param id 编号 - */ - void deletePurchaseOrderMaterial(Long id); - - /** - * 获得采购单物料 - * - * @param id 编号 - * @return 采购单物料 - */ - PurchaseOrderMaterialDO getPurchaseOrderMaterial(Long id); - - /** - * 获得采购单物料分页 - * - * @param pageReqVO 分页查询 - * @return 采购单物料分页 - */ - PageResult getPurchaseOrderMaterialPage(PurchaseOrderMaterialPageReqVO pageReqVO); - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.purchaseordermaterial; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 采购单物料 Service 接口 + * + * @author 管理员 + */ +public interface PurchaseOrderMaterialService { + + /** + * 创建采购单物料 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createPurchaseOrderMaterial(@Valid PurchaseOrderMaterialSaveReqVO createReqVO); + + /** + * 更新采购单物料 + * + * @param updateReqVO 更新信息 + */ + void updatePurchaseOrderMaterial(@Valid PurchaseOrderMaterialSaveReqVO updateReqVO); + + /** + * 删除采购单物料 + * + * @param id 编号 + */ + void deletePurchaseOrderMaterial(Long id); + + /** + * 获得采购单物料 + * + * @param id 编号 + * @return 采购单物料 + */ + PurchaseOrderMaterialDO getPurchaseOrderMaterial(Long id); + + /** + * 获得采购单物料分页 + * + * @param pageReqVO 分页查询 + * @return 采购单物料分页 + */ + PageResult getPurchaseOrderMaterialPage(PurchaseOrderMaterialPageReqVO pageReqVO); + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialServiceImpl.java index bf2363ad..c0cff21c 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseordermaterial/PurchaseOrderMaterialServiceImpl.java @@ -1,74 +1,75 @@ -package com.chanko.yunxi.mes.module.heli.service.purchaseordermaterial; - -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; - -import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordermaterial.PurchaseOrderMaterialMapper; - -import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; - -/** - * 采购单物料 Service 实现类 - * - * @author 管理员 - */ -@Service -@Validated -public class PurchaseOrderMaterialServiceImpl implements PurchaseOrderMaterialService { - - @Resource - private PurchaseOrderMaterialMapper purchaseOrderMaterialMapper; - - @Override - public Long createPurchaseOrderMaterial(PurchaseOrderMaterialSaveReqVO createReqVO) { - // 插入 - PurchaseOrderMaterialDO purchaseOrderMaterial = BeanUtils.toBean(createReqVO, PurchaseOrderMaterialDO.class); - purchaseOrderMaterialMapper.insert(purchaseOrderMaterial); - // 返回 - return purchaseOrderMaterial.getId(); - } - - @Override - public void updatePurchaseOrderMaterial(PurchaseOrderMaterialSaveReqVO updateReqVO) { - // 校验存在 - validatePurchaseOrderMaterialExists(updateReqVO.getId()); - // 更新 - PurchaseOrderMaterialDO updateObj = BeanUtils.toBean(updateReqVO, PurchaseOrderMaterialDO.class); - purchaseOrderMaterialMapper.updateById(updateObj); - } - - @Override - public void deletePurchaseOrderMaterial(Long id) { - // 校验存在 - validatePurchaseOrderMaterialExists(id); - // 删除 - purchaseOrderMaterialMapper.deleteById(id); - } - - private void validatePurchaseOrderMaterialExists(Long id) { - if (purchaseOrderMaterialMapper.selectById(id) == null) { - throw exception(PURCHASE_ORDER_MATERIAL_NOT_EXISTS); - } - } - - @Override - public PurchaseOrderMaterialDO getPurchaseOrderMaterial(Long id) { - return purchaseOrderMaterialMapper.selectById(id); - } - - @Override - public PageResult getPurchaseOrderMaterialPage(PurchaseOrderMaterialPageReqVO pageReqVO) { - return purchaseOrderMaterialMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.purchaseordermaterial; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermaterial.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordermaterial.PurchaseOrderMaterialDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordermaterial.PurchaseOrderMaterialMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 采购单物料 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class PurchaseOrderMaterialServiceImpl implements PurchaseOrderMaterialService { + + @Resource + private PurchaseOrderMaterialMapper purchaseOrderMaterialMapper; + + @Override + public Long createPurchaseOrderMaterial(PurchaseOrderMaterialSaveReqVO createReqVO) { + // 插入 + PurchaseOrderMaterialDO purchaseOrderMaterial = BeanUtils.toBean(createReqVO, PurchaseOrderMaterialDO.class); + purchaseOrderMaterialMapper.insert(purchaseOrderMaterial); + // 返回 + return purchaseOrderMaterial.getId(); + } + + @Override + public void updatePurchaseOrderMaterial(PurchaseOrderMaterialSaveReqVO updateReqVO) { + // 校验存在 + validatePurchaseOrderMaterialExists(updateReqVO.getId()); + // 更新 + PurchaseOrderMaterialDO updateObj = BeanUtils.toBean(updateReqVO, PurchaseOrderMaterialDO.class); + purchaseOrderMaterialMapper.updateById(updateObj); + } + + @Override + public void deletePurchaseOrderMaterial(Long id) { + // 校验存在 + validatePurchaseOrderMaterialExists(id); + // 删除 + purchaseOrderMaterialMapper.deleteById(id); + } + + private void validatePurchaseOrderMaterialExists(Long id) { + if (purchaseOrderMaterialMapper.selectById(id) == null) { + throw exception(PURCHASE_ORDER_MATERIAL_NOT_EXISTS); + } + } + + @Override + public PurchaseOrderMaterialDO getPurchaseOrderMaterial(Long id) { + return purchaseOrderMaterialMapper.selectById(id); + } + + @Override + public PageResult getPurchaseOrderMaterialPage(PurchaseOrderMaterialPageReqVO pageReqVO) { + return purchaseOrderMaterialMapper.selectPage(pageReqVO); + } + + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualityfeedback/QualityFeedbackService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualityfeedback/QualityFeedbackService.java new file mode 100644 index 00000000..8072bcc2 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualityfeedback/QualityFeedbackService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.qualityfeedback; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.qualityfeedback.QualityFeedbackDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 客户反馈质量 Service 接口 + * + * @author 管理员 + */ +public interface QualityFeedbackService { + + /** + * 创建客户反馈质量 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createQualityFeedback(@Valid QualityFeedbackSaveReqVO createReqVO); + + /** + * 更新客户反馈质量 + * + * @param updateReqVO 更新信息 + */ + Long updateQualityFeedback(@Valid QualityFeedbackSaveReqVO updateReqVO); + + /** + * 删除客户反馈质量 + * + * @param id 编号 + */ + void deleteQualityFeedback(Long id); + + /** + * 获得客户反馈质量 + * + * @param id 编号 + * @return 客户反馈质量 + */ + QualityFeedbackDO getQualityFeedback(Long id); + + /** + * 获得客户反馈质量分页 + * + * @param pageReqVO 分页查询 + * @return 客户反馈质量分页 + */ + PageResult getQualityFeedbackPage(QualityFeedbackPageReqVO pageReqVO); + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualityfeedback/QualityFeedbackServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualityfeedback/QualityFeedbackServiceImpl.java new file mode 100644 index 00000000..94fa8589 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualityfeedback/QualityFeedbackServiceImpl.java @@ -0,0 +1,75 @@ +package com.chanko.yunxi.mes.module.heli.service.qualityfeedback; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualityfeedback.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.qualityfeedback.QualityFeedbackDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.qualityfeedback.QualityFeedbackMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 客户反馈质量 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class QualityFeedbackServiceImpl implements QualityFeedbackService { + + @Resource + private QualityFeedbackMapper qualityFeedbackMapper; + + @Override + public Long createQualityFeedback(QualityFeedbackSaveReqVO createReqVO) { + // 插入 + QualityFeedbackDO qualityFeedback = BeanUtils.toBean(createReqVO, QualityFeedbackDO.class); + qualityFeedbackMapper.insert(qualityFeedback); + // 返回 + return qualityFeedback.getId(); + } + + @Override + public Long updateQualityFeedback(QualityFeedbackSaveReqVO updateReqVO) { + // 校验存在 + validateQualityFeedbackExists(updateReqVO.getId()); + // 更新 + QualityFeedbackDO updateObj = BeanUtils.toBean(updateReqVO, QualityFeedbackDO.class); + qualityFeedbackMapper.updateById(updateObj); + return updateObj.getId(); + } + + @Override + public void deleteQualityFeedback(Long id) { + // 校验存在 + validateQualityFeedbackExists(id); + // 删除 + qualityFeedbackMapper.deleteById(id); + } + + private void validateQualityFeedbackExists(Long id) { + if (qualityFeedbackMapper.selectById(id) == null) { + throw exception(QUALITY_FEEDBACK_NOT_EXISTS); + } + } + + @Override + public QualityFeedbackDO getQualityFeedback(Long id) { + return qualityFeedbackMapper.selectById(id); + } + + @Override + public PageResult getQualityFeedbackPage(QualityFeedbackPageReqVO pageReqVO) { + return qualityFeedbackMapper.selectPage(pageReqVO); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualitymanagement/QualityManagementService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualitymanagement/QualityManagementService.java new file mode 100644 index 00000000..03317547 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualitymanagement/QualityManagementService.java @@ -0,0 +1,16 @@ +package com.chanko.yunxi.mes.module.heli.service.qualitymanagement; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo.InspectionReportPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo.InspectionReportRespVO; + +/** + * 质量管理 Service 接口 + * + * @author 管理员 + */ +public interface QualityManagementService { + PageResult getInspectionReportPage(InspectionReportPageReqVO pageReqVO); + + InspectionReportRespVO getInspectionReport(Long id); +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualitymanagement/QualityManagementServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualitymanagement/QualityManagementServiceImpl.java new file mode 100644 index 00000000..8e8aeea7 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/qualitymanagement/QualityManagementServiceImpl.java @@ -0,0 +1,37 @@ +package com.chanko.yunxi.mes.module.heli.service.qualitymanagement; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo.InspectionReportPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.qualitymanagement.vo.InspectionReportRespVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.projectorder.ProjectOrderSubMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * 质量管理 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class QualityManagementServiceImpl implements QualityManagementService{ + + @Resource + private ProjectOrderSubMapper projectOrderSubMapper; + + @Override + public PageResult getInspectionReportPage(InspectionReportPageReqVO pageReqVO) { + PageResult pageResult = projectOrderSubMapper.getInspectionReportPage(pageReqVO); + return BeanUtils.toBean(pageResult, InspectionReportRespVO.class); + } + + @Override + public InspectionReportRespVO getInspectionReport(Long id) { + ProjectOrderSubDO projectOrderSubDO = projectOrderSubMapper.getInspectionReport(id); + return BeanUtils.toBean(projectOrderSubDO, InspectionReportRespVO.class); + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogService.java index dd4adf47..5b6002e6 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogService.java @@ -8,6 +8,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogAll.StorageLogA import com.chanko.yunxi.mes.framework.common.pojo.PageResult; import com.chanko.yunxi.mes.framework.common.pojo.PageParam; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO; /** @@ -57,6 +58,12 @@ public interface StorageLogService { PageResult getStorageNowPage(StorageLogPageReqVO pageReqVO); + PageResult getStorageNowPageAll(StorageLogPageReqVO pageReqVO); + + PageResult getStorageNowPageInMaterial(StorageLogPageReqVO pageReqVO); + + PageResult getStorageNowPageGroupMaterial(StorageLogPageReqVO pageReqVO); + List selectNowByMatPnId(Long matId,Long pnId); List getStorageNowList(StorageNowAllReqVO queryReqVO); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogServiceImpl.java index 585aaf6d..9c80efc2 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagelog/StorageLogServiceImpl.java @@ -2,8 +2,10 @@ package com.chanko.yunxi.mes.module.heli.service.storagelog; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogAll.StorageLogAllDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO; import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogAllMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageLogNowMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.storagelog.StorageMaterialMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -39,6 +41,9 @@ public class StorageLogServiceImpl implements StorageLogService { @Resource private StorageLogNowMapper storageLogNowMapper; + @Resource + private StorageMaterialMapper storageMaterialMapper; + @Override public Long createStorageLog(StorageLogSaveReqVO createReqVO) { // 插入 @@ -86,6 +91,21 @@ public class StorageLogServiceImpl implements StorageLogService { return storageLogNowMapper.selectPage(pageReqVO); } + @Override + public PageResult getStorageNowPageAll(StorageLogPageReqVO pageReqVO) { + return storageLogNowMapper.selectPageAll(pageReqVO); + } + + @Override + public PageResult getStorageNowPageInMaterial(StorageLogPageReqVO pageReqVO) { + return storageMaterialMapper.selectMaterialWithNow(pageReqVO); + } + + @Override + public PageResult getStorageNowPageGroupMaterial(StorageLogPageReqVO pageReqVO) { + return storageMaterialMapper.selectMaterialGroupNow(pageReqVO); + } + @Override public List getStorageNowList(StorageNowAllReqVO queryReqVO) { if(queryReqVO.getNoZero().equals(1)){ diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchService.java index 2ca2f48a..b3c62351 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchService.java @@ -1,66 +1,76 @@ -package com.chanko.yunxi.mes.module.heli.service.taskdispatch; - -import java.util.*; -import javax.validation.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetail.TaskDispatchDetailDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; - -/** - * 派工单 Service 接口 - * - * @author 管理员 - */ -public interface TaskDispatchService { - - /** - * 创建派工单 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createTaskDispatch(@Valid TaskDispatchSaveReqVO createReqVO); - - /** - * 更新派工单 - * - * @param updateReqVO 更新信息 - */ - void updateTaskDispatch(@Valid TaskDispatchSaveReqVO updateReqVO); - - /** - * 删除派工单 - * - * @param id 编号 - */ - void deleteTaskDispatch(Long id); - - /** - * 获得派工单 - * - * @param id 编号 - * @return 派工单 - */ - TaskDispatchDO getTaskDispatch(Long id); - - /** - * 获得派工单分页 - * - * @param pageReqVO 分页查询 - * @return 派工单分页 - */ - PageResult getTaskDispatchPage(TaskDispatchPageReqVO pageReqVO); - - // ==================== 子表(派工明细) ==================== - - /** - * 获得派工明细列表 - * - * @param dispatchId 派工单id - * @return 派工明细列表 - */ - List getTaskDispatchDetailListByDispatchId(Long dispatchId); - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.taskdispatch; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchSaveReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; + +import javax.validation.Valid; +import java.util.List; + +/** + * 派工单 Service 接口 + * + * @author 管理员 + */ +public interface TaskDispatchService { + + /** + * 创建派工单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createTaskDispatch(@Valid TaskDispatchSaveReqVO createReqVO); + + /** + * 更新派工单 + * + * @param updateReqVO 更新信息 + */ + void updateTaskDispatch(@Valid TaskDispatchSaveReqVO updateReqVO); + + /** + * 删除派工单 + * + * @param id 编号 + */ + void deleteTaskDispatch(Long id); + + /** + * 获得派工单 + * + * @param id 编号 + * @return 派工单 + */ + TaskDispatchDO getTaskDispatch(Long id); + + /** + * 获得派工单分页 + * + * @param pageReqVO 分页查询 + * @return 派工单分页 + */ + PageResult getTaskDispatchPage(TaskDispatchPageReqVO pageReqVO); + + // ==================== 子表(派工明细) ==================== + + /** + * 获得派工明细列表 + * + * @param dispatchId 派工单id + * @return 派工明细列表 + */ + List getTaskDispatchDetailListByDispatchId(Long dispatchId); + + void operate(TaskDispatchSaveReqVO operateReqVO); + + void deleteTaskDispatchDetail(Long id); + + PageResult getTaskDispatchDetailPage(TaskDispatchDetailPageReqVO pageReqVO); + + void operateDetail(TaskDispatchDetailVO operateReqVO); +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java index 56c0ed3b..1f065817 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskdispatch/TaskDispatchServiceImpl.java @@ -1,112 +1,342 @@ -package com.chanko.yunxi.mes.module.heli.service.taskdispatch; - -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatchdetail.TaskDispatchDetailDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; - -import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMapper; -import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatchdetail.TaskDispatchDetailMapper; - -import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; - -/** - * 派工单 Service 实现类 - * - * @author 管理员 - */ -@Service -@Validated -public class TaskDispatchServiceImpl implements TaskDispatchService { - - @Resource - private TaskDispatchMapper taskDispatchMapper; - @Resource - private TaskDispatchDetailMapper taskDispatchDetailMapper; - - @Override - @Transactional(rollbackFor = Exception.class) - public Long createTaskDispatch(TaskDispatchSaveReqVO createReqVO) { - // 插入 - TaskDispatchDO taskDispatch = BeanUtils.toBean(createReqVO, TaskDispatchDO.class); - taskDispatchMapper.insert(taskDispatch); - - // 插入子表 - createTaskDispatchDetailList(taskDispatch.getId(), createReqVO.getTaskDispatchDetails()); - // 返回 - return taskDispatch.getId(); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void updateTaskDispatch(TaskDispatchSaveReqVO updateReqVO) { - // 校验存在 - validateTaskDispatchExists(updateReqVO.getId()); - // 更新 - TaskDispatchDO updateObj = BeanUtils.toBean(updateReqVO, TaskDispatchDO.class); - taskDispatchMapper.updateById(updateObj); - - // 更新子表 - updateTaskDispatchDetailList(updateReqVO.getId(), updateReqVO.getTaskDispatchDetails()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteTaskDispatch(Long id) { - // 校验存在 - validateTaskDispatchExists(id); - // 删除 - taskDispatchMapper.deleteById(id); - - // 删除子表 - deleteTaskDispatchDetailByDispatchId(id); - } - - private void validateTaskDispatchExists(Long id) { - if (taskDispatchMapper.selectById(id) == null) { - throw exception(TASK_DISPATCH_NOT_EXISTS); - } - } - - @Override - public TaskDispatchDO getTaskDispatch(Long id) { - return taskDispatchMapper.selectById(id); - } - - @Override - public PageResult getTaskDispatchPage(TaskDispatchPageReqVO pageReqVO) { - return taskDispatchMapper.selectPage(pageReqVO); - } - - // ==================== 子表(派工明细) ==================== - - @Override - public List getTaskDispatchDetailListByDispatchId(Long dispatchId) { - return taskDispatchDetailMapper.selectListByDispatchId(dispatchId); - } - - private void createTaskDispatchDetailList(Long dispatchId, List list) { - list.forEach(o -> o.setDispatchId(dispatchId)); - taskDispatchDetailMapper.insertBatch(list); - } - - private void updateTaskDispatchDetailList(Long dispatchId, List list) { - deleteTaskDispatchDetailByDispatchId(dispatchId); - list.forEach(o -> o.setId(null).setUpdater(null).setUpdateTime(null)); // 解决更新情况下:1)id 冲突;2)updateTime 不更新 - createTaskDispatchDetailList(dispatchId, list); - } - - private void deleteTaskDispatchDetailByDispatchId(Long dispatchId) { - taskDispatchDetailMapper.deleteByDispatchId(dispatchId); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.taskdispatch; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchDetailVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskdispatch.vo.TaskDispatchSaveReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport.TaskReportMapper; +import com.chanko.yunxi.mes.module.heli.enums.*; +import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager; +import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService; +import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; +import com.chanko.yunxi.mes.module.system.service.user.AdminUserService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 派工单 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class TaskDispatchServiceImpl implements TaskDispatchService { + + @Resource + private TaskDispatchMapper taskDispatchMapper; + @Resource + private TaskDispatchDetailMapper taskDispatchDetailMapper; + @Resource + private TaskReportMapper taskReportMapper; + @Resource + private CrossOrderManager crossOrderManager; + @Resource + private SerialNumberService serialNumberService; + @Resource + private AdminUserService adminUserService; + + @Override + @Transactional(rollbackFor = Exception.class) + public Long createTaskDispatch(TaskDispatchSaveReqVO createReqVO) { + // 插入 + TaskDispatchDO taskDispatch = BeanUtils.toBean(createReqVO, TaskDispatchDO.class); + + TaskDispatchTypeEnum taskDispatchTypeEnum = TaskDispatchTypeEnum.valueOf(taskDispatch.getDispatchType()); + SerialNumberDO serialNumberDO = serialNumberService.getSerialNumber(taskDispatchTypeEnum.getBusinesTypeEnum().name(), new SimpleDateFormat("yyyyMMdd").format(new Date())); + serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1); + taskDispatch.setCode(taskDispatchTypeEnum.getCodeEnum().getCode(serialNumberDO.getSerialNumber().toString())); + taskDispatch.setDispatchStatus(TaskDispatchStatusEnum.valueOf(createReqVO.getActive()).getCode()); + taskDispatchMapper.insert(taskDispatch); + + // 回写序列记录 + serialNumberService.updateSerialNumber(serialNumberDO); + + // 插入子表 + if(CollUtil.isNotEmpty(createReqVO.getTaskDispatchDetails())) createTaskDispatchDetailList(taskDispatch.getId(), createReqVO.getTaskDispatchDetails()); + createReqVO.setId(taskDispatch.getId()); + // 返回 + return taskDispatch.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateTaskDispatch(TaskDispatchSaveReqVO updateReqVO) { + // 校验存在 + validateTaskDispatchExists(updateReqVO.getId()); + // 提交的时候 明细不容许为空 + OperateTypeEnum operateTypeEnum = OperateTypeEnum.valueOf(updateReqVO.getActive()); + if(operateTypeEnum == OperateTypeEnum.SUBMIT){ + if(CollUtil.isEmpty(updateReqVO.getTaskDispatchDetails())){ + throw exception(PROCESS_BOM_DETAIL_NOT_EXISTS); + } + } + + // 更新 + TaskDispatchDO updateObj = BeanUtils.toBean(updateReqVO, TaskDispatchDO.class); + if(!updateObj.canOperate(operateTypeEnum)){ + throw exception(INVALID_OPERATE); + } + + // 明细工序状态更新 + if(operateTypeEnum == OperateTypeEnum.SUBMIT){ + updateReqVO.getTaskDispatchDetails().forEach(taskDispatchDetailDO -> { + if(taskDispatchDetailDO.getProcedureStatus().intValue() == 0){ + taskDispatchDetailDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.SUBMITTED.getCode()); + } + }); + } + updateObj.setDispatchStatus(TaskDispatchStatusEnum.valueOf(updateReqVO.getActive()).getCode()); + taskDispatchMapper.updateById(updateObj); + + // 更新子表 + updateTaskDispatchDetailList(updateReqVO.getId(), updateReqVO.getTaskDispatchDetails()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteTaskDispatch(Long id) { + // 校验存在 + validateTaskDispatchExists(id); + // 删除 + taskDispatchMapper.deleteById(id); + + // 删除子表 + deleteTaskDispatchDetailByDispatchId(id); + } + + private void validateTaskDispatchExists(Long id) { + if (taskDispatchMapper.selectById(id) == null) { + throw exception(TASK_DISPATCH_NOT_EXISTS); + } + } + + @Override + public TaskDispatchDO getTaskDispatch(Long id) { + TaskDispatchDO taskDispatchDO = taskDispatchMapper.selectById(id); + convertAssembleProcedure(taskDispatchDO); + return taskDispatchDO; + } + + @Override + public PageResult getTaskDispatchPage(TaskDispatchPageReqVO pageReqVO) { + PageResult taskDispatchDOPageResult = null; + // 如为装配任务 使用代码分页 + if(TaskDispatchTypeEnum.ASSEMBLE.name().equals(pageReqVO.getDispatchType())){ + + if(!StringUtils.isEmpty(pageReqVO.getOwnerName())){ + Integer pageNo = pageReqVO.getPageNo(); + Integer pageSize = pageReqVO.getPageSize(); + String ownerName = pageReqVO.getOwnerName(); + // 查全量 + pageReqVO.setOwnerName(null).setPageNo(1).setPageSize(99999); + taskDispatchDOPageResult = taskDispatchMapper.selectPage(pageReqVO); + List crudeResultList = taskDispatchDOPageResult.getList().stream().filter(taskDispatchDO -> { + convertAssembleProcedure(taskDispatchDO); + return !StringUtils.isEmpty(taskDispatchDO.getOwnerName()) && taskDispatchDO.getOwnerName().indexOf(ownerName) > -1; + }).collect(Collectors.toList()); + // 分页 + int totalPage = new BigDecimal(crudeResultList.size()).divide(new BigDecimal(pageSize), 0, RoundingMode.CEILING).intValue(); + List resultList = crudeResultList.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); + taskDispatchDOPageResult = new PageResult<>(resultList, Long.parseLong(String.valueOf(crudeResultList.size())), totalPage); + }else{ + taskDispatchDOPageResult = taskDispatchMapper.selectPage(pageReqVO); + } + + if(taskDispatchDOPageResult.getTotal() != 0){ + taskDispatchDOPageResult.getList().forEach(taskDispatchDO -> { + convertAssembleProcedure(taskDispatchDO); + }); + } + }else{ + taskDispatchDOPageResult = taskDispatchMapper.selectPage(pageReqVO); + } + + + return taskDispatchDOPageResult; + } + + private void convertAssembleProcedure(TaskDispatchDO taskDispatchDO) { + // 提取 装配 工序 + if(TaskDispatchTypeEnum.ASSEMBLE.name().equals(taskDispatchDO.getDispatchType()) && + !StringUtils.isEmpty(taskDispatchDO.getCraftContent())){ + List procedureList = JSON.parseObject(taskDispatchDO.getCraftContent(), new TypeReference>() {{ + }}); + Map assemble = procedureList.stream().filter(procedure -> { + return "装配".equals(procedure.get("name")); + }).findFirst().get(); + if(assemble != null && !assemble.isEmpty()){ + taskDispatchDO.setRequiredStartDate(!StringUtils.isEmpty(assemble.get("startDate")) ? Long.parseLong(String.valueOf(assemble.get("startDate"))) : null); + taskDispatchDO.setRequiredEndDate(!StringUtils.isEmpty(assemble.get("endDate")) ? Long.parseLong(String.valueOf(assemble.get("endDate"))) : null); + + String ownerName = ""; + if(!StringUtils.isEmpty(assemble.get("owner"))){ + AdminUserDO owner = adminUserService.getUser(Long.parseLong(String.valueOf(assemble.get("owner")))); + if(owner != null) { + ownerName = owner.getNickname(); + } + } + taskDispatchDO.setOwnerName(ownerName); + } + } + } + + // ==================== 子表(派工明细) ==================== + + @Override + public List getTaskDispatchDetailListByDispatchId(Long dispatchId) { + return taskDispatchDetailMapper.selectListByDispatchId(dispatchId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void operate(TaskDispatchSaveReqVO operateReqVO) { + if(operateReqVO.getId() == null){ + createTaskDispatch(operateReqVO); + }else{ + updateTaskDispatch(operateReqVO); + } + } + + @Override + public void deleteTaskDispatchDetail(Long id) { + taskDispatchDetailMapper.deleteByDispatchId(id); + } + + @Override + public PageResult getTaskDispatchDetailPage(TaskDispatchDetailPageReqVO pageReqVO) { + return taskDispatchDetailMapper.selectPage(pageReqVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void operateDetail(TaskDispatchDetailVO operateReqVO) { + LocalDateTime now = LocalDateTime.now(); + TaskReportOperateEnum operate = TaskReportOperateEnum.valueOf(operateReqVO.getActive()); + // 提交 报工数量和报工工时 不能为空 + if(operate == TaskReportOperateEnum.SUBMIT){ + if(operateReqVO.getAmount() == null || operateReqVO.getWorkTime() == null){ + throw exception(TASK_REPORT_PARAMS_ERROR); + } + } + + TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectOne(new LambdaQueryWrapperX(){{ + eq(TaskDispatchDetailDO::getId, operateReqVO.getId()) + .ne(TaskDispatchDetailDO::getProcedureStatus, TaskDispatchProcedureStatusEnum.COMPLETED.getCode()) + .last("LIMIT 1 FOR UPDATE"); + }}); + if(taskDispatchDetailDO == null){ + throw exception(TASK_DISPATCH_TASK_NOT_EXISTS); + } + + // 查询最近没有提交的报工记录 + TaskReportDO lastReportDO = taskReportMapper.selectOne(new LambdaQueryWrapperX() {{ + eq(TaskReportDO::getDispatchDetailId, taskDispatchDetailDO.getId()) + .eq(TaskReportDO::getHasReport, YesOrNoEnum.N.getCode()) + .orderByDesc(TaskReportDO::getId) + .last("LIMIT 1 FOR UPDATE"); + }}); + + // 校验 + if(lastReportDO == null){ + // 如没有未提交的记录 + // 不能直接结束或提交 + if(operate == TaskReportOperateEnum.END || operate == TaskReportOperateEnum.SUBMIT){ + throw exception(TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE); + } + lastReportDO = new TaskReportDO(); + }else{ + // 如有 + // 不能直接完成或开始 + if(operate == TaskReportOperateEnum.FINISH || operate == TaskReportOperateEnum.START){ + throw exception(TASK_DISPATCH_TASK_NO_PERMISSION_FOR_OPERATE); + } + + // 不能超额报工 + if(operate == TaskReportOperateEnum.SUBMIT){ + List historyReportList = taskReportMapper.selectList(new LambdaQueryWrapper() {{ + eq(TaskReportDO::getDispatchDetailId, taskDispatchDetailDO.getId()) + .ne(TaskReportDO::getAmount, 0); + }}); + int historyReportAmount = historyReportList.stream().mapToInt(TaskReportDO::getAmount).sum(); + if(taskDispatchDetailDO.getAmount() < (historyReportAmount + operateReqVO.getAmount())){ + throw exception(TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS); + } + } + } + + // 执行 + switch (operate){ + case START: + lastReportDO.setDispatchDetailId(taskDispatchDetailDO.getId()) + .setStartTime(now); + taskReportMapper.insert(lastReportDO); + break; + case END: + lastReportDO.setEndTime(now); + taskReportMapper.updateById(lastReportDO); + break; + case SUBMIT: + lastReportDO.setAmount(operateReqVO.getAmount()) + .setWorkTime(operateReqVO.getWorkTime()) + .setReportTime(now) + .setHasReport(YesOrNoEnum.Y.getCode()); + taskReportMapper.updateById(lastReportDO); + + // 生成虚拟入库单 + crossOrderManager.generateStockInOrder(taskDispatchDetailDO.getDispatchId(), now, lastReportDO.getAmount()); + break; + case FINISH: + taskDispatchDetailDO.setProcedureStatus(TaskDispatchProcedureStatusEnum.COMPLETED.getCode()); + taskDispatchDetailMapper.updateById(taskDispatchDetailDO); + break; + } + } + + private void createTaskDispatchDetailList(Long dispatchId, List list) { + list.forEach(o -> o.setDispatchId(dispatchId)); + // 分组更新与插入 + List updateList = list.stream().filter(o -> o.getId() != null).collect(Collectors.toList()); + List insertList = list.stream().filter(o -> o.getId() == null).collect(Collectors.toList()); + + if(!updateList.isEmpty()) taskDispatchDetailMapper.updateBatch(updateList); + if(!insertList.isEmpty()) taskDispatchDetailMapper.insertBatch(insertList); + } + + private void updateTaskDispatchDetailList(Long dispatchId, List list) { + createTaskDispatchDetailList(dispatchId, list); + } + + private void deleteTaskDispatchDetailByDispatchId(Long dispatchId) { + taskDispatchDetailMapper.deleteByDispatchId(dispatchId); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskreport/TaskReportService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskreport/TaskReportService.java new file mode 100644 index 00000000..3febeb94 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskreport/TaskReportService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.taskreport; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 任务报工 Service 接口 + * + * @author 管理员 + */ +public interface TaskReportService { + + /** + * 创建任务报工 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createTaskReport(@Valid TaskReportSaveReqVO createReqVO); + + /** + * 更新任务报工 + * + * @param updateReqVO 更新信息 + */ + void updateTaskReport(@Valid TaskReportSaveReqVO updateReqVO); + + /** + * 删除任务报工 + * + * @param id 编号 + */ + void deleteTaskReport(Long id); + + /** + * 获得任务报工 + * + * @param id 编号 + * @return 任务报工 + */ + TaskReportDO getTaskReport(Long id); + + /** + * 获得任务报工分页 + * + * @param pageReqVO 分页查询 + * @return 任务报工分页 + */ + PageResult getTaskReportPage(TaskReportPageReqVO pageReqVO); + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskreport/TaskReportServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskreport/TaskReportServiceImpl.java new file mode 100644 index 00000000..8c4ba6b2 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/taskreport/TaskReportServiceImpl.java @@ -0,0 +1,74 @@ +package com.chanko.yunxi.mes.module.heli.service.taskreport; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport.TaskReportMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 任务报工 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class TaskReportServiceImpl implements TaskReportService { + + @Resource + private TaskReportMapper taskReportMapper; + + @Override + public Long createTaskReport(TaskReportSaveReqVO createReqVO) { + // 插入 + TaskReportDO taskReport = BeanUtils.toBean(createReqVO, TaskReportDO.class); + taskReportMapper.insert(taskReport); + // 返回 + return taskReport.getId(); + } + + @Override + public void updateTaskReport(TaskReportSaveReqVO updateReqVO) { + // 校验存在 + validateTaskReportExists(updateReqVO.getId()); + // 更新 + TaskReportDO updateObj = BeanUtils.toBean(updateReqVO, TaskReportDO.class); + taskReportMapper.updateById(updateObj); + } + + @Override + public void deleteTaskReport(Long id) { + // 校验存在 + validateTaskReportExists(id); + // 删除 + taskReportMapper.deleteById(id); + } + + private void validateTaskReportExists(Long id) { + if (taskReportMapper.selectById(id) == null) { + throw exception(TASK_REPORT_NOT_EXISTS); + } + } + + @Override + public TaskReportDO getTaskReport(Long id) { + return taskReportMapper.selectById(id); + } + + @Override + public PageResult getTaskReportPage(TaskReportPageReqVO pageReqVO) { + return taskReportMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/unqualifiednotification/UnqualifiedNotificationService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/unqualifiednotification/UnqualifiedNotificationService.java new file mode 100644 index 00000000..4d106443 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/unqualifiednotification/UnqualifiedNotificationService.java @@ -0,0 +1,58 @@ +package com.chanko.yunxi.mes.module.heli.service.unqualifiednotification; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 品质异常通知单审核 Service 接口 + * + * @author 管理员 + */ +public interface UnqualifiedNotificationService { + + /** + * 创建品质异常通知单审核 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createUnqualifiedNotification(@Valid UnqualifiedNotificationSaveReqVO createReqVO); + + /** + * 更新品质异常通知单审核 + * + * @param updateReqVO 更新信息 + */ + void updateUnqualifiedNotification(@Valid UnqualifiedNotificationSaveReqVO updateReqVO); + + /** + * 删除品质异常通知单审核 + * + * @param id 编号 + */ + void deleteUnqualifiedNotification(Long id); + + /** + * 获得品质异常通知单审核 + * + * @param id 编号 + * @return 品质异常通知单审核 + */ + UnqualifiedNotificationDO getUnqualifiedNotification(Long id); + + /** + * 获得品质异常通知单审核分页 + * + * @param pageReqVO 分页查询 + * @return 品质异常通知单审核分页 + */ + PageResult getUnqualifiedNotificationPage(UnqualifiedNotificationPageReqVO pageReqVO); + + void operate(UnqualifiedNotificationSaveReqVO operateReqVO); + + PageResult getUnqualifiedNotificationStatisticPage(UnqualifiedNotificationPageReqVO pageReqVO); +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/unqualifiednotification/UnqualifiedNotificationServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/unqualifiednotification/UnqualifiedNotificationServiceImpl.java new file mode 100644 index 00000000..9019d498 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/unqualifiednotification/UnqualifiedNotificationServiceImpl.java @@ -0,0 +1,119 @@ +package com.chanko.yunxi.mes.module.heli.service.unqualifiednotification; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum; +import com.chanko.yunxi.mes.framework.security.core.util.SecurityFrameworkUtils; +import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.unqualifiednotification.vo.UnqualifiedNotificationSaveReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.unqualifiednotification.UnqualifiedNotificationDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.unqualifiednotification.UnqualifiedNotificationMapper; +import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum; +import com.chanko.yunxi.mes.module.heli.enums.CodeEnum; +import com.chanko.yunxi.mes.module.heli.enums.UnqualifiedNotificationStatusEnum; +import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.Date; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.INVALID_OPERATE; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.UNQUALIFIED_NOTIFICATION_NOT_EXISTS; + +/** + * 品质异常通知单审核 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class UnqualifiedNotificationServiceImpl implements UnqualifiedNotificationService { + + @Resource + private UnqualifiedNotificationMapper unqualifiedNotificationMapper; + @Resource + private SerialNumberService serialNumberService; + + @Override + @Transactional(rollbackFor = Exception.class) + public Long createUnqualifiedNotification(UnqualifiedNotificationSaveReqVO createReqVO) { + // 插入 + UnqualifiedNotificationDO unqualifiedNotification = BeanUtils.toBean(createReqVO, UnqualifiedNotificationDO.class); + SerialNumberDO serialNumberDO = serialNumberService.getSerialNumber(BusinesTypeEnum.UNQUALIFIED_NOTIFICATION.name(), new SimpleDateFormat("yyyyMMdd").format(new Date())); + serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1); + unqualifiedNotification.setCode(CodeEnum.UNQUALIFIED_NOTIFICATION.getCode(serialNumberDO.getSerialNumber().toString())); + unqualifiedNotification.setNotificationStatus(UnqualifiedNotificationStatusEnum.valueOf(createReqVO.getActive()).getCode()); + + unqualifiedNotificationMapper.insert(unqualifiedNotification); + + // 回写序列记录 + serialNumberService.updateSerialNumber(serialNumberDO); + // 返回 + return unqualifiedNotification.getId(); + } + + @Override + public void updateUnqualifiedNotification(UnqualifiedNotificationSaveReqVO updateReqVO) { + // 校验存在 + validateUnqualifiedNotificationExists(updateReqVO.getId()); + // 更新 + UnqualifiedNotificationDO updateObj = BeanUtils.toBean(updateReqVO, UnqualifiedNotificationDO.class); + + OperateTypeEnum operateTypeEnum = OperateTypeEnum.valueOf(updateReqVO.getActive()); + if(!updateObj.canOperate(operateTypeEnum)){ + throw exception(INVALID_OPERATE); + } + + if(operateTypeEnum == OperateTypeEnum.AUDIT){ + updateObj.setAuditor(SecurityFrameworkUtils.getLoginUserId()).setAuditTime(LocalDateTime.now()); + } + + updateObj.setNotificationStatus(UnqualifiedNotificationStatusEnum.valueOf(updateReqVO.getActive()).getCode()); + unqualifiedNotificationMapper.updateById(updateObj); + } + + @Override + public void deleteUnqualifiedNotification(Long id) { + // 校验存在 + validateUnqualifiedNotificationExists(id); + // 删除 + unqualifiedNotificationMapper.deleteById(id); + } + + private void validateUnqualifiedNotificationExists(Long id) { + if (unqualifiedNotificationMapper.selectById(id) == null) { + throw exception(UNQUALIFIED_NOTIFICATION_NOT_EXISTS); + } + } + + @Override + public UnqualifiedNotificationDO getUnqualifiedNotification(Long id) { + return unqualifiedNotificationMapper.selectById(id); + } + + @Override + public PageResult getUnqualifiedNotificationPage(UnqualifiedNotificationPageReqVO pageReqVO) { + return unqualifiedNotificationMapper.selectPage(pageReqVO); + } + + @Override + public void operate(UnqualifiedNotificationSaveReqVO operateReqVO) { + if(operateReqVO.getId() == null){ + createUnqualifiedNotification(operateReqVO); + }else{ + updateUnqualifiedNotification(operateReqVO); + } + } + + @Override + public PageResult getUnqualifiedNotificationStatisticPage(UnqualifiedNotificationPageReqVO pageReqVO) { + return unqualifiedNotificationMapper.getStatisticPage(pageReqVO); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/equipmanufacture/EquipManufactureMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/equipmanufacture/EquipManufactureMapper.xml new file mode 100644 index 00000000..3d928356 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/equipmanufacture/EquipManufactureMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/invoice/InvoiceMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/invoice/InvoiceMapper.xml new file mode 100644 index 00000000..e4232ec4 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/invoice/InvoiceMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/materialplanboom/BoomDetailRespVOMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/materialplanboom/BoomDetailRespVOMapper.xml new file mode 100644 index 00000000..759dbad5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/materialplanboom/BoomDetailRespVOMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/materialplanboom/MaterialPlanBoomMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/materialplanboom/MaterialPlanBoomMapper.xml new file mode 100644 index 00000000..6082617f --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/materialplanboom/MaterialPlanBoomMapper.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plantask/PlanTaskMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plantask/PlanTaskMapper.xml new file mode 100644 index 00000000..1db52d84 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plantask/PlanTaskMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plantaskbom/PlanTaskBomMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plantaskbom/PlanTaskBomMapper.xml new file mode 100644 index 00000000..9feadac8 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/plantaskbom/PlanTaskBomMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/purchaseorderboom/PurchaseOrderBoomMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/purchaseorderboom/PurchaseOrderBoomMapper.xml new file mode 100644 index 00000000..2d44a1c9 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/purchaseorderboom/PurchaseOrderBoomMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/qualityfeedback/QualityFeedbackMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/qualityfeedback/QualityFeedbackMapper.xml new file mode 100644 index 00000000..2eeaf3b6 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/qualityfeedback/QualityFeedbackMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagelog/StorageLogNowMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagelog/StorageLogNowMapper.xml index f0a73ad1..e0a3fb85 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagelog/StorageLogNowMapper.xml +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagelog/StorageLogNowMapper.xml @@ -10,22 +10,21 @@ --> - - - - - + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/taskreport/TaskReportMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/taskreport/TaskReportMapper.xml new file mode 100644 index 00000000..9282f10c --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/taskreport/TaskReportMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/unqualifiednotification/UnqualifiedNotificationMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/unqualifiednotification/UnqualifiedNotificationMapper.xml new file mode 100644 index 00000000..d244f16e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/unqualifiednotification/UnqualifiedNotificationMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/controller/admin/file/vo/file/FilePageReqVO.java b/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/controller/admin/file/vo/file/FilePageReqVO.java index 6935eb7f..77d1c921 100644 --- a/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/controller/admin/file/vo/file/FilePageReqVO.java +++ b/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/controller/admin/file/vo/file/FilePageReqVO.java @@ -23,6 +23,9 @@ public class FilePageReqVO extends PageParam { @Schema(description = "业务类型 用于业务关联", example = "1") private String businessType; + @Schema(description = "业务文件类型", example = "1") + private String businessFileType; + @Schema(description = "业务id", example = "18052") private Long businessId; diff --git a/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/dal/mysql/file/FileMapper.java b/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/dal/mysql/file/FileMapper.java index 8df37ab2..f2c3ddda 100644 --- a/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/dal/mysql/file/FileMapper.java +++ b/mes-module-infra/mes-module-infra-biz/src/main/java/com/chanko/yunxi/mes/module/infra/dal/mysql/file/FileMapper.java @@ -19,6 +19,7 @@ public interface FileMapper extends BaseMapperX { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(FileDO::getConfigId, reqVO.getConfigId()) .eqIfPresent(FileDO::getBusinessType, reqVO.getBusinessType()) + .eqIfPresent(FileDO::getBusinessFileType, reqVO.getBusinessFileType()) .eqIfPresent(FileDO::getBusinessId, reqVO.getBusinessId()) .likeIfPresent(FileDO::getName, reqVO.getName()) .eqIfPresent(FileDO::getPath, reqVO.getPath()) diff --git a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/dict/DictDataController.java b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/dict/DictDataController.java index 8639ebf0..d5afb8cf 100644 --- a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/dict/DictDataController.java +++ b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/dict/DictDataController.java @@ -66,9 +66,9 @@ public class DictDataController { @GetMapping(value = {"/list-all-simple", "simple-list"}) @Operation(summary = "获得全部字典数据列表", description = "一般用于管理后台缓存字典数据在本地") // 无需添加权限认证,因为前端全局都需要 - public CommonResult> getSimpleDictDataList() { + public CommonResult> getSimpleDictDataList(@RequestParam(value = "dictTypeList", required = false) List dictTypeList) { List list = dictDataService.getDictDataList( - CommonStatusEnum.ENABLE.getStatus(), null); + CommonStatusEnum.ENABLE.getStatus(), dictTypeList); return success(BeanUtils.toBean(list, DictDataSimpleRespVO.class)); } diff --git a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java index 0f3516ff..76c95680 100644 --- a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java +++ b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/controller/admin/permission/vo/role/RoleSaveReqVO.java @@ -1,5 +1,7 @@ package com.chanko.yunxi.mes.module.system.controller.admin.permission.vo.role; +import com.chanko.yunxi.mes.framework.common.enums.CommonStatusEnum; +import com.chanko.yunxi.mes.framework.common.validation.InEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -31,4 +33,9 @@ public class RoleSaveReqVO { @Schema(description = "备注", example = "我是一个角色") private String remark; + @Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态不能为空") + @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") + private Integer status; + } diff --git a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/dataobject/dept/DeptDO.java b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/dataobject/dept/DeptDO.java index 7b158d56..00ac7825 100644 --- a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/dataobject/dept/DeptDO.java +++ b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/dataobject/dept/DeptDO.java @@ -1,11 +1,9 @@ package com.chanko.yunxi.mes.module.system.dal.dataobject.dept; +import com.baomidou.mybatisplus.annotation.*; import com.chanko.yunxi.mes.framework.common.enums.CommonStatusEnum; import com.chanko.yunxi.mes.framework.tenant.core.db.TenantBaseDO; import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; @@ -47,6 +45,7 @@ public class DeptDO extends TenantBaseDO { * * 关联 {@link AdminUserDO#getId()} */ + @TableField(fill = FieldFill.UPDATE) private Long leaderUserId; /** * 联系电话 diff --git a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/mysql/dict/DictDataMapper.java b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/mysql/dict/DictDataMapper.java index f3407c40..beb2847b 100644 --- a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/mysql/dict/DictDataMapper.java +++ b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/dal/mysql/dict/DictDataMapper.java @@ -46,4 +46,10 @@ public interface DictDataMapper extends BaseMapperX { .eqIfPresent(DictDataDO::getDictType, dictType)); } + default List selectListByStatusAndDictType(Integer status, List dictTypeList) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(DictDataDO::getStatus, status) + .inIfPresent(DictDataDO::getDictType, dictTypeList)); + } + } diff --git a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataService.java b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataService.java index f647ce6d..ebdcf0cf 100644 --- a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataService.java +++ b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataService.java @@ -99,4 +99,5 @@ public interface DictDataService { */ DictDataDO parseDictData(String dictType, String label); + List getDictDataList(Integer status, List dictTypeList); } diff --git a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataServiceImpl.java b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataServiceImpl.java index ec663c5d..12407868 100644 --- a/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataServiceImpl.java +++ b/mes-module-system/mes-module-system-biz/src/main/java/com/chanko/yunxi/mes/module/system/service/dict/DictDataServiceImpl.java @@ -169,4 +169,11 @@ public class DictDataServiceImpl implements DictDataService { return dictDataMapper.selectByDictTypeAndLabel(dictType, label); } + @Override + public List getDictDataList(Integer status, List dictTypeList) { + List list = dictDataMapper.selectListByStatusAndDictType(status, dictTypeList); + list.sort(COMPARATOR_TYPE_AND_SORT); + return list; + } + } diff --git a/mes-server/src/main/resources/application.yaml b/mes-server/src/main/resources/application.yaml index 0cf712da..e1b15b7a 100644 --- a/mes-server/src/main/resources/application.yaml +++ b/mes-server/src/main/resources/application.yaml @@ -175,12 +175,9 @@ mes: front-type: 10 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类 error-code: # 错误码相关配置项 constants-class-list: - - com.chanko.yunxi.mes.module.bpm.enums.ErrorCodeConstants - com.chanko.yunxi.mes.module.infra.enums.ErrorCodeConstants - - com.chanko.yunxi.mes.module.member.enums.ErrorCodeConstants - - com.chanko.yunxi.mes.module.pay.enums.ErrorCodeConstants - com.chanko.yunxi.mes.module.system.enums.ErrorCodeConstants - - com.chanko.yunxi.mes.module.mp.enums.ErrorCodeConstants + - com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants tenant: # 多租户相关配置项 enable: true ignore-urls: diff --git a/mes-ui/mes-echarts/src/views/btmcenter.vue b/mes-ui/mes-echarts/src/views/btmcenter.vue index 4081450c..75f8ed87 100644 --- a/mes-ui/mes-echarts/src/views/btmcenter.vue +++ b/mes-ui/mes-echarts/src/views/btmcenter.vue @@ -34,7 +34,7 @@ export default { }, }; var robt2Chart = echarts.init(document.getElementById("btmcenter")); - let dataX = ["Y2019", "Y2020", "Y2021", "Y2022", "Y2023"]; + let dataX = [ "Y2020", "Y2021", "Y2022", "Y2023","Y2024"]; // dataX对应的数据 // let dataA = [44, 55, 66, 46, 67, 69, 55, 66, 46, 67]; // let dataB = [44, 55, 66, 46, 67, 69, 55, 66, 46, 67]; @@ -163,7 +163,7 @@ export default { emphasis: { focus: "series", }, - data: [88, 95, 102, 102, 93], + data: [95, 102, 102, 108,19], label: { show: true, // 开启显示 align: "center", @@ -186,7 +186,7 @@ export default { emphasis: { focus: "series", }, - data: [110, 117, 130, 155, 145], + data: [ 117, 130, 155, 161,24], label: { show: true, // 开启显示 align: "center", @@ -226,7 +226,7 @@ export default { fontSize: 12, }, formatter: (obj) => { - const datal = [198, 212, 232, 257, 238]; + const datal = [ 212, 232, 257, 269,43]; return datal[obj.dataIndex]; }, }, diff --git a/mes-ui/mes-echarts/src/views/btmleft.vue b/mes-ui/mes-echarts/src/views/btmleft.vue index 2f16f9f3..f178e0fd 100644 --- a/mes-ui/mes-echarts/src/views/btmleft.vue +++ b/mes-ui/mes-echarts/src/views/btmleft.vue @@ -50,51 +50,10 @@ export default { const labelOption2 = { show: true, formatter: (obj) => { - let data1 = [ - 100, 90, 90, 85, 85, 85, 85, 80, 80, 30, 60, 60, 50, 40, 30, 10, 10, - 5, - ]; - let data2 = [ - , - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 20, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 5, - ]; - let data3 = [ - , - , - , - 5, - 5, - 5, - 5, - 10, - 10, - 20, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 5, - ]; - let data4 = [, , , , , , , , , 30, 10, 10, 10, 10, 10, 10, 10, 10]; + let data1 = [10, 30, 10, 5, 5, 10]; + let data2 = [10, 10, 30, 10, 10, 10]; + let data3 = [10, 10, 40, 10, 10, 10]; + let data4 = [20, 10, 15, 10, 10, 20]; let arrC = 0; let dataA = data1[obj.dataIndex]; let dataB = data2[obj.dataIndex]; @@ -169,51 +128,18 @@ export default { document.getElementById("progressChart") ); let dataX = [ - "WP15NG", - "斯堪尼亚支架", - "HXE195636/5657", - "DN400", - "0871机壳", - "GT GG JJ", - "一汽 M50", - "EP040 6#模", - "1GRR", - "康明斯RUBYA发动机缸盖", - "增压器等", - "L1缸盖", - "CAMC-9L缸盖", - "F4J20", - "福特8缸缸体 第二套", - "康明斯RUBY缸体", - "康明斯RUBYA发动机缸体", - "福特8缸缸体 第三套", + "DDZZ-自动化夹具", + "BX-VM项目", + "CQHQ-BAIC缸盖低压模具", + "CA-HE15-AA缸盖", + "CA-HE15-TG-AA缸盖", + "SDWC-226B缸盖", ]; // dataX对应的数据 - let data1 = [ - 100, 90, 90, 85, 85, 85, 85, 80, 80, 30, 60, 60, 50, 40, 30, 10, 10, 5, - ]; - let data2 = [ - , - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 20, - 10, - 10, - 10, - 10, - 10, - 10, - 10, - 5, - ]; - let data3 = [, , , 5, 5, 5, 5, 10, 10, 20, 10, 10, 10, 10, 10, 10, 10, 5]; - let data4 = [, , , , , , , , , 30, 10, 10, 10, 10, 10, 10, 10, 10]; + let data1 = [10, 30, 10, 5, 5, 10]; + let data2 = [10, 10, 30, 10, 10, 10]; + let data3 = [10, 10, 40, 10, 10, 10]; + let data4 = [20, 10, 15, 10, 10, 20]; const option = { dataZoom: [ { @@ -283,7 +209,7 @@ export default { }, series: [ { - name: "11月第4周", + name: "3月第1周", type: "bar", stack: "total", label: labelOption2, @@ -291,21 +217,21 @@ export default { data: data1, }, { - name: "12月第1周", + name: "3月第2周", type: "bar", stack: "total", label: labelOption2, data: data2, }, { - name: "12月第2周", + name: "3月第3周", type: "bar", stack: "total", label: labelOption2, data: data3, }, { - name: "12月第3周", + name: "3月第4周", type: "bar", stack: "total", label: labelOption2, diff --git a/mes-ui/mes-echarts/src/views/leftbottom.vue b/mes-ui/mes-echarts/src/views/leftbottom.vue index 6660eca6..257528bf 100644 --- a/mes-ui/mes-echarts/src/views/leftbottom.vue +++ b/mes-ui/mes-echarts/src/views/leftbottom.vue @@ -27,22 +27,18 @@ export default { }; var myChart = echarts.init(document.getElementById("leftbottommain")); let dataX = [ - "RUBY216挺杆", - "FM30副车架", - "C02副车架", - "EP040 6#模 壳体", - "YXK 9L缸盖", - "SDHF Z14壳体", - "LYGC 转向节2404101", - "BX 福特8缸 P模", - "WC L1缸盖", - "FT 凸轮轴", - "DFZZ ruby 缸体", + "SDHF-Z14低压模具", + "CADP-控制臂修模", + "CQHQ-BAIC缸盖低压", + "CA-HE15-TG缸盖", + "CA-HE15-AA缸盖", + "GZHN-芯盒", + "DFZz 自动化夹具", "MXG 福特NANO V6缸体", "BX VM MOTORI缸体", ]; // dataX对应的数据 - let data = [90, 50, 70, 40, 60, 20, 40, 60, 80, 20, 90, 10, 15]; + let data = [95, 100, 90, 60, 60, 30, 10, 65, 80]; var option = { dataZoom: [ diff --git a/mes-ui/mes-echarts/src/views/mainrigth.vue b/mes-ui/mes-echarts/src/views/mainrigth.vue index 462ea144..9d8c88f0 100644 --- a/mes-ui/mes-echarts/src/views/mainrigth.vue +++ b/mes-ui/mes-echarts/src/views/mainrigth.vue @@ -39,20 +39,20 @@ export default { [ "1#机", "BX RUBY -- B0B1底框侧铣,YIZZ--EP040侧模侧铣", - "2023/12/1-12/3", + "2024/1/28-2/3", ], - ["2#机", "AGYT DN400-- 上下模框、吹气板开粗", "2023/12/1-12/3"], - ["3#机", "YQZZ--EP040壳体镶块精加工", "2023/12/1-12/4"], - ["4#机", "BX RUBY -- B0B1顶板精加工", "2023/12/2-12/3"], + ["2#机", "AGYT DN400-- 上下模框、吹气板开粗", "2024/1/29-2/4"], + ["3#机", "YQZZ--EP040壳体镶块精加工", "2024/1/29-2/3"], + ["4#机", "BX RUBY -- B0B1顶板精加工", "2024/1/29-2/3"], ["5#机", "设备保养中", "--"], - ["6#机", "BX--福特八缸05/06X芯盒顶板", "2023/12/2-12/3"], + ["6#机", "BX--福特八缸05/06X芯盒顶板", "2024/1/29-2/4"], ["7#机", "设备保养中", "--"], - ["8#机", "DFZZ-康明斯RUBY主体芯模框精加工", "2023/12/2-12/4"], - ["9#机", "YQZZ--EP040 6#模上模板精加工", "2023/12/2-12/3"], - ["10#机", "WC--L1缸盖冒口芯上模块精加工", "2023/12/1-12/4"], - ["11#机", "WC--L1缸盖进排气定模块精加工", "2023/12/1-12/4"], - ["12#机", "WC--L1缸盖冒口芯下模块精加工", "2023/12/1-12/4"], - ["13#机", "SXCY--透气箱上模样精加工", "2023/12/2-12/3"], + ["8#机", "DFZZ-康明斯RUBY主体芯模框精加工", "2024/1/28-2/3"], + ["9#机", "YQZZ--EP040 6#模上模板精加工", "2024/1/28-2/3"], + ["10#机", "WC--L1缸盖冒口芯上模块精加工", "2024/1/28-2/5"], + ["11#机", "WC--L1缸盖进排气定模块精加工", "2024/1/28-2/3"], + ["12#机", "WC--L1缸盖冒口芯下模块精加工", "2024/1/28-2/3"], + ["13#机", "SXCY--透气箱上模样精加工", "2024/1/29-2/4"], ], rowNum: 5, // 表格行数 headerHeight: 50, @@ -65,20 +65,20 @@ export default { align: ["left", "left", "center", "center", "center", "left"], }, configs: { - header: ["项目名称", "负责人", "进度", "交付时间"], + header: ["模具名称", "负责人", "进度", "交付时间"], data: [ - ["JCGK-支架", "B组", "100%", "2023/12/2"], - ["DYDJ-0871机壳", "B组", "90%", "2023/12/6"], - ["YPJX-5636/5657", "B组", "80%", "2023/12/4"], - ["DFQC-前壳体", "A组", "80%", "2023/12/9"], - ["BX-ruby缸体", "B组", "50%", "2023/12/16"], - ["YXK-M50芯盒", "A组", "20%", "2023/12/14"], - ["YQ-EP040 6#模", "A组", "20%", "2023/12/15"], - ["YXK-GTGG", "A组", "20%", "2023/12/15"], - ["XC-磨削胎具", "B组", "10%", "2023/12/9"], - ["AGYT-DN400芯盒", "B组", "10%", "2023/12/9"], - ["DFZZ-ruby缸体 /缸盖", "A组", "10%", "2024/1/20"], - ["BX-福特8缸缸体", "B组", "10%", "2024/1/20"], + ["JCGK-支架", "B组", "100%", "2024/2/21"], + ["DYDJ-0871机壳", "B组", "90%", "2024/1/26"], + ["YPJX-5636/5657", "B组", "80%", "2024/2/4"], + ["DFQC-前壳体", "A组", "80%", "2024/2/29"], + ["BX-ruby缸体", "B组", "50%", "2024/1/16"], + ["YXK-M50芯盒", "A组", "20%", "2024/1/14"], + ["YQ-EP040 6#模", "A组", "20%", "2024/1/15"], + ["YXK-GTGG", "A组", "20%", "2024/2/22"], + ["XC-磨削胎具", "B组", "10%", "2024/1/9"], + ["AGYT-DN400芯盒", "B组", "10%", "2024/1/27"], + ["DFZZ-ruby缸体 /缸盖", "A组", "10%", "2024/1/25"], + ["BX-福特8缸缸体", "B组", "10%", "2024/2/29"], ], rowNum: 5, // 表格行数 headerHeight: 50, diff --git a/mes-ui/mes-echarts/src/views/rightbot2.vue b/mes-ui/mes-echarts/src/views/rightbot2.vue index 558f09a1..6af3ecc3 100644 --- a/mes-ui/mes-echarts/src/views/rightbot2.vue +++ b/mes-ui/mes-echarts/src/views/rightbot2.vue @@ -4,7 +4,7 @@
- 月度开发模具数量 + 2024年度开发模具数量
@@ -42,12 +42,7 @@ export default { "3月", "4月", "5月", - "6月", - "7月", - "8月", - "9月", - "10月", - "11月", + ]; // dataX对应的数据 // let dataA = [44, 55, 66, 46, 67, 69, 55, 66, 46, 67]; @@ -174,7 +169,7 @@ export default { emphasis: { focus: "series", }, - data: [12, 8, 14, 13, 14, 15, 18, 10, 15, 12, 14], + data: [12, 7, 0,0,0], label: { show: true, // 开启显示 align: "center", @@ -197,7 +192,7 @@ export default { emphasis: { focus: "series", }, - data: [7, 8, 6, 12, 5, 11, 7, 9, 11, 8, 9], + data: [17, 5], label: { show: true, // 开启显示 align: "center", @@ -237,7 +232,7 @@ export default { fontSize: 12, }, formatter: (obj) => { - const datal = [19, 16, 20, 25, 19, 26, 25, 19, 26, 20, 23]; + const datal = [29, 12]; // console.log(obj); return datal[obj.dataIndex]; }, diff --git a/mes-ui/mes-ui-admin-vue3/.env.pro b/mes-ui/mes-ui-admin-vue3/.env.pro index 06df38b2..e22777d9 100644 --- a/mes-ui/mes-ui-admin-vue3/.env.pro +++ b/mes-ui/mes-ui-admin-vue3/.env.pro @@ -4,13 +4,13 @@ NODE_ENV=production VITE_DEV=false # 请求路径 -VITE_BASE_URL='http://localhost:8080' +VITE_BASE_URL='http://192.168.1.224:8080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:8080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://192.168.1.224:8080/admin-api/infra/file/upload' # 上传路径 -VITE_UPLOAD_BATCH_URL='http://localhost:8080/admin-api/infra/file/uploadBatch' +VITE_UPLOAD_BATCH_URL='http://192.168.1.224:8080/admin-api/infra/file/uploadBatch' # 接口前缀 VITE_API_BASEPATH= diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/customer/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/customer/index.ts index cdee2490..d1bba66b 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/customer/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/customer/index.ts @@ -5,6 +5,7 @@ export interface CustomerVO { code: string brief: string name: string + fullName:string briefOrName:string industry: string level: number diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/equipmanufacture/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/equipmanufacture/index.ts new file mode 100644 index 00000000..e090c04a --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/equipmanufacture/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +export interface EquipManufactureVO { + id: number + code: string + name: string + type: string + model: string + status: number + codeOrName: string +} + +// 查询制造设备分页 +export const getEquipManufacturePage = async (params) => { + return await request.get({ url: `/heli/equip-manufacture/page`, params }) +} + +// 查询制造设备详情 +export const getEquipManufacture = async (id: number) => { + return await request.get({ url: `/heli/equip-manufacture/get?id=` + id }) +} + +// 新增制造设备 +export const createEquipManufacture = async (data: EquipManufactureVO) => { + return await request.post({ url: `/heli/equip-manufacture/create`, data }) +} + +// 修改制造设备 +export const updateEquipManufacture = async (data: EquipManufactureVO) => { + return await request.put({ url: `/heli/equip-manufacture/update`, data }) +} + +// 删除制造设备 +export const deleteEquipManufacture = async (id: number) => { + return await request.delete({ url: `/heli/equip-manufacture/delete?id=` + id }) +} + +// 导出制造设备 Excel +export const exportEquipManufacture = async (params) => { + return await request.download({ url: `/heli/equip-manufacture/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/inspectionreport/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/inspectionreport/index.ts new file mode 100644 index 00000000..319c2bf7 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/inspectionreport/index.ts @@ -0,0 +1,19 @@ +import request from '@/config/axios' + +export interface InspectionReportVO { + id: number + projectId: number + projectSubId: number + status: number +} + +// 查询检验报告分页 +export const getInspectionReportPage = async (params) => { + return await request.get({ url: `/heli/quality-management/inspection-report/page`, params }) +} + +// 查询检验报告详情 +export const getInspectionReport = async (id: number) => { + return await request.get({ url: `/heli/quality-management/inspection-report/get?id=` + id }) +} + diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/invoice/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/invoice/index.ts new file mode 100644 index 00000000..526300ff --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/invoice/index.ts @@ -0,0 +1,52 @@ +import request from '@/config/axios' + +export interface InvoiceVO { + id: number + businessType: string + orderId: number + number: string + type: string + billingDate: Date + amount: number + rate: number + remark: string + submitter: number + submitTime: Date + canceller: number + cancelTime: Date + status: number +} + +// 查询财务发票分页 +export const getInvoicePage = async (params) => { + return await request.get({ url: `/heli/invoice/page`, params }) +} + +// 查询财务发票详情 +export const getInvoice = async (id: number, businessType: String) => { + return await request.get({ url: `/heli/invoice/get?id=` + id + `&businessType=` + businessType }) +} + +// 新增财务发票 +export const createInvoice = async (data: InvoiceVO) => { + return await request.post({ url: `/heli/invoice/create`, data }) +} + +// 修改财务发票 +export const updateInvoice = async (data: InvoiceVO) => { + return await request.put({ url: `/heli/invoice/update`, data }) +} + +// 删除财务发票 +export const deleteInvoice = async (id: number) => { + return await request.delete({ url: `/heli/invoice/delete?id=` + id }) +} + +// 导出财务发票 Excel +export const exportInvoice = async (params) => { + return await request.download({ url: `/heli/invoice/export-excel`, params }) +} + +export async function operateInvoice(data: InvoiceVO) { + return await request.post({ url: `/heli/invoice/operate`, data }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplanboom/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplanboom/index.ts new file mode 100644 index 00000000..16323787 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplanboom/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface MaterialPlanBoomVO { + id: number + projectMaterialPlanId: number + boomDetailId: number + projectSubId: number + boomAmount: number + boomArriveDate: Date + description: string +} + +// 查询物料需求计划加工件明细详情 +export const getBoomDetailList = async (params) => { + return await request.get({ url: `/heli/material-plan-boom/boom`,params }) +} + +// 查询物料需求计划加工件明细分页 +export const getMaterialPlanBoomSumPage = async (params) => { + return await request.get({ url: `/heli/material-plan-boom/page-sum`, params }) +} +// 查询物料需求计划加工件明细分页 +export const getMaterialPlanBoomPage = async (params) => { + return await request.get({ url: `/heli/material-plan-boom/page`, params }) +} + +// 查询物料需求计划加工件明细详情 +export const getMaterialPlanBoom = async (id: number) => { + return await request.get({ url: `/heli/material-plan-boom/get?id=` + id }) +} + +// 新增物料需求计划加工件明细 +export const createMaterialPlanBoom = async (data: MaterialPlanBoomVO) => { + return await request.post({ url: `/heli/material-plan-boom/create`, data }) +} + +// 修改物料需求计划加工件明细 +export const updateMaterialPlanBoom = async (data: MaterialPlanBoomVO) => { + return await request.put({ url: `/heli/material-plan-boom/update`, data }) +} + +// 删除物料需求计划加工件明细 +export const deleteMaterialPlanBoom = async (id: number) => { + return await request.delete({ url: `/heli/material-plan-boom/delete?id=` + id }) +} + +// 导出物料需求计划加工件明细 Excel +export const exportMaterialPlanBoom = async (params) => { + return await request.download({ url: `/heli/material-plan-boom/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplandetail/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplandetail/index.ts index 63680ab3..0b8d23af 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplandetail/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplandetail/index.ts @@ -1,41 +1,46 @@ -import request from '@/config/axios' - -export interface MaterialPlanDetailVO { - id: number - projectMaterialPlanId: number - materialId: number - projectSubId: number - requireAmount: number - requireArriveTime: Date - description: string -} - -// 查询物料需求计划物料详情分页 -export const getMaterialPlanDetailPage = async (params) => { - return await request.get({ url: `/heli/material-plan-detail/page`, params }) -} - -// 查询物料需求计划物料详情详情 -export const getMaterialPlanDetail = async (id: number) => { - return await request.get({ url: `/heli/material-plan-detail/get?id=` + id }) -} - -// 新增物料需求计划物料详情 -export const createMaterialPlanDetail = async (data: MaterialPlanDetailVO) => { - return await request.post({ url: `/heli/material-plan-detail/create`, data }) -} - -// 修改物料需求计划物料详情 -export const updateMaterialPlanDetail = async (data: MaterialPlanDetailVO) => { - return await request.put({ url: `/heli/material-plan-detail/update`, data }) -} - -// 删除物料需求计划物料详情 -export const deleteMaterialPlanDetail = async (id: number) => { - return await request.delete({ url: `/heli/material-plan-detail/delete?id=` + id }) -} - -// 导出物料需求计划物料详情 Excel -export const exportMaterialPlanDetail = async (params) => { - return await request.download({ url: `/heli/material-plan-detail/export-excel`, params }) -} \ No newline at end of file +import request from '@/config/axios' + +export interface MaterialPlanDetailVO { + id: number + projectMaterialPlanId: number + materialId: number + projectSubId: number + requireAmount: number + requireArriveTime: Date + description: string +} + +// 查询物料需求计划物料详情分页 +export const getMaterialPlanDetailSumPage = async (params) => { + return await request.get({ url: `/heli/material-plan-detail/page-sum`, params }) +} + +// 查询物料需求计划物料详情分页 +export const getMaterialPlanDetailPage = async (params) => { + return await request.get({ url: `/heli/material-plan-detail/page`, params }) +} + +// 查询物料需求计划物料详情详情 +export const getMaterialPlanDetail = async (id: number) => { + return await request.get({ url: `/heli/material-plan-detail/get?id=` + id }) +} + +// 新增物料需求计划物料详情 +export const createMaterialPlanDetail = async (data: MaterialPlanDetailVO) => { + return await request.post({ url: `/heli/material-plan-detail/create`, data }) +} + +// 修改物料需求计划物料详情 +export const updateMaterialPlanDetail = async (data: MaterialPlanDetailVO) => { + return await request.put({ url: `/heli/material-plan-detail/update`, data }) +} + +// 删除物料需求计划物料详情 +export const deleteMaterialPlanDetail = async (id: number) => { + return await request.delete({ url: `/heli/material-plan-detail/delete?id=` + id }) +} + +// 导出物料需求计划物料详情 Excel +export const exportMaterialPlanDetail = async (params) => { + return await request.download({ url: `/heli/material-plan-detail/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/plantask/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/plantask/index.ts new file mode 100644 index 00000000..585a8473 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/plantask/index.ts @@ -0,0 +1,54 @@ +import request from '@/config/axios' + +export interface PlanTaskVO { + id: number + projectId: number + projectPlanId: number + projectPlanSubId: number + processBomId: number + taskNo: string + bomVersion: number + description: string + status: number + active:string +} + +// 刷新生产计划任务单最新数据 +export const refreshPlanTaskByPlanId = async (id: number) => { + return await request.get({ url: `/heli/plan-task/refresh?id=` + id }) +} + +// 获得bom需要更新的状态 +export const getPlanTaskBomStatus = async (id: number) => { + return await request.get({ url: `/heli/plan-task/get-version-status?id=` + id }) +} + +// 查询生产计划任务分页 +export const getPlanTaskPage = async (params) => { + return await request.get({ url: `/heli/plan-task/page`, params }) +} + +// 查询生产计划任务详情 +export const getPlanTask = async (id: number) => { + return await request.get({ url: `/heli/plan-task/get?id=` + id }) +} + +// 新增生产计划任务 +export const createPlanTask = async (data: PlanTaskVO) => { + return await request.post({ url: `/heli/plan-task/create`, data }) +} + +// 修改生产计划任务 +export const updatePlanTask = async (data: PlanTaskVO) => { + return await request.put({ url: `/heli/plan-task/update`, data }) +} + +// 删除生产计划任务 +export const deletePlanTask = async (id: number) => { + return await request.delete({ url: `/heli/plan-task/delete?id=` + id }) +} + +// 导出生产计划任务 Excel +export const exportPlanTask = async (params) => { + return await request.download({ url: `/heli/plan-task/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/plantaskbom/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/plantaskbom/index.ts new file mode 100644 index 00000000..5d01d483 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/plantaskbom/index.ts @@ -0,0 +1,39 @@ +import request from '@/config/axios' + +export interface PlanTaskBomVO { + id: number + taskId: number + bomDetailId: number + owner: string + endTime: Date +} + +// 查询生产计划任务Bom分页 +export const getPlanTaskBomPage = async (params) => { + return await request.get({ url: `/heli/plan-task-bom/page`, params }) +} + +// 查询生产计划任务Bom详情 +export const getPlanTaskBom = async (id: number) => { + return await request.get({ url: `/heli/plan-task-bom/get?id=` + id }) +} + +// 新增生产计划任务Bom +export const createPlanTaskBom = async (data: PlanTaskBomVO) => { + return await request.post({ url: `/heli/plan-task-bom/create`, data }) +} + +// 修改生产计划任务Bom +export const updatePlanTaskBom = async (data: PlanTaskBomVO) => { + return await request.put({ url: `/heli/plan-task-bom/update`, data }) +} + +// 删除生产计划任务Bom +export const deletePlanTaskBom = async (id: number) => { + return await request.delete({ url: `/heli/plan-task-bom/delete?id=` + id }) +} + +// 导出生产计划任务Bom Excel +export const exportPlanTaskBom = async (params) => { + return await request.download({ url: `/heli/plan-task-bom/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/processbom/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/processbom/index.ts index 298259a5..bc8a040a 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/processbom/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/processbom/index.ts @@ -53,6 +53,10 @@ export const getProcessBomDetailListByBomId = async (bomId) => { return await request.get({ url: `/heli/process-bom/process-bom-detail/list-by-bom-id?bomId=` + bomId }) } +export const deleteProcessBomDetail = async (id: number) => { + return await request.delete({ url: `/heli/process-bom/process-bom-detail/delete?id=` + id }) +} + export async function operateProcessBom(data: ProcessBomVO) { return await request.post({ url: `/heli/process-bom/operate`, data }) } diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/projectorder/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/projectorder/index.ts index b95f811e..8a3f7237 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/projectorder/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/projectorder/index.ts @@ -76,6 +76,20 @@ export const getProjectOrderSubListByProjectOrderId = async (projectOrderId) => return await request.get({ url: `/heli/project-order/project-order-sub/list-by-project-order-id?projectOrderId=` + projectOrderId }) } +export const deleteProjectOrderSub = async (id: number) => { + return await request.delete({ url: `/heli/project-order/project-order-sub/delete?id=` + id }) +} + export async function operateProjectOrder(data: ProjectOrderVO) { return await request.post({ url: `/heli/project-order/operate`, data }) } + +export const getProjectOrderSubPage = async (params) => { + return await request.get({ url: `/heli/project-order/project-order-sub/page`, params }) +} + + + + + + diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/purchaseorderboom/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/purchaseorderboom/index.ts new file mode 100644 index 00000000..836358a5 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/purchaseorderboom/index.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +export interface PurchaseOrderBoomVO { + id: number + purchaseOrderId: number + boomDetailId: number + boomName: string + boomSpec: string + boomUnit: number + composition: string + boomAmount:number + purchaseAmount: number + estimatedPrice: number + actualPrice: number + arriveTime: Date + requireTime:Date + description: string +} + +// 查询采购订单加工件明细分页 +export const getPurchaseOrderBoomPage = async (params) => { + return await request.get({ url: `/heli/purchase-order-boom/page`, params }) +} + +// 查询采购订单加工件明细详情 +export const getPurchaseOrderBoom = async (id: number) => { + return await request.get({ url: `/heli/purchase-order-boom/get?id=` + id }) +} + +// 新增采购订单加工件明细 +export const createPurchaseOrderBoom = async (data: PurchaseOrderBoomVO) => { + return await request.post({ url: `/heli/purchase-order-boom/create`, data }) +} + +// 修改采购订单加工件明细 +export const updatePurchaseOrderBoom = async (data: PurchaseOrderBoomVO) => { + return await request.put({ url: `/heli/purchase-order-boom/update`, data }) +} + +// 删除采购订单加工件明细 +export const deletePurchaseOrderBoom = async (id: number) => { + return await request.delete({ url: `/heli/purchase-order-boom/delete?id=` + id }) +} + +// 导出采购订单加工件明细 Excel +export const exportPurchaseOrderBoom = async (params) => { + return await request.download({ url: `/heli/purchase-order-boom/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/qualityfeedback/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/qualityfeedback/index.ts new file mode 100644 index 00000000..b18204e9 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/qualityfeedback/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +export interface QualityFeedbackVO { + id: number + projectId: number + projectSubId: number + feedbacker: string + mobile: string + remark: string + status: number +} + +// 查询客户反馈质量分页 +export const getQualityFeedbackPage = async (params) => { + return await request.get({ url: `/heli/quality-feedback/page`, params }) +} + +// 查询客户反馈质量详情 +export const getQualityFeedback = async (id: number) => { + return await request.get({ url: `/heli/quality-feedback/get?id=` + id }) +} + +// 新增客户反馈质量 +export const createQualityFeedback = async (data: QualityFeedbackVO) => { + return await request.post({ url: `/heli/quality-feedback/create`, data }) +} + +// 修改客户反馈质量 +export const updateQualityFeedback = async (data: QualityFeedbackVO) => { + return await request.put({ url: `/heli/quality-feedback/update`, data }) +} + +// 删除客户反馈质量 +export const deleteQualityFeedback = async (id: number) => { + return await request.delete({ url: `/heli/quality-feedback/delete?id=` + id }) +} + +// 导出客户反馈质量 Excel +export const exportQualityFeedback = async (params) => { + return await request.download({ url: `/heli/quality-feedback/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/storagelog/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagelog/index.ts index 1c648206..94c1c0ec 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/storagelog/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagelog/index.ts @@ -21,6 +21,21 @@ export const getStorageNowList = async (params) => { return await request.get({ url: `/heli/storage-log/all`, params }) } +// 查询物料信息结合库存信息 +export const getStorageNowMaterialGroupPage = async (params) => { + return await request.get({ url: `/heli/storage-log/page-material-group`, params }) +} + + +// 查询物料信息结合库存信息 +export const getStorageNowMaterialPage = async (params) => { + return await request.get({ url: `/heli/storage-log/page-material`, params }) +} + +// 查询入/出库实时分页 +export const getStorageNowAllPage = async (params) => { + return await request.get({ url: `/heli/storage-log/page-now-all`, params }) +} // 查询入/出库实时分页 export const getStorageNowPage = async (params) => { diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/taskdispatch/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/taskdispatch/index.ts index 28ce2580..bbce58eb 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/taskdispatch/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/taskdispatch/index.ts @@ -1,52 +1,66 @@ -import request from '@/config/axios' - -export interface TaskDispatchVO { - id: number - code: string - dispatchType: string - taskId: number - planId: number - projectId: number - projectSubId: number - bomDetailId: number - dispatchStatus: number - remark: string - status: number -} - -// 查询派工单分页 -export const getTaskDispatchPage = async (params) => { - return await request.get({ url: `/heli/task-dispatch/page`, params }) -} - -// 查询派工单详情 -export const getTaskDispatch = async (id: number) => { - return await request.get({ url: `/heli/task-dispatch/get?id=` + id }) -} - -// 新增派工单 -export const createTaskDispatch = async (data: TaskDispatchVO) => { - return await request.post({ url: `/heli/task-dispatch/create`, data }) -} - -// 修改派工单 -export const updateTaskDispatch = async (data: TaskDispatchVO) => { - return await request.put({ url: `/heli/task-dispatch/update`, data }) -} - -// 删除派工单 -export const deleteTaskDispatch = async (id: number) => { - return await request.delete({ url: `/heli/task-dispatch/delete?id=` + id }) -} - -// 导出派工单 Excel -export const exportTaskDispatch = async (params) => { - return await request.download({ url: `/heli/task-dispatch/export-excel`, params }) -} - -// ==================== 子表(派工明细) ==================== - -// 获得派工明细列表 -export const getTaskDispatchDetailListByDispatchId = async (dispatchId) => { - return await request.get({ url: `/heli/task-dispatch/task-dispatch-detail/list-by-dispatch-id?dispatchId=` + dispatchId }) -} \ No newline at end of file +import request from '@/config/axios' + +export interface TaskDispatchVO { + id: number + code: string + dispatchType: string + taskId: number + planId: number + projectId: number + projectSubId: number + bomDetailId: number + dispatchStatus: number + remark: string + status: number + active: string + activeOpinion: string +} + +// 查询派工单分页 +export const getTaskDispatchPage = async (params) => { + return await request.get({ url: `/heli/task-dispatch/page`, params }) +} + +// 查询派工单详情 +export const getTaskDispatch = async (id: number) => { + return await request.get({ url: `/heli/task-dispatch/get?id=` + id }) +} + +// 新增派工单 +export const createTaskDispatch = async (data: TaskDispatchVO) => { + return await request.post({ url: `/heli/task-dispatch/create`, data }) +} + +// 修改派工单 +export const updateTaskDispatch = async (data: TaskDispatchVO) => { + return await request.put({ url: `/heli/task-dispatch/update`, data }) +} + +// 删除派工单 +export const deleteTaskDispatch = async (id: number) => { + return await request.delete({ url: `/heli/task-dispatch/delete?id=` + id }) +} + +// 导出派工单 Excel +export const exportTaskDispatch = async (params) => { + return await request.download({ url: `/heli/task-dispatch/export-excel`, params }) +} + +// ==================== 子表(派工明细) ==================== + +// 获得派工明细列表 +export const getTaskDispatchDetailListByDispatchId = async (dispatchId) => { + return await request.get({ url: `/heli/task-dispatch/task-dispatch-detail/list-by-dispatch-id?dispatchId=` + dispatchId }) +} +// 删除派工单 +export const deleteTaskDispatchDetail = async (id: number) => { + return await request.delete({ url: `/heli/task-dispatch/task-dispatch-detail/delete?id=` + id }) +} + +export async function operateTaskDispatch(data: TaskDispatchVO) { + return await request.post({ url: `/heli/task-dispatch/operate`, data }) +} + +export const getTaskDispatchDetailPage = async (params) => { + return await request.get({ url: `/heli/task-dispatch/task-dispatch-detail/page`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/taskreport/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/taskreport/index.ts new file mode 100644 index 00000000..37589dbc --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/taskreport/index.ts @@ -0,0 +1,43 @@ +import request from '@/config/axios' + +export interface TaskReportVO { + id: number + dispatchDetailId: number + owner: number + amount: number + startTime: Date + endTime: Date + reportTime: Date + hasReport: number + status: number +} + +// 查询任务报工分页 +export const getTaskReportPage = async (params) => { + return await request.get({ url: `/heli/task-report/page`, params }) +} + +// 查询任务报工详情 +export const getTaskReport = async (id: number) => { + return await request.get({ url: `/heli/task-report/get?id=` + id }) +} + +// 新增任务报工 +export const createTaskReport = async (data: TaskReportVO) => { + return await request.post({ url: `/heli/task-report/create`, data }) +} + +// 修改任务报工 +export const updateTaskReport = async (data: TaskReportVO) => { + return await request.put({ url: `/heli/task-report/update`, data }) +} + +// 删除任务报工 +export const deleteTaskReport = async (id: number) => { + return await request.delete({ url: `/heli/task-report/delete?id=` + id }) +} + +// 导出任务报工 Excel +export const exportTaskReport = async (params) => { + return await request.download({ url: `/heli/task-report/export-excel`, params }) +} \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/unqualifiednotification/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/unqualifiednotification/index.ts new file mode 100644 index 00000000..35ee1d56 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/unqualifiednotification/index.ts @@ -0,0 +1,55 @@ +import request from '@/config/axios' + +export interface UnqualifiedNotificationVO { + id: number + code: string + type: string + notificationStatus: number + projectId: number + projectSubId: number + bomDetailId: number + procedureId: number + amount: number + owner: number + remark: string + auditor: number + auditOpinion: string + status: number + auditTime: Date +} + +// 查询品质异常通知单审核分页 +export const getUnqualifiedNotificationPage = async (params) => { + return await request.get({ url: `/heli/unqualified-notification/page`, params }) +} + +// 查询品质异常通知单审核详情 +export const getUnqualifiedNotification = async (id: number) => { + return await request.get({ url: `/heli/unqualified-notification/get?id=` + id }) +} + +// 新增品质异常通知单审核 +export const createUnqualifiedNotification = async (data: UnqualifiedNotificationVO) => { + return await request.post({ url: `/heli/unqualified-notification/create`, data }) +} + +// 修改品质异常通知单审核 +export const updateUnqualifiedNotification = async (data: UnqualifiedNotificationVO) => { + return await request.put({ url: `/heli/unqualified-notification/update`, data }) +} + +// 删除品质异常通知单审核 +export const deleteUnqualifiedNotification = async (id: number) => { + return await request.delete({ url: `/heli/unqualified-notification/delete?id=` + id }) +} + +// 导出品质异常通知单审核 Excel +export const exportUnqualifiedNotification = async (params) => { + return await request.download({ url: `/heli/unqualified-notification/export-excel`, params }) +} +export async function operateUnqualifiedNotification(data: UnqualifiedNotificationVO) { + return await request.post({ url: `/heli/unqualified-notification/operate`, data }) +} +export const getUnqualifiedNotificationStatisticPage = async (params) => { + return await request.get({ url: `/heli/unqualified-notification/statisticPage`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/components/Dialog/src/Dialog.vue b/mes-ui/mes-ui-admin-vue3/src/components/Dialog/src/Dialog.vue index a1eb550c..45257547 100644 --- a/mes-ui/mes-ui-admin-vue3/src/components/Dialog/src/Dialog.vue +++ b/mes-ui/mes-ui-admin-vue3/src/components/Dialog/src/Dialog.vue @@ -65,7 +65,6 @@ const dialogStyle = computed(() => { :width="width" destroy-on-close lock-scroll - draggable class="com-dialog" :show-close="false" > diff --git a/mes-ui/mes-ui-admin-vue3/src/locales/zh-CN.ts b/mes-ui/mes-ui-admin-vue3/src/locales/zh-CN.ts index 7198bb94..d6ba4482 100644 --- a/mes-ui/mes-ui-admin-vue3/src/locales/zh-CN.ts +++ b/mes-ui/mes-ui-admin-vue3/src/locales/zh-CN.ts @@ -121,7 +121,7 @@ export default { hasUser: '已有账号?去登录', forgetPassword: '忘记密码?', tenantNamePlaceholder: '请输入租户名称', - usernamePlaceholder: '请输入用户名', + usernamePlaceholder: '请输入工号', passwordPlaceholder: '请输入密码', codePlaceholder: '请输入验证码', mobileTitle: '手机登录', diff --git a/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss b/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss index 49eacdbe..5a65ad88 100644 --- a/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss +++ b/mes-ui/mes-ui-admin-vue3/src/styles/cus.scss @@ -67,6 +67,9 @@ .hl-table.is-scrolling-none th.el-table-fixed-column--left { background-color: #f7f8fa; } +.hl-table.is-scrolling-right th.el-table-fixed-column--right { + background-color: #f7f8fa; /* 继承父级(一般为表格整体背景色)或者自定义颜色 */ +} .hl-table-list { td.el-table__cell { @@ -172,75 +175,74 @@ //已送审 .iapproval { - background-color:#EDFFED; - color: #038A24; + background-color: #edffed; + color: #038a24; } //已保存 .iconserve { - background-color:#F2FBFF; - color: #1B9AEE; + background-color: #f2fbff; + color: #1b9aee; } //已审核 .iaudit { - background-color: #19A998; - color:#FFFFFF; - border:none; + background-color: #19a998; + color: #ffffff; + border: none; } //已启动 .istart { - background-color: #1B9AEE; - color: #FFFFFF; - border:none; + background-color: #1b9aee; + color: #ffffff; + border: none; } //已打回 .iBack { - background-color: #FFEDED; - color: #E62412; - border:#FFEDED; + background-color: #ffeded; + color: #e62412; + border: #ffeded; } //已变更 .ialteration { - background-color:#FFF7E6; - color:#D46B08; - border:none; + background-color: #fff7e6; + color: #d46b08; + border: none; } //已提交 .isubmit { - background-color: #19A998; - color:#FFFFFF; - border:none; + background-color: #19a998; + color: #ffffff; + border: none; } //已作废 .icancellation { - background-color: #F0F1F4; + background-color: #f0f1f4; color: #666879; - border:none; - + border: none; } //已终止 .ibreakup { - background-color: #F0F1F4; + background-color: #f0f1f4; color: #666879; - border:none; + border: none; } //全部发货 .allshipments { - color: #1B9AEE; + color: #1b9aee; background-color: transparent; border: none; } //未发货 .noshipments { - color: #E62412; + color: #e62412; background-color: transparent; border: none; } //部分发货 .partshipments { - color: #F39800; + color: #f39800; background-color: transparent; border: none; } @@ -253,5 +255,7 @@ .fou { background-color: #f7fbfd; border: 1px solid #d4d6e3; - color: #77838C; + color: #77838c; } + + diff --git a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts index 86b965ce..218792bf 100644 --- a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts +++ b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts @@ -248,4 +248,12 @@ export enum DICT_TYPE { HELI_PROJECT_PURCHASE_ORDER_TYPE = 'heli_project_purchase_order_type',//采购单类型 HELI_PROJECT_PURCHASE_GOODS_TYPE = 'heli_project_purchase_goods_type',//采购物类型 HELI_PURCHASE_ORDER_STATUS = 'heli_purchase_order_status',//采购单状态 + HELI_DISPATCH_STATUS = 'heli_dispatch_status', // 派工单状态 + HELI_INSPECTION_TYPE = 'heli_inspection_type', // 质检类型 + HELI_UNQUALIFIED_NOTIFICATION_STATUS = 'heli_unqualified_notification_status', // 品质异常通知单审核状态 + HELI_UNQUALIFIED_NOTIFICATION_OPINION = 'heli_unqualified_notification_opinion', // 品质异常通知单审核意见 + HELI_INVOICE_TYPE = 'heli_invoice_type', // 发票类型 + HELI_INVOICE_STATUS = 'heli_invoice_status', //发票状态 + // =====发货人姓名===== + HELI_DEFAULT_DELIVER='heli_default_deliver',//默认发货人姓名 } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/CompositionForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/CompositionForm.vue index 5d989cb5..275872aa 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/CompositionForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/CompositionForm.vue @@ -26,7 +26,7 @@ - + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/index.vue index 1dd6ace2..51e6fb60 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/index.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/composition/index.vue @@ -86,6 +86,11 @@ + + +