diff --git a/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java b/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java index 219ad5f2a..85484dc04 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java +++ b/cf-module-prod-executor/cf-module-prod-executor-api/src/main/java/com/cf/imes/module/executor/enums/ErrorCodeConstants.java @@ -44,9 +44,13 @@ public interface ErrorCodeConstants { ErrorCode CUSTOM_ORDER_EXISTS = new ErrorCode(1_001_117_000, "自定义生产单号存在"); ErrorCode SALESMAN_ORDER_NOT_EXISTS = new ErrorCode(1_001_118_000, "业务员不存在"); ErrorCode SPLITTER_ORDER_NOT_EXISTS = new ErrorCode(1_001_119_000, "拆单员不存在"); - ErrorCode ORDER_PROCESS_NOT_EXISTS = new ErrorCode(1_001_119_000, "工序组不存在"); - ErrorCode ORDER_PROCESS_EXISTS = new ErrorCode(1_001_119_000, "该生产单工序组已经存在"); - ErrorCode PROCESS_GROUP_NOT_EXISTS = new ErrorCode(1_002_029_000, "工序组不存在"); - ErrorCode ORDER_BODY_NOT_EXISTS = new ErrorCode(1_002_029_000, "此生产单中柜体并不存在不存在"); - ErrorCode RAW_GOODS_NOT_EXISTS = new ErrorCode(1_002_029_000, "生产单中未用到此板材"); + ErrorCode ORDER_PROCESS_NOT_EXISTS = new ErrorCode(1_001_119_001, "工序组不存在"); + ErrorCode ORDER_PROCESS_EXISTS = new ErrorCode(1_001_119_002, "该生产单工序组已经存在"); + ErrorCode PROCESS_GROUP_NOT_EXISTS = new ErrorCode(1_002_029_003, "工序组不存在"); + ErrorCode ORDER_BODY_NOT_EXISTS = new ErrorCode(1_002_029_004, "此生产单中柜体并不存在不存在"); + ErrorCode RAW_GOODS_NOT_EXISTS = new ErrorCode(1_002_029_005, "生产单中未用到此板材"); + ErrorCode ORDER_STATUS_ERROR = new ErrorCode(1_002_029_006, "生产单不允许删除"); + ErrorCode APP_TOKEN_ERROR = new ErrorCode(1_002_029_006, "token获取失败"); + ErrorCode PLATE_DATA_ERROR = new ErrorCode(1_002_029_006, "板材数据获取错误"); + ErrorCode PARTS_DATA_ERROR = new ErrorCode(1_002_029_006, "配件数据获取错误"); } 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 c0798e2e1..9a874f920 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 @@ -2,17 +2,12 @@ package com.cf.imes.module.executor.controller.admin.order; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONObject; -import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderImportRespVO; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPageReqVO; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO; import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderSaveReqVO; import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO; import com.cf.imes.module.executor.dal.dataobject.orderModuleExtra.OrderModuleExtraDO; import com.cf.imes.module.executor.service.order.ApiOrderService; -import com.cf.imes.module.executor.service.order.OrderInputProcessor; -import com.cf.imes.module.executor.util.FileTypeChangeUtil; -import com.cf.imes.module.executor.util.deviseData.Detail; -import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO; import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.PlateImportVO; import io.swagger.v3.oas.annotations.Parameters; import org.springframework.util.ResourceUtils; @@ -107,14 +102,14 @@ public class OrderController { } // 获取当前条件下所有生产单信息 - @GetMapping("/allOrder") - @Operation(summary = "获得所有生产单") - @PreAuthorize("@ss.hasPermission('executor:order:query')") - public CommonResult> getAllOrder(@Valid OrderPageReqVO pageReqVO) { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - PageResult pageResult = orderService.getOrderPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, OrderRespVO.class)); - } +// @GetMapping("/allOrder") +// @Operation(summary = "获得所有生产单") +// @PreAuthorize("@ss.hasPermission('executor:order:query')") +// public CommonResult> getAllOrder(@Valid OrderPageReqVO pageReqVO) { +// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); +// PageResult pageResult = orderService.getOrderPage(pageReqVO); +// return success(BeanUtils.toBean(pageResult, OrderRespVO.class)); +// } @GetMapping("/page") @Operation(summary = "获得生产单分页") @@ -164,64 +159,6 @@ public class OrderController { } } -// @PostMapping("/import") -// @Operation(summary = "导入生产单新增") -// @Parameters({ -// @Parameter(name = "file", description = "Excel 文件", required = true), -// @Parameter(name = "isAddPlate", description = "是否为生产单新增板材", example = "false"), -// @Parameter(name = "upload", description = "是 更新、否 新建", example = "false"), -// @Parameter(name = "orderSaveReqVO", description = "生产单新增参数", required = true) -// }) -// @PreAuthorize("@ss.hasPermission('executor:order:import')") -// public CommonResult> importExcel(@RequestPart("file") MultipartFile file, -// @RequestParam(value = "isAddPlate", required = false, defaultValue = "false") Boolean isAddPlate, -// @RequestParam(value = "upload", required = false, defaultValue = "false") Boolean upload, -// @RequestPart("orderSaveReqVO") OrderSaveReqVO createReqVO) throws IOException { -// Map map = new HashMap<>(); -//// 判断是否更新板材 -// if (!isAddPlate) {//不需要添加板材 -// if (upload) { -// orderService.updateOrder(createReqVO);//更新 -// map.put(true, "单独更新生产单成功"); -// } else { -// Long id = orderService.createOrder(createReqVO);//新建 -// map.put(true, "单独新增生产单成功"); -// } -// return success(map); -// } else { -// Long id = 0L; -// if (upload) { -// orderService.updateOrder(createReqVO);//更新 -// id = createReqVO.getId(); -// map.put(true, "单独更新生产单成功"); -// } else { -// id = orderService.createOrder(createReqVO);//新建 -// map.put(true, "单独新增生产单成功"); -// } -//// 解析导入文件,生成统一格式 -// List list = new ArrayList<>(); -// if (createReqVO.getDataType() == 1) {//CAD -// -// } else if (createReqVO.getDataType() == 2) {//WebCAD -// -// } else if (createReqVO.getDataType() == 3) {//Excel -//// 文件数据读取 -// list = fileTypeChangeUtil.fileDataChange(file); -// } -// if (list == null || list.size() == 0) { -// map.put(false, "导入文件有误"); -// return success(map); -// } -//// OrderImportRespVO respVO = orderService.importOrderList(list , id , orderImportRespVO); -// orderInputProcessor.input((List) list, id); -//// 是否新增成功需要返回 -// map.putIfAbsent(true, "文件导入成功"); -// return success(map); -// -// } -// } - - // 导出错误的excel // @PostMapping("/import-excel") // @Operation(summary = "生产单导入新增") @@ -333,41 +270,13 @@ public class OrderController { return success(BeanUtils.toBean(orderService.getBody(orderId), OrderBodyRespVO.class)); } -// @PostMapping("file-import") -// @Operation(summary = "文件上传接口--完善中") -// @Parameters({ -// @Parameter(name = "file", description = "文件", required = false), -// @Parameter(name = "isAddPlate", description = "是否为生产单新增板材", example = "false"), -// @Parameter(name = "upload", description = "是 更新、否 新建", example = "false"), -// @Parameter(name = "orderSaveReqVO", description = "生产单新增参数", required = true), -// @Parameter(name = "type", description = "文件类型", required = true) -// }) -// @PreAuthorize("@ss.hasPermission('executor:fileData:import')") -// public CommonResult apiImport(@RequestPart(value = "file", required = false) MultipartFile file, -// @RequestParam(value = "isAddPlate", required = false, defaultValue = "false") Boolean isAddPlate, -// @RequestParam(value = "upload", required = false, defaultValue = "false") Boolean upload, -// @RequestPart("orderSaveReqVO") OrderSaveReqVO createReqVO, -// @RequestParam(value = "type", required = false, defaultValue = "cf_cad") String type, -// final HttpServletResponse respons) throws IOException { -// -// OrderImportRespVO orderImportRespVO = OrderImportRespVO.builder().createOrder(new ArrayList<>()) -// .updateOrder(new ArrayList<>()).failureOrder(new LinkedHashMap<>()).build(); -// -//// 数据格式转换,返回转换完成的数据(传入文件类型,和文件类容),判断需要使用那种解析之后,进行数据的转换 -// List list = fileTypeChangeUtil.chooseType(file, type); -// if (fileTypeChangeUtil.getFlag()) {//文件数据转换成功,进行数据填入 -// -// } -// -// return success(orderImportRespVO); -// } - - // 测试接口 - @GetMapping("getTest") - @Operation(summary = "测试接口(忽略)") - @PreAuthorize("@ss.hasPermission('executor:order:query')") + @GetMapping("getApiData") + @Operation(summary = "api数据获取") + @PreAuthorize("@ss.hasPermission('executor:order:getApiData')") public CommonResult test(@RequestParam(value = "orderNo", required = false, defaultValue = "20230809027818") String orderNo) { + +// orderService.importApiData(orderNo); // 获取token JSONObject json = apiOrderService.getApiTokenMessage("CF7526AD51", "5f467b508061eff60bdacc7230357d2f"); // 判断获取token是否成功 @@ -378,8 +287,21 @@ public class OrderController { jsonObject.put("order_no", orderNo);//生产单号需要传入赋值 jsonObject.put("format", "json"); + JSONObject partsObject = new JSONObject(); + partsObject.put("curr_page", 1);//生产单号需要传入赋值 + partsObject.put("page_count", "100"); + partsObject.put("order_no", orderNo); // 数据解析 JSONObject data = apiOrderService.getApiOrderMessage(token, jsonObject); + JSONObject parts = apiOrderService.getApiOrderPartsMessage(token, partsObject); +// if (parts.getString("err_code").equals("0")) { +// System.out.println("获取数据成功"); +// String value = parts.getString("value"); +// System.out.println("value " + parts.getString("value") ); +//// System.out.println("list " + toListMap(value)); +//// 数据格式进行转换 +// System.out.println("order " + value.substring(1, value.length() - 1)); +// } if (data.getString("err_code").equals("0")) { System.out.println("获取数据成功"); String value = data.getString("value"); @@ -387,6 +309,8 @@ public class OrderController { // System.out.println("list " + toListMap(value)); // 数据格式进行转换 System.out.println("order " + value.substring(1, value.length() - 1)); + }else { + System.out.println("获取数据shibai"); } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPageReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPageReqVO.java index a6a4cf1c8..ab2a00b9c 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPageReqVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderPageReqVO.java @@ -22,15 +22,19 @@ public class OrderPageReqVO extends PageParam { @Schema(description = "父单号") private Long parentNo; + @Schema(description = "生产单日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] orderDate; + @Schema(description = "交付日期") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] deliveryDate; @Schema(description = "生产单类型,1主单 2子单", example = "1") - private Boolean type; + private Boolean orderType; @Schema(description = "生产单排序号") - private Integer sort; + private Integer orderSort; @Schema(description = "CAD数据类型,1CAD 2WebCAD 3Excel", example = "1") private Integer dataType; diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderRespVO.java index c1ed8644b..c9223cc73 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderRespVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderRespVO.java @@ -19,17 +19,21 @@ public class OrderRespVO { @ExcelProperty("父单号") private Long parentNo; + @Schema(description = "生产单日期", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("交付日期") + private LocalDateTime orderDate; + @Schema(description = "交付日期", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("交付日期") private LocalDateTime deliveryDate; @Schema(description = "生产单类型,1主单 2子单", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("生产单类型,1主单 2子单") - private Boolean type; + private Boolean orderType; @Schema(description = "生产单排序号", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("生产单排序号") - private Integer sort; + private Integer orderSort; @Schema(description = "CAD数据类型,1CAD 2WebCAD 3Excel", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("CAD数据类型,1CAD 2WebCAD 3Excel") diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderSaveReqVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderSaveReqVO.java index affb9f142..ef7933636 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderSaveReqVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/order/vo/order/OrderSaveReqVO.java @@ -19,17 +19,21 @@ public class OrderSaveReqVO { @NotNull(message = "父单号不能为空,无父单时为0") private Long parentNo; + @Schema(description = "生产单日期", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "交付日期不能为空") + private LocalDateTime orderDate; + @Schema(description = "交付日期", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "交付日期不能为空") private LocalDateTime deliveryDate; @Schema(description = "生产单类型,1主单 2子单", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "生产单类型,1主单 2子单不能为空") - private Boolean type; + private Boolean orderType; @Schema(description = "生产单排序号", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "生产单排序号不能为空") - private Integer sort; + private Integer orderSort; @Schema(description = "CAD数据类型,1CAD 2WebCAD 3Excel", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "CAD数据类型,1CAD 2WebCAD 3Excel不能为空") diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/order/OrderDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/order/OrderDO.java index 7727b4297..28dc7f51d 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/order/OrderDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/order/OrderDO.java @@ -33,6 +33,10 @@ public class OrderDO extends OrganBaseDO { * 父单号 */ private Long parentNo; + /** + * 生产单日期 + */ + private LocalDateTime orderDate; /** * 交付日期 */ @@ -40,11 +44,11 @@ public class OrderDO extends OrganBaseDO { /** * 生产单类型,1主单 2子单 */ - private Boolean type; + private Boolean orderType; /** * 生产单排序号 */ - private Integer sort; + private Integer orderSort; /** * CAD数据类型,1CAD 2WebCAD 3Excel */ diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java index 574a050e7..ca3a65e4f 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java @@ -29,8 +29,9 @@ public interface OrderMapper extends BaseMapperX { return selectPage(reqVO, new LambdaQueryWrapperX() .eqIfPresent(OrderDO::getParentNo, reqVO.getParentNo()) .betweenIfPresent(OrderDO::getDeliveryDate, reqVO.getDeliveryDate()) - .eqIfPresent(OrderDO::getType, reqVO.getType()) - .eqIfPresent(OrderDO::getSort, reqVO.getSort()) + .betweenIfPresent(OrderDO::getOrderDate, reqVO.getOrderDate()) + .eqIfPresent(OrderDO::getOrderType, reqVO.getOrderType()) + .eqIfPresent(OrderDO::getOrderSort, reqVO.getOrderSort()) .eqIfPresent(OrderDO::getDataType, reqVO.getDataType()) .eqIfPresent(OrderDO::getStatus, reqVO.getStatus()) .eqIfPresent(OrderDO::getCustomOrderNo, reqVO.getCustomOrderNo()) @@ -53,8 +54,8 @@ public interface OrderMapper extends BaseMapperX { default List selectOrderCheck(OrderPageReqVO reqVO) { MPJLambdaWrapper wrapper = new MPJLambdaWrapper() .eqIfExists(OrderDO::getParentNo, reqVO.getParentNo()) - .eqIfExists(OrderDO::getType, reqVO.getType()) - .eqIfExists(OrderDO::getSort, reqVO.getSort()) + .eqIfExists(OrderDO::getOrderType, reqVO.getOrderType()) + .eqIfExists(OrderDO::getOrderSort, reqVO.getOrderSort()) .eqIfExists(OrderDO::getDataType, reqVO.getDataType()) .eqIfExists(OrderDO::getStatus, reqVO.getStatus()) .eqIfExists(OrderDO::getCustomOrderNo, reqVO.getCustomOrderNo()) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/framework/rpc/config/RpcConfiguration.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/framework/rpc/config/RpcConfiguration.java index f5a2442d7..520d0cae3 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/framework/rpc/config/RpcConfiguration.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/framework/rpc/config/RpcConfiguration.java @@ -1,6 +1,7 @@ package com.cf.imes.module.executor.framework.rpc.config; import com.cf.imes.module.infra.api.file.FileApi; +import com.cf.imes.module.system.api.application.ApplicationApi; import com.cf.imes.module.system.api.dataSource.DataSourceApi; import com.cf.imes.module.system.api.machine.MachineApi; import com.cf.imes.module.system.api.process.ProcessGroupApi; @@ -14,6 +15,6 @@ import org.springframework.context.annotation.Configuration; */ @Configuration(proxyBeanMethods = false) @EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class, DictDataApi.class, - FileApi.class, ProcessGroupApi.class, FileApi.class, DataSourceApi.class}) + FileApi.class, ProcessGroupApi.class, FileApi.class, DataSourceApi.class, ApplicationApi.class}) public class RpcConfiguration { } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/ApiOrderService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/ApiOrderService.java index 2e1fbd12e..a9c05c88c 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/ApiOrderService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/ApiOrderService.java @@ -14,4 +14,7 @@ public interface ApiOrderService { @RequestMapping(value = "/Api-erpOrders-orderPlanData",method = RequestMethod.POST) JSONObject getApiOrderMessage(@RequestParam("token") String token, @RequestBody JSONObject json); + + @RequestMapping(value = "/Api-erpOrders-partsList",method = RequestMethod.POST) + JSONObject getApiOrderPartsMessage(@RequestParam("token") String token, @RequestBody JSONObject json); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderService.java index fc8fe6ce1..c90e9a59b 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderService.java @@ -113,4 +113,11 @@ public interface OrderService { */ List getBody(Long orderId); + /** + * @param orderNo:生产单号 + * @return Boolean + * @author Administrator + * @date 2024/3/30 + */ + Boolean importApiData(String orderNo); } \ No newline at end of file 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 936c5d56f..d4f04e6dd 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 @@ -1,5 +1,7 @@ package com.cf.imes.module.executor.service.order; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import cn.smallbun.screw.core.util.CollectionUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator; @@ -23,6 +25,10 @@ import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper; import com.cf.imes.module.executor.dal.mysql.rawgoods.RawGoodsMapper; import com.cf.imes.module.executor.util.FileTypeChangeUtil; import com.cf.imes.module.executor.util.deviseData.Detail; +import com.cf.imes.module.executor.util.deviseData.dataTwo.PlateDetail; +import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiTypeChangeRealize; +import com.cf.imes.module.system.api.application.ApplicationApi; +import com.cf.imes.module.system.api.organ.OrganApi; import com.cf.imes.module.system.api.user.AdminUserApi; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -96,10 +102,18 @@ public class OrderServiceImpl implements OrderService { private OrderModuleExtraMapper orderModuleExtraMapper; @Resource - private FileTypeChangeUtil fileTypeChangeUtil; + private ApiTypeChangeRealize apiTypeChangeRealize; + + @Resource + private ApplicationApi applicationApi; + + @Resource + private ApiOrderService apiOrderService; private static final int DEFAULT_DAYS_TO_ADD = 30; + private static final int PARTS_PAGE_MAX = 1000; + @Override public Long createOrder(OrderSaveReqVO createReqVO) { //校验手机号是否合法 @@ -344,6 +358,10 @@ public class OrderServiceImpl implements OrderService { @Override public void deleteBodyByOrder(Long orderId, Collection bodyIds) { validateOrderExists(orderId); +// 校验生产单的状态 1 为新单状态,才可以修改 + if (orderMapper.selectOne(new LambdaQueryWrapper().eq(OrderDO::getId, orderId).eq(OrderDO::getStatus, 1)).getStatus() == 1) { + throw exception(ORDER_STATUS_ERROR); + } if (CollectionUtils.isNotEmpty(bodyIds)) { bodyIds.forEach(bodyId -> { // 校验存在 @@ -359,13 +377,78 @@ public class OrderServiceImpl implements OrderService { return orderBodyMapper.selectList(new LambdaQueryWrapper().eq(OrderBodyDO::getOrderId, orderId)); } + @Override + public Boolean importApiData(String orderNo) { +// 获取token + Long organId = SecurityFrameworkUtils.getLoginUser().getOrganId(); + JSONObject app = applicationApi.getApplicationByOrganId(organId); + String appId = app.getString("appId"); + String appSecret = app.getString("appSecret"); + + JSONObject json = apiOrderService.getApiTokenMessage(appId, appSecret); + System.out.println("json " + json); + if (!json.getString("err_msg").equals("success")) { + throw exception(APP_TOKEN_ERROR); + } + String token = json.getJSONObject("info").getString("access_token"); +// 获取生产信息 + JSONObject jsonPlates = new JSONObject(); + jsonPlates.put("order_no", orderNo);//生产单号需要传入赋值 + jsonPlates.put("format", "json"); + JSONObject dataPlates = apiOrderService.getApiOrderMessage(token, jsonPlates); + System.out.println(dataPlates); + if (!dataPlates.getString("err_code").equals("0")) { + throw exception(PLATE_DATA_ERROR); + } +// 获取配件信息 + JSONObject jsonParts = new JSONObject(); + jsonParts.put("curr_page", 1); + jsonParts.put("page_count", PARTS_PAGE_MAX); + jsonParts.put("order_no", orderNo); + JSONObject parts = apiOrderService.getApiOrderPartsMessage(token, jsonParts); + if (!dataPlates.getString("err_code").equals("0")) { + throw exception(PARTS_DATA_ERROR); + } + JSONObject dataParts = new JSONObject(); + for (int i = 1; i <= parts.getJSONObject("value").getInteger("PageCount"); i++) { + jsonParts.put("curr_page", i); + JSONObject value = apiOrderService.getApiOrderPartsMessage(token, jsonParts).getJSONObject("value"); + mergeJSONObjects(dataParts, value); + } +// 转换 + List plateDetails = (List) apiTypeChangeRealize.apiPlateDataChange(dataPlates,dataParts); + System.out.println(plateDetails); + return null; + } + + // 合并两个 JSON 对象的方法 + public JSONObject mergeJSONObjects(JSONObject object1, JSONObject object2) { + JSONObject mergedObject = new JSONObject(); + + // 获取第一个 JSON 对象中 "name" 的值 + Object value1 = object1.get("List"); + + // 获取第二个 JSON 对象中 "name" 的值 + Object value2 = object2.get("List"); + + // 创建一个 JSON 数组,将两个值添加进去 + JSONArray array = new JSONArray(); + array.add(value1); + array.add(value2); + + // 将数组作为值设置到合并后的 JSON 对象中 + mergedObject.put("List", array); + + return mergedObject; + } + private void validateOrderBodyExists(Long orderId, Long bodyId) { if (orderBodyMapper.selectCount(new LambdaQueryWrapper().eq(OrderBodyDO::getOrderId, orderId).eq(OrderBodyDO::getId, bodyId)) == 0) { throw exception(ORDER_BODY_NOT_EXISTS); } } -// 对数据进行分类 + // 对数据进行分类 private HashMap> classifyGoods(List list) { HashMap> map = new HashMap<>(); List plateLists = new ArrayList<>(); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/FileTypeChangeUtil.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/FileTypeChangeUtil.java index fc37dd787..478ff73bd 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/FileTypeChangeUtil.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/FileTypeChangeUtil.java @@ -1,8 +1,5 @@ package com.cf.imes.module.executor.util; -import com.cf.imes.module.executor.util.deviseData.Detail; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; @@ -11,19 +8,19 @@ import java.util.List; /** * 生产单新增传入文件格式转换工具 */ -public interface FileTypeChangeUtil { -// 文件数据格式转换 +public interface FileTypeChangeUtil { + // 文件数据格式转换 List fileDataChange(MultipartFile file) throws IOException; -// Api数据格式转换 + // Api数据格式转换 -// ds数据转换 + // ds数据转换 -// 数据转换成功判断 + // 数据转换成功判断 boolean getFlag(); -// 根据文件类型判断使用那种方式进行数据转换 - default List chooseType(MultipartFile file,String type) throws IOException { + // 根据文件类型判断使用那种方式进行数据转换 + default List chooseType(MultipartFile file, String type) throws IOException { if (type.equals("cf_cad")) return fileDataChange(file); return null; diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/DrillsInfo.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/DrillsInfo.java index 51db1ffdf..f0774c479 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/DrillsInfo.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/DrillsInfo.java @@ -16,9 +16,9 @@ public class DrillsInfo { private String name; // 排钻名称 - private String type; // 排钻类型 + private String type; // 排钻类型名称 - private String face; // 排钻朝向 + private String face; // 排钻朝向名称 private Double count; // 排钻数量 } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/HoleDetail.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/HoleDetail.java index e24006fc9..5d8db41bc 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/HoleDetail.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/HoleDetail.java @@ -14,10 +14,12 @@ import lombok.NoArgsConstructor; @NoArgsConstructor public class HoleDetail { - private String faceType; // 打孔面(0正面, 1反面, 2侧面) - private String holeType;// 孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔) private String holeName;// 孔名称,用于类型相同的孔,进行分组区分,一组的孔名称相同 + private Integer faceType; // 打孔面(0正面, 1反面, 2侧面) + private Integer holeType;// 孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔) + + // 孔的起点坐标 private Double startX; private Double startY; @@ -31,6 +33,6 @@ public class HoleDetail { private Double endY; private Double endZ; - private Double angle; //角度 + private Double depth; // 深度 } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/ModelDetail.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/ModelDetail.java index f91cecd88..7ebf2b101 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/ModelDetail.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/ModelDetail.java @@ -17,12 +17,13 @@ import java.util.List; @NoArgsConstructor public class ModelDetail { - private Double depth; //造型深度 - private Integer faceType; //使用字典进行解析 造型排版面 0正面, 1反面, 2侧面 + private Double depth; //造型深度 + + private String knifeName; //造像使用刀具名称 - private float knifeRadius; //刀半径 + private Double knifeRadius; //刀半径 private IOriginModelingData originModeling;//造型数据 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/OffSetList.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/OffSetList.java index f9b8e73b8..868cc82d7 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/OffSetList.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/OffSetList.java @@ -19,13 +19,13 @@ import lombok.experimental.Accessors; public class OffSetList { // 刀路的偏移值 - private float value; // 刀路的偏倚值 - private float deep;//下刀的深度 - private float angle;//角度 + private Double value; // 刀路的偏倚值 + private Double depth;//下刀的深度 + private Double angle;//角度 // 二维刀路的属性 private String name; //刀的名称 - private float radius;//刀的半径 + private Double radius;//刀的半径 private String faceType;// 面向类型(0正面, 1反面, 2侧面) } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PartsInfo.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PartsInfo.java index f543f3fc3..5f8c82b0e 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PartsInfo.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PartsInfo.java @@ -14,19 +14,22 @@ import lombok.NoArgsConstructor; @NoArgsConstructor public class PartsInfo { -// 配件所属信息 - private String roomsName; //房间名称 - private String bodyName; //柜体名 + private String id; // 配件标识 + private String name; // 配件名称 - // 柜体成倍拆单的倍数 + +// 配件所属信息 + private String roomName; //房间名称 + private String bodyName; //柜体名 + private String bodyNo; // 柜体编号 + + +// 柜体成倍拆单的倍数 private Integer multiNum; // 商品信息 - private String goodsName; //商品名称 private String goodsNo; // 商品编码 - private Long goodId; // 商品id - - + private Long goodId; // 商品对应标识 private String material; //材质 private String color; //颜色 private String factory; //商品生产厂商 @@ -34,10 +37,16 @@ public class PartsInfo { private String model; //商品型号 private String spec; //商品规格 private String unit; //商品单位 + private Double price; // 配件价格 + + private Boolean isComposite; // 是否为配件 + private String groupName; // 组件名称 + private String objectType; // 五金类型 + private String objectSpecExtras; // 五金额外规格 + private String partsSpec; // 配件属性 + private String doorRemark; // 门板组件铰链备注 + private String hingeRemark; // 门板组件拉手备注 - private Boolean isComposite; // 是否为复合配件 - private String groupName; // - private String objectType; private Double goodsNumber; //产品数量为特殊处理,板件和配件都有数量 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PlateDetail.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PlateDetail.java index 517581718..8b3bd1b39 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PlateDetail.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PlateDetail.java @@ -23,9 +23,16 @@ public class PlateDetail { // 自定义板号 private String customPlateNo; + private Integer texture; //纹路 纹路(0正纹1可翻转2反纹) + private Integer typographicFace; //排版面 排钻类型(0正面1反面2随意面) + private Integer openDoorType; //开门类型 0非门板,1左开,2右开,3上翻,4下翻 字典转换 + private String boardType; // 小板类型 + + // 板件所属信息 private String roomsName; //房间名称 private String bodyName; //柜体名 + private String bodyNo; // 柜体号 // 柜体成倍拆单的倍数 private Integer multiNum; @@ -54,9 +61,6 @@ public class PlateDetail { private Double sealUp; private Double sealDown; - private Integer texture; //纹路 纹路(0正纹1可翻转2反纹) - private Integer typographicFace; //排版面 排钻类型(0正面1反面2随意面) - private Integer openDoorType; //开门类型 0非门板,1左开,2右开,3上翻,4下翻 字典转换 // 偏移量 private Double offsetX; @@ -69,6 +73,11 @@ public class PlateDetail { // 排钻类型 private List drillsInfos; + private Double throughHoleCount; // 挖孔的孔数 + private Double throughModelCount; // 挖穿的造型数 + + private Boolean has2DModel; // 是否有二维刀路 + private Boolean has3DModel; // 是否有三维刀路 // 轮廓数据、造型数据 private List pointDetail ; //点明细,表示小板外围轮廓的几个转折点(不含封边) @@ -78,7 +87,6 @@ public class PlateDetail { private List contourDetail ; //造型明细 private List sideHoleDetail;//侧面孔明细 - private List sideModelDetail ; //侧面造型明细 // 备注 private Map remark;// 板件备注 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PointList.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PointList.java index ce059ce0f..362909cdf 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PointList.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/deviseData/dataTwo/PointList.java @@ -22,9 +22,10 @@ public class PointList { // 点的位置信息 private Double pointX; private Double pointY; + private Double pointZ; private Double radius; - private float curve; // 曲线 - private float depth; //曲线深度 + private Double curve; // 曲线 + private Double depth; //曲线深度 } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeChangeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeChangeRealize.java index 9f289f7f7..47fccdd28 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeChangeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeChangeRealize.java @@ -1,69 +1,63 @@ package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cf.imes.module.executor.dal.dataobject.order.OrderDO; -import com.cf.imes.module.executor.util.FileTypeChangeUtil; -import com.cf.imes.module.executor.util.deviseData.dataTwo.Group; -import com.cf.imes.module.executor.util.deviseData.dataTwo.HoleDetail; -import com.cf.imes.module.executor.util.deviseData.dataTwo.PlateDetail; -import com.cf.imes.module.executor.util.deviseData.dataTwo.PointDetail; -import org.apache.poi.ss.formula.functions.T; -import org.springframework.web.multipart.MultipartFile; +import com.cf.imes.module.executor.util.deviseData.dataTwo.*; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; -import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; + /** * 实现数据格式转换 */ -public class ApiTypeChangeRealize implements FileTypeChangeUtil { +@Service +@Validated +public class ApiTypeChangeRealize{ + public List apiPlateDataChange(JSONObject dataPlates, JSONObject dataParts){ - @Override - public List fileDataChange(MultipartFile file) throws IOException { - return null; +// 配件数据分类 + List partsInfos = partsInfoChange(dataParts); + Map> partsMap = partsInfos.stream() + .collect(Collectors.groupingBy( + partsInfo -> partsInfo.getBodyNo() != null ? partsInfo.getBodyNo() : " ", + Collectors.toList() + )); + +// 放入板材 + List plateDetails = platesInfoChange(dataPlates); + for (PlateDetail plateDetail : plateDetails) { + if (partsMap.get(plateDetail.getBodyNo()) != null){ + plateDetail.setPartsInfos(partsMap.get(plateDetail.getBodyNo())); + } + } + return plateDetails; } - - public List fileDataChange(String data) throws IOException { - - return null; - } - - @Override - public boolean getFlag() { - return false; - } - - public static void main(String[] args) { - - String jsonData = "{\"Orders\":[{\"OrderNo\":20240423031255,\"CustomOrderNo\":\"\",\"CustomNo\":1538,\"CustomName\":\"sqy_cf\",\"SalePerson\":\"sqy_cf\",\"SaleDate\":\"2024-04-23\",\"DeliveryDate\":\"2024-05-13\",\"Consigee\":\"sasa\",\"ConsigeePhone\":\"11111111111\",\"ConsigeeAddress\":\"dswd\",\"Remark\":\"\",\"Materials\":[{\"Name\":\"F-A330铁力木(颗粒板)\",\"GoodsID\":517,\"GoodsSN\":\"\",\"Specification\":\"2440*1220*18\",\"Material\":\"颗粒板\",\"Color\":\"F-A330铁力木\",\"Thickness\":18,\"Width\":1220,\"Length\":2440,\"WaveFlag\":true,\"Blocks\":[{\"BlockNo\":2404003442164,\"RoomName\":\"主卧\",\"BoxNo\":\"\",\"BoxName\":\"下柜\",\"BlockID\":4289996,\"CustomNo\":\"\",\"BlockName\":\"右侧板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"预埋件\",\"face\":\"反面\",\"count\":2},{\"name\":\"木销\",\"type\":\"预埋件\",\"face\":\"反面\",\"count\":2}],\"extra\":{\"boardType\":\"立板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"600\",\"Length\":\"2000\",\"Size\":\"1.2\",\"CuttingWidth\":\"598\",\"CuttingLength\":\"1998\",\"CuttingSize\":\"1.195\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"49\",\"Y\":\"999\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"549\",\"Y\":\"999\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"81\",\"Y\":\"999\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"517\",\"Y\":\"999\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[]},{\"BlockNo\":2404003442163,\"RoomName\":\"主卧\",\"BoxNo\":\"\",\"BoxName\":\"下柜\",\"BlockID\":4289995,\"CustomNo\":\"\",\"BlockName\":\"左侧板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"预埋件\",\"face\":\"正面\",\"count\":2},{\"name\":\"木销\",\"type\":\"预埋件\",\"face\":\"正面\",\"count\":2}],\"extra\":{\"boardType\":\"立板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"600\",\"Length\":\"2000\",\"Size\":\"1.2\",\"CuttingWidth\":\"598\",\"CuttingLength\":\"1998\",\"CuttingSize\":\"1.195\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"49\",\"Y\":\"999\",\"Face\":0,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"549\",\"Y\":\"999\",\"Face\":0,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"81\",\"Y\":\"999\",\"Face\":0,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"517\",\"Y\":\"999\",\"Face\":0,\"Diameter\":\"8\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[]},{\"BlockNo\":2404003442162,\"RoomName\":\"主卧\",\"BoxNo\":\"\",\"BoxName\":\"下柜\",\"BlockID\":4289994,\"CustomNo\":\"\",\"BlockName\":\"层板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"反面\",\"count\":4},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"下侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"下侧面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"上侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"上侧面\",\"count\":2}],\"extra\":{\"boardType\":\"层板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"600\",\"Length\":\"1164\",\"Size\":\"0.698\",\"CuttingWidth\":\"598.2\",\"CuttingLength\":\"1162.8\",\"CuttingSize\":\"0.696\",\"BorderLeft\":1.2,\"BorderRight\":0.6,\"BorderUpper\":0.6,\"BorderUnder\":0.6,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1.2\",\"OffsetY\":\"0.6\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"48.8\",\"Y\":\"1129.4\",\"Face\":1,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"548.8\",\"Y\":\"1129.4\",\"Face\":1,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"48.8\",\"Y\":\"33.4\",\"Face\":1,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"548.8\",\"Y\":\"33.4\",\"Face\":1,\"Diameter\":\"15\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[{\"StartPoint\":\"50,1164,-9\",\"EndPoint\":\"50,1130,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":1},{\"StartPoint\":\"550,1164,-9\",\"EndPoint\":\"550,1130,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":1},{\"StartPoint\":\"82,1164,-9\",\"EndPoint\":\"82,1130,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":1},{\"StartPoint\":\"518,1164,-9\",\"EndPoint\":\"518,1130,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":1},{\"StartPoint\":\"50,0,-9\",\"EndPoint\":\"50,34,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":3},{\"StartPoint\":\"550,0,-9\",\"EndPoint\":\"550,34,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":3},{\"StartPoint\":\"82,0,-9\",\"EndPoint\":\"82,34,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":3},{\"StartPoint\":\"518,0,-9\",\"EndPoint\":\"518,34,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":3}]}]}]}]}"; - - // 解析 JSON 字符串 - JSONObject object = JSON.parseObject(jsonData); - +// 生产单信息获取 + public OrderDO orderInfoChange(JSONObject dataPlates){ + List plateDetails = new ArrayList<>(); // 获取 Orders 字段对应的数组 - JSONArray ordersArray = object.getJSONArray("Orders"); + JSONObject order = dataPlates.getJSONObject("Orders"); // 如果 Orders 数组不为空,则获取第一个订单对象 - if (ordersArray != null && !ordersArray.isEmpty()) { + if (order != null && !order.isEmpty()) { // 获取生产单信息 - for (int i = 0; i < ordersArray.size(); i++) { - JSONObject order = ordersArray.getJSONObject(i); - // 使用 DateTimeFormatter 解析日期字符串 DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); LocalDate deliveryDate = LocalDate.parse(order.getString("DeliveryDate"), formatter); OrderDO orderDO = OrderDO.builder() .parentNo(0L) - .type(true) - .sort(0) + .orderType(true) + .orderSort(0) .dataType(1) .status(0) .customOrderNo(order.getString("OrderNo")) @@ -75,7 +69,21 @@ public class ApiTypeChangeRealize implements FileTypeChangeUtil { .remark(order.getString("Remark")) .deliveryDate(deliveryDate.atStartOfDay()) .build(); + return orderDO; + } + return null; + } +// 板材数据转换 + public List platesInfoChange(JSONObject dataPlates){ + List plateDetails = new ArrayList<>(); + // 获取 Orders 字段对应的数组 + JSONArray ordersArray = dataPlates.getJSONArray("Orders"); + // 如果 Orders 数组不为空,则获取第一个订单对象 + if (ordersArray != null && !ordersArray.isEmpty()) { + // 获取生产单信息 + for (int i = 0; i < ordersArray.size(); i++) { + JSONObject order = ordersArray.getJSONObject(i); // 获取材料信息 if (order.getJSONArray("Materials") != null && !order.getJSONArray("Materials").isEmpty()) { for (int j = 0; j < order.getJSONArray("Materials").size(); j++) { @@ -87,6 +95,7 @@ public class ApiTypeChangeRealize implements FileTypeChangeUtil { JSONObject block = material.getJSONArray("Blocks").getJSONObject(k);// 每块板 PlateDetail plateDetail = PlateDetail.builder() + .bodyNo(block.getString("BoxNo")) .plateNo(block.getString("BlockNo")) .name(block.getString("BlockName")) .customPlateNo(block.getString("CustomNo")) @@ -111,29 +120,190 @@ public class ApiTypeChangeRealize implements FileTypeChangeUtil { .openDoorType(Integer.valueOf(block.getString("OpenDoorType"))) .offsetX(Double.valueOf(block.getString("OffsetX"))) .offsetY(Double.valueOf(block.getString("OffsetY"))) - .pointDetail(getPointDetail(block, 2)) - .rawPointDetail(getPointDetail(block, 1)) + .pointDetail(getPointDetail(block, 1)) + .rawPointDetail(getPointDetail(block, 3)) + .holeDetail(getHoleDetail(block, 1)) + .sideHoleDetail(getHoleDetail(block, 3)) + .contourDetail(getModelDetail(block)) +// 排钻类型 + .drillsInfos(getDrillsInfo(block)) + .boardType(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("boardType")) + .throughHoleCount(Double.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("throughHoleCount"))) + .throughModelCount(Double.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("throughModelCount"))) + .has2DModel(Boolean.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("has2DModel"))) + .has3DModel(Boolean.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("has3DModel"))) + .remark(remarkToMap(block)) + .sideRemark(edgeRemarkToMap(block.getJSONObject("ExtraRemark").getJSONObject("extra"))) .build(); + + plateDetails.add(plateDetail); + System.out.println("plateDetail " + plateDetail); } } } } + System.out.println("板块 " + plateDetails.size()); } } else { System.out.println("JSON 数据中没有订单信息(Orders 数组为空)。"); } + return plateDetails; } + // 配件信息转换 + public List partsInfoChange(JSONObject value) { + List partsInfos = new ArrayList<>(); + + if (value != null && !value.isEmpty()) { + JSONArray partsLists = value.getJSONArray("List"); + for (int i = 0; i < partsLists.size(); i++) { + JSONObject parts = partsLists.getJSONObject(i); + PartsInfo partsInfo = PartsInfo.builder() + .id(parts.getString("DataID")) + .name(parts.getString("Name")) + .roomName(parts.getString("RoomName")) + .bodyName(parts.getString("BoxName")) + .bodyNo(parts.getString("BoxID")) + .multiNum(Integer.valueOf(parts.getString("MultiNum"))) + .goodsNo(parts.getString("GoodsNo")) + .goodId(Long.valueOf(parts.getString("GoodsID"))) + .material(parts.getString("material")) + .color(parts.getString("color")) + .factory(parts.getString("Factory")) + .brand(parts.getString("Brand")) + .model(parts.getString("Model")) + .spec(parts.getString("Spec")) + .unit(parts.getString("Units")) + .price(parts.getDouble("Price")) + .isComposite(Boolean.valueOf(parts.getString("IsComposite"))) + .groupName(parts.getString("GroupName")) + .objectType(parts.getString("ObjectType")) + .objectSpecExtras(parts.getString("SpecExtras")) + .partsSpec(parts.getString("PartsSpec")) + .goodsNumber(Double.valueOf(parts.getString("GoodsNumber"))) + .doorRemark(parts.getString("DoorRemark")) + .hingeRemark(parts.getString("HingeRemark")) + .remark(parts.getString("Remark")) + .build(); + } + } + return partsInfos; + } +// public static void main(String[] args) { +// +// String jsonData = "{\"Orders\":[{\"OrderNo\":20240423031257,\"CustomOrderNo\":\"\",\"CustomNo\":1538,\"CustomName\":\"sqy_cf\",\"SalePerson\":\"sqy_cf\",\"SaleDate\":\"2024-04-23\",\"DeliveryDate\":\"2024-05-13\",\"Consigee\":\"fvdf\",\"ConsigeePhone\":\"11111111111\",\"ConsigeeAddress\":\"vfvz\",\"Remark\":\"\",\"Materials\":[{\"Name\":\"F-A330铁力木(颗粒板)\",\"GoodsID\":517,\"GoodsSN\":\"\",\"Specification\":\"2440*1220*18\",\"Material\":\"颗粒板\",\"Color\":\"F-A330铁力木\",\"Thickness\":18,\"Width\":1220,\"Length\":2440,\"WaveFlag\":true,\"Blocks\":[{\"BlockNo\":2404003442203,\"RoomName\":\"未命名\",\"BoxNo\":\"\",\"BoxName\":\"标准柜2\",\"BlockID\":4290018,\"CustomNo\":\"\",\"BlockName\":\"背板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"预埋件\",\"face\":\"反面\",\"count\":6},{\"name\":\"木销\",\"type\":\"预埋件\",\"face\":\"反面\",\"count\":6}],\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[{\"name\":\"抽屉\",\"size\":{\"width\":600,\"height\":300,\"depth\":418}},{\"name\":\"斜切\",\"size\":{\"width\":600,\"height\":300,\"depth\":18}}],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"抽屉1,斜切1\",\"Width\":\"600\",\"Length\":\"300\",\"Size\":\"0.18\",\"CuttingWidth\":\"598\",\"CuttingLength\":\"298\",\"CuttingSize\":\"0.178\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"28\",\"Y\":\"229\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"28\",\"Y\":\"69\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"28\",\"Y\":\"197\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"28\",\"Y\":\"101\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"570\",\"Y\":\"229\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"570\",\"Y\":\"69\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"570\",\"Y\":\"197\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"570\",\"Y\":\"101\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"78\",\"Y\":\"28\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"520\",\"Y\":\"28\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"110\",\"Y\":\"28\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"488\",\"Y\":\"28\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[]},{\"BlockNo\":2404003442201,\"RoomName\":\"未命名\",\"BoxNo\":\"\",\"BoxName\":\"标准柜2\",\"BlockID\":4290016,\"CustomNo\":\"\",\"BlockName\":\"层板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"反面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"左侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"左侧面\",\"count\":2}],\"extra\":{\"boardType\":\"层板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[{\"name\":\"抽屉\",\"size\":{\"width\":600,\"height\":300,\"depth\":418}}],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"抽屉1\",\"Width\":\"400\",\"Length\":\"542\",\"Size\":\"0.217\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"540\",\"CuttingSize\":\"0.215\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"33\",\"Y\":\"491\",\"Face\":1,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"33\",\"Y\":\"49\",\"Face\":1,\"Diameter\":\"15\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[{\"StartPoint\":\"0,492,-9\",\"EndPoint\":\"34,492,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,50,-9\",\"EndPoint\":\"34,50,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,460,-9\",\"EndPoint\":\"34,460,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,82,-9\",\"EndPoint\":\"34,82,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4}]},{\"BlockNo\":2404003442200,\"RoomName\":\"未命名\",\"BoxNo\":\"\",\"BoxName\":\"标准柜2\",\"BlockID\":4290015,\"CustomNo\":\"\",\"BlockName\":\"右侧板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"正面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"左侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"左侧面\",\"count\":2}],\"extra\":{\"boardType\":\"立板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[{\"name\":\"抽屉\",\"size\":{\"width\":600,\"height\":300,\"depth\":418}}],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"抽屉1\",\"Width\":\"400\",\"Length\":\"260\",\"Size\":\"0.104\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"258\",\"CuttingSize\":\"0.103\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"33\",\"Y\":\"209\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"33\",\"Y\":\"49\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"}],\"Models\":[{\"Depth\":\"9\",\"Face\":1,\"Diameter\":\"6\",\"ToolNo\":\"\",\"Points\":[{\"Pos\":\"-1,-1,-9\",\"Curve\":\"0\"},{\"Pos\":\"-1,14,-9\",\"Curve\":\"0\"},{\"Pos\":\"399,14,-9\",\"Curve\":\"0\"},{\"Pos\":\"399,-1,-9\",\"Curve\":\"0\"},{\"Pos\":\"-1,-1,-9\",\"Curve\":\"0\"},{\"Pos\":\"5,5,-9\",\"Curve\":\"0\"},{\"Pos\":\"393,5,-9\",\"Curve\":\"0\"},{\"Pos\":\"393,8,-9\",\"Curve\":\"0\"},{\"Pos\":\"5,8,-9\",\"Curve\":\"0\"},{\"Pos\":\"5,5,-9\",\"Curve\":\"0\"}],\"OffsetList\":[],\"OriginModeling\":[{\"Pos\":\"0,0,0\",\"Curve\":\"0\"},{\"Pos\":\"400,0,0\",\"Curve\":\"0\"},{\"Pos\":\"400,18,0\",\"Curve\":\"0\"},{\"Pos\":\"0,18,0\",\"Curve\":\"0\"},{\"Pos\":\"0,0,0\",\"Curve\":\"0\"}]},{\"Depth\":\"5\",\"Face\":1,\"Diameter\":\"6\",\"ToolNo\":\"\",\"Points\":[{\"Pos\":\"373,35,-5\",\"Curve\":\"0\"},{\"Pos\":\"373,259,-5\",\"Curve\":\"0\"},{\"Pos\":\"376,259,-5\",\"Curve\":\"0\"},{\"Pos\":\"376,35,-5\",\"Curve\":\"0\"},{\"Pos\":\"373,35,-5\",\"Curve\":\"0\"}],\"OffsetList\":[],\"OriginModeling\":[{\"Pos\":\"371,33,0\",\"Curve\":\"0\"},{\"Pos\":\"380,33,0\",\"Curve\":\"0\"},{\"Pos\":\"380,260,0\",\"Curve\":\"0\"},{\"Pos\":\"371,260,0\",\"Curve\":\"0\"},{\"Pos\":\"371,33,0\",\"Curve\":\"0\"}]}],\"SideHoles\":[{\"StartPoint\":\"0,210,-9\",\"EndPoint\":\"34,210,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,50,-9\",\"EndPoint\":\"34,50,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,178,-9\",\"EndPoint\":\"34,178,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,82,-9\",\"EndPoint\":\"34,82,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4}]},{\"BlockNo\":2404003442199,\"RoomName\":\"未命名\",\"BoxNo\":\"\",\"BoxName\":\"标准柜2\",\"BlockID\":4290014,\"CustomNo\":\"\",\"BlockName\":\"左侧板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"正面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"左侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"左侧面\",\"count\":2}],\"extra\":{\"boardType\":\"立板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[{\"name\":\"抽屉\",\"size\":{\"width\":600,\"height\":300,\"depth\":418}}],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"抽屉1\",\"Width\":\"400\",\"Length\":\"260\",\"Size\":\"0.104\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"258\",\"CuttingSize\":\"0.103\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"33\",\"Y\":\"209\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"33\",\"Y\":\"49\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"}],\"Models\":[{\"Depth\":\"9\",\"Face\":0,\"Diameter\":\"6\",\"ToolNo\":\"\",\"Points\":[{\"Pos\":\"-1,-1,-9\",\"Curve\":\"0\"},{\"Pos\":\"-1,14,-9\",\"Curve\":\"0\"},{\"Pos\":\"399,14,-9\",\"Curve\":\"0\"},{\"Pos\":\"399,-1,-9\",\"Curve\":\"0\"},{\"Pos\":\"-1,-1,-9\",\"Curve\":\"0\"},{\"Pos\":\"5,5,-9\",\"Curve\":\"0\"},{\"Pos\":\"393,5,-9\",\"Curve\":\"0\"},{\"Pos\":\"393,8,-9\",\"Curve\":\"0\"},{\"Pos\":\"5,8,-9\",\"Curve\":\"0\"},{\"Pos\":\"5,5,-9\",\"Curve\":\"0\"}],\"OffsetList\":[],\"OriginModeling\":[{\"Pos\":\"0,0,0\",\"Curve\":\"0\"},{\"Pos\":\"400,0,0\",\"Curve\":\"0\"},{\"Pos\":\"400,18,0\",\"Curve\":\"0\"},{\"Pos\":\"0,18,0\",\"Curve\":\"0\"},{\"Pos\":\"0,0,0\",\"Curve\":\"0\"}]},{\"Depth\":\"5\",\"Face\":0,\"Diameter\":\"6\",\"ToolNo\":\"\",\"Points\":[{\"Pos\":\"373,35,-5\",\"Curve\":\"0\"},{\"Pos\":\"373,259,-5\",\"Curve\":\"0\"},{\"Pos\":\"376,259,-5\",\"Curve\":\"0\"},{\"Pos\":\"376,35,-5\",\"Curve\":\"0\"},{\"Pos\":\"373,35,-5\",\"Curve\":\"0\"}],\"OffsetList\":[],\"OriginModeling\":[{\"Pos\":\"371,33,0\",\"Curve\":\"0\"},{\"Pos\":\"380,33,0\",\"Curve\":\"0\"},{\"Pos\":\"380,260,0\",\"Curve\":\"0\"},{\"Pos\":\"371,260,0\",\"Curve\":\"0\"},{\"Pos\":\"371,33,0\",\"Curve\":\"0\"}]}],\"SideHoles\":[{\"StartPoint\":\"0,210,-9\",\"EndPoint\":\"34,210,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,50,-9\",\"EndPoint\":\"34,50,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,178,-9\",\"EndPoint\":\"34,178,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4},{\"StartPoint\":\"0,82,-9\",\"EndPoint\":\"34,82,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":4}]},{\"BlockNo\":2404003442191,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G03\",\"BlockID\":4290013,\"CustomNo\":\"\",\"BlockName\":\"二维刀路-免拉手\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":true,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[],\"Models\":[{\"Depth\":\"15\",\"Face\":0,\"Diameter\":\"24\",\"ToolNo\":\"24牛角拉手刀\",\"Points\":[{\"Pos\":\"412,-1,-15\",\"Curve\":\"0\"},{\"Pos\":\"392,-1,-15\",\"Curve\":\"0\"},{\"Pos\":\"392,393.82,-15\",\"Curve\":\"0\"},{\"Pos\":\"412,413.82,-15\",\"Curve\":\"0\"}],\"OffsetList\":[{\"Value\":\"0\",\"Name\":\"24牛角拉手刀\",\"Diameter\":\"24\",\"Angle\":\"0\",\"Depth\":\"15\"}]},{\"Depth\":\"12\",\"Face\":1,\"Diameter\":\"25\",\"ToolNo\":\"威法拉直器刀\",\"Points\":[{\"Pos\":\"249,614,-12\",\"Curve\":\"0\"},{\"Pos\":\"249,-16,-12\",\"Curve\":\"0\"}],\"OffsetList\":[{\"Value\":\"0\",\"Name\":\"威法拉直器刀\",\"Diameter\":\"25\",\"Angle\":\"0\",\"Depth\":\"12\"}]}],\"SideHoles\":[]},{\"BlockNo\":2404003442190,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G03\",\"BlockID\":4290012,\"CustomNo\":\"\",\"BlockName\":\"二维刀路-免拉手\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":true,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[],\"Models\":[{\"Depth\":\"15\",\"Face\":0,\"Diameter\":\"25\",\"ToolNo\":\"25免拉手刀\",\"Points\":[{\"Pos\":\"412,184.18,-15\",\"Curve\":\"0\"},{\"Pos\":\"392,204.18,-15\",\"Curve\":\"0\"},{\"Pos\":\"392,304,-15\",\"Curve\":\"0\"},{\"Pos\":\"412,304,-15\",\"Curve\":\"0\"}],\"OffsetList\":[{\"Value\":\"0\",\"Name\":\"25免拉手刀\",\"Diameter\":\"25\",\"Angle\":\"0\",\"Depth\":\"15\"}]},{\"Depth\":\"15\",\"Face\":0,\"Diameter\":\"25\",\"ToolNo\":\"25免拉手刀\",\"Points\":[{\"Pos\":\"412,413.82,-15\",\"Curve\":\"0\"},{\"Pos\":\"392,393.82,-15\",\"Curve\":\"0\"},{\"Pos\":\"392,291.5,-15\",\"Curve\":\"0\"},{\"Pos\":\"412,291.5,-15\",\"Curve\":\"0\"}],\"OffsetList\":[{\"Value\":\"0\",\"Name\":\"25免拉手刀\",\"Diameter\":\"25\",\"Angle\":\"0\",\"Depth\":\"15\"}]}],\"SideHoles\":[]},{\"BlockNo\":2404003442189,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G02\",\"BlockID\":4290011,\"CustomNo\":\"\",\"BlockName\":\"加工组-2\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[{\"name\":\"弧形\",\"size\":{\"width\":400,\"height\":600,\"depth\":18}},{\"name\":\"斜切\",\"size\":{\"width\":400,\"height\":600,\"depth\":18}}],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"弧形2,斜切1\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[],\"Models\":[],\"SideHoles\":[]},{\"BlockNo\":2404003442188,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G02\",\"BlockID\":4290010,\"CustomNo\":\"\",\"BlockName\":\"加工组-1\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[{\"name\":\"弧形\",\"size\":{\"width\":400,\"height\":600,\"depth\":18}}],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"弧形1\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[],\"Models\":[],\"SideHoles\":[]},{\"BlockNo\":2404003442183,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G01 \",\"BlockID\":4290009,\"CustomNo\":\"\",\"BlockName\":\"异形-切角\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"正面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2}],\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":true,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[{\"X\":\"0\",\"Y\":\"0\",\"Curve\":\"0\"},{\"X\":\"398\",\"Y\":\"0\",\"Curve\":\"0\"},{\"X\":\"398\",\"Y\":\"598\",\"Curve\":\"0\"},{\"X\":\"99.62\",\"Y\":\"598\",\"Curve\":\"0\"},{\"X\":\"0\",\"Y\":\"398.76\",\"Curve\":\"0\"}],\"OrgPoints\":[{\"X\":\"0\",\"Y\":\"0\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"400\",\"Y\":\"0\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"400\",\"Y\":\"600\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"100\",\"Y\":\"600\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"0\",\"Y\":\"400\",\"Curve\":\"0\",\"Edge\":\"1\"}],\"Holes\":[{\"X\":\"365\",\"Y\":\"549\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"365\",\"Y\":\"49\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[{\"StartPoint\":\"400,550,-9\",\"EndPoint\":\"366,550,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,50,-9\",\"EndPoint\":\"366,50,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,518,-9\",\"EndPoint\":\"366,518,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,82,-9\",\"EndPoint\":\"366,82,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2}]},{\"BlockNo\":2404003442182,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G01 \",\"BlockID\":4290008,\"CustomNo\":\"\",\"BlockName\":\"异形-缺口\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"正面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2}],\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":true,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[{\"X\":\"0\",\"Y\":\"0\",\"Curve\":\"0\"},{\"X\":\"398\",\"Y\":\"0\",\"Curve\":\"0\"},{\"X\":\"398\",\"Y\":\"598\",\"Curve\":\"0\"},{\"X\":\"100\",\"Y\":\"598\",\"Curve\":\"0\"},{\"X\":\"100\",\"Y\":\"398\",\"Curve\":\"0\"},{\"X\":\"0\",\"Y\":\"398\",\"Curve\":\"0\"}],\"OrgPoints\":[{\"X\":\"0\",\"Y\":\"0\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"400\",\"Y\":\"0\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"400\",\"Y\":\"600\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"100\",\"Y\":\"600\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"100\",\"Y\":\"400\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"0\",\"Y\":\"400\",\"Curve\":\"0\",\"Edge\":\"1\"}],\"Holes\":[{\"X\":\"365\",\"Y\":\"549\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"365\",\"Y\":\"49\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[{\"StartPoint\":\"400,550,-9\",\"EndPoint\":\"366,550,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,50,-9\",\"EndPoint\":\"366,50,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,518,-9\",\"EndPoint\":\"366,518,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,82,-9\",\"EndPoint\":\"366,82,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2}]},{\"BlockNo\":2404003442181,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G01 \",\"BlockID\":4290007,\"CustomNo\":\"\",\"BlockName\":\"异形-圆角\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"正面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"预埋件\",\"face\":\"反面\",\"count\":2},{\"name\":\"木销\",\"type\":\"预埋件\",\"face\":\"反面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2}],\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":true,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[{\"X\":\"0\",\"Y\":\"0\",\"Curve\":\"0\"},{\"X\":\"398\",\"Y\":\"0\",\"Curve\":\"0\"},{\"X\":\"398\",\"Y\":\"598\",\"Curve\":\"0\"},{\"X\":\"99\",\"Y\":\"598\",\"Curve\":\"0.414213562373095\"},{\"X\":\"0\",\"Y\":\"499\",\"Curve\":\"0\"}],\"OrgPoints\":[{\"X\":\"0\",\"Y\":\"0\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"400\",\"Y\":\"0\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"400\",\"Y\":\"600\",\"Curve\":\"0\",\"Edge\":\"1\"},{\"X\":\"100\",\"Y\":\"600\",\"Curve\":\"0.414213562373095\",\"Edge\":\"1\"},{\"X\":\"0\",\"Y\":\"500\",\"Curve\":\"0\",\"Edge\":\"1\"}],\"Holes\":[{\"X\":\"365\",\"Y\":\"549\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"365\",\"Y\":\"49\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"270\",\"Y\":\"549\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"270\",\"Y\":\"49\",\"Face\":1,\"Diameter\":\"5\",\"Depth\":\"13.5\"},{\"X\":\"270\",\"Y\":\"517\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"},{\"X\":\"270\",\"Y\":\"81\",\"Face\":1,\"Diameter\":\"8\",\"Depth\":\"13.5\"}],\"Models\":[],\"SideHoles\":[{\"StartPoint\":\"400,550,-9\",\"EndPoint\":\"366,550,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,50,-9\",\"EndPoint\":\"366,50,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,518,-9\",\"EndPoint\":\"366,518,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,82,-9\",\"EndPoint\":\"366,82,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2}]},{\"BlockNo\":2404003442180,\"RoomName\":\"F01\",\"BoxNo\":\"\",\"BoxName\":\"G01 \",\"BlockID\":4290006,\"CustomNo\":\"\",\"BlockName\":\"正反面造型\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"drills\":[{\"name\":\"三合一\",\"type\":\"偏心轮\",\"face\":\"正面\",\"count\":2},{\"name\":\"三合一\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2},{\"name\":\"木销\",\"type\":\"连接杆\",\"face\":\"右侧面\",\"count\":2}],\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"\",\"Width\":\"400\",\"Length\":\"600\",\"Size\":\"0.24\",\"CuttingWidth\":\"398\",\"CuttingLength\":\"598\",\"CuttingSize\":\"0.238\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[{\"X\":\"365\",\"Y\":\"549\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"},{\"X\":\"365\",\"Y\":\"49\",\"Face\":0,\"Diameter\":\"15\",\"Depth\":\"13.5\"}],\"Models\":[{\"Depth\":\"5\",\"Face\":0,\"Diameter\":\"6\",\"ToolNo\":\"\",\"Points\":[{\"Pos\":\"22,-1,-5\",\"Curve\":\"0\"},{\"Pos\":\"22,599,-5\",\"Curve\":\"0\"},{\"Pos\":\"26,599,-5\",\"Curve\":\"0\"},{\"Pos\":\"26,-1,-5\",\"Curve\":\"0\"},{\"Pos\":\"22,-1,-5\",\"Curve\":\"0\"}],\"OffsetList\":[],\"OriginModeling\":[{\"Pos\":\"20,0,0\",\"Curve\":\"0\"},{\"Pos\":\"30,0,0\",\"Curve\":\"0\"},{\"Pos\":\"30,600,0\",\"Curve\":\"0\"},{\"Pos\":\"20,600,0\",\"Curve\":\"0\"},{\"Pos\":\"20,0,0\",\"Curve\":\"0\"}]},{\"Depth\":\"6\",\"Face\":1,\"Diameter\":\"6\",\"ToolNo\":\"\",\"Points\":[{\"Pos\":\"122,-1,-6\",\"Curve\":\"0\"},{\"Pos\":\"122,584,-6\",\"Curve\":\"0\"},{\"Pos\":\"136,584,-6\",\"Curve\":\"0\"},{\"Pos\":\"136,-1,-6\",\"Curve\":\"0\"},{\"Pos\":\"122,-1,-6\",\"Curve\":\"0\"},{\"Pos\":\"128,5,-6\",\"Curve\":\"0\"},{\"Pos\":\"130,5,-6\",\"Curve\":\"0\"},{\"Pos\":\"130,578,-6\",\"Curve\":\"0\"},{\"Pos\":\"128,578,-6\",\"Curve\":\"0\"},{\"Pos\":\"128,5,-6\",\"Curve\":\"0\"}],\"OffsetList\":[],\"OriginModeling\":[{\"Pos\":\"120,0,0\",\"Curve\":\"0\"},{\"Pos\":\"140,0,0\",\"Curve\":\"0\"},{\"Pos\":\"140,588,0\",\"Curve\":\"0\"},{\"Pos\":\"120,588,0\",\"Curve\":\"0\"},{\"Pos\":\"120,0,0\",\"Curve\":\"0\"}]}],\"SideHoles\":[{\"StartPoint\":\"400,550,-9\",\"EndPoint\":\"366,550,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,50,-9\",\"EndPoint\":\"366,50,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,518,-9\",\"EndPoint\":\"366,518,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2},{\"StartPoint\":\"400,82,-9\",\"EndPoint\":\"366,82,-9\",\"Diameter\":\"8\",\"Depth\":\"34\",\"Direction\":2}]}]},{\"Name\":\"9mm-苏湘桐-多层板\",\"GoodsID\":840,\"GoodsSN\":\"\",\"Specification\":\"2440*1220*9\",\"Material\":\"多层板\",\"Color\":\"苏湘桐\",\"Thickness\":9,\"Width\":1220,\"Length\":2440,\"WaveFlag\":true,\"Blocks\":[{\"BlockNo\":2404003442202,\"RoomName\":\"未命名\",\"BoxNo\":\"\",\"BoxName\":\"标准柜2\",\"BlockID\":4290017,\"CustomNo\":\"\",\"BlockName\":\"背板\",\"OpenDoorType\":0,\"Remark1\":\"\",\"Remark2\":\"\",\"Remark3\":\"\",\"Remark4\":\"\",\"Remark5\":\"\",\"ExtraRemark\":{\"extra\":{\"boardType\":\"背板\",\"throughHoleCount\":0,\"throughModelCount\":0,\"has2DModel\":false,\"has3DModel\":false,\"composingFace\":\"任意面\",\"processList\":[{\"name\":\"抽屉\",\"size\":{\"width\":600,\"height\":300,\"depth\":418}}],\"edgeRemarks\":[\"\",\"\",\"\",\"\"]}},\"ProcessGroupName\":\"抽屉1\",\"Width\":\"534\",\"Length\":\"227\",\"Size\":\"0.121\",\"CuttingWidth\":\"532\",\"CuttingLength\":\"225\",\"CuttingSize\":\"0.12\",\"BorderLeft\":1,\"BorderRight\":1,\"BorderUpper\":1,\"BorderUnder\":1,\"Wave\":0,\"PlaceFace\":2,\"IsUnRegular\":false,\"OffsetX\":\"1\",\"OffsetY\":\"1\",\"Points\":[],\"OrgPoints\":[],\"Holes\":[],\"Models\":[],\"SideHoles\":[]}]}]}]}"; +// +// // 解析 JSON 字符串 +// JSONObject object = JSON.parseObject(jsonData); +// +// // 获取 Orders 字段对应的数组 +// JSONArray ordersArray = object.getJSONArray("Orders"); +// +// // 如果 Orders 数组不为空,则获取第一个订单对象 +// if (ordersArray != null && !ordersArray.isEmpty()) { +// // 获取生产单信息 +// for (int i = 0; i < ordersArray.size(); i++) { +// JSONObject order = ordersArray.getJSONObject(i); +// +// // 使用 DateTimeFormatter 解析日期字符串 +// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); +// LocalDate deliveryDate = LocalDate.parse(order.getString("DeliveryDate"), formatter); +// +// OrderDO orderDO = OrderDO.builder() +// .parentNo(0L) +// .type(true) +// .sort(0) +// .dataType(1) +// .status(0) +// .customOrderNo(order.getString("OrderNo")) +// .customer(order.getString("Consigee")) +// .address(order.getString("ConsigeeAddress")) +// .phoneNumber(order.getString("ConsigeePhone")) +// .dealer(order.getString("CustomName")) +// .salesman(order.getString("SalePerson")) +// .remark(order.getString("Remark")) +// .deliveryDate(deliveryDate.atStartOfDay()) +// .build(); +// +// List plateDetails = new ArrayList<>(); +// // 获取材料信息 +// if (order.getJSONArray("Materials") != null && !order.getJSONArray("Materials").isEmpty()) { +// for (int j = 0; j < order.getJSONArray("Materials").size(); j++) { +// JSONObject material = order.getJSONArray("Materials").getJSONObject(j); +// +// // 板件信息 +// if (material.getJSONArray("Blocks") != null && !material.getJSONArray("Blocks").isEmpty()) { +// for (int k = 0; k < material.getJSONArray("Blocks").size(); k++) { +// JSONObject block = material.getJSONArray("Blocks").getJSONObject(k);// 每块板 +// +// PlateDetail plateDetail = PlateDetail.builder() +// .bodyNo(block.getString("BoxNo")) +// .plateNo(block.getString("BlockNo")) +// .name(block.getString("BlockName")) +// .customPlateNo(block.getString("CustomNo")) +// .roomsName(block.getString("RoomName")) +// .bodyName(block.getString("BoxName")) +// .group(block.getString("ProcessGroupName")) +// .multiNum(1) +// .groupList(getProcessGroup(block)) +// .width(Double.valueOf(block.getString("Width"))) +// .length(Double.valueOf(block.getString("Length"))) +// .acreage(Double.valueOf(block.getString("Size"))) +// .splitWidth(Double.valueOf(block.getString("CuttingWidth"))) +// .splitLength(Double.valueOf(block.getString("CuttingLength"))) +// .sealAcreage(Double.valueOf(block.getString("CuttingSize"))) +// .isUnRegular(Boolean.valueOf(block.getString("IsUnRegular"))) +// .sealLeft(Double.valueOf(block.getString("BorderLeft"))) +// .sealRight(Double.valueOf(block.getString("BorderRight"))) +// .sealUp(Double.valueOf(block.getString("BorderUpper"))) +// .sealDown(Double.valueOf(block.getString("BorderUnder"))) +// .texture(Integer.valueOf(block.getString("Wave"))) +// .typographicFace(Integer.valueOf(block.getString("PlaceFace"))) +// .openDoorType(Integer.valueOf(block.getString("OpenDoorType"))) +// .offsetX(Double.valueOf(block.getString("OffsetX"))) +// .offsetY(Double.valueOf(block.getString("OffsetY"))) +// .pointDetail(getPointDetail(block, 1)) +// .rawPointDetail(getPointDetail(block, 3)) +// .holeDetail(getHoleDetail(block, 1)) +// .sideHoleDetail(getHoleDetail(block, 3)) +// .contourDetail(getModelDetail(block)) +//// 排钻类型 +// .drillsInfos(getDrillsInfo(block)) +// .boardType(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("boardType")) +// .throughHoleCount(Double.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("throughHoleCount"))) +// .throughModelCount(Double.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("throughModelCount"))) +// .has2DModel(Boolean.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("has2DModel"))) +// .has3DModel(Boolean.valueOf(block.getJSONObject("ExtraRemark").getJSONObject("extra").getString("has3DModel"))) +// .remark(remarkToMap(block)) +// .sideRemark(edgeRemarkToMap(block.getJSONObject("ExtraRemark").getJSONObject("extra"))) +// .build(); +// +// plateDetails.add(plateDetail); +// System.out.println("plateDetail " + plateDetail); +// } +// } +// } +// +// } +// System.out.println("板块 " + plateDetails.size()); +// } +// +// } else { +// System.out.println("JSON 数据中没有订单信息(Orders 数组为空)。"); +// } +// +// } + // 加工组信息筛选 - private static List getProcessGroup(JSONObject block) { + private List getProcessGroup(JSONObject block) { List groupList = new ArrayList<>(); - if (block.getJSONArray("ExtraRemark") != null && !block.getJSONArray("ExtraRemark").isEmpty()) { - JSONObject extraRemark = block.getJSONArray("ExtraRemark").getJSONObject(0); - if (extraRemark.getJSONArray("extra") != null && !extraRemark.getJSONArray("extra").isEmpty()) { - JSONObject extra = extraRemark.getJSONArray("extra").getJSONObject(0); + if (block.getJSONObject("ExtraRemark") != null && !block.getJSONObject("ExtraRemark").isEmpty()) { + JSONObject extraRemark = block.getJSONObject("ExtraRemark"); + if (extraRemark.getJSONObject("extra") != null && !extraRemark.getJSONObject("extra").isEmpty()) { + JSONObject extra = extraRemark.getJSONObject("extra"); if (extra.getJSONArray("processList") != null && !extra.getJSONArray("processList").isEmpty()) { for (int i = 0; i < extra.getJSONArray("processList").size(); i++) { JSONObject process = extra.getJSONArray("processList").getJSONObject(i); @@ -154,8 +324,8 @@ public class ApiTypeChangeRealize implements FileTypeChangeUtil { return null; } - // 异形板的开料轮廓 (type 为1,不含封边) - private static List getPointDetail(JSONObject block, Integer type) { + // 异形板的开料轮廓 (type 为1,不含封边;其他为,含封边) + private List getPointDetail(JSONObject block, Integer type) { List pointDetailList = new ArrayList<>(); if (type == 1) { // 不含封边 @@ -183,11 +353,11 @@ public class ApiTypeChangeRealize implements FileTypeChangeUtil { } } } - return null; + return pointDetailList; } - // 孔明细板数据解析 (type 为1,正面) - private static List getHoleDetail(JSONObject block, Integer type) { + // 孔明细板数据解析 (type 为1,正面;3,侧面) + private List getHoleDetail(JSONObject block, Integer type) { List holeDetails = new ArrayList<>(); if (type == 1) { // 1,正面 if (block.getJSONArray("Holes") != null && !block.getJSONArray("Holes").isEmpty()) { @@ -196,27 +366,139 @@ public class ApiTypeChangeRealize implements FileTypeChangeUtil { holeDetails.add(HoleDetail.builder() .startX(Double.valueOf(hole.getString("X"))) .startY(Double.valueOf(hole.getString("Y"))) - .faceType(hole.getString("Face")) - .holeType(hole.getString("Type")) + .faceType(1) + .radius(Double.valueOf(hole.getString("Diameter")) / 2) + .depth(Double.valueOf(hole.getString("Depth"))) .build()); - } + } + } + } else { + if (block.getJSONArray("SideHoles") != null && !block.getJSONArray("SideHoles").isEmpty()) { + for (int i = 0; i < block.getJSONArray("SideHoles").size(); i++) { + JSONObject hole = block.getJSONArray("SideHoles").getJSONObject(i); + String[] startPoints = splitAndTrim(hole.getString("StartPoint")); + String[] endPoints = splitAndTrim(hole.getString("EndPoint")); + try { + holeDetails.add(HoleDetail.builder() + .startX(Double.valueOf(startPoints[0])) + .startY(Double.valueOf(startPoints[1])) + .startZ(Double.valueOf(startPoints[2])) + .endX(Double.valueOf(endPoints[0])) + .endY(Double.valueOf(endPoints[1])) + .endZ(Double.valueOf(endPoints[2])) + .faceType(3) + .radius(Double.valueOf(hole.getString("Diameter")) / 2) + .depth(Double.valueOf(hole.getString("Depth"))) + .build()); + } catch (Exception e) { + System.out.println("HoleDetail " + hole); + } + + } + } + } + + return holeDetails; + } + + // 造型明细板数据解析 (type 为1,正面;3,侧面) + private List getModelDetail(JSONObject block) { + List modelDetails = new ArrayList<>(); + + if (block.getJSONArray("Models") != null && !block.getJSONArray("Models").isEmpty()) { + for (int i = 0; i < block.getJSONArray("Models").size(); i++) { + JSONObject model = block.getJSONArray("Models").getJSONObject(i); + + List pointLists = new ArrayList<>(); + if (model.getJSONArray("Points") != null && !model.getJSONArray("Points").isEmpty()) { + for (int j = 0; j < model.getJSONArray("Points").size(); j++) { + JSONObject point = model.getJSONArray("Points").getJSONObject(j); + String[] points = splitAndTrim(point.getString("Pos")); + pointLists.add(PointList.builder() + .pointX(Double.valueOf(points[0])) + .pointY(Double.valueOf(points[1])) + .pointZ(Double.valueOf(points[2])) + .curve(Double.valueOf(point.getString("Curve"))) + .build()); } } - return null; + List offSetLists = new ArrayList<>(); + if (model.getJSONArray("OffsetList") != null && !model.getJSONArray("OffsetList").isEmpty()) { + for (int j = 0; j < model.getJSONArray("OffsetList").size(); j++) { + JSONObject offSet = model.getJSONArray("OffsetList").getJSONObject(j); + offSetLists.add(OffSetList.builder() + .value(Double.valueOf(offSet.getString("Value"))) + .name(offSet.getString("Name")) + .radius(Double.valueOf(offSet.getString("Diameter")) / 2) + .angle(Double.valueOf(offSet.getString("Angle"))) + .depth(Double.valueOf(offSet.getString("Depth"))) + .build()); + } + } + modelDetails.add(ModelDetail.builder() + .depth(Double.valueOf(model.getString("Depth"))) + .faceType(Integer.valueOf(model.getString("Face"))) + .knifeName(model.getString("TooINo")) + .knifeRadius(Double.valueOf(model.getString("Diameter")) / 2) + .pointList(pointLists) + .offSetList(offSetLists) + .build()); + } + } + + return modelDetails; } - // 异形板的开料轮廓 (不含封边) + // 排钻数据 + private List getDrillsInfo(JSONObject block) { + List drillsInfos = new ArrayList<>(); - // 生产单数据分离填入 - public List getDeviseData(String[] args) { - return null; + if (block.getJSONArray("drills") != null && !block.getJSONArray("drills").isEmpty()) { + for (int i = 0; i < block.getJSONArray("drills").size(); i++) { + JSONObject drill = block.getJSONArray("drills").getJSONObject(i); + drillsInfos.add(DrillsInfo.builder() + .name(drill.getString("name")) + .type(drill.getString("type")) + .face(drill.getString("face")) + .count(Double.valueOf(drill.getString("count"))) + .build()); + } + } + return drillsInfos; + } + + // String[] 以逗号分割,去空格 + public String[] splitAndTrim(String str) { + String[] strs = str.split(","); + for (int i = 0; i < strs.length; i++) { + strs[i] = strs[i].trim(); + } + return strs; + } + + + // 将remark转为map + public Map remarkToMap(JSONObject block) { + Map map = new HashMap<>(); + for (int i = 0; i < 4; i++) { + if (block.getString("remark" + i) != null && !block.getString("remark" + i).isEmpty()) { + map.put("remark" + i, block.getString("remark" + i)); + } + } + return map; } // 将remark转为map - public Map remarkToMap(String[] remark) { + public Map edgeRemarkToMap(JSONObject edgeRemark) { Map map = new HashMap<>(); - + if (edgeRemark.getJSONArray("edgeRemarks") != null && !edgeRemark.getJSONArray("edgeRemarks").isEmpty()) { + for (int i = 0; i < edgeRemark.getJSONArray("edgeRemarks").size(); i++) { + if (edgeRemark.getJSONArray("edgeRemarks").getString(i) != null && !edgeRemark.getJSONArray("edgeRemarks").getString(i).isEmpty()) { + map.put(String.valueOf(i), edgeRemark.getJSONArray("edgeRemarks").getString(i)); + } + } + } return map; } } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/vo/Point.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/vo/Point.java deleted file mode 100644 index a55a227df..000000000 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/vo/Point.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.vo; - -import lombok.Data; - -import javax.xml.bind.annotation.*; - -@Data// lombok注解,给字段添加getter和setter -@XmlAccessorType(XmlAccessType.FIELD)// 映射所有的字段 -@XmlRootElement(name = "Point ")// XML根节点名称,此处为nation -public class Point { - - @XmlAttribute// 解析节点的属性 - private String type; - - @XmlValue// 解析nation节点的内容,字段名称无所谓 - private String nationValue; -} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml index 30e5f06fd..619138e77 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml @@ -3,7 +3,7 @@