1、禅道bug#1566修复;2、解包不作操作直接封包逻辑修复;

This commit is contained in:
gaoqr
2026-05-28 15:16:58 +08:00
parent 6e827603c1
commit 7e9198feb1
4 changed files with 53 additions and 14 deletions
@@ -57,12 +57,12 @@ public class PackController {
return success(packService.getOrderPack(reqVO));
}
@GetMapping("/packageDetails/{packageNo}")
@PostMapping("/packageDetail")
@Operation(summary = "查询包裹编号对应的包裹中的明细")
@Parameter(name = "packageNo", description = "包裹编号", required = true)
@PreAuthorize("@ss.hasAnyPermissions('manage:pack:pack-details','manage:pack:query')")
public CommonResult<List<PackageDetailsRespVO>> queryOrdersPackageDetails(@PathVariable String packageNo){
return success(packService.getOrdersPackageDetails(packageNo));
public CommonResult<List<PackageDetailsRespVO>> queryOrdersPackageDetail(@Valid @RequestBody PackageDetailReqVO reqVO){
return success(packService.getOrdersPackageDetails(reqVO));
}
@GetMapping("/packageDetails/{orderId}/{packageNo}")
@@ -0,0 +1,32 @@
package com.cf.imes.module.executor.controller.admin.manage.pack.vo;
import com.cf.imes.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import java.util.List;
@Schema(description = "管理后台 - 查看订单下的包裹明细")
@Data
@ToString(callSuper = true)
public class PackageDetailReqVO extends PageParam {
@Schema(description = "订单号列表", requiredMode = Schema.RequiredMode.REQUIRED)
@Size(max = 100, message = "订单号列表长度不能超过 100 个")
@NotEmpty(message = "订单号列表不能为空")
private List<Long> orderIds;
@Schema(description = "包裹编号")
@Pattern(regexp = "^[0-9]*$",message = "包裹编号必须为数字")
@Length(max = 13,message = "包裹编号长度不能超过 13 位")
@NotNull(message = "包裹编号不能为空")
private String packageNo;
}
@@ -78,10 +78,10 @@ public interface PackService {
/**
* 获取包裹板件、配件详情
*
* @param packageNo
* @param reqVO
* @return
*/
List<PackageDetailsRespVO> getOrdersPackageDetails(String packageNo);
List<PackageDetailsRespVO> getOrdersPackageDetails(PackageDetailReqVO reqVO);
/**
* 获取包裹板件、配件详情
@@ -232,8 +232,16 @@ public class PackServiceImpl implements PackService {
OrderPackagDO existPackageDO = validateOrdersExists(orderIds, packNo);
// 新增/删除 板件配件全为空代表是原封不动的封包
boolean justPack = CollUtil.isEmpty(addPlateNos) && CollUtil.isEmpty(addPartsList)
&& CollUtil.isEmpty(deletePlateNos) && CollUtil.isEmpty(delPartsList);
// 判断包裹ID是否为空,为空,走新增,不为空,走更新
if (ObjectUtil.isEmpty(existPackageDO)) {
if (justPack) {
throw new ServiceException(PACK_DATA_NULL);
}
String packageNo = generatePackageNo();
List<OrderPackagDO> orderPackageDOS = new ArrayList<>();
for (Long orderId : orderIds) {
@@ -287,11 +295,6 @@ public class PackServiceImpl implements PackService {
return typeConversion(orderPackageDOS.get(0), orderIds);
}
if (CollUtil.isEmpty(addPlateNos) && CollUtil.isEmpty(addPartsList)
&& CollUtil.isEmpty(deletePlateNos) && CollUtil.isEmpty(delPartsList)) {
throw new ServiceException(PACK_DATA_NULL);
}
String existPackageNo = existPackageDO.getPackageNo();
// 板件明细新增包裹 ID
List<List<Long>> split = CollUtil.split(addPlateNos, 1000);
@@ -361,8 +364,10 @@ public class PackServiceImpl implements PackService {
p.updateOrderStatus(orderDO);
}
}
// 更新已打包数量到订单
orderInfoVersionControlService.updateOrderPackNum(orderDOS);
if (!justPack) {
// 更新已打包数量到订单
orderInfoVersionControlService.updateOrderPackNum(orderDOS);
}
return typeConversion(existPackageDO, orderIds);
@@ -1212,14 +1217,16 @@ public class PackServiceImpl implements PackService {
}
@Override
public List<PackageDetailsRespVO> getOrdersPackageDetails(String packageNo) {
public List<PackageDetailsRespVO> getOrdersPackageDetails(PackageDetailReqVO reqVO) {
Set<Long> orderIds = reqVO.getOrderIds().stream().collect(Collectors.toSet());
String packageNo = reqVO.getPackageNo();
List<OrderPackagDO> orderPackagDONews = orderPackageMapper.selectList(new LambdaQueryWrapper<OrderPackagDO>()
.in(OrderPackagDO::getOrderId, orderIds)
.eq(OrderPackagDO::getPackageNo, packageNo));
if (CollUtil.isEmpty(orderPackagDONews)) {
return new ArrayList<>();
}
Set<Long> orderIds = orderPackagDONews.stream().map(OrderPackagDO::getOrderId).collect(Collectors.toSet());
// 查询板件
List<PackageDetailsRespVO> packPlateList = orderPlateMapper.selectPackedPlateList(orderIds, packageNo);
// 查询配件