From d29583f73c440c7d24a2555ff06923fc0593c631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Thu, 8 Jul 2021 14:45:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=8A=9F=E8=83=BD=E3=80=81=E8=B4=A8=E9=87=8F?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8F=90=E6=8A=A5bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AbnormalBillController.java | 82 +++++------- .../anomaly/service/AbnormalBillService.java | 12 ++ .../service/impl/AbnormalBillServiceImpl.java | 117 +++++++++++++++--- .../mapper/AbnormalBillDisposeMapper.xml | 7 +- .../mesnac/common/constant/Constants.java | 8 ++ .../meapi/controller/ItemController.java | 1 + .../meapi/controller/RouterController.java | 2 + .../meapi/controller/ShopOrderController.java | 4 +- .../mesnac/meapi/mapper/ShopOrderMapper.java | 2 +- .../meapi/service/ShopOrderService.java | 2 +- .../service/impl/ShopOrderServiceImpl.java | 4 +- .../main/resources/mapper/RouterMapper.xml | 4 +- .../main/resources/mapper/ShopOrderMapper.xml | 3 + 13 files changed, 171 insertions(+), 77 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java index b65ef514..2a22581c 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java @@ -6,20 +6,11 @@ import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto; import com.foreverwin.mesnac.anomaly.model.AbnormalBill; import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose; import com.foreverwin.mesnac.anomaly.service.AbnormalBillService; -import com.foreverwin.mesnac.common.util.StringUtil; -import com.foreverwin.mesnac.meapi.model.DataField; -import com.foreverwin.mesnac.meapi.model.NcCode; -import com.foreverwin.mesnac.meapi.model.WorkCenter; -import com.foreverwin.mesnac.meapi.service.DataFieldListService; -import com.foreverwin.mesnac.meapi.service.NcCodeService; -import com.foreverwin.mesnac.meapi.service.WorkCenterService; -import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.HashMap; import java.util.List; /** @@ -34,14 +25,6 @@ public class AbnormalBillController { @Autowired private AbnormalBillService abnormalBillService; - @Autowired - private NcCodeService ncCodeService; - - @Autowired - private WorkCenterService workCenterService; - - @Autowired - private DataFieldListService dataFieldListService; /** * 根据id查询 @@ -170,37 +153,9 @@ public class AbnormalBillController { */ @GetMapping("/init") public R init(String messageType){ - HashMap hashMap = new HashMap<>(); - String site = CommonMethods.getSite(); - //消息类型 - if(!StringUtil.isBlank(messageType)){ - List ncByNG = ncCodeService.findNcByNG(messageType,null); - hashMap.put("ncByNG",ncByNG); - } - //工作中心 - WorkCenter workCenter = new WorkCenter(); - workCenter.setWcCategory("LEVEL4"); - workCenter.setSite(site); - List workCenterList = workCenterService.selectList(workCenter); - hashMap.put("workCenter",workCenterList); - //原因分类 - NcCode ncCode = new NcCode(); - ncCode.setSite(site); - ncCode.setNcCategory("REPAIR"); - List ncCodeList = ncCodeService.selectList(ncCode); - hashMap.put("causeType",ncCodeList); - //责任部门 - DataField dataField = new DataField(); - dataField.setSite(site); - dataField.setDataField("RESPONSIBILITY_DEPARTMENT"); - List dutyDepartList = dataFieldListService.findDataFieldListById(dataField); - hashMap.put("dutyDepart",dutyDepartList); - //责任分类 - dataField.setDataField("RESPONSIBILITY_TYPE"); - List dutyTypeList = dataFieldListService.findDataFieldListById(dataField); - hashMap.put("dutyType",dutyTypeList); - return R.ok(hashMap); + + return R.ok(abnormalBillService.init(messageType)); } // @GetMapping("/findAllUserByUserGroup") @@ -269,21 +224,50 @@ public class AbnormalBillController { return R.ok(abnormalBillService.findAllByAbnormalNo(abnormalBill)); } + /** + * 响应处理 + * @param abnormalBill + * @return + */ @GetMapping("/resProcessing") public R resProcessing(AbnormalBill abnormalBill){ abnormalBillService.resProcessing(abnormalBill); return R.ok(); } - @GetMapping("programConfirm") + /** + * 方案确认 + * @param abnormalBill + * @param abnormalBillDispose + * @return + */ + @GetMapping("/programConfirm") public R programConfirm(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose){ abnormalBillService.programConfirm(abnormalBill,abnormalBillDispose); return R.ok(); } - @GetMapping("dutyConfirm") + /** + * 判责提交 + * @param abnormalBill + * @param abnormalBillDispose + * @return + */ + @GetMapping("/dutyConfirm") public R dutyConfirm(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose){ abnormalBillService.dutyConfirm(abnormalBill,abnormalBillDispose); return R.ok(); } + + /** + * 闭环关闭 + * @param abnormalBill + * @param abnormalBillDispose + * @return + */ + @GetMapping("/anomalyShutDown") + public R anomalyShutDown(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose){ + abnormalBillService.anomalyShutDown(abnormalBill,abnormalBillDispose); + return R.ok(); + } } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java index 51226c30..4b39336f 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/AbnormalBillService.java @@ -8,6 +8,7 @@ import com.foreverwin.mesnac.anomaly.model.AbnormalBill; import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose; import com.foreverwin.modular.core.util.FrontPage; +import java.util.HashMap; import java.util.List; /** @@ -51,6 +52,10 @@ public interface AbnormalBillService extends IService { String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose); + /** + * 初始化 + */ + HashMap init(String messageType); /** * 待办事项 * @param abnormalBillDto @@ -81,4 +86,11 @@ public interface AbnormalBillService extends IService { */ void dutyConfirm(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose); + /** + * 闭环关闭 + * @param abnormalBill + * @param abnormalBillDispose + */ + void anomalyShutDown(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose); + } \ No newline at end of file diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index eb6e8a6c..1187a198 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -9,13 +9,13 @@ import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillDisposeMapper; import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper; import com.foreverwin.mesnac.anomaly.model.*; import com.foreverwin.mesnac.anomaly.service.*; +import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.helper.NextNumberHelper; import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.meapi.mapper.*; import com.foreverwin.mesnac.meapi.model.*; -import com.foreverwin.mesnac.meapi.service.NcCodeService; -import com.foreverwin.mesnac.meapi.service.NwaUserService; +import com.foreverwin.mesnac.meapi.service.*; import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; @@ -25,10 +25,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; +import java.util.*; /** *

@@ -86,6 +83,16 @@ public class AbnormalBillServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, AbnormalBill abnormalBill) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -179,6 +186,41 @@ public class AbnormalBillServiceImpl extends ServiceImpl init(String messageType) { + HashMap hashMap = new HashMap<>(); + String site = CommonMethods.getSite(); + //消息类型 + if(!StringUtil.isBlank(messageType)){ + List ncByNG = ncCodeService.findNcByNG(messageType,null); + + hashMap.put("ncByNG",ncByNG); + } + //工作中心 + WorkCenter workCenter = new WorkCenter(); + workCenter.setWcCategory("LEVEL4"); + workCenter.setSite(site); + List workCenterList = workCenterService.selectList(workCenter); + hashMap.put("workCenter",workCenterList); + //原因分类 + NcCode ncCode = new NcCode(); + ncCode.setSite(site); + ncCode.setNcCategory("REPAIR"); + List ncCodeList = ncCodeService.selectList(ncCode); + hashMap.put("causeType",ncCodeList); + //责任部门 + DataField dataField = new DataField(); + dataField.setSite(site); + dataField.setDataField("RESPONSIBILITY_DEPARTMENT"); + List dutyDepartList = dataFieldListService.findDataFieldListById(dataField); + hashMap.put("dutyDepart",dutyDepartList); + //责任分类 + dataField.setDataField("RESPONSIBILITY_TYPE"); + List dutyTypeList = dataFieldListService.findDataFieldListById(dataField); + hashMap.put("dutyType",dutyTypeList); + return hashMap; + } + @Override public List backLog(AbnormalBillDto abnormalBillDto) { String language = LocaleContextHolder.getLocale().getLanguage(); @@ -206,7 +248,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl routers = routerService.selectList(router); + if(routers == null || routers.size() == 0){ + throw BusinessException.build("该返修工艺不存在"); + } } //判断返修工单是否正确 - ShopOrder shopOrder = shopOrderMapper.selectById(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBillDispose.getResolveShopOrder())); - if(shopOrder == null){ - throw BusinessException.build("该返修工单不存在"); + if(!StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder())){ + ShopOrder shopOrder = shopOrderMapper.selectById(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBillDispose.getResolveShopOrder())); + if(shopOrder == null){ + throw BusinessException.build("该返修工单不存在"); + } } //发送用户 String[] split = abnormalBillDispose.getResolveSendUser().split(","); @@ -239,7 +292,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl dutyCauseType,List dutyType) { String site = CommonMethods.getSite(); @@ -401,7 +486,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl @@ -656,6 +655,6 @@ ZAB.PB_PHOTOSHOP ,ZABD.DUTY_CAUSE_DESCRIPTION ,ZABD.DUTY_CAUSE_TYPE ,ZABD.DUTY_DEPART , ZABD.DUTY_SEND_USER_GROUP ,ZABD.DUTY_TYPE ,ZABD.PRINCIPAL_USER ,ZABD.ABNORMAL_METHOD , R.ROUTER ,ZABD.RESOLVE_SHOP_ORDER ,ZABD.RESOLVE_REMARK ,ZABD.RESOLVE_SEND_USER , - ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,R.HANDLE + ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE 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 c0025909..527698f5 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 @@ -17,6 +17,14 @@ public interface Constants { String STATUS_Y = "Y"; String STATUS_N = "N"; + //异常单状态 + String NEW = "N"; + String RESPONSE = "X"; + String PROGRAM_CONFIRM = "F"; + String CORRECTION_CONFIRM = "J"; + String CANCEL = "Q"; + String SHUT_DOWN = "G"; + //任务编号常量 String RESOURCE_INSPECT_TASK = "RESOURCE_INSPECT_TASK"; diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java index dff9be55..04cc4158 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ItemController.java @@ -53,6 +53,7 @@ public class ItemController { String site = CommonMethods.getSite(); item.setSite(site); + item.setCurrentRevision("true"); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.setEntity(item); if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/RouterController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/RouterController.java index 4fdf115e..de597e9e 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/RouterController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/RouterController.java @@ -65,6 +65,8 @@ public class RouterController { public R page(FrontPage frontPage, Router router){ IPage result; QueryWrapper queryWrapper = new QueryWrapper<>(); + String site = CommonMethods.getSite(); + router.setSite(site); queryWrapper.setEntity(router); if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { //TODO modify global query diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java index b427be00..7867dcee 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ShopOrderController.java @@ -75,8 +75,8 @@ public class ShopOrderController { * @return */ @GetMapping("/findById") - public R findById(String handle){ - return R.ok(shopOrderService.findById(handle)); + public R findById(String handle,String plannedItemBo){ + return R.ok(shopOrderService.findById(handle,plannedItemBo)); } /** diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ShopOrderMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ShopOrderMapper.java index 46305c01..e7d4e1b8 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ShopOrderMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/ShopOrderMapper.java @@ -17,7 +17,7 @@ import org.springframework.stereotype.Repository; @Repository public interface ShopOrderMapper extends BaseMapper { - ShopOrder findById(@Param("handle")String handle,@Param("status501")String status501); + ShopOrder findById(@Param("handle")String handle,@Param("status501")String status501,@Param("plannedItemBo")String plannedItemBo); ShopOrderDto findByShopOrderBo(@Param("handle")String handle); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java index e521f844..7554f661 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/ShopOrderService.java @@ -32,7 +32,7 @@ public interface ShopOrderService extends IService { * @param handle * @return */ - ShopOrder findById(String handle); + ShopOrder findById(String handle,String plannedItemBo); ShopOrderDto findByShopOrderBo(String handle); diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java index 0eb5c5bf..bff01b04 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/ShopOrderServiceImpl.java @@ -46,10 +46,10 @@ public class ShopOrderServiceImpl extends ServiceImpl AND ORIGIN=#{ew.entity.origin} - ${ew.sqlSegment} + AND ${ew.sqlSegment} - ${ew.sqlSegment} + AND ${ew.sqlSegment} diff --git a/meapi/src/main/resources/mapper/ShopOrderMapper.xml b/meapi/src/main/resources/mapper/ShopOrderMapper.xml index e49dead4..4d917bf5 100644 --- a/meapi/src/main/resources/mapper/ShopOrderMapper.xml +++ b/meapi/src/main/resources/mapper/ShopOrderMapper.xml @@ -1000,6 +1000,9 @@ AND HANDLE = #{handle} + + AND PLANNED_ITEM_BO = #{plannedItemBo} + From 87e0040b2c733390b44f0eef8c6238261e6289b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=98=89=E4=BC=9F?= <1724121454@qq.com> Date: Thu, 8 Jul 2021 14:55:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/anomaly/controller/AbnormalBillController.java | 2 -- .../src/main/resources/mapper/AbnormalBillDisposeMapper.xml | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java index 2a22581c..a222710d 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/controller/AbnormalBillController.java @@ -153,8 +153,6 @@ public class AbnormalBillController { */ @GetMapping("/init") public R init(String messageType){ - - return R.ok(abnormalBillService.init(messageType)); } diff --git a/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml b/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml index 9260ac63..9f1414b9 100644 --- a/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml +++ b/anomaly/src/main/resources/mapper/AbnormalBillDisposeMapper.xml @@ -621,7 +621,8 @@ ZAB.PB_PHOTOSHOP PB_PHOTOSHOP,ZABD.DUTY_CAUSE_DESCRIPTION DUTY_CAUSE_DESCRIPTION,ZABD.DUTY_CAUSE_TYPE DUTY_CAUSE_TYPE,ZABD.DUTY_DEPART DUTY_DEPART, ZABD.DUTY_SEND_USER_GROUP DUTY_SEND_USER_GROUP,ZABD.DUTY_TYPE DUTY_TYPE,ZABD.PRINCIPAL_USER PRINCIPAL_USER,ZABD.ABNORMAL_METHOD ABNORMAL_METHOD, R.ROUTER ROUTER,ZABD.RESOLVE_SHOP_ORDER RESOLVE_SHOP_ORDER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,ZABD.RESOLVE_SEND_USER RESOLVE_SEND_USER, - ZABD.ABNORMAL_REASON ABNORMAL_REASON,ZABD.BEFORE_MEASURE BEFORE_MEASURE,"MAP".VALUE "MAP" + ZABD.ABNORMAL_REASON ABNORMAL_REASON,ZABD.BEFORE_MEASURE BEFORE_MEASURE,"MAP".VALUE "MAP", + ZABD.ROUTER_BO ROUTER_BO FROM Z_ABNORMAL_BILL ZAB LEFT JOIN Z_ABNORMAL_BILL_DISPOSE ZABD ON ZAB.HANDLE = ZABD.ABNORMAL_BILL_BO INNER JOIN ITEM I ON I.HANDLE = ZAB.ITEM_BO @@ -655,6 +656,6 @@ ZAB.PB_PHOTOSHOP ,ZABD.DUTY_CAUSE_DESCRIPTION ,ZABD.DUTY_CAUSE_TYPE ,ZABD.DUTY_DEPART , ZABD.DUTY_SEND_USER_GROUP ,ZABD.DUTY_TYPE ,ZABD.PRINCIPAL_USER ,ZABD.ABNORMAL_METHOD , R.ROUTER ,ZABD.RESOLVE_SHOP_ORDER ,ZABD.RESOLVE_REMARK ,ZABD.RESOLVE_SEND_USER , - ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE + ZABD.ABNORMAL_REASON ,ZABD.BEFORE_MEASURE ,"MAP".VALUE,ZABD.ROUTER_BO