退料报废转到维修
This commit is contained in:
parent
566f8a6b08
commit
1fad55d44e
|
|
@ -99,4 +99,10 @@ public interface BackReceiveService {
|
||||||
List<BackApplyInfo> backReceiveRecordWeb(BackApplyInfo record);
|
List<BackApplyInfo> backReceiveRecordWeb(BackApplyInfo record);
|
||||||
|
|
||||||
List<BackApplyInfo> backReceiveRecordWebPt(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;
|
return backApplyInfoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int insertRad(int taskId, List<BackApplyInfo> wxList) {
|
public int insertRad(int taskId, List<BackApplyInfo> wxList) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (wxList != null) {
|
if (wxList != null) {
|
||||||
for (BackApplyInfo wx : wxList) {
|
for (BackApplyInfo wx : wxList) {
|
||||||
|
|
@ -414,14 +414,14 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int insertTta(int taskId, List<BackApplyInfo> list) {
|
public int insertTta(int taskId, List<BackApplyInfo> list) {
|
||||||
int res;
|
int res;
|
||||||
String agreementId = String.valueOf(list.get(0).getAgreementId());
|
String agreementId = String.valueOf(list.get(0).getAgreementId());
|
||||||
res = backReceiveMapper.insertTta(taskId, agreementId);
|
res = backReceiveMapper.insertTta(taskId, agreementId);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int insertTt(List<BackApplyInfo> hgList, Integer taskType, String createBy) {
|
public int insertTt(List<BackApplyInfo> hgList, Integer taskType, String createBy) {
|
||||||
int newTask;
|
int newTask;
|
||||||
//生成单号
|
//生成单号
|
||||||
String code = genCodeRule(taskType);
|
String code = genCodeRule(taskType);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
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.base.api.domain.BackApplyInfo;
|
||||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||||
import com.bonus.sgzb.common.core.enums.ReviewStatusEnum;
|
import com.bonus.sgzb.common.core.enums.ReviewStatusEnum;
|
||||||
|
|
@ -56,6 +58,9 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
@Resource
|
@Resource
|
||||||
private ScrapAuditorSetMapper scrapAuditorSetMapper;
|
private ScrapAuditorSetMapper scrapAuditorSetMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
BackReceiveService backReceiveService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询报废任务详细scrap_apply_details
|
* 查询报废任务详细scrap_apply_details
|
||||||
*
|
*
|
||||||
|
|
@ -490,11 +495,11 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
if (notScrapList.size() == scrapApplyDetailsList.size()) {
|
if (notScrapList.size() == scrapApplyDetailsList.size()) {
|
||||||
task.setTaskStatus(59);
|
task.setTaskStatus(59);
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
status = "2";
|
status = "2";
|
||||||
List<ScrapApplyDetails> backList = new ArrayList<>();
|
List<ScrapApplyDetails> backList = new ArrayList<>();
|
||||||
List<ScrapApplyDetails> repairList = new ArrayList<>();
|
List<ScrapApplyDetails> repairList = new ArrayList<>();
|
||||||
|
List<BackApplyInfo> wxList = new ArrayList<>();
|
||||||
if (scrapApplyDetailsList.size() > 0) {
|
if (scrapApplyDetailsList.size() > 0) {
|
||||||
for (ScrapApplyDetails bean : scrapApplyDetailsList) {
|
for (ScrapApplyDetails bean : scrapApplyDetailsList) {
|
||||||
if ("1".equals(bean.getScrapSource())) {
|
if ("1".equals(bean.getScrapSource())) {
|
||||||
|
|
@ -502,33 +507,29 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
} else if ("2".equals(bean.getScrapSource())) {
|
} else if ("2".equals(bean.getScrapSource())) {
|
||||||
repairList.add(bean);
|
repairList.add(bean);
|
||||||
}
|
}
|
||||||
}
|
BackApplyInfo backApplyInfo = new BackApplyInfo();
|
||||||
}
|
backApplyInfo.setAgreementId(tmTaskAgreement.getAgreementId().intValue());
|
||||||
if (backList.size() > 0) {
|
backApplyInfo.setMaId(bean.getMaId().intValue());
|
||||||
if (backList.get(0).getCompanyId() != null) {
|
backApplyInfo.setTypeId(String.valueOf(bean.getTypeId()));
|
||||||
companyId = Math.toIntExact(backList.get(0).getCompanyId());
|
backApplyInfo.setCompanyId(String.valueOf(bean.getCompanyId()));
|
||||||
}
|
backApplyInfo.setBackNum(bean.getScrapNum().intValue());
|
||||||
if (backList.get(0).getParentId() != null) {
|
backApplyInfo.setId(bean.getParentId());
|
||||||
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.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
backApplyInfo.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
scrapApplyDetailsMapper.addBackInfo(backApplyInfo);
|
wxList.add(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) {
|
||||||
|
//插入任务表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);
|
||||||
|
}
|
||||||
|
|
||||||
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());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue