This commit is contained in:
parent
63439f1c73
commit
c0831402b0
|
|
@ -209,7 +209,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
scrapNum += bi.getBackNum();
|
||||
}
|
||||
}
|
||||
log.error("check001退料接收:{},{},{},{}", maxBackNumBackEnd, passNum, maintenanceNum, scrapNum);
|
||||
log.error("退料接收总数与详细数据对比结果:maxBackNumBackEnd={},passNum={},maintenanceNum={},scrapNum={}", maxBackNumBackEnd, passNum, maintenanceNum, scrapNum);
|
||||
if (maxBackNumBackEnd < passNum + maintenanceNum + scrapNum) {
|
||||
log.error("TypeId={}所提交的退料数量大于最大退料数,可能您的退料已被别人退掉了!", bai.getTypeId());
|
||||
continue;
|
||||
|
|
@ -259,31 +259,18 @@ 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);
|
||||
// }
|
||||
|
||||
//更新结算表 slt_agreement_info
|
||||
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);
|
||||
|
||||
//库存日志
|
||||
int postStoreNum = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setPostStoreNum(postStoreNum);
|
||||
record.setBackNum(passNum + maintenanceNum + scrapNum);
|
||||
record.setPassNum(passNum);
|
||||
record.setMaintenanceNum(maintenanceNum);
|
||||
|
|
@ -328,32 +315,32 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
return 1;
|
||||
}
|
||||
|
||||
private int updateSlt(BackApplyInfo record, List<BackApplyInfo> hgList) {
|
||||
for (BackApplyInfo bean : hgList) {
|
||||
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);
|
||||
// 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;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> codeQuery(BackApplyInfo record) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue