This commit is contained in:
parent
f15593e866
commit
63439f1c73
|
|
@ -259,18 +259,26 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
res = insertSad(newTaskId, bfList);
|
||||
}
|
||||
|
||||
List<BackApplyInfo> allList = backReceiveMapper.getAllList(record);
|
||||
List<BackApplyInfo> allList2 = allList.stream().filter(o -> o.getTypeId().equals(record.getTypeId())).collect(Collectors.toList());
|
||||
if (allList2 != null && allList2.size() > 0) {
|
||||
res = updateSlt(record, allList2);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("该机具未被领料使用");
|
||||
}
|
||||
BackApplyInfo b = allList2.get(0);
|
||||
record.setTypeId(b.getTypeId());
|
||||
int postStoreNum = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setPostStoreNum(postStoreNum);
|
||||
// List<BackApplyInfo> allList = backReceiveMapper.getAllList(record);
|
||||
// List<BackApplyInfo> allList2 = allList.stream().filter(o -> o.getTypeId().equals(record.getTypeId())).collect(Collectors.toList());
|
||||
// if (allList2 != null && allList2.size() > 0) {
|
||||
// res = updateSlt(record, allList2);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("该机具未被领料使用");
|
||||
// }
|
||||
// BackApplyInfo b = allList2.get(0);
|
||||
// record.setTypeId(b.getTypeId());
|
||||
// int postStoreNum = backReceiveMapper.getmaChineByCt(record);
|
||||
// record.setPostStoreNum(postStoreNum);
|
||||
// }
|
||||
|
||||
res = updateSlt4Bean(record, bai);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("该机具未被领料使用");
|
||||
}
|
||||
int postStoreNum = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setPostStoreNum(postStoreNum);
|
||||
|
||||
|
||||
//完成退料的部分,更新 back_check_details 为 is_finished=1,此部分不支持撤回
|
||||
finishBackCheckDetails(record);
|
||||
|
|
@ -295,6 +303,31 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
}
|
||||
}
|
||||
|
||||
private int updateSlt4Bean(BackApplyInfo record, BackApplyInfo bean) {
|
||||
List<SltAgreementInfo> infoList = backReceiveMapper.getStlInfo(bean);
|
||||
if (infoList.size() > 0) {
|
||||
Integer backNum = bean.getBackNum();
|
||||
for (SltAgreementInfo info : infoList) {
|
||||
Integer num = info.getNum();
|
||||
if (backNum.equals(num)) {
|
||||
backReceiveMapper.updateStlInfo(info, record);
|
||||
break;
|
||||
} else if (backNum > num) {
|
||||
backNum = backNum - num;
|
||||
backReceiveMapper.updateStlInfo(info, record);
|
||||
} else if (backNum < num) {
|
||||
Integer many = num - backNum;
|
||||
backReceiveMapper.updateStlInfoTwo(info, record, backNum);
|
||||
backReceiveMapper.insStlInfoTwo(info, many);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private int updateSlt(BackApplyInfo record, List<BackApplyInfo> hgList) {
|
||||
for (BackApplyInfo bean : hgList) {
|
||||
List<SltAgreementInfo> infoList = backReceiveMapper.getStlInfo(bean);
|
||||
|
|
|
|||
|
|
@ -819,6 +819,7 @@
|
|||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||
WHERE
|
||||
parent_id=#{parentId}
|
||||
and bcd.type_id=#{typeId}
|
||||
and bcd.back_status='1' and (bcd.is_finished is null or bcd.is_finished != 1)
|
||||
</select>
|
||||
|
||||
|
|
@ -839,6 +840,7 @@
|
|||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||
WHERE
|
||||
parent_id=#{parentId}
|
||||
and bcd.type_id=#{typeId}
|
||||
and bcd.back_status='2' and (bcd.is_finished is null or bcd.is_finished != 1)
|
||||
</select>
|
||||
|
||||
|
|
@ -859,6 +861,7 @@
|
|||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||
WHERE
|
||||
parent_id=#{parentId}
|
||||
and bcd.type_id=#{typeId}
|
||||
and bcd.back_status='3' and (bcd.is_finished is null or bcd.is_finished != 1)
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue