opt:1.优化错误任务分配策略;2.优化移库任务深货位对应浅货位有无货筛选;
3.优化单据类型不同仓库字段,非立库单据过滤条件; 4.优化月末关单用料回执单回传失败,取当前时间; 5.优化用料单回传辅助单位部分为id不是code的物料数据;
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
<jjwt.version>0.11.1</jjwt.version>
|
<jjwt.version>0.11.1</jjwt.version>
|
||||||
<fastjson.version>1.2.83</fastjson.version>
|
<fastjson.version>1.2.83</fastjson.version>
|
||||||
<!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 -->
|
<!-- oshi监控需要指定jna版本, 问题详见 https://github.com/oshi/oshi/issues/1040 -->
|
||||||
<!-- <jna.version>5.8.0</jna.version>-->
|
<!-- <jna.version>5.8.0</jna.version>-->
|
||||||
<configuration.version>1.9</configuration.version>
|
<configuration.version>1.9</configuration.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>${hutool.version}</version>
|
<version>${hutool.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--Excel-->
|
<!--Excel-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi</artifactId>
|
<artifactId>poi</artifactId>
|
||||||
@@ -193,7 +193,20 @@
|
|||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.gson</groupId>
|
||||||
|
<artifactId>gson-jar</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>D:/Program/jar/gson-2.8.0.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.kingdee.bos.webapi</groupId>
|
||||||
|
<artifactId>kingdee-jar</artifactId>
|
||||||
|
<version>8.0.6</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>D:/Program/jar/k3cloud-webapi-sdk8.0.6.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
<!--Mysql依赖包-->
|
<!--Mysql依赖包-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
@@ -205,14 +218,14 @@
|
|||||||
<artifactId>gson-jar</artifactId>
|
<artifactId>gson-jar</artifactId>
|
||||||
<version>2.8.0</version>
|
<version>2.8.0</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>/Users/mima0000/Desktop/gson-2.8.0.jar</systemPath>
|
<systemPath>D:/Program/jar/gson-2.8.0.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.kingdee.bos.webapi</groupId>
|
<groupId>com.kingdee.bos.webapi</groupId>
|
||||||
<artifactId>kingdee-jar</artifactId>
|
<artifactId>kingdee-jar</artifactId>
|
||||||
<version>8.0.6</version>
|
<version>8.0.6</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>/Users/mima0000/Desktop/k3cloud-webapi-sdk8.0.6.jar</systemPath>
|
<systemPath>D:/Program/jar/k3cloud-webapi-sdk8.0.6.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- druid数据源驱动 -->
|
<!-- druid数据源驱动 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -226,11 +239,11 @@
|
|||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
<version>${fastjson.version}</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.dev33</groupId>
|
<groupId>cn.dev33</groupId>
|
||||||
<artifactId>sa-token-dao-redis</artifactId>
|
<artifactId>sa-token-dao-redis</artifactId>
|
||||||
@@ -269,7 +282,6 @@
|
|||||||
<artifactId>commons-configuration</artifactId>
|
<artifactId>commons-configuration</artifactId>
|
||||||
<version>${configuration.version}</version>
|
<version>${configuration.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/jcifs/jcifs -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.guava</groupId>
|
<groupId>com.google.guava</groupId>
|
||||||
<artifactId>guava</artifactId>
|
<artifactId>guava</artifactId>
|
||||||
|
|||||||
@@ -4,13 +4,10 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.exception.BadRequestException;
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.IStIvtIostorinvdtlService;
|
|
||||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.dao.StIvtIostorinvdtl;
|
|
||||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
|
||||||
import org.nl.wms.base_manage.vehicle.service.IBmVehicleInfoService;
|
import org.nl.wms.base_manage.vehicle.service.IBmVehicleInfoService;
|
||||||
import org.nl.wms.base_manage.vehicle.service.dao.BmVehicleInfo;
|
import org.nl.wms.base_manage.vehicle.service.dao.BmVehicleInfo;
|
||||||
import org.nl.wms.decision_manage.handler.decisioner.Decisioner;
|
import org.nl.wms.decision_manage.handler.decisioner.Decisioner;
|
||||||
|
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -50,18 +47,16 @@ public class LimitStorageRuleHandler extends Decisioner<StIvtStructattr, JSONObj
|
|||||||
// 判断策略类型
|
// 判断策略类型
|
||||||
String vehicleCode = param.getString("vehicle_code");
|
String vehicleCode = param.getString("vehicle_code");
|
||||||
BmVehicleInfo vehileInfo = bmVehicleInfoService.vehileInfo(vehicleCode);
|
BmVehicleInfo vehileInfo = bmVehicleInfoService.vehileInfo(vehicleCode);
|
||||||
if (vehileInfo==null){
|
if (vehileInfo == null) {
|
||||||
throw new BadRequestException("当前载具信息不存在:"+vehicleCode+"!");
|
throw new BadRequestException("当前载具信息不存在:" + vehicleCode + "!");
|
||||||
}
|
}
|
||||||
//限位策略特殊处理
|
//限位策略特殊处理
|
||||||
String start_point = param.getString("start_point");
|
String start_point = param.getString("start_point");
|
||||||
if (StringUtils.isNotEmpty(start_point) && start_point.equals("1109")){
|
String errorTask = param.getString("errorTask");
|
||||||
List<StIvtStructattr> collect = list.stream().filter(struct -> struct.getCol_num() > 2).collect(Collectors.toList());
|
if ((StringUtils.isNotEmpty(start_point) && "1109".equals(start_point)) || StringUtils.isNotEmpty(errorTask)) {
|
||||||
if (!CollectionUtils.isEmpty(collect)){
|
list = list.stream().filter(struct -> struct.getCol_num() > 2).collect(Collectors.toList());
|
||||||
list = collect;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
List<StIvtStructattr> resultList = inHandler(list,vehileInfo);
|
List<StIvtStructattr> resultList = inHandler(list, vehileInfo);
|
||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package org.nl.wms.decision_manage.handler.decisioner.impl.diy;
|
package org.nl.wms.decision_manage.handler.decisioner.impl.diy;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.wms.decision_manage.handler.decisioner.Decisioner;
|
import org.nl.wms.decision_manage.handler.decisioner.Decisioner;
|
||||||
|
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -15,14 +19,42 @@ import java.util.stream.Collectors;
|
|||||||
* @Date 2024/7/31 15:19
|
* @Date 2024/7/31 15:19
|
||||||
*/
|
*/
|
||||||
@Service("depthPriority")
|
@Service("depthPriority")
|
||||||
|
@Slf4j
|
||||||
public class DepthPriorityHandler extends Decisioner<StIvtStructattr, JSONObject> {
|
public class DepthPriorityHandler extends Decisioner<StIvtStructattr, JSONObject> {
|
||||||
//现场1/4排深位
|
//现场1/4排深位
|
||||||
@Override
|
@Override
|
||||||
public List<StIvtStructattr> handler(List<StIvtStructattr> list, JSONObject param) {
|
public List<StIvtStructattr> handler(List<StIvtStructattr> list, JSONObject param) {
|
||||||
List<StIvtStructattr> collect = list.stream().filter(a -> a.getRow_num() == 1 || a.getRow_num() == 4).collect(Collectors.toList());
|
//深货位
|
||||||
if (!CollectionUtils.isEmpty(collect)){
|
List<StIvtStructattr> depCollect = list.stream().filter(a -> a.getRow_num() == 1 || a.getRow_num() == 4).collect(Collectors.toList());
|
||||||
return collect;
|
//浅货位
|
||||||
|
List<StIvtStructattr> shallowCollect = list.stream().filter(a -> a.getRow_num() == 2 || a.getRow_num() == 3).collect(Collectors.toList());
|
||||||
|
List<StIvtStructattr> matchingCollect = new ArrayList<>();
|
||||||
|
depCollect.forEach(r -> {
|
||||||
|
shallowCollect.forEach(s -> {
|
||||||
|
String depCode = r.getCol_num() + "-" + r.getLayer_num();
|
||||||
|
String shallowCode = s.getCol_num() + "-" + s.getLayer_num();
|
||||||
|
if (r.getRow_num() == 1 && s.getRow_num() == 2) {
|
||||||
|
if (depCode.equals(shallowCode)) {
|
||||||
|
matchingCollect.add(r);
|
||||||
|
}
|
||||||
|
} else if (r.getRow_num() == 4 && s.getRow_num() == 3) {
|
||||||
|
if (depCode.equals(shallowCode)) {
|
||||||
|
matchingCollect.add(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (!CollectionUtils.isEmpty(matchingCollect)) {
|
||||||
|
log.info("深位优先分配结果: 存在深位并对应浅位无货的库位,分配结果:" + matchingCollect.get(0).getStruct_code());
|
||||||
|
return matchingCollect;
|
||||||
|
} else if (!CollectionUtils.isEmpty(depCollect)) {
|
||||||
|
log.info("深位优先分配结果: 存在深位但对应浅位有货的库位,分配结果:" + depCollect.get(0).getStruct_code());
|
||||||
|
return depCollect;
|
||||||
}
|
}
|
||||||
|
log.info("深位优先分配结果: 不存在深位库位,分配结果:" + list.get(0).getStruct_code());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
|||||||
RedissonUtils.lock(() -> {
|
RedissonUtils.lock(() -> {
|
||||||
System.out.println("---3--" + Thread.currentThread().getName());
|
System.out.println("---3--" + Thread.currentThread().getName());
|
||||||
//出阻挡说明是同排跟任务一个类型载具
|
//出阻挡说明是同排跟任务一个类型载具
|
||||||
Map process = SpringContextHolder.getBean(DecisionHandler.class).dispenseTransa(ListOf.of("limitStorage","depthPriority","nearby"), new JSONObject(MapOf.of( "is_move",true,"stor_code", stIvtStructattr.getStor_code(),"vehicle_code",task.getVehicle_code())));
|
Map process = SpringContextHolder.getBean(DecisionHandler.class).dispenseTransa(ListOf.of("limitStorage","depthPriority","nearby"), new JSONObject(MapOf.of( "is_move",true,"stor_code", stIvtStructattr.getStor_code(),"vehicle_code",task.getVehicle_code(),"errorTask","errorTask")));
|
||||||
moveStruct.set(((Map<String, String>) process.get("form_data")).get("end_struct_code"));
|
moveStruct.set(((Map<String, String>) process.get("form_data")).get("end_struct_code"));
|
||||||
}, "1" + stIvtStructattr.getStor_code(), 5);
|
}, "1" + stIvtStructattr.getStor_code(), 5);
|
||||||
Map moveForm = MapOf.of("task_type", StatusEnum.IOBILL_TYPE_MOVE.code("异常位移库")
|
Map moveForm = MapOf.of("task_type", StatusEnum.IOBILL_TYPE_MOVE.code("异常位移库")
|
||||||
@@ -333,7 +333,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
|||||||
.dispenseTransa(ListOf.of("limitStorage","depthPriority","nearby")
|
.dispenseTransa(ListOf.of("limitStorage","depthPriority","nearby")
|
||||||
, new JSONObject(MapOf.of("stor_code", stIvtStructattr.getStor_code()
|
, new JSONObject(MapOf.of("stor_code", stIvtStructattr.getStor_code()
|
||||||
,"vehicle_code",task.getVehicle_code(),
|
,"vehicle_code",task.getVehicle_code(),
|
||||||
"start_point",task.getPoint_code1())));
|
"start_point",task.getPoint_code1(),"errorTask","errorTask")));
|
||||||
String new_struct_code = ((Map<String, String>) map.get("form_data")).get("end_struct_code");
|
String new_struct_code = ((Map<String, String>) map.get("form_data")).get("end_struct_code");
|
||||||
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
||||||
.set("remark", stIvtStructattr.getStruct_code() + "入满异常重新分配货位" + new_struct_code)
|
.set("remark", stIvtStructattr.getStruct_code() + "入满异常重新分配货位" + new_struct_code)
|
||||||
@@ -364,7 +364,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
|||||||
Map map = SpringContextHolder.getBean(DecisionHandler.class)
|
Map map = SpringContextHolder.getBean(DecisionHandler.class)
|
||||||
.dispenseTransa(ListOf.of("limitStorage","depthPriority","nearby"), new JSONObject(MapOf.of("stor_code", stIvtStructattr.getStor_code()
|
.dispenseTransa(ListOf.of("limitStorage","depthPriority","nearby"), new JSONObject(MapOf.of("stor_code", stIvtStructattr.getStor_code()
|
||||||
,"vehicle_code",task.getVehicle_code(),
|
,"vehicle_code",task.getVehicle_code(),
|
||||||
"start_point",task.getPoint_code1())));
|
"start_point",task.getPoint_code1(),"errorTask","errorTask")));
|
||||||
String new_struct_code = ((Map<String, String>) map.get("form_data")).get("end_struct_code");
|
String new_struct_code = ((Map<String, String>) map.get("form_data")).get("end_struct_code");
|
||||||
if (vehicleCode!=null){
|
if (vehicleCode!=null){
|
||||||
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
iActRuExecutionService.update(new UpdateWrapper<ActRuExecution>()
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public class SyncReceiptProcessHandler implements ClassProcess {
|
|||||||
if (model == null) {
|
if (model == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
model.put("FDate", DateUtil.now());
|
||||||
JSONArray fEntityArray = formData.getJSONObject("Model").getJSONArray("FEntity");
|
JSONArray fEntityArray = formData.getJSONObject("Model").getJSONArray("FEntity");
|
||||||
if ("RECEIPT_PRD".equals(formType)) {
|
if ("RECEIPT_PRD".equals(formType)) {
|
||||||
for (int i = 0; i < fEntityArray.size(); i++) {
|
for (int i = 0; i < fEntityArray.size(); i++) {
|
||||||
@@ -189,13 +190,6 @@ public class SyncReceiptProcessHandler implements ClassProcess {
|
|||||||
throw new BadRequestException("回传失败:查询物料信息,物料编码不存在:" + JSON.parseObject(fEntity.getString("FMaterialId")).getString("FNumber"));
|
throw new BadRequestException("回传失败:查询物料信息,物料编码不存在:" + JSON.parseObject(fEntity.getString("FMaterialId")).getString("FNumber"));
|
||||||
}
|
}
|
||||||
MdMeMaterialbase materialInfo = materialList.get(0);
|
MdMeMaterialbase materialInfo = materialList.get(0);
|
||||||
//没有启用批次号
|
|
||||||
if ("0".equals(materialInfo.getPrint_no())) {
|
|
||||||
if (fEntity.containsKey("FLot")) {
|
|
||||||
fEntity.remove("FLot");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//辅助单位
|
|
||||||
Map<String, Object> linkedMap = new LinkedHashMap<>();
|
Map<String, Object> linkedMap = new LinkedHashMap<>();
|
||||||
for (String key : fEntity.keySet()) {
|
for (String key : fEntity.keySet()) {
|
||||||
linkedMap.put(key, fEntity.get(key));
|
linkedMap.put(key, fEntity.get(key));
|
||||||
@@ -203,16 +197,23 @@ public class SyncReceiptProcessHandler implements ClassProcess {
|
|||||||
Map<String, Object> tempMap = new LinkedHashMap<>();
|
Map<String, Object> tempMap = new LinkedHashMap<>();
|
||||||
for (Map.Entry<String, Object> entry : linkedMap.entrySet()) {
|
for (Map.Entry<String, Object> entry : linkedMap.entrySet()) {
|
||||||
tempMap.put(entry.getKey(), entry.getValue());
|
tempMap.put(entry.getKey(), entry.getValue());
|
||||||
|
if ("FPPBomEntryId".equals(entry.getKey())) {
|
||||||
|
tempMap.put("FSrcBillType", "PRD_PPBOM");
|
||||||
|
tempMap.put("FSrcBillNo", jsonArray.getJSONObject(0).getString("BillNo"));
|
||||||
|
tempMap.put("FEntrySrcEnteryId", entity.getString("Id"));
|
||||||
|
tempMap.put("FEntrySrcEntrySeq", entity.getString("Seq"));
|
||||||
|
}
|
||||||
|
//辅助单位
|
||||||
if (!"0".equals(materialInfo.getAssist_unit_id()) && "FUnitID".equals(entry.getKey())) {
|
if (!"0".equals(materialInfo.getAssist_unit_id()) && "FUnitID".equals(entry.getKey())) {
|
||||||
JSONObject fUnit = new JSONObject();
|
JSONObject fUnit = new JSONObject();
|
||||||
fUnit.put("FNumber", materialInfo.getAssist_unit_id());
|
fUnit.put("FNumber", materialInfo.getAssist_unit_id());
|
||||||
tempMap.put("FSecUnitId", fUnit);
|
tempMap.put("FSecUnitId", fUnit);
|
||||||
}
|
}
|
||||||
if ("FActualQty".equals(entry.getKey())) {
|
//没有启用批次号
|
||||||
tempMap.put("FSrcBillType", "PRD_PPBOM");
|
if ("0".equals(materialInfo.getPrint_no())) {
|
||||||
tempMap.put("FSrcBillNo", jsonArray.getJSONObject(0).getString("BillNo"));
|
if (entry.getKey().contains("FLot")) {
|
||||||
tempMap.put("FEntrySrcEnteryId", entity.getString("Id"));
|
tempMap.remove("FLot");
|
||||||
tempMap.put("FEntrySrcEntrySeq", entity.getString("Seq"));
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JSONArray fEntityLinkArray = new JSONArray();
|
JSONArray fEntityLinkArray = new JSONArray();
|
||||||
|
|||||||
@@ -322,10 +322,21 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
|||||||
List<String> parents = pmFormDataDtos.stream().map(PmFormDataDto::getId).collect(Collectors.toList());
|
List<String> parents = pmFormDataDtos.stream().map(PmFormDataDto::getId).collect(Collectors.toList());
|
||||||
List<PmFormDataDto> childs = this.baseMapper.selectChilds(parents);
|
List<PmFormDataDto> childs = this.baseMapper.selectChilds(parents);
|
||||||
//过滤非料箱与托盘库
|
//过滤非料箱与托盘库
|
||||||
childs.removeIf(r ->
|
String stockId = "";
|
||||||
!new HashSet<>(Arrays.asList("1233925", "1233926"))
|
if (pmFormDataDtos.get(0).getCode().contains("PPBOM")) {
|
||||||
.contains(r.getForm_data().getString("stock_Id"))
|
stockId = "stock_Id";
|
||||||
);
|
} else if (pmFormDataDtos.get(0).getCode().contains("JDSCLLSQ")) {
|
||||||
|
stockId = "stockId";
|
||||||
|
} else if (pmFormDataDtos.get(0).getCode().contains("ZJDB")) {
|
||||||
|
stockId = "SrcStockId_Id";
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(stockId)) {
|
||||||
|
String finalStockId = stockId;
|
||||||
|
childs.removeIf(r ->
|
||||||
|
!new HashSet<>(Arrays.asList("1233925", "1233926"))
|
||||||
|
.contains(r.getForm_data().getString(finalStockId))
|
||||||
|
);
|
||||||
|
}
|
||||||
if (!CollectionUtils.isEmpty(childs)) {
|
if (!CollectionUtils.isEmpty(childs)) {
|
||||||
Map<String, List<PmFormDataDto>> childMap = childs.stream().collect(Collectors.groupingBy(PmFormDataDto::getParent_id));
|
Map<String, List<PmFormDataDto>> childMap = childs.stream().collect(Collectors.groupingBy(PmFormDataDto::getParent_id));
|
||||||
for (PmFormDataDto dataDto : pmFormDataDtos) {
|
for (PmFormDataDto dataDto : pmFormDataDtos) {
|
||||||
@@ -354,17 +365,27 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
|||||||
}
|
}
|
||||||
PmFormDataDto pmFormDataDto = pmFormDataDtos.get(0);
|
PmFormDataDto pmFormDataDto = pmFormDataDtos.get(0);
|
||||||
List<PmFormDataDto> childs = this.baseMapper.selectChilds(ListOf.of(pmFormDataDto.getId()));
|
List<PmFormDataDto> childs = this.baseMapper.selectChilds(ListOf.of(pmFormDataDto.getId()));
|
||||||
|
if (CollectionUtils.isEmpty(childs)) {
|
||||||
|
throw new BadRequestException(code + "单据明细数据为空");
|
||||||
|
}
|
||||||
//过滤非料箱与托盘库
|
//过滤非料箱与托盘库
|
||||||
childs.removeIf(r ->
|
String stockId = "";
|
||||||
!new HashSet<>(Arrays.asList("1233925", "1233926"))
|
if (code.contains("PPBOM")) {
|
||||||
.contains(r.getForm_data().getString("stock_Id"))
|
stockId = "stock_Id";
|
||||||
);
|
} else if (code.contains("JDSCLLSQ")) {
|
||||||
if (CollectionUtils.isEmpty(childs)){
|
stockId = "stockId";
|
||||||
throw new BadRequestException(code+"单据明细数据为空");
|
} else if (code.contains("ZJDB")) {
|
||||||
|
stockId = "SrcStockId_Id";
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(stockId)) {
|
||||||
|
String finalStockId = stockId;
|
||||||
|
childs.removeIf(r ->
|
||||||
|
!new HashSet<>(Arrays.asList("1233925", "1233926"))
|
||||||
|
.contains(r.getForm_data().getString(finalStockId))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
String productArea = pmFormDataDto.getForm_data().getString("product_area");
|
String productArea = pmFormDataDto.getForm_data().getString("product_area");
|
||||||
pmFormDataDto.setProduct_area(productArea);
|
pmFormDataDto.setProduct_area(productArea);
|
||||||
|
|
||||||
List<String> collect = childs.stream().map(PmFormDataDto::getMaterial_id).collect(Collectors.toList());
|
List<String> collect = childs.stream().map(PmFormDataDto::getMaterial_id).collect(Collectors.toList());
|
||||||
//TODO:指定仓库
|
//TODO:指定仓库
|
||||||
List<StructAssignQty> structMaterials = iStIvtStructattrService.getStructIvtAssign(collect, stor_code);
|
List<StructAssignQty> structMaterials = iStIvtStructattrService.getStructIvtAssign(collect, stor_code);
|
||||||
|
|||||||
Reference in New Issue
Block a user