领料接口优化

This commit is contained in:
sxu 2024-11-14 14:20:51 +08:00
parent 68f4d0073f
commit ca1eda6280
3 changed files with 6 additions and 7 deletions

View File

@ -12,8 +12,8 @@ public enum LeaseTaskStatusEnum {
LEASE_TASK_TO_PUBLISHED(1, "待发布"), LEASE_TASK_TO_PUBLISHED(1, "待发布"),
LEASE_TASK_TO_AUDIT(2, "待审核"), LEASE_TASK_TO_AUDIT(2, "待审核"),
LEASE_TASK_IN_STOCK_OUT(3, "出库进行中"), LEASE_TASK_IN_PROGRESS(3, "出库进行中"),
LEASE_TASK_END_STOCK_OUT(4, "出库已完成"); LEASE_TASK_FINISHED(4, "出库已完成");
private final Integer status; private final Integer status;
private final String statusName; private final String statusName;

View File

@ -77,9 +77,9 @@ public class LeaseApplyInfoController extends BaseController {
//@RequiresPermissions("lease:info:add") //@RequiresPermissions("lease:info:add")
@SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务") @SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务")
@PostMapping @PostMapping
public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody LeaseApplyRequestVo tmTaskRequestVo) { public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody LeaseApplyRequestVo leaseApplyRequestVo) {
try { try {
return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo); return leaseApplyInfoService.insertLeaseApplyInfo(leaseApplyRequestVo);
} catch (Exception e) { } catch (Exception e) {
return error("系统错误, " + e.getMessage()); return error("系统错误, " + e.getMessage());
} }

View File

@ -157,11 +157,11 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
try { try {
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo); int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
if (result > 0) { if (result > 0) {
// 同步修改tm_task任务状态, 如果不需要审核改成 LEASE_TASK_IN_STOCK_OUT 如果需要审核改成 LEASE_TASK_TO_AUDIT // 同步修改tm_task任务状态, 如果不需要审核改成 LEASE_TASK_IN_PROGRESS 如果需要审核改成 LEASE_TASK_TO_AUDIT
TmTask tmTask = new TmTask(); TmTask tmTask = new TmTask();
tmTask.setTaskType(TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId()); tmTask.setTaskType(TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId());
tmTask.setTaskId(leaseApplyInfo.getTaskId()); tmTask.setTaskId(leaseApplyInfo.getTaskId());
tmTask.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_STOCK_OUT.getStatus()); tmTask.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
tmTaskMapper.updateTmTask(tmTask); tmTaskMapper.updateTmTask(tmTask);
return AjaxResult.success("发布成功"); return AjaxResult.success("发布成功");
} }
@ -180,7 +180,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
details.setParentId(taskId); // 设置领料taskId details.setParentId(taskId); // 设置领料taskId
details.setCreateTime(DateUtils.getNowDate()); details.setCreateTime(DateUtils.getNowDate());
details.setCreateBy(SecurityUtils.getUsername()); details.setCreateBy(SecurityUtils.getUsername());
//details.setStatus(PurchaseTaskStatusEnum.TO_NOTICE.getStatus());
} }
// 批量插入详情数据 // 批量插入详情数据
int count = leaseApplyDetailsMapper.insertLeaseApplyDetailsList(leaseApplyDetailsList); int count = leaseApplyDetailsMapper.insertLeaseApplyDetailsList(leaseApplyDetailsList);