|
@@ -1,5 +1,9 @@
|
|
|
package cn.start.tz.module.pressure2.service.paymentfollowrecord;
|
|
package cn.start.tz.module.pressure2.service.paymentfollowrecord;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
+import cn.start.tz.module.system.api.user.AdminUserApi;
|
|
|
|
|
+import cn.start.tz.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -30,6 +34,9 @@ public class PaymentFollowRecordServiceImpl extends ServiceImpl<PaymentFollowRec
|
|
|
@Resource
|
|
@Resource
|
|
|
private PaymentFollowRecordMapper paymentFollowRecordMapper;
|
|
private PaymentFollowRecordMapper paymentFollowRecordMapper;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private AdminUserApi adminUserApi;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public String createPaymentFollowRecord(PaymentFollowRecordSaveReqVO createReqVO) {
|
|
public String createPaymentFollowRecord(PaymentFollowRecordSaveReqVO createReqVO) {
|
|
|
// 插入
|
|
// 插入
|
|
@@ -68,8 +75,33 @@ public class PaymentFollowRecordServiceImpl extends ServiceImpl<PaymentFollowRec
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public PageResult<PaymentFollowRecordDO> getPaymentFollowRecordPage(PaymentFollowRecordPageReqVO pageReqVO) {
|
|
|
|
|
- return paymentFollowRecordMapper.selectPage(pageReqVO);
|
|
|
|
|
|
|
+ public PageResult<PaymentFollowRecordRespVO> getPaymentFollowRecordPage(PaymentFollowRecordPageReqVO pageReqVO) {
|
|
|
|
|
+ PageResult<PaymentFollowRecordRespVO> pageResult = new PageResult<>();
|
|
|
|
|
+ PageResult<PaymentFollowRecordDO> paymentFollowRecordDOPageResult = paymentFollowRecordMapper.selectPage(pageReqVO);
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(paymentFollowRecordDOPageResult) && paymentFollowRecordDOPageResult.getTotal() > 0) {
|
|
|
|
|
+ pageResult.setTotal(paymentFollowRecordDOPageResult.getTotal());
|
|
|
|
|
+ List<PaymentFollowRecordRespVO> list = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ List<String> followIds = paymentFollowRecordDOPageResult.getList().stream().map(PaymentFollowRecordDO::getCreator).filter(Objects::nonNull) .distinct().toList();
|
|
|
|
|
+ Map<String, AdminUserRespDTO> userMap = new HashMap<>();
|
|
|
|
|
+ if (CollUtil.isNotEmpty(followIds)) {
|
|
|
|
|
+ userMap = adminUserApi.getUserMap(followIds);
|
|
|
|
|
+ }
|
|
|
|
|
+ for (PaymentFollowRecordDO paymentFollowRecordDO : paymentFollowRecordDOPageResult.getList()) {
|
|
|
|
|
+ PaymentFollowRecordRespVO paymentFollowRecordRespVO = new PaymentFollowRecordRespVO();
|
|
|
|
|
+ BeanUtils.copyProperties(paymentFollowRecordDO, paymentFollowRecordRespVO);
|
|
|
|
|
+ paymentFollowRecordRespVO.setFollowId(paymentFollowRecordDO.getCreator());
|
|
|
|
|
+ AdminUserRespDTO adminUserRespDTO = userMap.get(paymentFollowRecordDO.getCreator());
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(adminUserRespDTO)) {
|
|
|
|
|
+ paymentFollowRecordRespVO.setFollowName(adminUserRespDTO.getNickname());
|
|
|
|
|
+ }
|
|
|
|
|
+ list.add(paymentFollowRecordRespVO);
|
|
|
|
|
+ }
|
|
|
|
|
+ pageResult.setList(list);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return pageResult;
|
|
|
|
|
+ }
|
|
|
|
|
+ return pageResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|