拆分LMS任务
This commit is contained in:
@@ -66,12 +66,16 @@ public class FaultDeviceServiceImpl implements FaultDeviceService {
|
||||
|
||||
JSONObject param = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(device_code)) {
|
||||
JSONObject device_jo = WQLObject.getWQLObject("EM_BI_MonitorDevice").query("device_code = '"+device_code+"'").uniqueResult(0);
|
||||
param.put("device_code",device_code);
|
||||
param.put("product_area",device_jo.getString("plant_code"));
|
||||
} else {
|
||||
// 不为空则只需要查询专机设备
|
||||
JSONObject jsonStr = WQL.getWO("QMD_BI_FAULT").addParam("flag", "3").process().uniqueResult(0);
|
||||
String str = jsonStr.getString("str");
|
||||
String product_area = jsonStr.getString("product_area");
|
||||
param.put("device_code",str);
|
||||
param.put("product_area",product_area);
|
||||
}
|
||||
|
||||
// 调用acs接口获取设备
|
||||
|
||||
@@ -91,7 +91,8 @@
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
GROUP_CONCAT(device_code) AS str
|
||||
GROUP_CONCAT(device_code) AS str,
|
||||
plant_code AS product_area
|
||||
FROM
|
||||
EM_BI_MonitorDevice
|
||||
WHERE
|
||||
|
||||
@@ -877,6 +877,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
tran_jo.put("vehicle_code2", right_point.getString("vehicle_code"));
|
||||
tran_jo.put("task_type", "010406");
|
||||
tran_jo.put("product_area", product_area);
|
||||
cutConveyorTask.createTask(tran_jo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
import org.nl.wms.sch.tasks.URLEnum;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -86,10 +87,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
String product_area = whereJson.getString("product_area");
|
||||
|
||||
String url = acsUrl + api;
|
||||
if (StrUtil.isEmpty(product_area)) {
|
||||
throw new BadRequestException("区域不能为空!下发信息:" + whereJson.toString());
|
||||
}
|
||||
|
||||
String acs_url = URLEnum.find(product_area);
|
||||
if (StrUtil.isEmpty(acs_url)) {
|
||||
log.info(product_area);
|
||||
throw new BadRequestException("未查询到区域对应的acs地址!");
|
||||
}
|
||||
|
||||
String url = acs_url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(whereJson))
|
||||
@@ -125,10 +135,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
String product_area = whereJson.getString("product_area");
|
||||
|
||||
String url = acsUrl + api;
|
||||
if (StrUtil.isEmpty(product_area)) {
|
||||
throw new BadRequestException("区域不能为空!下发信息:" + whereJson.toString());
|
||||
}
|
||||
|
||||
String acs_url = URLEnum.find(product_area);
|
||||
if (StrUtil.isEmpty(acs_url)) {
|
||||
log.info(product_area);
|
||||
throw new BadRequestException("未查询到区域对应的acs地址!");
|
||||
}
|
||||
|
||||
String url = acs_url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(whereJson))
|
||||
@@ -248,7 +267,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
// 工作时长:电量百分比*6
|
||||
String electricity = json.getString("electricity");
|
||||
json.put("run_time", NumberUtil.round(NumberUtil.div(NumberUtil.mul(electricity, run_time),100), 1));
|
||||
json.put("run_time", NumberUtil.round(NumberUtil.div(NumberUtil.mul(electricity, run_time), 100), 1));
|
||||
|
||||
if ("2,3".contains(json.getString("car_no"))) {
|
||||
ArrA1.add(json);
|
||||
@@ -348,6 +367,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
String product_area = "A1";
|
||||
|
||||
String acs_url = URLEnum.find(product_area);
|
||||
if (StrUtil.isEmpty(acs_url)) {
|
||||
log.info(product_area);
|
||||
throw new BadRequestException("未查询到区域对应的acs地址!");
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
|
||||
@@ -386,10 +413,20 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
String product_area = whereJson.getString("product_area");
|
||||
|
||||
String url = acsUrl + api;
|
||||
if (StrUtil.isEmpty(product_area)) {
|
||||
throw new BadRequestException("区域不能为空!下发信息:" + whereJson.toString());
|
||||
}
|
||||
|
||||
String acs_url = URLEnum.find(product_area);
|
||||
if (StrUtil.isEmpty(acs_url)) {
|
||||
log.info(product_area);
|
||||
throw new BadRequestException("未查询到区域对应的acs地址!");
|
||||
}
|
||||
|
||||
|
||||
String url = acs_url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(whereJson))
|
||||
@@ -424,10 +461,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
String product_area = jo.getString("product_area");
|
||||
|
||||
String url = acsUrl + api;
|
||||
if (StrUtil.isEmpty(product_area)) {
|
||||
throw new BadRequestException("区域不能为空!下发信息:" + jo.toString());
|
||||
}
|
||||
|
||||
String acs_url = URLEnum.find(product_area);
|
||||
if (StrUtil.isEmpty(acs_url)) {
|
||||
log.info(product_area);
|
||||
throw new BadRequestException("未查询到区域对应的acs地址!");
|
||||
}
|
||||
|
||||
String url = acs_url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(jo))
|
||||
|
||||
@@ -509,8 +509,13 @@ public class BakingServiceImpl implements BakingService {
|
||||
public JSONObject release(JSONObject whereJson) {
|
||||
JSONArray rows = new JSONArray();
|
||||
JSONObject jo = new JSONObject();
|
||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '"+whereJson.getString("point_code")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)){
|
||||
throw new BadRequestException("未查询到对应的报警灯点位!");
|
||||
}
|
||||
jo.put("device_code", whereJson.getString("point_code"));
|
||||
jo.put("code", "to_command");
|
||||
jo.put("product_area", point_jo.getString("product_area"));
|
||||
jo.put("value", "0");
|
||||
rows.add(jo);
|
||||
new WmsToAcsServiceImpl().action(rows);
|
||||
|
||||
@@ -185,6 +185,11 @@ public class CasingServiceImpl implements CasingService {
|
||||
throw new BadRequestException("点位编码不能为空!");
|
||||
}
|
||||
|
||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '"+point_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)){
|
||||
throw new BadRequestException("未查询到对应的穿拔轴机构,请扫描正确点位!");
|
||||
}
|
||||
|
||||
JSONObject qzz_jo = WQLObject.getWQLObject("md_pb_storagevehicleinfo").query("storagevehicle_code = '" + qzzno + "' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(qzz_jo)) {
|
||||
throw new BadRequestException("该气涨轴不存在或被删除!");
|
||||
@@ -206,6 +211,7 @@ public class CasingServiceImpl implements CasingService {
|
||||
|
||||
JSONObject device_jo = new JSONObject();
|
||||
device_jo.put("device_code", whereJson.getString("point_code"));
|
||||
device_jo.put("product_area", point_jo.getString("product_area"));
|
||||
device_jo.put("type", "1");
|
||||
device_jo.put("size", to_size);
|
||||
new WmsToAcsServiceImpl().putPlusPullAction(device_jo);
|
||||
@@ -227,6 +233,11 @@ public class CasingServiceImpl implements CasingService {
|
||||
throw new BadRequestException("点位编码不能为空!");
|
||||
}
|
||||
|
||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '"+point_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)){
|
||||
throw new BadRequestException("未查询到对应的穿拔轴机构,请扫描正确点位!");
|
||||
}
|
||||
|
||||
JSONObject qzz_jo = WQLObject.getWQLObject("md_pb_storagevehicleinfo").query("storagevehicle_code = '" + qzzno + "' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(qzz_jo)) {
|
||||
throw new BadRequestException("该气涨轴不存在或被删除!");
|
||||
@@ -248,6 +259,7 @@ public class CasingServiceImpl implements CasingService {
|
||||
|
||||
JSONObject device_jo = new JSONObject();
|
||||
device_jo.put("device_code", whereJson.getString("point_code"));
|
||||
device_jo.put("product_area", point_jo.getString("product_area"));
|
||||
device_jo.put("type", "0");
|
||||
device_jo.put("size", to_size);
|
||||
new WmsToAcsServiceImpl().putPlusPullAction(device_jo);
|
||||
|
||||
@@ -133,6 +133,7 @@ public class InServiceImpl implements InService {
|
||||
throw new BadRequestException("点位:"+convey_jo.getString("point_code")+"载具号为空!");
|
||||
}
|
||||
form.put("vehicle_code2", convey_jo.getString("vehicle_code"));
|
||||
form.put("product_area", convey_jo.getString("product_area"));
|
||||
CutConveyorTask cutConveyorTask = new CutConveyorTask();
|
||||
cutConveyorTask.createTask(form);
|
||||
|
||||
|
||||
@@ -280,6 +280,7 @@ public class OutServiceImpl implements OutService {
|
||||
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + convey_jo.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
|
||||
form.put("point_code2", ss_jo.getString("point_code"));
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", convey_jo.getString("product_area"));
|
||||
CutConveyorTask cutConveyorTask = new CutConveyorTask();
|
||||
cutConveyorTask.createTask(form);
|
||||
|
||||
|
||||
@@ -65,9 +65,14 @@ public class PaperTubeServiceImpl implements PaperTubeService {
|
||||
if (StrUtil.isEmpty(material_code)) {
|
||||
throw new BadRequestException("物料不能为空!");
|
||||
}
|
||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)){
|
||||
throw new BadRequestException("未查询到对应的穿拔轴机构,请扫描正常点位!");
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code", device_code);
|
||||
jo.put("material_code", material_code);
|
||||
jo.put("product_area", point_jo.getString("product_area"));
|
||||
jo.put("type", "1");
|
||||
wmsToAcsService.PaperTubeAction(jo);
|
||||
}
|
||||
@@ -84,9 +89,14 @@ public class PaperTubeServiceImpl implements PaperTubeService {
|
||||
if (qty <= 0) {
|
||||
throw new BadRequestException("出库数量必须大于0");
|
||||
}
|
||||
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)){
|
||||
throw new BadRequestException("未查询到对应的穿拔轴机构,请扫描正常点位!");
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code", device_code);
|
||||
jo.put("material_code", material_code);
|
||||
jo.put("product_area", point_jo.getString("product_area"));
|
||||
jo.put("type", "2");
|
||||
jo.put("qty", qty);
|
||||
wmsToAcsService.PaperTubeAction(jo);
|
||||
|
||||
@@ -263,6 +263,7 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", jsonSb.getString("point_code"));
|
||||
param.put("task_code", task_jo.getString("task_code"));
|
||||
param.put("product_area", jsonSb.getString("product_area"));
|
||||
param.put("option", "1");
|
||||
paramArr.add(param);
|
||||
|
||||
|
||||
@@ -70,11 +70,12 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
//查询该区域点位类型为出口的点位
|
||||
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + cut_jo.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
|
||||
form.put("point_code2", ss_jo.getString("point_code"));
|
||||
if (StrUtil.isEmpty(empty_vehicle.getString("vehicle_code"))){
|
||||
throw new BadRequestException("点位:"+empty_vehicle.getString("point_code")+"载具号为空!");
|
||||
if (StrUtil.isEmpty(empty_vehicle.getString("vehicle_code"))) {
|
||||
throw new BadRequestException("点位:" + empty_vehicle.getString("point_code") + "载具号为空!");
|
||||
}
|
||||
form.put("vehicle_code2", empty_vehicle.getString("vehicle_code"));
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", cut_jo.getString("product_area"));
|
||||
cutConveyorTask.createTask(form);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
@@ -94,9 +95,9 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
if (ObjectUtil.isNotEmpty(vehicle_task)) {
|
||||
throw new BadRequestException("载具码:" + vehicle_code + "存在未完成的输送线任务!");
|
||||
}
|
||||
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("vehicle_code = '"+vehicle_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(del_jo)){
|
||||
throw new BadRequestException("载具码:" + vehicle_code + "存在点位:"+del_jo.getString("point_code")+"上!");
|
||||
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(del_jo)) {
|
||||
throw new BadRequestException("载具码:" + vehicle_code + "存在点位:" + del_jo.getString("point_code") + "上!");
|
||||
}
|
||||
|
||||
if (rows.size() > 2) {
|
||||
@@ -238,6 +239,7 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
form.put("point_code1", ss_jo.getString("point_code"));
|
||||
form.put("point_code2", empty_point.getString("point_code"));
|
||||
form.put("task_type", "010402");
|
||||
form.put("product_area", plan_jo.getString("product_area"));
|
||||
form.put("vehicle_code", plan_jo.getString("qzzno"));
|
||||
form.put("vehicle_code2", vehicle_code);
|
||||
cutConveyorTask.createTask(form);
|
||||
@@ -262,8 +264,9 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
JSONObject ss_jo2 = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + cut_jo.getString("product_area") + "' AND point_type = '7'").uniqueResult(0);
|
||||
form2.put("point_code2", ss_jo2.getString("point_code"));
|
||||
form2.put("task_type", "010401");
|
||||
if (StrUtil.isEmpty(left_point.getString("vehicle_code"))){
|
||||
throw new BadRequestException("点位:"+left_point.getString("point_code")+"载具号为空!");
|
||||
form2.put("product_area", cut_jo.getString("product_area"));
|
||||
if (StrUtil.isEmpty(left_point.getString("vehicle_code"))) {
|
||||
throw new BadRequestException("点位:" + left_point.getString("point_code") + "载具号为空!");
|
||||
}
|
||||
form2.put("vehicle_code2", left_point.getString("vehicle_code"));
|
||||
cutConveyorTask.createTask(form2);
|
||||
@@ -290,9 +293,9 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
if (ObjectUtil.isNotEmpty(vehicle_task)) {
|
||||
throw new BadRequestException("载具码:" + vehicle_code + "存在未完成的输送线任务!");
|
||||
}
|
||||
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("vehicle_code = '"+vehicle_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(del_jo)){
|
||||
throw new BadRequestException("载具码:" + vehicle_code + "存在点位:"+del_jo.getString("point_code")+"上!");
|
||||
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(del_jo)) {
|
||||
throw new BadRequestException("载具码:" + vehicle_code + "存在点位:" + del_jo.getString("point_code") + "上!");
|
||||
}
|
||||
|
||||
//判断起点是否存在
|
||||
@@ -305,7 +308,7 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
}
|
||||
|
||||
//查询该载具码对应的区域位置
|
||||
JSONObject vehicle_area = WQLObject.getWQLObject("md_pb_vehiclearea").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
JSONObject vehicle_area = WQLObject.getWQLObject("md_pb_vehiclearea").query("vehicle_code = '" + vehicle_code + "' AND product_area = '" + start_jo.getString("product_area") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(vehicle_area)) {
|
||||
throw new BadRequestException("未查询到该载具对应的区域位置!");
|
||||
}
|
||||
@@ -339,6 +342,7 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
form.put("point_code1", point_code);
|
||||
form.put("point_code2", point_jo.getString("point_code"));
|
||||
form.put("task_type", "010402");
|
||||
form.put("product_area", point_jo.getString("product_area"));
|
||||
form.put("vehicle_code2", vehicle_code);
|
||||
cutConveyorTask.createTask(form);
|
||||
JSONObject jo = new JSONObject();
|
||||
@@ -390,11 +394,12 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
tran_jo.put("point_code1", translate_code1);
|
||||
tran_jo.put("point_code2", translate_code2);
|
||||
tran_jo.put("vehicle_code", del_jo.getString("qzzno"));
|
||||
if (StrUtil.isEmpty(del_jo.getString("vehicle_code"))){
|
||||
throw new BadRequestException("点位:"+del_jo.getString("point_code")+"载具号为空!");
|
||||
if (StrUtil.isEmpty(del_jo.getString("vehicle_code"))) {
|
||||
throw new BadRequestException("点位:" + del_jo.getString("point_code") + "载具号为空!");
|
||||
}
|
||||
tran_jo.put("vehicle_code2", del_jo.getString("vehicle_code"));
|
||||
tran_jo.put("task_type", "010406");
|
||||
tran_jo.put("product_area", product_area);
|
||||
cutConveyorTask.createTask(tran_jo);
|
||||
} else {
|
||||
throw new BadRequestException("该点位所在输送线对应的上料位存在载具,不能横移!");
|
||||
|
||||
@@ -617,7 +617,8 @@
|
||||
IF 输入.flag = "15"
|
||||
QUERY
|
||||
SELECT
|
||||
point_code AS device_code
|
||||
point_code AS device_code,
|
||||
product_area
|
||||
FROM
|
||||
st_ivt_hotpointivt
|
||||
WHERE
|
||||
|
||||
@@ -399,6 +399,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
jsonParam.put("device_code", json.getString("point_code2"));
|
||||
jsonParam.put("vehicle_code", json.getString("vehicle_code"));
|
||||
jsonParam.put("task_code", json.getString("task_code"));
|
||||
jsonParam.put("product_area", "LK");
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "解锁成功!");
|
||||
|
||||
@@ -42,4 +42,8 @@ public class AcsTaskDto {
|
||||
private String start_height;
|
||||
//发货区终点高度
|
||||
private String next_height;
|
||||
//LMS任务类型
|
||||
private String class_type;
|
||||
//生产区域
|
||||
private String product_area;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.URLEnum;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -34,40 +35,57 @@ public class AcsUtil {
|
||||
return result;
|
||||
}
|
||||
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("acs_url").getValue();
|
||||
for (int j = 0; j < list.size(); j++) {
|
||||
JSONObject jo = list.getJSONObject(j);
|
||||
String product_area = jo.getString("product_area");
|
||||
|
||||
String url = acsUrl + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(list))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
log.info("ACS相应参数----------------------------------------+" + api + ",---" + result.toString());
|
||||
if (jo.containsKey("class_type") && jo.getString("class_type").contains("0105")){
|
||||
product_area = "LK";
|
||||
}
|
||||
if (StrUtil.isEmpty(product_area)) {
|
||||
throw new BadRequestException("区域不能为空!下发信息:" + jo.toString());
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//ConnectException: Connection refused: connect
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
result.put("status", HttpStatus.BAD_REQUEST);
|
||||
result.put("message", "网络不通,操作失败!");
|
||||
result.put("data", new JSONObject());
|
||||
}
|
||||
//acs抛异常这里
|
||||
if (!StrUtil.equals(result.getString("status"), "200")) {
|
||||
throw new BadRequestException(result.getString("message"));
|
||||
} else {
|
||||
//如果向ACS下发任务,变更任务状态为下发
|
||||
if (api.equals("api/wms/task")) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject task_jo = list.getJSONObject(i);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + task_jo.getString("ext_task_id") + "'");
|
||||
String acs_url = URLEnum.find(product_area);
|
||||
if (StrUtil.isEmpty(acs_url)){
|
||||
log.info(product_area);
|
||||
throw new BadRequestException("未查询到区域对应的acs地址!");
|
||||
}
|
||||
|
||||
String url = acs_url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
.body(String.valueOf(list))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
log.info("ACS相应参数----------------------------------------+" + api + ",---" + result.toString());
|
||||
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
//ConnectException: Connection refused: connect
|
||||
//网络不通
|
||||
System.out.println(msg);
|
||||
result.put("status", HttpStatus.BAD_REQUEST);
|
||||
result.put("message", "网络不通,操作失败!");
|
||||
result.put("data", new JSONObject());
|
||||
}
|
||||
//acs抛异常这里
|
||||
if (!StrUtil.equals(result.getString("status"), "200")) {
|
||||
throw new BadRequestException(result.getString("message"));
|
||||
} else {
|
||||
//如果向ACS下发任务,变更任务状态为下发
|
||||
if (api.equals("api/wms/task")) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject task_jo = list.getJSONObject(i);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + task_jo.getString("ext_task_id") + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,228 +0,0 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.sch.AcsTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BookTwoConfirmTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = BookTwoConfirmTask.class.getName();
|
||||
@Autowired
|
||||
private CutConveyorTask conveyorTask;
|
||||
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
|
||||
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工序工单表
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
if (StrUtil.equals(status,"0")) {
|
||||
// 更新删除字段
|
||||
jsonTask.put("is_delete","1");
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
// 更新单据状态为执行中
|
||||
JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonCool.put("bill_status", "40");
|
||||
jsonCool.put("update_optid",currentUserId);
|
||||
jsonCool.put("update_optname",currentUsername);
|
||||
jsonCool.put("update_time",DateUtil.now());
|
||||
coolTab.update(jsonCool);
|
||||
}
|
||||
|
||||
if(StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||
// 更改任务状态为完成
|
||||
jsonTask.put("task_status",TaskStatusEnum.FINISHED.getCode());
|
||||
jsonTask.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||
jsonTask.put("update_optname", SecurityUtils.getCurrentUsername());
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
String point_code1 = jsonTask.getString("point_code1");
|
||||
String point_code2 = jsonTask.getString("point_code2");
|
||||
|
||||
PointService point = SpringContextHolder.getBean(PointService.class);
|
||||
// 校验起点是否存在
|
||||
PointDto startDto = point.findByCode(point_code1);
|
||||
if (ObjectUtil.isEmpty(startDto)) throw new BadRequestException("起点未找到可用点位:" + point_code1);
|
||||
|
||||
// 校验终点是否存在
|
||||
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code2 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2);
|
||||
|
||||
// 更新冷却库存状态
|
||||
JSONObject jsonRaw = rawTab.query("resource_name ='" + point_code1 + "'").uniqueResult(0);
|
||||
|
||||
jsonIvt.put("full_point_status", "02");
|
||||
jsonIvt.put("instorage_time", DateUtil.now());
|
||||
jsonIvt.put("container_name", jsonRaw.getString("container_name"));
|
||||
jsonIvt.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
jsonIvt.put("ivt_qty", jsonRaw.getString("productin_qty"));
|
||||
ivtTab.update(jsonIvt);
|
||||
|
||||
// 更新冷却区出入表
|
||||
JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
jsonCool.put("bill_status","50");
|
||||
jsonCool.put("confirm_optid", SecurityUtils.getCurrentUserId());
|
||||
jsonCool.put("confirm_optname", SecurityUtils.getCurrentUsername());
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
coolTab.update(jsonCool);
|
||||
|
||||
//更新母卷工单状态
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("statuPDM_BI_RawFoilWorkOrders", "09");
|
||||
map.put("realend_time", DateUtil.now());
|
||||
map.put("update_optid",currentUserId+"");
|
||||
map.put("update_optname",currentUsername);
|
||||
jsonCool.put("finish_type", "01");
|
||||
map.put("update_time",DateUtil.now());
|
||||
WQLObject.getWQLObject("").update(map,"container_name = '"+jsonTask.getString("material_code")+"'");
|
||||
jsonCool.put("status", "09");
|
||||
jsonCool.put("realend_time", DateUtil.now());
|
||||
jsonCool.put("finish_type", "01");
|
||||
jsonCool.put("update_optid",currentUserId+"");
|
||||
jsonCool.put("update_optname",currentUsername);
|
||||
jsonCool.put("update_time",DateUtil.now());
|
||||
rawTab.update(jsonCool);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findStartPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String createTask(JSONObject form) {
|
||||
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
String point_code1 = form.getString("point_code1");
|
||||
String point_code2 = form.getString("point_code2");
|
||||
if (conveyorTask.isSingleTask(point_code1)){
|
||||
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
|
||||
}
|
||||
if (conveyorTask.isSingleTask(point_code2)){
|
||||
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
|
||||
}
|
||||
|
||||
/*SchTaskDto dto = SchTaskDto.builder().task_id(org.nl.wms.util.IdUtil.getLongId())
|
||||
.task_code(IdUtil.getSnowflake(1,1).nextId())
|
||||
.task_type("")
|
||||
.task_name("共挤线叫空载具")
|
||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||
.point_code2(point_code2)
|
||||
.acs_task_type("2")
|
||||
.vehicle_code(form.getString("vehicle_code"))
|
||||
.vehicle_qty(form.getIntValue("qty"))
|
||||
.handle_class(THIS_CLASS)
|
||||
.create_time(DateUtil.now())
|
||||
.build();*/
|
||||
|
||||
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("task_type", "05");
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", form.getString("start_pint_code"));
|
||||
json.put("point_code2", form.getString("end_pint_code"));
|
||||
json.put("sort_seq", "1");
|
||||
json.put("handle_class", THIS_CLASS);
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("priority","1" );
|
||||
json.put("acs_task_type","1" );
|
||||
tab.insert(json);
|
||||
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void forceFinish(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,6 +64,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
.agv_system_type(agv_system_type)
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.product_area(product_area)
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ public class CoolCutTask extends AbstractAcsTask {
|
||||
.priority(json.getString("priority"))
|
||||
.agv_system_type(agv_system_type)
|
||||
.remark(json.getString("remark"))
|
||||
.product_area(product_area)
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
|
||||
@@ -53,9 +53,11 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.ext_task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.product_area(json.getString("product_area"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.vehicle_code(vehicle_code)
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
@@ -176,6 +178,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
}
|
||||
tran_jo.put("vehicle_code2", right_point.getString("vehicle_code"));
|
||||
tran_jo.put("task_type", "010406");
|
||||
tran_jo.put("product_area", product_area);
|
||||
this.createTask(tran_jo);
|
||||
|
||||
}
|
||||
@@ -244,6 +247,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
tran_jo.put("vehicle_code", jsonTask.getString("vehicle_code"));
|
||||
tran_jo.put("vehicle_code2", jsonTask.getString("vehicle_code2"));
|
||||
tran_jo.put("task_type", "010406");
|
||||
tran_jo.put("product_area", product_area);
|
||||
this.createTask(tran_jo);
|
||||
} else {
|
||||
//如果有货、且没有任务
|
||||
@@ -266,6 +270,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
form.put("vehicle_code2", left_point.getString("vehicle_code"));
|
||||
//分切输送出
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", product_area);
|
||||
this.createTask(form);
|
||||
}
|
||||
}
|
||||
@@ -360,6 +365,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", point_code1);
|
||||
json.put("point_code2", point_code2);
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("vehicle_code2", form.getString("vehicle_code2"));
|
||||
json.put("handle_class", THIS_CLASS);
|
||||
|
||||
@@ -74,6 +74,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
.agv_system_type(agv_system_type)
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.product_area(product_area)
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
@@ -99,7 +100,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
//桁架标准任务
|
||||
if (jsonTask.getString("task_type").equals("010403")) {
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '04'").getResultJSONArray(0);
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status IN ('04','05')").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "对应的分切计划!");
|
||||
}
|
||||
@@ -142,7 +143,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
//分切>输送线 子卷入站
|
||||
if (jsonTask.getString("task_type").equals("010405")) {
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '04'").getResultJSONArray(0);
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status IN ('04','05') ").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "对应的分切计划!");
|
||||
}
|
||||
@@ -206,7 +207,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '04'").getResultJSONArray(0);
|
||||
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status IN ('04','05') ").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo2)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "对应的分切计划!");
|
||||
}
|
||||
@@ -228,6 +229,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
}
|
||||
form.put("vehicle_code2", delivery_point.getString("vehicle_code"));
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", delivery_point.getString("product_area"));
|
||||
cutConveyorTask.createTask(form);
|
||||
}
|
||||
|
||||
@@ -263,6 +265,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
}
|
||||
form.put("vehicle_code2", delivery_point.getString("vehicle_code"));
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", delivery_point.getString("product_area"));
|
||||
cutConveyorTask.createTask(form);
|
||||
}
|
||||
|
||||
@@ -278,7 +281,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").update(delivery_point);
|
||||
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '04'").getResultJSONArray(0);
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status IN ('04','05') ").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "对应的分切计划!");
|
||||
}
|
||||
@@ -316,6 +319,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
form.put("vehicle_code2", delivery_point.getString("vehicle_code"));
|
||||
//分切输送出
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", delivery_point.getString("product_area"));
|
||||
cutConveyorTask.createTask(form);
|
||||
} else {
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ public class EmptyVehicleTask extends AbstractAcsTask {
|
||||
.priority(json.getString("priority"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.remark(json.getString("remark"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public class InCoolIvtTask extends AbstractAcsTask {
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.product_area(product_area)
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ public class InHotTask extends AbstractAcsTask {
|
||||
.oven_time(json.getString("request_param"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.product_area(product_area)
|
||||
.build();
|
||||
if (StrUtil.isNotEmpty(json.getString("point_code3"))) {
|
||||
dto.setNext_device_code(json.getString("point_code3"));
|
||||
|
||||
@@ -61,6 +61,7 @@ public class InTask extends AbstractAcsTask {
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
|
||||
@@ -60,6 +60,7 @@ public class OutHotTask extends AbstractAcsTask {
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.agv_system_type(agv_system_type)
|
||||
.priority(json.getString("priority"))
|
||||
.product_area(product_area)
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
resultList.add(dto);
|
||||
|
||||
@@ -66,6 +66,7 @@ public class OutTask extends AbstractAcsTask {
|
||||
.next_device_code(json.getString("point_code2"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.dtl_type(String.valueOf(dtl_type))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
|
||||
@@ -72,6 +72,7 @@ public class SendOutTask extends AbstractAcsTask {
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.class_type(json.getString("task_type"))
|
||||
.start_height(start_high)
|
||||
.next_height(next_high)
|
||||
.build();
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.nl.modules.common.utils.enums.CodeBiEnum;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum URLEnum {
|
||||
ACS_URL_A1("A1", s -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_A1").getValue()),
|
||||
ACS_URL_A2("A2", s -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_A2").getValue()),
|
||||
ACS_URL_A3("A3", s -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_A3").getValue()),
|
||||
ACS_URL_A4("A4", s -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_A4").getValue()),
|
||||
ACS_URL_LK("LK", s -> SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("ACS_URL_LK").getValue());
|
||||
|
||||
private String product_area;
|
||||
|
||||
private Function<String,String> acs_url;
|
||||
|
||||
public static String find(String product_area) {
|
||||
for (URLEnum value : URLEnum.values()) {
|
||||
if (product_area.equals(value.getProduct_area())) {
|
||||
return value.getAcs_url().apply("");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user