mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
api导入改善提示
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ public class ErrorCodeConstants {
|
|||||||
public static final ErrorCode ORDER_STATUS_CONFLICT = new ErrorCode(1_002_029_006, "生产单状态冲突,禁止投入生产");
|
public static final ErrorCode ORDER_STATUS_CONFLICT = new ErrorCode(1_002_029_006, "生产单状态冲突,禁止投入生产");
|
||||||
public static final ErrorCode ORDER_READ_ERR = new ErrorCode(1_002_029_006, "订单列表获取失败,请刷新重试");
|
public static final ErrorCode ORDER_READ_ERR = new ErrorCode(1_002_029_006, "订单列表获取失败,请刷新重试");
|
||||||
public static final ErrorCode ORDER_DATE_ERR = new ErrorCode(1_002_029_006, "获取订单列表,时间超出范围,请在30天范围内选择");
|
public static final ErrorCode ORDER_DATE_ERR = new ErrorCode(1_002_029_006, "获取订单列表,时间超出范围,请在30天范围内选择");
|
||||||
public static final ErrorCode ORDER_DETAIL_DATE_ERR = new ErrorCode(1_002_029_006, "板件造型数据对应有无,请重新上传");
|
public static final ErrorCode ORDER_DETAIL_DATE_ERR = new ErrorCode(1_002_029_006, "板件生产数据缺失,请确认数据源中是否存在相关数据");
|
||||||
|
|
||||||
public static final ErrorCode SOURCE_NOT_EXITS_ERROR = new ErrorCode(1_002_029_013, "源数据查询失败");
|
public static final ErrorCode SOURCE_NOT_EXITS_ERROR = new ErrorCode(1_002_029_013, "源数据查询失败");
|
||||||
public static final ErrorCode ORDER_DELETED_ERR = new ErrorCode(1_002_029_006, "生产单删除失败");
|
public static final ErrorCode ORDER_DELETED_ERR = new ErrorCode(1_002_029_006, "生产单删除失败");
|
||||||
|
|||||||
+4
-1
@@ -50,6 +50,7 @@ import java.util.concurrent.ExecutionException;
|
|||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.cf.imes.framework.common.pojo.CommonResult.error;
|
||||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.IMPORT;
|
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.IMPORT;
|
||||||
@@ -231,7 +232,9 @@ public class OrderController {
|
|||||||
orderInputProcessor.deleteByOrderId(orderId, ORDER_PLATE_MODEL_COMPRESS);
|
orderInputProcessor.deleteByOrderId(orderId, ORDER_PLATE_MODEL_COMPRESS);
|
||||||
}
|
}
|
||||||
log.error(errKey, e);
|
log.error(errKey, e);
|
||||||
return success(e.getMessage());
|
|
||||||
|
return error(500 , e.getMessage());
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
redisLockUtil.unlock(lockKey);
|
redisLockUtil.unlock(lockKey);
|
||||||
}
|
}
|
||||||
|
|||||||
+30
-14
@@ -109,6 +109,11 @@ public class ApiTypeRealize {
|
|||||||
ApiDataTypeVo platesData = results.get("plate").get();
|
ApiDataTypeVo platesData = results.get("plate").get();
|
||||||
|
|
||||||
|
|
||||||
|
// 判断生产数据是否可以为空
|
||||||
|
if (!platesData.getMapPlatesInfos().isEmpty() && plateDetailData.getMapPlateDetails().isEmpty() ) {
|
||||||
|
throw exception(ORDER_DETAIL_DATE_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
// 小板数据补充,order_goods_id添加造型相关数据判断获取,以及配件中添加goods_id
|
// 小板数据补充,order_goods_id添加造型相关数据判断获取,以及配件中添加goods_id
|
||||||
// 用方法实现,小板中添加其他信息,以及更新goods_id
|
// 用方法实现,小板中添加其他信息,以及更新goods_id
|
||||||
updateSmallBoardInfo(goodsData.getMapGoodsDO(),
|
updateSmallBoardInfo(goodsData.getMapGoodsDO(),
|
||||||
@@ -198,7 +203,7 @@ public class ApiTypeRealize {
|
|||||||
Map<String, PlateDO> mapPlatesInfos,
|
Map<String, PlateDO> mapPlatesInfos,
|
||||||
Map<String, PlateDetail> mapPlateDetailsRemarks) {
|
Map<String, PlateDetail> mapPlateDetailsRemarks) {
|
||||||
// 第一步判断是否存在需要进行数据添加的小板
|
// 第一步判断是否存在需要进行数据添加的小板
|
||||||
if (mapPlatesInfos.isEmpty()) {
|
if (mapPlatesInfos == null || mapPlatesInfos.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mapPlatesInfos.forEach((k, v) -> {
|
mapPlatesInfos.forEach((k, v) -> {
|
||||||
@@ -321,14 +326,16 @@ public class ApiTypeRealize {
|
|||||||
// System.out.println("开始2: " + System.currentTimeMillis());
|
// System.out.println("开始2: " + System.currentTimeMillis());
|
||||||
JSONObject goodsMessage = apiDataAchieve.getApiGoodsMessage(token, orderNo); // 全部信息
|
JSONObject goodsMessage = apiDataAchieve.getApiGoodsMessage(token, orderNo); // 全部信息
|
||||||
|
|
||||||
|
Map<String, RawGoodsDO> rawGoodsDOS = new HashMap<>();
|
||||||
|
Map<String, GoodsDO> goodsDOS = new HashMap<>();
|
||||||
|
|
||||||
JSONArray goodsLists = goodsMessage.getJSONArray(ProduceApiConstants.LIST);
|
JSONArray goodsLists = goodsMessage.getJSONArray(ProduceApiConstants.LIST);
|
||||||
if (goodsLists == null || goodsLists.isEmpty()) {
|
if (goodsLists == null || goodsLists.isEmpty()) {
|
||||||
throw exception(GOODS_DATA_ERROR);
|
return new ApiDataTypeVo().setMapRawGoodsDO(rawGoodsDOS).setMapGoodsDO(goodsDOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map<String, Object> map = new HashMap<>();
|
// Map<String, Object> map = new HashMap<>();
|
||||||
Map<String, RawGoodsDO> rawGoodsDOS = new HashMap<>();
|
|
||||||
Map<String, GoodsDO> goodsDOS = new HashMap<>();
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < goodsLists.size(); i++) {
|
for (int i = 0; i < goodsLists.size(); i++) {
|
||||||
@@ -401,7 +408,7 @@ public class ApiTypeRealize {
|
|||||||
JSONArray bodyLists = bodyMessage.getJSONArray(ProduceApiConstants.LIST);
|
JSONArray bodyLists = bodyMessage.getJSONArray(ProduceApiConstants.LIST);
|
||||||
|
|
||||||
if (bodyLists == null || bodyLists.isEmpty()) {
|
if (bodyLists == null || bodyLists.isEmpty()) {
|
||||||
return null;
|
return new ApiDataTypeVo();
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, OrderBodyDO> bodyInfos = new HashMap<>();
|
Map<String, OrderBodyDO> bodyInfos = new HashMap<>();
|
||||||
@@ -494,7 +501,7 @@ public class ApiTypeRealize {
|
|||||||
jsonParts.put(ProduceApiConstants.ORDER_NO_KEY, "N" + orderNo);
|
jsonParts.put(ProduceApiConstants.ORDER_NO_KEY, "N" + orderNo);
|
||||||
|
|
||||||
if (apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts) == null) {
|
if (apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts) == null) {
|
||||||
return null;
|
return new ApiDataTypeVo();
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer pageCount = apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts).getJSONObject(ProduceApiConstants.VALUE).getInteger(ProduceApiConstants.PAGE_COUNT); // 获取页码总数
|
Integer pageCount = apiDataAchieve.getApiPartsMessage(token, orderNo, jsonParts).getJSONObject(ProduceApiConstants.VALUE).getInteger(ProduceApiConstants.PAGE_COUNT); // 获取页码总数
|
||||||
@@ -674,19 +681,21 @@ public class ApiTypeRealize {
|
|||||||
Long organId) {
|
Long organId) {
|
||||||
// System.out.println("开始6: " + System.currentTimeMillis());
|
// System.out.println("开始6: " + System.currentTimeMillis());
|
||||||
|
|
||||||
|
Map<String, PlateDetail> plateDetails = new HashMap<>();
|
||||||
|
|
||||||
JSONObject jsonPlatesDetail = apiDataAchieve.getApiPlateProData(token, orderNo);
|
JSONObject jsonPlatesDetail = apiDataAchieve.getApiPlateProData(token, orderNo);
|
||||||
|
|
||||||
// 获取板件详情数据
|
// 获取板件详情数据
|
||||||
if (jsonPlatesDetail.getJSONObject(ProduceApiConstants.VALUE) == null) {
|
if (jsonPlatesDetail.getJSONObject(ProduceApiConstants.VALUE) == null) {
|
||||||
return null;
|
return new ApiDataTypeVo().setMapPlateDetails(plateDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, PlateDetail> plateDetails = new HashMap<>();
|
|
||||||
|
|
||||||
// 获取 Orders 字段对应的数组
|
// 获取 Orders 字段对应的数组
|
||||||
JSONArray ordersArray = jsonPlatesDetail.getJSONObject(ProduceApiConstants.VALUE).getJSONArray(ProduceApiConstants.OPD_ORDER);
|
JSONArray ordersArray = jsonPlatesDetail.getJSONObject(ProduceApiConstants.VALUE).getJSONArray(ProduceApiConstants.OPD_ORDER);
|
||||||
if (ordersArray == null || ordersArray.isEmpty()) {
|
if (ordersArray == null || ordersArray.isEmpty()) {
|
||||||
return null;
|
return new ApiDataTypeVo().setMapPlateDetails(plateDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ordersArray.size(); i++) {
|
for (int i = 0; i < ordersArray.size(); i++) {
|
||||||
@@ -778,11 +787,6 @@ public class ApiTypeRealize {
|
|||||||
jsonPlates.put(ProduceApiConstants.PAGE_COUNT_KEY, PARTS_PAGE_MAX);
|
jsonPlates.put(ProduceApiConstants.PAGE_COUNT_KEY, PARTS_PAGE_MAX);
|
||||||
jsonPlates.put(ProduceApiConstants.ORDER_NO_KEY, "N" + orderNo);
|
jsonPlates.put(ProduceApiConstants.ORDER_NO_KEY, "N" + orderNo);
|
||||||
|
|
||||||
if (apiDataAchieve.getApiPlateDetailMessage(token, orderNo, jsonPlates) == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer pageCount = apiDataAchieve.getApiPlateDetailMessage(token, orderNo, jsonPlates).getJSONObject(ProduceApiConstants.VALUE).getInteger(ProduceApiConstants.PAGE_COUNT); // 获取页码总数
|
|
||||||
// 根据总页码总数进行多线程循环
|
// 根据总页码总数进行多线程循环
|
||||||
Map<String, PlateDO> plateInfos = new HashMap<>();
|
Map<String, PlateDO> plateInfos = new HashMap<>();
|
||||||
Map<String, List<OrderItemDO>> plateItem = new HashMap<>();
|
Map<String, List<OrderItemDO>> plateItem = new HashMap<>();
|
||||||
@@ -796,6 +800,18 @@ public class ApiTypeRealize {
|
|||||||
Map<String, Integer> totalPlateCountMapToGroup = new HashMap<>();
|
Map<String, Integer> totalPlateCountMapToGroup = new HashMap<>();
|
||||||
Map<String, Integer> irregularPlateCountMapToGroup = new HashMap<>();
|
Map<String, Integer> irregularPlateCountMapToGroup = new HashMap<>();
|
||||||
|
|
||||||
|
if (apiDataAchieve.getApiPlateDetailMessage(token, orderNo, jsonPlates) == null) {
|
||||||
|
return new ApiDataTypeVo().setMapPlatesInfos(plateInfos).setMapItemByGroup(plateItem)
|
||||||
|
.setTotalPlateCountMapToBody(totalPlateCountMapToBody)
|
||||||
|
.setIrregularPlateCountMapToBody(irregularPlateCountMapToBody)
|
||||||
|
.setTotalPlateCountMapToGroup(totalPlateCountMapToGroup)
|
||||||
|
.setIrregularPlateCountMapToGroup(irregularPlateCountMapToGroup)
|
||||||
|
.setMapPlateDetails(plateDetailMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer pageCount = apiDataAchieve.getApiPlateDetailMessage(token, orderNo, jsonPlates).getJSONObject(ProduceApiConstants.VALUE).getInteger(ProduceApiConstants.PAGE_COUNT); // 获取页码总数
|
||||||
|
|
||||||
|
|
||||||
List<CompletableFuture<Map<String, Object>>> futures = new ArrayList<>();
|
List<CompletableFuture<Map<String, Object>>> futures = new ArrayList<>();
|
||||||
JSONObject blocksValue = apiDataAchieve.getApiBlocksMessage(token, orderNo);
|
JSONObject blocksValue = apiDataAchieve.getApiBlocksMessage(token, orderNo);
|
||||||
for (int i = 1; i <= pageCount; i++) {
|
for (int i = 1; i <= pageCount; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user