直转审核流程修改领料数量
This commit is contained in:
parent
714959eb41
commit
beefd3e461
|
|
@ -313,7 +313,7 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
||||||
final List<BmQrBoxInfo> bmQrBoxInfos = bmQrBoxMapper.find(new BmQrBoxInfo().setBoxId(bmQrBoxInfo.getBoxId()));
|
final List<BmQrBoxInfo> bmQrBoxInfos = bmQrBoxMapper.find(new BmQrBoxInfo().setBoxId(bmQrBoxInfo.getBoxId()));
|
||||||
if (!bmQrBoxInfos.isEmpty()) {
|
if (!bmQrBoxInfos.isEmpty()) {
|
||||||
final BmQrBoxInfo item = bmQrBoxInfos.get(0);
|
final BmQrBoxInfo item = bmQrBoxInfos.get(0);
|
||||||
if (null == item.getTransferUser() || !Objects.equals(item.getTransferUser(), SecurityUtils.getLoginUser().getUserid())) {
|
if (null == item.getInputUser() || !Objects.equals(item.getInputUser(), SecurityUtils.getLoginUser().getUserid())) {
|
||||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "驳回失败,您并非接收人,无法操作驳回!");
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "驳回失败,您并非接收人,无法操作驳回!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -83,9 +83,15 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
||||||
@Resource
|
@Resource
|
||||||
private DirectRotationMapper mapper;
|
private DirectRotationMapper mapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmTaskMapper taskMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TmTaskAgreementMapper taskAgreementMapper;
|
private TmTaskAgreementMapper taskAgreementMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LeaseApplyInfoMapper leaseApplyInfoMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BackApplyInfoMapper backApplyInfoMapper;
|
private BackApplyInfoMapper backApplyInfoMapper;
|
||||||
|
|
||||||
|
|
@ -422,6 +428,73 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
|
||||||
//获取leaseAgreementId
|
//获取leaseAgreementId
|
||||||
int leaseAgreementId = sysWorkflowRecordMapper.selectLeaseAgreementIdByRecordId(taskId);
|
int leaseAgreementId = sysWorkflowRecordMapper.selectLeaseAgreementIdByRecordId(taskId);
|
||||||
createWorkOrderAndPeopleDirect(sysUser,leaseAgreementId, taskId, recordCode, recordId, nodeId);
|
createWorkOrderAndPeopleDirect(sysUser,leaseAgreementId, taskId, recordCode, recordId, nodeId);
|
||||||
|
}else{
|
||||||
|
//以下走退料、领料方法
|
||||||
|
SltAgreementInfo sltAgreementInfo = new SltAgreementInfo();
|
||||||
|
sltAgreementInfo.setId(Long.valueOf(taskId));
|
||||||
|
DirectApplyInfo info = mapper.getInfoById(sltAgreementInfo);
|
||||||
|
BackApplyInfo backApplyInfo = new BackApplyInfo();
|
||||||
|
if (info != null) {
|
||||||
|
backApplyInfo.setAgreementId(Long.valueOf(info.getBackAgreementId()));
|
||||||
|
backApplyInfo.setBackPerson(info.getBackMan());
|
||||||
|
backApplyInfo.setPhone(info.getBackPhone());
|
||||||
|
}
|
||||||
|
List<DirectApplyDetails> detailById = mapper.getDetailById(sltAgreementInfo);
|
||||||
|
List<DirectApplyDetails> list = mapper.selectDetails(sltAgreementInfo);
|
||||||
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||||
|
String codes = genderTaskCode(thisMonthMaxOrder);
|
||||||
|
TmTask task = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||||
|
BackTaskStatusEnum.BACK_TASK_IN_FINISHED.getStatus(),
|
||||||
|
null,thisMonthMaxOrder + 1, codes);
|
||||||
|
task.setCreateTime(DateUtils.getNowDate());
|
||||||
|
task.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
backApplyInfo.setCode(codes);
|
||||||
|
backApplyInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
backApplyInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
// 保存退料信息到 tm_task 表中
|
||||||
|
int result = 0;
|
||||||
|
result = taskMapper.insertTmTask(task);
|
||||||
|
// 新增退料表back_apply_info信息
|
||||||
|
result = getBackInfoResult(info, backApplyInfo, task, result);
|
||||||
|
if (result > 0) {
|
||||||
|
// 保存退料详情数据 back_apply_details
|
||||||
|
result = getBackDetailsResult(backApplyInfo, list, result);
|
||||||
|
// 保存退料详情数据 back_check_details
|
||||||
|
extractedCheckDetails(backApplyInfo, detailById, result);
|
||||||
|
}
|
||||||
|
// 审核通过,处理转入单位领料逻辑
|
||||||
|
int maxOrderByDate = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId());
|
||||||
|
String taskCode = genderLeaseTaskCode(maxOrderByDate);
|
||||||
|
TmTask tmTask1 = new TmTask(null, TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId(),
|
||||||
|
LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus(),null
|
||||||
|
,maxOrderByDate + 1, taskCode);
|
||||||
|
tmTask1.setCreateTime(DateUtils.getNowDate());
|
||||||
|
tmTask1.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
tmTaskMapper.insertTmTask(tmTask1);
|
||||||
|
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask1.getTaskId(), Long.valueOf(info.getLeaseAgreementId()));
|
||||||
|
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||||
|
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||||
|
/** 设置审批人为默认的董班长 --防止代码冲突 **/
|
||||||
|
Long peopleId = leaseApplyInfoMapper.getDirectAuditBy();
|
||||||
|
LeaseApplyInfo applyInfo = new LeaseApplyInfo();
|
||||||
|
applyInfo.setDirectAuditBy(peopleId);
|
||||||
|
applyInfo.setCode(taskCode);
|
||||||
|
applyInfo.setTaskId(tmTask1.getTaskId());
|
||||||
|
applyInfo.setLeasePerson(info.getLeaseMan());
|
||||||
|
applyInfo.setPhone(info.getLeasePhone());
|
||||||
|
applyInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
applyInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
/** 设置审批人为默认的董班长 --防止代码冲突 **/
|
||||||
|
int count = leaseApplyInfoMapper.insertLeaseApplyInfo(applyInfo);
|
||||||
|
if (count > 0) {
|
||||||
|
// 新增lease_apply_details表数据
|
||||||
|
count = getLeaseApplyCount(list, applyInfo, count);
|
||||||
|
// 插入 lease_out_details表数据
|
||||||
|
if (count > 0) {
|
||||||
|
extracted(sltAgreementInfo, info, detailById, applyInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.info("-------------节点更新工单信息结束-------------");
|
log.info("-------------节点更新工单信息结束-------------");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue