fix:问题优化
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.b_lms.bst.ivt.stockingivt.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -13,12 +14,17 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.b_lms.bst.ivt.papervehicle.service.IMdPbPapervehicleService;
|
import org.nl.b_lms.bst.ivt.papervehicle.service.IMdPbPapervehicleService;
|
||||||
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
|
import org.nl.b_lms.bst.ivt.papervehicle.service.dao.MdPbPapervehicle;
|
||||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
|
||||||
|
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||||
|
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
import org.nl.b_lms.bst.ivt.stockingivt.service.IBstIvtStockingivtService;
|
||||||
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.mapper.BstIvtStockingivtMapper;
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.mapper.BstIvtStockingivtMapper;
|
||||||
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
import org.nl.b_lms.bst.ivt.stockingivt.service.dao.BstIvtStockingivt;
|
||||||
|
import org.nl.wms.basedata.master.service.MaterialbaseService;
|
||||||
|
import org.nl.wms.basedata.master.service.dto.MaterialbaseDto;
|
||||||
|
import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -40,6 +46,10 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
|||||||
private BstIvtStockingivtMapper bstIvtStockingivtMapper;
|
private BstIvtStockingivtMapper bstIvtStockingivtMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMdPbPapervehicleService PapervehicleService;
|
private IMdPbPapervehicleService PapervehicleService;
|
||||||
|
@Autowired
|
||||||
|
private WmsToAcsService wmsToAcsService;
|
||||||
|
@Autowired
|
||||||
|
private MaterialbaseService materialbaseService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<BstIvtStockingivt> queryAll(Map whereJson, PageQuery page) {
|
public IPage<BstIvtStockingivt> queryAll(Map whereJson, PageQuery page) {
|
||||||
@@ -114,7 +124,7 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
|||||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||||
String row_num = jsonObject.getString("row_num");
|
String row_num = jsonObject.getString("row_num");
|
||||||
String material_code = jsonObject.getString("material_code");
|
String material_code = jsonObject.getString("material_code");
|
||||||
String material_name = jsonObject.getString("material_name");
|
|
||||||
|
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
@@ -123,12 +133,70 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
|||||||
//1-绑定;2-清除
|
//1-绑定;2-清除
|
||||||
String type = jsonObject.getString("type");
|
String type = jsonObject.getString("type");
|
||||||
if (type.equals("1")) {
|
if (type.equals("1")) {
|
||||||
|
//
|
||||||
|
MaterialbaseDto mater = materialbaseService.findByCode(material_code);
|
||||||
|
String material_name = mater.getMaterial_name();
|
||||||
|
|
||||||
//查询当前载具和排是否存在库存
|
//查询当前载具和排是否存在库存
|
||||||
MdPbPapervehicle papervehicle = PapervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
MdPbPapervehicle papervehicle = PapervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||||
.eq(MdPbPapervehicle::getRow_num, row_num));
|
.eq(MdPbPapervehicle::getRow_num, row_num));
|
||||||
if (ObjectUtil.isNotEmpty(papervehicle) && !papervehicle.getMaterial_code().equals(material_code)) {
|
if (ObjectUtil.isNotEmpty(papervehicle) && !papervehicle.getMaterial_code().equals(material_code)) {
|
||||||
throw new BadRequestException("当前排物料为【" + papervehicle.getMaterial_code() + "】,与绑定的物料不同,如需要请先清除库存,再进行绑定!");
|
throw new BadRequestException("当前排物料为【" + papervehicle.getMaterial_code() + "】,与绑定的物料不同,如需要请先清除库存,再进行绑定!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取当前纸管的高度
|
||||||
|
// 解析描述数组
|
||||||
|
String[] tubeArray = material_name.split("\\|");
|
||||||
|
|
||||||
|
int currLength = Integer.parseInt(tubeArray[tubeArray.length - 1]);
|
||||||
|
|
||||||
|
//校验高度差要大于50MM,否则不允许进行绑定
|
||||||
|
int num = Integer.parseInt(row_num);
|
||||||
|
if (num == 1) {
|
||||||
|
//只判断第二排的纸管长度
|
||||||
|
int nextNum = num + 1;
|
||||||
|
MdPbPapervehicle nextPaper = PapervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||||
|
.eq(MdPbPapervehicle::getRow_num, nextNum));
|
||||||
|
if (ObjectUtil.isNotEmpty(nextPaper)) {
|
||||||
|
//获取第二排的纸管高度和纸管类型
|
||||||
|
String nextMaterialName = nextPaper.getMaterial_name();
|
||||||
|
String[] nextArray = nextMaterialName.split("\\|");
|
||||||
|
int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||||
|
if (Math.abs(nextLength - currLength) <= 50) {
|
||||||
|
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//判断后一排的纸管高度
|
||||||
|
int nextNum = num + 1;
|
||||||
|
MdPbPapervehicle nextPaper = PapervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||||
|
.eq(MdPbPapervehicle::getRow_num, nextNum));
|
||||||
|
if (ObjectUtil.isNotEmpty(nextPaper)) {
|
||||||
|
//获取后一排的纸管高度和纸管类型
|
||||||
|
String nextMaterialName = nextPaper.getMaterial_name();
|
||||||
|
String[] nextArray = nextMaterialName.split("\\|");
|
||||||
|
int nextLength = Integer.parseInt(nextArray[nextArray.length - 1]);
|
||||||
|
if (Math.abs(nextLength - currLength) <= 50) {
|
||||||
|
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断前一排的纸管高度
|
||||||
|
int preNum = num - 1;
|
||||||
|
MdPbPapervehicle prePaper = PapervehicleService.getOne(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code)
|
||||||
|
.eq(MdPbPapervehicle::getRow_num, preNum));
|
||||||
|
if (ObjectUtil.isNotEmpty(prePaper)) {
|
||||||
|
//获取后一排的纸管高度和纸管类型
|
||||||
|
String preMaterialName = prePaper.getMaterial_name();
|
||||||
|
String[] preArray = preMaterialName.split("\\|");
|
||||||
|
int preLength = Integer.parseInt(preArray[preArray.length - 1]);
|
||||||
|
if (Math.abs(preLength - currLength) <= 50) {
|
||||||
|
throw new BadRequestException("相邻排的纸管高度差要大于等于50MM!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(papervehicle)) {
|
if (ObjectUtil.isNotEmpty(papervehicle)) {
|
||||||
papervehicle.setQty(jsonObject.getBigDecimal("qty"));
|
papervehicle.setQty(jsonObject.getBigDecimal("qty"));
|
||||||
papervehicle.setUpdate_optid(currentUserId);
|
papervehicle.setUpdate_optid(currentUserId);
|
||||||
@@ -148,6 +216,15 @@ public class BstIvtStockingivtServiceImpl extends ServiceImpl<BstIvtStockingivtM
|
|||||||
papervehicle.setUpdate_time(now);
|
papervehicle.setUpdate_time(now);
|
||||||
PapervehicleService.save(papervehicle);
|
PapervehicleService.save(papervehicle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断绑定的纸管是否在机械手范围内,如果存在的话把最新库存推送给电气
|
||||||
|
BstIvtStockingivt bstIvtStockingivt = bstIvtStockingivtMapper.selectOne(new LambdaQueryWrapper<BstIvtStockingivt>().eq(BstIvtStockingivt::getVehicle_code, vehicle_code));
|
||||||
|
if (bstIvtStockingivt != null && bstIvtStockingivt.getPoint_type().equals("1")) {
|
||||||
|
List<MdPbPapervehicle> list = PapervehicleService.list(new LambdaQueryWrapper<MdPbPapervehicle>().eq(MdPbPapervehicle::getVehicle_code, vehicle_code));
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
SlitterTaskUtil.doSavePaperInfos(list, jo);
|
||||||
|
wmsToAcsService.getTubeMsg(jo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.equals("2")) {
|
if (type.equals("2")) {
|
||||||
|
|||||||
@@ -119,6 +119,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
String UpCoilerDate = param.getString("UpCoilerDate");
|
String UpCoilerDate = param.getString("UpCoilerDate");
|
||||||
String IsReloadSend = param.getString("IsReloadSend");
|
String IsReloadSend = param.getString("IsReloadSend");
|
||||||
String Attribute1 = param.getString("Attribute1");
|
String Attribute1 = param.getString("Attribute1");
|
||||||
|
if (StringUtils.isEmpty(Attribute1)) {
|
||||||
|
Attribute1 = "SF2";
|
||||||
|
}
|
||||||
|
|
||||||
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
||||||
WQLObject orderTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
|
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("product_area", jsonPoint.getString("product_area"));
|
||||||
json.put("point_code", jsonPoint.getString("point_code"));
|
json.put("point_code", jsonPoint.getString("point_code"));
|
||||||
if (Attribute1.equals("SF1")) {
|
if (Attribute1.equals("SF1")) {
|
||||||
|
//标箔
|
||||||
json.put("order_type", "1");
|
json.put("order_type", "1");
|
||||||
} else if (Attribute1.equals("SF2")) {
|
} else if (Attribute1.equals("SF2")) {
|
||||||
|
//锂电
|
||||||
json.put("order_type", "2");
|
json.put("order_type", "2");
|
||||||
}
|
}
|
||||||
json.put("realstart_time", DateUtil.now());
|
json.put("realstart_time", DateUtil.now());
|
||||||
@@ -217,6 +222,9 @@ public class MesToLmsServiceImpl implements MesToLmsService {
|
|||||||
String ContainerName = param.getString("ContainerName");
|
String ContainerName = param.getString("ContainerName");
|
||||||
String ResourceName = param.getString("ResourceName");
|
String ResourceName = param.getString("ResourceName");
|
||||||
String Type = param.getString("Type");
|
String Type = param.getString("Type");
|
||||||
|
if (StringUtils.isEmpty(Type)) {
|
||||||
|
Type = "Foil";
|
||||||
|
}
|
||||||
JSONObject raw_jo = new JSONObject();
|
JSONObject raw_jo = new JSONObject();
|
||||||
if (Type.equals("TR")) {
|
if (Type.equals("TR")) {
|
||||||
raw_jo = WQLObject.getWQLObject("PDM_BI_SurProcessOrder").query("container_name ='" + ContainerName + "' AND resource_name = '" + ResourceName + "'").uniqueResult(0);
|
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);
|
JSONObject jsonStor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_code = '" + stor_code + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isEmpty(jsonStor)) {
|
if (ObjectUtil.isEmpty(jsonStor)) {
|
||||||
throw new BadRequestException("仓库不存在:"+stor_code);
|
throw new BadRequestException("仓库不存在:" + stor_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONArray rowsDtl = new JSONArray();
|
JSONArray rowsDtl = new JSONArray();
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class AutoQueryProudDayData {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public void run() {
|
public void run() {
|
||||||
RLock lock = redissonClient.getLock(this.getClass().getName());
|
RLock lock = redissonClient.getLock(this.getClass().getName());
|
||||||
boolean tryLock = lock.tryLock(0,600, TimeUnit.SECONDS);
|
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||||
try {
|
try {
|
||||||
if (tryLock){
|
if (tryLock){
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class AutoSendIvtExcel {
|
|||||||
ToolLocalStorage local = iToolLocalStorageService.getOne(new QueryWrapper<ToolLocalStorage>().eq("name","当天库存报表"));
|
ToolLocalStorage local = iToolLocalStorageService.getOne(new QueryWrapper<ToolLocalStorage>().eq("name","当天库存报表"));
|
||||||
if (ObjectUtil.isNotEmpty(local)){
|
if (ObjectUtil.isNotEmpty(local)){
|
||||||
local.setUpdate_time(DateUtil.now());
|
local.setUpdate_time(DateUtil.now());
|
||||||
iToolLocalStorageService.save(local);
|
iToolLocalStorageService.update(local);
|
||||||
}else {
|
}else {
|
||||||
ToolLocalStorage localStorage = new ToolLocalStorage(
|
ToolLocalStorage localStorage = new ToolLocalStorage(
|
||||||
"当天库存报表.xls",
|
"当天库存报表.xls",
|
||||||
|
|||||||
@@ -96,12 +96,12 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
if (StrUtil.isNotEmpty(whereJson.getString("is_delete"))) {
|
if (StrUtil.isNotEmpty(whereJson.getString("is_delete"))) {
|
||||||
map.put("is_delete", whereJson.getString("is_delete"));
|
map.put("is_delete", whereJson.getString("is_delete"));
|
||||||
}
|
}
|
||||||
//获取人员对应的区域
|
// 获取人员对应的区域
|
||||||
// UserAreaServiceImpl userAreaService = new UserAreaServiceImpl();
|
UserAreaServiceImpl userAreaService = new UserAreaServiceImpl();
|
||||||
// String in_area_id = userAreaService.getInArea();
|
String in_area_id = userAreaService.getInArea();
|
||||||
// if (ObjectUtil.isNotEmpty(in_area_id)) {
|
if (ObjectUtil.isNotEmpty(in_area_id)) {
|
||||||
// map.put("in_area_id", 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");
|
JSONObject json = WQL.getWO("QSCH_TASK_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "update_time desc");
|
||||||
JSONArray content = json.getJSONArray("content");
|
JSONArray content = json.getJSONArray("content");
|
||||||
JSONArray res = new JSONArray();
|
JSONArray res = new JSONArray();
|
||||||
@@ -124,7 +124,7 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
RLock lock = redissonClient.getLock(task_id);
|
RLock lock = redissonClient.getLock(task_id);
|
||||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||||
try {
|
try {
|
||||||
if (tryLock){
|
if (tryLock) {
|
||||||
String method_name = MapUtil.getStr(map, "method_name");
|
String method_name = MapUtil.getStr(map, "method_name");
|
||||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||||
if ("finish".equals(method_name)) {
|
if ("finish".equals(method_name)) {
|
||||||
@@ -184,10 +184,10 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
throw new BadRequestException(e.getMessage());
|
throw new BadRequestException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
throw new BadRequestException("任务标识为:"+task_id+"的任务正在操作中!");
|
throw new BadRequestException("任务标识为:" + task_id + "的任务正在操作中!");
|
||||||
}
|
}
|
||||||
}finally {
|
} finally {
|
||||||
if (tryLock) {
|
if (tryLock) {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,71 @@ public class CutTrussTask extends AbstractAcsTask {
|
|||||||
String task_id = taskObj.getString("task_id");
|
String task_id = taskObj.getString("task_id");
|
||||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
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)) {
|
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||||
// 更新任务状态为执行中
|
// 更新任务状态为执行中
|
||||||
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||||
@@ -198,6 +263,84 @@ public class CutTrussTask extends AbstractAcsTask {
|
|||||||
cutConveyorTask.createTask(form);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,17 +32,17 @@ export function changeActive(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function oneCreate(data) {
|
export function blurQuery(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/structattr/oneCreate',
|
url: 'api/structattr/blurQuery',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function blurQuery(data) {
|
export function oneCreate(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/structattr/blurQuery',
|
url: 'api/structattr/oneCreate',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user