Commit 1ad8b5291bf42861626f082f21521d52ee5892b1
1 parent
d3d00639
fix: 补齐销售订单筛选及拼团团长昵称
Showing
6 changed files
with
50 additions
and
1 deletions
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/CombinationRecordController.java
| ... | ... | @@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController; |
| 24 | 24 | import jakarta.annotation.Resource; |
| 25 | 25 | import jakarta.validation.Valid; |
| 26 | 26 | import java.util.List; |
| 27 | +import java.util.Map; | |
| 27 | 28 | |
| 28 | 29 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 29 | 30 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| ... | ... | @@ -51,7 +52,19 @@ public class CombinationRecordController { |
| 51 | 52 | convertSet(recordPage.getList(), CombinationRecordDO::getActivityId)); |
| 52 | 53 | List<CombinationProductDO> products = combinationActivityService.getCombinationProductListByActivityIds( |
| 53 | 54 | convertSet(recordPage.getList(), CombinationRecordDO::getActivityId)); |
| 54 | - return success(CombinationActivityConvert.INSTANCE.convert(recordPage, activities, products)); | |
| 55 | + PageResult<CombinationRecordPageItemRespVO> result = CombinationActivityConvert.INSTANCE.convert(recordPage, activities, products); | |
| 56 | + Map<Long, CombinationRecordDO> headRecords = combinationRecordService.getCombinationRecordMapByIds( | |
| 57 | + convertSet(recordPage.getList(), CombinationRecordDO::getHeadId, | |
| 58 | + record -> record.getHeadId() != null && record.getHeadId() > 0)); | |
| 59 | + result.getList().forEach(item -> { | |
| 60 | + if (item.getHeadId() == null || CombinationRecordDO.HEAD_ID_GROUP.equals(item.getHeadId())) { | |
| 61 | + item.setHeadNickname(item.getNickname()); | |
| 62 | + } else { | |
| 63 | + CombinationRecordDO headRecord = headRecords.get(item.getHeadId()); | |
| 64 | + item.setHeadNickname(headRecord == null ? null : headRecord.getNickname()); | |
| 65 | + } | |
| 66 | + }); | |
| 67 | + return success(result); | |
| 55 | 68 | } |
| 56 | 69 | |
| 57 | 70 | @GetMapping("/get-summary") | ... | ... |
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/vo/recrod/CombinationRecordPageItemRespVO.java
| ... | ... | @@ -12,6 +12,9 @@ import lombok.ToString; |
| 12 | 12 | @ToString(callSuper = true) |
| 13 | 13 | public class CombinationRecordPageItemRespVO extends CombinationRecordBaseVO { |
| 14 | 14 | |
| 15 | + @Schema(description = "团长昵称", example = "芋道源码") | |
| 16 | + private String headNickname; | |
| 17 | + | |
| 15 | 18 | // ========== 活动相关 ========== |
| 16 | 19 | |
| 17 | 20 | private CombinationActivityRespVO activity; | ... | ... |
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordService.java
| ... | ... | @@ -15,6 +15,8 @@ import java.util.Collection; |
| 15 | 15 | import java.util.List; |
| 16 | 16 | import java.util.Map; |
| 17 | 17 | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; | |
| 19 | + | |
| 18 | 20 | /** |
| 19 | 21 | * 拼团记录 Service 接口 |
| 20 | 22 | * |
| ... | ... | @@ -120,6 +122,24 @@ public interface CombinationRecordService { |
| 120 | 122 | List<CombinationRecordDO> getCombinationRecordListByHeadId(Long headId); |
| 121 | 123 | |
| 122 | 124 | /** |
| 125 | + * 获得指定编号的拼团记录列表 | |
| 126 | + * | |
| 127 | + * @param ids 记录编号集合 | |
| 128 | + * @return 拼团记录列表 | |
| 129 | + */ | |
| 130 | + List<CombinationRecordDO> getCombinationRecordListByIds(Collection<Long> ids); | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * 获得指定编号的拼团记录 Map | |
| 134 | + * | |
| 135 | + * @param ids 记录编号集合 | |
| 136 | + * @return 拼团记录 Map | |
| 137 | + */ | |
| 138 | + default Map<Long, CombinationRecordDO> getCombinationRecordMapByIds(Collection<Long> ids) { | |
| 139 | + return convertMap(getCombinationRecordListByIds(ids), CombinationRecordDO::getId); | |
| 140 | + } | |
| 141 | + | |
| 142 | + /** | |
| 123 | 143 | * 获取拼团记录分页数据 |
| 124 | 144 | * |
| 125 | 145 | * @param pageVO 分页请求 | ... | ... |
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java
| ... | ... | @@ -40,6 +40,7 @@ import org.springframework.validation.annotation.Validated; |
| 40 | 40 | import java.time.LocalDateTime; |
| 41 | 41 | import java.util.ArrayList; |
| 42 | 42 | import java.util.Collection; |
| 43 | +import java.util.Collections; | |
| 43 | 44 | import java.util.List; |
| 44 | 45 | import java.util.Map; |
| 45 | 46 | |
| ... | ... | @@ -287,6 +288,14 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 287 | 288 | } |
| 288 | 289 | |
| 289 | 290 | @Override |
| 291 | + public List<CombinationRecordDO> getCombinationRecordListByIds(Collection<Long> ids) { | |
| 292 | + if (CollUtil.isEmpty(ids)) { | |
| 293 | + return Collections.emptyList(); | |
| 294 | + } | |
| 295 | + return combinationRecordMapper.selectByIds(ids); | |
| 296 | + } | |
| 297 | + | |
| 298 | + @Override | |
| 290 | 299 | public PageResult<CombinationRecordDO> getCombinationRecordPage(CombinationRecordReqPageVO pageVO) { |
| 291 | 300 | return combinationRecordMapper.selectPage(pageVO); |
| 292 | 301 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/productsales/vo/MesWmProductSalesPageReqVO.java
| ... | ... | @@ -23,6 +23,9 @@ public class MesWmProductSalesPageReqVO extends PageParam { |
| 23 | 23 | @Schema(description = "出库单名称", example = "产品出库单") |
| 24 | 24 | private String name; |
| 25 | 25 | |
| 26 | + @Schema(description = "销售订单编号", example = "SO202603010001") | |
| 27 | + private String salesOrderCode; | |
| 28 | + | |
| 26 | 29 | @Schema(description = "客户编号", example = "1") |
| 27 | 30 | private Long clientId; |
| 28 | 31 | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/productsales/MesWmProductSalesMapper.java
| ... | ... | @@ -21,6 +21,7 @@ public interface MesWmProductSalesMapper extends BaseMapperX<MesWmProductSalesDO |
| 21 | 21 | return selectPage(reqVO, new LambdaQueryWrapperX<MesWmProductSalesDO>() |
| 22 | 22 | .likeIfPresent(MesWmProductSalesDO::getCode, reqVO.getCode()) |
| 23 | 23 | .likeIfPresent(MesWmProductSalesDO::getName, reqVO.getName()) |
| 24 | + .likeIfPresent(MesWmProductSalesDO::getSalesOrderCode, reqVO.getSalesOrderCode()) | |
| 24 | 25 | .eqIfPresent(MesWmProductSalesDO::getClientId, reqVO.getClientId()) |
| 25 | 26 | .eqIfPresent(MesWmProductSalesDO::getStatus, reqVO.getStatus()) |
| 26 | 27 | .betweenIfPresent(MesWmProductSalesDO::getSalesDate, reqVO.getShipmentDate()) | ... | ... |