mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
+20
-19
@@ -66,9 +66,10 @@ import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConsta
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.UNKNOWN;
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.organ.core.context.OrganContextHolder.getOrganId;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_NOT_EXISTS;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.PLAN_NOT_EXISTS;
|
||||
import static com.cf.imes.module.executor.util.OrganIdUtils.getUserOrganId;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
@@ -415,28 +416,28 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
public void saveOptimizationResults(SavePlanPlateResultReqVO req) {
|
||||
|
||||
|
||||
// // 判断当前的大板数据是否已经优化,有优化,更新,没有,新增
|
||||
// if (req.getOptimizeBoardModelDOS().get(0).getIsOptimized().equals(true)) {
|
||||
// try {
|
||||
// // 更新大板的优化数据
|
||||
// BulkResponse bulkResponse = esDocumentService.bulkUpdate(ORDER_REMAIN_PLATE_MODEL, req.getOptimizeBoardModelDOS());
|
||||
// boolean errors = bulkResponse.errors();
|
||||
// if (errors) {
|
||||
// log.error(bulkResponse.items().toString());
|
||||
// throw new ServiceException(500, "未知异常");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// log.error(e.getMessage());
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// 判断当前的大板数据是否已经优化,有优化,更新,没有,新增
|
||||
if (req.getOptimizeBoardModelDOS().get(0).getIsOptimized().equals(true)) {
|
||||
try {
|
||||
// 更新大板的优化数据
|
||||
BulkResponse bulkResponse = esDocumentService.bulkUpdate(ORDER_REMAIN_PLATE_MODEL, req.getOptimizeBoardModelDOS());
|
||||
boolean errors = bulkResponse.errors();
|
||||
if (errors) {
|
||||
log.error(bulkResponse.items().toString());
|
||||
throw new ServiceException(500, "未知异常");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage());
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
// 保存优化后的大板数据
|
||||
batchSaveBoardModel(req.getOptimizeBoardModelDOS());
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
if (CollectionUtil.isNotEmpty(req.getOptimizeRemainPlates())) {
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
plan.setIsPay(Boolean.FALSE);
|
||||
plan.setSort(sort);
|
||||
plan.setPlanNo(identifierGenerator.nextId(null).toString());
|
||||
String orderNos = itemList.stream().map(i -> i.getOrderId()).distinct().collect(Collectors.toList()).toString();
|
||||
String orderNos = itemList.stream().map(i -> i.getOrderId()).collect(Collectors.toList()).toString();
|
||||
plan.setOrderNos(orderNos);
|
||||
planMapper.insert(plan);
|
||||
Long planId = plan.getId();
|
||||
|
||||
Reference in New Issue
Block a user