|
|
@ -5,7 +5,10 @@ import cn.hutool.core.util.NumberUtil; |
|
|
|
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 com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService; |
|
|
|
import org.nl.b_lms.sch.task.dao.SchBaseTask; |
|
|
|
import org.nl.b_lms.sch.task.service.IschBaseTaskService; |
|
|
|
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService; |
|
|
@ -19,6 +22,12 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdtl; |
|
|
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService; |
|
|
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBussManageService; |
|
|
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.TwoInBussManageService; |
|
|
|
import org.nl.b_lms.storage_manage.md.service.MdPbMeasureunitService; |
|
|
|
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr; |
|
|
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr; |
|
|
|
import org.nl.b_lms.storage_manage.st.service.StIvtSectattrService; |
|
|
|
import org.nl.b_lms.storage_manage.st.service.StIvtStructattrService; |
|
|
|
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService; |
|
|
|
import org.nl.common.utils.IdUtil; |
|
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
|
import org.nl.modules.wql.WQL; |
|
|
@ -38,6 +47,7 @@ import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.function.Consumer; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
/** |
|
|
|
* <p> |
|
|
@ -97,6 +107,17 @@ public class OutBussManageServiceImpl implements OutBussManageService { |
|
|
|
*/ |
|
|
|
@Autowired |
|
|
|
private TwoInBussManageService twoInBussManageService; |
|
|
|
@Autowired |
|
|
|
private StIvtStructivtService structivtService; |
|
|
|
@Autowired |
|
|
|
private MdPbMeasureunitService measureunitService; |
|
|
|
/** 子卷包装关系 */ |
|
|
|
@Autowired |
|
|
|
private IpdmBiSubpackagerelationService subpackagerelationService; |
|
|
|
@Autowired |
|
|
|
private StIvtSectattrService sectattrService; |
|
|
|
@Autowired |
|
|
|
private StIvtStructattrService structattrService; |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
@ -106,13 +127,15 @@ public class OutBussManageServiceImpl implements OutBussManageService { |
|
|
|
throw new BadRequestException("锁定或解锁仓位不能为空!"); |
|
|
|
} |
|
|
|
|
|
|
|
// 仓位表
|
|
|
|
WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr"); |
|
|
|
|
|
|
|
String operate = json.getString("operate"); |
|
|
|
if (operate.equals(IOSEnum.IO_TYPE.code("出库"))) { |
|
|
|
|
|
|
|
attrTab.update(json, "struct_code IN ('" + String.join("','", param) + "')"); |
|
|
|
LambdaUpdateWrapper<StIvtStructattr> lam = new LambdaUpdateWrapper<>(); |
|
|
|
lam.in(StIvtStructattr::getStruct_code, param) |
|
|
|
.set(StIvtStructattr::getInv_id, json.getString("inv_id")) |
|
|
|
.set(StIvtStructattr::getInv_type, json.getString("inv_type")) |
|
|
|
.set(StIvtStructattr::getInv_code, json.getString("inv_code")) |
|
|
|
.set(StIvtStructattr::getLock_type, json.getString("lock_type")); |
|
|
|
structattrService.update(lam); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -264,29 +287,25 @@ public class OutBussManageServiceImpl implements OutBussManageService { |
|
|
|
List<StIvtIostorinvdis> resultDisList = new ArrayList<>(); |
|
|
|
|
|
|
|
// 查询计量单位
|
|
|
|
JSONObject jsonUnit = WQLObject.getWQLObject("md_pb_measureunit") |
|
|
|
.query("measure_unit_id = '" + likeBoxList.get(0).getString("qty_unit_id") + "'") |
|
|
|
.uniqueResult(0); |
|
|
|
|
|
|
|
List<JSONObject> units = measureunitService.getUnitAllByIds(Stream.of(likeBoxList.get(0).getString("qty_unit_id")) |
|
|
|
.collect(Collectors.toList())); |
|
|
|
if (ObjectUtil.isEmpty(units)) { |
|
|
|
throw new BadRequestException("找不到单位【" + likeBoxList.get(0).getString("qty_unit_id") + "】"); |
|
|
|
} |
|
|
|
JSONObject jsonUnit = units.get(0); |
|
|
|
// 查询子卷包装关系
|
|
|
|
String pcsn_in = likeBoxList.stream() |
|
|
|
List<String> pcsns = likeBoxList.stream() |
|
|
|
.map(row -> row.getString("pcsn")) |
|
|
|
.collect(Collectors.joining("','")); |
|
|
|
|
|
|
|
List<JSONObject> subList = WQLObject.getWQLObject("pdm_bi_subpackagerelation") |
|
|
|
.query("container_name in ('" + pcsn_in + "')") |
|
|
|
.getResultJSONArray(0).toJavaList(JSONObject.class); |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<JSONObject> subList = subpackagerelationService.getSubPackageInfoBySubRolls(pcsns); |
|
|
|
for (int i = 0; i < likeBoxList.size(); i++) { |
|
|
|
JSONObject jsonIvt = likeBoxList.get(i); |
|
|
|
|
|
|
|
// 查询库区
|
|
|
|
JSONObject jsonSect = WQLObject.getWQLObject("st_ivt_sectattr") |
|
|
|
.query("sect_id = '" + jsonIvt.getString("sect_id") + "'") |
|
|
|
.uniqueResult(0); |
|
|
|
StIvtSectattr sectAttribute = sectattrService.getById(jsonIvt.getString("sect_id")); |
|
|
|
|
|
|
|
String work_status; |
|
|
|
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) { |
|
|
|
if (sectAttribute.getSect_type_attr().equals(IOSEnum.SECT_TYPE.code("虚拟区"))) { |
|
|
|
work_status = IOSEnum.WORK_STATUS.code("生成"); |
|
|
|
} else { |
|
|
|
work_status = IOSEnum.WORK_STATUS.code("未生成"); |
|
|
|