From f4ea23fc035007eff560aa8d8d21f7d62e700983 Mon Sep 17 00:00:00 2001 From: Leon <3066758958@qq.com> Date: Thu, 26 Aug 2021 20:44:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=B4=BE=E5=B7=A5=E5=92=8C?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/common/dto/SfcDispatchDto.java | 18 +++++++++ .../controller/CallItemController.java | 15 +++----- .../controller/SfcDispatchController.java | 3 -- .../dispatch/mapper/CallItemMapper.java | 6 ++- .../dispatch/service/CallItemService.java | 4 +- .../service/impl/CallItemServiceImpl.java | 13 ++----- .../main/resources/mapper/CallItemMapper.xml | 28 +++++++++++--- .../resources/mapper/SfcDispatchMapper.xml | 38 +++++++++++++------ 8 files changed, 83 insertions(+), 42 deletions(-) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java b/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java index b3481371..c4775c15 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/dto/SfcDispatchDto.java @@ -182,6 +182,8 @@ public class SfcDispatchDto implements Serializable{ */ private String component; private String componentDescription; + private String texture; + private String matSpec; private String isCompleted; private BigDecimal completedQty; private String resourceWorkCenter; @@ -604,6 +606,22 @@ public class SfcDispatchDto implements Serializable{ this.componentDescription = componentDescription; } + public String getTexture() { + return texture; + } + + public void setTexture(String texture) { + this.texture = texture; + } + + public String getMatSpec() { + return matSpec; + } + + public void setMatSpec(String matSpec) { + this.matSpec = matSpec; + } + public String getIsCompleted() { return isCompleted; } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java index 875a5288..29cc8a78 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java @@ -39,18 +39,13 @@ public class CallItemController { * @return */ @ResponseBody - @PostMapping("/findCallItemList") - public R findCallItemList(@RequestBody CallItem callItem){ + @GetMapping("/findCallItemList") + public R findCallItemList(@RequestParam(required = false) Map paramMap){ List result; try { - callItem.setSite(CommonMethods.getSite()); - if (callItem.getStartFromDate_S() != null) { - callItem.setStartFromDate(DateUtil.parse(callItem.getStartFromDate_S())); - } - if (callItem.getStartToDate_S() != null) { - callItem.setStartToDate(DateUtil.parse(callItem.getStartToDate_S())); - } - result = callItemService.findCallItemList(callItem); + String site = CommonMethods.getSite(); + paramMap.put("site", site); + result = callItemService.findCallItemList(paramMap); } catch (Exception e) { return R.failed(e.getMessage()); } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java index 08615a77..ed4f73be 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/SfcDispatchController.java @@ -1,14 +1,11 @@ package com.foreverwin.mesnac.dispatch.controller; -import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.foreverwin.mesnac.common.dto.SfcDispatchDto; import com.foreverwin.mesnac.common.enums.DispatchStatusEnum; -import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.dispatch.model.SfcDispatch; import com.foreverwin.mesnac.dispatch.service.SfcDispatchService; -import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.R; diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java index b4a844e5..d406e03d 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java @@ -4,12 +4,12 @@ import com.foreverwin.mesnac.common.dto.SfcDispatchDto; import com.foreverwin.mesnac.dispatch.dto.IssueItemDto; import com.foreverwin.mesnac.dispatch.model.CallItem; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.foreverwin.mesnac.dispatch.model.SfcDispatch; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; import java.util.List; +import java.util.Map; /** *

@@ -30,7 +30,7 @@ public interface CallItemMapper extends BaseMapper { List selectCallItemAndType(@Param("sfcDispatchBo") String sfcDispatchBo); - List findCallItemList(CallItem callItem); + List findCallItemList(Map paramMap); List findCallItemDetailList(CallItem callItem); @@ -51,6 +51,8 @@ public interface CallItemMapper extends BaseMapper { List findRefreshCallItemPda(@Param("list") List list); + void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); + void updateCallItemStatusByCallItemNo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); void refreshRequiredTime(@Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java index 3b833d2d..ee2f12b2 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java @@ -37,9 +37,9 @@ public interface CallItemService extends IService { /** * 生产叫料查询 * - * @param callItem + * @param paramMap */ - List findCallItemList(CallItem callItem); + List findCallItemList(Map paramMap); /** * 叫料明细查询 diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java index f1ecba2b..412f7959 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java @@ -137,8 +137,8 @@ public class CallItemServiceImpl extends ServiceImpl i } @Override - public List findCallItemList(CallItem callItem) { - return callItemMapper.findCallItemList(callItem); + public List findCallItemList(Map paramMap) { + return callItemMapper.findCallItemList(paramMap); } @Override @@ -174,13 +174,8 @@ public class CallItemServiceImpl extends ServiceImpl i return; } - //派工单号集合 - List dispatchBoList = new ArrayList<>(); - for (CallItem callItem : callItemList) { - dispatchBoList.add(callItem.getSfcDispatchBo()); - } - - this.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_CALLED, user, dispatchBoList); + LocalDateTime nowDate = LocalDateTime.now(); + callItemMapper.updateCallItemStatusByHandle(Constants.CALL_ITEM_STATUS_CALLED, user, nowDate, callItemList); } @Override diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index 0e03f30b..03bfeff7 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -39,6 +39,10 @@ + + + + @@ -640,14 +644,14 @@ + + UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime} + WHERE STATUS != '804' AND HANDLE IN + + #{item.handle} + + + UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime} WHERE STATUS != '804' AND SFC_DISPATCH_BO IN diff --git a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml index 46014c8a..93013b88 100644 --- a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml +++ b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml @@ -65,6 +65,9 @@ + + + @@ -676,12 +679,12 @@ WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布' END AS STATUS_NAME, 'ADMINISTRATOR' AS ROLE FROM ( - SELECT DISTINCT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS, + SELECT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE ITEM_NUMBER, C1.VALUE WORK_ORDER, IM.HANDLE ITEM_BO, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS, SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE USER_NAME, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION RESOURCE_DESCRIPTION, CASE WHEN SD.DISPATCH_STATUS = 'COMPLETE' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION, SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE, - CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, - WR.WORK_CENTER RESOURCE_WORK_CENTER + CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, MAX(BC.COMPONENT_GBO) COMPONENT_BO, + WR.WORK_CENTER RESOURCE_WORK_CENTER, MAX(CP.ITEM) COMPONENT, MAX(CT.DESCRIPTION) COMPONENT_DESCRIPTION, MAX(C3.VALUE) TEXTURE, MAX(C4.VALUE) MAT_SPEC FROM Z_SFC_DISPATCH SD LEFT JOIN RESRCE RS ON SD.SITE = RS.SITE AND SD.RESRCE = RS.RESRCE INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER @@ -692,8 +695,10 @@ INNER JOIN OPERATION O ON O.SITE = SD.SITE AND O.OPERATION = SD.OPERATION AND O.CURRENT_REVISION = 'true' LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = 'zh' INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SO.BOM_BO - INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO - LEFT JOIN ITEM_T CPT ON CPT.ITEM_BO = CP.HANDLE AND CPT.LOCALE = 'zh' + LEFT JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO + LEFT JOIN ITEM_T CT ON CT.ITEM_BO = CP.HANDLE AND CT.LOCALE = 'zh' + LEFT JOIN CUSTOM_FIELDS C3 ON C3.HANDLE = CP.HANDLE AND C3.ATTRIBUTE = 'TEXTTURE' + LEFT JOIN CUSTOM_FIELDS C4 ON C4.HANDLE = CP.HANDLE AND C4.ATTRIBUTE = 'MAT_SPEC' LEFT JOIN WORK_CENTER_MEMBER WCM ON WCM.WORK_CENTER_OR_RESOURCE_GBO = 'ResourceBO:' || SD.SITE || ',' || SD.RESRCE LEFT JOIN WORK_CENTER WR ON WR.HANDLE = WCM.WORK_CENTER_BO WHERE SD.SITE = #{site} @@ -733,17 +738,23 @@ AND SD.TURN_OPERATION = #{turnOperation} + + AND SD.IS_DISPATCH = #{isDispatch} + + + AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%' + AND CP.ITEM = #{component} - AND CPT.DESCRIPTION LIKE '%' || #{componentDescription} || '%' + AND CT.DESCRIPTION LIKE '%' || #{componentDescription} || '%' - - AND SD.IS_DISPATCH = #{isDispatch} + + AND C3.VALUE LIKE '%'|| #{texture} ||'%' - - AND SD.BLANKING_SIZE LIKE '%'||#{blankingSize}||'%' + + AND C4.VALUE LIKE '%'|| #{matSpec}|| '%' AND SO.PLANNED_START_DATE >= TO_DATE(#{startFromDate}, 'YYYY-MM-DD') @@ -757,6 +768,11 @@ AND SO.PLANNED_COMP_DATE <= TO_DATE(#{completeToDate}|| '23:59:59', 'YYYY-MM-DD HH24:MI:SS') + GROUP BY SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C2.VALUE, C1.VALUE, IM.HANDLE, IM.ITEM, IT.DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS, + SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.EMPLOYEE, SD.DISPATCH_QTY, SD.PROD_HOURS, RS.DESCRIPTION, + SD.DISPATCH_STATUS, SD.DISPATCH_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, SD.EMPLOYEE_DESCRIPTION, + SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.EARLIEST_START_DATE, SD.LATEST_END_DATE, + IM.LOT_SIZE, SD.TURN_OPERATION, SD.BLANKING_SIZE, WR.WORK_CENTER ) WIP LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.DISPATCH_SEQ = WIP.BEFORE_SEQ LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ @@ -808,7 +824,7 @@ - SELECT FROM Z_SFC_DISPATCH WHERE SITE = #{site} AND SFC = #{sfc} AND TO_NUMBER(STEP_ID) >= #{stepId}