cad拆单移除rawgoods操作

This commit is contained in:
gaoqr
2026-05-07 15:34:18 +08:00
parent 3ac29c5ebc
commit 58b8782f48
4 changed files with 2 additions and 67 deletions
@@ -30,7 +30,6 @@ import com.cf.imes.module.plan.dal.mysql.order.OrderMapper;
import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper; import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper;
import com.cf.imes.module.plan.dal.mysql.orderImport.OrderImportTaskMapper; import com.cf.imes.module.plan.dal.mysql.orderImport.OrderImportTaskMapper;
import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper; import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper;
import com.cf.imes.module.plan.dal.mysql.rawgoods.RawGoodsMapper;
import com.cf.imes.module.plan.enums.ErrorCodeConstants; import com.cf.imes.module.plan.enums.ErrorCodeConstants;
import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService; import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService;
import com.cf.imes.module.plan.service.order.OrderInputProcessor; import com.cf.imes.module.plan.service.order.OrderInputProcessor;
@@ -105,9 +104,6 @@ public class WebCadOrderImportServiceImpl implements WebCadOrderImportService {
@Resource @Resource
private GoodsMapper goodsMapper; private GoodsMapper goodsMapper;
@Resource
private RawGoodsMapper rawGoodsMapper;
@Resource @Resource
private SystemConfigApi systemConfigApi; private SystemConfigApi systemConfigApi;
@@ -168,7 +164,7 @@ public class WebCadOrderImportServiceImpl implements WebCadOrderImportService {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
WebCadDataReqVO webCadDataReqVO = mapper.readValue(parser, WebCadDataReqVO.class); WebCadDataReqVO webCadDataReqVO = mapper.readValue(parser, WebCadDataReqVO.class);
WebCadOrderImportFactory webCadOrderImportFactory = new WebCadOrderImportFactory(organId, orderDO, snowFlakeGenerator, orderMapper, orderBodyMapper, plateMapper, WebCadOrderImportFactory webCadOrderImportFactory = new WebCadOrderImportFactory(organId, orderDO, snowFlakeGenerator, orderMapper, orderBodyMapper, plateMapper,
idWorker, orderInputProcessor, goodsMapper, rawGoodsMapper, customPlateNoGenerateService, systemConfigApi, webCadImportProperties.getCadImportPlateNumThreshold(), jdbcTemplate); idWorker, orderInputProcessor, goodsMapper, customPlateNoGenerateService, systemConfigApi, webCadImportProperties.getCadImportPlateNumThreshold(), jdbcTemplate);
// cad图纸文件id // cad图纸文件id
cadViewFileId = webCadDataReqVO.getCadViewFileId(); cadViewFileId = webCadDataReqVO.getCadViewFileId();
@@ -16,7 +16,6 @@ import com.cf.imes.module.plan.dal.mysql.order.OrderMapper;
import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper; import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper;
import com.cf.imes.module.plan.dal.mysql.orderImport.OrderImportTaskMapper; import com.cf.imes.module.plan.dal.mysql.orderImport.OrderImportTaskMapper;
import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper; import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper;
import com.cf.imes.module.plan.dal.mysql.rawgoods.RawGoodsMapper;
import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService; import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService;
import com.cf.imes.module.plan.service.order.OrderInputProcessor; import com.cf.imes.module.plan.service.order.OrderInputProcessor;
import com.cf.imes.module.plan.service.orderImport.OrderImportTaskService; import com.cf.imes.module.plan.service.orderImport.OrderImportTaskService;
@@ -78,9 +77,6 @@ public class WebCadOrderImportConsumer {
@Resource @Resource
private GoodsMapper goodsMapper; private GoodsMapper goodsMapper;
@Resource
private RawGoodsMapper rawGoodsMapper;
@Resource @Resource
private SystemConfigApi systemConfigApi; private SystemConfigApi systemConfigApi;
@@ -146,7 +142,7 @@ public class WebCadOrderImportConsumer {
log.info("====================【webcad异步拆单处理临时数据开始】===================="); log.info("====================【webcad异步拆单处理临时数据开始】====================");
WebCadOrderImportAsyncFactory webCadOrderImportAsyncFactory = WebCadOrderImportAsyncFactory webCadOrderImportAsyncFactory =
new WebCadOrderImportAsyncFactory(organId, orderMapper, snowFlakeGenerator, orderBodyMapper, plateMapper, idWorker, new WebCadOrderImportAsyncFactory(organId, orderMapper, snowFlakeGenerator, orderBodyMapper, plateMapper, idWorker,
orderImportTaskMapper, orderInputProcessor, goodsMapper, rawGoodsMapper, customPlateNoGenerateService, systemConfigApi, orderImportTaskDO.getCreator(), orderImportTaskMapper, orderInputProcessor, goodsMapper, customPlateNoGenerateService, systemConfigApi, orderImportTaskDO.getCreator(),
cadImportPlateNumThreshold, jdbcTemplate); cadImportPlateNumThreshold, jdbcTemplate);
webCadOrderImportAsyncFactory.analyzeTempData(taskId, webCadImportProperties.getTempFilePath()); webCadOrderImportAsyncFactory.analyzeTempData(taskId, webCadImportProperties.getTempFilePath());
log.info("====================【webcad异步拆单处理临时数据结束】===================="); log.info("====================【webcad异步拆单处理临时数据结束】====================");
@@ -42,7 +42,6 @@ import com.cf.imes.module.plan.dal.dataobject.orderItem.OrderItemDO;
import com.cf.imes.module.plan.dal.dataobject.orderParts.OrderPartsDO; import com.cf.imes.module.plan.dal.dataobject.orderParts.OrderPartsDO;
import com.cf.imes.module.plan.dal.dataobject.ordermodel.OrderModelDO; import com.cf.imes.module.plan.dal.dataobject.ordermodel.OrderModelDO;
import com.cf.imes.module.plan.dal.dataobject.plate.PlateDO; import com.cf.imes.module.plan.dal.dataobject.plate.PlateDO;
import com.cf.imes.module.plan.dal.dataobject.rawgoods.RawGoodsDO;
import com.cf.imes.module.plan.dal.elasticsearch.HoleDetail; import com.cf.imes.module.plan.dal.elasticsearch.HoleDetail;
import com.cf.imes.module.plan.dal.elasticsearch.IContourData; import com.cf.imes.module.plan.dal.elasticsearch.IContourData;
import com.cf.imes.module.plan.dal.elasticsearch.IOriginModelingData; import com.cf.imes.module.plan.dal.elasticsearch.IOriginModelingData;
@@ -56,7 +55,6 @@ import com.cf.imes.module.plan.dal.mysql.order.OrderMapper;
import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper; import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper;
import com.cf.imes.module.plan.dal.mysql.orderImport.OrderImportTaskMapper; import com.cf.imes.module.plan.dal.mysql.orderImport.OrderImportTaskMapper;
import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper; import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper;
import com.cf.imes.module.plan.dal.mysql.rawgoods.RawGoodsMapper;
import com.cf.imes.module.plan.enums.ErrorCodeConstants; import com.cf.imes.module.plan.enums.ErrorCodeConstants;
import com.cf.imes.module.plan.enums.ordercomponent.OrderComponentProcessStatusEnum; import com.cf.imes.module.plan.enums.ordercomponent.OrderComponentProcessStatusEnum;
import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService; import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService;
@@ -126,8 +124,6 @@ public class WebCadOrderImportAsyncFactory {
private GoodsMapper goodsMapper; private GoodsMapper goodsMapper;
private RawGoodsMapper rawGoodsMapper;
private CustomPlateNoGenerateService customPlateNoGenerateService; private CustomPlateNoGenerateService customPlateNoGenerateService;
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
@@ -182,7 +178,6 @@ public class WebCadOrderImportAsyncFactory {
private List<OrderItemDO> orderItemDOS = new ArrayList<>(); private List<OrderItemDO> orderItemDOS = new ArrayList<>();
private List<OrderPartsDO> orderPartsDOS = new ArrayList<>(); private List<OrderPartsDO> orderPartsDOS = new ArrayList<>();
private List<OrderModelDO> orderModelDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER); private List<OrderModelDO> orderModelDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
private List<RawGoodsDO> rawGoodsDOS = new ArrayList<>();
private List<GoodsDO> goodsDOS = new ArrayList<>(); private List<GoodsDO> goodsDOS = new ArrayList<>();
private List<OrderComponentDO> orderComponentDOS = new ArrayList<>(); private List<OrderComponentDO> orderComponentDOS = new ArrayList<>();
private List<SystemConfigSealEdgeRespDTO> sealEdgeConfigList; private List<SystemConfigSealEdgeRespDTO> sealEdgeConfigList;
@@ -218,7 +213,6 @@ public class WebCadOrderImportAsyncFactory {
OrderImportTaskMapper orderImportTaskMapper, OrderImportTaskMapper orderImportTaskMapper,
OrderInputProcessor orderInputProcessor, OrderInputProcessor orderInputProcessor,
GoodsMapper goodsMapper, GoodsMapper goodsMapper,
RawGoodsMapper rawGoodsMapper,
CustomPlateNoGenerateService customPlateNoGenerateService, CustomPlateNoGenerateService customPlateNoGenerateService,
SystemConfigApi systemConfigApi, SystemConfigApi systemConfigApi,
String operatorName, String operatorName,
@@ -233,7 +227,6 @@ public class WebCadOrderImportAsyncFactory {
this.orderImportTaskMapper = orderImportTaskMapper; this.orderImportTaskMapper = orderImportTaskMapper;
this.orderInputProcessor = orderInputProcessor; this.orderInputProcessor = orderInputProcessor;
this.goodsMapper = goodsMapper; this.goodsMapper = goodsMapper;
this.rawGoodsMapper = rawGoodsMapper;
this.customPlateNoGenerateService = customPlateNoGenerateService; this.customPlateNoGenerateService = customPlateNoGenerateService;
this.systemConfigApi = systemConfigApi; this.systemConfigApi = systemConfigApi;
this.operatorName = operatorName; this.operatorName = operatorName;
@@ -480,27 +473,6 @@ public class WebCadOrderImportAsyncFactory {
// 创建设计端商品 // 创建设计端商品
Long rawGoodsId = (Long) snowFlakeGenerator.nextId(null); Long rawGoodsId = (Long) snowFlakeGenerator.nextId(null);
RawGoodsDO rawGoodsDO = RawGoodsDO.builder()
.id(rawGoodsId)
.orderId(orderId)
.rawGoodsId(plateGoodsGoodsId)
.goodsName(materialReqVO.getName())
.material(materialReqVO.getMaterial())
.texture(materialReqVO.getTexture())
.color(materialReqVO.getColor())
.colorBlack(EMPTY_STRING)
.thickness(materialReqVO.getThickness())
.spec(getEmpty(materialReqVO.getSpec()))
.brand(getEmpty(materialReqVO.getBrand()))
.price(0.00)
.deleted(false)
.organId(organId)
.build();
rawGoodsDO.setCreator(operatorName);
rawGoodsDO.setUpdater(operatorName);
rawGoodsDO.setCreateTime(now);
rawGoodsDO.setUpdateTime(now);
orderGoodsId = (Long) snowFlakeGenerator.nextId(null); orderGoodsId = (Long) snowFlakeGenerator.nextId(null);
// 创建订单商品 // 创建订单商品
GoodsDO goodsDO = GoodsDO.builder() GoodsDO goodsDO = GoodsDO.builder()
@@ -536,7 +508,6 @@ public class WebCadOrderImportAsyncFactory {
goodsDO.setUpdateTime(now); goodsDO.setUpdateTime(now);
goodsDOS.add(goodsDO); goodsDOS.add(goodsDO);
rawGoodsDOS.add(rawGoodsDO);
// 缓存goodCode和orderGoodsId的对应关系 // 缓存goodCode和orderGoodsId的对应关系
materialMap.put(plateGoodsGoodsId, goodsDO); materialMap.put(plateGoodsGoodsId, goodsDO);
@@ -544,7 +515,6 @@ public class WebCadOrderImportAsyncFactory {
} }
reader.endArray(); reader.endArray();
orderInfoBatchInsertWithinThreshold(rawGoodsMapper, rawGoodsDOS, true);
} }
/** /**
@@ -2491,7 +2461,6 @@ public class WebCadOrderImportAsyncFactory {
orderItemDOS = null; orderItemDOS = null;
orderPartsDOS = null; orderPartsDOS = null;
orderModelDOS = null; orderModelDOS = null;
rawGoodsDOS = null;
goodsDOS = null; goodsDOS = null;
orderComponentDOS = null; orderComponentDOS = null;
sealEdgeConfigList = null; sealEdgeConfigList = null;
@@ -38,7 +38,6 @@ import com.cf.imes.module.plan.dal.dataobject.orderItem.OrderItemDO;
import com.cf.imes.module.plan.dal.dataobject.orderParts.OrderPartsDO; import com.cf.imes.module.plan.dal.dataobject.orderParts.OrderPartsDO;
import com.cf.imes.module.plan.dal.dataobject.ordermodel.OrderModelDO; import com.cf.imes.module.plan.dal.dataobject.ordermodel.OrderModelDO;
import com.cf.imes.module.plan.dal.dataobject.plate.PlateDO; import com.cf.imes.module.plan.dal.dataobject.plate.PlateDO;
import com.cf.imes.module.plan.dal.dataobject.rawgoods.RawGoodsDO;
import com.cf.imes.module.plan.dal.elasticsearch.HoleDetail; import com.cf.imes.module.plan.dal.elasticsearch.HoleDetail;
import com.cf.imes.module.plan.dal.elasticsearch.IContourData; import com.cf.imes.module.plan.dal.elasticsearch.IContourData;
import com.cf.imes.module.plan.dal.elasticsearch.IOriginModelingData; import com.cf.imes.module.plan.dal.elasticsearch.IOriginModelingData;
@@ -51,7 +50,6 @@ import com.cf.imes.module.plan.dal.mysql.goods.GoodsMapper;
import com.cf.imes.module.plan.dal.mysql.order.OrderMapper; import com.cf.imes.module.plan.dal.mysql.order.OrderMapper;
import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper; import com.cf.imes.module.plan.dal.mysql.orderBody.OrderBodyMapper;
import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper; import com.cf.imes.module.plan.dal.mysql.plate.PlateMapper;
import com.cf.imes.module.plan.dal.mysql.rawgoods.RawGoodsMapper;
import com.cf.imes.module.plan.enums.ErrorCodeConstants; import com.cf.imes.module.plan.enums.ErrorCodeConstants;
import com.cf.imes.module.plan.enums.ordercomponent.OrderComponentProcessStatusEnum; import com.cf.imes.module.plan.enums.ordercomponent.OrderComponentProcessStatusEnum;
import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService; import com.cf.imes.module.plan.service.customplateno.CustomPlateNoGenerateService;
@@ -114,8 +112,6 @@ public class WebCadOrderImportFactory {
private GoodsMapper goodsMapper; private GoodsMapper goodsMapper;
private RawGoodsMapper rawGoodsMapper;
private CustomPlateNoGenerateService customPlateNoGenerateService; private CustomPlateNoGenerateService customPlateNoGenerateService;
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
@@ -170,7 +166,6 @@ public class WebCadOrderImportFactory {
private List<OrderItemDO> orderItemDOS = new ArrayList<>(); private List<OrderItemDO> orderItemDOS = new ArrayList<>();
private List<OrderPartsDO> orderPartsDOS = new ArrayList<>(); private List<OrderPartsDO> orderPartsDOS = new ArrayList<>();
private List<OrderModelDO> orderModelDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER); private List<OrderModelDO> orderModelDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
private List<RawGoodsDO> rawGoodsDOS = new ArrayList<>();
private List<GoodsDO> goodsDOS = new ArrayList<>(); private List<GoodsDO> goodsDOS = new ArrayList<>();
private List<OrderComponentDO> orderComponentDOS = new ArrayList<>(); private List<OrderComponentDO> orderComponentDOS = new ArrayList<>();
private List<SystemConfigSealEdgeRespDTO> sealEdgeConfigList; private List<SystemConfigSealEdgeRespDTO> sealEdgeConfigList;
@@ -207,7 +202,6 @@ public class WebCadOrderImportFactory {
SnowflakeIdWorker3rd idWorker, SnowflakeIdWorker3rd idWorker,
OrderInputProcessor orderInputProcessor, OrderInputProcessor orderInputProcessor,
GoodsMapper goodsMapper, GoodsMapper goodsMapper,
RawGoodsMapper rawGoodsMapper,
CustomPlateNoGenerateService customPlateNoGenerateService, CustomPlateNoGenerateService customPlateNoGenerateService,
SystemConfigApi systemConfigApi, SystemConfigApi systemConfigApi,
int cadImportPlateNumThreshold, int cadImportPlateNumThreshold,
@@ -222,7 +216,6 @@ public class WebCadOrderImportFactory {
this.idWorker = idWorker; this.idWorker = idWorker;
this.orderInputProcessor = orderInputProcessor; this.orderInputProcessor = orderInputProcessor;
this.goodsMapper = goodsMapper; this.goodsMapper = goodsMapper;
this.rawGoodsMapper = rawGoodsMapper;
this.customPlateNoGenerateService = customPlateNoGenerateService; this.customPlateNoGenerateService = customPlateNoGenerateService;
this.systemConfigApi = systemConfigApi; this.systemConfigApi = systemConfigApi;
operatorName = SecurityFrameworkUtils.getLoginUser().getNickname(); operatorName = SecurityFrameworkUtils.getLoginUser().getNickname();
@@ -415,22 +408,6 @@ public class WebCadOrderImportFactory {
if (ObjectUtil.isNull(existOrderGoods)) { if (ObjectUtil.isNull(existOrderGoods)) {
// 创建设计端商品 // 创建设计端商品
Long rawGoodsId = (Long) snowFlakeGenerator.nextId(null); Long rawGoodsId = (Long) snowFlakeGenerator.nextId(null);
RawGoodsDO rawGoodsDO = RawGoodsDO.builder()
.id(rawGoodsId)
.orderId(orderId)
.rawGoodsId(plateGoodsGoodsId)
.goodsName(materialReqVO.getName())
.material(materialReqVO.getMaterial())
.texture(materialReqVO.getTexture())
.color(materialReqVO.getColor())
.colorBlack(EMPTY_STRING)
.thickness(materialReqVO.getThickness())
.spec(getEmpty(materialReqVO.getSpec()))
.brand(getEmpty(materialReqVO.getBrand()))
.price(0.00)
.deleted(false)
.organId(organId)
.build();
Long orderGoodsId = (Long) snowFlakeGenerator.nextId(null); Long orderGoodsId = (Long) snowFlakeGenerator.nextId(null);
// 创建订单商品 // 创建订单商品
@@ -463,13 +440,11 @@ public class WebCadOrderImportFactory {
.build(); .build();
goodsDOS.add(goodsDO); goodsDOS.add(goodsDO);
rawGoodsDOS.add(rawGoodsDO);
// 缓存goodCode和orderGoodsId的对应关系 // 缓存goodCode和orderGoodsId的对应关系
materialMap.put(plateGoodsGoodsId, goodsDO); materialMap.put(plateGoodsGoodsId, goodsDO);
} }
} }
orderInfoBatchInsertWithinThreshold(rawGoodsMapper, rawGoodsDOS, true);
} }
/** /**
@@ -2369,7 +2344,6 @@ public class WebCadOrderImportFactory {
orderItemDOS = null; orderItemDOS = null;
orderPartsDOS = null; orderPartsDOS = null;
orderModelDOS = null; orderModelDOS = null;
rawGoodsDOS = null;
goodsDOS = null; goodsDOS = null;
orderComponentDOS = null; orderComponentDOS = null;
sealEdgeConfigList = null; sealEdgeConfigList = null;