FengChaoYu 11 mesiacov pred
rodič
commit
fa163b4b3f

+ 3 - 3
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/commonmapper/MaterialMapper.java

@@ -62,7 +62,7 @@ public interface MaterialMapper {
      *
      * @param page
      * @param companyWechatId
-     * @param userId
+     * @param workerId
      * @param orderId
      * @param goodsType
      * @param startTime
@@ -72,7 +72,7 @@ public interface MaterialMapper {
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
     IPage<NormRecordVO> normRecordList(IPage page,
                                        @Param("companyWechatId") String companyWechatId,
-                                       @Param("userId") String userId,
+                                       @Param("workerId") String workerId,
                                        @Param("orderId") String orderId,
                                        @Param("goodsType") String goodsType,
                                        @Param("startTime") String startTime,
@@ -81,7 +81,7 @@ public interface MaterialMapper {
     @InterceptorIgnore(tenantLine = "1", blockAttack = "1", illegalSql = "1")
     IPage<PartsRefundVO> partsRefundList(Page<Object> objectPage,
                                          @Param("companyWechatId") String currentCompanyWechatId,
-                                         @Param("userId") String userId,
+                                         @Param("workerId") String workerId,
                                          @Param("type") String type,
                                          @Param("status") String status);
 

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

@@ -232,7 +232,7 @@ public class SMSLogic {
         //6位随机数
         if (!active.equals("prd")) {
             //记录发送的code
-            redisUtil.set(Constant.RedisPrefix.SMS + ":" + mobile, "000000", 1 * 60);
+            redisUtil.set(Constant.RedisPrefix.SMS + ":" + mobile, "000000", 60);
         } else {
             Random random = new Random();
             int num = (int) (random.nextDouble() * (1000000 - 100000) + 100000);
@@ -241,15 +241,15 @@ public class SMSLogic {
             map.put("code", code);
             String content = this.send(mobile, TEMPLATE_SMS_CODE, map);
 
-            String beforeDate = DateUtils.formatDate1(new Date());
-            long count = smsRecordService.count(new LambdaQueryWrapper<SmsRecord>()
-                    .eq(SmsRecord::getPhone, mobile)
-                    .ge(SmsRecord::getCreateTime, beforeDate + " 00:00:00")
-                    .le(SmsRecord::getCreateTime, beforeDate + " 23:59:59"));
-            // 一天内超过5次登录,不再发短信
-            if (count > 5) {
-                throw new RemoteServiceException("今天发送短信次数超过5次,今天禁止登录!");
-            }
+//            String beforeDate = DateUtils.formatDate1(new Date());
+//            long count = smsRecordService.count(new LambdaQueryWrapper<SmsRecord>()
+//                    .eq(SmsRecord::getPhone, mobile)
+//                    .ge(SmsRecord::getCreateTime, beforeDate + " 00:00:00")
+//                    .le(SmsRecord::getCreateTime, beforeDate + " 23:59:59"));
+//            // 一天内超过10次登录,不再发短信
+//            if (count > 10) {
+//                throw new RemoteServiceException("今天发送短信次数超过5次,今天禁止登录!");
+//            }
 
             //记录短信内容
             SmsRecord smsRecord = new SmsRecord();

+ 6 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/material/NormRecordLogic.java

@@ -7,8 +7,11 @@ import com.gree.mall.miniapp.bean.user.CurrentCompanyWechat;
 import com.gree.mall.miniapp.commonmapper.MaterialMapper;
 import com.gree.mall.miniapp.exception.RemoteServiceException;
 import com.gree.mall.miniapp.logic.common.CommonLogic;
+import com.gree.mall.miniapp.plus.entity.User;
+import com.gree.mall.miniapp.plus.service.UserService;
 import com.gree.mall.miniapp.utils.DateUtils;
 import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.cp.bean.WxCpAgent;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
@@ -26,6 +29,8 @@ public class NormRecordLogic {
     MaterialMapper materialMapper;
     @Resource
     CommonLogic commonLogic;
+    @Resource
+    UserService userService;
 
     public IPage<NormRecordVO> list(String orderId, String goodsType, String yearMonth, Integer pageNum, Integer pageSize, HttpServletRequest request) {
         String startTime = null;
@@ -37,7 +42,7 @@ public class NormRecordLogic {
         }
         CurrentCompanyWechat wechat = commonLogic.getCurrentCompanyWechat(request);
         IPage<NormRecordVO> page = materialMapper.normRecordList(new Page<>(pageNum, pageSize), wechat.getCurrentCompanyWechatId(),
-                wechat.getUserId(), orderId, goodsType, startTime, endTime);
+                wechat.getUser().getWorkerNumber(), orderId, goodsType, startTime, endTime);
         return page;
     }
 

+ 1 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/material/PartsRefundLogic.java

@@ -42,7 +42,7 @@ public class PartsRefundLogic {
     public IPage<PartsRefundVO> list(String type, String status, Integer pageNum, Integer pageSize, HttpServletRequest request) {
         CurrentCompanyWechat wechat = commonLogic.getCurrentCompanyWechat(request);
         IPage<PartsRefundVO> page = materialMapper.partsRefundList(new Page<>(pageNum, pageSize), wechat.getCurrentCompanyWechatId(),
-                wechat.getUserId(), type, status);
+                wechat.getUser().getWorkerNumber(), type, status);
         if (CollectionUtil.isNotEmpty(page.getRecords())) {
             // 查出明细
             List<WebsitPartsRetItem> itemList = websitPartsRetItemService.lambdaQuery()

+ 2 - 2
mall-miniapp-service/src/main/resources/mapper/MaterialMapper.xml

@@ -298,7 +298,7 @@
             websit_norm_record a
         WHERE
             a.company_wechat_id = #{companyWechatId}
-            AND a.worker_id = #{userId}
+            AND a.worker_id = #{workerId}
         <if test="orderId!=null and orderId!=''">
             AND a.order_id LIKE CONCAT ('%', #{orderId}, '%')
         </if>
@@ -318,7 +318,7 @@
         websit_parts_ret a
         WHERE
         a.company_wechat_id = #{companyWechatId}
-        AND a.worker_id = #{userId}
+        AND a.worker_id = #{workerId}
         <if test="type!=null and type!=''">
             AND a.type = #{type}
         </if>