This commit is contained in:
2023-02-25 14:10:46 +08:00
parent 3d8d075f53
commit 7316933ac3
9 changed files with 119 additions and 25 deletions

View File

@@ -233,6 +233,10 @@ public class LmsToMesServiceImpl implements LmsToMesService {
JSONObject jo = new JSONObject();
jo.put("iContainerName", container_name);
jo.put("iisAirSwellAssComplete", 1);
//发送MES运输中
if (StrUtil.isNotEmpty(param.getString("is_send"))) {
jo.put("Attribute1", 1);
}
// String url = acsUrl + api;
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();

View File

@@ -469,15 +469,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
try {
String is_mesTolms = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_mesTolms").getValue();
if (StrUtil.equals(is_mesTolms, "1")) {
String Attribute1 = param.getString("Attribute1");
if (Attribute1.equals("0")) {
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
System.out.println(result);
return result;
}
String container_name = param.getString("ContainerName");
if (StrUtil.isEmpty(container_name)) {
throw new BadRequestException("子卷号不能为空!");
@@ -488,6 +479,23 @@ public class MesToLmsServiceImpl implements MesToLmsService {
if (ObjectUtil.isEmpty(plan_jo)) {
throw new BadRequestException("未查询到该子卷号对应的分切计划!");
}
String Attribute1 = param.getString("Attribute1");
String Attribute2 = param.getString("Attribute2");
if (StrUtil.equals("1", Attribute2)) {
//更新该子卷号对应的分切计划为已呼叫
plan_jo.put("is_call", "1");
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_jo);
}
if (Attribute1.equals("0")) {
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
System.out.println(result);
return result;
}
//查询该分切机对应的点位
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
@@ -700,7 +708,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
if (ObjectUtil.isEmpty(plan_jo)) {
throw new BadRequestException("未查询到分切计划:" + row.getString("ContainerGroup"));
}
//如果入站的分切计划气涨轴为空,则虚拟一个气涨轴编号
//如果入站的分切计划气涨轴为空,则虚拟一个气a涨轴编号
if (StrUtil.isEmpty(plan_jo.getString("qzzno"))) {
if (i == 0 || i == 2) {
plan_jo.put("qzzno", "XN-" + plan_jo.getString("resource_name") + "A");

View File

@@ -39,7 +39,7 @@ public class ShippingController {
}
@PostMapping("/confirm")
@Log("套轴确认")
@Log("配送确认")
@ApiOperation("配送确认")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(shippingService.confirm(whereJson), HttpStatus.OK);

View File

@@ -113,14 +113,6 @@ public class CasingServiceImpl implements CasingService {
}
}
//如果一个分切组只有两个子卷,则一定得分两根轴进行绑定
if (rows.size() == 2 && order_type.equals("1")) {
JSONArray group_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("parent_container_name = '" + parent_container_name + "' AND split_group = '" + split_group + "' AND is_delete = '0'").getResultJSONArray(0);
if (group_rows.size() == 2) {
throw new BadRequestException("该分切组只有两个分切计划,请选择两个不同的轴进行绑定!");
}
}
//查询该气涨轴是否存在已经套轴的分切计划
JSONArray case_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("qzzno = '" + qzzno + "' AND is_delete = '0' AND is_child_tz_ok = '1' AND status < '09'").getResultJSONArray(0);
for (int i = 0; i < case_rows.size(); i++) {
@@ -145,6 +137,14 @@ public class CasingServiceImpl implements CasingService {
throw new BadRequestException("该气涨轴上已经绑定了两个分切计划,无法继续绑定!");
}
//如果一个分切组只有两个子卷,则一定得分两根轴进行绑定
if ((rows.size() == 2 || (rows.size() == 1 && case_rows.size() == 1)) && order_type.equals("1")) {
JSONArray group_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("parent_container_name = '" + parent_container_name + "' AND split_group = '" + split_group + "' AND is_delete = '0'").getResultJSONArray(0);
if (group_rows.size() == 2) {
throw new BadRequestException("该分切组只有两个分切计划,请选择两个不同的轴进行绑定!");
}
}
for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i);

View File

@@ -9,6 +9,7 @@ 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.ext.mes.service.LmsToMesService;
import org.nl.wms.pda.mps.service.CasingService;
import org.nl.wms.pda.mps.service.ShippingService;
import org.nl.wms.sch.tasks.CutConveyorTask;
@@ -141,8 +142,27 @@ public class ShippingServiceImpl implements ShippingService {
if (StrUtil.isNotEmpty(qzzno)) {
map.put("qzzno", qzzno);
}
JSONObject plan_jo = WQL.getWO("PDA_02").addParamMap(map).process().uniqueResult(0);
JSONArray plan = WQL.getWO("PDA_02").addParamMap(map).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(plan)) {
throw new BadRequestException("未找到气涨轴【" + qzzno + "】对应的分切计划!");
}
//判断该气涨轴对应的分切计划是否呼叫,如果没有呼叫不允许配送
//判断该接口是否需要卡MES是否呼叫
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'callNextAssAndMomRoll'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
for (int i = 0; i < plan.size(); i++) {
JSONObject plan_jo = plan.getJSONObject(i);
String is_call = plan_jo.getString("is_call");
if (StrUtil.equals("0", is_call)) {
throw new BadRequestException("子卷号为:" + plan_jo.getString("container_name") + "的分切计划未呼叫,不允许进行配送!");
}
}
}
JSONObject plan_jo = plan.getJSONObject(0);
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + resource_name + "'").uniqueResult(0);
String product_area = cut_jo.getString("product_area");
String point_location = cut_jo.getString("point_location");
@@ -164,6 +184,7 @@ public class ShippingServiceImpl implements ShippingService {
if (ObjectUtil.isEmpty(vehicle_area)) {
throw new BadRequestException("该气涨轴无法放在该载具上!");
}
//查询离该分切计划包含机台最近的一个空点位
JSONObject empty_point = WQL.getWO("PDA_02")
.addParam("sql_str", " ORDER BY abs(" + plan_jo.getString("sort_seq") + "-sort_seq),point_code")
@@ -367,11 +388,11 @@ public class ShippingServiceImpl implements ShippingService {
if (StrUtil.isEmpty(qzzno)) {
throw new BadRequestException("气涨轴不能为空!");
}
JSONObject plan = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("qzzno = '" + qzzno + "'").uniqueResult(0);
JSONArray plan = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("qzzno = '" + qzzno + "'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(plan)) {
throw new BadRequestException("未找到气涨轴【" + qzzno + "】对应的分切计划!");
}
String resource_name = plan.getString("resource_name");
String resource_name = plan.getJSONObject(0).getString("resource_name");
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + resource_name + "'").uniqueResult(0);
String product_area = cut_jo.getString("product_area");
String point_location = cut_jo.getString("point_location");
@@ -394,10 +415,19 @@ public class ShippingServiceImpl implements ShippingService {
}
}
//判断该气涨轴对应的分切计划是否呼叫,如果没有呼叫不允许配送
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'callNextAssAndMomRoll'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
for (int i = 0; i < plan.size(); i++) {
JSONObject plan_jo = plan.getJSONObject(i);
String is_call = plan_jo.getString("is_call");
if (StrUtil.equals("0", is_call)) {
throw new BadRequestException("子卷号为:" + plan_jo.getString("container_name") + "的分切计划未呼叫,不允许进行配送!");
}
}
}
JSONObject jo = new JSONObject();
jo.put("message", "校验无误,可以进行配送!");
return jo;
}
}

