Browse Source

no message

FengChaoYu 2 weeks ago
parent
commit
e4239057f9

+ 0 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/bean/user/UserWxBean.java

@@ -1,7 +1,6 @@
 package com.gree.mall.miniapp.bean.user;
 
 import com.gree.mall.miniapp.plus.entity.User;
-import com.gree.mall.miniapp.plus.entity.UserCompanyAttr;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;

+ 10 - 11
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/common/CommonLogic.java

@@ -1,6 +1,5 @@
 package com.gree.mall.miniapp.logic.common;
 
-import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.http.HttpUtil;
@@ -60,7 +59,7 @@ public class CommonLogic {
     @Resource
     OrderPickTimeConfigService orderPickTimeConfigService;
     @Resource
-    UserCompanyAttrService userCompanyAttrService;
+    UserCompanyCreditService userCompanyCreditService;
     @Resource
     UserCompanyDeliveryService userCompanyDeliveryService;
     @Resource
@@ -133,9 +132,9 @@ public class CommonLogic {
         }
 
         // 商户授信用户记录
-        final UserCompanyAttr userCompanyAttr = userCompanyAttrService.lambdaQuery()
-                .eq(UserCompanyAttr::getUserId, userId)
-                .eq(UserCompanyAttr::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
+        final UserCompanyCredit userCompanyCredit = userCompanyCreditService.lambdaQuery()
+                .eq(UserCompanyCredit::getUserId, userId)
+                .eq(UserCompanyCredit::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
                 .one();
 
         // 是否配送员记录
@@ -146,12 +145,12 @@ public class CommonLogic {
 
         currentCompanyWechat.setIsDelivery(existDelivery > 0);
 
-        if (Objects.nonNull(userCompanyAttr)) {
-            currentCompanyWechat.setCreditLimit(userCompanyAttr.getCreditLimit());
-            currentCompanyWechat.setAvailableCredit(userCompanyAttr.getAvailableCredit());
-            currentCompanyWechat.setIsCreditEnabled(userCompanyAttr.getIsCreditEnabled());
-            currentCompanyWechat.setBillingDay(userCompanyAttr.getBillingDay());
-            currentCompanyWechat.setPaymentGracePeriod(userCompanyAttr.getPaymentGracePeriod());
+        if (Objects.nonNull(userCompanyCredit)) {
+            currentCompanyWechat.setCreditLimit(userCompanyCredit.getCreditLimit());
+            currentCompanyWechat.setAvailableCredit(userCompanyCredit.getAvailableCredit());
+            currentCompanyWechat.setIsCreditEnabled(userCompanyCredit.getIsCreditEnabled());
+            currentCompanyWechat.setBillingDay(userCompanyCredit.getBillingDay());
+            currentCompanyWechat.setPaymentGracePeriod(userCompanyCredit.getPaymentGracePeriod());
         }
 
         return currentCompanyWechat;

+ 2 - 5
mall-server-api/src/main/java/com/gree/mall/manager/bean/member/UserCompanyAttrBean.java → mall-server-api/src/main/java/com/gree/mall/manager/bean/member/UserCompanyCreditBean.java

@@ -1,18 +1,15 @@
 package com.gree.mall.manager.bean.member;
 
-import com.gree.mall.manager.plus.entity.User;
-import com.gree.mall.manager.plus.entity.UserCompanyAttr;
+import com.gree.mall.manager.plus.entity.UserCompanyCredit;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
-
 @EqualsAndHashCode(callSuper = true)
 @ApiModel
 @Data
-public class UserCompanyAttrBean extends UserCompanyAttr {
+public class UserCompanyCreditBean extends UserCompanyCredit {
 
     @ApiModelProperty(value = "师傅名称")
     private String nickName;

+ 5 - 5
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/CommonMapper.java

@@ -14,7 +14,7 @@ import com.gree.mall.manager.bean.listvo.order.PunishOrderVO;
 import com.gree.mall.manager.bean.listvo.param.ExamineZfireParamBean;
 import com.gree.mall.manager.bean.listvo.param.WorkOrderZfireParam;
 import com.gree.mall.manager.bean.listvo.workorder.*;
-import com.gree.mall.manager.bean.member.UserCompanyAttrBean;
+import com.gree.mall.manager.bean.member.UserCompanyCreditBean;
 import com.gree.mall.manager.bean.member.UserCompanyDeliveryVO;
 import com.gree.mall.manager.bean.order.LeaseOrderVO;
 import com.gree.mall.manager.bean.order.OrderPickTimeConfigVO;
@@ -566,10 +566,10 @@ public interface CommonMapper {
      * @param mobile
      * @return
      */
-    IPage<UserCompanyAttrBean> companyCredit(Page<Object> objectPage,
-                                             @Param("companyWechatId") String companyWechatId,
-                                             @Param("nickName") String nickName,
-                                             @Param("mobile") String mobile);
+    IPage<UserCompanyCreditBean> companyCredit(Page<Object> objectPage,
+                                               @Param("companyWechatId") String companyWechatId,
+                                               @Param("nickName") String nickName,
+                                               @Param("mobile") String mobile);
 
     /**
      * 仓储提货时间配置

+ 3 - 3
mall-server-api/src/main/java/com/gree/mall/manager/controller/member/MemberController.java

@@ -9,7 +9,7 @@ import com.gree.mall.manager.bean.listvo.UserCustomerVO;
 import com.gree.mall.manager.bean.listvo.UserVO;
 import com.gree.mall.manager.bean.listvo.workorder.UserWaitVO;
 import com.gree.mall.manager.bean.member.UserApplyBean;
-import com.gree.mall.manager.bean.member.UserCompanyAttrBean;
+import com.gree.mall.manager.bean.member.UserCompanyCreditBean;
 import com.gree.mall.manager.bean.member.UserCompanyDeliveryAddBean;
 import com.gree.mall.manager.bean.member.UserCompanyDeliveryVO;
 import com.gree.mall.manager.bean.user.UserWxBean;
@@ -373,13 +373,13 @@ public class MemberController {
 
     @PostMapping("/company/credit")
     @ApiOperation(value = "商户授信人员列表")
-    public ResponseHelper<IPage<UserCompanyAttrBean>> companyCredit(
+    public ResponseHelper<IPage<UserCompanyCreditBean>> companyCredit(
             @ApiParam(value = "昵称") @RequestParam(required = false) String nickName,
             @ApiParam(value = "手机号") @RequestParam(required = false) String mobile,
             @ApiParam(value = "页号", required = true) @RequestParam Integer pageNum,
             @ApiParam(value = "页大小", required = true) @RequestParam Integer pageSize
     ) {
-        IPage<UserCompanyAttrBean> list = userLogic.companyCredit(nickName, mobile, pageNum, pageSize);
+        IPage<UserCompanyCreditBean> list = userLogic.companyCredit(nickName, mobile, pageNum, pageSize);
         return ResponseHelper.success(list);
     }
 

+ 14 - 14
mall-server-api/src/main/java/com/gree/mall/manager/logic/user/UserLogic.java

@@ -65,7 +65,7 @@ public class UserLogic {
     private final PgOrderBaseService pgOrderBaseService;
     private final PgOrderWorkerService pgOrderWorkerService;
     private final UserCompanyDeliveryService userCompanyDeliveryService;
-    private final UserCompanyAttrService userCompanyAttrService;
+    private final UserCompanyCreditService userCompanyCreditService;
     private final StorageService storageService;
     private final UserCompanyDeliveryRelaService userCompanyDeliveryRelaService;
 
@@ -554,7 +554,7 @@ public class UserLogic {
                 .remove();
     }
 
-    public IPage<UserCompanyAttrBean> companyCredit(String nickName, String mobile, Integer pageNum, Integer pageSize) {
+    public IPage<UserCompanyCreditBean> companyCredit(String nickName, String mobile, Integer pageNum, Integer pageSize) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
         return commonMapper.companyCredit(new Page<>(pageNum, pageSize), adminUser.getCompanyWechatId(), nickName, mobile);
     }
@@ -568,7 +568,7 @@ public class UserLogic {
 
         final DateTime curDate = DateUtil.date();
 
-        List<UserCompanyAttr> userCompanyAttrList = new ArrayList<>();
+        List<UserCompanyCredit> userCompanyCreditList = new ArrayList<>();
         for (Object o : datas) {
             index++;
             String errPrefix = "第" + index + "行";
@@ -594,9 +594,9 @@ public class UserLogic {
                 throw new RemoteServiceException(errPrefix + " 没有找到对应师傅信息");
             }
 
-            final Integer count = userCompanyAttrService.lambdaQuery()
-                    .eq(UserCompanyAttr::getUserId, user.getUserId())
-                    .eq(UserCompanyAttr::getCompanyWechatId, adminUser.getCompanyWechatId())
+            final Integer count = userCompanyCreditService.lambdaQuery()
+                    .eq(UserCompanyCredit::getUserId, user.getUserId())
+                    .eq(UserCompanyCredit::getCompanyWechatId, adminUser.getCompanyWechatId())
                     .count();
 
             if (count > 0) {
@@ -630,7 +630,7 @@ public class UserLogic {
                 throw new RemoteServiceException(errPrefix + " 请填写正确的账期天数(1-30)");
             }
 
-            UserCompanyAttr attr = new UserCompanyAttr();
+            UserCompanyCredit attr = new UserCompanyCredit();
             attr.setCompanyWechatId(adminUser.getCompanyWechatId())
                     .setCompanyWechatName(adminUser.getCompanyName())
                     .setUserId(user.getUserId())
@@ -640,20 +640,20 @@ public class UserLogic {
                     .setPaymentGracePeriod(paymentGracePeriodInt)
                     .setCreateTime(curDate);
 
-            userCompanyAttrList.add(attr);
+            userCompanyCreditList.add(attr);
         }
 
-        userCompanyAttrService.saveBatch(userCompanyAttrList);
+        userCompanyCreditService.saveBatch(userCompanyCreditList);
     }
 
     public void companyCreditEnabled(List<String> userIds, Boolean status) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
 
-        userCompanyAttrService.lambdaUpdate()
-                .set(UserCompanyAttr::getIsCreditEnabled, status)
-                .set(UserCompanyAttr::getUpdateTime, DateUtil.date())
-                .eq(UserCompanyAttr::getCompanyWechatId, adminUser.getCompanyWechatId())
-                .in(UserCompanyAttr::getUserId, userIds)
+        userCompanyCreditService.lambdaUpdate()
+                .set(UserCompanyCredit::getIsCreditEnabled, status)
+                .set(UserCompanyCredit::getUpdateTime, DateUtil.date())
+                .eq(UserCompanyCredit::getCompanyWechatId, adminUser.getCompanyWechatId())
+                .in(UserCompanyCredit::getUserId, userIds)
                 .update();
     }
 

+ 1 - 1
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1064,7 +1064,7 @@
         ${ex.orderBy}
     </select>
 
-    <select id="companyCredit" resultType="com.gree.mall.manager.bean.member.UserCompanyAttrBean">
+    <select id="companyCredit" resultType="com.gree.mall.manager.bean.member.UserCompanyCreditBean">
         SELECT
             uca.*,
             a.nick_name,