修改
This commit is contained in:
@@ -80,6 +80,14 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.process(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/shipDeviceUpdate")
|
||||
@Log(value = "输送线光电无货上报", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("输送线光电无货上报")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> shipDeviceUpdate(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acsToWmsService.shipDeviceUpdate(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/initialize")
|
||||
@Log(value = "仓位初始化", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("仓位初始化")
|
||||
|
||||
@@ -69,6 +69,15 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
JSONObject process(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* ACS客户端--->LMS服务端
|
||||
* 输送线光电无货上报
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject shipDeviceUpdate(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 仓位初始化
|
||||
*/
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
|
||||
import org.nl.wms.pda.st.service.PrintService;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.EmptyVehicleTask;
|
||||
import org.nl.wms.sch.tasks.SendOutTask;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
@@ -43,6 +44,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
private final StorPublicService storPublicService;
|
||||
|
||||
private final CutConveyorTask cutConveyorTask;
|
||||
|
||||
/**
|
||||
* task_id:任务标识
|
||||
* task_code:任务编码
|
||||
@@ -543,6 +546,53 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject shipDeviceUpdate(JSONObject whereJson) {
|
||||
log.info("shipDeviceUpdate请求参数:---------------------------------------------"+whereJson.toString());
|
||||
String device_code = whereJson.getString("device_code");
|
||||
if (StrUtil.isEmpty(device_code)){
|
||||
throw new BadRequestException("输入的设备号不能为空!");
|
||||
}
|
||||
|
||||
//查询该设备对应的输送线点位
|
||||
JSONObject deliver_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
String qzzno = deliver_jo.getString("qzzno");
|
||||
if (ObjectUtil.isNotEmpty(deliver_jo)){
|
||||
deliver_jo.put("point_status","01");
|
||||
deliver_jo.put("qzzno","");
|
||||
WQLObject.getWQLObject("st_ivt_deliverypointivt").update(deliver_jo);
|
||||
|
||||
//如果为靠近分切机一端的输送点,判断远离端是否需要进行横移
|
||||
char dtl_type = device_code.charAt(device_code.length() - 1);
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
|
||||
String point_location = deliver_jo.getString("point_location");
|
||||
String product_area = deliver_jo.getString("product_area");
|
||||
String sort_seq = deliver_jo.getString("sort_seq");
|
||||
JSONObject right_point = WQL.getWO("PDA_02")
|
||||
.addParam("point_location", point_location)
|
||||
.addParam("point_code", device_code)
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("sort_seq", sort_seq)
|
||||
.addParam("flag", "17").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(right_point) && !right_point.getString("point_status").equals("01")) {
|
||||
//创建载具横移任务
|
||||
String translate_code1 = right_point.getString("point_code");
|
||||
String translate_code2 = device_code;
|
||||
JSONObject tran_jo = new JSONObject();
|
||||
tran_jo.put("point_code1",translate_code1);
|
||||
tran_jo.put("point_code2",translate_code2);
|
||||
tran_jo.put("vehicle_code",right_point.getString("qzzno"));
|
||||
tran_jo.put("task_type","010406");
|
||||
cutConveyorTask.createTask(tran_jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize(JSONObject param) {
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ public class InController {
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("子卷出站")
|
||||
@Log("子卷入站")
|
||||
@ApiOperation("子卷入站")
|
||||
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(inService.confirm(whereJson), HttpStatus.OK);
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pda.mps.service.InService;
|
||||
import org.nl.wms.pda.mps.service.OutService;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.CutTrussTask;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -66,6 +67,12 @@ public class InServiceImpl implements InService {
|
||||
jo.put("vehicle_code", cut_row.getString("qzzno"));
|
||||
jo.put("product_area", cut_ivt.getString("product_area"));
|
||||
jo.put("task_type", "010405");
|
||||
char dtl_type = cut_row.getString("delivery_code").charAt(cut_row.getString("delivery_code").length() - 1);
|
||||
//判断起点是否远离分切机
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 == 0) {
|
||||
jo.put("task_status", TaskStatusEnum.SURE_END.getCode());
|
||||
jo.put("point_code1", "");
|
||||
}
|
||||
cutTrussTask.createTask(jo);
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.pda.mps.service.OutService;
|
||||
import org.nl.wms.pda.mps.service.ShippingService;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.CutConveyorTask;
|
||||
import org.nl.wms.sch.tasks.CutTrussTask;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -109,7 +110,7 @@ public class OutServiceImpl implements OutService {
|
||||
//查询该分切机邻近位置的空载具的输送线点位
|
||||
JSONObject empty_vehicle = WQL.getWO("PDA_02")
|
||||
.addParam("sort_seq", cut_ivt.getString("sort_seq"))
|
||||
.addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code desc")
|
||||
.addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code")
|
||||
.addParam("product_area", cut_ivt.getString("product_area"))
|
||||
.addParam("point_location", cut_ivt.getString("point_location"))
|
||||
.addParam("flag", "3").process().uniqueResult(0);
|
||||
@@ -134,6 +135,8 @@ public class OutServiceImpl implements OutService {
|
||||
throw new BadRequestException("输送线不存在该分切机已经配送完成的气涨轴!");
|
||||
}
|
||||
|
||||
char dtl_type = delivery_point.getString("point_code").charAt(delivery_point.getString("point_code").length() - 1);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("point_code1",delivery_point.getString("point_code"));
|
||||
jo.put("point_code2", point_code);
|
||||
@@ -142,6 +145,12 @@ public class OutServiceImpl implements OutService {
|
||||
jo.put("vehicle_code", delivery_point.getString("qzzno"));
|
||||
jo.put("vehicle_code2", cut_qzzno);
|
||||
jo.put("product_area", cut_ivt.getString("product_area"));
|
||||
//判断起点是否远离分切机
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 == 0) {
|
||||
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
|
||||
jo.put("point_code1", "");
|
||||
jo.put("point_code2", "");
|
||||
}
|
||||
jo.put("task_type", "010403");
|
||||
cutTrussTask.createTask(jo);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
//查询离该分切计划包含机台最近的一个空载具
|
||||
JSONObject empty_vehicle = WQL.getWO("PDA_02")
|
||||
.addParam("sort_seq", cut_jo.getString("sort_seq"))
|
||||
.addParam("sql_str", " ORDER BY abs(" + cut_jo.getString("sort_seq") + "-sort_seq),point_code desc")
|
||||
.addParam("sql_str", " ORDER BY abs(" + cut_jo.getString("sort_seq") + "-sort_seq),point_code")
|
||||
.addParam("product_area", cut_jo.getString("product_area"))
|
||||
.addParam("point_location", cut_jo.getString("point_location"))
|
||||
.addParam("flag", "3").process().uniqueResult(0);
|
||||
@@ -175,11 +175,11 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
|
||||
char dtl_type = empty_point.getString("point_code").charAt(empty_point.getString("point_code").length() - 1);
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
|
||||
JSONObject right_point = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_location = '"+empty_point.getString("point_location")+"' AND product_area = '"+empty_point.getString("product_area")+"' AND sort_seq = '"+empty_point.getString("sort_seq")+"' order by point_code desc").uniqueResult(0);
|
||||
JSONObject right_point = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_location = '" + empty_point.getString("point_location") + "' AND product_area = '" + empty_point.getString("product_area") + "' AND sort_seq = '" + empty_point.getString("sort_seq") + "' order by point_code desc").uniqueResult(0);
|
||||
//判断是否存在任务
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '"+right_point.getString("point_code")+"' OR point_code2 = '"+right_point.getString("point_code")+"') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)){
|
||||
throw new BadRequestException(empty_point.getString("point_code")+"所在一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '" + right_point.getString("point_code") + "' OR point_code2 = '" + right_point.getString("point_code") + "') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException(empty_point.getString("point_code") + "所在一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,6 +200,22 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(row);
|
||||
}
|
||||
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 == 0) {
|
||||
//如果是右边的任务,判断左边是否存在空载具且没任务,如果存在则把左边的空载具送出
|
||||
JSONObject left_point = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_location = '" + empty_point.getString("point_location") + "' AND product_area = '" + empty_point.getString("product_area") + "' AND sort_seq = '" + empty_point.getString("sort_seq") + "' order by point_code").uniqueResult(0);
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '" + left_point.getString("point_code") + "' OR point_code2 = '" + left_point.getString("point_code") + "') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(task_jo) && left_point.getString("point_status").equals("02")) {
|
||||
//如果查询到给ACS下发一个输送线任务
|
||||
JSONObject form2 = new JSONObject();
|
||||
form2.put("point_code1", left_point.getString("point_code"));
|
||||
//查询该区域点位类型为出口的点位
|
||||
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");
|
||||
cutConveyorTask.createTask(form2);
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
return jo;
|
||||
@@ -233,7 +249,9 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
|
||||
//根据起点判断区域查询对应的输送线空点位
|
||||
JSONObject point_jo = WQL.getWO("PDA_02").addParam("flag", "4").addParam("product_area", vehicle_area.getString("product_area"))
|
||||
.addParam("point_location", vehicle_area.getString("point_location")).process().uniqueResult(0);
|
||||
.addParam("point_location", vehicle_area.getString("point_location"))
|
||||
.addParam("sql_str", " ORDER BY point_code")
|
||||
.process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("对应输送线不存在可用的空位!");
|
||||
}
|
||||
@@ -242,11 +260,11 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
|
||||
char dtl_type = point_jo.getString("point_code").charAt(point_jo.getString("point_code").length() - 1);
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
|
||||
JSONObject right_point = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_location = '"+point_jo.getString("point_location")+"' AND product_area = '"+point_jo.getString("product_area")+"' AND sort_seq = '"+point_jo.getString("sort_seq")+"' order by point_code desc").uniqueResult(0);
|
||||
JSONObject right_point = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_location = '" + point_jo.getString("point_location") + "' AND product_area = '" + point_jo.getString("product_area") + "' AND sort_seq = '" + point_jo.getString("sort_seq") + "' order by point_code desc").uniqueResult(0);
|
||||
//判断是否存在任务
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '"+right_point.getString("point_code")+"' OR point_code2 = '"+right_point.getString("point_code")+"') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)){
|
||||
throw new BadRequestException(point_jo.getString("point_code")+"所在一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '" + right_point.getString("point_code") + "' OR point_code2 = '" + right_point.getString("point_code") + "') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException(point_jo.getString("point_code") + "所在一截输送线存在未完成的任务,请稍等几分钟后进行下发!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,21 +284,21 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
public JSONObject acrossVehicle(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("point_code");
|
||||
|
||||
if (StrUtil.isEmpty(point_code)){
|
||||
if (StrUtil.isEmpty(point_code)) {
|
||||
throw new BadRequestException("输入点位不能为空!");
|
||||
}
|
||||
|
||||
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_code = '"+point_code+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(del_jo)){
|
||||
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(del_jo)) {
|
||||
throw new BadRequestException("未查询到相关的输送线点位!");
|
||||
}
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '"+point_code+"' OR point_code2 = '"+point_code+"') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)){
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("(point_code1 = '" + point_code + "' OR point_code2 = '" + point_code + "') AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
throw new BadRequestException("该点位存在未完成的任务,请先完成任务!");
|
||||
}
|
||||
|
||||
String point_status = del_jo.getString("point_status");
|
||||
if (point_status.equals("01")){
|
||||
if (point_status.equals("01")) {
|
||||
throw new BadRequestException("该点位上不存在载具!");
|
||||
}
|
||||
|
||||
@@ -301,10 +319,10 @@ public class ShippingServiceImpl implements ShippingService {
|
||||
String translate_code1 = point_code;
|
||||
String translate_code2 = left_point.getString("point_code");
|
||||
JSONObject tran_jo = new JSONObject();
|
||||
tran_jo.put("point_code1",translate_code1);
|
||||
tran_jo.put("point_code2",translate_code2);
|
||||
tran_jo.put("vehicle_code",del_jo.getString("qzzno"));
|
||||
tran_jo.put("task_type","010406");
|
||||
tran_jo.put("point_code1", translate_code1);
|
||||
tran_jo.put("point_code2", translate_code2);
|
||||
tran_jo.put("vehicle_code", del_jo.getString("qzzno"));
|
||||
tran_jo.put("task_type", "010406");
|
||||
cutConveyorTask.createTask(tran_jo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,20 @@
|
||||
st_ivt_deliverypointivt del
|
||||
LEFT JOIN pdm_bi_slittingproductionplan plan ON plan.qzzno = del.qzzno
|
||||
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
SELECT RIGHT
|
||||
( point_code, 1 ) AS goal_code,
|
||||
point_code
|
||||
FROM
|
||||
st_ivt_deliverypointivt
|
||||
) a
|
||||
WHERE
|
||||
MOD(goal_code,2) = 1
|
||||
) b ON b.point_code = del.point_code
|
||||
WHERE
|
||||
del.point_status = '03'
|
||||
AND
|
||||
@@ -491,7 +505,7 @@
|
||||
OPTION 输入.ext_code <> ""
|
||||
plan.resource_name = 输入.ext_code
|
||||
ENDOPTION
|
||||
order by del.point_code desc
|
||||
order by plan.split_group,del.point_code desc
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -516,6 +530,9 @@
|
||||
OPTION 输入.find_type = "2"
|
||||
point_status = '01'
|
||||
ENDOPTION
|
||||
OPTION 输入.find_type = "3"
|
||||
point_status = '03'
|
||||
ENDOPTION
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
|
||||
@@ -99,12 +99,12 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
throw new BadRequestException("未找到可用点位:" + point_code1);
|
||||
}
|
||||
|
||||
// 更新分切输送库存状态
|
||||
/*// 更新分切输送库存状态
|
||||
jsonIvt.put("point_status", "01");
|
||||
jsonIvt.put("qzzno", "");
|
||||
ivtTab.update(jsonIvt);
|
||||
ivtTab.update(jsonIvt);*/
|
||||
|
||||
//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
|
||||
/*//判断输送出来的任务起点是否靠近分切机,如果靠近分切机且远离分切机的点位上存在载具且不存在任务进行载具横移
|
||||
char dtl_type = point_code1.charAt(point_code1.length() - 1);
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
|
||||
String point_location = jsonIvt.getString("point_location");
|
||||
@@ -128,7 +128,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
this.createTask(tran_jo);
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (jsonTask.getString("task_type").equals("010402")) {
|
||||
// 校验终点是否存在
|
||||
@@ -175,6 +175,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
String sort_seq = jsonIvt.getString("sort_seq");
|
||||
JSONObject left_point = WQL.getWO("PDA_02")
|
||||
.addParam("point_location", point_location)
|
||||
.addParam("point_code", point_code2)
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("sort_seq", sort_seq)
|
||||
.addParam("find_type", "2")
|
||||
@@ -192,19 +193,37 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jsonTask.getString("task_type").equals("010406")){
|
||||
if (jsonTask.getString("task_type").equals("010406")) {
|
||||
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0);
|
||||
JSONObject jsonIvt2 = ivtTab.query("point_code ='" + point_code2 + "'").uniqueResult(0);
|
||||
|
||||
String point_status = jsonIvt.getString("point_status");
|
||||
String qzzno = jsonIvt.getString("qzzno");
|
||||
|
||||
jsonIvt2.put("point_status", point_status);
|
||||
jsonIvt2.put("qzzno", qzzno);
|
||||
// 更新分切输送库存状态
|
||||
if (StrUtil.isNotEmpty(jsonTask.getString("vehicle_code"))) {
|
||||
jsonIvt2.put("point_status", "03");
|
||||
jsonIvt2.put("qzzno", jsonTask.getString("vehicle_code"));
|
||||
} else {
|
||||
jsonIvt2.put("point_status", "02");
|
||||
}
|
||||
ivtTab.update(jsonIvt2);
|
||||
jsonIvt.put("point_status", "01");
|
||||
jsonIvt.put("qzzno", "");
|
||||
ivtTab.update(jsonIvt);
|
||||
|
||||
//如果载具横移完成时,判断该气涨轴对应的分切机是否存在出站中的,且终点为空,状态为02的任务,则把该分切机的终点补上,状态改为04并下发
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("vehicle_code = '"+jsonTask.getString("vehicle_code")+"' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
if (task_jo.getString("task_type").equals("010405")) {
|
||||
//入站
|
||||
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task_jo.put("point_code1", jsonTask.getString("point_code2"));
|
||||
}
|
||||
if (task_jo.getString("task_type").equals("010403")) {
|
||||
//出站
|
||||
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task_jo.put("point_code1", jsonTask.getString("point_code2"));
|
||||
task_jo.put("point_code4", jsonTask.getString("point_code2"));
|
||||
}
|
||||
WQLObject.getWQLObject("sch_base_task").update(task_jo);
|
||||
new CutTrussTask().immediateNotifyAcs(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -230,7 +249,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
String point_code2 = form.getString("point_code2");
|
||||
JSONObject point1_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||
JSONObject point2_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
if (!form.getString("task_type").equals("010507")){
|
||||
if (!form.getString("task_type").equals("010507") && !form.getString("task_type").equals("010406")) {
|
||||
if (isSingleTask(point_code1) && !point1_jo.getString("point_type").equals("6") && !point1_jo.getString("point_type").equals("7")) {
|
||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||
}
|
||||
|
||||
@@ -206,6 +206,30 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
plan_row.put("end_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
|
||||
//如果桁架任务执行完,右侧的输送线上存在气涨轴,则生成一个输送出的任务
|
||||
char dtl_type = jsonTask.getString("point_code1").charAt(jsonTask.getString("point_code1").length() - 1);
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 != 0) {
|
||||
String point_location = delivery_point.getString("point_location");
|
||||
String product_area = delivery_point.getString("product_area");
|
||||
String sort_seq = delivery_point.getString("sort_seq");
|
||||
JSONObject right_point = WQL.getWO("PDA_02")
|
||||
.addParam("point_location", point_location)
|
||||
.addParam("point_code", jsonTask.getString("point_code1"))
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("sort_seq", sort_seq)
|
||||
.addParam("find_type", "3")
|
||||
.addParam("flag", "17").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(right_point)){
|
||||
//生成一个输送线出库任务
|
||||
JSONObject form = new JSONObject();
|
||||
form.put("point_code1", jsonTask.getString("point_code1"));
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,16 +257,16 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
String point_code2 = form.getString("point_code2");
|
||||
String point_code3 = form.getString("point_code3");
|
||||
String point_code4 = form.getString("point_code4");
|
||||
if (cutConveyorTask.isSingleTask(point_code1)) {
|
||||
if (cutConveyorTask.isSingleTask(point_code1) && StrUtil.isNotEmpty(point_code1)) {
|
||||
throw new BadRequestException("点位:" + point_code1 + "存在未完成的任务!");
|
||||
}
|
||||
if (cutConveyorTask.isSingleTask(point_code2)) {
|
||||
if (cutConveyorTask.isSingleTask(point_code2) && StrUtil.isNotEmpty(point_code2)) {
|
||||
throw new BadRequestException("点位:" + point_code2 + "存在未完成的任务!");
|
||||
}
|
||||
if (cutConveyorTask.isSingleTask(point_code3)) {
|
||||
if (cutConveyorTask.isSingleTask(point_code3) && StrUtil.isNotEmpty(point_code3)) {
|
||||
throw new BadRequestException("点位:" + point_code3 + "存在未完成的任务!");
|
||||
}
|
||||
if (cutConveyorTask.isSingleTask(point_code4)) {
|
||||
if (cutConveyorTask.isSingleTask(point_code4) && StrUtil.isNotEmpty(point_code4)) {
|
||||
throw new BadRequestException("点位:" + point_code4 + "存在未完成的任务!");
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
@@ -251,7 +275,11 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("vehicle_code2", form.getString("vehicle_code2"));
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
if (StrUtil.isEmpty(form.getString("task_status"))){
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
}else {
|
||||
json.put("task_status", form.getString("task_status"));
|
||||
}
|
||||
json.put("point_code1", form.getString("point_code1"));
|
||||
json.put("point_code2", form.getString("point_code2"));
|
||||
json.put("point_code3", form.getString("point_code3"));
|
||||
|
||||
Reference in New Issue
Block a user