From 76211d85fa898be9e08dc57d62150f1eaf7e27b6 Mon Sep 17 00:00:00 2001 From: zpl Date: Tue, 10 Aug 2021 22:13:09 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=8F=AB=E6=96=99PDA?= =?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/PrintLogServiceImpl.java | 2 +- .../controller/CallItemController.java | 24 ++++++++++++ .../dispatch/mapper/CallItemMapper.java | 2 + .../mesnac/dispatch/model/CallItem.java | 12 ++++++ .../dispatch/service/CallItemService.java | 8 ++++ .../service/impl/CallItemServiceImpl.java | 5 +++ .../main/resources/mapper/CallItemMapper.xml | 38 +++++++++++++++++++ 7 files changed, 90 insertions(+), 1 deletion(-) 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 e9ad3806..e8a4f5fb 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 @@ -134,6 +134,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/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 + + + From a5e0923fffff601bbeff6bdc91aebe4bf5d17e51 Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Wed, 11 Aug 2021 10:16:27 +0800 Subject: [PATCH 2/4] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/AbnormalBillMapper.xml | 2 +- .../service/impl/SplitSfcServiceImpl.java | 70 +++++++++---------- .../resources/mapper/SelfReportMapper.xml | 3 +- 3 files changed, 38 insertions(+), 37 deletions(-) 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/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 @@ From f4a23895e35cff047d727353838c9440fe70d9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Sun, 8 Aug 2021 13:43:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?pom=E9=94=99=E8=AF=AF=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- integration/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration/pom.xml b/integration/pom.xml index 78216c8d..640557f7 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -38,5 +38,9 @@ com.foreverwin.mesnac dispatch + + com.foreverwin.mesnac + common + \ No newline at end of file