Pārlūkot izejas kodu

1/29 分组修改

lwhhszx 1 gadu atpakaļ
vecāks
revīzija
98446a735c
27 mainītis faili ar 70 papildinājumiem un 60 dzēšanām
  1. 2 1
      src/main/java/cn/cslg/pas/common/dto/ImportTaskDTO.java
  2. 3 3
      src/main/java/cn/cslg/pas/factorys/getOrderFactory/GetEventProjectNumOrder.java
  3. 3 3
      src/main/java/cn/cslg/pas/factorys/getOrderFactory/GetEventReportNumOrder.java
  4. 2 2
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetComGroup.java
  5. 1 1
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetEntrustGroup.java
  6. 2 2
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetEventScenarioGroup.java
  7. 1 1
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMarketDataMonthGroup.java
  8. 1 1
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMarketDataSeasonGroup.java
  9. 1 1
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMarketDataYearGroup.java
  10. 4 4
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMatterGroup.java
  11. 2 2
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetReportTypeGroup.java
  12. 3 3
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetScenarioGroup.java
  13. 2 2
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetTimeGroup.java
  14. 1 1
      src/main/java/cn/cslg/pas/factorys/reGroupFactory/QueryGroupImp.java
  15. 1 1
      src/main/java/cn/cslg/pas/mapper/EventMapper.java
  16. 2 1
      src/main/java/cn/cslg/pas/service/business/EventService.java
  17. 1 1
      src/main/java/cn/cslg/pas/service/business/ImportTaskService.java
  18. 5 1
      src/main/java/cn/cslg/pas/service/business/PatentDigProjectService.java
  19. 6 2
      src/main/java/cn/cslg/pas/service/business/PatentProjectService.java
  20. 2 2
      src/main/java/cn/cslg/pas/service/business/ProductMarketDataService.java
  21. 5 1
      src/main/java/cn/cslg/pas/service/business/ReportProjectService.java
  22. 3 1
      src/main/java/cn/cslg/pas/service/importPatent/SchedulingTaskService.java
  23. 6 0
      src/main/java/cn/cslg/pas/service/importPatent/TaskThread.java
  24. 2 2
      src/main/resources/jsons/event.json
  25. 2 2
      src/main/resources/mapper/AssoProjectEvent.xml
  26. 1 1
      src/main/resources/mapper/Event.xml
  27. 6 18
      src/test/java/cn/cslg/pas/service/EventServiceTests.java

+ 2 - 1
src/main/java/cn/cslg/pas/common/dto/ImportTaskDTO.java

