添加捡货完成接口
This commit is contained in:
parent
399ebb4686
commit
ed15a53b1a
|
|
@ -8,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.app.domain.*;
|
||||
import com.ruoyi.app.domain.DTO.OtherStockInRequest;
|
||||
import com.ruoyi.app.domain.DTO.PickCompleteReq;
|
||||
import com.ruoyi.app.service.*;
|
||||
import com.ruoyi.app.service.impl.AppPendingStorageServiceImpl;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
|
|
@ -710,8 +711,8 @@ public class AppTaskController extends BaseController
|
|||
* @return 结果
|
||||
*/
|
||||
@Anonymous
|
||||
@GetMapping("/GetPickTask/{vehicleNo}")
|
||||
public AjaxResult GetPickTask(@PathVariable String vehicleNo) {
|
||||
@GetMapping("/getPickTask/{vehicleNo}")
|
||||
public AjaxResult getPickTask(@PathVariable String vehicleNo) {
|
||||
if(StringUtils.isEmpty(vehicleNo)) {
|
||||
return error("载具号不能为空");
|
||||
}
|
||||
|
|
@ -727,4 +728,39 @@ public class AppTaskController extends BaseController
|
|||
}
|
||||
return success(selectedAppTaskList);
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@PostMapping("/pickComplete")
|
||||
public AjaxResult pickComplete(@RequestBody PickCompleteReq request) {
|
||||
if(request == null || StringUtils.isEmpty(request.getTaskId()) || request.getPickNum() == null) {
|
||||
return error("请求参数不能为空");
|
||||
}
|
||||
if(request.getPickNum().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return error("捡货数量必须大于0");
|
||||
}
|
||||
// 检查这个taskId是否存在
|
||||
AppTask selectTask = appTaskService.selectAppTaskByTaskId(request.getTaskId());
|
||||
if (selectTask == null) {
|
||||
return error("数据服务异常,请重试");
|
||||
}
|
||||
if (selectTask.getTaskType() != 2) {
|
||||
return error("该任务不是拣货任务,请检查!");
|
||||
}
|
||||
if (selectTask.getTaskStatus() != 4) {
|
||||
return error("该任务状态不是待捡货,请检查!");
|
||||
}
|
||||
// 更新捡货任务数量
|
||||
AppTask updatePickNum = new AppTask();
|
||||
updatePickNum.setTaskId(request.getTaskId());
|
||||
updatePickNum.setOpNum(request.getPickNum());
|
||||
updatePickNum.setTaskStatus(5);
|
||||
updatePickNum.setOpUser(request.getPicker());
|
||||
int updateAppTask = appTaskService.updateAppTask(updatePickNum);
|
||||
if (updateAppTask == 0) {
|
||||
return error("数据服务异常,请重试");
|
||||
}
|
||||
return success("捡货成功");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package com.ruoyi.app.domain.DTO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 捡货完成反馈的请求实体
|
||||
*/
|
||||
public class PickCompleteReq {
|
||||
|
||||
|
||||
private String taskId;
|
||||
|
||||
private BigDecimal pickNum;
|
||||
|
||||
private String vehicleNo;
|
||||
|
||||
private String picker;
|
||||
|
||||
public String getVehicleNo() {
|
||||
return vehicleNo;
|
||||
}
|
||||
|
||||
public void setVehicleNo(String vehicleNo) {
|
||||
this.vehicleNo = vehicleNo;
|
||||
}
|
||||
|
||||
public String getPicker() {
|
||||
return picker;
|
||||
}
|
||||
|
||||
public void setPicker(String picker) {
|
||||
this.picker = picker;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public BigDecimal getPickNum() {
|
||||
return pickNum;
|
||||
}
|
||||
|
||||
public void setPickNum(BigDecimal pickNum) {
|
||||
this.pickNum = pickNum;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user