|
@@ -4,11 +4,14 @@ package cn.cslg.pas.controller;
|
|
|
import cn.cslg.pas.common.core.base.Constants;
|
|
|
import cn.cslg.pas.common.dto.AddSelfFieldDTO;
|
|
|
import cn.cslg.pas.common.model.cronModel.Records;
|
|
|
+import cn.cslg.pas.common.model.request.StringRequest;
|
|
|
import cn.cslg.pas.common.utils.Response;
|
|
|
import cn.cslg.pas.common.utils.StringUtils;
|
|
|
import cn.cslg.pas.common.vo.EntityVO;
|
|
|
import cn.cslg.pas.common.vo.PersonSelfFieldVO;
|
|
|
import cn.cslg.pas.domain.business.SystemDict;
|
|
|
+import cn.cslg.pas.factorys.businessFactory.Business;
|
|
|
+import cn.cslg.pas.factorys.businessFactory.BusinessFactory;
|
|
|
import cn.cslg.pas.service.business.AssoScenarioMatterService;
|
|
|
import cn.cslg.pas.service.business.CommonService;
|
|
|
import cn.cslg.pas.service.business.ScenarioService;
|
|
@@ -39,77 +42,21 @@ public class ImportTaskController {
|
|
|
|
|
|
@Autowired
|
|
|
private PersonFieldService personFieldService;
|
|
|
- @PostMapping("getParams")
|
|
|
- @Operation(summary = "获得实体类栏位信息")
|
|
|
- public Response getQueryConditions(@RequestBody List<String> tables) {
|
|
|
- List<EntityVO> vos = commonService.getQueryConditions(tables);
|
|
|
- return Response.success(vos);
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("data")
|
|
|
- @Operation(summary = "通用数据")
|
|
|
- public Object getCommonData(String keys) {
|
|
|
- List<String> typeList = StringUtils.changeStringToString(keys, ",");
|
|
|
- List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(typeList);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- for (String type : typeList) {
|
|
|
- map.put(type, systemDictList.stream().filter(item -> item.getType().equals(type)).collect(Collectors.toList()));
|
|
|
- }
|
|
|
- return Response.success(map);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @GetMapping("getCustomField")
|
|
|
- @Operation(summary = "查询个人栏位配置")
|
|
|
- public Response getCustomField(String tableName) {
|
|
|
- try {
|
|
|
- List<PersonSelfFieldVO> personSelfFieldVOS= personFieldService.getCustomField(tableName);
|
|
|
- Records records =new Records();
|
|
|
- records.setData(personSelfFieldVOS);
|
|
|
- return Response.success(records);
|
|
|
- }
|
|
|
- catch (Exception e){
|
|
|
- return Response.error(e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @PostMapping("setCustomField")
|
|
|
- @Operation(summary = "设置个人栏位配置")
|
|
|
- public Response setCustomField(@RequestBody AddSelfFieldDTO addSelfFieldDTO) {
|
|
|
- try {
|
|
|
- List<PersonSelfFieldVO> personSelfFieldVOS= personFieldService.setCustomField(addSelfFieldDTO);
|
|
|
- Records records =new Records();
|
|
|
- records.setData(personSelfFieldVOS);
|
|
|
- return Response.success(records);
|
|
|
- }
|
|
|
- catch (Exception e){
|
|
|
- return Response.error(e.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- @GetMapping("/scenario")
|
|
|
- @Operation(summary = "查询应用场景")
|
|
|
- public Response queryAllScenario(){
|
|
|
- Records records = new Records();
|
|
|
- records.setData(scenarioService.queryAll());
|
|
|
- return Response.success(records);
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("/matter")
|
|
|
- @Operation(summary = "查询处理事项")
|
|
|
- public Response queryMatter(@RequestBody List<Integer> scenarioIds){
|
|
|
- Records records = new Records();
|
|
|
- records.setData(assoScenarioMatterService.queryMatterIds(scenarioIds));
|
|
|
+ @Autowired
|
|
|
+ private BusinessFactory businessFactory;
|
|
|
+ @Operation(summary = "查询导入任务")
|
|
|
+ @PostMapping("/queryImportTask")
|
|
|
+ public Response queryImportTask(@RequestBody StringRequest stringRequest) throws Exception {
|
|
|
+ Business business = businessFactory.getClass("importTaskService");
|
|
|
+ Records records = (Records) business.queryMessage(stringRequest);
|
|
|
return Response.success(records);
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/queryCrons")
|
|
|
- @Operation(summary = "查找核心结论")
|
|
|
- public Response queryCrons(Integer reportType){
|
|
|
- Records records = new Records();
|
|
|
- records.setData(systemDictService.getCrons(reportType));
|
|
|
+ @Operation(summary = "添加导入任务")
|
|
|
+ @PostMapping("/addImportTask")
|
|
|
+ public Response addImportTask(@RequestBody StringRequest stringRequest) throws Exception {
|
|
|
+ Business business = businessFactory.getClass("importTaskService");
|
|
|
+ Records records = (Records) business.addMessage(stringRequest);
|
|
|
return Response.success(records);
|
|
|
}
|
|
|
}
|