|
|
@@ -1,12 +1,18 @@
|
|
|
package com.fs.qw.controller;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.domain.model.LoginUser;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
+import com.fs.course.domain.FsCoursePlaySourceConfig;
|
|
|
+import com.fs.course.service.IFsCoursePlaySourceConfigService;
|
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
import com.fs.qw.vo.QwOptionsVO;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
@@ -45,6 +51,8 @@ public class QwCompanyController extends BaseController
|
|
|
private TokenService tokenService;
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
+ @Autowired
|
|
|
+ private IFsCoursePlaySourceConfigService coursePlaySourceConfigService;
|
|
|
|
|
|
/**
|
|
|
* 查询企微主体列表
|
|
|
@@ -132,6 +140,48 @@ public class QwCompanyController extends BaseController
|
|
|
return toAjax(qwCompanyService.updateQwCompany(qwCompany));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量更换所有主体小程序
|
|
|
+ */
|
|
|
+ @Log(title = "批量更换小程序", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/batchUpdateMiniAppId")
|
|
|
+ public R batchUpdateMiniAppId(@RequestBody QwCompany qwCompany)
|
|
|
+ {
|
|
|
+ if (qwCompany.getMiniAppId() == null || qwCompany.getMiniAppId().trim().isEmpty()) {
|
|
|
+ return R.error("请选择小程序");
|
|
|
+ }
|
|
|
+ return qwCompanyService.batchUpdateMiniAppId(qwCompany.getMiniAppId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取小程序配置列表
|
|
|
+ */
|
|
|
+ @GetMapping("/getMiniAppList")
|
|
|
+ public R getMiniAppList()
|
|
|
+ {
|
|
|
+ QueryWrapper<FsCoursePlaySourceConfig> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("type", 1);
|
|
|
+ queryWrapper.eq("is_del", 0);
|
|
|
+ queryWrapper.orderByDesc("create_time");
|
|
|
+
|
|
|
+ List<FsCoursePlaySourceConfig> configs = coursePlaySourceConfigService.list(queryWrapper);
|
|
|
+ if (configs == null || configs.isEmpty()) {
|
|
|
+ return R.ok().put("data", new ArrayList<>());
|
|
|
+ }
|
|
|
+ List<Map<String, String>> list = new ArrayList<>();
|
|
|
+ for (FsCoursePlaySourceConfig config : configs) {
|
|
|
+ if (config.getAppid() != null && !config.getAppid().trim().isEmpty()) {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("label", config.getName() != null ? config.getName() : config.getAppid());
|
|
|
+ map.put("value", config.getAppid());
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.ok().put("data", list);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除企微主体
|
|
|
*/
|