mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、产品明细Service单元测试覆盖率异常修复;2、cad拆单新增支持板件的cadid和cad数据存储、生产单cadviewpath图纸路径存储;
This commit is contained in:
+5
@@ -24,6 +24,8 @@ public class WebCadDataBlockReqVO {
|
||||
private String name;
|
||||
private Integer type;
|
||||
private Integer custBlockNo;
|
||||
@JsonProperty(value = "ID")
|
||||
private Integer ID;
|
||||
|
||||
@Max(value = 99999, message = "板件宽度不能超过99999")
|
||||
@Min(value = 0, message = "板件宽度最小值为0")
|
||||
@@ -91,6 +93,9 @@ public class WebCadDataBlockReqVO {
|
||||
// private Long plateGoodsId;
|
||||
private String goodsCode;
|
||||
|
||||
@JsonProperty(value = "CadData")
|
||||
private String CadData;
|
||||
|
||||
private List<Integer> groupIds = new ArrayList<>();
|
||||
|
||||
public void setIsSpecialShape(boolean specialShape) {
|
||||
|
||||
+2
@@ -33,4 +33,6 @@ public class WebCadDataReqVO {
|
||||
|
||||
@JsonProperty(value = "Blocks")
|
||||
private List<WebCadDataDoubleRoomTreeReqVO> blocks;
|
||||
|
||||
private String cadViewPath;
|
||||
}
|
||||
|
||||
+5
@@ -157,4 +157,9 @@ public class OrderDO extends BaseDO {
|
||||
* 版本号:乐观锁用
|
||||
*/
|
||||
private int version;
|
||||
|
||||
/**
|
||||
* cad图纸路径
|
||||
*/
|
||||
private String cadViewPath;
|
||||
}
|
||||
|
||||
+10
@@ -291,4 +291,14 @@ public class PlateDO extends BaseDO {
|
||||
* 排单id
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* cad图纸id
|
||||
*/
|
||||
private Integer cadViewId;
|
||||
|
||||
/**
|
||||
* cad图纸数据
|
||||
*/
|
||||
private String cadData;
|
||||
}
|
||||
+13
-1
@@ -85,6 +85,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.zipString;
|
||||
import static com.cf.imes.module.plan.enums.ErrorCodeConstants.WEBCAD_ORDER_IMPORT_GET_ORG_SEALEDGE_ERROR;
|
||||
import static com.cf.imes.module.plan.enums.ErrorCodeConstants.WEBCAD_ORDER_IMPORT_ORDER_PLATENUM_CHECK_ERROR;
|
||||
import static com.cf.imes.module.plan.enums.ErrorCodeConstants.WEBCAD_ORDER_IMPORT_ORG_SEALEDGE_ANALYZE_ERROR;
|
||||
@@ -201,6 +202,9 @@ public class WebCadOrderImportAsyncFactory {
|
||||
|
||||
private String tempFilePath;
|
||||
|
||||
// cad图纸路径
|
||||
private String cadViewPath;
|
||||
|
||||
public WebCadOrderImportAsyncFactory(Long organId,
|
||||
OrderMapper orderMapper,
|
||||
SnowFlakeGenerator snowFlakeGenerator,
|
||||
@@ -268,6 +272,9 @@ public class WebCadOrderImportAsyncFactory {
|
||||
analyzeOrder(reader.readString());
|
||||
log.debug("====================【cad拆单解析生产单结束】====================");
|
||||
break;
|
||||
case "cadViewPath":
|
||||
cadViewPath = reader.readString();
|
||||
break;
|
||||
case "Materials":
|
||||
log.debug("====================【cad拆单解析板材开始】====================");
|
||||
analyzeMaterials(reader);
|
||||
@@ -843,6 +850,8 @@ public class WebCadOrderImportAsyncFactory {
|
||||
.deleted(false)
|
||||
.organId(organId)
|
||||
.planId(0L)
|
||||
.cadViewId(block.getID())
|
||||
.cadData(StringUtils.isNotEmpty(block.getCadData()) ? zipString(block.getCadData()) : null)
|
||||
.build();
|
||||
plateDO.setCreator(operatorName);
|
||||
plateDO.setUpdater(operatorName);
|
||||
@@ -1837,7 +1846,7 @@ public class WebCadOrderImportAsyncFactory {
|
||||
private void orderPlateBatchInsertWithinThreshold(List<PlateDO> list, boolean isLast) {
|
||||
// 达到批量的阈值就做一次插入
|
||||
if (CollUtil.isNotEmpty(list) && (list.size() >= BATCH_THRESHOLD_NUMBER || isLast)) {
|
||||
String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater, cad_view_id, cad_data) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
||||
@Override
|
||||
public void setValues(PreparedStatement ps, int index) throws SQLException {
|
||||
@@ -1892,6 +1901,8 @@ public class WebCadOrderImportAsyncFactory {
|
||||
ps.setTimestamp(48, Timestamp.valueOf(item.getUpdateTime()));
|
||||
ps.setString(49, item.getCreator());
|
||||
ps.setString(50, item.getUpdater());
|
||||
ps.setInt(51, item.getCadViewId());
|
||||
ps.setString(52, item.getCadData());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2201,6 +2212,7 @@ public class WebCadOrderImportAsyncFactory {
|
||||
.eq(OrderDO::getVersion, version)
|
||||
.set(OrderDO::getPlateNum, currentPlateNum)
|
||||
.set(OrderDO::getArea, currentPlateArea)
|
||||
.set(OrderDO::getCadViewPath, cadViewPath)
|
||||
.set(OrderDO::getVersion, version + 1));
|
||||
if (updated == 0) {
|
||||
throw new ServiceException(ErrorCodeConstants.WEBCAD_ORDER_IMPORT_ORDER_UPDATE_CONCURRENCY_ERROR, orderId);
|
||||
|
||||
+9
-3
@@ -75,6 +75,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.util.json.JsonUtils.zipString;
|
||||
import static com.cf.imes.module.plan.enums.ErrorCodeConstants.WEBCAD_ORDER_IMPORT_GET_ORG_SEALEDGE_ERROR;
|
||||
import static com.cf.imes.module.plan.enums.ErrorCodeConstants.WEBCAD_ORDER_IMPORT_ORDER_PLATENUM_CHECK_ERROR;
|
||||
import static com.cf.imes.module.plan.enums.ErrorCodeConstants.WEBCAD_ORDER_IMPORT_ORDER_PLATENUM_REACH_THRESHOLD_ERROR;
|
||||
@@ -265,7 +266,7 @@ public class WebCadOrderImportFactory {
|
||||
insertOrUpdatePlateNumGoods();
|
||||
|
||||
// 更新生产单板件数量
|
||||
updateOrderPlateNum();
|
||||
updateOrderPlateNum(webCadDataReqVO.getCadViewPath());
|
||||
|
||||
// 所有自定义板编号生成完成后更新配置到生产单
|
||||
customPlateNoGenerateService.updateCustomPlateNoGenerateConfig(plateNoGenerateConfigVO, orderDO);
|
||||
@@ -705,6 +706,8 @@ public class WebCadOrderImportFactory {
|
||||
.deleted(false)
|
||||
.organId(organId)
|
||||
.planId(0L)
|
||||
.cadViewId(block.getID())
|
||||
.cadData(StringUtils.isNotEmpty(block.getCadData()) ? zipString(block.getCadData()) : null)
|
||||
.build();
|
||||
plateDO.setCreator(operatorName);
|
||||
plateDO.setUpdater(operatorName);
|
||||
@@ -1694,7 +1697,7 @@ public class WebCadOrderImportFactory {
|
||||
private void orderPlateBatchInsertWithinThreshold(List<PlateDO> list, boolean isLast) {
|
||||
// 达到批量的阈值就做一次插入
|
||||
if (CollUtil.isNotEmpty(list) && (list.size() >= BATCH_THRESHOLD_NUMBER || isLast)) {
|
||||
String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
String sql = "INSERT INTO order_plate (id,organ_id,order_id,name,plate_no,type,goods_id,width,height,thickness,split_width,split_height,split_thickness,seal_left,seal_right,seal_up,seal_down,area,texture,hole_face,hole_arrange,unregular_point_count,front_hole_count,back_hole_count,side_hole_count,front_model_count,back_model_count,is_door,open_door_type,offset_x,offset_y,is_arc_across,module_type_id,is_special_shaped,is_sculpt,is_side_sculpt,is_2v,is_side_2v,is_row_hole,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater, cad_view_id, cad_data) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
||||
@Override
|
||||
public void setValues(PreparedStatement ps, int index) throws SQLException {
|
||||
@@ -1749,6 +1752,8 @@ public class WebCadOrderImportFactory {
|
||||
ps.setTimestamp(48, Timestamp.valueOf(item.getUpdateTime()));
|
||||
ps.setString(49, item.getCreator());
|
||||
ps.setString(50, item.getUpdater());
|
||||
ps.setInt(51, item.getCadViewId());
|
||||
ps.setString(52, item.getCadData());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2008,7 +2013,7 @@ public class WebCadOrderImportFactory {
|
||||
/**
|
||||
* 更新生产单的板件总数
|
||||
*/
|
||||
private void updateOrderPlateNum() {
|
||||
private void updateOrderPlateNum(String cadViewPath) {
|
||||
int version = orderDO.getVersion();
|
||||
Long orderId = orderDO.getId();
|
||||
int updated = orderMapper.update(new LambdaUpdateWrapper<OrderDO>()
|
||||
@@ -2017,6 +2022,7 @@ public class WebCadOrderImportFactory {
|
||||
.eq(OrderDO::getVersion, version)
|
||||
.set(OrderDO::getPlateNum, currentPlateNum)
|
||||
.set(OrderDO::getArea, currentPlateArea)
|
||||
.set(OrderDO::getCadViewPath, cadViewPath)
|
||||
.set(OrderDO::getVersion, version + 1));
|
||||
if (updated == 0) {
|
||||
throw new ServiceException(ErrorCodeConstants.WEBCAD_ORDER_IMPORT_ORDER_UPDATE_CONCURRENCY_ERROR, orderId);
|
||||
|
||||
Reference in New Issue
Block a user