领料单空值保护

This commit is contained in:
sxu 2024-09-29 18:15:40 +08:00
parent 4a57f9a3bc
commit 5853bd9621
3 changed files with 7 additions and 4 deletions

View File

@ -551,9 +551,8 @@ public class TmTaskController extends BaseController {
tmTaskService.edit(task);
return AjaxResult.success("修改成功");
} catch (Exception e) {
return AjaxResult.error("修改失败");
return AjaxResult.error("修改失败"+e.getMessage());
}
}
/**

View File

@ -71,7 +71,7 @@ public interface TmTaskService{
int updateByPrimaryKeySelective(TmTask record);
int edit(TmTask tmTask);
int edit(TmTask tmTask) throws Exception;
int editCq(TmTask tmTask);
Integer getAgreementIdByUnit(TmTask task);

View File

@ -1021,7 +1021,7 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
@Transactional(rollbackFor = Exception.class)
public int edit(TmTask tmTask) {
public int edit(TmTask tmTask) throws Exception {
int res = 0;
//修改任务信息tm_task
this.updateByPrimaryKeySelective(tmTask);
@ -1053,6 +1053,7 @@ public class TmTaskServiceImpl implements TmTaskService {
}
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new Exception(e.getMessage());
}
return res;
}
@ -1198,6 +1199,9 @@ public class TmTaskServiceImpl implements TmTaskService {
Long taskId = task.getTaskId();
if (CollUtil.isNotEmpty(leaseApplyDetails)) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail.getPreNum() == null || leaseApplyDetail.getPreNum().equals(0)) {
return 0;
}
LeaseApplyInfo leaseApplyInfos = new LeaseApplyInfo();
if (leaseApplyDetail.getCompanyId() == null) {
leaseApplyInfos = leaseApplyInfoMapper.selectByTaskIdAndCompIdCq(String.valueOf(taskId));