This commit is contained in:
2022-12-16 11:10:50 +08:00
parent 33e4167fa0
commit 89b1ea77f8
17 changed files with 158 additions and 51 deletions

View File

@@ -55,6 +55,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String processing_class = taskObj.getString("handle_class");
//1:执行中,2:完成 ,3:acs取消
String acs_task_status = row.getString("task_status");
String car_no = row.getString("car_no");
if (StrUtil.isNotEmpty(car_no)){
taskObj.put("car_no",car_no);
WQLObject.getWQLObject("SCH_BASE_Task").update(taskObj);
}
String message = "";
String status = "";
if ("1".equals(acs_task_status)) {
@@ -240,6 +245,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.put("box_length",box_length);
result.put("box_width",box_width);
result.put("box_high",box_high);
result.put("bundle_times",2);
}else {
throw new BadRequestException("请输入正确的任务类型!");
}

View File

@@ -16,7 +16,6 @@ import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.pda.mps.service.BakingService;
@@ -100,6 +99,8 @@ public class BakingServiceImpl implements BakingService {
param.put("point_code1", point_code1);
param.put("point_code2", jsonHotIvt.getString("point_code"));
param.put("material_code", container_name);
param.put("product_area", jsonPointZc.getString("product_area"));
param.put("request_param", NumberUtil.mul(Double.parseDouble(hours),60));
InHotTask inHotTask = new InHotTask();
String task_id = inHotTask.createTask(param);
@@ -156,7 +157,11 @@ public class BakingServiceImpl implements BakingService {
//只找入箱点位
map.put("point_type", "4");
JSONObject point_code2 = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
if (ObjectUtil.isEmpty(point_code2_jo)){
throw new BadRequestException("未查询到符合的对接位!");
}
String point_code2 = point_code2_jo.getString("point_code");
/*if (ObjectUtil.isEmpty(pointArr)) {
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
@@ -181,6 +186,8 @@ public class BakingServiceImpl implements BakingService {
param.put("point_code2", point_code2);
param.put("point_code3", jsonHotIvt.getString("point_code"));
param.put("material_code", container_name);
param.put("product_area", product_area);
param.put("request_param", NumberUtil.mul(Double.parseDouble(hours),60));
// 创建冷却区 --> 暂存位的任务
InHotTask inHotTask = new InHotTask();
@@ -207,8 +214,8 @@ public class BakingServiceImpl implements BakingService {
// 生成冷却区出入表
Long currentUserId = 2L;
String currentUsername = "mes用户";
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonCool = new JSONObject();
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
@@ -297,6 +304,7 @@ public class BakingServiceImpl implements BakingService {
param.put("point_code1", point_code1);
param.put("point_code2", point_code2);
param.put("material_code", jsonHotIvt.getString("container_name"));
param.put("product_area", jsonHotIvt.getString("product_area"));
OutHotTask outHotTask = new OutHotTask();
String task_id = outHotTask.createTask(param);
@@ -326,8 +334,6 @@ public class BakingServiceImpl implements BakingService {
@Transactional(rollbackFor = Exception.class)
public JSONObject inCoolIvt(JSONObject whereJson) {
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位点
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱出入主表
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
@@ -363,6 +369,7 @@ public class BakingServiceImpl implements BakingService {
param.put("point_code1", point_code1);
param.put("point_code2", jsonCooIvt.getString("full_point_code"));
param.put("container_name", container_name);
param.put("product_area", jsonPoint.getString("product_area"));
InCoolIvtTask inCoolIvtTask = new InCoolIvtTask();
@@ -379,8 +386,8 @@ public class BakingServiceImpl implements BakingService {
this.createHotDtl(hotParam);*/
// 生成冷却区出入表
Long currentUserId = 2L;
String currentUsername = "mes用户";
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
@@ -422,6 +429,9 @@ public class BakingServiceImpl implements BakingService {
*/
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱区出入主表
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonHotMst = new JSONObject();
jsonHotMst.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonHotMst.put("bill_code", CodeUtil.getNewCode("HOT_BILL_CODE"));
@@ -439,11 +449,11 @@ public class BakingServiceImpl implements BakingService {
jsonHotMst.put("task_type", param.getString("task_type"));
jsonHotMst.put("temperature", param.getString("temperature"));
jsonHotMst.put("oven_time", param.getString("oven_time"));
jsonHotMst.put("create_id", 2);
jsonHotMst.put("create_name", "mes用户");
jsonHotMst.put("create_id", currentUserId);
jsonHotMst.put("create_name", currentUsername);
jsonHotMst.put("create_time", DateUtil.now());
jsonHotMst.put("confirm_optid", 2);
jsonHotMst.put("confirm_optname", "mes用户");
jsonHotMst.put("confirm_optid", currentUserId);
jsonHotMst.put("confirm_optname", currentUsername);
jsonHotMst.put("confirm_time", DateUtil.now());
hotMstTab.insert(jsonHotMst);
@@ -456,8 +466,8 @@ public class BakingServiceImpl implements BakingService {
JSONArray rows = new JSONArray();
JSONObject jo = new JSONObject();
jo.put("device_code",whereJson.getString("point_code"));
jo.put("code","");
jo.put("value","");
jo.put("code","to_command");
jo.put("value","0");
rows.add(jo);
new WmsToAcsServiceImpl().action(rows);
JSONObject result = new JSONObject();

View File

@@ -2,21 +2,13 @@ package org.nl.wms.pda.mps.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.pda.mps.service.EmptyVehicleService;
import org.nl.wms.pda.mps.service.OutService;
import org.nl.wms.sch.tasks.CutConveyorTask;
import org.nl.wms.sch.tasks.CutTrussTask;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
@Service
@RequiredArgsConstructor

View File

@@ -138,8 +138,8 @@ public class FeedingServiceImpl implements FeedingService {
jsonCool.put("start_point_code", cool_ivt.getString("full_point_code"));
jsonCool.put("end_point_code", cut_jo.getString("full_point_code"));
jsonCool.put("create_mode", "03");
jsonCool.put("create_id", "2");
jsonCool.put("create_name", "MES用户");
jsonCool.put("create_id", currentUserId);
jsonCool.put("create_name", currentUsername);
jsonCool.put("create_time", DateUtil.now());
jsonCool.put("update_optid", currentUserId);
jsonCool.put("update_optname", currentUsername);

View File

@@ -63,6 +63,7 @@ public class InServiceImpl implements InService {
jo.put("point_code1", cut_row.getString("delivery_code"));
jo.put("point_code2", point_code);
jo.put("vehicle_code", cut_row.getString("qzzno"));
jo.put("product_area", cut_ivt.getString("product_area"));
jo.put("task_type", "010405");
cutTrussTask.createTask(jo);

View File

@@ -121,6 +121,7 @@ public class OutServiceImpl implements OutService {
jo.put("point_code1", point_code);
jo.put("point_code2", empty_vehicle.getString("point_code"));
jo.put("vehicle_code", cut_qzzno);
jo.put("product_area", cut_ivt.getString("product_area"));
jo.put("task_type", "010404");
cutTrussTask.createTask(jo);
@@ -149,6 +150,7 @@ public class OutServiceImpl implements OutService {
jo.put("point_code4", point_code);
jo.put("vehicle_code", delivery_point.getString("qzzno"));
jo.put("vehicle_code2", cut_qzzno);
jo.put("product_area", cut_ivt.getString("product_area"));
jo.put("task_type", "010403");
cutTrussTask.createTask(jo);
}
@@ -183,7 +185,9 @@ public class OutServiceImpl implements OutService {
//如果查询到给ACS下发一个输送线任务
JSONObject form = new JSONObject();
form.put("point_code1", point_code);
form.put("point_code2", "SS01");
JSONObject convey_jo = WQLObject.getWQLObject("").query("point_code = '"+point_code+"'").uniqueResult(0);
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");
CutConveyorTask cutConveyorTask = new CutConveyorTask();
cutConveyorTask.createTask(form);

View File

@@ -172,6 +172,7 @@ public class RawFoilServiceImpl implements RawFoilService {
param.put("point_code4", point_code4);
param.put("task_type", "010101");
param.put("material_code", jsonRaw.getString("container_name"));
param.put("product_area", jsonSb.getString("product_area"));
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
callEmpReelTask.createTask(param);

View File

@@ -60,7 +60,9 @@ public class ShippingServiceImpl implements ShippingService {
//如果查询到给ACS下发一个输送线任务
JSONObject form = new JSONObject();
form.put("point_code1",empty_vehicle.getString("point_code"));
form.put("point_code2","SS01");
//查询该区域点位类型为出口的点位
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"));
form.put("task_type","010401");
cutConveyorTask.createTask(form);
@@ -153,7 +155,8 @@ public class ShippingServiceImpl implements ShippingService {
//下发输送线任务
JSONObject form = new JSONObject();
form.put("point_code1","SS02");
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '"+plan_jo.getString("product_area")+"' AND point_type = '6'").uniqueResult(0);
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("vehicle_code",plan_jo.getString("qzzno"));

View File

@@ -32,4 +32,8 @@ public class AcsTaskDto {
private String remark;
//扩展参数
private String params;
//温度
private String temperature;
//烘烤时间
private String oven_time;
}

View File

@@ -44,13 +44,24 @@ public class CallEmpReelTask extends AbstractAcsTask {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
String product_area = json.getString("product_area");
String agv_system_type = "";
if (product_area.equals("A1") || product_area.equals("A2")){
agv_system_type = "2";
}
if (product_area.equals("A3") || product_area.equals("A4")){
agv_system_type = "3";
}
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"))
.start_device_code2(json.getString("point_code3"))
.next_device_code2(json.getString("point_code4"))
.vehicle_code(json.getString("vehicle_code"))
.agv_system_type(agv_system_type)
.priority(json.getString("priority"))
.remark(json.getString("remark"))
.build();
@@ -74,6 +85,20 @@ public class CallEmpReelTask extends AbstractAcsTask {
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
//更新车号和重量
String car_no = taskObj.getString("car_no");
if (StrUtil.isNotEmpty(car_no)){
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
jsonRaw.put("agvno", car_no);
rawTab.update(jsonRaw);
}
// 更新生箔工单称重信息
String weight = taskObj.getString("weight");
if (ObjectUtil.isNotEmpty(weight)) {
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
jsonRaw.put("productin_qty", taskObj.getDoubleValue(weight));
rawTab.update(jsonRaw);
}
if (StrUtil.equals(status, "0")) {
// 更新删除字段
jsonTask.put("is_delete","1");
@@ -100,15 +125,6 @@ public class CallEmpReelTask extends AbstractAcsTask {
JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0);
jsonCool.put("bill_status", "40");
coolTab.update(jsonCool);*/
// 更新生箔工单称重信息
String weight = taskObj.getString("weight");
if (ObjectUtil.isNotEmpty(weight)) {
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
jsonRaw.put("productin_qty", taskObj.getDoubleValue(weight));
rawTab.update(jsonRaw);
}
}
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
@@ -276,6 +292,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
json.put("point_code3", form.getString("point_code3"));
json.put("point_code4", form.getString("point_code4"));
json.put("task_type", form.getString("task_type"));
json.put("product_area", form.getString("product_area"));
json.put("handle_class", THIS_CLASS);
json.put("sort_seq", "1");
json.put("create_id", currentUserId);
@@ -288,7 +305,9 @@ public class CallEmpReelTask extends AbstractAcsTask {
}else {
json.put("priority", priority_jo.getString("value"));
}
json.put("acs_task_type", "1");
if (form.getString("task_type").equals("010101")) {
json.put("acs_task_type", "1");
}
tab.insert(json);
this.immediateNotifyAcs(null);

View File

@@ -59,6 +59,8 @@ public class CoolCutTask extends AbstractAcsTask {
.task_type(json.getString("acs_task_type"))
.start_device_code(json.getString("point_code1"))
.next_device_code(json.getString("point_code2"))
.start_device_code2(json.getString("point_code3"))
.next_device_code2(json.getString("point_code4"))
.vehicle_code(json.getString("vehicle_code"))
.priority(json.getString("priority"))
.agv_system_type(agv_system_type)
@@ -292,6 +294,7 @@ public class CoolCutTask extends AbstractAcsTask {
json.put("point_code4", point_code4);
json.put("vehicle_code", form.getString("vehicle_code"));
json.put("vehicle_code2", form.getString("vehicle_code2"));
json.put("product_area", form.getString("product_area"));
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);

View File

@@ -40,6 +40,15 @@ public class CutTrussTask extends AbstractAcsTask {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
String product_area = json.getString("product_area");
String agv_system_type = "";
if (product_area.equals("A1") || product_area.equals("A2")){
agv_system_type = "2";
}
if (product_area.equals("A3") || product_area.equals("A4")){
agv_system_type = "3";
}
AcsTaskDto dto = AcsTaskDto.builder()
.ext_task_id(json.getString("task_id"))
.task_code(json.getString("task_code"))
@@ -47,6 +56,7 @@ public class CutTrussTask extends AbstractAcsTask {
.start_device_code(json.getString("point_code1"))
.next_device_code(json.getString("point_code2"))
.vehicle_code(json.getString("vehicle_code"))
.agv_system_type(agv_system_type)
.priority(json.getString("priority"))
.remark(json.getString("remark"))
.build();
@@ -136,7 +146,8 @@ public class CutTrussTask extends AbstractAcsTask {
//生成一个输送线出库任务
JSONObject form = new JSONObject();
form.put("point_code1",jsonTask.getString("point_code1"));
form.put("point_code2","SS01");
JSONObject ss_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '"+delivery_point.getString("product_area")+"' AND point_type = '7'").uniqueResult(0);
form.put("point_code2",ss_jo.getString("point_code"));
form.put("task_type","010401");
cutConveyorTask.createTask(form);
}
@@ -241,6 +252,7 @@ public class CutTrussTask extends AbstractAcsTask {
json.put("point_code2", form.getString("point_code2"));
json.put("point_code3", form.getString("point_code3"));
json.put("point_code4", form.getString("point_code4"));
json.put("product_area", form.getString("product_area"));
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);

View File

@@ -44,12 +44,22 @@ public class InCoolIvtTask extends AbstractAcsTask {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
String product_area = json.getString("product_area");
String agv_system_type = "";
if (product_area.equals("A1") || product_area.equals("A2")){
agv_system_type = "2";
}
if (product_area.equals("A3") || product_area.equals("A4")){
agv_system_type = "3";
}
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"))
.agv_system_type(agv_system_type)
.vehicle_code(json.getString("vehicle_code"))
.priority(json.getString("priority"))
.remark(json.getString("remark"))
@@ -66,7 +76,6 @@ public class InCoolIvtTask extends AbstractAcsTask {
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工序工单表
String task_id = taskObj.getString("task_id");
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
@@ -182,6 +191,7 @@ public class InCoolIvtTask extends AbstractAcsTask {
json.put("point_code1", point_code1);
json.put("point_code2", point_code2);
json.put("material_code", form.getString("container_name"));
json.put("material_code", form.getString("product_area"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
@@ -194,7 +204,7 @@ public class InCoolIvtTask extends AbstractAcsTask {
}else {
json.put("priority", priority_jo.getString("value"));
}
json.put("acs_task_type","4" );
json.put("acs_task_type","3" );
tab.insert(json);
return json.getString("task_id");

View File

@@ -42,16 +42,34 @@ public class InHotTask extends AbstractAcsTask {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
String product_area = json.getString("product_area");
String agv_system_type = "";
if (product_area.equals("A1") || product_area.equals("A2")){
agv_system_type = "2";
}
if (product_area.equals("A3") || product_area.equals("A4")){
agv_system_type = "3";
}
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"))
.agv_system_type(agv_system_type)
.oven_time(json.getString("request_param"))
.priority(json.getString("priority"))
.remark(json.getString("remark"))
.build();
if (StrUtil.isNotEmpty(json.getString("point_code3"))){
dto.setNext_device_code(json.getString("point_code3"));
dto.setPut_device_code(json.getString("point_code2"));
}else {
dto.setNext_device_code(json.getString("point_code2"));
}
//查询该任务对应的
resultList.add(dto);
}
return resultList;
@@ -231,6 +249,8 @@ public class InHotTask extends AbstractAcsTask {
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("point_code3", form.getString("point_code3"));
json.put("product_area", form.getString("product_area"));
json.put("request_param", form.getString("request_param"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
@@ -244,7 +264,7 @@ public class InHotTask extends AbstractAcsTask {
}else {
json.put("priority", priority_jo.getString("value"));
}
json.put("acs_task_type", "1");
json.put("acs_task_type", "8");
tab.insert(json);
task_id = json.getString("task_id");
@@ -276,16 +296,25 @@ public class InHotTask extends AbstractAcsTask {
json.put("task_status", "01");
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("product_area", form.getString("product_area"));
json.put("request_param", form.getString("request_param"));
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");
//根据类型获取对应的任务优先级
JSONObject priority_jo = WQL.getWO("PDA_COOLIN").addParam("flag","3").addParam("task_type",json.getString("task_type")).process().uniqueResult(0);
if (ObjectUtil.isEmpty(priority_jo)){
json.put("priority", "1");
}else {
json.put("priority", priority_jo.getString("value"));
}
json.put("acs_task_type", "8");
tab.insert(json);
task_id = json.getString("task_id");
}
immediateNotifyAcs(task_id);
return task_id;
}

View File

@@ -42,6 +42,15 @@ public class OutHotTask extends AbstractAcsTask {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
String product_area = json.getString("product_area");
String agv_system_type = "";
if (product_area.equals("A1") || product_area.equals("A2")){
agv_system_type = "2";
}
if (product_area.equals("A3") || product_area.equals("A4")){
agv_system_type = "3";
}
AcsTaskDto dto = AcsTaskDto.builder()
.ext_task_id(json.getString("task_id"))
.task_code(json.getString("task_code"))
@@ -49,6 +58,7 @@ public class OutHotTask extends AbstractAcsTask {
.start_device_code(json.getString("point_code1"))
.next_device_code(json.getString("point_code2"))
.vehicle_code(json.getString("vehicle_code"))
.agv_system_type(agv_system_type)
.priority(json.getString("priority"))
.remark(json.getString("remark"))
.build();
@@ -170,6 +180,7 @@ public class OutHotTask extends AbstractAcsTask {
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("product_area", form.getString("product_area"));
json.put("material_code", form.getString("material_code"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
@@ -183,9 +194,9 @@ public class OutHotTask extends AbstractAcsTask {
}else {
json.put("priority", priority_jo.getString("value"));
}
json.put("acs_task_type", "1");
json.put("acs_task_type", "6");
tab.insert(json);
immediateNotifyAcs(null);
immediateNotifyAcs(json.getString("task_id"));
return json.getString("task_id");
}