opt:优化一件设置
This commit is contained in:
@@ -145,4 +145,5 @@ public interface IStIvtIostorinvOutService extends IService<StIvtIostorinv> {
|
||||
* @return String 任务标识
|
||||
*/
|
||||
String taskExceptionalOut(JSONObject whereJson);
|
||||
public void createForTask(JSONObject json, JSONObject where) ;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.wms.basedata.st.service.StorattrService;
|
||||
import org.nl.wms.basedata.st.service.dto.StorattrDto;
|
||||
@@ -1686,6 +1687,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
if (ObjectUtil.isNotEmpty(jsonParam)) {
|
||||
flag = jsonParam.getString("value");
|
||||
}
|
||||
IStIvtIostorinvOutService aopService = SpringContextHolder.getBean(IStIvtIostorinvOutService.class);
|
||||
for (int i = 0; i < taskMangeList.size(); i++) {
|
||||
JSONObject json = taskMangeList.get(i);
|
||||
// TODO ---
|
||||
@@ -1695,107 +1697,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
|
||||
jsonObject.put("taskList",taskList);
|
||||
jsonObject.put("is_auto_issue",is_auto_issue);
|
||||
jsonObject.put("task_group_id",task_group_id);
|
||||
createForTask(json,jsonObject);
|
||||
// TODO ---
|
||||
/*
|
||||
// 确定起点
|
||||
start_device_code = json.getString("struct_code");
|
||||
|
||||
// 确定终点: 根据仓位所在排确定终点
|
||||
String end_device_code = "";
|
||||
if("1".equals(flag)){
|
||||
end_device_code = IsEndCode2(json);
|
||||
}else{
|
||||
end_device_code = IsEndCode(json);
|
||||
}
|
||||
|
||||
// 过滤此仓位的分配明细
|
||||
List<StIvtIostorinvdis> disDaoList = disLikeList.stream()
|
||||
.filter(row -> row.getString("struct_code").equals(json.getString("struct_code")))
|
||||
.map(row -> JSONObject.parseObject(JSONObject.toJSONString(row), StIvtIostorinvdis.class))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 判断是否是异常货位
|
||||
if (json.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("出库异常锁"))) {
|
||||
*//*
|
||||
* 判断异常货位上的任务是否完成
|
||||
* 完成:生成完成任务的point_code2 当做起点的任务
|
||||
* 未完成:只更新分配明细状态为生成
|
||||
*//*
|
||||
JSONObject jsonTask = taskList.stream()
|
||||
.filter(row -> row.getString("task_id").equals(json.getString("task_code")))
|
||||
.collect(Collectors.toList()).get(0);
|
||||
|
||||
|
||||
// 完成
|
||||
if (jsonTask.getString("task_status").equals(TaskStatusEnum.FINISHED.getCode())) {
|
||||
start_device_code = jsonTask.getString("point_code2");
|
||||
is_auto_issue = IOSEnum.IS_SEND.code("否");
|
||||
} else {
|
||||
// 未完成:只更新分配明细状态不更新任务id
|
||||
disDaoList.forEach(row -> {
|
||||
row.setWork_status(IOSEnum.WORK_STATUS.code("生成"));
|
||||
row.setTask_id(Long.parseLong(task_group_id));
|
||||
});
|
||||
iStIvtIostorinvdisService.updateBatchById(disDaoList);
|
||||
|
||||
// 标记任务
|
||||
jsonTask.put("is_auto_issue",IOSEnum.IS_SEND.code("否"));
|
||||
taskService.update(jsonTask);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 查询木箱对应的载具
|
||||
JSONObject jsonVeExt = extTab.query("pcsn = '" + json.getString("storagevehicle_code") + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonVeExt)) {
|
||||
throw new BadRequestException("此木箱没有绑定托盘号!"+json.getString("storagevehicle_code"));
|
||||
}
|
||||
|
||||
// 生成任务
|
||||
JSONObject jsonTaskParam = new JSONObject();
|
||||
jsonTaskParam.put("task_type", "010711");
|
||||
jsonTaskParam.put("point_code1", start_device_code);
|
||||
jsonTaskParam.put("point_code2", end_device_code);
|
||||
jsonTaskParam.put("vehicle_code", json.getString("storagevehicle_code"));
|
||||
jsonTaskParam.put("vehicle_code2", jsonVeExt.getString("storagevehicle_code"));
|
||||
jsonTaskParam.put("containerType", json.getString("storagevehicle_type"));
|
||||
jsonTaskParam.put("task_group_id", task_group_id);
|
||||
jsonTaskParam.put("is_auto_issue", is_auto_issue);
|
||||
JSONObject request_param = new JSONObject();
|
||||
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
|
||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||
.eq(BstIvtBoxinfo::getBox_no, json.getString("storagevehicle_code"))
|
||||
);
|
||||
request_param.put("containerType", boxDao.getVehicle_type());
|
||||
jsonTaskParam.put("request_param", request_param);
|
||||
jsonTaskParam.put("table_fk", disDaoList.get(0).getIostorinv_id().toString());
|
||||
|
||||
if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("浅")) ||
|
||||
json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("无")))
|
||||
{
|
||||
jsonTaskParam.put("sort_seq", Integer.parseInt(IOSEnum.ZDEPTH_STRUCT.code("浅")));
|
||||
} else {
|
||||
jsonTaskParam.put("sort_seq", Integer.parseInt(IOSEnum.ZDEPTH_STRUCT.code("深")));
|
||||
}
|
||||
jsonTaskParam.put("request_param", jsonTaskParam);
|
||||
|
||||
TwoOutTask twoOutTask = new TwoOutTask();
|
||||
String task_id = twoOutTask.createTask(jsonTaskParam);
|
||||
|
||||
// 更新分配明细
|
||||
JSONObject jsonPoint = schBasePointService.query("point_code = '" + end_device_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("出库点位不存在:"+end_device_code);
|
||||
}
|
||||
|
||||
disDaoList.forEach(row -> {
|
||||
row.setWork_status(IOSEnum.WORK_STATUS.code("生成"));
|
||||
row.setTask_id(Long.parseLong(task_id));
|
||||
row.setPoint_id(jsonPoint.getLongValue("point_id"));
|
||||
});
|
||||
iStIvtIostorinvdisService.updateBatchById(disDaoList);*/
|
||||
aopService.createForTask(json,jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
@@ -505,12 +506,8 @@ public class OutBussManageServiceImpl implements OutBussManageService {
|
||||
public void createMove2(List<JSONObject> list) {
|
||||
//子卷包装关系表
|
||||
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
|
||||
|
||||
//物料表
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||
// 载具扩展属性表
|
||||
WQLObject extTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
|
||||
// 获取子卷包装集合
|
||||
String vehilcle_in = list.stream()
|
||||
.map(row -> row.getString("storagevehicle_code"))
|
||||
@@ -518,134 +515,16 @@ public class OutBussManageServiceImpl implements OutBussManageService {
|
||||
|
||||
List<JSONObject> subList = subTab.query("package_box_sn IN ('" + vehilcle_in + "')")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
// 查询物料集合
|
||||
String materialCode_in = subList.stream()
|
||||
.map(row -> row.getString("product_name"))
|
||||
.collect(Collectors.joining("','"));
|
||||
|
||||
List<JSONObject> materList = materTab.query("material_code IN ('" + materialCode_in + "')")
|
||||
.getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
|
||||
OutBussManageService myService = SpringContextHolder.getBean(OutBussManageService.class);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject json = list.get(i);
|
||||
// TODO--
|
||||
createForMove(json,subList,materList);
|
||||
// TODO--
|
||||
/*
|
||||
// 生成移库单传入参数
|
||||
JSONObject mapParam = new JSONObject();
|
||||
// 明细参数
|
||||
JSONArray table = new JSONArray();
|
||||
|
||||
mapParam.put("bill_type", IOSEnum.MOVE_TYPE.code("出库移库"));
|
||||
mapParam.put("buss_type", IOSEnum.MOVE_TYPE.code("出库移库"));
|
||||
mapParam.put("bill_status", IOSEnum.MOVE_STATUS.code("提交"));
|
||||
mapParam.put("biz_date", DateUtil.today());
|
||||
mapParam.put("stor_code", json.getString("stor_code"));
|
||||
mapParam.put("stor_id", json.getString("stor_id"));
|
||||
mapParam.put("stor_name", json.getString("stor_name"));
|
||||
mapParam.put("is_task", IOSEnum.IS_NOTANDYES.code("是"));
|
||||
|
||||
// 过滤对应物料
|
||||
JSONObject jsonSub = subList.stream()
|
||||
.filter(row -> row.getString("package_box_sn").equals(json.getString("storagevehicle_code")))
|
||||
.collect(Collectors.toList()).get(0);
|
||||
|
||||
JSONObject jsonMater = materList.stream()
|
||||
.filter(row -> row.getString("material_code").equals(jsonSub.getString("product_name")))
|
||||
.collect(Collectors.toList()).get(0);
|
||||
|
||||
// 查询移入货位
|
||||
JSONObject moveParam = new JSONObject();
|
||||
moveParam.put("stor_id", json.getString("stor_id"));
|
||||
moveParam.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
|
||||
moveParam.put("box_no", json.getString("storagevehicle_code"));
|
||||
moveParam.put("material_id", jsonMater.getString("material_id"));
|
||||
//根据木箱高度,判断入库仓位的高度、
|
||||
String height = "";
|
||||
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
|
||||
String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue();
|
||||
// 查询木箱信息
|
||||
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
|
||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||
.eq(BstIvtBoxinfo::getBox_no, json.getString("storagevehicle_code"))
|
||||
);
|
||||
|
||||
String box_high = boxDao.getBox_high();
|
||||
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
|
||||
height = "('1','2','3')";
|
||||
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
|
||||
height = "('2','3')";
|
||||
} else {
|
||||
height = "('3')";
|
||||
}
|
||||
moveParam.put("height", height);
|
||||
moveParam.put("vehicle_type", boxDao.getVehicle_type());
|
||||
// 移库巷道
|
||||
moveParam.put("move_block_num",json.getString("block_num"));
|
||||
|
||||
// TODO JSONObject jsonMove = inBussManageService.getOneStruct(moveParam);
|
||||
JSONObject jsonMove = twoInBussManageService.getOneStruct(moveParam);
|
||||
|
||||
// 查询移出货位的库存物料
|
||||
JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03")
|
||||
.addParam("flag", "6")
|
||||
.addParam("struct_id", json.getString("struct_id"))
|
||||
.process().uniqueResult(0);
|
||||
|
||||
// 移库单明细
|
||||
JSONObject jsonMoveDtl = new JSONObject();
|
||||
jsonMoveDtl.put("is_task", "2");
|
||||
jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name"));
|
||||
jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id"));
|
||||
jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn"));
|
||||
jsonMoveDtl.put("quality_scode", IOSEnum.QUALITY_SCODE.code("合格品"));
|
||||
jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id"));
|
||||
jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name"));
|
||||
jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty"));
|
||||
jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
|
||||
jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id"));
|
||||
jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code"));
|
||||
jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name"));
|
||||
jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id"));
|
||||
jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code"));
|
||||
jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name"));
|
||||
|
||||
// 查询木箱对应的载具
|
||||
JSONObject jsonVeExt = extTab.query("pcsn = '" + json.getString("storagevehicle_code") + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonVeExt)) {
|
||||
throw new BadRequestException("此木箱没有绑定托盘号!"+json.getString("storagevehicle_code"));
|
||||
}
|
||||
|
||||
// 生成任务
|
||||
JSONObject param2 = new JSONObject();
|
||||
param2.put("task_type", "010709");
|
||||
param2.put("vehicle_code", json.getString("storagevehicle_code"));
|
||||
param2.put("vehicle_code2", jsonVeExt.getString("storagevehicle_code"));
|
||||
param2.put("point_code1", json.getString("struct_code"));
|
||||
param2.put("point_code2", jsonMove.getString("struct_code"));
|
||||
|
||||
HandMoveStorAcsTask handMoveStorAcsTask = new HandMoveStorAcsTask();
|
||||
String move_task_id = handMoveStorAcsTask.createTask(param2);
|
||||
|
||||
// 回显移库明细任务id
|
||||
jsonMoveDtl.put("task_id", move_task_id);
|
||||
table.add(jsonMoveDtl);
|
||||
|
||||
mapParam.put("tableData", table);
|
||||
// 调用移库单新增方法
|
||||
handMoveStorService.insertDtl2(mapParam);
|
||||
|
||||
// 下发任务
|
||||
handMoveStorAcsTask.immediateNotifyAcs(null);*/
|
||||
myService.createForMove(json,subList,materList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,6 +534,7 @@ public class OutBussManageServiceImpl implements OutBussManageService {
|
||||
* @param subList 子卷包装关系集合
|
||||
* @param materList 物料集合
|
||||
*/
|
||||
@Autowired
|
||||
@Transactional
|
||||
public void createForMove(JSONObject json, List<JSONObject> subList, List<JSONObject> materList) {
|
||||
// 载具扩展属性表
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface OutBussManageService {
|
||||
* @return List<StIvtIostorinvdis>: 分配明细集合
|
||||
*/
|
||||
List<StIvtIostorinvdis> manualDivIvt(StIvtIostorinvdtl dtlDao, List<JSONObject> ivtList);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新库存
|
||||
@@ -87,4 +87,5 @@ public interface OutBussManageService {
|
||||
* @return point_code: 货位编码
|
||||
*/
|
||||
JSONObject taskExceptional(JSONObject whereJson);
|
||||
public void createForMove(JSONObject json, List<JSONObject> subList, List<JSONObject> materList);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class CheckOutBillController {
|
||||
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
iStIvtIostorinvOutService.allSetPoint2(whereJson);
|
||||
} else {
|
||||
checkOutBillService.allSetPoint(whereJson);
|
||||
checkOutBillService.allSetPointByNoTran(whereJson);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user