diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java index 9e2b4de9b..debcee335 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/OrderController.java @@ -342,7 +342,6 @@ public class OrderController { } else if (type == 2) { // xml orderXmlVO = (OrderXmlVO) XMLUtil.read(file, OrderXmlVO.class); - System.out.println("1、 " + orderXmlVO); if (index == 0){ if (orderXmlVO != null) { @@ -377,9 +376,8 @@ public class OrderController { } } if (!flag){ - System.out.println("xml = " + orderXmlVO); String xmlStr = XmlBuilder.objectToXmlStr(orderXmlVO); - XMLUtil.writeErr(response, xmlStr, " 错误.xml"); + XMLUtil.writeErr(response, xmlStr, " order_add_xml_err.xml"); return; } } @@ -390,7 +388,7 @@ public class OrderController { ExcelWriterUtil.write(response, mapOrder, list, orderService.getSavePath() + File.separator + "order_add_excel_err.xlsx"); } else if (type == 2) { String xmlStr = XmlBuilder.objectToXmlStr(orderXmlVO); - XMLUtil.writeErr(response, xmlStr, " 错误.xml"); + XMLUtil.writeErr(response, xmlStr, " order_add_xml_err.xml"); } } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/ordermodel/OrderModelDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/ordermodel/OrderModelDO.java index 41f6a7e6d..849fddde0 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/ordermodel/OrderModelDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/ordermodel/OrderModelDO.java @@ -32,6 +32,8 @@ public class OrderModelDO extends ESDocument { @Schema(description = "小板id") private Long plateId; + @Schema(description = "房间的基点坐标") + private BasePosition roomBasePosition; // 板件基准点坐标 @Schema(description = "柜体的基点坐标") private BasePosition bodyBasePosition; // 板件基准点坐标 @Schema(description = "板件的基点坐标") @@ -76,7 +78,7 @@ public class OrderModelDO extends ESDocument { @Schema(description = "侧面孔明细列表") private List sideHoleDetail; - @Schema(description = "生产封边备注 弃用") + @Schema(description = "生产封边备注") private Map sideRemark;// 封边备注 @Schema(description = "板材扩展备注") private JSONObject plateExtraRemark;// 封边备注 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java index 5088a7d51..5b408d798 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java @@ -867,7 +867,10 @@ public class OrderServiceImpl implements OrderService { PlateGoodDO plateGoodDO = null; List plateGoodDOS = null; if (goodsDO.getGoodsId() != null) { // 有goodsId - plateGoodDO = plateGoodMapper.selectGoodOne(goodsDO.getGoodsId(), OrganContextHolder.getOrganId()).get(0); + List plateGoodlist = plateGoodMapper.selectGoodOne(goodsDO.getGoodsId(), OrganContextHolder.getOrganId()); + if (plateGoodlist.size() > 0) { + plateGoodDO = plateGoodlist.get(0); + } } else { // 没有goodsId 其他信息匹配 plateGoodDOS = plateGoodMapper.selectGood(goodsDO.getGoodsName(), goodsDO.getMaterial(), goodsDO.getColor(), goodsDO.getTexture(), goodsDO.getWidth(), goodsDO.getThickness(), goodsDO.getHeight(), goodsDO.getBrand(), @@ -879,14 +882,19 @@ public class OrderServiceImpl implements OrderService { } else if (plateGoodDO != null) { // 存在板材 goodsDO.setGoodsId(plateGoodDO.getGoodsId()); } else { // 不存在板材 + String goodsId = goodsDO.getGoodsId(); + + if (goodsId == null) { + long plateNo = idWorker.nextId(); + long obtainingTime = idWorker.obtainingTime(); + goodsId = (obtainingTime) + Long.toString(plateNo).substring(2); + } Long plateGoods = (Long) identifierGenerator.nextId(null); - long plateNo = idWorker.nextId(); - long obtainingTime = idWorker.obtainingTime(); // Long goodsId = (Long) identifierGenerator.nextId(null); plateGoodDO = BeanUtils.toBean(goodsDO, PlateGoodDO.class) .setId(plateGoods) - .setGoodsId((obtainingTime) + Long.toString(plateNo).substring(2)); + .setGoodsId(goodsId); // 判断是否存在raw_goods_id if (goodsDO.getGoodsId() != null) { plateGoodDO.setGoodsId(goodsDO.getGoodsId()); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/structure/PlateDetail.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/structure/PlateDetail.java index 25d278ad7..51bdb5a22 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/structure/PlateDetail.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/structure/PlateDetail.java @@ -1,6 +1,7 @@ package com.cf.imes.module.executor.util.deviseData.structure; import com.alibaba.fastjson.JSONObject; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -89,6 +90,7 @@ public class PlateDetail{ private Boolean has3DModel; // 是否有三维刀路 // 轮廓数据、造型数据 + private BasePosition roomBasePosition; // 板件基准点坐标 private BasePosition bodyBasePosition; // 柜体基准点坐标 private BasePosition plateBasePosition; // 板件基准点坐标 private List pointDetail ; //点明细,表示小板外围轮廓的几个转折点(不含封边) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/PositionVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/PositionVO.java new file mode 100644 index 000000000..89d14e4c3 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/PositionVO.java @@ -0,0 +1,35 @@ +package com.cf.imes.module.executor.util.fileConversion.admin.files.xml; + +import io.swagger.v3.oas.annotations.media.Schema; + +import javax.xml.bind.annotation.XmlAttribute; + +/** + * xml中房间、柜体、加工组的位置信息 + */ +public class PositionVO { + + @Schema(name = "房间名称") + private String roomName; + + @Schema(name = "房间号") + private String roomCode; + + @Schema(name = "柜体名称") + private String boxName; + + @Schema(name = "柜体号") + private String boxCode; + + @Schema(name = "加工组名称") + private String groupName; + + @Schema(name = "加工组号") + private String groupCode; + + @Schema(name = "模块名称") + private String moduleName; + + @Schema(name = "模块号") + private String moduleCode; +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/VO/ExtraVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/VO/ExtraVO.java new file mode 100644 index 000000000..146d789e7 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/VO/ExtraVO.java @@ -0,0 +1,44 @@ +package com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * 板补充备注 格式 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ExtraVO { + + @Schema(description ="板类型" ) + private String boardType; + + @Schema(description ="挖穿的孔数" ) + private String throughHoleCount; + + @Schema(description ="挖穿的孔数" ) + private String throughModelCount; + + @Schema(description ="是否有二维刀路" ) + private String has2DModel; + + @Schema(description ="是否有三维刀路" ) + private String has3DModel; + + @Schema(description ="排版面" ) + private String composingFace; + + @Schema(description ="板边备注" ) + private List edgeRemarks; + + @Schema(description ="封边备注" ) + private List rectSealDetail; + +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/VO/RectSealVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/VO/RectSealVO.java new file mode 100644 index 000000000..575754cba --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/VO/RectSealVO.java @@ -0,0 +1,30 @@ +package com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 板备注 格式 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class RectSealVO { + + @Schema(description ="点id" ) + private String PointID; + + @Schema(description ="预留边" ) + private String ReservedEdge; + + @Schema(description ="封边颜色" ) + private String SealColor; + + @Schema(description ="封边尺寸" ) + private String SealSize; + +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XMLUtil.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XMLUtil.java index 72cb28c8b..210994638 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XMLUtil.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XMLUtil.java @@ -59,7 +59,7 @@ public class XMLUtil { // XML转为JAVA对象 Object odfBody = XmlBuilder.xmlStrToOject(clazz, builder.toString()); - return odfBody; + return odfBody; } catch (IOException e) { log.error("Error reading the file: " + file.getOriginalFilename(), e); } catch (Exception e) { @@ -151,7 +151,7 @@ public class XMLUtil { } } OrderDO orderDO = new OrderDO(); - if (error){ + if (error) { assert orderDate != null; orderDO = OrderDO.builder() .organId(organId) @@ -183,29 +183,29 @@ public class XMLUtil { Boolean flag = true; RoomXmlVOS roomXmlVOS = orderXmlVO.getRoomXmlVOS(); - if ( roomXmlVOS != null ) { + if (roomXmlVOS != null) { checkRoom(roomXmlVOS, flag); } ModuleXmlVOS moduleXmlVOS = orderXmlVO.getModuleXmlVOS(); - if ( moduleXmlVOS != null ) { + if (moduleXmlVOS != null) { checkModules(moduleXmlVOS, flag); } GroupXmlVOS grooveXmlVOS = orderXmlVO.getGroupXmlVOS(); - if ( grooveXmlVOS != null ) { + if (grooveXmlVOS != null) { checkGroups(grooveXmlVOS, flag); } MaterialXmlVO materialXmlVO = orderXmlVO.getMaterialXmlVO(); - if ( materialXmlVO != null ) { + if (materialXmlVO != null) { PlateXmlVOS plateXmlVOS = materialXmlVO.getPlateXmlVOS(); if (plateXmlVOS != null && plateXmlVOS.getPlateXmlVOList().size() > 0) { checkPlates(plateXmlVOS.getPlateXmlVOList(), flag); } AccessoryXmlVO accessoryXmlVO = materialXmlVO.getAccessoryXmlVO(); //配件 - if (accessoryXmlVO != null ){ + if (accessoryXmlVO != null) { checkEdgings(accessoryXmlVO.getEdgingXmlVOS(), flag); checkHardwares(accessoryXmlVO.getHardwareXmlVOS(), flag); } @@ -222,28 +222,28 @@ public class XMLUtil { private void checkAssemblies(AssemblieXmlVOS assemblieXmlVOS, Boolean flag) { if (assemblieXmlVOS != null && assemblieXmlVOS.getAssemblyXmlVOList().size() > 0) { for (AssemblyXmlVO assemblyXmlVO : assemblieXmlVOS.getAssemblyXmlVOList()) { - if (StringUtils.isEmpty(assemblyXmlVO.getName())){ + if (StringUtils.isEmpty(assemblyXmlVO.getName())) { assemblyXmlVO.setName("---< 组件名称不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(assemblyXmlVO.getMaterial())){ + if (StringUtils.isEmpty(assemblyXmlVO.getMaterial())) { assemblyXmlVO.setMaterial("---< 组件材质不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(assemblyXmlVO.getColor())){ + if (StringUtils.isEmpty(assemblyXmlVO.getColor())) { assemblyXmlVO.setColor("---< 组件颜色不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(assemblyXmlVO.getCount())){ + if (StringUtils.isEmpty(assemblyXmlVO.getCount())) { assemblyXmlVO.setCount("---< 组件数量不能为空 >---"); flag = false; } else { - if (!checkNumber(assemblyXmlVO.getCount().trim(), Double.class)){ - assemblyXmlVO.setCount("---< " + assemblyXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + if (!checkNumber(assemblyXmlVO.getCount().trim(), Double.class)) { + assemblyXmlVO.setCount(assemblyXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); flag = false; } } - if (StringUtils.isEmpty(assemblyXmlVO.getUnitCount())){ + if (StringUtils.isEmpty(assemblyXmlVO.getUnitCount())) { assemblyXmlVO.setUnit("---< 组件数量单位不能为空 >---"); flag = false; } @@ -254,32 +254,32 @@ public class XMLUtil { private void checkHardwares(HardwareXmlVOS hardwareXmlVOS, Boolean flag) { if (hardwareXmlVOS != null && hardwareXmlVOS.getHardwareXmlVOList().size() > 0) { for (HardwareXmlVO hardwareXmlVO : hardwareXmlVOS.getHardwareXmlVOList()) { - if (StringUtils.isEmpty(hardwareXmlVO.getName())){ + if (StringUtils.isEmpty(hardwareXmlVO.getName())) { hardwareXmlVO.setName("---< 五金名称不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(hardwareXmlVO.getMaterial())){ + if (StringUtils.isEmpty(hardwareXmlVO.getMaterial())) { hardwareXmlVO.setMaterial("---< 五金材质不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(hardwareXmlVO.getColor())){ + if (StringUtils.isEmpty(hardwareXmlVO.getColor())) { hardwareXmlVO.setColor("---< 五金条颜色不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(hardwareXmlVO.getCount())){ + if (StringUtils.isEmpty(hardwareXmlVO.getCount())) { hardwareXmlVO.setCount("---< 五金数量不能为空 >---"); flag = false; } else { - if (!checkNumber(hardwareXmlVO.getCount().trim() , Double.class)){ - hardwareXmlVO.setCount("---< " + hardwareXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + if (!checkNumber(hardwareXmlVO.getCount().trim(), Double.class)) { + hardwareXmlVO.setCount(hardwareXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); flag = false; } } - if (StringUtils.isEmpty(hardwareXmlVO.getUnitCount())){ + if (StringUtils.isEmpty(hardwareXmlVO.getUnitCount())) { hardwareXmlVO.setUnitCount("---< 五金数量单位不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(hardwareXmlVO.getUnit())){ + if (StringUtils.isEmpty(hardwareXmlVO.getUnit())) { hardwareXmlVO.setUnit("---< 五金单位不能为空 >---"); flag = false; } @@ -290,55 +290,55 @@ public class XMLUtil { private void checkEdgings(EdgingXmlVOS edgingXmlVOS, Boolean flag) { if (edgingXmlVOS != null && edgingXmlVOS.getEdgingXmlVOList().size() > 0) { for (EdgingXmlVO edgingXmlVO : edgingXmlVOS.getEdgingXmlVOList()) { - if (StringUtils.isEmpty(edgingXmlVO.getName())){ + if (StringUtils.isEmpty(edgingXmlVO.getName())) { edgingXmlVO.setName("---< 封边条名称不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(edgingXmlVO.getMaterial())){ + if (StringUtils.isEmpty(edgingXmlVO.getMaterial())) { edgingXmlVO.setMaterial("---< 封边条材质不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(edgingXmlVO.getColor())){ + if (StringUtils.isEmpty(edgingXmlVO.getColor())) { edgingXmlVO.setColor("---< 封边条颜色不能为空 >---"); flag = false; } - if (StringUtils.isEmpty(edgingXmlVO.getLength())){ + if (StringUtils.isEmpty(edgingXmlVO.getLength())) { edgingXmlVO.setLength("---< 封边条长度不能为空 >---"); flag = false; - } else if (!checkNumber(edgingXmlVO.getLength().trim(), Double.class)){ - edgingXmlVO.setLength("---< " + edgingXmlVO.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + } else if (!checkNumber(edgingXmlVO.getLength().trim(), Double.class)) { + edgingXmlVO.setLength(edgingXmlVO.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); flag = false; } - if (StringUtils.isEmpty(edgingXmlVO.getWidth())){ + if (StringUtils.isEmpty(edgingXmlVO.getWidth())) { edgingXmlVO.setWidth("---< 封边条宽度不能为空 >---"); flag = false; - } else if (!checkNumber(edgingXmlVO.getWidth().trim(), Double.class)){ - edgingXmlVO.setWidth("---< " + edgingXmlVO.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + } else if (!checkNumber(edgingXmlVO.getWidth().trim(), Double.class)) { + edgingXmlVO.setWidth(edgingXmlVO.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); flag = false; - } - if (StringUtils.isEmpty(edgingXmlVO.getThickness())){ + } + if (StringUtils.isEmpty(edgingXmlVO.getThickness())) { edgingXmlVO.setThickness("---< 封边条厚度不能为空 >---"); flag = false; - } else if (!checkNumber(edgingXmlVO.getThickness().trim(), Double.class)){ - edgingXmlVO.setThickness("---< " + edgingXmlVO.getThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + } else if (!checkNumber(edgingXmlVO.getThickness().trim(), Double.class)) { + edgingXmlVO.setThickness(edgingXmlVO.getThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); } - if (StringUtils.isEmpty(edgingXmlVO.getUnit())){ + if (StringUtils.isEmpty(edgingXmlVO.getUnit())) { edgingXmlVO.setUnit("mm"); } else { DictDataRespDTO dictData = dictDataApi.parseDictData(DictTypeConstants.UNIT_LENGTH, edgingXmlVO.getUnit().trim()).getData(); if (dictData == null) { - edgingXmlVO.setUnit("---< " + edgingXmlVO.getUnit().trim() + "封边条长度单位无效 >---"); + edgingXmlVO.setUnit(edgingXmlVO.getUnit() + "---< " + "封边条长度单位无效 >---"); flag = false; } } - if (StringUtils.isEmpty(edgingXmlVO.getCount())){ + if (StringUtils.isEmpty(edgingXmlVO.getCount())) { edgingXmlVO.setCount("---< 封边条数量不能为空 >---"); flag = false; - } else if (!checkNumber(edgingXmlVO.getCount().trim(), Double.class)){ - edgingXmlVO.setCount("---< " + edgingXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + } else if (!checkNumber(edgingXmlVO.getCount().trim(), Double.class)) { + edgingXmlVO.setCount(edgingXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); flag = false; - } - if (StringUtils.isEmpty(edgingXmlVO.getUnitCount())){ + } + if (StringUtils.isEmpty(edgingXmlVO.getUnitCount())) { edgingXmlVO.setUnitCount("m"); flag = false; } else { @@ -354,19 +354,19 @@ public class XMLUtil { // 房间数据格式验证 public void checkRoom(RoomXmlVOS roomXmlVOS, Boolean error) { if (!StringUtils.isEmpty(roomXmlVOS.getCount())) { - if (ToolUtil.convertToType(roomXmlVOS.getCount().trim(), Integer.class)){ - if (!ToolUtil.checkNumber(roomXmlVOS.getCount().trim())){ + if (ToolUtil.convertToType(roomXmlVOS.getCount().trim(), Integer.class)) { + if (!ToolUtil.checkNumber(roomXmlVOS.getCount().trim())) { roomXmlVOS.setCount(roomXmlVOS.getCount() + "---< " + POSITIVE_ERR + " >---"); error = false; } } else { - roomXmlVOS.setCount(roomXmlVOS.getCount() + "---< " + roomXmlVOS.getCount() + TYPE_ERR + " >---"); + roomXmlVOS.setCount(roomXmlVOS.getCount() + "---< " + TYPE_ERR + " >---"); error = false; } } - for ( RoomXmlVO room : roomXmlVOS.getRoomXmlVOList() ) { - if (room != null){ - if (!StringUtils.isEmpty(room.getHeight()) ){ + for (RoomXmlVO room : roomXmlVOS.getRoomXmlVOList()) { + if (room != null) { + if (!StringUtils.isEmpty(room.getHeight())) { Boolean flag = checkNumber(room.getHeight().trim(), Double.class); if (!flag) { room.setHeight(room.getHeight() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); @@ -375,7 +375,7 @@ public class XMLUtil { } else { room.setHeight("0"); } - if (!StringUtils.isEmpty(room.getLength()) ){ + if (!StringUtils.isEmpty(room.getLength())) { Boolean flag = checkNumber(room.getLength().trim(), Double.class); if (!flag) { room.setLength(room.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); @@ -384,135 +384,178 @@ public class XMLUtil { } else { room.setLength("0"); } - if (!StringUtils.isEmpty(room.getWidth()) ){ + if (!StringUtils.isEmpty(room.getWidth())) { Boolean flag = checkNumber(room.getWidth().trim(), Double.class); if (!flag) { room.setWidth(room.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } - }else { + } else { room.setWidth("0"); } - if (!StringUtils.isEmpty(room.getMultipleNumber()) ){ + if (!StringUtils.isEmpty(room.getMultipleNumber())) { Boolean flag = checkNumber(room.getMultipleNumber().trim(), Integer.class); if (!flag) { - room.setMultipleNumber(room.getMultipleNumber() +"---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + room.setMultipleNumber(room.getMultipleNumber() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } - }else { + } else { room.setMultipleNumber("1"); } - if (!StringUtils.isEmpty(room.getMultipleNo()) ){ + if (!StringUtils.isEmpty(room.getMultipleNo())) { Boolean flag = checkNumber(room.getMultipleNo().trim(), Integer.class); if (!flag) { room.setMultipleNo(room.getMultipleNo() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } - }else { + } else { room.setMultipleNo("1"); } - if (!StringUtils.isEmpty(room.getBasePointX()) ){ + if (!StringUtils.isEmpty(room.getBasePointX())) { if (!ToolUtil.convertToType(room.getBasePointX().trim(), Double.class)) { - room.setBasePointX("---< " + room.getBasePointX() + TYPE_ERR + " >---"); + room.setBasePointX(room.getBasePointX() + "---< " + TYPE_ERR + " >---"); error = false; } + }else { + room.setBasePointX("0"); } - if (!StringUtils.isEmpty(room.getBasePointY()) ){ + if (!StringUtils.isEmpty(room.getBasePointY())) { if (!ToolUtil.convertToType(room.getBasePointY().trim(), Double.class)) { - room.setBasePointY("---< " + room.getBasePointY() + TYPE_ERR + " >---"); + room.setBasePointY(room.getBasePointY() + "---< " + TYPE_ERR + " >---"); error = false; } + }else { + room.setBasePointY("0"); } - if (!StringUtils.isEmpty(room.getBasePointZ()) ){ + if (!StringUtils.isEmpty(room.getBasePointZ())) { if (!ToolUtil.convertToType(room.getBasePointZ().trim(), Double.class)) { - room.setBasePointZ("---< " + room.getBasePointZ() + TYPE_ERR + " >---"); + room.setBasePointZ(room.getBasePointZ() + "---< " + TYPE_ERR + " >---"); error = false; } + }else { + room.setBasePointZ("0"); } - if (!StringUtils.isEmpty(room.getAxisXrotate()) ){ + if (!StringUtils.isEmpty(room.getAxisXrotate())) { if (!ToolUtil.convertToType(room.getAxisXrotate().trim(), Double.class)) { - room.setAxisXrotate("---< " + room.getAxisXrotate() + TYPE_ERR + " >---"); + room.setAxisXrotate(room.getAxisXrotate() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + room.setAxisXrotate("0"); } - if (!StringUtils.isEmpty(room.getAxisYrotate()) ){ + if (!StringUtils.isEmpty(room.getAxisYrotate())) { if (!ToolUtil.convertToType(room.getAxisYrotate().trim(), Double.class)) { - room.setAxisYrotate("---< " + room.getAxisYrotate() + TYPE_ERR + " >---"); + room.setAxisYrotate(room.getAxisYrotate() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + room.setAxisYrotate("0"); } - if (!StringUtils.isEmpty(room.getAxisZrotate()) ){ + if (!StringUtils.isEmpty(room.getAxisZrotate())) { if (!ToolUtil.convertToType(room.getAxisZrotate().trim(), Double.class)) { - room.setAxisZrotate("---< " + room.getAxisZrotate() + TYPE_ERR + " >---"); + room.setAxisZrotate(room.getAxisZrotate() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + room.setAxisZrotate("0"); } // 柜体数据格式验证 - if (room.getBoxXmlVOList() != null && room.getBoxXmlVOList().size() > 0){ + if (room.getBoxXmlVOList() != null && room.getBoxXmlVOList().size() > 0) { checkBoxList(room.getBoxXmlVOList(), error); } } } } + // 柜体数据格式验证 public void checkBoxList(List boxXmlVOList, Boolean error) { - for ( BoxXmlVO box : boxXmlVOList ) { - if (!StringUtils.isEmpty(box.getHeight()) ){ + for (BoxXmlVO box : boxXmlVOList) { + if (!StringUtils.isEmpty(box.getHeight())) { Boolean flag = checkNumber(box.getHeight().trim(), Double.class); if (!flag) { - box.setHeight("---< " + box.getHeight() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + box.setHeight(box.getHeight() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { box.setHeight("0"); } - if (!StringUtils.isEmpty(box.getLength()) ){ + if (!StringUtils.isEmpty(box.getLength())) { Boolean flag = checkNumber(box.getLength().trim(), Double.class); if (!flag) { - box.setLength("---< " + box.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + box.setLength(box.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { box.setLength("0"); } - if (!StringUtils.isEmpty(box.getWidth()) ){ + if (!StringUtils.isEmpty(box.getWidth())) { Boolean flag = checkNumber(box.getWidth().trim(), Double.class); if (!flag) { - box.setWidth("---< " + box.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + box.setWidth(box.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { box.setWidth("0"); } - if (!StringUtils.isEmpty(box.getBasePointX())){ + if (!StringUtils.isEmpty(box.getMultipleNumber())) { + Boolean flag = checkNumber(box.getMultipleNumber().trim(), Integer.class); + if (!flag) { + box.setMultipleNumber(box.getMultipleNumber() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + error = false; + } + } else { + box.setMultipleNumber("1"); + } + if (!StringUtils.isEmpty(box.getMultipleNo())) { + Boolean flag = checkNumber(box.getMultipleNo().trim(), Integer.class); + if (!flag) { + box.setMultipleNo(box.getMultipleNo() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + error = false; + } + } else { + box.setMultipleNo("1"); + } + if (!StringUtils.isEmpty(box.getBasePointX())) { if (!ToolUtil.convertToType(box.getBasePointX().trim(), Double.class)) { - box.setBasePointX("---< " + box.getBasePointX() + TYPE_ERR + " >---"); + box.setBasePointX(box.getBasePointX() + "---< " + TYPE_ERR + " >---"); } + } else { + box.setBasePointX("0"); } - if (!StringUtils.isEmpty(box.getBasePointY())){ + if (!StringUtils.isEmpty(box.getBasePointY())) { if (!ToolUtil.convertToType(box.getBasePointY().trim(), Double.class)) { - box.setBasePointY("---< " + box.getBasePointY() + TYPE_ERR + " >---"); + box.setBasePointY(box.getBasePointY() + "---< " + TYPE_ERR + " >---"); } + } else { + box.setBasePointY("0"); } - if (!StringUtils.isEmpty(box.getBasePointZ())){ + if (!StringUtils.isEmpty(box.getBasePointZ())) { if (!ToolUtil.convertToType(box.getBasePointZ().trim(), Double.class)) { - box.setBasePointZ("---< " + box.getBasePointZ() + TYPE_ERR + " >---"); + box.setBasePointZ(box.getBasePointZ() + "---< " + TYPE_ERR + " >---"); } + } else { + box.setBasePointZ("0"); } - if (!StringUtils.isEmpty(box.getAxisYrotate())){ + if (!StringUtils.isEmpty(box.getAxisYrotate())) { if (!ToolUtil.convertToType(box.getAxisYrotate().trim(), Double.class)) { - box.setAxisYrotate("---< " + box.getAxisYrotate() + TYPE_ERR + " >---"); + box.setAxisYrotate(box.getAxisYrotate() + "---< " + TYPE_ERR + " >---"); } + } else { + box.setAxisYrotate("0"); } - if (!StringUtils.isEmpty(box.getAxisXrotate())){ + if (!StringUtils.isEmpty(box.getAxisXrotate())) { if (!ToolUtil.convertToType(box.getAxisXrotate().trim(), Double.class)) { - box.setAxisXrotate("---< " + box.getAxisXrotate() + TYPE_ERR + " >---"); + box.setAxisXrotate(box.getAxisXrotate() + "---< " + TYPE_ERR + " >---"); } + } else { + box.setAxisXrotate("0"); } - if (!StringUtils.isEmpty(box.getAxisZrotate())){ + if (!StringUtils.isEmpty(box.getAxisZrotate())) { if (!ToolUtil.convertToType(box.getAxisZrotate().trim(), Double.class)) { - box.setAxisZrotate("---< " + box.getAxisZrotate() + TYPE_ERR + " >---"); + box.setAxisZrotate(box.getAxisZrotate() + "---< " + TYPE_ERR + " >---"); } + } else { + box.setAxisZrotate("0"); } } } @@ -520,46 +563,47 @@ public class XMLUtil { // 模块数据格式验证 public void checkModules(ModuleXmlVOS moduleXmlVOS, Boolean error) { if (!StringUtils.isEmpty(moduleXmlVOS.getCount())) { - if (ToolUtil.convertToType(moduleXmlVOS.getCount().trim(), Integer.class)){ - if (!ToolUtil.checkNumber(moduleXmlVOS.getCount().trim())){ - moduleXmlVOS.setCount("---< " + moduleXmlVOS.getCount() + POSITIVE_ERR + " >---"); + if (ToolUtil.convertToType(moduleXmlVOS.getCount().trim(), Integer.class)) { + if (!ToolUtil.checkNumber(moduleXmlVOS.getCount().trim())) { + moduleXmlVOS.setCount(moduleXmlVOS.getCount() + "---< " + POSITIVE_ERR + " >---"); error = false; } } else { - moduleXmlVOS.setCount("---< " + moduleXmlVOS.getCount() + TYPE_ERR + " >---"); + moduleXmlVOS.setCount(moduleXmlVOS.getCount() + "---< " + TYPE_ERR + " >---"); error = false; } } - if (moduleXmlVOS.getModuleXmlVOList() != null && moduleXmlVOS.getModuleXmlVOList().size() > 0){ + if (moduleXmlVOS.getModuleXmlVOList() != null && moduleXmlVOS.getModuleXmlVOList().size() > 0) { checkModuleList(moduleXmlVOS.getModuleXmlVOList(), error); } } + // 模块数据格式验证 public void checkModuleList(List moduleXmlVOSList, Boolean error) { - for ( ModuleXmlVO module : moduleXmlVOSList ) { - if (!StringUtils.isEmpty(module.getLength()) ){ + for (ModuleXmlVO module : moduleXmlVOSList) { + if (!StringUtils.isEmpty(module.getLength())) { Boolean flag = checkNumber(module.getLength().trim(), Double.class); if (!flag) { - module.setLength("---< " + module.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + module.setLength(module.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { module.setLength("0"); } - if (!StringUtils.isEmpty(module.getWidth()) ){ + if (!StringUtils.isEmpty(module.getWidth())) { Boolean flag = checkNumber(module.getWidth().trim(), Double.class); if (!flag) { - module.setWidth("---< " + module.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + module.setWidth(module.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { module.setWidth("0"); } - if (!StringUtils.isEmpty(module.getHeight()) ){ + if (!StringUtils.isEmpty(module.getHeight())) { Boolean flag = checkNumber(module.getHeight().trim(), Double.class); if (!flag) { - module.setHeight("---< " + module.getHeight() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + module.setHeight(module.getHeight() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { @@ -571,45 +615,46 @@ public class XMLUtil { // 加工组数据格式验证 public void checkGroups(GroupXmlVOS groupXmlVOS, Boolean error) { if (!StringUtils.isEmpty(groupXmlVOS.getCount())) { - if (ToolUtil.convertToType(groupXmlVOS.getCount().trim(), Integer.class)){ - if (!ToolUtil.checkNumber(groupXmlVOS.getCount().trim())){ - groupXmlVOS.setCount("---< " + groupXmlVOS.getCount() + POSITIVE_ERR + " >---"); + if (ToolUtil.convertToType(groupXmlVOS.getCount().trim(), Integer.class)) { + if (!ToolUtil.checkNumber(groupXmlVOS.getCount().trim())) { + groupXmlVOS.setCount(groupXmlVOS.getCount() + "---< " + POSITIVE_ERR + " >---"); error = false; } } else { - groupXmlVOS.setCount("---< " + groupXmlVOS.getCount() + TYPE_ERR + " >---"); + groupXmlVOS.setCount(groupXmlVOS.getCount() + "---< " + TYPE_ERR + " >---"); error = false; } } - if (groupXmlVOS.getGroupXmlVOList() != null && groupXmlVOS.getGroupXmlVOList().size() > 0){ + if (groupXmlVOS.getGroupXmlVOList() != null && groupXmlVOS.getGroupXmlVOList().size() > 0) { checkGroupList(groupXmlVOS.getGroupXmlVOList(), error); } } + // 加工组数据格式验证 public void checkGroupList(List groupXmlVOList, Boolean error) { - for ( GroupXmlVO group : groupXmlVOList ) { - if (!StringUtils.isEmpty(group.getLength()) ){ + for (GroupXmlVO group : groupXmlVOList) { + if (!StringUtils.isEmpty(group.getLength())) { Boolean flag = checkNumber(group.getLength().trim(), Double.class); if (!flag) { - group.setLength("---< " + group.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + group.setLength(group.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { group.setLength("0"); } - if (!StringUtils.isEmpty(group.getWidth()) ){ + if (!StringUtils.isEmpty(group.getWidth())) { Boolean flag = checkNumber(group.getWidth().trim(), Double.class); if (!flag) { - group.setWidth( "---< " + group.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + group.setWidth(group.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { group.setWidth("0"); } - if (!StringUtils.isEmpty(group.getHeight()) ){ + if (!StringUtils.isEmpty(group.getHeight())) { Boolean flag = checkNumber(group.getHeight().trim(), Double.class); if (!flag) { - group.setHeight("---< " + group.getHeight() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + group.setHeight(group.getHeight() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { @@ -620,12 +665,12 @@ public class XMLUtil { // 板材数据格式验证 public void checkPlates(List plateXmlVOList, Boolean error) { - for ( PlateXmlVO plate : plateXmlVOList ) { - if (StringUtils.isEmpty(plate.getName())){ + for (PlateXmlVO plate : plateXmlVOList) { + if (StringUtils.isEmpty(plate.getName())) { plate.setName("---< 板材名称不能为空 >---"); error = false; } - if (StringUtils.isEmpty(plate.getMaterial())){ + if (StringUtils.isEmpty(plate.getMaterial())) { plate.setItemCode("---< 板材材质不能为空 >---"); error = false; } @@ -634,7 +679,7 @@ public class XMLUtil { plate.setGrained("有"); } else { if (!StringUtils.equals(plate.getGrained().trim(), "无") && !StringUtils.equals(plate.getGrained().trim(), "有")) { - plate.setGrained("---< " + plate.getGrained() + " 板材纹理无效 >---"); + plate.setGrained(plate.getGrained() + "---< " + " 板材纹理无效 >---"); error = false; } } @@ -642,88 +687,88 @@ public class XMLUtil { plate.setCoating("双面"); } else { if (!StringUtils.equals(plate.getCoating().trim(), "双面") && !StringUtils.equals(plate.getCoating().trim(), "单面") && - !StringUtils.equals(plate.getCoating().trim(), "无")) { - plate.setCoating("---< " + plate.getCoating() + " 板材纹理无效 >---"); + !StringUtils.equals(plate.getCoating().trim(), "无")) { + plate.setCoating(plate.getCoating() + "---< " + " 板材纹理无效 >---"); error = false; } } - if (StringUtils.isEmpty(plate.getLength())){ + if (StringUtils.isEmpty(plate.getLength())) { plate.setLength("---< 板材长度不可为空>---"); error = false; } else { Boolean flag = checkNumber(plate.getLength().trim(), Double.class); if (!flag) { - plate.setLength("---< " + plate.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + plate.setLength(plate.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkPrecision(plate.getLength().trim(), 5, 3)){ - plate.setLength("---< " + plate.getLength() + LONG_ERR + " >---"); + if (!ToolUtil.checkPrecision(plate.getLength().trim(), 5, 3)) { + plate.setLength(plate.getLength() + "---< " + LONG_ERR + " >---"); error = false; } } } - if (StringUtils.isEmpty(plate.getWidth())){ + if (StringUtils.isEmpty(plate.getWidth())) { plate.setWidth("---< 板材宽度不可为空>---"); error = false; } else { Boolean flag = checkNumber(plate.getWidth().trim(), Double.class); if (!flag) { - plate.setWidth("---< " + plate.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + plate.setWidth(plate.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkPrecision(plate.getWidth().trim(), 5, 3)){ - plate.setWidth("---< " + plate.getWidth() + LONG_ERR + " >---"); + if (!ToolUtil.checkPrecision(plate.getWidth().trim(), 5, 3)) { + plate.setWidth(plate.getWidth() + "---< " + LONG_ERR + " >---"); error = false; } } } - if (StringUtils.isEmpty(plate.getThickness())){ + if (StringUtils.isEmpty(plate.getThickness())) { plate.setThickness("---< 板材宽度不可为空>---"); error = false; } else { Boolean flag = checkNumber(plate.getThickness().trim(), Double.class); if (!flag) { - plate.setThickness("---< " + plate.getThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + plate.setThickness(plate.getThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkPrecision(plate.getThickness().trim(), 5, 3)){ - plate.setThickness("---< " + plate.getThickness() + LONG_ERR + " >---"); + if (!ToolUtil.checkPrecision(plate.getThickness().trim(), 5, 3)) { + plate.setThickness(plate.getThickness() + "---< " + LONG_ERR + " >---"); error = false; } } } - if (!StringUtils.isEmpty(plate.getOddmentLength())){ + if (!StringUtils.isEmpty(plate.getOddmentLength())) { Boolean flag = checkNumber(plate.getOddmentLength().trim(), Double.class); if (!flag) { - plate.setOddmentLength("---< " + plate.getOddmentLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + plate.setOddmentLength(plate.getOddmentLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkPrecision(plate.getOddmentLength().trim(), 5, 3)){ - plate.setOddmentLength("---< " + plate.getOddmentLength() + LONG_ERR + " >---"); + if (!ToolUtil.checkPrecision(plate.getOddmentLength().trim(), 5, 3)) { + plate.setOddmentLength(plate.getOddmentLength() + "---< " + LONG_ERR + " >---"); error = false; } } } - if (!StringUtils.isEmpty(plate.getOddmentWidth())){ + if (!StringUtils.isEmpty(plate.getOddmentWidth())) { Boolean flag = checkNumber(plate.getOddmentWidth().trim(), Double.class); if (!flag) { - plate.setOddmentWidth("---< " + plate.getOddmentWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + plate.setOddmentWidth(plate.getOddmentWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkPrecision(plate.getOddmentWidth().trim(), 5, 3)){ - plate.setOddmentWidth("---< " + plate.getOddmentWidth() + LONG_ERR + " >---"); + if (!ToolUtil.checkPrecision(plate.getOddmentWidth().trim(), 5, 3)) { + plate.setOddmentWidth(plate.getOddmentWidth() + "---< " + LONG_ERR + " >---"); error = false; } } } - if (!StringUtils.isEmpty(plate.getOddmentThickness())){ + if (!StringUtils.isEmpty(plate.getOddmentThickness())) { Boolean flag = checkNumber(plate.getOddmentThickness().trim(), Double.class); if (!flag) { - plate.setOddmentThickness("---< " + plate.getOddmentThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + plate.setOddmentThickness(plate.getOddmentThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkPrecision(plate.getOddmentThickness().trim(), 5, 3)){ - plate.setOddmentThickness("---< " + plate.getOddmentThickness() + LONG_ERR + " >---"); + if (!ToolUtil.checkPrecision(plate.getOddmentThickness().trim(), 5, 3)) { + plate.setOddmentThickness(plate.getOddmentThickness() + "---< " + LONG_ERR + " >---"); error = false; } } @@ -734,23 +779,23 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(plate.getUnitLength().trim())){ + if (StringUtils.isEmpty(plate.getUnitLength().trim())) { plate.setUnitLength("mm"); - }else { + } else { DictDataRespDTO dictData = dictDataApi.parseDictData(DictTypeConstants.UNIT_LENGTH, plate.getUnitLength().trim()).getData(); if (dictData == null) { plate.setUnitLength(plate.getUnitLength() + "---< " + "板块长度单位无效 >---"); error = false; } } - if (!StringUtils.isEmpty(plate.getArea())){ + if (!StringUtils.isEmpty(plate.getArea())) { Boolean flag = checkNumber(plate.getArea(), Double.class); if (!flag) { plate.setArea(plate.getArea() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (StringUtils.isEmpty(plate.getUnitArea())){ + if (StringUtils.isEmpty(plate.getUnitArea())) { plate.setUnitArea("m²"); } else { DictDataRespDTO dictData = dictDataApi.parseDictData(DictTypeConstants.UNIT_AREA, plate.getUnitArea().trim()).getData(); @@ -760,8 +805,8 @@ public class XMLUtil { } } if (!StringUtils.isEmpty(plate.getCount())) { - if (ToolUtil.convertToType(plate.getCount().trim(), Integer.class)){ - if (!ToolUtil.checkNumber(plate.getCount().trim())){ + if (ToolUtil.convertToType(plate.getCount().trim(), Integer.class)) { + if (!ToolUtil.checkNumber(plate.getCount().trim())) { plate.setCount(plate.getCount() + "---< " + POSITIVE_ERR + " >---"); error = false; } @@ -775,6 +820,7 @@ public class XMLUtil { } } } + // 小板数据格式验证 public void checkBlocks(BlockXmlVOS blockXmlVOS, Boolean error) { if (!StringUtils.isEmpty(blockXmlVOS.getCount())) { @@ -783,7 +829,7 @@ public class XMLUtil { blockXmlVOS.setCount(blockXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkNumber(blockXmlVOS.getCount())){ + if (!ToolUtil.checkNumber(blockXmlVOS.getCount())) { blockXmlVOS.setCount(blockXmlVOS.getCount() + "---< " + POSITIVE_ERR + " >---"); error = false; } @@ -795,7 +841,7 @@ public class XMLUtil { blockXmlVOS.setArea(blockXmlVOS.getArea() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } else { - if (!ToolUtil.checkNumber(blockXmlVOS.getArea())){ + if (!ToolUtil.checkNumber(blockXmlVOS.getArea())) { blockXmlVOS.setArea(blockXmlVOS.getArea() + "---< " + POSITIVE_ERR + " >---"); error = false; } @@ -815,11 +861,12 @@ public class XMLUtil { checkBlockList(blockXmlVOS.getBlockXmlVOList(), error); } } + // 板块数据格式验证 public void checkBlockList(List blockXmlVOList, Boolean error) { if (blockXmlVOList.size() > 0) { for (BlockXmlVO blockXmlVO : blockXmlVOList) { - if (StringUtils.isEmpty(blockXmlVO.getName())){ + if (StringUtils.isEmpty(blockXmlVO.getName())) { blockXmlVO.setName("未命名"); } if (StringUtils.isEmpty(blockXmlVO.getType())) { @@ -827,7 +874,7 @@ public class XMLUtil { } else { DictDataRespDTO dictData = dictDataApi.parseDictData(DictTypeConstants.PLATE_TYPE, blockXmlVO.getType()).getData(); if (dictData == null) { - blockXmlVO.setType(blockXmlVO.getType() +"---< " + "板块类型无效 >---"); + blockXmlVO.setType(blockXmlVO.getType() + "---< " + "板块类型无效 >---"); error = false; } } @@ -877,7 +924,7 @@ public class XMLUtil { blockXmlVO.setLength("---< 板块长度不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getLength(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getLength(), Double.class, 5, 3)) { blockXmlVO.setLength(blockXmlVO.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -886,7 +933,7 @@ public class XMLUtil { blockXmlVO.setWidth("---< 板块宽度不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getWidth(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getWidth(), Double.class, 5, 3)) { blockXmlVO.setWidth(blockXmlVO.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -895,7 +942,7 @@ public class XMLUtil { blockXmlVO.setThickness("---< 板块厚度不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getThickness(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getThickness(), Double.class, 5, 3)) { blockXmlVO.setThickness(blockXmlVO.getThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -904,7 +951,7 @@ public class XMLUtil { blockXmlVO.setCuttingLength("---< 板块开料长不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getThickness(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getThickness(), Double.class, 5, 3)) { blockXmlVO.setCuttingLength(blockXmlVO.getCuttingLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -913,7 +960,7 @@ public class XMLUtil { blockXmlVO.setCuttingWidth("---< 板块开料宽不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getCuttingWidth(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getCuttingWidth(), Double.class, 5, 3)) { blockXmlVO.setCuttingWidth(blockXmlVO.getCuttingWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -922,7 +969,7 @@ public class XMLUtil { blockXmlVO.setCuttingThickness("---< 板块开料厚不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getCuttingThickness(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getCuttingThickness(), Double.class, 5, 3)) { blockXmlVO.setCuttingThickness(blockXmlVO.getCuttingThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -931,7 +978,7 @@ public class XMLUtil { blockXmlVO.setRawLength("---< 板块胚料长不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getRawLength(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getRawLength(), Double.class, 5, 3)) { blockXmlVO.setRawLength(blockXmlVO.getRawLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -940,7 +987,7 @@ public class XMLUtil { blockXmlVO.setRawWidth("---< 板块胚料宽不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getRawWidth(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getRawWidth(), Double.class, 5, 3)) { blockXmlVO.setRawWidth(blockXmlVO.getRawWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -949,7 +996,7 @@ public class XMLUtil { blockXmlVO.setRawThickness("---< 板块胚料厚不可为空 >---"); error = false; } else { - if (!checkNumber(blockXmlVO.getRawThickness(), Double.class,5, 3)){ + if (!checkNumber(blockXmlVO.getRawThickness(), Double.class, 5, 3)) { blockXmlVO.setRawThickness(blockXmlVO.getRawThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + "或是" + LONG_ERR + " >---"); error = false; } @@ -958,28 +1005,28 @@ public class XMLUtil { blockXmlVO.setUnit("mm"); } else { DictDataRespDTO dictData = dictDataApi.parseDictData(blockXmlVO.getUnit(), DictTypeConstants.UNIT_LENGTH).getData(); - if (dictData == null){ + if (dictData == null) { blockXmlVO.setUnit(blockXmlVO.getUnit() + "---< " + " 长度单位无效 >---"); error = false; } } - if (StringUtils.isEmpty(blockXmlVO.getMultipleNumber())){ + if (StringUtils.isEmpty(blockXmlVO.getMultipleNumber())) { blockXmlVO.setMultipleNumber("1"); } else { - if (!checkNumber(blockXmlVO.getMultipleNumber().trim(), Integer.class)){ + if (!checkNumber(blockXmlVO.getMultipleNumber().trim(), Integer.class)) { blockXmlVO.setMultipleNumber(blockXmlVO.getMultipleNumber() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (StringUtils.isEmpty(blockXmlVO.getMultipleNo())){ + if (StringUtils.isEmpty(blockXmlVO.getMultipleNo())) { blockXmlVO.setMultipleNo("1"); } else { - if (!checkNumber(blockXmlVO.getMultipleNo().trim(), Integer.class)){ + if (!checkNumber(blockXmlVO.getMultipleNo().trim(), Integer.class)) { blockXmlVO.setMultipleNo(blockXmlVO.getMultipleNo() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (StringUtils.isEmpty(blockXmlVO.getUnregular())){ + if (StringUtils.isEmpty(blockXmlVO.getUnregular())) { blockXmlVO.setUnregular("否"); } else { if (!StringUtils.equals(blockXmlVO.getUnregular().trim(), "是") && !StringUtils.equals(blockXmlVO.getUnregular().trim(), "否")) { @@ -987,15 +1034,15 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(blockXmlVO.getDrilling())){ + if (StringUtils.isEmpty(blockXmlVO.getDrilling())) { blockXmlVO.setDrilling("否"); } else { if (!StringUtils.equals(blockXmlVO.getDrilling().trim(), "是") && !StringUtils.equals(blockXmlVO.getDrilling().trim(), "否")) { - blockXmlVO.setDrilling(blockXmlVO.getDrilling()+ "---< " + "板材是否钻孔数据无效 >---"); + blockXmlVO.setDrilling(blockXmlVO.getDrilling() + "---< " + "板材是否钻孔数据无效 >---"); error = false; } } - if (StringUtils.isEmpty(blockXmlVO.getSlotting())){ + if (StringUtils.isEmpty(blockXmlVO.getSlotting())) { blockXmlVO.setSlotting("否"); } else { if (!StringUtils.equals(blockXmlVO.getSlotting().trim(), "是") && !StringUtils.equals(blockXmlVO.getSlotting().trim(), "否")) { @@ -1003,76 +1050,88 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(blockXmlVO.getRoomName())){ + if (StringUtils.isEmpty(blockXmlVO.getRoomName())) { blockXmlVO.setRoomName("未命名"); } - if (StringUtils.isEmpty(blockXmlVO.getBoxName())){ + if (StringUtils.isEmpty(blockXmlVO.getBoxName())) { blockXmlVO.setBoxName("未命名"); } - if (!StringUtils.isEmpty(blockXmlVO.getBasePointX())){ + if (!StringUtils.isEmpty(blockXmlVO.getBasePointX())) { if (!ToolUtil.convertToType(blockXmlVO.getBasePointX(), Double.class)) { blockXmlVO.setBasePointX(blockXmlVO.getBasePointX() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + blockXmlVO.setBasePointX("0"); } - if (!StringUtils.isEmpty(blockXmlVO.getBasePointY())){ - if (!ToolUtil.convertToType(blockXmlVO.getBasePointX(), Double.class)) { + if (!StringUtils.isEmpty(blockXmlVO.getBasePointY())) { + if (!ToolUtil.convertToType(blockXmlVO.getBasePointY(), Double.class)) { blockXmlVO.setBasePointY(blockXmlVO.getBasePointY() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + blockXmlVO.setBasePointY("0"); } - if (!StringUtils.isEmpty(blockXmlVO.getBasePointZ())){ + if (!StringUtils.isEmpty(blockXmlVO.getBasePointZ())) { if (!ToolUtil.convertToType(blockXmlVO.getBasePointZ(), Double.class)) { blockXmlVO.setBasePointZ(blockXmlVO.getBasePointZ() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + blockXmlVO.setBasePointZ("0"); } - if (!StringUtils.isEmpty(blockXmlVO.getAxisXrotate())){ + if (!StringUtils.isEmpty(blockXmlVO.getAxisXrotate())) { if (!ToolUtil.convertToType(blockXmlVO.getAxisXrotate(), Double.class)) { blockXmlVO.setAxisXrotate(blockXmlVO.getAxisXrotate() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + blockXmlVO.setAxisXrotate("0"); } - if (!StringUtils.isEmpty(blockXmlVO.getAxisYrotate())){ + if (!StringUtils.isEmpty(blockXmlVO.getAxisYrotate())) { if (!ToolUtil.convertToType(blockXmlVO.getAxisYrotate(), Double.class)) { blockXmlVO.setAxisYrotate(blockXmlVO.getAxisYrotate() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + blockXmlVO.setAxisYrotate("0"); } - if (!StringUtils.isEmpty(blockXmlVO.getAxisZrotate())){ + if (!StringUtils.isEmpty(blockXmlVO.getAxisZrotate())) { if (!ToolUtil.convertToType(blockXmlVO.getAxisZrotate(), Double.class)) { blockXmlVO.setAxisZrotate(blockXmlVO.getAxisZrotate() + "---< " + TYPE_ERR + " >---"); error = false; } + } else { + blockXmlVO.setAxisZrotate("0"); } - if (blockXmlVO.getOutlineXmlVO() != null){ + if (blockXmlVO.getOutlineXmlVO() != null) { checkOutline(blockXmlVO.getOutlineXmlVO(), error); } - if (blockXmlVO.getCuttingOutlineXmlVO() != null){ + if (blockXmlVO.getCuttingOutlineXmlVO() != null) { checkCuttingOutline(blockXmlVO.getCuttingOutlineXmlVO(), error); } if (blockXmlVO.getRawOutlineXmlVO() != null && blockXmlVO.getRawOutlineXmlVO().getPointXmlVOList() != null - && blockXmlVO.getRawOutlineXmlVO().getPointXmlVOList().size() > 0){ + && blockXmlVO.getRawOutlineXmlVO().getPointXmlVOList().size() > 0) { checkRawOutline(blockXmlVO.getRawOutlineXmlVO(), error); } - if (blockXmlVO.getHoleXmlVOS() != null){ + if (blockXmlVO.getHoleXmlVOS() != null) { checkHoles(blockXmlVO.getHoleXmlVOS(), error); } - if (blockXmlVO.getGrooveXmlVOS() != null){ + if (blockXmlVO.getGrooveXmlVOS() != null) { checkGrooves(blockXmlVO.getGrooveXmlVOS(), error); } if (blockXmlVO.getIsletXmlVOS() != null && blockXmlVO.getIsletXmlVOS().getIsletXmlVOList() != null && - blockXmlVO.getIsletXmlVOS().getIsletXmlVOList().size() > 0){ + blockXmlVO.getIsletXmlVOS().getIsletXmlVOList().size() > 0) { checkIslets(blockXmlVO.getIsletXmlVOS(), error); } - if (blockXmlVO.getCorrelationXmlVOS() != null){ + if (blockXmlVO.getCorrelationXmlVOS() != null) { checkCorrelations(blockXmlVO.getCorrelationXmlVOS(), error); } @@ -1081,26 +1140,26 @@ public class XMLUtil { } private void checkCorrelations(CorrelationXmlVOS correlationXmlVOS, Boolean error) { - if (!StringUtils.isEmpty(correlationXmlVOS.getCount())){ + if (!StringUtils.isEmpty(correlationXmlVOS.getCount())) { if (!checkNumber(correlationXmlVOS.getCount(), Integer.class)) { - correlationXmlVOS.setCount("---< " + correlationXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + correlationXmlVOS.setCount(correlationXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (correlationXmlVOS.getCorrelationXmlVOList() != null && correlationXmlVOS.getCorrelationXmlVOList().size() > 0){ + if (correlationXmlVOS.getCorrelationXmlVOList() != null && correlationXmlVOS.getCorrelationXmlVOList().size() > 0) { for (CorrelationXmlVO correlationXmlVO : correlationXmlVOS.getCorrelationXmlVOList()) { - if (StringUtils.isEmpty(correlationXmlVO.getItemCode())){ - if (StringUtils.isEmpty(correlationXmlVO.getName())){ + if (StringUtils.isEmpty(correlationXmlVO.getItemCode())) { + if (StringUtils.isEmpty(correlationXmlVO.getName())) { correlationXmlVO.setName("---< 关联配件(五金)/组件名称不可为空 >---"); error = false; } - if (StringUtils.isEmpty(correlationXmlVO.getUnitCount())){ + if (StringUtils.isEmpty(correlationXmlVO.getUnitCount())) { correlationXmlVO.setUnitCount("---< 关联配件(五金)/组件单位不可为空 >---"); error = false; } - if (!StringUtils.isEmpty(correlationXmlVO.getCount())){ + if (!StringUtils.isEmpty(correlationXmlVO.getCount())) { if (!checkNumber(correlationXmlVO.getCount(), Integer.class)) { - correlationXmlVO.setCount("---< " + correlationXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + correlationXmlVO.setCount(correlationXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { @@ -1114,23 +1173,23 @@ public class XMLUtil { private void checkIslets(IsletXmlVOS isletXmlVOS, Boolean error) { Boolean index = true; - if (StringUtils.isEmpty(isletXmlVOS.getCount())){ + if (StringUtils.isEmpty(isletXmlVOS.getCount())) { isletXmlVOS.setCount("---< 孤岛数量不可为空 >---"); error = false; index = false; } else { Boolean flag = checkNumber(isletXmlVOS.getCount().trim(), Integer.class); if (!flag) { - isletXmlVOS.setCount("---< " + isletXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + isletXmlVOS.setCount(isletXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; index = false; } } if (index) { - if (isletXmlVOS.getIsletXmlVOList() == null){ + if (isletXmlVOS.getIsletXmlVOList() == null) { isletXmlVOS.setCount("---< 孤岛数量与孤岛列表数量不一致 >---"); error = false; - } else if (isletXmlVOS.getIsletXmlVOList().size() > 0){ + } else if (isletXmlVOS.getIsletXmlVOList().size() > 0) { if (Integer.valueOf(isletXmlVOS.getCount()) != isletXmlVOS.getIsletXmlVOList().size()) { isletXmlVOS.setCount("---< 孤岛数量与孤岛列表数量不一致 >---"); error = false; @@ -1145,7 +1204,7 @@ public class XMLUtil { } private void checkIslet(IsletXmlVO isletXmlVO, Boolean error) { - if (StringUtils.isEmpty(isletXmlVO.getId())){ + if (StringUtils.isEmpty(isletXmlVO.getId())) { isletXmlVO.setId("---< 孤岛ID不可为空 >---"); error = false; } @@ -1153,26 +1212,26 @@ public class XMLUtil { if (isletXmlVO.getPointXmlVOS() != null) { Boolean index = true; - if (StringUtils.isEmpty(isletXmlVO.getPointXmlVOS().getCount())){ - isletXmlVO.getPointXmlVOS().setCount("---< 孤岛数量不可为空 >---"); + if (StringUtils.isEmpty(isletXmlVO.getPointXmlVOS().getCount())) { + isletXmlVO.getPointXmlVOS().setCount("---< 孤岛点阵数量不可为空 >---"); error = false; index = false; } else { Boolean flag = checkNumber(isletXmlVO.getPointXmlVOS().getCount().trim(), Integer.class); if (!flag) { - isletXmlVO.getPointXmlVOS().setCount("---< " + isletXmlVO.getPointXmlVOS().getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + isletXmlVO.getPointXmlVOS().setCount(isletXmlVO.getPointXmlVOS().getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; index = false; } } if (index) { - if (isletXmlVO.getPointXmlVOS().getPointXmlVOList() == null){ - isletXmlVO.getPointXmlVOS().setCount("---< 孤岛数量与孤岛列表数量不一致 >---"); + if (isletXmlVO.getPointXmlVOS().getPointXmlVOList() == null) { + isletXmlVO.getPointXmlVOS().setCount("---< 孤岛点阵数量与孤岛点阵列表数量不一致 >---"); error = false; - } else if (isletXmlVO.getPointXmlVOS().getPointXmlVOList().size() > 0){ + } else if (isletXmlVO.getPointXmlVOS().getPointXmlVOList().size() > 0) { if (Integer.valueOf(isletXmlVO.getPointXmlVOS().getCount()) != isletXmlVO.getPointXmlVOS().getPointXmlVOList().size()) { - isletXmlVO.getPointXmlVOS().setCount("---< 孤岛数量与孤岛列表数量不一致 >---"); + isletXmlVO.getPointXmlVOS().setCount("---< 孤岛点阵数量与孤岛点阵列表数量不一致 >---"); error = false; } else { for (PointXmlVO pointXmlVO : isletXmlVO.getPointXmlVOS().getPointXmlVOList()) { @@ -1186,98 +1245,98 @@ public class XMLUtil { } private void checkHoles(HoleXmlVOS holeXmlVOS, Boolean error) { - if (!StringUtils.isEmpty(holeXmlVOS.getCount()) ){ + if (!StringUtils.isEmpty(holeXmlVOS.getCount())) { Boolean flag = checkNumber(holeXmlVOS.getCount().trim(), Double.class); if (!flag) { - holeXmlVOS.setCount("---< " + holeXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCount(holeXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceA())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceA())) { Boolean flag = checkNumber(holeXmlVOS.getCountFaceA().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountFaceA("---< " + holeXmlVOS.getCountFaceA() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountFaceA(holeXmlVOS.getCountFaceA() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceB())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceB())) { Boolean flag = checkNumber(holeXmlVOS.getCountFaceB().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountFaceB("---< " + holeXmlVOS.getCountFaceB() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountFaceB(holeXmlVOS.getCountFaceB() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountSide())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountSide())) { Boolean flag = checkNumber(holeXmlVOS.getCountSide().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountSide("---< " + holeXmlVOS.getCountSide() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountSide(holeXmlVOS.getCountSide() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountSideL())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountSideL())) { Boolean flag = checkNumber(holeXmlVOS.getCountSideL().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountSideL("---< " + holeXmlVOS.getCountSideL() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountSideL(holeXmlVOS.getCountSideL() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountSideR())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountSideR())) { Boolean flag = checkNumber(holeXmlVOS.getCountSideR().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountSideR("---< " + holeXmlVOS.getCountSideR() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountSideR(holeXmlVOS.getCountSideR() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountSideU())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountSideU())) { Boolean flag = checkNumber(holeXmlVOS.getCountSideU().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountSideU("---< " + holeXmlVOS.getCountSideU() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountSideU(holeXmlVOS.getCountSideU() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountSideD())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountSideD())) { Boolean flag = checkNumber(holeXmlVOS.getCountSideD().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountSideD("---< " + holeXmlVOS.getCountSideD() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountSideD(holeXmlVOS.getCountSideD() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountBevelled())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountBevelled())) { Boolean flag = checkNumber(holeXmlVOS.getCountBevelled().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountBevelled("---< " + holeXmlVOS.getCountBevelled() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountBevelled(holeXmlVOS.getCountBevelled() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountLocking())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountLocking())) { Boolean flag = checkNumber(holeXmlVOS.getCountLocking().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountLocking("---< " + holeXmlVOS.getCountLocking() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountLocking(holeXmlVOS.getCountLocking() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountBuildIn())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountBuildIn())) { Boolean flag = checkNumber(holeXmlVOS.getCountBuildIn().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountBuildIn("---< " + holeXmlVOS.getCountBuildIn() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountBuildIn(holeXmlVOS.getCountBuildIn() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountHinge())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountHinge())) { Boolean flag = checkNumber(holeXmlVOS.getCountHinge().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountHinge("---< " + holeXmlVOS.getCountHinge() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountHinge(holeXmlVOS.getCountHinge() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(holeXmlVOS.getCountThrough())){ + if (!StringUtils.isEmpty(holeXmlVOS.getCountThrough())) { Boolean flag = checkNumber(holeXmlVOS.getCountThrough().trim(), Integer.class); if (!flag) { - holeXmlVOS.setCountThrough("---< " + holeXmlVOS.getCountThrough() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + holeXmlVOS.setCountThrough(holeXmlVOS.getCountThrough() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (holeXmlVOS.getHoleXmlVOList() != null && holeXmlVOS.getHoleXmlVOList().size() > 0){ + if (holeXmlVOS.getHoleXmlVOList() != null && holeXmlVOS.getHoleXmlVOList().size() > 0) { for (HoleXmlVO holeXmlVO : holeXmlVOS.getHoleXmlVOList()) { checkHole(holeXmlVO, error); } @@ -1285,26 +1344,26 @@ public class XMLUtil { } private void checkHole(HoleXmlVO holeXmlVO, Boolean error) { - if (StringUtils.isEmpty(holeXmlVO.getFace())){ + if (StringUtils.isEmpty(holeXmlVO.getFace())) { holeXmlVO.setFace("---< 小板孔加工面不可为空 >---"); error = false; } else { DictDataRespDTO dictDataVO = dictDataApi.parseDictData(DictTypeConstants.HOLE_FACE, holeXmlVO.getFace()).getData(); - if (dictDataVO == null){ - holeXmlVO.setFace(holeXmlVO.getFace() + "---< " +" 小板孔加工面数据无效 >---"); + if (dictDataVO == null) { + holeXmlVO.setFace(holeXmlVO.getFace() + "---< " + " 小板孔加工面数据无效 >---"); error = false; } } - if (StringUtils.isEmpty(holeXmlVO.getDirection())){ + if (StringUtils.isEmpty(holeXmlVO.getDirection())) { holeXmlVO.setDirection("---< 小板孔加工方向不可为空 >---"); error = false; } else { DictDataRespDTO dictDataVO = dictDataApi.parseDictData(DictTypeConstants.HOLE_DIRECTION, holeXmlVO.getDirection()).getData(); - if (dictDataVO == null){ + if (dictDataVO == null) { holeXmlVO.setDirection(holeXmlVO.getDirection() + "---< " + " 小板孔加工方向数据无效 >---"); } } - if (StringUtils.isEmpty(holeXmlVO.getDiameter())){ + if (StringUtils.isEmpty(holeXmlVO.getDiameter())) { holeXmlVO.setDiameter("---< 小板孔直径不可为空 >---"); error = false; } else { @@ -1314,8 +1373,8 @@ public class XMLUtil { error = false; } } - if (StringUtils.isNotEmpty(holeXmlVO.getType()) && holeXmlVO.getType().equals("沉头孔")){ - if (StringUtils.isEmpty(holeXmlVO.getDiameterInner())){ + if (StringUtils.isNotEmpty(holeXmlVO.getType()) && holeXmlVO.getType().equals("沉头孔")) { + if (StringUtils.isEmpty(holeXmlVO.getDiameterInner())) { holeXmlVO.setDiameterInner("---< 当小板孔类型为沉头孔时,小板孔沉头孔内径不可为空 >---"); error = false; } else { @@ -1324,7 +1383,7 @@ public class XMLUtil { holeXmlVO.setDiameterInner(holeXmlVO.getDiameterInner() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); } } - if (StringUtils.isEmpty(holeXmlVO.getDepthInner())){ + if (StringUtils.isEmpty(holeXmlVO.getDepthInner())) { holeXmlVO.setDepthInner("---< 当小板孔类型为沉头孔时,沉头孔的深度不可为空 >---"); error = false; } else { @@ -1334,23 +1393,23 @@ public class XMLUtil { } } } - if (StringUtils.isEmpty(holeXmlVO.getDepth())){ + if (StringUtils.isEmpty(holeXmlVO.getDepth())) { holeXmlVO.setDepth("---< 小板孔深度不可为空 >---"); error = false; } else { Boolean flag = checkNumber(holeXmlVO.getDepth().trim(), Double.class); if (!flag) { - holeXmlVO.setDepth(holeXmlVO.getDepth() + "---< " + POSITIVE_ERR+ "或是" + TYPE_ERR + " >---"); + holeXmlVO.setDepth(holeXmlVO.getDepth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); } } - if (!StringUtils.isEmpty(holeXmlVO.getGroupNumber())){ + if (!StringUtils.isEmpty(holeXmlVO.getGroupNumber())) { Boolean flag = checkNumber(holeXmlVO.getGroupNumber().trim(), Integer.class); if (!flag) { holeXmlVO.setGroupNumber(holeXmlVO.getGroupNumber() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); - error = false; + error = false; } } - if (StringUtils.isEmpty(holeXmlVO.getGroupXoffset())){ + if (StringUtils.isEmpty(holeXmlVO.getGroupXoffset())) { holeXmlVO.setGroupXoffset("0"); } else { Boolean flag = ToolUtil.convertToType(holeXmlVO.getGroupXoffset().trim(), Double.class); @@ -1359,7 +1418,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(holeXmlVO.getGroupYoffset())){ + if (StringUtils.isEmpty(holeXmlVO.getGroupYoffset())) { holeXmlVO.setGroupYoffset("0"); } else { Boolean flag = ToolUtil.convertToType(holeXmlVO.getGroupYoffset().trim(), Double.class); @@ -1368,7 +1427,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(holeXmlVO.getGroupZoffset())){ + if (StringUtils.isEmpty(holeXmlVO.getGroupZoffset())) { holeXmlVO.setGroupZoffset("0"); } else { Boolean flag = ToolUtil.convertToType(holeXmlVO.getGroupZoffset().trim(), Double.class); @@ -1377,180 +1436,180 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(holeXmlVO.getStartX())){ + if (StringUtils.isEmpty(holeXmlVO.getStartX())) { holeXmlVO.setStartX("---< 小板孔起点坐标X不可为空 >---"); error = false; } else { - if (!ToolUtil.convertToType(holeXmlVO.getStartX().trim(), Double.class)){ + if (!ToolUtil.convertToType(holeXmlVO.getStartX().trim(), Double.class)) { holeXmlVO.setStartX(holeXmlVO.getStartX() + "---< " + " 小板孔起点坐标X数据无效 >---"); } } - if (StringUtils.isEmpty(holeXmlVO.getStartY())){ + if (StringUtils.isEmpty(holeXmlVO.getStartY())) { holeXmlVO.setStartY("---< 小板孔起点坐标Y不可为空 >---"); error = false; } else { - if (!ToolUtil.convertToType(holeXmlVO.getStartY().trim(), Double.class)){ + if (!ToolUtil.convertToType(holeXmlVO.getStartY().trim(), Double.class)) { holeXmlVO.setStartY(holeXmlVO.getStartY() + "---< " + " 小板孔起点坐标Y数据无效 >---"); } } - if (StringUtils.isEmpty(holeXmlVO.getStartZ())){ + if (StringUtils.isEmpty(holeXmlVO.getStartZ())) { holeXmlVO.setStartZ("---< 小板孔起点坐标Z不可为空 >---"); error = false; } else { - if (!ToolUtil.convertToType(holeXmlVO.getStartZ().trim(), Double.class)){ + if (!ToolUtil.convertToType(holeXmlVO.getStartZ().trim(), Double.class)) { holeXmlVO.setStartZ(holeXmlVO.getStartZ() + "---< " + " 小板孔起点坐标Z数据无效 >---"); } } - if (StringUtils.isEmpty(holeXmlVO.getEndX())){ + if (StringUtils.isEmpty(holeXmlVO.getEndX())) { holeXmlVO.setEndX("---< 小板孔终点坐标X不可为空 >---"); error = false; } else { - if (!ToolUtil.convertToType(holeXmlVO.getEndX().trim(), Double.class)){ + if (!ToolUtil.convertToType(holeXmlVO.getEndX().trim(), Double.class)) { holeXmlVO.setEndX(holeXmlVO.getEndX() + "---< " + " 小板孔终点坐标X数据无效 >---"); } } - if (StringUtils.isEmpty(holeXmlVO.getEndY())){ + if (StringUtils.isEmpty(holeXmlVO.getEndY())) { holeXmlVO.setEndY("---< 小板孔终点坐标Y不可为空 >---"); error = false; } else { - if (!ToolUtil.convertToType(holeXmlVO.getEndY().trim(), Double.class)){ + if (!ToolUtil.convertToType(holeXmlVO.getEndY().trim(), Double.class)) { holeXmlVO.setEndY(holeXmlVO.getEndY() + "---< " + " 小板孔终点坐标Y数据无效 >---"); } } - if (StringUtils.isEmpty(holeXmlVO.getEndZ())){ + if (StringUtils.isEmpty(holeXmlVO.getEndZ())) { holeXmlVO.setEndZ("---< 小板孔终点坐标Z不可为空 >---"); error = false; } else { - if (!ToolUtil.convertToType(holeXmlVO.getEndZ().trim(), Double.class)){ + if (!ToolUtil.convertToType(holeXmlVO.getEndZ().trim(), Double.class)) { holeXmlVO.setEndZ(holeXmlVO.getEndZ() + "---< " + " 小板孔终点坐标Z数据无效 >---"); } } - if (!StringUtils.isEmpty(holeXmlVO.getToolStartRotateX())){ - if (!ToolUtil.convertToType(holeXmlVO.getToolStartRotateX().trim(), Double.class)){ + if (!StringUtils.isEmpty(holeXmlVO.getToolStartRotateX())) { + if (!ToolUtil.convertToType(holeXmlVO.getToolStartRotateX().trim(), Double.class)) { holeXmlVO.setToolStartRotateX(holeXmlVO.getToolStartRotateX() + "---< " + " 小板孔起点旋转角度X数据无效 >---"); } } - if (!StringUtils.isEmpty(holeXmlVO.getToolStartRotateY())){ - if (!ToolUtil.convertToType(holeXmlVO.getToolStartRotateY().trim(), Double.class)){ + if (!StringUtils.isEmpty(holeXmlVO.getToolStartRotateY())) { + if (!ToolUtil.convertToType(holeXmlVO.getToolStartRotateY().trim(), Double.class)) { holeXmlVO.setToolStartRotateY(holeXmlVO.getToolStartRotateY() + "---< " + " 小板孔起点旋转角度Y数据无效 >---"); } } - if (!StringUtils.isEmpty(holeXmlVO.getToolStartRotateZ())){ - if (!ToolUtil.convertToType(holeXmlVO.getToolStartRotateZ().trim(), Double.class)){ + if (!StringUtils.isEmpty(holeXmlVO.getToolStartRotateZ())) { + if (!ToolUtil.convertToType(holeXmlVO.getToolStartRotateZ().trim(), Double.class)) { holeXmlVO.setToolStartRotateZ("---< " + holeXmlVO.getToolStartRotateZ() + " 小板孔起点旋转角度Z数据无效 >---"); } } - if (!StringUtils.isEmpty(holeXmlVO.getToolEndRotateX())){ - if (!ToolUtil.convertToType(holeXmlVO.getToolEndRotateX().trim(), Double.class)){ + if (!StringUtils.isEmpty(holeXmlVO.getToolEndRotateX())) { + if (!ToolUtil.convertToType(holeXmlVO.getToolEndRotateX().trim(), Double.class)) { holeXmlVO.setToolEndRotateX("---< " + holeXmlVO.getToolEndRotateX() + " 小板孔终点旋转角度X数据无效 >---"); } } - if (!StringUtils.isEmpty(holeXmlVO.getToolEndRotateY())){ - if (!ToolUtil.convertToType(holeXmlVO.getToolEndRotateY().trim(), Double.class)){ + if (!StringUtils.isEmpty(holeXmlVO.getToolEndRotateY())) { + if (!ToolUtil.convertToType(holeXmlVO.getToolEndRotateY().trim(), Double.class)) { holeXmlVO.setToolEndRotateY("---< " + holeXmlVO.getToolEndRotateY() + " 小板孔终点旋转角度Y数据无效 >---"); } } - if (!StringUtils.isEmpty(holeXmlVO.getToolEndRotateZ())){ - if (!ToolUtil.convertToType(holeXmlVO.getToolEndRotateZ().trim(), Double.class)){ + if (!StringUtils.isEmpty(holeXmlVO.getToolEndRotateZ())) { + if (!ToolUtil.convertToType(holeXmlVO.getToolEndRotateZ().trim(), Double.class)) { holeXmlVO.setToolEndRotateZ("---< " + holeXmlVO.getToolEndRotateZ() + " 小板孔终点旋转角度Z数据无效 >---"); } } } private void checkGrooves(GrooveXmlVOS grooveXmlVOS, Boolean error) { - if (!StringUtils.isEmpty(grooveXmlVOS.getCount()) ){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCount())) { Boolean flag = checkNumber(grooveXmlVOS.getCount().trim(), Double.class); if (!flag) { - grooveXmlVOS.setCount("---< " + grooveXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCount(grooveXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceA())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceA())) { Boolean flag = checkNumber(grooveXmlVOS.getCountFaceA().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountFaceA("---< " + grooveXmlVOS.getCountFaceA() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountFaceA(grooveXmlVOS.getCountFaceA() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceB())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceB())) { Boolean flag = checkNumber(grooveXmlVOS.getCountFaceB().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountFaceB("---< " + grooveXmlVOS.getCountFaceB() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountFaceB(grooveXmlVOS.getCountFaceB() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountSide())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountSide())) { Boolean flag = checkNumber(grooveXmlVOS.getCountSide().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountSide("---< " + grooveXmlVOS.getCountSide() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountSide(grooveXmlVOS.getCountSide() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideL())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideL())) { Boolean flag = checkNumber(grooveXmlVOS.getCountSideL().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountSideL("---< " + grooveXmlVOS.getCountSideL() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountSideL(grooveXmlVOS.getCountSideL() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideR())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideR())) { Boolean flag = checkNumber(grooveXmlVOS.getCountSideR().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountSideR("---< " + grooveXmlVOS.getCountSideR() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountSideR(grooveXmlVOS.getCountSideR() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideU())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideU())) { Boolean flag = checkNumber(grooveXmlVOS.getCountSideU().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountSideU("---< " + grooveXmlVOS.getCountSideU() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountSideU(grooveXmlVOS.getCountSideU() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideD())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideD())) { Boolean flag = checkNumber(grooveXmlVOS.getCountSideD().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountSideD("---< " + grooveXmlVOS.getCountSideD() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountSideD(grooveXmlVOS.getCountSideD() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountBevelled())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountBevelled())) { Boolean flag = checkNumber(grooveXmlVOS.getCountBevelled().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountBevelled("---< " + grooveXmlVOS.getCountBevelled() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountBevelled(grooveXmlVOS.getCountBevelled() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountRectangle())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountRectangle())) { Boolean flag = checkNumber(grooveXmlVOS.getCountRectangle().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountRectangle("---< " + grooveXmlVOS.getCountRectangle() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountRectangle(grooveXmlVOS.getCountRectangle() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCountThrough())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCountThrough())) { Boolean flag = checkNumber(grooveXmlVOS.getCountThrough().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCountThrough("---< " + grooveXmlVOS.getCountThrough() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCountThrough(grooveXmlVOS.getCountThrough() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCount2V())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCount2V())) { Boolean flag = checkNumber(grooveXmlVOS.getCount2V().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCount2V("---< " + grooveXmlVOS.getCount2V() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCount2V(grooveXmlVOS.getCount2V() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVOS.getCount3D())){ + if (!StringUtils.isEmpty(grooveXmlVOS.getCount3D())) { Boolean flag = checkNumber(grooveXmlVOS.getCount3D().trim(), Integer.class); if (!flag) { - grooveXmlVOS.setCount3D("---< " + grooveXmlVOS.getCount3D() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVOS.setCount3D(grooveXmlVOS.getCount3D() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (grooveXmlVOS.getGrooveXmlVOList() != null && grooveXmlVOS.getGrooveXmlVOList().size() > 0){ + if (grooveXmlVOS.getGrooveXmlVOList() != null && grooveXmlVOS.getGrooveXmlVOList().size() > 0) { for (GrooveXmlVO grooveXmlVO : grooveXmlVOS.getGrooveXmlVOList()) { checkGroove(grooveXmlVO, error); } @@ -1558,28 +1617,28 @@ public class XMLUtil { } private void checkGroove(GrooveXmlVO grooveXmlVO, Boolean error) { - if (StringUtils.isEmpty(grooveXmlVO.getId())){ + if (StringUtils.isEmpty(grooveXmlVO.getId())) { grooveXmlVO.setId("---< 凹槽信息ID不可为空 >---"); error = false; } // 父孤岛id - if (StringUtils.isEmpty(grooveXmlVO.getType())){ + if (StringUtils.isEmpty(grooveXmlVO.getType())) { grooveXmlVO.setType("---< 槽类型数据不可以为空 >---"); error = false; } - if (StringUtils.isEmpty(grooveXmlVO.getFace())){ + if (StringUtils.isEmpty(grooveXmlVO.getFace())) { grooveXmlVO.setFace("---< 槽面不可为空 >---"); error = false; } else { DictDataRespDTO dictDataDO = dictDataApi.parseDictData(DictTypeConstants.HOLE_FACE, grooveXmlVO.getFace().trim()).getData(); - if (dictDataDO == null){ + if (dictDataDO == null) { grooveXmlVO.setFace(grooveXmlVO.getFace() + "---< 槽加工面数据无效 >---"); error = false; } } if (grooveXmlVO.getType().trim().equals("矩形槽")) { - if (StringUtils.isEmpty(grooveXmlVO.getWidth())){ + if (StringUtils.isEmpty(grooveXmlVO.getWidth())) { grooveXmlVO.setWidth("---< 当槽为矩形时,槽宽度不可为空 >---"); error = false; } @@ -1587,98 +1646,98 @@ public class XMLUtil { if (!StringUtils.isEmpty(grooveXmlVO.getWidth())) { Boolean flag = checkNumber(grooveXmlVO.getWidth().trim(), Double.class); if (!flag) { - grooveXmlVO.setWidth("---< " + grooveXmlVO.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setWidth(grooveXmlVO.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } if (!StringUtils.isEmpty(grooveXmlVO.getLength())) { Boolean flag = checkNumber(grooveXmlVO.getLength().trim(), Double.class); if (!flag) { - grooveXmlVO.setLength("---< " + grooveXmlVO.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setLength(grooveXmlVO.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (StringUtils.isEmpty(grooveXmlVO.getDepth())){ + if (StringUtils.isEmpty(grooveXmlVO.getDepth())) { grooveXmlVO.setDepth("---< 槽深度不可为空 >---"); error = false; } else { Boolean flag = checkNumber(grooveXmlVO.getDepth().trim(), Double.class); if (!flag) { - grooveXmlVO.setDepth("---< " + grooveXmlVO.getDepth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setDepth(grooveXmlVO.getDepth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVO.getWidthExtend())){ + if (!StringUtils.isEmpty(grooveXmlVO.getWidthExtend())) { Boolean flag = checkNumber(grooveXmlVO.getWidthExtend().trim(), Double.class); if (!flag) { - grooveXmlVO.setWidthExtend("---< " + grooveXmlVO.getWidthExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setWidthExtend(grooveXmlVO.getWidthExtend() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } - }else { + } else { grooveXmlVO.setWidthExtend("0"); } - if (!StringUtils.isEmpty(grooveXmlVO.getLengthExtend())){ + if (!StringUtils.isEmpty(grooveXmlVO.getLengthExtend())) { Boolean flag = checkNumber(grooveXmlVO.getLengthExtend().trim(), Double.class); if (!flag) { - grooveXmlVO.setLengthExtend("---< " + grooveXmlVO.getLengthExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setLengthExtend(grooveXmlVO.getLengthExtend() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { grooveXmlVO.setLengthExtend("0"); } - if (!StringUtils.isEmpty(grooveXmlVO.getDepthExtend())){ + if (!StringUtils.isEmpty(grooveXmlVO.getDepthExtend())) { Boolean flag = checkNumber(grooveXmlVO.getDepthExtend().trim(), Double.class); if (!flag) { - grooveXmlVO.setDepthExtend("---< " + grooveXmlVO.getDepthExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setDepthExtend(grooveXmlVO.getDepthExtend() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { grooveXmlVO.setDepthExtend("0"); } - if (!StringUtils.isEmpty(grooveXmlVO.getRound())){ + if (!StringUtils.isEmpty(grooveXmlVO.getRound())) { Boolean flag = checkNumber(grooveXmlVO.getRound().trim(), Double.class); if (!flag) { - grooveXmlVO.setRound("---< " + grooveXmlVO.getRound() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setRound(grooveXmlVO.getRound() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { grooveXmlVO.setRound("0"); } - if (grooveXmlVO.getType().trim().equals("路径槽") || grooveXmlVO.getType().trim().equals("折返路径槽")){ - if (StringUtils.isEmpty(grooveXmlVO.getToolDiameter())){ + if (grooveXmlVO.getType().trim().equals("路径槽") || grooveXmlVO.getType().trim().equals("折返路径槽")) { + if (StringUtils.isEmpty(grooveXmlVO.getToolDiameter())) { grooveXmlVO.setToolDiameter("---< 当槽为路径槽或是折返路径槽时,刀直径不可为空 >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVO.getToolDiameter())){ + if (!StringUtils.isEmpty(grooveXmlVO.getToolDiameter())) { Boolean flag = checkNumber(grooveXmlVO.getToolDiameter().trim(), Double.class); if (!flag) { - grooveXmlVO.setToolDiameter("---< " + grooveXmlVO.getToolDiameter() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setToolDiameter(grooveXmlVO.getToolDiameter() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (!StringUtils.isEmpty(grooveXmlVO.getRedundance())){ + if (!StringUtils.isEmpty(grooveXmlVO.getRedundance())) { Boolean flag = checkNumber(grooveXmlVO.getRedundance().trim(), Double.class); if (!flag) { - grooveXmlVO.setRedundance("---< " + grooveXmlVO.getRedundance() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setRedundance(grooveXmlVO.getRedundance() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { grooveXmlVO.setRedundance("0"); } - if (!StringUtils.isEmpty(grooveXmlVO.getTangentAngle())){ + if (!StringUtils.isEmpty(grooveXmlVO.getTangentAngle())) { Boolean flag = checkNumber(grooveXmlVO.getTangentAngle().trim(), Double.class); if (!flag) { - grooveXmlVO.setTangentAngle("---< " + grooveXmlVO.getTangentAngle() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setTangentAngle(grooveXmlVO.getTangentAngle() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { grooveXmlVO.setTangentAngle("0"); } - if (!StringUtils.isEmpty(grooveXmlVO.getIsletCount())){ + if (!StringUtils.isEmpty(grooveXmlVO.getIsletCount())) { Boolean flag = checkNumber(grooveXmlVO.getIsletCount().trim(), Integer.class); if (!flag) { - grooveXmlVO.setIsletCount("---< " + grooveXmlVO.getIsletCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + grooveXmlVO.setIsletCount(grooveXmlVO.getIsletCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } else { @@ -1693,7 +1752,7 @@ public class XMLUtil { } } - if (grooveXmlVO.getOffsetLineXmlVOS() != null && grooveXmlVO.getOffsetLineXmlVOS().getOffsetLineXmlVOList() != null && grooveXmlVO.getOffsetLineXmlVOS().getOffsetLineXmlVOList().size() > 0){ + if (grooveXmlVO.getOffsetLineXmlVOS() != null && grooveXmlVO.getOffsetLineXmlVOS().getOffsetLineXmlVOList() != null && grooveXmlVO.getOffsetLineXmlVOS().getOffsetLineXmlVOList().size() > 0) { for (OffsetLineXmlVO offsetLineXmlVO : grooveXmlVO.getOffsetLineXmlVOS().getOffsetLineXmlVOList()) { checkOffsetLine(offsetLineXmlVO, error); } @@ -1701,23 +1760,23 @@ public class XMLUtil { } private void checkOffsetLine(OffsetLineXmlVO offsetLineXmlVO, Boolean error) { - if (StringUtils.isEmpty(offsetLineXmlVO.getOffset())){ + if (StringUtils.isEmpty(offsetLineXmlVO.getOffset())) { offsetLineXmlVO.setOffset("---< 偏移刀路偏移量不可为空 >---"); error = false; } else { Boolean flag = ToolUtil.convertToType(offsetLineXmlVO.getOffset().trim(), Double.class); if (!flag) { - offsetLineXmlVO.setOffset("---< " + offsetLineXmlVO.getOffset() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + offsetLineXmlVO.setOffset(offsetLineXmlVO.getOffset() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); error = false; } } - if (StringUtils.isEmpty(offsetLineXmlVO.getDepth())){ + if (StringUtils.isEmpty(offsetLineXmlVO.getDepth())) { offsetLineXmlVO.setDepth("---< 偏移刀路深度不可为空 >---"); error = false; } else { Boolean flag = ToolUtil.convertToType(offsetLineXmlVO.getDepth().trim(), Double.class); if (!flag) { - offsetLineXmlVO.setDepth("---< " + offsetLineXmlVO.getDepth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + offsetLineXmlVO.setDepth(offsetLineXmlVO.getDepth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); } } if (StringUtils.isEmpty(offsetLineXmlVO.getToolDiameter())) { @@ -1730,7 +1789,7 @@ public class XMLUtil { error = false; } } - if (!StringUtils.isEmpty(offsetLineXmlVO.getTangentAngle())){ + if (!StringUtils.isEmpty(offsetLineXmlVO.getTangentAngle())) { Boolean flag = checkNumber(offsetLineXmlVO.getTangentAngle().trim(), Double.class); if (!flag) { offsetLineXmlVO.setTangentAngle("---< " + offsetLineXmlVO.getTangentAngle() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); @@ -1743,7 +1802,7 @@ public class XMLUtil { private void checkRawOutline(RawOutlineXmlVO rawOutlineXmlVO, Boolean error) { Boolean index = true; - if (StringUtils.isEmpty(rawOutlineXmlVO.getCount())){ + if (StringUtils.isEmpty(rawOutlineXmlVO.getCount())) { rawOutlineXmlVO.setCount("---< 小板坯料(精加工)轮廓点阵列表数量不可为空 >---"); error = false; index = false; @@ -1755,7 +1814,7 @@ public class XMLUtil { index = false; } } - if (StringUtils.isEmpty(rawOutlineXmlVO.getReferenceOffsetX())){ + if (StringUtils.isEmpty(rawOutlineXmlVO.getReferenceOffsetX())) { rawOutlineXmlVO.setReferenceOffsetX("---< 小板开坯料(精加工)轮廓参考点X坐标不可为空 >---"); error = false; } else { @@ -1764,7 +1823,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(rawOutlineXmlVO.getReferenceOffsetY())){ + if (StringUtils.isEmpty(rawOutlineXmlVO.getReferenceOffsetY())) { rawOutlineXmlVO.setReferenceOffsetY("---< 小板坯料(精加工)轮廓参考点Y坐标不可为空 >---"); error = false; } else { @@ -1774,15 +1833,15 @@ public class XMLUtil { } } - if (rawOutlineXmlVO.getPointXmlVOList() != null && rawOutlineXmlVO.getPointXmlVOList().size() > 0){ + if (rawOutlineXmlVO.getPointXmlVOList() != null && rawOutlineXmlVO.getPointXmlVOList().size() > 0) { if (index) { - if (Integer.parseInt(rawOutlineXmlVO.getCount()) != rawOutlineXmlVO.getPointXmlVOList().size()){ + if (Integer.parseInt(rawOutlineXmlVO.getCount()) != rawOutlineXmlVO.getPointXmlVOList().size()) { rawOutlineXmlVO.setCount("---< 小板坯料(精加工)点阵数量与实际数量不一致 >---"); error = false; - } - } else { - for (PointXmlVO pointXmlVO : rawOutlineXmlVO.getPointXmlVOList()) { - checkPoint(pointXmlVO, error); + } else { + for (PointXmlVO pointXmlVO : rawOutlineXmlVO.getPointXmlVOList()) { + checkPoint(pointXmlVO, error); + } } } } @@ -1790,7 +1849,7 @@ public class XMLUtil { private void checkCuttingOutline(CuttingOutlineXmlVO cuttingOutlineXmlVO, Boolean error) { Boolean index = true; - if (StringUtils.isEmpty(cuttingOutlineXmlVO.getCount())){ + if (StringUtils.isEmpty(cuttingOutlineXmlVO.getCount())) { cuttingOutlineXmlVO.setCount("---< 小板开料轮廓点阵列表数量不可为空 >---"); error = false; index = false; @@ -1802,7 +1861,7 @@ public class XMLUtil { index = false; } } - if (StringUtils.isEmpty(cuttingOutlineXmlVO.getReferenceOffsetX())){ + if (StringUtils.isEmpty(cuttingOutlineXmlVO.getReferenceOffsetX())) { cuttingOutlineXmlVO.setReferenceOffsetX("---< 小板开料轮廓参考点X坐标不可为空 >---"); error = false; } else { @@ -1811,7 +1870,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(cuttingOutlineXmlVO.getReferenceOffsetY())){ + if (StringUtils.isEmpty(cuttingOutlineXmlVO.getReferenceOffsetY())) { cuttingOutlineXmlVO.setReferenceOffsetY("---< 小板开料轮廓参考点Y坐标不可为空 >---"); error = false; } else { @@ -1821,15 +1880,15 @@ public class XMLUtil { } } - if (cuttingOutlineXmlVO.getPointXmlVOList() != null && cuttingOutlineXmlVO.getPointXmlVOList().size() > 0){ + if (cuttingOutlineXmlVO.getPointXmlVOList() != null && cuttingOutlineXmlVO.getPointXmlVOList().size() > 0) { if (index) { - if (Integer.parseInt(cuttingOutlineXmlVO.getCount()) != cuttingOutlineXmlVO.getPointXmlVOList().size()){ + if (Integer.parseInt(cuttingOutlineXmlVO.getCount()) != cuttingOutlineXmlVO.getPointXmlVOList().size()) { cuttingOutlineXmlVO.setCount("---< 小板轮廓点阵数量与实际数量不一致 >---"); error = false; - } - } else { - for (PointXmlVO pointXmlVO : cuttingOutlineXmlVO.getPointXmlVOList()) { - checkPoint(pointXmlVO, error); + } else { + for (PointXmlVO pointXmlVO : cuttingOutlineXmlVO.getPointXmlVOList()) { + checkPoint(pointXmlVO, error); + } } } } @@ -1837,7 +1896,7 @@ public class XMLUtil { public void checkOutline(OutlineXmlVO outlineXmlVO, Boolean error) { Boolean index = true; - if (StringUtils.isEmpty(outlineXmlVO.getCount())){ + if (StringUtils.isEmpty(outlineXmlVO.getCount())) { outlineXmlVO.setCount("---< 小板成品轮廓点阵列表数量不可为空 >---"); error = false; index = false; @@ -1849,39 +1908,47 @@ public class XMLUtil { index = false; } } - if (outlineXmlVO.getPointXmlVOList() != null && outlineXmlVO.getPointXmlVOList().size() > 0){ - if (index){ - if (Integer.parseInt(outlineXmlVO.getCount()) != outlineXmlVO.getPointXmlVOList().size()){ + if (outlineXmlVO.getPointXmlVOList() != null && outlineXmlVO.getPointXmlVOList().size() > 0) { + if (index) { + if (Integer.parseInt(outlineXmlVO.getCount()) != outlineXmlVO.getPointXmlVOList().size()) { outlineXmlVO.setCount("---< 小板轮廓点阵数量与实际数量不一致 >---"); error = false; } - } else { + + for (PointXmlVO pointXmlVO : outlineXmlVO.getPointXmlVOList()) { checkPoint(pointXmlVO, error); - if (StringUtils.isEmpty(pointXmlVO.getItemCode())){ - if (StringUtils.isEmpty(pointXmlVO.getEdgingName()) || StringUtils.isEmpty(pointXmlVO.getEdgingColor()) || - StringUtils.isEmpty(pointXmlVO.getEdgingMaterial())){ - pointXmlVO.setItemCode("---< 当封边条没有物料编码时,封边条名称、颜色、材质不可为空 >---"); - error = false; + if (!(StringUtils.isEmpty(pointXmlVO.getItemCode()) && StringUtils.isEmpty(pointXmlVO.getEdgingName()) && + StringUtils.isEmpty(pointXmlVO.getEdgingColor()) && StringUtils.isEmpty(pointXmlVO.getEdgingMaterial()) && + (StringUtils.isEmpty(pointXmlVO.getEdgingThickness()) || pointXmlVO.getEdgingThickness().trim().equals("0")))) { + if (StringUtils.isEmpty(pointXmlVO.getEdgingName())) { + pointXmlVO.setEdgingName("封边条"); + } + if (StringUtils.isEmpty(pointXmlVO.getItemCode())) { + if (StringUtils.isEmpty(pointXmlVO.getEdgingColor()) || StringUtils.isEmpty(pointXmlVO.getEdgingMaterial())) { + pointXmlVO.setItemCode("---< 当封边条没有物料编码时,封边条颜色、材质不可为空 >---"); + error = false; + } + } + if (StringUtils.isEmpty(pointXmlVO.getEdgingThickness())) { + pointXmlVO.setEdgingThickness("0"); + } else { + if (!checkNumber(pointXmlVO.getEdgingThickness().trim(), Double.class)) { + pointXmlVO.setEdgingThickness("---< " + pointXmlVO.getEdgingThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + error = false; + } + } + if (StringUtils.isEmpty(pointXmlVO.getEdgingExtend())) { + pointXmlVO.setEdgingExtend("0"); + } else { + if (!checkNumber(pointXmlVO.getEdgingExtend().trim(), Double.class)) { + pointXmlVO.setEdgingExtend("---< " + pointXmlVO.getEdgingExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); + error = false; + } } } - if (StringUtils.isEmpty(pointXmlVO.getEdgingThickness())){ - pointXmlVO.setEdgingThickness("0"); - } else { - if (!checkNumber(pointXmlVO.getEdgingThickness().trim(), Double.class)) { - pointXmlVO.setEdgingThickness("---< " + pointXmlVO.getEdgingThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); - error = false; - } - } - if (StringUtils.isEmpty(pointXmlVO.getEdgingExtend())){ - pointXmlVO.setEdgingExtend("0"); - } else { - if (!checkNumber(pointXmlVO.getEdgingExtend().trim(), Double.class)) { - pointXmlVO.setEdgingExtend("---< " + pointXmlVO.getEdgingExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); - error = false; - } - } - if (StringUtils.isEmpty(pointXmlVO.getPreMilling())){ + + if (StringUtils.isEmpty(pointXmlVO.getPreMilling())) { pointXmlVO.setPreMilling("0"); } else { if (!checkNumber(pointXmlVO.getPreMilling().trim(), Double.class)) { @@ -1889,7 +1956,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(pointXmlVO.getScale())){ + if (StringUtils.isEmpty(pointXmlVO.getScale())) { pointXmlVO.setScale("0"); } else { if (!ToolUtil.convertToType(pointXmlVO.getScale().trim(), Double.class)) { @@ -1899,6 +1966,7 @@ public class XMLUtil { } } } + } } @@ -1906,7 +1974,7 @@ public class XMLUtil { private Boolean checkNumber(String numberStr, Class targetType) { boolean error = true; if (ToolUtil.convertToType(numberStr, targetType)) { - if (!ToolUtil.checkNumber(numberStr)){ + if (!ToolUtil.checkNumber(numberStr)) { error = false; } } else { @@ -1914,6 +1982,7 @@ public class XMLUtil { } return error; } + // 数据格式+数据正数+数据长度判断 private Boolean checkNumber(String numberStr, Class targetType, Integer length, Integer decimalLength) { Boolean flag = checkNumber(numberStr, targetType); @@ -1926,9 +1995,10 @@ public class XMLUtil { } return true; } + // point 验证 private void checkPoint(PointXmlVO pointXmlVO, Boolean error) { - if (StringUtils.isEmpty(pointXmlVO.getPointX())){ + if (StringUtils.isEmpty(pointXmlVO.getPointX())) { pointXmlVO.setPointX("---< 小板轮廓起点坐标X不可为空 >---"); error = false; } else { @@ -1937,7 +2007,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(pointXmlVO.getPointY())){ + if (StringUtils.isEmpty(pointXmlVO.getPointY())) { pointXmlVO.setPointY("---< 小板轮廓起点坐标Y不可为空 >---"); error = false; } else { @@ -1946,7 +2016,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(pointXmlVO.getCurvature())){ + if (StringUtils.isEmpty(pointXmlVO.getCurvature())) { pointXmlVO.setPointZ("---< 小板轮廓边圆弧凹凸度不可为空 >---"); error = false; } else { @@ -1955,7 +2025,7 @@ public class XMLUtil { error = false; } } - if (StringUtils.isEmpty(pointXmlVO.getRadius())){ + if (StringUtils.isEmpty(pointXmlVO.getRadius())) { pointXmlVO.setRadius("---< 小板轮廓边圆弧半径不可为空 >---"); error = false; } else { diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java index c94e50164..05fc77466 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/files/xml/XmlTypeRealize.java @@ -53,6 +53,47 @@ public class XmlTypeRealize { @Resource private IdentifierGenerator identifierGenerator; + // 房间基点坐标转换 + public Map> bodyBasePositionChange(RoomXmlVOS roomXmlVOS) { + Map> roomInfos = new HashMap<>(); + if (roomXmlVOS != null && roomXmlVOS.getRoomXmlVOList() != null && roomXmlVOS.getRoomXmlVOList().size() > 0) { + Map basePositions = new HashMap<>(); + for (RoomXmlVO roomXmlVO : roomXmlVOS.getRoomXmlVOList()) { + for (BoxXmlVO boxXmlVO : roomXmlVO.getBoxXmlVOList()) { + BasePosition basePosition = BasePosition.builder() + .basePointX(Double.valueOf(boxXmlVO.getBasePointX())) + .basePointY(Double.valueOf(boxXmlVO.getBasePointY())) + .basePointZ(Double.valueOf(boxXmlVO.getBasePointZ())) + .axisXrotate(Double.valueOf(boxXmlVO.getAxisXrotate())) + .axisYrotate(Double.valueOf(boxXmlVO.getAxisYrotate())) + .axisZrotate(Double.valueOf(boxXmlVO.getAxisZrotate())) + .build(); + basePositions.put(boxXmlVO.getCode(), basePosition); + } + roomInfos.put(roomXmlVO.getCode(), basePositions); + } + } + return roomInfos; + } + + // 柜体基点坐标转换 + public Map roomBasePositionChange(RoomXmlVOS roomXmlVOS) { + Map basePositions = new HashMap<>(); + if (roomXmlVOS != null && roomXmlVOS.getRoomXmlVOList() != null && roomXmlVOS.getRoomXmlVOList().size() > 0) { + for (RoomXmlVO roomXmlVO : roomXmlVOS.getRoomXmlVOList()) { + basePositions.put(roomXmlVO.getCode(), BasePosition.builder() + .basePointX(Double.valueOf(roomXmlVO.getBasePointX())) + .basePointY(Double.valueOf(roomXmlVO.getBasePointY())) + .basePointZ(Double.valueOf(roomXmlVO.getBasePointZ())) + .axisXrotate(Double.valueOf(roomXmlVO.getAxisXrotate())) + .axisYrotate(Double.valueOf(roomXmlVO.getAxisYrotate())) + .axisZrotate(Double.valueOf(roomXmlVO.getAxisZrotate())) + .build()); + } + } + return basePositions; + } + // 房间柜体信息转换 public Map> bodyInfoChange(RoomXmlVOS roomXmlVOS, Long orderId, Long organId) { @@ -84,29 +125,6 @@ public class XmlTypeRealize { return roomInfos; } - // 柜体基点坐标转换 - public Map> basePositionChange(RoomXmlVOS roomXmlVOS) { - Map> roomInfos = new HashMap<>(); - if (roomXmlVOS != null && roomXmlVOS.getRoomXmlVOList() != null && roomXmlVOS.getRoomXmlVOList().size() > 0) { - Map basePositions = new HashMap<>(); - for (RoomXmlVO roomXmlVO : roomXmlVOS.getRoomXmlVOList()) { - for (BoxXmlVO boxXmlVO : roomXmlVO.getBoxXmlVOList()) { - BasePosition basePosition = BasePosition.builder() - .basePointX(Double.valueOf(boxXmlVO.getBasePointX())) - .basePointY(Double.valueOf(boxXmlVO.getBasePointY())) - .basePointZ(Double.valueOf(boxXmlVO.getBasePointZ())) - .axisXrotate(Double.valueOf(boxXmlVO.getAxisXrotate())) - .axisYrotate(Double.valueOf(boxXmlVO.getAxisYrotate())) - .axisZrotate(Double.valueOf(boxXmlVO.getAxisZrotate())) - .build(); - basePositions.put(boxXmlVO.getCode(), basePosition); - } - roomInfos.put(roomXmlVO.getCode(), basePositions); - } - } - return roomInfos; - } - // 加工组信息转换 public Map groupInfoChange(GroupXmlVOS groupXmlVOS, Long orderId, Long organId) { Map groupInfos = new HashMap<>(); @@ -143,8 +161,10 @@ public class XmlTypeRealize { // 房间柜体 Map> roomInfos = bodyInfoChange(orderXmlVO.getRoomXmlVOS(), orderId, organId); // roomInfos 这个在跟着一起变 - // 房间柜体基点 - Map> boxBasePositions = basePositionChange(orderXmlVO.getRoomXmlVOS()); + // 房间基点 + Map roomBasePositions = roomBasePositionChange(orderXmlVO.getRoomXmlVOS()); + // 柜体基点 + Map> boxBasePositions = bodyBasePositionChange(orderXmlVO.getRoomXmlVOS()); // 加工组 Map groupInfos = groupInfoChange(orderXmlVO.getGroupXmlVOS(), orderId, organId); // groupInfos 这个在跟着一起变 @@ -154,7 +174,7 @@ public class XmlTypeRealize { Map partsDOInfos = new HashMap<>(); - if (orderXmlVO.getMaterialXmlVO() != null ){ + if (orderXmlVO.getMaterialXmlVO() != null) { MaterialXmlVO materialXmlVO = orderXmlVO.getMaterialXmlVO(); if (materialXmlVO.getAccessoryXmlVO() != null && materialXmlVO.getAssemblieXmlVOS() != null && materialXmlVO.getPlateXmlVOS() != null) { PlateXmlVOS plateXmlVOS = materialXmlVO.getPlateXmlVOS(); @@ -214,7 +234,7 @@ public class XmlTypeRealize { goodsDOs.add(goodsDO); // 小板信息 - plateDetail = plateInfoChange(plateXmlVO.getBlockXmlVOS(), orderId, goodsDO.getId(), organId, roomInfos, groupInfos, partsInfos, itemInfos, plateDOs, boxBasePositions); + plateDetail = plateInfoChange(plateXmlVO.getBlockXmlVOS(), orderId, goodsDO.getId(), organId, roomInfos, groupInfos, partsInfos, itemInfos, plateDOs, boxBasePositions, roomBasePositions); } } @@ -246,17 +266,17 @@ public class XmlTypeRealize { } // id得到 - private Map getId(String roomNo, String BoxNo, Map> roomInfos, - String groupNo, Map groupInfos, Double plateNum, - Double unregularNum, Long orderId, Long organId) { - Map map = new HashMap<>(); + private Map getId(String roomNo, String BoxNo, Map> roomInfos, + String groupNo, Map groupInfos, Double plateNum, + Double unregularNum, Long orderId, Long organId) { + Map map = new HashMap<>(); Map bodyMap = roomInfos.get(roomNo); OrderBodyDO bodyDO; - if (bodyMap == null){ + if (bodyMap == null) { bodyMap = new HashMap<>(); roomInfos.put(roomNo, bodyMap); } - if ( bodyMap.containsKey(BoxNo)) { + if (bodyMap.containsKey(BoxNo)) { bodyDO = bodyMap.get(BoxNo); bodyDO.setPlateNum((int) (bodyDO.getPlateNum() + plateNum + unregularNum)) .setUnregularNum((int) (bodyDO.getUnregularNum() + unregularNum)); @@ -281,7 +301,7 @@ public class XmlTypeRealize { Long roomId = bodyDO.getRoomId(); Long bodyId = bodyDO.getId(); // 加工组 - OrderGroupDO orderGroupDO = groupInfos.get(groupNo); + OrderGroupDO orderGroupDO = groupInfos.get(groupNo); Long groupId = 0L; if (orderGroupDO != null) { groupId = orderGroupDO.getId(); @@ -293,6 +313,7 @@ public class XmlTypeRealize { map.put("groupId", groupId); return map; } + // 配件信息转换 public Map> goodsInfoChange(AccessoryXmlVO accessoryXmlVO, AssemblieXmlVOS assemblieXmlVOS, Long orderId, Long organId, Map> roomInfos, Map groupInfos) { @@ -305,9 +326,24 @@ public class XmlTypeRealize { if (accessoryXmlVO != null) { if (accessoryXmlVO.getEdgingXmlVOS() != null && accessoryXmlVO.getEdgingXmlVOS().getEdgingXmlVOList() != null && accessoryXmlVO.getEdgingXmlVOS().getEdgingXmlVOList().size() > 0) { EdgingXmlVOS edgingXmlVOS = accessoryXmlVO.getEdgingXmlVOS(); + // 以itemCode为条件进行分组,成map + Map> edgingMap = edgingXmlVOS.getEdgingXmlVOList().stream().collect(Collectors.groupingBy(EdgingXmlVO::getItemCode)); + // 遍历map + edgingMap.forEach((key, value) -> { + if (key == null) { // 没有itemCode + Map> edgingMapWithNull = value.stream().collect(Collectors.groupingBy(edgingXmlVO -> + edgingXmlVO.getManufacturer() + edgingXmlVO.getBrand() + edgingXmlVO.getName() + edgingXmlVO.getMaterial() + + edgingXmlVO.getSpecs() + edgingXmlVO.getColor() + edgingXmlVO.getWidth() + edgingXmlVO.getThickness())) ; + + edgingMapWithNull.forEach((term, list) -> { + + }); + + } + }); for (EdgingXmlVO edgingXmlVO : edgingXmlVOS.getEdgingXmlVOList()) { - Map idMap = getId(edgingXmlVO.getRoomCode(), edgingXmlVO.getBoxCode(), roomInfos, edgingXmlVO.getGroupCode(), groupInfos, 0.0, 0.0, orderId, organId); + Map idMap = getId(edgingXmlVO.getRoomCode(), edgingXmlVO.getBoxCode(), roomInfos, edgingXmlVO.getGroupCode(), groupInfos, 0.0, 0.0, orderId, organId); Long partsId = (Long) identifierGenerator.nextId(null); orderPartsMap.put(edgingXmlVO.getItemCode(), OrderPartsAddVO.builder() @@ -368,7 +404,7 @@ public class XmlTypeRealize { HardwareXmlVOS hardwareXmlVOS = accessoryXmlVO.getHardwareXmlVOS(); for (HardwareXmlVO hardwareXmlVO : hardwareXmlVOS.getHardwareXmlVOList()) { - Map idMap = getId(hardwareXmlVO.getRoomCode(), hardwareXmlVO.getBoxCode(), roomInfos, hardwareXmlVO.getGroupCode(), groupInfos, 0.0, 0.0,orderId, organId); + Map idMap = getId(hardwareXmlVO.getRoomCode(), hardwareXmlVO.getBoxCode(), roomInfos, hardwareXmlVO.getGroupCode(), groupInfos, 0.0, 0.0, orderId, organId); Long partsId = (Long) identifierGenerator.nextId(null); orderPartsMap.put(hardwareXmlVO.getItemCode(), OrderPartsAddVO.builder() @@ -432,7 +468,7 @@ public class XmlTypeRealize { for (AssemblyXmlVO assemblyXmlVO : assemblieXmlVOS.getAssemblyXmlVOList()) { if (assemblyXmlVO != null && assemblyXmlVO.toString().length() > 0) { - Map idMap = getId(assemblyXmlVO.getRoomCode(), assemblyXmlVO.getBoxCode(), roomInfos, assemblyXmlVO.getGroupCode(), groupInfos, 0.0, 0.0, orderId, organId); + Map idMap = getId(assemblyXmlVO.getRoomCode(), assemblyXmlVO.getBoxCode(), roomInfos, assemblyXmlVO.getGroupCode(), groupInfos, 0.0, 0.0, orderId, organId); Long partsId = (Long) identifierGenerator.nextId(null); orderPartsMap.put(assemblyXmlVO.getItemCode(), OrderPartsAddVO.builder() @@ -499,9 +535,9 @@ public class XmlTypeRealize { } public List plateInfoChange(BlockXmlVOS blockXmlVOS, Long orderId, Long goodsId, Long organId, - Map> roomInfos, Map groupInfos, + Map> roomInfos, Map groupInfos, Map partsMap, Map orderItemMap, List plateDOs, - Map> boxBasePositionMap) { + Map> boxBasePositionMap, Map roomBasePositions) { List plateDetails = new ArrayList<>(); if (blockXmlVOS != null && blockXmlVOS.getBlockXmlVOList() != null && blockXmlVOS.getBlockXmlVOList().size() > 0) { @@ -510,23 +546,35 @@ public class XmlTypeRealize { long plateNo = idWorker.nextId(); long obtainingTime = idWorker.obtainingTime(); Long plateId = (Long) identifierGenerator.nextId(null); - BigDecimal area = BigDecimal.valueOf((Double.parseDouble(blockXmlVO.getWidth()) / 1000) * (Double.parseDouble(blockXmlVO.getLength()) / 1000) ); + BigDecimal area = BigDecimal.valueOf((Double.parseDouble(blockXmlVO.getWidth()) / 1000) * (Double.parseDouble(blockXmlVO.getLength()) / 1000)); // 开料面积 - BigDecimal sealAcreage = BigDecimal.valueOf( (Double.parseDouble(blockXmlVO.getCuttingWidth()) / 1000) * ( Double.parseDouble(blockXmlVO.getCuttingLength()) / 1000)); + BigDecimal sealAcreage = BigDecimal.valueOf((Double.parseDouble(blockXmlVO.getCuttingWidth()) / 1000) * (Double.parseDouble(blockXmlVO.getCuttingLength()) / 1000)); // 开门类型获取 - Integer doorType = Integer.valueOf(dictDataApi.parseDictData(DictTypeConstants.DOOR_OPENING_DIRECTIONS, blockXmlVO.getOpenDirection()).getData().getValue()); + int doorType = Integer.parseInt(dictDataApi.parseDictData(DictTypeConstants.DOOR_OPENING_DIRECTIONS, blockXmlVO.getOpenDirection()).getData().getValue()); // 板材获取 - Double plateNum = 0.0; - Double unregularNum = 0.0; - if (convertToBoolean(blockXmlVO.getUnregular())){ + double plateNum = 0.0; + double unregularNum = 0.0; + if (convertToBoolean(blockXmlVO.getUnregular())) { unregularNum = 1.0; - }else { + } else { plateNum = 1.0; } - Map idMap = getId(blockXmlVO.getRoomCode(), blockXmlVO.getBoxCode(), roomInfos, blockXmlVO.getGroupCode(), groupInfos, plateNum, unregularNum, orderId, organId); - BasePosition boxBasePoint = boxBasePositionMap.get(blockXmlVO.getRoomCode()).get(blockXmlVO.getBoxCode()).setBasePoint(String.valueOf(idMap.get("bodyId"))); + Map idMap = getId(blockXmlVO.getRoomCode(), blockXmlVO.getBoxCode(), roomInfos, blockXmlVO.getGroupCode(), groupInfos, plateNum, unregularNum, orderId, organId); +// 出错 null + // 柜体基点坐标 + BasePosition boxBasePoint = null; + if (boxBasePositionMap.get(blockXmlVO.getRoomCode()) != null){ + if (boxBasePositionMap.get(blockXmlVO.getRoomCode()).get(blockXmlVO.getBoxCode()) != null){ + boxBasePoint = boxBasePositionMap.get(blockXmlVO.getRoomCode()).get(blockXmlVO.getBoxCode()).setBasePoint(String.valueOf(idMap.get("bodyId"))); + } + } + // 房间基点坐标 + BasePosition roomBasePoint = null; + if (roomBasePositions.get(blockXmlVO.getRoomCode()) != null){ + roomBasePoint = roomBasePositions.get(blockXmlVO.getRoomCode()); + } PlateDO plateDO = PlateDO.builder() .id(plateId) .organId(organId) @@ -585,6 +633,7 @@ public class XmlTypeRealize { .plateWidth(plateDO.getWidth()) .plateLength(plateDO.getHeight()) .acreage(plateDO.getArea()) + .roomBasePosition(roomBasePoint) .bodyBasePosition(boxBasePoint) .plateBasePosition(plateBasePosition) .splitLength(BigDecimal.valueOf(Long.parseLong(blockXmlVO.getCuttingLength()))) @@ -662,7 +711,7 @@ public class XmlTypeRealize { Double x = Double.parseDouble(pointXmlVO.getPointX()); Double y = Double.parseDouble(pointXmlVO.getPointY()); OrderPartsAddVO edging = (OrderPartsAddVO) edgIng.get(pointXmlVO.getItemCode()); - if (edging != null){ + if (edging != null) { size = edging.getThickness(); } diff --git a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/dal/mysql/plate/PlateMapper.java b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/dal/mysql/plate/PlateMapper.java index 421991b50..5c884d135 100644 --- a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/dal/mysql/plate/PlateMapper.java +++ b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/dal/mysql/plate/PlateMapper.java @@ -73,9 +73,6 @@ public interface PlateMapper extends BaseMapperX { PlateDO selectOneById(@Param("id") Long id, @Param("organId") Long organId); default Boolean isByGoodID(String goodId , Long organId) { - if (selectOne(PlateDO::getGoodsId, goodId, PlateDO::getOrganId, organId) != null) { - return true; - } - return false; + return selectList(PlateDO::getGoodsId, goodId, PlateDO::getOrganId, organId).size() > 0; } } diff --git a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java index d43935e5b..9dccccb53 100644 --- a/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java +++ b/cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/service/plate/PlateServiceImpl.java @@ -75,7 +75,7 @@ public class PlateServiceImpl implements PlateService { getOrganId(BASE_PLATE_UPDATE_PERMISSION, getLoginUser().getId(), updateReqVO.getOrganId())); PlateDO updateObj = BeanUtils.toBean(updateReqVO, PlateDO.class); // 校验板材goods_id是否相同 - if (!plateMapper.isByGoodID(updateReqVO.getGoodsId(), getLoginUser().getId())) { + if (plateMapper.isByGoodID(updateReqVO.getGoodsId(), getLoginUser().getId())) { throw exception(PLATE_GOODS_ID_NOT_SAME); } plateMapper.updateById(updateObj); diff --git a/cf-module-system/cf-module-system-biz/src/test/java/com/cf/imes/module/system/service/machine/MachineServiceImplTest.java b/cf-module-system/cf-module-system-biz/src/test/java/com/cf/imes/module/system/service/machine/MachineServiceImplTest.java index edc0ba780..b71439c8d 100644 --- a/cf-module-system/cf-module-system-biz/src/test/java/com/cf/imes/module/system/service/machine/MachineServiceImplTest.java +++ b/cf-module-system/cf-module-system-biz/src/test/java/com/cf/imes/module/system/service/machine/MachineServiceImplTest.java @@ -14,16 +14,16 @@ class MachineServiceImplTest { @Resource private MachineService machineService; - @Test - void create() { - OrganContextHolder.setOrganId(1L); - for (int i = 0; i < 20; i++) { - CuttingSaveReqVO saveReqVO = randomPojo(CuttingSaveReqVO.class); - saveReqVO.setId(null); - Long aLong = machineService.createCutting(saveReqVO); - } - - } +// @Test +// void create() { +// OrganContextHolder.setOrganId(1L); +// for (int i = 0; i < 20; i++) { +// CuttingSaveReqVO saveReqVO = randomPojo(CuttingSaveReqVO.class); +// saveReqVO.setId(null); +// Long aLong = machineService.createCutting(saveReqVO); +// } +// +// } @Test void update() {