报废驳回进维修
This commit is contained in:
parent
566f8a6b08
commit
ae7afcde25
|
|
@ -99,4 +99,10 @@ public interface BackReceiveService {
|
|||
List<BackApplyInfo> backReceiveRecordWeb(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> backReceiveRecordWebPt(BackApplyInfo record);
|
||||
|
||||
int insertRad(int taskId, List<BackApplyInfo> wxList);
|
||||
|
||||
int insertTt(List<BackApplyInfo> hgList, Integer taskType, String createBy);
|
||||
|
||||
int insertTta(int taskId, List<BackApplyInfo> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return backApplyInfoList;
|
||||
}
|
||||
|
||||
private int insertRad(int taskId, List<BackApplyInfo> wxList) {
|
||||
public int insertRad(int taskId, List<BackApplyInfo> wxList) {
|
||||
int result = 0;
|
||||
if (wxList != null) {
|
||||
for (BackApplyInfo wx : wxList) {
|
||||
|
|
@ -414,14 +414,14 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return result;
|
||||
}
|
||||
|
||||
private int insertTta(int taskId, List<BackApplyInfo> list) {
|
||||
public int insertTta(int taskId, List<BackApplyInfo> list) {
|
||||
int res;
|
||||
String agreementId = String.valueOf(list.get(0).getAgreementId());
|
||||
res = backReceiveMapper.insertTta(taskId, agreementId);
|
||||
return res;
|
||||
}
|
||||
|
||||
private int insertTt(List<BackApplyInfo> hgList, Integer taskType, String createBy) {
|
||||
public int insertTt(List<BackApplyInfo> hgList, Integer taskType, String createBy) {
|
||||
int newTask;
|
||||
//生成单号
|
||||
String code = genCodeRule(taskType);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||
import com.bonus.sgzb.app.service.BackReceiveService;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||
import com.bonus.sgzb.common.core.enums.ReviewStatusEnum;
|
||||
|
|
@ -56,6 +58,12 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
@Resource
|
||||
private ScrapAuditorSetMapper scrapAuditorSetMapper;
|
||||
|
||||
@Resource
|
||||
private BackReceiveMapper backReceiveMapper;
|
||||
|
||||
@Resource
|
||||
BackReceiveService backReceiveService;
|
||||
|
||||
/**
|
||||
* 查询报废任务详细scrap_apply_details
|
||||
*
|
||||
|
|
@ -490,11 +498,11 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
if (notScrapList.size() == scrapApplyDetailsList.size()) {
|
||||
task.setTaskStatus(59);
|
||||
}
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
status = "2";
|
||||
List<ScrapApplyDetails> backList = new ArrayList<>();
|
||||
List<ScrapApplyDetails> repairList = new ArrayList<>();
|
||||
List<BackApplyInfo> wxList = new ArrayList<>();
|
||||
if (scrapApplyDetailsList.size() > 0) {
|
||||
for (ScrapApplyDetails bean : scrapApplyDetailsList) {
|
||||
if ("1".equals(bean.getScrapSource())) {
|
||||
|
|
@ -502,6 +510,15 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
} else if ("2".equals(bean.getScrapSource())) {
|
||||
repairList.add(bean);
|
||||
}
|
||||
BackApplyInfo backApplyInfo = new BackApplyInfo();
|
||||
backApplyInfo.setAgreementId(tmTaskAgreement.getAgreementId().intValue());
|
||||
backApplyInfo.setMaId(bean.getMaId().intValue());
|
||||
backApplyInfo.setTypeId(String.valueOf(bean.getTypeId()));
|
||||
backApplyInfo.setCompanyId(String.valueOf(bean.getCompanyId()));
|
||||
backApplyInfo.setRepairedNum(String.valueOf(bean.getScrapNum()));
|
||||
backApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
backApplyInfo.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
wxList.add(backApplyInfo);
|
||||
}
|
||||
}
|
||||
if (backList.size() > 0) {
|
||||
|
|
@ -511,23 +528,36 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
|||
if (backList.get(0).getParentId() != null) {
|
||||
parentId = Math.toIntExact(backList.get(0).getParentId());
|
||||
}
|
||||
taskCode = purchaseCodeRule("T", 36);
|
||||
taskStatus = 38;
|
||||
taskType = 36;
|
||||
long backTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId);
|
||||
backApplyInfo.setCode(taskCode);
|
||||
backApplyInfo.setTaskId((int) backTaskId);
|
||||
backApplyInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
scrapApplyDetailsMapper.addBackInfo(backApplyInfo);
|
||||
for (ScrapApplyDetails bean : backList) {
|
||||
bean.setParentId(backApplyInfo.getId());
|
||||
bean.setStatus("1");
|
||||
bean.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
scrapApplyDetailsMapper.addBackDetails(bean);
|
||||
|
||||
//维修的创建维修任务,插入任务协议表
|
||||
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
|
||||
int newTaskId = backReceiveService.insertTt(wxList, TaskTypeEnum.MAINTENANCE_TASK.getCode(), SecurityUtils.getLoginUser().getUsername());
|
||||
//插入协议任务表tm_task_agreement
|
||||
backReceiveService.insertTta(newTaskId, wxList);
|
||||
//插入维修记录表repair_apply_details
|
||||
backReceiveService.insertRad(newTaskId, wxList);
|
||||
}
|
||||
|
||||
// taskCode = purchaseCodeRule("T", 36);
|
||||
// taskStatus = 38;
|
||||
// taskType = 36;
|
||||
// long backTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||
// BackApplyInfo backApplyInfo = scrapApplyDetailsMapper.getBackApplyInfo(parentId);
|
||||
// backApplyInfo.setCode(taskCode);
|
||||
// backApplyInfo.setTaskId((int) backTaskId);
|
||||
// backApplyInfo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
// backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
// scrapApplyDetailsMapper.addBackInfo(backApplyInfo);
|
||||
// for (ScrapApplyDetails bean : backList) {
|
||||
// bean.setParentId(backApplyInfo.getId());
|
||||
// bean.setStatus("1");
|
||||
// bean.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
// bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
// scrapApplyDetailsMapper.addBackDetails(bean);
|
||||
// }
|
||||
}
|
||||
if (repairList.size() > 0) {
|
||||
if (repairList.get(0).getCompanyId() != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue