修改
This commit is contained in:
Binary file not shown.
@@ -336,9 +336,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
public JSONObject deviceApply(JSONObject whereJson) {
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String type = whereJson.getString("type");
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("木箱码不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(type)) {
|
||||
throw new BadRequestException("任务类型不能为空!");
|
||||
}
|
||||
@@ -347,11 +344,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||
}
|
||||
if (type.equals("1")) {
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("木箱码不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||
}
|
||||
//贴标申请
|
||||
String print_type = sub_jo.getString("print_type");
|
||||
if (StrUtil.isEmpty(print_type)) {
|
||||
@@ -375,6 +375,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
print_jo.put("print_type", print_info.getString("print_id"));
|
||||
printService.customerPrint(print_jo);
|
||||
} else if (type.equals("2")) {
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("木箱码不能为空!");
|
||||
}
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(sub_jo)) {
|
||||
throw new BadRequestException("未查询到该木箱对应的包装关系!");
|
||||
}
|
||||
//捆扎申请
|
||||
String box_length = sub_jo.getString("box_length");
|
||||
String box_width = sub_jo.getString("box_width");
|
||||
|
||||
@@ -651,7 +651,6 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject childRollCutStartComp(JSONArray param) {
|
||||
log.info("childRollCutStartComp接口输入参数为:-------------------" + param.toString());
|
||||
JSONObject result = new JSONObject();
|
||||
@@ -734,13 +733,15 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String point_code = "";
|
||||
//分切机上只存在一个气涨轴,下一分切组存在两个气涨轴,执行一个进站
|
||||
if (ObjectUtil.isEmpty(up_rows)) {
|
||||
point_code = down_point_code;
|
||||
point_code = up_point_code;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(down_rows)) {
|
||||
point_code = up_point_code;
|
||||
point_code = down_point_code;
|
||||
}
|
||||
//查询当前输送线上可用的气涨轴
|
||||
JSONObject del_row = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("resource_name = '"+ResourceName+"' AND split_group = '"+group_jo.getString("split_group")+"' AND (parent_container_name = '"+group_jo.getString("source_container_name")+"' OR parent_container_name = '"+group_jo.getString("source_container_name")+"') AND status = '03'").uniqueResult(0);
|
||||
JSONObject del_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("qzzno = '"+del_row.getString("qzzno")+"'").uniqueResult(0);
|
||||
del_row.put("delivery_code",del_jo.getString("point_code"));
|
||||
JSONObject whereJson = new JSONObject();
|
||||
whereJson.put("point_code",point_code);
|
||||
whereJson.put("cut_rows",del_row);
|
||||
|
||||
@@ -183,7 +183,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
jsonDtl.put("source_bill_code", json.getString("VGBEL-VGPOS"));
|
||||
jsonDtl.put("vbeln", json.getString("VBELN")); // 来源交货单
|
||||
jsonDtl.put("posnr", json.getString("POSNR")); // 来源交货单行
|
||||
jsonDtl.put("posnr", json.getString("POSNR")); // 幅宽
|
||||
jsonDtl.put("width", json.getString("HL02")); // 幅宽
|
||||
tableData.add(jsonDtl);
|
||||
}
|
||||
if (StrUtil.equals(lfart, "ZLR")) {
|
||||
@@ -258,6 +258,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
map.put("product_name", sub_jo.getString("product_name"));
|
||||
map.put("vbeln", json.getString("VBELN"));
|
||||
map.put("posnr", json.getString("POSNR"));
|
||||
map.put("width", json.getString("HL02"));
|
||||
box_rows.add(map);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ public class BakingServiceImpl implements BakingService {
|
||||
jsonMap.put("flag", "1");
|
||||
jsonMap.put("product_area", jsonPointZc.getString("product_area"));
|
||||
//获取温度幅度
|
||||
jsonMap.put("min_temperature", NumberUtil.sub(temperature, temperature_lose));
|
||||
jsonMap.put("max_temperature", NumberUtil.add(temperature, temperature_lose));
|
||||
jsonMap.put("min_temperature", (NumberUtil.sub(temperature, temperature_lose)).toString());
|
||||
jsonMap.put("max_temperature", (NumberUtil.add(temperature, temperature_lose)).toString());
|
||||
jsonMap.put("point_location", jsonPointZc.getString("point_location"));
|
||||
JSONObject jsonHotIvt = WQL.getWO("PDA_BAKING_01").addParamMap(jsonMap).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有合适温度的空位!");
|
||||
|
||||
@@ -109,7 +109,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")
|
||||
.addParam("sql_str", " ORDER BY abs(" + cut_ivt.getString("sort_seq") + "-sort_seq),point_code desc")
|
||||
.addParam("product_area", cut_ivt.getString("product_area"))
|
||||
.addParam("point_location", cut_ivt.getString("point_location"))
|
||||
.addParam("flag", "3").process().uniqueResult(0);
|
||||
@@ -129,18 +129,9 @@ public class OutServiceImpl implements OutService {
|
||||
String ext_code = cut_ivt.getString("ext_code");
|
||||
|
||||
//查询该机台编号已经配送完成,套轴完成但是未完成的分切计划
|
||||
JSONObject slitting = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("resource_name = '" + ext_code + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND status = '03'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(slitting)) {
|
||||
throw new BadRequestException("该分切机没有下一分切组配送完成的气涨轴!");
|
||||
}
|
||||
|
||||
String qzzno = slitting.getString("qzzno");
|
||||
|
||||
//查询该气涨轴所在输送线位置
|
||||
JSONObject delivery_point = WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").query("qzzno = '" + qzzno + "' AND point_status = '03'").uniqueResult(0);
|
||||
JSONObject delivery_point = WQL.getWO("PDA_02").addParam("ext_code",ext_code).addParam("flag","16").process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(delivery_point)) {
|
||||
throw new BadRequestException("未查询到对应的输送线点位!");
|
||||
throw new BadRequestException("输送线不存在该分切机已经配送完成的气涨轴!");
|
||||
}
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
@@ -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")
|
||||
.addParam("sql_str", " ORDER BY abs("+cut_jo.getString("sort_seq")+"-sort_seq),point_code desc")
|
||||
.addParam("product_area", cut_jo.getString("product_area"))
|
||||
.addParam("point_location", cut_jo.getString("point_location"))
|
||||
.addParam("flag", "3").process().uniqueResult(0);
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
输入.container_name TYPEAS s_string
|
||||
输入.source_container_name TYPEAS s_string
|
||||
输入.resource_name TYPEAS s_string
|
||||
输入.ext_code TYPEAS s_string
|
||||
输入.find_type TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -469,6 +471,62 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "16"
|
||||
QUERY
|
||||
SELECT
|
||||
del.*
|
||||
FROM
|
||||
pdm_bi_slittingproductionplan plan
|
||||
LEFT JOIN st_ivt_deliverypointivt del ON del.qzzno = plan.qzzno
|
||||
WHERE
|
||||
is_child_tz_ok = '1'
|
||||
AND
|
||||
is_child_ps_ok = '1'
|
||||
AND
|
||||
`status` = '03'
|
||||
AND
|
||||
del.point_status = '03'
|
||||
OPTION 输入.ext_code <> ""
|
||||
plan.resource_name = 输入.ext_code
|
||||
ENDOPTION
|
||||
order by del.point_code desc
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "17"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_deliverypointivt ivt
|
||||
WHERE
|
||||
sort_seq = 输入.sort_seq
|
||||
AND
|
||||
product_area = 输入.product_area
|
||||
AND
|
||||
point_location = 输入.point_location
|
||||
AND
|
||||
point_code <> 输入.point_code
|
||||
OPTION 输入.find_type = "1"
|
||||
point_status <> '01'
|
||||
ENDOPTION
|
||||
OPTION 输入.find_type = "2"
|
||||
point_status = '01'
|
||||
ENDOPTION
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code1 = ivt.point_code OR point_code2 = ivt.point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -96,13 +96,39 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
// 校验终点是否存在
|
||||
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
throw new BadRequestException("未找到可用点位:" + point_code2);
|
||||
throw new BadRequestException("未找到可用点位:" + point_code1);
|
||||
}
|
||||
|
||||
// 更新分切输送库存状态
|
||||
jsonIvt.put("point_status", "01");
|
||||
jsonIvt.put("qzzno", "");
|
||||
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");
|
||||
String product_area = jsonIvt.getString("product_area");
|
||||
String sort_seq = jsonIvt.getString("sort_seq");
|
||||
JSONObject right_point = WQL.getWO("PDA_02")
|
||||
.addParam("point_location", point_location)
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("sort_seq", sort_seq)
|
||||
.addParam("find_type", "1")
|
||||
.addParam("flag", "17").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(right_point)) {
|
||||
//创建载具横移任务
|
||||
String translate_code1 = right_point.getString("point_code");
|
||||
String translate_code2 = point_code1;
|
||||
JSONObject tran_jo = new JSONObject();
|
||||
tran_jo.put("point_code1",translate_code1);
|
||||
tran_jo.put("point_code2",translate_code2);
|
||||
tran_jo.put("vehicle_code",jsonTask.getString("vehicle_code"));
|
||||
tran_jo.put("task_type","010406");
|
||||
this.createTask(tran_jo);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jsonTask.getString("task_type").equals("010402")) {
|
||||
// 校验终点是否存在
|
||||
@@ -141,6 +167,44 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
}
|
||||
}
|
||||
|
||||
//判断输送进去的任务终点是否远离分切机,如果远离分切机且靠近分切机的点位上不存在载具且不存在任务进行载具横移
|
||||
char dtl_type = point_code2.charAt(point_code1.length() - 1);
|
||||
if (Integer.valueOf(String.valueOf(dtl_type)) % 2 == 0) {
|
||||
String point_location = jsonIvt.getString("point_location");
|
||||
String product_area = jsonIvt.getString("product_area");
|
||||
String sort_seq = jsonIvt.getString("sort_seq");
|
||||
JSONObject left_point = WQL.getWO("PDA_02")
|
||||
.addParam("point_location", point_location)
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("sort_seq", sort_seq)
|
||||
.addParam("find_type", "2")
|
||||
.addParam("flag", "17").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(left_point)) {
|
||||
//创建载具横移任务
|
||||
String translate_code1 = point_code2;
|
||||
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",jsonTask.getString("vehicle_code"));
|
||||
tran_jo.put("task_type","010406");
|
||||
this.createTask(tran_jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
ivtTab.update(jsonIvt2);
|
||||
jsonIvt.put("point_status", "01");
|
||||
jsonIvt.put("qzzno", "");
|
||||
ivtTab.update(jsonIvt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,8 +324,7 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.immediateNotifyAcs(null);
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ public class InHotTask extends AbstractAcsTask {
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
|
||||
json.put("task_type", "010203");
|
||||
json.put("task_status", "01");
|
||||
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"));
|
||||
|
||||
Reference in New Issue
Block a user