xml字段对应验证

This commit is contained in:
lym
2024-09-24 17:54:08 +08:00
parent 6f5bd90c0d
commit 71ce80769a
12 changed files with 693 additions and 458 deletions
@@ -340,7 +340,6 @@ public class OrderController {
} else if (type == 2) { // xml } else if (type == 2) { // xml
orderXmlVO = (OrderXmlVO) XMLUtil.read(file, OrderXmlVO.class); orderXmlVO = (OrderXmlVO) XMLUtil.read(file, OrderXmlVO.class);
System.out.println("1、 " + orderXmlVO);
if (index == 0){ if (index == 0){
if (orderXmlVO != null) { if (orderXmlVO != null) {
@@ -375,9 +374,8 @@ public class OrderController {
} }
} }
if (!flag){ if (!flag){
System.out.println("xml = " + orderXmlVO);
String xmlStr = XmlBuilder.objectToXmlStr(orderXmlVO); String xmlStr = XmlBuilder.objectToXmlStr(orderXmlVO);
XMLUtil.writeErr(response, xmlStr, " 错误.xml"); XMLUtil.writeErr(response, xmlStr, " order_add_xml_err.xml");
return; return;
} }
} }
@@ -388,7 +386,7 @@ public class OrderController {
ExcelWriterUtil.write(response, mapOrder, list, orderService.getSavePath() + File.separator + "order_add_excel_err.xlsx"); ExcelWriterUtil.write(response, mapOrder, list, orderService.getSavePath() + File.separator + "order_add_excel_err.xlsx");
} else if (type == 2) { } else if (type == 2) {
String xmlStr = XmlBuilder.objectToXmlStr(orderXmlVO); String xmlStr = XmlBuilder.objectToXmlStr(orderXmlVO);
XMLUtil.writeErr(response, xmlStr, " 错误.xml"); XMLUtil.writeErr(response, xmlStr, " order_add_xml_err.xml");
} }
} }
} }
@@ -32,6 +32,8 @@ public class OrderModelDO extends ESDocument {
@Schema(description = "小板id") @Schema(description = "小板id")
private Long plateId; private Long plateId;
@Schema(description = "房间的基点坐标")
private BasePosition roomBasePosition; // 板件基准点坐标
@Schema(description = "柜体的基点坐标") @Schema(description = "柜体的基点坐标")
private BasePosition bodyBasePosition; // 板件基准点坐标 private BasePosition bodyBasePosition; // 板件基准点坐标
@Schema(description = "板件的基点坐标") @Schema(description = "板件的基点坐标")
@@ -76,7 +78,7 @@ public class OrderModelDO extends ESDocument {
@Schema(description = "侧面孔明细列表") @Schema(description = "侧面孔明细列表")
private List<HoleDetail> sideHoleDetail; private List<HoleDetail> sideHoleDetail;
@Schema(description = "生产封边备注 弃用") @Schema(description = "生产封边备注")
private Map<String,String> sideRemark;// 封边备注 private Map<String,String> sideRemark;// 封边备注
@Schema(description = "板材扩展备注") @Schema(description = "板材扩展备注")
private JSONObject plateExtraRemark;// 封边备注 private JSONObject plateExtraRemark;// 封边备注
@@ -729,7 +729,10 @@ public class OrderServiceImpl implements OrderService {
PlateGoodDO plateGoodDO = null; PlateGoodDO plateGoodDO = null;
List<PlateGoodDO> plateGoodDOS = null; List<PlateGoodDO> plateGoodDOS = null;
if (goodsDO.getGoodsId() != null) { // 有goodsId if (goodsDO.getGoodsId() != null) { // 有goodsId
plateGoodDO = plateGoodMapper.selectGoodOne(goodsDO.getGoodsId(), OrganContextHolder.getOrganId()).get(0); List<PlateGoodDO> plateGoodlist = plateGoodMapper.selectGoodOne(goodsDO.getGoodsId(), OrganContextHolder.getOrganId());
if (plateGoodlist.size() > 0) {
plateGoodDO = plateGoodlist.get(0);
}
} else { // 没有goodsId 其他信息匹配 } else { // 没有goodsId 其他信息匹配
plateGoodDOS = plateGoodMapper.selectGood(goodsDO.getGoodsName(), goodsDO.getMaterial(), goodsDO.getColor(), plateGoodDOS = plateGoodMapper.selectGood(goodsDO.getGoodsName(), goodsDO.getMaterial(), goodsDO.getColor(),
goodsDO.getTexture(), goodsDO.getWidth(), goodsDO.getThickness(), goodsDO.getHeight(), goodsDO.getBrand(), goodsDO.getTexture(), goodsDO.getWidth(), goodsDO.getThickness(), goodsDO.getHeight(), goodsDO.getBrand(),
@@ -741,14 +744,19 @@ public class OrderServiceImpl implements OrderService {
} else if (plateGoodDO != null) { // 存在板材 } else if (plateGoodDO != null) { // 存在板材
goodsDO.setGoodsId(plateGoodDO.getGoodsId()); goodsDO.setGoodsId(plateGoodDO.getGoodsId());
} else { // 不存在板材 } else { // 不存在板材
Long plateGoods = (Long) identifierGenerator.nextId(null); String goodsId = goodsDO.getGoodsId();
if (goodsId == null) {
long plateNo = idWorker.nextId(); long plateNo = idWorker.nextId();
long obtainingTime = idWorker.obtainingTime(); long obtainingTime = idWorker.obtainingTime();
goodsId = (obtainingTime) + Long.toString(plateNo).substring(2);
}
Long plateGoods = (Long) identifierGenerator.nextId(null);
// Long goodsId = (Long) identifierGenerator.nextId(null); // Long goodsId = (Long) identifierGenerator.nextId(null);
plateGoodDO = BeanUtils.toBean(goodsDO, PlateGoodDO.class) plateGoodDO = BeanUtils.toBean(goodsDO, PlateGoodDO.class)
.setId(plateGoods) .setId(plateGoods)
.setGoodsId((obtainingTime) + Long.toString(plateNo).substring(2)); .setGoodsId(goodsId);
// 判断是否存在raw_goods_id // 判断是否存在raw_goods_id
if (goodsDO.getGoodsId() != null) { if (goodsDO.getGoodsId() != null) {
plateGoodDO.setGoodsId(goodsDO.getGoodsId()); plateGoodDO.setGoodsId(goodsDO.getGoodsId());
@@ -1,6 +1,7 @@
package com.cf.imes.module.executor.util.deviseData.structure; package com.cf.imes.module.executor.util.deviseData.structure;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@@ -89,6 +90,7 @@ public class PlateDetail{
private Boolean has3DModel; // 是否有三维刀路 private Boolean has3DModel; // 是否有三维刀路
// 轮廓数据、造型数据 // 轮廓数据、造型数据
private BasePosition roomBasePosition; // 板件基准点坐标
private BasePosition bodyBasePosition; // 柜体基准点坐标 private BasePosition bodyBasePosition; // 柜体基准点坐标
private BasePosition plateBasePosition; // 板件基准点坐标 private BasePosition plateBasePosition; // 板件基准点坐标
private List<PointDetail> pointDetail ; //点明细,表示小板外围轮廓的几个转折点(不含封边) private List<PointDetail> pointDetail ; //点明细,表示小板外围轮廓的几个转折点(不含封边)
@@ -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;
}
@@ -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<String> edgeRemarks;
@Schema(description ="封边备注" )
private List<String> rectSealDetail;
}
@@ -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;
}
@@ -239,7 +239,7 @@ public class XMLUtil {
flag = false; flag = false;
} else { } else {
if (!checkNumber(assemblyXmlVO.getCount().trim(), Double.class)) { if (!checkNumber(assemblyXmlVO.getCount().trim(), Double.class)) {
assemblyXmlVO.setCount("---< " + assemblyXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); assemblyXmlVO.setCount(assemblyXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
flag = false; flag = false;
} }
} }
@@ -271,7 +271,7 @@ public class XMLUtil {
flag = false; flag = false;
} else { } else {
if (!checkNumber(hardwareXmlVO.getCount().trim(), Double.class)) { if (!checkNumber(hardwareXmlVO.getCount().trim(), Double.class)) {
hardwareXmlVO.setCount("---< " + hardwareXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); hardwareXmlVO.setCount(hardwareXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
flag = false; flag = false;
} }
} }
@@ -306,28 +306,28 @@ public class XMLUtil {
edgingXmlVO.setLength("---< 封边条长度不能为空 >---"); edgingXmlVO.setLength("---< 封边条长度不能为空 >---");
flag = false; flag = false;
} else if (!checkNumber(edgingXmlVO.getLength().trim(), Double.class)) { } else if (!checkNumber(edgingXmlVO.getLength().trim(), Double.class)) {
edgingXmlVO.setLength("---< " + edgingXmlVO.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); edgingXmlVO.setLength(edgingXmlVO.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
flag = false; flag = false;
} }
if (StringUtils.isEmpty(edgingXmlVO.getWidth())) { if (StringUtils.isEmpty(edgingXmlVO.getWidth())) {
edgingXmlVO.setWidth("---< 封边条宽度不能为空 >---"); edgingXmlVO.setWidth("---< 封边条宽度不能为空 >---");
flag = false; flag = false;
} else if (!checkNumber(edgingXmlVO.getWidth().trim(), Double.class)) { } else if (!checkNumber(edgingXmlVO.getWidth().trim(), Double.class)) {
edgingXmlVO.setWidth("---< " + edgingXmlVO.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); edgingXmlVO.setWidth(edgingXmlVO.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
flag = false; flag = false;
} }
if (StringUtils.isEmpty(edgingXmlVO.getThickness())) { if (StringUtils.isEmpty(edgingXmlVO.getThickness())) {
edgingXmlVO.setThickness("---< 封边条厚度不能为空 >---"); edgingXmlVO.setThickness("---< 封边条厚度不能为空 >---");
flag = false; flag = false;
} else if (!checkNumber(edgingXmlVO.getThickness().trim(), Double.class)) { } else if (!checkNumber(edgingXmlVO.getThickness().trim(), Double.class)) {
edgingXmlVO.setThickness("---< " + edgingXmlVO.getThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); edgingXmlVO.setThickness(edgingXmlVO.getThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
} }
if (StringUtils.isEmpty(edgingXmlVO.getUnit())) { if (StringUtils.isEmpty(edgingXmlVO.getUnit())) {
edgingXmlVO.setUnit("mm"); edgingXmlVO.setUnit("mm");
} else { } else {
DictDataRespDTO dictData = dictDataApi.parseDictData(DictTypeConstants.UNIT_LENGTH, edgingXmlVO.getUnit().trim()).getData(); DictDataRespDTO dictData = dictDataApi.parseDictData(DictTypeConstants.UNIT_LENGTH, edgingXmlVO.getUnit().trim()).getData();
if (dictData == null) { if (dictData == null) {
edgingXmlVO.setUnit("---< " + edgingXmlVO.getUnit().trim() + "封边条长度单位无效 >---"); edgingXmlVO.setUnit(edgingXmlVO.getUnit() + "---< " + "封边条长度单位无效 >---");
flag = false; flag = false;
} }
} }
@@ -335,7 +335,7 @@ public class XMLUtil {
edgingXmlVO.setCount("---< 封边条数量不能为空 >---"); edgingXmlVO.setCount("---< 封边条数量不能为空 >---");
flag = false; flag = false;
} else if (!checkNumber(edgingXmlVO.getCount().trim(), Double.class)) { } else if (!checkNumber(edgingXmlVO.getCount().trim(), Double.class)) {
edgingXmlVO.setCount("---< " + edgingXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); edgingXmlVO.setCount(edgingXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
flag = false; flag = false;
} }
if (StringUtils.isEmpty(edgingXmlVO.getUnitCount())) { if (StringUtils.isEmpty(edgingXmlVO.getUnitCount())) {
@@ -360,7 +360,7 @@ public class XMLUtil {
error = false; error = false;
} }
} else { } else {
roomXmlVOS.setCount(roomXmlVOS.getCount() + "---< " + roomXmlVOS.getCount() + TYPE_ERR + " >---"); roomXmlVOS.setCount(roomXmlVOS.getCount() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -413,39 +413,51 @@ public class XMLUtil {
} }
if (!StringUtils.isEmpty(room.getBasePointX())) { if (!StringUtils.isEmpty(room.getBasePointX())) {
if (!ToolUtil.convertToType(room.getBasePointX().trim(), Double.class)) { if (!ToolUtil.convertToType(room.getBasePointX().trim(), Double.class)) {
room.setBasePointX("---< " + room.getBasePointX() + TYPE_ERR + " >---"); room.setBasePointX(room.getBasePointX() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
}else {
room.setBasePointX("0");
} }
if (!StringUtils.isEmpty(room.getBasePointY())) { if (!StringUtils.isEmpty(room.getBasePointY())) {
if (!ToolUtil.convertToType(room.getBasePointY().trim(), Double.class)) { if (!ToolUtil.convertToType(room.getBasePointY().trim(), Double.class)) {
room.setBasePointY("---< " + room.getBasePointY() + TYPE_ERR + " >---"); room.setBasePointY(room.getBasePointY() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
}else {
room.setBasePointY("0");
} }
if (!StringUtils.isEmpty(room.getBasePointZ())) { if (!StringUtils.isEmpty(room.getBasePointZ())) {
if (!ToolUtil.convertToType(room.getBasePointZ().trim(), Double.class)) { if (!ToolUtil.convertToType(room.getBasePointZ().trim(), Double.class)) {
room.setBasePointZ("---< " + room.getBasePointZ() + TYPE_ERR + " >---"); room.setBasePointZ(room.getBasePointZ() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
}else {
room.setBasePointZ("0");
} }
if (!StringUtils.isEmpty(room.getAxisXrotate())) { if (!StringUtils.isEmpty(room.getAxisXrotate())) {
if (!ToolUtil.convertToType(room.getAxisXrotate().trim(), Double.class)) { if (!ToolUtil.convertToType(room.getAxisXrotate().trim(), Double.class)) {
room.setAxisXrotate("---< " + room.getAxisXrotate() + TYPE_ERR + " >---"); room.setAxisXrotate(room.getAxisXrotate() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
room.setAxisXrotate("0");
} }
if (!StringUtils.isEmpty(room.getAxisYrotate())) { if (!StringUtils.isEmpty(room.getAxisYrotate())) {
if (!ToolUtil.convertToType(room.getAxisYrotate().trim(), Double.class)) { if (!ToolUtil.convertToType(room.getAxisYrotate().trim(), Double.class)) {
room.setAxisYrotate("---< " + room.getAxisYrotate() + TYPE_ERR + " >---"); room.setAxisYrotate(room.getAxisYrotate() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
room.setAxisYrotate("0");
} }
if (!StringUtils.isEmpty(room.getAxisZrotate())) { if (!StringUtils.isEmpty(room.getAxisZrotate())) {
if (!ToolUtil.convertToType(room.getAxisZrotate().trim(), Double.class)) { if (!ToolUtil.convertToType(room.getAxisZrotate().trim(), Double.class)) {
room.setAxisZrotate("---< " + room.getAxisZrotate() + TYPE_ERR + " >---"); room.setAxisZrotate(room.getAxisZrotate() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
room.setAxisZrotate("0");
} }
// 柜体数据格式验证 // 柜体数据格式验证
if (room.getBoxXmlVOList() != null && room.getBoxXmlVOList().size() > 0) { if (room.getBoxXmlVOList() != null && room.getBoxXmlVOList().size() > 0) {
@@ -454,13 +466,14 @@ public class XMLUtil {
} }
} }
} }
// 柜体数据格式验证 // 柜体数据格式验证
public void checkBoxList(List<BoxXmlVO> boxXmlVOList, Boolean error) { public void checkBoxList(List<BoxXmlVO> boxXmlVOList, Boolean error) {
for (BoxXmlVO box : boxXmlVOList) { for (BoxXmlVO box : boxXmlVOList) {
if (!StringUtils.isEmpty(box.getHeight())) { if (!StringUtils.isEmpty(box.getHeight())) {
Boolean flag = checkNumber(box.getHeight().trim(), Double.class); Boolean flag = checkNumber(box.getHeight().trim(), Double.class);
if (!flag) { if (!flag) {
box.setHeight("---< " + box.getHeight() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); box.setHeight(box.getHeight() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -469,7 +482,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(box.getLength())) { if (!StringUtils.isEmpty(box.getLength())) {
Boolean flag = checkNumber(box.getLength().trim(), Double.class); Boolean flag = checkNumber(box.getLength().trim(), Double.class);
if (!flag) { if (!flag) {
box.setLength("---< " + box.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); box.setLength(box.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -478,41 +491,71 @@ public class XMLUtil {
if (!StringUtils.isEmpty(box.getWidth())) { if (!StringUtils.isEmpty(box.getWidth())) {
Boolean flag = checkNumber(box.getWidth().trim(), Double.class); Boolean flag = checkNumber(box.getWidth().trim(), Double.class);
if (!flag) { if (!flag) {
box.setWidth("---< " + box.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); box.setWidth(box.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
box.setWidth("0"); box.setWidth("0");
} }
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 (!StringUtils.isEmpty(box.getBasePointX())) {
if (!ToolUtil.convertToType(box.getBasePointX().trim(), Double.class)) { 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)) { 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)) { 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)) { 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)) { 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)) { if (!ToolUtil.convertToType(box.getAxisZrotate().trim(), Double.class)) {
box.setAxisZrotate("---< " + box.getAxisZrotate() + TYPE_ERR + " >---"); box.setAxisZrotate(box.getAxisZrotate() + "---< " + TYPE_ERR + " >---");
} }
} else {
box.setAxisZrotate("0");
} }
} }
} }
@@ -522,11 +565,11 @@ public class XMLUtil {
if (!StringUtils.isEmpty(moduleXmlVOS.getCount())) { if (!StringUtils.isEmpty(moduleXmlVOS.getCount())) {
if (ToolUtil.convertToType(moduleXmlVOS.getCount().trim(), Integer.class)) { if (ToolUtil.convertToType(moduleXmlVOS.getCount().trim(), Integer.class)) {
if (!ToolUtil.checkNumber(moduleXmlVOS.getCount().trim())) { if (!ToolUtil.checkNumber(moduleXmlVOS.getCount().trim())) {
moduleXmlVOS.setCount("---< " + moduleXmlVOS.getCount() + POSITIVE_ERR + " >---"); moduleXmlVOS.setCount(moduleXmlVOS.getCount() + "---< " + POSITIVE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
moduleXmlVOS.setCount("---< " + moduleXmlVOS.getCount() + TYPE_ERR + " >---"); moduleXmlVOS.setCount(moduleXmlVOS.getCount() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -535,13 +578,14 @@ public class XMLUtil {
} }
} }
// 模块数据格式验证 // 模块数据格式验证
public void checkModuleList(List<ModuleXmlVO> moduleXmlVOSList, Boolean error) { public void checkModuleList(List<ModuleXmlVO> moduleXmlVOSList, Boolean error) {
for (ModuleXmlVO module : moduleXmlVOSList) { for (ModuleXmlVO module : moduleXmlVOSList) {
if (!StringUtils.isEmpty(module.getLength())) { if (!StringUtils.isEmpty(module.getLength())) {
Boolean flag = checkNumber(module.getLength().trim(), Double.class); Boolean flag = checkNumber(module.getLength().trim(), Double.class);
if (!flag) { if (!flag) {
module.setLength("---< " + module.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); module.setLength(module.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -550,7 +594,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(module.getWidth())) { if (!StringUtils.isEmpty(module.getWidth())) {
Boolean flag = checkNumber(module.getWidth().trim(), Double.class); Boolean flag = checkNumber(module.getWidth().trim(), Double.class);
if (!flag) { if (!flag) {
module.setWidth("---< " + module.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); module.setWidth(module.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -559,7 +603,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(module.getHeight())) { if (!StringUtils.isEmpty(module.getHeight())) {
Boolean flag = checkNumber(module.getHeight().trim(), Double.class); Boolean flag = checkNumber(module.getHeight().trim(), Double.class);
if (!flag) { if (!flag) {
module.setHeight("---< " + module.getHeight() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); module.setHeight(module.getHeight() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -573,11 +617,11 @@ public class XMLUtil {
if (!StringUtils.isEmpty(groupXmlVOS.getCount())) { if (!StringUtils.isEmpty(groupXmlVOS.getCount())) {
if (ToolUtil.convertToType(groupXmlVOS.getCount().trim(), Integer.class)) { if (ToolUtil.convertToType(groupXmlVOS.getCount().trim(), Integer.class)) {
if (!ToolUtil.checkNumber(groupXmlVOS.getCount().trim())) { if (!ToolUtil.checkNumber(groupXmlVOS.getCount().trim())) {
groupXmlVOS.setCount("---< " + groupXmlVOS.getCount() + POSITIVE_ERR + " >---"); groupXmlVOS.setCount(groupXmlVOS.getCount() + "---< " + POSITIVE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
groupXmlVOS.setCount("---< " + groupXmlVOS.getCount() + TYPE_ERR + " >---"); groupXmlVOS.setCount(groupXmlVOS.getCount() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -585,13 +629,14 @@ public class XMLUtil {
checkGroupList(groupXmlVOS.getGroupXmlVOList(), error); checkGroupList(groupXmlVOS.getGroupXmlVOList(), error);
} }
} }
// 加工组数据格式验证 // 加工组数据格式验证
public void checkGroupList(List<GroupXmlVO> groupXmlVOList, Boolean error) { public void checkGroupList(List<GroupXmlVO> groupXmlVOList, Boolean error) {
for (GroupXmlVO group : groupXmlVOList) { for (GroupXmlVO group : groupXmlVOList) {
if (!StringUtils.isEmpty(group.getLength())) { if (!StringUtils.isEmpty(group.getLength())) {
Boolean flag = checkNumber(group.getLength().trim(), Double.class); Boolean flag = checkNumber(group.getLength().trim(), Double.class);
if (!flag) { if (!flag) {
group.setLength("---< " + group.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); group.setLength(group.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -600,7 +645,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(group.getWidth())) { if (!StringUtils.isEmpty(group.getWidth())) {
Boolean flag = checkNumber(group.getWidth().trim(), Double.class); Boolean flag = checkNumber(group.getWidth().trim(), Double.class);
if (!flag) { if (!flag) {
group.setWidth( "---< " + group.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); group.setWidth(group.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -609,7 +654,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(group.getHeight())) { if (!StringUtils.isEmpty(group.getHeight())) {
Boolean flag = checkNumber(group.getHeight().trim(), Double.class); Boolean flag = checkNumber(group.getHeight().trim(), Double.class);
if (!flag) { if (!flag) {
group.setHeight("---< " + group.getHeight() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); group.setHeight(group.getHeight() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -634,7 +679,7 @@ public class XMLUtil {
plate.setGrained(""); plate.setGrained("");
} else { } else {
if (!StringUtils.equals(plate.getGrained().trim(), "") && !StringUtils.equals(plate.getGrained().trim(), "")) { if (!StringUtils.equals(plate.getGrained().trim(), "") && !StringUtils.equals(plate.getGrained().trim(), "")) {
plate.setGrained("---< " + plate.getGrained() + " 板材纹理无效 >---"); plate.setGrained(plate.getGrained() + "---< " + " 板材纹理无效 >---");
error = false; error = false;
} }
} }
@@ -643,7 +688,7 @@ public class XMLUtil {
} else { } else {
if (!StringUtils.equals(plate.getCoating().trim(), "双面") && !StringUtils.equals(plate.getCoating().trim(), "单面") && if (!StringUtils.equals(plate.getCoating().trim(), "双面") && !StringUtils.equals(plate.getCoating().trim(), "单面") &&
!StringUtils.equals(plate.getCoating().trim(), "")) { !StringUtils.equals(plate.getCoating().trim(), "")) {
plate.setCoating("---< " + plate.getCoating() + " 板材纹理无效 >---"); plate.setCoating(plate.getCoating() + "---< " + " 板材纹理无效 >---");
error = false; error = false;
} }
} }
@@ -653,11 +698,11 @@ public class XMLUtil {
} else { } else {
Boolean flag = checkNumber(plate.getLength().trim(), Double.class); Boolean flag = checkNumber(plate.getLength().trim(), Double.class);
if (!flag) { if (!flag) {
plate.setLength("---< " + plate.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); plate.setLength(plate.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} else { } else {
if (!ToolUtil.checkPrecision(plate.getLength().trim(), 5, 3)) { if (!ToolUtil.checkPrecision(plate.getLength().trim(), 5, 3)) {
plate.setLength("---< " + plate.getLength() + LONG_ERR + " >---"); plate.setLength(plate.getLength() + "---< " + LONG_ERR + " >---");
error = false; error = false;
} }
} }
@@ -668,11 +713,11 @@ public class XMLUtil {
} else { } else {
Boolean flag = checkNumber(plate.getWidth().trim(), Double.class); Boolean flag = checkNumber(plate.getWidth().trim(), Double.class);
if (!flag) { if (!flag) {
plate.setWidth("---< " + plate.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); plate.setWidth(plate.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} else { } else {
if (!ToolUtil.checkPrecision(plate.getWidth().trim(), 5, 3)) { if (!ToolUtil.checkPrecision(plate.getWidth().trim(), 5, 3)) {
plate.setWidth("---< " + plate.getWidth() + LONG_ERR + " >---"); plate.setWidth(plate.getWidth() + "---< " + LONG_ERR + " >---");
error = false; error = false;
} }
} }
@@ -683,11 +728,11 @@ public class XMLUtil {
} else { } else {
Boolean flag = checkNumber(plate.getThickness().trim(), Double.class); Boolean flag = checkNumber(plate.getThickness().trim(), Double.class);
if (!flag) { if (!flag) {
plate.setThickness("---< " + plate.getThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); plate.setThickness(plate.getThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} else { } else {
if (!ToolUtil.checkPrecision(plate.getThickness().trim(), 5, 3)) { if (!ToolUtil.checkPrecision(plate.getThickness().trim(), 5, 3)) {
plate.setThickness("---< " + plate.getThickness() + LONG_ERR + " >---"); plate.setThickness(plate.getThickness() + "---< " + LONG_ERR + " >---");
error = false; error = false;
} }
} }
@@ -695,11 +740,11 @@ public class XMLUtil {
if (!StringUtils.isEmpty(plate.getOddmentLength())) { if (!StringUtils.isEmpty(plate.getOddmentLength())) {
Boolean flag = checkNumber(plate.getOddmentLength().trim(), Double.class); Boolean flag = checkNumber(plate.getOddmentLength().trim(), Double.class);
if (!flag) { if (!flag) {
plate.setOddmentLength("---< " + plate.getOddmentLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); plate.setOddmentLength(plate.getOddmentLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} else { } else {
if (!ToolUtil.checkPrecision(plate.getOddmentLength().trim(), 5, 3)) { if (!ToolUtil.checkPrecision(plate.getOddmentLength().trim(), 5, 3)) {
plate.setOddmentLength("---< " + plate.getOddmentLength() + LONG_ERR + " >---"); plate.setOddmentLength(plate.getOddmentLength() + "---< " + LONG_ERR + " >---");
error = false; error = false;
} }
} }
@@ -707,11 +752,11 @@ public class XMLUtil {
if (!StringUtils.isEmpty(plate.getOddmentWidth())) { if (!StringUtils.isEmpty(plate.getOddmentWidth())) {
Boolean flag = checkNumber(plate.getOddmentWidth().trim(), Double.class); Boolean flag = checkNumber(plate.getOddmentWidth().trim(), Double.class);
if (!flag) { if (!flag) {
plate.setOddmentWidth("---< " + plate.getOddmentWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); plate.setOddmentWidth(plate.getOddmentWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} else { } else {
if (!ToolUtil.checkPrecision(plate.getOddmentWidth().trim(), 5, 3)) { if (!ToolUtil.checkPrecision(plate.getOddmentWidth().trim(), 5, 3)) {
plate.setOddmentWidth("---< " + plate.getOddmentWidth() + LONG_ERR + " >---"); plate.setOddmentWidth(plate.getOddmentWidth() + "---< " + LONG_ERR + " >---");
error = false; error = false;
} }
} }
@@ -719,11 +764,11 @@ public class XMLUtil {
if (!StringUtils.isEmpty(plate.getOddmentThickness())) { if (!StringUtils.isEmpty(plate.getOddmentThickness())) {
Boolean flag = checkNumber(plate.getOddmentThickness().trim(), Double.class); Boolean flag = checkNumber(plate.getOddmentThickness().trim(), Double.class);
if (!flag) { if (!flag) {
plate.setOddmentThickness("---< " + plate.getOddmentThickness() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); plate.setOddmentThickness(plate.getOddmentThickness() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} else { } else {
if (!ToolUtil.checkPrecision(plate.getOddmentThickness().trim(), 5, 3)) { if (!ToolUtil.checkPrecision(plate.getOddmentThickness().trim(), 5, 3)) {
plate.setOddmentThickness("---< " + plate.getOddmentThickness() + LONG_ERR + " >---"); plate.setOddmentThickness(plate.getOddmentThickness() + "---< " + LONG_ERR + " >---");
error = false; error = false;
} }
} }
@@ -775,6 +820,7 @@ public class XMLUtil {
} }
} }
} }
// 小板数据格式验证 // 小板数据格式验证
public void checkBlocks(BlockXmlVOS blockXmlVOS, Boolean error) { public void checkBlocks(BlockXmlVOS blockXmlVOS, Boolean error) {
if (!StringUtils.isEmpty(blockXmlVOS.getCount())) { if (!StringUtils.isEmpty(blockXmlVOS.getCount())) {
@@ -815,6 +861,7 @@ public class XMLUtil {
checkBlockList(blockXmlVOS.getBlockXmlVOList(), error); checkBlockList(blockXmlVOS.getBlockXmlVOList(), error);
} }
} }
// 板块数据格式验证 // 板块数据格式验证
public void checkBlockList(List<BlockXmlVO> blockXmlVOList, Boolean error) { public void checkBlockList(List<BlockXmlVO> blockXmlVOList, Boolean error) {
if (blockXmlVOList.size() > 0) { if (blockXmlVOList.size() > 0) {
@@ -1014,36 +1061,48 @@ public class XMLUtil {
blockXmlVO.setBasePointX(blockXmlVO.getBasePointX() + "---< " + TYPE_ERR + " >---"); blockXmlVO.setBasePointX(blockXmlVO.getBasePointX() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
blockXmlVO.setBasePointX("0");
} }
if (!StringUtils.isEmpty(blockXmlVO.getBasePointY())) { if (!StringUtils.isEmpty(blockXmlVO.getBasePointY())) {
if (!ToolUtil.convertToType(blockXmlVO.getBasePointX(), Double.class)) { if (!ToolUtil.convertToType(blockXmlVO.getBasePointY(), Double.class)) {
blockXmlVO.setBasePointY(blockXmlVO.getBasePointY() + "---< " + TYPE_ERR + " >---"); blockXmlVO.setBasePointY(blockXmlVO.getBasePointY() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
blockXmlVO.setBasePointY("0");
} }
if (!StringUtils.isEmpty(blockXmlVO.getBasePointZ())) { if (!StringUtils.isEmpty(blockXmlVO.getBasePointZ())) {
if (!ToolUtil.convertToType(blockXmlVO.getBasePointZ(), Double.class)) { if (!ToolUtil.convertToType(blockXmlVO.getBasePointZ(), Double.class)) {
blockXmlVO.setBasePointZ(blockXmlVO.getBasePointZ() + "---< " + TYPE_ERR + " >---"); blockXmlVO.setBasePointZ(blockXmlVO.getBasePointZ() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
blockXmlVO.setBasePointZ("0");
} }
if (!StringUtils.isEmpty(blockXmlVO.getAxisXrotate())) { if (!StringUtils.isEmpty(blockXmlVO.getAxisXrotate())) {
if (!ToolUtil.convertToType(blockXmlVO.getAxisXrotate(), Double.class)) { if (!ToolUtil.convertToType(blockXmlVO.getAxisXrotate(), Double.class)) {
blockXmlVO.setAxisXrotate(blockXmlVO.getAxisXrotate() + "---< " + TYPE_ERR + " >---"); blockXmlVO.setAxisXrotate(blockXmlVO.getAxisXrotate() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
blockXmlVO.setAxisXrotate("0");
} }
if (!StringUtils.isEmpty(blockXmlVO.getAxisYrotate())) { if (!StringUtils.isEmpty(blockXmlVO.getAxisYrotate())) {
if (!ToolUtil.convertToType(blockXmlVO.getAxisYrotate(), Double.class)) { if (!ToolUtil.convertToType(blockXmlVO.getAxisYrotate(), Double.class)) {
blockXmlVO.setAxisYrotate(blockXmlVO.getAxisYrotate() + "---< " + TYPE_ERR + " >---"); blockXmlVO.setAxisYrotate(blockXmlVO.getAxisYrotate() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
blockXmlVO.setAxisYrotate("0");
} }
if (!StringUtils.isEmpty(blockXmlVO.getAxisZrotate())) { if (!StringUtils.isEmpty(blockXmlVO.getAxisZrotate())) {
if (!ToolUtil.convertToType(blockXmlVO.getAxisZrotate(), Double.class)) { if (!ToolUtil.convertToType(blockXmlVO.getAxisZrotate(), Double.class)) {
blockXmlVO.setAxisZrotate(blockXmlVO.getAxisZrotate() + "---< " + TYPE_ERR + " >---"); blockXmlVO.setAxisZrotate(blockXmlVO.getAxisZrotate() + "---< " + TYPE_ERR + " >---");
error = false; error = false;
} }
} else {
blockXmlVO.setAxisZrotate("0");
} }
if (blockXmlVO.getOutlineXmlVO() != null) { if (blockXmlVO.getOutlineXmlVO() != null) {
@@ -1083,7 +1142,7 @@ public class XMLUtil {
private void checkCorrelations(CorrelationXmlVOS correlationXmlVOS, Boolean error) { private void checkCorrelations(CorrelationXmlVOS correlationXmlVOS, Boolean error) {
if (!StringUtils.isEmpty(correlationXmlVOS.getCount())) { if (!StringUtils.isEmpty(correlationXmlVOS.getCount())) {
if (!checkNumber(correlationXmlVOS.getCount(), Integer.class)) { if (!checkNumber(correlationXmlVOS.getCount(), Integer.class)) {
correlationXmlVOS.setCount("---< " + correlationXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); correlationXmlVOS.setCount(correlationXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -1100,7 +1159,7 @@ public class XMLUtil {
} }
if (!StringUtils.isEmpty(correlationXmlVO.getCount())) { if (!StringUtils.isEmpty(correlationXmlVO.getCount())) {
if (!checkNumber(correlationXmlVO.getCount(), Integer.class)) { if (!checkNumber(correlationXmlVO.getCount(), Integer.class)) {
correlationXmlVO.setCount("---< " + correlationXmlVO.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); correlationXmlVO.setCount(correlationXmlVO.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1121,7 +1180,7 @@ public class XMLUtil {
} else { } else {
Boolean flag = checkNumber(isletXmlVOS.getCount().trim(), Integer.class); Boolean flag = checkNumber(isletXmlVOS.getCount().trim(), Integer.class);
if (!flag) { if (!flag) {
isletXmlVOS.setCount("---< " + isletXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); isletXmlVOS.setCount(isletXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
index = false; index = false;
} }
@@ -1154,13 +1213,13 @@ public class XMLUtil {
if (isletXmlVO.getPointXmlVOS() != null) { if (isletXmlVO.getPointXmlVOS() != null) {
Boolean index = true; Boolean index = true;
if (StringUtils.isEmpty(isletXmlVO.getPointXmlVOS().getCount())) { if (StringUtils.isEmpty(isletXmlVO.getPointXmlVOS().getCount())) {
isletXmlVO.getPointXmlVOS().setCount("---< 孤岛数量不可为空 >---"); isletXmlVO.getPointXmlVOS().setCount("---< 孤岛点阵数量不可为空 >---");
error = false; error = false;
index = false; index = false;
} else { } else {
Boolean flag = checkNumber(isletXmlVO.getPointXmlVOS().getCount().trim(), Integer.class); Boolean flag = checkNumber(isletXmlVO.getPointXmlVOS().getCount().trim(), Integer.class);
if (!flag) { if (!flag) {
isletXmlVO.getPointXmlVOS().setCount("---< " + isletXmlVO.getPointXmlVOS().getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); isletXmlVO.getPointXmlVOS().setCount(isletXmlVO.getPointXmlVOS().getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
index = false; index = false;
} }
@@ -1168,11 +1227,11 @@ public class XMLUtil {
if (index) { if (index) {
if (isletXmlVO.getPointXmlVOS().getPointXmlVOList() == null) { if (isletXmlVO.getPointXmlVOS().getPointXmlVOList() == null) {
isletXmlVO.getPointXmlVOS().setCount("---< 孤岛数量与孤岛列表数量不一致 >---"); isletXmlVO.getPointXmlVOS().setCount("---< 孤岛点阵数量与孤岛点阵列表数量不一致 >---");
error = false; 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()) { if (Integer.valueOf(isletXmlVO.getPointXmlVOS().getCount()) != isletXmlVO.getPointXmlVOS().getPointXmlVOList().size()) {
isletXmlVO.getPointXmlVOS().setCount("---< 孤岛数量与孤岛列表数量不一致 >---"); isletXmlVO.getPointXmlVOS().setCount("---< 孤岛点阵数量与孤岛点阵列表数量不一致 >---");
error = false; error = false;
} else { } else {
for (PointXmlVO pointXmlVO : isletXmlVO.getPointXmlVOS().getPointXmlVOList()) { for (PointXmlVO pointXmlVO : isletXmlVO.getPointXmlVOS().getPointXmlVOList()) {
@@ -1189,91 +1248,91 @@ public class XMLUtil {
if (!StringUtils.isEmpty(holeXmlVOS.getCount())) { if (!StringUtils.isEmpty(holeXmlVOS.getCount())) {
Boolean flag = checkNumber(holeXmlVOS.getCount().trim(), Double.class); Boolean flag = checkNumber(holeXmlVOS.getCount().trim(), Double.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCount("---< " + holeXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCount(holeXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceA())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceA())) {
Boolean flag = checkNumber(holeXmlVOS.getCountFaceA().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountFaceA().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountFaceA("---< " + holeXmlVOS.getCountFaceA() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountFaceA(holeXmlVOS.getCountFaceA() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceB())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountFaceB())) {
Boolean flag = checkNumber(holeXmlVOS.getCountFaceB().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountFaceB().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountFaceB("---< " + holeXmlVOS.getCountFaceB() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountFaceB(holeXmlVOS.getCountFaceB() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSide())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSide())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSide().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSide().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountSide("---< " + holeXmlVOS.getCountSide() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSide(holeXmlVOS.getCountSide() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideL())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideL())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideL().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideL().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountSideL("---< " + holeXmlVOS.getCountSideL() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideL(holeXmlVOS.getCountSideL() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideR())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideR())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideR().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideR().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountSideR("---< " + holeXmlVOS.getCountSideR() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideR(holeXmlVOS.getCountSideR() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideU())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideU())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideU().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideU().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountSideU("---< " + holeXmlVOS.getCountSideU() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideU(holeXmlVOS.getCountSideU() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountSideD())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountSideD())) {
Boolean flag = checkNumber(holeXmlVOS.getCountSideD().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountSideD().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountSideD("---< " + holeXmlVOS.getCountSideD() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountSideD(holeXmlVOS.getCountSideD() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountBevelled())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountBevelled())) {
Boolean flag = checkNumber(holeXmlVOS.getCountBevelled().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountBevelled().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountBevelled("---< " + holeXmlVOS.getCountBevelled() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountBevelled(holeXmlVOS.getCountBevelled() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountLocking())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountLocking())) {
Boolean flag = checkNumber(holeXmlVOS.getCountLocking().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountLocking().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountLocking("---< " + holeXmlVOS.getCountLocking() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountLocking(holeXmlVOS.getCountLocking() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountBuildIn())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountBuildIn())) {
Boolean flag = checkNumber(holeXmlVOS.getCountBuildIn().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountBuildIn().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountBuildIn("---< " + holeXmlVOS.getCountBuildIn() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountBuildIn(holeXmlVOS.getCountBuildIn() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountHinge())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountHinge())) {
Boolean flag = checkNumber(holeXmlVOS.getCountHinge().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountHinge().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountHinge("---< " + holeXmlVOS.getCountHinge() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountHinge(holeXmlVOS.getCountHinge() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(holeXmlVOS.getCountThrough())) { if (!StringUtils.isEmpty(holeXmlVOS.getCountThrough())) {
Boolean flag = checkNumber(holeXmlVOS.getCountThrough().trim(), Integer.class); Boolean flag = checkNumber(holeXmlVOS.getCountThrough().trim(), Integer.class);
if (!flag) { if (!flag) {
holeXmlVOS.setCountThrough("---< " + holeXmlVOS.getCountThrough() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); holeXmlVOS.setCountThrough(holeXmlVOS.getCountThrough() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -1461,91 +1520,91 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVOS.getCount())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCount())) {
Boolean flag = checkNumber(grooveXmlVOS.getCount().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVOS.getCount().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCount("---< " + grooveXmlVOS.getCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCount(grooveXmlVOS.getCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceA())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceA())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountFaceA().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountFaceA().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountFaceA("---< " + grooveXmlVOS.getCountFaceA() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountFaceA(grooveXmlVOS.getCountFaceA() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceB())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountFaceB())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountFaceB().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountFaceB().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountFaceB("---< " + grooveXmlVOS.getCountFaceB() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountFaceB(grooveXmlVOS.getCountFaceB() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountSide())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountSide())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountSide().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountSide().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountSide("---< " + grooveXmlVOS.getCountSide() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountSide(grooveXmlVOS.getCountSide() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideL())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideL())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountSideL().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountSideL().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountSideL("---< " + grooveXmlVOS.getCountSideL() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountSideL(grooveXmlVOS.getCountSideL() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideR())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideR())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountSideR().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountSideR().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountSideR("---< " + grooveXmlVOS.getCountSideR() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountSideR(grooveXmlVOS.getCountSideR() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideU())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideU())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountSideU().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountSideU().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountSideU("---< " + grooveXmlVOS.getCountSideU() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountSideU(grooveXmlVOS.getCountSideU() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideD())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountSideD())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountSideD().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountSideD().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountSideD("---< " + grooveXmlVOS.getCountSideD() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountSideD(grooveXmlVOS.getCountSideD() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountBevelled())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountBevelled())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountBevelled().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountBevelled().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountBevelled("---< " + grooveXmlVOS.getCountBevelled() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountBevelled(grooveXmlVOS.getCountBevelled() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountRectangle())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountRectangle())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountRectangle().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountRectangle().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountRectangle("---< " + grooveXmlVOS.getCountRectangle() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountRectangle(grooveXmlVOS.getCountRectangle() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCountThrough())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCountThrough())) {
Boolean flag = checkNumber(grooveXmlVOS.getCountThrough().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCountThrough().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCountThrough("---< " + grooveXmlVOS.getCountThrough() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCountThrough(grooveXmlVOS.getCountThrough() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCount2V())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCount2V())) {
Boolean flag = checkNumber(grooveXmlVOS.getCount2V().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCount2V().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCount2V("---< " + grooveXmlVOS.getCount2V() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCount2V(grooveXmlVOS.getCount2V() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVOS.getCount3D())) { if (!StringUtils.isEmpty(grooveXmlVOS.getCount3D())) {
Boolean flag = checkNumber(grooveXmlVOS.getCount3D().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVOS.getCount3D().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVOS.setCount3D("---< " + grooveXmlVOS.getCount3D() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVOS.setCount3D(grooveXmlVOS.getCount3D() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -1587,14 +1646,14 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVO.getWidth())) { if (!StringUtils.isEmpty(grooveXmlVO.getWidth())) {
Boolean flag = checkNumber(grooveXmlVO.getWidth().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getWidth().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setWidth("---< " + grooveXmlVO.getWidth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setWidth(grooveXmlVO.getWidth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVO.getLength())) { if (!StringUtils.isEmpty(grooveXmlVO.getLength())) {
Boolean flag = checkNumber(grooveXmlVO.getLength().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getLength().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setLength("---< " + grooveXmlVO.getLength() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setLength(grooveXmlVO.getLength() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -1604,14 +1663,14 @@ public class XMLUtil {
} else { } else {
Boolean flag = checkNumber(grooveXmlVO.getDepth().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getDepth().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setDepth("---< " + grooveXmlVO.getDepth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setDepth(grooveXmlVO.getDepth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVO.getWidthExtend())) { if (!StringUtils.isEmpty(grooveXmlVO.getWidthExtend())) {
Boolean flag = checkNumber(grooveXmlVO.getWidthExtend().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getWidthExtend().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setWidthExtend("---< " + grooveXmlVO.getWidthExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setWidthExtend(grooveXmlVO.getWidthExtend() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1620,7 +1679,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVO.getLengthExtend())) { if (!StringUtils.isEmpty(grooveXmlVO.getLengthExtend())) {
Boolean flag = checkNumber(grooveXmlVO.getLengthExtend().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getLengthExtend().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setLengthExtend("---< " + grooveXmlVO.getLengthExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setLengthExtend(grooveXmlVO.getLengthExtend() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1629,7 +1688,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVO.getDepthExtend())) { if (!StringUtils.isEmpty(grooveXmlVO.getDepthExtend())) {
Boolean flag = checkNumber(grooveXmlVO.getDepthExtend().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getDepthExtend().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setDepthExtend("---< " + grooveXmlVO.getDepthExtend() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setDepthExtend(grooveXmlVO.getDepthExtend() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1638,7 +1697,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVO.getRound())) { if (!StringUtils.isEmpty(grooveXmlVO.getRound())) {
Boolean flag = checkNumber(grooveXmlVO.getRound().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getRound().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setRound("---< " + grooveXmlVO.getRound() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setRound(grooveXmlVO.getRound() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1653,14 +1712,14 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVO.getToolDiameter())) { if (!StringUtils.isEmpty(grooveXmlVO.getToolDiameter())) {
Boolean flag = checkNumber(grooveXmlVO.getToolDiameter().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getToolDiameter().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setToolDiameter("---< " + grooveXmlVO.getToolDiameter() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setToolDiameter(grooveXmlVO.getToolDiameter() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
if (!StringUtils.isEmpty(grooveXmlVO.getRedundance())) { if (!StringUtils.isEmpty(grooveXmlVO.getRedundance())) {
Boolean flag = checkNumber(grooveXmlVO.getRedundance().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getRedundance().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setRedundance("---< " + grooveXmlVO.getRedundance() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setRedundance(grooveXmlVO.getRedundance() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1669,7 +1728,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVO.getTangentAngle())) { if (!StringUtils.isEmpty(grooveXmlVO.getTangentAngle())) {
Boolean flag = checkNumber(grooveXmlVO.getTangentAngle().trim(), Double.class); Boolean flag = checkNumber(grooveXmlVO.getTangentAngle().trim(), Double.class);
if (!flag) { if (!flag) {
grooveXmlVO.setTangentAngle("---< " + grooveXmlVO.getTangentAngle() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setTangentAngle(grooveXmlVO.getTangentAngle() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1678,7 +1737,7 @@ public class XMLUtil {
if (!StringUtils.isEmpty(grooveXmlVO.getIsletCount())) { if (!StringUtils.isEmpty(grooveXmlVO.getIsletCount())) {
Boolean flag = checkNumber(grooveXmlVO.getIsletCount().trim(), Integer.class); Boolean flag = checkNumber(grooveXmlVO.getIsletCount().trim(), Integer.class);
if (!flag) { if (!flag) {
grooveXmlVO.setIsletCount("---< " + grooveXmlVO.getIsletCount() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); grooveXmlVO.setIsletCount(grooveXmlVO.getIsletCount() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} else { } else {
@@ -1707,7 +1766,7 @@ public class XMLUtil {
} else { } else {
Boolean flag = ToolUtil.convertToType(offsetLineXmlVO.getOffset().trim(), Double.class); Boolean flag = ToolUtil.convertToType(offsetLineXmlVO.getOffset().trim(), Double.class);
if (!flag) { if (!flag) {
offsetLineXmlVO.setOffset("---< " + offsetLineXmlVO.getOffset() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); offsetLineXmlVO.setOffset(offsetLineXmlVO.getOffset() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
error = false; error = false;
} }
} }
@@ -1717,7 +1776,7 @@ public class XMLUtil {
} else { } else {
Boolean flag = ToolUtil.convertToType(offsetLineXmlVO.getDepth().trim(), Double.class); Boolean flag = ToolUtil.convertToType(offsetLineXmlVO.getDepth().trim(), Double.class);
if (!flag) { if (!flag) {
offsetLineXmlVO.setDepth("---< " + offsetLineXmlVO.getDepth() + POSITIVE_ERR + "或是" + TYPE_ERR + " >---"); offsetLineXmlVO.setDepth(offsetLineXmlVO.getDepth() + "---< " + POSITIVE_ERR + "或是" + TYPE_ERR + " >---");
} }
} }
if (StringUtils.isEmpty(offsetLineXmlVO.getToolDiameter())) { if (StringUtils.isEmpty(offsetLineXmlVO.getToolDiameter())) {
@@ -1779,7 +1838,6 @@ public class XMLUtil {
if (Integer.parseInt(rawOutlineXmlVO.getCount()) != rawOutlineXmlVO.getPointXmlVOList().size()) { if (Integer.parseInt(rawOutlineXmlVO.getCount()) != rawOutlineXmlVO.getPointXmlVOList().size()) {
rawOutlineXmlVO.setCount("---< 小板坯料(精加工)点阵数量与实际数量不一致 >---"); rawOutlineXmlVO.setCount("---< 小板坯料(精加工)点阵数量与实际数量不一致 >---");
error = false; error = false;
}
} else { } else {
for (PointXmlVO pointXmlVO : rawOutlineXmlVO.getPointXmlVOList()) { for (PointXmlVO pointXmlVO : rawOutlineXmlVO.getPointXmlVOList()) {
checkPoint(pointXmlVO, error); checkPoint(pointXmlVO, error);
@@ -1787,6 +1845,7 @@ public class XMLUtil {
} }
} }
} }
}
private void checkCuttingOutline(CuttingOutlineXmlVO cuttingOutlineXmlVO, Boolean error) { private void checkCuttingOutline(CuttingOutlineXmlVO cuttingOutlineXmlVO, Boolean error) {
Boolean index = true; Boolean index = true;
@@ -1826,7 +1885,6 @@ public class XMLUtil {
if (Integer.parseInt(cuttingOutlineXmlVO.getCount()) != cuttingOutlineXmlVO.getPointXmlVOList().size()) { if (Integer.parseInt(cuttingOutlineXmlVO.getCount()) != cuttingOutlineXmlVO.getPointXmlVOList().size()) {
cuttingOutlineXmlVO.setCount("---< 小板轮廓点阵数量与实际数量不一致 >---"); cuttingOutlineXmlVO.setCount("---< 小板轮廓点阵数量与实际数量不一致 >---");
error = false; error = false;
}
} else { } else {
for (PointXmlVO pointXmlVO : cuttingOutlineXmlVO.getPointXmlVOList()) { for (PointXmlVO pointXmlVO : cuttingOutlineXmlVO.getPointXmlVOList()) {
checkPoint(pointXmlVO, error); checkPoint(pointXmlVO, error);
@@ -1834,6 +1892,7 @@ public class XMLUtil {
} }
} }
} }
}
public void checkOutline(OutlineXmlVO outlineXmlVO, Boolean error) { public void checkOutline(OutlineXmlVO outlineXmlVO, Boolean error) {
Boolean index = true; Boolean index = true;
@@ -1855,13 +1914,19 @@ public class XMLUtil {
outlineXmlVO.setCount("---< 小板轮廓点阵数量与实际数量不一致 >---"); outlineXmlVO.setCount("---< 小板轮廓点阵数量与实际数量不一致 >---");
error = false; error = false;
} }
} else {
for (PointXmlVO pointXmlVO : outlineXmlVO.getPointXmlVOList()) { for (PointXmlVO pointXmlVO : outlineXmlVO.getPointXmlVOList()) {
checkPoint(pointXmlVO, error); checkPoint(pointXmlVO, error);
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.getItemCode())) {
if (StringUtils.isEmpty(pointXmlVO.getEdgingName()) || StringUtils.isEmpty(pointXmlVO.getEdgingColor()) || if (StringUtils.isEmpty(pointXmlVO.getEdgingColor()) || StringUtils.isEmpty(pointXmlVO.getEdgingMaterial())) {
StringUtils.isEmpty(pointXmlVO.getEdgingMaterial())){ pointXmlVO.setItemCode("---< 当封边条没有物料编码时,封边条颜色、材质不可为空 >---");
pointXmlVO.setItemCode("---< 当封边条没有物料编码时,封边条名称、颜色、材质不可为空 >---");
error = false; error = false;
} }
} }
@@ -1881,6 +1946,8 @@ public class XMLUtil {
error = false; error = false;
} }
} }
}
if (StringUtils.isEmpty(pointXmlVO.getPreMilling())) { if (StringUtils.isEmpty(pointXmlVO.getPreMilling())) {
pointXmlVO.setPreMilling("0"); pointXmlVO.setPreMilling("0");
} else { } else {
@@ -1899,6 +1966,7 @@ public class XMLUtil {
} }
} }
} }
} }
} }
@@ -1914,6 +1982,7 @@ public class XMLUtil {
} }
return error; return error;
} }
// 数据格式+数据正数+数据长度判断 // 数据格式+数据正数+数据长度判断
private Boolean checkNumber(String numberStr, Class<?> targetType, Integer length, Integer decimalLength) { private Boolean checkNumber(String numberStr, Class<?> targetType, Integer length, Integer decimalLength) {
Boolean flag = checkNumber(numberStr, targetType); Boolean flag = checkNumber(numberStr, targetType);
@@ -1926,6 +1995,7 @@ public class XMLUtil {
} }
return true; return true;
} }
// point 验证 // point 验证
private void checkPoint(PointXmlVO pointXmlVO, Boolean error) { private void checkPoint(PointXmlVO pointXmlVO, Boolean error) {
if (StringUtils.isEmpty(pointXmlVO.getPointX())) { if (StringUtils.isEmpty(pointXmlVO.getPointX())) {
@@ -53,6 +53,47 @@ public class XmlTypeRealize {
@Resource @Resource
private IdentifierGenerator identifierGenerator; private IdentifierGenerator identifierGenerator;
// 房间基点坐标转换
public Map<String, Map<String, BasePosition>> bodyBasePositionChange(RoomXmlVOS roomXmlVOS) {
Map<String, Map<String, BasePosition>> roomInfos = new HashMap<>();
if (roomXmlVOS != null && roomXmlVOS.getRoomXmlVOList() != null && roomXmlVOS.getRoomXmlVOList().size() > 0) {
Map<String, BasePosition> 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<String, BasePosition> roomBasePositionChange(RoomXmlVOS roomXmlVOS) {
Map<String, BasePosition> 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<String, Map<String, OrderBodyDO>> bodyInfoChange(RoomXmlVOS roomXmlVOS, Long orderId, Long organId) { public Map<String, Map<String, OrderBodyDO>> bodyInfoChange(RoomXmlVOS roomXmlVOS, Long orderId, Long organId) {
@@ -84,29 +125,6 @@ public class XmlTypeRealize {
return roomInfos; return roomInfos;
} }
// 柜体基点坐标转换
public Map<String, Map<String, BasePosition>> basePositionChange(RoomXmlVOS roomXmlVOS) {
Map<String, Map<String, BasePosition>> roomInfos = new HashMap<>();
if (roomXmlVOS != null && roomXmlVOS.getRoomXmlVOList() != null && roomXmlVOS.getRoomXmlVOList().size() > 0) {
Map<String, BasePosition> 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<String, OrderGroupDO> groupInfoChange(GroupXmlVOS groupXmlVOS, Long orderId, Long organId) { public Map<String, OrderGroupDO> groupInfoChange(GroupXmlVOS groupXmlVOS, Long orderId, Long organId) {
Map<String, OrderGroupDO> groupInfos = new HashMap<>(); Map<String, OrderGroupDO> groupInfos = new HashMap<>();
@@ -143,8 +161,10 @@ public class XmlTypeRealize {
// 房间柜体 // 房间柜体
Map<String, Map<String, OrderBodyDO>> roomInfos = bodyInfoChange(orderXmlVO.getRoomXmlVOS(), orderId, organId); // roomInfos 这个在跟着一起变 Map<String, Map<String, OrderBodyDO>> roomInfos = bodyInfoChange(orderXmlVO.getRoomXmlVOS(), orderId, organId); // roomInfos 这个在跟着一起变
// 房间柜体基点 // 房间基点
Map<String, Map<String, BasePosition>> boxBasePositions = basePositionChange(orderXmlVO.getRoomXmlVOS()); Map<String, BasePosition> roomBasePositions = roomBasePositionChange(orderXmlVO.getRoomXmlVOS());
// 柜体基点
Map<String, Map<String, BasePosition>> boxBasePositions = bodyBasePositionChange(orderXmlVO.getRoomXmlVOS());
// 加工组 // 加工组
Map<String, OrderGroupDO> groupInfos = groupInfoChange(orderXmlVO.getGroupXmlVOS(), orderId, organId); // groupInfos 这个在跟着一起变 Map<String, OrderGroupDO> groupInfos = groupInfoChange(orderXmlVO.getGroupXmlVOS(), orderId, organId); // groupInfos 这个在跟着一起变
@@ -214,7 +234,7 @@ public class XmlTypeRealize {
goodsDOs.add(goodsDO); 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);
} }
} }
@@ -293,6 +313,7 @@ public class XmlTypeRealize {
map.put("groupId", groupId); map.put("groupId", groupId);
return map; return map;
} }
// 配件信息转换 // 配件信息转换
public Map<String, Map<String, Object>> goodsInfoChange(AccessoryXmlVO accessoryXmlVO, AssemblieXmlVOS assemblieXmlVOS, Long orderId, Long organId, public Map<String, Map<String, Object>> goodsInfoChange(AccessoryXmlVO accessoryXmlVO, AssemblieXmlVOS assemblieXmlVOS, Long orderId, Long organId,
Map<String, Map<String, OrderBodyDO>> roomInfos, Map<String, OrderGroupDO> groupInfos) { Map<String, Map<String, OrderBodyDO>> roomInfos, Map<String, OrderGroupDO> groupInfos) {
@@ -305,6 +326,21 @@ public class XmlTypeRealize {
if (accessoryXmlVO != null) { if (accessoryXmlVO != null) {
if (accessoryXmlVO.getEdgingXmlVOS() != null && accessoryXmlVO.getEdgingXmlVOS().getEdgingXmlVOList() != null && accessoryXmlVO.getEdgingXmlVOS().getEdgingXmlVOList().size() > 0) { if (accessoryXmlVO.getEdgingXmlVOS() != null && accessoryXmlVO.getEdgingXmlVOS().getEdgingXmlVOList() != null && accessoryXmlVO.getEdgingXmlVOS().getEdgingXmlVOList().size() > 0) {
EdgingXmlVOS edgingXmlVOS = accessoryXmlVO.getEdgingXmlVOS(); EdgingXmlVOS edgingXmlVOS = accessoryXmlVO.getEdgingXmlVOS();
// 以itemCode为条件进行分组,成map
Map<String, List<EdgingXmlVO>> edgingMap = edgingXmlVOS.getEdgingXmlVOList().stream().collect(Collectors.groupingBy(EdgingXmlVO::getItemCode));
// 遍历map
edgingMap.forEach((key, value) -> {
if (key == null) { // 没有itemCode
Map<String, List<EdgingXmlVO>> 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()) { for (EdgingXmlVO edgingXmlVO : edgingXmlVOS.getEdgingXmlVOList()) {
Map<String, Long> idMap = getId(edgingXmlVO.getRoomCode(), edgingXmlVO.getBoxCode(), roomInfos, edgingXmlVO.getGroupCode(), groupInfos, 0.0, 0.0, orderId, organId); Map<String, Long> idMap = getId(edgingXmlVO.getRoomCode(), edgingXmlVO.getBoxCode(), roomInfos, edgingXmlVO.getGroupCode(), groupInfos, 0.0, 0.0, orderId, organId);
@@ -501,7 +537,7 @@ public class XmlTypeRealize {
public List<Object> plateInfoChange(BlockXmlVOS blockXmlVOS, Long orderId, Long goodsId, Long organId, public List<Object> plateInfoChange(BlockXmlVOS blockXmlVOS, Long orderId, Long goodsId, Long organId,
Map<String, Map<String, OrderBodyDO>> roomInfos, Map<String, OrderGroupDO> groupInfos, Map<String, Map<String, OrderBodyDO>> roomInfos, Map<String, OrderGroupDO> groupInfos,
Map<String, Object> partsMap, Map<String, Object> orderItemMap, List<Object> plateDOs, Map<String, Object> partsMap, Map<String, Object> orderItemMap, List<Object> plateDOs,
Map<String, Map<String, BasePosition>> boxBasePositionMap) { Map<String, Map<String, BasePosition>> boxBasePositionMap, Map<String, BasePosition> roomBasePositions) {
List<Object> plateDetails = new ArrayList<>(); List<Object> plateDetails = new ArrayList<>();
if (blockXmlVOS != null && blockXmlVOS.getBlockXmlVOList() != null && blockXmlVOS.getBlockXmlVOList().size() > 0) { if (blockXmlVOS != null && blockXmlVOS.getBlockXmlVOList() != null && blockXmlVOS.getBlockXmlVOList().size() > 0) {
@@ -514,19 +550,31 @@ public class XmlTypeRealize {
// 开料面积 // 开料面积
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 plateNum = 0.0;
Double unregularNum = 0.0; double unregularNum = 0.0;
if (convertToBoolean(blockXmlVO.getUnregular())) { if (convertToBoolean(blockXmlVO.getUnregular())) {
unregularNum = 1.0; unregularNum = 1.0;
} else { } else {
plateNum = 1.0; plateNum = 1.0;
} }
Map<String, Long> idMap = getId(blockXmlVO.getRoomCode(), blockXmlVO.getBoxCode(), roomInfos, blockXmlVO.getGroupCode(), groupInfos, plateNum, unregularNum, orderId, organId); Map<String, Long> 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"))); // 出错 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() PlateDO plateDO = PlateDO.builder()
.id(plateId) .id(plateId)
.organId(organId) .organId(organId)
@@ -585,6 +633,7 @@ public class XmlTypeRealize {
.plateWidth(plateDO.getWidth()) .plateWidth(plateDO.getWidth())
.plateLength(plateDO.getHeight()) .plateLength(plateDO.getHeight())
.acreage(plateDO.getArea()) .acreage(plateDO.getArea())
.roomBasePosition(roomBasePoint)
.bodyBasePosition(boxBasePoint) .bodyBasePosition(boxBasePoint)
.plateBasePosition(plateBasePosition) .plateBasePosition(plateBasePosition)
.splitLength(BigDecimal.valueOf(Long.parseLong(blockXmlVO.getCuttingLength()))) .splitLength(BigDecimal.valueOf(Long.parseLong(blockXmlVO.getCuttingLength())))
@@ -73,9 +73,6 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
PlateDO selectOneById(@Param("id") Long id, @Param("organId") Long organId); PlateDO selectOneById(@Param("id") Long id, @Param("organId") Long organId);
default Boolean isByGoodID(String goodId , Long organId) { default Boolean isByGoodID(String goodId , Long organId) {
if (selectOne(PlateDO::getGoodsId, goodId, PlateDO::getOrganId, organId) != null) { return selectList(PlateDO::getGoodsId, goodId, PlateDO::getOrganId, organId).size() > 0;
return true;
}
return false;
} }
} }
@@ -75,7 +75,7 @@ public class PlateServiceImpl implements PlateService {
getOrganId(BASE_PLATE_UPDATE_PERMISSION, getLoginUser().getId(), updateReqVO.getOrganId())); getOrganId(BASE_PLATE_UPDATE_PERMISSION, getLoginUser().getId(), updateReqVO.getOrganId()));
PlateDO updateObj = BeanUtils.toBean(updateReqVO, PlateDO.class); PlateDO updateObj = BeanUtils.toBean(updateReqVO, PlateDO.class);
// 校验板材goods_id是否相同 // 校验板材goods_id是否相同
if (!plateMapper.isByGoodID(updateReqVO.getGoodsId(), getLoginUser().getId())) { if (plateMapper.isByGoodID(updateReqVO.getGoodsId(), getLoginUser().getId())) {
throw exception(PLATE_GOODS_ID_NOT_SAME); throw exception(PLATE_GOODS_ID_NOT_SAME);
} }
plateMapper.updateById(updateObj); plateMapper.updateById(updateObj);
@@ -14,16 +14,16 @@ class MachineServiceImplTest {
@Resource @Resource
private MachineService machineService; private MachineService machineService;
@Test // @Test
void create() { // void create() {
OrganContextHolder.setOrganId(1L); // OrganContextHolder.setOrganId(1L);
for (int i = 0; i < 20; i++) { // for (int i = 0; i < 20; i++) {
CuttingSaveReqVO saveReqVO = randomPojo(CuttingSaveReqVO.class); // CuttingSaveReqVO saveReqVO = randomPojo(CuttingSaveReqVO.class);
saveReqVO.setId(null); // saveReqVO.setId(null);
Long aLong = machineService.createCutting(saveReqVO); // Long aLong = machineService.createCutting(saveReqVO);
} // }
//
} // }
@Test @Test
void update() { void update() {