xml数据转换修改

This commit is contained in:
lym
2024-10-08 17:03:05 +08:00
parent 85a004b42c
commit 67291c4517
19 changed files with 887 additions and 450 deletions
@@ -22,4 +22,5 @@ public interface DictTypeConstants {
// ========== 单位 模块 ========== // ========== 单位 模块 ==========
String UNIT_LENGTH = "length_unit"; // 长度单位 String UNIT_LENGTH = "length_unit"; // 长度单位
String UNIT_AREA = "area_unit"; // 面积单位 String UNIT_AREA = "area_unit"; // 面积单位
String UNIT_NUMBER = "area_number"; // 个数单位
} }
@@ -6,6 +6,7 @@ import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.pojo.PageParam; import com.cf.imes.framework.common.pojo.PageParam;
import com.cf.imes.framework.common.pojo.PageResult; import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.object.BeanUtils; import com.cf.imes.framework.common.util.object.BeanUtils;
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
import com.cf.imes.framework.operatelog.core.annotations.OperateLog; import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils; import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
import com.cf.imes.module.executor.controller.admin.order.vo.order.*; import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
@@ -20,10 +21,12 @@ import com.cf.imes.module.executor.util.ExcelWriterUtil;
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiDataAchieve; import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiDataAchieve;
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiTypeRealize; import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiTypeRealize;
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelReadUtil; import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelReadUtil;
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelTypeRealize;
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO; import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO.OrderXmlVO; import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO.OrderXmlVO;
import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.XMLUtil; import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.XMLUtil;
import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.XmlBuilder; import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.XmlBuilder;
import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.XmlTypeRealize;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.Parameters;
@@ -41,6 +44,7 @@ import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -87,7 +91,14 @@ public class OrderController {
@Resource @Resource
private XMLUtil xmlUtil; private XMLUtil xmlUtil;
@Resource
private ExcelTypeRealize excelTypeRealize;
@Resource
private SnowFlakeGenerator snowFlakeGenerator;
@Resource
private XmlTypeRealize xmlTypeRealize;
@PutMapping("/update") @PutMapping("/update")
@Operation(summary = "更新生产单") @Operation(summary = "更新生产单")
@PreAuthorize("@ss.hasPermission('production:manager-list:edit')") @PreAuthorize("@ss.hasPermission('production:manager-list:edit')")
@@ -229,46 +240,6 @@ public class OrderController {
} }
} }
// public CommonResult<Long> test(@RequestParam(value = "orderNo") String orderNo)
// throws InterruptedException, ExecutionException {
//
// Long orderId = (Long) identifierGenerator.nextId(null);
// Long organId = getUserOrganId();
//
// JSONObject oauth = apiDataAchieve.getApiToken(organId).get();
// String token = oauth.getJSONObject("info").getString("access_token");
// String shopId = oauth.getJSONObject("info").getString("shop_id");
// JSONObject order = apiDataAchieve.getApiOrder(token, shopId, orderNo).get();
// if (!order.getString("err_code").equals("0")) {
// throw exception(PLATE_PLAN_DATA_ERROR);
// }
// if (order.getJSONArray("data") == null) {
// throw exception(PLATE_PLAN_DATA_NULL);
// }
// JSONObject dataPlates = apiDataAchieve.getApiPlateProData(token, orderNo).get();
// JSONObject dataParts = apiDataAchieve.getApiPartsMessage(token, orderNo).get();
// JSONObject dataBody = apiDataAchieve.getApiBodyMessage(token, orderNo).get();
// JSONObject dataGoods = apiDataAchieve.getApiGoodsMessage(token, orderNo).get();
// JSONObject plate = apiDataAchieve.getApiPlateDetailMessage(token, orderNo).get();
// JSONObject dataModule = apiDataAchieve.getApiGroupMessage(token, orderNo).get();
// JSONObject block = apiDataAchieve.getApiBlocksMessage(token, orderNo).get();
//
// CompletableFuture.runAsync(() -> {
// try {
// DynamicDataSourceContextHolder.push("slave");
// orderService.importApiData(order,dataPlates,dataParts,dataBody,dataGoods,plate,dataModule,block,orderNo, orderId, organId);
// DynamicDataSourceContextHolder.clear();
// } catch (Exception e) {
//
// log.error(" 1: ", e);
// }
// }, asyncExecutor).exceptionally(e -> {
// log.error("error", e);
// return null;
// });
//
// return success(orderId);
// }
@PostMapping("/importFile") @PostMapping("/importFile")
@Operation(summary = "生产单文件导入新增/导入板材") @Operation(summary = "生产单文件导入新增/导入板材")
@@ -287,6 +258,7 @@ public class OrderController {
HttpServletResponse response) throws Exception { HttpServletResponse response) throws Exception {
List<OrderPlateImportExcelVO> list = null; List<OrderPlateImportExcelVO> list = null;
OrderXmlVO orderXmlVO = null; OrderXmlVO orderXmlVO = null;
Map<String, List<?>> listMap = null;
OrderDO orderDO = null; OrderDO orderDO = null;
Map<String, Object> mapOrder = null; Map<String, Object> mapOrder = null;
@@ -304,6 +276,7 @@ public class OrderController {
Map<String, Object> mapChange = excelReadUtil.changeOrderDO(mapOrder); Map<String, Object> mapChange = excelReadUtil.changeOrderDO(mapOrder);
mapOrder = (Map<String, Object>) mapChange.get("file"); mapOrder = (Map<String, Object>) mapChange.get("file");
orderDO = (OrderDO) mapChange.get("order"); orderDO = (OrderDO) mapChange.get("order");
orderDO.setId((Long) snowFlakeGenerator.nextId(null));
flag = (Boolean) mapChange.get("error"); flag = (Boolean) mapChange.get("error");
} }
} else { } else {
@@ -332,6 +305,7 @@ public class OrderController {
orderDO.setStatus(OrderStatusEnum.EMPTY.getStatus()); orderDO.setStatus(OrderStatusEnum.EMPTY.getStatus());
} else { } else {
orderDO.setStatus(OrderStatusEnum.NEW_ORDER.getStatus()); orderDO.setStatus(OrderStatusEnum.NEW_ORDER.getStatus());
listMap = excelTypeRealize.changeDate(list, orderDO.getId());
} }
} }
if (!flag) { if (!flag) {
@@ -347,12 +321,13 @@ public class OrderController {
if (orderXmlVO != null) { if (orderXmlVO != null) {
mapOrder = xmlUtil.changeDate(orderXmlVO, getUserOrganId()); // 生产单数据格式验证 mapOrder = xmlUtil.changeDate(orderXmlVO, getUserOrganId()); // 生产单数据格式验证
orderDO = (OrderDO) mapOrder.get("order"); orderDO = (OrderDO) mapOrder.get("order");
orderDO.setId((Long) snowFlakeGenerator.nextId(null));
flag = (Boolean) mapOrder.get("error"); flag = (Boolean) mapOrder.get("error");
} }
} else { } else {
orderDO = orderService.getOrder(orderId); orderDO = orderService.getOrder(orderId);
if (orderDO == null) { if (orderDO == null) {
orderXmlVO = new OrderXmlVO().setMemo("生产单号不存在"); orderXmlVO = new OrderXmlVO().setMemo("---< 生产单号不存在 >---");
flag = false; flag = false;
} }
} }
@@ -365,14 +340,17 @@ public class OrderController {
orderXmlVO = new OrderXmlVO().setMemo("生产单内容为空"); orderXmlVO = new OrderXmlVO().setMemo("生产单内容为空");
flag = false; flag = false;
} else if (orderDO.getCustomOrderNo() != null && !orderService.customOrderNoIsExists(orderDO.getCustomOrderNo())) { } else if (orderDO.getCustomOrderNo() != null && !orderService.customOrderNoIsExists(orderDO.getCustomOrderNo())) {
orderXmlVO.setOrderCode(orderXmlVO.getOrderCode() + "自定义单号重复"); orderXmlVO.setOrderCode(orderXmlVO.getOrderCode() + "---< 自定义单号重复 >---");
flag = false; flag = false;
} else if (flag){ // 生产单的内容正确 } else if (flag){ // 生产单的内容正确
if (orderXmlVO.getMaterialXmlVO().getPlateXmlVOS().getPlateXmlVOList().size() == 0) { if (orderXmlVO.getMaterialXmlVO() == null || orderXmlVO.getMaterialXmlVO().getPlateXmlVOS() == null ||
orderXmlVO.getMaterialXmlVO().getPlateXmlVOS().getPlateXmlVOList() == null ||
orderXmlVO.getMaterialXmlVO().getPlateXmlVOS().getPlateXmlVOList().size() == 0) {
orderDO.setStatus(OrderStatusEnum.EMPTY.getStatus()); orderDO.setStatus(OrderStatusEnum.EMPTY.getStatus());
} else { } else {
orderDO.setStatus(OrderStatusEnum.NEW_ORDER.getStatus()); orderDO.setStatus(OrderStatusEnum.NEW_ORDER.getStatus());
flag = xmlUtil.checkVO(orderXmlVO); flag = xmlUtil.checkVO(orderXmlVO);
listMap = xmlTypeRealize.goodsInfoChange(orderXmlVO, orderDO.getId(), getUserOrganId());
} }
} }
if (!flag){ if (!flag){
@@ -381,7 +359,7 @@ public class OrderController {
return; return;
} }
} }
orderService.importExcelData(orderDO, type , index, list, orderXmlVO); orderService.importExcelData(orderDO, index, listMap);
} catch (Exception e) { } catch (Exception e) {
log.error("文件导入异常", e); log.error("文件导入异常", e);
if (type == 0) { if (type == 0) {
@@ -2,10 +2,7 @@ package com.cf.imes.module.executor.dal.dataobject.ordermodel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cf.imes.framework.es.core.dal.ESDocument; import com.cf.imes.framework.es.core.dal.ESDocument;
import com.cf.imes.module.executor.util.deviseData.structure.BasePosition; import com.cf.imes.module.executor.util.deviseData.structure.*;
import com.cf.imes.module.executor.util.deviseData.structure.HoleDetail;
import com.cf.imes.module.executor.util.deviseData.structure.ModelDetail;
import com.cf.imes.module.executor.util.deviseData.structure.PointDetail;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@@ -48,6 +45,8 @@ public class OrderModelDO extends ESDocument {
@Schema(description = "小板类型") @Schema(description = "小板类型")
private String boardType; private String boardType;
@Schema(description = "板件配件信息")
private List<PartsInfo> partsInfos;
@Schema(description = "开料长") @Schema(description = "开料长")
private BigDecimal splitLength; private BigDecimal splitLength;
@@ -69,8 +68,14 @@ public class OrderModelDO extends ESDocument {
private List<PointDetail> pointDetail; private List<PointDetail> pointDetail;
@Schema(description = "原始点明细列表") @Schema(description = "原始点明细列表")
private List<PointDetail> rawPointDetail; private List<PointDetail> rawPointDetail;
@Schema(description = "坯料点明细")
private List<PointDetail> basePointDetail ; //坯料点明细
@Schema(description = "holes数量集合 count=孔数量 countFaceA=正面垂直孔数量] countFaceB=反面垂直孔数量] countSide=水平侧孔数量] countSideL=左侧孔数量] countSideR=右侧孔数量 countSideU=上侧孔数量 countSideD=下侧孔数量 countBevelled=斜面孔数量 countLocking=偏心轮/锁定孔数量 countBuildIn=预埋件/插入孔数量 countHinge=铰链孔数量 countThrough=通孔(对穿孔)/挖穿孔数量]")
private Map<String,Integer> holeCount;//孔类型数量集合
@Schema(description = "孔明细列表") @Schema(description = "孔明细列表")
private List<HoleDetail> holeDetail; private List<HoleDetail> holeDetail;
@Schema(description = "凹槽数量集合")
private Map<String,Integer> contourCount;//凹槽数量集合
@Schema(description = "造型明细(凹槽)") @Schema(description = "造型明细(凹槽)")
private List<ModelDetail> contourDetail; private List<ModelDetail> contourDetail;
@Schema(description = "造型明细(孤岛,现在是xml数据格式添加)") @Schema(description = "造型明细(孤岛,现在是xml数据格式添加)")
@@ -101,15 +101,11 @@ public interface OrderService {
* @date 2024/3/30 * @date 2024/3/30
*/ */
Long importApiData(Map<String, List<?>> listMap); Long importApiData(Map<String, List<?>> listMap);
void importApiData(JSONObject order, JSONObject dataPlates, JSONObject dataParts
, JSONObject dataBody, JSONObject dataGoods
, JSONObject plates, JSONObject dataModule
, JSONObject dataBlocks, String orderNo,Long orderId, Long organId);
/** /**
* 文件数据导入 * 文件数据导入
*/ */
void importExcelData(OrderDO orderDO, Integer type, Integer index, List<OrderPlateImportExcelVO> list, OrderXmlVO orderXmlVO); void importExcelData(OrderDO orderDO, Integer index, Map<String, List<?>> mapOrder);
/** /**
* 生产导入文件模板下载 * 生产导入文件模板下载
@@ -520,34 +520,10 @@ public class OrderServiceImpl implements OrderService {
} }
@Override @Override
// @Async
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void importApiData(JSONObject order, JSONObject dataPlates, JSONObject dataParts public void importExcelData(OrderDO orderDO, Integer index, Map<String, List<?>> listMap) {
, JSONObject dataBody, JSONObject dataGoods if (index == 0) {
, JSONObject plates, JSONObject dataModule String nickName = Objects.requireNonNull(SecurityFrameworkUtils.getLoginUser()).getNickname();
, JSONObject dataBlocks, String orderNo,Long orderId, Long organId) {
// RequestContextHolder.setRequestAttributes(requestAttributes);
String nickName = SecurityFrameworkUtils.getLoginUser().getNickname();
Map<String, List<?>> listMap = apiTypeRealize.apiPlateDataChange(
order,
dataPlates,//板件生产信息
dataParts,// 配件信息
dataBody, // 柜体信息
dataGoods, // 商品信息
plates, // 板件明细
dataModule,// 加工组信息
dataBlocks,// 板材数据
orderNo,// 原始板编号
orderId,
organId);
List<OrderDO> orderDOS = (List<OrderDO>) listMap.get("orderDO");
if (orderDOS != null && orderDOS.size() > 0) {
OrderDO orderDO = orderDOS.get(0);
validateCustomOrderNoExists(orderDO.getCustomOrderNo());
orderDO.setCreator(nickName).setUpdater(nickName);
if (orderDO.getSalesman() == null || orderDO.getSalesman().equals("")) { if (orderDO.getSalesman() == null || orderDO.getSalesman().equals("")) {
orderDO.setSalesman(nickName); orderDO.setSalesman(nickName);
} }
@@ -556,61 +532,7 @@ public class OrderServiceImpl implements OrderService {
} }
orderMapper.insert(orderDO); orderMapper.insert(orderDO);
} }
List<GoodsDO> goodsDO = (List<GoodsDO>) listMap.get("goodsDO"); if (Objects.equals(orderDO.getStatus(), OrderStatusEnum.NEW_ORDER.getStatus())) {
List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) listMap.get("rawGoodsDO");
List<OrderBodyDO> bodyDO = (List<OrderBodyDO>) listMap.get("bodyDO");
List<OrderGroupDO> groupDO = (List<OrderGroupDO>) listMap.get("groupDO");
List<OrderPartsDO> partsDO = (List<OrderPartsDO>) listMap.get("partsDO");
List<PlateDO> plateDO = (List<PlateDO>) listMap.get("platesDO");
List<PlateDetail> plateDetail = (List<PlateDetail>) listMap.get("plateDetail");
List<OrderItemDO> itemDO = (List<OrderItemDO>) listMap.get("itemDO");
List<OrderPartsRemark> partsRemark = (List<OrderPartsRemark>) listMap.get("partsRemark");
Map<String, List<?>> map = getPlateGoods(goodsDO);// 检验商品板材信息是否存在
goodsDO = (List<GoodsDO>) map.get("goodsDO");
List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) map.get("plateGoodDOLists");
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, itemDO, goodsDO, plateGoodDOS);
List<OrderModelDO> orderModelDOs = BeanUtils.toBean(plateDetail, OrderModelDO.class);
if (orderModelDOs.size() > 0) {
orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(orderDOS.get(0).getId()));
orderInputProcessor.batchSaveModel(orderModelDOs);
}
if (partsRemark.size() > 0) {
orderInputProcessor.batchSaveOrderPartsModel(partsRemark);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void importExcelData(OrderDO orderDO, Integer type, Integer index, List<OrderPlateImportExcelVO> list, OrderXmlVO orderXmlVO) {
if (index == null || index == 0) {
orderDO.setId((Long) snowFlakeGenerator.nextId(null));
String nickName = SecurityFrameworkUtils.getLoginUser().getNickname();
if (orderDO.getSalesman() == null || orderDO.getSalesman().equals("")) {
orderDO.setSalesman(nickName);
}
if (orderDO.getSplitter() == null || orderDO.getSplitter().equals("")) {
orderDO.setSplitter(nickName);
}
orderMapper.insert(orderDO);
}
Map<String, List<?>> listMap = null;
if (type == 0){
if (list != null && list.size() > 0) {
listMap = excelTypeRealize.changeDate(list, orderDO.getId());
}
} else if (type == 1) {
} else if (type == 2) {
if (orderXmlVO != null) {
listMap = xmlTypeRealize.goodsInfoChange(orderXmlVO, orderDO.getId(), getUserOrganId());
}
}
List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) listMap.get("rawGoodsDOS"); List<RawGoodsDO> rawGoodsDO = (List<RawGoodsDO>) listMap.get("rawGoodsDOS");
List<GoodsDO> goodsDO = (List<GoodsDO>) listMap.get("goodsDOS"); List<GoodsDO> goodsDO = (List<GoodsDO>) listMap.get("goodsDOS");
@@ -628,17 +550,17 @@ public class OrderServiceImpl implements OrderService {
List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) map.get("plateGoodDOLists"); List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) map.get("plateGoodDOLists");
if (index != null && index != 0) { if (index != 0) {
roomCabinetProcessGroupMatch(orderDO.getId(), bodyDO, itemDO); roomCabinetProcessGroupMatch(orderDO.getId(), bodyDO, itemDO);
if (orderDO.getStatus() == OrderStatusEnum.EMPTY.getStatus()) { if (Objects.equals(orderDO.getStatus(), OrderStatusEnum.EMPTY.getStatus())) {
orderDO.setStatus(OrderStatusEnum.NEW_ORDER.getStatus()); orderDO.setStatus(OrderStatusEnum.NEW_ORDER.getStatus());
updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class)); updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class));
} }
if (orderDO.getStatus() == OrderStatusEnum.FINISH_PRODUCTION.getStatus()) { if (Objects.equals(orderDO.getStatus(), OrderStatusEnum.FINISH_PRODUCTION.getStatus())) {
orderDO.setStatus(OrderStatusEnum.IN_PRODUCTION.getStatus()); orderDO.setStatus(OrderStatusEnum.IN_PRODUCTION.getStatus());
updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class)); updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class));
} }
if (orderDO.getPackaged() == OrderPackageStatusEnum.PACKAGED.getStatus()) { if (Objects.equals(orderDO.getPackaged(), OrderPackageStatusEnum.PACKAGED.getStatus())) {
orderDO.setPackaged(OrderPackageStatusEnum.PACKAGING.getStatus()); orderDO.setPackaged(OrderPackageStatusEnum.PACKAGING.getStatus());
updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class)); updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class));
} }
@@ -657,6 +579,7 @@ public class OrderServiceImpl implements OrderService {
if (orderPartsRemarks != null && orderPartsRemarks.size() > 0) { if (orderPartsRemarks != null && orderPartsRemarks.size() > 0) {
orderInputProcessor.batchSaveOrderPartsModel(orderPartsRemarks); orderInputProcessor.batchSaveOrderPartsModel(orderPartsRemarks);
} }
}
} }
@@ -36,6 +36,4 @@ public class OffSetList {
@Schema(description = "二维刀路的属性-刀的半径") @Schema(description = "二维刀路的属性-刀的半径")
private Double radius; private Double radius;
@Schema(description = "面向类型(0正面, 1反面, 2侧面)")
private String faceType;
} }
@@ -14,43 +14,12 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor @NoArgsConstructor
public class PartsInfo { public class PartsInfo {
private String id; // 配件标识 private Long id; // 配件标识
private String name; // 配件名称 private String name; // 配件名称
// 配件所属信息
private String roomName; //房间名称
private String bodyName; //柜体名
private Integer bodyNo; // 柜体编号
// 柜体成倍拆单的倍数
private Integer multiNum;
// 单个配件的数量 // 单个配件的数量
private Double partNum; private Double partNum;
// 商品信息 // 配件数量单位
private String goodsNo; // 商品编码 private String unit;
private Long goodId; // 商品对应标识
private String material; //材质
private String color; //颜色
private String factory; //商品生产厂商
private String brand; //商品品牌
private String model; //商品型号
private String unit; //商品单位
private Double price; // 配件价格
private Boolean isComposite; // 是否为配件
private String groupName; // 组件名称
private String processGroup; // 五金加工组
private String objectType; // 五金类型
private String objectSpecExtras; // 五金额外规格
private Double goodsNumber; //产品数量为特殊处理,板件和配件都有数量
private String doorRemark; // 门板组件铰链备注
private String hingeRemark; // 门板组件拉手备注
private String remark;
private String specialRemark; // 特殊备注(Json字符串)
} }
@@ -19,6 +19,10 @@ import java.util.Map;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class PlateDetail{ public class PlateDetail{
// 组织id
private Long organId;
// 生产单id
private Long orderId;
// 板名称 // 板名称
private String name; private String name;
// 板id // 板id
@@ -39,6 +43,8 @@ public class PlateDetail{
private String roomNo; // 房间号 private String roomNo; // 房间号
private String bodyName; //柜体名 private String bodyName; //柜体名
private String bodyNo; // 柜体号 private String bodyNo; // 柜体号
private String groupName; //加工组号
private String groupNo; // 加工组名称
// 柜体 长 宽 深 // 柜体 长 宽 深
private Double width; private Double width;
private Double height; private Double height;
@@ -95,8 +101,11 @@ public class PlateDetail{
private BasePosition plateBasePosition; // 板件基准点坐标 private BasePosition plateBasePosition; // 板件基准点坐标
private List<PointDetail> pointDetail ; //点明细,表示小板外围轮廓的几个转折点(不含封边) private List<PointDetail> pointDetail ; //点明细,表示小板外围轮廓的几个转折点(不含封边)
private List<PointDetail> rawPointDetail ; //原始点明细(含封边) private List<PointDetail> rawPointDetail ; //原始点明细(含封边)
private List<PointDetail> basePointDetail ; //坯料点明细
private Map<String,Integer> holeCount;//孔类型数量集合
private List<HoleDetail> holeDetail ; //孔明细,表示板上的孔 private List<HoleDetail> holeDetail ; //孔明细,表示板上的孔
private Map<String,Integer> contourCount;//凹槽数量集合
private List<ModelDetail> contourDetail ; //造型明细(凹槽) private List<ModelDetail> contourDetail ; //造型明细(凹槽)
private List<ModelDetail> isletsDetail ; //造型明细(孤岛) private List<ModelDetail> isletsDetail ; //造型明细(孤岛)
@@ -33,4 +33,7 @@ public class PointDetail {
// 点的封边尺寸 // 点的封边尺寸
@Schema(description = "点的封边尺寸,封边尺寸,封边的厚度,长同边长") @Schema(description = "点的封边尺寸,封边尺寸,封边的厚度,长同边长")
private BigDecimal sealSize; private BigDecimal sealSize;
@Schema(description = "加工工艺")
private String process;
} }
@@ -1,12 +1,20 @@
package com.cf.imes.module.executor.util.fileConversion.admin.files.xml; package com.cf.imes.module.executor.util.fileConversion.admin.files.xml;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlAttribute;
/** /**
* xml中房间、柜体、加工组的位置信息 * xml中房间、柜体、加工组的位置信息
*/ */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PositionVO { public class PositionVO {
@Schema(name = "房间名称") @Schema(name = "房间名称")
@@ -99,6 +99,10 @@ public class AssemblyXmlVO implements Serializable {
@XmlAttribute(name = "groupCode") @XmlAttribute(name = "groupCode")
private String groupCode; private String groupCode;
// 加工组名称
@XmlAttribute(name = "groupName")
private String groupName;
// 模块名称 // 模块名称
@XmlAttribute(name = "moduleName") @XmlAttribute(name = "moduleName")
private String moduleName; private String moduleName;
@@ -139,6 +139,10 @@ public class BlockXmlVO implements Serializable {
@XmlAttribute(name = "groupCode") @XmlAttribute(name = "groupCode")
private String groupCode; private String groupCode;
// 柜体名称
@XmlAttribute(name = "groupName")
private String groupName;
// 模块名称 // 模块名称
@XmlAttribute(name = "moduleName") @XmlAttribute(name = "moduleName")
private String moduleName; private String moduleName;
@@ -1,6 +1,7 @@
package com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO; package com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@@ -8,6 +9,7 @@ import javax.xml.bind.annotation.*;
import java.io.Serializable; import java.io.Serializable;
@Data @Data
@Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@XmlRootElement(name = "Edging") @XmlRootElement(name = "Edging")
@@ -39,6 +39,6 @@ public class ExtraVO {
private List<String> edgeRemarks; private List<String> edgeRemarks;
@Schema(description ="封边备注" ) @Schema(description ="封边备注" )
private List<String> rectSealDetail; private List<RectSealVO> rectSealDetail;
} }
@@ -99,6 +99,10 @@ public class HardwareXmlVO implements Serializable {
@XmlAttribute(name = "groupCode") @XmlAttribute(name = "groupCode")
private String groupCode; private String groupCode;
// 加工组名称
@XmlAttribute(name = "groupName")
private String groupName;
// 模块名称 // 模块名称
@XmlAttribute(name = "moduleName") @XmlAttribute(name = "moduleName")
private String moduleName; private String moduleName;
@@ -85,4 +85,12 @@ public class PointXmlVO implements Serializable {
// 边备注信息 // 边备注信息
@XmlAttribute(name = "remark") @XmlAttribute(name = "remark")
private String remark; private String remark;
// 单边封边尺寸
@XmlAttribute(name = "count")
private String count;
// 封边尺寸单位
@XmlAttribute(name = "countUnit")
private String countUnit;
} }
@@ -16,15 +16,15 @@ import lombok.NoArgsConstructor;
public class RectSealVO { public class RectSealVO {
@Schema(description ="点id" ) @Schema(description ="点id" )
private String PointID; private String pointID;
@Schema(description ="预留边" ) @Schema(description ="预留边" )
private String ReservedEdge; private String reservedEdge;
@Schema(description ="封边颜色" ) @Schema(description ="封边颜色" )
private String SealColor; private String sealColor;
@Schema(description ="封边尺寸" ) @Schema(description ="封边尺寸" )
private String SealSize; private String sealSize;
} }
@@ -33,6 +33,9 @@ public class XMLUtil {
final String POSITIVE_ERR = "数据需为正数"; final String POSITIVE_ERR = "数据需为正数";
final String LONG_ERR = "数据长度不符合(共8位整数位5位,小数位3位)"; final String LONG_ERR = "数据长度不符合(共8位整数位5位,小数位3位)";
final String NOT_ASSIGNED = "未命名";
final String NOT_ASSIGNED_CODE = "未命编号";
@Resource @Resource
private DictDataApi dictDataApi; private DictDataApi dictDataApi;
@@ -247,6 +250,24 @@ public class XMLUtil {
assemblyXmlVO.setUnit("---< 组件数量单位不能为空 >---"); assemblyXmlVO.setUnit("---< 组件数量单位不能为空 >---");
flag = false; flag = false;
} }
if (StringUtils.isEmpty(assemblyXmlVO.getRoomCode())) {
assemblyXmlVO.setRoomCode(NOT_ASSIGNED_CODE);
}
if (StringUtils.isEmpty(assemblyXmlVO.getRoomName())) {
assemblyXmlVO.setRoomName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(assemblyXmlVO.getBoxCode())) {
assemblyXmlVO.setBoxCode(NOT_ASSIGNED_CODE);
}
if (StringUtils.isEmpty(assemblyXmlVO.getBoxName())) {
assemblyXmlVO.setBoxName(NOT_ASSIGNED);
}
// if (StringUtils.isEmpty(assemblyXmlVO.getGroupCode())) {
// assemblyXmlVO.setGroupCode(NOT_ASSIGNED_CODE);
// }
// if (StringUtils.isEmpty(assemblyXmlVO.getGroupName())) {
// assemblyXmlVO.setGroupName(NOT_ASSIGNED);
// }
} }
} }
} }
@@ -254,6 +275,24 @@ public class XMLUtil {
private void checkHardwares(HardwareXmlVOS hardwareXmlVOS, Boolean flag) { private void checkHardwares(HardwareXmlVOS hardwareXmlVOS, Boolean flag) {
if (hardwareXmlVOS != null && hardwareXmlVOS.getHardwareXmlVOList().size() > 0) { if (hardwareXmlVOS != null && hardwareXmlVOS.getHardwareXmlVOList().size() > 0) {
for (HardwareXmlVO hardwareXmlVO : hardwareXmlVOS.getHardwareXmlVOList()) { for (HardwareXmlVO hardwareXmlVO : hardwareXmlVOS.getHardwareXmlVOList()) {
if (StringUtils.isEmpty(hardwareXmlVO.getRoomCode())) {
hardwareXmlVO.setRoomCode(NOT_ASSIGNED_CODE);
}
if (StringUtils.isEmpty(hardwareXmlVO.getRoomName())) {
hardwareXmlVO.setRoomName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(hardwareXmlVO.getBoxCode())) {
hardwareXmlVO.setBoxCode(NOT_ASSIGNED_CODE);
}
if (StringUtils.isEmpty(hardwareXmlVO.getBoxName())) {
hardwareXmlVO.setBoxName(NOT_ASSIGNED);
}
// if (StringUtils.isEmpty(hardwareXmlVO.getGroupCode())) {
// hardwareXmlVO.setGroupCode(NOT_ASSIGNED_CODE);
// }
// if (StringUtils.isEmpty(hardwareXmlVO.getGroupName())) {
// hardwareXmlVO.setGroupName(NOT_ASSIGNED);
// }
if (StringUtils.isEmpty(hardwareXmlVO.getName())) { if (StringUtils.isEmpty(hardwareXmlVO.getName())) {
hardwareXmlVO.setName("---< 五金名称不能为空 >---"); hardwareXmlVO.setName("---< 五金名称不能为空 >---");
flag = false; flag = false;
@@ -290,6 +329,24 @@ public class XMLUtil {
private void checkEdgings(EdgingXmlVOS edgingXmlVOS, Boolean flag) { private void checkEdgings(EdgingXmlVOS edgingXmlVOS, Boolean flag) {
if (edgingXmlVOS != null && edgingXmlVOS.getEdgingXmlVOList().size() > 0) { if (edgingXmlVOS != null && edgingXmlVOS.getEdgingXmlVOList().size() > 0) {
for (EdgingXmlVO edgingXmlVO : edgingXmlVOS.getEdgingXmlVOList()) { for (EdgingXmlVO edgingXmlVO : edgingXmlVOS.getEdgingXmlVOList()) {
if (StringUtils.isEmpty(edgingXmlVO.getRoomCode())) {
edgingXmlVO.setRoomCode(NOT_ASSIGNED_CODE);
}
if (StringUtils.isEmpty(edgingXmlVO.getRoomName())) {
edgingXmlVO.setRoomName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(edgingXmlVO.getBoxCode())) {
edgingXmlVO.setBoxCode(NOT_ASSIGNED_CODE);
}
if (StringUtils.isEmpty(edgingXmlVO.getBoxName())) {
edgingXmlVO.setBoxName(NOT_ASSIGNED);
}
// if (StringUtils.isEmpty(edgingXmlVO.getGroupCode())) {
// edgingXmlVO.setGroupCode(NOT_ASSIGNED_CODE);
// }
// if (StringUtils.isEmpty(edgingXmlVO.getGroupName())) {
// edgingXmlVO.setGroupName(NOT_ASSIGNED);
// }
if (StringUtils.isEmpty(edgingXmlVO.getName())) { if (StringUtils.isEmpty(edgingXmlVO.getName())) {
edgingXmlVO.setName("---< 封边条名称不能为空 >---"); edgingXmlVO.setName("---< 封边条名称不能为空 >---");
flag = false; flag = false;
@@ -365,6 +422,12 @@ public class XMLUtil {
} }
} }
for (RoomXmlVO room : roomXmlVOS.getRoomXmlVOList()) { for (RoomXmlVO room : roomXmlVOS.getRoomXmlVOList()) {
if (StringUtils.isEmpty(room.getName())) {
room.setName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(room.getCode())) {
room.setCode(NOT_ASSIGNED_CODE);
}
if (room != null) { if (room != null) {
if (!StringUtils.isEmpty(room.getHeight())) { if (!StringUtils.isEmpty(room.getHeight())) {
Boolean flag = checkNumber(room.getHeight().trim(), Double.class); Boolean flag = checkNumber(room.getHeight().trim(), Double.class);
@@ -557,6 +620,12 @@ public class XMLUtil {
} else { } else {
box.setAxisZrotate("0"); box.setAxisZrotate("0");
} }
if (StringUtils.isEmpty(box.getName())) {
box.setName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(box.getCode())) {
box.setCode(NOT_ASSIGNED_CODE);
}
} }
} }
@@ -582,6 +651,12 @@ public class XMLUtil {
// 模块数据格式验证 // 模块数据格式验证
public void checkModuleList(List<ModuleXmlVO> moduleXmlVOSList, Boolean error) { public void checkModuleList(List<ModuleXmlVO> moduleXmlVOSList, Boolean error) {
for (ModuleXmlVO module : moduleXmlVOSList) { for (ModuleXmlVO module : moduleXmlVOSList) {
if (StringUtils.isEmpty(module.getName())) {
module.setName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(module.getCode())) {
module.setCode(NOT_ASSIGNED_CODE);
}
if (!StringUtils.isEmpty(module.getLength())) { if (!StringUtils.isEmpty(module.getLength())) {
Boolean flag = checkNumber(module.getLength().trim(), Double.class); Boolean flag = checkNumber(module.getLength().trim(), Double.class);
if (!flag) { if (!flag) {
@@ -633,6 +708,12 @@ public class XMLUtil {
// 加工组数据格式验证 // 加工组数据格式验证
public void checkGroupList(List<GroupXmlVO> groupXmlVOList, Boolean error) { public void checkGroupList(List<GroupXmlVO> groupXmlVOList, Boolean error) {
for (GroupXmlVO group : groupXmlVOList) { for (GroupXmlVO group : groupXmlVOList) {
if (StringUtils.isEmpty(group.getName())) {
group.setName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(group.getCode())) {
group.setCode(NOT_ASSIGNED_CODE);
}
if (!StringUtils.isEmpty(group.getLength())) { if (!StringUtils.isEmpty(group.getLength())) {
Boolean flag = checkNumber(group.getLength().trim(), Double.class); Boolean flag = checkNumber(group.getLength().trim(), Double.class);
if (!flag) { if (!flag) {
@@ -1050,12 +1131,24 @@ public class XMLUtil {
error = false; error = false;
} }
} }
if (StringUtils.isEmpty(blockXmlVO.getRoomCode())) {
blockXmlVO.setRoomCode(NOT_ASSIGNED_CODE);
}
if (StringUtils.isEmpty(blockXmlVO.getRoomName())) { if (StringUtils.isEmpty(blockXmlVO.getRoomName())) {
blockXmlVO.setRoomName("未命名"); blockXmlVO.setRoomName(NOT_ASSIGNED);
}
if (StringUtils.isEmpty(blockXmlVO.getBoxCode())) {
blockXmlVO.setBoxCode(NOT_ASSIGNED_CODE);
} }
if (StringUtils.isEmpty(blockXmlVO.getBoxName())) { if (StringUtils.isEmpty(blockXmlVO.getBoxName())) {
blockXmlVO.setBoxName("未命名"); blockXmlVO.setBoxName(NOT_ASSIGNED);
} }
// if (StringUtils.isEmpty(blockXmlVO.getGroupCode())) {
// blockXmlVO.setGroupCode(NOT_ASSIGNED_CODE);
// }
// if (StringUtils.isEmpty(blockXmlVO.getGroupName())) {
// blockXmlVO.setGroupName(NOT_ASSIGNED);
// }
if (!StringUtils.isEmpty(blockXmlVO.getBasePointX())) { if (!StringUtils.isEmpty(blockXmlVO.getBasePointX())) {
if (!ToolUtil.convertToType(blockXmlVO.getBasePointX(), Double.class)) { if (!ToolUtil.convertToType(blockXmlVO.getBasePointX(), Double.class)) {
blockXmlVO.setBasePointX(blockXmlVO.getBasePointX() + "---< " + TYPE_ERR + " >---"); blockXmlVO.setBasePointX(blockXmlVO.getBasePointX() + "---< " + TYPE_ERR + " >---");
@@ -1149,23 +1242,19 @@ public class XMLUtil {
if (correlationXmlVOS.getCorrelationXmlVOList() != null && correlationXmlVOS.getCorrelationXmlVOList().size() > 0) { if (correlationXmlVOS.getCorrelationXmlVOList() != null && correlationXmlVOS.getCorrelationXmlVOList().size() > 0) {
for (CorrelationXmlVO correlationXmlVO : correlationXmlVOS.getCorrelationXmlVOList()) { for (CorrelationXmlVO correlationXmlVO : correlationXmlVOS.getCorrelationXmlVOList()) {
if (StringUtils.isEmpty(correlationXmlVO.getItemCode())) { if (StringUtils.isEmpty(correlationXmlVO.getItemCode())) {
if (StringUtils.isEmpty(correlationXmlVO.getName())) { if (StringUtils.isEmpty(correlationXmlVO.getItemCode())) {
correlationXmlVO.setName("---< 关联配件(五金)/组件名称不可为空 >---"); correlationXmlVO.setName("---< 关联配件(五金)/组件物料编码 >---");
error = false; error = false;
} }
if (StringUtils.isEmpty(correlationXmlVO.getUnitCount())) { }
correlationXmlVO.setUnitCount("---< 关联配件(五金)/组件单位不可为空 >---"); if (!StringUtils.isEmpty(correlationXmlVO.getCount())) {
error = false; if (!checkNumber(correlationXmlVO.getCount(), Integer.class)) {
} correlationXmlVO.setCount(correlationXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
if (!StringUtils.isEmpty(correlationXmlVO.getCount())) {
if (!checkNumber(correlationXmlVO.getCount(), Integer.class)) {
correlationXmlVO.setCount(correlationXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false;
}
} else {
correlationXmlVO.setCount("---< 关联配件(五金)/组件数量不可为空 >---");
error = false; error = false;
} }
} else {
correlationXmlVO.setCount("---< 关联配件(五金)/组件数量不可为空 >---");
error = false;
} }
} }
} }
@@ -1251,6 +1340,8 @@ public class XMLUtil {
holeXmlVOS.setCount(holeXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCount(holeXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCount("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceA())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceA())) {
Boolean flag = checkNumber(holeXmlVOS.getCountFaceA().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountFaceA().trim(), Integer.class);
@@ -1258,6 +1349,8 @@ public class XMLUtil {
holeXmlVOS.setCountFaceA(holeXmlVOS.getCountFaceA() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountFaceA(holeXmlVOS.getCountFaceA() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountFaceA("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceB())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceB())) {
Boolean flag = checkNumber(holeXmlVOS.getCountFaceB().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountFaceB().trim(), Integer.class);
@@ -1265,6 +1358,8 @@ public class XMLUtil {
holeXmlVOS.setCountFaceB(holeXmlVOS.getCountFaceB() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountFaceB(holeXmlVOS.getCountFaceB() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountFaceB("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSide())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSide())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSide().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSide().trim(), Integer.class);
@@ -1272,6 +1367,8 @@ public class XMLUtil {
holeXmlVOS.setCountSide(holeXmlVOS.getCountSide() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSide(holeXmlVOS.getCountSide() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountSide("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideL())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideL())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideL().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideL().trim(), Integer.class);
@@ -1279,6 +1376,8 @@ public class XMLUtil {
holeXmlVOS.setCountSideL(holeXmlVOS.getCountSideL() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideL(holeXmlVOS.getCountSideL() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountSideL("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideR())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideR())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideR().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideR().trim(), Integer.class);
@@ -1286,6 +1385,8 @@ public class XMLUtil {
holeXmlVOS.setCountSideR(holeXmlVOS.getCountSideR() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideR(holeXmlVOS.getCountSideR() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountSideR("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideU())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideU())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideU().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideU().trim(), Integer.class);
@@ -1293,6 +1394,8 @@ public class XMLUtil {
holeXmlVOS.setCountSideU(holeXmlVOS.getCountSideU() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideU(holeXmlVOS.getCountSideU() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountSideU("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideD())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideD())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideD().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideD().trim(), Integer.class);
@@ -1300,6 +1403,8 @@ public class XMLUtil {
holeXmlVOS.setCountSideD(holeXmlVOS.getCountSideD() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideD(holeXmlVOS.getCountSideD() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountSideD("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountBevelled())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountBevelled())) {
Boolean flag = checkNumber(holeXmlVOS.getCountBevelled().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountBevelled().trim(), Integer.class);
@@ -1307,6 +1412,8 @@ public class XMLUtil {
holeXmlVOS.setCountBevelled(holeXmlVOS.getCountBevelled() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountBevelled(holeXmlVOS.getCountBevelled() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountBevelled("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountLocking())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountLocking())) {
Boolean flag = checkNumber(holeXmlVOS.getCountLocking().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountLocking().trim(), Integer.class);
@@ -1314,6 +1421,8 @@ public class XMLUtil {
holeXmlVOS.setCountLocking(holeXmlVOS.getCountLocking() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountLocking(holeXmlVOS.getCountLocking() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountLocking("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountBuildIn())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountBuildIn())) {
Boolean flag = checkNumber(holeXmlVOS.getCountBuildIn().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountBuildIn().trim(), Integer.class);
@@ -1321,6 +1430,8 @@ public class XMLUtil {
holeXmlVOS.setCountBuildIn(holeXmlVOS.getCountBuildIn() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountBuildIn(holeXmlVOS.getCountBuildIn() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountBuildIn("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountHinge())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountHinge())) {
Boolean flag = checkNumber(holeXmlVOS.getCountHinge().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountHinge().trim(), Integer.class);
@@ -1328,6 +1439,8 @@ public class XMLUtil {
holeXmlVOS.setCountHinge(holeXmlVOS.getCountHinge() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountHinge(holeXmlVOS.getCountHinge() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountHinge("0");
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountThrough())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountThrough())) {
Boolean flag = checkNumber(holeXmlVOS.getCountThrough().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountThrough().trim(), Integer.class);
@@ -1335,6 +1448,8 @@ public class XMLUtil {
holeXmlVOS.setCountThrough(holeXmlVOS.getCountThrough() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountThrough(holeXmlVOS.getCountThrough() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
holeXmlVOS.setCountThrough("0");
} }
if (holeXmlVOS.getHoleXmlVOList() != null && holeXmlVOS.getHoleXmlVOList().size() > 0) { if (holeXmlVOS.getHoleXmlVOList() != null && holeXmlVOS.getHoleXmlVOList().size() > 0) {
for (HoleXmlVO holeXmlVO : holeXmlVOS.getHoleXmlVOList()) { for (HoleXmlVO holeXmlVO : holeXmlVOS.getHoleXmlVOList()) {
@@ -1964,6 +2079,23 @@ public class XMLUtil {
error = false; error = false;
} }
} }
if (StringUtils.isEmpty(pointXmlVO.getCount())) {
pointXmlVO.setCount("0");
} else {
if (!checkNumber(pointXmlVO.getCount().trim(), Double.class)) {
pointXmlVO.setRadius("---< " + pointXmlVO.getRadius() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false;
}
}
if (StringUtils.isEmpty(pointXmlVO.getCountUnit())) {
pointXmlVO.setCountUnit("m");
} else {
DictDataRespDTO dictData = dictDataApi.parseDictData(DictTypeConstants.UNIT_LENGTH, pointXmlVO.getCountUnit().trim()).getData();
if (dictData == null) {
pointXmlVO.setCountUnit(pointXmlVO.getCountUnit() + "---< " + "封边条长度单位无效 >---");
error = false;
}
}
} }
} }