mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
禅道#1446/1456/1461问题修复
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Gqr
|
||||||
|
* @since 2025/4/1 15:04
|
||||||
|
*/
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class WebCadDataBlockRemarkVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用备注
|
||||||
|
*/
|
||||||
|
private List<String> remarks;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* extra备注
|
||||||
|
*/
|
||||||
|
private JSONObject extraObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drills备注
|
||||||
|
*/
|
||||||
|
private JSONArray drillsObj;
|
||||||
|
}
|
||||||
+202
-2
@@ -56,7 +56,7 @@ public class WebCadDataBlockReqVO {
|
|||||||
private Double cabinetWidth;
|
private Double cabinetWidth;
|
||||||
private Double cabinetHeight;
|
private Double cabinetHeight;
|
||||||
private BoadrData boardData;
|
private BoadrData boardData;
|
||||||
private Object pointInfo;
|
private PointInfoDTO pointInfo;
|
||||||
|
|
||||||
private Long plateGoodsId;
|
private Long plateGoodsId;
|
||||||
private String goodsId;
|
private String goodsId;
|
||||||
@@ -66,7 +66,6 @@ public class WebCadDataBlockReqVO {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
public static class GroupInfo {
|
public static class GroupInfo {
|
||||||
private Integer groupId;
|
|
||||||
private String groupTypeName;
|
private String groupTypeName;
|
||||||
private String groupName;
|
private String groupName;
|
||||||
private Double width;
|
private Double width;
|
||||||
@@ -435,4 +434,205 @@ public class WebCadDataBlockReqVO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class PointInfoDTO {
|
||||||
|
@JsonProperty("PointDetail")
|
||||||
|
private List<PointDetailDTO> pointDetail;
|
||||||
|
@JsonProperty("OrgPointDetail")
|
||||||
|
private List<OrgPointDetailDTO> orgPointDetail;
|
||||||
|
@JsonProperty("HoleDetail")
|
||||||
|
private List<HoleDetailDTO> holeDetail;
|
||||||
|
@JsonProperty("SideHoleDetail")
|
||||||
|
private List<SideHoleDetailDTO> sideHoleDetail;
|
||||||
|
@JsonProperty("SideModelDetail")
|
||||||
|
private List<?> sideModelDetail;
|
||||||
|
@JsonProperty("ModelDetail")
|
||||||
|
private List<ModelDetailDTO> modelDetail;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class PointDetailDTO {
|
||||||
|
@JsonProperty("PointID")
|
||||||
|
private Integer pointID;
|
||||||
|
@JsonProperty("PointX")
|
||||||
|
private Double pointX;
|
||||||
|
@JsonProperty("PointY")
|
||||||
|
private Double pointY;
|
||||||
|
@JsonProperty("Curve")
|
||||||
|
private Double curve;
|
||||||
|
@JsonProperty("SealSize")
|
||||||
|
private Integer sealSize;
|
||||||
|
@JsonProperty("SealColor")
|
||||||
|
private String sealColor;
|
||||||
|
@JsonProperty("ReservedEdge")
|
||||||
|
private Integer reservedEdge;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class OrgPointDetailDTO {
|
||||||
|
@JsonProperty("PointID")
|
||||||
|
private Integer pointID;
|
||||||
|
@JsonProperty("PointX")
|
||||||
|
private Double pointX;
|
||||||
|
@JsonProperty("PointY")
|
||||||
|
private Double pointY;
|
||||||
|
@JsonProperty("Curve")
|
||||||
|
private Double curve;
|
||||||
|
@JsonProperty("SealSize")
|
||||||
|
private Integer sealSize;
|
||||||
|
@JsonProperty("SealColor")
|
||||||
|
private String sealColor;
|
||||||
|
@JsonProperty("ReservedEdge")
|
||||||
|
private Integer reservedEdge;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class HoleDetailDTO {
|
||||||
|
@JsonProperty("HoleID")
|
||||||
|
private Integer holeID;
|
||||||
|
@JsonProperty("HoleType")
|
||||||
|
private Integer holeType;
|
||||||
|
@JsonProperty("Face")
|
||||||
|
private Integer face;
|
||||||
|
@JsonProperty("PointX")
|
||||||
|
private Double pointX;
|
||||||
|
@JsonProperty("PointY")
|
||||||
|
private Double pointY;
|
||||||
|
@JsonProperty("PointZ")
|
||||||
|
private Integer pointZ;
|
||||||
|
@JsonProperty("Radius")
|
||||||
|
private Double radius;
|
||||||
|
@JsonProperty("Depth")
|
||||||
|
private Double depth;
|
||||||
|
@JsonProperty("EndPoint")
|
||||||
|
private String endPoint;
|
||||||
|
@JsonProperty("Angle")
|
||||||
|
private Integer angle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class SideHoleDetailDTO {
|
||||||
|
@JsonProperty("HoleID")
|
||||||
|
private Integer holeID;
|
||||||
|
@JsonProperty("HoleType")
|
||||||
|
private Integer holeType;
|
||||||
|
@JsonProperty("Face")
|
||||||
|
private Integer face;
|
||||||
|
@JsonProperty("PointX")
|
||||||
|
private Double pointX;
|
||||||
|
@JsonProperty("PointY")
|
||||||
|
private Double pointY;
|
||||||
|
@JsonProperty("PointZ")
|
||||||
|
private Double pointZ;
|
||||||
|
@JsonProperty("Radius")
|
||||||
|
private Double radius;
|
||||||
|
@JsonProperty("Depth")
|
||||||
|
private Double depth;
|
||||||
|
@JsonProperty("EndPoint")
|
||||||
|
private String endPoint;
|
||||||
|
@JsonProperty("PointX2")
|
||||||
|
private Double pointX2;
|
||||||
|
@JsonProperty("PointY2")
|
||||||
|
private Double pointY2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class ModelDetailDTO {
|
||||||
|
@JsonProperty("ModelID")
|
||||||
|
private Integer modelID;
|
||||||
|
@JsonProperty("LineID")
|
||||||
|
private Integer lineID;
|
||||||
|
@JsonProperty("Face")
|
||||||
|
private Integer face;
|
||||||
|
@JsonProperty("KnifeName")
|
||||||
|
private String knifeName;
|
||||||
|
@JsonProperty("KnifeRadius")
|
||||||
|
private Double knifeRadius;
|
||||||
|
@JsonProperty("Depth")
|
||||||
|
private Double depth;
|
||||||
|
@JsonProperty("PointList")
|
||||||
|
private List<PointListDTO> pointList;
|
||||||
|
@JsonProperty("OriginModeling")
|
||||||
|
private OriginModelingDTO originModeling;
|
||||||
|
@JsonProperty("ModelType")
|
||||||
|
private Integer modelType;
|
||||||
|
@JsonProperty("OffSetList")
|
||||||
|
private List<OffSetListDTO> offSetList;
|
||||||
|
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class OriginModelingDTO {
|
||||||
|
@JsonProperty("outline")
|
||||||
|
private OutlineDTO outline;
|
||||||
|
@JsonProperty("holes")
|
||||||
|
private List<?> holes;
|
||||||
|
@JsonProperty("addLen")
|
||||||
|
private Double addLen;
|
||||||
|
@JsonProperty("addWidth")
|
||||||
|
private Double addWidth;
|
||||||
|
@JsonProperty("addDepth")
|
||||||
|
private Double addDepth;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class OutlineDTO {
|
||||||
|
@JsonProperty("pts")
|
||||||
|
private List<PtsDTO> pts;
|
||||||
|
@JsonProperty("buls")
|
||||||
|
private List<Double> buls;
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class PtsDTO {
|
||||||
|
@JsonProperty("x")
|
||||||
|
private Double x;
|
||||||
|
@JsonProperty("y")
|
||||||
|
private Double y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class PointListDTO {
|
||||||
|
@JsonProperty("LineID")
|
||||||
|
private Integer lineID;
|
||||||
|
@JsonProperty("PointID")
|
||||||
|
private Integer pointID;
|
||||||
|
@JsonProperty("PointX")
|
||||||
|
private Double pointX;
|
||||||
|
@JsonProperty("PointY")
|
||||||
|
private Double pointY;
|
||||||
|
@JsonProperty("Depth")
|
||||||
|
private Double depth;
|
||||||
|
@JsonProperty("Curve")
|
||||||
|
private Double curve;
|
||||||
|
@JsonProperty("Radius")
|
||||||
|
private Double radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public static class OffSetListDTO {
|
||||||
|
@JsonProperty("Value")
|
||||||
|
private Double value;
|
||||||
|
@JsonProperty("Deep")
|
||||||
|
private Double deep;
|
||||||
|
@JsonProperty("Angle")
|
||||||
|
private Double angle;
|
||||||
|
@JsonProperty("Name")
|
||||||
|
private String name;
|
||||||
|
@JsonProperty("Radius")
|
||||||
|
private Double radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -90,4 +90,10 @@ public class OrderBodyDO extends BaseDO {
|
|||||||
* 是否删除
|
* 是否删除
|
||||||
*/
|
*/
|
||||||
private Boolean deleted;
|
private Boolean deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成倍拆单的房间柜体名,如:房间1柜体1,成倍的时候会是:房间11柜体11、房间12柜体12
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String multiRoomBodyName;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -19,7 +19,7 @@ import java.util.List;
|
|||||||
public class ModelDetail {
|
public class ModelDetail {
|
||||||
|
|
||||||
@Schema(description = "造型ID")
|
@Schema(description = "造型ID")
|
||||||
private Integer id;
|
private Integer modelID;
|
||||||
|
|
||||||
@Schema(description = "刀路ID")
|
@Schema(description = "刀路ID")
|
||||||
private Integer lineID;
|
private Integer lineID;
|
||||||
|
|||||||
+1
-1
@@ -1050,7 +1050,7 @@ public class DefaultXmlOrderImportFactory {
|
|||||||
subIDs = Arrays.stream(grooveXmlVO.getSubIDs().split(",")).map(String::valueOf).toArray(String[]::new);
|
subIDs = Arrays.stream(grooveXmlVO.getSubIDs().split(",")).map(String::valueOf).toArray(String[]::new);
|
||||||
}
|
}
|
||||||
return ModelDetail.builder()
|
return ModelDetail.builder()
|
||||||
.id(Integer.valueOf(grooveXmlVO.getId()))
|
.modelID(Integer.valueOf(grooveXmlVO.getId()))
|
||||||
.subIDs(subIDs)
|
.subIDs(subIDs)
|
||||||
.type(grooveXmlVO.getType())
|
.type(grooveXmlVO.getType())
|
||||||
.grooveFace(grooveXmlVO.getFace())
|
.grooveFace(grooveXmlVO.getFace())
|
||||||
|
|||||||
+356
-67
@@ -21,6 +21,7 @@ import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
|||||||
import com.cf.imes.module.executor.enums.DataTypeEnum;
|
import com.cf.imes.module.executor.enums.DataTypeEnum;
|
||||||
import com.cf.imes.module.executor.enums.OrderItemTypeEnum;
|
import com.cf.imes.module.executor.enums.OrderItemTypeEnum;
|
||||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||||
|
import com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo.WebCadDataBlockRemarkVO;
|
||||||
import com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo.WebCadDataBlockReqVO;
|
import com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo.WebCadDataBlockReqVO;
|
||||||
import com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo.WebCadDataDoubleRoomTreeReqVO;
|
import com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo.WebCadDataDoubleRoomTreeReqVO;
|
||||||
import com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo.WebCadDataMaterialReqVO;
|
import com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo.WebCadDataMaterialReqVO;
|
||||||
@@ -38,6 +39,14 @@ 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.plate.PlateGoodDO;
|
import com.cf.imes.module.plan.dal.dataobject.plate.PlateGoodDO;
|
||||||
import com.cf.imes.module.plan.dal.dataobject.rawgoods.RawGoodsDO;
|
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.IContourData;
|
||||||
|
import com.cf.imes.module.plan.dal.elasticsearch.IOriginModelingData;
|
||||||
|
import com.cf.imes.module.plan.dal.elasticsearch.ModelDetail;
|
||||||
|
import com.cf.imes.module.plan.dal.elasticsearch.OffSetList;
|
||||||
|
import com.cf.imes.module.plan.dal.elasticsearch.Point;
|
||||||
|
import com.cf.imes.module.plan.dal.elasticsearch.PointDetail;
|
||||||
|
import com.cf.imes.module.plan.dal.elasticsearch.PointList;
|
||||||
import com.cf.imes.module.plan.dal.mysql.goods.GoodsMapper;
|
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;
|
||||||
@@ -151,8 +160,8 @@ public class WebCadOrderImportFactory {
|
|||||||
// 柜体缓存
|
// 柜体缓存
|
||||||
private Map<String, OrderBodyDO> bodyMap = new HashMap<>();
|
private Map<String, OrderBodyDO> bodyMap = new HashMap<>();
|
||||||
|
|
||||||
// 加工组map
|
// 房间名+柜体名+加工组名
|
||||||
private Map<Integer, OrderGroupDO> groupMap = new HashMap<>();
|
private Map<String, OrderGroupDO> orderGroupMap = new HashMap<>();
|
||||||
|
|
||||||
private List<PlateDO> plateDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
|
private List<PlateDO> plateDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
|
||||||
private List<OrderItemDO> orderItemDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
|
private List<OrderItemDO> orderItemDOS = ListUtils.newArrayListWithExpectedSize(BATCH_THRESHOLD_NUMBER);
|
||||||
@@ -434,7 +443,6 @@ public class WebCadOrderImportFactory {
|
|||||||
// brId 板件序号获取板件
|
// brId 板件序号获取板件
|
||||||
WebCadDataBlockReqVO webCadDataBlockReqVO = blockReqVOS.get(brId - 1);
|
WebCadDataBlockReqVO webCadDataBlockReqVO = blockReqVOS.get(brId - 1);
|
||||||
WebCadDataBlockReqVO.GroupInfo groupInfo = new WebCadDataBlockReqVO.GroupInfo();
|
WebCadDataBlockReqVO.GroupInfo groupInfo = new WebCadDataBlockReqVO.GroupInfo();
|
||||||
groupInfo.setGroupId(project.getGroupID());
|
|
||||||
groupInfo.setGroupTypeName(groupTypeName);
|
groupInfo.setGroupTypeName(groupTypeName);
|
||||||
groupInfo.setGroupName(project.getProjName());
|
groupInfo.setGroupName(project.getProjName());
|
||||||
groupInfo.setWidth(project.getBoxSize().getWidth());
|
groupInfo.setWidth(project.getBoxSize().getWidth());
|
||||||
@@ -459,7 +467,6 @@ public class WebCadOrderImportFactory {
|
|||||||
// objId 配件序号获取配件
|
// objId 配件序号获取配件
|
||||||
WebCadDataPartsReqVO.BlockObjectListDTO part = partsReqVO.getBlockObjectList().get(objId - 1);
|
WebCadDataPartsReqVO.BlockObjectListDTO part = partsReqVO.getBlockObjectList().get(objId - 1);
|
||||||
WebCadDataBlockReqVO.GroupInfo groupInfo = new WebCadDataBlockReqVO.GroupInfo();
|
WebCadDataBlockReqVO.GroupInfo groupInfo = new WebCadDataBlockReqVO.GroupInfo();
|
||||||
groupInfo.setGroupId(project.getGroupID());
|
|
||||||
groupInfo.setGroupTypeName(groupTypeName);
|
groupInfo.setGroupTypeName(groupTypeName);
|
||||||
groupInfo.setGroupName(project.getProjName());
|
groupInfo.setGroupName(project.getProjName());
|
||||||
groupInfo.setWidth(project.getBoxSize().getWidth());
|
groupInfo.setWidth(project.getBoxSize().getWidth());
|
||||||
@@ -545,7 +552,9 @@ public class WebCadOrderImportFactory {
|
|||||||
orderBodyDO.setUpdateTime(now);
|
orderBodyDO.setUpdateTime(now);
|
||||||
|
|
||||||
// 缓存成倍的柜体信息
|
// 缓存成倍的柜体信息
|
||||||
bodyMap.put(roomBodyKey + i, orderBodyDO);
|
String multiRoomBodyName = roomBodyKey + i;
|
||||||
|
orderBodyDO.setMultiRoomBodyName(multiRoomBodyName);
|
||||||
|
bodyMap.put(multiRoomBodyName, orderBodyDO);
|
||||||
|
|
||||||
listBody.forEach(block -> {
|
listBody.forEach(block -> {
|
||||||
// 创建板件相关数据:order_plate、order_item、es.orderModels
|
// 创建板件相关数据:order_plate、order_item、es.orderModels
|
||||||
@@ -620,6 +629,16 @@ public class WebCadOrderImportFactory {
|
|||||||
long plateNo = idWorker.nextId();
|
long plateNo = idWorker.nextId();
|
||||||
long obtainingTime = idWorker.obtainingTime();
|
long obtainingTime = idWorker.obtainingTime();
|
||||||
|
|
||||||
|
// 从info.remarks中获取备注相关
|
||||||
|
WebCadDataBlockRemarkVO plateRemark = getPlateRemark(blockInfo);
|
||||||
|
List<String> remarks = plateRemark.getRemarks();
|
||||||
|
StringBuffer remark = new StringBuffer();
|
||||||
|
if (CollUtil.isNotEmpty(remarks)) {
|
||||||
|
for (String remarkStr : remarks) {
|
||||||
|
remark.append(remarkStr).append(",");
|
||||||
|
}
|
||||||
|
remark.deleteCharAt(remark.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
String splitHeight = blockInfo.getSpliteHeight();
|
String splitHeight = blockInfo.getSpliteHeight();
|
||||||
String spliteWidth = blockInfo.getSpliteWidth();
|
String spliteWidth = blockInfo.getSpliteWidth();
|
||||||
@@ -665,7 +684,7 @@ public class WebCadOrderImportFactory {
|
|||||||
.sealRight(BigDecimal.ZERO)
|
.sealRight(BigDecimal.ZERO)
|
||||||
.sealUp(BigDecimal.ZERO)
|
.sealUp(BigDecimal.ZERO)
|
||||||
.sealDown(BigDecimal.ZERO)
|
.sealDown(BigDecimal.ZERO)
|
||||||
.remark(getPlateRemark(blockInfo))
|
.remark(remark.toString())
|
||||||
.deleted(false)
|
.deleted(false)
|
||||||
.organId(organId)
|
.organId(organId)
|
||||||
.build();
|
.build();
|
||||||
@@ -682,18 +701,61 @@ public class WebCadOrderImportFactory {
|
|||||||
// 获取封边厚度
|
// 获取封边厚度
|
||||||
calculateSealThickness(plateDO, boardData.getSealing());
|
calculateSealThickness(plateDO, boardData.getSealing());
|
||||||
|
|
||||||
|
|
||||||
//批量保存板件
|
//批量保存板件
|
||||||
plateDOS.add(plateDO);
|
plateDOS.add(plateDO);
|
||||||
orderInfoBatchInsertWithinThreshold(plateMapper, plateDOS, false);
|
orderInfoBatchInsertWithinThreshold(plateMapper, plateDOS, false);
|
||||||
|
|
||||||
|
// 创建es造型数据
|
||||||
|
createModel(plateDO, block, blockInfo, plateRemark);
|
||||||
|
// 批量插入造型数据
|
||||||
|
orderModelsBatchInsertWithinThreshold(false);
|
||||||
|
|
||||||
|
// 遍历加工组信息,生成对应的加工组和item
|
||||||
|
analyzeBlockProcessGroup(orderBodyDO, block, blockInfo, plateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建板件造型es数据
|
||||||
|
*/
|
||||||
|
private void createModel(PlateDO plateDO, WebCadDataBlockReqVO block, WebCadDataBlockReqVO.InfoDTO blockInfo, WebCadDataBlockRemarkVO plateRemark) {
|
||||||
|
// 点阵信息
|
||||||
|
WebCadDataBlockReqVO.PointInfoDTO pointInfo = block.getPointInfo();
|
||||||
|
|
||||||
OrderModelDO orderModelDO = OrderModelDO.builder()
|
OrderModelDO orderModelDO = OrderModelDO.builder()
|
||||||
.orderId(orderId)
|
.orderId(orderId)
|
||||||
.plateId(plateId)
|
.plateId(plateDO.getId())
|
||||||
.batchId(batchId)
|
.batchId(batchId)
|
||||||
.boardData(JSON.toJSONString(boardData))
|
.texture(block.getTexture())
|
||||||
.pointInfo(JSON.toJSONString(block.getPointInfo()))
|
.typographicFace(block.getHoleArrange())
|
||||||
|
.openDoorType(block.getOpenDoorType())
|
||||||
|
.splitLength(BigDecimal.valueOf(blockInfo.getKaiLiaoHeight()))
|
||||||
|
.splitWidth(BigDecimal.valueOf(blockInfo.getKaiLiaoWidth()))
|
||||||
|
.offsetX(BigDecimal.valueOf(block.getOffsetX()))
|
||||||
|
.offsetY(BigDecimal.valueOf(block.getOffsetY()))
|
||||||
|
.pointDetail(getPointDetail(pointInfo.getPointDetail()))
|
||||||
|
.rawPointDetail(getRawPointDetail(pointInfo.getOrgPointDetail()))
|
||||||
|
.holeDetail(getHoleDetail(pointInfo.getHoleDetail()))
|
||||||
|
.sideHoleDetail(getSideHoleDetail(pointInfo.getSideHoleDetail()))
|
||||||
|
.contourDetail(getContourDetail(pointInfo.getModelDetail()))
|
||||||
|
.sideRemark(getSideRemark(plateRemark.getRemarks()))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
// 处理备注信息
|
||||||
|
JSONObject plateExtraRemark = new JSONObject();
|
||||||
|
JSONObject extraObject = plateRemark.getExtraObject();
|
||||||
|
if (ObjectUtil.isNotNull(extraObject)) {
|
||||||
|
orderModelDO.setBoardType(extraObject.getString("boardType"));
|
||||||
|
orderModelDO.setHas2DModel(extraObject.getBoolean("has2DModel"));
|
||||||
|
orderModelDO.setHas3DModel(extraObject.getBoolean("has3DModel"));
|
||||||
|
plateExtraRemark.put("extra", extraObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONArray drillsObj = plateRemark.getDrillsObj();
|
||||||
|
if (ObjectUtil.isNotNull(drillsObj)) {
|
||||||
|
plateExtraRemark.put("drills", drillsObj);
|
||||||
|
}
|
||||||
|
orderModelDO.setPlateExtraRemark(plateExtraRemark);
|
||||||
|
|
||||||
orderModelDO.setGoodsId(block.getGoodsId());
|
orderModelDO.setGoodsId(block.getGoodsId());
|
||||||
orderModelDO.setPlateGoodsId(plateDO.getGoodsId());
|
orderModelDO.setPlateGoodsId(plateDO.getGoodsId());
|
||||||
orderModelDO.setOrganId(organId);
|
orderModelDO.setOrganId(organId);
|
||||||
@@ -703,34 +765,268 @@ public class WebCadOrderImportFactory {
|
|||||||
if (!esInsert) {
|
if (!esInsert) {
|
||||||
esInsert = true;
|
esInsert = true;
|
||||||
}
|
}
|
||||||
// 批量插入造型数据
|
|
||||||
orderModelsBatchInsertWithinThreshold(false);
|
|
||||||
|
|
||||||
// 遍历加工组信息,生成对应的加工组和item
|
|
||||||
analyzeBlockProcessGroup(orderBodyDO, block, blockInfo, plateId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取生产封边备注
|
||||||
|
*
|
||||||
|
* @param remarks
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Map<String, String> getSideRemark(List<String> remarks) {
|
||||||
|
if (CollUtil.isNotEmpty(remarks)) {
|
||||||
|
Map<String, String> sideRemarkMap = new HashMap<>();
|
||||||
|
for (int i = 1; i <= remarks.size(); i++) {
|
||||||
|
sideRemarkMap.put("Remark" + i, remarks.get(i - 1));
|
||||||
|
}
|
||||||
|
return sideRemarkMap;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取板件点明细
|
||||||
|
*
|
||||||
|
* @param cadPointDetailList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<PointDetail> getPointDetail(List<WebCadDataBlockReqVO.PointInfoDTO.PointDetailDTO> cadPointDetailList) {
|
||||||
|
List<PointDetail> pointDetails = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(cadPointDetailList)) {
|
||||||
|
for (WebCadDataBlockReqVO.PointInfoDTO.PointDetailDTO cadPointDetail : cadPointDetailList) {
|
||||||
|
PointDetail pointDetail = new PointDetail();
|
||||||
|
pointDetail.setPointX(cadPointDetail.getPointX());
|
||||||
|
pointDetail.setPointY(cadPointDetail.getPointY());
|
||||||
|
pointDetail.setCurve(cadPointDetail.getCurve());
|
||||||
|
pointDetails.add(pointDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pointDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取板件原始点明细
|
||||||
|
*
|
||||||
|
* @param orgPointDetail
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<PointDetail> getRawPointDetail(List<WebCadDataBlockReqVO.PointInfoDTO.OrgPointDetailDTO> orgPointDetail) {
|
||||||
|
List<PointDetail> pointDetails = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(orgPointDetail)) {
|
||||||
|
for (WebCadDataBlockReqVO.PointInfoDTO.OrgPointDetailDTO cadPointDetail : orgPointDetail) {
|
||||||
|
PointDetail pointDetail = new PointDetail();
|
||||||
|
pointDetail.setPointX(cadPointDetail.getPointX());
|
||||||
|
pointDetail.setPointY(cadPointDetail.getPointY());
|
||||||
|
pointDetail.setCurve(cadPointDetail.getCurve());
|
||||||
|
pointDetail.setSealSize(BigDecimal.valueOf(cadPointDetail.getSealSize()));
|
||||||
|
pointDetails.add(pointDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pointDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取板件孔明细列表
|
||||||
|
*
|
||||||
|
* @param cadHoleDetailList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<HoleDetail> getHoleDetail(List<WebCadDataBlockReqVO.PointInfoDTO.HoleDetailDTO> cadHoleDetailList) {
|
||||||
|
List<HoleDetail> holeDetails = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(cadHoleDetailList)) {
|
||||||
|
for (WebCadDataBlockReqVO.PointInfoDTO.HoleDetailDTO cadHoleDetail : cadHoleDetailList) {
|
||||||
|
HoleDetail holeDetail = new HoleDetail();
|
||||||
|
holeDetail.setId(String.valueOf(cadHoleDetail.getHoleID()));
|
||||||
|
holeDetail.setFaceType(cadHoleDetail.getFace());
|
||||||
|
holeDetail.setHoleType(cadHoleDetail.getHoleType());
|
||||||
|
holeDetail.setStartX(cadHoleDetail.getPointX());
|
||||||
|
holeDetail.setStartY(cadHoleDetail.getPointY());
|
||||||
|
holeDetail.setRadius(cadHoleDetail.getRadius());
|
||||||
|
holeDetail.setDepth(cadHoleDetail.getDepth());
|
||||||
|
holeDetails.add(holeDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return holeDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取侧面孔明细
|
||||||
|
*
|
||||||
|
* @param cadSideHoleDetailList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<HoleDetail> getSideHoleDetail(List<WebCadDataBlockReqVO.PointInfoDTO.SideHoleDetailDTO> cadSideHoleDetailList) {
|
||||||
|
List<HoleDetail> holeDetails = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(cadSideHoleDetailList)) {
|
||||||
|
for (WebCadDataBlockReqVO.PointInfoDTO.SideHoleDetailDTO cadHoleDetail : cadSideHoleDetailList) {
|
||||||
|
HoleDetail holeDetail = new HoleDetail();
|
||||||
|
holeDetail.setFaceType(cadHoleDetail.getFace());
|
||||||
|
holeDetail.setStartX(cadHoleDetail.getPointX());
|
||||||
|
holeDetail.setStartY(cadHoleDetail.getPointY());
|
||||||
|
holeDetail.setStartZ(cadHoleDetail.getPointZ());
|
||||||
|
holeDetail.setRadius(cadHoleDetail.getRadius());
|
||||||
|
holeDetail.setEndX(cadHoleDetail.getPointX2());
|
||||||
|
holeDetail.setEndY(cadHoleDetail.getPointY2());
|
||||||
|
holeDetail.setEndZ(cadHoleDetail.getPointZ());
|
||||||
|
holeDetail.setDepth(cadHoleDetail.getDepth());
|
||||||
|
holeDetails.add(holeDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return holeDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取造型明细
|
||||||
|
*
|
||||||
|
* @param cadModelDetailList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<ModelDetail> getContourDetail(List<WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO> cadModelDetailList) {
|
||||||
|
List<ModelDetail> modelDetails = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(cadModelDetailList)) {
|
||||||
|
for (WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO cadModelDetail : cadModelDetailList) {
|
||||||
|
ModelDetail modelDetail = new ModelDetail();
|
||||||
|
modelDetail.setModelID(cadModelDetail.getModelID());
|
||||||
|
modelDetail.setLineID(cadModelDetail.getLineID());
|
||||||
|
modelDetail.setFaceType(cadModelDetail.getFace());
|
||||||
|
modelDetail.setDepth(cadModelDetail.getDepth());
|
||||||
|
modelDetail.setKnifeName(cadModelDetail.getKnifeName());
|
||||||
|
modelDetail.setKnifeRadius(cadModelDetail.getKnifeRadius());
|
||||||
|
|
||||||
|
WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.OriginModelingDTO cadOriginModeling = cadModelDetail.getOriginModeling();
|
||||||
|
if (ObjectUtil.isNotNull(cadOriginModeling)) {
|
||||||
|
IOriginModelingData originModelingData = new IOriginModelingData();
|
||||||
|
originModelingData.setAddLen(cadOriginModeling.getAddLen());
|
||||||
|
originModelingData.setAddWidth(cadOriginModeling.getAddWidth());
|
||||||
|
originModelingData.setAddDepth(cadOriginModeling.getAddDepth());
|
||||||
|
|
||||||
|
WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.OriginModelingDTO.OutlineDTO cadOutline = cadOriginModeling.getOutline();
|
||||||
|
originModelingData.setOutline(getOriginModelingOutlineList(cadOutline));
|
||||||
|
|
||||||
|
modelDetail.setOriginModeling(originModelingData);
|
||||||
|
}
|
||||||
|
List<WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.PointListDTO> pointList = cadModelDetail.getPointList();
|
||||||
|
modelDetail.setPointList(getModelDetailPointList(pointList));
|
||||||
|
|
||||||
|
List<WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.OffSetListDTO> offSetList = cadModelDetail.getOffSetList();
|
||||||
|
modelDetail.setOffSetList(getModelDetailOffsetList(offSetList));
|
||||||
|
|
||||||
|
modelDetails.add(modelDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return modelDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取造型偏移量列表
|
||||||
|
*
|
||||||
|
* @param cadOffSetList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<OffSetList> getModelDetailOffsetList(List<WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.OffSetListDTO> cadOffSetList) {
|
||||||
|
List<OffSetList> offSetLists = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(cadOffSetList)) {
|
||||||
|
for (WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.OffSetListDTO cadOffset : cadOffSetList) {
|
||||||
|
OffSetList offSet = new OffSetList();
|
||||||
|
offSet.setValue(cadOffset.getValue());
|
||||||
|
offSet.setDepth(cadOffset.getDeep());
|
||||||
|
offSet.setAngle(cadOffset.getAngle());
|
||||||
|
offSet.setName(cadOffset.getName());
|
||||||
|
offSet.setRadius(cadOffset.getRadius());
|
||||||
|
|
||||||
|
offSetLists.add(offSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return offSetLists;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取造型点列表
|
||||||
|
*
|
||||||
|
* @param cadPointList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<PointList> getModelDetailPointList(List<WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.PointListDTO> cadPointList) {
|
||||||
|
List<PointList> pointList = new ArrayList<>();
|
||||||
|
if (CollUtil.isNotEmpty(cadPointList)) {
|
||||||
|
for (WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.PointListDTO cadPoint : cadPointList) {
|
||||||
|
PointList point = new PointList();
|
||||||
|
point.setPointX(cadPoint.getPointX());
|
||||||
|
point.setPointY(cadPoint.getPointY());
|
||||||
|
point.setCurve(cadPoint.getCurve());
|
||||||
|
point.setDepth(cadPoint.getDepth());
|
||||||
|
point.setRadius(cadPoint.getRadius());
|
||||||
|
|
||||||
|
pointList.add(point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pointList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取造型轮廓
|
||||||
|
*
|
||||||
|
* @param cadOutline
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<IContourData> getOriginModelingOutlineList(WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.OriginModelingDTO.OutlineDTO cadOutline) {
|
||||||
|
List<IContourData> outlineList = new ArrayList<>();
|
||||||
|
if (ObjectUtil.isNull(cadOutline)) {
|
||||||
|
return outlineList;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Double> buls = cadOutline.getBuls();
|
||||||
|
List<WebCadDataBlockReqVO.PointInfoDTO.ModelDetailDTO.OriginModelingDTO.OutlineDTO.PtsDTO> pts = cadOutline.getPts();
|
||||||
|
if (CollUtil.isNotEmpty(pts) && CollUtil.isNotEmpty(buls)) {
|
||||||
|
for (int i = 0; i < pts.size(); i++) {
|
||||||
|
IContourData iContourData = new IContourData();
|
||||||
|
Point point = new Point();
|
||||||
|
point.setX(pts.get(i).getX());
|
||||||
|
point.setY(pts.get(i).getY());
|
||||||
|
iContourData.setPts(point);
|
||||||
|
iContourData.setBuls(buls.get(i));
|
||||||
|
outlineList.add(iContourData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return outlineList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取板件备注
|
* 获取板件备注
|
||||||
*
|
*
|
||||||
* @param infoDTO
|
* @param infoDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String getPlateRemark(WebCadDataBlockReqVO.InfoDTO infoDTO) {
|
private WebCadDataBlockRemarkVO getPlateRemark(WebCadDataBlockReqVO.InfoDTO infoDTO) {
|
||||||
|
WebCadDataBlockRemarkVO blockRemark = new WebCadDataBlockRemarkVO();
|
||||||
if (ObjectUtil.isNull(infoDTO)) {
|
if (ObjectUtil.isNull(infoDTO)) {
|
||||||
return EMPTY_STRING;
|
return blockRemark;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<List<String>> remarks = infoDTO.getRemarks();
|
List<List<String>> remarks = infoDTO.getRemarks();
|
||||||
if (CollUtil.isEmpty(remarks)) {
|
if (CollUtil.isEmpty(remarks)) {
|
||||||
return EMPTY_STRING;
|
return blockRemark;
|
||||||
}
|
}
|
||||||
|
|
||||||
return remarks.stream()
|
List<String> blockRemarkList = new ArrayList<>();
|
||||||
.filter(remark -> CollUtil.isNotEmpty(remark) && remark.size() == 2)
|
for (List<String> remark : remarks) {
|
||||||
.filter(remark -> !"#extra".equals(remark.get(0)) && !"#drills".equals(remark.get(0)))
|
if (CollUtil.isNotEmpty(remark) && remark.size() == 2) {
|
||||||
.map(remark -> remark.get(1))
|
String key = remark.get(0);
|
||||||
.collect(Collectors.joining(","));
|
String value = remark.get(1);
|
||||||
|
|
||||||
|
if ("#extra".equals(key)) {
|
||||||
|
blockRemark.setExtraObject(JSON.parseObject(value));
|
||||||
|
} else if ("#drills".equals(key)) {
|
||||||
|
blockRemark.setDrillsObj(JSON.parseArray(value));
|
||||||
|
} else {
|
||||||
|
blockRemarkList.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
blockRemark.setRemarks(blockRemarkList);
|
||||||
|
return blockRemark;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -771,9 +1067,9 @@ public class WebCadOrderImportFactory {
|
|||||||
if (CollUtil.isNotEmpty(groupInfos)) {
|
if (CollUtil.isNotEmpty(groupInfos)) {
|
||||||
// 加工组缓存存在,一个加工组一个orderGroup+orderItem
|
// 加工组缓存存在,一个加工组一个orderGroup+orderItem
|
||||||
for (WebCadDataBlockReqVO.GroupInfo groupInfo : groupInfos) {
|
for (WebCadDataBlockReqVO.GroupInfo groupInfo : groupInfos) {
|
||||||
Integer cadGroupId = groupInfo.getGroupId();
|
String groupMapKey = orderBodyDO.getMultiRoomBodyName() + groupInfo.getGroupName();
|
||||||
OrderGroupDO orderGroupDO = groupMap.get(cadGroupId);
|
OrderGroupDO orderGroupDO = orderGroupMap.get(groupMapKey);
|
||||||
// cadGroupId存在累加板件和异形数量,不存在新增groupDO和orderGroupMap缓存
|
// 房间+柜体+加工组名称存在累加板件和异形数量,不存在新增groupDO和orderGroupMap缓存
|
||||||
if (ObjectUtil.isNull(orderGroupDO)) {
|
if (ObjectUtil.isNull(orderGroupDO)) {
|
||||||
orderGroupDO = OrderGroupDO
|
orderGroupDO = OrderGroupDO
|
||||||
.builder()
|
.builder()
|
||||||
@@ -799,7 +1095,7 @@ public class WebCadOrderImportFactory {
|
|||||||
orderGroupDO.setCreateTime(now);
|
orderGroupDO.setCreateTime(now);
|
||||||
orderGroupDO.setUpdateTime(now);
|
orderGroupDO.setUpdateTime(now);
|
||||||
|
|
||||||
groupMap.put(cadGroupId, orderGroupDO);
|
orderGroupMap.put(groupMapKey, orderGroupDO);
|
||||||
orderGroupDOS.add(orderGroupDO);
|
orderGroupDOS.add(orderGroupDO);
|
||||||
} else {
|
} else {
|
||||||
orderGroupDO.setPlateNum(orderGroupDO.getPlateNum() + 1);
|
orderGroupDO.setPlateNum(orderGroupDO.getPlateNum() + 1);
|
||||||
@@ -955,9 +1251,9 @@ public class WebCadOrderImportFactory {
|
|||||||
// 带加工组的配件增加item只记录配件id和数量
|
// 带加工组的配件增加item只记录配件id和数量
|
||||||
partNum += part.getNum();
|
partNum += part.getNum();
|
||||||
for (WebCadDataBlockReqVO.GroupInfo groupInfo : groupInfos) {
|
for (WebCadDataBlockReqVO.GroupInfo groupInfo : groupInfos) {
|
||||||
Integer cadGroupId = groupInfo.getGroupId();
|
String groupMapKey = orderBodyDO.getMultiRoomBodyName() + groupInfo.getGroupName();
|
||||||
OrderGroupDO orderGroupDO = groupMap.get(cadGroupId);
|
OrderGroupDO orderGroupDO = orderGroupMap.get(groupMapKey);
|
||||||
// cadGroupId存在累加板件和异形数量,不存在新增groupDO和orderGroupMap缓存
|
// 房间+柜体+加工组名称存在累加配件item,不存在新增groupDO和orderGroupMap缓存
|
||||||
if (ObjectUtil.isNull(orderGroupDO)) {
|
if (ObjectUtil.isNull(orderGroupDO)) {
|
||||||
orderGroupDO = OrderGroupDO
|
orderGroupDO = OrderGroupDO
|
||||||
.builder()
|
.builder()
|
||||||
@@ -983,7 +1279,7 @@ public class WebCadOrderImportFactory {
|
|||||||
orderGroupDO.setCreateTime(now);
|
orderGroupDO.setCreateTime(now);
|
||||||
orderGroupDO.setUpdateTime(now);
|
orderGroupDO.setUpdateTime(now);
|
||||||
|
|
||||||
groupMap.put(cadGroupId, orderGroupDO);
|
orderGroupMap.put(groupMapKey, orderGroupDO);
|
||||||
orderGroupDOS.add(orderGroupDO);
|
orderGroupDOS.add(orderGroupDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1080,6 +1376,8 @@ public class WebCadOrderImportFactory {
|
|||||||
material = partGroupData.getMaterial();
|
material = partGroupData.getMaterial();
|
||||||
// 封边条宽度从系统配置中获取宽度对应
|
// 封边条宽度从系统配置中获取宽度对应
|
||||||
sealEdgeWidthMatch(part);
|
sealEdgeWidthMatch(part);
|
||||||
|
// 规格可能修改,再获取一次
|
||||||
|
spec = part.getSpec();
|
||||||
}
|
}
|
||||||
|
|
||||||
String type = changePartType(partType, part.getIsComposite());
|
String type = changePartType(partType, part.getIsComposite());
|
||||||
@@ -1161,54 +1459,45 @@ public class WebCadOrderImportFactory {
|
|||||||
* @param part
|
* @param part
|
||||||
*/
|
*/
|
||||||
private void sealEdgeWidthMatch(WebCadDataPartsReqVO.BlockObjectListDTO part) {
|
private void sealEdgeWidthMatch(WebCadDataPartsReqVO.BlockObjectListDTO part) {
|
||||||
// 从spec中解析宽度、厚度
|
// 获取宽度、厚度
|
||||||
String spec = part.getSpec();
|
WebCadDataPartsReqVO.BlockObjectListDTO.GroupDataDTO partGroupData = part.getGroupData();
|
||||||
Double widthFromSpec = getWidthFromSpec(spec);
|
|
||||||
part.setThickness(getThicknessFromSpec(spec));
|
if (ObjectUtil.isNotNull(partGroupData)) {
|
||||||
if (ObjectUtil.isNull(widthFromSpec)) {
|
part.setThickness(String.valueOf(partGroupData.getSize()));
|
||||||
return;
|
Integer thickness = partGroupData.getThickness();
|
||||||
}
|
|
||||||
|
// 是否匹配上系统配置的封边条宽度配置,对应上了需要同步修改spec的中的内容
|
||||||
|
boolean sealEdgeConfigMatch = false;
|
||||||
|
String matchWidth = null;
|
||||||
for (SystemConfigSealEdgeRespDTO configSealEdgeRespDTO : sealEdgeConfigList) {
|
for (SystemConfigSealEdgeRespDTO configSealEdgeRespDTO : sealEdgeConfigList) {
|
||||||
// 宽度处于配置范围,宽取值作为最终配件宽度
|
// 宽度处于配置范围,宽取值作为最终配件宽度
|
||||||
if (widthFromSpec >= configSealEdgeRespDTO.getWidthMin() && widthFromSpec <= configSealEdgeRespDTO.getWidthMax()) {
|
if (thickness >= configSealEdgeRespDTO.getWidthMin() && thickness <= configSealEdgeRespDTO.getWidthMax()) {
|
||||||
part.setWidth(String.valueOf(configSealEdgeRespDTO.getWidthValue()));
|
matchWidth = String.valueOf(configSealEdgeRespDTO.getWidthValue());
|
||||||
|
part.setWidth(matchWidth);
|
||||||
|
sealEdgeConfigMatch = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sealEdgeConfigMatch) {
|
||||||
|
part.setSpec(modifySealEdgeSpec(part.getSpec(), matchWidth));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从规格中获取宽度,例:1mm-18mm
|
* @param spec
|
||||||
|
* @param width
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
private Double getWidthFromSpec(String spec) {
|
private String modifySealEdgeSpec(String spec, String width) {
|
||||||
if (StringUtils.isNotEmpty(spec)) {
|
if (StringUtils.isNotEmpty(spec)) {
|
||||||
String[] specSplit = spec.split("-");
|
String[] specSplit = spec.split("-");
|
||||||
if (specSplit.length >= 2) {
|
// 例:9mm-18mm-经典檀木
|
||||||
String widthInSpec = specSplit[1];
|
if (specSplit.length == 3) {
|
||||||
String[] widthSplit = widthInSpec.split("mm");
|
return specSplit[0] + "-" + width + "mm-" + specSplit[2];
|
||||||
if (widthSplit.length == 1) {
|
|
||||||
return NumberUtil.parseDouble(widthSplit[0]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return spec;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从规格中获取厚度,例:1mm-18mm
|
|
||||||
*/
|
|
||||||
private String getThicknessFromSpec(String spec) {
|
|
||||||
if (StringUtils.isNotEmpty(spec)) {
|
|
||||||
String[] specSplit = spec.split("-");
|
|
||||||
if (specSplit.length >= 2) {
|
|
||||||
String widthInSpec = specSplit[0];
|
|
||||||
String[] widthSplit = widthInSpec.split("mm");
|
|
||||||
if (widthSplit.length == 1) {
|
|
||||||
return widthSplit[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1397,7 +1686,7 @@ public class WebCadOrderImportFactory {
|
|||||||
private void clearAll() {
|
private void clearAll() {
|
||||||
orderPartsDOS.clear();
|
orderPartsDOS.clear();
|
||||||
orderGroupDOS.clear();
|
orderGroupDOS.clear();
|
||||||
groupMap.clear();
|
orderGroupMap.clear();
|
||||||
plateDOS.clear();
|
plateDOS.clear();
|
||||||
orderItemDOS.clear();
|
orderItemDOS.clear();
|
||||||
orderModelDOS.clear();
|
orderModelDOS.clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user