liub há 4 meses atrás
pai
commit
b1dc55addb

+ 2 - 0
commons/src/main/java/com/jzg/commons/entity/dto/IncomeAndExpenseParam.java

@@ -22,5 +22,7 @@ public class IncomeAndExpenseParam {
     @Schema(description = "收支状态 0-收入 1-支出")
     private String incomeAndExpense;
 
+    @Schema(description = "月份筛选 格式:yyyy-MM,例如:2026-03")
+    private String month;
 
 }

+ 1 - 0
gateway/src/main/java/com/jzg/config/CorsConfig.java

@@ -17,6 +17,7 @@ public class CorsConfig {
         corsConfiguration.addAllowedOrigin("http://localhost:8082");
         corsConfiguration.addAllowedOrigin("http://localhost:9000");
         corsConfiguration.addAllowedOrigin("http://localhost:9001");
+        corsConfiguration.addAllowedOrigin("http://localhost:9002");
         corsConfiguration.addAllowedOrigin("http://127.0.0.1:9000");
         corsConfiguration.addAllowedOrigin("http://192.168.0.149:9000");
         corsConfiguration.addAllowedOrigin("http://192.168.0.253:9000");

+ 1 - 1
tenant/costsorrule/src/main/java/com/jzg/costsorrule/client/QuoteClient.java

@@ -5,7 +5,7 @@ import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 
-@FeignClient(name = "jzg-insurance")
+@FeignClient(name = "quotation-summary")
 public interface QuoteClient {
 
     /**

+ 1 - 1
tenant/insurance/quotation-summary/src/main/resources/application-dev.yaml

@@ -246,7 +246,7 @@ zhongAn:
 
 feign:
   client:
-    jzg-insurance:
+    quotation-summary:
       url: http://localhost:9898/
     jzg-org:
       url: http://localhost:8084/

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/client/QuoteClient.java

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
-@FeignClient(name = "jzg-insurance")
+@FeignClient(name = "quotation-summary")
 public interface QuoteClient {
 
     @GetMapping(value = "/supplementOrder/selectById")

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/controller/MessageController.java

@@ -59,7 +59,7 @@ public class MessageController extends BaseController {
         String userName = getUserName();
         SysUser sysUser = userService.getOne(new LambdaQueryWrapper<SysUser>()
                 .eq(SysUser::getMobile, userName));
-        param.setUserId(sysUser.getId());
+        param.setUserId(sysUser.getMobile());
         Page<MessageVo> result = messageService.queryPage(param);
         return HttpResult.ok(result);
     }

+ 81 - 6
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysUserAccountServiceImpl.java

@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.YearMonth;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -206,18 +207,66 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
         String systemCode = baseController.getAppSystemCode();
         SysUser sysUser = sysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getMobile, mobile));
         SysUserJzgInfo sysUserJzgInfo = sysUserJzgInfoService.getOne(new LambdaQueryWrapper<SysUserJzgInfo>().eq(SysUserJzgInfo::getUserId, sysUser.getId()).eq(SysUserJzgInfo::getSystemCode, systemCode));
-        List<SysAmountAuditing> sysAmountAuditingList = sysAmountAuditingService
-                .list(new LambdaQueryWrapper<SysAmountAuditing>()
-                        .eq(SysAmountAuditing::getUserId, sysUser.getId())
-                        .eq(SysAmountAuditing::getAuditingStatus, param.getStatus()));
+
+        // 处理月份筛选参数
+        String createTimeStart = param.getCreateTimeStart();
+        String createTimeEnd = param.getCreateTimeEnd();
+        if (param.getMonth() != null && !param.getMonth().isEmpty()) {
+            // 如果传入了月份参数,计算该月的开始和结束时间
+            String monthStr = param.getMonth();
+            DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
+            YearMonth yearMonth = YearMonth.parse(monthStr, monthFormatter);
+            LocalDateTime monthStart = yearMonth.atDay(1).atStartOfDay();
+            LocalDateTime monthEnd = yearMonth.atEndOfMonth().atTime(23, 59, 59, 999999999);
+            
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            createTimeStart = monthStart.format(formatter);
+            createTimeEnd = monthEnd.format(formatter);
+        }
+
+        // 构建查询条件(支持时间范围筛选)
+        LambdaQueryWrapper<SysAmountAuditing> auditingWrapper = new LambdaQueryWrapper<SysAmountAuditing>()
+                .eq(SysAmountAuditing::getUserId, sysUser.getId());
+        
+        // 支出状态筛选
+        if (param.getStatus() != null && !param.getStatus().isEmpty()) {
+            auditingWrapper.eq(SysAmountAuditing::getAuditingStatus, param.getStatus());
+        }
+        
+        // 时间筛选(支出记录)
+        if (createTimeStart != null && !createTimeStart.isEmpty()) {
+            auditingWrapper.ge(SysAmountAuditing::getCreateTime,
+                    LocalDateTime.parse(createTimeStart, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
+        if (createTimeEnd != null && !createTimeEnd.isEmpty()) {
+            auditingWrapper.le(SysAmountAuditing::getCreateTime,
+                    LocalDateTime.parse(createTimeEnd, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
+        
+        List<SysAmountAuditing> sysAmountAuditingList = sysAmountAuditingService.list(auditingWrapper);
+
+        // 构建订单收入查询参数(手动设置时间,避免类型转换问题)
         InsFeeOrdersParam feeOrdersParam = new InsFeeOrdersParam();
-        BeanUtils.copyProperties(param, feeOrdersParam);
         feeOrdersParam.setUserId(sysUserJzgInfo.getUserId());
+        if (createTimeStart != null && !createTimeStart.isEmpty()) {
+            feeOrdersParam.setCreateTimeStart(LocalDateTime.parse(createTimeStart, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
+        if (createTimeEnd != null && !createTimeEnd.isEmpty()) {
+            feeOrdersParam.setCreateTimeEnd(LocalDateTime.parse(createTimeEnd, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
         List<InsFeeOrders> insFeeOrdersList = quoteClient.getInsFeeOrderByUserId(feeOrdersParam);
+
+        // 构建分销收入查询参数
         InsFeeOrdersParam feeOrdersParam1 = new InsFeeOrdersParam();
-        BeanUtils.copyProperties(param, feeOrdersParam1);
         feeOrdersParam1.setDistributorId(sysUserJzgInfo.getId());
+        if (createTimeStart != null && !createTimeStart.isEmpty()) {
+            feeOrdersParam1.setCreateTimeStart(LocalDateTime.parse(createTimeStart, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
+        if (createTimeEnd != null && !createTimeEnd.isEmpty()) {
+            feeOrdersParam1.setCreateTimeEnd(LocalDateTime.parse(createTimeEnd, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
         List<InsFeeOrders> distributionList = quoteClient.getInsFeeOrdersList(feeOrdersParam1);
+
         List<IncomeAndExpenseVo.IncomeAndExpenseList> allRecords = new ArrayList<>();
         // 处理支出记录
         for (SysAmountAuditing auditing : sysAmountAuditingList) {
@@ -263,6 +312,14 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             if (b.getCreateTime() == null) return -1;
             return b.getCreateTime().compareTo(a.getCreateTime());
         });
+
+        // 收支状态筛选(在排序后、分组前进行)
+        if (param.getIncomeAndExpense() != null && !param.getIncomeAndExpense().isEmpty()) {
+            allRecords = allRecords.stream()
+                    .filter(record -> param.getIncomeAndExpense().equals(record.getIncomeAndExpense()))
+                    .collect(Collectors.toList());
+        }
+
         // 按月份分组统计
         Map<String, IncomeAndExpenseVo.IncomeAndExpense> monthSummaryMap = new TreeMap<>(Collections.reverseOrder());
         for (IncomeAndExpenseVo.IncomeAndExpenseList record : allRecords) {
@@ -294,6 +351,24 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             summary.setBalance(summary.getIncome().subtract(summary.getExpense()));
         }
 
+        // 如果指定了月份筛选,只返回该月的数据
+        if (param.getMonth() != null && !param.getMonth().isEmpty()) {
+            List<IncomeAndExpenseVo> result = new ArrayList<>();
+            IncomeAndExpenseVo vo = new IncomeAndExpenseVo();
+            IncomeAndExpenseVo.IncomeAndExpense summary = monthSummaryMap.get(param.getMonth());
+            if (summary != null) {
+                vo.setIncomeAndExpense(summary);
+                
+                // 筛选当前月份的明细记录
+                List<IncomeAndExpenseVo.IncomeAndExpenseList> monthRecords = allRecords.stream()
+                        .filter(record -> param.getMonth().equals(record.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM"))))
+                        .collect(Collectors.toList());
+                vo.setIncomeAndExpenseList(monthRecords);
+                result.add(vo);
+            }
+            return result;
+        }
+
         // 构建返回结果
         List<IncomeAndExpenseVo> result = new ArrayList<>();
         for (Map.Entry<String, IncomeAndExpenseVo.IncomeAndExpense> entry : monthSummaryMap.entrySet()) {

+ 1 - 1
tenant/organization/src/main/resources/application-dev.yml

@@ -22,7 +22,7 @@ config:
 
 feign:
   client:
-    jzg-insurance:
+    quotation-summary:
       url: http://localhost:9898/
     jzg-org:
       url: http://localhost:8084/

+ 2 - 1
tenant/organization/src/main/resources/mapper/SysUserJzgInfoBankCardMapper.xml

@@ -21,11 +21,12 @@
             sujibc.bank_name as bankName,
             sujibc.bank_address as bankAddress,
             sujibc.bank_card_number as bankCardNumber,
+            sujibc.card_holder_mobile as cardHolderMobile,
             sujibc.audit_status as auditStatus,
             sujif.file_url as cardFileUrl
         from
             sys_user_jzg_info_bank_card sujibc
-        left join sys_user_jzg_info suji on suji.user_id = sujibc.user_info_id and suji.system_code = #{systemCode}
+        left join sys_user_jzg_info suji on suji.id = sujibc.user_info_id and suji.system_code = #{systemCode}
         left join sys_user_jzg_info_file sujif on sujif.id = sujibc.file_id
         where
             1=1