From b9f18e997f757ce95ce9f21537f0d94adff50d71 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Fri, 1 Dec 2023 17:22:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20MES=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/config/lucene/LogMessageConstant.java | 2 +- .../service/dao/MonthlyWorkOrderVo.java | 17 ++ .../service/impl/CockpitServiceImpl.java | 18 +- .../cockpit/service/mapper/CockPitMapper.java | 9 +- .../cockpit/service/mapper/CockPitMapper.xml | 9 + .../MdBaseClassstandardController.java | 7 + .../service/IMdBaseClassstandardService.java | 2 + .../impl/MdBaseClassstandardServiceImpl.java | 15 + .../acs/service/impl/AcsToWmsServiceImpl.java | 10 +- .../mes/controller/WmsToMesController.java | 48 ++++ .../wms/ext/mes/service/WmsToMesService.java | 16 +- .../service/dao/mapper/MesRequestMapper.java | 13 + .../service/dao/mapper/MesRequestMapper.xml | 36 ++- .../nl/wms/ext/mes/service/dto/ScrapDto.java | 23 ++ .../wms/ext/mes/service/dto/ScrapQuery.java | 14 + .../mes/service/dto/SemiProductGXPFDo.java | 53 ++++ .../mes/service/impl/WmsToMesServiceImpl.java | 81 +++++- .../nl/wms/pda/controller/PdaController.java | 4 +- .../wms/pda/service/impl/PdaServiceImpl.java | 2 + .../classification/mdBaseClassstandard.js | 10 +- .../src/views/wms/pdm/scrap/index.vue | 271 ++++++++++++++++++ .../src/views/wms/pdm/scrap/scrap.js | 10 + 22 files changed, 634 insertions(+), 36 deletions(-) create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/dao/MonthlyWorkOrderVo.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/controller/WmsToMesController.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapDto.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapQuery.java create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SemiProductGXPFDo.java create mode 100644 lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue create mode 100644 lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java index c2fc8e5..14ddcca 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java @@ -41,6 +41,6 @@ public class LogMessageConstant { /** 背景颜色:黄色 */ public final static String BACKGROUND_YELLOW = "\u001B[43m"; /** 索引路径 */ - public final static String INDEX_DIR = "D:\\lucene\\index"; + public final static String INDEX_DIR = "E:\\lucene\\index"; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/dao/MonthlyWorkOrderVo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/dao/MonthlyWorkOrderVo.java new file mode 100644 index 0000000..a1e87eb --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/dao/MonthlyWorkOrderVo.java @@ -0,0 +1,17 @@ +package org.nl.wms.cockpit.service.dao; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/11/30 + */ +@Data +public class MonthlyWorkOrderVo { + private String name; + private Long order_num; + private Long guada_num; + private Long residue_num; // 剩余 + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java index 436b3a6..6b17a37 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java @@ -3,10 +3,7 @@ package org.nl.wms.cockpit.service.impl; import lombok.extern.slf4j.Slf4j; import org.nl.config.thread.ThreadPoolExecutorUtil; import org.nl.wms.cockpit.service.CockpitService; -import org.nl.wms.cockpit.service.dao.PersonnelMonthlyProductionVo; -import org.nl.wms.cockpit.service.dao.PressProductHeaderVo; -import org.nl.wms.cockpit.service.dao.ProductTaskVo; -import org.nl.wms.cockpit.service.dao.ShiftProductionVo; +import org.nl.wms.cockpit.service.dao.*; import org.nl.wms.cockpit.service.mapper.CockPitMapper; import org.nl.wms.util.CommonUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -73,12 +70,23 @@ public class CockpitServiceImpl implements CockpitService { map.put("ProductionTask", null); return null; }); + // 5、当月工单 + CompletableFuture> monthlyWorkOrderFuture = CompletableFuture.supplyAsync( + () -> cockPitMapper.getMonthlyWorkOrderFutureList(), pool); + monthlyWorkOrderFuture.thenAccept(result -> { + map.put("MonthlyWorkOrder", result); + }).exceptionally((e) -> { + log.error("当月工单: {}", e.getMessage(), e); + map.put("MonthlyWorkOrder", null); + return null; + }); // 提交 CompletableFuture allQuery = CompletableFuture.allOf( listCompletableFuture, listShiftProductionFuture, listPersonnelMonthlyProductionFuture, - listProductionTaskFuture); + listProductionTaskFuture, + monthlyWorkOrderFuture); CompletableFuture> future = allQuery.thenApply((result) -> map).exceptionally((e) -> { log.error(e.getMessage(), e); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java index 020ccf6..30aee37 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.java @@ -1,9 +1,7 @@ package org.nl.wms.cockpit.service.mapper; -import org.nl.wms.cockpit.service.dao.PersonnelMonthlyProductionVo; -import org.nl.wms.cockpit.service.dao.PressProductHeaderVo; -import org.nl.wms.cockpit.service.dao.ProductTaskVo; -import org.nl.wms.cockpit.service.dao.ShiftProductionVo; +import com.baomidou.dynamic.datasource.annotation.DS; +import org.nl.wms.cockpit.service.dao.*; import java.util.List; @@ -25,4 +23,7 @@ public interface CockPitMapper { List getPersonnelMonthlyProductionList(String dayShift); List getProductionTaskList(); + + @DS("oracle") + List getMonthlyWorkOrderFutureList(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml index 70bed48..34b03e7 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockPitMapper.xml @@ -67,4 +67,13 @@ WHERE w.region_code = 'YZ' ORDER BY w.team DESC, w.workorder_status + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/controller/MdBaseClassstandardController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/controller/MdBaseClassstandardController.java index 9b8acf9..10e16ac 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/controller/MdBaseClassstandardController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/controller/MdBaseClassstandardController.java @@ -89,5 +89,12 @@ public class MdBaseClassstandardController { ArrayList list = mdBaseClassstandardService.getSuperior(classstandard, new ArrayList<>()); return new ResponseEntity<>(mdBaseClassstandardService.buildTree(list), HttpStatus.OK); } + + @PostMapping("/getClassByCode") + @Log("根据编码获取分类名称下拉框") + @ApiOperation("根据编码获取分类名称下拉框") + public ResponseEntity getClassByCode(@RequestBody String code) { + return new ResponseEntity<>(mdBaseClassstandardService.getClassByCode(code), HttpStatus.OK); + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/IMdBaseClassstandardService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/IMdBaseClassstandardService.java index 7081151..d05f052 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/IMdBaseClassstandardService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/IMdBaseClassstandardService.java @@ -69,4 +69,6 @@ public interface IMdBaseClassstandardService extends IService buildTree(ArrayList list); + + List getClassByCode(String code); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/impl/MdBaseClassstandardServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/impl/MdBaseClassstandardServiceImpl.java index 44ef614..8e7d54e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/impl/MdBaseClassstandardServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/classification/service/impl/MdBaseClassstandardServiceImpl.java @@ -63,6 +63,7 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl() .eq(MdBaseClassstandard::getClass_code, entity.getClass_code()) + .eq(MdBaseClassstandard::getParent_class_id, entity.getParent_class_id()) .eq(MdBaseClassstandard::getIs_delete, false)); if (ObjectUtil.isNotEmpty(mdBaseClassstandard) && !mdBaseClassstandard.getClass_id().equals(entity.getClass_id())) { throw new BadRequestException("存在相同的基础类别编号"); @@ -245,4 +246,18 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl getClassByCode(String code) { + // 获取父类 + MdBaseClassstandard fpType = mdBaseClassstandardMapper.selectOne(new LambdaQueryWrapper() + .eq(MdBaseClassstandard::getClass_code, "fp_type") + .eq(MdBaseClassstandard::getParent_class_id, "0")); + MdBaseClassstandard parentClass = mdBaseClassstandardMapper.selectOne(new LambdaQueryWrapper() + .eq(MdBaseClassstandard::getClass_code, code) + .eq(MdBaseClassstandard::getParent_class_id, fpType.getClass_id())); + return mdBaseClassstandardMapper.selectList(new LambdaQueryWrapper() + .eq(MdBaseClassstandard::getParent_class_id, parentClass.getClass_id()) + .eq(MdBaseClassstandard::getIs_delete, false)); + } + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 28c5e08..2f0199b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -517,10 +517,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { mesPackDto.setBATCHNO(ObjectUtil.isNotEmpty(groupInfo.getPcsn()) ? groupInfo.getPcsn() : DateUtil.format(DateUtil.date(), "yyyyMMdd")); mesPackDto.setTRAY_NO(groupInfo.getVehicle_code()); - mesPackDto.setPRO_NUM(BigDecimal.valueOf(groupInfo.getMaterial_qty())); - mesPackDto.setPRO_UNIT("块"); - mesPackDto.setPRO_SUBNUM(multiply); - mesPackDto.setPRO_SUBUNIT("吨"); + mesPackDto.setPRO_NUM(multiply); + mesPackDto.setPRO_UNIT("吨"); + mesPackDto.setPRO_SUBNUM(BigDecimal.valueOf(groupInfo.getMaterial_qty())); + mesPackDto.setPRO_SUBUNIT("块"); mesPackDto.setMATERIAL_ID(groupInfo.getMaterial_id()); mesPackDto.setMATERIAL_NAME(baseMaterial.getMaterial_name()); mesPackDto.setPROSPEC(baseMaterial.getMaterial_spec()); @@ -749,7 +749,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { throw new BadRequestException("入窑失败:载具[" + baseRequest.getVehicle_code() + "]组盘信息不存在!"); } // 记录入窑数据给MES - wmsToMesService.reportGdyMaterialInfoIn(groupInfo.getGroup_id()); groupInfo.setInto_kiln_time(DateUtil.now()); if (ObjectUtil.isNotEmpty(basePoint)) { // 记录当前位置 @@ -759,6 +758,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } TaskUtils.setGroupUpdateByAcs(groupInfo); vehiclematerialgroupService.updateById(groupInfo); + wmsToMesService.reportGdyMaterialInfoIn(groupInfo); // 插入生产过程跟踪表 PdmBdProductionProcessTracking processTracking = new PdmBdProductionProcessTracking(); processTracking.setBuss_move_id(groupInfo.getBuss_move_id()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/controller/WmsToMesController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/controller/WmsToMesController.java new file mode 100644 index 0000000..7829ea3 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/controller/WmsToMesController.java @@ -0,0 +1,48 @@ +package org.nl.wms.ext.mes.controller; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.base.TableDataInfo; +import org.nl.common.domain.query.PageQuery; +import org.nl.common.logging.annotation.Log; +import org.nl.wms.database.classification.service.dao.MdBaseClassstandard; +import org.nl.wms.ext.mes.service.WmsToMesService; +import org.nl.wms.ext.mes.service.dto.ScrapDto; +import org.nl.wms.ext.mes.service.dto.ScrapQuery; +import org.nl.wms.pdm.workorder.service.dto.PdmBdWorkorderQuery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @Author: lyd + * @Description: 直接与mes交互的功能 - 工序判废 + * @Date: 2023/11/29 + */ +@RestController +@Api(tags = "mes请求lms") +@RequestMapping("/api/mes") +@Slf4j +public class WmsToMesController { + @Autowired + private WmsToMesService wmsToMesService; + @GetMapping("/mesScrapInfo") + @Log("查询工序报废信息") + @ApiOperation("查询工序报废信息") + public ResponseEntity queryMesScrapInfo(ScrapQuery query, PageQuery page){ + return new ResponseEntity<>(TableDataInfo.build(wmsToMesService.queryMesScrapInfo(query,page)), HttpStatus.OK); + } + + @PostMapping("/addScrap") + @Log("新增工序报废") + @ApiOperation("新增工序报废") + //@SaCheckPermission("@el.check('mdBaseClassstandard:add')") + public ResponseEntity addScrap(@Validated @RequestBody ScrapDto entity){ + wmsToMesService.addScrap(entity); + return new ResponseEntity<>(HttpStatus.CREATED); + } + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java index d1febc2..9e42544 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java @@ -1,9 +1,11 @@ package org.nl.wms.ext.mes.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import org.nl.common.domain.query.PageQuery; import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo; import org.nl.wms.ext.mes.service.dto.*; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; +import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; import java.util.List; @@ -46,9 +48,9 @@ public interface WmsToMesService { /** * wms上报入窑记录信息 - * @param groupId + * @param group */ - void reportGdyMaterialInfoIn(String groupId); + void reportGdyMaterialInfoIn(SchBaseVehiclematerialgroup group); /** * wms上报出窑数据 @@ -146,4 +148,14 @@ public interface WmsToMesService { * @param mesPackDto */ void reportPackInfo(MesPackDto mesPackDto); + + /** + * 分页获取上报给mes的工序判废信息 + * @param query + * @param page + * @return + */ + IPage queryMesScrapInfo(ScrapQuery query, PageQuery page); + + void addScrap(ScrapDto entity); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java index ec0639e..d0ef370 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java @@ -79,4 +79,17 @@ public interface MesRequestMapper { void reportSpreaderInfoToMes(SpreaderDto spreaderDto); @DS("oracle") void reportPackInfo(MesPackDto mesPackDto); + + /** + * 无参分页 - 自写 + * @param currentPage + * @param currentSize + * @return + */ + @DS("oracle") + List selectMesScrapInfo(int currentPage, int currentSize); + @DS("oracle") + int getSemiProductGXPFTotal(); + @DS("oracle") + void reportSemiProductGXPF(SemiProductGXPFDo semiProductGXPFDo); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml index 6c4d4cd..ecfcba9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml @@ -23,23 +23,23 @@ INSERT INTO "LMSTELCOM"."RECEIVE_CS_SEMIPROINFO_OUT"(MSGID, SEMIPRODUCT_BATCHNO, PRODUCT_BATCHNO, FPRODUCT_MATERIAL_ID - , FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, PRO_NUM, PRO_UNIT, STOCK, STOCK_NAME, CHECKEROUT_TIM, OUTTYPE + , FPRODUCT_MATERIAL_NAME, FMATSPEC, FMATMODEL, PRO_SUBNUM, PRO_SUBUNIT, STOCK, STOCK_NAME, CHECKEROUT_TIM, OUTTYPE , CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{SEMIPRODUCT_BATCHNO}, #{PRODUCT_BATCHNO}, #{FPRODUCT_MATERIAL_ID} - , #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}, #{FMATMODEL}, #{PRO_NUM}, #{PRO_UNIT}, #{STOCK}, #{STOCK_NAME} + , #{FPRODUCT_MATERIAL_NAME}, #{FMATSPEC}, #{FMATMODEL}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{STOCK}, #{STOCK_NAME} , #{CHECKEROUT_TIM}, #{OUTTYPE}, #{CREATE_TM}, #{OP_FLAG}) INSERT INTO "LMSTELCOM"."RECEIVE_GDY_MATIN"(MSGID, TRAY_NO, FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME - , FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_NUM, PRO_UNIT, FCONVERTRATE, STOCK, DEVICE, IN_DATE + , FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_SUBNUM, PRO_SUBUNIT, FCONVERTRATE, STOCK, DEVICE, IN_DATE , CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{TRAY_NO}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME} - , #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_NUM}, #{PRO_UNIT}, #{FCONVERTRATE} + , #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{FCONVERTRATE} , #{STOCK}, #{DEVICE}, #{IN_DATE}, #{CREATE_TM}, #{OP_FLAG}) INSERT INTO "LMSTELCOM"."RECEIVE_GDY_MATOUT"(MSGID, TRAY_NO, FPRODUCT_MATERIAL_ID, FPRODUCT_MATERIAL_NAME - , FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_NUM, PRO_UNIT, FCONVERTRATE, STOCK, DEVICE, OUT_DATE + , FMATSPEC, FMATMODEL, BATCHNO, PRESSUNIT, PRO_SUBNUM, PRO_SUBUNIT, FCONVERTRATE, STOCK, DEVICE, OUT_DATE , CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{TRAY_NO}, #{FPRODUCT_MATERIAL_ID}, #{FPRODUCT_MATERIAL_NAME} - , #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_NUM}, #{PRO_UNIT}, #{FCONVERTRATE} + , #{FMATSPEC}, #{FMATMODEL}, #{BATCHNO}, #{PRESSUNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{FCONVERTRATE} , #{STOCK}, #{DEVICE}, #{OUT_DATE}, #{CREATE_TM}, #{OP_FLAG}) @@ -103,6 +103,13 @@ VALUES (#{MSGID}, #{BATCHNO}, #{TRAY_NO}, #{PRO_NUM}, #{PRO_UNIT}, #{PRO_SUBNUM}, #{PRO_SUBUNIT}, #{MATERIAL_ID} , #{MATERIAL_NAME}, #{PROSPEC}, #{PROMODEL}, #{CHECKERIN_TIM}, #{ORDER_NO}) + + INSERT INTO "LMSTELCOM"."RECEIVE_R_SEMIPRODUCT_GXPF"(MSGID, FORDER_NO, BATCHNO, DEVICE, FTEAM, PRODATE, WORKUNIT + , FP_NUM, FP_UNIT, FP_SUBNUM, FP_SUBUNIT, FP_REASON, FP_REMARK, IFJJ, EDTPFJJ_PROMATNO, CHECKERIN, CHECKERIN_TIM + , CREATE_TM, OP_FLAG) VALUES (#{MSGID}, #{FORDER_NO}, #{BATCHNO}, #{DEVICE}, #{FTEAM}, #{PRODATE}, #{WORKUNIT} + , #{FP_NUM}, #{FP_UNIT}, #{FP_SUBNUM}, #{FP_SUBUNIT}, #{FP_REASON}, #{FP_REMARK}, #{IFJJ}, #{EDTPFJJ_PROMATNO} + , #{CHECKERIN}, #{CHECKERIN_TIM}, #{CREATE_TM}, #{OP_FLAG}) + UPDATE "LMSTELCOM"."SEND_POP_SCHEDULE_PRESS" SET OP_FLAG = '1' @@ -258,7 +265,7 @@ LEFT JOIN sch_base_point p ON p.point_code = vg.source_vehicle_code LEFT JOIN sch_base_point p2 ON p.parent_point_code = p2.point_code WHERE - vg.point_code IN ( 'HCSSX01', 'HCSSX63' ) + vg.point_code IN ( 'HCSSX01', 'HCSSX63' ) AND vg.group_bind_material_status = '2' AND pw.workorder_code IS NOT NULL + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapDto.java new file mode 100644 index 0000000..b47baa6 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapDto.java @@ -0,0 +1,23 @@ +package org.nl.wms.ext.mes.service.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/11/29 + */ +@Data +public class ScrapDto { + private String process; + private String region_code; + private String point_code; + private String fp_weight; + private String fp_number; + private String vehicle_code; + private String fp_remark; + private String pf_name; + private String jj_material; + private String fp_big_type; + private String is_jj; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapQuery.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapQuery.java new file mode 100644 index 0000000..20e5202 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/ScrapQuery.java @@ -0,0 +1,14 @@ +package org.nl.wms.ext.mes.service.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/11/29 + */ +@Data +public class ScrapQuery implements Serializable { +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SemiProductGXPFDo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SemiProductGXPFDo.java new file mode 100644 index 0000000..5a8fb83 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/SemiProductGXPFDo.java @@ -0,0 +1,53 @@ +package org.nl.wms.ext.mes.service.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/11/29 + * 唯一标识 + * 订单号 + * 半成品批次号 + * 设备 + * 工序(H01:RH砖原料仓储;H02:RH砖配料;H03:RH砖成型;H04:RH砖热处理;H05:RH砖包装;H06:RH砖入库) + * 班组(大夜班、小夜班、白班) + * 废品重量 + * 重量单位 + * 废品数量 + * 数量单位 + * 废品大类 + * 废品备注 + * 是否降级,是1,否0 + * 降级后物料编码 + * 判废人 + * 判废日期 + * 生产日期 + * 写入时间 + * 读取标志,0未读取,1已读取 + * 读取时间 + */ +@Data +public class SemiProductGXPFDo { + private String MSGID; + private String FORDER_NO; + private String BATCHNO; + private String DEVICE; + private String WORKUNIT; + private String FTEAM; + private String FP_NUM; + private String FP_UNIT; + private String FP_SUBNUM; + private String FP_SUBUNIT; + private String FP_REASON; + private String FP_REMARK; + private String IFJJ; + private String EDTPFJJ_PROMATNO; + private String CHECKERIN; + private String CHECKERIN_TIM; + private String PRODATE; + private String CREATE_TM; + private String OP_FLAG; + private String OP_TM; + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java index 7dde290..e646a89 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java @@ -4,8 +4,12 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.nl.common.domain.query.PageQuery; import org.nl.common.exception.BadRequestException; import org.nl.system.service.notice.ISysNoticeService; import org.nl.wms.database.brick.service.dao.MdBaseBrickInfo; @@ -21,6 +25,7 @@ import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task_manage.GeneralDefinition; +import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; import org.springframework.beans.factory.annotation.Autowired; @@ -179,7 +184,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { semiProductionInfoInDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC()); semiProductionInfoInDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); semiProductionInfoInDto.setBATCHNO(mesWorkOrderDto.getBATCHNO()); - semiProductionInfoInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT()); semiProductionInfoInDto.setFTEAM(workorder.getTeam()); semiProductionInfoInDto.setTRAY_NO(vehiclematerialgroup.getVehicle_code()); semiProductionInfoInDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty()));// 数量 @@ -223,8 +227,8 @@ public class WmsToMesServiceImpl implements WmsToMesService { semiProductionInfoOutDto.setFPRODUCT_MATERIAL_NAME(mesWorkOrderDto.getFPRODUCT_MATERIAL_NAME()); semiProductionInfoOutDto.setFMATSPEC(mesWorkOrderDto.getFMATSPEC()); semiProductionInfoOutDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); - semiProductionInfoOutDto.setPRO_NUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty())); - semiProductionInfoOutDto.setPRO_UNIT("块"); + semiProductionInfoOutDto.setPRO_SUBNUM(BigDecimal.valueOf(vehiclematerialgroup.getMaterial_qty())); + semiProductionInfoOutDto.setPRO_SUBUNIT("块"); semiProductionInfoOutDto.setSTOCK("未知"); semiProductionInfoOutDto.setSTOCK_NAME("未知"); semiProductionInfoOutDto.setCHECKEROUT_TIM(vehiclematerialgroup.getUpdate_time()); @@ -246,9 +250,9 @@ public class WmsToMesServiceImpl implements WmsToMesService { @Override @Async - public void reportGdyMaterialInfoIn(String groupId) { + public void reportGdyMaterialInfoIn(SchBaseVehiclematerialgroup vehiclematerialgroup) { // 获取组盘信息 - SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); +// SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(groupId); String workorderCode = vehiclematerialgroup.getWorkorder_code(); // 获取工单 PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(workorderCode); @@ -263,8 +267,8 @@ public class WmsToMesServiceImpl implements WmsToMesService { gdyMaterialInDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); gdyMaterialInDto.setBATCHNO(mesWorkOrderDto.getBATCHNO()); gdyMaterialInDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT()); - gdyMaterialInDto.setPRO_NUM(String.valueOf(vehiclematerialgroup.getMaterial_qty())); - gdyMaterialInDto.setPRO_UNIT("块"); + gdyMaterialInDto.setPRO_SUBNUM(String.valueOf(vehiclematerialgroup.getMaterial_qty())); + gdyMaterialInDto.setPRO_SUBUNIT("块"); gdyMaterialInDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE()); gdyMaterialInDto.setSTOCK("未知"); gdyMaterialInDto.setDEVICE(GeneralDefinition.YES); @@ -305,8 +309,8 @@ public class WmsToMesServiceImpl implements WmsToMesService { gdyMaterialOutDto.setFMATMODEL(mesWorkOrderDto.getFMATMODEL()); // 型号,mes给的工单都有 gdyMaterialOutDto.setBATCHNO(mesWorkOrderDto.getBATCHNO()); gdyMaterialOutDto.setPRESSUNIT(mesWorkOrderDto.getPRESSUNIT()); - gdyMaterialOutDto.setPRO_NUM(String.valueOf(vehiclematerialgroup.getMaterial_qty())); - gdyMaterialOutDto.setPRO_UNIT("块"); + gdyMaterialOutDto.setPRO_SUBNUM(String.valueOf(vehiclematerialgroup.getMaterial_qty())); + gdyMaterialOutDto.setPRO_SUBUNIT("块"); gdyMaterialOutDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE()); gdyMaterialOutDto.setSTOCK("未知"); gdyMaterialOutDto.setDEVICE("1"); @@ -449,6 +453,65 @@ public class WmsToMesServiceImpl implements WmsToMesService { mesRequestMapper.reportPackInfo(mesPackDto); } + @Override + public IPage queryMesScrapInfo(ScrapQuery query, PageQuery pageQuery) { + Integer page = pageQuery.getPage(); + Integer size = pageQuery.getSize(); + IPage pages = new Page<>(page, size); + int currentPage = page * size + 1; // start + int currentSize = (pageQuery.getPage() + 1) * size; // end + List mesScrapInfoList = mesRequestMapper.selectMesScrapInfo(currentPage, currentSize); + pages.setRecords(mesScrapInfoList); + int total = mesRequestMapper.getSemiProductGXPFTotal(); + pages.setTotal(total); + return pages; + } + + @Override + public void addScrap(ScrapDto entity) { + SemiProductGXPFDo semiProductGXPFDo = new SemiProductGXPFDo(); + MesWorkOrderDto mesWorkOrderDto = null; + if (ObjectUtil.isNotEmpty(entity.getPoint_code())) { + // 设备为准 + PdmBdWorkorder deviceProductionTask = pdmBdWorkorderService.getDeviceProductionTask(entity.getPoint_code()); + if (ObjectUtil.isEmpty(deviceProductionTask)) { + throw new BadRequestException("设备[" + entity.getPoint_code() + "]不存在!"); + } + String extData = deviceProductionTask.getExt_data(); + mesWorkOrderDto = JSON.parseObject(extData, MesWorkOrderDto.class); + } else { + if (ObjectUtil.isEmpty(entity.getVehicle_code())) { + throw new BadRequestException("载具编码与设备必须选择一个"); + } + SchBaseVehiclematerialgroup gtp = vehiclematerialgroupService.getGroupInfo(entity.getVehicle_code(), "GTP", GroupBindMaterialStatusEnum.BOUND.getValue()); + PdmBdWorkorder workorder = pdmBdWorkorderService.getByCode(gtp.getWorkorder_code()); + mesWorkOrderDto = JSON.parseObject(workorder.getExt_data(), MesWorkOrderDto.class); + } + semiProductGXPFDo.setMSGID(IdUtil.getSnowflake(1,1).nextIdStr()); + semiProductGXPFDo.setFORDER_NO(mesWorkOrderDto.getFORDER_NO()); + semiProductGXPFDo.setBATCHNO(mesWorkOrderDto.getBATCHNO()); + semiProductGXPFDo.setDEVICE(mesWorkOrderDto.getPRESSUNIT()); + semiProductGXPFDo.setFTEAM(mesWorkOrderDto.getFTEAM()); + semiProductGXPFDo.setPRODATE(mesWorkOrderDto.getFPRODUCT_DATE()); + semiProductGXPFDo.setWORKUNIT(entity.getProcess()); + semiProductGXPFDo.setFP_NUM(entity.getFp_weight()); + semiProductGXPFDo.setFP_UNIT("千克"); + semiProductGXPFDo.setFP_SUBNUM(entity.getFp_number()); + semiProductGXPFDo.setFP_SUBUNIT("块"); + semiProductGXPFDo.setFP_REASON(entity.getFp_big_type()); + semiProductGXPFDo.setFP_REMARK(entity.getFp_remark()); + semiProductGXPFDo.setIFJJ(entity.getIs_jj()); + semiProductGXPFDo.setEDTPFJJ_PROMATNO(entity.getJj_material()); + semiProductGXPFDo.setCHECKERIN(entity.getPf_name()); + semiProductGXPFDo.setCHECKERIN_TIM(DateUtil.now()); + semiProductGXPFDo.setCREATE_TM(DateUtil.now()); + semiProductGXPFDo.setOP_FLAG(GeneralDefinition.NO); + if (entity.getIs_jj().equals(GeneralDefinition.NO)) { + semiProductGXPFDo.setEDTPFJJ_PROMATNO("-"); + } + mesRequestMapper.reportSemiProductGXPF(semiProductGXPFDo); + } + /** * 转换 * diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java index cdf662a..03fbd23 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java @@ -256,8 +256,8 @@ public class PdaController { } @PostMapping("/shelf/updateData") - @Log("货架盘点-物料查询") - @ApiOperation("货架盘点-物料查询") + @Log("货架盘点-更新") + @ApiOperation("货架盘点-更新") public ResponseEntityupdateData(@Validated @RequestBody ShelfSaveDto shelfSaveDto){ return new ResponseEntity<>(pdaService.updateData(shelfSaveDto), HttpStatus.OK); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java index 7eee48f..13bbc55 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -358,6 +358,7 @@ public class PdaServiceImpl implements PdaService { @Override @Transactional(rollbackFor = Exception.class) public PdaResponseVo updateData(ShelfSaveDto shelfSaveDto) { + log.info("人工操作库存, {}", shelfSaveDto); // 货位号填充HCHJ+*** String pointCode = "HCHJ" + String.format("%03d", Integer.parseInt(shelfSaveDto.getPoint_code())); // 获取点位 @@ -370,6 +371,7 @@ public class PdaServiceImpl implements PdaService { if (ObjectUtil.isNotEmpty(basePoint.getVehicle_code())) { SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(basePoint.getVehicle_code(), GeneralDefinition.STEEL_TRAY, GroupBindMaterialStatusEnum.BOUND.getValue()); + log.info("解绑载具数据{}", groupInfo); if (ObjectUtil.isNotEmpty(groupInfo)) { TaskUtils.setGroupUpdateByPC(groupInfo); groupInfo.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); diff --git a/lms/nladmin-ui/src/views/wms/basedata/classification/mdBaseClassstandard.js b/lms/nladmin-ui/src/views/wms/basedata/classification/mdBaseClassstandard.js index 0c216de..fba452b 100644 --- a/lms/nladmin-ui/src/views/wms/basedata/classification/mdBaseClassstandard.js +++ b/lms/nladmin-ui/src/views/wms/basedata/classification/mdBaseClassstandard.js @@ -79,4 +79,12 @@ export function getClassName() { }) } -export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName } +export function getClassByCode(data) { + return request({ + url: 'api/Classstandard/getClassByCode', + method: 'post', + data + }) +} + +export default { add, edit, del, getClass, getClassSuperior, getClassType, getClassTable, getType, queryClassById, getClassName, getClassByCode } diff --git a/lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue b/lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue new file mode 100644 index 0000000..265e9ab --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/pdm/scrap/index.vue @@ -0,0 +1,271 @@ + + + + + diff --git a/lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js b/lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js new file mode 100644 index 0000000..cb6199d --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/pdm/scrap/scrap.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/mes/addScrap', + method: 'post', + data + }) +} +export default { add }