mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
排单Bug修改-生产工序查询SQL增加组织ID
This commit is contained in:
+2
-2
@@ -49,10 +49,10 @@ public class PlanSaveReqVO {
|
||||
/*@Schema(description = "板件id列表")
|
||||
private List<Long> plateIds;*/
|
||||
|
||||
@Schema(description = "生产单id与商品id 列表")
|
||||
@Schema(description = "生产单id与商品id 列表",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> itemList;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "生产操作人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
||||
+19
-20
@@ -66,10 +66,9 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -416,28 +415,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()).collect(Collectors.toList()).toString();
|
||||
String orderNos = itemList.stream().map(i -> i.getOrderId()).distinct().collect(Collectors.toList()).toString();
|
||||
plan.setOrderNos(orderNos);
|
||||
planMapper.insert(plan);
|
||||
Long planId = plan.getId();
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
||||
private OrderBodyMapper orderBodyMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Transactional
|
||||
public Long createOrderProcess(OrderProcessSaveReqVO createReqVO) {
|
||||
// 当生产不为删除时,校验生产单存在
|
||||
if (orderMapper.selectOrder(createReqVO.getOrderId(), SecurityFrameworkUtils.getLoginUser().getOrganId()).isEmpty()) {
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@
|
||||
from order_goods a
|
||||
left join order_plate b on a.goods_id = b.goods_id
|
||||
left join order_item c on c.order_id = b.order_id
|
||||
left join order_remain_plate d on a.goods_id = d.goods_id and d.plan_id = c.plan_id
|
||||
left join order_remain_plate d on a.goods_id = d.goods_id and d.plan_id = c.plan_id
|
||||
where c.plan_id = #{planId}
|
||||
GROUP BY a.id, d.id
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
select a.id as plateId, a.name, a.width, a.height, a.thickness, a.area,
|
||||
b.custom_order_no, b.customer, b.address, b.remark, b.id as orderId,
|
||||
c.goods_name, c.material, c.color, c.goods_id,oi.num,a.is_special_shaped as specialShaped,a.is_sculpt as profiling
|
||||
c.goods_name, c.material, c.color, a.goods_id,oi.num,a.is_special_shaped as specialShaped,a.is_sculpt as profiling
|
||||
|
||||
from order_plate a
|
||||
LEFT JOIN order_item oi on a.id = oi.plate_id and a.order_id = oi.order_id
|
||||
|
||||
Reference in New Issue
Block a user