报废驳回进维修

This commit is contained in:
sxu 2024-08-22 13:20:54 +08:00
parent ae7afcde25
commit 21656e0515
1 changed files with 24 additions and 22 deletions

View File

@ -515,24 +515,16 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
backApplyInfo.setMaId(bean.getMaId().intValue()); backApplyInfo.setMaId(bean.getMaId().intValue());
backApplyInfo.setTypeId(String.valueOf(bean.getTypeId())); backApplyInfo.setTypeId(String.valueOf(bean.getTypeId()));
backApplyInfo.setCompanyId(String.valueOf(bean.getCompanyId())); backApplyInfo.setCompanyId(String.valueOf(bean.getCompanyId()));
backApplyInfo.setRepairedNum(String.valueOf(bean.getScrapNum())); backApplyInfo.setBackNum(bean.getScrapNum().intValue());
backApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getUsername()); backApplyInfo.setId(bean.getParentId());
backApplyInfo.setUpdateBy(SecurityUtils.getLoginUser().getUsername()); backApplyInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
wxList.add(backApplyInfo); wxList.add(backApplyInfo);
} }
} }
if (backList.size() > 0) {
if (backList.get(0).getCompanyId() != null) {
companyId = Math.toIntExact(backList.get(0).getCompanyId());
}
if (backList.get(0).getParentId() != null) {
parentId = Math.toIntExact(backList.get(0).getParentId());
}
//维修的创建维修任务插入任务协议表 //维修的创建维修任务插入任务协议表
if (wxList != null && wxList.size() > 0) { if (wxList != null && wxList.size() > 0) {
BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId);
wxList = wxList.stream().peek(obj -> obj.setBackId(backApplyInfo.getBackId())).collect(Collectors.toList());
//插入任务表tm_task //插入任务表tm_task
int newTaskId = backReceiveService.insertTt(wxList, TaskTypeEnum.MAINTENANCE_TASK.getCode(), SecurityUtils.getLoginUser().getUsername()); int newTaskId = backReceiveService.insertTt(wxList, TaskTypeEnum.MAINTENANCE_TASK.getCode(), SecurityUtils.getLoginUser().getUsername());
//插入协议任务表tm_task_agreement //插入协议任务表tm_task_agreement
@ -541,6 +533,14 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
backReceiveService.insertRad(newTaskId, wxList); backReceiveService.insertRad(newTaskId, wxList);
} }
// if (backList.size() > 0) {
// if (backList.get(0).getCompanyId() != null) {
// companyId = Math.toIntExact(backList.get(0).getCompanyId());
// }
// if (backList.get(0).getParentId() != null) {
// parentId = Math.toIntExact(backList.get(0).getParentId());
// }
// taskCode = purchaseCodeRule("T", 36); // taskCode = purchaseCodeRule("T", 36);
// taskStatus = 38; // taskStatus = 38;
// taskType = 36; // taskType = 36;
@ -558,7 +558,9 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
// bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); // bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
// scrapApplyDetailsMapper.addBackDetails(bean); // scrapApplyDetailsMapper.addBackDetails(bean);
// } // }
} // }
if (repairList.size() > 0) { if (repairList.size() > 0) {
if (repairList.get(0).getCompanyId() != null) { if (repairList.get(0).getCompanyId() != null) {
companyId = Math.toIntExact(repairList.get(0).getCompanyId()); companyId = Math.toIntExact(repairList.get(0).getCompanyId());