From 5a60b221578a30c031cef971f766233b1ba522c3 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 6 Sep 2023 14:43:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=AE=A1=E5=88=92-=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E8=B7=AF=E7=BA=BF=E9=80=89=E6=8B=A9=E6=9B=B4=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/RemoteMesService.java | 3 + .../com/op/system/api/RemotePlanService.java | 1 + .../api/domain/mes/ProRfidProcessDetail.java | 10 +- .../api/factory/RemoteMesFallbackFactory.java | 5 + .../src/main/java/com/op/job/task/RyTask.java | 16 ++- .../mes/controller/MesPrepareController.java | 6 ++ .../java/com/op/mes/domain/MesReportWork.java | 99 +++++++++++++++++++ .../op/mes/mapper/MesReportWorkMapper.java | 4 + .../mapper/ProRfidProcessDetailMapper.java | 2 + .../op/mes/service/IMesPrepareService.java | 2 + .../service/impl/IWCInterfaceServiceImpl.java | 41 +++++++- .../service/impl/MesPrepareServiceImpl.java | 63 ++++++++++++ .../mapper/mes/MesReportWorkMapper.xml | 33 ++++++- .../mapper/mes/ProRfidProcessDetailMapper.xml | 8 +- .../op/quality/controller/QuaController.java | 2 +- .../com/op/quality/mapper/BaseFileMapper.java | 72 -------------- .../op/quality/mapper/QcProCheckMapper.java | 4 + .../serviceImpl/QcProCheckServiceImpl.java | 6 +- .../resources/mapper/QcProCheckMapper.xml | 19 +++- .../system/controller/SysUserController.java | 3 +- 20 files changed, 307 insertions(+), 92 deletions(-) delete mode 100644 op-modules/op-quality/src/main/java/com/op/quality/mapper/BaseFileMapper.java diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java index 9ba5c354..135fda3b 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java @@ -32,4 +32,7 @@ public interface RemoteMesService { /**获取领料单**/ @PostMapping("/prepare/getMesPrepare") public R getMesPrepare(); + + @PostMapping("/prepare/reportWorkTask") + public R reportWorkTask(); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java index b5814d40..92e89e1d 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemotePlanService.java @@ -31,4 +31,5 @@ public interface RemotePlanService { @PostMapping("/order/syncSAPOrders") public R syncSAPOrders(); + } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProRfidProcessDetail.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProRfidProcessDetail.java index 0fbb60c0..65a44a10 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProRfidProcessDetail.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/ProRfidProcessDetail.java @@ -34,7 +34,7 @@ public class ProRfidProcessDetail extends BaseEntity { /** 机台编码 */ @Excel(name = "机台编码") private String machineCode; - + private String prodLineCode; /** 当前步 */ @Excel(name = "当前步") private String nowProcessId; @@ -87,6 +87,14 @@ public class ProRfidProcessDetail extends BaseEntity { private String productCode; private String productModel; + public String getProdLineCode() { + return prodLineCode; + } + + public void setProdLineCode(String prodLineCode) { + this.prodLineCode = prodLineCode; + } + public String getProductCode() { return productCode; } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java index b6c0c40c..0bd451f3 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java @@ -40,6 +40,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory getProcessFinishList(MesProcessReport mesReportWork); public List getProductionList(MesReportProduction mesReportProduction); + + public List getReportWorkList(MesReportWork mesReportWork); + + void updateSyncSapStatus(MesReportWork work); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java index 10af1522..22ca741c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/ProRfidProcessDetailMapper.java @@ -64,4 +64,6 @@ public interface ProRfidProcessDetailMapper { public ProRfidProcessDetail getRfidInfo(String rfidNo); public String getStationType(String equipmentCode); + + String getActuaEquips(ProRfidProcessDetail rfidInfo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesPrepareService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesPrepareService.java index 69228280..334c839c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesPrepareService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesPrepareService.java @@ -61,4 +61,6 @@ public interface IMesPrepareService { public int deleteMesPrepareByPrepareId(String prepareId); public R getMesPrepare(); + + public R reportWorkTask(); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index c5fe1461..a455733d 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -1,5 +1,6 @@ package com.op.mes.service.impl; +import com.alibaba.fastjson2.JSONArray; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.bean.BeanUtils; @@ -20,7 +21,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; /** * wcs接口业务层处理 @@ -83,17 +86,33 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { ProRfidProcessDetail rfidInfo = proRfidProcessDetailMapper.getRfidInfo(wcsdto.getRfidNo()); //获取设备类型 if(rfidInfo!=null && StringUtils.isNotBlank(rfidInfo.getMachineCode())){ - String[] machineCodes = rfidInfo.getMachineCode().split(","); - String stationType = proRfidProcessDetailMapper.getStationType(machineCodes[0]); + //设备-工艺路线的设备大范围 + String[] machineCodes0 = rfidInfo.getMachineCode().split(","); + String stationType = proRfidProcessDetailMapper.getStationType(machineCodes0[0]); if(StringUtils.isNotBlank(stationType)){ dto.setStationType(stationType); } + //设备-根据工单获取实际规划设备路线 + String machinecode = rfidInfo.getProdLineCode();//proRfidProcessDetailMapper.getActuaEquips(rfidInfo); + JSONArray codeArray = JSONArray.parseArray(machinecode); + List list2 = new ArrayList<>(); + for(int c1=0;c1 list1 = Arrays.asList(machineCodes0); + List machineArray = list1.stream() + .filter(u1-> list2.contains(u1)) + .collect(Collectors.toList()); + dto.setSku(rfidInfo.getProductCode()); dto.setSpec(rfidInfo.getProductModel()); dto.setProductionState(rfidInfo.getNowProcessId()); List stationNos = new ArrayList<>(); WCSDataDTO wCSDataDTO = null; - for(String machineCode:machineCodes){ + for(String machineCode:machineArray){ wCSDataDTO = new WCSDataDTO(); if(StringUtils.isNotBlank(machineCode)){ wCSDataDTO.setStationNo(machineCode); @@ -104,5 +123,19 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { return dto; } - + public static void main(String args[]){ + String machinecode1 = "[[\"GX01\",\"LG2\"],[\"GX01\",\"LG3\"],[\"GX02\",\"S1\"],[\"GX02\",\"S2\"],[\"GX03\",\"HF01\"],[\"GX04\",\"SPJ01\"]]"; + JSONArray codeArray1 = JSONArray.parseArray(machinecode1); + String[] machineCodes1 = new String[codeArray1.size()]; + for(int c1=0;c1 list1 = Arrays.asList(machinecode0); + List list2 = Arrays.asList(machineCodes1); + List machineArray = list2.stream() + .filter(u1-> list1.contains(u1)) + .collect(Collectors.toList()); + System.out.println(machineArray.toString()); + } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareServiceImpl.java index 145a36bd..0fe86094 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesPrepareServiceImpl.java @@ -14,11 +14,14 @@ import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.web.domain.AjaxResult; import com.op.common.security.utils.SecurityUtils; import com.op.mes.domain.MesPrepareDetail; +import com.op.mes.domain.MesReportWork; import com.op.mes.mapper.MesPrepareDetailMapper; +import com.op.mes.mapper.MesReportWorkMapper; import com.op.system.api.RemoteSapService; import com.op.system.api.RemoteUserService; import com.op.system.api.domain.SysUser; import com.op.system.api.domain.sap.SapMaterialPreparation; +import com.op.system.api.domain.sap.SapRFW; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -46,6 +49,8 @@ public class MesPrepareServiceImpl implements IMesPrepareService { private RemoteUserService remoteUserService; @Autowired private MesPrepareDetailMapper mesPrepareDetailMapper; + @Autowired + private MesReportWorkMapper mesReportWorkMapper; /** * 查询备料单 @@ -216,6 +221,64 @@ public class MesPrepareServiceImpl implements IMesPrepareService { } + @Override + public R reportWorkTask() { + // 加载sf-cloud库的sys_datasource + SysUser sysUser = new SysUser(); + sysUser.setUserId(1L); + R>> dateSources0 = remoteUserService.getPoolNameList(sysUser); + List> dateSources = dateSources0.getData(); + ExecutorService executorService = new ThreadPoolExecutor( + dateSources.size(), + dateSources.size(), + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue()); + try { + dateSources.forEach(dateSource -> { + logger.info("++++++++++++" + dateSource.get("poolName") + "++++报工开始++++++++++"); + Runnable run = () -> reportWorkByFactory(dateSource.get("poolName")); + executorService.execute(run); + }); + } catch (Exception e) { + logger.error("service == deviceOfflineTimingTask == exception", e); + return R.fail("service == deviceOfflineTimingTask == exception"); + } finally { + executorService.shutdown(); + } + return R.ok(true); + } + //报工 + public void reportWorkByFactory(String poolName) { + DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key + MesReportWork mesReportWork = new MesReportWork(); + mesReportWork.setUploadStatus("1");//除了1报工成功的,都需要报工 + List reportWorks = mesReportWorkMapper.getReportWorkList(mesReportWork); + for(MesReportWork work:reportWorks){ + SapRFW sapRFW = new SapRFW(); + sapRFW.setAufnr(work.getWorkorderCodeSap());//虚拟工单号 + sapRFW.setGamng(work.getQuantityFeedback().toString());//报工数量 + SapRFW.lt_gs ltgs = sapRFW.getLt_gs();//生产订单报工工时修改 + ltgs.setConf_activity1(work.getSac1()); + ltgs.setConf_activity2(work.getSac2()); + ltgs.setConf_activity3(work.getSac3()); + ltgs.setConf_activity4(work.getSac4()); + ltgs.setConf_activity5(work.getSac5()); + ltgs.setConf_activity6(work.getSac6()); + SapRFW.lt_hw lthw = sapRFW.getLt_hw();//MES生产订单报工货物移动修改 + lthw.setEntry_qnt(work.getQuantityFeedback().toString()); + lthw.setMaterial(work.getProcessCode()); + R r = remoteSapService.sapRFWOrder(sapRFW); + //上传成功,更改mes_report_work状态 + if(r.getCode() == 200){ + work.setUploadStatus("1"); + }else{ + work.setUploadStatus("2"); + work.setUploadMsg(r.getMsg()); + } + work.setUploadTime(DateUtils.getNowDate()); + mesReportWorkMapper.updateSyncSapStatus(work); + } + } public static void main(String args[]) { List list = new ArrayList<>(); SapMaterialPreparation p1 = new SapMaterialPreparation(); 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 595812c5..e52bed5f 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 @@ -156,8 +156,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and CONVERT(varchar(10),mrw.feedback_time, 120) >= #{productDateStart} and #{productDateEnd} >= CONVERT(varchar(10),mrw.feedback_time, 120) + - + insert into mes_report_work id, @@ -263,6 +282,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time = #{createTime}, update_time = #{updateTime}, update_by = #{updateBy}, + create_time = #{createTime}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where id = #{id} + + + update mes_report_work + + upload_time = #{uploadTime}, + upload_status = #{uploadStatus}, + upload_msg = #{uploadMsg}, where id = #{id} diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml index 136ef686..cc41b14d 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml @@ -70,7 +70,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" rfid.next_process_id nextProcessId, p.equipment machineCode, bp.product_code productCode, - bp.product_model productModel + bp.product_model productModel, + w.prod_line_code prodLineCode from pro_rfid_process_detail rfid left join pro_process p on p.process_id = rfid.next_process_id left join pro_order_workorder w on w.workorder_code = rfid.workorder_code @@ -85,6 +86,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from base_equipment where equipment_code = #{equipmentCode} + insert into pro_rfid_process_detail diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java index 71546200..56880bda 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java @@ -56,7 +56,7 @@ public class QuaController extends BaseController { * 获取【请填写功能名称】详细信息 */ - @GetMapping(value = "getInfoByRfid/{rfid}") + @GetMapping(value = "getInfoByRfid") public AjaxResult getInfo(QcProCheck qcProCheck) { return success(qcProCheckService.getInfoByRfid(qcProCheck)); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/BaseFileMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/BaseFileMapper.java deleted file mode 100644 index 4ea57c8d..00000000 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/BaseFileMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.op.quality.mapper; - -import com.op.common.core.domain.BaseFileData; - -import com.op.quality.domain.BaseFile; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 附件Mapper接口 - * - * @author Open Platform - * @date 2023-07-10 - */ -@Mapper -public interface BaseFileMapper { - /** - * 查询附件 - * - * @param fileId 附件主键 - * @return 附件 - */ - public BaseFile selectBaseFileByFileId(String fileId); - - /** - * 查询附件列表 - * - * @param baseFile 附件 - * @return 附件集合 - */ - public List selectBaseFileList(BaseFile baseFile); - - /** - * 新增附件 - * - * @param baseFile 附件 - * @return 结果 - */ - public int insertBaseFile(BaseFile baseFile); - - /** - * 修改附件 - * - * @param baseFile 附件 - * @return 结果 - */ - public int updateBaseFile(BaseFile baseFile); - - /** - * 删除附件 - * - * @param fileId 附件主键 - * @return 结果 - */ - public int deleteBaseFileByFileId(String fileId); - - /** - * 批量删除附件 - * - * @param fileIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteBaseFileByFileIds(String[] fileIds); - - Boolean insertBaseFileBatch(@Param("baseFiles") List baseFiles); - - List getBaseFileBatch(String processId); - - void deleteBaseFileBySourceId(String processId); -} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java index a422aace..36961fd0 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcProCheckMapper.java @@ -1,8 +1,10 @@ package com.op.quality.mapper; +import com.op.common.core.domain.BaseFileData; import com.op.common.core.domain.R; import com.op.quality.domain.QcProCheck; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -26,4 +28,6 @@ public interface QcProCheckMapper { List selectQcProCheckList(QcProCheck qcProCheck); QcProCheck getInfoByRfid(QcProCheck qcProCheck); + + void insertBaseFileBatch(@Param("baseFiles") List baseFiles); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java index 76ab2667..4e00df54 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java @@ -3,12 +3,10 @@ package com.op.quality.service.serviceImpl; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.BaseFileData; import com.op.common.core.domain.R; -//import com.op.quality.domain.BaseFile; import com.op.common.core.utils.StringUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.QcProCheck; -import com.op.quality.mapper.BaseFileMapper; import com.op.quality.mapper.QcProCheckMapper; import com.op.quality.service.QcProCheckService; import org.springframework.beans.factory.annotation.Autowired; @@ -29,8 +27,6 @@ import java.util.UUID; public class QcProCheckServiceImpl implements QcProCheckService { @Autowired private QcProCheckMapper qcProCheckMapper; - @Autowired - private BaseFileMapper baseFileMapper; @Override public R saveQcProCheck(QcProCheck qcProCheck) { @@ -52,7 +48,7 @@ public class QcProCheckServiceImpl implements QcProCheckService { file.setCreateTime(new Date()); files.add(file); } - baseFileMapper.insertBaseFileBatch(files); + qcProCheckMapper.insertBaseFileBatch(files); } qcProCheckMapper.insertQcProCheck(qcProCheck); diff --git a/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml index 3ae9dba4..c8ac56db 100644 --- a/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml @@ -123,7 +123,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{fileId}, - + + INSERT INTO base_file(file_id, file_name, file_address, source_id, remark, create_by, create_time) + VALUES + + ( + #{baseFile.fileId}, + #{baseFile.fileName}, + #{baseFile.fileAddress}, + #{baseFile.sourceId}, + #{baseFile.remark}, + #{baseFile.createBy}, + #{baseFile.createTime} + ) + + @@ -177,7 +191,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" be.equipment_name machineName, ow.product_code productCode, ow.product_name productName, - ow.product_spc productSpc + ow.product_spc productSpc, + ow.order_code orderCode from pro_rfid_process_detail rfid left join base_equipment be on rfid.machine_code = be.equipment_code left join pro_order_workorder ow on ow.workorder_code = rfid.workorder_code diff --git a/op-modules/op-system/src/main/java/com/op/system/controller/SysUserController.java b/op-modules/op-system/src/main/java/com/op/system/controller/SysUserController.java index 790b2e0b..2fbf3307 100644 --- a/op-modules/op-system/src/main/java/com/op/system/controller/SysUserController.java +++ b/op-modules/op-system/src/main/java/com/op/system/controller/SysUserController.java @@ -180,7 +180,8 @@ public class SysUserController extends BaseController { } @PostMapping("/mobileGetInfo") - public AjaxResult mobileGetInfo(@RequestBody SysUser user) { + public AjaxResult mobileGetInfo(@RequestBody SysUser sysUser) { + SysUser user = userService.selectUserByUserName(sysUser.getUserName()); // 角色集合 Set roles = permissionService.getRolePermission(user); // 权限集合 From 7fefe369ccf34b4a2b8567b10618be0fb8691ca4 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 6 Sep 2023 17:54:14 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=AE=A1=E5=88=92bug=E5=92=8C=E8=B4=A8?= =?UTF-8?q?=E9=87=8Fbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/plan/service/impl/ProOrderServiceImpl.java | 2 +- .../quality/service/serviceImpl/QcProCheckServiceImpl.java | 4 +++- .../src/main/resources/mapper/QcProCheckMapper.xml | 7 ++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 6864aaec..bc9b61fa 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -160,7 +160,7 @@ public class ProOrderServiceImpl implements IProOrderService { setBatch(workBatch, splitOrderDTO.getFormFields(), workOrder.getWorkorderId(), conver); // 如果存在子节点 - if (proOrder.getChildren() != null) { + if (proOrder.getChildren() != null && proOrder.getChildren().size()>0) { ProOrderDTO newProOrder = (ProOrderDTO) proOrder.getChildren().get(0); // 更新换算值 conver = (newProOrder.getQuantity() / quantity); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java index 4e00df54..c0e4f36f 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java @@ -3,6 +3,7 @@ package com.op.quality.service.serviceImpl; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.BaseFileData; import com.op.common.core.domain.R; +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.common.security.utils.SecurityUtils; @@ -50,7 +51,8 @@ public class QcProCheckServiceImpl implements QcProCheckService { } qcProCheckMapper.insertBaseFileBatch(files); } - + qcProCheck.setCreateBy(SecurityUtils.getUsername()); + qcProCheck.setCreateTime(DateUtils.getNowDate()); qcProCheckMapper.insertQcProCheck(qcProCheck); return R.ok(); diff --git a/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml b/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml index c8ac56db..c284628c 100644 --- a/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/QcProCheckMapper.xml @@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,isqua,file_id,attr1,attr2, + select id,rfid,factory_id,factory_code,order_id,machine_id,bad_meg,product_id,isqua,file_id,attr1,attr2, attr3,attr4,create_by,create_time,update_by,update_time,order_code,machine_code, workorder_id,workorder_code,workorder_name,product_code from qc_pro_check @@ -45,13 +45,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - insert into qc_pro_check From ca4b21061c589a8fa062715d845fa18623d89d12 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Thu, 7 Sep 2023 16:12:57 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AE=A1=E5=88=92bug=E5=92=8C=E8=B4=A8?= =?UTF-8?q?=E9=87=8Fbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/domain/sap/SapBaseSupplier.java | 279 +++++++++ .../controller/MesReportWorkController.java | 12 + .../com/op/mes/domain/MesDailyReport.java | 560 ++++++++++++++++++ .../op/mes/mapper/MesReportWorkMapper.java | 5 +- .../op/mes/service/IMesReportWorkService.java | 3 + .../impl/MesReportWorkServiceImpl.java | 7 + .../mapper/mes/MesReportWorkMapper.xml | 24 + 7 files changed, 889 insertions(+), 1 deletion(-) create mode 100644 op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseSupplier.java create mode 100644 op-modules/op-mes/src/main/java/com/op/mes/domain/MesDailyReport.java diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseSupplier.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseSupplier.java new file mode 100644 index 00000000..d9c56985 --- /dev/null +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/sap/SapBaseSupplier.java @@ -0,0 +1,279 @@ +package com.op.system.api.domain.sap; + +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 供应商管理对象 base_supplier + * + * @author Open Platform + * @date 2023-07-18 + */ +public class SapBaseSupplier extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键uuid */ + private String supplierId; + + /** 供应商代码 */ + @Excel(name = "供应商代码") + private String supplierCode; + + /** 中文描述 */ + @Excel(name = "中文描述") + private String zhDesc; + + /** 英文描述 */ + @Excel(name = "英文描述") + private String enDesc; + + /** 供应商类型 */ + @Excel(name = "供应商类型") + private String supplierType; + + /** 账号 */ + @Excel(name = "账号") + private String accountNumber; + + /** 证照编码 */ + @Excel(name = "证照编码") + private String licenceNumber; + + /** 经营范围 */ + @Excel(name = "经营范围") + private String businessScope; + + /** 省 */ + @Excel(name = "省") + private String province; + + /** 市 */ + @Excel(name = "市") + private String city; + + /** 区 */ + @Excel(name = "区") + private String area; + + /** 详细地址 */ + @Excel(name = "详细地址") + private String address; + + /** 邮编 */ + @Excel(name = "邮编") + private String postcode; + + /** 联系人 */ + @Excel(name = "联系人") + private String contact; + + /** 联系人电话 */ + @Excel(name = "联系人电话") + private String contactPhone; + + /** 联系人职务 */ + @Excel(name = "联系人职务") + private String contactPosition; + + /** 联系人电子邮件 */ + @Excel(name = "联系人电子邮件") + private String contactEmail; + + /** 激活标记 */ + @Excel(name = "激活标记") + private String activeFlag; + + /** 用户自定义1--国家 */ + @Excel(name = "用户自定义1--国家") + private String userDefined1; + + /** 用户自定义2--税号 */ + @Excel(name = "用户自定义2--税号") + private String userDefined2; + + /** 用户自定义3 */ + @Excel(name = "用户自定义3") + private String userDefined3; + + public void setSupplierId(String supplierId) { + this.supplierId = supplierId; + } + + public String getSupplierId() { + return supplierId; + } + public void setSupplierCode(String supplierCode) { + this.supplierCode = supplierCode; + } + + public String getSupplierCode() { + return supplierCode; + } + public void setZhDesc(String zhDesc) { + this.zhDesc = zhDesc; + } + + public String getZhDesc() { + return zhDesc; + } + public void setEnDesc(String enDesc) { + this.enDesc = enDesc; + } + + public String getEnDesc() { + return enDesc; + } + public void setSupplierType(String supplierType) { + this.supplierType = supplierType; + } + + public String getSupplierType() { + return supplierType; + } + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + public String getAccountNumber() { + return accountNumber; + } + public void setLicenceNumber(String licenceNumber) { + this.licenceNumber = licenceNumber; + } + + public String getLicenceNumber() { + return licenceNumber; + } + public void setBusinessScope(String businessScope) { + this.businessScope = businessScope; + } + + public String getBusinessScope() { + return businessScope; + } + public void setProvince(String province) { + this.province = province; + } + + public String getProvince() { + return province; + } + public void setCity(String city) { + this.city = city; + } + + public String getCity() { + return city; + } + public void setArea(String area) { + this.area = area; + } + + public String getArea() { + return area; + } + public void setAddress(String address) { + this.address = address; + } + + public String getAddress() { + return address; + } + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + public String getPostcode() { + return postcode; + } + public void setContact(String contact) { + this.contact = contact; + } + + public String getContact() { + return contact; + } + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getContactPhone() { + return contactPhone; + } + public void setContactPosition(String contactPosition) { + this.contactPosition = contactPosition; + } + + public String getContactPosition() { + return contactPosition; + } + public void setContactEmail(String contactEmail) { + this.contactEmail = contactEmail; + } + + public String getContactEmail() { + return contactEmail; + } + public void setActiveFlag(String activeFlag) { + this.activeFlag = activeFlag; + } + + public String getActiveFlag() { + return activeFlag; + } + public void setUserDefined1(String userDefined1) { + this.userDefined1 = userDefined1; + } + + public String getUserDefined1() { + return userDefined1; + } + public void setUserDefined2(String userDefined2) { + this.userDefined2 = userDefined2; + } + + public String getUserDefined2() { + return userDefined2; + } + public void setUserDefined3(String userDefined3) { + this.userDefined3 = userDefined3; + } + + public String getUserDefined3() { + return userDefined3; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("supplierId", getSupplierId()) + .append("supplierCode", getSupplierCode()) + .append("zhDesc", getZhDesc()) + .append("enDesc", getEnDesc()) + .append("supplierType", getSupplierType()) + .append("accountNumber", getAccountNumber()) + .append("licenceNumber", getLicenceNumber()) + .append("businessScope", getBusinessScope()) + .append("province", getProvince()) + .append("city", getCity()) + .append("area", getArea()) + .append("address", getAddress()) + .append("postcode", getPostcode()) + .append("contact", getContact()) + .append("contactPhone", getContactPhone()) + .append("contactPosition", getContactPosition()) + .append("contactEmail", getContactEmail()) + .append("activeFlag", getActiveFlag()) + .append("userDefined1", getUserDefined1()) + .append("userDefined2", getUserDefined2()) + .append("userDefined3", getUserDefined3()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} 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 ef171e3d..81e0dadc 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 @@ -4,6 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.op.common.core.utils.uuid.IdUtils; +import com.op.mes.domain.MesDailyReport; import com.op.mes.domain.MesProcessReport; import com.op.mes.domain.MesReportProduction; import org.springframework.beans.factory.annotation.Autowired; @@ -146,6 +147,17 @@ public class MesReportWorkController extends BaseController { ExcelUtil util = new ExcelUtil(MesReportProduction.class); util.exportExcel(response, list, "工单各工序完成数据"); } + + /** + * 获取产量报表 + */ + @RequiresPermissions("mes:production:list") + @GetMapping("/getDailyReport") + public TableDataInfo getDailyReport(MesDailyReport mesDailyReport) { + startPage(); + List list = mesReportWorkService.getDailyReport(mesDailyReport); + return getDataTable(list); + } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesDailyReport.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesDailyReport.java new file mode 100644 index 00000000..d56cffaf --- /dev/null +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesDailyReport.java @@ -0,0 +1,560 @@ +package com.op.mes.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 报工报表对象 mes_report_work + * + * @author Open Platform + * @date 2023-08-24 + */ +public class MesDailyReport extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 记录id */ + private String id; + + /** 报工类型,报工类型:SELF自行报工、UNI统一报工 */ + @Excel(name = "报工类型,报工类型:SELF自行报工、UNI统一报工") + private String reportType; + + /** 报工单编号 */ + @Excel(name = "报工单编号") + private String reportCode; + + /** 生产工单编码 */ + @Excel(name = "生产工单编码") + private String workorderCode; + + /** 产品编码 */ + @Excel(name = "产品编码") + private String productCode; + + /** 产品名称 */ + @Excel(name = "产品名称") + private String productName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String spec; + + /** 单位 */ + @Excel(name = "单位") + private String unit; + + /** 排产数量 */ + @Excel(name = "排产数量") + private BigDecimal quantity; + + /** 本次报工数量 */ + @Excel(name = "本次报工数量") + private BigDecimal quantityFeedback; + + /** 合格数量 */ + @Excel(name = "合格数量") + private BigDecimal quantityQualified; + + /** 不合格数量 */ + @Excel(name = "不合格数量") + private BigDecimal quantityUnqualified; + + /** 报工人员 */ + @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; + + /** 录入人员 */ + @Excel(name = "录入人员") + private String recordUser; + + /** 状态 */ + @Excel(name = "状态") + private String status; + + /** 工时 */ + @Excel(name = "工时") + private Long workTime; + + /** 线体编码 */ + @Excel(name = "线体编码") + private String machineCode; + + /** 线体名称 */ + @Excel(name = "线体名称") + private String machineName; + + /** 班组编码 */ + @Excel(name = "班组编码") + private String teamCode; + + /** 班次编码 */ + @Excel(name = "班次编码") + private String shiftCode; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + + /** 预留字段4 */ + @Excel(name = "预留字段4") + private String attr4; + @Excel(name = "计划生产日期") + private String productDate; + private String productDateStart; + private String productDateEnd; + @Excel(name = "订单编号") + private String orderCode; + @Excel(name = "规格型号") + private String productSpc; + @Excel(name = "工序名称") + private String processName; + @Excel(name = "工序编码") + private String processCode; + private String factoryCode; + private String factoryName; + private String carCode; + private String carName; + private Date uploadTime; + private String uploadStatus; + private String uploadMsg; + private String workorderCodeSap; + private String routeCode; + private String sac1; + private String sac2; + private String sac3; + private String sac4; + private String sac5; + private String sac6; + + public String getWorkorderCodeSap() { + return workorderCodeSap; + } + + public void setWorkorderCodeSap(String workorderCodeSap) { + this.workorderCodeSap = workorderCodeSap; + } + + public String getRouteCode() { + return routeCode; + } + + public void setRouteCode(String routeCode) { + this.routeCode = routeCode; + } + + public String getSac1() { + return sac1; + } + + public void setSac1(String sac1) { + this.sac1 = sac1; + } + + public String getSac2() { + return sac2; + } + + public void setSac2(String sac2) { + this.sac2 = sac2; + } + + public String getSac3() { + return sac3; + } + + public void setSac3(String sac3) { + this.sac3 = sac3; + } + + public String getSac4() { + return sac4; + } + + public void setSac4(String sac4) { + this.sac4 = sac4; + } + + public String getSac5() { + return sac5; + } + + public void setSac5(String sac5) { + this.sac5 = sac5; + } + + public String getSac6() { + return sac6; + } + + public void setSac6(String sac6) { + this.sac6 = sac6; + } + + public Date getUploadTime() { + return uploadTime; + } + + public void setUploadTime(Date uploadTime) { + this.uploadTime = uploadTime; + } + + public String getUploadStatus() { + return uploadStatus; + } + + public void setUploadStatus(String uploadStatus) { + this.uploadStatus = uploadStatus; + } + + public String getUploadMsg() { + return uploadMsg; + } + + public void setUploadMsg(String uploadMsg) { + this.uploadMsg = uploadMsg; + } + + public String getFactoryCode() { + return factoryCode; + } + + public void setFactoryCode(String factoryCode) { + this.factoryCode = factoryCode; + } + + public String getFactoryName() { + return factoryName; + } + + public void setFactoryName(String factoryName) { + this.factoryName = factoryName; + } + + public String getCarCode() { + return carCode; + } + + public void setCarCode(String carCode) { + this.carCode = carCode; + } + + public String getCarName() { + return carName; + } + + public void setCarName(String carName) { + this.carName = carName; + } + + public String getProcessCode() { + return processCode; + } + + public void setProcessCode(String processCode) { + this.processCode = processCode; + } + + public String getProductDateStart() { + return productDateStart; + } + + public void setProductDateStart(String productDateStart) { + this.productDateStart = productDateStart; + } + + public String getProductDateEnd() { + return productDateEnd; + } + + public void setProductDateEnd(String productDateEnd) { + this.productDateEnd = productDateEnd; + } + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public void setReportType(String reportType) { + this.reportType = reportType; + } + public String getReportType() { + return reportType; + } + + public void setReportCode(String reportCode) { + this.reportCode = reportCode; + } + public String getReportCode() { + return reportCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } + + public String getWorkorderCode() { + return workorderCode; + } + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductCode() { + return productCode; + } + public void setProductName(String productName) { + this.productName = productName; + } + + public String getProductName() { + return productName; + } + public void setSpec(String spec) { + this.spec = spec; + } + + public String getSpec() { + return spec; + } + public void setUnit(String unit) { + this.unit = unit; + } + + public String getUnit() { + return unit; + } + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + + public BigDecimal getQuantity() { + return quantity; + } + public void setQuantityFeedback(BigDecimal quantityFeedback) { + this.quantityFeedback = quantityFeedback; + } + + public BigDecimal getQuantityFeedback() { + return quantityFeedback; + } + public void setQuantityQualified(BigDecimal quantityQualified) { + this.quantityQualified = quantityQualified; + } + + public BigDecimal getQuantityQualified() { + return quantityQualified; + } + public void setQuantityUnqualified(BigDecimal quantityUnqualified) { + this.quantityUnqualified = quantityUnqualified; + } + + public BigDecimal getQuantityUnqualified() { + return quantityUnqualified; + } + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserName() { + return userName; + } + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getNickName() { + return nickName; + } + public void setFeedbackChannel(String feedbackChannel) { + this.feedbackChannel = feedbackChannel; + } + + public String getFeedbackChannel() { + return feedbackChannel; + } + public void setFeedbackTime(Date feedbackTime) { + this.feedbackTime = feedbackTime; + } + + public Date getFeedbackTime() { + return feedbackTime; + } + public void setRecordUser(String recordUser) { + this.recordUser = recordUser; + } + + public String getRecordUser() { + return recordUser; + } + public void setStatus(String status) { + this.status = status; + } + + public String getStatus() { + return status; + } + public void setWorkTime(Long workTime) { + this.workTime = workTime; + } + + public Long getWorkTime() { + return workTime; + } + public void setMachineCode(String machineCode) { + this.machineCode = machineCode; + } + + public String getMachineCode() { + return machineCode; + } + public void setMachineName(String machineName) { + this.machineName = machineName; + } + + public String getMachineName() { + return machineName; + } + public void setTeamCode(String teamCode) { + this.teamCode = teamCode; + } + + public String getTeamCode() { + return teamCode; + } + public void setShiftCode(String shiftCode) { + this.shiftCode = shiftCode; + } + + public String getShiftCode() { + return shiftCode; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + public void setAttr4(String attr4) { + this.attr4 = attr4; + } + + public String getAttr4() { + return attr4; + } + + public String getProductDate() { + return productDate; + } + + public void setProductDate(String productDate) { + this.productDate = productDate; + } + + public String getOrderCode() { + return orderCode; + } + + public void setOrderCode(String orderCode) { + this.orderCode = orderCode; + } + + public String getProductSpc() { + return productSpc; + } + + public void setProductSpc(String productSpc) { + this.productSpc = productSpc; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("reportType", getReportType()) + .append("reportCode", getReportCode()) + .append("workorderCode", getWorkorderCode()) + .append("productCode", getProductCode()) + .append("productName", getProductName()) + .append("spec", getSpec()) + .append("unit", getUnit()) + .append("quantity", getQuantity()) + .append("quantityFeedback", getQuantityFeedback()) + .append("quantityQualified", getQuantityQualified()) + .append("quantityUnqualified", getQuantityUnqualified()) + .append("userName", getUserName()) + .append("nickName", getNickName()) + .append("feedbackChannel", getFeedbackChannel()) + .append("feedbackTime", getFeedbackTime()) + .append("recordUser", getRecordUser()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("workTime", getWorkTime()) + .append("machineCode", getMachineCode()) + .append("machineName", getMachineName()) + .append("teamCode", getTeamCode()) + .append("shiftCode", getShiftCode()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .toString(); + } +} 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 bafd6fb3..7a665776 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 @@ -2,6 +2,7 @@ package com.op.mes.mapper; import java.util.List; +import com.op.mes.domain.MesDailyReport; import com.op.mes.domain.MesProcessReport; import com.op.mes.domain.MesReportProduction; import com.op.mes.domain.MesReportWork; @@ -67,5 +68,7 @@ public interface MesReportWorkMapper { public List getReportWorkList(MesReportWork mesReportWork); - void updateSyncSapStatus(MesReportWork work); + public void updateSyncSapStatus(MesReportWork work); + + public List getDailyReport(MesDailyReport mesDailyReport); } 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 f1eebbf0..34cf877e 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 @@ -2,6 +2,7 @@ package com.op.mes.service; import java.util.List; +import com.op.mes.domain.MesDailyReport; import com.op.mes.domain.MesProcessReport; import com.op.mes.domain.MesReportProduction; import com.op.mes.domain.MesReportWork; @@ -64,4 +65,6 @@ public interface IMesReportWorkService { public List getProcessFinishList(MesProcessReport mesReportWork); public List getProductionList(MesReportProduction mesReportProduction); + + public List getDailyReport(MesDailyReport mesDailyReport); } 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 03d9e4f4..0332de5d 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 @@ -6,6 +6,7 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; +import com.op.mes.domain.MesDailyReport; import com.op.mes.domain.MesProcessReport; import com.op.mes.domain.MesReportProduction; import org.springframework.beans.factory.annotation.Autowired; @@ -166,4 +167,10 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return mesReportWorkMapper.getProductionList(mesReportProduction); } + @Override + @DS("#header.poolName") + public List getDailyReport(MesDailyReport mesDailyReport) { + return mesReportWorkMapper.getDailyReport(mesDailyReport); + } + } 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 e52bed5f..c04358b3 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 @@ -175,6 +175,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where mrw.upload_status != #{uploadStatus} order by mrw.create_time + insert into mes_report_work From 736f72f4aff0f61b7618078fcde6c820d1dff813 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Thu, 7 Sep 2023 16:44:59 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E8=B7=AF=E7=BA=BF-BOM?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProProcessController.java | 9 +-- .../technology/mapper/ProProcessMapper.java | 3 +- .../service/IProProcessService.java | 3 +- .../service/impl/ProProcessServiceImpl.java | 11 ++- .../mapper/technology/ProProcessMapper.xml | 72 ++++++++----------- 5 files changed, 44 insertions(+), 54 deletions(-) diff --git a/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java b/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java index a2c53cd7..7e2a5909 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/controller/ProProcessController.java @@ -11,6 +11,7 @@ import com.op.common.log.annotation.Log; import com.op.common.log.enums.BusinessType; import com.op.common.security.annotation.RequiresPermissions; import com.op.technology.domain.Bom; +import com.op.technology.domain.BomComponent; import com.op.technology.domain.ProProcess; import com.op.technology.domain.Equipment; import com.op.technology.service.IProProcessService; @@ -153,11 +154,11 @@ public class ProProcessController extends BaseController { /** * 查询BOM物料管理列表 */ - @RequiresPermissions("mes:pro:process:bomList") - @GetMapping("/bomList") - public TableDataInfo bomList(Bom bom) { + @RequiresPermissions("mes:pro:process:bomComponentList") + @GetMapping("/bomComponentList") + public TableDataInfo selectBaseBomComponentList(BomComponent bomComponent) { startPage(); - List list = proProcessService.selectBomList(bom); + List list = proProcessService.selectBaseBomComponentList(bomComponent); return getDataTable(list); } } diff --git a/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java b/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java index 8b76b587..74279eb7 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/mapper/ProProcessMapper.java @@ -1,6 +1,7 @@ package com.op.technology.mapper; import com.op.technology.domain.Bom; +import com.op.technology.domain.BomComponent; import com.op.technology.domain.Equipment; import com.op.technology.domain.ProProcess; import org.apache.ibatis.annotations.Mapper; @@ -71,5 +72,5 @@ public interface ProProcessMapper List selectEquipmentList(Equipment equipment); Equipment selectEquipmentByEquipmentId(Long equipmentId); - List selectBomList(Bom bom); + List selectBaseBomComponentList(BomComponent bomComponent); } diff --git a/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java b/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java index 51a4250e..70e5b86f 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/service/IProProcessService.java @@ -1,6 +1,7 @@ package com.op.technology.service; import com.op.technology.domain.Bom; +import com.op.technology.domain.BomComponent; import com.op.technology.domain.Equipment; import com.op.technology.domain.ProProcess; @@ -72,5 +73,5 @@ public interface IProProcessService public Equipment selectEquipmentByEquipmentId(Long equipmentId); - public List selectBomList(Bom bom); + public List selectBaseBomComponentList(BomComponent bomComponent); } diff --git a/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java b/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java index 69b62355..3b1abc02 100644 --- a/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java +++ b/op-modules/op-technology/src/main/java/com/op/technology/service/impl/ProProcessServiceImpl.java @@ -7,10 +7,7 @@ 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.common.security.utils.SecurityUtils; -import com.op.technology.domain.BaseFile; -import com.op.technology.domain.Bom; -import com.op.technology.domain.Equipment; -import com.op.technology.domain.ProProcess; +import com.op.technology.domain.*; import com.op.technology.mapper.BaseFileMapper; import com.op.technology.mapper.ProProcessMapper; import com.op.technology.service.IProProcessService; @@ -216,13 +213,13 @@ public class ProProcessServiceImpl implements IProProcessService { /** * 查询BOM物料管理列表 * - * @param bom BOM物料管理 + * @param bomComponent BOM物料管理 * @return BOM物料管理 */ @Override @DS("#header.poolName") - public List selectBomList(Bom bom) { - return proProcessMapper.selectBomList(bom); + public List selectBaseBomComponentList(BomComponent bomComponent) { + return proProcessMapper.selectBaseBomComponentList(bomComponent); } } diff --git a/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml b/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml index 083e7fb6..1a445283 100644 --- a/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml +++ b/op-modules/op-technology/src/main/resources/mapper/technology/ProProcessMapper.xml @@ -1,7 +1,7 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> @@ -65,18 +65,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - + + - - - - - - - - + + + + + + + + + + + @@ -89,7 +91,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - @@ -123,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where process_id = #{processId} - select top 1 process_id, process_code, process_name, attention, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_process @@ -170,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" param8, param9, param10, - + #{processId}, #{processCode}, @@ -202,7 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{param8}, #{param9}, #{param10}, - + @@ -267,29 +268,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + From 2ca3d7842de009171eb05405d6b8a95a9fab8ea6 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Thu, 7 Sep 2023 16:46:28 +0800 Subject: [PATCH 5/5] BOM --- .../op/technology/domain/BomComponent.java | 279 ++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java diff --git a/op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java b/op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java new file mode 100644 index 00000000..06de88ff --- /dev/null +++ b/op-modules/op-technology/src/main/java/com/op/technology/domain/BomComponent.java @@ -0,0 +1,279 @@ +package com.op.technology.domain; + +import com.op.common.core.annotation.Excel; +import com.op.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +import java.util.List; + +/** + * 物料BOM子表对象 base_bom_component + * + * @author Open Platform + * @date 2023-08-04 + */ +public class BomComponent extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** 主键 */ + private String handle; + + /** BOM单号 */ + @Excel(name = "BOM单号") + private String bomCode; + + private String bomName; + + /** 工厂/站点 */ + @Excel(name = "工厂/站点") + private String site; + + /** 物料编码 */ + @Excel(name = "物料编码") + private String productCode; + + /** 组件上层物料编码 */ + @Excel(name = "组件上层物料编码") + private String cumc; + + /** 组件编码 */ + @Excel(name = "组件编码") + private String component; + + /** BOM层次 */ + @Excel(name = "BOM层次") + private String bomHierarchy; + + /** 项目编号 */ + @Excel(name = "项目编号") + private String projectNo; + + /** 标准用量 */ + @Excel(name = "标准用量") + private Long standardDosage; + + /** 损耗率 */ + @Excel(name = "损耗率") + private Long lossRate; + + /** 损耗额 */ + @Excel(name = "损耗额") + private Long lossAmount; + + /** 含损耗用量 */ + @Excel(name = "含损耗用量") + private Long cilosses; + + /** 组件数量单位 */ + @Excel(name = "组件数量单位") + private String componentUnit; + + /** 组件采购标志 */ + @Excel(name = "组件采购标志") + private String componentProFlag; + + /** 物料供应标识 */ + @Excel(name = "物料供应标识") + private String msi; + + /** 成本核算标识相关 */ + @Excel(name = "成本核算标识相关") + private String sanka; + + /** 预留字段1 */ + @Excel(name = "预留字段1") + private String attr1; + + /** 预留字段2 */ + @Excel(name = "预留字段2") + private String attr2; + + /** 预留字段3 */ + @Excel(name = "预留字段3") + private String attr3; + +// private List children; +// +// public List getChildren() { +// return children; +// } +// +// public void setChildren(List children) { +// this.children = children; +// } + + public void setHandle(String handle) { + this.handle = handle; + } + + public String getHandle() { + return handle; + } + public void setBomCode(String bomCode) { + this.bomCode = bomCode; + } + + public String getBomCode() { + return bomCode; + } + + public void setBomName(String bomName) { + this.bomName = bomName; + } + + public String getBomName() { + return bomName; + } + + public void setSite(String site) { + this.site = site; + } + + public String getSite() { + return site; + } + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + public String getProductCode() { + return productCode; + } + public void setCumc(String cumc) { + this.cumc = cumc; + } + + public String getCumc() { + return cumc; + } + public void setComponent(String component) { + this.component = component; + } + + public String getComponent() { + return component; + } + public void setBomHierarchy(String bomHierarchy) { + this.bomHierarchy = bomHierarchy; + } + + public String getBomHierarchy() { + return bomHierarchy; + } + public void setProjectNo(String projectNo) { + this.projectNo = projectNo; + } + + public String getProjectNo() { + return projectNo; + } + public void setStandardDosage(Long standardDosage) { + this.standardDosage = standardDosage; + } + + public Long getStandardDosage() { + return standardDosage; + } + public void setLossRate(Long lossRate) { + this.lossRate = lossRate; + } + + public Long getLossRate() { + return lossRate; + } + public void setLossAmount(Long lossAmount) { + this.lossAmount = lossAmount; + } + + public Long getLossAmount() { + return lossAmount; + } + public void setCilosses(Long cilosses) { + this.cilosses = cilosses; + } + + public Long getCilosses() { + return cilosses; + } + public void setComponentUnit(String componentUnit) { + this.componentUnit = componentUnit; + } + + public String getComponentUnit() { + return componentUnit; + } + public void setComponentProFlag(String componentProFlag) { + this.componentProFlag = componentProFlag; + } + + public String getComponentProFlag() { + return componentProFlag; + } + public void setMsi(String msi) { + this.msi = msi; + } + + public String getMsi() { + return msi; + } + public void setSanka(String sanka) { + this.sanka = sanka; + } + + public String getSanka() { + return sanka; + } + public void setAttr1(String attr1) { + this.attr1 = attr1; + } + + public String getAttr1() { + return attr1; + } + public void setAttr2(String attr2) { + this.attr2 = attr2; + } + + public String getAttr2() { + return attr2; + } + public void setAttr3(String attr3) { + this.attr3 = attr3; + } + + public String getAttr3() { + return attr3; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("handle", getHandle()) + .append("bomCode", getBomCode()) + .append("bomName", getBomName()) + .append("site", getSite()) + .append("productCode", getProductCode()) + .append("cumc", getCumc()) + .append("component", getComponent()) + .append("bomHierarchy", getBomHierarchy()) + .append("projectNo", getProjectNo()) + .append("standardDosage", getStandardDosage()) + .append("lossRate", getLossRate()) + .append("lossAmount", getLossAmount()) + .append("cilosses", getCilosses()) + .append("componentUnit", getComponentUnit()) + .append("componentProFlag", getComponentProFlag()) + .append("msi", getMsi()) + .append("sanka", getSanka()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +}