fix:问题优化
This commit is contained in:
@@ -119,6 +119,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String UpCoilerDate = param.getString("UpCoilerDate");
|
||||
String IsReloadSend = param.getString("IsReloadSend");
|
||||
String Attribute1 = param.getString("Attribute1");
|
||||
if (StringUtils.isEmpty(Attribute1)) {
|
||||
Attribute1 = "SF2";
|
||||
}
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
||||
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
||||
@@ -171,8 +174,10 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
json.put("product_area", jsonPoint.getString("product_area"));
|
||||
json.put("point_code", jsonPoint.getString("point_code"));
|
||||
if (Attribute1.equals("SF1")) {
|
||||
//标箔
|
||||
json.put("order_type", "1");
|
||||
} else if (Attribute1.equals("SF2")) {
|
||||
//锂电
|
||||
json.put("order_type", "2");
|
||||
}
|
||||
json.put("realstart_time", DateUtil.now());
|
||||
@@ -217,6 +222,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
String ContainerName = param.getString("ContainerName");
|
||||
String ResourceName = param.getString("ResourceName");
|
||||
String Type = param.getString("Type");
|
||||
if (StringUtils.isEmpty(Type)) {
|
||||
Type = "Foil";
|
||||
}
|
||||
JSONObject raw_jo = new JSONObject();
|
||||
if (Type.equals("TR")) {
|
||||
raw_jo = WQLObject.getWQLObject("PDM_BI_SurProcessOrder").query("container_name ='" + ContainerName + "' AND resource_name = '" + ResourceName + "'").uniqueResult(0);
|
||||
@@ -1280,7 +1288,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
||||
|
||||
JSONObject jsonStor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_code = '" + stor_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonStor)) {
|
||||
throw new BadRequestException("仓库不存在:"+stor_code);
|
||||
throw new BadRequestException("仓库不存在:" + stor_code);
|
||||
}
|
||||
|
||||
JSONArray rowsDtl = new JSONArray();
|
||||
|
||||
@@ -36,7 +36,7 @@ public class AutoQueryProudDayData {
|
||||
@SneakyThrows
|
||||
public void run() {
|
||||
RLock lock = redissonClient.getLock(this.getClass().getName());
|
||||
boolean tryLock = lock.tryLock(0,600, TimeUnit.SECONDS);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock){
|
||||
JSONObject param = new JSONObject();
|
||||
|
||||
@@ -122,7 +122,7 @@ public class AutoSendIvtExcel {
|
||||
ToolLocalStorage local = iToolLocalStorageService.getOne(new QueryWrapper<ToolLocalStorage>().eq("name","当天库存报表"));
|
||||
if (ObjectUtil.isNotEmpty(local)){
|
||||
local.setUpdate_time(DateUtil.now());
|
||||
iToolLocalStorageService.save(local);
|
||||
iToolLocalStorageService.update(local);
|
||||
}else {
|
||||
ToolLocalStorage localStorage = new ToolLocalStorage(
|
||||
"当天库存报表.xls",
|
||||
|
||||
@@ -96,12 +96,12 @@ public class TaskServiceImpl implements TaskService {
|
||||
if (StrUtil.isNotEmpty(whereJson.getString("is_delete"))) {
|
||||
map.put("is_delete", whereJson.getString("is_delete"));
|
||||
}
|
||||
//获取人员对应的区域
|
||||
// UserAreaServiceImpl userAreaService = new UserAreaServiceImpl();
|
||||
// String in_area_id = userAreaService.getInArea();
|
||||
// if (ObjectUtil.isNotEmpty(in_area_id)) {
|
||||
// map.put("in_area_id", in_area_id);
|
||||
// }
|
||||
// 获取人员对应的区域
|
||||
UserAreaServiceImpl userAreaService = new UserAreaServiceImpl();
|
||||
String in_area_id = userAreaService.getInArea();
|
||||
if (ObjectUtil.isNotEmpty(in_area_id)) {
|
||||
map.put("in_area_id", in_area_id);
|
||||
}
|
||||
JSONObject json = WQL.getWO("QSCH_TASK_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "update_time desc");
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
JSONArray res = new JSONArray();
|
||||
@@ -124,7 +124,7 @@ public class TaskServiceImpl implements TaskService {
|
||||
RLock lock = redissonClient.getLock(task_id);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock){
|
||||
if (tryLock) {
|
||||
String method_name = MapUtil.getStr(map, "method_name");
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
if ("finish".equals(method_name)) {
|
||||
@@ -184,10 +184,10 @@ public class TaskServiceImpl implements TaskService {
|
||||
throw new BadRequestException(e.getMessage());
|
||||
}
|
||||
}
|
||||
}else {
|
||||
throw new BadRequestException("任务标识为:"+task_id+"的任务正在操作中!");
|
||||
} else {
|
||||
throw new BadRequestException("任务标识为:" + task_id + "的任务正在操作中!");
|
||||
}
|
||||
}finally {
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
@@ -85,6 +85,71 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 更新删除字段
|
||||
jsonTask.put("is_delete", "1");
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
//桁架标准任务
|
||||
if ("010403".equals(jsonTask.getString("task_type"))) {
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status IN ('04','05')").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "状态为:入站中或入站完成的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo.size(); i++) {
|
||||
JSONObject plan_row = plan_jo.getJSONObject(i);
|
||||
plan_row.put("status", "03");
|
||||
plan_row.put("end_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
|
||||
//更新出站气涨轴的分切计划状态
|
||||
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code2") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '06'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo2)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code2") + "状态为:出站中的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo2.size(); i++) {
|
||||
JSONObject plan_row = plan_jo2.getJSONObject(i);
|
||||
plan_row.put("status", "05");
|
||||
plan_row.put("end_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
}
|
||||
|
||||
//分切>输送线 子卷出站
|
||||
if ("010404".equals(jsonTask.getString("task_type"))) {
|
||||
if (!jsonTask.getString("vehicle_code").contains("废箔")) {
|
||||
//更新出站气涨轴的分切计划状态
|
||||
JSONArray plan_jo2 = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status = '06'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo2)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "状态为:出站中的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo2.size(); i++) {
|
||||
JSONObject plan_row = plan_jo2.getJSONObject(i);
|
||||
plan_row.put("status", "05");
|
||||
plan_row.put("end_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
}
|
||||
}
|
||||
//分切>输送线 子卷入站
|
||||
if ("010405".equals(jsonTask.getString("task_type"))) {
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status IN ('04','05') ").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "状态为:入站中或入站完成的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo.size(); i++) {
|
||||
JSONObject plan_row = plan_jo.getJSONObject(i);
|
||||
plan_row.put("status", "03");
|
||||
plan_row.put("end_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
@@ -198,6 +263,84 @@ public class CutTrussTask extends AbstractAcsTask {
|
||||
cutConveyorTask.createTask(form);
|
||||
}
|
||||
|
||||
if ("010405".equals(jsonTask.getString("task_type"))) {
|
||||
//更新输送线的气涨轴编码
|
||||
JSONObject delivery_point = WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(delivery_point)) {
|
||||
throw new BadRequestException("未查询到对应的输送线点位!");
|
||||
}
|
||||
delivery_point.put("qzzno", "");
|
||||
delivery_point.put("point_status", "02");
|
||||
WQLObject.getWQLObject("ST_IVT_DeliveryPointIvt").update(delivery_point);
|
||||
|
||||
//更新入站气涨轴的分切计划状态
|
||||
JSONArray plan_jo = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete = '0' AND status IN ('04','05') ").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_jo)) {
|
||||
throw new BadRequestException("未查询到气涨轴:" + jsonTask.getString("vehicle_code") + "对应的分切计划!");
|
||||
}
|
||||
for (int i = 0; i < plan_jo.size(); i++) {
|
||||
JSONObject plan_row = plan_jo.getJSONObject(i);
|
||||
plan_row.put("status", "05");
|
||||
plan_row.put("end_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(plan_row);
|
||||
}
|
||||
|
||||
//如果桁架任务执行完,右侧的输送线上存在气涨轴,则生成一个输送出的任务,防止左侧空载具挡住右侧气涨轴进行横移
|
||||
log.debug("如果桁架任务执行完,缓存位的输送线上存在气涨轴,则对上料位的空载具生成一个输送出的任务");
|
||||
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)) {
|
||||
log.debug("生成一个输送线出库任务");
|
||||
//生成一个输送线出库任务
|
||||
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"));
|
||||
if (StrUtil.isEmpty(delivery_point.getString("vehicle_code"))) {
|
||||
throw new BadRequestException("点位:" + delivery_point.getString("point_code") + "载具号为空!");
|
||||
}
|
||||
form.put("vehicle_code2", delivery_point.getString("vehicle_code"));
|
||||
//分切输送出
|
||||
form.put("task_type", "010401");
|
||||
form.put("product_area", delivery_point.getString("product_area"));
|
||||
cutConveyorTask.createTask(form);
|
||||
} else {
|
||||
|
||||
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", "4")
|
||||
.addParam("flag", "18").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(right_point)) {
|
||||
//判断对应缓存位是否存在需要末次下卷或者废箔下卷的任务
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("vehicle_code2 = '" + right_point.getString("vehicle_code") + "' AND is_delete = '0' AND task_status = '02'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)) {
|
||||
if ("010404".equals(task_jo.getString("task_type"))) {
|
||||
//出站
|
||||
task_jo.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task_jo.put("point_code2", jsonTask.getString("point_code1"));
|
||||
task_jo.put("vehicle_code2", delivery_point.getString("vehicle_code"));
|
||||
WQLObject.getWQLObject("sch_base_task").update(task_jo);
|
||||
new CutTrussTask().immediateNotifyAcs(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user