Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

xuzhancheng před 23 hodinami
rodič
revize
e917e52959

+ 12 - 12
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/paymentfollowrecord/PaymentFollowRecordController.java

@@ -70,20 +70,20 @@ public class PaymentFollowRecordController {
     @GetMapping("/page")
     @Operation(summary = "获得缴费跟进记录分页")
     public CommonResult<PageResult<PaymentFollowRecordRespVO>> getPaymentFollowRecordPage(@Valid PaymentFollowRecordPageReqVO pageReqVO) {
-        PageResult<PaymentFollowRecordDO> pageResult = paymentFollowRecordService.getPaymentFollowRecordPage(pageReqVO);
+        PageResult<PaymentFollowRecordRespVO> pageResult = paymentFollowRecordService.getPaymentFollowRecordPage(pageReqVO);
         return success(BeanUtils.toBean(pageResult, PaymentFollowRecordRespVO.class));
     }
 
-    @GetMapping("/export-excel")
-    @Operation(summary = "导出缴费跟进记录 Excel")
-    @ApiAccessLog(operateType = EXPORT)
-    public void exportPaymentFollowRecordExcel(@Valid PaymentFollowRecordPageReqVO pageReqVO,
-              HttpServletResponse response) throws IOException {
-        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<PaymentFollowRecordDO> list = paymentFollowRecordService.getPaymentFollowRecordPage(pageReqVO).getList();
-        // 导出 Excel
-        ExcelUtils.write(response, "缴费跟进记录.xls", "数据", PaymentFollowRecordRespVO.class,
-                        BeanUtils.toBean(list, PaymentFollowRecordRespVO.class));
-    }
+//    @GetMapping("/export-excel")
+//    @Operation(summary = "导出缴费跟进记录 Excel")
+//    @ApiAccessLog(operateType = EXPORT)
+//    public void exportPaymentFollowRecordExcel(@Valid PaymentFollowRecordPageReqVO pageReqVO,
+//              HttpServletResponse response) throws IOException {
+//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+//        List<PaymentFollowRecordRespVO> list = paymentFollowRecordService.getPaymentFollowRecordPage(pageReqVO).getList();
+//        // 导出 Excel
+//        ExcelUtils.write(response, "缴费跟进记录.xls", "数据", PaymentFollowRecordRespVO.class,
+//                        BeanUtils.toBean(list, PaymentFollowRecordRespVO.class));
+//    }
 
 }

+ 6 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/paymentfollowrecord/vo/PaymentFollowRecordRespVO.java

@@ -32,4 +32,10 @@ public class PaymentFollowRecordRespVO {
     @ExcelProperty("公众号推送状态(0=成功,1=拒绝接收,2=其他原因失败,3=发送失败)")
     private Integer status;
 
+    @Schema(description = "跟进人id")
+    private String followId;
+
+    @Schema(description = "跟进人名称")
+    private String followName;
+
 }

+ 1 - 1
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/paymentfollowrecord/PaymentFollowRecordService.java

@@ -51,6 +51,6 @@ public interface PaymentFollowRecordService extends IService<PaymentFollowRecord
      * @param pageReqVO 分页查询
      * @return 缴费跟进记录分页
      */
-    PageResult<PaymentFollowRecordDO> getPaymentFollowRecordPage(PaymentFollowRecordPageReqVO pageReqVO);
+    PageResult<PaymentFollowRecordRespVO> getPaymentFollowRecordPage(PaymentFollowRecordPageReqVO pageReqVO);
 
 }

+ 34 - 2
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/paymentfollowrecord/PaymentFollowRecordServiceImpl.java

@@ -1,5 +1,9 @@
 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 jakarta.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
@@ -30,6 +34,9 @@ public class PaymentFollowRecordServiceImpl extends ServiceImpl<PaymentFollowRec
     @Resource
     private PaymentFollowRecordMapper paymentFollowRecordMapper;
 
+    @Resource
+    private AdminUserApi adminUserApi;
+
     @Override
     public String createPaymentFollowRecord(PaymentFollowRecordSaveReqVO createReqVO) {
         // 插入
@@ -68,8 +75,33 @@ public class PaymentFollowRecordServiceImpl extends ServiceImpl<PaymentFollowRec
     }
 
     @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;
     }
 
 }

+ 5 - 5
tz-module-pressure2/tz-module-pressure2-biz/src/main/resources/mapper/taskordernontaxapply/TaskOrderLeftJoinMapper.xml

@@ -32,16 +32,16 @@
         FROM pressure_task_order t
         LEFT JOIN pressure2_payment_follow_record p ON p.task_order_id = t.id AND p.deleted = 0
         AND p.id IN (
-            SELECT id FROM pressure_payment_follow_record
+            SELECT id FROM pressure2_payment_follow_record
             WHERE deleted = 0
             AND (task_order_id, create_time) IN (
             SELECT task_order_id, MAX(create_time)
-            FROM pressure_payment_follow_record
+            FROM pressure2_payment_follow_record
             WHERE deleted = 0
             GROUP BY task_order_id
             )
         )
-        left join system_client_unit c on c.id = t.use_unit_id  and c.deleted = 0
+        left join system_client_unit c on c.CODE = t.UNIT_CODE  and c.deleted = 0
         WHERE t.deleted = 0 AND t.equip_main_type in (200,300)
         AND t.task_status = 800
         <if test="reqVO.paymentStatus != null">
@@ -103,12 +103,12 @@
         WHERE deleted = 0
         AND (task_order_id, create_time) IN (
         SELECT task_order_id, MAX(create_time)
-        FROM pressure_payment_follow_record
+        FROM pressure2_payment_follow_record
         WHERE deleted = 0
         GROUP BY task_order_id
         )
         )
-        left join system_client_unit c on c.id = t.use_unit_id and c.deleted = 0
+        left join system_client_unit c on c.CODE = t.UNIT_CODE and c.deleted = 0
         WHERE t.deleted = 0 AND t.equip_main_type in (200,300)
         AND t.task_status = 800
         <if test="reqVO.paymentStatus != null">