View File

@@ -27,6 +27,8 @@
输入.resource_name TYPEAS s_string
输入.ext_code TYPEAS s_string
输入.find_type TYPEAS s_string
输入.point_code1 TYPEAS s_string
输入.point_code2 TYPEAS s_string
[临时表]
@@ -641,6 +643,28 @@
ENDQUERY
ENDIF
IF 输入.flag = "19"
QUERY
SELECT
*
FROM
sch_base_task task
INNER JOIN (
SELECT
ivt.up_point_code
FROM
st_ivt_cutpointivt ivt
WHERE
( ivt.down_point_code = 输入.point_code1 OR ivt.down_point_code = 输入.point_code2 )) a ON a.up_point_code = task.point_code1
OR a.up_point_code = task.point_code2
WHERE
task.is_delete = '0'
AND
task.task_status < '04'
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -103,6 +103,21 @@ public class CutConveyorTask extends AbstractAcsTask {
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
jsonTask.put("update_time", DateUtil.now());
taskTab.update(jsonTask);
//调用MES接口通知MES运输中
LmsToMesService lmsToMesService = SpringContextHolder.getBean(LmsToMesService.class);
JSONArray rows = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_delete ='0' AND status < '09'").getResultJSONArray(0);
for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i);
JSONObject jo = new JSONObject();
jo.put("container_name", row.getString("container_name"));
jo.put("is_send", "1");
//判断该接口是否需要回传
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'airSwellWithPaperTubeAssComplete'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
lmsToMesService.airSwellWithPaperTubeAssComplete(jo);
}
}
}
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {

View File

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Service
@@ -34,7 +35,7 @@ public class CutTrussTask extends AbstractAcsTask {
/*
* 下发给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);
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0' order by task_code").getResultJSONArray(0);
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
for (int i = 0; i < arr.size(); i++) {
@@ -49,6 +50,18 @@ public class CutTrussTask extends AbstractAcsTask {
agv_system_type = "3";
}
//添加过滤如果为分切机B轴的下料位要判断该分切机A轴的点位是否存在未下发的任务存在则也不允许下发
String point_code1 = json.getString("point_code1");
String point_code2 = json.getString("point_code2");
JSONObject task_jo = new JSONObject();
task_jo.put("point_code1", point_code1);
task_jo.put("point_code2", point_code2);
task_jo.put("flag", "19");
JSONObject up_task = WQL.getWO("PDA_02").addParamMap(task_jo).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(up_task)) {
log.info("点位:" + point_code1 + "分切机的A轴存在未完成的任务无法下发分切机B轴的任务");
continue;
}
AcsTaskDto dto = AcsTaskDto.builder()
.ext_task_id(json.getString("task_id"))
.task_code(json.getString("task_code"))