rev:内包间逻辑优化
This commit is contained in:
@@ -1093,7 +1093,33 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
//查询当前输送线入口是否存在可用的载具
|
||||
JSONObject in_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + product_area + "' AND point_type = '6'").uniqueResult(0);
|
||||
String vehicle_code = in_jo.getString("vehicle_code");
|
||||
// JSONObject vehicle_jo = WQLObject.getWQLObject("md_pb_vehiclearea").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(vehicle_code)) {
|
||||
//判断是否存在010606 的任务存在
|
||||
JSONObject in_task = WQLObject.getWQLObject("sch_base_task").query("task_type = '010606' AND product_area = '" + product_area + "' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(in_task)) {
|
||||
JSONObject vehicle_jo = WQLObject.getWQLObject("md_pb_vehiclearea").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if (vehicle_jo.getString("point_location").equals(point_location)) {
|
||||
//创建一个从套管工位到IN点的任务
|
||||
JSONObject tggw_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '4'").uniqueResult(0);
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("task_type", "010606");
|
||||
jo.put("truss_type", "1");
|
||||
jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
jo.put("point_code1", tggw_jo.getString("point_code"));
|
||||
jo.put("point_code2", in_jo.getString("point_code"));
|
||||
JSONObject request_param = new JSONObject();
|
||||
request_param.put("container_name1", task_resq.getString("container_name1"));
|
||||
request_param.put("container_name2", task_resq.getString("container_name2"));
|
||||
jo.put("request_param", request_param);
|
||||
jo.put("vehicle_code", task_resq.getString("container_name1"));
|
||||
jo.put("product_area", product_area);
|
||||
paperTrussTask.createTask(jo);
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
//todo:如果缓存位有可用库位,创建一个桁架任务从穿拔轴位到缓存位,否则不动
|
||||
JSONObject tz_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '2' AND have_qzz = '0' order by sort_seq").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(tz_jo)) {
|
||||
@@ -1113,6 +1139,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
request_param.put("container_name2", task_resq.getString("container_name2"));
|
||||
jo.put("request_param", request_param.toString());
|
||||
paperTrussTask.createTask(jo);
|
||||
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "反馈成功!");
|
||||
return result;
|
||||
} else {
|
||||
noticeService.createNotice("套轴气胀轴缓存架空位不足", "套轴气胀轴缓存架空位不足"
|
||||
, NoticeTypeEnum.WARN.getCode());
|
||||
@@ -1310,12 +1340,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
paperTrussTask.immediateNotifyAcs(null);
|
||||
}
|
||||
} else {
|
||||
//未查询到需要搬运的气胀轴,创建空载具入库任务
|
||||
ShippingService shippingService = SpringContextHolder.getBean(ShippingService.class);
|
||||
JSONObject ship_jo = new JSONObject();
|
||||
ship_jo.put("vehicle_code", vehicle_code);
|
||||
ship_jo.put("point_code", in_jo.getString("point_code"));
|
||||
shippingService.returnVehicle(ship_jo);
|
||||
//判断在等待任务数量范围内是否存在符合的纸管,如果存在则等待,不存在则创建空载具入库任务
|
||||
boolean need_wait = this.judgeWait(product_area, vehicle_jo);
|
||||
if (!need_wait) {
|
||||
//未查询到需要搬运的气胀轴,创建空载具入库任务
|
||||
ShippingService shippingService = SpringContextHolder.getBean(ShippingService.class);
|
||||
JSONObject ship_jo = new JSONObject();
|
||||
ship_jo.put("vehicle_code", vehicle_code);
|
||||
ship_jo.put("point_code", in_jo.getString("point_code"));
|
||||
shippingService.returnVehicle(ship_jo);
|
||||
} else {
|
||||
in_jo.put("vehicle_code", vehicle_code);
|
||||
WQLObject.getWQLObject("sch_base_point").update(in_jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1325,6 +1362,40 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean judgeWait(String product_area, JSONObject vehicle_jo) {
|
||||
boolean need_wait = false;
|
||||
JSONArray task_rows = WQL.getWO("QAUTO_QUERY").addParam("flag", "8").addParam("product_area", product_area).process().getResultJSONArray(0);
|
||||
//取当前
|
||||
String point_location = vehicle_jo.getString("point_location");
|
||||
String task_num = "";
|
||||
if ("0".equals(point_location)) {
|
||||
task_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("up_task_num").getValue();
|
||||
}
|
||||
if ("1".equals(point_location)) {
|
||||
task_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("down_task_num").getValue();
|
||||
}
|
||||
int limit_num = Integer.parseInt(task_num);
|
||||
//判断当前可用的空位是多少,MAX=5(4个缓存货架+1个套管工位)
|
||||
JSONArray hchj_ja = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '2' AND is_used = '1' AND have_qzz = '0'").getResultJSONArray(0);
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_type = '010607' AND product_area = '" + product_area + "' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
|
||||
int min_num = 0;
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
min_num = Math.min(limit_num, hchj_ja.size());
|
||||
} else {
|
||||
min_num = Math.min(limit_num, (hchj_ja.size() + 1));
|
||||
}
|
||||
min_num = Math.min(task_rows.size(), min_num);
|
||||
for (int i = 0; i < min_num; i++) {
|
||||
JSONObject jo = task_rows.getJSONObject(i);
|
||||
if (jo.getString("point_location").equals(point_location)) {
|
||||
need_wait = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return need_wait;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject shipDeviceUpdate(JSONObject whereJson) {
|
||||
|
||||
@@ -120,7 +120,9 @@ public class PaperTubeTask extends AbstractAcsTask {
|
||||
String have_qzz = cbz_jo.getString("have_qzz");
|
||||
//判断当前RGV上是否存在未拔轴的成品卷
|
||||
JSONObject rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '5' AND product_area = '" + product_area + "'").uniqueResult(0);
|
||||
if ("0".equals(have_qzz) && "0".equals(rgv_jo.getString("have_qzz"))) {
|
||||
//判断是否存在未完成的成品下卷任务
|
||||
JSONObject container_jo = WQLObject.getWQLObject("sch_base_task").query("task_type = '010605' AND product_area = '"+product_area+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if ("0".equals(have_qzz) && "0".equals(rgv_jo.getString("have_qzz")) && ObjectUtil.isEmpty(container_jo)) {
|
||||
PaperTrussTask paperTrussTask = SpringContextHolder.getBean(PaperTrussTask.class);
|
||||
//todo:创建桁架任务搬运一个符合的气涨轴
|
||||
JSONObject jo = new JSONObject();
|
||||
@@ -149,7 +151,7 @@ public class PaperTubeTask extends AbstractAcsTask {
|
||||
String device_code = cbz_jo.getString("point_code");
|
||||
//判断是否存在任务
|
||||
JSONObject paper_jo = WQLObject.getWQLObject("sch_base_task").query("point_code1 = '" + device_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(paper_jo)) {
|
||||
if (ObjectUtil.isEmpty(paper_jo)) {
|
||||
//给穿拔轴机下发套轴
|
||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
JSONArray action_rows = new JSONArray();
|
||||
|
||||
@@ -58,7 +58,12 @@
|
||||
AND IFNULL( call_time, '' ) <> ''
|
||||
AND is_delete = '0'
|
||||
AND cut.product_area = 输入.product_area
|
||||
AND cut.point_location = 输入.point_location
|
||||
OPTION 输入.point_location <> ""
|
||||
cut.point_location = 输入.point_location
|
||||
ENDOPTION
|
||||
OPTION 输入.is_paper_ok <> ""
|
||||
plan.is_paper_ok = 输入.is_paper_ok
|
||||
ENDOPTION
|
||||
GROUP BY
|
||||
parent_container_name,
|
||||
split_group UNION
|
||||
@@ -240,4 +245,24 @@
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "8"
|
||||
QUERY
|
||||
SELECT
|
||||
ivt.point_location
|
||||
FROM
|
||||
sch_base_task task
|
||||
LEFT JOIN pdm_bi_slittingproductionplan plan ON plan.container_name = task.vehicle_code AND plan.is_delete = '0'
|
||||
LEFT JOIN st_ivt_cutpointivt ivt ON ivt.ext_code = plan.resource_name
|
||||
WHERE
|
||||
task.task_type = '010601'
|
||||
AND
|
||||
task.product_area = 输入.product_area
|
||||
AND
|
||||
task.is_delete = '0'
|
||||
AND
|
||||
task.task_status < '07'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -129,6 +129,12 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷号1">
|
||||
<el-input v-model="form.container_name1" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="子卷号2">
|
||||
<el-input v-model="form.container_name2" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序号" prop="sort_seq">
|
||||
<el-input v-model="form.sort_seq" style="width: 370px;" disabled/>
|
||||
</el-form-item>
|
||||
@@ -152,14 +158,16 @@
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="point_code" label="点位编码" width="100px" />
|
||||
<el-table-column prop="have_qzz" label="轴数量" />
|
||||
<el-table-column prop="qzz_generation" label="代数" />
|
||||
<el-table-column prop="qzz_size" label="尺寸" />
|
||||
<el-table-column prop="product_area" label="生产区域">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.product_area[scope.row.product_area] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="have_qzz" label="轴数量" />
|
||||
<el-table-column prop="qzz_generation" label="代数" />
|
||||
<el-table-column prop="qzz_size" label="尺寸" />
|
||||
<el-table-column prop="container_name1" label="子卷号1" />
|
||||
<el-table-column prop="container_name2" label="子卷号2" />
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.is_used[scope.row.is_used] }}
|
||||
@@ -197,6 +205,8 @@ const defaultForm = {
|
||||
have_qzz: null,
|
||||
qzz_generation: null,
|
||||
qzz_size: null,
|
||||
container_name1: null,
|
||||
container_name2: null,
|
||||
point_location: null,
|
||||
sort_seq: null,
|
||||
is_used: null,
|
||||
|
||||
Reference in New Issue
Block a user