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 8fb9ff3c..d74e4366 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,6 +8,8 @@ package com.foreverwin.mesnac.common.constant; */ public interface Constants { + String OP_6106GX = "6106GX"; + String STATUS_NEW = "NEW"; String STATE_CONFIRM ="CONF"; String STATE_REJECT="REJ"; @@ -175,6 +177,4 @@ public interface Constants { */ String UNTREATED = "UN"; //未处理 String PROCESSED = "PR"; //已处理 - - } diff --git a/common/src/main/java/com/foreverwin/mesnac/common/dto/UsrDto.java b/common/src/main/java/com/foreverwin/mesnac/common/dto/UsrDto.java new file mode 100644 index 00000000..f87af383 --- /dev/null +++ b/common/src/main/java/com/foreverwin/mesnac/common/dto/UsrDto.java @@ -0,0 +1,29 @@ +package com.foreverwin.mesnac.common.dto; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-10 + */ +public class UsrDto { + + private String userName; + + private String fullName; + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } +} diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/UserService.java b/common/src/main/java/com/foreverwin/mesnac/common/service/UserService.java new file mode 100644 index 00000000..eeb9af99 --- /dev/null +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/UserService.java @@ -0,0 +1,17 @@ +package com.foreverwin.mesnac.common.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.common.dto.UsrDto; + +import java.util.List; + +/** + * @Description TODO + * @Author zhaojiawei + * @Since 2021-08-10 + */ +public interface UserService { + List findList(String user); + + IPage findPage(IPage page,String user); +} diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java index d8091ca0..048a8df8 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java @@ -370,7 +370,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImplanomaly + + com.foreverwin.mesnac + listener + + com.foreverwin.mesnac quartz diff --git a/console/src/main/resources/application-qas.yml b/console/src/main/resources/application-qas.yml index 076f5a6b..54b8bdcd 100644 --- a/console/src/main/resources/application-qas.yml +++ b/console/src/main/resources/application-qas.yml @@ -33,7 +33,7 @@ ftp: #打印服务器配置 print: - server: http://localhost:8080/CodeSoftPrintWeb/printService + server: http://172.16.251.188:8022/print/mesnacprint activeMq: sendWeChatMessage: tcp://localhost:61616?wireFormat.maxInactivityDuration=0 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 5fb59ea8..03ccfc2e 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 @@ -4,6 +4,7 @@ import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.common.service.UserService; import com.foreverwin.mesnac.dispatch.dto.UserResourceDto; import com.foreverwin.mesnac.dispatch.model.UserResource; import com.foreverwin.mesnac.dispatch.service.UserResourceService; @@ -28,6 +29,10 @@ public class UserResourceController { @Autowired public UserResourceService userResourceService; + @Autowired + public UserService userService; + + /** * 根据id查询 * @@ -139,7 +144,7 @@ public class UserResourceController { return R.ok(userResourceService.findAll(userResourceDto)); } - @PostMapping("saveAll") + @PostMapping("/saveAll") public R saveAll(@RequestBody Map param){ String resource = (String) param.get("resource"); String user = (String) param.get("user"); @@ -162,4 +167,15 @@ public class UserResourceController { } } + @GetMapping("/findList") + public R findList(String user){ + return R.ok(userService.findList(user)); + } + + @GetMapping("/findPage") + public R page(FrontPage frontPage) { + String globalQuery = frontPage.getGlobalQuery(); + return R.ok(userService.findPage(frontPage.getPagePlus(), globalQuery)); + } + } \ No newline at end of file diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java index 1da336de..d1f0bec7 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/ShopOrderReleaseServiceImpl.java @@ -94,13 +94,6 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService { } for (ShopOrderRelease shopOrderReleaseModel : shopOrderList) { - String workCenter = shopOrderReleaseModel.getWorkCenter(); - String workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter); - WorkCenter workCenterModel = workCenterService.getById(workCenterBo); - if (workCenterModel == null) { - throw new BaseException("工作中心[" + workCenter + "]不存在"); - } - //查询工单信息 String shopOrder = shopOrderReleaseModel.getShopOrder(); String shopOrderBo = shopOrderReleaseModel.getShopOrderBo(); @@ -133,6 +126,23 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService { throw new BaseException("工艺路线[" +StringUtils.trimHandle(routerBo)+ "]主数据不完整,请确认"); } + //获取车间 + String workCenter = null; + String workCenterBo = null; + for (RouterDTO routerDTO: routerList) { + String operation = routerDTO.getOperation(); + if (!Constants.OP_6106GX.equals(operation) && operation.contains("_")) { + workCenter = operation.split("_")[0]; + + workCenterBo = HandleEnum.WORK_CENTER.getHandle(site, workCenter); + WorkCenter workCenterModel = workCenterService.getById(workCenterBo); + if (workCenterModel == null) { + throw BusinessException.build("生产车间【" +workCenter+ "】不存在"); + } + break; + } + } + //工单下达 ReleaseShopOrderResponse response = null; try { diff --git a/dispatch/src/main/resources/mapper/ShopOrderReleaseMapper.xml b/dispatch/src/main/resources/mapper/ShopOrderReleaseMapper.xml index 8636ef4f..f45b7dc7 100644 --- a/dispatch/src/main/resources/mapper/ShopOrderReleaseMapper.xml +++ b/dispatch/src/main/resources/mapper/ShopOrderReleaseMapper.xml @@ -34,7 +34,7 @@ FROM SHOP_ORDER SO INNER JOIN ITEM IM ON SO.PLANNED_ITEM_BO = IM.HANDLE INNER JOIN STATUS ST ON SO.STATUS_BO = ST.HANDLE AND ST.STATUS_GROUP = 'ORDERS' - INNER JOIN ROUTER RT ON SO.PLANNED_ROUTER_BO = RT.HANDLE + INNER JOIN ROUTER RT ON SO.PLANNED_ROUTER_BO = RT.HANDLE OR (SO.PLANNED_ROUTER_BO = 'RouterBO:'||RT.SITE||','||RT.ROUTER||','||RT.ROUTER_TYPE||',#' AND RT.CURRENT_REVISION = 'true') INNER JOIN ROUTER_OPERATION RO ON RT.ENTRY_ROUTER_STEP_BO = RO.ROUTER_STEP_BO INNER JOIN OPERATION OP ON SO.SITE = OP.SITE AND SPLIT(RO.OPERATION_BO,2) = OP.OPERATION AND OP.CURRENT_REVISION = 'true' LEFT JOIN ( 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 d4c2d035..d0dbe19b 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 @@ -442,13 +442,13 @@ public class InterfaceServiceImpl implements InterfaceService { * 2.MES资源类型=生产车间_ERP工作中心 * 3.MES资源类型=MES工序 */ - String erpWorkCenter = componentDto.getOPERATION(); - if (StringUtil.isBlank(erpWorkCenter)) { - throw BusinessException.build("BOM节点下字段【OPERATION】不能为空!"); + String stepId = componentDto.getSTEP_ID(); + if (StringUtil.isBlank(stepId)) { + throw BusinessException.build("步骤标示不能为空!"); } - Operation operationModel = operationService.queryOperationByErpWorkCenter(site, erpWorkCenter); + Operation operationModel = operationService.getOperationByRouterStepId(site, bom, stepId); if (operationModel == null) { - throw BusinessException.build("ERP工作中心【" +erpWorkCenter+"】对应的MES工序未维护"); + throw BusinessException.build("步骤标识【"+stepId+"】在工艺路线【"+bom+"】未到对应的工序"); } String operationBo = operationModel.getHandle(); @@ -532,10 +532,21 @@ public class InterfaceServiceImpl implements InterfaceService { String stepId = routerStepDto.getSTEP_ID(); String erpWorkCenter = routerStepDto.getOPERATION().trim(); + if (StringUtil.isBlank(entryRouterStep)) { + entryRouterStep = stepId; + } + + //上一步骤添加当前步骤为下一步骤 + if (i > 0) { + RouterNextStep routerNextStep = new RouterNextStep(); + routerNextStep.setNextStepId(stepId); + routerStepList.get(i - 1).getRouterNextStepList().add(routerNextStep); + } + String operation = null; String operationBo = null; if (StringUtil.isBlank(erpWorkCenter)) { - operation = (i == 0) ? "HJ01_6106GX" : "6106GX"; + operation = Constants.OP_6106GX; Operation operationModel = operationService.getCurrentRevisionRef(site, operation); if (operationModel == null) { throw BusinessException.build("工序编号【" +operation+ "】不存在"); @@ -543,19 +554,6 @@ public class InterfaceServiceImpl implements InterfaceService { operation = operationModel.getOperation(); operationBo = operationModel.getHandle(); } else { - - if (StringUtil.isBlank(entryRouterStep)) { - entryRouterStep = stepId; - } - - //上一步骤添加当前步骤为下一步骤 - if (i > 0) { - RouterNextStep routerNextStep = new RouterNextStep(); - routerNextStep.setNextStepId(stepId); - routerStepList.get(i - 1).getRouterNextStepList().add(routerNextStep); - } - - /** * 工序参数说明: * 1.接口传过来的参数是ERP工作中心 @@ -680,6 +678,18 @@ public class InterfaceServiceImpl implements InterfaceService { if (StringUtil.isBlank(plannedItem)) { throw BusinessException.build("工单的计划物料不能拿为空"); } + + //查询物料清单和工艺路线 + Bom bomModel = bomService.getMaxRevisionBom(site, plannedBom); + if (bomModel == null) { + throw BusinessException.build("工单【" +shopOrder+ "】的物料清单未同步!"); + } + + Router routerModel = routerService.getMaxRevisionRouter(site, plannedRouter); + if (routerModel == null) { + throw BusinessException.build("工单【" +shopOrder+ "】的工艺路线未同步!"); + } + String plannedItemBo = HandleEnum.ITEM.getHandle(site, plannedItem, "A"); String plannedBomBo = HandleEnum.BOM.getHandle(site, plannedBom, bomType, "#"); String plannedRouterBo = HandleEnum.ROUTER.getHandle(site, plannedRouter, routerType, "#"); diff --git a/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java b/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java index 4a4e676f..3eda5db2 100644 --- a/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java +++ b/listener/src/main/java/com/foreverwin/mesnac/listener/mapper/UsrMapper.java @@ -1,6 +1,8 @@ package com.foreverwin.mesnac.listener.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.common.dto.UsrDto; import com.foreverwin.mesnac.listener.model.SysUser; import com.foreverwin.mesnac.listener.model.Usr; import org.apache.ibatis.annotations.Param; @@ -21,4 +23,8 @@ public interface UsrMapper extends BaseMapper { List selectListForPd(@Param("site") String site); /*List userList(Usr user);*/ + List findList(@Param("site")String site,@Param("user")String user); + + IPage findPage(IPage page,@Param("site")String site,@Param("user")String user); + } \ No newline at end of file diff --git a/listener/src/main/java/com/foreverwin/mesnac/listener/service/UsrService.java b/listener/src/main/java/com/foreverwin/mesnac/listener/service/UsrService.java index bff21257..19800010 100644 --- a/listener/src/main/java/com/foreverwin/mesnac/listener/service/UsrService.java +++ b/listener/src/main/java/com/foreverwin/mesnac/listener/service/UsrService.java @@ -2,6 +2,7 @@ package com.foreverwin.mesnac.listener.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.mesnac.common.service.UserService; import com.foreverwin.mesnac.listener.model.SysUser; import com.foreverwin.mesnac.listener.model.Usr; import com.foreverwin.modular.core.util.FrontPage; @@ -16,7 +17,7 @@ import java.util.List; * @author sungang * @since 2020-10-16 */ -public interface UsrService extends IService { +public interface UsrService extends IService, UserService { /** * 分页查询 diff --git a/listener/src/main/java/com/foreverwin/mesnac/listener/service/impl/UsrServiceImpl.java b/listener/src/main/java/com/foreverwin/mesnac/listener/service/impl/UsrServiceImpl.java index 51100e8b..b6484643 100644 --- a/listener/src/main/java/com/foreverwin/mesnac/listener/service/impl/UsrServiceImpl.java +++ b/listener/src/main/java/com/foreverwin/mesnac/listener/service/impl/UsrServiceImpl.java @@ -3,10 +3,12 @@ package com.foreverwin.mesnac.listener.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.foreverwin.mesnac.common.dto.UsrDto; import com.foreverwin.mesnac.listener.mapper.UsrMapper; import com.foreverwin.mesnac.listener.model.SysUser; import com.foreverwin.mesnac.listener.model.Usr; import com.foreverwin.mesnac.listener.service.UsrService; +import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -49,6 +51,18 @@ public class UsrServiceImpl extends ServiceImpl implements UsrSe return usrMapper.selectListForPd(site); } + @Override + public List findList(String user) { + String site = CommonMethods.getSite(); + return usrMapper.findList(site,user); + } + + @Override + public IPage findPage(IPage page, String user) { + String site = CommonMethods.getSite(); + return usrMapper.findPage(page,site,user); + } + /* @Override public List userList(Usr user) { String site = CommonMethods.getSite(); diff --git a/listener/src/main/resources/mapper/UsrMapper.xml b/listener/src/main/resources/mapper/UsrMapper.xml index b4fe79c6..b40e7fb2 100644 --- a/listener/src/main/resources/mapper/UsrMapper.xml +++ b/listener/src/main/resources/mapper/UsrMapper.xml @@ -29,6 +29,12 @@ + + + + + + HANDLE, CHANGE_STAMP, SITE, USER_ID, CURRENT_OPERATION_BO, CURRENT_RESOURCE_BO, CREATED_DATE_TIME, MODIFIED_DATE_TIME, BADGE_NUMBER, EMPLOYEE_NUMBER, HIRE_DATE, TERMINATION_DATE, ALLOW_CLOCK_IN_NON_PROD, ACTION_CLOCK_OUT_SFC, CLOCK_IN_OUT_RANGE, ALLOW_SUP_TIME_EDIT_APPR, APPR_REQ_FOR_EXPORT, AUTO_CLOCK_OUT, CLOCK_IN_CONTROL, DEFAULT_WORK_CENTER_BO, ERP_PERSONNEL_NUMBER, ERP_USER @@ -606,5 +612,23 @@ ) + + diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java index 125724c8..6351b508 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/OperationMapper.java @@ -29,5 +29,5 @@ public interface OperationMapper extends BaseMapper { IPage selectOperationStep( IPage page, @Param("locale") String locale,@Param("ew") Wrapper wrapper); - + Operation selectOperationByRouterStepId(@Param("site") String site, @Param("router") String router, @Param("stepId") String stepId); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java index c641d3fe..66826b7d 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/OperationService.java @@ -40,4 +40,13 @@ public interface OperationService extends IService { */ Operation queryOperationByErpWorkCenter(String site, String erpWorkCenter); + /** + * 查询工序By 工艺路线&步骤标识 + * + * @param site + * @param router + * @param stepId + * @return + */ + Operation getOperationByRouterStepId(String site, String router, String stepId); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java index 1c894695..921bcfb9 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/OperationServiceImpl.java @@ -66,7 +66,10 @@ public class OperationServiceImpl extends ServiceImpl - + diff --git a/pom.xml b/pom.xml index 64dc68e7..ab5c5d57 100644 --- a/pom.xml +++ b/pom.xml @@ -132,6 +132,12 @@ ${project.version} + + com.foreverwin.mesnac + listener + ${project.version} + + com.foreverwin.mesnac dataimport diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java index cd01bbea..a9ae99cb 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/SplitSfcController.java @@ -26,9 +26,9 @@ public class SplitSfcController { @ResponseBody @GetMapping("/getSfcData") - public R getSfcData(String sfc){ + public R getSfcData(SfcDto dto){ SfcDto result; - result = splitSfcService.getSfcData(sfc); + result = splitSfcService.getSfcData(dto); return R.ok(result); } @@ -49,7 +49,7 @@ public class SplitSfcController { @ResponseBody @GetMapping("/splitSfc") - public R getSfcData(SfcDto sfcDto){ + public R splitSfc(SfcDto sfcDto){ return R.ok( splitSfcService.splitSfc(sfcDto)); } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java b/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java index 3ac0c6a3..4ef0f0ca 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/mapper/SplitSfcMapper.java @@ -20,5 +20,5 @@ public interface SplitSfcMapper extends BaseMapper { SfcDto getSfcData(@Param("handle") String handle); - SplitSfcDto getAbnormalQty(@Param("site")String site, @Param("sfc")String sfc, @Param("operation") String operation); + SplitSfcDto getAbnormalQty(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation,@Param("abnormalNo") String abnormalNo); } \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java index 7a7e9309..48bb4234 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/SplitSfcService.java @@ -27,7 +27,7 @@ public interface SplitSfcService extends IService { List selectList(SplitSfc splitSfc); - SfcDto getSfcData(String sfc); + SfcDto getSfcData(SfcDto dto); SfcDto getGoodSfcData(String sfc); diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java index ca2dd264..4850dd6b 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/SplitSfcServiceImpl.java @@ -73,9 +73,15 @@ public class SplitSfcServiceImpl extends ServiceImpl i } @Override - public SfcDto getSfcData(String sfc) { + public SfcDto getSfcData(SfcDto dto) { String site = CommonMethods.getSite(); - String handle = HandleEnum.SFC.getHandle(site, sfc); + String handle = HandleEnum.SFC.getHandle(site, dto.getSfc()); + if (StringUtil.isBlank(dto.getSfc())){ + throw new BaseException("产品条码不能为空"); + } + if (StringUtil.isBlank(dto.getAbnormalNo())){ + throw new BaseException("异常单号不能为空"); + } //根据sfc找工单等信息 SfcDto sfcData = splitSfcMapper.getSfcData(handle); if (sfcData==null){ @@ -83,7 +89,7 @@ public class SplitSfcServiceImpl extends ServiceImpl i } String operation = sfcData.getOperation(); //查询质量异常记录数量 - SplitSfcDto sfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation); + SplitSfcDto sfcDto=splitSfcMapper.getAbnormalQty(site,dto.getSfc(),operation,dto.getAbnormalNo()); if (sfcDto==null){ throw new BaseException("未找到闭环关闭的质量异常"); } @@ -154,6 +160,10 @@ public class SplitSfcServiceImpl extends ServiceImpl i public SplitSfc splitSfc(SfcDto sfcDto){ String site = CommonMethods.getSite(); String sfc = sfcDto.getSfc(); + String abnormalNo = sfcDto.getAbnormalNo(); + if (StringUtil.isBlank(abnormalNo)){ + throw new BaseException("异常单号不能为空"); + } String handle = HandleEnum.SFC.getHandle(site, sfc); BigDecimal splitQty = new BigDecimal(sfcDto.getQty()); @@ -164,7 +174,7 @@ public class SplitSfcServiceImpl extends ServiceImpl i throw new BaseException("未找到产品条码信息"); } //查询质量异常记录数量 处置工艺路线及不良代码 - SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation); + SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo); String routerBo = splitSfcDto.getRouterBo(); String ncCode = splitSfcDto.getNcCode(); if (StringUtil.isBlank(routerBo)){ @@ -237,7 +247,7 @@ public class SplitSfcServiceImpl extends ServiceImpl i splitSfc.setCreatedDateTime(LocalDateTime.now()); save(splitSfc); String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo(); - sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),newSfc, sfcData.getShopOrder(),routerBo); + sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle()); return splitSfc; } catch (Exception e) { ExceptionUtil.throwException(e); diff --git a/production/src/main/resources/mapper/SfcScrapMapper.xml b/production/src/main/resources/mapper/SfcScrapMapper.xml index 754aa1bc..dd00b909 100644 --- a/production/src/main/resources/mapper/SfcScrapMapper.xml +++ b/production/src/main/resources/mapper/SfcScrapMapper.xml @@ -431,12 +431,12 @@ SELECT zab.NC_QTY,zsbd.ROUTER_BO,zab.NC_CODE,zab.ABNORMAL_NO FROM Z_ABNORMAL_BILL zab JOIN Z_ABNORMAL_BILL_DISPOSE zsbd ON zab.HANDLE=ZSBD.ABNORMAL_BILL_BO - WHERE ZAB.SFC=#{sfc} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='G' AND zab."TYPE"='Z' AND (zsbd.ABNORMAL_METHOD='F' OR zsbd.ABNORMAL_METHOD='C') + WHERE ZAB.SFC=#{sfc} AND zab.ABNORMAL_NO=#{abnormalNo} AND zab.SITE=#{site} AND ZAB.OPERATION=#{operation} AND zab.STATUS='G' AND zab."TYPE"='Z' AND (zsbd.ABNORMAL_METHOD='F' OR zsbd.ABNORMAL_METHOD='C')