From f7bf29a708080749e4792671b0ac1ba975c1f368 Mon Sep 17 00:00:00 2001 From: ruanqi Date: Tue, 22 Aug 2023 18:19:54 +0800 Subject: [PATCH] =?UTF-8?q?0412=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controller/PdaOrderController.java | 2 + .../production/dao/DailyPlanMapper.java | 2 + .../service/impl/DailyPlanServiceImpl.java | 40 ++++++++++++++----- .../resources/mapper/board/BoardMapper.xml | 15 +++---- .../mapper/production/DailyPlanMapper.xml | 10 +++-- 5 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/heai/modules/app/controller/PdaOrderController.java b/src/main/java/com/heai/modules/app/controller/PdaOrderController.java index 4d92afa..96daad5 100644 --- a/src/main/java/com/heai/modules/app/controller/PdaOrderController.java +++ b/src/main/java/com/heai/modules/app/controller/PdaOrderController.java @@ -101,6 +101,8 @@ public class PdaOrderController { ShopOrderData shopOrder = dailyPlanService.getTransfer(dailyPlanInData); return R.ok().put("row", shopOrder); } + + /** * @Method getShopOrder * @Description: 获取生产订单信息 diff --git a/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java b/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java index 09598d1..7dfcc43 100644 --- a/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java +++ b/src/main/java/com/heai/modules/production/dao/DailyPlanMapper.java @@ -84,6 +84,8 @@ public interface DailyPlanMapper { */ Integer checkELevels(@Param("site") String site , @Param("orderNo") String orderNo); + ShopOrderData checkShopOrderForTransfer(@Param("site") String site , @Param("orderNo") String orderNo); + List checkReceiveFlag(@Param("site") String site , @Param("seqNo") Integer seqNo); List checkNotInspectTransFer(@Param("site") String site , @Param("seqNo") Integer seqNo); void changeReceiveFlag(@Param("site") String site , @Param("seqNo") Integer seqNo, @Param("flag") String flag); diff --git a/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java b/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java index b355e46..17ef64e 100644 --- a/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java +++ b/src/main/java/com/heai/modules/production/service/impl/DailyPlanServiceImpl.java @@ -659,17 +659,31 @@ public class DailyPlanServiceImpl implements DailyPlanService { if("N".equals(shopOrderList.get(0).getNeedReceiveFlag())){ throw new RuntimeException("未通过实验室检验,请先检验!!"); } - Integer checkELevels=dailyPlanMapper.checkELevels(shopOrderList.get(0).getSite(),shopOrderList.get(0).getOrderNo()); - if(checkELevels!=null){ + // Integer checkELevels=dailyPlanMapper.checkELevels(shopOrderList.get(0).getSite(),shopOrderList.get(0).getOrderNo()); + // if(checkELevels!=null){ + // List check= dailyPlanMapper.checkReceiveFlag(shopOrderList.get(0).getSite(),shopOrderList.get(0).getSeqNo()); + // if(check.size()==0){ + // throw new RuntimeException("该派工单未检验,请先找实验室检验!!"); + // } + // } + // if(checkELevels==null&&!"Hunlian".equals(dailyPlanInData.getStatus())){ + // throw new RuntimeException("该通知单可能是混炼通知单或者通知单不存在!!"); + // } + // if("NotHunlian".equals(dailyPlanInData.getStatus())&&checkELevels==2){ + // throw new RuntimeException("该订单是混炼订单请用混炼通知单入库!"); + // } + + ShopOrderData checkShopOrder=dailyPlanMapper.checkShopOrderForTransfer(shopOrderList.get(0).getSite(),shopOrderList.get(0).getOrderNo()); + if(checkShopOrder!=null){ List check= dailyPlanMapper.checkReceiveFlag(shopOrderList.get(0).getSite(),shopOrderList.get(0).getSeqNo()); if(check.size()==0){ throw new RuntimeException("该派工单未检验,请先找实验室检验!!"); } } - if(checkELevels==null&&!"Hunlian".equals(dailyPlanInData.getStatus())){ + if(checkShopOrder==null&&!"Hunlian".equals(dailyPlanInData.getStatus())){ throw new RuntimeException("该通知单可能是混炼通知单或者通知单不存在!!"); } - if("NotHunlian".equals(dailyPlanInData.getStatus())&&checkELevels==2){ + if("NotHunlian".equals(dailyPlanInData.getStatus())&&(checkShopOrder.getPartNo().startsWith("RC")||checkShopOrder.getPartNo().startsWith("SC"))){ throw new RuntimeException("该订单是混炼订单请用混炼通知单入库!"); } // if("Hunlian".equals(dailyPlanInData.getStatus())&&checkELevels!=2){ @@ -1072,9 +1086,13 @@ public class DailyPlanServiceImpl implements DailyPlanService { dailyPlanMapper.saveSfdcTimeHistDataStart(sfdcTimeHistData); inData.setFlag("N"); dailyPlanMapper.updateStopWork(inData); - Integer eLevels=dailyPlanMapper.checkELevels(checkUserSeqNo.get(0).getSite(),checkUserSeqNo.get(0).getOrderNo()); + // Integer eLevels=dailyPlanMapper.checkELevels(checkUserSeqNo.get(0).getSite(),checkUserSeqNo.get(0).getOrderNo()); + ShopOrderData checkShopOrder=dailyPlanMapper.checkShopOrderForTransfer(checkUserSeqNo.get(0).getSite(),checkUserSeqNo.get(0).getOrderNo()); + if(checkShopOrder==null){ + throw new RuntimeException("erp生产订单已被删除!"); + } //----------更新订单工序最近开工时间 用于提示----------- - if(eLevels==0) { + if(!checkShopOrder.getPartNo().startsWith("SP")) { List checkSORoutingOutput = dailyPlanMapper.checkSORoutingOutput(checkUserSeqNo.get(0)); if (checkSORoutingOutput.size() == 0) { dailyPlanMapper.createSORoutingOutput(checkUserSeqNo.get(0)); @@ -1094,7 +1112,7 @@ public class DailyPlanServiceImpl implements DailyPlanService { } } } - if(eLevels==1) { + if(checkShopOrder.getPartNo().startsWith("SP")) { String transNo = dailyPlanMapper.getTransNo(); checkUserSeqNo.get(0).setTransNo(transNo); checkUserSeqNo.get(0).setToTypeFlag("硫化检验单"); @@ -1204,7 +1222,11 @@ public class DailyPlanServiceImpl implements DailyPlanService { inData.setFlag("N"); dailyPlanMapper.updateStopWork(inData); Integer eLevels=dailyPlanMapper.checkELevels(checkUserSeqNo.get(0).getSite(),checkUserSeqNo.get(0).getOrderNo()); - if(eLevels==1&&"Y".equals(inspectFlag)) { + ShopOrderData checkShopOrder=dailyPlanMapper.checkShopOrderForTransfer(checkUserSeqNo.get(0).getSite(),checkUserSeqNo.get(0).getOrderNo()); + if(checkShopOrder==null){ + throw new RuntimeException("erp生产订单已被删除!"); + } + if(checkShopOrder.getPartNo().startsWith("SP")&&"Y".equals(inspectFlag)) { String transNo = dailyPlanMapper.getTransNo(); checkUserSeqNo.get(0).setTransNo(transNo); checkUserSeqNo.get(0).setToTypeFlag("硫化检验单(重复)"); @@ -1216,7 +1238,7 @@ public class DailyPlanServiceImpl implements DailyPlanService { } //----------更新订单工序最近开工时间 用于提示----------- - if(eLevels==0) { + if(!checkShopOrder.getPartNo().startsWith("SP")) { List checkSORoutingOutput = dailyPlanMapper.checkSORoutingOutput(checkUserSeqNo.get(0)); if (checkSORoutingOutput.size() == 0) { dailyPlanMapper.createSORoutingOutput(checkUserSeqNo.get(0)); diff --git a/src/main/resources/mapper/board/BoardMapper.xml b/src/main/resources/mapper/board/BoardMapper.xml index fb55409..f05e220 100644 --- a/src/main/resources/mapper/board/BoardMapper.xml +++ b/src/main/resources/mapper/board/BoardMapper.xml @@ -76,11 +76,12 @@ @@ -105,7 +106,7 @@ a.QtyReported,a.QtyApprove,isnull(SOP.TotalFinishedQty,0) lastApproveQty,b.NeedDate as planFinishTime,dbo.Get_SORouting_ClosedFlag(a.site,a.OrderNo,a.ItemNo) as ClosedFlag from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo LEFT JOIN SORoutingOutput SOP ON a.site=SOP.site and a.OrderNo=SOP.OrderNo and SOP.itemNo=dbo.Get_SORouting_PreviousOperationItemNo(a.site,a.OrderNo,a.itemNo) - where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported ) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TRIMMING' + where a.partNo like 'FP%' and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported ) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TRIMMING' and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01' order by planFinishTime @@ -117,7 +118,7 @@ from SORouting a left join ShopOrder b on a.site=b.site and a.orderNo=b.orderNo LEFT JOIN SORoutingOutput SOP ON a.site=SOP.site and a.OrderNo=SOP.OrderNo and SOP.itemNo=dbo.Get_SORouting_PreviousOperationItemNo(a.site,a.OrderNo,a.itemNo) Left Join PartSubPropertiesValue as S90 On S90.Site=a.Site and S90.PartNo=a.PartNo and S90.PropertiesItemNo='SPECIAL CHECK' - where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='INSPECT' + where a.partNo like 'FP%' and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='INSPECT' and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01' order by planFinishTime @@ -135,7 +136,7 @@ Left Join PartSubPropertiesValue as S92 On S92.Site=a.Site and S92.PartNo=a.PartNo and S92.RecordType='P' and S92.SubCodeSeqNo=1 and S92.PropertiesItemNo='POST CURE-TEMP' Left Join PartSubPropertiesValue as S93 On S93.Site=a.Site and S93.PartNo=a.PartNo and S93.RecordType='P' and S93.SubCodeSeqNo=1 and S93.PropertiesItemNo='POST CURE-TIME' LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='MATERIAL' - where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TREAT' + where a.partNo like 'FP%' and (b.status not in ('已取消','已关闭','已停工','已计划') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='TREAT' and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0)>a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01' order by planFinishTime @@ -150,7 +151,7 @@ LEFT JOIN PartSubPropertiesValue p2 on p2.site=a.site and p2.PartNo=a.PartNo and p2.PropertiesItemNo='QTY' LEFT JOIN PartSubPropertiesValue p3 on p3.site=a.site and p3.PartNo=a.PartNo and p3.PropertiesItemNo='CARTON' LEFT JOIN PartSubPropertiesValue p4 on p4.site=a.site and p4.PartNo=a.PartNo and p4.PropertiesItemNo='BAG TYPE' - where b.E_Levels =0 and (b.status not in ('已取消','已关闭','已停工') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING' + where a.partNo like 'FP%' and (b.status not in ('已取消','已关闭','已停工') and a.QtyRequired>a.QtyReported) and dbo.Get_WorkCenter_ProLineNo(a.site,a.WorkCenterNo)='PACKING' and( (isnull(SOP.TotalFinishedQty,0)>0 and isnull(SOP.TotalFinishedQty,0) >a.QtyReported) or a.itemNo=10) and b.enterDate>'2022-01-01' order by planFinishTime diff --git a/src/main/resources/mapper/production/DailyPlanMapper.xml b/src/main/resources/mapper/production/DailyPlanMapper.xml index 91c1560..8cec812 100644 --- a/src/main/resources/mapper/production/DailyPlanMapper.xml +++ b/src/main/resources/mapper/production/DailyPlanMapper.xml @@ -47,7 +47,7 @@ and ${planStatus} - AND a.E_Levels=1 + AND a.PartNo like 'SP%' order by a.PlanStartDate @@ -238,7 +238,7 @@ left join CODetail cod on a.site=cod.site and a.orderRef1=cod.OrderNo and a.orderRef2= CONVERT(VARCHAR(10),cod.ItemNo) and uwc.WorkCenterNo is not null - and a.E_Levels =0 + and a.PartNo NOT like 'SP%' and a.PartNo NOT like 'RC%' and a.PartNo NOT like 'SC%' AND a.site = #{site} @@ -581,6 +581,10 @@ + +