Browse Source

no message

FengChaoYu 1 month ago
parent
commit
5c02e3b765

+ 1 - 2
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/controller/user/UserCompanyCreditController.java

@@ -1,7 +1,6 @@
 package com.gree.mall.miniapp.controller.user;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.gree.mall.miniapp.bean.user.UserWxBean;
 import com.gree.mall.miniapp.enums.TransactionTypeEnum;
 import com.gree.mall.miniapp.helper.ResponseHelper;
 import com.gree.mall.miniapp.logic.user.UserCompanyCreditLogic;
@@ -40,7 +39,7 @@ public class UserCompanyCreditController {
     @ApiOperation(value = "授信账单列表")
     public ResponseHelper<List<UserCompanyCreditBill>> billList(
             @ApiParam(required = true, value = "商户id") @RequestParam String companyWechatId,
-            @ApiParam(value = "年度") @RequestParam(required = false) Integer year,
+            @ApiParam(value = "年度(不传查当前年度)") @RequestParam(required = false) Integer year,
             @ApiParam(required = true, value = "pageNum") @RequestParam Integer pageNum,
             @ApiParam(required = true, value = "pageSize") @RequestParam Integer pageSize
     ) {

+ 5 - 3
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/user/UserCompanyCreditLogic.java

@@ -6,13 +6,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
-import com.gree.mall.miniapp.bean.user.SettleMonthWagesWorkerBean;
 import com.gree.mall.miniapp.commonmapper.LockQueryMapper;
 import com.gree.mall.miniapp.constant.Constant;
 import com.gree.mall.miniapp.enums.TransactionTypeEnum;
 import com.gree.mall.miniapp.enums.UserCreditBillStatusEnum;
 import com.gree.mall.miniapp.exception.RemoteServiceException;
-import com.gree.mall.miniapp.helper.ResponseHelper;
 import com.gree.mall.miniapp.logic.common.CommonLogic;
 import com.gree.mall.miniapp.plus.entity.*;
 import com.gree.mall.miniapp.plus.service.UserCompanyCreditBillItemService;
@@ -142,12 +140,16 @@ public class UserCompanyCreditLogic {
     public IPage<UserCompanyCreditBill> billList(String companyWechatId, Integer year, Integer pageNum, Integer pageSize) {
         CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
 
+        if (Objects.isNull(year)) {
+            year = DateUtil.year(DateUtil.date());
+        }
+
         DateTime start = DateUtil.beginOfYear(DateUtil.parse(year + "-01-01"));
         DateTime end = DateUtil.endOfYear(DateUtil.parse(year + "-01-01"));
         IPage<UserCompanyCreditBill> page = userCompanyCreditBillService.lambdaQuery()
                 .eq(UserCompanyCreditBill::getUserId, currentCompanyWechat.getUserId())
                 .eq(UserCompanyCreditBill::getCompanyWechatId, companyWechatId)
-                .between(Objects.nonNull(year), UserCompanyCreditBill::getCreateTime, start, end)
+                .between(UserCompanyCreditBill::getCreateTime, start, end)
                 .orderByDesc(UserCompanyCreditBill::getBillId)
                 .page(new Page<>(pageNum, pageSize));