mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 13:42:07 +08:00
分页打包数据对应修正-新增排单:板材分组接口新增
This commit is contained in:
+10
@@ -112,6 +112,16 @@ public class PlanController {
|
|||||||
return success(planService.getOrderPage(pageReqVO));
|
return success(planService.getOrderPage(pageReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("getNotPlanGoodsListPage")
|
||||||
|
@Operation(summary = "获取未排单的大板板材分页列表")
|
||||||
|
@PreAuthorize("@ss.hasPermission('placeorder:query')")
|
||||||
|
public CommonResult<PageResult<OrderGoodsResp>> getOrderGoodsPage(@Valid OrderPageReqVOCopy pageReqVO) {
|
||||||
|
return success(planService.getOrderGoodsPage(pageReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("getNotPlanPlateListPage")
|
@GetMapping("getNotPlanPlateListPage")
|
||||||
@Operation(summary = "获取未排单的板材分页列表")
|
@Operation(summary = "获取未排单的板材分页列表")
|
||||||
@PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
@PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
||||||
|
|||||||
+8
-5
@@ -3,23 +3,26 @@ package com.cf.imes.module.executor.controller.admin.plan.bo;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.Builder;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@Builder
|
||||||
public class GoodsIds {
|
public class OrderIds {
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "大板ID")
|
@Schema(description = "大板ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "生产单ID")
|
@Schema(description = "生产单ID")
|
||||||
private Long orderId;
|
private Long orderId;
|
||||||
|
|
||||||
@Schema(description = "板材库的大板ID")
|
|
||||||
|
@Schema(description = "商品ID")
|
||||||
private Long goodsId;
|
private Long goodsId;
|
||||||
|
|
||||||
@Schema(description = "余料板ID")
|
|
||||||
private Long remainId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
-3
@@ -43,9 +43,6 @@ public class OrderSource {
|
|||||||
private PlanDO plan;
|
private PlanDO plan;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "大板ID列表")
|
|
||||||
private List<GoodsIds> goodsIdList;
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "生产单列表")
|
@Schema(description = "生产单列表")
|
||||||
private List<OrderDO> orderList;
|
private List<OrderDO> orderList;
|
||||||
|
|||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OrderGoodsResp {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "生产单id")
|
||||||
|
private List<OrderIds> orderIds;
|
||||||
|
@Schema(description = "商品id")
|
||||||
|
private Long goodsId;
|
||||||
|
@Schema(description = "商品名称")
|
||||||
|
private String goodsName;
|
||||||
|
@Schema(description = "商品材质")
|
||||||
|
private String material;
|
||||||
|
@Schema(description = "商品颜色")
|
||||||
|
private String color;
|
||||||
|
@Schema(description = "宽")
|
||||||
|
private BigDecimal width;
|
||||||
|
@Schema(description = "高")
|
||||||
|
private BigDecimal height;
|
||||||
|
@Schema(description = "厚")
|
||||||
|
private BigDecimal thickness;
|
||||||
|
@Schema(description = "面积")
|
||||||
|
private BigDecimal area;
|
||||||
|
|
||||||
|
@Schema(description = "板件数量")
|
||||||
|
private Long num;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "订单对应的板件的信息")
|
||||||
|
private List<OrderRespVOCopy> orderList;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+2
-2
@@ -43,8 +43,8 @@ public class OrderRespVOCopy {
|
|||||||
private int num;
|
private int num;
|
||||||
@Schema(description = "平方")
|
@Schema(description = "平方")
|
||||||
private BigDecimal area = new BigDecimal("0");
|
private BigDecimal area = new BigDecimal("0");
|
||||||
// @Schema(description = "商品id")
|
@Schema(description = "商品id")
|
||||||
// private String goodsId;
|
private Long goodsId;
|
||||||
// @Schema(description = "商品名称")
|
// @Schema(description = "商品名称")
|
||||||
// private String goodsName;
|
// private String goodsName;
|
||||||
|
|
||||||
|
|||||||
+4
@@ -9,6 +9,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
|||||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPageReqVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPageReqVO;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@@ -122,4 +123,7 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
|||||||
.eq(OrderDO::getId, id)
|
.eq(OrderDO::getId, id)
|
||||||
.eq(OrderDO::getOrganId, organId));
|
.eq(OrderDO::getOrganId, organId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<OrderRespVOCopy> selectOrderListByIds(@Param("orderIds") List<OrderIds> orderIds, @Param("organId")Long organId);
|
||||||
}
|
}
|
||||||
|
|||||||
+11
@@ -7,11 +7,13 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||||
import com.cf.imes.framework.common.exception.ServiceException;
|
import com.cf.imes.framework.common.exception.ServiceException;
|
||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
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.bo.OrderIds;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
import com.cf.imes.module.executor.dal.dataobject.orderGroup.OrderGroupDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
import com.cf.imes.module.executor.dal.dataobject.orderParts.OrderPartsDO;
|
||||||
@@ -123,4 +125,13 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
|||||||
|
|
||||||
|
|
||||||
List<PlatePage> selectGoodsPage( @Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
List<OrderIds> selectOrderIds(@Param("pageReqVO") OrderPageReqVOCopy pageReqVO,@Param("organId") Long organId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
+3
@@ -71,4 +71,7 @@ public interface PlanService {
|
|||||||
Boolean setSort(List<SortVO> list);
|
Boolean setSort(List<SortVO> list);
|
||||||
|
|
||||||
List<PlateResList> getPlateList(List<Long> planIds);
|
List<PlateResList> getPlateList(List<Long> planIds);
|
||||||
|
|
||||||
|
PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
+51
-14
@@ -15,6 +15,8 @@ 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.MPJLambdaWrapperX;
|
||||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO;
|
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds;
|
||||||
|
import com.cf.imes.module.executor.controller.admin.plate.vo.PlateRespVO;
|
||||||
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;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||||
@@ -115,18 +117,6 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
orderMapper.updateBatch(orderDOS);
|
orderMapper.updateBatch(orderDOS);
|
||||||
|
|
||||||
Long planId = plan.getId();
|
Long planId = plan.getId();
|
||||||
/* List<Long> orderIds = createReqVO.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);
|
|
||||||
}*/
|
|
||||||
//List<Long> plateIds = createReqVO.getPlateIds();
|
|
||||||
|
|
||||||
|
|
||||||
Set<Long> itemIds = plateMapper.selectBatchOrderIdsAndGoodsIds(itemList,getUserOrganId());
|
Set<Long> itemIds = plateMapper.selectBatchOrderIdsAndGoodsIds(itemList,getUserOrganId());
|
||||||
@@ -334,6 +324,7 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
.eqIfPresent("a.custom_order_no", pageReqVO.getDefaultId())
|
.eqIfPresent("a.custom_order_no", pageReqVO.getDefaultId())
|
||||||
.eqIfPresent("a.address", pageReqVO.getConsigneeAddress())
|
.eqIfPresent("a.address", pageReqVO.getConsigneeAddress())
|
||||||
.betweenIfPresent("a.create_time", pageReqVO.getCreateTime())
|
.betweenIfPresent("a.create_time", pageReqVO.getCreateTime())
|
||||||
|
.eqIfPresent("op.is_special_shaped", pageReqVO.getRectangle() != null ? false: null)
|
||||||
.eqIfPresent("op.is_special_shaped", pageReqVO.getSpecialShaped())
|
.eqIfPresent("op.is_special_shaped", pageReqVO.getSpecialShaped())
|
||||||
.eqIfPresent("op.is_sculpt", pageReqVO.getSculpt())
|
.eqIfPresent("op.is_sculpt", pageReqVO.getSculpt())
|
||||||
.eqIfPresent("op.is_door", pageReqVO.getIsDoor())
|
.eqIfPresent("op.is_door", pageReqVO.getIsDoor())
|
||||||
@@ -384,9 +375,8 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
|
|
||||||
// 处理后的 filteredRecords 将不包含过滤后的数据为空的 record
|
// 处理后的 filteredRecords 将不包含过滤后的数据为空的 record
|
||||||
orderRespVOCopies.setRecords(filteredRecords);
|
orderRespVOCopies.setRecords(filteredRecords);
|
||||||
orderRespVOCopies.setTotal(filteredRecords.size());
|
|
||||||
|
|
||||||
|
|
||||||
|
orderRespVOCopies.setTotal(orderRespVOCopies.getRecords().size());
|
||||||
|
|
||||||
|
|
||||||
return new PageResult<>(orderRespVOCopies.getRecords(), orderRespVOCopies.getTotal());
|
return new PageResult<>(orderRespVOCopies.getRecords(), orderRespVOCopies.getTotal());
|
||||||
@@ -551,4 +541,51 @@ public class PlanServiceImpl implements PlanService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<OrderGoodsResp> getOrderGoodsPage(OrderPageReqVOCopy pageReqVO) {
|
||||||
|
|
||||||
|
|
||||||
|
PageDTO<OrderGoodsResp> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
|
|
||||||
|
|
||||||
|
List<Integer> filterTypes = new ArrayList<>();
|
||||||
|
if (Objects.nonNull(pageReqVO.getHoleThrough()) && pageReqVO.getHoleThrough()) {
|
||||||
|
filterTypes.add(PlanFilterTypeEnum.DIGGINGTHROUGHTHESHAPE.getType());
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(pageReqVO.getBurrow()) && pageReqVO.getBurrow()) {
|
||||||
|
filterTypes.add(PlanFilterTypeEnum.THEREAREPERFORATEDHOLES.getType());
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(pageReqVO.getTwoDimensionalToolPath()) && pageReqVO.getTwoDimensionalToolPath()) {
|
||||||
|
filterTypes.add(PlanFilterTypeEnum.TWODIMENSIONALCUTTINGPATH.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IPage<OrderGoodsResp> orderGoodsRespIPage = plateMapper.selectGoodsList(page,pageReqVO,getUserOrganId());
|
||||||
|
|
||||||
|
|
||||||
|
if (CollectionUtil.isEmpty(orderGoodsRespIPage.getRecords())) {
|
||||||
|
return new PageResult<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<OrderIds> orderIds = plateMapper.selectOrderIds(pageReqVO,getUserOrganId());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<OrderRespVOCopy> orderRespVOCopies = orderMapper.selectOrderListByIds(orderIds, getUserOrganId());
|
||||||
|
|
||||||
|
|
||||||
|
for (OrderGoodsResp record : orderGoodsRespIPage.getRecords()) {
|
||||||
|
record.setOrderIds(orderIds.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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new PageResult<>(orderGoodsRespIPage.getRecords(), orderGoodsRespIPage.getTotal());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+48
@@ -20,4 +20,52 @@
|
|||||||
<select id="selectDynamicSqlString" resultType="java.util.Map">
|
<select id="selectDynamicSqlString" resultType="java.util.Map">
|
||||||
${sqlStr}
|
${sqlStr}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectOrderListByIds"
|
||||||
|
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy"
|
||||||
|
parameterType="map">
|
||||||
|
|
||||||
|
|
||||||
|
select distinct
|
||||||
|
o.id as orderId ,
|
||||||
|
o.custom_order_no as defineId,
|
||||||
|
o.customer as customer,
|
||||||
|
o.address as address,
|
||||||
|
o.order_date as orderDate,
|
||||||
|
o.delivery_date as deliveryDate,
|
||||||
|
o.update_time as updateTime,
|
||||||
|
og.goods_id as goodsId,
|
||||||
|
count(distinct op.id) as num,
|
||||||
|
sum(op.area) as area
|
||||||
|
|
||||||
|
from orders o
|
||||||
|
join order_goods og on o.id = og.order_id and o.organ_id = og.organ_id
|
||||||
|
join order_plate op on o.id = op.order_id and og.id = op.goods_id and o.organ_id = op.organ_id
|
||||||
|
|
||||||
|
where
|
||||||
|
o.id in
|
||||||
|
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||||
|
(#{orderIds.orderId})
|
||||||
|
</foreach>
|
||||||
|
and o.organ_id = #{organId}
|
||||||
|
and op.deleted = false
|
||||||
|
and op.is_cancel = 0
|
||||||
|
and og.goods_id in
|
||||||
|
|
||||||
|
<foreach collection="orderIds" item="orderIds" open="(" close=")" separator=",">
|
||||||
|
(#{orderIds.goodsId})
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
group by o.id,o.custom_order_no, o.customer,o.address,o.order_date,o.delivery_date, o.update_time,o.status,og.goods_id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
+145
@@ -365,4 +365,149 @@
|
|||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<resultMap id="GoodsList" type="com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp">
|
||||||
|
|
||||||
|
<result property="goodsId" column="goodsId"/>
|
||||||
|
<result property="goodsName" column="goodsName"/>
|
||||||
|
<result property="width" column="width"/>
|
||||||
|
<result property="height" column="height"/>
|
||||||
|
<result property="thickness" column="thickness"/>
|
||||||
|
<result property="material" column="material"/>
|
||||||
|
<result property="color" column="color"/>
|
||||||
|
<result property="num" column="num"/>
|
||||||
|
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectGoodsList"
|
||||||
|
resultMap="GoodsList"
|
||||||
|
parameterType="map">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
select distinct
|
||||||
|
c.goods_id as goodsId,
|
||||||
|
c.width as width,
|
||||||
|
c.height as height,
|
||||||
|
c.thickness as thickness,
|
||||||
|
c.goods_name as goodsName,
|
||||||
|
c.material as material,
|
||||||
|
c.color as color,
|
||||||
|
count(distinct a.id)
|
||||||
|
|
||||||
|
from order_plate a
|
||||||
|
LEFT JOIN order_item oi on a.id = oi.plate_id and a.order_id = oi.order_id and a.organ_id = oi.organ_id
|
||||||
|
LEFT JOIN `orders` b on a.order_id = b.id and a.organ_id = b.organ_id
|
||||||
|
LEFT JOIN order_goods c on a.goods_id = c.id and a.organ_id = c.organ_id
|
||||||
|
left join order_plan_item opi on oi.id = opi.item_id and oi.organ_id = opi.organ_id
|
||||||
|
<where>
|
||||||
|
c.organ_id = #{organId}
|
||||||
|
and a.is_cancel = 0
|
||||||
|
and b.status = 2
|
||||||
|
and a.deleted = false
|
||||||
|
and opi.item_id is null
|
||||||
|
|
||||||
|
<if test="pageReqVO.orderId !=null">
|
||||||
|
and a.order_id like concat('%', #{pageReqVO.orderId},'%')
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.defaultId !=null">
|
||||||
|
and b.custom_order_no = #{pageReqVO.defaultId}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.consignee !=null">
|
||||||
|
and b.customer = #{pageReqVO.consignee}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.consigneeAddress !=null">
|
||||||
|
and b.address = #{pageReqVO.consigneeAddress}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.createTime[0] !=null and pageReqVO.createTime[1] !=null ">
|
||||||
|
and b.create_time between #{pageReqVO.createTime[0]} and #{pageReqVO.createTime[1]}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.rectangle !=null and pageReqVO.rectangle= true">
|
||||||
|
and a.is_special_shaped = false
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.specialShaped !=null ">
|
||||||
|
and a.is_special_shaped = #{pageReqVO.specialShaped}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.sculpt !=null ">
|
||||||
|
and a.is_sculpt = #{pageReqVO.sculpt}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.isDoor !=null ">
|
||||||
|
and a.is_door = #{pageReqVO.isDoor}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.longMinRang !=null and pageReqVO.longMaxRang !=null">
|
||||||
|
and a.height between #{pageReqVO.longMinRang} and #{pageReqVO.longMaxRang}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.widthMinRang !=null and pageReqVO.widthMaxRang !=null">
|
||||||
|
and a.width between #{pageReqVO.widthMinRang} and #{pageReqVO.widthMaxRang}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.holeThrough !=null or pageReqVO.burrow !=null or pageReqVO.twoDimensionalToolPath !=null">
|
||||||
|
and a.filter_type in (pageReqVO.holeThrough,pageReqVO.burrow,pageReqVO.twoDimensionalToolPath)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
group by c.goods_id,c.id,b.id ,c.goods_name,c.width,c.height,c.thickness, c.material, c.color;
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectOrderIds" resultType="com.cf.imes.module.executor.controller.admin.plan.bo.OrderIds" parameterType="map">
|
||||||
|
select distinct
|
||||||
|
a.order_id as orderId,
|
||||||
|
c.id as id,
|
||||||
|
c.goods_id as goodsId
|
||||||
|
from order_plate a
|
||||||
|
LEFT JOIN order_item oi on a.id = oi.plate_id and a.order_id = oi.order_id and a.organ_id = oi.organ_id
|
||||||
|
LEFT JOIN `orders` b on a.order_id = b.id and a.organ_id = b.organ_id
|
||||||
|
LEFT JOIN order_goods c on a.goods_id = c.id and a.organ_id = c.organ_id
|
||||||
|
left join order_plan_item opi on oi.id = opi.item_id and oi.organ_id = opi.organ_id
|
||||||
|
<where>
|
||||||
|
c.organ_id = #{organId}
|
||||||
|
and a.is_cancel = 0
|
||||||
|
and b.status = 2
|
||||||
|
and a.deleted = false
|
||||||
|
and opi.item_id is null
|
||||||
|
|
||||||
|
<if test="pageReqVO.orderId !=null">
|
||||||
|
and a.order_id like concat('%', #{pageReqVO.orderId},'%')
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.defaultId !=null">
|
||||||
|
and b.custom_order_no = #{pageReqVO.defaultId}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.consignee !=null">
|
||||||
|
and b.customer = #{pageReqVO.consignee}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.consigneeAddress !=null">
|
||||||
|
and b.address = #{pageReqVO.consigneeAddress}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.createTime[0] !=null and pageReqVO.createTime[1] !=null ">
|
||||||
|
and b.create_time between #{pageReqVO.createTime[0]} and #{pageReqVO.createTime[1]}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.rectangle !=null and pageReqVO.rectangle= true">
|
||||||
|
and a.is_special_shaped = false
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.specialShaped !=null ">
|
||||||
|
and a.is_special_shaped = #{pageReqVO.specialShaped}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.sculpt !=null ">
|
||||||
|
and a.is_sculpt = #{pageReqVO.sculpt}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.isDoor !=null ">
|
||||||
|
and a.is_door = #{pageReqVO.isDoor}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.longMinRang !=null and pageReqVO.longMaxRang !=null">
|
||||||
|
and a.height between #{pageReqVO.longMinRang} and #{pageReqVO.longMaxRang}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.widthMinRang !=null and pageReqVO.widthMaxRang !=null">
|
||||||
|
and a.width between #{pageReqVO.widthMinRang} and #{pageReqVO.widthMaxRang}
|
||||||
|
</if>
|
||||||
|
<if test="pageReqVO.holeThrough !=null or pageReqVO.burrow !=null or pageReqVO.twoDimensionalToolPath !=null">
|
||||||
|
and a.filter_type in (pageReqVO.holeThrough,pageReqVO.burrow,pageReqVO.twoDimensionalToolPath)
|
||||||
|
</if>
|
||||||
|
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
+2
@@ -25,6 +25,8 @@ public class PackPageReqVO extends PageParam {
|
|||||||
@Schema(description = "自定义单号")
|
@Schema(description = "自定义单号")
|
||||||
private String customOrderNo;
|
private String customOrderNo;
|
||||||
|
|
||||||
|
@Schema(description = "经销商")
|
||||||
|
private String dealer;
|
||||||
|
|
||||||
@Schema(description = "客户")
|
@Schema(description = "客户")
|
||||||
private String customer;
|
private String customer;
|
||||||
|
|||||||
+2
-1
@@ -36,7 +36,7 @@ public interface OrderPackageMapper extends BaseMapperX<OrderPackageDO> {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<PackRespVO> selectPackPage(@Param("orderIds") List<Long> orderIds);
|
List<PackRespVO> selectPackPage(@Param("orderIds") List<Long> orderIds,@Param("organId") Long organId);
|
||||||
|
|
||||||
|
|
||||||
IPage<PlateDetailsRespVO> selectMissingBoard( @Param("page") IPage page, @Param("orderNo") Long orderNo, @Param("organId") Long organId);
|
IPage<PlateDetailsRespVO> selectMissingBoard( @Param("page") IPage page, @Param("orderNo") Long orderNo, @Param("organId") Long organId);
|
||||||
@@ -72,4 +72,5 @@ public interface OrderPackageMapper extends BaseMapperX<OrderPackageDO> {
|
|||||||
void updatePackStatus(Long packageId);
|
void updatePackStatus(Long packageId);
|
||||||
|
|
||||||
|
|
||||||
|
List<PackRespVO> selectPackPieceCount(@Param("orderIds") List<Long> orderIds, @Param("organId") Long organId);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -83,14 +83,18 @@ public class PackServiceImpl implements PackService {
|
|||||||
// 查询打包首页分页数据信息,总的板件数量信息
|
// 查询打包首页分页数据信息,总的板件数量信息
|
||||||
IPage<PackRespVO> packRespVOS = productionStatusMapper.selectOrderPlate(page,orderIds,getUserOrganId());
|
IPage<PackRespVO> packRespVOS = productionStatusMapper.selectOrderPlate(page,orderIds,getUserOrganId());
|
||||||
|
|
||||||
List<PackRespVO> respVOS = orderPackageMapper.selectPackPage(orderIds);
|
// 查询当前生产的包裹数量
|
||||||
|
List<PackRespVO> respVOS = orderPackageMapper.selectPackPage(orderIds,getUserOrganId());
|
||||||
|
|
||||||
|
// 查询当前生产单已经打包的板材数量
|
||||||
|
List<PackRespVO> plateNum = orderPackageMapper.selectPackPieceCount(orderIds, getUserOrganId());
|
||||||
|
|
||||||
for (PackRespVO record : packRespVOS.getRecords()) {
|
for (PackRespVO record : packRespVOS.getRecords()) {
|
||||||
|
|
||||||
// 已打包数
|
// 已打包数
|
||||||
record.setPackCount(respVOS.stream().filter(f -> Objects.equals(f.getId(), record.getId())).mapToLong(PackRespVO::getPackCount).sum());
|
record.setPackCount(respVOS.stream().filter(f -> Objects.equals(f.getId(), record.getId())).mapToLong(PackRespVO::getPackCount).sum());
|
||||||
// 已打包片数
|
// 已打包片数
|
||||||
record.setPackPieceCount(respVOS.stream().filter(f -> Objects.equals(f.getId(), record.getId())).mapToLong(PackRespVO::getPackPieceCount).sum());
|
record.setPackPieceCount(plateNum.stream().filter(f -> Objects.equals(f.getId(), record.getId())).mapToLong(PackRespVO::getPackPieceCount).sum());
|
||||||
// 待处理量
|
// 待处理量
|
||||||
record.setPendingNum(record.getTotalPieceCount() - record.getPackPieceCount());
|
record.setPendingNum(record.getTotalPieceCount() - record.getPackPieceCount());
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-7
@@ -17,15 +17,15 @@
|
|||||||
|
|
||||||
select
|
select
|
||||||
op.order_id as id,
|
op.order_id as id,
|
||||||
count(distinct op.id) as packCount ,
|
count(distinct op.id) as packCount
|
||||||
count(distinct oi.plate_id) as packPieceCount
|
|
||||||
|
|
||||||
from order_package op
|
from order_package op
|
||||||
join order_item oi on op.order_id = oi.order_id and op.organ_id = oi.organ_id
|
join order_item oi on op.id = oi.package_id and op.organ_id = oi.organ_id
|
||||||
where op.status <> 0
|
where
|
||||||
and oi.package_id != 0
|
op.status <> 0
|
||||||
and oi.plate_id != 0
|
and oi.package_id != 0
|
||||||
and op.order_id in
|
and op.organ_id = #{organId}
|
||||||
|
and op.order_id in
|
||||||
<foreach item="id" collection="orderIds" open="(" separator="," close=")">
|
<foreach item="id" collection="orderIds" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
@@ -34,6 +34,32 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectPackPieceCount"
|
||||||
|
parameterType="java.util.List"
|
||||||
|
resultMap="PackMap">
|
||||||
|
|
||||||
|
select
|
||||||
|
op.order_id as id,
|
||||||
|
count(distinct oi.plate_id ) as packPieceCount
|
||||||
|
|
||||||
|
from order_package op
|
||||||
|
join order_item oi on op.id = oi.package_id and op.organ_id = oi.organ_id
|
||||||
|
|
||||||
|
where op.status <> 0
|
||||||
|
and oi.package_id !=0
|
||||||
|
and plate_id != 0
|
||||||
|
and op.organ_id =#{organId}
|
||||||
|
and op.order_id in
|
||||||
|
<foreach item="id" collection="orderIds" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
group by op.order_id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -85,9 +85,7 @@
|
|||||||
o.organ_id = #{organId} and oi.plate_id != 0 and
|
o.organ_id = #{organId} and oi.plate_id != 0 and
|
||||||
o.id in
|
o.id in
|
||||||
<foreach item="id" collection="orderIds" open="(" separator="," close=")">
|
<foreach item="id" collection="orderIds" open="(" separator="," close=")">
|
||||||
<if test="id !=null">
|
|
||||||
#{id}
|
#{id}
|
||||||
</if>
|
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
group by orderNo,customOrderNo,dealer,createTime,deliveryDate,customer,phoneNumber,address,salesman,splitter,status
|
group by orderNo,customOrderNo,dealer,createTime,deliveryDate,customer,phoneNumber,address,salesman,splitter,status
|
||||||
@@ -169,6 +167,10 @@
|
|||||||
and address like concat('%', #{pageReqVO.address},'%')
|
and address like concat('%', #{pageReqVO.address},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="pageReqVO.dealer !=null">
|
||||||
|
and dealer like concat('%', #{pageReqVO.dealer},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user