Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

yuhongqi 1 месяц назад
Родитель
Сommit
3a03b69a22

+ 6 - 6
fs-admin/src/main/java/com/fs/his/controller/FsAdvController.java

@@ -40,7 +40,7 @@ public class FsAdvController extends BaseController
     /**
      * 查询广告列表
      */
-    @PreAuthorize("@ss.hasPermi('his:adv:list')")
+    @PreAuthorize("@ss.hasPermi('store:adv:list')")
     @GetMapping("/list")
     public TableDataInfo list(FsAdv fsAdv)
     {
@@ -52,7 +52,7 @@ public class FsAdvController extends BaseController
     /**
      * 导出广告列表
      */
-    @PreAuthorize("@ss.hasPermi('his:adv:export')")
+    @PreAuthorize("@ss.hasPermi('store:adv:export')")
     @Log(title = "广告", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(FsAdv fsAdv)
@@ -65,7 +65,7 @@ public class FsAdvController extends BaseController
     /**
      * 获取广告详细信息
      */
-    @PreAuthorize("@ss.hasPermi('his:adv:query')")
+    @PreAuthorize("@ss.hasPermi('store:adv:query')")
     @GetMapping(value = "/{advId}")
     public AjaxResult getInfo(@PathVariable("advId") String advId)
     {
@@ -76,7 +76,7 @@ public class FsAdvController extends BaseController
     /**
      * 新增广告
      */
-    @PreAuthorize("@ss.hasPermi('his:adv:add')")
+    @PreAuthorize("@ss.hasPermi('store:adv:add')")
     @Log(title = "广告", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody FsAdv fsAdv)
@@ -91,7 +91,7 @@ public class FsAdvController extends BaseController
     /**
      * 修改广告
      */
-    @PreAuthorize("@ss.hasPermi('his:adv:edit')")
+    @PreAuthorize("@ss.hasPermi('store:adv:edit')")
     @Log(title = "广告", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody FsAdv fsAdv)
@@ -105,7 +105,7 @@ public class FsAdvController extends BaseController
     /**
      * 删除广告
      */
-    @PreAuthorize("@ss.hasPermi('his:adv:remove')")
+    @PreAuthorize("@ss.hasPermi('store:adv:remove')")
     @Log(title = "广告", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{advIds}")
     public AjaxResult remove(@PathVariable String[] advIds)

+ 9 - 9
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreScrmController.java

@@ -37,7 +37,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 查询店铺管理列表
      */
-    @PreAuthorize("@ss.hasPermi('his:store:list')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:list')")
     @GetMapping("/list")
     public TableDataInfo list(FsStoreScrm fsStore)
     {
@@ -52,7 +52,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 导出店铺管理列表
      */
-    @PreAuthorize("@ss.hasPermi('his:store:export')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:export')")
     @Log(title = "店铺管理", businessType = BusinessType.EXPORT,logParam = {"店铺","导出店铺信息"},isStoreLog = true)
     @GetMapping("/export")
     public AjaxResult export(FsStoreScrm fsStore)
@@ -69,7 +69,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 获取店铺管理详细信息
      */
-    @PreAuthorize("@ss.hasPermi('his:store:query')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:query')")
     @GetMapping(value = "/{storeId}")
     public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
     {
@@ -81,7 +81,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 新增店铺管理
      */
-    @PreAuthorize("@ss.hasPermi('his:store:add')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:add')")
     @Log(title = "店铺管理", businessType = BusinessType.INSERT,logParam = {"店铺","新增店铺信息"},isStoreLog = true)
     @PostMapping
     public AjaxResult add(@RequestBody FsStoreScrm fsStore)
@@ -93,7 +93,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 修改店铺管理
      */
-    @PreAuthorize("@ss.hasPermi('his:store:edit')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:edit')")
     @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","修改店铺信息"},isStoreLog = true)
     @PutMapping
     public AjaxResult edit(@RequestBody FsStoreScrm fsStore)
@@ -108,7 +108,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 删除店铺管理
      */
-    @PreAuthorize("@ss.hasPermi('his:store:remove')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:remove')")
     @Log(title = "店铺管理", businessType = BusinessType.DELETE,logParam = {"店铺","删除店铺信息"},isStoreLog = true)
 	@DeleteMapping("/{storeIds}")
     public AjaxResult remove(@PathVariable Long[] storeIds)
@@ -119,7 +119,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 店铺审核
      */
-    @PreAuthorize("@ss.hasPermi('his:store:audit')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:audit')")
     @Log(title = "店铺审核", businessType = BusinessType.AUDIT,logParam = {"店铺","店铺审核"},isStoreLog = true
     ,logParamExpression = "#p0.getIsAudit()==1?new String[]{'店铺','店铺审核通过'}: new String[]{'店铺','店铺审核退回'}")
     @PutMapping("/audit")
@@ -131,7 +131,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 重置店铺密码
      * */
-    @PreAuthorize("@ss.hasPermi('his:store:refresh')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:refresh')")
     @Log(title = "店铺管理", businessType = BusinessType.UPDATE,logParam = {"店铺","重置店铺密码"},isStoreLog = true)
     @PutMapping("/refresh/{storeId}")
     public AjaxResult refresh(@PathVariable Long storeId)
@@ -143,7 +143,7 @@ public class FsStoreScrmController extends BaseController
     /**
      * 店铺审核日志
      * */
-    @PreAuthorize("@ss.hasPermi('his:store:auditLog')")
+    @PreAuthorize("@ss.hasPermi('store:his:store:auditLog')")
     @GetMapping("/auditLog/{storeId}")
     public R auditLog(@PathVariable Long storeId){
         return R.ok().put("auditLog",storeAuditLogUtil.selectOperLogByMainId(storeId));

+ 31 - 4
fs-company/src/main/java/com/fs/framework/service/CompanyLoginService.java

@@ -58,13 +58,13 @@ public class CompanyLoginService
     @Autowired
     private ICompanyUserService companyUserService;
 
-    @Value("${wechat.company.appid}")
+    @Value("${wechat.company.appid:#{null}}")
     private String appId;
-    @Value("${wechat.company.secret}")
+    @Value("${wechat.company.secret:#{null}}")
     private String secret;
-    @Value("${wechat.company.redirectUri}")
+    @Value("${wechat.company.redirectUri:#{null}}")
     private String redirectUri;
-    @Value("${wechat.isNeedScan}")
+    @Value("${wechat.isNeedScan:false}")
     private Boolean isNeedScan;
 
     @Autowired
@@ -119,8 +119,35 @@ public class CompanyLoginService
             }
         }
         LoginUser loginUser = (LoginUser) authentication.getPrincipal();
+        //查询当前登录用户信息
+        CompanyUser companyUser = companyUserService.selectCompanyUserById(loginUser.getUser().getUserId());
         AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginUser.getUser().getCompanyId(),username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
         redisCache.setCacheObject("companyId:"+loginUser.getUser().getUserId(),loginUser.getUser().getCompanyId(),604800, TimeUnit.SECONDS);
+        String ipAddr = IpUtils.getIpAddr(ServletUtils.getRequest()).split(",")[0].trim();
+        log.info("销售用户{}正常登录获取到的ip地址{}", loginUser.getUser().getUserId(), ipAddr);
+
+        companyUser.setUserId(loginUser.getUser().getUserId());
+        String loginIp = companyUser.getLoginIp();
+        List<String> ipList = new ArrayList<>();
+        if (StringUtils.isNotEmpty(loginIp)) {
+            String[] ips = loginIp.split(",");
+            for (String ip : ips) {
+                ip = ip.trim();                  // 去掉前后空格
+                if (!ip.isEmpty()) {
+                    ipList.add(ip);              // 先加入已有 IP
+                }
+            }
+        }
+
+        ipList.add(ipAddr);
+        List<String> distinctList = ipList.stream()
+                .map(String::trim)       // 再次确保去掉空格
+                .distinct()
+                .collect(Collectors.toList());
+        companyUser.setLoginIp(String.join(",", distinctList));
+
+        companyUser.setLoginDate(new Date());
+        companyUserService.updateCompanyUser(companyUser);
         // 生成token
         return tokenService.createToken(loginUser);
     }

+ 11 - 0
fs-framework/src/main/java/com/fs/framework/web/service/SysLoginService.java

@@ -143,6 +143,17 @@ public class SysLoginService
      */
     public void recordLoginInfo(SysUser user)
     {
+        String ipAddr = IpUtils.getIpAddr(ServletUtils.getRequest());
+        String loginIp = user.getLoginIp();
+        if (com.fs.common.utils.StringUtils.isEmpty(loginIp)) {
+            user.setLoginIp(ipAddr);
+        } else {
+            List<String> ipList = new ArrayList<>(Arrays.asList(loginIp.split(",")));
+            if (!ipList.contains(ipAddr)) {
+                ipList.add(ipAddr);
+                user.setLoginIp(String.join(",", ipList));
+            }
+        }
         user.setLoginIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
         user.setLoginDate(DateUtils.getNowDate());
         userService.updateUserProfile(user);

+ 5 - 4
fs-service/src/main/java/com/fs/company/service/impl/CompanyServiceImpl.java

@@ -202,10 +202,11 @@ public class CompanyServiceImpl implements ICompanyService
             List<CompanyMiniapp> miniApp = companyMiniappService.getMiniAppListByCompanyList(Collections.singletonList(company.getCompanyId()));
             company.setMiniAppMaster(GET_MINI_APP_STR.apply(0, miniApp));
             company.setMiniAppServer(GET_MINI_APP_STR.apply(1, miniApp));
-        }
-        String redPackageMoney = redisCache.getCacheObject(FsConstants.COMPANY_MONEY_KEY+company.getCompanyId());
-        if(redPackageMoney!=null){
-            company.setRedPackageMoney(new BigDecimal(redPackageMoney));
+
+            String redPackageMoney = redisCache.getCacheObject(FsConstants.COMPANY_MONEY_KEY+company.getCompanyId());
+            if(redPackageMoney!=null){
+                company.setRedPackageMoney(new BigDecimal(redPackageMoney));
+            }
         }
         return company;
     }

+ 2 - 2
fs-service/src/main/java/com/fs/course/vo/FsCourseRedPacketLogListPVO.java

@@ -49,8 +49,8 @@ public class FsCourseRedPacketLogListPVO extends BaseEntity
     @Excel(name = "转帐金额")
     private BigDecimal amount;
 
-    @Excel(name = "状态",dictType = "sys_course_red_packet_status")
-    private Integer status;//状态 0 发送中  1  已发送
+    @Excel(name = "状态", readConverterExp = "0=发送中,1=已发送,2余额不足待发送")
+    private Integer status; // 状态 0 发送中 1 已发送
 
     @Excel(name = "分享人企微Id")
     private String qwUserId;

+ 1 - 1
fs-service/src/main/java/com/fs/course/vo/FsCourseWatchLogListVO.java

@@ -60,7 +60,7 @@ public class FsCourseWatchLogListVO extends BaseEntity
     @Excel(name = "小节名称")
     private String videoName;
 
-    @Excel(name = "记录类型" ,dictType = "sys_course_watch_log_type")
+    @Excel(name = "记录类型" ,dictType = "sys_course_watch_log_type_new")
     private Integer logType;
 
     @Excel(name = "奖励类型 1红包 2积分")

+ 5 - 0
fs-service/src/main/java/com/fs/course/vo/newfs/FsUserCourseVideoDetailsVO.java

@@ -31,6 +31,11 @@ public class FsUserCourseVideoDetailsVO {
     @ApiModelProperty(value = "课程ID")
     private Long courseId;
 
+
+    @ApiModelProperty(value = "是否启用倍速(0:否;1:是)")
+    private Integer isSpeed;
+
+
     @ApiModelProperty(value = "题库内容")
     private List<FsUserVideoQuestionVO> questionBankList;
 

+ 4 - 4
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -5248,10 +5248,10 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         String uuid = IdUtil.randomUUID();
         redisCache.setCacheObject("createOrderKey:" + uuid, companyUser.getCompanyId() + "-" + companyUser.getUserId(), 24, TimeUnit.HOURS);
 
-        // 这里的carts是购物车信息,价格取的套餐包价格
-        for (FsStoreCartQueryVO vo : carts) {
-            vo.setPrice(storeProductPackage.getPayMoney());
-        }
+//        // 这里的carts是购物车信息,价格取的套餐包价格
+//        for (FsStoreCartQueryVO vo : carts) {
+//            vo.setPrice(storeProductPackage.getPayMoney());
+//        }
         redisCache.setCacheObject("orderCarts:" + uuid, carts, 24, TimeUnit.HOURS);
         if (orderType != null || orderMedium != null) {
             FsStoreOrderScrm fsStoreOrder = new FsStoreOrderScrm();

+ 2 - 2
fs-service/src/main/resources/application-config-druid-cfryt.yml

@@ -42,8 +42,8 @@ wx:
       port: 6379
       timeout: 2000
     configs:
-      - appId: wx17f36a56c701bdea # 第一个公众号的appid   //公众号名称
-        secret: 185030bbe7f8d7a0c16b94dd9d4ea542 # 公众号的appsecret
+      - appId: wxbf0cfcfbc92ccd72 # 第一个公众号的appid   //赤峰润元堂
+        secret: b08b0c6e763b5fa3c863b3dd114cd1c9 # 公众号的appsecret
         token: PPKOdAlCoMO # 接口配置里的Token值
         aesKey: Eswa6VjwtVcw03qZy6Wllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
 aifabu:  #爱链接