rev:修改所有代码状态判断根据枚举code判断
This commit is contained in:
@@ -40,6 +40,12 @@ public enum StatusEnum {
|
|||||||
POINT_LOCATION_REC("2","接料位",""),
|
POINT_LOCATION_REC("2","接料位",""),
|
||||||
POINT_LOCATION_FULL("3","满料位",""),
|
POINT_LOCATION_FULL("3","满料位",""),
|
||||||
POINT_LOCATION_IN("4","上料位",""),
|
POINT_LOCATION_IN("4","上料位",""),
|
||||||
|
//出入料箱
|
||||||
|
IN_VEHICLE("1","入箱",""),
|
||||||
|
OUT_VEHICLE("2","出箱",""),
|
||||||
|
//出入料箱
|
||||||
|
PAUSE_CACHELINE("1","暂停",""),
|
||||||
|
START_CACHELINE("2","启动",""),
|
||||||
;
|
;
|
||||||
private String code;
|
private String code;
|
||||||
private String desc;
|
private String desc;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class MobileAuthorizationController {
|
|||||||
private final ISysRoleService roleService;
|
private final ISysRoleService roleService;
|
||||||
|
|
||||||
@ApiOperation("登录授权")
|
@ApiOperation("登录授权")
|
||||||
@PostMapping(value = "/login")
|
@PostMapping(value = "/login")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
public ResponseEntity<Object> login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception {
|
||||||
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
// 密码解密 - 前端的加密规则: encrypt(根据实际更改)
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import java.util.Map;
|
|||||||
@Api(tags = "海亮缓存线手持服务")
|
@Api(tags = "海亮缓存线手持服务")
|
||||||
@RequestMapping("/api/cacheLineHand")
|
@RequestMapping("/api/cacheLineHand")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SaIgnore
|
|
||||||
public class CacheLineHandController{
|
public class CacheLineHandController{
|
||||||
private final CacheLineHandService cacheLineHandService;
|
private final CacheLineHandService cacheLineHandService;
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ public class CacheLineHandController{
|
|||||||
//限制查询参数过短,模糊力度大
|
//限制查询参数过短,模糊力度大
|
||||||
int length = params.getBytes().length;
|
int length = params.getBytes().length;
|
||||||
if(length < 3) {
|
if(length < 3) {
|
||||||
throw new BizCoreException("您输入的条件匹配的范围太大,请重新输入稍长一点的内容。");
|
throw new BizCoreException("您输入的条件所匹配的范围太大,请输入大于2个字的内容。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ResponseEntity<>(cacheLineHandService.queryMaterial(params), HttpStatus.OK);
|
return new ResponseEntity<>(cacheLineHandService.queryMaterial(params), HttpStatus.OK);
|
||||||
@@ -106,7 +105,7 @@ public class CacheLineHandController{
|
|||||||
@PostMapping("/instPageQuery")
|
@PostMapping("/instPageQuery")
|
||||||
@Log("任务分页查询")
|
@Log("任务分页查询")
|
||||||
@ApiOperation("任务分页数据")
|
@ApiOperation("任务分页数据")
|
||||||
public ResponseEntity<Map<String,Object>> instPageQuery(@RequestBody Map<String,String> param, Pageable page) {
|
public ResponseEntity<Object> instPageQuery(@RequestBody Map<String,String> param, Pageable page) {
|
||||||
log.info("海亮缓存线手持服务 [任务分页查询] 接口被请求, 请求参数-{}", param);
|
log.info("海亮缓存线手持服务 [任务分页查询] 接口被请求, 请求参数-{}", param);
|
||||||
if(null == param) {
|
if(null == param) {
|
||||||
throw new BizCoreException(ResultCode.MISS_PARAMETER);
|
throw new BizCoreException(ResultCode.MISS_PARAMETER);
|
||||||
@@ -181,7 +180,7 @@ public class CacheLineHandController{
|
|||||||
@PostMapping("/inOutExceptionInstConfirm")
|
@PostMapping("/inOutExceptionInstConfirm")
|
||||||
@Log("缓存线出入箱异常指令确认")
|
@Log("缓存线出入箱异常指令确认")
|
||||||
@ApiOperation("缓存线出入箱异常指令确认")
|
@ApiOperation("缓存线出入箱异常指令确认")
|
||||||
public ResponseEntity<String> inOutExceptionInstConfirm(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> inOutExceptionInstConfirm(@RequestBody JSONObject param) {
|
||||||
log.info("海亮缓存线手持服务 [缓存线出入箱异常指令确认] 接口被请求, 请求参数-{}", param);
|
log.info("海亮缓存线手持服务 [缓存线出入箱异常指令确认] 接口被请求, 请求参数-{}", param);
|
||||||
//参数校验
|
//参数校验
|
||||||
if(StringUtils.isEmpty(param.getString("instruct_uuid")) || StringUtils.isEmpty(param.getString("inOut_type")) || StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("vehicle_code"))) {
|
if(StringUtils.isEmpty(param.getString("instruct_uuid")) || StringUtils.isEmpty(param.getString("inOut_type")) || StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("vehicle_code"))) {
|
||||||
@@ -263,7 +262,7 @@ public class CacheLineHandController{
|
|||||||
@PostMapping("/cacheLineExcepOpt")
|
@PostMapping("/cacheLineExcepOpt")
|
||||||
@Log("缓存线异常处理")
|
@Log("缓存线异常处理")
|
||||||
@ApiOperation("缓存线异常处理")
|
@ApiOperation("缓存线异常处理")
|
||||||
public ResponseEntity<String> cacheLineExcepOpt(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> cacheLineExcepOpt(@RequestBody JSONObject param) {
|
||||||
log.info("海亮缓存线手持服务 [缓存线异常处理] 接口被请求, 请求参数-{}", param);
|
log.info("海亮缓存线手持服务 [缓存线异常处理] 接口被请求, 请求参数-{}", param);
|
||||||
//参数校验
|
//参数校验
|
||||||
if(StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("opt_type"))) {
|
if(StringUtils.isEmpty(param.getString("wcsdevice_code")) || StringUtils.isEmpty(param.getString("opt_type"))) {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ public interface CacheLineHandService{
|
|||||||
* @author gbx
|
* @author gbx
|
||||||
* @date 2023/3/24
|
* @date 2023/3/24
|
||||||
*/
|
*/
|
||||||
String inOutExceptionInstConfirm(JSONObject param);
|
Map<String, Object> inOutExceptionInstConfirm(JSONObject param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务操作
|
* 任务操作
|
||||||
@@ -245,7 +245,7 @@ public interface CacheLineHandService{
|
|||||||
* @author gbx
|
* @author gbx
|
||||||
* @date 2023/3/24
|
* @date 2023/3/24
|
||||||
*/
|
*/
|
||||||
String cacheLineExcepOpt(JSONObject param);
|
Map<String,Object> cacheLineExcepOpt(JSONObject param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 倒料操作
|
* 倒料操作
|
||||||
@@ -254,7 +254,7 @@ public interface CacheLineHandService{
|
|||||||
* @author gbx
|
* @author gbx
|
||||||
* @date 2023/3/24
|
* @date 2023/3/24
|
||||||
*/
|
*/
|
||||||
void pourMaterial(JSONObject param);
|
Map<String,Object> pourMaterial(JSONObject param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存线下拉框
|
* 缓存线下拉框
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import org.nl.common.enums.StatusEnum;
|
|||||||
import org.nl.common.utils.*;
|
import org.nl.common.utils.*;
|
||||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.exception.BizCoreException;
|
|
||||||
import org.nl.modules.common.utils.RedisUtils;
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
@@ -26,12 +25,12 @@ import org.nl.wms.pda.dto.MaterialDto;
|
|||||||
import org.nl.wms.pda.service.CacheLineHandService;
|
import org.nl.wms.pda.service.CacheLineHandService;
|
||||||
import org.nl.wms.sch.tasks.SpeMachineryTask;
|
import org.nl.wms.sch.tasks.SpeMachineryTask;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.xml.transform.Result;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
@@ -53,8 +52,8 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
private final RedisUtils redisUtils;
|
private final RedisUtils redisUtils;
|
||||||
@Autowired
|
@Autowired
|
||||||
private LocalCache cache;
|
private LocalCache cache;
|
||||||
@Autowired
|
@Value("${acs.url}")
|
||||||
private ClassstandardService classstandardService;
|
private String acsUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONArray dropdownListQuery(String param, String type) {
|
public JSONArray dropdownListQuery(String param, String type) {
|
||||||
@@ -115,7 +114,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
private List<MaterialDto> getMaterialDto(List<MaterialDto> materialList, String param) {
|
private List<MaterialDto> getMaterialDto(List<MaterialDto> materialList, String param) {
|
||||||
if(StringUtils.isNotEmpty(param)) {
|
if(StringUtils.isNotEmpty(param)) {
|
||||||
//按条件搜索
|
//按条件搜索
|
||||||
materialList = materialList.stream().filter(m -> (m.getMaterial_name().indexOf(param) > -1) || (m.getMaterial_code().indexOf(param)) > -1 || (m.getMaterial_spec().indexOf(param)) > -1|| (m.getClass_name().indexOf(param)) > -1).collect(Collectors.toList());
|
materialList = materialList.stream().filter(m -> (m.getMaterial_name().indexOf(param) > -1) || (m.getMaterial_code().indexOf(param)) > -1 || (m.getMaterial_spec().indexOf(param)) > -1 || (m.getClass_name().indexOf(param)) > -1).collect(Collectors.toList());
|
||||||
return materialList;
|
return materialList;
|
||||||
}
|
}
|
||||||
return materialList;
|
return materialList;
|
||||||
@@ -194,12 +193,12 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
SpeMachineryTask SpeMachineryTask = new SpeMachineryTask();
|
SpeMachineryTask SpeMachineryTask = new SpeMachineryTask();
|
||||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||||
JSONObject taskObject = taskTab.query("task_id =" + param.getString("instruct_uuid")).uniqueResult(0);
|
JSONObject taskObject = taskTab.query("task_id =" + param.getString("instruct_uuid")).uniqueResult(0);
|
||||||
//01-取消、02-完成、03-任务下发,根据操作类型执行相关操作
|
//1-取消、2-完成、3-任务下发,根据操作类型执行相关操作
|
||||||
if("1".equals(optType) || "2".equals(optType)) {
|
if(StatusEnum.TASK_CANNEL.getCode().equals(optType) || StatusEnum.TASK_FINISH.getCode().equals(optType)) {
|
||||||
return updateTaskStatus(taskObject, optType);
|
return updateTaskStatus(taskObject, optType);
|
||||||
}
|
}
|
||||||
//任务下发
|
//任务下发
|
||||||
else if("3".equals(optType)) {
|
else if(StatusEnum.TASK_PUBLISH.getCode().equals(optType)) {
|
||||||
return SpeMachineryTask.createTask(taskObject);
|
return SpeMachineryTask.createTask(taskObject);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -256,7 +255,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* status = 0: 空位 status = 1: 绿色空箱 || status = 2:黄色满箱 || status = 3:红色异常 || status = 4 :不展示
|
* status = 1: 空位 status = 2: 绿色空箱 || status = 3:黄色满箱 || status = 4:红色异常 || status = 5 :不展示
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public JSONArray cacheLineMaterInfoQuery(JSONObject param) {
|
public JSONArray cacheLineMaterInfoQuery(JSONObject param) {
|
||||||
@@ -273,14 +272,14 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
json.put("weight", "0");
|
json.put("weight", "0");
|
||||||
json.put("quantity", "0");
|
json.put("quantity", "0");
|
||||||
//不展示
|
//不展示
|
||||||
if("0".equals(json.getString("is_show"))) {
|
if(StatusEnum.CACHE_VEL_DIS.getCode().equals(json.getString("is_show"))) {
|
||||||
json.put("vehicle_status", "4");
|
json.put("vehicle_status", StatusEnum.CACHE_VEL_DIS.getCode());
|
||||||
}
|
}
|
||||||
//展示
|
//展示
|
||||||
else{
|
else{
|
||||||
//是否空位
|
//是否空位
|
||||||
if("1".equals(json.getString("is_empty"))) {
|
if(StatusEnum.CACHE_VEL_NULL.getCode().equals(json.getString("is_empty"))) {
|
||||||
json.put("vehicle_status", "0");
|
json.put("vehicle_status", StatusEnum.STATUS_FLASE.getCode());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// 载具不是空位
|
// 载具不是空位
|
||||||
@@ -289,7 +288,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
JSONObject ivtObj = ivtTab.query("vehicle_code = '" + vehicle_code + "' and cacheLine_code like '%" + param.getString("wcsdevice_code") + "%'").uniqueResult(0);
|
JSONObject ivtObj = ivtTab.query("vehicle_code = '" + vehicle_code + "' and cacheLine_code like '%" + param.getString("wcsdevice_code") + "%'").uniqueResult(0);
|
||||||
if(ivtObj == null) {
|
if(ivtObj == null) {
|
||||||
//标记为红色异常
|
//标记为红色异常
|
||||||
json.put("vehicle_status", "3");
|
json.put("vehicle_status", StatusEnum.CACHE_VEL_ERR.getCode());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
json.put("vehicle_status", ivtObj.getString("vehicle_status"));
|
json.put("vehicle_status", ivtObj.getString("vehicle_status"));
|
||||||
@@ -441,7 +440,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
//缓存线载具物料表
|
//缓存线载具物料表
|
||||||
WQLObject vehMaterTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
WQLObject vehMaterTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||||
// 入空箱
|
// 入空箱
|
||||||
if("1".equals(inOut_type)) {
|
if(StatusEnum.IN_VEHICLE.getCode().equals(inOut_type)) {
|
||||||
// 1.判断是否可以放入空箱子
|
// 1.判断是否可以放入空箱子
|
||||||
JSONObject ivtObj = positionTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
JSONObject ivtObj = positionTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||||
if(ivtObj != null) {
|
if(ivtObj != null) {
|
||||||
@@ -457,13 +456,13 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
afterIvt.put("vehmaterial_id", IdUtil.getStringId());
|
afterIvt.put("vehmaterial_id", IdUtil.getStringId());
|
||||||
afterIvt.put("vehicle_code", vehicle_code);
|
afterIvt.put("vehicle_code", vehicle_code);
|
||||||
afterIvt.put("cacheLine_code", cacheLine_code);
|
afterIvt.put("cacheLine_code", cacheLine_code);
|
||||||
afterIvt.put("vehicle_status", "1");
|
afterIvt.put("vehicle_status", StatusEnum.STATUS_TRUE.getCode());
|
||||||
afterIvt.put("update_time", DateUtil.now());
|
afterIvt.put("update_time", DateUtil.now());
|
||||||
afterIvt.put("create_time", DateUtil.now());
|
afterIvt.put("create_time", DateUtil.now());
|
||||||
result = vehMaterTab.insert(afterIvt).getSucess();
|
result = vehMaterTab.insert(afterIvt).getSucess();
|
||||||
}
|
}
|
||||||
// 出空箱
|
// 出空箱
|
||||||
if("2".equals(inOut_type)) {
|
if(StatusEnum.OUT_VEHICLE.getCode().equals(inOut_type)) {
|
||||||
// 缓存线载具物料表
|
// 缓存线载具物料表
|
||||||
JSONObject json = vehMaterTab.query("cacheLine_code = '" + cacheLine_code + "'and vehicle_code = '" + vehicle_code + "' and vehicle_status= '1'").uniqueResult(0);
|
JSONObject json = vehMaterTab.query("cacheLine_code = '" + cacheLine_code + "'and vehicle_code = '" + vehicle_code + "' and vehicle_status= '1'").uniqueResult(0);
|
||||||
if(json == null) {
|
if(json == null) {
|
||||||
@@ -493,7 +492,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||||
JSONArray result = new JSONArray();
|
JSONArray result = new JSONArray();
|
||||||
// 入箱扫码异常
|
// 入箱扫码异常
|
||||||
if("1".equals(inOut_type)) {
|
if(StatusEnum.IN_VEHICLE.getCode().equals(inOut_type)) {
|
||||||
String where = "point_code2 = '" + wcsdevice_code + "' and task_status <> '7'";
|
String where = "point_code2 = '" + wcsdevice_code + "' and task_status <> '7'";
|
||||||
if(StringUtils.isNotBlank(vehicle_code)) {
|
if(StringUtils.isNotBlank(vehicle_code)) {
|
||||||
where = "point_code2 = '" + wcsdevice_code + "' and vehicle_code = '" + vehicle_code + "' and task_status <> '7'";
|
where = "point_code2 = '" + wcsdevice_code + "' and vehicle_code = '" + vehicle_code + "' and task_status <> '7'";
|
||||||
@@ -513,7 +512,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 出箱扫码异常
|
// 出箱扫码异常
|
||||||
if("2".equals(inOut_type)) {
|
if(StatusEnum.OUT_VEHICLE.getCode().equals(inOut_type)) {
|
||||||
String where = "point_code1 = '" + wcsdevice_code + "' and task_status <> '7'";
|
String where = "point_code1 = '" + wcsdevice_code + "' and task_status <> '7'";
|
||||||
if(StringUtils.isNotBlank(vehicle_code)) {
|
if(StringUtils.isNotBlank(vehicle_code)) {
|
||||||
where = "point_code1 = '" + wcsdevice_code + "' and vehicle_code = '" + vehicle_code + "' and task_status <> '7'";
|
where = "point_code1 = '" + wcsdevice_code + "' and vehicle_code = '" + vehicle_code + "' and task_status <> '7'";
|
||||||
@@ -536,13 +535,14 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 扫码异常确认
|
||||||
* 出入类型 inOut_type 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
* 出入类型 inOut_type 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
||||||
* 缓存线编码 wcsdevice_code
|
* 缓存线编码 wcsdevice_code
|
||||||
* 缓存线位置编码 position_code
|
* 缓存线位置编码 position_code
|
||||||
* 料箱码 vehicle_code
|
* 料箱码 vehicle_code
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String inOutExceptionInstConfirm(JSONObject param) {
|
public Map<String,Object> inOutExceptionInstConfirm(JSONObject param) {
|
||||||
// 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
// 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
||||||
String inOut_type = param.getString("inOut_type");
|
String inOut_type = param.getString("inOut_type");
|
||||||
// 缓存线编码
|
// 缓存线编码
|
||||||
@@ -554,33 +554,48 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
// 封装给acs的数据
|
// 封装给acs的数据
|
||||||
JSONArray jsonArray = new JSONArray();
|
JSONArray jsonArray = new JSONArray();
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
// 1 扫码异常-入箱扫码 2 出箱扫码
|
||||||
jsonObject.put("inOut_type", inOut_type);
|
jsonObject.put("inOut_type", inOut_type);
|
||||||
|
//缓存线编号
|
||||||
jsonObject.put("wcsdevice_code", wcsdevice_code);
|
jsonObject.put("wcsdevice_code", wcsdevice_code);
|
||||||
|
//料箱码
|
||||||
jsonObject.put("vehicle_code", vehicle_code);
|
jsonObject.put("vehicle_code", vehicle_code);
|
||||||
|
//缓存线点位编码
|
||||||
jsonObject.put("position_code", position_code);
|
jsonObject.put("position_code", position_code);
|
||||||
jsonArray.add(jsonObject);
|
jsonArray.add(jsonObject);
|
||||||
//TOFIX 等确定api后,换成下发的url
|
try {
|
||||||
return AcsUtil.notifyAcs("api", jsonArray).getString("status");
|
//TOFIX 等确定api后,换成下发的url
|
||||||
|
return AcsUtil.notifyAcs(acsUrl, jsonArray);
|
||||||
|
}
|
||||||
|
catch(NullPointerException e) {
|
||||||
|
throw new BadRequestException(e.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String cacheLineExcepOpt(JSONObject param) {
|
public Map<String,Object> cacheLineExcepOpt(JSONObject param) {
|
||||||
// 缓存线编码
|
// 缓存线编码
|
||||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||||
// 1-暂停、2-启动
|
// opt_type 1-暂停、2-启动,默认为1暂停
|
||||||
|
String type = StatusEnum.PAUSE_CACHELINE.getCode();
|
||||||
String opt_type = param.getString("opt_type");
|
String opt_type = param.getString("opt_type");
|
||||||
// 类型:恢复是0,暂停是1
|
if(StatusEnum.START_CACHELINE.getCode().equals(opt_type)) {
|
||||||
String type = "1";
|
|
||||||
if("2".equals(opt_type)) {
|
|
||||||
type = "0";
|
type = "0";
|
||||||
}
|
}
|
||||||
JSONArray jsonArray = new JSONArray();
|
JSONArray jsonArray = new JSONArray();
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
//下发接收的,恢复是0,暂停是1
|
||||||
jsonObject.put("type", type);
|
jsonObject.put("type", type);
|
||||||
|
//缓存线编码
|
||||||
jsonObject.put("wcsdevice_code", wcsdevice_code);
|
jsonObject.put("wcsdevice_code", wcsdevice_code);
|
||||||
jsonArray.add(jsonObject);
|
jsonArray.add(jsonObject);
|
||||||
//TOFIX 等确定api后,换成下发的url
|
try {
|
||||||
return AcsUtil.notifyAcs("api", jsonArray).getString("status");
|
//TOFIX 等确定api后,换成下发的url
|
||||||
|
return AcsUtil.notifyAcs(acsUrl, jsonArray);
|
||||||
|
}
|
||||||
|
catch(NullPointerException e) {
|
||||||
|
throw new BadRequestException(e.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -646,7 +661,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
json.put("vehmaterial_id", IdUtil.getStringId());
|
json.put("vehmaterial_id", IdUtil.getStringId());
|
||||||
json.put("create_time", DateUtil.now());
|
json.put("create_time", DateUtil.now());
|
||||||
// 入满箱扫码异常
|
// 入满箱扫码异常
|
||||||
if("1".equals(inOut_type)) {
|
if(StatusEnum.IN_VEHICLE.getCode().equals(inOut_type)) {
|
||||||
//5.通过缓存线位置表当前执行任务id,获取任务信息中的物料信息
|
//5.通过缓存线位置表当前执行任务id,获取任务信息中的物料信息
|
||||||
JSONObject positionInfo = positionTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
JSONObject positionInfo = positionTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||||
//查不到点位信息
|
//查不到点位信息
|
||||||
@@ -672,12 +687,12 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
json.put("material_name", meObj.getString("material_name"));
|
json.put("material_name", meObj.getString("material_name"));
|
||||||
json.put("quantity", instructObj.getString("material_qty"));
|
json.put("quantity", instructObj.getString("material_qty"));
|
||||||
json.put("product_area", instructObj.getString("product_area"));
|
json.put("product_area", instructObj.getString("product_area"));
|
||||||
json.put("vehicle_status", "2");
|
json.put("vehicle_status", StatusEnum.CACHE_VEL_EMT.getCode());
|
||||||
}
|
}
|
||||||
// 出满箱扫码异常
|
// 出满箱扫码异常
|
||||||
if("2".equals(inOut_type)) {
|
if(StatusEnum.OUT_VEHICLE.getCode().equals(inOut_type)) {
|
||||||
//5.重新新建该缓存线位置上的料箱为空箱子,是空料箱没有放物料等其他信息
|
//5.重新新建该缓存线位置上的料箱为空箱子,是空料箱没有放物料等其他信息
|
||||||
json.put("vehicle_status", "1");
|
json.put("vehicle_status", StatusEnum.STATUS_TRUE.getCode());
|
||||||
json.put("material_uuid", "");
|
json.put("material_uuid", "");
|
||||||
json.put("material_code", "");
|
json.put("material_code", "");
|
||||||
json.put("material_spec", "");
|
json.put("material_spec", "");
|
||||||
@@ -798,7 +813,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pourMaterial(JSONObject param) {
|
public Map<String,Object> pourMaterial(JSONObject param) {
|
||||||
// 指令标识
|
// 指令标识
|
||||||
String instruct_uuid = param.getString("instruct_uuid");
|
String instruct_uuid = param.getString("instruct_uuid");
|
||||||
// 指令点位表【sch_base_task】
|
// 指令点位表【sch_base_task】
|
||||||
@@ -810,8 +825,13 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
jsonObject.put("producer", producer);
|
jsonObject.put("producer", producer);
|
||||||
jsonObject.put("putquantity", putquantity);
|
jsonObject.put("putquantity", putquantity);
|
||||||
jsonArray.add(jsonObject);
|
jsonArray.add(jsonObject);
|
||||||
//TOFIX 等确定api后,换成下发的url
|
try {
|
||||||
AcsUtil.notifyAcs("api", jsonArray);
|
//TOFIX 等确定api后,换成下发的url
|
||||||
|
return AcsUtil.notifyAcs(acsUrl, jsonArray);
|
||||||
|
}
|
||||||
|
catch(NullPointerException e) {
|
||||||
|
throw new BadRequestException(e.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user