revb:二期移库修改

This commit is contained in:
2024-07-08 16:14:54 +08:00
parent 3967634972
commit 2b37eea4a0
3 changed files with 129 additions and 13 deletions

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"));