@@ -78,7 +78,8 @@ public class ImportTaskDTO {
     /**
      * 检索导入使用的数据库类型(中国or世界)
      */
-    private String dbType;
+    @JsonProperty(value = "DBType")
+    private String DBType;
 
     private String orderBy;
     private String orderByType;

+ 3 - 3
src/main/java/cn/cslg/pas/factorys/getOrderFactory/GetEventProjectNumOrder.java

@@ -25,11 +25,11 @@ public class GetEventProjectNumOrder implements GetOrderObject {
         //根据名称查询人员id
         try {
             if (orderType.equals(0)) {
-                orderTypeStr="asc";
+                orderTypeStr=" asc";
             } else {
                 orderTypeStr= " desc";
             }
-          ids = assoProjectEventMapper.getEventProjectNumOrder(1,orderTypeStr);
+          ids = assoProjectEventMapper.getEventProjectNumOrder(0," asc");
 
         } catch (Exception e) {
         }
@@ -39,7 +39,7 @@ public class GetEventProjectNumOrder implements GetOrderObject {
         }
 
         String idStr = StringUtils.join(ids, ",");
-        String orderStr = " field(" + orderBy + "," + idStr + ")";
+        String orderStr = " field(" + orderBy + "," + idStr + ")"+orderTypeStr;
         String re = orderStr;
 
         return re;

+ 3 - 3
src/main/java/cn/cslg/pas/factorys/getOrderFactory/GetEventReportNumOrder.java

@@ -23,11 +23,11 @@ public class GetEventReportNumOrder implements GetOrderObject {
         //根据名称查询人员id
         try {
             if (orderType.equals(0)) {
-                orderTypeStr="asc";
+                orderTypeStr=" asc";
             } else {
                 orderTypeStr= " desc";
             }
-          ids = assoProjectEventMapper.getEventProjectNumOrder(2,orderTypeStr);
+        ids = assoProjectEventMapper.getEventProjectNumOrder(1," asc");
 
         } catch (Exception e) {
         }
@@ -35,7 +35,7 @@ public class GetEventReportNumOrder implements GetOrderObject {
             return "";
         }
         String idStr = StringUtils.join(ids, ",");
-        String orderStr = " field(" + orderBy + "," + idStr + ")";
+        String orderStr = " field(" + orderBy + "," + idStr + ") " +orderTypeStr;
         String re = orderStr;
 
         return re;

+ 2 - 2
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetComGroup.java

@@ -19,11 +19,11 @@ public class GetComGroup implements QueryGroupImp {
 private EventMapper eventMapper;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField){
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled){
         ReGroupDataVO reGroupDataVO =new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         String selectField ="";
-    List<GroupReVO> reValues =eventMapper.getGroups(sqls,tableName,groupField,selectField);
+    List<GroupReVO> reValues =eventMapper.getGroups(sqls,tableName,groupField,selectField,selectField);
         return reGroupDataVO;
     };
 

+ 1 - 1
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetEntrustGroup.java

@@ -24,7 +24,7 @@ public class GetEntrustGroup implements QueryGroupImp {
     private PermissionService permissionService;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled) {
         groupField = "p.entrust_type ,p.entrust_id ";
         ReGroupDataVO reGroupDataVO = new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();

+ 2 - 2
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetEventScenarioGroup.java

@@ -21,13 +21,13 @@ public class GetEventScenarioGroup implements QueryGroupImp {
     private SystemDictService systemDictService;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled) {
         ReGroupDataVO reGroupDataVO = new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         String selectField = groupField;
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList("ENTERPRISE_APPLICATION_SCENARIO"));
         //分组查询应用场景
-        List<GroupReVO> scenarioIds = eventMapper.getGroups(sqls, tableName, groupField, selectField);
+        List<GroupReVO> scenarioIds = eventMapper.getGroups(sqls, tableName, groupField, selectField,selectField);
         Long total = eventMapper.getGroupsCount(sqls, tableName, groupField, selectField);
         //装载应用场景名称
         scenarioIds.forEach(item -> {

+ 1 - 1
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMarketDataMonthGroup.java

@@ -32,7 +32,7 @@ public class GetMarketDataMonthGroup implements QueryGroupImp {
      * @return
      */
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled) {
         ReGroupDataVO reGroupDataVO = new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         //“select ${selectField} as marketDate,”

+ 1 - 1
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMarketDataSeasonGroup.java

@@ -25,7 +25,7 @@ public class GetMarketDataSeasonGroup implements QueryGroupImp {
     private ProductService productService;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled) {
         ReGroupDataVO reGroupDataVO =new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         groupField = "CONCAT(DATE_FORMAT("+ groupField+", '%Y'),'年第', CEIL(MONTH(" + groupField + ") / 3),'季度')";

+ 1 - 1
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMarketDataYearGroup.java

@@ -24,7 +24,7 @@ public class GetMarketDataYearGroup implements QueryGroupImp {
     private ProductService productService;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled) {
         ReGroupDataVO reGroupDataVO = new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         groupField = "CONCAT(DATE_FORMAT(" + groupField + ",'%Y'),'年')";

+ 4 - 4
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetMatterGroup.java

@@ -23,14 +23,14 @@ public class GetMatterGroup implements QueryGroupImp {
     private MatterService matterService;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled) {
         ReGroupDataVO reGroupDataVO =new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
-        String selectField = "ifnull(aspm.matter_id,0)";;
+        String selectField = "ifnull(aspm.matter_id,0)";
+        String countField="distinct p.id";
         List<Matter> matters = matterService.list();
-        tableName =tableName+" left join (select * from pas_prod2.asso_project_event where matter_id is not null) as aspm on p.id = aspm.project_id";
         //分组查询应用场景
-        List<GroupReVO> matterIds = eventMapper.getGroups(sqls, tableName, groupField, selectField);
+        List<GroupReVO> matterIds = eventMapper.getGroups(sqls, tableName, groupField, selectField,countField);
         Long total =eventMapper.getGroupsCount(sqls, tableName, groupField, selectField);
         //装载调查类型名称
         matterIds.forEach(item->{

+ 2 - 2
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetReportTypeGroup.java

@@ -21,14 +21,14 @@ public class GetReportTypeGroup implements QueryGroupImp {
     private SystemDictService systemDictService;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countFiled) {
         ReGroupDataVO reGroupDataVO =new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         String selectField = groupField;
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList("REPORT_TYPE"));
 
         //分组查询报告类型
-        List<GroupReVO> typeIds = eventMapper.getGroups(sqls, tableName, groupField, selectField);
+        List<GroupReVO> typeIds = eventMapper.getGroups(sqls, tableName, groupField, selectField,selectField);
         Long total =eventMapper.getGroupsCount(sqls, tableName, groupField, selectField);
         //装载应用场景名称
         typeIds.forEach(item->{

+ 3 - 3
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetScenarioGroup.java

@@ -21,14 +21,14 @@ public class GetScenarioGroup implements QueryGroupImp {
     private SystemDictService systemDictService;
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countField) {
         ReGroupDataVO reGroupDataVO = new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         String selectField = "ifnull(asps.scenario_id,0)";
         List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Arrays.asList("ENTERPRISE_APPLICATION_SCENARIO"));
         //分组查询应用场景
-        tableName =tableName+" left join (select * from pas_prod2.asso_project_event where scenario_id is not null) as asps on p.id = asps.project_id";
-        List<GroupReVO> scenarioIds = eventMapper.getGroups(sqls, tableName, groupField, selectField);
+
+        List<GroupReVO> scenarioIds = eventMapper.getGroups(sqls, tableName, groupField, selectField,countField);
         Long total = eventMapper.getGroupsCount(sqls, tableName, groupField, selectField);
         //装载应用场景名称
         scenarioIds.forEach(item -> {

+ 2 - 2
src/main/java/cn/cslg/pas/factorys/reGroupFactory/GetTimeGroup.java

@@ -21,12 +21,12 @@ public class GetTimeGroup implements QueryGroupImp {
 
 
     @Override
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField) {
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countField) {
         ReGroupDataVO reGroupDataVO =new ReGroupDataVO();
         List<Map<String, Object>> maps = new ArrayList<>();
         String selectField = "ifnull(DATE_FORMAT(" + groupField + ",'%Y%m') ,'未知')";
         groupField = selectField;
-        List<GroupReVO> reValues = eventMapper.getGroups(sqls, tableName, groupField, selectField);
+        List<GroupReVO> reValues = eventMapper.getGroups(sqls, tableName, groupField, selectField,countField);
         Long total =eventMapper.getGroupsCount(sqls, tableName, groupField, selectField);
         reValues.forEach(
                 item->{

+ 1 - 1
src/main/java/cn/cslg/pas/factorys/reGroupFactory/QueryGroupImp.java

@@ -10,5 +10,5 @@ import java.util.Map;
  *
  */
 public interface QueryGroupImp {
-    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField);
+    public ReGroupDataVO getGroup(List<String> sqls, String tableName, String groupField,String countField);
 }

+ 1 - 1
src/main/java/cn/cslg/pas/mapper/EventMapper.java

@@ -21,7 +21,7 @@ import java.util.List;
 @Repository
 public interface EventMapper extends BaseMapper<Event> {
     public List<EventVO> getEvent(String sql1,String sql2,String sql3);
-    public List<GroupReVO> getGroups(List<String> sqls, String tableName, String groupField, String selectField);
+    public List<GroupReVO> getGroups(List<String> sqls, String tableName, String groupField, String selectField,String countField);
     public Long getEventCount(String sql);
     public Long getGroupsCount(List<String> sqls,String tableName,String groupField,String selectField);
     public List<Integer> getEventOrder(@Param("orderType") Integer orderType);

+ 2 - 1
src/main/java/cn/cslg/pas/service/business/EventService.java

@@ -271,7 +271,8 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
 
         //返回分组数据
         QueryGroupImp queryGroupImp = queryGroupFactory.getClass(groupConfig.getGroupClass());
-        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
+        String countFiled ="id";
+        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField(),countFiled);
 
         //装载数据
         GroupVO groupVO = new GroupVO();

+ 1 - 1
src/main/java/cn/cslg/pas/service/business/ImportTaskService.java

@@ -159,7 +159,7 @@ public class ImportTaskService extends ServiceImpl<ImportTaskMapper, ImportTask>
         importTaskCondition.setType(importTaskDTO.getType());
         importTaskCondition.setFileGuid(importTaskDTO.getFileGuid());
         importTaskCondition.setSourceId(importTaskDTO.getSourceId());
-        importTaskCondition.setDbType(importTaskDTO.getDbType());
+        importTaskCondition.setDbType(importTaskDTO.getDBType());
         importTaskCondition.setOrderBy(importTaskDTO.getOrderBy());
         importTaskCondition.setOrderByType(importTaskDTO.getOrderByType());
         importTaskCondition.setCreateId(personnelVO.getId());

+ 5 - 1
src/main/java/cn/cslg/pas/service/business/PatentDigProjectService.java

@@ -159,9 +159,13 @@ public class PatentDigProjectService extends ServiceImpl<PatentDigProjectMapper,
         }
 
         tableName = "patent_dig_project as dp left join project as p on dp.project_id =p.id left join rd_project rp on dp.rd_project_id =rp.id ";
+        tableName+=  "left join (select * from asso_project_event where scenario_id is not null ) as asps on p.id = asps.project_id " +
+                "left join (select * from asso_project_event where event_id is not null ) as aspe on p.id = aspe.project_id " +
+                "left join (select * from asso_project_event where matter_id is not null ) as aspm on p.id = aspm.project_id";
         //返回分组数据
         QueryGroupImp queryGroupImp = queryGroupFactory.getClass(groupConfig.getGroupClass());
-        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
+        String countFiled="distinct p.id";
+        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField(),countFiled);
 
         //装载数据
         GroupVO groupVO = new GroupVO();

+ 6 - 2
src/main/java/cn/cslg/pas/service/business/PatentProjectService.java

@@ -207,9 +207,13 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
         }
 
         tableName = "patent_project as pp left join project as p on pp.project_id = p.id ";
+      tableName+=  "left join (select * from asso_project_event where scenario_id is not null ) as asps on p.id = asps.project_id " +
+                "left join (select * from asso_project_event where event_id is not null ) as aspe on p.id = aspe.project_id " +
+                "left join (select * from asso_project_event where matter_id is not null ) as aspm on p.id = aspm.project_id";
         //返回分组数据
         QueryGroupImp queryGroupImp = queryGroupFactory.getClass(groupConfig.getGroupClass());
-        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
+        String countFiled="distinct p.id";
+        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField(),countFiled);
 
         //装载数据
         GroupVO groupVO = new GroupVO();
@@ -319,7 +323,7 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
             for (ProjectEventDTO projectEventDTO : events) {
                 AssoProjectEvent assoProjectEvent = new AssoProjectEvent();
                 //事件id和处理事项id
-                BeanUtils.copyProperties(projectEventDTO, assoProjectEvent);
+              assoProjectEvent.setEventId(projectEventDTO.getEventId());
                 //项目id
                 assoProjectEvent.setProjectId(project.getId());
                 //创建人

+ 2 - 2
src/main/java/cn/cslg/pas/service/business/ProductMarketDataService.java

@@ -223,7 +223,7 @@ public class ProductMarketDataService extends ServiceImpl<ProductMarketDataMappe
         //返回分组数据
         tableName = "product_market_data as pmd left join product as p on pmd.product_id = p.id";
         QueryGroupImp queryGroupImp = queryGroupFactory.getClass(groupConfig.getGroupClass());
-        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
+        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField(),groupConfig.getSqlField());
         //装载数据
         GroupVO groupVO = new GroupVO();
         groupVO.setField(groupRequest.getGroupBy());
@@ -258,7 +258,7 @@ public class ProductMarketDataService extends ServiceImpl<ProductMarketDataMappe
         //返回分组数据
         tableName = "product_market_data as pmd left join product as p on pmd.product_id = p.id";
         QueryGroupImp queryGroupImp = queryGroupFactory.getClass(groupConfig.getGroupClass());
-        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
+        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField(),groupConfig.getSqlField());
         return reGroupDataVO;
     }
     /**

+ 5 - 1
src/main/java/cn/cslg/pas/service/business/ReportProjectService.java

@@ -216,9 +216,13 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
             }
         }
         tableName = "report as rp left join project as p on rp.project_id =p.id ";
+        tableName+=  "left join (select * from asso_project_event where scenario_id is not null ) as asps on p.id = asps.project_id " +
+                "left join (select * from asso_project_event where event_id is not null ) as aspe on p.id = aspe.project_id " +
+                "left join (select * from asso_project_event where matter_id is not null ) as aspm on p.id = aspm.project_id";
         //返回分组数据
         QueryGroupImp queryGroupImp = queryGroupFactory.getClass(groupConfig.getGroupClass());
-        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField());
+        String countFiled="distinct p.id";
+        ReGroupDataVO reGroupDataVO = queryGroupImp.getGroup(sqls, tableName, groupConfig.getSqlField(),countFiled);
 
         //装载数据
         GroupVO groupVO = new GroupVO();

+ 3 - 1
src/main/java/cn/cslg/pas/service/importPatent/SchedulingTaskService.java

@@ -122,7 +122,9 @@ public class SchedulingTaskService {
     public void pauseTask(Integer taskId, Integer state) {
         //根据id获得
         ImportTaskAMVO importTaskAMVO = importTaskAMVOS.stream().filter(item -> item.getId().equals(taskId)).findFirst().orElse(null);
-        importTaskAMVO.setState(state);
+      if(importTaskAMVO!=null) {
+          importTaskAMVO.setState(state);
+      }
     }
 
     public List<ImportTaskAMVO> getImportTaskAMVOs() {

+ 6 - 0
src/main/java/cn/cslg/pas/service/importPatent/TaskThread.java

@@ -65,9 +65,12 @@ public class TaskThread extends Thread {
         importTaskAMVO.setIfAddPicture(ifAddPicture);
         importTaskAMVO.setIfAddFullText(ifFullText);
         importTaskAMVO.setIfAddPDF(ifPdf);
+        //已完成的线程
         importTaskAMVO.setThreadDoneCounter(0);
         importTaskAMVO.setMessageThreadDoneCounter(0);
+        //总共需要完成的线程
         Integer threadCount = 0;
+        //专利信息需要完成的线程
         Integer messageThreadCount = 0;
 
         if (ifAddPicture == '1') {
@@ -142,6 +145,8 @@ public class TaskThread extends Thread {
         synchronized ("导入任务是否完成") {
             importTaskAMVO.setThreadDoneCounter(importTaskAMVO.getThreadDoneCounter() + 1);
             if (importTaskAMVO.getThreadCounter().equals(importTaskAMVO.getThreadDoneCounter())) {
+
+                System.out.println("任务已经完成");
                 if (taskThreadLock.tryLock()) {
                     //taskLock.lock();
                     taskThreadCondition.signalAll();
@@ -186,6 +191,7 @@ public class TaskThread extends Thread {
                     }
                     break;
             }
+            // 计算总进度
             List<Integer> nums = new ArrayList<>();
             nums.add(patentProcess.getPictureDoneNum());
             nums.add(patentProcess.getPdfDoneNum());

+ 2 - 2
src/main/resources/jsons/event.json

@@ -32,7 +32,7 @@
     "type": "Integer",
     "value": "reportProjectNum",
     "field": "reportProjectNum",
-    "sqlField": "event_id",
+    "sqlField": "id",
     "orderClass": "getEventReportNumOrder",
     "ifSearch": "false",
     "ifGroup": "false",
@@ -43,7 +43,7 @@
     "type": "Integer",
     "value": "patentProjectNum",
     "field": "patentProjectNum",
-    "sqlField": "event_id",
+    "sqlField": "id",
     "orderClass": "getEventProjectNumOrder",
     "ifSearch": "false",
     "ifGroup": "false",

+ 2 - 2
src/main/resources/mapper/AssoProjectEvent.xml

@@ -14,13 +14,13 @@
     </select>
 
     <select id="getEventProjectNumOrder" resultType="java.lang.Integer">
-        select event_id from (select event_id, count(*) as c from
+        select  ifnull(event_id,0) from (select event_id, count(*) as c from
         asso_project_event
         <where>
             project_type =#{projectType}
             group by event_id,project_type
         </where>
-        ) as t order by c #{orderType}
+        ) as t order by c ${orderType}
     </select>
 
 </mapper>

+ 1 - 1
src/main/resources/mapper/Event.xml

@@ -21,7 +21,7 @@
         </if>
     </select>
     <select id="getGroups" resultType="cn.cslg.pas.common.vo.GroupReVO">
-        select ${selectField} as value ,count(${selectField}) as num from ${tableName}
+        select ${selectField} as value ,count(${countField}) as num from ${tableName}
         <if test="sqls.get(0)!=''">
             where ${sqls.get(0)}
         </if>

+ 6 - 18
src/test/java/cn/cslg/pas/service/EventServiceTests.java

@@ -18,6 +18,7 @@ import cn.cslg.pas.controller.PatentController;
 import cn.cslg.pas.domain.es.FamilyPatent;
 import cn.cslg.pas.domain.es.Patent;
 import cn.cslg.pas.domain.es.PatentFamilyMessage;
+import cn.cslg.pas.mapper.AssoProjectEventMapper;
 import cn.cslg.pas.service.business.MergePersonService;
 import cn.cslg.pas.service.business.ProductMarketDataService;
 import cn.cslg.pas.service.business.ReportTempleService;
@@ -68,7 +69,8 @@ public class EventServiceTests {
 
     @Autowired
     private ProductMarketDataService productMarketDataService;
-
+@Autowired
+private AssoProjectEventMapper assoProjectEventMapper;
     @Test
     void test() throws Exception {
         StringRequest queryRequest = new StringRequest();
@@ -468,23 +470,9 @@ public class EventServiceTests {
 
     @Test
     public void test101() {
-//        Date date = new Date();
-//        Calendar calendar = Calendar.getInstance();
-//        calendar.setTime(date);
-//        calendar.add(Calendar.DAY_OF_MONTH, 1);
-//        Date date1 = calendar.getTime();
-//        System.out.println(date1);
-//
-//        List<Integer> list = Arrays.asList(1, 2, 3);
-//        String result = String.join(",", String.join(",", list.stream().map(Object::toString).collect(Collectors.toList())));
-//        System.out.println(result); // 输出: 1,2,3
-
-        String s = "((type='1') AND  (type_id='7') ) AND  (parent_id='0') ";
-        if (s.contains("type='1") || s.contains("type='2'")) {
-            System.out.println("Sdggdsgred");
-        } else {
-            System.out.println("end");
-        }
+        String a =" DESC";
+  List<Integer> ids = assoProjectEventMapper.getEventProjectNumOrder(0,a);
+  System.out.println(ids);
     }
 
 }