mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
优化生产权限修改,新增空小板Bug修改
This commit is contained in:
+10
-9
@@ -36,7 +36,8 @@ public class OptimizePlanController {
|
||||
|
||||
@GetMapping("/getPlateListByPlanId")
|
||||
@Operation(summary = "根据排单id获取板材列表")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
// @PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<List<PlateOptimize>> getPlateListByPlanId(@Schema(description = "排单id") @RequestParam("planId") Long planId) {
|
||||
return CommonResult.success(optimizePlanService.getPlateListByPlanId(planId));
|
||||
}
|
||||
@@ -44,7 +45,7 @@ public class OptimizePlanController {
|
||||
|
||||
@PostMapping("/addRemain")
|
||||
@Operation(summary = "添加余料板")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> addRemain(@RequestBody @Valid AddRemainReqVO vo){
|
||||
return CommonResult.success(optimizePlanService.addRemain(vo));
|
||||
}
|
||||
@@ -52,35 +53,35 @@ public class OptimizePlanController {
|
||||
@PostMapping("savePlanPlateResult")
|
||||
@Operation(summary = "提交保存优化结果文件")
|
||||
@OperateLog(logArgs = false)
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> savePlanPlateResult(SavePlanPlateResult result) {
|
||||
return CommonResult.success(optimizePlanService.savePlanPlateResult(result));
|
||||
}
|
||||
|
||||
@GetMapping("commit")
|
||||
@Operation(summary = "开始开料")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> commit(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
||||
return CommonResult.success(optimizePlanService.commit(planId));
|
||||
}
|
||||
|
||||
@GetMapping("/endCutting")
|
||||
@Operation(summary = "结束开料")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> endCutting(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
||||
return success(optimizePlanService.endCutting(planId));
|
||||
}
|
||||
|
||||
@GetMapping("/getOptimizeParam")
|
||||
@Operation(summary = "获取优化算法参数")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
@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('executor:optimize-plate:create')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<OptimizeParamResVO> getCfData(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
||||
//todo
|
||||
return CommonResult.success(null);
|
||||
@@ -100,7 +101,7 @@ public class OptimizePlanController {
|
||||
|
||||
@GetMapping("/getOrderSource")
|
||||
@Operation(summary = "获取生产单源数据")
|
||||
@PreAuthorize("@ss.hasPermission('production:manager-list:calculate')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<OrderSource> getOrderSource(@Schema(description = "生产单id") @RequestParam(required = false) Long orderId,
|
||||
@Schema(description = "排单id") @RequestParam(required = false) Long planId,
|
||||
@Schema(description = "机台Id") @RequestParam("machineId") Long machineId
|
||||
@@ -112,7 +113,7 @@ public class OptimizePlanController {
|
||||
|
||||
@GetMapping("/getLabelDataSourceValue")
|
||||
@Operation(summary = "获取标签数据源value")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Map<String,Object>> getLabelDataSourceValue(@Valid GetSourceDataReq req ) {
|
||||
return CommonResult.success( optimizePlanService.getLabelDataSourceValue(req));
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class OrderGoodsResp {
|
||||
private BigDecimal area;
|
||||
|
||||
@Schema(description = "板件数量")
|
||||
private Long num;
|
||||
private int num;
|
||||
|
||||
|
||||
@Schema(description = "生产单信息")
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
List<PlatePage> selectGoodsPage( @Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||
|
||||
|
||||
IPage<OrderGoodsResp> selectGoodsList(@Param("page") IPage<OrderGoodsResp> page,@Param("pageReqVO") OrderPageReqVOCopy pageReqVO,@Param("organId") Long organId);
|
||||
IPage<OrderGoodsResp> selectGoodsList(@Param("page") IPage<OrderGoodsResp> page,@Param("goodsIds") List<Long> goodsIds,@Param("organId") Long organId);
|
||||
|
||||
|
||||
List<OrderIds> selectOrderIds(@Param("orderIds") List<Long> orderIds,@Param("organId") Long organId);
|
||||
|
||||
+8
-1
@@ -391,7 +391,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
public PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO) {
|
||||
|
||||
|
||||
PageDTO<OrderRespVOCopy> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
PageDTO<OrderGoodsResp> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
|
||||
QueryWrapperX<OrderDO> queryWrapperX = new QueryWrapperX<>();
|
||||
queryWrapperX
|
||||
@@ -440,6 +440,13 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
|
||||
for (OrderGoodsResp record : orderGoodsResps.getRecords()) {
|
||||
record.setNum(orderRespVOCopies.stream().filter(e-> Objects.equals(e.getGoodsId(), record.getGoodsId())).
|
||||
mapToInt(OrderRespVOCopy::getNum).sum());
|
||||
|
||||
record.setArea(orderRespVOCopies.stream().filter(e-> Objects.equals(e.getGoodsId(), record.getGoodsId()))
|
||||
.map(OrderRespVOCopy::getArea)
|
||||
.reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||
|
||||
record.setOrderIds(orderIdsList.stream().filter(e -> Objects.equals(e.getGoodsId(), record.getGoodsId())).collect(Collectors.toList()));
|
||||
record.setOrderList(orderRespVOCopies.stream().filter(e -> Objects.equals(e.getGoodsId(), record.getGoodsId())).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
+1
-3
@@ -266,9 +266,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
|
||||
plateDO.setRemark(reqVO.getRemake1() +","+ reqVO.getRemake2());
|
||||
|
||||
Long goodsId = goodsMapper.selectId(reqVO.getOrderId(), reqVO.getGoodsId(), getUserOrganId()).getId();
|
||||
|
||||
plateDO.setGoodsId(goodsId);
|
||||
plateDO.setGoodsId(reqVO.getGoodsId());
|
||||
|
||||
plateDO.setPlateNo((obtainingTime) + Long.toString(plateNo).substring(2));
|
||||
|
||||
|
||||
+4
@@ -408,6 +408,10 @@
|
||||
and b.status = 2
|
||||
and a.deleted = false
|
||||
and opi.item_id is null
|
||||
and c.goods_id in
|
||||
<foreach item="goodsIds" collection="goodsIds" open="(" separator="," close=")">
|
||||
#{goodsIds}
|
||||
</foreach>
|
||||
|
||||
group by c.goods_id,c.id,b.id ,c.goods_name,c.width,c.height,c.thickness, c.material, c.color;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user