mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
分堆打包板件标记由plateId改为plateNo短编号
This commit is contained in:
+4
-4
@@ -19,11 +19,11 @@ import java.util.List;
|
||||
@Schema(description = "管理后台 - 分堆打包 - 保存分堆 Request VO")
|
||||
@Data
|
||||
public class HeapSplitSaveReqVO {
|
||||
@Schema(description = "板件id列表")
|
||||
private List<Long> plateIds = new ArrayList<>();
|
||||
@Schema(description = "新增板号列表")
|
||||
private List<Long> plateNos = new ArrayList<>();
|
||||
|
||||
@Schema(description = "删除的板件id列表")
|
||||
private List<Long> delPlateIds = new ArrayList<>();
|
||||
@Schema(description = "删除的板号列表")
|
||||
private List<Long> delPlateNos = new ArrayList<>();
|
||||
|
||||
@Schema(description = "配件id列表")
|
||||
private List<PackagePartsSaveReqVO> parts = new ArrayList<>();
|
||||
|
||||
+4
-4
@@ -25,11 +25,11 @@ public class OrderPackReqVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "新增的板件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> addPlateIdList = new ArrayList<>();
|
||||
@Schema(description = "新增的板号列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> addPlateNoList = new ArrayList<>();
|
||||
|
||||
@Schema(description = "移除的板件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> deletePlateIdList = new ArrayList<>();
|
||||
@Schema(description = "移除的板号列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> deletePlateNoList = new ArrayList<>();
|
||||
|
||||
@Schema(description = "打包方式:0柜名、1房名、2订单")
|
||||
@InEnum(OrderPackageMethodEnum.class)
|
||||
|
||||
+13
-4
@@ -142,11 +142,11 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
/**
|
||||
* 更新板件item的包裹id
|
||||
*
|
||||
* @param plateIdList
|
||||
* @param plateNos
|
||||
* @param packageNo
|
||||
* @param orderIds
|
||||
*/
|
||||
void updatePlatesItemPackageId(@Param("plateIdList") List<Long> plateIdList, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
void updatePlatesItemPackageId(@Param("plateNos") List<Long> plateNos, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 更新配件item的包裹id
|
||||
@@ -161,11 +161,11 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
/**
|
||||
* 更新板件item解包package_id = 0
|
||||
*
|
||||
* @param deletePlateIdList
|
||||
* @param plateNos
|
||||
* @param packageNo
|
||||
* @param orderIds
|
||||
*/
|
||||
void updatePlatesItemUnPackageId(@Param("deletePlateIdList") List<Long> deletePlateIdList, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
void updatePlatesItemUnPackageId(@Param("plateNos") List<Long> plateNos, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 更新配件item解包package_id = 0
|
||||
@@ -176,6 +176,15 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
*/
|
||||
void updatePartsItemUnPackageId(@Param("deletePartsList") List<Long> deletePartsList, @Param("packageNo") String packageNo, @Param("orderIds") List<Long> orderIds);
|
||||
|
||||
/**
|
||||
* 更新板件item的分堆状态
|
||||
*
|
||||
* @param plateNos
|
||||
* @param orderIds
|
||||
* @param heapSplit true:没分堆改分堆、false:分堆改没分堆
|
||||
*/
|
||||
void updatePlatesItemHeapSplitStatus(@Param("plateNos") List<Long> plateNos, @Param("orderIds") List<Long> orderIds, @Param("heapSplit") boolean heapSplit);
|
||||
|
||||
void insertPartsId(@Param("packId") Long packId, @Param("addPartsIdList") List<Long> addPartsIdList,@Param("orderId") Long orderId,@Param("organId") Long organId);
|
||||
|
||||
|
||||
|
||||
+8
-16
@@ -54,28 +54,20 @@ public class HeapSplitServiceImpl implements HeapSplitService {
|
||||
Integer packMethod = reqVO.getPackMethod();
|
||||
List<Long> orderIds = reqVO.getOrderIds();
|
||||
// 更新板件分堆状态
|
||||
List<Long> plateIds = reqVO.getPlateIds();
|
||||
if (CollUtil.isNotEmpty(plateIds)) {
|
||||
List<List<Long>> platePartitions = CollUtil.split(plateIds, 1000);
|
||||
List<Long> plateNos = reqVO.getPlateNos();
|
||||
if (CollUtil.isNotEmpty(plateNos)) {
|
||||
List<List<Long>> platePartitions = CollUtil.split(plateNos, 1000);
|
||||
for (List<Long> batch : platePartitions) {
|
||||
orderItemMapper.update(new LambdaUpdateWrapper<OrderItemDO>()
|
||||
.in(OrderItemDO::getOrderId, orderIds)
|
||||
.in(OrderItemDO::getPlateId, batch)
|
||||
.eq(OrderItemDO::getHeapSplitStatus, HeapSplitStatusEnum.NO.getStatus())
|
||||
.set(OrderItemDO::getHeapSplitStatus, HeapSplitStatusEnum.YES.getStatus()));
|
||||
orderItemMapper.updatePlatesItemHeapSplitStatus(batch, orderIds, true);
|
||||
}
|
||||
}
|
||||
|
||||
// 删除板件分堆状态
|
||||
List<Long> delPlateIds = reqVO.getDelPlateIds();
|
||||
if (CollUtil.isNotEmpty(delPlateIds)) {
|
||||
List<List<Long>> delPlatePartitions = CollUtil.split(delPlateIds, 1000);
|
||||
List<Long> delPlateNos = reqVO.getDelPlateNos();
|
||||
if (CollUtil.isNotEmpty(delPlateNos)) {
|
||||
List<List<Long>> delPlatePartitions = CollUtil.split(delPlateNos, 1000);
|
||||
for (List<Long> batch : delPlatePartitions) {
|
||||
orderItemMapper.update(new LambdaUpdateWrapper<OrderItemDO>()
|
||||
.in(OrderItemDO::getOrderId, orderIds)
|
||||
.in(OrderItemDO::getPlateId, batch)
|
||||
.eq(OrderItemDO::getHeapSplitStatus, HeapSplitStatusEnum.YES.getStatus())
|
||||
.set(OrderItemDO::getHeapSplitStatus, HeapSplitStatusEnum.NO.getStatus()));
|
||||
orderItemMapper.updatePlatesItemHeapSplitStatus(batch, orderIds, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-9
@@ -3,6 +3,7 @@ package com.cf.imes.module.executor.service.manage.pack;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -268,8 +269,8 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
String packNo = packageVO.getPackNo();
|
||||
List<Long> orderIds = packageVO.getOrderIds();
|
||||
List<Long> addPlateIdList = packageVO.getAddPlateIdList();
|
||||
List<Long> deletePlateIdList = packageVO.getDeletePlateIdList();
|
||||
List<Long> addPlateNos = packageVO.getAddPlateNoList();
|
||||
List<Long> deletePlateNos = packageVO.getDeletePlateNoList();
|
||||
List<PackagePartsSaveReqVO> addPartsList = packageVO.getAddPartsList();
|
||||
List<PackagePartsSaveReqVO> delPartsList = packageVO.getDelPartsList();
|
||||
Integer packMethod = packageVO.getPackMethod();
|
||||
@@ -290,7 +291,7 @@ public class PackServiceImpl implements PackService {
|
||||
}
|
||||
orderPackageMapper.insertBatch(orderPackageDOS);
|
||||
// 板件明细新增包裹 ID
|
||||
List<List<Long>> split = CollUtil.split(addPlateIdList, 1000);
|
||||
List<List<Long>> split = CollUtil.split(addPlateNos, 1000);
|
||||
if (CollUtil.isNotEmpty(split)) {
|
||||
for (List<Long> batch : split) {
|
||||
orderItemMapper.updatePlatesItemPackageId(batch, packageNo, orderIds);
|
||||
@@ -313,14 +314,14 @@ public class PackServiceImpl implements PackService {
|
||||
return typeConversion(orderPackageDOS.get(0), orderIds);
|
||||
}
|
||||
|
||||
if (CollUtil.isEmpty(addPlateIdList) && CollUtil.isEmpty(addPartsList)
|
||||
&& CollUtil.isEmpty(deletePlateIdList) && CollUtil.isEmpty(delPartsList)) {
|
||||
if (CollUtil.isEmpty(addPlateNos) && CollUtil.isEmpty(addPartsList)
|
||||
&& CollUtil.isEmpty(deletePlateNos) && CollUtil.isEmpty(delPartsList)) {
|
||||
throw new ServiceException(PART_PACK_DATA_ERROR);
|
||||
}
|
||||
|
||||
String existPackageNo = existPackageDO.getPackageNo();
|
||||
// 板件明细新增包裹 ID
|
||||
List<List<Long>> split = CollUtil.split(addPlateIdList, 1000);
|
||||
List<List<Long>> split = CollUtil.split(addPlateNos, 1000);
|
||||
if (CollUtil.isNotEmpty(split)) {
|
||||
for (List<Long> batch : split) {
|
||||
orderItemMapper.updatePlatesItemPackageId(batch, existPackageNo, orderIds);
|
||||
@@ -328,7 +329,7 @@ public class PackServiceImpl implements PackService {
|
||||
}
|
||||
|
||||
// 板件明细移除包裹 ID
|
||||
List<List<Long>> split3 = CollUtil.split(deletePlateIdList, 1000);
|
||||
List<List<Long>> split3 = CollUtil.split(deletePlateNos, 1000);
|
||||
if (CollUtil.isNotEmpty(split3)) {
|
||||
for (List<Long> batch : split3) {
|
||||
orderItemMapper.updatePlatesItemUnPackageId(batch, existPackageNo, orderIds);
|
||||
@@ -999,6 +1000,7 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
@Override
|
||||
public List<Long> getComponentCorrelation(PackScanComponentCorrelationReqVO reqVO) {
|
||||
// 进来是板用的是板编号,配件用的是配件id
|
||||
Long id = reqVO.getId();
|
||||
Integer itemType = reqVO.getItemType();
|
||||
Integer type = reqVO.getType();
|
||||
@@ -1009,10 +1011,10 @@ public class PackServiceImpl implements PackService {
|
||||
OrderItemDO itemDO;
|
||||
if (com.cf.imes.module.executor.enums.OrderItemTypeEnum.PLATE_ITEM.getStatus().equals(itemType)) {
|
||||
// 板件
|
||||
PlateDO plate = plateService.getPlate(id);
|
||||
PlateDO plate = plateService.getPlateByNo(id, ArrayUtil.toArray(orderIds, Long.class));
|
||||
AssertUtils.notEmpty(plate, PLATE_NOT_EXISTS);
|
||||
// 查询关联部件id
|
||||
itemDO = orderItemService.getPlateItemCompId(id);
|
||||
itemDO = orderItemService.getPlateItemCompId(plate.getId());
|
||||
} else {
|
||||
// 配件
|
||||
OrderPartsDO part = orderPartsService.getPart(id);
|
||||
|
||||
+9
@@ -28,6 +28,15 @@ public interface PlateService {
|
||||
*/
|
||||
PlateDO getPlate(Long plateId);
|
||||
|
||||
/**
|
||||
* 根据短编号查询板件
|
||||
*
|
||||
* @param plateNo
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
PlateDO getPlateByNo(Long plateNo, Long... orderIds);
|
||||
|
||||
/**
|
||||
* 创建订单板件
|
||||
*
|
||||
|
||||
+9
@@ -20,6 +20,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.Assert.AssertUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
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.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||
@@ -142,6 +143,14 @@ public class PlateServiceImpl implements PlateService {
|
||||
return plateMapper.selectById(plateId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlateDO getPlateByNo(Long plateNo, Long... orderIds) {
|
||||
return plateMapper.selectOne(new LambdaQueryWrapperX<PlateDO>()
|
||||
.eq(PlateDO::getPlateNo, plateNo)
|
||||
.inIfPresent(PlateDO::getOrderId, orderIds)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long createPlate(PlateSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
|
||||
+60
-30
@@ -389,20 +389,21 @@
|
||||
|
||||
|
||||
|
||||
<update id="updatePlatesItemPackageId" parameterType="java.lang.Long">
|
||||
update order_item
|
||||
set package_id = #{packageNo}
|
||||
where order_id IN
|
||||
<update id="updatePlatesItemPackageId">
|
||||
UPDATE order_item oi
|
||||
JOIN order_plate op ON oi.order_id = op.order_id AND oi.plate_id = op.id
|
||||
SET package_id = #{packageNo}
|
||||
where oi.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
and plate_id in
|
||||
<foreach item="id" collection="plateIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
AND op.plate_no IN
|
||||
<foreach item="plateNo" collection="plateNos" open="(" separator="," close=")">
|
||||
#{plateNo}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updatePartsItemPackageId" parameterType="java.lang.Long">
|
||||
<update id="updatePartsItemPackageId">
|
||||
update order_item oi
|
||||
set package_id = #{packageNo}
|
||||
where order_id IN
|
||||
@@ -416,23 +417,22 @@
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="updatePlatesItemUnPackageId" parameterType="java.lang.Long">
|
||||
update order_item oi
|
||||
set package_id = 0
|
||||
where order_id IN
|
||||
<update id="updatePlatesItemUnPackageId">
|
||||
UPDATE order_item oi
|
||||
JOIN order_plate op ON oi.order_id = op.order_id AND oi.plate_id = op.id
|
||||
SET package_id = 0
|
||||
where oi.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
and package_id = #{packageNo}
|
||||
and plate_id in
|
||||
<foreach item="id" collection="deletePlateIdList" open="(" separator="," close=")">
|
||||
#{id}
|
||||
AND op.plate_no IN
|
||||
<foreach item="plateNo" collection="plateNos" open="(" separator="," close=")">
|
||||
#{plateNo}
|
||||
</foreach>
|
||||
AND oi.package_id = #{packageNo}
|
||||
</update>
|
||||
|
||||
<update id="updatePartsItemUnPackageId" parameterType="java.lang.Long">
|
||||
<update id="updatePartsItemUnPackageId">
|
||||
update order_item oi
|
||||
set package_id = 0
|
||||
where order_id IN
|
||||
@@ -447,6 +447,40 @@
|
||||
|
||||
</update>
|
||||
|
||||
<update id="updatePlatesItemHeapSplitStatus">
|
||||
UPDATE order_item oi
|
||||
JOIN order_plate op ON oi.order_id = op.order_id AND oi.plate_id = op.id
|
||||
<choose>
|
||||
<when test="heapSplit">
|
||||
<set>
|
||||
oi.heap_split_status = ${@com.cf.imes.module.executor.enums.heapsplit.HeapSplitStatusEnum@YES.status}
|
||||
</set>
|
||||
</when>
|
||||
<otherwise>
|
||||
<set>
|
||||
oi.heap_split_status = ${@com.cf.imes.module.executor.enums.heapsplit.HeapSplitStatusEnum@NO.status}
|
||||
</set>
|
||||
</otherwise>
|
||||
</choose>
|
||||
where oi.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
AND op.plate_no IN
|
||||
<foreach item="plateNo" collection="plateNos" open="(" separator="," close=")">
|
||||
#{plateNo}
|
||||
</foreach>
|
||||
AND
|
||||
<choose>
|
||||
<when test="heapSplit">
|
||||
oi.heap_split_status = ${@com.cf.imes.module.executor.enums.heapsplit.HeapSplitStatusEnum@NO.status}
|
||||
</when>
|
||||
<otherwise>
|
||||
oi.heap_split_status = ${@com.cf.imes.module.executor.enums.heapsplit.HeapSplitStatusEnum@YES.status}
|
||||
</otherwise>
|
||||
</choose>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<update id="insertPartsId" parameterType="java.lang.Long">
|
||||
@@ -662,9 +696,13 @@
|
||||
</select>
|
||||
|
||||
<select id="selectComponentCorrelationPlateIds" resultType="java.lang.Long">
|
||||
select oi.plate_id
|
||||
from order_item oi
|
||||
where oi.plate_id != 0
|
||||
SELECT DISTINCT op.plate_no
|
||||
FROM order_item oi
|
||||
JOIN order_plate op
|
||||
ON op.id = oi.plate_id
|
||||
AND op.order_id = oi.order_id
|
||||
AND op.deleted = 0
|
||||
WHERE oi.plate_id != 0
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
and oi.comp_id in
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
@@ -680,14 +718,6 @@
|
||||
<if test="groupId != null">
|
||||
AND oi.group_id = #{groupId}
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_plate op
|
||||
WHERE op.id = oi.plate_id
|
||||
AND op.order_id = oi.order_id
|
||||
AND op.deleted = false
|
||||
)
|
||||
GROUP BY oi.plate_id;
|
||||
</select>
|
||||
|
||||
<select id="selectComponentCorrelationPartsIds" resultType="java.lang.Long">
|
||||
|
||||
+3
-2
@@ -382,6 +382,7 @@
|
||||
<result property="category" column="category"/>
|
||||
<result property="subparts" column="subparts"/>
|
||||
<result property="componentName" column="componentName"/>
|
||||
<result property="processGroup" column="processGroup"/>
|
||||
|
||||
<result property="heapSplitStatus" column="heapSplitStatus"/>
|
||||
<result property="heapNum" column="heapNum"/>
|
||||
@@ -395,7 +396,7 @@
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.group_names AS groupName,
|
||||
t.group_names AS processGroup,
|
||||
t.component_names AS componentName,
|
||||
t.num AS num,
|
||||
op.id AS partsId,
|
||||
@@ -462,7 +463,7 @@
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.heap_split_status AS heapSplitStatus,
|
||||
t.group_names AS groupName,
|
||||
t.group_names AS processGroup,
|
||||
t.component_names AS componentName,
|
||||
t.num AS num,
|
||||
t.heap_num AS heapNum,
|
||||
|
||||
Reference in New Issue
Block a user