|
@@ -1,7 +1,14 @@
|
|
|
package com.ruoyi.web.controller.system;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
+import com.ruoyi.system.domain.SysRepo;
|
|
|
+import com.ruoyi.system.service.impl.SysDictTypeServiceImpl;
|
|
|
+import com.ruoyi.system.service.impl.SysRepoServiceImpl;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -33,6 +40,10 @@ public class SysCompanyTemplateController extends BaseController
|
|
|
{
|
|
|
@Autowired
|
|
|
private ISysCompanyTemplateService sysCompanyTemplateService;
|
|
|
+ @Autowired
|
|
|
+ private SysDictTypeServiceImpl sysDictTypeServiceImpl;
|
|
|
+ @Autowired
|
|
|
+ private SysRepoServiceImpl sysRepoServiceImpl;
|
|
|
|
|
|
/**
|
|
|
* 查询企业模板列表
|
|
@@ -59,6 +70,42 @@ public class SysCompanyTemplateController extends BaseController
|
|
|
util.exportExcel(response, list, "企业配置数据");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取企业模板列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:template:getTemplate')")
|
|
|
+ @Log(title = "获取模板列表", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/getTemplate")
|
|
|
+ public AjaxResult getTemplate(String type)
|
|
|
+ {
|
|
|
+ Map map = new HashMap<>();
|
|
|
+ SysRepo sysRepo = new SysRepo();
|
|
|
+ List<SysDictData> list = sysDictTypeServiceImpl.selectDictDataByType(type);
|
|
|
+ if(list == null){
|
|
|
+ return AjaxResult.warn("未找到该类型");
|
|
|
+ }else{
|
|
|
+ for(SysDictData sysDictData:list){
|
|
|
+ sysRepo.setGroupId(sysDictData.getDictValue());
|
|
|
+ map.put(sysDictData.getDictLabel(),sysRepoServiceImpl.selectSysRepoList(sysRepo));
|
|
|
+ }
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 获取企业模板列表
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('system:template:getTemplatefile')")
|
|
|
+// @Log(title = "获取模板文件", businessType = BusinessType.EXPORT)
|
|
|
+// @GetMapping("/getTemplateFiles")
|
|
|
+// public AjaxResult getTemplate(SysCompanyTemplate sysCompanyTemplate)
|
|
|
+// {
|
|
|
+// if (sysCompanyTemplate.getTemplate() == null){
|
|
|
+// return error("该公司未配置模板");
|
|
|
+// }
|
|
|
+// return success();
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 获取企业模板详细信息
|
|
|
*/
|