mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1.机台配置添加字段,2.修改排单相关接口表逻辑
This commit is contained in:
+8
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.controller.admin.plan;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.AddRemainReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OptimizeParamResVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.SavePlanPlateResult;
|
||||
import com.cf.imes.module.executor.service.optimizeplan.OptimizePlanService;
|
||||
@@ -60,4 +61,11 @@ public class OptimizePlanController {
|
||||
return CommonResult.success(optimizePlanService.commit(planId));
|
||||
}
|
||||
|
||||
@GetMapping("/getOptimizeParam")
|
||||
@Operation(summary = "获取优化算法参数")
|
||||
@PreAuthorize("@ss.hasPermission('executor:optimize-plate:create')")
|
||||
public CommonResult<OptimizeParamResVO> getOptimizeParam(@RequestParam @Valid @NotNull(message = "排单id不能空") Long planId) {
|
||||
return CommonResult.success(optimizePlanService.getOptimizeParam(planId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class GetPlateByPlanIdVO {
|
||||
@Schema(description = "排单id")
|
||||
@NotNull(message = "排单id不能空")
|
||||
private Long palnId;
|
||||
private Long planId;
|
||||
@Schema(description = "矩形")
|
||||
private boolean rectangle;
|
||||
@Schema(description = "异形")
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "优化算法入参")
|
||||
public class OptimizeParamResVO {
|
||||
|
||||
@Schema(description = "小板列表")
|
||||
private List<PlateParam> plates;
|
||||
@Schema(description = "原料板规格列表")
|
||||
private List<RawSize> rawSizes;
|
||||
@Schema(description = "余料板数量")
|
||||
private Integer remainPlateCount;
|
||||
@Schema(description = "优化次数")
|
||||
private Integer optimizeCount;
|
||||
@Schema(description = "双面加工的小板是否优先排入")
|
||||
private Boolean isdTwoSided;
|
||||
@Schema(description = "排版缝隙 = 开料刀直径 + 缝隙 ")
|
||||
private BigDecimal gap;
|
||||
@Schema(description = "算法")
|
||||
private Boolean hssf;
|
||||
@Schema(description = "余料板是否排入双面加工的小板")
|
||||
private Boolean remainPlateBoardDo2FaceBlock;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@Schema(description = "原料板规格")
|
||||
public static class RawSize {
|
||||
@Schema(description = "长")
|
||||
private BigDecimal length;
|
||||
@Schema(description = "宽")
|
||||
private BigDecimal width;
|
||||
@Schema(description = "x")
|
||||
private BigDecimal x;
|
||||
@Schema(description = "y")
|
||||
private BigDecimal y;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+2
-2
@@ -41,8 +41,8 @@ public class PlanSaveReqVO {
|
||||
@NotNull(message = "计划时间不能为空")
|
||||
private LocalDateTime planTime;
|
||||
|
||||
@Schema(description = "生产单id列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> orderIds;
|
||||
/*@Schema(description = "生产单id列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> orderIds;*/
|
||||
|
||||
@Schema(description = "板件id列表")
|
||||
private List<Long> plateIds;
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class PlateParam {
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
@Schema(description = "板编号")
|
||||
private String plateNo;
|
||||
@Schema(description = "长")
|
||||
private BigDecimal length;
|
||||
@Schema(description = "宽")
|
||||
private BigDecimal width;
|
||||
@Schema(description = "纹路类型 0 正纹 1 可翻转 2 反纹")
|
||||
private Integer texture;
|
||||
@Schema(description = " 排孔类型,0 正纹 1 反面 2 随意面")
|
||||
private Integer holeArrange;
|
||||
@Schema(description = "孔面类型")
|
||||
private Integer holeFace;
|
||||
@Schema(description = "是否矩形")
|
||||
private Boolean isRect;
|
||||
@Schema(description = "有网洞")
|
||||
private Boolean hasHole;
|
||||
@Schema(description = "是否双面")
|
||||
private Boolean isdTwoSided;
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package com.cf.imes.module.executor.dal.dataobject.planorder;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 排单生产单关联 DO
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("prod_plan_order")
|
||||
@KeySequence("prod_plan_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PlanOrderDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 排单id
|
||||
*/
|
||||
private Long planId;
|
||||
/**
|
||||
* 生产单id
|
||||
*/
|
||||
private Long orderId;
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.cf.imes.module.executor.dal.mysql.planorder;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planorder.PlanOrderDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 排单生产单关联 Mapper
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@Mapper
|
||||
public interface PlanOrderMapper extends BaseMapperX<PlanOrderDO> {
|
||||
|
||||
|
||||
}
|
||||
+4
@@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OptimizeParamResVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
@@ -65,4 +67,6 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
IPage<PlatePage> selectPlatePage(@Param("page") IPage<PlatePage> page, @Param("orderId")Long organId, @Param("goodsId") String goodsId);
|
||||
|
||||
List<PlateResList> selectPlateByPlanId(@Param(Constants.WRAPPER) Wrapper<PlateDO> wrapper);
|
||||
|
||||
List<PlateParam> selectPlateList(Long planId);
|
||||
}
|
||||
+3
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.executor.service.optimizeplan;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.AddRemainReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OptimizeParamResVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.SavePlanPlateResult;
|
||||
|
||||
@@ -14,4 +15,6 @@ public interface OptimizePlanService {
|
||||
Boolean savePlanPlateResult(SavePlanPlateResult result);
|
||||
|
||||
Boolean commit(Long planId);
|
||||
|
||||
OptimizeParamResVO getOptimizeParam(Long planId);
|
||||
}
|
||||
|
||||
+21
-3
@@ -1,12 +1,12 @@
|
||||
package com.cf.imes.module.executor.service.optimizeplan;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.AddRemainReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateOptimize;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.SavePlanPlateResult;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plan.PlanDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.remainplaten.RemainPlateDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.plan.PlanMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.remainplaten.RemainPlateMapper;
|
||||
import com.cf.imes.module.infra.api.file.FileApi;
|
||||
import com.cf.imes.module.infra.api.file.dto.FileCreateReqDTO;
|
||||
@@ -36,6 +36,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
@Resource
|
||||
private FileApi fileApi;
|
||||
|
||||
@Resource
|
||||
private PlateMapper plateMapper;
|
||||
|
||||
@Override
|
||||
public List<PlateOptimize> getPlateListByPlanId(Long planId) {
|
||||
return planMapper.selectPlateListByPlanId(planId);
|
||||
@@ -112,4 +115,19 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
.build());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OptimizeParamResVO getOptimizeParam(Long planId) {
|
||||
//小板列表
|
||||
List<PlateParam> plates = plateMapper.selectPlateList(planId);
|
||||
//余料规格列表
|
||||
|
||||
//大板规格
|
||||
|
||||
//余料板数量
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+32
-29
@@ -10,23 +10,23 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.module.ModuleDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planorder.PlanOrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.module.ModuleMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planorder.PlanOrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.system.api.machine.MachineApi;
|
||||
import com.cf.imes.module.system.api.machine.dto.CuttingRespDTO;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -65,9 +65,6 @@ public class PlanServiceImpl implements PlanService {
|
||||
@Resource
|
||||
private GoodsMapper goodsMapper;
|
||||
|
||||
@Resource
|
||||
private PlanOrderMapper planOrderMapper;
|
||||
|
||||
@Resource
|
||||
private PlanItemMapper planItemMapper;
|
||||
|
||||
@@ -94,7 +91,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
PlanDO plan = BeanUtils.toBean(createReqVO, PlanDO.class);
|
||||
planMapper.insert(plan);
|
||||
Long planId = plan.getId();
|
||||
List<Long> orderIds = createReqVO.getOrderIds();
|
||||
/* List<Long> orderIds = createReqVO.getOrderIds();
|
||||
if (CollectionUtil.isNotEmpty(orderIds)) {
|
||||
ArrayList<PlanOrderDO> planOrderDOS = new ArrayList<>();
|
||||
for (Long orderId : orderIds) {
|
||||
@@ -104,7 +101,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
.build());
|
||||
}
|
||||
planOrderMapper.insertBatch(planOrderDOS);
|
||||
}
|
||||
}*/
|
||||
List<Long> plateIds = createReqVO.getPlateIds();
|
||||
if (CollectionUtil.isNotEmpty(plateIds)) {
|
||||
ArrayList<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||
@@ -130,10 +127,10 @@ public class PlanServiceImpl implements PlanService {
|
||||
planMapper.updateById(plan);
|
||||
Long planId = plan.getId();
|
||||
|
||||
planOrderMapper.delete(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, planId));
|
||||
/*planOrderMapper.delete(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, planId));*/
|
||||
planItemMapper.delete(new LambdaQueryWrapperX<PlanItemDO>().eq(PlanItemDO::getPlanId, planId));
|
||||
|
||||
List<Long> orderIds = updateReqVO.getOrderIds();
|
||||
/* List<Long> orderIds = updateReqVO.getOrderIds();
|
||||
if (CollectionUtil.isNotEmpty(orderIds)) {
|
||||
ArrayList<PlanOrderDO> planOrderDOS = new ArrayList<>();
|
||||
for (Long orderId : orderIds) {
|
||||
@@ -143,7 +140,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
.build());
|
||||
}
|
||||
planOrderMapper.insertBatch(planOrderDOS);
|
||||
}
|
||||
}*/
|
||||
List<Long> plateIds = updateReqVO.getPlateIds();
|
||||
if (CollectionUtil.isNotEmpty(plateIds)) {
|
||||
ArrayList<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||
@@ -171,7 +168,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
}
|
||||
// 删除
|
||||
planMapper.deleteById(id);
|
||||
planOrderMapper.delete(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, id));
|
||||
/*planOrderMapper.delete(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, id));*/
|
||||
planItemMapper.delete(new LambdaQueryWrapperX<PlanItemDO>().eq(PlanItemDO::getPlanId, id));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
@@ -185,13 +182,18 @@ public class PlanServiceImpl implements PlanService {
|
||||
@Override
|
||||
public PlanRespVO getPlan(Long id) {
|
||||
PlanDO planDO = planMapper.selectById(id);
|
||||
Set<Long> orderIds = planOrderMapper.selectList(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, planDO.getPlanNo()))
|
||||
MPJLambdaWrapper<OrderItemDO> wrapper = new MPJLambdaWrapperX<OrderItemDO>().select(OrderItemDO::getOrderId)
|
||||
.rightJoin(PlanItemDO.class, PlanItemDO::getItemId, OrderItemDO::getId)
|
||||
.isNotNull(OrderItemDO::getId);
|
||||
Set<Long> orderIds = orderItemMapper.selectJoinList(OrderItemDO.class, wrapper).stream().map(OrderItemDO::getOrderId).collect(Collectors.toSet());
|
||||
|
||||
/*Set<Long> orderIds = planOrderMapper.selectList(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, planDO.getPlanNo()))
|
||||
.stream()
|
||||
.map(e -> e.getOrderId())
|
||||
.collect(Collectors.toSet());
|
||||
.collect(Collectors.toSet());*/
|
||||
PlanRespVO respVO = BeanUtils.toBean(planDO, PlanRespVO.class);
|
||||
List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>().in(GoodsDO::getOrderId, orderIds));
|
||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getGoodsId, goodsDOS.stream().map(e -> e.getGoodsId()).collect(Collectors.toSet())));
|
||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getGoodsId, goodsDOS.stream().map(GoodsDO::getGoodsId).collect(Collectors.toSet())));
|
||||
List<PlateInfoVO> plateInfoVOS = goodsDOS.stream().map(e -> PlateInfoVO.builder()
|
||||
.material(e.getMaterial())
|
||||
.width(e.getWidth())
|
||||
@@ -211,14 +213,14 @@ public class PlanServiceImpl implements PlanService {
|
||||
if (CollectionUtil.isEmpty(planDOPageResult.getList())) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
Set<Long> macheineIds = planDOPageResult.getList().stream().map(e -> e.getMachineId()).collect(Collectors.toSet());
|
||||
Set<Long> macheineIds = planDOPageResult.getList().stream().map(PlanDO::getMachineId).collect(Collectors.toSet());
|
||||
List<CuttingRespDTO> machines = machineApi.list(macheineIds).getCheckedData();
|
||||
Set<Long> ids = planDOPageResult.getList().stream().map(e -> e.getId()).collect(Collectors.toSet());
|
||||
Set<Long> ids = planDOPageResult.getList().stream().map(PlanDO::getId).collect(Collectors.toSet());
|
||||
List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>().in(GoodsDO::getOrderId, ids));
|
||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getGoodsId, goodsDOS.stream().map(e -> e.getGoodsId()).collect(Collectors.toSet())));
|
||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getGoodsId, goodsDOS.stream().map(GoodsDO::getGoodsId).collect(Collectors.toSet())));
|
||||
PageResult<PlanRespVO> planRespVOPageResult = BeanUtils.toBean(planDOPageResult, PlanRespVO.class);
|
||||
planRespVOPageResult.getList().stream().forEach(e -> {
|
||||
e.setMachineName(machines.stream().filter(f -> Objects.equals(f.getId(), e.getMachineId())).map(m -> m.getName()).findAny().orElse(null));
|
||||
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()
|
||||
@@ -307,7 +309,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
throw exception(PLAN_NOT_ALLOW_CANCEL);
|
||||
}
|
||||
Set<Long> itemIds = planItemMapper.selectList(new LambdaQueryWrapperX<PlanItemDO>().eq(PlanItemDO::getPlanId, id))
|
||||
.stream().map(e -> e.getItemId())
|
||||
.stream().map(PlanItemDO::getItemId)
|
||||
.collect(Collectors.toSet());
|
||||
plateMapper.update(new LambdaUpdateWrapper<PlateDO>().in(PlateDO::getId, itemIds).set(PlateDO::getIsCancel, Boolean.TRUE));
|
||||
return Boolean.TRUE;
|
||||
@@ -315,7 +317,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
@Override
|
||||
public List<PlateResList> getPlateByPlanId(GetPlateByPlanIdVO vo) {
|
||||
validatePlanExists(vo.getPalnId());
|
||||
validatePlanExists(vo.getPlanId());
|
||||
QueryWrapperX<PlateDO> queryWrapperX = new QueryWrapperX<>();
|
||||
List<Integer> filterTypes = new ArrayList<>();
|
||||
if (vo.isHoleThrough()) {
|
||||
@@ -329,23 +331,24 @@ public class PlanServiceImpl implements PlanService {
|
||||
}
|
||||
queryWrapperX.betweenIfPresent("a.width", new BigDecimal[]{vo.getWidthMinRang(), vo.getWidthMaxRang()})
|
||||
.betweenIfPresent("a.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()})
|
||||
.inIfPresent("c.filter_type", filterTypes)
|
||||
.inIfPresent("a.filter_type", filterTypes)
|
||||
.betweenIfPresent("f.delivery_date", new Date[]{vo.getBeginDate(), vo.getEndDate()})
|
||||
.inIfPresent("a.filter_type", filterTypes)
|
||||
.eq("a.id", vo.getPalnId())
|
||||
.eq("p.plan_id", vo.getPlanId())
|
||||
;
|
||||
|
||||
|
||||
List<PlateResList> list = plateMapper.selectPlateByPlanId(queryWrapperX);
|
||||
Set<Long> bodyIds = list.stream().map(e -> e.getBodyId()).collect(Collectors.toSet());
|
||||
Set<Long> roomIds = list.stream().map(e -> e.getRoomId()).collect(Collectors.toSet());
|
||||
List<ModuleDO> moduleDOS = moduleMapper.selectList(new LambdaQueryWrapperX<ModuleDO>().in(ModuleDO::getId, bodyIds).eq(ModuleDO::getType, 2)
|
||||
Set<Long> bodyIds = list.stream().map(PlateResList::getBodyId).collect(Collectors.toSet());
|
||||
Set<Long> roomIds = list.stream().map(PlateResList::getRoomId).collect(Collectors.toSet());
|
||||
//todo 获取柜体名称,房间名称
|
||||
/* List<ModuleDO> moduleDOS = moduleMapper.selectList(new LambdaQueryWrapperX<ModuleDO>().in(ModuleDO::getId, bodyIds).eq(ModuleDO::getType, 2)
|
||||
.or().in(ModuleDO::getId, roomIds).eq(ModuleDO::getType, 1)
|
||||
);
|
||||
for (PlateResList resList : list) {
|
||||
resList.setBodyName(moduleDOS.stream().filter(e -> Objects.equals(e.getId(), resList.getBodyId())).map(e -> e.getName()).findAny().orElse(null));
|
||||
resList.setRoomName(moduleDOS.stream().filter(e -> Objects.equals(e.getId(), resList.getRoomId())).map(e -> e.getName()).findAny().orElse(null));
|
||||
}
|
||||
resList.setBodyName(moduleDOS.stream().filter(e -> Objects.equals(e.getId(), resList.getBodyId())).map(ModuleDO::getName).findAny().orElse(null));
|
||||
resList.setRoomName(moduleDOS.stream().filter(e -> Objects.equals(e.getId(), resList.getRoomId())).map(ModuleDO::getName).findAny().orElse(null));
|
||||
}*/
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
select a.goods_id, a.goods_name, a.material, a.color, a.width, a.height, a.thickness, count(b.id) as plateNum, d.*
|
||||
from order_goods a
|
||||
left join order_plate b on a.goods_id = b.goods_id
|
||||
left join prod_plan_order c on c.order_id = b.order_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
|
||||
where c.plan_id = #{planId}
|
||||
GROUP BY a.id, d.id
|
||||
|
||||
+12
-4
@@ -24,12 +24,20 @@
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList">
|
||||
select a.order_id, a.plate_no , a.name, e.material, e.color, e.width, e.height, e.thickness, b.room_id, b.body_id
|
||||
from order_plate a
|
||||
left join order_item b on a.id = b.plate_id
|
||||
left join order_plan_item c on a.id = c.item_id
|
||||
left join order_goods e on e.goods_id = a.goods_id and e.order_id = a.order_id
|
||||
left join `order` f on f.id = a.order_id
|
||||
LEFT JOIN order_item b ON a.id = b.plate_id
|
||||
LEFT JOIN order_goods e ON e.goods_id = a.goods_id AND e.order_id = a.order_id
|
||||
LEFT JOIN order_plan_item p ON b.id = p.item_id
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
</select>
|
||||
<select id="selectPlateList"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam">
|
||||
select a.id, a.plate_no, a.height length, a.width, a.texture, a.hole_arrange, a.hole_face, if ( (count(a.unregular_point_count) = 0), 1, 0) as isRect
|
||||
from order_plate a
|
||||
left join order_item b on a.id = b.plate_id
|
||||
where b.plan_id = #{planId}
|
||||
group by a.id
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
+12
@@ -516,6 +516,18 @@ public class CuttingSettingDO extends ESDocument {
|
||||
@Schema(description = "ManualSortingCornerWidth")
|
||||
private Integer manualSortingCornerWidth;
|
||||
|
||||
@Schema(description = "矩形板件R角开料 默认否")
|
||||
private Boolean rectanglR;
|
||||
|
||||
@Schema(description = "圆弧加工使用IJ指令 默认否,使用R指令")
|
||||
private Boolean arcUseIJ;
|
||||
|
||||
@Schema(description = "圆弧方向反转 默认否 顺时针G2/逆时针G3")
|
||||
private Boolean arcInversion;
|
||||
|
||||
@Schema(description = "圆弧转多段线长度 默认0 不转")
|
||||
private Boolean arcTurnLength;
|
||||
|
||||
|
||||
@Schema( description ="样式-BoardBorder")
|
||||
private Integer styleBoardBorder;
|
||||
|
||||
+12
@@ -522,6 +522,18 @@ public class CuttingTemplateMachineDO extends ESDocument {
|
||||
@Schema(description = "ManualSortingCornerWidth")
|
||||
private Integer manualSortingCornerWidth;
|
||||
|
||||
@Schema(description = "矩形板件R角开料 默认否")
|
||||
private Boolean rectanglR;
|
||||
|
||||
@Schema(description = "圆弧加工使用IJ指令 默认否,使用R指令")
|
||||
private Boolean arcUseIJ;
|
||||
|
||||
@Schema(description = "圆弧方向反转 默认否 顺时针G2/逆时针G3")
|
||||
private Boolean arcInversion;
|
||||
|
||||
@Schema(description = "圆弧转多段线长度 默认0 不转")
|
||||
private Boolean arcTurnLength;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class KnifeListBean {
|
||||
|
||||
Reference in New Issue
Block a user