Merge branch 'b_lms' of http://121.40.234.130:8899/root/lanzhouhailiang_one into b_lms
This commit is contained in:
Binary file not shown.
@@ -116,7 +116,7 @@ public class AcsToWmsController {
|
||||
}
|
||||
|
||||
/*@PostMapping("/getQZZInfo")
|
||||
|
||||
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getQZZInfo(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acsToWmsService.getQZZInfo(jo), HttpStatus.OK);
|
||||
@@ -177,5 +177,10 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.deviceApplyExceptional(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/slitterApply")
|
||||
@Log(value = "二期分切请求", isInterfaceLog = true, interfaceLogType = InterfaceLogType.ACS_TO_LMS)
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> slitterApply(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.slitterApply(param), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,4 +167,11 @@ public interface AcsToWmsService {
|
||||
* }
|
||||
*/
|
||||
JSONObject deviceApplyExceptional(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 二期分切请求
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
JSONObject slitterApply(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.TwoBoxExcepTask;
|
||||
import org.nl.b_lms.sch.tasks.first_floor_area.MzhcwTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.TASKEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.*;
|
||||
@@ -47,6 +48,7 @@ import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -126,6 +128,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Resource
|
||||
private MzhcwTask mzhcwTask;
|
||||
|
||||
private final SlitterService slitterService;
|
||||
|
||||
|
||||
/**
|
||||
* task_id:任务标识
|
||||
@@ -2012,6 +2016,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
point_code = inBussManageService.taskExceptional(whereJson);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("点位为空!");
|
||||
}
|
||||
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "下发成功!");
|
||||
result.put("point_code", point_code);
|
||||
@@ -2029,4 +2038,56 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public JSONObject slitterApply(JSONObject param) {
|
||||
log.info("slitterApply请求参数:---------------------------------------------{}", param);
|
||||
JSONObject res = new JSONObject();
|
||||
String deviceCode = param.getString("device_code");
|
||||
String type = param.getString("type");
|
||||
if (ObjectUtil.isEmpty(type)) {
|
||||
throw new BadRequestException("任务类型「type」不能为空");
|
||||
}
|
||||
RLock lock = redissonClient.getLock(deviceCode);
|
||||
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
switch (type) {
|
||||
case "1":
|
||||
// 申请套管
|
||||
res = slitterService.acsRequestShaftLoadTube(param);
|
||||
break;
|
||||
case "2":
|
||||
// 套管完成
|
||||
res = slitterService.acsFinishLoadShaft(param);
|
||||
break;
|
||||
case "3":
|
||||
// 拔轴完成
|
||||
res = slitterService.acsFinishShaftPluckTube(param);
|
||||
break;
|
||||
case "4":
|
||||
// 申请拔轴
|
||||
res = slitterService.acsRequestShaftPluckTube(param);
|
||||
break;
|
||||
case "5":
|
||||
// 缓存线已满,生产桁架任务
|
||||
res = slitterService.acsSendShaftToCache(param);
|
||||
break;
|
||||
default:
|
||||
log.error("slitterApply任务类型「{}」无效!,参数:---------------------------------------------{}", type, param);
|
||||
throw new BadRequestException("任务类型「" + type + "」无效!");
|
||||
}
|
||||
} else {
|
||||
log.error("slitterApply系统繁忙,参数:---------------------------------------------{}", param);
|
||||
throw new BadRequestException("系统繁忙,请稍后再试!");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
log.info("slitterApply返回参数:---------------------------------------------{}", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,6 @@ public class AcsTaskDto {
|
||||
* 扩展参数
|
||||
*/
|
||||
private String params;
|
||||
private String params2;
|
||||
/**
|
||||
* 温度
|
||||
*/
|
||||
@@ -109,7 +108,7 @@ public class AcsTaskDto {
|
||||
/**
|
||||
* 任务扩展字段
|
||||
*/
|
||||
private String interaction_json;
|
||||
private JSONObject interaction_json;
|
||||
/**
|
||||
* 空点位
|
||||
*/
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@@ -139,8 +140,15 @@ public class TaskServiceImpl implements TaskService {
|
||||
// 任务处理类
|
||||
String processing_class = taskObj.getString("handle_class");
|
||||
String message = "";
|
||||
|
||||
try {
|
||||
Object obj = SpringContextHolder.getBean(Class.forName(processing_class));
|
||||
Object obj = new Object();
|
||||
try {
|
||||
obj = SpringContextHolder.getBean(Class.forName(processing_class));
|
||||
} catch (Exception e) {
|
||||
Class<?> clz = Class.forName(processing_class);
|
||||
obj = clz.newInstance();
|
||||
}
|
||||
// 调用每个任务类的method_name()强制结束方法
|
||||
Method m = obj.getClass().getMethod(method_name, String.class);
|
||||
JSONObject result = (JSONObject) m.invoke(obj, task_id);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.outbill.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -403,6 +404,7 @@ public class CheckOutBillController {
|
||||
|
||||
@PostMapping("/testBoxLash")
|
||||
@Log("木箱捆扎测试")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> testBoxLash(@RequestBody JSONObject whereJson) {
|
||||
lashManageService.createLashTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
Reference in New Issue
Block a user