mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 21:32:07 +08:00
优化排单-生产单全部数据返回
This commit is contained in:
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
package com.cf.imes.module.executor.controller.admin.plan.bo;
|
package com.cf.imes.module.executor.controller.admin.plan.bo;
|
||||||
|
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OptimizeParamRespVO;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.OptimizeParamRespVO;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetialRespVO;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailVO;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateDetailVO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||||
@@ -34,11 +35,11 @@ public class OrderSource {
|
|||||||
@Schema(description = "生产单列表")
|
@Schema(description = "生产单列表")
|
||||||
private List<OrderDO> orderList;
|
private List<OrderDO> orderList;
|
||||||
|
|
||||||
@Schema(description = "商品板材列表")
|
@Schema(description = "板材-大板列表")
|
||||||
private List<GoodsDO> goodsList;
|
private List<GoodsDO> goodsList;
|
||||||
|
|
||||||
@Schema(description = "小板列表")
|
@Schema(description = "小板列表")
|
||||||
private List<PlateDO> plateList;
|
private List<PlateDetialRespVO> plateList;
|
||||||
|
|
||||||
@Schema(description = "小板造型列表")
|
@Schema(description = "小板造型列表")
|
||||||
private List<OrderModelDO> plateModels;
|
private List<OrderModelDO> plateModels;
|
||||||
|
|||||||
+93
@@ -0,0 +1,93 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 生产单板件 Response VO")
|
||||||
|
@Data
|
||||||
|
public class PlateDetialRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "板件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "房间名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "柜体名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String bodyName;
|
||||||
|
|
||||||
|
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
@Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long goodsId;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "板编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String plateNo;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "板名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "板长", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Double height;
|
||||||
|
|
||||||
|
@Schema(description = "板宽", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Double width;
|
||||||
|
|
||||||
|
@Schema(description = "板厚", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Double thickness;
|
||||||
|
|
||||||
|
@Schema(description = "是否异性-是否弧形地脚,不处理异形", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Boolean isSpecialShaped;
|
||||||
|
|
||||||
|
@Schema(description = "左封边厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private BigDecimal sealLeft;
|
||||||
|
|
||||||
|
@Schema(description = "右封边厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private BigDecimal sealRight;
|
||||||
|
|
||||||
|
@Schema(description = "上封边厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private BigDecimal sealUp;
|
||||||
|
|
||||||
|
@Schema(description = "下封边厚度", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private BigDecimal sealDown;
|
||||||
|
|
||||||
|
@Schema(description = "纹路类型,0 正纹 1 可翻转 2 反纹", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Integer texture;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "异型偏移 x", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Double offsetX;
|
||||||
|
|
||||||
|
@Schema(description = "异型偏移 y", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Double offsetY;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "板类型,0 层板 1 立板 2 背板", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String processGroupName;
|
||||||
|
|
||||||
|
@Schema(description = "开门类型,0 无 1 左 2 右 3 上 4 下", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
private Integer openDoorType;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "生产单明细ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long itemId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+6
-4
@@ -10,10 +10,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
|||||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlanSaveReqVO;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||||
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.plate.PlateDO;
|
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||||
@@ -94,4 +91,9 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
|||||||
Set<Long> selectBatchOrderIdsAndGoodsIds(@Param("itemList") List<PlanSaveReqVO.Item> itemList);
|
Set<Long> selectBatchOrderIdsAndGoodsIds(@Param("itemList") List<PlanSaveReqVO.Item> itemList);
|
||||||
|
|
||||||
PlateDetailRespVO selectPlateNumList(PlateDetailReqVO reqVO);
|
PlateDetailRespVO selectPlateNumList(PlateDetailReqVO reqVO);
|
||||||
|
|
||||||
|
List<PlateDetialRespVO> selectPlateDetialList(@Param("orderId") Long orderId);
|
||||||
|
|
||||||
|
|
||||||
|
List<PlateDetialRespVO> selectPlateDetialListByIds(@Param("orderIds") Set<Long> orderIds);
|
||||||
}
|
}
|
||||||
+6
-4
@@ -304,10 +304,10 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>()
|
List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>()
|
||||||
.eq(GoodsDO::getOrderId, orderId)
|
.eq(GoodsDO::getOrderId, orderId)
|
||||||
);
|
);
|
||||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>()
|
List<PlateDetialRespVO> plateDOS = plateMapper.selectPlateDetialList(orderId);
|
||||||
.eq(PlateDO::getOrderId, orderId)
|
|
||||||
);
|
|
||||||
List<OrderModelDO> orderModelDOS = buildRespByOrderId(orderId, ORDER_PLATE_MODEL);
|
List<OrderModelDO> orderModelDOS = buildRespByOrderId(orderId, ORDER_PLATE_MODEL);
|
||||||
|
|
||||||
orderSource.setOrderList(Collections.singletonList(orderDO));
|
orderSource.setOrderList(Collections.singletonList(orderDO));
|
||||||
orderSource.setPlateList(plateDOS);
|
orderSource.setPlateList(plateDOS);
|
||||||
orderSource.setGoodsList(goodsDOS);
|
orderSource.setGoodsList(goodsDOS);
|
||||||
@@ -333,7 +333,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
|||||||
Set<Long> orderIds = orderItemDOS.stream().map(OrderItemDO::getOrderId).collect(Collectors.toSet());
|
Set<Long> orderIds = orderItemDOS.stream().map(OrderItemDO::getOrderId).collect(Collectors.toSet());
|
||||||
List<OrderDO> orderDOS = orderMapper.selectBatchIds(orderIds);
|
List<OrderDO> orderDOS = orderMapper.selectBatchIds(orderIds);
|
||||||
List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>().in(GoodsDO::getOrderId, orderIds));
|
List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>().in(GoodsDO::getOrderId, orderIds));
|
||||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getOrderId, orderIds));
|
|
||||||
|
List<PlateDetialRespVO> plateDOS = plateMapper.selectPlateDetialListByIds(orderIds);
|
||||||
|
|
||||||
List<OrderModelDO> orderModelDOS = buildRespByOrderIds(orderIds, ORDER_PLATE_MODEL);
|
List<OrderModelDO> orderModelDOS = buildRespByOrderIds(orderIds, ORDER_PLATE_MODEL);
|
||||||
return OrderSource.builder()
|
return OrderSource.builder()
|
||||||
.orderList(orderDOS)
|
.orderList(orderDOS)
|
||||||
|
|||||||
+49
@@ -111,4 +111,53 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<resultMap id="PlateDetialMap" type="com.cf.imes.module.executor.controller.admin.plan.vo.PlateDetialRespVO">
|
||||||
|
|
||||||
|
<result property="itemId" column="itemId"/>
|
||||||
|
<result property="bodyName" column="bodyName"/>
|
||||||
|
<result property="roomName" column="roomName"/>
|
||||||
|
<result property="processGroupName" column="processGroupName"/>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
<select id="selectPlateDetialList"
|
||||||
|
resultMap="PlateDetialMap"
|
||||||
|
resultType="java.lang.Long">
|
||||||
|
|
||||||
|
select distinct op.*,
|
||||||
|
oi.id as itemId,
|
||||||
|
ob.name as bodyName,
|
||||||
|
ob.room_name as roomName,
|
||||||
|
og.name as processGroupName
|
||||||
|
from order_plate op
|
||||||
|
join order_item oi on op.id = oi.plate_id
|
||||||
|
join order_body ob on oi.body_id = ob.id
|
||||||
|
left join order_group og on oi.group_id = og.id
|
||||||
|
where op.order_id = #{orderId}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectPlateDetialListByIds"
|
||||||
|
resultMap="PlateDetialMap"
|
||||||
|
resultType="java.lang.Long">
|
||||||
|
|
||||||
|
select distinct op.*,
|
||||||
|
oi.id as itemId,
|
||||||
|
ob.name as bodyName,
|
||||||
|
ob.room_name as roomName,
|
||||||
|
og.name as processGroupName
|
||||||
|
from order_plate op
|
||||||
|
join order_item oi on op.id = oi.plate_id
|
||||||
|
join order_body ob on oi.body_id = ob.id
|
||||||
|
left join order_group og on oi.group_id = og.id
|
||||||
|
where op.order_id in
|
||||||
|
<foreach collection="id" item="orderIds" open="(" close=")" separator=",">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user