mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
排单-去除排单号-planNo
This commit is contained in:
+1
-35
@@ -36,7 +36,6 @@ public class OptimizePlanController {
|
|||||||
|
|
||||||
@GetMapping("/getPlateListByPlanId")
|
@GetMapping("/getPlateListByPlanId")
|
||||||
@Operation(summary = "根据排单id获取板材列表")
|
@Operation(summary = "根据排单id获取板材列表")
|
||||||
// @PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
|
||||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||||
public CommonResult<List<PlateOptimize>> getPlateListByPlanId(@Schema(description = "排单id") @RequestParam("planId") Long planId) {
|
public CommonResult<List<PlateOptimize>> getPlateListByPlanId(@Schema(description = "排单id") @RequestParam("planId") Long planId) {
|
||||||
return CommonResult.success(optimizePlanService.getPlateListByPlanId(planId));
|
return CommonResult.success(optimizePlanService.getPlateListByPlanId(planId));
|
||||||
@@ -50,13 +49,6 @@ public class OptimizePlanController {
|
|||||||
return CommonResult.success(optimizePlanService.addRemain(vo));
|
return CommonResult.success(optimizePlanService.addRemain(vo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("savePlanPlateResult")
|
|
||||||
@Operation(summary = "提交保存优化结果文件")
|
|
||||||
@OperateLog(logArgs = false)
|
|
||||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
|
||||||
public CommonResult<Boolean> savePlanPlateResult(SavePlanPlateResult result) {
|
|
||||||
return CommonResult.success(optimizePlanService.savePlanPlateResult(result));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("commit")
|
@GetMapping("commit")
|
||||||
@Operation(summary = "开始开料")
|
@Operation(summary = "开始开料")
|
||||||
@@ -72,32 +64,6 @@ public class OptimizePlanController {
|
|||||||
return success(optimizePlanService.endCutting(planId));
|
return success(optimizePlanService.endCutting(planId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getOptimizeParam")
|
|
||||||
@Operation(summary = "获取优化算法参数")
|
|
||||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
|
||||||
public CommonResult<OptimizeParamResVO> getOptimizeParam(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
|
||||||
return CommonResult.success(optimizePlanService.getOptimizeParam(planId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/getCfData")
|
|
||||||
@Operation(summary = "获取cfData")
|
|
||||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
|
||||||
public CommonResult<OptimizeParamResVO> getCfData(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
|
||||||
//todo
|
|
||||||
return CommonResult.success(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* @GetMapping("/getOptimizePlanParam")
|
|
||||||
@Operation(summary = "获取优化排单参数 (mock)")
|
|
||||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
|
||||||
@Parameter(name = "planId", description = "排单id", required = false)
|
|
||||||
public CommonResult<OptimizeParamRespVO> getOptimizePlanParam (@RequestParam (required = false) Long planId) {
|
|
||||||
*//* OptimizeParamRespVO data = RandomUtils.randomPojo(OptimizeParamRespVO.class);
|
|
||||||
return CommonResult.success(data);*//*
|
|
||||||
//todo
|
|
||||||
OptimizeParamRespVO optimizePlanParam = optimizePlanService.getOptimizePlanParam(planId);
|
|
||||||
return CommonResult.success(optimizePlanParam);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
@GetMapping("/getOrderSource")
|
@GetMapping("/getOrderSource")
|
||||||
@Operation(summary = "获取生产单源数据")
|
@Operation(summary = "获取生产单源数据")
|
||||||
@@ -107,7 +73,7 @@ public class OptimizePlanController {
|
|||||||
@Schema(description = "机台Id") @RequestParam("machineId") Long machineId
|
@Schema(description = "机台Id") @RequestParam("machineId") Long machineId
|
||||||
) {
|
) {
|
||||||
return CommonResult.success(optimizePlanService.getOrderSource(orderId, planId, machineId));
|
return CommonResult.success(optimizePlanService.getOrderSource(orderId, planId, machineId));
|
||||||
//return CommonResult.success(RandomUtils.randomPojo(OrderSource.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -16,7 +16,7 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
|||||||
public class PlanPageReqVO extends PageParam {
|
public class PlanPageReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "排单号")
|
@Schema(description = "排单号")
|
||||||
private String planNo;
|
private String id;
|
||||||
|
|
||||||
@Schema(description = "排序优先级")
|
@Schema(description = "排序优先级")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
@@ -27,8 +27,8 @@ public class PlanPageReqVO extends PageParam {
|
|||||||
@Schema(description = "排单状态:0 新单,1 板材已申请,2 开料中,3 已开料", example = "1")
|
@Schema(description = "排单状态:0 新单,1 板材已申请,2 开料中,3 已开料", example = "1")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@Schema(description = "是否支付:0 否,1 是")
|
// @Schema(description = "是否支付:0 否,1 是")
|
||||||
private Boolean isPay;
|
// private Boolean isPay;
|
||||||
|
|
||||||
@Schema(description = "机台 ID", example = "16707")
|
@Schema(description = "机台 ID", example = "16707")
|
||||||
private Long machineId;
|
private Long machineId;
|
||||||
|
|||||||
+3
-3
@@ -18,9 +18,9 @@ public class PlanRespVO {
|
|||||||
@ExcelProperty("ID")
|
@ExcelProperty("ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "排单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
// @Schema(description = "排单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("排单号")
|
// @ExcelProperty("排单号")
|
||||||
private String planNo;
|
// private String planNo;
|
||||||
|
|
||||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("排序优先级")
|
@ExcelProperty("排序优先级")
|
||||||
|
|||||||
-5
@@ -16,8 +16,6 @@ public class PlanSaveReqVO {
|
|||||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12776")
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12776")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/*@Schema(description = "排单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private String planNo;*/
|
|
||||||
|
|
||||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
//@NotNull(groups = CreateGroup.class,message = "排序优先级不能为空")
|
//@NotNull(groups = CreateGroup.class,message = "排序优先级不能为空")
|
||||||
@@ -31,9 +29,6 @@ public class PlanSaveReqVO {
|
|||||||
@NotNull(message = "排单状态:0 新单,1 板材已申请,2 开料中,3 已开料不能为空", groups = CreateGroup.class)
|
@NotNull(message = "排单状态:0 新单,1 板材已申请,2 开料中,3 已开料不能为空", groups = CreateGroup.class)
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@Schema(description = "是否支付:0 否,1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
//@NotNull(message = "是否支付:0 否,1 是不能为空")
|
|
||||||
private Boolean isPay;
|
|
||||||
|
|
||||||
@Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
@Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
||||||
@NotNull(message = "机台 ID不能为空")
|
@NotNull(message = "机台 ID不能为空")
|
||||||
|
|||||||
+4
-4
@@ -33,10 +33,10 @@ public class PlanDO extends BaseDO {
|
|||||||
// 组织 ID
|
// 组织 ID
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
private Long organId;
|
private Long organId;
|
||||||
/**
|
// /**
|
||||||
* 排单号
|
// * 排单号
|
||||||
*/
|
// */
|
||||||
private String planNo;
|
// private String planNo;
|
||||||
/**
|
/**
|
||||||
* 排序优先级
|
* 排序优先级
|
||||||
*/
|
*/
|
||||||
|
|||||||
+4
-4
@@ -30,11 +30,11 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
|||||||
return selectJoinPage(reqVO, PlanDO.class, new MPJLambdaWrapperX<PlanDO>()
|
return selectJoinPage(reqVO, PlanDO.class, new MPJLambdaWrapperX<PlanDO>()
|
||||||
.eq(PlanDO::getDeleted,false)
|
.eq(PlanDO::getDeleted,false)
|
||||||
.eq(PlanDO::getOrganId,getUserOrganId())
|
.eq(PlanDO::getOrganId,getUserOrganId())
|
||||||
.likeIfPresent(PlanDO::getPlanNo, reqVO.getPlanNo())
|
.eqIfPresent(PlanDO::getId, reqVO.getId())
|
||||||
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
||||||
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent(PlanDO::getIsPay, reqVO.getIsPay())
|
// .eqIfPresent(PlanDO::getIsPay, reqVO.getIsPay())
|
||||||
.eqIfPresent(PlanDO::getMachineId, reqVO.getMachineId())
|
.eqIfPresent(PlanDO::getMachineId, reqVO.getMachineId())
|
||||||
.betweenIfPresent(PlanDO::getPlanTime, reqVO.getPlanTime())
|
.betweenIfPresent(PlanDO::getPlanTime, reqVO.getPlanTime())
|
||||||
.likeIfPresent(PlanDO::getOrderNos, reqVO.getOrderNos())
|
.likeIfPresent(PlanDO::getOrderNos, reqVO.getOrderNos())
|
||||||
@@ -54,11 +54,11 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<PlanDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<PlanDO>()
|
||||||
.eq(PlanDO::getDeleted,false)
|
.eq(PlanDO::getDeleted,false)
|
||||||
.eq(PlanDO::getOrganId,getUserOrganId())
|
.eq(PlanDO::getOrganId,getUserOrganId())
|
||||||
.likeIfPresent(PlanDO::getPlanNo, reqVO.getPlanNo())
|
.eqIfPresent(PlanDO::getId, reqVO.getId())
|
||||||
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
.eqIfPresent(PlanDO::getSort, reqVO.getSort())
|
||||||
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
.eqIfPresent(PlanDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(PlanDO::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent(PlanDO::getIsPay, reqVO.getIsPay())
|
// .eqIfPresent(PlanDO::getIsPay, reqVO.getIsPay())
|
||||||
.eqIfPresent(PlanDO::getMachineId, reqVO.getMachineId())
|
.eqIfPresent(PlanDO::getMachineId, reqVO.getMachineId())
|
||||||
.betweenIfPresent(PlanDO::getPlanTime, reqVO.getPlanTime())
|
.betweenIfPresent(PlanDO::getPlanTime, reqVO.getPlanTime())
|
||||||
.likeIfPresent(PlanDO::getOrderNos, reqVO.getOrderNos())
|
.likeIfPresent(PlanDO::getOrderNos, reqVO.getOrderNos())
|
||||||
|
|||||||
+1
@@ -12,6 +12,7 @@ import co.elastic.clients.elasticsearch.core.search.Hit;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.cf.imes.framework.common.enums.OrderStatusEnum;
|
import com.cf.imes.framework.common.enums.OrderStatusEnum;
|
||||||
import com.cf.imes.framework.common.enums.PlanStatusEnum;
|
import com.cf.imes.framework.common.enums.PlanStatusEnum;
|
||||||
|
import com.cf.imes.framework.common.enums.ProcessProcessingTypeEnum;
|
||||||
import com.cf.imes.framework.common.enums.RemainTypeEnum;
|
import com.cf.imes.framework.common.enums.RemainTypeEnum;
|
||||||
import com.cf.imes.framework.common.exception.ServiceException;
|
import com.cf.imes.framework.common.exception.ServiceException;
|
||||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||||
|
|||||||
+3
-57
@@ -106,9 +106,9 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
// 插入
|
// 插入
|
||||||
long sort = System.currentTimeMillis();
|
long sort = System.currentTimeMillis();
|
||||||
PlanDO plan = BeanUtils.toBean(createReqVO, PlanDO.class);
|
PlanDO plan = BeanUtils.toBean(createReqVO, PlanDO.class);
|
||||||
plan.setIsPay(Boolean.FALSE);
|
// plan.setIsPay(Boolean.FALSE);
|
||||||
plan.setSort(0L);
|
plan.setSort(0L);
|
||||||
plan.setPlanNo(identifierGenerator.nextId(null).toString());
|
// plan.setPlanNo(identifierGenerator.nextId(null).toString());
|
||||||
String orderNos = itemList.stream().map(PlanSaveReqVO.Item::getOrderId).distinct().toList().toString();
|
String orderNos = itemList.stream().map(PlanSaveReqVO.Item::getOrderId).distinct().toList().toString();
|
||||||
plan.setOrderNos(orderNos);
|
plan.setOrderNos(orderNos);
|
||||||
plan.setProduceTime(null);
|
plan.setProduceTime(null);
|
||||||
@@ -161,33 +161,6 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
PlanDO plan = BeanUtils.toBean(updateReqVO, PlanDO.class);
|
PlanDO plan = BeanUtils.toBean(updateReqVO, PlanDO.class);
|
||||||
plan.setIsPay(Boolean.FALSE);
|
plan.setIsPay(Boolean.FALSE);
|
||||||
planMapper.updateById(plan);
|
planMapper.updateById(plan);
|
||||||
Long planId = plan.getId();
|
|
||||||
|
|
||||||
/*planOrderMapper.delete(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, planId));*/
|
|
||||||
|
|
||||||
/* List<Long> orderIds = updateReqVO.getOrderIds();
|
|
||||||
if (CollectionUtil.isNotEmpty(orderIds)) {
|
|
||||||
ArrayList<PlanOrderDO> planOrderDOS = new ArrayList<>();
|
|
||||||
for (Long orderId : orderIds) {
|
|
||||||
planOrderDOS.add(PlanOrderDO.builder()
|
|
||||||
.planId(planId)
|
|
||||||
.orderId(orderId)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
planOrderMapper.insertBatch(planOrderDOS);
|
|
||||||
}*/
|
|
||||||
/* planItemMapper.delete(new LambdaQueryWrapperX<PlanItemDO>().eq(PlanItemDO::getPlanId, planId));
|
|
||||||
List<Long> plateIds = updateReqVO.getPlateIds();
|
|
||||||
if (CollectionUtil.isNotEmpty(plateIds)) {
|
|
||||||
ArrayList<PlanItemDO> planItemDOS = new ArrayList<>();
|
|
||||||
for (Long plateId : plateIds) {
|
|
||||||
planItemDOS.add(PlanItemDO.builder()
|
|
||||||
.planId(planId)
|
|
||||||
.itemId(plateId)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
planItemMapper.insertBatch(planItemDOS);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,15 +243,7 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
|
|
||||||
|
|
||||||
List<Long> planIds = planDOPageResult.getList().stream().map(PlanDO::getId).collect(Collectors.toList());
|
List<Long> planIds = planDOPageResult.getList().stream().map(PlanDO::getId).collect(Collectors.toList());
|
||||||
// // 根据排单ID查询排单明细表对应的明细ID
|
|
||||||
// List<PlanItemDO> itemDOS = planItemMapper.selectList(new LambdaQueryWrapperX<PlanItemDO>().in(PlanItemDO::getPlanId, ids));
|
|
||||||
//
|
|
||||||
// List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>().in(GoodsDO::getOrderId, ids));
|
|
||||||
//
|
|
||||||
// List<Long> longs = goodsDOS.stream().map(GoodsDO::getGoodsId).collect(Collectors.toList());
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getGoodsId,longs ));
|
|
||||||
|
|
||||||
List<PlateInfoVO> plateInfoVOS = planItemMapper.selectGoodsList(planIds,getUserOrganId());
|
List<PlateInfoVO> plateInfoVOS = planItemMapper.selectGoodsList(planIds,getUserOrganId());
|
||||||
|
|
||||||
@@ -289,25 +254,6 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
|
|
||||||
PageResult<PlanRespVO> planRespVOPageResult = BeanUtils.toBean(planDOPageResult, PlanRespVO.class);
|
PageResult<PlanRespVO> planRespVOPageResult = BeanUtils.toBean(planDOPageResult, PlanRespVO.class);
|
||||||
|
|
||||||
// planRespVOPageResult.getList().forEach(e -> {
|
|
||||||
// e.setMachineName(machines.stream()
|
|
||||||
// .filter(f -> Objects.equals(f.getId(), e.getMachineId()))
|
|
||||||
// .map(CuttingRespDTO::getName)
|
|
||||||
// .findAny()
|
|
||||||
// .orElse(null));
|
|
||||||
// e.setPlateInfoList(goodsDOS.stream()
|
|
||||||
// .filter(f -> Objects.equals(f.getOrderId(), e.getId()))
|
|
||||||
// .map(p -> PlateInfoVO.builder()
|
|
||||||
// .material(p.getMaterial())
|
|
||||||
// .width(p.getWidth())
|
|
||||||
// .height(p.getHeight())
|
|
||||||
// .thickness(p.getThickness())
|
|
||||||
// .color(p.getColor())
|
|
||||||
// .area(p.getHeight().multiply(p.getWidth()).setScale(2, RoundingMode.HALF_UP))
|
|
||||||
// .count(plateDOS.stream().filter(f -> Objects.equals(f.getGoodsId(), p.getGoodsId())).collect(Collectors.toSet()).size())
|
|
||||||
// .build())
|
|
||||||
// .collect(Collectors.toList()));
|
|
||||||
// });
|
|
||||||
|
|
||||||
planRespVOPageResult.getList().forEach(e -> {
|
planRespVOPageResult.getList().forEach(e -> {
|
||||||
e.setMachineName(machines.stream()
|
e.setMachineName(machines.stream()
|
||||||
|
|||||||
+5
-4
@@ -25,12 +25,13 @@
|
|||||||
og.height as height,
|
og.height as height,
|
||||||
og.thickness as thickness ,
|
og.thickness as thickness ,
|
||||||
og.color as color,
|
og.color as color,
|
||||||
count(oi.plate_id) as plateNum,
|
count(op.id) as plateNum,
|
||||||
ROUND(og.height * og.width , 2) as area
|
sum(op.area) as area
|
||||||
|
|
||||||
from order_plan_item opi
|
from order_plan_item opi
|
||||||
join order_item oi on opi.item_id = oi.id and opi.organ_id = oi.organ_id
|
left join order_item oi on opi.item_id = oi.id and opi.organ_id = oi.organ_id
|
||||||
join order_goods og on oi.order_id = og.order_id and oi.organ_id = og.organ_id
|
left join order_plate op on oi.plate_id = op.id and oi.organ_id = op.organ_id
|
||||||
|
left join order_goods og on oi.order_id = og.order_id and oi.organ_id = og.organ_id
|
||||||
|
|
||||||
where opi.organ_id = #{organId}
|
where opi.organ_id = #{organId}
|
||||||
and
|
and
|
||||||
|
|||||||
Reference in New Issue
Block a user