From 1cb57919fbfd5ccc9b0489d16391bcd4909e21f9 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期五, 18 八月 2023 08:59:05 +0800
Subject: [PATCH] 08.17
---
server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java b/server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java
index d283106..cea6336 100644
--- a/server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java
+++ b/server/src/main/java/doumeemes/service/ext/impl/PlansExtServiceImpl.java
@@ -1585,6 +1585,12 @@
@Transactional(rollbackFor = {BusinessException.class,Exception.class})
@Override
public void autoWorkReport(LoginUserInfo user, AutoWorkReportDTO autoWorkReportDTO){
+ if(Objects.isNull(autoWorkReportDTO)
+ || Objects.isNull(autoWorkReportDTO.getCreateWorkorderRecordDTO())
+ || Objects.isNull(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum())|| autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum().compareTo(BigDecimal.ZERO) < Constants.ZERO
+ || Objects.isNull(autoWorkReportDTO.getCreateWorkorderRecordDTO().getQualifiedNum())|| autoWorkReportDTO.getCreateWorkorderRecordDTO().getQualifiedNum().compareTo(BigDecimal.ZERO) < Constants.ZERO){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
//鏌ヨ宸ュ伐搴忚鍒掔姸鎬�
Plans plans = plansExtMapper.selectById(autoWorkReportDTO.getPlansId());
if(Objects.isNull(plans)){
@@ -1597,7 +1603,7 @@
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"宸ュ簭璁″垝宸叉殏鍋滐紝鏃犳硶鎿嶄綔");
}
if(Objects.isNull(autoWorkReportDTO.getCreateWorkorderRecordDTO())){
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍙傛暟閿欒锛氫骇鍑烘暟鎹�");
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鍙傛暟閿欒锛氫骇鍑烘暟鎹�");
}
//鏌ヨ宸ュ簭璁″垝宸插垎閰嶆暟閲�
List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().eq("PLAN_ID",plans.getId())
@@ -1620,7 +1626,7 @@
param.setProUserList(autoWorkReportDTO.getProUserList());
param.setPlanNum(num.intValue());
//鐢熸垚宸ュ崟淇℃伅
- Workorder workorder = this.distributeDone(user,param,plans.getNum());
+ Workorder workorder = this.distributeDone(user,param,num.intValue());
//宸ュ崟鎶曟枡璁板綍
CreateMaterialDTO createMaterialDTO = new CreateMaterialDTO();
if(!Objects.isNull(autoWorkReportDTO.getRecordList())&&autoWorkReportDTO.getRecordList().size()>Constants.ZERO){
@@ -1632,7 +1638,7 @@
autoWorkReportDTO.getCreateWorkorderRecordDTO().setWorkorderId(workorder.getId());
WorkorderRecord workorderRecord = workorderRecordStandardService.createWorkorderRecord(autoWorkReportDTO.getCreateWorkorderRecordDTO(),user);
//宸ュ崟鎶ュ伐
- workorderRecordStandardService.comfirmDone(workorder);
+ workorderRecordStandardService.comfirmDone(workorder,false);
//鏇存柊宸ュ崟鐘舵��
if(num.compareTo(BigDecimal.valueOf(surplusNum))==Constants.ZERO){
plans.setStatus(Constants.PLAN_STATUS.done);
@@ -1642,6 +1648,8 @@
}
}
plansExtMapper.updateById(plans);
+ //鍙戦�佹秷鎭槦鍒楀鐞嗗垎浜搷浣�
+ workorderExtService.statisticNum(workorder);
//瀛樺偍鎶ュ伐涓嶈壇椤规暟鎹�
if(autoWorkReportDTO.getCreateWorkorderRecordDTO().getUnQualifiedNum().compareTo(BigDecimal.ZERO)<=Constants.ZERO){
if(!Objects.isNull(autoWorkReportDTO.getCreateUnqualifiedDTOList())&&autoWorkReportDTO.getCreateUnqualifiedDTOList().size()>Constants.ZERO){
--
Gitblit v1.9.3