add:添加移库手动校验
This commit is contained in:
@@ -6,13 +6,17 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.wms.st.core.service.CheckOutBillService;
|
||||
import org.nl.wms.st.instor.service.HandMoveStorService;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@@ -55,6 +59,20 @@ public class HandMoveStorController {
|
||||
@Log("新增移库单")
|
||||
@ApiOperation("新增移库单")
|
||||
public ResponseEntity<Object> insertDtl(@RequestBody Map whereJson){
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableData");
|
||||
for (HashMap row : rows) {
|
||||
Object startPointCode = row.get("start_point_code");
|
||||
Object turninStructCode = row.get("turnin_struct_code");
|
||||
JSONObject startTask = wo_Task.query("is_delete = '0' and task_status < '99' and start_point_code='" + startPointCode + "'").uniqueResult(0);
|
||||
JSONObject endTask = wo_Task.query("is_delete = '0' and task_status < '99' and next_point_code='" + turninStructCode + "'").uniqueResult(0);
|
||||
if (startTask !=null){
|
||||
throw new BadRequestException("当前起点"+startPointCode+"存在正在执行的任务");
|
||||
}
|
||||
if (endTask !=null){
|
||||
throw new BadRequestException("当前终点"+turninStructCode+"存在正在执行的任务");
|
||||
}
|
||||
}
|
||||
handMoveStorService.insertDtl(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user