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 2d21173d..489eb985 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 @@ -326,9 +326,14 @@ public class AbnormalBillController { return R.ok(abnormalBillService.getNextNumber(type)); } - @GetMapping("/test") - public R test(String category, String resource, String shopOrder, String sfc, String ncCodes ){ - anomalyService.createAnomalyTask(category,resource,shopOrder,sfc,ncCodes); - return R.ok(); +// @GetMapping("/test") +// public R test(String category, String resource, String shopOrder, String sfc, String ncCodes ){ +// anomalyService.createAnomalyTask(category,resource,shopOrder,sfc,ncCodes); +// return R.ok(); +// } + + @GetMapping("/anomalyReveseRepair") + public R anomalyReveseRepair(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose){ + return R.ok(abnormalBillService.anomalyReveseRepair(abnormalBill,abnormalBillDispose)); } } \ 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 b490e7bb..4cc182df 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 @@ -119,4 +119,6 @@ public interface AbnormalBillService extends IService { */ String getNextNumber(String type); + HashMap anomalyReveseRepair(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 64ccfa30..61d45599 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 @@ -613,7 +613,31 @@ public class AbnormalBillServiceImpl extends ServiceImpl anomalyReveseRepair(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) { + String site = CommonMethods.getSite(); + String user = CommonMethods.getUser(); + LocalDateTime now = LocalDateTime.now(); + if(!Constants.RESPONSE.equals(abnormalBill.getStatus())){ + throw BusinessException.build("该异常单的状态必须是响应中才能转维修"); + } + if(StringUtil.isBlank(abnormalBillDispose.getAbnormalMethod())){ + throw BusinessException.build("转维修时方案分类必须填写"); + } + abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo())); + abnormalBill.setStatus(Constants.SHUT_DOWN); + abnormalBillDispose.setResolveUser(user); + abnormalBillDispose.setResolveDateTime(now); + abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo())); + this.saveOrUpdate(abnormalBill); + abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose); + HashMap hashMap = new HashMap<>(); + hashMap.put("abnormalBill",abnormalBillMapper.selectById(abnormalBill.getHandle())); + hashMap.put("abnormalBillDispose",abnormalBillDisposeMapper.selectById(abnormalBillDispose.getHandle())); + return hashMap; + } + + @Override + public void createAnomalyTask(String category, String resource, String shopOrder, String sfc, String ncCodes,String position,String ncQty,String ncDescription) { String site = CommonMethods.getSite(); LocalDateTime now = LocalDateTime.now(); String user = CommonMethods.getUser(); @@ -630,6 +654,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl