From 59454f195ab6ab42cf537da5a70e7e5f21052705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Wed, 18 Aug 2021 19:33:03 +0800 Subject: [PATCH 1/6] =?UTF-8?q?userResource=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataimport/handler/UserResourceHandler.java | 17 ++++++++++++----- .../service/impl/UserResourceServiceImpl.java | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dataimport/src/main/java/com/foreverwin/mesnac/dataimport/handler/UserResourceHandler.java b/dataimport/src/main/java/com/foreverwin/mesnac/dataimport/handler/UserResourceHandler.java index 65043a50..1df51c7d 100644 --- a/dataimport/src/main/java/com/foreverwin/mesnac/dataimport/handler/UserResourceHandler.java +++ b/dataimport/src/main/java/com/foreverwin/mesnac/dataimport/handler/UserResourceHandler.java @@ -1,7 +1,9 @@ package com.foreverwin.mesnac.dataimport.handler; import com.alibaba.fastjson.JSONObject; +import com.foreverwin.mesnac.common.dto.UsrDto; import com.foreverwin.mesnac.common.enums.HandleEnum; +import com.foreverwin.mesnac.common.service.UserService; import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.dataimport.handler.base.BaseHandler; import com.foreverwin.mesnac.dataimport.reader.FileReader; @@ -13,7 +15,6 @@ import com.foreverwin.mesnac.dispatch.model.UserResource; import com.foreverwin.mesnac.dispatch.service.UserResourceService; import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper; import com.foreverwin.mesnac.meapi.mapper.ResrceMapper; -import com.foreverwin.mesnac.meapi.model.NwaUser; import com.foreverwin.mesnac.meapi.model.Resrce; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.I18nUtil; @@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import java.io.InputStream; import java.time.LocalDateTime; +import java.util.List; import java.util.Map; @@ -43,6 +45,9 @@ public class UserResourceHandler extends BaseHandler { @Autowired private UserResourceMapper userResourceMapper; + @Autowired + private UserService userService; + @Override public String importFile(String site, InputStream inputStream, String fileType, String mode) throws Exception { int row = 0; @@ -144,7 +149,7 @@ public class UserResourceHandler extends BaseHandler { }; } - String updateAndInsert(UserResource userResource,Long index){ + String updateAndInsert(UserResource userResource, Long index){ //判断资源是否存在 Resrce resrce = resrceMapper.selectById(userResource.getResourceBo()); @@ -153,10 +158,12 @@ public class UserResourceHandler extends BaseHandler { } //设置资源描述 userResource.setResrceDescription(resrce.getDescription()); + userResource.setExistUser("false"); //设置员工描述 - NwaUser nwaUser = nwaUserMapper.selectById(HandleEnum.USER.getHandle(userResource.getSite(), userResource.getUserId())); - if(nwaUser != null){ - userResource.setUserDescription(nwaUser.getFullName()); + List userList = userService.findList(userResource.getUserId()); + if(userList != null && userList.size() > 0){ + userResource.setUserDescription(userList.get(0).getFullName()); + userResource.setExistUser("true"); }else if("true".equals(userResource.getTemporaryUser())){ //不做任何操作 }else{ diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java index 2f557530..583eb51c 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java @@ -106,6 +106,7 @@ public class UserResourceServiceImpl extends ServiceImpl userByUserName = userService.findList(userResource.getUserId()); if("false".equals(userResource.getTemporaryUser()) && @@ -114,6 +115,7 @@ public class UserResourceServiceImpl extends ServiceImpl 0){ //userByUserName.setFullName(userResource.getUserDescription()); userResource.setUserDescription(userByUserName.get(0).getFullName()); + userResource.setExistUser("true"); //nwaUserService.saveOrUpdate(userByUserName); } userResource.setStatus(userResourceDto.getStatus()); From b6be3a324c173bbf6c6db5de5bb224aeddeaf268 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 19 Aug 2021 08:36:26 +0800 Subject: [PATCH 2/6] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/equip/controller/ResourceRepairTaskController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java index e4cc920e..d7e4daa3 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/controller/ResourceRepairTaskController.java @@ -190,7 +190,7 @@ public class ResourceRepairTaskController { String resourceNo = resourceRepairTask.getResourceNo(); String resourceTypeNo = resourceRepairTask.getResourceTypeNo(); if (workCenterNo != null){ - resourceRepairTask.setWorkCenterBo(HandleEnum.RESOURCE_INSPECT_PLAN.getHandle(site,workCenterNo)); + resourceRepairTask.setWorkCenterBo(HandleEnum.WORK_CENTER.getHandle(site,workCenterNo)); } if (resourceNo != null){ resourceRepairTask.setResourceBo(HandleEnum.RESOURCE.getHandle(site,resourceNo)); From 3f93c1e9bc17671862870b59eedecf90c1adc134 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 19 Aug 2021 09:06:49 +0800 Subject: [PATCH 3/6] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- equip/src/main/resources/mapper/ResourceRepairTaskMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/equip/src/main/resources/mapper/ResourceRepairTaskMapper.xml b/equip/src/main/resources/mapper/ResourceRepairTaskMapper.xml index 4c8a728b..90fb6936 100644 --- a/equip/src/main/resources/mapper/ResourceRepairTaskMapper.xml +++ b/equip/src/main/resources/mapper/ResourceRepairTaskMapper.xml @@ -894,7 +894,7 @@ INNER JOIN WIP.RESRCE R ON RRT.SITE = R.SITE AND R.RESRCE = RRT.RESOURCE_NO LEFT JOIN WIP.WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = R.HANDLE LEFT JOIN WIP.WORK_CENTER_MEMBER WCMA ON WCMA.WORK_CENTER_OR_RESOURCE_GBO = WCM.WORK_CENTER_BO - LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO + LEFT JOIN WIP.WORK_CENTER_T WCT ON WCT.WORK_CENTER_BO = WCMA.WORK_CENTER_BO AND WCT.LOCALE = 'zh' INNER JOIN WIP.RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = R.HANDLE WHERE RRT.SITE = #{site} @@ -910,7 +910,7 @@ AND RRT.STATUS = #{status} - AND WCM.WORK_CENTER_BO = #{workCenterBo} + AND WCMA.WORK_CENTER_BO = #{workCenterBo} AND RTR.RESOURCE_TYPE_BO = #{resourceTypeBo} From c0f278f3a8632f7476cc0a46532cbf235d4e7220 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 19 Aug 2021 11:16:25 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=95=B0=E6=8D=AEbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InterfaceServiceImpl.java | 65 +++++++++---------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java index 6c100148..eb121243 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java @@ -819,7 +819,6 @@ public class InterfaceServiceImpl implements InterfaceService { LocalDateTime now = LocalDateTime.now(); - List printLogList = new ArrayList<>(); //循环处理 物料批次 for (int i = 0; i < itemBatchDtoList.size(); i++) { ItemBatchDto itemBatchDto = itemBatchDtoList.get(i); @@ -867,42 +866,40 @@ public class InterfaceServiceImpl implements InterfaceService { itemBatch.setCreateUser(Constants.SITE_ADMIN); itemBatch.setCreatedDateTime(now); itemBatchService.save(itemBatch); + + //打印模板参数 + List labelPrintDtoList = new ArrayList<>(); + LabelPrintDto labelPrintDto = new LabelPrintDto(); + labelPrintDto.setSite(site); + labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_INV); + labelPrintDto.setItem(item); + labelPrintDto.setItemDescription(itemModel.getDescription()); + labelPrintDto.setSupplier(supplier); + //labelPrintDto.setBatch(inventory); + labelPrintDto.setBatch(batch); + labelPrintDto.setLabel(inventory); + labelPrintDtoList.add(labelPrintDto); + + //记录打印数据 + PrintLog printLog = new PrintLog(); + printLog.setHandle(UUID.randomUUID().toString()); + printLog.setSite(site); + printLog.setCategory(Constants.PRINT_TYPE_INV); + printLog.setPrintName(""); + printLog.setPrintTemplate(Constants.PRINT_TYPE_INV); + printLog.setPrintParam(JSON.toJSONString(labelPrintDtoList)); + printLog.setInventory(inventory); + printLog.setItemBo(itemModel.getHandle()); + printLog.setIsPrint("false"); + printLog.setPrintNum(0); + printLog.setCreateUser("SITE_ADMIN"); + printLog.setCreatedDateTime(LocalDateTime.now()); + printLogService.save(printLog); + } - //打印模板参数 - List labelPrintDtoList = new ArrayList<>(); - LabelPrintDto labelPrintDto = new LabelPrintDto(); - labelPrintDto.setSite(site); - labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_INV); - labelPrintDto.setItem(item); - labelPrintDto.setItemDescription(itemModel.getDescription()); - labelPrintDto.setSupplier(supplier); - //labelPrintDto.setBatch(inventory); - labelPrintDto.setBatch(batch); - labelPrintDto.setLabel(inventory); - labelPrintDtoList.add(labelPrintDto); - - - //记录打印数据 - PrintLog printLog = new PrintLog(); - printLog.setHandle(UUID.randomUUID().toString()); - printLog.setSite(site); - printLog.setCategory(Constants.PRINT_TYPE_INV); - printLog.setPrintName(""); - printLog.setPrintTemplate(Constants.PRINT_TYPE_INV); - printLog.setPrintParam(JSON.toJSONString(labelPrintDtoList)); - printLog.setInventory(inventory); - printLog.setItemBo(itemModel.getHandle()); - printLog.setIsPrint("false"); - printLog.setPrintNum(0); - printLog.setCreateUser("SITE_ADMIN"); - printLog.setCreatedDateTime(LocalDateTime.now()); - printLogList.add(printLog); - } - - if (printLogList != null && printLogList.size() > 0) { - printLogService.saveBatch(printLogList); } + } /** From c7c9b3d156758af27c4cde5c50d587a2565dc3d1 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 19 Aug 2021 13:41:18 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/common/controller/PrinterController.java | 1 + dispatch/src/main/resources/mapper/CallItemMapper.xml | 4 ++-- .../equip/service/impl/ResourceRepairTaskServiceImpl.java | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java index 3c6eebdb..77ad9aa2 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java @@ -83,6 +83,7 @@ public class PrinterController { return R.ok("保存成功"); } else { printerModel.setDescription(printer.getDescription()); + printerModel.setEnabled(printer.getEnabled()); printerModel.setModifiedDateTime(nowDate); printerService.updateById(printerModel); return R.ok("修改成功"); diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index 31adaeb8..555f72e2 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -984,8 +984,8 @@ ZCI.SHOP_ORDER , ZCI.RESRCE, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION,ZCI.COMPONENT_BO , CP.ITEM COMPONENT, ITT.DESCRIPTION COMPONENT_DESCRIPTION, ZSD.BLANKING_SIZE, - MIN(ZSD.PLANNED_START_DATE) , - /*MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/ + /*MIN(ZSD.PLANNED_START_DATE) , + MIN(SO.PLANNED_START_DATE) , ZCI.CALL_TYPE,*/ SUM(ZCI.REQUIRED_QTY) REQUIRED_QTY FROM Z_CALL_ITEM ZCI INNER JOIN Z_SFC_DISPATCH ZSD ON ZSD.HANDLE = ZCI.SFC_DISPATCH_BO diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java index d51e8e29..cf05e5cb 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java @@ -145,6 +145,7 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl Date: Thu, 19 Aug 2021 13:41:25 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- integration/src/main/resources/mapper/IntegrationLogMapper.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/integration/src/main/resources/mapper/IntegrationLogMapper.xml b/integration/src/main/resources/mapper/IntegrationLogMapper.xml index 5191bc5f..fb9fd932 100644 --- a/integration/src/main/resources/mapper/IntegrationLogMapper.xml +++ b/integration/src/main/resources/mapper/IntegrationLogMapper.xml @@ -483,5 +483,6 @@ AND REQUEST_DATE_TIME <= #{integration.endDateTime} + ORDER BY REQUEST_DATE_TIME DESC