mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
bug修改
This commit is contained in:
+18
-53
@@ -1,9 +1,12 @@
|
||||
package com.cf.imes.module.executor.controller.admin.order;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.*;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiDataAchieve;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelReadUtil;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
@@ -48,6 +51,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 生产单管理")
|
||||
@@ -62,6 +66,9 @@ public class OrderController {
|
||||
@Resource
|
||||
private ExcelReadUtil excelReadUtil;
|
||||
|
||||
@Resource
|
||||
private ApiDataAchieve apiDataAchieve;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OrderController.class);
|
||||
|
||||
@PostMapping("/create")
|
||||
@@ -139,57 +146,6 @@ public class OrderController {
|
||||
}
|
||||
}
|
||||
|
||||
// 导出错误的excel
|
||||
// @PostMapping("/import-excel")
|
||||
// @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:importExcel')")
|
||||
// @OperateLog(type = EXPORT)
|
||||
// public void exportExcel(@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,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
//// 判断是否更新板材
|
||||
// if (!isAddPlate) {//不需要添加板材
|
||||
// if (upload) {
|
||||
// orderService.updateOrder(createReqVO);//更新
|
||||
// } else {
|
||||
// Long id = orderService.createOrder(createReqVO);//新建
|
||||
// }
|
||||
// } else {
|
||||
// Long id = 0L;
|
||||
// if (upload) {
|
||||
// orderService.updateOrder(createReqVO);//更新
|
||||
// id = createReqVO.getId();
|
||||
// } else {
|
||||
// id = orderService.createOrder(createReqVO);//新建
|
||||
// }
|
||||
//// 解析导入文件,生成统一格式
|
||||
// List<?> list = new ArrayList<>();
|
||||
// if (createReqVO.getDataType() == 1) {//数据源
|
||||
//
|
||||
// } else if (createReqVO.getDataType() == 2) {//api
|
||||
//
|
||||
// } else if (createReqVO.getDataType() == 0) {//文件
|
||||
//// 文件数据读取
|
||||
// list = fileTypeChangeUtil.fileDataChange(file);
|
||||
// }
|
||||
// if (!fileTypeChangeUtil.getFlag()) {
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "生产单导入错误返回.xlsx", "数据", OrderPlateImportExcelVO.class,
|
||||
// BeanUtils.toBean(list, OrderPlateImportExcelVO.class));
|
||||
// }
|
||||
// orderInputProcessor.input((List<Detail>) list, id);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
// 清理生产单
|
||||
@GetMapping("/clean")
|
||||
@Operation(summary = "清理生产单")
|
||||
@@ -200,7 +156,6 @@ public class OrderController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/get-room")
|
||||
@Operation(summary = "生产单详情-房间和柜体id")
|
||||
@Parameter(name = "orderId", description = "生产单编号", required = true, example = "1024")
|
||||
@@ -276,8 +231,18 @@ public class OrderController {
|
||||
@GetMapping("getApiData")
|
||||
@Operation(summary = "生产单api数据导入新增")
|
||||
@PreAuthorize("@ss.hasPermission('executor:order:getApiData')")
|
||||
public CommonResult<Long> test(@RequestParam(value = "orderNo", required = false, defaultValue = "20230809027818") String orderNo) {
|
||||
public CommonResult<Long> test(@RequestParam(value = "orderNo", required = false, defaultValue = "20230809027818") String orderNo) throws InterruptedException {
|
||||
return success(orderService.importApiData(orderNo));
|
||||
// Long organId = SecurityFrameworkUtils.getLoginUser().getOrganId();
|
||||
// String token = apiDataAchieve.getApiToken(organId);
|
||||
// JSONObject dataPlates = apiDataAchieve.getApiPlateProData(token, orderNo);
|
||||
// JSONObject dataParts = apiDataAchieve.getApiPartsMessage(token, orderNo);
|
||||
// JSONObject dataBody = apiDataAchieve.getApiBodyMessage(token, orderNo);
|
||||
// JSONObject dataGoods = apiDataAchieve.getApiGoodsMessage(token, orderNo);
|
||||
// JSONObject plate = apiDataAchieve.getApiPlateDetailMessage(token, orderNo);
|
||||
// JSONObject dataModule = apiDataAchieve.getApiGroupMessage(token, orderNo);
|
||||
// JSONObject block = apiDataAchieve.getApiBlocksMessage(token, orderNo);
|
||||
// return success(null);
|
||||
}
|
||||
|
||||
@PostMapping("/importFile")
|
||||
|
||||
+4
-1
@@ -25,5 +25,8 @@ public class OrderModuleRespVO {
|
||||
private String groupName;
|
||||
|
||||
@Schema(description = "柜体中的板材数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer plateNum;
|
||||
private Integer bodyNum;
|
||||
|
||||
@Schema(description = "加工组中的板材数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer groupNum;
|
||||
}
|
||||
|
||||
+23
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.ordermodel;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import com.cf.imes.module.executor.util.deviseData.dataTwo.HoleDetail;
|
||||
import com.cf.imes.module.executor.util.deviseData.dataTwo.ModelDetail;
|
||||
@@ -12,6 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
@@ -58,4 +60,25 @@ public class OrderModelDO extends ESDocument {
|
||||
private List<ModelDetail> contourDetail;
|
||||
@Schema(description = "侧面孔明细列表")
|
||||
private List<HoleDetail> sideHoleDetail;
|
||||
|
||||
@Schema(description = "生产封边备注")
|
||||
private Map<String,String> sideRemark;// 封边备注
|
||||
|
||||
@Schema(description = "扩展备注(包含铰链备注、订单板件流水号)")
|
||||
private String extraRemark; // 扩展备注(包含铰链备注、订单板件流水号)(板材明细中)
|
||||
@Schema(description = "特殊备注(Json字符串)")
|
||||
private String specialRemarkDei; // 特殊备注(Json字符串)
|
||||
@Schema(description = "拉手备注(Json字符串)")
|
||||
private String extraHandleRemark; // 拉手备注
|
||||
@Schema(description = "排钻备注(Json字符串)")
|
||||
private String drillsRemark; // 排钻备注(Json字符串)
|
||||
@Schema(description = "板其他备注(Json字符串)")
|
||||
private String infoRemark; // 板其他备注(Json字符串)
|
||||
@Schema(description = "板件备注(Json字符串)")
|
||||
private String remarkJsonDei; // 板件备注(Json字符串)
|
||||
|
||||
@Schema(description = "普通备注(板材数据中)")
|
||||
private String remarkJson; // 普通备注(板材数据中)
|
||||
@Schema(description = "特殊备注(板材数据中)")
|
||||
private String specialRemark; // 特殊备注(板材数据中)
|
||||
}
|
||||
|
||||
-11
@@ -1,13 +1,9 @@
|
||||
package com.cf.imes.module.executor.service.order;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import co.elastic.clients.elasticsearch.core.BulkResponse;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.es.core.service.ESDocumentService;
|
||||
import com.cf.imes.framework.mybatis.core.generator.SnowFlakeGenerator;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
@@ -29,18 +25,11 @@ import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
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.RandomUtils;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import com.cf.imes.module.executor.util.deviseData.IBoardProdInfo;
|
||||
import com.cf.imes.module.executor.util.deviseData.PartsModuleExtra;
|
||||
import com.cf.imes.module.executor.util.deviseData.PlateModuleExtra;
|
||||
import com.cf.imes.module.executor.util.deviseData.dataTwo.PlateDetail;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
+8
-18
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.executor.service.order;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import cn.smallbun.screw.core.util.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -33,6 +32,7 @@ import com.cf.imes.module.executor.dal.mysql.plate.PlateGoodMapper;
|
||||
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.deviseData.dataTwo.PlateDetail;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiDataProduction;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.api.webcad.ApiTypeRealize;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.ExcelTypeRealize;
|
||||
import com.cf.imes.module.system.api.application.ApplicationApi;
|
||||
@@ -57,7 +57,6 @@ import java.time.format.DateTimeParseException;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
@@ -116,7 +115,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
private ApplicationApi applicationApi;
|
||||
|
||||
@Resource
|
||||
private ApiOrderService apiOrderService;
|
||||
private ApiDataProduction apiOrderService;
|
||||
|
||||
@Resource
|
||||
private IdentifierGenerator identifierGenerator;
|
||||
@@ -129,7 +128,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
private static final int DEFAULT_DAYS_TO_ADD = 30;
|
||||
|
||||
private static final int PARTS_PAGE_MAX = 10;
|
||||
private static final int PARTS_PAGE_MAX = 100;
|
||||
|
||||
@Override
|
||||
public Long createOrder(OrderSaveReqVO createReqVO) {
|
||||
@@ -361,7 +360,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
// 加工组信息转换
|
||||
JSONObject jsonModule = new JSONObject();
|
||||
jsonModule.put("order_no", orderNo);
|
||||
JSONObject dataModule = apiOrderService.getApiModuleTypeDataMessage(token, jsonGoods);
|
||||
JSONObject dataModule = apiOrderService.getApiModuleTypeDataMessage(token, jsonModule);
|
||||
|
||||
// 板材数据信息转换
|
||||
JSONObject jsonBlocks = new JSONObject();
|
||||
@@ -378,16 +377,6 @@ public class OrderServiceImpl implements OrderService {
|
||||
JSONObject value = apiOrderService.getApiBlocksMessage(token, jsonBlocks);
|
||||
block = mergeJSONObjects(block, value);
|
||||
}
|
||||
System.err.println(block);
|
||||
// 转换
|
||||
System.out.println(" "
|
||||
+ " jsonPlatesData " + dataPlates.getJSONObject("value")+ "\n"
|
||||
+ " dataParts " + dataParts+ "\n"
|
||||
+ " dataBody " + dataBody+ "\n"
|
||||
+ " dataGoods " + dataGoods+ "\n"
|
||||
+ " plate " + plate+ "\n"
|
||||
+ " dataModule " + dataModule + "\n"
|
||||
+ " block " + block);
|
||||
Map<String, List<?>> listMap = apiTypeRealize.apiPlateDataChange(
|
||||
dataPlates.getJSONObject("value"),//板件生产信息
|
||||
dataParts,// 配件信息
|
||||
@@ -410,12 +399,13 @@ public class OrderServiceImpl implements OrderService {
|
||||
goodsDO = (List<GoodsDO>) map.get("goodsDO");
|
||||
List<PlateGoodDO> plateGoodDOS = (List<PlateGoodDO>) map.get("plateGoodDOLists");
|
||||
validateCustomOrderNoExists(order.get(0).getCustomOrderNo());
|
||||
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, order.get(0),goodsDO,plateGoodDOS);
|
||||
List<OrderModelDO> orderModelDOs = BeanUtils.toBean(plateDetail, OrderModelDO.class);
|
||||
orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(order.get(0).getId()));
|
||||
orderInputProcessor.batchSaveModel(orderModelDOs);
|
||||
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, order.get(0),goodsDO,plateGoodDOS);
|
||||
// System.out.println("plateDO = " + plateDO+ " BeanUtils.toBean(plateDetail, OrderModelDO.class) = " + orderModelDOs);
|
||||
return order.get(0).getId();
|
||||
// return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -479,7 +469,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
|
||||
mergedObj.put("List", mergedList);
|
||||
System.out.println(mergedObj);
|
||||
// System.out.println(mergedObj);
|
||||
return mergedObj;
|
||||
|
||||
|
||||
@@ -585,7 +575,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
validateCustomOrderNoExists(orderDO.getCustomOrderNo());
|
||||
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, orderDO,goodsDO,plateGoodDOS);
|
||||
orderInputProcessor.batchSaveModel(orderModelDOS);
|
||||
// System.out.println("plateDO = " + plateDO+ " BeanUtils.toBean(plateDetail, OrderModelDO.class) = " + orderModelDOs);
|
||||
// System.out.println("plateDO = " + plateDO+ " BeanUtils.toBean(plateDetail, OrderModelDO.class) = " + orderModelDOS);
|
||||
|
||||
}
|
||||
|
||||
|
||||
-103
@@ -1,12 +1,6 @@
|
||||
package com.cf.imes.module.executor.util;
|
||||
|
||||
import com.cf.imes.module.executor.util.deviseData.*;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.zip.Deflater;
|
||||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.Inflater;
|
||||
@@ -112,102 +106,5 @@ public class ZLibUtils {
|
||||
return o.toByteArray();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws JsonProcessingException {
|
||||
// GoodDetail goodDetail = new GoodDetail();
|
||||
|
||||
List<ModelDetail> modelDetail = new ArrayList<>();
|
||||
modelDetail.add(new ModelDetail());
|
||||
// ModelDetail modelDetail = new ModelDetail(); //造型明细
|
||||
// modelDetail.setModelId(1);
|
||||
List<PointDetail> pointDetail = new ArrayList<>(); //点明细
|
||||
pointDetail.add(new PointDetail());
|
||||
List<HoleDetail> holeDetail = new ArrayList<>(); //孔明细
|
||||
holeDetail.add(new HoleDetail());
|
||||
List<PointDetail> orgPointDetail = new ArrayList<>(); //原始点明细
|
||||
orgPointDetail.add(new PointDetail());
|
||||
List<ModelDetail> sideModelDetail = new ArrayList<>(); //侧面造型明细
|
||||
sideModelDetail.add(new ModelDetail());
|
||||
List<HoleDetail> sideHoleDetail= new ArrayList<>();//侧面孔明细
|
||||
sideHoleDetail.add(new HoleDetail());
|
||||
|
||||
Detail detail = new Detail();
|
||||
// PlateDetail plateDetail = new PlateDetail();
|
||||
// plateDetail.setGoodDetail(goodDetail);
|
||||
IBoardProdInfo iBoardProdInfo = new IBoardProdInfo();
|
||||
detail.setIBoardProdInfo(iBoardProdInfo);
|
||||
detail.setContourDetail(modelDetail);
|
||||
detail.setPointDetail(pointDetail);
|
||||
// detail.setHoleDetail(holeDetail);
|
||||
detail.setRawPointDetail(orgPointDetail);
|
||||
detail.setSideModelDetail(sideModelDetail);
|
||||
detail.setSideHoleDetail(sideHoleDetail);
|
||||
|
||||
// PartDetail partDetail = new PartDetail();
|
||||
// PartDetail[] partDetailList = {partDetail,partDetail};
|
||||
// PlateDetail[] plateDetailList = {plateDetail,plateDetail};
|
||||
// CabinetsDetail cabinetsDetail = new CabinetsDetail();
|
||||
// cabinetsDetail.setPlateDetail(plateDetailList);
|
||||
// cabinetsDetail.setPartsDetail(partDetailList);
|
||||
// RoomDetail roomDetail = new RoomDetail();
|
||||
// CabinetsDetail[] cabinetsDetailList = {cabinetsDetail,cabinetsDetail};
|
||||
// roomDetail.setCabinetsDetail(cabinetsDetailList);
|
||||
// Detail detail = new Detail();
|
||||
// RoomDetail[] roomDetailList = {roomDetail,roomDetail};
|
||||
// detail.setRoomDetail(roomDetailList);
|
||||
// Detail[] detailList = {detail,detail};
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String detailListJson = objectMapper.writeValueAsString(detail);
|
||||
System.out.println(
|
||||
detailListJson
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//测试字节数组
|
||||
// System.err.println("字节压缩/解压缩测试");
|
||||
// String inputStr = "snowolf@zlex.org;dongliang@zlex.org;zlex.dongliang@zlex.org";
|
||||
// System.err.println("输入字符串:\t" + inputStr);
|
||||
// byte[] input = inputStr.getBytes();
|
||||
// System.err.println("输入字节长度:\t" + input.length);
|
||||
//
|
||||
// byte[] data = ZLibUtils.compress(input);
|
||||
// System.err.println("压缩后字节长度:\t" + data.length);
|
||||
//
|
||||
// byte[] output = ZLibUtils.decompress(data);
|
||||
// System.err.println("解压缩后字节长度:\t" + output.length);
|
||||
// String outputStr = new String(output);
|
||||
// System.err.println("输出字符串:\t" + outputStr);
|
||||
//
|
||||
// //测试文件
|
||||
// String filename = "zlib";
|
||||
// File file = new File(filename);
|
||||
// System.err.println("文件压缩/解压缩测试");
|
||||
// try {
|
||||
//
|
||||
// FileOutputStream fos = new FileOutputStream(file);
|
||||
// ZLibUtils.compress(input, fos);
|
||||
// fos.close();
|
||||
// System.err.println("压缩后字节长度:\t" + file.length());
|
||||
// } catch (Exception e) {
|
||||
// System.err.println("错误:\t" + e.getMessage());
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// FileInputStream fis = new FileInputStream(file);
|
||||
// output = ZLibUtils.decompress(fis);
|
||||
// fis.close();
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// System.err.println("错误:\t" + e.getMessage());
|
||||
// }
|
||||
// System.err.println("解压缩后字节长度:\t" + output.length);
|
||||
// outputStr = new String(output);
|
||||
// System.err.println("输出字符串:\t" + outputStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* CAD板件信息详情
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class Detail {
|
||||
// 柜体成倍拆单数据
|
||||
private Integer multiNum;
|
||||
// 柜体 长 宽 深
|
||||
private Double width;
|
||||
private Double height;
|
||||
private Double depth;
|
||||
|
||||
// 板材所属加工组
|
||||
private List<String> group;// 板件加工组Group的名称,可以有多个
|
||||
private String groupName;// 加工组中Group中每个小加工组的名称
|
||||
|
||||
// 大板信息
|
||||
private IBoardProdInfo iBoardProdInfo;
|
||||
// 配件信息
|
||||
private List<IBoardProdInfo> partsDetail ;
|
||||
|
||||
private List<ModelDetail> contourDetail ; //轮廓明细
|
||||
private List<PointDetail> pointDetail ; //点明细
|
||||
private HoleDetail holeDetail ; //孔明细
|
||||
private List<PointDetail> rawPointDetail ; //原始点明细
|
||||
private List<ModelDetail> sideModelDetail ; //侧面轮廓明细
|
||||
private List<HoleDetail> sideHoleDetail;//侧面孔明细
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 孔明细
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HoleDetail {
|
||||
|
||||
@Schema(description = "孔ID")
|
||||
private Integer holeId; //孔ID
|
||||
@Schema(description = "孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔)")
|
||||
private Integer holeType;// 孔类型(0大孔, 10小孔, 20木削, 21木削大孔, 30层板钉, 40通孔, 50连接杆, -10造型孔)
|
||||
@Schema(description = "孔面类型(0正面, 1反面, 2侧面)")
|
||||
private Integer faceType; // 孔面类型(0正面, 1反面, 2侧面)
|
||||
private float pointX;
|
||||
private float pointY;
|
||||
private float pointZ;
|
||||
@Schema(description = "孔半径")
|
||||
private float radius; //孔半径
|
||||
@Schema(description = "孔深度")
|
||||
private float depth; //孔深度
|
||||
@Schema(description = "孔末端点")
|
||||
private float endPoint; //孔末端点
|
||||
private float pointX2;
|
||||
private float pointY2;
|
||||
@Schema(description = "角度")
|
||||
private float angle; //角度
|
||||
|
||||
}
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 板件属性信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IBoardProdInfo {
|
||||
|
||||
// 基础分类信息
|
||||
private String roomsName; //房间名称
|
||||
private String cabinetsName; //柜体名
|
||||
private int synthesis; //组合类型
|
||||
private String synthesisTypeName; //组合类型的名称
|
||||
private String combinationName; //组合名称
|
||||
|
||||
// 商品信息
|
||||
private String goodsId; // 商品编码
|
||||
private String goodsName; //商品名称
|
||||
private int goodType; //商品类型
|
||||
private String material; //材质
|
||||
private String color; //颜色
|
||||
private String factory; //商品生产厂商
|
||||
private String brand; //商品品牌
|
||||
private String model; //商品型号
|
||||
private Double thickness;//规格-板厚 板厚,成品和开料都是一样的
|
||||
private String spec; //商品规格
|
||||
private String unit; //商品单位
|
||||
|
||||
// 当有板件时就有板件信息
|
||||
private Double goodsNumber; //产品数量为特殊处理,板件和配件都有数量
|
||||
// 生产小板 板件信息
|
||||
private Long plateId; //板件Id
|
||||
private Long rawGoodsId;//未对应商品Id
|
||||
private String plateNo;//自定义板号
|
||||
private String name; //板件名称
|
||||
private Integer texture; //纹路 纹路(0正纹1可翻转2反纹)
|
||||
private int typographicFace; //排版面 排钻类型(0正面1反面2随意面)
|
||||
private int openDoorType; //开门类型 0非门板,1左开,2右开,3上翻,4下翻
|
||||
private Boolean isRect; //是否为矩形
|
||||
|
||||
private float splitHeight; //开料长
|
||||
private float splitWidth; //开料宽
|
||||
private float splitThickness; //开料厚度
|
||||
|
||||
private float decomposeHeight; //拆单长
|
||||
private float decomposeWidth; //拆单宽
|
||||
private float decomposeThickness; //拆单厚度
|
||||
|
||||
private float height; //成品长
|
||||
private float width; //成品宽
|
||||
// private BigDecimal thickness; //成品厚度和开料的厚度相同
|
||||
|
||||
private float edgeHeight; //外封边长
|
||||
private float edgeWidth; //外封边宽
|
||||
private float edgeThickness; //外封边厚度
|
||||
|
||||
private float sealLeft; //左封边
|
||||
private float sealRight; //右封边
|
||||
private float sealUp; //上封边
|
||||
private float sealDown; //下封边
|
||||
|
||||
private String remark; //备注
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plan.dto.Point;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 轮廓数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IContourData {
|
||||
private List<Point> pts; //点集(二维向量(x,y))
|
||||
private float[] buls; //凸度(0直线段 >0逆时针方向 <0顺时针方向)
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Dictionary;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 造型数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class IOriginModelingData {
|
||||
|
||||
@Schema(description = "轮郭")
|
||||
private IContourData outline;
|
||||
@Schema(description = "孔轮廓")
|
||||
private List<IContourData> holes;
|
||||
@Schema(description ="厚度" )
|
||||
private float thickness;
|
||||
@Schema(description = "0正面、1反面、2侧面")
|
||||
private Integer dir;
|
||||
@Schema(description = "刀半径")
|
||||
private float knifeRadius;
|
||||
@Schema(description = "槽加长")
|
||||
private float addLen;
|
||||
@Schema(description = "槽加宽")
|
||||
private float addWidth;
|
||||
@Schema(description = "槽加深")
|
||||
private float addDepth;
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 造型明细
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class ModelDetail {//去除order_module_extra
|
||||
@Schema(description = "造型ID")
|
||||
private Integer modelId; //造型ID
|
||||
@Schema(description = "纹路ID")
|
||||
private Integer lineID; //纹路ID
|
||||
@Schema(description = "排版面 0正面, 1反面, 2侧面")
|
||||
private Integer typographicFace; //排版面 0正面, 1反面, 2侧面
|
||||
@Schema(description = "刀具名称")
|
||||
private String knifeName; //刀具名称
|
||||
@Schema(description = "刀半径")
|
||||
private float knifeRadius; //刀半径
|
||||
@Schema(description = "深度")
|
||||
private float depth; //深度
|
||||
@Schema(description = "造型数据")
|
||||
private IOriginModelingData originModeling; //造型数据
|
||||
@Schema(description = "点列表")
|
||||
private List<PointList> pointList; //点列表
|
||||
@Schema(description = "偏移量列表 //模块偏移数据")
|
||||
private List<OffSetList> offSetList; //偏移量列表 //模块偏移数据
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 偏移量列表 模块偏移数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class OffSetList {
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name; //名称
|
||||
@Schema(description = "面向类型(0正面, 1反面, 2侧面)")
|
||||
private Integer faceType;// 面向类型(0正面, 1反面, 2侧面)
|
||||
@Schema(description = "值")
|
||||
private float value; //值
|
||||
@Schema(description = "半径")
|
||||
private float radius;//半径
|
||||
@Schema(description = "深度")
|
||||
private float deep;//深度
|
||||
@Schema(description = "角度")
|
||||
private float angle;//角度
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
* 五金配置的extra
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PartsModuleExtra {
|
||||
private String name;
|
||||
private String bodyName;
|
||||
private String model;
|
||||
private String spec;
|
||||
private String unit;
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
* 小板的extra数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PlateModuleExtra {
|
||||
private float width;
|
||||
private float height;
|
||||
private Double thickness;
|
||||
private String groupType;
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 点明细
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class PointDetail {
|
||||
private Integer pointId;
|
||||
private float pointX;
|
||||
private float pointY;
|
||||
@Schema(description = "曲线")
|
||||
private float curve;//曲线
|
||||
@Schema(description = "封边尺寸")
|
||||
private float SealSize;//封边尺寸
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.cf.imes.module.executor.util.deviseData;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 点列表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免生产单导入有问
|
||||
public class PointList {
|
||||
private Integer lineId;//纹路Id
|
||||
private Integer pointId;//点Id
|
||||
private float pointX;
|
||||
private float pointY;
|
||||
private float radius;
|
||||
private float depth;
|
||||
private float curve;
|
||||
}
|
||||
+12
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.executor.util.deviseData.dataTwo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.es.core.dal.ESDocument;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -99,6 +100,16 @@ public class PlateDetail{
|
||||
private List<HoleDetail> sideHoleDetail;//侧面孔明细
|
||||
|
||||
// 备注
|
||||
private Map<String,String> remark;// 板件备注
|
||||
private Map<String,String> remark;// 板件备注 (生产数据接口中)
|
||||
private Map<String,String> sideRemark;// 封边备注
|
||||
|
||||
private String extraRemark; // 扩展备注(包含铰链备注、订单板件流水号)(板材明细中)
|
||||
private String specialRemarkDei; // 特殊备注(Json字符串)
|
||||
private String extraHandleRemark; // 拉手备注
|
||||
private String drillsRemark; // 排钻备注(Json字符串)
|
||||
private String infoRemark; // 板其他备注(Json字符串)
|
||||
private String remarkJsonDei; // 板件备注(Json字符串)
|
||||
|
||||
private String remarkJson; // 普通备注(板材数据中)
|
||||
private String specialRemark; // 特殊备注(板材数据中)
|
||||
}
|
||||
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.api.application.ApplicationApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* api数据获取
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ApiDataAchieve {
|
||||
|
||||
@Resource
|
||||
private ApiDataProduction apiDataProduction;
|
||||
|
||||
@Resource
|
||||
private ApplicationApi applicationApi;
|
||||
|
||||
private static final int PARTS_PAGE_MAX = 100;
|
||||
|
||||
// 获得token数据
|
||||
public String getApiToken(Long organId) {
|
||||
JSONObject app = applicationApi.getApplicationByOrganId(organId);
|
||||
String appId = app.getString("appId");
|
||||
String appSecret = app.getString("appSecret");
|
||||
|
||||
JSONObject json = apiDataProduction.getApiTokenMessage(appId, appSecret);
|
||||
if (!json.getString("err_msg").equals("success")) {
|
||||
throw exception(APP_TOKEN_ERROR);
|
||||
}
|
||||
String token = json.getJSONObject("info").getString("access_token");
|
||||
return token;
|
||||
}
|
||||
|
||||
// 获取板件生产数据信息
|
||||
// @Async
|
||||
public JSONObject getApiPlateProData(String token, String orderNo) {
|
||||
JSONObject jsonPlatesData = new JSONObject();
|
||||
jsonPlatesData.put("order_no", orderNo);//生产单号需要传入赋值
|
||||
jsonPlatesData.put("format", "json");
|
||||
JSONObject dataPlates = apiDataProduction.getApiOrderMessage(token, jsonPlatesData);
|
||||
if (!dataPlates.getString("err_code").equals("0")) {
|
||||
throw exception(PLATE_PLAN_DATA_ERROR);
|
||||
}
|
||||
return dataPlates;
|
||||
}
|
||||
|
||||
// 获取配件信息 分页获取
|
||||
// @Async
|
||||
public JSONObject getApiPartsMessage(String token, String orderNo) {
|
||||
JSONObject jsonParts = new JSONObject();
|
||||
jsonParts.put("curr_page", 1);
|
||||
jsonParts.put("page_count", PARTS_PAGE_MAX);
|
||||
jsonParts.put("order_no", orderNo);
|
||||
JSONObject parts = apiDataProduction.getApiOrderPartsMessage(token, jsonParts);
|
||||
if (!parts.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 = apiDataProduction.getApiOrderPartsMessage(token, jsonParts);
|
||||
dataParts = mergeJSONObjects(dataParts, value);
|
||||
}
|
||||
return dataParts;
|
||||
}
|
||||
|
||||
// 柜体信息转换
|
||||
// @Async
|
||||
public JSONObject getApiBodyMessage(String token, String orderNo) {
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
jsonBody.put("curr_page", 1);
|
||||
jsonBody.put("page_count", PARTS_PAGE_MAX);
|
||||
jsonBody.put("order_no", orderNo);
|
||||
JSONObject body = apiDataProduction.getApiOrderBodyMessage(token, jsonBody);
|
||||
if (!body.getString("err_code").equals("0")) {
|
||||
throw exception(BODY_DATA_ERROR);
|
||||
}
|
||||
JSONObject dataBody = new JSONObject();
|
||||
for (int i = 1; i <= body.getJSONObject("value").getInteger("PageCount"); i++) {
|
||||
jsonBody.put("curr_page", i);
|
||||
JSONObject value = apiDataProduction.getApiOrderBodyMessage(token, jsonBody);
|
||||
dataBody = mergeJSONObjects(dataBody, value);
|
||||
}
|
||||
return dataBody;
|
||||
}
|
||||
|
||||
// 商品信息转换
|
||||
// @Async
|
||||
public JSONObject getApiGoodsMessage(String token, String orderNo) {
|
||||
JSONObject jsonGoods = new JSONObject();
|
||||
jsonGoods.put("curr_page", 1);
|
||||
jsonGoods.put("page_count", PARTS_PAGE_MAX);
|
||||
jsonGoods.put("order_no", orderNo);
|
||||
JSONObject goods = apiDataProduction.getApiOrderGoodsMessage(token, jsonGoods);
|
||||
if (!goods.getString("err_code").equals("0")) {
|
||||
throw exception(GOODS_DATA_ERROR);
|
||||
}
|
||||
JSONObject dataGoods = new JSONObject();
|
||||
for (int i = 1; i <= goods.getJSONObject("value").getInteger("PageCount"); i++) {
|
||||
jsonGoods.put("curr_page", i);
|
||||
JSONObject value = apiDataProduction.getApiOrderGoodsMessage(token, jsonGoods);
|
||||
dataGoods = mergeJSONObjects(dataGoods, value);
|
||||
}
|
||||
return dataGoods;
|
||||
}
|
||||
|
||||
// 板材明细信息转换
|
||||
// @Async
|
||||
public JSONObject getApiPlateDetailMessage(String token, String orderNo) {
|
||||
JSONObject jsonPlates = new JSONObject();
|
||||
jsonPlates.put("curr_page", 1);
|
||||
jsonPlates.put("page_count", PARTS_PAGE_MAX);
|
||||
jsonPlates.put("order_no", orderNo);
|
||||
JSONObject plates = apiDataProduction.getApiBlocksDataMessage(token, jsonPlates);
|
||||
if (!plates.getString("err_code").equals("0")) {
|
||||
throw exception(PLATE_DATA_ERROR);
|
||||
}
|
||||
JSONObject plate = new JSONObject();
|
||||
for (int i = 1; i <= plates.getJSONObject("value").getInteger("PageCount"); i++) {
|
||||
jsonPlates.put("curr_page", i);
|
||||
JSONObject value = apiDataProduction.getApiBlocksDataMessage(token, jsonPlates);
|
||||
plate = mergeJSONObjects(plate, value);
|
||||
}
|
||||
return plate;
|
||||
}
|
||||
|
||||
// 加工组信息转换
|
||||
// @Async
|
||||
public JSONObject getApiGroupMessage(String token, String orderNo) {
|
||||
JSONObject jsonModule = new JSONObject();
|
||||
jsonModule.put("order_no", orderNo);
|
||||
JSONObject dataModule = apiDataProduction.getApiModuleTypeDataMessage(token, jsonModule);
|
||||
return dataModule;
|
||||
}
|
||||
|
||||
// 板材数据信息转换
|
||||
// @Async
|
||||
public JSONObject getApiBlocksMessage(String token, String orderNo) {
|
||||
JSONObject jsonBlocks = new JSONObject();
|
||||
jsonBlocks.put("curr_page", 1);
|
||||
jsonBlocks.put("page_count", PARTS_PAGE_MAX);
|
||||
jsonBlocks.put("order_no", orderNo);
|
||||
JSONObject blocks = apiDataProduction.getApiBlocksMessage(token, jsonBlocks);
|
||||
if (!blocks.getString("err_code").equals("0")) {
|
||||
throw exception(PLATE_DATA_ERROR);
|
||||
}
|
||||
JSONObject block = new JSONObject();
|
||||
for (int i = 1; i <= blocks.getJSONObject("value").getInteger("PageCount"); i++) {
|
||||
jsonBlocks.put("curr_page", i);
|
||||
JSONObject value = apiDataProduction.getApiBlocksMessage(token, jsonBlocks);
|
||||
block = mergeJSONObjects(block, value);
|
||||
}
|
||||
return block;
|
||||
}
|
||||
|
||||
|
||||
public JSONObject mergeJSONObjects(JSONObject object1, JSONObject object2) {
|
||||
|
||||
// 创建新对象
|
||||
JSONObject mergedObj = new JSONObject();
|
||||
// 合并 List 属性
|
||||
JSONArray mergedList = new JSONArray();
|
||||
JSONArray list1 = null;
|
||||
if (object1.getJSONObject("value") != null) {
|
||||
list1 = object1.getJSONObject("value").getJSONArray("List");
|
||||
if (list1 != null) {
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
mergedList.add(list1.getJSONObject(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (object1.getJSONArray("List") != null) {
|
||||
list1 = object1.getJSONArray("List");
|
||||
if (list1 != null) {
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
mergedList.add(list1.getJSONObject(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONArray list2 = object2.getJSONObject("value").getJSONArray("List");
|
||||
if (list2 != null) {
|
||||
for (int i = 0; i < list2.size(); i++) {
|
||||
mergedList.add(list2.getJSONObject(i));
|
||||
}
|
||||
}
|
||||
|
||||
mergedObj.put("List", mergedList);
|
||||
// System.out.println(mergedObj);
|
||||
return mergedObj;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package com.cf.imes.module.executor.service.order;
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@FeignClient(url = "https://chenfeng.tech:7779", name = "apiOrderService")
|
||||
public interface ApiOrderService {
|
||||
public interface ApiDataProduction {
|
||||
|
||||
// 登陆token
|
||||
@RequestMapping(value = "/Api-Oauth-token",method = RequestMethod.GET)
|
||||
+14
-4
@@ -110,7 +110,7 @@ public class ApiTypeRealize {
|
||||
// + " 配件Item " + partsItems + " 板材Item " + platesItems);
|
||||
map.put("orderDO", order);
|
||||
map.put("itemDO", itemsList);
|
||||
System.out.println(" bodyItemsPlates " + bodyItemsPlates);
|
||||
// System.out.println(" bodyItemsPlates " + bodyItemsPlates);
|
||||
map.put("bodyDO", bodyItemsPlates.values().stream().collect(Collectors.toList()));
|
||||
return map;
|
||||
}
|
||||
@@ -323,7 +323,7 @@ public class ApiTypeRealize {
|
||||
|
||||
}
|
||||
}
|
||||
System.out.println(" bodyInfos " + bodyInfos);
|
||||
// System.out.println(" bodyInfos " + bodyInfos);
|
||||
return bodyInfos;
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ public class ApiTypeRealize {
|
||||
}
|
||||
|
||||
/**
|
||||
* 板材信息转换 写表 Integer指板材的ItemID板id 还没有存备注!!!!!!!!!!!!!!!!!!!! 加一个板材自定义编号
|
||||
* 板材信息转换 写表 Integer指板材的ItemID板id 加一个板材自定义编号
|
||||
*/
|
||||
private Map<String, Map<Integer, ?>> platesInfoChange(JSONObject value, JSONObject dataPlates, Long orderId,
|
||||
Map<Integer, GoodsDO> goodsDOMap, Map<Integer, OrderBodyDO> bodyInfos,
|
||||
@@ -483,7 +483,14 @@ public class ApiTypeRealize {
|
||||
.build();
|
||||
|
||||
if (plateDetail.get(plate.getInteger("BlockNo")) != null) {
|
||||
plateDetail.get(plate.getInteger("BlockNo")).setPlateId(plateId);
|
||||
plateDetail.get(plate.getInteger("BlockNo")).setPlateId(plateId)
|
||||
.setExtraRemark(plate.getString("ExtraRemark"))
|
||||
.setSpecialRemarkDei(plate.getString("SpecialRemark"))
|
||||
.setExtraHandleRemark(plate.getString("ExtraHandleRemark"))
|
||||
.setDrillsRemark(plate.getString("DrillsRemark"))
|
||||
.setInfoRemark(plate.getString("InfoRemark"))
|
||||
.setRemarkJsonDei(plate.getString("RemarkJson"));
|
||||
plateInfo.setRemark(plateDetail.get(plate.getInteger("BlockNo")).getRemark().toString());
|
||||
}
|
||||
if (plateMap.get(plate.getInteger("BlockNo")) != null) {
|
||||
JSONObject jsonObject = plateMap.get(plate.getInteger("BlockNo"));
|
||||
@@ -491,6 +498,9 @@ public class ApiTypeRealize {
|
||||
.setWidth(BigDecimal.valueOf(jsonObject.getDouble("Width")))
|
||||
.setThickness(BigDecimal.valueOf(jsonObject.getDouble("Thickness")))
|
||||
.setArea(BigDecimal.valueOf(jsonObject.getDouble("Area")));
|
||||
plateDetail.get(plate.getInteger("BlockNo"))
|
||||
.setRemarkJson(jsonObject.getString("RemarkJson"))
|
||||
.setSpecialRemark(jsonObject.getString("SpecialRemark"));
|
||||
}
|
||||
platesInfos.put(plate.getInteger("ItemID"), plateInfo);
|
||||
platesItem.put(plate.getInteger("ItemID"), itemPlate);
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.cf.imes.module.executor.util.fileConversion.admin.api.webcad;
|
||||
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* @Description: 配置类实现AsyncConfigurer接口,并重写getAsyncExecutor方法,并返回一个ThreadPoolTaskExecutor,
|
||||
* 这样我们就获得一个基于线程池TaskExecutor
|
||||
* 利用@EnableAsync注解开启异步任务支持
|
||||
* @ClassName: MultiThreadingConfig
|
||||
* @Author: xiaolege
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan("com.cf.imes.module.executor.service.order")
|
||||
@EnableAsync
|
||||
public class MultiThreadingConfig implements AsyncConfigurer {
|
||||
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
|
||||
//最小线程数
|
||||
taskExecutor.setCorePoolSize(5);
|
||||
//最大线程数
|
||||
taskExecutor.setMaxPoolSize(10);
|
||||
//等待队列
|
||||
taskExecutor.setQueueCapacity(50);
|
||||
taskExecutor.setKeepAliveSeconds(600);
|
||||
//设置拒绝策略
|
||||
taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
//等待所有任务结束后再关闭线程池
|
||||
// taskExecutor.setWaitForTasksToCompleteOnShutdown(true);
|
||||
taskExecutor.initialize();
|
||||
return taskExecutor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return AsyncConfigurer.super.getAsyncUncaughtExceptionHandler();
|
||||
}
|
||||
|
||||
}
|
||||
+4
-1
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.nacos.common.utils.DateFormatUtils;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
||||
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
||||
@@ -104,6 +105,8 @@ public class ExcelReadUtil { // 文件读取
|
||||
LocalDate orderDate = LocalDate.parse(s, formatter);
|
||||
|
||||
OrderDO orderDO = OrderDO.builder()
|
||||
.organId(OrganContextHolder.getOrganId())
|
||||
.dataType(0)
|
||||
.customer((String) orderMap.get("客户"))
|
||||
.customOrderNo((String) orderMap.get("自定义单号"))
|
||||
.dealer((String) orderMap.get("经销商"))
|
||||
@@ -134,7 +137,7 @@ public class ExcelReadUtil { // 文件读取
|
||||
List<OrderPlateImportExcelVO> list) throws IOException {
|
||||
|
||||
// 加载模板
|
||||
String filePathErr = ResourceUtils.getURL("classpath:").getPath() + "\\files\\生产单新增Excel模板.xlsx";
|
||||
String filePathErr = ResourceUtils.getURL("classpath:").getPath() + "\\files\\生产单Excel导入错误导出模板.xlsx";
|
||||
//输入流
|
||||
// InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("templates/生产单新增Excel模板.xlsx");
|
||||
InputStream inputStream = ResourceUtils.getURL(filePathErr).openStream();
|
||||
|
||||
+3
-2
@@ -197,7 +197,8 @@ public class ExcelTypeRealize {
|
||||
.roomId(roomId).bodyId(bodyId).plateId(plateId)
|
||||
.num(1.0).groupId(groupId).build();
|
||||
orderItemDOS.add(orderItemDO);
|
||||
orderModelDOS.add(OrderModelDO.builder().orderId(orderId).plateId(plateId).build());
|
||||
orderModelDOS.add(OrderModelDO.builder().orderId(orderId).plateId(plateId)
|
||||
.typographicFace(Integer.valueOf(combination.getTypographicFace())).build());
|
||||
}
|
||||
plateCountByCabinetName[0] = plateCountByCabinetName[0] + plateCountByCombination[0];
|
||||
|
||||
@@ -205,7 +206,7 @@ public class ExcelTypeRealize {
|
||||
//配件
|
||||
Long partsId = (Long) snowFlakeGenerator.nextId(null);
|
||||
OrderPartsDO orderPartsDO = OrderPartsDO.builder().id(partsId).orderId(orderId).goodsId(combination.getGoodsId())
|
||||
.name(combination.getName()).material(combination.getMaterial()).type(combination.getGoodType())
|
||||
.name(combination.getGoodsName()).material(combination.getMaterial()).type(combination.getGoodType())
|
||||
.model(combination.getModel()).spec(combination.getSpec()).brand(combination.getBrand()).factory(combination.getFactory())
|
||||
.unit(combination.getUnit()).price(0.0).isComposite(false).remark(combination.remarkJSON()).isComposite(false).build();
|
||||
orderPartsDOS.add(orderPartsDO);
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@
|
||||
</delete>
|
||||
|
||||
<select id="selectModuleByOrderId" resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderModuleRespVO">
|
||||
SELECT b.order_id, b.room_id,b.id AS body_id, g.id as group_id, g.name as group_name, g.group_type_id,g.group_type_name,b.plate_num
|
||||
SELECT b.order_id, b.room_id,b.id AS body_id, g.id as group_id, g.name as group_name, g.group_type_id,g.group_type_name,
|
||||
g.plate_num AS group_num,b.plate_num AS body_num
|
||||
FROM `order_body` b
|
||||
LEFT JOIN `order_group` g ON b.id = g.body_id
|
||||
WHERE b.order_id = #{orderId}
|
||||
|
||||
+8
-8
@@ -177,15 +177,15 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode NOTIFY_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(1_002_028_000, "模板参数({})缺失");
|
||||
|
||||
|
||||
//=========== 工序信息 1-002-028-000 ============
|
||||
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_002_028_000, "工序不存在");
|
||||
ErrorCode PROCESS_IS_ENABLED = new ErrorCode(1_002_028_000, "工序已在工序组中启用,禁止关闭或删除");
|
||||
ErrorCode PROCESS_ID_IS_NULL = new ErrorCode(1_002_028_000, "工序ID填写错误不存在");
|
||||
ErrorCode PROCESS_STATUS_DISABLE = new ErrorCode(1_002_028_000, "工序状态以已禁用");
|
||||
//=========== 工序信息 1-002-027-000 ============
|
||||
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_002_027_000, "工序不存在");
|
||||
ErrorCode PROCESS_IS_ENABLED = new ErrorCode(1_002_027_001, "工序已在工序组中启用,禁止关闭或删除");
|
||||
ErrorCode PROCESS_ID_IS_NULL = new ErrorCode(1_002_027_002, "工序ID填写错误不存在");
|
||||
ErrorCode PROCESS_STATUS_DISABLE = new ErrorCode(1_002_027_003, "工序状态以已禁用");
|
||||
|
||||
//=========== 工序组信息 1-002-029-000 ============
|
||||
ErrorCode PROCESS_GROUP_NOT_EXISTS = new ErrorCode(1_002_029_000, "工序组不存在");
|
||||
ErrorCode PROCESS_GROUP_USED = new ErrorCode(1_002_029_001, "工序组已使用,禁止删除 ");
|
||||
ErrorCode PROCESS_GROUP_NOT_EXISTS = new ErrorCode(1_002_029_010, "工序组不存在");
|
||||
ErrorCode PROCESS_GROUP_USED = new ErrorCode(1_002_029_011, "工序组已使用,禁止删除 ");
|
||||
|
||||
// ========== 机台 1-002-029-000 ==========
|
||||
ErrorCode MACHINE_NOT_EXISTS = new ErrorCode(1_002_029_000, "机台不存在");
|
||||
@@ -208,7 +208,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
|
||||
//=========== 工序组信息 1-002-031-000 ============
|
||||
ErrorCode PLATE_NOT_EXISTS = new ErrorCode(1_002_029_000, "板材不存在");
|
||||
ErrorCode PLATE_NOT_EXISTS = new ErrorCode(1_002_029_001, "板材不存在");
|
||||
|
||||
//=========== 板材信息 1-002-032-000 ============
|
||||
ErrorCode PLATE_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_002_032_001, "导入板材数据不能为空!");
|
||||
|
||||
Reference in New Issue
Block a user