mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、cad拆单支持造型数据压缩存入mysql;2、未排单数据、计算用板量、优化生产接口支持mysql造型数据替换es造型数据;
This commit is contained in:
+85
-9
@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
@@ -75,7 +76,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readValue(text, clazz);
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -89,7 +90,7 @@ public class JsonUtils {
|
||||
JsonNode pathNode = treeNode.path(path);
|
||||
return objectMapper.readValue(pathNode.toString(), clazz);
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +102,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readValue(text, objectMapper.getTypeFactory().constructType(type));
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -129,7 +130,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readValue(bytes, clazz);
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, bytes, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, bytes, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -138,7 +139,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readValue(text, typeReference);
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -150,7 +151,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readValue(text, objectMapper.getTypeFactory().constructCollectionType(List.class, clazz));
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -164,7 +165,7 @@ public class JsonUtils {
|
||||
JsonNode pathNode = treeNode.path(path);
|
||||
return objectMapper.readValue(pathNode.toString(), objectMapper.getTypeFactory().constructCollectionType(List.class, clazz));
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -173,7 +174,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readTree(text);
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -182,7 +183,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readTree(text);
|
||||
} catch (IOException e) {
|
||||
log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
// log.error(JSON_PARSE_ERROR_NOTIFICATION, text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -269,5 +270,80 @@ public class JsonUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 压缩
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static byte[] zip(String str) {
|
||||
|
||||
Deflater deflater = new Deflater(Deflater.DEFAULT_COMPRESSION);
|
||||
|
||||
deflater.setInput(str.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
deflater.finish();
|
||||
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
while (!deflater.finished()) {
|
||||
int len = deflater.deflate(buffer);
|
||||
outputStream.write(buffer, 0, len);
|
||||
}
|
||||
|
||||
deflater.end();
|
||||
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解压缩
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static String unzip(byte[] data) {
|
||||
|
||||
Inflater inflater = new Inflater();
|
||||
|
||||
inflater.setInput(data);
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
|
||||
|
||||
while (!inflater.finished()) {
|
||||
|
||||
int len = inflater.inflate(buffer);
|
||||
|
||||
// 防止异常数据导致死循环
|
||||
if (len == 0) {
|
||||
|
||||
if (inflater.needsInput()) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (inflater.needsDictionary()) {
|
||||
throw new RuntimeException("Inflater needs dictionary");
|
||||
}
|
||||
}
|
||||
|
||||
outputStream.write(buffer, 0, len);
|
||||
}
|
||||
|
||||
return outputStream.toString(StandardCharsets.UTF_8);
|
||||
|
||||
} catch (DataFormatException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} finally {
|
||||
inflater.end();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.cf.imes.framework.mybatis.core.type;
|
||||
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.type.BaseTypeHandler;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* mb自定义压缩字符串到byte[]类型转换器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/5/11 14:22
|
||||
*/
|
||||
public class CompressByteTypeHandler extends BaseTypeHandler<String> {
|
||||
|
||||
@Override
|
||||
public void setNonNullParameter(
|
||||
PreparedStatement ps,
|
||||
int i,
|
||||
String parameter,
|
||||
JdbcType jdbcType
|
||||
) throws SQLException {
|
||||
|
||||
if (StringUtils.isBlank(parameter)) {
|
||||
ps.setBytes(i, null);
|
||||
return;
|
||||
}
|
||||
|
||||
byte[] compressed = JsonUtils.zip(parameter);
|
||||
|
||||
ps.setBytes(i, compressed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNullableResult(ResultSet rs, String columnName)
|
||||
throws SQLException {
|
||||
|
||||
byte[] bytes = rs.getBytes(columnName);
|
||||
|
||||
return unzip(bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNullableResult(ResultSet rs, int columnIndex)
|
||||
throws SQLException {
|
||||
|
||||
byte[] bytes = rs.getBytes(columnIndex);
|
||||
|
||||
return unzip(bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNullableResult(CallableStatement cs, int columnIndex)
|
||||
throws SQLException {
|
||||
|
||||
byte[] bytes = cs.getBytes(columnIndex);
|
||||
|
||||
return unzip(bytes);
|
||||
}
|
||||
|
||||
private String unzip(byte[] bytes) {
|
||||
|
||||
if (bytes == null || bytes.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return JsonUtils.unzip(bytes);
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -220,5 +220,6 @@ public class PlateDetailRespVO {
|
||||
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<ProcessGroupList> processGroupLists;
|
||||
|
||||
|
||||
@Schema(description = "造型数据")
|
||||
private String modelData;
|
||||
}
|
||||
|
||||
+25
-20
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.executor.service.optimizeplan;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.PageUtil;
|
||||
@@ -20,6 +19,7 @@ import co.elastic.clients.elasticsearch.sql.TranslateRequest;
|
||||
import co.elastic.clients.elasticsearch.sql.TranslateResponse;
|
||||
import co.elastic.clients.json.JsonData;
|
||||
import co.elastic.clients.json.JsonpMappingException;
|
||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -32,6 +32,7 @@ import com.cf.imes.framework.common.enums.PlanTypeEnum;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||
@@ -308,10 +309,14 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
AssertUtils.notEmpty(plateDOS, ORDER_PLATE_EMPTY);
|
||||
|
||||
List<OrderModelDO> orderModelDOS = getOrderModels(ListUtil.of(orderId), goodsDOS.stream().map(GoodsReqVO::getId).collect(Collectors.toList()));
|
||||
|
||||
AssertUtils.notEmpty(orderModelDOS,ORDER_PLATE_MODEL_DATE_ERROR);
|
||||
List<OrderModelDO> models =
|
||||
plateDOS.stream()
|
||||
.map(PlateDetailRespVO::getModelData)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
||||
.toList();
|
||||
|
||||
AssertUtils.notEmpty(models, ORDER_PLATE_MODEL_DATE_ERROR);
|
||||
|
||||
// 查询订单对应的配件信息
|
||||
List<PrintOrderPartsRespVO> printOrderPartsRespVOS = orderPartsMapper.selectPartList(Collections.singletonList(orderId), getUserOrganId());
|
||||
@@ -338,7 +343,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
.orderList(Collections.singletonList(orderDO))
|
||||
.goodsList(goodsDOS)
|
||||
.plateList(plateDOS)
|
||||
.plateModels(orderModelDOS)
|
||||
.plateModels(models)
|
||||
.orderPartsRespVOS(printOrderPartsRespVOS)
|
||||
.orderPartsRemarks(orderPartsRemarks)
|
||||
.orderPackReqVOS(printOrderPackReqVOS)
|
||||
@@ -389,18 +394,14 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
AssertUtils.notEmpty(orderDOS, ORDER_PLAN_ORDERS_EMPTY);
|
||||
|
||||
// 需要查询小板造型信息的板材ID
|
||||
List<Long> plateIds = plateDetailRespVOS.stream().map(PlateDetailRespVO::getPlateId).toList();
|
||||
List<OrderModelDO> models =
|
||||
plateDetailRespVOS.stream()
|
||||
.map(PlateDetailRespVO::getModelData)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
||||
.toList();
|
||||
|
||||
// 每一千块查询一次es
|
||||
List<List<Long>> batchPlateIdsList = batchProcess(plateIds);
|
||||
|
||||
List<OrderModelDO> orderModelDOS = new ArrayList<>();
|
||||
for (List<Long> plateIdsList : batchPlateIdsList) {
|
||||
orderModelDOS.addAll(esUtils.getEsDocument(FIELD_PLATE_ID, plateIdsList, plateIdsList.size(), ORDER_PLATE_MODEL.getIndex(), OrderModelDO.class));
|
||||
}
|
||||
|
||||
AssertUtils.notEmpty(orderModelDOS, ORDER_PLAN_PLATE_MODEL_DATE_ERROR);
|
||||
AssertUtils.notEmpty(models, ORDER_PLAN_PLATE_MODEL_DATE_ERROR);
|
||||
|
||||
|
||||
List<RemainPlateDO> remainPlateDOS = remainPlateMapper.selectByPlanId(planId,getUserOrganId());
|
||||
@@ -446,7 +447,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
.plan(planDO)
|
||||
.goodsList(goodsDOS)
|
||||
.plateList(plateDetailRespVOS)
|
||||
.plateModels(orderModelDOS)
|
||||
.plateModels(models)
|
||||
.planActualGoodsModelDO(planActualGoodsModelDO)
|
||||
.optimizeRemainPlates(optimizeRemainPlates)
|
||||
.orderPartsRespVOS(printOrderPartsRespVOS)
|
||||
@@ -791,8 +792,12 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
AssertUtils.notEmpty(plateDetailRespVOS, ORDER_PLATE_EMPTY);
|
||||
|
||||
// todo 数据结构改后,可以增加排单ID作为筛选,只查为 0 的
|
||||
// List<OrderModelDO> orderModelDOS = getOrderModels(orderIds, orderGoodsIds);
|
||||
List<OrderModelDO> models =
|
||||
plateDetailRespVOS.stream()
|
||||
.map(PlateDetailRespVO::getModelData)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.map(json -> JsonUtils.parseObject(json, OrderModelDO.class))
|
||||
.toList();
|
||||
|
||||
AssertUtils.notEmpty(plateDetailRespVOS,ORDER_PLATE_MODEL_DATE_ERROR);
|
||||
|
||||
@@ -800,7 +805,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
.orderList(buildTree(orderDOS))
|
||||
.goodsList(goodsReqVOS)
|
||||
.plateList(plateDetailRespVOS)
|
||||
.plateModels(Collections.emptyList())
|
||||
.plateModels(models)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -405,6 +405,7 @@
|
||||
<result property="isSideSculpt" column="isSideSculpt"/>
|
||||
<result property="is2v" column="is2v"/>
|
||||
<result property="isSide2v" column="isSide2v"/>
|
||||
<result property="modelData" column="modelData" typeHandler="com.cf.imes.framework.mybatis.core.type.CompressByteTypeHandler"/>
|
||||
|
||||
<collection property="processGroupLists" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList" >
|
||||
|
||||
@@ -453,7 +454,8 @@
|
||||
op.open_door_type as openDoorType,
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.is_sculpt as isSculpt,
|
||||
op.remark as remark
|
||||
op.remark as remark,
|
||||
op.model_data as modelData
|
||||
|
||||
from order_plate op
|
||||
left join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id
|
||||
|
||||
+6
-2
@@ -76,6 +76,7 @@
|
||||
<result property="isSideSculpt" column="isSideSculpt"/>
|
||||
<result property="is2v" column="is2v"/>
|
||||
<result property="isSide2v" column="isSide2v"/>
|
||||
<result property="modelData" column="modelData" typeHandler="com.cf.imes.framework.mybatis.core.type.CompressByteTypeHandler"/>
|
||||
|
||||
<collection property="processGroupLists" javaType="java.util.List" ofType="com.cf.imes.module.executor.controller.admin.plan.bo.ProcessGroupList" >
|
||||
|
||||
@@ -379,6 +380,7 @@
|
||||
<result property="offsetY" column="offsetY"/>
|
||||
<result property="isSpecialShaped" column="isSpecialShaped"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="modelData" column="modelData" typeHandler="com.cf.imes.framework.mybatis.core.type.CompressByteTypeHandler"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPlateListByGoodsIds"
|
||||
@@ -409,7 +411,8 @@
|
||||
op.hole_face as holeFace,
|
||||
op.open_door_type as openDoorType,
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.remark as remark
|
||||
op.remark as remark,
|
||||
op.model_data as modelData
|
||||
|
||||
from order_plate op
|
||||
join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id
|
||||
@@ -463,7 +466,8 @@
|
||||
op.is_special_shaped as isSpecialShaped,
|
||||
op.is_sculpt as isSculpt,
|
||||
op.is_row_hole as hasHole,
|
||||
op.remark as remark
|
||||
op.remark as remark,
|
||||
op.model_data as modelData
|
||||
|
||||
from order_plate op
|
||||
join order_goods ogs on op.organ_id = ogs.organ_id and op.order_id = ogs.order_id and op.goods_id = ogs.id
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ import com.cf.imes.module.plan.dal.elasticsearch.HoleDetail;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.ModelDetail;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.PartsInfo;
|
||||
import com.cf.imes.module.plan.dal.elasticsearch.PointDetail;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -25,9 +26,9 @@ import java.util.Map;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class OrderModelDO extends ESDocument {
|
||||
/*@Schema(description = "组织id")
|
||||
private Long organId;*/
|
||||
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
@Schema(description = "小板id")
|
||||
|
||||
+6
@@ -247,4 +247,10 @@ public class PlateDO extends BaseDO {
|
||||
* cad自定义板编号
|
||||
*/
|
||||
private String cadPlateNo;
|
||||
|
||||
/**
|
||||
* 造型数据
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String modelData;
|
||||
}
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -12,6 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class BasePosition {
|
||||
private String basePoint;// 基准点
|
||||
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class HoleDetail {
|
||||
|
||||
@Schema(description = "孔ID")
|
||||
|
||||
+2
-4
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -17,6 +18,7 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免订单导入有问
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class IOriginModelingData {
|
||||
|
||||
@Schema(description = "刀半径")
|
||||
@@ -44,8 +46,4 @@ public class IOriginModelingData {
|
||||
@Schema(description = "槽加深")
|
||||
private Double addDepth;
|
||||
|
||||
// ============ 启用 api =============
|
||||
// @Schema(description = "造型点列表")
|
||||
// private List<PointList> pointList;
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -16,6 +17,7 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "管理后台 - 造型信息")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ModelDetail {
|
||||
|
||||
@Schema(description = "造型ID")
|
||||
@@ -52,9 +54,6 @@ public class ModelDetail {
|
||||
@Schema(description = "角度(二维刀路V型刀提角/清角用)")
|
||||
private Double tangentAngle; // 目前只在xml中
|
||||
|
||||
// @Schema(description = "造型数量")
|
||||
// private Integer count;
|
||||
|
||||
@Schema(description = "造像使用刀具名称")
|
||||
private String knifeName;
|
||||
@Schema(description = "刀号")
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -17,6 +18,7 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免订单导入有问
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class OffSetList {
|
||||
|
||||
@Schema(description = "偏移刀路ID")
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -12,6 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class PartsInfo {
|
||||
|
||||
private Long id; // 配件标识
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -17,6 +18,7 @@ import java.math.BigDecimal;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免订单导入有问
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class PointDetail {
|
||||
|
||||
@Schema(description = "点id")
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.plan.dal.elasticsearch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -15,6 +16,7 @@ import lombok.experimental.Accessors;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免订单导入有问
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class PointList {
|
||||
|
||||
@Schema(description = "纹路Id")
|
||||
|
||||
+3
-2
@@ -130,8 +130,9 @@ public class WebCadOrderImportServiceImpl implements WebCadOrderImportService {
|
||||
JsonFactory factory = new JsonFactory();
|
||||
|
||||
Long cadViewFileId = null;
|
||||
try (GZIPInputStream gzipInputStream = new GZIPInputStream(file.getInputStream());
|
||||
JsonParser parser = factory.createParser(gzipInputStream)) {
|
||||
try (
|
||||
// GZIPInputStream gzipInputStream = new GZIPInputStream(file.getInputStream());
|
||||
JsonParser parser = factory.createParser(file.getInputStream())) {
|
||||
factory.disable(JsonParser.Feature.AUTO_CLOSE_SOURCE);
|
||||
|
||||
int plateCount = 0;
|
||||
|
||||
+34
-25
@@ -17,6 +17,7 @@ import com.cf.imes.framework.common.exception.ErrorCode;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.mybatis.core.injector.BaseBatchMapper;
|
||||
@@ -135,9 +136,6 @@ public class WebCadOrderImportAsyncFactory {
|
||||
// 是否入库的第一块板件
|
||||
private boolean isFirstPlate;
|
||||
|
||||
// 是否有插入es数据
|
||||
private boolean esInsert;
|
||||
|
||||
private CustomPlateNoGenerateConfigVO plateNoGenerateConfigVO;
|
||||
|
||||
// 操作人
|
||||
@@ -172,7 +170,6 @@ public class WebCadOrderImportAsyncFactory {
|
||||
private List<PlateDO> plateDOS = new ArrayList<>();
|
||||
private List<OrderItemDO> orderItemDOS = new ArrayList<>();
|
||||
private List<OrderPartsDO> orderPartsDOS = new ArrayList<>();
|
||||
private List<OrderModelDO> orderModelDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
|
||||
private List<GoodsDO> goodsDOS = new ArrayList<>();
|
||||
private List<OrderComponentDO> orderComponentDOS = new ArrayList<>();
|
||||
private List<SystemConfigSealEdgeRespDTO> sealEdgeConfigList;
|
||||
@@ -833,8 +830,9 @@ public class WebCadOrderImportAsyncFactory {
|
||||
plateDOS.add(plateDO);
|
||||
orderPlateBatchInsertWithinThreshold(plateDOS, false);
|
||||
|
||||
// 创建es造型数据
|
||||
// createModel(plateDO, block, plateRemark);
|
||||
// 创建造型数据
|
||||
OrderModelDO orderModelDO = createModel(plateDO, block, plateRemark);
|
||||
plateDO.setModelData(JsonUtils.toJsonString(orderModelDO));
|
||||
|
||||
// 遍历加工组信息,生成对应的加工组和item
|
||||
analyzeBlockProcessGroup(orderBodyDO, block, plateId);
|
||||
@@ -946,7 +944,7 @@ public class WebCadOrderImportAsyncFactory {
|
||||
/**
|
||||
* 创建板件造型es数据
|
||||
*/
|
||||
private void createModel(PlateDO plateDO, WebCadDataBlockReqVO block, WebCadDataBlockRemarkVO plateRemark) {
|
||||
private OrderModelDO createModel(PlateDO plateDO, WebCadDataBlockReqVO block, WebCadDataBlockRemarkVO plateRemark) {
|
||||
// 点阵信息
|
||||
WebCadDataBlockReqVO.PointInfoDTO pointInfo = block.getPointInfo();
|
||||
|
||||
@@ -988,11 +986,7 @@ public class WebCadOrderImportAsyncFactory {
|
||||
|
||||
orderModelDO.setGoodsId(block.getGoodsCode());
|
||||
orderModelDO.setPlateGoodsId(plateDO.getGoodsId());
|
||||
orderModelDO.setOrganId(organId);
|
||||
orderModelDOS.add(orderModelDO);
|
||||
if (!esInsert) {
|
||||
esInsert = true;
|
||||
}
|
||||
return orderModelDO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2009,7 +2003,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, cad_plate_no) 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_plate_no, model_data) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
||||
@Override
|
||||
public void setValues(PreparedStatement ps, int index) throws SQLException {
|
||||
@@ -2021,17 +2015,17 @@ public class WebCadOrderImportAsyncFactory {
|
||||
ps.setString(5, item.getPlateNo());
|
||||
ps.setInt(6, item.getType());
|
||||
ps.setLong(7, item.getGoodsId());
|
||||
ps.setBigDecimal(8, item.getWidth());
|
||||
ps.setBigDecimal(9, item.getHeight());
|
||||
ps.setBigDecimal(10, item.getThickness());
|
||||
ps.setBigDecimal(11, item.getSplitWidth());
|
||||
ps.setBigDecimal(12, item.getSplitHeight());
|
||||
ps.setBigDecimal(13, item.getSplitThickness());
|
||||
ps.setBigDecimal(14, item.getSealLeft());
|
||||
ps.setBigDecimal(15, item.getSealRight());
|
||||
ps.setBigDecimal(16, item.getSealUp());
|
||||
ps.setBigDecimal(17, item.getSealDown());
|
||||
ps.setBigDecimal(18, item.getArea());
|
||||
setSqlDefaultBigDecimal(ps, 8, item.getWidth());
|
||||
setSqlDefaultBigDecimal(ps, 9, item.getHeight());
|
||||
setSqlDefaultBigDecimal(ps, 10, item.getThickness());
|
||||
setSqlDefaultBigDecimal(ps, 11, item.getSplitWidth());
|
||||
setSqlDefaultBigDecimal(ps, 12, item.getSplitHeight());
|
||||
setSqlDefaultBigDecimal(ps, 13, item.getSplitThickness());
|
||||
setSqlDefaultBigDecimal(ps, 14, item.getSealLeft());
|
||||
setSqlDefaultBigDecimal(ps, 15, item.getSealRight());
|
||||
setSqlDefaultBigDecimal(ps, 16, item.getSealUp());
|
||||
setSqlDefaultBigDecimal(ps, 17, item.getSealDown());
|
||||
setSqlDefaultBigDecimal(ps, 18, item.getArea());
|
||||
ps.setInt(19, item.getTexture());
|
||||
ps.setInt(20, item.getHoleFace());
|
||||
ps.setInt(21, item.getHoleArrange());
|
||||
@@ -2065,6 +2059,13 @@ public class WebCadOrderImportAsyncFactory {
|
||||
ps.setString(49, item.getCreator());
|
||||
ps.setString(50, item.getUpdater());
|
||||
ps.setString(51, item.getCadPlateNo());
|
||||
|
||||
String modelData = item.getModelData();
|
||||
if (StringUtils.isNotEmpty(modelData)) {
|
||||
ps.setBytes(52, JsonUtils.zip(modelData));
|
||||
} else {
|
||||
ps.setNull(52, Types.BLOB);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2421,7 +2422,6 @@ public class WebCadOrderImportAsyncFactory {
|
||||
plateDOS = null;
|
||||
orderItemDOS = null;
|
||||
orderPartsDOS = null;
|
||||
orderModelDOS = null;
|
||||
goodsDOS = null;
|
||||
orderComponentDOS = null;
|
||||
sealEdgeConfigList = null;
|
||||
@@ -2498,4 +2498,13 @@ public class WebCadOrderImportAsyncFactory {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setSqlDefaultBigDecimal(PreparedStatement ps, int index, BigDecimal value) throws SQLException {
|
||||
if (value == null) {
|
||||
ps.setBigDecimal(index, BigDecimal.ZERO);
|
||||
} else {
|
||||
ps.setBigDecimal(index, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+34
-29
@@ -15,6 +15,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.common.exception.ErrorCode;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.mybatis.core.injector.BaseBatchMapper;
|
||||
@@ -123,9 +124,6 @@ public class WebCadOrderImportFactory {
|
||||
// 是否入库的第一块板件
|
||||
private boolean isFirstPlate;
|
||||
|
||||
// 是否有插入es数据
|
||||
private boolean esInsert;
|
||||
|
||||
private CustomPlateNoGenerateConfigVO plateNoGenerateConfigVO;
|
||||
|
||||
// 操作人
|
||||
@@ -160,7 +158,6 @@ public class WebCadOrderImportFactory {
|
||||
private List<PlateDO> plateDOS = new ArrayList<>();
|
||||
private List<OrderItemDO> orderItemDOS = new ArrayList<>();
|
||||
private List<OrderPartsDO> orderPartsDOS = new ArrayList<>();
|
||||
private List<OrderModelDO> orderModelDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
|
||||
private List<GoodsDO> goodsDOS = new ArrayList<>();
|
||||
private List<OrderComponentDO> orderComponentDOS = new ArrayList<>();
|
||||
private List<SystemConfigSealEdgeRespDTO> sealEdgeConfigList;
|
||||
@@ -213,7 +210,6 @@ public class WebCadOrderImportFactory {
|
||||
this.systemConfigApi = systemConfigApi;
|
||||
operatorName = SecurityFrameworkUtils.getLoginUser().getNickname();
|
||||
now = LocalDateTime.now();
|
||||
batchId = (Long) snowFlakeGenerator.nextId(null);
|
||||
sealEdgeConfigList = new ArrayList<>();
|
||||
this.cadImportPlateNumThreshold = cadImportPlateNumThreshold;
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
@@ -773,12 +769,13 @@ public class WebCadOrderImportFactory {
|
||||
orderBodyDO.setPlateNum(orderBodyDO.getPlateNum() + 1);
|
||||
orderBodyDO.setUnregularNum(orderBodyDO.getUnregularNum() + BooleanUtil.toInt(isSpecialShape));
|
||||
|
||||
// 创建造型数据
|
||||
OrderModelDO orderModelDO = createModel(plateDO, block, plateRemark);
|
||||
plateDO.setModelData(JsonUtils.toJsonString(orderModelDO));
|
||||
|
||||
plateDOS.add(plateDO);
|
||||
orderPlateBatchInsertWithinThreshold(plateDOS, false);
|
||||
|
||||
// 创建es造型数据
|
||||
// createModel(plateDO, block, plateRemark);
|
||||
|
||||
// 遍历加工组信息,生成对应的加工组和item
|
||||
analyzeBlockProcessGroup(orderBodyDO, block, plateId);
|
||||
}
|
||||
@@ -786,14 +783,12 @@ public class WebCadOrderImportFactory {
|
||||
/**
|
||||
* 创建板件造型es数据
|
||||
*/
|
||||
private void createModel(PlateDO plateDO, WebCadDataBlockReqVO block, WebCadDataBlockRemarkVO plateRemark) {
|
||||
private OrderModelDO createModel(PlateDO plateDO, WebCadDataBlockReqVO block, WebCadDataBlockRemarkVO plateRemark) {
|
||||
// 点阵信息
|
||||
WebCadDataBlockReqVO.PointInfoDTO pointInfo = block.getPointInfo();
|
||||
|
||||
OrderModelDO orderModelDO = OrderModelDO.builder()
|
||||
.orderId(orderId)
|
||||
.plateId(plateDO.getId())
|
||||
.batchId(batchId)
|
||||
.texture(block.getTexture())
|
||||
.typographicFace(block.getHoleArrange())
|
||||
.openDoorType(block.getOpenDoorType())
|
||||
@@ -828,11 +823,7 @@ public class WebCadOrderImportFactory {
|
||||
|
||||
orderModelDO.setGoodsId(block.getGoodsCode());
|
||||
orderModelDO.setPlateGoodsId(plateDO.getGoodsId());
|
||||
orderModelDO.setOrganId(organId);
|
||||
orderModelDOS.add(orderModelDO);
|
||||
if (!esInsert) {
|
||||
esInsert = true;
|
||||
}
|
||||
return orderModelDO;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1845,7 +1836,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, cad_plate_no) 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_plate_no, model_data) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
|
||||
@Override
|
||||
public void setValues(PreparedStatement ps, int index) throws SQLException {
|
||||
@@ -1857,17 +1848,17 @@ public class WebCadOrderImportFactory {
|
||||
ps.setString(5, item.getPlateNo());
|
||||
ps.setInt(6, item.getType());
|
||||
ps.setLong(7, item.getGoodsId());
|
||||
ps.setBigDecimal(8, item.getWidth());
|
||||
ps.setBigDecimal(9, item.getHeight());
|
||||
ps.setBigDecimal(10, item.getThickness());
|
||||
ps.setBigDecimal(11, item.getSplitWidth());
|
||||
ps.setBigDecimal(12, item.getSplitHeight());
|
||||
ps.setBigDecimal(13, item.getSplitThickness());
|
||||
ps.setBigDecimal(14, item.getSealLeft());
|
||||
ps.setBigDecimal(15, item.getSealRight());
|
||||
ps.setBigDecimal(16, item.getSealUp());
|
||||
ps.setBigDecimal(17, item.getSealDown());
|
||||
ps.setBigDecimal(18, item.getArea());
|
||||
setSqlDefaultBigDecimal(ps, 8, item.getWidth());
|
||||
setSqlDefaultBigDecimal(ps, 9, item.getHeight());
|
||||
setSqlDefaultBigDecimal(ps, 10, item.getThickness());
|
||||
setSqlDefaultBigDecimal(ps, 11, item.getSplitWidth());
|
||||
setSqlDefaultBigDecimal(ps, 12, item.getSplitHeight());
|
||||
setSqlDefaultBigDecimal(ps, 13, item.getSplitThickness());
|
||||
setSqlDefaultBigDecimal(ps, 14, item.getSealLeft());
|
||||
setSqlDefaultBigDecimal(ps, 15, item.getSealRight());
|
||||
setSqlDefaultBigDecimal(ps, 16, item.getSealUp());
|
||||
setSqlDefaultBigDecimal(ps, 17, item.getSealDown());
|
||||
setSqlDefaultBigDecimal(ps, 18, item.getArea());
|
||||
ps.setInt(19, item.getTexture());
|
||||
ps.setInt(20, item.getHoleFace());
|
||||
ps.setInt(21, item.getHoleArrange());
|
||||
@@ -1901,6 +1892,13 @@ public class WebCadOrderImportFactory {
|
||||
ps.setString(49, item.getCreator());
|
||||
ps.setString(50, item.getUpdater());
|
||||
ps.setString(51, item.getCadPlateNo());
|
||||
|
||||
String modelData = item.getModelData();
|
||||
if (StringUtils.isNotEmpty(modelData)) {
|
||||
ps.setBytes(52, JsonUtils.zip(modelData));
|
||||
} else {
|
||||
ps.setNull(52, Types.BLOB);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2293,6 +2291,14 @@ public class WebCadOrderImportFactory {
|
||||
}
|
||||
}
|
||||
|
||||
private void setSqlDefaultBigDecimal(PreparedStatement ps, int index, BigDecimal value) throws SQLException {
|
||||
if (value == null) {
|
||||
ps.setBigDecimal(index, BigDecimal.ZERO);
|
||||
} else {
|
||||
ps.setBigDecimal(index, value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空所有列表
|
||||
*/
|
||||
@@ -2309,7 +2315,6 @@ public class WebCadOrderImportFactory {
|
||||
plateDOS = null;
|
||||
orderItemDOS = null;
|
||||
orderPartsDOS = null;
|
||||
orderModelDOS = null;
|
||||
goodsDOS = null;
|
||||
orderComponentDOS = null;
|
||||
sealEdgeConfigList = null;
|
||||
|
||||
Reference in New Issue
Block a user