Browse Source

Merge branch 'refs/heads/master' into openIm

caoliqin 5 ngày trước cách đây
mục cha
commit
dcebacf838

+ 154 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsCoursePlaySourceConfigController.java

@@ -0,0 +1,154 @@
+package com.fs.company.controller.course;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.bean.BeanUtils;
+import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.param.FsCoursePlaySourceConfigCreateParam;
+import com.fs.course.param.FsCoursePlaySourceConfigEditParam;
+import com.fs.course.service.IFsCoursePlaySourceConfigService;
+import com.fs.course.vo.FsCoursePlaySourceConfigVO;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.security.SecurityUtils;
+import com.github.pagehelper.PageHelper;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.time.LocalDateTime;
+import java.util.*;
+
+@RestController
+@RequestMapping("/course/playSourceConfig")
+@AllArgsConstructor
+public class FsCoursePlaySourceConfigController extends BaseController {
+
+    private final IFsCoursePlaySourceConfigService fsCoursePlaySourceConfigService;
+    private final RedisCache redisCache;
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(@RequestParam(required = false) String name,
+                              @RequestParam(required = false) String appid,
+                              @RequestParam(required = false, defaultValue = "1") Integer pageNum,
+                              @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("name", name);
+        params.put("appid", appid);
+        params.put("companyId", SecurityUtils.getLoginUser().getCompany().getCompanyId());
+
+        PageHelper.startPage(pageNum, pageSize);
+        List<FsCoursePlaySourceConfigVO> list = fsCoursePlaySourceConfigService.selectCoursePlaySourceConfigVOListByMap(params);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id) {
+        FsCoursePlaySourceConfig config = fsCoursePlaySourceConfigService.getById(id);
+        if (Objects.isNull(config)) {
+            return AjaxResult.success(null);
+        }
+
+        FsCoursePlaySourceConfigVO configVO = new FsCoursePlaySourceConfigVO();
+        BeanUtils.copyProperties(config, configVO);
+        return AjaxResult.success(configVO);
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:add')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Valid @RequestBody FsCoursePlaySourceConfigCreateParam param) {
+        Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery()
+                .eq(FsCoursePlaySourceConfig::getAppid, param.getAppid())
+                .eq(FsCoursePlaySourceConfig::getIsDel, 0);
+        if (fsCoursePlaySourceConfigService.count(queryWrapper) > 0) {
+            return AjaxResult.error("appid已存在");
+        }
+
+        FsCoursePlaySourceConfig config = new FsCoursePlaySourceConfig();
+        BeanUtils.copyProperties(param, config);
+
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        config.setCompanyId(loginUser.getCompany().getCompanyId());
+        config.setCompanyUserId(loginUser.getUser().getUserId());
+        config.setIsDel(0);
+        config.setCreateTime(LocalDateTime.now());
+        config.setUpdateTime(LocalDateTime.now());
+        fsCoursePlaySourceConfigService.save(config);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:edit')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Valid @RequestBody FsCoursePlaySourceConfigEditParam param) {
+        FsCoursePlaySourceConfig config = fsCoursePlaySourceConfigService.getById(param.getId());
+        if (Objects.isNull(config)) {
+            return AjaxResult.error("点播播放源配置不存在");
+        }
+
+        Wrapper<FsCoursePlaySourceConfig> queryWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaQuery()
+                .eq(FsCoursePlaySourceConfig::getAppid, param.getAppid())
+                .eq(FsCoursePlaySourceConfig::getIsDel, 0)
+                .last("limit 1");
+        FsCoursePlaySourceConfig one = fsCoursePlaySourceConfigService.getOne(queryWrapper);
+        if (Objects.nonNull(one) && !one.getId().equals(config.getId())) {
+            return AjaxResult.error("appid已存在");
+        }
+
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (!loginUser.getCompany().getCompanyId().equals(config.getCompanyId())) {
+            return AjaxResult.error("非法操作");
+        }
+
+        BeanUtils.copyProperties(param, config);
+        fsCoursePlaySourceConfigService.updateById(config);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('course:playSourceConfig:remove')")
+    @Log(title = "点播播放源配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        Wrapper<FsCoursePlaySourceConfig> updateWrapper = Wrappers.<FsCoursePlaySourceConfig>lambdaUpdate()
+                .set(FsCoursePlaySourceConfig::getIsDel, 1)
+                .eq(FsCoursePlaySourceConfig::getCompanyId, loginUser.getCompany().getCompanyId())
+                .in(FsCoursePlaySourceConfig::getId, Arrays.asList(ids));
+        fsCoursePlaySourceConfigService.update(updateWrapper);
+        return AjaxResult.success();
+    }
+
+    /**
+     * 启用-关闭小程序销售管理
+     * @param bock
+     * @return
+     */
+    @GetMapping("/updateIsTownOn")
+    public R queryIsTownOn(String bock, String appId)
+    {
+        String key = appId+"start_status_001";
+        String start = redisCache.getCacheObject(key);
+        if (ObjectUtil.isNotEmpty(bock)){
+            if (bock.equals("001")){
+                redisCache.setCacheObject(key,bock);
+                return R.ok("调整成功");
+            }else if (bock.equals("002")){
+                redisCache.setCacheObject(key,bock);
+                return R.ok("调整成功");
+            }
+
+        }
+        return R.ok().put("date",start);
+    }
+}

+ 10 - 0
fs-service/src/main/java/com/fs/course/domain/FsCoursePlaySourceConfig.java

@@ -76,4 +76,14 @@ public class FsCoursePlaySourceConfig {
      * 修改时间
      */
     private LocalDateTime updateTime;
+
+    /**
+     * 公司ID
+     */
+    private Long companyId;
+
+    /**
+     * 销售ID
+     */
+    private Long companyUserId;
 }

+ 7 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -2522,6 +2522,13 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             List<FsCourseQuestionBank> fsCourseQuestionBanks = courseQuestionBankMapper.selectFsCourseQuestionBankByIdVO(courseVideo.getQuestionBankId().split(","));
             fsUserCourseVideoQVO.setQuestionBankList(fsCourseQuestionBanks);
         }
