diff --git a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml index e84dfa1e..14836bc4 100644 --- a/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml +++ b/anomaly/src/main/resources/mapper/AbnormalBillMapper.xml @@ -1014,6 +1014,6 @@ SELECT * FROM Z_ABNORMAL_BILL zab JOIN sfc s ON zab.SITE=s.SITE AND zab.SFC=s.SFC JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZABD.ABNORMAL_BILL_BO= ZAB.HANDLE - WHERE zab.SITE=#{site} AND zab.STATUS='G' AND zab."TYPE"='Z' AND s.QTY>1 AND (ZABD.ABNORMAL_METHOD='F' OR ZABD.ABNORMAL_METHOD='C') AND ZABD.ROUTER_BO IS NOT NULL ORDER BY ZABD.CLOSED_DATE_TIME DESC + WHERE zab.SITE=#{site} AND zab.STATUS='G' AND zab."TYPE"='Z' AND s.QTY>1 AND (ZABD.ABNORMAL_METHOD='F' OR ZABD.ABNORMAL_METHOD='C') ORDER BY ZABD.CLOSED_DATE_TIME DESC 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 index eeb9af99..f03c422d 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/UserService.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/UserService.java @@ -11,6 +11,7 @@ import java.util.List; * @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/PrintLogServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java index 6f50e552..b49c4d50 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java @@ -83,7 +83,7 @@ public class PrintLogServiceImpl extends ServiceImpl i JSONObject jsonObject = JSONObject.parseObject(post); Integer code = jsonObject.getInteger("code"); String msg = jsonObject.getString("msg"); - if (code == 500){ + if (code != 0){ throw BusinessException.build(msg); } // 更新打印记录:是否已打印、使用的打印机、打印次数 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 4b9a89e7..437da2fe 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 @@ -110,6 +110,30 @@ public class CallItemController { return R.ok(result); } + /** + * 查询叫料明细数据 + * + * @return + */ + @ResponseBody + @PostMapping("/findCallItemInfoList") + public R findCallItemInfoList(@RequestBody CallItem callItem){ + 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.findCallItemInfoList(callItem); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + return R.ok(result); + } + @ResponseBody @PostMapping("/callItem") public R callItem(@RequestBody List callItemList) { 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 f92639c7..4506b694 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 @@ -34,6 +34,8 @@ public interface CallItemMapper extends BaseMapper { List findCallItemDetailList(CallItem callItem); + List findCallItemInfoList(CallItem callItem); + List findCallItemDetailListByDispatchBo(@Param("site") String site, @Param("list") List list); void updateCallItemStatusByDispatchBo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/CallItem.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/CallItem.java index 2fefe482..2102550d 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/CallItem.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/model/CallItem.java @@ -142,6 +142,8 @@ public class CallItem extends Model { @TableField(exist = false) private String component; @TableField(exist = false) + private String componentDescription; + @TableField(exist = false) private String itemDescription; @TableField(exist = false) private String materialType; @@ -158,6 +160,8 @@ public class CallItem extends Model { @TableField(exist = false) private String workCenter; @TableField(exist = false) + private String workCenterDescription; + @TableField(exist = false) private String dispatchNo; @TableField(exist = false) private BigDecimal dispatchQty; @@ -384,6 +388,14 @@ public class CallItem extends Model { this.component = component; } + public String getComponentDescription() { + return componentDescription; + } + + public void setComponentDescription(String componentDescription) { + this.componentDescription = componentDescription; + } + public String getItemDescription() { return itemDescription; } 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 ce714f19..03e2fd95 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 @@ -58,6 +58,14 @@ public interface CallItemService extends IService { */ List findCallItemDetailListByDispatchBo(String site, List dispatchBoList); + /** + * 生产叫料PDA + * + * @param callItem + * @return + */ + List findCallItemInfoList(CallItem callItem); + /** * 叫料 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 6f7a510d..7aa4b9d7 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 @@ -135,6 +135,11 @@ public class CallItemServiceImpl extends ServiceImpl i return callItemMapper.findCallItemDetailListByDispatchBo(site, dispatchBoList); } + @Override + public List findCallItemInfoList(CallItem callItem) { + return callItemMapper.findCallItemInfoList(callItem); + } + @Override public void callItem(String site, String user, List callItemList) { if (callItemList == null || callItemList.size() <= 0) { 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 87a41f73..09272d10 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 @@ -1,9 +1,9 @@ package com.foreverwin.mesnac.dispatch.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.common.enums.HandleEnum; +import com.foreverwin.mesnac.common.service.UserService; import com.foreverwin.mesnac.dispatch.dto.UserResourceDto; import com.foreverwin.mesnac.dispatch.mapper.UserResourceMapper; import com.foreverwin.mesnac.dispatch.model.UserResource; @@ -13,7 +13,6 @@ import com.foreverwin.mesnac.meapi.service.NwaUserService; import com.foreverwin.mesnac.meapi.service.ResrceService; import com.foreverwin.modular.core.exception.BusinessException; 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; import org.springframework.transaction.annotation.Transactional; @@ -45,6 +44,10 @@ public class UserResourceServiceImpl extends ServiceImpl findEmployeeList(String site) { return userResourceMapper.findEmployeeList(site); @@ -62,7 +65,9 @@ public class UserResourceServiceImpl extends ServiceImpl hashMap = new HashMap<>();; - List nwaUserList = nwaUserService.selectList(null); + // List nwaUserList = nwaUserService.selectList(null); + List nwaUserList = userService.findList(null); + List userResourceList = userResourceMapper.findAll(site, resource, userId); hashMap.put("users",nwaUserList); hashMap.put("userResources",userResourceList); @@ -88,14 +93,15 @@ public class UserResourceServiceImpl extends ServiceImpl userByUserName = userService.findList(userResource.getUserId()); if("false".equals(userResource.getTemporaryUser()) && - userByUserName == null){ + userByUserName.size() <= 0){ throw BusinessException.build("第"+(i+1)+"行的用户不存在,必须为临时用户"); - }else if(userByUserName != null){ + }else if(userByUserName != null && userByUserName.size() > 0){ //userByUserName.setFullName(userResource.getUserDescription()); - userResource.setUserDescription(userByUserName.getFullName()); - nwaUserService.saveOrUpdate(userByUserName); + userResource.setUserDescription(userByUserName.get(0).getFullName()); + //nwaUserService.saveOrUpdate(userByUserName); } userResource.setStatus(userResourceDto.getStatus()); userResource.setHandle("UserResourceBo:"+userResource.getSite()+","+ diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index af07b7f5..14036eec 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -969,4 +969,42 @@ ON VIP.SITE = SIP.SITE AND VIP.ITEM_BO = SIP.ITEM_BO AND VIP.REQUIRED_QTY > 0 ORDER BY VIP.WORK_ORDER, VIP.ITEM + + + diff --git a/integration/pom.xml b/integration/pom.xml index c8f3bbba..640557f7 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -34,15 +34,13 @@ com.foreverwin.mesnac meapi - com.foreverwin.mesnac - common + dispatch - com.foreverwin.mesnac - dispatch + common \ 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 19800010..bff21257 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,7 +2,6 @@ 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; @@ -17,7 +16,7 @@ import java.util.List; * @author sungang * @since 2020-10-16 */ -public interface UsrService extends IService, UserService { +public interface UsrService extends IService { /** * 分页查询 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 b6484643..6b752c5b 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 @@ -4,6 +4,7 @@ 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.common.service.UserService; import com.foreverwin.mesnac.listener.mapper.UsrMapper; import com.foreverwin.mesnac.listener.model.SysUser; import com.foreverwin.mesnac.listener.model.Usr; @@ -26,7 +27,7 @@ import java.util.List; */ @Service @Transactional(rollbackFor = Exception.class) -public class UsrServiceImpl extends ServiceImpl implements UsrService { +public class UsrServiceImpl extends ServiceImpl implements UsrService,UserService { @Autowired diff --git a/listener/src/main/resources/mapper/UsrMapper.xml b/listener/src/main/resources/mapper/UsrMapper.xml index b40e7fb2..f61d2226 100644 --- a/listener/src/main/resources/mapper/UsrMapper.xml +++ b/listener/src/main/resources/mapper/UsrMapper.xml @@ -616,7 +616,12 @@ SELECT U.USER_ID USER_NAME,ZNU.FULL_NAME FULL_NAME FROM USR U INNER JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = U.USER_ID - WHERE U.SITE=#{site} AND U.USER_ID = #{user} + WHERE U.SITE=#{site} + + AND ( + U.USER_ID = #{user} + ) + 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 4850dd6b..4bf58e23 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 @@ -177,15 +177,12 @@ public class SplitSfcServiceImpl extends ServiceImpl i SplitSfcDto splitSfcDto=splitSfcMapper.getAbnormalQty(site,sfc,operation, abnormalNo); String routerBo = splitSfcDto.getRouterBo(); String ncCode = splitSfcDto.getNcCode(); - if (StringUtil.isBlank(routerBo)){ - throw new BaseException("异常处置未选择处置工艺路线"); - } if (StringUtil.isBlank(ncCode)){ throw new BaseException("异常处置未选择不良代码"); } BigDecimal sfcQty = new BigDecimal(sfcData.getQty()); if (new BigDecimal(splitSfcDto.getNcQty()).compareTo(sfcQty)>=0){ - throw new BaseException("质量异常数量不小于于产品条码的数量,不能拆分"); + throw new BaseException("质量异常数量大于等于于产品条码的数量,不能拆分"); } if (splitQty.compareTo(new BigDecimal(splitSfcDto.getNcQty()))>0){ throw new BaseException("拆分数量大于质量异常数量的数量,不能拆分"); @@ -206,37 +203,42 @@ public class SplitSfcServiceImpl extends ServiceImpl i Collection splitSfcResponses = splitService.splitSfc(splitSfcRequest); SplitSfcResponse splitSfcResponse = splitSfcResponses.iterator().next(); String newSfcRef = splitSfcResponse.getNewSfcRef(); - //记录不合格 - CreateNCRequest createNCRequest=new CreateNCRequest(); - createNCRequest.setQty(splitQty); - createNCRequest.setSfcRef(newSfcRef); - ProductionContext productionContext=new ProductionContext(); - StepIdentifier stepIdentifier=new StepIdentifier(); - stepIdentifier.setStepId(sfcData.getStepId()); - stepIdentifier.setOperationId(sfcData.getOperation()); - productionContext.setStepIdentifier(stepIdentifier); - List resourceBySfc = sfcCrossMapper.getResourceBySfc(site, sfc); - if (resourceBySfc.isEmpty()){ - throw new BaseException("产品不在工作中"); + String newSfc = StringUtil.trimHandle(newSfcRef); + + if(StringUtil.notBlank(routerBo)){ + //记录不合格 + CreateNCRequest createNCRequest=new CreateNCRequest(); + createNCRequest.setQty(splitQty); + createNCRequest.setSfcRef(newSfcRef); + ProductionContext productionContext=new ProductionContext(); + StepIdentifier stepIdentifier=new StepIdentifier(); + stepIdentifier.setStepId(sfcData.getStepId()); + stepIdentifier.setOperationId(sfcData.getOperation()); + productionContext.setStepIdentifier(stepIdentifier); + List resourceBySfc = sfcCrossMapper.getResourceBySfc(site, sfc); + if (resourceBySfc.isEmpty()){ + throw new BaseException("产品不在工作中"); + } + productionContext.setResourceRef(resourceBySfc.get(0).getResourceBo()); + createNCRequest.setProdCtx(productionContext); + createNCRequest.setNcCodeRef(HandleEnum.NC_CODE.getHandle(site,splitNcCode[0])); + ncProductionService.createNC(createNCRequest); + //不合格处置特殊工艺路线 + DispositionMultipleSfcsRequest dispositionSfcsRequest=new DispositionMultipleSfcsRequest(); + List sfcs=new ArrayList<>(); + sfcs.add(newSfcRef); + dispositionSfcsRequest.setSfcs(sfcs); + dispositionSfcsRequest.setBypassStepValidation(true); + DispositionSelection dispositionSelection=new DispositionSelection(); + Router maxRevisionRouter = routerService.getMaxRevisionRouter(site, StringUtil.trimHandle(routerBo)); + dispositionSelection.setRouterRef(maxRevisionRouter.getHandle()); + dispositionSfcsRequest.setDispositionSelection(dispositionSelection); + dispositionSfcsRequest.setProdCtx(new ProductionContext()); + ncProductionService.dispositionMultipleSfcs(dispositionSfcsRequest); + String workCenterBo = shopOrderService.getById(HandleEnum.SHOP_ORDER.getHandle(site, sfcData.getShopOrder())).getPlannedWorkCenterBo(); + sfcDispatchCommonService.saveSfcDispatch(site,CommonMethods.getUser(),StringUtil.trimHandle(workCenterBo),newSfc, sfcData.getShopOrder(),maxRevisionRouter.getHandle()); } - productionContext.setResourceRef(resourceBySfc.get(0).getResourceBo()); - createNCRequest.setProdCtx(productionContext); - createNCRequest.setNcCodeRef(HandleEnum.NC_CODE.getHandle(site,splitNcCode[0])); - ncProductionService.createNC(createNCRequest); - //不合格处置特殊工艺路线 - DispositionMultipleSfcsRequest dispositionSfcsRequest=new DispositionMultipleSfcsRequest(); - List sfcs=new ArrayList<>(); - sfcs.add(newSfcRef); - dispositionSfcsRequest.setSfcs(sfcs); - dispositionSfcsRequest.setBypassStepValidation(true); - DispositionSelection dispositionSelection=new DispositionSelection(); - Router maxRevisionRouter = routerService.getMaxRevisionRouter(site, StringUtil.trimHandle(routerBo)); - dispositionSelection.setRouterRef(maxRevisionRouter.getHandle()); - dispositionSfcsRequest.setDispositionSelection(dispositionSelection); - dispositionSfcsRequest.setProdCtx(new ProductionContext()); - ncProductionService.dispositionMultipleSfcs(dispositionSfcsRequest); SplitSfc splitSfc=new SplitSfc(); - String newSfc = StringUtil.trimHandle(newSfcRef); splitSfc.setHandle(HandleEnum.SPLIT_SFC.getHandle(site,newSfc)); splitSfc.setSite(site); splitSfc.setSfc(sfc); @@ -246,8 +248,6 @@ public class SplitSfcServiceImpl extends ServiceImpl i splitSfc.setCreateUser(CommonMethods.getUser()); 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(),maxRevisionRouter.getHandle()); return splitSfc; } catch (Exception e) { ExceptionUtil.throwException(e); diff --git a/quality/src/main/resources/mapper/SelfReportMapper.xml b/quality/src/main/resources/mapper/SelfReportMapper.xml index 91c0433b..1cb34a29 100644 --- a/quality/src/main/resources/mapper/SelfReportMapper.xml +++ b/quality/src/main/resources/mapper/SelfReportMapper.xml @@ -153,9 +153,10 @@