mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
禅道#1470问题修复
This commit is contained in:
+39
-7
@@ -165,6 +165,9 @@ public class WebCadOrderImportFactory {
|
||||
// 房间名+柜体名+加工组名
|
||||
private Map<String, OrderGroupDO> orderGroupMap = new HashMap<>();
|
||||
|
||||
// 板材缓存:{商品编号:order_goods}
|
||||
private Map<String, GoodsDO> materialMap = new HashMap<>();
|
||||
|
||||
// 加工组缓存
|
||||
private Map<Integer, WebCadDataBlockReqVO.GroupInfo> processGroupMap = new HashMap<>();
|
||||
|
||||
@@ -340,11 +343,21 @@ public class WebCadOrderImportFactory {
|
||||
for (WebCadDataMaterialReqVO materialReqVO : materialReqVOS) {
|
||||
String plateGoodsId = materialReqVO.getId();
|
||||
String plateGoodsGoodsId = materialReqVO.getGoodsId();
|
||||
List<Integer> orginIds = materialReqVO.getOrginIds();
|
||||
PlateGoodDO plateGoodDO = plateGoodMapper.selectById(plateGoodsId);
|
||||
// 检查板材库
|
||||
if (ObjectUtil.isNull(plateGoodDO)) {
|
||||
throw ServiceExceptionUtil.exception(WEBCAD_ORDER_IMPORT_PLATE_NOT_EXIST_ERROR, plateGoodsId);
|
||||
}
|
||||
// 获取缓存的orderGoods
|
||||
GoodsDO cacheOrderPlate = materialMap.get(plateGoodsGoodsId);
|
||||
// 缓存没有才创建
|
||||
if (ObjectUtil.isNotNull(cacheOrderPlate)) {
|
||||
Long cacheOrderPlateId = cacheOrderPlate.getId();
|
||||
// 使用缓存中的order_goods信息赋值到板件
|
||||
setGoodsInfoToBlock(plateGoodsGoodsId, cacheOrderPlateId, orginIds, blockReqVOS);
|
||||
continue;
|
||||
}
|
||||
// 检查生产单下是否已经有板材下的order_goods,有不再创建
|
||||
List<GoodsDO> existOrderGoods = goodsMapper.selectList(new LambdaUpdateWrapper<GoodsDO>()
|
||||
.eq(GoodsDO::getGoodsId, plateGoodsGoodsId)
|
||||
@@ -400,19 +413,37 @@ public class WebCadOrderImportFactory {
|
||||
|
||||
goodsDOS.add(goodsDO);
|
||||
rawGoodsDOS.add(rawGoodsDO);
|
||||
|
||||
// 缓存板材
|
||||
materialMap.put(plateGoodsGoodsId, goodsDO);
|
||||
}
|
||||
for (Integer blockIndex : materialReqVO.getOrginIds()) {
|
||||
// blockIndex序号获取对应板件a
|
||||
WebCadDataBlockReqVO webCadDataBlockReqVO = blockReqVOS.get(blockIndex - 1);
|
||||
// 把板材的id和goodsId赋给cad板件
|
||||
webCadDataBlockReqVO.setGoodsId(plateGoodsGoodsId);
|
||||
webCadDataBlockReqVO.setPlateGoodsId(orderGoodsId);
|
||||
}
|
||||
setGoodsInfoToBlock(plateGoodsGoodsId, orderGoodsId, orginIds, blockReqVOS);
|
||||
}
|
||||
orderInfoBatchInsertWithinThreshold(rawGoodsMapper, rawGoodsDOS, true);
|
||||
orderInfoBatchInsertWithinThreshold(goodsMapper, goodsDOS, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 板件信息映射到对应的cad板材中
|
||||
*
|
||||
* @param plateGoodsGoodsId
|
||||
* @param orderGoodsId
|
||||
* @param orginIds
|
||||
* @param blockReqVOS
|
||||
*/
|
||||
private void setGoodsInfoToBlock(String plateGoodsGoodsId, Long orderGoodsId, List<Integer> orginIds, List<WebCadDataBlockReqVO> blockReqVOS) {
|
||||
if (CollUtil.isEmpty(orginIds)) {
|
||||
return;
|
||||
}
|
||||
for (Integer blockIndex : orginIds) {
|
||||
// blockIndex序号获取对应板件a
|
||||
WebCadDataBlockReqVO webCadDataBlockReqVO = blockReqVOS.get(blockIndex - 1);
|
||||
// 把板材的id和goodsId赋给cad板件
|
||||
webCadDataBlockReqVO.setGoodsId(plateGoodsGoodsId);
|
||||
webCadDataBlockReqVO.setPlateGoodsId(orderGoodsId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存加工组类型
|
||||
*
|
||||
@@ -1842,6 +1873,7 @@ public class WebCadOrderImportFactory {
|
||||
bodyMap.clear();
|
||||
sealEdgeConfigList.clear();
|
||||
processGroupMap.clear();
|
||||
materialMap.clear();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user