diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java index 9caf7ab59..46831309e 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java @@ -67,7 +67,7 @@ public interface PlateMapper extends BaseMapperX { .orderByDesc(PlateDO::getId)); } -// IPage selectPlatePage(@Param("page") IPage page, @Param("orderId")Long organId, @Param("goodsId") String goodsId); + // IPage selectPlatePage(@Param("page") IPage page, @Param("orderId")Long organId, @Param("goodsId") String goodsId); List selectPlatePage( @Param("orderId") Long orderId,@Param("organId") Long organId/*, @Param("goodsId") String goodsId*/); IPage selectPlateByPlanId(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); 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 642b11e5d..513cc5acd 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 @@ -153,6 +153,15 @@ public class OrderServiceImpl implements OrderService { if (updateReqVO.getCustomOrderNo() == null || updateReqVO.getCustomOrderNo().equals("")) { updateObj.setCustomOrderNo(""); } + if (updateReqVO.getSalesman() == null || updateReqVO.getSalesman().equals("")) { + updateObj.setSalesman(""); + } + if (updateReqVO.getSplitter() == null || updateReqVO.getSplitter().equals("")) { + updateObj.setSplitter(""); + } + if (updateReqVO.getRemark() == null || updateReqVO.getRemark().equals("")) { + updateObj.setRemark(""); + } orderMapper.updateById(updateObj); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/intervalometer/OrderScheduledImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/intervalometer/OrderScheduledImpl.java index c2efcd4de..218bcf898 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/intervalometer/OrderScheduledImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/intervalometer/OrderScheduledImpl.java @@ -60,7 +60,7 @@ public class OrderScheduledImpl { public static final String ORDER_PARTS_REMARK_MODEL = "imes_order_parts_remark_model"; -// @Scheduled(cron = "0 0 2 * * ?") + // @Scheduled(cron = "0 0 2 * * ?") @OrganIgnore @Transactional(rollbackFor = Exception.class) public void fixedDeletedOrder() { 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/ApiDataAchieve.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiDataAchieve.java index 57815fff6..5ca93f9d8 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiDataAchieve.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiDataAchieve.java @@ -21,6 +21,7 @@ import java.util.concurrent.Future; import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.cf.imes.module.executor.enums.ErrorCodeConstants.*; + /** * api数据获取 */ @@ -35,9 +36,8 @@ public class ApiDataAchieve { private ApplicationApi applicationApi; private static final int PARTS_PAGE_MAX = 100; - private static final int PARTS_PAGE_MAX_Test = 95; -// 获得token数据 + // 获得token数据 public Future getApiToken(Long organId) { JSONObject app = applicationApi.getApplicationByOrganId(organId); String appId = app.getString("appId"); @@ -45,14 +45,14 @@ public class ApiDataAchieve { JSONObject json = apiDataProduction.getApiTokenMessage(appId, appSecret); if (!json.getString("err_msg").equals("success")) { -// throw exception(APP_TOKEN_ERROR); + throw exception(APP_TOKEN_ERROR); } // String token = json.getJSONObject("info").getString("access_token"); return new AsyncResult<>(json); } -// 获取板件生产数据信息 -// @Async + // 获取板件生产数据信息 + @Async public Future getApiPlateProData(String token, String orderNo) { JSONObject jsonPlatesData = new JSONObject(); jsonPlatesData.put("order_no", orderNo);//生产单号需要传入赋值 @@ -62,8 +62,8 @@ public class ApiDataAchieve { return new AsyncResult<>(dataPlates); } -// 获取配件信息 分页获取 -// @Async + // 获取配件信息 分页获取 + @Async public Future getApiPartsMessage(String token, String orderNo) { JSONObject jsonParts = new JSONObject(); jsonParts.put("curr_page", 1); @@ -72,7 +72,7 @@ public class ApiDataAchieve { JSONObject parts = apiDataProduction.getApiOrderPartsMessage(token, jsonParts); if (!parts.getString("err_code").equals("0")) { log.error("配件数据获取错误" + orderNo); -// throw exception(PARTS_DATA_ERROR); + throw exception(PARTS_DATA_ERROR); } JSONObject dataParts = new JSONObject(); for (int i = 1; i <= parts.getJSONObject("value").getInteger("PageCount"); i++) { @@ -83,8 +83,8 @@ public class ApiDataAchieve { return new AsyncResult<>(dataParts); } -// 柜体信息转换 -// @Async + // 柜体信息转换 + @Async public Future getApiBodyMessage(String token, String orderNo) { JSONObject jsonBody = new JSONObject(); jsonBody.put("curr_page", 1); @@ -93,7 +93,7 @@ public class ApiDataAchieve { JSONObject body = apiDataProduction.getApiOrderBodyMessage(token, jsonBody); if (!body.getString("err_code").equals("0")) { log.error("柜体数据获取错误" + orderNo); -// throw exception(BODY_DATA_ERROR); + throw exception(BODY_DATA_ERROR); } JSONObject dataBody = new JSONObject(); for (int i = 1; i <= body.getJSONObject("value").getInteger("PageCount"); i++) { @@ -104,8 +104,8 @@ public class ApiDataAchieve { return new AsyncResult<>(dataBody); } -// 商品信息转换 -// @Async + // 商品信息转换 + @Async public Future getApiGoodsMessage(String token, String orderNo) { JSONObject jsonGoods = new JSONObject(); jsonGoods.put("curr_page", 1); @@ -114,7 +114,7 @@ public class ApiDataAchieve { JSONObject goods = apiDataProduction.getApiOrderGoodsMessage(token, jsonGoods); if (!goods.getString("err_code").equals("0")) { log.error("商品信息转换失败" + orderNo); -// throw exception(GOODS_DATA_ERROR); + throw exception(GOODS_DATA_ERROR); } JSONObject dataGoods = new JSONObject(); for (int i = 1; i <= goods.getJSONObject("value").getInteger("PageCount"); i++) { @@ -125,8 +125,8 @@ public class ApiDataAchieve { return new AsyncResult<>(dataGoods); } -// 板材明细信息转换 -// @Async + // 板材明细信息转换 + @Async public Future getApiPlateDetailMessage(String token, String orderNo) { JSONObject jsonPlates = new JSONObject(); jsonPlates.put("curr_page", 1); @@ -135,7 +135,7 @@ public class ApiDataAchieve { JSONObject plates = apiDataProduction.getApiBlocksDataMessage(token, jsonPlates); if (!plates.getString("err_code").equals("0")) { log.error("板材明细获取错误" + orderNo); -// throw exception(PLATE_DATA_ERROR); + throw exception(PLATE_DATA_ERROR); } JSONObject plate = new JSONObject(); for (int i = 1; i <= plates.getJSONObject("value").getInteger("PageCount"); i++) { @@ -146,8 +146,8 @@ public class ApiDataAchieve { return new AsyncResult<>(plate); } -// 加工组信息转换 -// @Async + // 加工组信息转换 + @Async public Future getApiGroupMessage(String token, String orderNo) { JSONObject jsonModule = new JSONObject(); jsonModule.put("order_no", orderNo); @@ -155,8 +155,8 @@ public class ApiDataAchieve { return new AsyncResult<>(dataModule); } -// 板材数据信息转换 -// @Async + // 板材数据信息转换 + @Async public Future getApiBlocksMessage(String token, String orderNo) { JSONObject jsonBlocks = new JSONObject(); jsonBlocks.put("curr_page", 1); @@ -177,21 +177,15 @@ public class ApiDataAchieve { return new AsyncResult<>(block); } -// 订单获取 + // 订单获取 public Future getApiOrder(String token, String shopId, String orderNo) { JSONObject jsonOrders = new JSONObject(); jsonOrders.put("order_no", shopId + "@N" +orderNo); JSONObject order = apiDataProduction.getApiOrderList(token, jsonOrders); return new AsyncResult<>(order); } - public Future getApiOrder(String token) { // 批量导入专用,之后删除 - JSONObject jsonOrders = new JSONObject(); - jsonOrders.put("page_count", PARTS_PAGE_MAX_Test ); - JSONObject order = apiDataProduction.getApiOrderList(token, jsonOrders); - return new AsyncResult<>(order); - } -// 订单列表 + // 订单列表 public Future getApiOrderList(String token,String shopId,String createDateMin, String createDateMax, String orderNo, String customOrderNo) { JSONObject jsonOrders = new JSONObject(); if (createDateMin != null && createDateMax != null){ @@ -203,7 +197,7 @@ public class ApiDataAchieve { LocalDate endTime = LocalDate.parse(createDateMax, formatter); long daysBetweenSimple = ChronoUnit.DAYS.between(startTime, endTime); if (daysBetweenSimple > 30) { -// throw exception(ORDER_DATE_ERR); + throw exception(ORDER_DATE_ERR); } jsonOrders.put("create_date_min", createDateMin + " 00:00:00"); @@ -222,7 +216,7 @@ public class ApiDataAchieve { JSONObject orders = apiDataProduction.getApiOrderList(token, jsonOrders); if (!orders.getString("err_code").equals("0")) { -// throw exception(ORDER_READ_ERR); + throw exception(ORDER_READ_ERR); } JSONObject order = new JSONObject(); int countPage = divideWithPlusOne(orders.getInteger("count"), PARTS_PAGE_MAX); @@ -274,7 +268,7 @@ public class ApiDataAchieve { public int divideWithPlusOne(int dividend, int divisor) { // 首先检查除数是否为0,避免除以0的异常 if (divisor == 0) { -// throw new IllegalArgumentException("除数不能为0"); + throw new IllegalArgumentException("除数不能为0"); } // 计算商和余数 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/ApiTypeRealize.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java index 764afce64..8a0710f7f 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/util/fileConversion/admin/api/webcad/ApiTypeRealize.java @@ -78,31 +78,31 @@ public class ApiTypeRealize { Long orderId = (Long) identifierGenerator.nextId(null); // 获取组织id 之后删除 - Long orgId = 325L; +// Long orgId = 325L; // 生产单数据 - OrderDO orderDO = orderInfoChange(order, orderId, orderNo, orgId); + OrderDO orderDO = orderInfoChange(order, orderId, orderNo); List orderList = new ArrayList<>(); orderList.add(orderDO); // 商品信息数据 信息以全 - Map> goodsInfoChange = rawGoodsInfoChange(dataGoods, orderId, dataBlocks, orgId); + Map> goodsInfoChange = rawGoodsInfoChange(dataGoods, orderId, dataBlocks); List goodsDO = (List) goodsInfoChange.get("goodsDOS").values().stream().collect(Collectors.toList()); map.put("goodsDO", goodsDO); List rawGoodsDO = (List) goodsInfoChange.get("rawGoodsDOS").values().stream().collect(Collectors.toList()); map.put("rawGoodsDO", rawGoodsDO); // 柜体信息 少异形数量、板材数量 - Map bodyInfoChange = bodyInfoChange(dataBody, orderId, orgId); + Map bodyInfoChange = bodyInfoChange(dataBody, orderId); // 加工组 少异形数量、板材数量 Map> group = - groupInfoChange(dataModule, orderId, bodyInfoChange, orgId); + groupInfoChange(dataModule, orderId, bodyInfoChange); Map orderGroupDO = (Map) group.get("orderGroup"); Map> groupLists = (Map>) group.get("lists"); // 加工组中包含的板件、配件id // 配件 Map> partsDO = partsInfoChange(dataParts, orderId, - (Map) goodsInfoChange.get("goodsDOS"), bodyInfoChange, orgId); + (Map) goodsInfoChange.get("goodsDOS"), bodyInfoChange); Map partsRemark = (Map) partsDO.get("remarks"); // 配件备注 map.put("partsRemark", partsRemark.values().stream().collect(Collectors.toList())); @@ -117,7 +117,7 @@ public class ApiTypeRealize { itemsList.addAll(partsItems.values()); // 板材 写库 Map> platesDO = platesInfoChange(dataPlates, plates, orderId, - (Map) goodsInfoChange.get("goodsDOS"), bodyInfoChange, dataBlocks, orgId); + (Map) goodsInfoChange.get("goodsDOS"), bodyInfoChange, dataBlocks); Map orderPlatesDO = (Map) platesDO.get("platesInfos"); map.put("platesDO", orderPlatesDO.values().stream().collect(Collectors.toList())); map.put("plateDetail", platesDO.get("plateDetail").values().stream().collect(Collectors.toList())); @@ -221,7 +221,7 @@ public class ApiTypeRealize { /** * 加工组 信息转换 */ - private Map> groupInfoChange(JSONObject dataModule, Long orderId, Map bodyInfoChange, Long organId) { + private Map> groupInfoChange(JSONObject dataModule, Long orderId, Map bodyInfoChange) { Map> map = new HashMap<>(); Map orderGroupDOs = new HashMap<>();// 加工组id 和 加工组信息 Map> groupLists = new HashMap<>();// 加工组id 和 详细信息 @@ -248,7 +248,6 @@ public class ApiTypeRealize { .unregularNum(0) .filename("无") .remark("无") - .organId(organId) .build(); groupLists.put(group.getLong("ModuleID"), jsonArrayToList(group.getJSONArray("ItemIDList"))); orderGroupDOs.put(group.getLong("ModuleID"), bodyInfo); @@ -268,7 +267,7 @@ public class ApiTypeRealize { * @author Administrator * @date 2024/4/30 */ - public OrderDO orderInfoChange(JSONObject orderJson, Long orderId, String orderNo, Long organId) { + public OrderDO orderInfoChange(JSONObject orderJson, Long orderId, String orderNo) { // 获取 Orders 字段对应的数组 JSONObject order = orderJson.getJSONArray("data").getJSONObject(0); @@ -306,7 +305,6 @@ public class ApiTypeRealize { // .splitter("") .splitter(order.getString("cd_nick_name")) .remark(orderRemark + order.getString("comments")) - .organId(organId) .build(); Integer submitState = order.getInteger("submit_state"); @@ -346,7 +344,7 @@ public class ApiTypeRealize { * @author Administrator * @date 2024/4/30 */ - public Map> rawGoodsInfoChange(JSONObject dataRawGoods, Long orderId, JSONObject dataBlocks, Long organId) { + public Map> rawGoodsInfoChange(JSONObject dataRawGoods, Long orderId, JSONObject dataBlocks) { Map> map = new HashMap<>(); Map rawGoodsDOS = new HashMap<>(); Map goodsDOS = new HashMap<>(); @@ -369,7 +367,6 @@ public class ApiTypeRealize { .price(goods.getDouble("Price")) .brand(goods.getString("Brand")) .spec(goods.getString("Spec")) - .organId(organId) .build(); rawGoodsDOS.put(goods.getLong("GoodsID"), rawGoodsDO); @@ -388,7 +385,6 @@ public class ApiTypeRealize { .price(BigDecimal.valueOf(goods.getDouble("Price"))) .brand(goods.getString("Brand")) .spec(goods.getString("Spec")) - .organId(organId) .build(); goodsDOS.put(goods.getLong("GoodsID"), goodsDO); @@ -408,7 +404,7 @@ public class ApiTypeRealize { * @author Administrator * @date 2024/4/30 */ - private Map bodyInfoChange(JSONObject dataBody, Long orderId, Long organId) { + private Map bodyInfoChange(JSONObject dataBody, Long orderId) { Map bodyInfos = new HashMap<>(); if (dataBody.getJSONArray("List") != null && @@ -430,7 +426,6 @@ public class ApiTypeRealize { .unregularNum(0) .filename("无") .remark("无") - .organId(organId) .build(); bodyInfos.put(body.getLong("BoxID"), bodyInfo); @@ -461,7 +456,7 @@ public class ApiTypeRealize { * @author Administrator * @date 2024/4/30 */ - public Map> partsInfoChange(JSONObject value, Long orderId, Map goodsDOMap, Map bodyInfos, Long organId) { + public Map> partsInfoChange(JSONObject value, Long orderId, Map goodsDOMap, Map bodyInfos) { Map> map = new HashMap<>(); Map partsInfos = new HashMap<>(); Map partsItem = new HashMap<>(); @@ -489,7 +484,6 @@ public class ApiTypeRealize { .price(parts.getDouble("Price")) .isComposite(parts.getBoolean("IsComposite")) .remark(parts.getString("Remark")) - .organId(organId) .build(); remarks.put(parts.getLong("ItemID"), partsRemarkChange(parts, orderId, partsId)); partsInfos.put(parts.getLong("ItemID"), partsInfo); @@ -506,7 +500,6 @@ public class ApiTypeRealize { .groupId(0L) .partsId(partsId) .num(parts.getDouble("Num")) - .organId(organId) .build(); partsItem.put(parts.getLong("ItemID"), item); } @@ -541,7 +534,7 @@ public class ApiTypeRealize { */ private Map> platesInfoChange(JSONObject value, JSONObject dataPlates, Long orderId, Map goodsDOMap, Map bodyInfos, - JSONObject dataBlocks, Long organId) { + JSONObject dataBlocks) { // 板材 写ES Map plateDetail = platesDetailChange(value); @@ -604,7 +597,6 @@ public class ApiTypeRealize { .isCancel(false) .filterType("") .remark(remark) - .organId(organId) .build(); // item 明细 @@ -619,7 +611,6 @@ public class ApiTypeRealize { .groupId(0L) .partsId(0L) .plateId(plateId) - .organId(organId) .num(1.0) .build(); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml index 11701c0a4..d7faf78f9 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml @@ -14,15 +14,15 @@ LEFT JOIN `orders` b on a.order_id = b.id and a.organ_id = b.organ_id LEFT JOIN order_goods c on a.goods_id = c.id and a.organ_id = c.organ_id left join order_plan_item opi on oi.id = opi.item_id and oi.organ_id = opi.organ_id - - a.organ_id = #{organId} - and a.is_cancel = 0 - and opi.item_id is null - - and a.order_id = #{orderId} - + + a.organ_id = #{organId} + and a.is_cancel = 0 + and opi.item_id is null + + and a.order_id = #{orderId} + - + @@ -40,9 +40,16 @@ SELECT DISTINCT a.id, a.plate_no, a.height, a.thickness, a.width, a.name, a.area, a.seal_left, a.seal_right, - a.seal_up, a.seal_down, a.texture, a.hole_face, a.hole_arrange, a.unregular_point_count, a.front_hole_count, a.back_hole_count, - a.side_hole_count, a.front_model_count, a.back_model_count, a.remark, c.material, c.color + a.seal_up, a.seal_down, a.texture, a.hole_face, a.hole_arrange, a.unregular_point_count, a.front_hole_count, a.back_hole_count, + a.side_hole_count, a.front_model_count, a.back_model_count, a.remark, c.material, c.color FROM order_plate a LEFT JOIN order_goods c ON a.goods_id = c.id AND a.order_id = c.order_id and a.organ_id = c.organ_id LEFT JOIN order_item b ON a.id = b.plate_id and a.organ_id = b.organ_id