add 成品入库开发
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
package org.nl.b_lms.pdm.subpackagerelation.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dto.PdmBiSubpackagerelationDto;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@@ -40,4 +39,7 @@ public interface PdmBiSubpackagerelationMapper extends BaseMapper<PdmBiSubpackag
|
||||
@Select("select resource_name as 下卷设备,sch_base_task.update_time as 下卷结束,sch_base_task.create_time as 下卷开始 from sch_base_task left JOIN pdm_bi_slittingproductionplan on pdm_bi_slittingproductionplan.qzzno = vehicle_code and pdm_bi_slittingproductionplan.container_name is not null where create_time > #{day} and task_status = '07' and vehicle_code != '' and vehicle_code is not NULL and point_code2 IN ('TZZC30','TZZC31','TZZC32','TZZC33','TZZC34','TZZC35','TZZC36','TZZC37','TZZC38')\n")
|
||||
List<Map<String,String>> downloadData(@Param("day") String date);
|
||||
|
||||
|
||||
@Select("select * from pdm_bi_subpackagerelation where package_box_sn = #{boxNo}")
|
||||
StructattrQuerry selectSubpackagerelationInser(String boxNo);
|
||||
}
|
||||
|
||||
@@ -299,8 +299,6 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
||||
try {
|
||||
if (tryLock) {
|
||||
|
||||
// 库区表
|
||||
WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||
// 参数类型转换 Map-> JSONObject
|
||||
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(whereJson));
|
||||
// 分配明细集合
|
||||
@@ -320,7 +318,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
||||
JSONObject jsonLock = new JSONObject();
|
||||
ArrayList<String> paramLockList = new ArrayList<>();
|
||||
// 仓位对象
|
||||
StIvtStructattr stIvtStructattr;
|
||||
StIvtStructattr stIvtStructattr = new StIvtStructattr();
|
||||
// 是否自动分配货位
|
||||
Boolean checked = jsonObject.getBoolean("checked");
|
||||
String height = "";
|
||||
@@ -350,9 +348,9 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
||||
height = "'3'";
|
||||
}
|
||||
attrParam.put("height", height);
|
||||
JSONObject jsonSect = sectTab.query("sect_id = '" + jsonObject.getString("sect_id") + "'").uniqueResult(0);
|
||||
StIvtSectattr stIvtSectattr = stIvtSectattrMapper.selectOne(new QueryWrapper<StIvtSectattr>().eq("sect_id",jsonObject.getString("sect_id")));
|
||||
// 判断是否是虚拟区
|
||||
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
|
||||
if (stIvtSectattr.getSect_type_attr().equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
|
||||
|
||||
stIvtStructattr = stIvtStructattrMapper.selectOne(new QueryWrapper<StIvtStructattr>().eq("sect_id", jsonObject.getString("sect_id")).eq("lock_type", "1").eq("is_delete", "0").apply("IFNULL(storagevehicle_code, '') = ''"));
|
||||
|
||||
@@ -362,11 +360,14 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get("in_buss"))) {
|
||||
attrParam.put("move_block_num", MapUtil.getStr(whereJson, "move_block_num"));
|
||||
}
|
||||
stIvtStructattr = twoInBussManageService.getOneStruct(attrParam);
|
||||
JSONObject oneStruct = twoInBussManageService.getOneStruct(attrParam);
|
||||
if (!ObjectUtil.isEmpty(oneStruct)){
|
||||
stIvtStructattr = oneStruct.toJavaObject(StIvtStructattr.class);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// 指定分配
|
||||
|
||||
stIvtStructattr = stIvtStructattrMapper.selectOne(new QueryWrapper<StIvtStructattr>().eq("struct_id", jsonDis.getString("struct_id")));
|
||||
|
||||
}
|
||||
@@ -384,9 +385,8 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
|
||||
// 判断是否虚拟区
|
||||
String work_status;
|
||||
Long task_id = null;
|
||||
JSONObject jsonSect = sectTab.query("sect_id = '" + jsonAttr.getString("sect_id") + "'").uniqueResult(0);
|
||||
StIvtSectattr stIvtSectattr = stIvtSectattrMapper.selectOne(new QueryWrapper<StIvtSectattr>().eq("sect_id", jsonAttr.getString("sect_id")));
|
||||
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
|
||||
StIvtSectattr stIvtSectattr = stIvtSectattrMapper.selectOne(new QueryWrapper<StIvtSectattr>().eq("sect_id",stIvtStructattr.getSect_id()));
|
||||
if (stIvtSectattr.getSect_type_attr().equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
|
||||
// 虚拟区:执行状态为完成
|
||||
work_status = IOSEnum.WORK_STATUS.code("完成");
|
||||
task_id = IdUtil.getLongId();
|
||||
|
||||
@@ -501,6 +501,9 @@ public class InBussManageServiceImpl implements InBussManageService {
|
||||
List<JSONObject> boxAllLikeList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
|
||||
|
||||
|
||||
// 为空说明库内没有相同规格的木箱,则返回不区分木箱规格的最小巷道
|
||||
if (ObjectUtil.isEmpty(boxAllLikeList)) {
|
||||
return jsonBlockMin.getString("block_num");
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.log4j.Log4j;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.TwoInBussManageService;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructattrMapper;
|
||||
@@ -17,10 +19,8 @@ import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -34,9 +34,11 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
|
||||
@Autowired
|
||||
private StIvtStructattrMapper stIvtStructattrMapper;
|
||||
@Autowired
|
||||
private PdmBiSubpackagerelationMapper pdmBiSubpackagerelationMapper;
|
||||
|
||||
@Override
|
||||
public JSONObject getOneStruct(JSONObject jsonObject) {
|
||||
public JSONObject getOneStruct(JSONObject jsonObject) {
|
||||
/*
|
||||
* 成品入库规则:
|
||||
* 1.根据托盘类型确认巷道小托盘负载均衡到所有巷道,大托盘去大托盘巷道。
|
||||
@@ -66,45 +68,27 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
// 是否是移库: 提前确定的巷道
|
||||
String block_num = jsonObject.getString("move_block_num");
|
||||
|
||||
JSONArray attrArry = new JSONArray();
|
||||
|
||||
String input = jsonObject.getString("height");
|
||||
List<String> result = Arrays.asList(input.split("','"));
|
||||
|
||||
//
|
||||
if (ObjectUtil.isEmpty(block_num)) {
|
||||
attrArry = attrTab.query("IFNULL(storagevehicle_code,'') = '' " +
|
||||
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("是") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("否") + "' " +
|
||||
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '" + jsonObject.getString("stor_id") + "' " +
|
||||
"AND storagevehicle_type = '" + jsonObject.getString("vehicle_type") + "'" +
|
||||
"AND height IN " + jsonObject.getString("height") +
|
||||
"AND sect_id = '" + jsonObject.getString("sect_id") + "'").getResultJSONArray(0);
|
||||
|
||||
LambdaQueryWrapper<StIvtStructattr> stIvtStructattrLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
stIvtStructattrLambdaQueryWrapper.eq(StIvtStructattr::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||
.eq(StIvtStructattr::getIs_used, IOSEnum.IS_NOTANDYES.code("是")).eq(StIvtStructattr::getSect_id, jsonObject.getString("sect_id"))
|
||||
.eq(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定")).eq(StIvtStructattr::getStor_id, jsonObject.getString("stor_id"))
|
||||
.in(StIvtStructattr::getHeight, result);
|
||||
if (){
|
||||
|
||||
}
|
||||
stIvtStructattrMapper.selectList()
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
attrArry = attrTab.query("IFNULL(storagevehicle_code,'') = '' " +
|
||||
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("是") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("否") + "' " +
|
||||
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '" + jsonObject.getString("stor_id") + "' " +
|
||||
"AND storagevehicle_type = '" + jsonObject.getString("vehicle_type") + "'" +
|
||||
"AND height IN " + jsonObject.getString("height") +
|
||||
"AND sect_id = '" + jsonObject.getString("sect_id") + "' AND block_num = '"+block_num+"'")
|
||||
.getResultJSONArray(0);
|
||||
|
||||
LambdaQueryWrapper<StIvtStructattr> stIvtStructattrLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
stIvtStructattrLambdaQueryWrapper.eq(StIvtStructattr::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||
.eq(StIvtStructattr::getIs_used, IOSEnum.IS_NOTANDYES.code("是")).eq(StIvtStructattr::getSect_id, jsonObject.getString("sect_id"))
|
||||
.eq(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定")).eq(StIvtStructattr::getStor_id, jsonObject.getString("stor_id"))
|
||||
.in(StIvtStructattr::getHeight, result);
|
||||
//小托盘均入四个巷道(不分类型),大托盘均入三个巷道
|
||||
if ("2".equals(jsonObject.getString("vehicle_type"))) {
|
||||
stIvtStructattrLambdaQueryWrapper.eq(StIvtStructattr::getStoragevehicle_type, "2");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(block_num)) {
|
||||
stIvtStructattrLambdaQueryWrapper.eq(StIvtStructattr::getBlock_num, block_num);
|
||||
}
|
||||
List<StIvtStructattr> stIvtStructattrs = stIvtStructattrMapper.selectList(stIvtStructattrLambdaQueryWrapper);
|
||||
|
||||
|
||||
if (ObjectUtil.isEmpty(attrArry)) {
|
||||
if (ObjectUtil.isEmpty(stIvtStructattrs)) {
|
||||
throw new BadRequestException("仓位不足!");
|
||||
}
|
||||
|
||||
@@ -112,23 +96,25 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
* 确定巷道:查看每个巷道相同木箱规格等 的数量,找到数量最小的那个巷道
|
||||
*/
|
||||
// 获取木箱入库巷道
|
||||
JSONObject jsonSub = subTab.query("package_box_sn = '" + jsonObject.getString("box_no") + "'").uniqueResult(0);
|
||||
jsonSub.put("stor_id", jsonObject.getString("stor_id"));
|
||||
jsonSub.put("sect_id", jsonObject.getString("sect_id"));
|
||||
jsonSub.put("material_id", jsonObject.getString("material_id"));
|
||||
jsonSub.put("vehicle_type", jsonObject.getString("vehicle_type"));
|
||||
jsonSub.put("height", jsonObject.getString("height"));
|
||||
StructattrQuerry structattrQuerry = pdmBiSubpackagerelationMapper.selectSubpackagerelationInser( jsonObject.getString("box_no"));
|
||||
|
||||
structattrQuerry.setStor_id(jsonObject.getString("stor_id"));
|
||||
structattrQuerry.setSect_id(jsonObject.getString("sect_id"));
|
||||
structattrQuerry.setMaterial_id(jsonObject.getString("material_id"));
|
||||
structattrQuerry.setStor_id(jsonObject.getString("vehicle_type"));
|
||||
structattrQuerry.setHeight(result);
|
||||
|
||||
|
||||
// 不是移库则需要找新巷道
|
||||
if (ObjectUtil.isEmpty(block_num)) {
|
||||
block_num = getMinBlock(jsonSub);
|
||||
block_num = getMinBlock(structattrQuerry);
|
||||
}
|
||||
jsonSub.put("block_num", block_num);
|
||||
structattrQuerry.setBlock_num(block_num);
|
||||
|
||||
/*
|
||||
* 找仓位
|
||||
*/
|
||||
JSONObject jsonAttr = getStruct(jsonSub);
|
||||
JSONObject jsonAttr = getStruct(structattrQuerry);
|
||||
|
||||
// 如果是移库空并且仓位为空则报错
|
||||
if (ObjectUtil.isNotEmpty(jsonObject.getString("move_block_num")) && ObjectUtil.isEmpty(jsonAttr)) {
|
||||
@@ -138,20 +124,15 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
// 为空则新找巷道
|
||||
if (ObjectUtil.isEmpty(jsonAttr)) {
|
||||
|
||||
jsonSub.put("flag", "1");
|
||||
notInBlockList.add(jsonSub.getString("block_num"));
|
||||
notInBlockList.add(structattrQuerry.getBlock_num());
|
||||
structattrQuerry.setNot_block(notInBlockList);
|
||||
List<String> block = stIvtStructattrMapper.getBlock(structattrQuerry);
|
||||
|
||||
String join = "('" + String.join("','", notInBlockList) + "')";
|
||||
jsonSub.put("not_block", join);
|
||||
for (int i = 0; i < block.size(); i++) {
|
||||
String s = block.get(i);
|
||||
structattrQuerry.setBlock_num(s);
|
||||
|
||||
List<JSONObject> blockList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
for (int i = 0; i < blockList.size(); i++) {
|
||||
JSONObject json = blockList.get(i);
|
||||
jsonSub.put("block_num",json.getString("block_num"));
|
||||
|
||||
JSONObject jsonAttr_2 = getStruct(jsonSub);
|
||||
JSONObject jsonAttr_2 = getStruct(structattrQuerry);
|
||||
if (ObjectUtil.isNotEmpty(jsonAttr_2)) {
|
||||
jsonAttr = jsonAttr_2;
|
||||
break;
|
||||
@@ -169,54 +150,43 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
/**
|
||||
* 获取最小巷道
|
||||
*
|
||||
* @param jsonSub {
|
||||
* jsonSub:木箱信息
|
||||
* sect_id:库区
|
||||
* stor_id:仓库
|
||||
* material_id:物料
|
||||
* }
|
||||
* @param structattrQuerry {
|
||||
* jsonSub:木箱信息
|
||||
* sect_id:库区
|
||||
* stor_id:仓库
|
||||
* material_id:物料
|
||||
* }
|
||||
* @return String : 巷道
|
||||
*/
|
||||
private String getMinBlock(JSONObject jsonSub) {
|
||||
private String getMinBlock(StructattrQuerry structattrQuerry) {
|
||||
// 获取系统参数不入哪个巷道
|
||||
String not_in_block_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("not_in_block_num").getValue();
|
||||
if (!not_in_block_num.equals(IOSEnum.IS_NOTANDYES.code("否"))) {
|
||||
jsonSub.put("not_in_block_num", not_in_block_num);
|
||||
structattrQuerry.setNot_in_block_num(not_in_block_num);
|
||||
}
|
||||
|
||||
jsonSub.put("flag", "1");
|
||||
|
||||
// 获取仓库、库区有空位的巷道
|
||||
List<JSONObject> blockList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
List<String> block = stIvtStructattrMapper.getBlock(structattrQuerry);
|
||||
|
||||
/*
|
||||
* 查询所属巷道所有木箱
|
||||
*/
|
||||
String block_in = blockList.stream()
|
||||
.map(row -> row.getString("block_num"))
|
||||
.collect(Collectors.joining("','"));
|
||||
|
||||
jsonSub.put("flag", "2");
|
||||
jsonSub.put("block_in", "('" + block_in + "')");
|
||||
|
||||
List<JSONObject> boxAllList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
structattrQuerry.setBlock_in(block);
|
||||
List<StIvtStructattr> boxAllList = stIvtStructattrMapper.getBoxAllList(structattrQuerry);
|
||||
|
||||
// 为空说明没有木箱,返回最小巷道
|
||||
if (ObjectUtil.isEmpty(boxAllList)) {
|
||||
return blockList.get(0).getString("block_num");
|
||||
if (CollUtil.isEmpty(boxAllList)) {
|
||||
return block.get(0);
|
||||
}
|
||||
|
||||
// 不区分木箱规格:最小木箱数的巷道
|
||||
JSONObject jsonBlockMin = sumBlockMinNum(blockList, boxAllList);
|
||||
JSONObject jsonBlockMin = sumBlockMinNum(block, boxAllList);
|
||||
|
||||
/*
|
||||
* 查询所属巷道所有相同规格的木箱
|
||||
*/
|
||||
jsonSub.put("flag", "3");
|
||||
List<JSONObject> boxAllLikeList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
List<StIvtStructattr> boxAllLikeList = stIvtStructattrMapper.getBoxAllLikeList(structattrQuerry);
|
||||
|
||||
|
||||
// 为空说明库内没有相同规格的木箱,则返回不区分木箱规格的最小巷道
|
||||
if (ObjectUtil.isEmpty(boxAllLikeList)) {
|
||||
@@ -224,7 +194,7 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
}
|
||||
|
||||
// 区分木箱规格:最小木箱的巷道
|
||||
JSONObject jsonBlockLikeMin = sumBlockMinNum(blockList, boxAllLikeList);
|
||||
JSONObject jsonBlockLikeMin = sumBlockMinNum(block, boxAllLikeList);
|
||||
return jsonBlockLikeMin.getString("block_num");
|
||||
}
|
||||
|
||||
@@ -235,35 +205,32 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
* @param boxAllList: 所有木箱
|
||||
* @return JSONObject:最小木箱数的巷道 JSONObject{block_num,box_num}
|
||||
*/
|
||||
private JSONObject sumBlockMinNum(List<JSONObject> blockList, List<JSONObject> boxAllList) {
|
||||
private JSONObject sumBlockMinNum(List<String> blockList, List<StIvtStructattr> boxAllList) {
|
||||
|
||||
// 统计各巷道木箱数
|
||||
Map<BigDecimal, List<StIvtStructattr>> boxGroupedByBlock = boxAllList.stream()
|
||||
.collect(Collectors.groupingBy(row -> row.getBlock_num()));
|
||||
|
||||
ArrayList<JSONObject> blockBoxList = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < blockList.size(); i++) {
|
||||
JSONObject jsonBlock = blockList.get(i);
|
||||
|
||||
List<JSONObject> box_num = boxAllList.stream()
|
||||
.filter(row -> row.getString("block_num").equals(jsonBlock.getString("block_num")))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
jsonBlock.put("box_num", String.valueOf(box_num.size()));
|
||||
blockBoxList.add(jsonBlock);
|
||||
for (String jsonBlock : blockList) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
int count = boxGroupedByBlock.getOrDefault(jsonBlock, Collections.emptyList()).size();
|
||||
jsonObject.put("box_num", String.valueOf(count));
|
||||
blockBoxList.add(jsonObject);
|
||||
}
|
||||
|
||||
// 最小木箱数的巷道
|
||||
List<JSONObject> boxNumList = blockBoxList.stream()
|
||||
.sorted(Comparator.comparing(row -> row.getIntValue("box_num")))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return boxNumList.get(0);
|
||||
// 获取木箱数最少的巷道
|
||||
return blockBoxList.stream()
|
||||
.min(Comparator.comparingInt(row -> Integer.parseInt(row.getString("box_num"))))
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取一个货位公共方法
|
||||
*
|
||||
* @param jsonSub {
|
||||
* @param structattrQuerry {
|
||||
* jsonSub:木箱信息
|
||||
* sect_id:库区
|
||||
* stor_id:仓库
|
||||
@@ -273,100 +240,88 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
* }
|
||||
* @return JSONObject : 仓位
|
||||
*/
|
||||
private JSONObject getStruct(JSONObject jsonSub) {
|
||||
private JSONObject getStruct(StructattrQuerry structattrQuerry) {
|
||||
// 根据巷道找这一巷道相同订单号、物料的仓位
|
||||
JSONObject jsonLikeBox = queryEqualBox(jsonSub);
|
||||
JSONObject jsonLikeBox = queryEqualBox(structattrQuerry);
|
||||
if (ObjectUtil.isNotEmpty(jsonLikeBox)) {
|
||||
return jsonLikeBox;
|
||||
}
|
||||
|
||||
// 获取此仓库、库区、巷道、排的所有空位 根据列、层、深度排序
|
||||
jsonSub.put("flag", "55");
|
||||
|
||||
List<JSONObject> rowStructList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
List<StIvtStructattr> stIvtStructattrs = stIvtStructattrMapper.getstructRow(structattrQuerry);
|
||||
|
||||
// 获取此仓库、库区、巷道、排的所有仓位
|
||||
jsonSub.put("flag", "66");
|
||||
|
||||
List<JSONObject> structAllList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
JSONObject jsonAttr = new JSONObject();
|
||||
|
||||
for (int i = 0; i < rowStructList.size(); i++) {
|
||||
JSONObject json = rowStructList.get(i);
|
||||
|
||||
List<StIvtStructattr> allStruct = stIvtStructattrMapper.getAllStruct(structattrQuerry);
|
||||
StIvtStructattr stIvtStructattrReturn = new StIvtStructattr();
|
||||
for (int i = 0; i < stIvtStructattrs.size(); i++) {
|
||||
StIvtStructattr stIvtStructattr = stIvtStructattrs.get(i);
|
||||
// 判断伸位
|
||||
if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("无"))) {
|
||||
if (stIvtStructattr.getZdepth().equals(IOSEnum.ZDEPTH_STRUCT.code("无"))) {
|
||||
// 无需深度
|
||||
jsonAttr = json;
|
||||
stIvtStructattrReturn = stIvtStructattr;
|
||||
break;
|
||||
} else if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("深"))) {
|
||||
} else if (stIvtStructattr.getZdepth().equals(IOSEnum.ZDEPTH_STRUCT.code("深"))) {
|
||||
/*
|
||||
* 深货位:判断浅是否阻挡
|
||||
*/
|
||||
// 获取此货位对应的浅货位
|
||||
List<JSONObject> lowAttr = structAllList.stream()
|
||||
.filter(row -> row.getString("col_num").equals(json.getString("col_num")) &&
|
||||
row.getString("layer_num").equals(json.getString("layer_num")) &&
|
||||
row.getString("row_num").equals(json.getString("row_num")) &&
|
||||
row.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("浅")))
|
||||
.collect(Collectors.toList());
|
||||
List<StIvtStructattr> lowAttr = allStruct.stream()
|
||||
.filter(row -> row.getCol_num().equals(String.valueOf(stIvtStructattr.getCol_num())) &&
|
||||
row.getLayer_num().equals(String.valueOf(stIvtStructattr.getLayer_num())) &&
|
||||
row.getRow_num().equals(String.valueOf(stIvtStructattr.getRow_num())) &&
|
||||
row.getZdepth().equals(IOSEnum.ZDEPTH_STRUCT.code("浅"))).collect(Collectors.toList());
|
||||
|
||||
if (ObjectUtil.isEmpty(lowAttr) || lowAttr.size() != 1) {
|
||||
notInBlockList.clear();
|
||||
throw new BadRequestException("匹配仓位时:" + json.getString("struct_code") + "对应的浅货位错误!");
|
||||
throw new BadRequestException("匹配仓位时:" + stIvtStructattr.getStruct_code() + "对应的浅货位错误!");
|
||||
}
|
||||
|
||||
// 判断是否有木箱
|
||||
JSONObject jsonAttrLow = lowAttr.get(0);
|
||||
if (ObjectUtil.isEmpty(jsonAttrLow.getString("storagevehicle_code")) && jsonAttrLow.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
StIvtStructattr jsonAttrLow = lowAttr.get(0);
|
||||
if (ObjectUtil.isEmpty(jsonAttrLow.getStoragevehicle_code()) && jsonAttrLow.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
// 没有木箱
|
||||
jsonAttr = json;
|
||||
stIvtStructattrReturn = stIvtStructattr;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("浅"))) {
|
||||
} else if (stIvtStructattr.getZdepth().equals(IOSEnum.ZDEPTH_STRUCT.code("浅"))) {
|
||||
/*
|
||||
* 浅货位:判断深货位是否空洞
|
||||
*/
|
||||
// 获取此货位对应的深货位
|
||||
List<JSONObject> darkAttr = structAllList.stream()
|
||||
.filter(row -> row.getString("col_num").equals(json.getString("col_num")) &&
|
||||
row.getString("layer_num").equals(json.getString("layer_num")) &&
|
||||
row.getString("row_num").equals(json.getString("row_num")) &&
|
||||
row.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("深")))
|
||||
.collect(Collectors.toList());
|
||||
List<StIvtStructattr> darkAttr = allStruct.stream()
|
||||
.filter(row -> row.getCol_num().equals(String.valueOf(stIvtStructattr.getCol_num())) &&
|
||||
row.getLayer_num().equals(String.valueOf(stIvtStructattr.getLayer_num())) &&
|
||||
row.getRow_num().equals(String.valueOf(stIvtStructattr.getRow_num())) &&
|
||||
row.getZdepth().equals(IOSEnum.ZDEPTH_STRUCT.code("深"))).collect(Collectors.toList());
|
||||
|
||||
if (ObjectUtil.isEmpty(darkAttr) || darkAttr.size() != 1) {
|
||||
notInBlockList.clear();
|
||||
throw new BadRequestException("匹配仓位时:" + json.getString("struct_code") + "对应的深货位错误!");
|
||||
throw new BadRequestException("匹配仓位时:" + stIvtStructattr.getStruct_code() + "对应的深货位错误!");
|
||||
}
|
||||
|
||||
// 判断是否有木箱
|
||||
JSONObject jsonAttrDark = darkAttr.get(0);
|
||||
StIvtStructattr jsonAttrDark = darkAttr.get(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAttrDark.getString("storagevehicle_code"))) {
|
||||
if (ObjectUtil.isNotEmpty(jsonAttrDark.getStoragevehicle_code())) {
|
||||
|
||||
// 判断是否是成品箱,判断内容:是否空托盘、是否空木箱
|
||||
if (jsonAttrDark.getString("is_vehicle").equals(IOSEnum.IS_NOTANDYES.code("是")) ||
|
||||
jsonAttrDark.getString("is_packing").equals(IOSEnum.IS_NOTANDYES.code("否"))
|
||||
if (jsonAttrDark.getIs_vehicle().equals(IOSEnum.IS_NOTANDYES.code("是")) ||
|
||||
jsonAttrDark.getIs_packing().equals(IOSEnum.IS_NOTANDYES.code("否"))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jsonAttrDark.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
jsonAttr = json;
|
||||
if (jsonAttrDark.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
stIvtStructattrReturn = stIvtStructattr;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (jsonAttrDark.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
jsonAttr = jsonAttrDark;
|
||||
if (jsonAttrDark.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||
stIvtStructattrReturn = jsonAttrDark;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
@@ -376,56 +331,59 @@ public class TwoInBussManageServiceImpl implements TwoInBussManageService {
|
||||
|
||||
}
|
||||
|
||||
return jsonAttr;
|
||||
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(stIvtStructattrReturn);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配相同订单、物料的仓位
|
||||
* @param jsonSub{子卷包装关系}
|
||||
*
|
||||
* @param structattrQuerry{子卷包装关系}
|
||||
* @return JSONObject:要入库的仓位
|
||||
*/
|
||||
private JSONObject queryEqualBox(JSONObject jsonSub) {
|
||||
private JSONObject queryEqualBox(StructattrQuerry structattrQuerry) {
|
||||
// 需要返回的仓位
|
||||
JSONObject result = new JSONObject();
|
||||
// 1.匹配相同订单号、物料的排(row_num)
|
||||
jsonSub.put("flag", "77");
|
||||
List<JSONObject> rowList = WQL.getWO("BST_INRULE").addParamMap(jsonSub)
|
||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
|
||||
List<StIvtStructattr> likeOrder = stIvtStructattrMapper.getLikeOrder(structattrQuerry);
|
||||
StructattrQuerry structattrQuerry2 = new StructattrQuerry();
|
||||
structattrQuerry2.setBlock_num(structattrQuerry.getBlock_num());
|
||||
structattrQuerry2.setSect_id(structattrQuerry.getSect_id());
|
||||
|
||||
// 查询此巷道的所有仓位
|
||||
List<JSONObject> attrRowAllList = WQL.getWO("BST_INRULE").addParam("flag", "88")
|
||||
.addParam("sect_id", jsonSub.getString("sect_id"))
|
||||
.addParam("block_num", jsonSub.getString("block_num")).process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
||||
List<StIvtStructattr> stIvtStructattrs = stIvtStructattrMapper.getallStruct(structattrQuerry2);
|
||||
|
||||
for (JSONObject json : rowList) {
|
||||
for (StIvtStructattr json : likeOrder) {
|
||||
// 判断此深仓位是否有货、是否被锁住
|
||||
if (ObjectUtil.isEmpty(json.getString("storagevehicle_code"))
|
||||
|| !json.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
if (ObjectUtil.isEmpty(json.getStoragevehicle_code())
|
||||
|| !json.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 找对应的浅货位
|
||||
JSONObject darkJson = attrRowAllList.stream()
|
||||
.filter(row -> row.getString("col_num").equals(json.getString("col_num")) &&
|
||||
row.getString("layer_num").equals(json.getString("layer_num")) &&
|
||||
row.getString("row_num").equals(json.getString("row_num")) &&
|
||||
row.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("浅")))
|
||||
StIvtStructattr darkJson = stIvtStructattrs.stream()
|
||||
.filter(row -> row.getCol_num().equals(json.getCol_num()) &&
|
||||
row.getLayer_num().equals(json.getLayer_num()) &&
|
||||
row.getRow_num().equals(json.getRow_num()) &&
|
||||
row.getZdepth().equals(IOSEnum.ZDEPTH_STRUCT.code("浅")))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (ObjectUtil.isEmpty(darkJson)) {
|
||||
notInBlockList.clear();
|
||||
throw new BadRequestException("匹配相同木箱规格仓位时:" + json.getString("struct_code") + "对应的深货位错误!");
|
||||
throw new BadRequestException("匹配相同木箱规格仓位时:" + darkJson.getStruct_code() + "对应的深货位错误!");
|
||||
}
|
||||
|
||||
// 判断浅货位是否有货、未锁定
|
||||
if (ObjectUtil.isNotEmpty(darkJson.getString("storagevehicle_code"))
|
||||
|| !darkJson.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
if (ObjectUtil.isNotEmpty(darkJson.getStoragevehicle_code())
|
||||
|| !darkJson.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(darkJson);
|
||||
|
||||
result = darkJson;
|
||||
result = jsonObject;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class StIvtStructattr implements Serializable {
|
||||
* 高度
|
||||
*/
|
||||
@TableField("height")
|
||||
private BigDecimal height;
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 深度
|
||||
@@ -357,4 +357,9 @@ public class StIvtStructattr implements Serializable {
|
||||
*/
|
||||
@TableField("storagevehicle_type")
|
||||
private String storagevehicle_type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String is_packing;
|
||||
@TableField(exist = false)
|
||||
private String is_vehicle;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
package org.nl.b_lms.storage_manage.st.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry;
|
||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StIvtStructattrMapper extends BaseMapper<StIvtStructattr> {
|
||||
|
||||
List<String> getBlock(@Param("param") StructattrQuerry pdmBiSubpackagerelation);
|
||||
|
||||
List<StIvtStructattr> getBoxAllList(@Param("param") StructattrQuerry pdmBiSubpackagerelation);
|
||||
|
||||
List<StIvtStructattr> getBoxAllLikeList(@Param("param") StructattrQuerry structattrQuerry);
|
||||
|
||||
List<StIvtStructattr> getLikeOrder(@Param("param") StructattrQuerry jsonSub);
|
||||
|
||||
List<StIvtStructattr> getallStruct(@Param("param")StructattrQuerry structattrQuerry2);
|
||||
|
||||
List<StIvtStructattr> getstructRow(@Param("param")StructattrQuerry structattrQuerry);
|
||||
|
||||
List<StIvtStructattr> getAllStruct(StructattrQuerry structattrQuerry);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,254 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructattrMapper">
|
||||
|
||||
<select id="getBlock" resultType="java.lang.String"
|
||||
parameterType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry">
|
||||
|
||||
SELECT
|
||||
attr.block_num
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
WHERE
|
||||
attr.is_used = '1'
|
||||
AND attr.is_delete = '0'
|
||||
AND attr.lock_type = '1'
|
||||
AND IFNULL(attr.storagevehicle_code,'') = ''
|
||||
AND attr.stor_id = param.stor_id
|
||||
AND attr.sect_id = param.sect_id
|
||||
AND attr.storagevehicle_type = param.vehicle_type
|
||||
<if test="param.not_in_block_num != '' || param.not_in_block_num != null ">
|
||||
AND attr.block_num != param.block_num
|
||||
</if>
|
||||
<if test=" param.not_block != null ">
|
||||
AND attr.block_num not in
|
||||
<foreach collection="param.not_block" open="(" close=")" separator="," index="block_num">
|
||||
#{block_num}
|
||||
</foreach>
|
||||
</if>
|
||||
AND attr.height in
|
||||
<foreach collection="param.height" open="(" close=")" separator="," index="height">
|
||||
#{height}
|
||||
</foreach>
|
||||
group by attr.block_num
|
||||
order by attr.block_num
|
||||
|
||||
</select>
|
||||
<select id="getBoxAllList" resultType="org.nl.b_lms.storage_manage.st.dao.StIvtStructattr"
|
||||
parameterType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry">
|
||||
SELECT
|
||||
attr.*
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
INNER JOIN bst_ivt_boxinfo box ON box.box_no = attr.storagevehicle_code
|
||||
WHERE
|
||||
attr.is_used = '1'
|
||||
AND attr.is_delete = '0'
|
||||
AND attr.stor_id = param.stor_id
|
||||
AND attr.sect_id = param.sect_id
|
||||
AND IFNULL(attr.storagevehicle_code,'') != ''
|
||||
AND box.is_packing = '1'
|
||||
|
||||
<if test="param.block_in != null ">
|
||||
AND attr.block_num in
|
||||
<foreach collection="param.block_in" open="(" close=")" separator="," index="block_num">
|
||||
#{block_num}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.row_in != null ">
|
||||
AND attr.row_num in
|
||||
<foreach collection="param.row_in" open="(" close=")" separator="," index="row_num">
|
||||
#{row_num}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.block_num != '' || param.block_num != null ">
|
||||
AND attr.block_num == param.block_num
|
||||
</if>
|
||||
<if test="param.row_num != '' || param.row_num != null ">
|
||||
AND attr.row_num != param.row_num
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getBoxAllLikeList" resultType="org.nl.b_lms.storage_manage.st.dao.StIvtStructattr"
|
||||
parameterType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry">
|
||||
|
||||
SELECT DISTINCT
|
||||
attr.*
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
INNER JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = attr.storagevehicle_code
|
||||
INNER JOIN bst_ivt_boxinfo box ON box.box_no = attr.storagevehicle_code
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_code = sub.product_name
|
||||
WHERE
|
||||
attr.is_used = '1'
|
||||
AND attr.is_delete = '0'
|
||||
AND attr.stor_id = param.stor_id
|
||||
AND attr.sect_id = param.sect_id
|
||||
AND IFNULL(attr.storagevehicle_code,'') != ''
|
||||
AND box.is_packing = '1'
|
||||
|
||||
<if test="param.material_id != '' || param.material_id != null ">
|
||||
AND mater.material_id == param.material_id
|
||||
</if>
|
||||
|
||||
<if test="param.customer_name != '' || param.customer_name != null ">
|
||||
AND sub.customer_name == param.customer_name
|
||||
</if>
|
||||
|
||||
<if test="param.customer_name != '' || param.customer_name != null ">
|
||||
AND sub.customer_name == param.customer_name
|
||||
</if>
|
||||
|
||||
<if test="param.sale_order_name != '' || param.sale_order_name != null ">
|
||||
AND sub.sale_order_name == param.sale_order_name
|
||||
</if>
|
||||
|
||||
<if test="param.box_length != '' || param.box_length != null ">
|
||||
AND sub.box_length == param.box_length
|
||||
</if>
|
||||
<if test="param.box_width != '' || param.box_width != null ">
|
||||
AND sub.box_width == param.box_width
|
||||
</if>
|
||||
<if test="param.box_high != '' || param.box_high != null ">
|
||||
AND sub.box_high == param.box_high
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
<if test="param.block_in != null ">
|
||||
AND attr.block_num in
|
||||
<foreach collection="param.block_in" open="(" close=")" separator="," index="block_num">
|
||||
#{block_num}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.row_in != null ">
|
||||
AND attr.row_num in
|
||||
<foreach collection="param.row_in" open="(" close=")" separator="," index="row_num">
|
||||
#{row_num}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getLikeOrder" resultType="org.nl.b_lms.storage_manage.st.dao.StIvtStructattr"
|
||||
parameterType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry">
|
||||
SELECT
|
||||
attr.*
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
INNER JOIN st_ivt_structattr attr ON ivt.struct_code = attr.struct_code
|
||||
INNER JOIN pdm_bi_subpackagerelation sub ON attr.storagevehicle_code = sub.package_box_sn AND ivt.pcsn = sub.container_name
|
||||
WHERE
|
||||
attr.is_used = '1'
|
||||
AND attr.is_delete = '0'
|
||||
AND attr.lock_type = '1'
|
||||
AND IFNULL(attr.storagevehicle_code,'') != ''
|
||||
AND attr.stor_id = param.stor_id
|
||||
AND attr.sect_id = param.sect_id
|
||||
AND attr.zdepth = '2'
|
||||
AND attr.storagevehicle_type = param.vehicle_type
|
||||
|
||||
AND attr.height in
|
||||
<foreach collection="param.height" open="(" close=")" separator="," index="height">
|
||||
#{height}
|
||||
</foreach>
|
||||
|
||||
<if test="param.block_num != '' || param.block_num != null ">
|
||||
AND attr.block_num == param.block_num
|
||||
</if>
|
||||
|
||||
<if test="param.product_name != '' || param.product_name != null ">
|
||||
AND sub.product_name == param.product_name
|
||||
</if>
|
||||
<if test="param.sale_order_name != '' || param.sale_order_name != null ">
|
||||
AND sub.sale_order_name == param.sale_order_name
|
||||
</if>
|
||||
<if test="param.box_length != '' || param.box_length != null ">
|
||||
AND sub.box_length == param.box_length
|
||||
</if>
|
||||
<if test="param.box_width != '' || param.box_width != null ">
|
||||
AND sub.box_width == param.box_width
|
||||
</if>
|
||||
<if test="param.box_high != '' || param.box_high != null ">
|
||||
AND sub.box_high == param.box_high
|
||||
</if>
|
||||
|
||||
order by attr.col_num,attr.layer_num ASC
|
||||
</select>
|
||||
<select id="getallStruct" resultType="org.nl.b_lms.storage_manage.st.dao.StIvtStructattr"
|
||||
parameterType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry">
|
||||
SELECT
|
||||
attr.*
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
WHERE
|
||||
attr.is_used = '1'
|
||||
AND attr.is_delete = '0'
|
||||
AND attr.sect_id = param.sect_id
|
||||
|
||||
<if test="param.block_num != '' || param.block_num != null ">
|
||||
AND attr.block_num == param.block_num
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getstructRow" resultType="org.nl.b_lms.storage_manage.st.dao.StIvtStructattr"
|
||||
parameterType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry">
|
||||
SELECT
|
||||
attr.*
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
WHERE
|
||||
attr.is_used = '1'
|
||||
AND attr.is_delete = '0'
|
||||
AND attr.lock_type = '1'
|
||||
AND IFNULL(attr.storagevehicle_code,'') = ''
|
||||
AND attr.stor_id = param.stor_id
|
||||
AND attr.sect_id = param.sect_id
|
||||
AND attr.storagevehicle_type = param.vehicle_type
|
||||
AND attr.height in
|
||||
<foreach collection="param.height" open="(" close=")" separator="," index="height">
|
||||
#{height}
|
||||
</foreach>
|
||||
<if test="param.block_num != '' || param.block_num != null ">
|
||||
AND attr.block_num == param.block_num
|
||||
</if>
|
||||
|
||||
|
||||
order by attr.zdepth DESC, attr.col_num, attr.layer_num ASC
|
||||
</select>
|
||||
<select id="getAllStruct" resultType="org.nl.b_lms.storage_manage.st.dao.StIvtStructattr"
|
||||
parameterType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.StructattrQuerry">
|
||||
|
||||
SELECT
|
||||
attr.*,
|
||||
CASE
|
||||
WHEN IFNULL(box.is_packing,'') = '' THEN '0'
|
||||
ELSE box.is_packing
|
||||
END AS is_packing,
|
||||
CASE
|
||||
WHEN IFNULL(attr.is_emptyvehicle,'') = '' THEN '0'
|
||||
ELSE attr.is_emptyvehicle
|
||||
END AS is_vehicle
|
||||
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
LEFT JOIN bst_ivt_boxinfo box ON box.box_no = attr.storagevehicle_code
|
||||
WHERE
|
||||
attr.is_used = '1'
|
||||
AND attr.is_delete = '0'
|
||||
AND attr.stor_id = param.stor_id
|
||||
AND attr.sect_id = param.sect_id
|
||||
AND attr.storagevehicle_type = param.vehicle_type
|
||||
|
||||
AND attr.height in
|
||||
<foreach collection="param.height" open="(" close=")" separator="," index="height">
|
||||
#{height}
|
||||
</foreach>
|
||||
<if test="param.block_num != '' || param.block_num != null ">
|
||||
AND attr.block_num == param.block_num
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user