领料接口优化

This commit is contained in:
sxu 2024-11-14 19:43:26 +08:00
parent 8a2c54430e
commit aaaf03419e
1 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
leaseApplyRequestVo.getLeaseApplyInfo().setCode(taskCode); leaseApplyRequestVo.getLeaseApplyInfo().setCode(taskCode);
int count = leaseApplyInfoMapper.insertLeaseApplyInfo(leaseApplyRequestVo.getLeaseApplyInfo()); int count = leaseApplyInfoMapper.insertLeaseApplyInfo(leaseApplyRequestVo.getLeaseApplyInfo());
if (count > 0) { if (count > 0) {
return insertPurchaseCheckDetails(leaseApplyRequestVo.getLeaseApplyDetailsList(), tmTask.getTaskId()); return insertPurchaseCheckDetails(leaseApplyRequestVo.getLeaseApplyDetailsList(), leaseApplyRequestVo.getLeaseApplyInfo().getId());
} else { } else {
return AjaxResult.error("新增任务失败,lease_apply_info表插入0条"); return AjaxResult.error("新增任务失败,lease_apply_info表插入0条");
} }
@ -174,10 +174,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
} }
} }
private AjaxResult insertPurchaseCheckDetails(List<LeaseApplyDetails> leaseApplyDetailsList, Long taskId) { private AjaxResult insertPurchaseCheckDetails(List<LeaseApplyDetails> leaseApplyDetailsList, Long parentId) {
if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) { if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) {
for (LeaseApplyDetails details : leaseApplyDetailsList) { for (LeaseApplyDetails details : leaseApplyDetailsList) {
details.setParentId(taskId); // 设置领料taskId details.setParentId(parentId); // 设置info.parentId
details.setCreateTime(DateUtils.getNowDate()); details.setCreateTime(DateUtils.getNowDate());
details.setCreateBy(SecurityUtils.getUsername()); details.setCreateBy(SecurityUtils.getUsername());
} }