修改
This commit is contained in:
Binary file not shown.
@@ -40,14 +40,6 @@ public class MesToLmsController {
|
|||||||
return new ResponseEntity<>(mesToLmsService.momRollFoilWeighing(jo), HttpStatus.OK);
|
return new ResponseEntity<>(mesToLmsService.momRollFoilWeighing(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("test")
|
|
||||||
@Log("MES获取AGV称重信息")
|
|
||||||
@ApiOperation("MES获取AGV称重信息")
|
|
||||||
@SaIgnore
|
|
||||||
public ResponseEntity<Object> test(@RequestBody JSONObject jo) {
|
|
||||||
return new ResponseEntity<>(mesToLmsService.test(jo), HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/momRollFoilComplete")
|
@PostMapping("/momRollFoilComplete")
|
||||||
@Log("MES执行下卷动作告诉LMS")
|
@Log("MES执行下卷动作告诉LMS")
|
||||||
@ApiOperation("MES执行下卷动作告诉LMS")
|
@ApiOperation("MES执行下卷动作告诉LMS")
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ public interface MesToLmsService {
|
|||||||
*/
|
*/
|
||||||
JSONObject momRollFoilWeighing(JSONObject param);
|
JSONObject momRollFoilWeighing(JSONObject param);
|
||||||
|
|
||||||
JSONObject test(JSONObject param);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MES执行下卷动作告诉LMS
|
* MES执行下卷动作告诉LMS
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
@@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class LmsToMesServiceImpl implements LmsToMesService {
|
public class LmsToMesServiceImpl implements LmsToMesService {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LMS的PDA操作AGV下卷,AGV称重完成后AGV称重信息发送MES
|
* LMS的PDA操作AGV下卷,AGV称重完成后AGV称重信息发送MES
|
||||||
*
|
*
|
||||||
@@ -218,6 +220,11 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
public JSONObject airSwellWithPaperTubeAssComplete(JSONObject param) {
|
public JSONObject airSwellWithPaperTubeAssComplete(JSONObject param) {
|
||||||
log.info("airSwellWithPaperTubeAssComplete接口输入参数为:-------------------"+param.toString());
|
log.info("airSwellWithPaperTubeAssComplete接口输入参数为:-------------------"+param.toString());
|
||||||
|
|
||||||
|
String container_name = param.getString("container_name");
|
||||||
|
if (StrUtil.isEmpty(container_name)){
|
||||||
|
throw new BadRequestException("子卷号不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
String isConnect = "1";
|
String isConnect = "1";
|
||||||
if (StrUtil.equals("0", isConnect)) {
|
if (StrUtil.equals("0", isConnect)) {
|
||||||
@@ -227,7 +234,9 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONArray list = new JSONArray();
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("iContainerName",container_name);
|
||||||
|
jo.put("iisAirSwellAssComplete",1);
|
||||||
|
|
||||||
// String url = acsUrl + api;
|
// String url = acsUrl + api;
|
||||||
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
@@ -235,7 +244,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
url = url+api;
|
url = url+api;
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
.body(String.valueOf(param))
|
.body(String.valueOf(jo))
|
||||||
.execute().body();
|
.execute().body();
|
||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("airSwellWithPaperTubeAssComplete接口输出参数为:-------------------"+result.toString());
|
log.info("airSwellWithPaperTubeAssComplete接口输出参数为:-------------------"+result.toString());
|
||||||
@@ -310,6 +319,11 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
public JSONObject airSwellWithPaperTubeAssArrival(JSONObject param) {
|
public JSONObject airSwellWithPaperTubeAssArrival(JSONObject param) {
|
||||||
log.info("airSwellWithPaperTubeAssArrival接口输入参数为:-------------------"+param.toString());
|
log.info("airSwellWithPaperTubeAssArrival接口输入参数为:-------------------"+param.toString());
|
||||||
|
|
||||||
|
String container_name = param.getString("container_name");
|
||||||
|
if (StrUtil.isEmpty(container_name)){
|
||||||
|
throw new BadRequestException("子卷号不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
String isConnect = "1";
|
String isConnect = "1";
|
||||||
if (StrUtil.equals("0", isConnect)) {
|
if (StrUtil.equals("0", isConnect)) {
|
||||||
@@ -319,7 +333,9 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONArray list = new JSONArray();
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("iContainerName",container_name);
|
||||||
|
jo.put("iisAirSwellDeliveryComplete",1);
|
||||||
|
|
||||||
// String url = acsUrl + api;
|
// String url = acsUrl + api;
|
||||||
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||||
@@ -327,7 +343,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
|||||||
url = url+api;
|
url = url+api;
|
||||||
try {
|
try {
|
||||||
String resultMsg = HttpRequest.post(url)
|
String resultMsg = HttpRequest.post(url)
|
||||||
.body(String.valueOf(param))
|
.body(String.valueOf(jo))
|
||||||
.execute().body();
|
.execute().body();
|
||||||
result = JSONObject.parseObject(resultMsg);
|
result = JSONObject.parseObject(resultMsg);
|
||||||
log.info("airSwellWithPaperTubeAssArrival接口输出参数为:-------------------"+result.toString());
|
log.info("airSwellWithPaperTubeAssArrival接口输出参数为:-------------------"+result.toString());
|
||||||
|
|||||||
@@ -9,10 +9,15 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.wms.ext.mes.service.MesToLmsService;
|
import org.nl.wms.ext.mes.service.MesToLmsService;
|
||||||
import org.nl.wms.log.LokiLog;
|
import org.nl.wms.log.LokiLog;
|
||||||
import org.nl.wms.log.LokiLogType;
|
import org.nl.wms.log.LokiLogType;
|
||||||
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
|
import org.nl.wms.sch.tasks.CoolCutTask;
|
||||||
|
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import sun.security.krb5.internal.crypto.Des;
|
import sun.security.krb5.internal.crypto.Des;
|
||||||
|
|
||||||
@@ -21,6 +26,8 @@ import sun.security.krb5.internal.crypto.Des;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class MesToLmsServiceImpl implements MesToLmsService {
|
public class MesToLmsServiceImpl implements MesToLmsService {
|
||||||
|
|
||||||
|
private final CheckOutBillService checkOutBillService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生箔烘箱:
|
* 生箔烘箱:
|
||||||
* 母卷批次创建信息发送智能物流(MES生箔工序Move In)
|
* 母卷批次创建信息发送智能物流(MES生箔工序Move In)
|
||||||
@@ -157,49 +164,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@LokiLog(type = LokiLogType.MES_TO_LMS)
|
|
||||||
@Override
|
|
||||||
public JSONObject test(JSONObject param) {
|
|
||||||
log.info("momRollFoilStart接口输入参数为:-------------------" + param.toString());
|
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
|
||||||
try {
|
|
||||||
String ContainerName = param.getString("ContainerName");
|
|
||||||
String ResourceName = param.getString("ResourceName");
|
|
||||||
String weight = param.getString("weight");
|
|
||||||
//查询该母卷号、设备号对应的生箔工单
|
|
||||||
JSONObject raw_jo = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").query("container_name ='" + ContainerName + "' AND resource_name = '" + ResourceName + "'").uniqueResult(0);
|
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(raw_jo)) {
|
|
||||||
throw new BadRequestException("未查询到对应的生箔工单!");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrUtil.isEmpty(weight)) {
|
|
||||||
throw new BadRequestException("未输入重量!");
|
|
||||||
}
|
|
||||||
|
|
||||||
raw_jo.put("productin_qty",weight);
|
|
||||||
|
|
||||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(raw_jo);
|
|
||||||
|
|
||||||
result.put("RTYPE", "S");
|
|
||||||
result.put("RTMSG", "操作成功!");
|
|
||||||
result.put("RTOAL", 1);
|
|
||||||
System.out.println(result);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
result.put("RTYPE", "E");
|
|
||||||
result.put("RTMSG", "操作失败!" + e.getMessage());
|
|
||||||
result.put("RTOAL", 0);
|
|
||||||
result.put("RTDAT", null);
|
|
||||||
System.out.println(result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MES执行下卷动作告诉LMS
|
* MES执行下卷动作告诉LMS
|
||||||
*
|
*
|
||||||
@@ -374,12 +338,150 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject callNextAssAndMomRoll(JSONObject param) {
|
public JSONObject callNextAssAndMomRoll(JSONObject param) {
|
||||||
log.info("callNextAssAndMomRoll接口输入参数为:-------------------" + param.toString());
|
log.info("callNextAssAndMomRoll接口输入参数为:-------------------" + param.toString());
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("RTYPE", "S");
|
|
||||||
result.put("RTMSG", "操作成功!");
|
try {
|
||||||
result.put("RTOAL", 1);
|
String container_name = param.getString("ContainerName");
|
||||||
result.put("RTDAT", null);
|
if (StrUtil.isEmpty(container_name)) {
|
||||||
System.out.println(result);
|
throw new BadRequestException("子卷号不能为空!");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("container_name = '" + container_name + "' AND is_delete = '0'").uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||||
|
throw new BadRequestException("未查询到该子卷号对应的分切计划!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询该分切机对应的点位
|
||||||
|
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
//创建搬运任务
|
||||||
|
if (plan_jo.getString("order_type").equals("1")) {
|
||||||
|
//生成一个半成品出库任务
|
||||||
|
String parent_container_name = plan_jo.getString("parent_container_name");
|
||||||
|
|
||||||
|
//查询该母卷号所在位置
|
||||||
|
JSONObject cool_ivt = WQLObject.getWQLObject("ST_IVT_CoolPointIvt").query("container_name = '" + parent_container_name + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(cool_ivt)) {
|
||||||
|
throw new BadRequestException("未查询到该母卷的库存信息,!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询该母卷号对应的生箔信息
|
||||||
|
JSONObject raw_jo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder").query("container_name = '" + parent_container_name + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(raw_jo)) {
|
||||||
|
throw new BadRequestException("未查询到母卷:" + parent_container_name + ",对应的生箔信息!");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + raw_jo.getString("product_name") + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
//创建任务,判断目的点是否存在空轴,存在创建4个点的任务,不存在则创建两个点任务
|
||||||
|
String task_id = "";
|
||||||
|
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
if (StrUtil.isEmpty(cut_jo.getString("empty_vehicle_code"))) {
|
||||||
|
jo.put("point_code1", cool_ivt.getString("full_point_code"));
|
||||||
|
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||||
|
jo.put("vehicle_code", parent_container_name);
|
||||||
|
jo.put("task_type", "010302");
|
||||||
|
} else {
|
||||||
|
jo.put("point_code1", cool_ivt.getString("full_point_code"));
|
||||||
|
jo.put("point_code2", cut_jo.getString("full_point_code"));
|
||||||
|
jo.put("point_code3", cut_jo.getString("full_point_code"));
|
||||||
|
jo.put("point_code4", cool_ivt.getString("full_point_code"));
|
||||||
|
jo.put("vehicle_code", parent_container_name);
|
||||||
|
jo.put("vehicle_code2", cut_jo.getString("empty_vehicle_code"));
|
||||||
|
jo.put("task_type", "010301");
|
||||||
|
}
|
||||||
|
|
||||||
|
AbstractAcsTask task = new CoolCutTask();
|
||||||
|
task_id = task.createTask(jo);
|
||||||
|
|
||||||
|
//生成半成品出库单据
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
|
||||||
|
JSONObject jsonCool = new JSONObject();
|
||||||
|
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
|
||||||
|
jsonCool.put("io_type", "1");
|
||||||
|
jsonCool.put("material_id", mater_jo.getString("material_id"));
|
||||||
|
jsonCool.put("pcsn", parent_container_name);
|
||||||
|
jsonCool.put("bill_status", "10");
|
||||||
|
jsonCool.put("task_id", task_id);
|
||||||
|
jsonCool.put("qty_unit_id", "1");
|
||||||
|
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", currentUserId);
|
||||||
|
jsonCool.put("create_name", currentUsername);
|
||||||
|
jsonCool.put("create_time", DateUtil.now());
|
||||||
|
jsonCool.put("update_optid", currentUserId);
|
||||||
|
jsonCool.put("update_optname", currentUsername);
|
||||||
|
jsonCool.put("update_time", DateUtil.now());
|
||||||
|
jsonCool.put("confirm_optid", currentUserId);
|
||||||
|
jsonCool.put("confirm_optname", currentUsername);
|
||||||
|
jsonCool.put("confirm_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_CoolRegionIO").insert(jsonCool);
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//生成一个成品出库任务
|
||||||
|
|
||||||
|
//查询该箱子所在仓位
|
||||||
|
String package_box_sn = plan_jo.getString("package_box_sn");
|
||||||
|
String restruct_container_name = plan_jo.getString("restruct_container_name");
|
||||||
|
|
||||||
|
//查询该包装关系
|
||||||
|
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("container_name = '"+restruct_container_name+"'").uniqueResult(0);
|
||||||
|
JSONObject struct = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + package_box_sn + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(struct)) {
|
||||||
|
throw new BadRequestException("该箱子已出库,不在库内!");
|
||||||
|
}
|
||||||
|
if (!struct.getString("lock_type").equals("1")) {
|
||||||
|
throw new BadRequestException("该木箱正在出库中!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//插入主表、明细、分配
|
||||||
|
JSONObject mst_jo = new JSONObject();
|
||||||
|
mst_jo.put("biz_date", DateUtil.now());
|
||||||
|
mst_jo.put("bill_type", "1003");
|
||||||
|
//查询成品库仓库
|
||||||
|
JSONObject stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1'").uniqueResult(0);
|
||||||
|
mst_jo.put("stor_id", stor.getString("stor_id"));
|
||||||
|
mst_jo.put("total_qty", "0");
|
||||||
|
mst_jo.put("bill_status", "10");
|
||||||
|
|
||||||
|
JSONArray rows = new JSONArray();
|
||||||
|
JSONObject dtl = new JSONObject();
|
||||||
|
//查询该物料
|
||||||
|
JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0);
|
||||||
|
dtl.put("material_id",mater_jo.getString("material_id"));
|
||||||
|
dtl.put("pcsn",plan_jo.getString("container_name"));
|
||||||
|
dtl.put("box_no",package_box_sn);
|
||||||
|
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '"+mater_jo.getString("base_unit_id")+"'").uniqueResult(0);
|
||||||
|
dtl.put("qty_unit_id",unit.getString("measure_unit_id"));
|
||||||
|
dtl.put("qty_unit_name",unit.getString("unit_name"));
|
||||||
|
dtl.put("plan_qty",sub_jo.getString("net_weight"));
|
||||||
|
rows.add(dtl);
|
||||||
|
mst_jo.put("tableData",rows);
|
||||||
|
checkOutBillService.insertDtl(mst_jo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
result.put("RTYPE", "S");
|
||||||
|
result.put("RTMSG", "操作成功!");
|
||||||
|
result.put("RTOAL", 1);
|
||||||
|
result.put("RTDAT", null);
|
||||||
|
System.out.println(result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
result.put("RTYPE", "E");
|
||||||
|
result.put("RTMSG", "操作失败!" + e.getMessage());
|
||||||
|
result.put("RTOAL", 0);
|
||||||
|
result.put("RTDAT", null);
|
||||||
|
System.out.println(result);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class ShippingController {
|
|||||||
|
|
||||||
@PostMapping("/confirm")
|
@PostMapping("/confirm")
|
||||||
@Log("套轴确认")
|
@Log("套轴确认")
|
||||||
@ApiOperation("套轴确认")
|
@ApiOperation("配送确认")
|
||||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||||
return new ResponseEntity<>(shippingService.confirm(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(shippingService.confirm(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,9 +123,8 @@ public class CasingServiceImpl implements CasingService {
|
|||||||
|
|
||||||
//调用MES接口,通知MES已经套轴完成
|
//调用MES接口,通知MES已经套轴完成
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("ContainerName",row.getString("container_name"));
|
jo.put("container_name",row.getString("container_name"));
|
||||||
jo.put("isAirSwellAssComplete",1);
|
lmsToMesService.airSwellWithPaperTubeAssComplete(jo);
|
||||||
//lmsToMesService.airSwellWithPaperTubeAssComplete(jo);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,293 @@
|
|||||||
|
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.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
|
import org.nl.wms.sch.AcsTaskDto;
|
||||||
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class CoolCutTask extends AbstractAcsTask {
|
||||||
|
|
||||||
|
private final String THIS_CLASS = CoolCutTask.class.getName();
|
||||||
|
|
||||||
|
|
||||||
|
@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()
|
||||||
|
.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"))
|
||||||
|
.vehicle_type(json.getString("vehicle_type"))
|
||||||
|
.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_CoolRegionIO");
|
||||||
|
|
||||||
|
String task_id = taskObj.getString("task_id");
|
||||||
|
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
|
||||||
|
if (StrUtil.equals(status, "0")) {
|
||||||
|
// 取消删除任务
|
||||||
|
taskTab.delete("task_id = '" + task_id + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||||
|
// 更新任务状态为执行中
|
||||||
|
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||||
|
jsonTask.put("update_time", DateUtil.now());
|
||||||
|
taskTab.update(jsonTask);
|
||||||
|
|
||||||
|
// 更新主表状态
|
||||||
|
JSONObject coolMst = ivtTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
|
coolMst.put("bill_status", "40");
|
||||||
|
ivtTab.update(coolMst);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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");
|
||||||
|
String point_code3 = jsonTask.getString("point_code3");
|
||||||
|
String point_code4 = jsonTask.getString("point_code4");
|
||||||
|
|
||||||
|
if (jsonTask.getString("task_type").equals("010301")) {
|
||||||
|
// 更新主表状态
|
||||||
|
JSONObject coolMst = ivtTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
|
coolMst.put("bill_status", "50");
|
||||||
|
ivtTab.update(coolMst);
|
||||||
|
|
||||||
|
//更新冷却区母卷库存
|
||||||
|
JSONObject jsonCoolIvt = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
String container_name = jsonCoolIvt.getString("container_name"); // 母卷号
|
||||||
|
|
||||||
|
jsonCoolIvt.put("full_point_status", "01");
|
||||||
|
jsonCoolIvt.put("container_name", "");
|
||||||
|
jsonCoolIvt.put("workorder_id", "");
|
||||||
|
jsonCoolIvt.put("ivt_qty", "0");
|
||||||
|
jsonCoolIvt.put("cool_ivt_status", "01");
|
||||||
|
jsonCoolIvt.put("instorage_time", "");
|
||||||
|
jsonCoolIvt.put("update_optid", currentUserId);
|
||||||
|
jsonCoolIvt.put("update_optname", currentUsername);
|
||||||
|
jsonCoolIvt.put("update_time", DateUtil.now());
|
||||||
|
ivtTab.update(jsonCoolIvt);
|
||||||
|
|
||||||
|
//更新分切区母卷库存
|
||||||
|
JSONObject cut_jo = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("full_point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||||
|
cut_jo.put("full_point_status", "02");
|
||||||
|
cut_jo.put("container_name", container_name);
|
||||||
|
cut_jo.put("update_optid", currentUserId);
|
||||||
|
cut_jo.put("update_optname", currentUsername);
|
||||||
|
cut_jo.put("update_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_jo);
|
||||||
|
|
||||||
|
//更新分切区空轴库存
|
||||||
|
JSONObject cut_jo2 = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("empty_point_code = '" + point_code3 + "'").uniqueResult(0);
|
||||||
|
cut_jo2.put("empty_point_status", "01");
|
||||||
|
cut_jo2.put("empty_vehicle_code", "");
|
||||||
|
cut_jo2.put("update_optid", currentUserId);
|
||||||
|
cut_jo2.put("update_optname", currentUsername);
|
||||||
|
cut_jo2.put("update_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_jo2);
|
||||||
|
|
||||||
|
//更新冷却区空轴库存
|
||||||
|
JSONObject jsonCoolIvt2 = ivtTab.query("full_point_code = '" + point_code4 + "'").uniqueResult(0);
|
||||||
|
jsonCoolIvt2.put("empty_point_status", "02");
|
||||||
|
jsonCoolIvt2.put("empty_vehicle_code", jsonTask.getString("vehicle_code2"));
|
||||||
|
jsonCoolIvt2.put("cool_ivt_status", "01");
|
||||||
|
jsonCoolIvt2.put("instorage_time", "");
|
||||||
|
jsonCoolIvt2.put("update_optid", currentUserId);
|
||||||
|
jsonCoolIvt2.put("update_optname", currentUsername);
|
||||||
|
jsonCoolIvt2.put("update_time", DateUtil.now());
|
||||||
|
ivtTab.update(jsonCoolIvt2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jsonTask.getString("task_type").equals("010302")) {
|
||||||
|
// 更新主表状态
|
||||||
|
JSONObject coolMst = ivtTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
|
coolMst.put("bill_status", "50");
|
||||||
|
ivtTab.update(coolMst);
|
||||||
|
|
||||||
|
//更新冷却区母卷库存
|
||||||
|
JSONObject jsonCoolIvt = ivtTab.query("full_point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
String container_name = jsonCoolIvt.getString("container_name"); // 母卷号
|
||||||
|
|
||||||
|
jsonCoolIvt.put("full_point_status", "01");
|
||||||
|
jsonCoolIvt.put("container_name", "");
|
||||||
|
jsonCoolIvt.put("workorder_id", "");
|
||||||
|
jsonCoolIvt.put("ivt_qty", "0");
|
||||||
|
jsonCoolIvt.put("cool_ivt_status", "01");
|
||||||
|
jsonCoolIvt.put("instorage_time", "");
|
||||||
|
jsonCoolIvt.put("update_optid", currentUserId);
|
||||||
|
jsonCoolIvt.put("update_optname", currentUsername);
|
||||||
|
jsonCoolIvt.put("update_time", DateUtil.now());
|
||||||
|
ivtTab.update(jsonCoolIvt);
|
||||||
|
|
||||||
|
//更新分切区母卷库存
|
||||||
|
JSONObject cut_jo = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("full_point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||||
|
cut_jo.put("full_point_status", "02");
|
||||||
|
cut_jo.put("container_name", container_name);
|
||||||
|
cut_jo.put("update_optid", currentUserId);
|
||||||
|
cut_jo.put("update_optname", currentUsername);
|
||||||
|
cut_jo.put("update_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_jo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jsonTask.getString("task_type").equals("010303")) {
|
||||||
|
//更新分切区空轴库存
|
||||||
|
JSONObject cut_jo2 = WQLObject.getWQLObject("ST_IVT_CutPointIvt").query("empty_point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
cut_jo2.put("empty_point_status", "01");
|
||||||
|
cut_jo2.put("empty_vehicle_code", "");
|
||||||
|
cut_jo2.put("update_optid", currentUserId);
|
||||||
|
cut_jo2.put("update_optname", currentUsername);
|
||||||
|
cut_jo2.put("update_time", DateUtil.now());
|
||||||
|
WQLObject.getWQLObject("ST_IVT_CutPointIvt").update(cut_jo2);
|
||||||
|
|
||||||
|
//更新冷却区空轴库存
|
||||||
|
JSONObject jsonCoolIvt2 = ivtTab.query("full_point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||||
|
jsonCoolIvt2.put("empty_point_status", "02");
|
||||||
|
jsonCoolIvt2.put("empty_vehicle_code", jsonTask.getString("vehicle_code"));
|
||||||
|
jsonCoolIvt2.put("cool_ivt_status", "01");
|
||||||
|
jsonCoolIvt2.put("instorage_time", "");
|
||||||
|
jsonCoolIvt2.put("update_optid", currentUserId);
|
||||||
|
jsonCoolIvt2.put("update_optname", currentUsername);
|
||||||
|
jsonCoolIvt2.put("update_time", DateUtil.now());
|
||||||
|
ivtTab.update(jsonCoolIvt2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void findStartPoint() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void findNextPoint() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public String createTask(JSONObject form) {
|
||||||
|
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
|
||||||
|
String point_code1 = form.getString("point_code1");
|
||||||
|
String point_code2 = form.getString("point_code2");
|
||||||
|
String point_code3 = form.getString("point_code3");
|
||||||
|
String point_code4 = form.getString("point_code4");
|
||||||
|
if (isSingleTask(point_code1)) {
|
||||||
|
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||||
|
}
|
||||||
|
if (isSingleTask(point_code2)) {
|
||||||
|
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||||
|
}
|
||||||
|
if (isSingleTask(point_code3)) {
|
||||||
|
throw new BadRequestException("点位:" + point_code3 + "存在未完成的任务!");
|
||||||
|
}
|
||||||
|
if (isSingleTask(point_code4)) {
|
||||||
|
throw new BadRequestException("点位:" + point_code4 + "存在未完成的任务!");
|
||||||
|
}
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
|
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
|
json.put("task_type", form.getString("task_type"));
|
||||||
|
json.put("task_status", "01");
|
||||||
|
json.put("point_code1", point_code1);
|
||||||
|
json.put("point_code2", point_code2);
|
||||||
|
json.put("point_code3", point_code3);
|
||||||
|
json.put("point_code4", point_code4);
|
||||||
|
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||||
|
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", "5");
|
||||||
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断该点位是否存在未完成的任务
|
||||||
|
public boolean isSingleTask(String point_code) {
|
||||||
|
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code2 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code3 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
|
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code4 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(task1) || ObjectUtil.isNotEmpty(task2) || ObjectUtil.isNotEmpty(task3) || ObjectUtil.isNotEmpty(task4)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,6 +12,8 @@ import org.nl.modules.common.exception.BadRequestException;
|
|||||||
import org.nl.modules.common.utils.SecurityUtils;
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
import org.nl.wms.sch.AcsTaskDto;
|
import org.nl.wms.sch.AcsTaskDto;
|
||||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||||
@@ -26,6 +28,7 @@ import java.util.List;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class CutConveyorTask extends AbstractAcsTask {
|
public class CutConveyorTask extends AbstractAcsTask {
|
||||||
|
|
||||||
private final String THIS_CLASS = CutConveyorTask.class.getName();
|
private final String THIS_CLASS = CutConveyorTask.class.getName();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,9 +67,9 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
String task_id = taskObj.getString("task_id");
|
String task_id = taskObj.getString("task_id");
|
||||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
|
|
||||||
if (StrUtil.equals(status,"0")) {
|
if (StrUtil.equals(status, "0")) {
|
||||||
// 取消删除任务
|
// 取消删除任务
|
||||||
taskTab.delete("task_id = '"+task_id+"'");
|
taskTab.delete("task_id = '" + task_id + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||||
@@ -76,9 +79,9 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
taskTab.update(jsonTask);
|
taskTab.update(jsonTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
|
||||||
// 更改任务状态为完成
|
// 更改任务状态为完成
|
||||||
jsonTask.put("task_status",TaskStatusEnum.FINISHED.getCode());
|
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||||
jsonTask.put("update_optid", SecurityUtils.getCurrentUserId());
|
jsonTask.put("update_optid", SecurityUtils.getCurrentUserId());
|
||||||
jsonTask.put("update_optname", SecurityUtils.getCurrentUsername());
|
jsonTask.put("update_optname", SecurityUtils.getCurrentUsername());
|
||||||
jsonTask.put("update_time", DateUtil.now());
|
jsonTask.put("update_time", DateUtil.now());
|
||||||
@@ -87,7 +90,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
String point_code1 = jsonTask.getString("point_code1");
|
String point_code1 = jsonTask.getString("point_code1");
|
||||||
String point_code2 = jsonTask.getString("point_code2");
|
String point_code2 = jsonTask.getString("point_code2");
|
||||||
|
|
||||||
if (jsonTask.getString("task_type").equals("010401")){
|
if (jsonTask.getString("task_type").equals("010401")) {
|
||||||
// 校验终点是否存在
|
// 校验终点是否存在
|
||||||
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0);
|
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||||
@@ -98,7 +101,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
jsonIvt.put("point_status", "01");
|
jsonIvt.put("point_status", "01");
|
||||||
ivtTab.update(jsonIvt);
|
ivtTab.update(jsonIvt);
|
||||||
}
|
}
|
||||||
if (jsonTask.getString("task_type").equals("010402")){
|
if (jsonTask.getString("task_type").equals("010402")) {
|
||||||
// 校验终点是否存在
|
// 校验终点是否存在
|
||||||
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code2 + "'").uniqueResult(0);
|
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code2 + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||||
@@ -112,9 +115,21 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
//更新对应气涨轴的分切计划表为配送完成
|
//更新对应气涨轴的分切计划表为配送完成
|
||||||
HashMap map = new HashMap();
|
HashMap map = new HashMap();
|
||||||
map.put("is_child_ps_ok","1");
|
map.put("is_child_ps_ok", "1");
|
||||||
map.put("status","03");
|
map.put("status", "03");
|
||||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map,"qzzno = '"+jsonTask.getString("vehicle_code")+"' AND is_child_tz_ok = '1' AND is_child_ps_ok = '0' AND is_delete ='0' AND status = '02'");
|
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map, "qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '0' AND is_delete ='0' AND status = '02'");
|
||||||
|
|
||||||
|
LmsToMesService lmsToMesService = SpringContextHolder.getBean(LmsToMesService.class);
|
||||||
|
//调用MES配送完成接口
|
||||||
|
JSONArray rows = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '0' AND is_delete ='0' AND status = '02'").getResultJSONArray(0);
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
JSONObject row = rows.getJSONObject(i);
|
||||||
|
String ContainerName = row.getString("container_name");
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("ContainerName", ContainerName);
|
||||||
|
lmsToMesService.airSwellWithPaperTubeAssArrival(row);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,14 +153,14 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
|
|
||||||
String point_code1 = form.getString("point_code1");
|
String point_code1 = form.getString("point_code1");
|
||||||
String point_code2 = form.getString("point_code2");
|
String point_code2 = form.getString("point_code2");
|
||||||
if (isSingleTask(point_code1)){
|
if (isSingleTask(point_code1)) {
|
||||||
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
|
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||||
}
|
}
|
||||||
if (isSingleTask(point_code2)){
|
if (isSingleTask(point_code2)) {
|
||||||
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
|
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||||
}
|
}
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("task_id", IdUtil.getSnowflake(1,1).nextId());
|
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||||
json.put("task_type", form.getString("task_type"));
|
json.put("task_type", form.getString("task_type"));
|
||||||
json.put("task_status", "01");
|
json.put("task_status", "01");
|
||||||
@@ -156,8 +171,8 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
json.put("create_id", currentUserId);
|
json.put("create_id", currentUserId);
|
||||||
json.put("create_name", currentUsername);
|
json.put("create_name", currentUsername);
|
||||||
json.put("create_time", DateUtil.now());
|
json.put("create_time", DateUtil.now());
|
||||||
json.put("priority","1" );
|
json.put("priority", "1");
|
||||||
json.put("acs_task_type","5" );
|
json.put("acs_task_type", "5");
|
||||||
tab.insert(json);
|
tab.insert(json);
|
||||||
|
|
||||||
return json.getString("task_id");
|
return json.getString("task_id");
|
||||||
@@ -171,22 +186,21 @@ public class CutConveyorTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel(String task_id) {
|
public void cancel(String task_id) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断该点位是否存在未完成的任务
|
//判断该点位是否存在未完成的任务
|
||||||
public boolean isSingleTask(String point_code){
|
public boolean isSingleTask(String point_code) {
|
||||||
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code2 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code2 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code3 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code3 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code4 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code4 = '" + point_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(task1) || ObjectUtil.isNotEmpty(task2) || ObjectUtil.isNotEmpty(task3) || ObjectUtil.isNotEmpty(task4)){
|
if (ObjectUtil.isNotEmpty(task1) || ObjectUtil.isNotEmpty(task2) || ObjectUtil.isNotEmpty(task3) || ObjectUtil.isNotEmpty(task4)) {
|
||||||
return true;
|
return true;
|
||||||
}else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user