Merge remote-tracking branch 'origin/master_merge' into master_merge

This commit is contained in:
zhouz
2024-07-08 17:28:03 +08:00
9 changed files with 185 additions and 37 deletions

View File

@@ -105,6 +105,7 @@
FROM bst_ivt_cutpointivt bc
LEFT JOIN pdm_bi_slittingproductionplan p ON p.qzzno = bc.qzz_no1 OR p.qzzno = bc.qzz_no2
WHERE bc.point_type IN ('1', '3') AND bc.point_status = '2'
AND (IFNULL(bc.qzz_no1,'') <![CDATA[ <> ]]> '' OR IFNULL(bc.qzz_no2,'') <![CDATA[ <> ]]> '')
AND p.resource_name = #{resource_name}
</select>

View File

@@ -183,7 +183,6 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
String bill_type = whereJson.getString("bill_type");
whereJson.put("material_barcode", whereJson.getString("box_no"));
whereJson.put("device_code", whereJson.getString("point_code"));
//todo 检查 1-返检入库2-改切入库
if (bill_type.equals("1")) {
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("返检入库"));
} else if (bill_type.equals("2")) {

View File

@@ -298,12 +298,15 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
.or()
.eq(SchBaseTask::getTask_type, PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)")
)));
// if (CollectionUtils.isNotEmpty(taskList)) {
// //todo 桁架任务取空载具动作完成
// if (!taskList.get(0).getRequest_param().equals(IOSEnum.IS_SEND.code("是"))) {
// throw new BadRequestException("请等待桁架任务取空载具动作执行完成,再分配空载具点位");
// }
// }
if (CollectionUtils.isNotEmpty(taskList)) {
if (StringUtils.isBlank(taskList.get(0).getRequest_param())) {
throw new BadRequestException("请等待桁架任务取空载具动作执行完成,再分配空载具点位");
} else {
if (!taskList.get(0).getRequest_param().equals(PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成"))) {
throw new BadRequestException("请等待桁架任务取空载具动作执行完成,再分配空载具点位");
}
}
}
newPoint = checkIvtSBlock();
} else {
newPoint = getBstIvtPackageinfoivt(actionType, taskPointType, baseTask);
@@ -348,7 +351,6 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区")) ||
baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("输送线四个点任务")) ||
baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))) {
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
//取满轴
if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("满轴缓存位->待检区"))) {
List<BstIvtPackageinfoivt> ivtList = packageinfoivtService.list(new LambdaQueryWrapper<BstIvtPackageinfoivt>()
@@ -359,21 +361,17 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
}
//只有子卷号相同才能清除库存
if (baseTask.getVehicle_code().equals(ivtList.get(0).getContainer_name())) {
updateWrapper.eq("point_code", baseTask.getPoint_code1());
upDateIvtOrTask(baseTask, baseTask.getPoint_code1(), false);
}
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("输送线四个点任务"))) {
//取空轴
updateWrapper.eq("point_code", baseTask.getPoint_code3());
upDateIvtOrTask(baseTask, baseTask.getPoint_code3(), true);
} else if (baseTask.getTask_type().equals(PackageInfoIvtEnum.TASK_TYPE.code("放空(空载具缓存位->输送线)"))) {
//取空轴
updateWrapper.eq("point_code", baseTask.getPoint_code1());
upDateIvtOrTask(baseTask, baseTask.getPoint_code1(), true);
}
updateWrapper.setSql("ivt_status = '0', container_name = null");
//清空起点库存状态
bstIvtPackageinfoivtMapper.update(null, updateWrapper);
//标记桁架任务取空载具完成
baseTask.setRequest_param(IOSEnum.IS_SEND.code(""));
taskService.update();
}
} else {
//放货任务
@@ -395,6 +393,25 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
}
}
/**
* 取货完成更新点位或任务标识
*/
private void upDateIvtOrTask(SchBaseTask baseTask, String pointCode, boolean isUpDateTask) {
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("point_code", pointCode);
updateWrapper.setSql("ivt_status = '0', container_name = null");
if (isUpDateTask) {
//清空起点库存状态
bstIvtPackageinfoivtMapper.update(null, updateWrapper);
//标记桁架任务取空载具完成
UpdateWrapper<SchBaseTask> updateWrapper1 = new UpdateWrapper<>();
updateWrapper1.eq("task_id", baseTask.getTask_id());
updateWrapper1.set("request_param", PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成"));
taskService.update(updateWrapper1);
}
}
private BstIvtPackageinfoivt getBstIvtPackageinfoivt(String actionType, String taskPointType, SchBaseTask baseTask) {
BstIvtPackageinfoivt newPoint;
//1取货任务2放货任务

View File

@@ -121,8 +121,6 @@ public class AutoSendVehicleToKzj {
} else {
pointCode2 = kzjIvtList.get(0).getPoint_code();
}
//待检区有空载具且过滤未完成任务
List<BstIvtPackageinfoivt> djqPackageinfoivtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("待检区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), PackageInfoIvtEnum.SORT_TYPE.code("升序"), "");
if (CollectionUtils.isNotEmpty(djqPackageinfoivtList)) {

View File

@@ -57,12 +57,11 @@ import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.getPointLocationInCutDevice;
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.getNumberByResourceCode;
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.getPointLocationInCutDevice;
/**
* @author lyd
@@ -267,12 +266,17 @@ public class SlitterServiceImpl implements SlitterService {
boolean tryLockPointR = lockPointR.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLockPointR) {
List<PdmBiSlittingproductionplan> planTemp = slittingproductionplanService.list(
new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
.in(PdmBiSlittingproductionplan::getContainer_name, collect));
PdmBiSlittingproductionplan tempPlan = planTemp.get(0);
// 需要枷锁
JSONObject exParam = new JSONObject();
exParam.put("point_code1", startPoint.getPoint_code());
exParam.put("point_code2", exceptionPoint.getPoint_code());
exParam.put("vehicle_code1", "-");
exParam.put("vehicle_code2", "-");
exParam.put("point_code2", SlitterConstant.SLITTER_SHAFT_UP.equals(tempPlan.getUp_or_down())
? exceptionPoint.getTruss_point_code1() : exceptionPoint.getTruss_point_code2());
exParam.put("vehicle_code1", SlitterTaskUtil.getQzzNoByUpOrDown(tempPlan));
exParam.put("vehicle_code2", SlitterTaskUtil.getQzzNoByUpOrDown(tempPlan));
exParam.put("task_type", SlitterEnum.TASK_TYPE.code("套轴异常处理桁架任务"));
exParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
sendNBJExceptionPointTask.createTask(exParam);

View File

@@ -273,4 +273,17 @@ public class SlitterTaskUtil {
}
return res;
}
/**
* 通过分切计划的上下轴返回对应的气胀轴编码
* @param plan 分切机
* @return 气胀轴编码或者"-"
*/
public static String getQzzNoByUpOrDown(PdmBiSlittingproductionplan plan) {
if (SlitterConstant.SLITTER_SHAFT_UP.equals(plan.getUp_or_down())) {
return plan.getQzzno();
} else {
return "-";
}
}
}

View File

@@ -47,4 +47,24 @@ public interface StorPublicService {
void updateStructAndPoint(JSONObject from);
void updateStructAndPoint2(JSONObject from);
/**
* 出入库仓位点位更新 - 二期
*
* @param from 仓位点位变动信息
* {
* struct_id 仓位id
* point_code ,点位编码
* lock_type ,锁定类型
* storagevehicle_code ,载具编码
* is_free是否清除载具(1是0或缺省为否)
* taskdtl_type锁定任务类型
* taskdtl_id锁定任务明细标识
* task_code锁定任务编码
* inv_type锁定单据类型
* inv_id锁定单据标识
* inv_code锁定单据编码
* }
*/
void updateStructAndPointTwo(JSONObject from);
}

View File

@@ -567,4 +567,70 @@ public class StorPublicServiceImpl implements StorPublicService {
wo_Point.update(map, "point_id = '" + jo.getString("point_id") + "'");
}
@Override
public void updateStructAndPointTwo(JSONObject from) {
//货位表
WQLObject wo_Struct = WQLObject.getWQLObject("ST_IVT_StructAttr");
//点位表
WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point");
//载具表
WQLObject wo_Storage = WQLObject.getWQLObject("MD_PB_StorageVehicleInfo");
String struct_id = from.getString("struct_id");
String point_code = from.getString("point_code");
//锁定类型
String lock_type = from.getString("lock_type");
//载具编码
String storagevehicle_code = from.getString("storagevehicle_code");
String is_overdue = from.getString("is_overdue");
if (StrUtil.isEmpty(struct_id) && StrUtil.isEmpty(point_code)) {
throw new BadRequestException("点位仓位更新出入参数异常!");
}
if (StrUtil.isEmpty(lock_type)) {
throw new BadRequestException("点位仓位更新出入参数异常!");
}
HashMap<String, String> map = new HashMap<>();
if ("1".equals(lock_type)) {//解锁
map.put("lock_type", lock_type);
map.put("task_code", "");
map.put("inv_type", "");
map.put("inv_id", "");
map.put("inv_code", "");
map.put("point_status", "1");
map.put("storagevehicle_code", "");
map.put("vehicle_code", "");
if (from.containsKey("is_free") && !"1".equals(from.getString("is_free")) && StrUtil.isNotEmpty(storagevehicle_code)) {
map.put("storagevehicle_code", storagevehicle_code);
map.put("storagevehicle_qty", "1");
map.put("vehicle_code", storagevehicle_code);
map.put("point_status", "01");
}
if ("1".equals(from.getString("is_overdue")) && StrUtil.isNotEmpty(is_overdue)) {
map.put("storagevehicle_code", storagevehicle_code);
}
if (ObjectUtil.isNotEmpty(from.getString("bill_type"))) {
if (from.getString("bill_type").equals("1011")){
map.put("storagevehicle_code", storagevehicle_code);
}
}
wo_Struct.update(map, "struct_id = '" + struct_id + "'");
} else {//锁定
map.put("lock_type", lock_type);
map.put("taskdtl_type", from.getString("task_type"));
map.put("taskdtl_id", from.getString("task_id"));
map.put("task_code", from.getString("task_code"));
map.put("inv_type", from.getString("inv_type"));
map.put("inv_id", from.getString("inv_id"));
map.put("inv_code", from.getString("inv_code"));
if (StrUtil.isNotEmpty(storagevehicle_code)) {
map.put("storagevehicle_code", storagevehicle_code);
map.put("storagevehicle_qty", "1");
map.put("vehicle_code", storagevehicle_code);
map.put("point_status", "01");
}
}
wo_Struct.update(map, "struct_id = '" + struct_id + "'");
}
}

View File

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.CodeUtil;
@@ -605,13 +606,17 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
jo.put("turnin_struct_id", turnin_struct_id);
jo.put("turnin_struct_code", row.getString("turnin_struct_code"));
jo.put("turnin_struct_name", row.getString("turnin_struct_name"));
//查询移入点位
JSONObject point = wo_Point.query("source_id='" + turnin_struct_id + "'").uniqueResult(0);
if (point == null) {
throw new BadRequestException(row.getString("turnin_struct_code") + "仓位数据异常,找不到对应点位!");
//查询移入点位 - 如果是二期的就不用查询
JSONObject point = new JSONObject();
if(!jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
point = wo_Point.query("source_id='" + turnin_struct_id + "'").uniqueResult(0);
if (point == null) {
throw new BadRequestException(row.getString("turnin_struct_code") + "仓位数据异常,找不到对应点位!");
}
}
//判断是否已生成过了任务,无未生成则插入任务
JSONObject task = wo_Task.query("is_delete = '0' and task_status='04' and point_code1 ='" + jo.getString("start_point_code") + "'").uniqueResult(0);
JSONObject task = wo_Task.query("is_delete = '0' and task_status='04' and point_code1 ='" + jo.getString("turnout_struct_code") + "'").uniqueResult(0);
if (task != null || "0".equals(is_task)) {
jo.put("task_id", task.getString("task_id"));
} else {
@@ -621,11 +626,19 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
task.put("task_id", task_id);
task.put("task_code", task_code);
task.put("task_type", "010505");
if(!jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
task.put("task_type", "010505");
} else {
task.put("task_type", "010709");
}
task.put("acs_task_type", "7");
task.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task.put("point_code1", jo.getString("start_point_code"));
task.put("point_code2", point.getString("point_code"));
task.put("point_code1", jo.getString("turnout_struct_code"));
if(!jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
task.put("point_code2", point.getString("point_code"));
} else {
task.put("point_code2", row.getString("turnin_struct_code"));
}
task.put("vehicle_code", jo.getString("storagevehicle_code"));
task.put("handle_class", HandMoveStorAcsTask.class.getName());
task.put("finished_type", "");
@@ -668,11 +681,21 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
from_start.put("taskdtl_type", task.getString("taskdtl_type"));
from_start.put("taskdtl_id", task.getString("taskdtl_id"));
from_start.put("task_code", task.getString("task_code"));
storPublicService.updateStructAndPoint(from_start);
if(!jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
storPublicService.updateStructAndPoint(from_start);
} else {
storPublicService.updateStructAndPointTwo(from_start);
}
//锁定终点点位、仓位
from_start.put("struct_id", turnin_struct_id);
from_start.put("lock_type", "7");
storPublicService.updateStructAndPoint(from_start);
if(!jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
storPublicService.updateStructAndPoint(from_start);
} else {
storPublicService.updateStructAndPointTwo(from_start);
}
}
ret.put("total_qty", total_qty);
ret.put("detail_count", ja.size());
@@ -970,15 +993,22 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
from_start.put("lock_type", "1");
from_start.put("storagevehicle_code", jo.getString("storagevehicle_code"));
from_start.put("struct_id", jo.getString("turnout_struct_id"));
storPublicService.updateStructAndPoint(from_start);
if (form.getString("turnout_sect_code").equals("BZC01")) {
storPublicService.updateStructAndPointTwo(from_start);
} else {
storPublicService.updateStructAndPoint(from_start);
}
//解锁终点点位、仓位,添加载具
JSONObject from_end = new JSONObject();
from_end.put("lock_type", "1");
from_end.put("struct_id", jo.getString("turnin_struct_id"));
from_end.put("is_free", "0");
from_end.put("storagevehicle_code", jo.getString("storagevehicle_code"));
storPublicService.updateStructAndPoint(from_end);
if (form.getString("turnout_sect_code").equals("BZC01")) {
storPublicService.updateStructAndPointTwo(from_end);
} else {
storPublicService.updateStructAndPoint(from_end);
}
//更新移出库存
jo.put("struct_id", jo.getString("turnout_struct_id"));
jo.put("change_qty", jo.getDoubleValue("qty"));