From f349941a940e949377b47abd0d7e9eefb7e060c2 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Mon, 8 Jan 2024 18:05:52 +0800 Subject: [PATCH 01/11] =?UTF-8?q?PDA=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/device/EquOrderMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml index 2fe00c62..af0d332b 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml @@ -185,7 +185,7 @@ where del_flag = '0' and user_name = #{userId} GROUP BY order_code) - order by eo.plan_loop_type, eo.plan_loop, eo.create_time, eo.equipment_code + order by eo.plan_loop_type, eo.plan_loop, eo.create_time desc, eo.equipment_code SELECT COUNT(fault_id)+1 AS serialNum FROM equ_fault_description - WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time) + WHERE del_flag = '0' \ No newline at end of file diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquFaultMeasuresMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquFaultMeasuresMapper.xml index eaafe629..6f98ab3b 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquFaultMeasuresMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquFaultMeasuresMapper.xml @@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and update_by like concat('%', #{updateBy}, '%') and del_flag = '0' + ORDER BY CAST(RIGHT(fault_code, 4) AS INTEGER) SELECT COUNT(fault_id)+1 AS serialNum FROM equ_fault_measures - WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time) + WHERE del_flag = '0' \ No newline at end of file diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml index 10b95ba1..431465fc 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml @@ -45,11 +45,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and update_by like concat('%', #{updateBy}, '%') and del_flag = '0' + ORDER BY CAST(RIGHT(fault_code, 4) AS INTEGER) @@ -122,6 +125,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" \ No newline at end of file diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml index b9268d5f..99fc05b3 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml @@ -50,7 +50,7 @@ and update_by like concat('%', #{updateBy}, '%') and del_flag = '0' - ORDER BY create_time DESC + ORDER BY CAST(RIGHT(fault_code, 4) AS INTEGER) SELECT COUNT(fault_id)+1 AS serialNum FROM equ_fault_type - WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time) + WHERE del_flag = '0' From 8a8cdaaed43b70be771c095e55f7f0676f4717b3 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Tue, 9 Jan 2024 11:24:07 +0800 Subject: [PATCH 06/11] =?UTF-8?q?2024-1-9-2=20=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF-=E5=B7=A5=E5=8E=82-=E5=8A=A0=E5=B7=A5=E5=8E=82?= =?UTF-8?q?=E5=BB=BA=E6=A8=A1=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/device/EquFaultReasonMapper.xml | 2 -- .../src/main/java/com/op/wms/domain/SysFactory.java | 11 +++++++++++ .../main/resources/mapper/wms/SysFactoryMapper.xml | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml index 431465fc..4d1539d2 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquFaultReasonMapper.xml @@ -51,8 +51,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java index 5b78ff86..d47e3894 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/SysFactory.java @@ -47,6 +47,10 @@ public class SysFactory extends TreeEntity { @Excel(name = "工厂编码") private String factoryCode; + /** 工厂建模类型 */ + @Excel(name = "工厂建模类型") + private String fType; + //虚拟字段 private List> workCenter; private String value; @@ -111,6 +115,13 @@ public class SysFactory extends TreeEntity { this.factoryCode = factoryCode; } + public String getFType() { + return fType; + } + public void setFType(String fType) { + this.fType = fType; + } + public String getValue() { return value; } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml index f8f26d4e..72b70fd8 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/SysFactoryMapper.xml @@ -21,10 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select factory_id, parent_id, ancestors, factory_name, order_num, leader, phone, email, status, del_flag, create_by, create_time, update_by, update_time, factory_code,del_flag from sys_factory + select factory_id, parent_id, ancestors, factory_name, order_num, leader, phone, email, status, del_flag, create_by, create_time, update_by, update_time, factory_code,del_flag , f_type from sys_factory @@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, update_time, factory_code, + f_type, #{parentId}, @@ -82,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{updateTime}, #{factoryCode}, + #{fType}, @@ -102,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, factory_code = #{factoryCode}, + f_type = #{fType}, where factory_id = #{factoryId} From fc507735c75d2a194fed2499a72c7811814be080 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Tue, 9 Jan 2024 14:09:36 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/mes/MesMapper.xml | 6 +- .../QcCheckReportProduceController.java | 12 ++- .../quality/domain/QcCheckReportIncome.java | 9 ++ .../op/quality/domain/QcCheckTaskProduce.java | 20 ++++ .../mapper/QcCheckReportIncomeMapper.java | 2 + .../mapper/QcCheckTaskProduceMapper.java | 9 ++ .../impl/QcCheckReportProduceServiceImpl.java | 23 ++-- .../quality/QcCheckReportIncomeMapper.xml | 31 ++++-- .../quality/QcCheckTaskProduceMapper.xml | 100 +++++++++++++++++- 9 files changed, 186 insertions(+), 26 deletions(-) diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml index 6656b442..38a294a9 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml @@ -118,9 +118,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" equ.equipment_type_code select qct.record_id, qct.check_no, qct.income_batch_no, - qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit, - qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status, - qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,qct.sample_quality, - qct.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type, - q.type_code,q.check_name + qct.order_no, qct.material_code, qct.material_name, qct.quality, qct.unit, + qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status, + qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,qct.sample_quality, + qct.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type, + q.type_code,q.check_name from qc_check_task qct left join qc_check_type q on q.id = qct.check_type @@ -143,8 +143,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join qc_check_type_project qctp on td.type_project_id = qctp.id where td.belong_to = #{recordId} + - + insert into qc_check_task record_id, diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml index 77edb220..31eb4ce1 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskProduceMapper.xml @@ -11,9 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - + @@ -35,9 +33,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -266,4 +299,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{recordId} + From bd8870982d9afae85a93852fcf058cbe2f2b7a0e Mon Sep 17 00:00:00 2001 From: Yangwl <1726150332@qq.com> Date: Tue, 9 Jan 2024 14:11:39 +0800 Subject: [PATCH 08/11] =?UTF-8?q?OA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/RemoteOpenService.java | 7 +- .../factory/RemoteOpenFallbackFactory.java | 8 +- .../op/common/core/constant/Constants.java | 8 +- .../controller/MesReportWorkController.java | 2 +- .../controller/MesUnitPriceController.java | 15 ++ .../java/com/op/mes/domain/MesReportWork.java | 157 ++++++++++----- .../op/mes/mapper/MesReportWorkMapper.java | 2 + .../op/mes/service/IMesReportWorkService.java | 2 + .../op/mes/service/IMesUnitPriceService.java | 3 + .../impl/MesReportWorkServiceImpl.java | 7 + .../service/impl/MesUnitPriceServiceImpl.java | 43 +++++ .../mapper/mes/MesReportWorkMapper.xml | 53 ++++++ .../mapper/mes/MesUnitPriceMapper.xml | 2 + .../op/open/controller/OpenController.java | 33 ++-- .../java/com/op/open/service/OpenService.java | 2 +- .../op/open/service/impl/OpenServiceImpl.java | 180 +++++++++--------- .../op/sap/service/impl/SapItemSyncImpl.java | 21 -- 17 files changed, 365 insertions(+), 180 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java index 680f81b7..f5840b14 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteOpenService.java @@ -6,6 +6,7 @@ import com.op.system.api.factory.RemoteOpenFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.Map; @@ -16,8 +17,12 @@ import java.util.Map; */ @FeignClient(contextId = "remoteOpenService", value = ServiceNameConstants.OPEN_SERVICE, fallbackFactory = RemoteOpenFallbackFactory.class) public interface RemoteOpenService { - /**提交ZL0010-来料检验不合格控制流程**/ + /**提交流程**/ @PostMapping("/openInterface/OAInspection") public AjaxResult OAInspection(@RequestBody(required = false) Map paramMap); + /**获取流程信息**/ + + @PostMapping("/openInterface/GetOaNodeInfo") + public AjaxResult GetOaNodeInfo(@RequestParam String requestId); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteOpenFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteOpenFallbackFactory.java index b3d5bc63..8ef1ae4d 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteOpenFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteOpenFallbackFactory.java @@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.Map; @@ -20,7 +21,12 @@ public class RemoteOpenFallbackFactory implements FallbackFactory paramMap) { - return AjaxResult.error("提交ZL0010-来料检验不合格控制流程失败"+throwable.getMessage()); + return AjaxResult.error("提交流程失败"+throwable.getMessage()); + } + + @Override + public AjaxResult GetOaNodeInfo(@RequestParam String requestId) { + return AjaxResult.error("获取流程失败"+throwable.getMessage()); } }; } diff --git a/op-common/op-common-core/src/main/java/com/op/common/core/constant/Constants.java b/op-common/op-common-core/src/main/java/com/op/common/core/constant/Constants.java index 81d7b51f..55d6df0a 100644 --- a/op-common/op-common-core/src/main/java/com/op/common/core/constant/Constants.java +++ b/op-common/op-common-core/src/main/java/com/op/common/core/constant/Constants.java @@ -148,9 +148,11 @@ public class Constants { //领料 public static final Integer LL=261; - //来料检验不合格控制流程workflowId + //ZL0010-来料检验不合格控制流程 - public static final Integer WORKFLOWID=26235; + public static final Integer WORKFLOWID_ZL0010=26235; + + //ZL0020-成品检验控制流程 + public static final Integer WORKFLOWID_ZL0020=26234; - //过程检验不合格控制流程workflowId } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index d70885d4..ad1e50ef 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -87,7 +87,7 @@ public class MesReportWorkController extends BaseController { // String dateEndStr = dtf.format(dateEnd)+" 00:00:00"; // mesReportWork.setCreateTimeEnd(dateEndStr);//end // } - List list = mesReportWorkService.selectMesReportWorkList(mesReportWork); + List list = mesReportWorkService.selectMesReportWorkList_S(mesReportWork); ExcelUtil util = new ExcelUtil(MesReportWork.class); util.exportExcel(response, list, "报工报表数据"); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesUnitPriceController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesUnitPriceController.java index 85374e65..cacf2b65 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesUnitPriceController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesUnitPriceController.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.op.common.security.utils.SecurityUtils; import com.op.mes.domain.MesUnitPrice; import com.op.mes.service.IMesUnitPriceService; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +24,7 @@ import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.utils.poi.ExcelUtil; import com.op.common.core.web.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; /** * unitPriceController @@ -58,12 +60,25 @@ public class MesUnitPriceController extends BaseController { ExcelUtil util = new ExcelUtil(MesUnitPrice.class); util.exportExcel(response, list, "unitPrice数据"); } + + @Log(title = "计件薪资管理", businessType = BusinessType.IMPORT) + @RequiresPermissions("system:unitPrice:import") + @PostMapping("/importData") + public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { + ExcelUtil util = new ExcelUtil(MesUnitPrice.class); + List UnitPriceList = util.importExcel(file.getInputStream()); + String operName = SecurityUtils.getUsername(); + String message = mesUnitPriceService.importMesUnitPrice(UnitPriceList, updateSupport, operName); + return success(message); + } + @PostMapping("/importTemplate") public void importTemplate(HttpServletResponse response) throws IOException { ExcelUtil util = new ExcelUtil(MesUnitPrice.class); util.importTemplateExcel(response, "产品单价导入模板"); } + /** * 获取unitPrice详细信息 */ diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java index df2eda83..49d5e5bd 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java @@ -21,19 +21,18 @@ public class MesReportWork extends BaseEntity { /** 记录id */ private String id; - - /** 报工单编号 */ - @Excel(name = "报工单编号") - private String reportCode; - - /** 报工类型,报工类型:SELF自行报工、UNI统一报工 */ - @Excel(name = "报工类型,报工类型:SELF上位机报工、UNI系统报工") - private String reportType; + /** 线体名称 */ + @Excel(name = "线体名称") + private String machineName; /** 生产工单编码 */ @Excel(name = "生产工单编码") private String workorderCode; + /** SAP订单号 */ + @Excel(name = "SAP订单号") + private String workorderCodeSap; + /** 产品编码 */ @Excel(name = "产品编码") private String productCode; @@ -42,22 +41,73 @@ public class MesReportWork extends BaseEntity { @Excel(name = "产品名称") private String productName; - /** 规格型号 */ - @Excel(name = "规格型号") - private String spec; + /** 批次号 */ + @Excel(name = "批次号") + private String batch; /** 单位 */ @Excel(name = "单位") private String unit; - /** 排产数量 */ - @Excel(name = "排产数量") - private BigDecimal quantity; - private BigDecimal quantitySplit; /** 本次报工数量 */ @Excel(name = "本次报工数量") private BigDecimal quantityFeedback; + /** 工时 */ + @Excel(name = "工时") + private Long workTime; + + @Excel(name = "用人") + private Long useMan; + + /** 报工人员 */ + @Excel(name = "报工人员") + private String nickName; + + /** 报工时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "报工时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date feedbackTime; + + /** 耗用物料编码 */ + @Excel(name = "耗用物料编码") + private String materialCode; + + + /** 耗用物料名称 */ + @Excel(name = "耗用物料名称") + private String materialName; + + /** 物料消耗数量 */ + @Excel(name = "物料消耗数量") + private BigDecimal quantity; + + /** 物料消耗数量 */ + @Excel(name = "物料消耗单位") + private String materialNameUnit; + + + + /** 报工单编号 */ +// @Excel(name = "报工单编号") + private String reportCode; + + /** 报工类型,报工类型:SELF自行报工、UNI统一报工 */ + //@Excel(name = "报工类型,报工类型:SELF上位机报工、UNI系统报工") + private String reportType; + + + /** 规格型号 */ + //@Excel(name = "规格型号") + private String spec; + + + + + + private BigDecimal quantitySplit; + + /** 合格数量 */ //@Excel(name = "合格数量") private BigDecimal quantityQualified; @@ -67,60 +117,50 @@ public class MesReportWork extends BaseEntity { private BigDecimal quantityUnqualified; /** 报工人员 */ - @Excel(name = "报工人员") + //@Excel(name = "报工人员") private String userName; - /** 人员名称 */ - @Excel(name = "人员名称") - private String nickName; + /** 报工途径:PAD、MOBILE、PC */ //@Excel(name = "报工途径:PAD、MOBILE、PC") private String feedbackChannel; - /** 报工时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "报工时间", width = 30, dateFormat = "yyyy-MM-dd") - private Date feedbackTime; + private String feedbackTimeStr; /** 录入人员 */ - @Excel(name = "录入人员") + //@Excel(name = "录入人员") private String recordUser; /** 状态 */ - @Excel(name = "状态") + //@Excel(name = "状态") private String status; - /** 工时 */ - @Excel(name = "工时") - private Long workTime; - @Excel(name = "用人") - private Long useMan; + + /** 线体编码 */ - @Excel(name = "线体编码") + //@Excel(name = "线体编码") private String machineCode; - /** 线体名称 */ - @Excel(name = "线体名称") - private String machineName; + /** 班组编码 */ - @Excel(name = "班组编码") + //@Excel(name = "班组编码") private String teamCode; /** 班次编码 */ - @Excel(name = "班次编码") + //@Excel(name = "班次编码") private String shiftCode; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "SAP报工时间") + //@Excel(name = "SAP报工时间") private Date uploadTime; - @Excel(name = "SAP报工状态0待报工1成功2失败") + //@Excel(name = "SAP报工状态0待报工1成功2失败") private String uploadStatus; - @Excel(name = "SAP报工信息") + //@Excel(name = "SAP报工信息") private String uploadMsg; /** 预留字段1 */ //@Excel(name = "预留字段1") @@ -137,23 +177,23 @@ public class MesReportWork extends BaseEntity { /** 预留字段4 */ //@Excel(name = "预留字段4") private String attr4; - @Excel(name = "计划生产日期") + //@Excel(name = "计划生产日期") private String productDate; private String productDateStart; private String productDateEnd; - @Excel(name = "订单编号") + //@Excel(name = "订单编号") private String orderCode; - @Excel(name = "规格型号") + //@Excel(name = "规格型号") private String productSpc; - @Excel(name = "工序名称") + //@Excel(name = "工序名称") private String processName; - @Excel(name = "工序编码") + //@Excel(name = "工序编码") private String processCode; private String factoryCode; private String factoryName; private String carCode; private String carName; - private String workorderCodeSap; + private String routeCode; private String sac1; private String sac2; @@ -166,7 +206,7 @@ public class MesReportWork extends BaseEntity { private String createTimeEnd; private String feedbackTimeStart; private String feedbackTimeEnd; - private String batch; + private String endReport; private String parentOrder; private String workorderCodes; @@ -180,8 +220,33 @@ public class MesReportWork extends BaseEntity { private Long workTimes; private String workCenter; private String shiftId; + private List consumesInfos; + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getMaterialNameUnit() { + return materialNameUnit; + } + + public void setMaterialNameUnit(String materialNameUnit) { + this.materialNameUnit = materialNameUnit; + } + public String getShiftId() { return shiftId; } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index 1513a6cc..35ccd15d 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -125,4 +125,6 @@ public interface MesReportWorkMapper { public MesReportWork getReportWorkHz(MesReportWork mesReportWork); MesReportWork getEndReport(MesReportWork pWork); + + List selectMesReportWorkList_S(MesReportWork mesReportWork); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java index 6f89c239..a543a263 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java @@ -98,4 +98,6 @@ public interface IMesReportWorkService { int submitReportPS(List mesReportWorks); List getPrepareList(MesPrepareDetail mesPrepareDetail); + + List selectMesReportWorkList_S(MesReportWork mesReportWork); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesUnitPriceService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesUnitPriceService.java index be6a7036..66764c91 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesUnitPriceService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesUnitPriceService.java @@ -59,4 +59,7 @@ public interface IMesUnitPriceService { * @return 结果 */ public int deleteMesUnitPriceByPicId(String picId); + + + public String importMesUnitPrice(List UnitPriceList, Boolean updateSupport,String operName); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 3a05d701..8d1d7fe9 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -169,6 +169,13 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return mesReportWorkMapper.getPrepareList(mesPrepareDetail); } + @Override + @DS("#header.poolName") + public List selectMesReportWorkList_S(MesReportWork mesReportWork) { + List dtos = mesReportWorkMapper.selectMesReportWorkList_S(mesReportWork); + return dtos; + } + /** * 修改报工报表 * diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesUnitPriceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesUnitPriceServiceImpl.java index a32b224f..3015610c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesUnitPriceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesUnitPriceServiceImpl.java @@ -3,10 +3,15 @@ package com.op.mes.service.impl; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.exception.ServiceException; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.StringUtils; +import com.op.common.core.utils.uuid.IdUtils; import com.op.mes.domain.MesUnitPrice; import com.op.mes.mapper.MesUnitPriceMapper; import com.op.mes.service.IMesUnitPriceService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,9 +24,13 @@ import org.springframework.stereotype.Service; */ @Service public class MesUnitPriceServiceImpl implements IMesUnitPriceService { + + private static final Logger log = LoggerFactory.getLogger(IMesUnitPriceService.class); + @Autowired private MesUnitPriceMapper mesUnitPriceMapper; + /** * 查询unitPrice * @@ -90,4 +99,38 @@ public class MesUnitPriceServiceImpl implements IMesUnitPriceService { public int deleteMesUnitPriceByPicId(String picId) { return mesUnitPriceMapper.deleteMesUnitPriceByPicId(picId); } + + @Override + @DS("#header.poolName") + public String importMesUnitPrice(List UnitPriceList, Boolean updateSupport, String operName) { + if (StringUtils.isNull(UnitPriceList) || UnitPriceList.size() == 0) { + throw new ServiceException("导入数据不能为空!"); + } + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + for (MesUnitPrice mesUnitPrice : UnitPriceList) { + try { + // 验证是否存在这个产线产品 + mesUnitPrice.setPicId(IdUtils.simpleUUID()); + mesUnitPriceMapper.insertMesUnitPrice(mesUnitPrice); + successNum++; + successMsg.append("导入成功"); + + } catch (Exception e) { + failureNum++; + String msg = "导入失败:"; + failureMsg.append(msg + e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } else { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + } + return successMsg.toString(); + } } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 2c11f765..556bef11 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -43,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + @@ -586,6 +592,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from mes_report_work where end_report = '1' and workorder_code = #{workorderCode} + insert into mes_report_work diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitPriceMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitPriceMapper.xml index a57d2a12..c79b86c5 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitPriceMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitPriceMapper.xml @@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select row_number() over (order by cast(eo.actual_operation_time as decimal(6, 2))/2 desc) as serialNumber, - eo.equipment_code as equipmentCode, - cast(cast(eo.actual_operation_time as decimal(18,2))/(SELECT count(*) from equ_repair_work_order erwo where erwo.equipment_code = eo.equipment_code and erwo.work_status = '1' and erwo.work_down_machine = '1') as decimal(18,2)) AS mtbf + eo.equipment_code as equipmentCode, + eo.equipment_name as equipmentName, + case + when eo.shutdown_times > 0 THEN cast(cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times as decimal(18,2)) + else 0 + end as mtbf from equ_operation eo where day(eo.create_time) = day(getdate()) - and cast(eo.fault_time as decimal(6, 0)) > 0 diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml index cad74285..6da1e004 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOperationMapper.xml @@ -29,6 +29,8 @@ + + @@ -55,7 +57,9 @@ create_by, create_time, update_by, - update_time + update_time, + failure_times, + shutdown_times from equ_operation @@ -159,6 +163,8 @@ create_time, update_by, update_time, + failure_times, + shutdown_times, #{id}, @@ -185,6 +191,8 @@ #{createTime}, #{updateBy}, #{updateTime}, + #{failureTimes}, + #{shutdownTimes}, @@ -236,6 +244,8 @@ create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, + failure_times = #{failureTimes}, + shutdown_times = #{shutdownTimes}, where id = #{id} From 56d369c801f67a7a89f14d68ae24528eba5b3659 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Tue, 9 Jan 2024 17:17:34 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=B7=B2=E5=88=A0=E9=99=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=B8=8D=E7=94=9F=E6=88=90=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/device/DeviceTaskMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml index a190ac18..4189a69a 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml @@ -29,6 +29,7 @@ from equ_plan ep left join equ_plan_equ epe on ep.plan_code = epe.plan_code where ep.del_flag = '0' and epe.del_flag = '0' and ep.plan_status = '0' + and epe.equipment_code in ( select be.equipment_code from base_equipment be where be.del_flag = '0' ) and ep.plan_type = #{planType} and CONVERT(varchar(10),GETDATE(), 120) >= CONVERT(varchar(10),ep.plan_loop_start, 120)