diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java index 137f5c30..54b0c615 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java @@ -148,4 +148,7 @@ public class LeaseApplyInfo implements Serializable { @ApiModelProperty(value = "设备数据所属组织类型") private Integer companyId; + @ApiModelProperty(value="审批状态id") + private String examineStatusId; + } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java index 38bc8b81..c80e51ce 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java @@ -289,34 +289,21 @@ public class TmTaskController extends BaseController { LeaseApplyInfo infoAdd = new LeaseApplyInfo(); if(list.size()<2){ List> deviceByCompanyList = CollUtil.groupByField(task.getLeaseApplyDetails(), "companyId"); - String companyId=""; - for (List leaseApplyDetailsList : deviceByCompanyList) { - companyId = leaseApplyDetailsList.get(0).getCompanyId() + "@" ; - } - - LeaseApplyInfo info = new LeaseApplyInfo(); infoAdd.setTaskId(task.getTaskId().intValue()); infoAdd.setCode(task.getLeaseApplyInfoList().get(0).getCode()); infoAdd.setLeasePerson(task.getLeaseApplyInfoList().get(0).getLeasePerson()); infoAdd.setPhone(task.getLeaseApplyInfoList().get(0).getPhone()); infoAdd.setRemark(task.getLeaseApplyInfoList().get(0).getRemark()); infoAdd.setType(task.getLeaseApplyInfoList().get(0).getType()); - - if(companyId.contains("101")){ - info.setId(101); - info.setTaskId(task.getTaskId().intValue()); - LeaseApplyInfo bean = tmTaskService.getListSomeol(info); - if(bean==null){ - infoAdd.setCompanyId(101); - leaseApplyInfoService.genderLeaseCode(infoAdd); - } - }else if(companyId.contains("102")){ - info.setId(102); - info.setTaskId(task.getTaskId().intValue()); - LeaseApplyInfo bean = tmTaskService.getListSomeol(info); - if(bean==null){ - infoAdd.setCompanyId(102); - leaseApplyInfoService.genderLeaseCode(infoAdd); + for (List leaseApplyDetailsList : deviceByCompanyList) { + if(leaseApplyDetailsList.get(0).getParenntId() == null ){ + if(leaseApplyDetailsList.get(0).getCompanyId()==101){ + infoAdd.setCompanyId(101); + leaseApplyInfoService.genderLeaseCode(infoAdd); + }else if(leaseApplyDetailsList.get(0).getCompanyId()==102){ + infoAdd.setCompanyId(102); + leaseApplyInfoService.genderLeaseCode(infoAdd); + } } } } @@ -328,7 +315,6 @@ public class TmTaskController extends BaseController { tmTaskService.updateLeaseInfo(bean); for (LeaseApplyInfo leaseApplyInfo : task.getLeaseApplyInfoList()) { - if (leaseApplyInfo == null || leaseApplyInfo.getId() == null) { continue; } @@ -340,7 +326,12 @@ public class TmTaskController extends BaseController { // 删除后,插入新地领料任务明细 if (StringUtils.isNotNull(leaseApplyInfo.getId())) { for (LeaseApplyDetails leaseApplyDetails : leaseApplyInfo.getLeaseApplyDetails()) { - leaseApplyDetails.setParenntId(leaseApplyInfo.getId()); // 设置领料任务ID + if(leaseApplyDetails.getParenntId() == null){ + leaseApplyDetails.setParenntId(infoAdd.getId()); + }else{ + leaseApplyDetails.setParenntId(leaseApplyInfo.getId()); // 设置领料任务ID + } + } // 插入领料任务明细 boolean addLeaseTaskDetailsResult = leaseApplyDetailsService.batchInsert(leaseApplyInfo.getLeaseApplyDetails()) > 0; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java index 4677378c..b7c04157 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java @@ -84,6 +84,7 @@ public class TmTaskServiceImpl implements TmTaskService{ if (CollUtil.isNotEmpty(record.getLeaseApplyInfoList())) { for (LeaseApplyInfo leaseApplyInfo : record.getLeaseApplyInfoList()) { if (leaseApplyInfo != null) { + leaseApplyInfo.setExamineStatusId(record.getExamineStatusId()); result += tmTaskMapper.updateLeaseApplyInfoAuditInfo(leaseApplyInfo); // 再审核领料任务详情表 if (CollUtil.isNotEmpty(leaseApplyInfo.getLeaseApplyDetails())) { diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index c0dad1f4..6662bc61 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -585,19 +585,20 @@ lease_apply_info set - + company_audit_by = #{record.companyAuditBy}, company_audit_time = now(), company_audit_remark = #{record.companyAuditRemark}, - + dept_audit_by = #{record.companyAuditBy}, dept_audit_time = now(), dept_audit_remark = #{record.companyAuditRemark}, - - direct_audit_by = #{record.directAuditBy}, - direct_audit_time = now() + + direct_audit_by = #{record.companyAuditBy}, + direct_audit_time = now(), + direct_audit_remark = #{record.companyAuditRemark}, WHERE