+
+        //返回课程关联的拍商品
+        if(courseVideo.getIsProduct() != null && courseVideo.getIsProduct() == 1 && courseVideo.getProductId() != null){
+            FsCourseProduct courseProduct = courseProductMapper.selectFsCourseProductById(courseVideo.getProductId());
+            List<FsCourseProduct> courseProducts = Arrays.asList(courseProduct);
+            fsUserCourseVideoQVO.setCourseProducts(courseProducts);
+        }
         return fsUserCourseVideoQVO;
     }
 

+ 13 - 3
fs-service/src/main/java/com/fs/hisStore/service/impl/FsExpressScrmServiceImpl.java

@@ -10,18 +10,21 @@ import java.util.Map;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
 import com.fs.api.param.ExpressParam;
 import com.fs.api.vo.ExpressVO;
 import com.fs.common.config.FSSysConfig;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
+import com.fs.hisStore.config.StoreConfig;
 import com.fs.hisStore.domain.FsStoreOrderScrm;
 import com.fs.hisStore.dto.ExpressAddressDTO;
 import com.fs.hisStore.dto.ExpressInfoDTO;
 import com.fs.hisStore.dto.TracesDTO;
 import com.fs.hisStore.enums.ShipperCodeEnum;
 import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
+import com.fs.system.service.ISysConfigService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,15 +43,14 @@ import org.springframework.util.Base64Utils;
 @Service
 public class FsExpressScrmServiceImpl implements IFsExpressScrmService 
 {
-
     Logger logger = LoggerFactory.getLogger(FsExpressScrmServiceImpl.class);
-
     @Autowired
     private FsExpressScrmMapper fsExpressMapper;
     @Autowired
     private FsStoreOrderScrmMapper fsStoreOrderMapper;
     @Autowired
-    private FSSysConfig sysConfig;
+    private ISysConfigService configService;
+
     /**
      * 查询快递公司
      * 
@@ -136,6 +138,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
         Map<String, Object> params = new HashMap<>();
         try {
+            String json = this.configService.selectConfigByKey("his.config");
+            FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
             params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
             params.put("EBusinessID",sysConfig.getKdnId().trim());
             params.put("RequestType", "8001");
@@ -181,6 +185,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
         Map<String, Object> params = new HashMap<>();
         try {
+            String json = this.configService.selectConfigByKey("his.config");
+            FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
             params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
             params.put("EBusinessID",sysConfig.getKdnId().trim());
             params.put("RequestType", "8008");
@@ -202,6 +208,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
         Map<String, Object> params = new HashMap<>();
         try {
+            String json = this.configService.selectConfigByKey("his.config");
+            FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
             params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
             params.put("EBusinessID",sysConfig.getKdnId().trim());
             params.put("RequestType", "6001");
@@ -244,6 +252,8 @@ public class FsExpressScrmServiceImpl implements IFsExpressScrmService
 
             Map<String, Object> params = new HashMap<>();
             try {
+                String json = this.configService.selectConfigByKey("his.config");
+                FSSysConfig sysConfig= JSON.parseObject(json,FSSysConfig.class);
                 params.put("RequestData", URLEncoder.encode(requestData, "UTF-8"));
                 params.put("EBusinessID",sysConfig.getKdnId().trim());
                 params.put("RequestType", "8001");

+ 3 - 0
fs-service/src/main/resources/application-config-druid-jnmy.yml

@@ -41,6 +41,9 @@ wx:
         secret: 1fac75465a61f9259a0fe19795d9e80d # 公众号的appsecret
         token: PPKOdAlCoMO # 接口配置里的Token值
         aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
+  open:
+    appId: wxda2eb168e5b09e56
+    secret: dde09b45d0f6d5b0925965b964b6ab48
 aifabu:  #爱链接
   appKey: 7b471be905ab17e00f3b858c6710dd117601d008
 watch:

+ 4 - 0
fs-service/src/main/resources/application-config-druid-sxjz.yml

@@ -46,6 +46,10 @@ wx:
         secret: 5da9ae6d354c130dc81cde1a6d097480 # 公众号的appsecret
         token: PPKOdAlCoMO # 接口配置里的Token值
         aesKey: Eswa6VjwtVcw03qZy6Wllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
+  # 开放平台app微信授权配置
+  open:
+    app-id: wx9746858bdb5e0643
+    secret: 32dfaa2b2dcad9229935ff089c65d372
 aifabu:  #爱链接
   appKey: 7b471be905ab17ef358c610dd117601d008
 watch:

+ 1 - 0
fs-service/src/main/resources/application-druid-jnmy-test.yml

@@ -151,3 +151,4 @@ rocketmq:
 openIM:
     secret: openIM123
     userID: imAdmin
+isNewWxMerchant: true

+ 3 - 0
fs-service/src/main/resources/db/20250901-点播播放源配置调整.sql

@@ -0,0 +1,3 @@
+alter table `fs_course_play_source_config`
+    add column `company_id` bigint comment '公司ID',
+    add column `company_user_id` bigint comment '销售ID';

+ 3 - 0
fs-service/src/main/resources/mapper/course/FsCoursePlaySourceConfigMapper.xml

@@ -15,6 +15,9 @@
         <if test="params.appid != null and params.appid != ''">
             and fcpsc.appid like concat('%', #{params.appid}, '%')
         </if>
+        <if test="params.companyId != null">
+            and fcpsc.company_id = #{params.companyId}
+        </if>
         order by fcpsc.id desc
     </select>
 </mapper>

+ 1 - 0
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -1655,6 +1655,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN company on company.company_id = company_user.company_id
         <where>
             1 = 1 and u.nick_name is not null
+            and u.is_del = 0
             <if test = "maps.nickname != null and  maps.nickname !='' " >
                 AND u.nick_name LIKE CONCAT("%",#{maps.nickname},"%")
             </if >

+ 1 - 1
fs-user-app/src/main/java/com/fs/app/controller/AppLoginController.java

@@ -150,7 +150,7 @@ public class AppLoginController extends AppBaseController{
             if (StringUtils.isBlank(param.getCode())) {
                 return R.error("code不存在");
             }
-            logger.info("zyp app微信登录,param:{}", param);
+            logger.info("zyp app微信登录,param:{},输出appid,{},secret:{}", param, openProperties.getAppId(), openProperties.getSecret());
             Map result = WxUtil.getAccessToken(param.getCode(), openProperties.getAppId(), openProperties.getSecret());
             String accessToken = result.get("access_token").toString();
             String unionid = result.get("unionid").toString();