From 70f1482493bbb7ca4091b06be2aa030da34e77d1 Mon Sep 17 00:00:00 2001 From: Leon <3066758958@qq.com> Date: Tue, 17 Aug 2021 13:25:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E6=B4=BE=E5=B7=A5=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/common/constant/Constants.java | 10 ++- .../mesnac/common/dto/SfcDispatchDto.java | 65 ++++++++++++------- .../src/main/resources/application-prd.yml | 42 ++++++++++++ .../controller/SfcDispatchController.java | 57 ++-------------- .../controller/UserResourceController.java | 4 +- .../dispatch/mapper/SfcDispatchMapper.java | 2 - .../dispatch/mapper/UserResourceMapper.java | 2 +- .../service/ShopOrderReleaseService.java | 3 +- .../dispatch/service/UserResourceService.java | 2 +- .../service/impl/CallItemServiceImpl.java | 15 +++-- .../service/impl/SfcDispatchServiceImpl.java | 64 ++++++++++++++---- .../impl/ShopOrderReleaseServiceImpl.java | 39 +++++------ .../service/impl/UserResourceServiceImpl.java | 7 +- .../main/resources/mapper/CallItemMapper.xml | 12 ++-- .../resources/mapper/SfcDispatchMapper.xml | 15 +++-- .../resources/mapper/UserResourceMapper.xml | 4 +- .../service/impl/InterfaceServiceImpl.java | 2 +- .../mesnac/meapi/mapper/UserGroupMapper.java | 1 + .../meapi/service/UserGroupService.java | 2 + .../service/impl/UserGroupServiceImpl.java | 5 +- .../main/resources/mapper/UserGroupMapper.xml | 7 ++ 21 files changed, 219 insertions(+), 141 deletions(-) create mode 100644 console/src/main/resources/application-prd.yml diff --git a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java index d74e4366..79a63ad0 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java @@ -8,7 +8,7 @@ package com.foreverwin.mesnac.common.constant; */ public interface Constants { - String OP_6106GX = "6106GX"; + String OP_WX_6106GX = "WX_6106GX"; String STATUS_NEW = "NEW"; String STATE_CONFIRM ="CONF"; @@ -177,4 +177,12 @@ public interface Constants { */ String UNTREATED = "UN"; //未处理 String PROCESSED = "PR"; //已处理 + + + //用户组 + String USER_GROUP_ADMINISTRATOR = "ADMINISTRATOR"; + //车间调度 + String USER_GROUP_CJDD = "CJDD"; + //总计划 + String USER_GROUP_ZJH = "ZJH"; } 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 42d221a8..a4bcf13d 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 @@ -85,11 +85,13 @@ public class SfcDispatchDto implements Serializable{ */ @ExcelColumn("资源编号") private String resrce; + private String resourceDescription; /** * 人员编号 */ @ExcelColumn("操作者") private String employee; + private String employeeDescription; /** * 是否转序 */ @@ -103,23 +105,25 @@ public class SfcDispatchDto implements Serializable{ */ private Double prodHours; /** - * 计划开始时间 + * 总计划开始时间 */ - @ExcelColumn("计划开始时间") + @ExcelColumn("总计划开始时间") private LocalDateTime plannedStartDate; /** - * 计划完成时间 + * 总计划完成时间 */ - @ExcelColumn("计划完成时间") + @ExcelColumn("总计划完成时间") private LocalDateTime plannedCompDate; /** - * 实际开始时间 + * 车间最早开始时间 */ - private LocalDateTime actualStartDate; + @ExcelColumn("车间最早开始时间") + private LocalDateTime earliestStartDate; /** - * 实际完成时间 + * 车间最晚结束时间 */ - private LocalDateTime actualCompleteDate; + @ExcelColumn("车间最晚结束时间") + private LocalDateTime latestEndDate; /** * 是否已经派工 */ @@ -176,14 +180,14 @@ public class SfcDispatchDto implements Serializable{ private BigDecimal completedQty; private String resourceWorkCenter; + private String user; + private String role; private String status; private String locale; private String routerBo; private String statusName; private LocalDateTime soReleasedDate; private LocalDateTime sfcReleasedDate; - private LocalDateTime latestEndDate; - private LocalDateTime earliestStartDate; private LocalDateTime releasedCompleteDate; private LocalDateTime dispatchCompleteDate; @@ -353,6 +357,14 @@ public class SfcDispatchDto implements Serializable{ this.resrce = resrce; } + public String getResourceDescription() { + return resourceDescription; + } + + public void setResourceDescription(String resourceDescription) { + this.resourceDescription = resourceDescription; + } + public String getEmployee() { return employee; } @@ -361,6 +373,14 @@ public class SfcDispatchDto implements Serializable{ this.employee = employee; } + public String getEmployeeDescription() { + return employeeDescription; + } + + public void setEmployeeDescription(String employeeDescription) { + this.employeeDescription = employeeDescription; + } + public String getTurnOperation() { return turnOperation; } @@ -401,28 +421,29 @@ public class SfcDispatchDto implements Serializable{ this.plannedCompDate = plannedCompDate; } - public LocalDateTime getActualStartDate() { - return actualStartDate; + + public String getIsDispatch() { + return isDispatch; } - public void setActualStartDate(LocalDateTime actualStartDate) { - this.actualStartDate = actualStartDate; + public void setIsDispatch(String isDispatch) { + this.isDispatch = isDispatch; } - public LocalDateTime getActualCompleteDate() { - return actualCompleteDate; + public String getUser() { + return user; } - public void setActualCompleteDate(LocalDateTime actualCompleteDate) { - this.actualCompleteDate = actualCompleteDate; + public void setUser(String user) { + this.user = user; } - public String getIsDispatch() { - return isDispatch; + public String getRole() { + return role; } - public void setIsDispatch(String isDispatch) { - this.isDispatch = isDispatch; + public void setRole(String role) { + this.role = role; } public String getStatus() { diff --git a/console/src/main/resources/application-prd.yml b/console/src/main/resources/application-prd.yml new file mode 100644 index 00000000..3d95b624 --- /dev/null +++ b/console/src/main/resources/application-prd.yml @@ -0,0 +1,42 @@ +#Spring +spring: + datasource: + dynamic: + primary: wip + datasource: + wip: + driver-class-name: com.sap.db.jdbc.Driver + jndi-name: jdbc/jts/wipPool + activemq: + enabled: false + brokerUrl: tcp://121.36.58.109:61616?wireFormat.maxInactivityDuration=0 + password: admin + user: admin + pool: + enabled: true + max-connections: 10 + +#WebService +ws: + erp: + server: 172.16.251.223 + port: 8000 + user: mesd001 + pwd: a123456 + valid: N + +ftp: + host: + port: 21 + username: + password: + +#打印服务器配置 +print: + server: http://172.16.251.188:8022/print/mesnacprint + + +exportDocument: + filePath: /usr/word/ + outputPath: /usr/word/outputWord/ + template: SFC_SCRAP_TEMPLATE.ftl \ No newline at end of file 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 cc086aec..980fa29f 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 @@ -70,12 +70,13 @@ public class SfcDispatchController { @ResponseBody @GetMapping("getSfcDispatch") public R getSfcDispatch(String workCenter, String dispatchStatus, String item, String itemNumber, String workOrder, String shopOrder, - String resrce, String resourceType, String operation, String sfc, String component, String componentDescription, String turnOperation, + String resrce, String resourceType, String operation, String operationDescription, String sfc, String component, String componentDescription, String turnOperation, String isDispatch, String startFromDate_S, String startToDate_S, String completeFromDate_S, String completeToDate_S) { List list; try { SfcDispatchDto sfcDispatchDto = new SfcDispatchDto(); sfcDispatchDto.setSite(CommonMethods.getSite()); + sfcDispatchDto.setUser(CommonMethods.getUser()); sfcDispatchDto.setWorkCenter(workCenter); sfcDispatchDto.setDispatchStatus(dispatchStatus); sfcDispatchDto.setItem(item); @@ -85,6 +86,7 @@ public class SfcDispatchController { sfcDispatchDto.setResrce(resrce); sfcDispatchDto.setResourceType(resourceType); sfcDispatchDto.setOperation(operation); + sfcDispatchDto.setOperationDescription(operationDescription); sfcDispatchDto.setSfc(sfc); sfcDispatchDto.setComponent(component); sfcDispatchDto.setComponentDescription(componentDescription); @@ -123,6 +125,7 @@ public class SfcDispatchController { List list; try { sfcDispatchDto.setSite(CommonMethods.getSite()); + sfcDispatchDto.setUser(CommonMethods.getUser()); if (sfcDispatchDto.getStartFromDate_S() != null) { sfcDispatchDto.setStartFromDate(DateUtil.parse(sfcDispatchDto.getStartFromDate_S())); } @@ -145,58 +148,6 @@ public class SfcDispatchController { } - /** - * 分页查询数据 - * - * @param frontPage 分页信息 - * @return - */ - @ResponseBody - @GetMapping("/page") - public R page(FrontPage frontPage, SfcDispatch sfcDispatch){ - IPage result; - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.setEntity(sfcDispatch); - sfcDispatch.setSite(CommonMethods.getSite()); - if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { - //TODO modify global query - queryWrapper.lambda().and(wrapper -> wrapper - .like(SfcDispatch::getHandle, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getSite, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getShopOrder, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getSfc, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getBlankingSize, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getDispatchSeq, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getDispatchNo, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getDispatchStatus, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getDrawingsNo, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getDrawingsRevision, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getIsLock, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getRouterBo, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getStepId, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getOperation, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getResourceType, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getWorkCenter, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getResrce, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getEmployee, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getTurnOperation, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getIsDispatch, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getIsImport, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getRemark, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getCreateUser, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getModifyUser, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getOther1, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getOther2, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getOther3, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getOther4, frontPage.getGlobalQuery()) - .or().like(SfcDispatch::getOther5, frontPage.getGlobalQuery()) - ); - } - result = sfcDispatchService.page(frontPage.getPagePlus(), queryWrapper); - return R.ok(result); - } - - @ResponseBody @PostMapping("/saveDispatch") public R saveDispatch(@RequestBody List sfcDispatchList) { diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/UserResourceController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/UserResourceController.java index 03ccfc2e..dcaf5eb6 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/UserResourceController.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/UserResourceController.java @@ -158,10 +158,10 @@ public class UserResourceController { @ResponseBody @GetMapping("/findEmployeeList") - public R findEmployeeList() { + public R findEmployeeList(String resourceType) { try { String site = CommonMethods.getSite(); - return R.ok(userResourceService.findEmployeeList(site)); + return R.ok(userResourceService.findEmployeeList(site, resourceType)); } catch (Exception e) { return R.failed(e.getMessage()); } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java index 5677a8d9..b8e37b8c 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/SfcDispatchMapper.java @@ -1,10 +1,8 @@ package com.foreverwin.mesnac.dispatch.mapper; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.foreverwin.mesnac.common.dto.SfcDispatchDto; import com.foreverwin.mesnac.dispatch.model.SfcDispatch; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java index f3f1d528..3eccf20a 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java @@ -20,7 +20,7 @@ import java.util.List; @Repository public interface UserResourceMapper extends BaseMapper { - List findEmployeeList(@Param("site") String site); + List findEmployeeList(@Param("site") String site, @Param("resourceType") String resourceType); List findEnableList(@Param("site") String site, @Param("resource") String resource, @Param("user") String user); diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/ShopOrderReleaseService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/ShopOrderReleaseService.java index d484c17a..4e671f02 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/ShopOrderReleaseService.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/ShopOrderReleaseService.java @@ -70,10 +70,9 @@ public interface ShopOrderReleaseService { * * @param site * @param user - * @param workCenter * @param shopOrderModel * @param sfcModel * @param routerList */ - void sfcDispatch(String site, String user, String workCenter, ShopOrder shopOrderModel, Sfc sfcModel, List routerList); + void sfcDispatch(String site, String user, ShopOrder shopOrderModel, Sfc sfcModel, List routerList); } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java index 729cc04d..f650fc30 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java @@ -20,7 +20,7 @@ import java.util.List; */ public interface UserResourceService extends IService { - List findEmployeeList(String site); + List findEmployeeList(String site, String resourceType); List findEnableList(String site, String resource, String user); 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 2850dd56..69cad71c 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 @@ -59,7 +59,8 @@ public class CallItemServiceImpl extends ServiceImpl i //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //工序叫料数据 - for (SfcDispatchDto sfcDispatchDto : sfcDispatchList) { + //Leon.L 2021/8/16 业务取消工序叫料 + /**for (SfcDispatchDto sfcDispatchDto : sfcDispatchList) { String prepositionStepId = sfcDispatchDto.getPrepositionStepId(); if (StringUtil.isBlank(prepositionStepId)) { continue; @@ -86,7 +87,7 @@ public class CallItemServiceImpl extends ServiceImpl i callItem.setModifyUser(user); callItem.setModifiedDateTime(nowDate); list.add(callItem); - } + }**/ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -323,11 +324,11 @@ public class CallItemServiceImpl extends ServiceImpl i String blankingSize = callItem.getBlankingSize(); //工序叫料不需要计算数量 - if (Constants.CALL_TYPE_OPERATION.equals(callItem.getCallType())) { + /**if (Constants.CALL_TYPE_OPERATION.equals(callItem.getCallType())) { callItem.setSizeReqQty(BigDecimal.ONE); compQtyMap.put(component, BigDecimal.ONE); continue; - } + }**/ if (StringUtil.isBlank(blankingSize)) { callItem.setSizeReqQty(callItem.getRequiredQty()); @@ -335,8 +336,10 @@ public class CallItemServiceImpl extends ServiceImpl i continue; } - if ("GB".equals(itemGroup)) { - if (!blankingSize.contains("*")) { + if (StringUtil.notBlank(itemGroup) && "GB".equals(itemGroup)) { + if (!blankingSize.contains("*") || blankingSize.split("\\*").length < 2) { + callItem.setSizeReqQty(callItem.getRequiredQty()); + compQtyMap.put(component, callItem.getRequiredQty()); continue; } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java index 52010faa..6bfe69b4 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/SfcDispatchServiceImpl.java @@ -25,6 +25,7 @@ import com.foreverwin.mesnac.meapi.dto.WorkCenterLinkDTO; import com.foreverwin.mesnac.meapi.model.Router; import com.foreverwin.mesnac.meapi.model.Sfc; import com.foreverwin.mesnac.meapi.model.ShopOrder; +import com.foreverwin.mesnac.meapi.model.UserGroup; import com.foreverwin.mesnac.meapi.service.*; import com.foreverwin.mesnac.meapi.util.StringUtils; import com.foreverwin.modular.core.exception.BaseException; @@ -36,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; +import sun.awt.geom.AreaOp; import javax.servlet.http.HttpServletRequest; import java.io.IOException; @@ -67,6 +69,8 @@ public class SfcDispatchServiceImpl extends ServiceImpl findSfcDispatchList(SfcDispatchDto sfcDispatchDto) { - return sfcDispatchMapper.findSfcDispatchList(sfcDispatchDto); + List list = sfcDispatchMapper.findSfcDispatchList(sfcDispatchDto); + if (list == null || list.size() <= 0) { + return list; + } + + //查询用户对应用户组 + String site = CommonMethods.getSite(); + String user = CommonMethods.getUser(); + String userBo = HandleEnum.USER.getHandle(site, user); + List userGroupList = userGroupService.getUserGroupListByUserBo(userBo); + String role = "ADMINISTRATOR"; + if (userGroupList != null && userGroupList.size() > 0) { + for (UserGroup userGroupModel: userGroupList) { + String userGroup = userGroupModel.getUserGroup(); + if (Constants.USER_GROUP_ADMINISTRATOR.equals(userGroup)) { + role = Constants.USER_GROUP_ADMINISTRATOR; + break; + } else if (Constants.USER_GROUP_CJDD.equals(userGroup)) { + role = Constants.USER_GROUP_CJDD; + break; + } else if (Constants.USER_GROUP_ZJH.equals(userGroup)) { + role = Constants.USER_GROUP_ZJH; + break; + } + } + } + + //赋值用户组 + for (SfcDispatchDto sfcDispatch: list) { + sfcDispatch.setRole(role); + } + return list; } @Override @@ -360,6 +395,10 @@ public class SfcDispatchServiceImpl extends ServiceImpl singleUserResourceList = usMap.get(employee); @@ -464,7 +503,6 @@ public class SfcDispatchServiceImpl extends ServiceImpl routerList) { + public void sfcDispatch(String site, String user, ShopOrder shopOrderModel, Sfc sfcModel, List routerList) { LocalDateTime nowDate = LocalDateTime.now(); String router = routerList.get(0).getRouter(); @@ -244,6 +228,19 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService { //计算完成时间 //plannedCompleteDate = plannedStartDate.plusMinutes(prodHours.longValue()); + //查询工序所属车间 + String workCenter = null; + if (operation.contains("_")) { + workCenter = operation.split("_")[0]; + } else { + workCenter = operation; + } + String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter); + WorkCenter workCenterModel = workCenterService.getById(workCenterBo); + if (workCenterModel == null) { + throw BusinessException.build("生产车间【" +workCenter+ "】不存在"); + } + //派工数据 String dispatchNo = sfc + "-" + stepId; SfcDispatch sfcDispatchModel = new SfcDispatch(); 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 09272d10..f7401b83 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 @@ -41,16 +41,13 @@ public class UserResourceServiceImpl extends ServiceImpl findEmployeeList(String site) { - return userResourceMapper.findEmployeeList(site); + public List findEmployeeList(String site, String resourceType) { + return userResourceMapper.findEmployeeList(site, resourceType); } @Override diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index 0132e1fb..589e10b7 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -894,7 +894,7 @@ LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER' - WHERE L.SITE = #{site} AND L.STATUS = '802' + WHERE L.SITE = #{site} AND L.STATUS = '802' AND L.CALL_TYPE = 'MATERIAL' AND W.WORK_CENTER = #{workCenter} @@ -925,8 +925,8 @@ ) ZS ON ZS.SITE = L.SITE AND ZS.SFC = L.SFC INNER JOIN Z_SFC_DISPATCH ZD ON ZD.SITE = ZS.SITE AND ZD.SFC = ZS.SFC AND ZD.DISPATCH_SEQ = ZS.DISPATCH_SEQ WHERE W.QTY_ON_HAND > 0 - ) SIP - ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0 + ) SIP ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO + WHERE VIP.REQUIRED_QTY > 0 ORDER BY VIP.WORK_ORDER, VIP.ITEM @@ -942,7 +942,7 @@ LEFT JOIN ITEM_GROUP IG ON IG.HANDLE = IGM.ITEM_GROUP_BO INNER JOIN SHOP_ORDER SO ON SO.SITE = L.SITE AND SO.SHOP_ORDER = L.SHOP_ORDER LEFT JOIN CUSTOM_FIELDS CF ON CF.HANDLE = SO.HANDLE AND CF."ATTRIBUTE" = 'WORK_ORDER' - WHERE L.SITE = #{site} AND L.STATUS = '802' + WHERE L.SITE = #{site} AND L.STATUS = '802' AND L.CALL_TYPE = 'MATERIAL' AND W.WORK_CENTER = #{workCenter} @@ -973,8 +973,8 @@ ) ZS ON ZS.SITE = L.SITE AND ZS.SFC = L.SFC INNER JOIN Z_SFC_DISPATCH ZD ON ZD.SITE = ZS.SITE AND ZD.SFC = ZS.SFC AND ZD.DISPATCH_SEQ = ZS.DISPATCH_SEQ WHERE W.QTY_ON_HAND > 0 - ) SIP - ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0 + ) SIP ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO + WHERE VIP.REQUIRED_QTY > 0 ORDER BY VIP.WORK_ORDER, VIP.ITEM diff --git a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml index 87c458b0..938d184d 100644 --- a/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml +++ b/dispatch/src/main/resources/mapper/SfcDispatchMapper.xml @@ -52,6 +52,8 @@ + + @@ -985,17 +987,17 @@ SELECT WIP.*, CASE WHEN WIP.DISPATCH_SEQ = 1 THEN WIP.PLANNED_START_DATE ELSE V1.PLANNED_COMP_DATE END EARLIEST_START_DATE, CASE WHEN V2.HANDLE IS NOT NULL THEN V2.PLANNED_START_DATE ELSE WIP.PLANNED_COMP_DATE END LATEST_END_DATE, V1.STEP_ID PREPOSITION_STEP_ID, V1.OPERATION PREPOSITION_OPERATION, - CASE WHEN WIP.DISPATCH_SEQ = 1 OR V1.OTHER_1 = 'true' THEN N'是' ELSE N'否' END IS_COMPLETED, + CASE WHEN WIP.DISPATCH_SEQ = 1 OR V1.DISPATCH_STATUS = 'COMPLETE' THEN N'是' ELSE N'否' END IS_COMPLETED, CASE WHEN WIP.DISPATCH_STATUS = 'NEW' THEN N'新建' WHEN WIP.DISPATCH_STATUS = 'CANCEL' THEN N'取消' WHEN WIP.DISPATCH_STATUS = 'PAUSE' THEN N'暂停' WHEN WIP.DISPATCH_STATUS = 'RELEASE' THEN N'发布' - END AS STATUS_NAME + 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, 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, - CASE WHEN OTHER_1 = 'true' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.PLANNED_START_DATE, SD.PLANNED_COMP_DATE, SD.WORK_CENTER, SD.IS_DISPATCH, + 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.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ, - CASE WHEN SD.TURN_OPERATION = 'true' THEN N'是' ELSE N'否' END TURN_OPERATION, SD.BLANKING_SIZE, - CASE WHEN IM.LOT_SIZE = 1 THEN N'是' ELSE N'否' END IS_MAJOR, 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, + WR.WORK_CENTER RESOURCE_WORK_CENTER FROM Z_SFC_DISPATCH SD INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'WORK_ORDER' @@ -1037,6 +1039,9 @@ AND SD.OPERATION = #{operation} + + AND OT.DESCRIPTION = #{operationDescription} + AND SD.SFC = #{sfc} diff --git a/dispatch/src/main/resources/mapper/UserResourceMapper.xml b/dispatch/src/main/resources/mapper/UserResourceMapper.xml index 54bee48f..139db635 100644 --- a/dispatch/src/main/resources/mapper/UserResourceMapper.xml +++ b/dispatch/src/main/resources/mapper/UserResourceMapper.xml @@ -467,8 +467,10 @@ + +