工机具管理-库管员配置;维修班配置

This commit is contained in:
sliang 2023-12-23 21:49:43 +08:00
parent 891246c5a9
commit 11aef851d9
4 changed files with 25 additions and 29 deletions

View File

@ -148,4 +148,7 @@ public class LeaseApplyInfo implements Serializable {
@ApiModelProperty(value = "设备数据所属组织类型")
private Integer companyId;
@ApiModelProperty(value="审批状态id")
private String examineStatusId;
}

View File

@ -289,34 +289,21 @@ public class TmTaskController extends BaseController {
LeaseApplyInfo infoAdd = new LeaseApplyInfo();
if(list.size()<2){
List<List<LeaseApplyDetails>> deviceByCompanyList = CollUtil.groupByField(task.getLeaseApplyDetails(), "companyId");
String companyId="";
for (List<LeaseApplyDetails> 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<LeaseApplyDetails> 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;

View File

@ -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())) {

View File

@ -585,19 +585,20 @@
lease_apply_info
set
<trim suffixOverrides=",">
<if test="record.companyAuditBy != null and record.companyAuditBy != ''">
<if test="record.examineStatusId == 30 and record.examineStatusId == '30'">
company_audit_by = #{record.companyAuditBy},
company_audit_time = now(),
company_audit_remark = #{record.companyAuditRemark},
</if>
<if test="record.deptAuditBy != null and record.deptAuditBy != ''">
<if test="record.examineStatusId == 31 and record.examineStatusId == '31'">
dept_audit_by = #{record.companyAuditBy},
dept_audit_time = now(),
dept_audit_remark = #{record.companyAuditRemark},
</if>
<if test="record.directAuditBy != null and record.directAuditBy != ''">
direct_audit_by = #{record.directAuditBy},
direct_audit_time = now()
<if test="record.examineStatusId == 32 and record.examineStatusId == '32'">
direct_audit_by = #{record.companyAuditBy},
direct_audit_time = now(),
direct_audit_remark = #{record.companyAuditRemark},
</if>
</trim>
WHERE