mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新增order_plate_less测试入口
This commit is contained in:
+3
-2
@@ -45,8 +45,9 @@ public class ProducingOrderImportReqVO {
|
|||||||
* 是否将板件写入精简测试表。
|
* 是否将板件写入精简测试表。
|
||||||
*
|
*
|
||||||
* <p>仅用于显式对比批量插入字段数量对性能的影响;缺省或传 {@code false} 时仍写入
|
* <p>仅用于显式对比批量插入字段数量对性能的影响;缺省或传 {@code false} 时仍写入
|
||||||
* {@code order_plate},传 {@code true} 时改写 {@code order_plate_less}。测试模式生成的
|
* {@code order_plate},传 {@code true} 时改写 {@code order_plate_less},并跳过
|
||||||
* 订单数据不完整,不应作为后续生产业务数据使用。</p>
|
* {@code model_data} 的压缩和写入。测试模式生成的订单数据不完整,不应作为后续
|
||||||
|
* 生产业务数据使用。</p>
|
||||||
*/
|
*/
|
||||||
@Schema(description = "是否将板件写入 order_plate_less 进行性能测试,缺省为 false",
|
@Schema(description = "是否将板件写入 order_plate_less 进行性能测试,缺省为 false",
|
||||||
defaultValue = "false")
|
defaultValue = "false")
|
||||||
|
|||||||
+29
-23
@@ -307,7 +307,8 @@ public class ProducingOrderImportFactory {
|
|||||||
try {
|
try {
|
||||||
if (useLessPlateTable) {
|
if (useLessPlateTable) {
|
||||||
log.warn("[producing-import-test] orderId={} plateTable=order_plate_less "
|
log.warn("[producing-import-test] orderId={} plateTable=order_plate_less "
|
||||||
+ "测试模式生成的数据不完整,仅用于批量插入性能对比", orderId);
|
+ "skipPlateModelData=true 测试模式生成的数据不完整,仅用于批量插入性能对比",
|
||||||
|
orderId);
|
||||||
}
|
}
|
||||||
cadViewFileId = producingImportData.getCadViewFileId();
|
cadViewFileId = producingImportData.getCadViewFileId();
|
||||||
useConcreteProcessGroupName = producingImportData.isUseConcreteProcessGroupName();
|
useConcreteProcessGroupName = producingImportData.isUseConcreteProcessGroupName();
|
||||||
@@ -2492,11 +2493,7 @@ public class ProducingOrderImportFactory {
|
|||||||
long[] compressionNanos = {0L};
|
long[] compressionNanos = {0L};
|
||||||
String tableName = useLessPlateTable ? "order_plate_less" : "order_plate";
|
String tableName = useLessPlateTable ? "order_plate_less" : "order_plate";
|
||||||
String sql = useLessPlateTable
|
String sql = useLessPlateTable
|
||||||
? "INSERT INTO order_plate_less (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,is_door,open_door_type,module_type_id,is_optimized,is_cutted,filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,creator,updater,cad_plate_no,model_data,reserved_edge_left,reserved_edge_right,reserved_edge_up,reserved_edge_down,source_block_item_id) "
|
? buildLessPlateInsertSql()
|
||||||
+ "VALUES (?,?,?,?,?,?,?,?,?,?"
|
|
||||||
+ ",?,?,?,?,?,?,?,?,?,?"
|
|
||||||
+ ",?,?,?,?,?,?,?,?,?,?"
|
|
||||||
+ ",?,?,?,?,?,?,?,?,?,?)"
|
|
||||||
: "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_plate_no, model_data, reserved_edge_left, reserved_edge_right, reserved_edge_up, reserved_edge_down, source_block_item_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
: "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_plate_no, model_data, reserved_edge_left, reserved_edge_right, reserved_edge_up, reserved_edge_down, source_block_item_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||||
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@@ -2600,11 +2597,28 @@ public class ProducingOrderImportFactory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建精简板件表的批量插入语句。
|
||||||
|
*
|
||||||
|
* @return 与当前造型测试模式匹配的插入 SQL
|
||||||
|
*/
|
||||||
|
private String buildLessPlateInsertSql() {
|
||||||
|
String columns = "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,is_door,open_door_type,module_type_id,is_optimized,is_cutted,"
|
||||||
|
+ "filter_type,remark,is_cancel,deleted,custom_plate_no,create_time,update_time,"
|
||||||
|
+ "creator,updater,cad_plate_no,";
|
||||||
|
return "INSERT INTO order_plate_less (" + columns
|
||||||
|
+ "reserved_edge_left,reserved_edge_right,reserved_edge_up,reserved_edge_down,"
|
||||||
|
+ "source_block_item_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
|
||||||
|
+ "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将板件绑定到精简性能测试表对应的40个字段。
|
* 将板件绑定到精简性能测试表对应的40个字段。
|
||||||
*
|
*
|
||||||
* <p>造型数据仍按正式导入逻辑压缩,确保两种模式只比较目标表字段数量,避免改变
|
* <p>精简测试模式固定跳过 {@code model_data} 的压缩和写入,用于测量移除造型大字段
|
||||||
* {@code model_data} 处理方式干扰测试结果。</p>
|
* 后的板件批量写入耗时。</p>
|
||||||
*
|
*
|
||||||
* @param ps 批量插入预编译语句
|
* @param ps 批量插入预编译语句
|
||||||
* @param item 板件数据
|
* @param item 板件数据
|
||||||
@@ -2647,21 +2661,13 @@ public class ProducingOrderImportFactory {
|
|||||||
ps.setString(33, item.getUpdater());
|
ps.setString(33, item.getUpdater());
|
||||||
ps.setString(34, item.getCadPlateNo());
|
ps.setString(34, item.getCadPlateNo());
|
||||||
|
|
||||||
long compressionNanos = 0L;
|
int reservedEdgeStartIndex = 35;
|
||||||
String modelData = item.getModelData();
|
setSqlDefaultBigDecimal(ps, reservedEdgeStartIndex, item.getReservedEdgeLeft());
|
||||||
if (StringUtils.isNotEmpty(modelData)) {
|
setSqlDefaultBigDecimal(ps, reservedEdgeStartIndex + 1, item.getReservedEdgeRight());
|
||||||
long compressionStartedAt = System.nanoTime();
|
setSqlDefaultBigDecimal(ps, reservedEdgeStartIndex + 2, item.getReservedEdgeUp());
|
||||||
ps.setString(35, JsonUtils.zipString(modelData));
|
setSqlDefaultBigDecimal(ps, reservedEdgeStartIndex + 3, item.getReservedEdgeDown());
|
||||||
compressionNanos = System.nanoTime() - compressionStartedAt;
|
ps.setString(reservedEdgeStartIndex + 4, item.getSourceBlockItemId());
|
||||||
} else {
|
return 0L;
|
||||||
ps.setNull(35, Types.LONGVARCHAR);
|
|
||||||
}
|
|
||||||
setSqlDefaultBigDecimal(ps, 36, item.getReservedEdgeLeft());
|
|
||||||
setSqlDefaultBigDecimal(ps, 37, item.getReservedEdgeRight());
|
|
||||||
setSqlDefaultBigDecimal(ps, 38, item.getReservedEdgeUp());
|
|
||||||
setSqlDefaultBigDecimal(ps, 39, item.getReservedEdgeDown());
|
|
||||||
ps.setString(40, item.getSourceBlockItemId());
|
|
||||||
return compressionNanos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user