Explorar el Código

Merge remote-tracking branch 'origin/master'

xiexiang hace 1 año
padre
commit
7237de0944
Se han modificado 24 ficheros con 289 adiciones y 55 borrados
  1. 9 13
      src/main/java/cn/cslg/pas/common/dto/customAnalyse/SchemaDataDTO.java
  2. 2 2
      src/main/java/cn/cslg/pas/common/utils/Response.java
  3. 6 2
      src/main/java/cn/cslg/pas/common/vo/customAnalyse/SourceDataVO.java
  4. 6 0
      src/main/java/cn/cslg/pas/controller/EventController.java
  5. 11 4
      src/main/java/cn/cslg/pas/controller/ProductCategoryController.java
  6. 5 0
      src/main/java/cn/cslg/pas/controller/ProductController.java
  7. 7 0
      src/main/java/cn/cslg/pas/controller/ReportProjectController.java
  8. 11 3
      src/main/java/cn/cslg/pas/domain/business/CustomAnalysisItemSchema.java
  9. 10 4
      src/main/java/cn/cslg/pas/domain/business/CustomAnalysisItemSetting.java
  10. 10 4
      src/main/java/cn/cslg/pas/domain/business/CustomAnalysisItemSource.java
  11. 6 2
      src/main/java/cn/cslg/pas/service/business/CustomAnalyseService.java
  12. 23 0
      src/main/java/cn/cslg/pas/service/business/CustomAnalysisItemSchemaService.java
  13. 2 0
      src/main/java/cn/cslg/pas/service/business/CustomAnalysisItemSettingService.java
  14. 34 15
      src/main/java/cn/cslg/pas/service/business/CustomAnalysisItemSourceService.java
  15. 22 1
      src/main/java/cn/cslg/pas/service/business/EventService.java
  16. 19 0
      src/main/java/cn/cslg/pas/service/business/PatentDigProjectService.java
  17. 18 0
      src/main/java/cn/cslg/pas/service/business/PatentProjectService.java
  18. 24 0
      src/main/java/cn/cslg/pas/service/business/ProductCategoryService.java
  19. 24 0
      src/main/java/cn/cslg/pas/service/business/ProductService.java
  20. 18 0
      src/main/java/cn/cslg/pas/service/business/ProjectTaskService.java
  21. 18 1
      src/main/java/cn/cslg/pas/service/business/ReportProjectService.java
  22. 1 1
      src/main/resources/jsons/patent.json
  23. 1 1
      src/main/resources/jsons/product.json
  24. 2 2
      src/main/resources/mapper/Event.xml

+ 9 - 13
src/main/java/cn/cslg/pas/common/dto/customAnalyse/SchemaDataDTO.java

@@ -1,26 +1,22 @@
 package cn.cslg.pas.common.dto.customAnalyse;
 
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 @Data
+@NoArgsConstructor
 public class SchemaDataDTO {
-    private Integer field;
-    private Integer expand;
+    private String field;
+    private String expand;
     private Integer ptype;
-    private Integer type;
+    private String type;
     private Integer num;
     private Integer merge;
+    private String name;
+    private String groupBy;
+    private String fieldKind;
 
-    public SchemaDataDTO() {
-        this.field = 0;
-        this.expand = 0;
-        this.type = 0;
-        this.ptype = 0;
-        this.num = 0;
-        this.merge = 0;
-    }
-
-    public SchemaDataDTO(Integer field, Integer expand) {
+    public SchemaDataDTO(String field, String expand) {
         this.field = field;
         this.expand = expand;
     }

+ 2 - 2
src/main/java/cn/cslg/pas/common/utils/Response.java

@@ -76,12 +76,12 @@ public class Response {
         return response;
     }
 
-    public static String noPermissions(String message) {
+    public static Response noPermissions(String message) {
         Response response = new Response();
         response.setCode(ResponseEnum.NO_PERMISSION.getCode());
         response.setData(Boolean.FALSE);
         response.setMessage(message);
-        return JsonUtils.objectToJson(response);
+        return response;
     }
 
 

+ 6 - 2
src/main/java/cn/cslg/pas/common/vo/customAnalyse/SourceDataVO.java

@@ -7,10 +7,14 @@ import java.util.List;
 
 @Data
 public class SourceDataVO {
-    private Integer expandId;
-    private Integer fieldId;
+    private String expand;
+    private String field;
     private String uid;
     private String patentKey;
     private String dimension;
+    private Boolean selected;
+    private Integer number;
+    private Integer topN;
+    private String name;
     private List<CustomAnalysisItemSource> source;
 }

+ 6 - 0
src/main/java/cn/cslg/pas/controller/EventController.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.controller;
 
+import cn.cslg.pas.common.auth.checkAuth;
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.dto.business.EventDTO;
 import cn.cslg.pas.common.dto.business.UpdateEventDTO;
@@ -38,6 +39,7 @@ public class EventController {
 
     @Operation(summary = "查询事件")
     @PostMapping("/queryEvent")
+    @checkAuth(FunId = "xiaoshi/event/search")
     public Response queryEvent(@RequestBody StringRequest stringRequest) throws Exception {
         Business business = businessFactory.getClass("eventService");
         Records records = (Records) business.queryMessage(stringRequest);
@@ -47,6 +49,7 @@ public class EventController {
 
     @Operation(summary = "添加事件")
     @PostMapping("/addEvent")
+    @checkAuth(FunId = "xiaoshi/event/add")
     public Response addEvent(String event, List<MultipartFile> files) throws Exception {
         if (event != null) {
             EventDTO eventDTO = JSONObject.parseObject(event, EventDTO.class);
@@ -71,6 +74,7 @@ public class EventController {
 
     @Operation(summary = "更新事件")
     @PostMapping("/updateEvent")
+    @checkAuth(FunId = "xiaoshi/event/edit")
     public Response updateEvent(String event, List<MultipartFile> files) throws Exception {
         if (event != null) {
             UpdateEventDTO updateEventDTO = JSONObject.parseObject(event, UpdateEventDTO.class);
@@ -85,6 +89,7 @@ public class EventController {
 
     @Operation(summary = "删除事件")
     @PostMapping("/deleteEvent")
+    @checkAuth(FunId = "xiaoshi/event/delete")
     public String deleteEvent(@RequestBody List<Integer> ids) throws Exception {
         Business business = businessFactory.getClass("eventService");
         business.deleteMessage(ids);
@@ -93,6 +98,7 @@ public class EventController {
 
     @Operation(summary = "分组事件")
     @PostMapping("/groupEvent")
+    @checkAuth(FunId = "xiaoshi/event/group")
     public Response groupEvent(@RequestBody StringGroupRequest stringGroupRequest) throws Exception {
         Business business = businessFactory.getClass("eventService");
         Records records = (Records)business.getGroup(stringGroupRequest,"event");

+ 11 - 4
src/main/java/cn/cslg/pas/controller/ProductCategoryController.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.controller;
 
+import cn.cslg.pas.common.auth.checkAuth;
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.dto.business.ProductCategoryDTO;
 import cn.cslg.pas.common.dto.business.UpdateProductCategoryDTO;
@@ -26,6 +27,7 @@ import java.util.List;
 
 /**
  * 产品类别的Controller层
+ *
  * @Author xiexiang
  * @Date 2023/10/24
  */
@@ -38,7 +40,8 @@ public class ProductCategoryController {
 
     @Operation(summary = "查询产品类别")
     @PostMapping("/queryProductCategory")
-    public Response queryProductCategory(@RequestBody  StringRequest stringRequest) throws Exception {
+    @checkAuth(FunId = "xiaoshi/product")
+    public Response queryProductCategory(@RequestBody StringRequest stringRequest) throws Exception {
         Business business = businessFactory.getClass("productCategoryService");
         Records records = (Records) business.queryMessage(stringRequest);
         return Response.success(records);
@@ -46,6 +49,7 @@ public class ProductCategoryController {
 
     @Operation(summary = "添加产品类别")
     @PostMapping("/addProductCategory")
+    @checkAuth(FunId = "xiaoshi/product")
     public Response addProductCategory(String productCategory, List<MultipartFile> files) throws Exception {
         if (productCategory != null && productCategory != "") {
             ProductCategoryDTO productCategoryDTO = JSONObject.parseObject(productCategory, ProductCategoryDTO.class);
@@ -53,8 +57,8 @@ public class ProductCategoryController {
             Integer id = null;
             try {
                 id = (Integer) business.addMessage(productCategoryDTO, files);
-            } catch (Exception e){
-                if(e instanceof XiaoShiException) {
+            } catch (Exception e) {
+                if (e instanceof XiaoShiException) {
                     return Response.error(e.getMessage());
                 } else if (e instanceof UnLoginException) {
                     return Response.unLogin(e.getMessage());
@@ -70,18 +74,21 @@ public class ProductCategoryController {
 
     @Operation(summary = "更新产品类别")
     @PostMapping("/updateProductCategory")
+    @checkAuth(FunId = "xiaoshi/product")
     public Response updateProductCategory(String productCategory, List<MultipartFile> files) throws Exception {
         if (productCategory != null) {
             UpdateProductCategoryDTO updateProductCategoryDTO = JSONObject.parseObject(productCategory, UpdateProductCategoryDTO.class);
             Business business = businessFactory.getClass("productCategoryService");
-            business.updateMessage(updateProductCategoryDTO,files);
+            business.updateMessage(updateProductCategoryDTO, files);
             return Response.success(1);
         } else {
             return Response.error("网络异常");
         }
     }
+
     @Operation(summary = "删除产品类别")
     @PostMapping("/deleteProductCategory")
+    @checkAuth(FunId = "xiaoshi/product")
     public String deleteProductCategory(@RequestBody List<Integer> ids) throws Exception {
         Business business = businessFactory.getClass("productCategoryService");
         business.deleteMessage(ids);

+ 5 - 0
src/main/java/cn/cslg/pas/controller/ProductController.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.controller;
 
+import cn.cslg.pas.common.auth.checkAuth;
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.dto.business.ProductDTO;
 import cn.cslg.pas.common.dto.business.UpdateProductDTO;
@@ -42,6 +43,7 @@ public class ProductController {
 
     @Operation(summary = "查询产品")
     @PostMapping("/queryProduct")
+    @checkAuth(FunId = "xiaoshi/product")
     public Response queryProduct(@RequestBody StringRequest stringRequest) throws Exception {
         Business business = businessFactory.getClass("productService");
         Records records = (Records) business.queryMessage(stringRequest);
@@ -50,6 +52,7 @@ public class ProductController {
 
     @Operation(summary = "添加产品")
     @PostMapping("/addProduct")
+    @checkAuth(FunId = "xiaoshi/product")
     public Response addProduct(String product, List<MultipartFile> files) throws Exception {
         if (product != null && product != "") {
             ProductDTO productDTO = JSONObject.parseObject(product, ProductDTO.class);
@@ -74,6 +77,7 @@ public class ProductController {
 
     @Operation(summary = "更新产品")
     @PostMapping("/updateProduct")
+    @checkAuth(FunId = "xiaoshi/product")
     public Response updateProduct(String product, List<MultipartFile> files) throws Exception {
         if(product != null){
             UpdateProductDTO updateProductDTO = JSONObject.parseObject(product, UpdateProductDTO.class);
@@ -87,6 +91,7 @@ public class ProductController {
 
     @Operation(summary = "删除产品")
     @PostMapping("/deleteProduct")
+    @checkAuth(FunId = "xiaoshi/product")
     public String deleteProduct(@RequestBody List<Integer> ids) throws Exception {
         Business business = businessFactory.getClass("productService");
         business.deleteMessage(ids);

+ 7 - 0
src/main/java/cn/cslg/pas/controller/ReportProjectController.java

@@ -1,5 +1,6 @@
 package cn.cslg.pas.controller;
 
+import cn.cslg.pas.common.auth.checkAuth;
 import cn.cslg.pas.common.core.base.Constants;
 import cn.cslg.pas.common.dto.business.EventDTO;
 import cn.cslg.pas.common.dto.business.ReportProjectDTO;
@@ -43,6 +44,7 @@ public class ReportProjectController {
 
     @Operation(summary = "查询报告")
     @PostMapping("/queryReportProject")
+    @checkAuth(FunId = "xiaoshi/report")
     public Response queryPatentProject(@RequestBody StringRequest stringRequest) throws Exception {
         Business business = businessFactory.getClass("reportProjectService");
         Records records = (Records) business.queryMessage(stringRequest);
@@ -52,6 +54,7 @@ public class ReportProjectController {
 
     @Operation(summary = "添加报告")
     @PostMapping("/addReportProject")
+    @checkAuth(FunId = "xiaoshi/report")
     public Response addReportProject(@RequestBody ReportProjectDTO reportProjectDTO) throws Exception {
         if (reportProjectDTO != null) {
             Business business = businessFactory.getClass("reportProjectService");
@@ -75,6 +78,7 @@ public class ReportProjectController {
 
     @Operation(summary = "更新报告")
     @PostMapping("/updateReportProject")
+    @checkAuth(FunId = "xiaoshi/report")
     public Response updatePatentProject(@RequestBody UpdateReportProjectDTO updateReportProjectDTO) throws Exception {
         if (updateReportProjectDTO != null) {
             Business business = businessFactory.getClass("reportProjectService");
@@ -87,6 +91,7 @@ public class ReportProjectController {
 
     @Operation(summary = "删除报告")
     @PostMapping("/deleteReportProject")
+    @checkAuth(FunId = "xiaoshi/report")
     public String deletePatentProject(@RequestBody List<Integer> ids) throws Exception {
         Business business = businessFactory.getClass("reportProjectService");
         business.deleteMessage(ids);
@@ -95,6 +100,7 @@ public class ReportProjectController {
 
     @Operation(summary = "分组报告")
     @PostMapping("/groupReportProject")
+    @checkAuth(FunId = "xiaoshi/report")
     public Response groupPatentProject(@RequestBody StringGroupRequest stringGroupRequest) throws Exception {
         Business business = businessFactory.getClass("reportProjectService");
         Records records = (Records) business.getGroup(stringGroupRequest, "reportProject");
@@ -104,6 +110,7 @@ public class ReportProjectController {
 
     @Operation(summary = "更新是否第二次无效")
     @PostMapping("/updateIfSecondInvalid")
+    @checkAuth(FunId = "xiaoshi/report")
     public Response updateIfSecondInvalid(@RequestBody UpdateIfSecondInvalidDTO updateIfSecondInvalidDTO) throws Exception {
         try {
             reportProjectService.updateIfSecondInvalid(updateIfSecondInvalidDTO);

+ 11 - 3
src/main/java/cn/cslg/pas/domain/business/CustomAnalysisItemSchema.java

@@ -27,13 +27,13 @@ public class CustomAnalysisItemSchema extends BaseEntity<CustomAnalysisItemSchem
     private String dimension;
 
     @TableField(value = "field")
-    private Integer field;
+    private String field;
 
     @TableField(value = "expand")
-    private Integer expand;
+    private String expand;
 
     @TableField(value = "type")
-    private Integer type;
+    private String type;
 
     @TableField(value = "ptype")
     private Integer ptype;
@@ -60,4 +60,12 @@ public class CustomAnalysisItemSchema extends BaseEntity<CustomAnalysisItemSchem
     @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
     private Date updateTime;
 
+    @TableField(value = "name")
+    private String name;
+
+    @TableField(value = "group_by")
+    private String groupBy;
+
+    @TableField(value = "field_kind")
+    private String fieldKind;
 }

+ 10 - 4
src/main/java/cn/cslg/pas/domain/business/CustomAnalysisItemSetting.java

@@ -63,9 +63,9 @@ public class CustomAnalysisItemSetting extends BaseEntity<CustomAnalysisItemSett
         this.fontSize2 = "13";
         this.fontColor = "#000000";
         this.fontColor2 = "#000000";
-        this.show = true;
+        this.show1 = true;
         this.show2 = true;
-        this.interval = true;
+        this.interval1 = true;
         this.interval2 = true;
         this.rotate = "0";
         this.rotate2 = "0";
@@ -303,7 +303,10 @@ public class CustomAnalysisItemSetting extends BaseEntity<CustomAnalysisItemSett
     /**
      * 坐标轴(X)显示
      */
-    @TableField(value = "show")
+    @TableField(value = "show1")
+    private Boolean show1;
+
+    @TableField(exist = false)
     private Boolean show;
 
     /**
@@ -318,7 +321,10 @@ public class CustomAnalysisItemSetting extends BaseEntity<CustomAnalysisItemSett
     /**
      * X轴信息全部显示
      */
-    @TableField(value = "interval")
+    @TableField(value = "interval1")
+    private Boolean interval1;
+
+    @TableField(exist = false)
     private Boolean interval;
 
     /**

+ 10 - 4
src/main/java/cn/cslg/pas/domain/business/CustomAnalysisItemSource.java

@@ -45,14 +45,14 @@ public class CustomAnalysisItemSource extends BaseEntity<CustomAnalysisItemSourc
     /**
      * 字段ID
      */
-    @TableField(value = "field_id")
-    private Integer fieldId;
+    @TableField(value = "field")
+    private String field;
 
     /**
      * 拓展ID
      */
-    @TableField(value = "expand_id")
-    private Integer expandId;
+    @TableField(value = "expand")
+    private String expand;
 
     /**
      * 开始时间
@@ -98,6 +98,12 @@ public class CustomAnalysisItemSource extends BaseEntity<CustomAnalysisItemSourc
     @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
     private Date updateTime;
 
+    @TableField(value = "number")
+    private Integer number;
+
+    @TableField(value = "topN")
+    private Integer topN;
+
     /**
      * 大于
      */

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

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -127,8 +128,8 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
             throw new UnLoginException("未登录");
         }
         CustomAnalysisItem item = new CustomAnalysisItem();
-        item.setUid(uid);
         BeanUtils.copyProperties(vo, item);
+        item.setUid(uid);
         if (vo.getType() == 1) {
             item.setParentId(0);
         } else {
@@ -140,9 +141,12 @@ public class CustomAnalyseService extends ServiceImpl<CustomAnalysisItemMapper,
         item.setCreateTime(new Date());
         item.setUpdateTime(new Date());
         item.insert();
+        if (StringUtils.isEmpty(vo.getUid())) {
+            vo.setUid(item.getUid());
+        }
         if (item.getType().equals(2)) {
-            itemSettingService.add(vo.getSetting(), uid);
             itemSchemaService.add(vo.getSchema(), uid);
+            itemSettingService.add(vo.getSetting(), uid);
             itemSourceService.edit(vo);
         }
         return item.getId();

+ 23 - 0
src/main/java/cn/cslg/pas/service/business/CustomAnalysisItemSchemaService.java

@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -53,11 +54,17 @@ public class CustomAnalysisItemSchemaService extends ServiceImpl<CustomAnalysisI
         x.setPtype(d1.getPtype());
         x.setNum(d1.getNum());
         x.setType(d1.getType());
+        x.setGroupBy(d1.getGroupBy());
+        x.setFieldKind(d1.getFieldKind());
+        x.setName(d1.getName());
         y.setField(d2.getField());
         y.setExpand(d2.getExpand());
         y.setPtype(d2.getPtype());
         y.setNum(d2.getNum());
         y.setType(d2.getType());
+        y.setName(d2.getName());
+        y.setGroupBy(d2.getGroupBy());
+        y.setFieldKind(d2.getFieldKind());
         dto.setX(x);
         dto.setY(y);
         return dto;
@@ -82,8 +89,13 @@ public class CustomAnalysisItemSchemaService extends ServiceImpl<CustomAnalysisI
         d1.setPtype(dto.getX().getPtype());
         d1.setType(dto.getX().getType());
         d1.setNum(dto.getX().getNum());
+        d1.setName(dto.getX().getName());
+        d1.setGroupBy(dto.getX().getGroupBy());
+        d1.setFieldKind(dto.getX().getFieldKind());
         d1.setCreateId(personnelVO.getId());
         d1.setCreateName(personnelVO.getName());
+        d1.setCreateTime(new Date());
+        d1.setUpdateTime(new Date());
         d2.setUid(uid);
         d2.setDimension("y");
         d2.setField(dto.getY().getField());
@@ -91,8 +103,13 @@ public class CustomAnalysisItemSchemaService extends ServiceImpl<CustomAnalysisI
         d2.setPtype(dto.getY().getPtype());
         d2.setType(dto.getY().getType());
         d2.setNum(dto.getY().getNum());
+        d2.setName(dto.getY().getName());
+        d2.setGroupBy(dto.getY().getGroupBy());
+        d2.setFieldKind(dto.getY().getFieldKind());
         d2.setCreateId(personnelVO.getId());
         d2.setCreateName(personnelVO.getName());
+        d2.setCreateTime(new Date());
+        d2.setUpdateTime(new Date());
         customAnalysisItemSchema.add(d1);
         customAnalysisItemSchema.add(d2);
         this.saveBatch(customAnalysisItemSchema);
@@ -111,6 +128,9 @@ public class CustomAnalysisItemSchemaService extends ServiceImpl<CustomAnalysisI
                         item.setPtype(dto.getX().getPtype());
                         item.setNum(dto.getX().getNum());
                         item.setType(dto.getX().getType());
+                        item.setName(dto.getX().getName());
+                        item.setGroupBy(dto.getX().getGroupBy());
+                        item.setFieldKind(dto.getX().getFieldKind());
                         break;
                     case "y":
                         item.setField(dto.getY().getField());
@@ -118,6 +138,9 @@ public class CustomAnalysisItemSchemaService extends ServiceImpl<CustomAnalysisI
                         item.setPtype(dto.getY().getPtype());
                         item.setNum(dto.getY().getNum());
                         item.setType(dto.getY().getType());
+                        item.setName(dto.getY().getName());
+                        item.setGroupBy(dto.getY().getGroupBy());
+                        item.setFieldKind(dto.getY().getFieldKind());
                         break;
                 }
             });

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

@@ -67,6 +67,8 @@ public class CustomAnalysisItemSettingService extends ServiceImpl<CustomAnalysis
         }
         CustomAnalysisItemSetting customAnalysisItemSetting = new CustomAnalysisItemSetting();
         BeanUtils.copyProperties(setting, customAnalysisItemSetting);
+        customAnalysisItemSetting.setShow1(setting.getShow());
+        customAnalysisItemSetting.setInterval1(setting.getInterval());
         customAnalysisItemSetting.setUid(uid);
         customAnalysisItemSetting.setCreateId(personnelVO.getId());
         customAnalysisItemSetting.setCreateName(personnelVO.getName());

+ 34 - 15
src/main/java/cn/cslg/pas/service/business/CustomAnalysisItemSourceService.java

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -50,12 +51,12 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
         return sourceDataDTO;
     }
 
-    public List<CustomAnalysisItemSource> getItemSourceList(String uid, String dimension, Integer fieldId, Integer expandId) {
+    public List<CustomAnalysisItemSource> getItemSourceList(String uid, String dimension, String field, String expand) {
         LambdaQueryWrapper<CustomAnalysisItemSource> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(CustomAnalysisItemSource::getUid, uid);
         queryWrapper.eq(CustomAnalysisItemSource::getDimension, dimension);
-        queryWrapper.eq(CustomAnalysisItemSource::getFieldId, fieldId);
-        queryWrapper.eq(CustomAnalysisItemSource::getExpandId, expandId);
+        queryWrapper.eq(CustomAnalysisItemSource::getField, field);
+        queryWrapper.eq(CustomAnalysisItemSource::getExpand, expand);
         return this.list(queryWrapper);
     }
 
@@ -63,14 +64,17 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
         list.forEach(item -> {
             item.setUid(null);
             item.setDimension(null);
-            item.setFieldId(null);
-            item.setExpandId(null);
+            item.setField(null);
+            item.setExpand(null);
             item.setCreateTime(null);
             item.setUpdateTime(null);
             item.setStatus(null);
             item.setId(null);
             item.setCreateId(null);
             item.setCreateName(null);
+            item.setName(null);
+            item.setNumber(null);
+            item.setTopN(null);
             if (StringUtils.isNotEmpty(item.getMaxData())) {
                 item.setMax(JsonUtils.jsonToPojo(item.getMaxData(), SourceMinAndMaxDataDTO.class));
                 item.setMaxData(null);
@@ -88,22 +92,34 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
         SourceDataVO x = new SourceDataVO();
         SourceDataVO y = new SourceDataVO();
         SourceDataDTO sourceDataDTO = vo.getSource();
-        if (vo.getSchema().getX().getPtype().equals(3) || vo.getSchema().getX().getPtype().equals(4)
-                || vo.getSchema().getX().getType().equals(6)) {
+        Integer xPType = vo.getSchema().getX().getPtype();
+        String xType = vo.getSchema().getX().getType();
+        if ((xPType != null && (xPType.equals(3) || xPType.equals(4))) || (StringUtils.isNotEmpty(xType) && xType.equalsIgnoreCase("tree"))) {
             x.setUid(vo.getUid());
             x.setDimension("x");
-            x.setFieldId(vo.getSchema().getX().getField());
-            x.setExpandId(vo.getSchema().getX().getExpand());
+            x.setField(vo.getSchema().getX().getField());
+            x.setExpand(vo.getSchema().getX().getExpand());
+            x.setName(vo.getSchema().getX().getName());
+            x.setNumber(vo.getSchema().getX().getNum());
             x.setSource(sourceDataDTO.getX());
+            if (!CollectionUtils.isEmpty(sourceDataDTO.getX())) {
+                x.setSelected(true);
+            }
             this.updateSource(x);
         }
-        if (vo.getSchema().getY().getPtype().equals(3) || vo.getSchema().getY().getPtype().equals(4)
-                || vo.getSchema().getY().getType().equals(6)) {
+        Integer yPType = vo.getSchema().getY().getPtype();
+        String yType = vo.getSchema().getY().getType();
+        if ((yPType != null && (yPType.equals(3) || yPType.equals(4))) || (StringUtils.isNotEmpty(yType) && xType.equalsIgnoreCase("tree"))) {
             y.setUid(vo.getUid());
             y.setDimension("y");
-            y.setFieldId(vo.getSchema().getY().getField());
-            y.setExpandId(vo.getSchema().getY().getExpand());
+            y.setField(vo.getSchema().getY().getField());
+            y.setExpand(vo.getSchema().getY().getExpand());
+            y.setName(vo.getSchema().getY().getName());
+            y.setNumber(vo.getSchema().getY().getNum());
             y.setSource(sourceDataDTO.getY());
+            if (!CollectionUtils.isEmpty(sourceDataDTO.getY())) {
+                y.setSelected(true);
+            }
             this.updateSource(y);
         }
     }
@@ -128,12 +144,15 @@ public class CustomAnalysisItemSourceService extends ServiceImpl<CustomAnalysisI
             if (StringUtils.isNotNull(source.getMin())) {
                 source.setMinData(JsonUtils.objectToJson(source.getMin()));
             }
-            source.setFieldId(sourceDataVO.getFieldId());
-            source.setExpandId(sourceDataVO.getExpandId());
+            source.setField(sourceDataVO.getField());
+            source.setExpand(sourceDataVO.getExpand());
             source.setCreateId(finalPersonnelVO.getId());
             source.setCreateName(finalPersonnelVO.getName());
             source.setDimension(sourceDataVO.getDimension());
             source.setUid(sourceDataVO.getUid());
+            source.setName(sourceDataVO.getName());
+            source.setNumber(sourceDataVO.getNumber());
+            source.setSelected(sourceDataVO.getSelected());
             list.add(source);
         });
         this.saveOrUpdateBatch(list);

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

@@ -77,7 +77,8 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
 
        List<String> sqls = formatQueryService.reSqls(queryRequest,"event");
-        //根据sql查询事件信息
+        sqls=this.loadSearchSql(sqls);
+       //根据sql查询事件信息
         List<EventVO> eventVOS = eventMapper.getEvent(sqls.get(0),sqls.get(1),sqls.get(2));
 
         //查询总数
@@ -256,6 +257,7 @@ public class EventService extends ServiceImpl<EventMapper, Event> implements Bus
         StringRequest stringRequest =new StringRequest();
         BeanUtils.copyProperties(groupRequest,stringRequest);
         List<String> sqls = formatQueryService.reSqls(stringRequest,tableName);
+        sqls =this.loadSearchSql(sqls);
         //格式化 分组
         GroupConfig groupConfig=null;
         if (groupRequest.getGroupBy() != null) {
@@ -446,4 +448,23 @@ public List<Integer> getEventIdByName(String value,Boolean ifEqual){
 
 }
 
+
+    //装载查询语句
+    private List<String> loadSearchSql(List<String> sqls){
+        PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
+        Integer tenant_id =personnelVO.getTenantId();
+        String rootSql ="(tenant_id ="+tenant_id+")";
+        if(sqls.get(0)!=null&&!sqls.get(0).equals(""))
+        {
+            sqls.set(0,rootSql+" and"+"("+sqls.get(0)+")");
+
+        }
+        else {
+            sqls.set(0,rootSql);
+        }
+
+        return sqls;
+
+    }
+
 }

+ 19 - 0
src/main/java/cn/cslg/pas/service/business/PatentDigProjectService.java

@@ -97,6 +97,7 @@ public class PatentDigProjectService extends ServiceImpl<PatentDigProjectMapper,
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
         List<String> sqls = formatQueryService.reSqls(queryRequest, "patentDigProject");
         //根据sql查询专题库信息
+       sqls = this.loadSearchSql(sqls);
         List<PatentDigProjectVO> patentProjectVOS = patentDigProjectMapper.getPatentDigProject(sqls.get(0), sqls.get(1), sqls.get(2));
         Long total = patentDigProjectMapper.getPatentDigCount(sqls.get(0));
         //装载专利数据库信息
@@ -755,4 +756,22 @@ public class PatentDigProjectService extends ServiceImpl<PatentDigProjectMapper,
 
     }
 
+
+    //装载查询语句
+    private List<String> loadSearchSql(List<String> sqls){
+        PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
+        String id =personnelVO.getId();
+        String rootSql ="(p.create_id ="+id+" or p.head_id="+id+" or p.id in (select project_id from asso_project_person where person_id ="+id+"))";
+        if(sqls.get(0)!=null&&!sqls.get(0).equals(""))
+        {
+            sqls.set(0,rootSql+" and"+"("+sqls.get(0)+")");
+
+        }
+        else {
+            sqls.set(0,rootSql);
+        }
+
+        return sqls;
+
+    }
 }

+ 18 - 0
src/main/java/cn/cslg/pas/service/business/PatentProjectService.java

@@ -104,6 +104,7 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
 
         List<String> sqls = formatQueryService.reSqls(queryRequest, "patentProject");
+        sqls =this.loadSearchSql(sqls);
         //根据sql查询专题库信息
         List<PatentProjectVO> patentProjectVOS = patentProjectMapper.getPatentProject(sqls.get(0), sqls.get(1), sqls.get(2));
         Long total = patentProjectMapper.getPatentProjectCount(sqls.get(0));
@@ -192,6 +193,7 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
         StringRequest stringRequest = new StringRequest();
         BeanUtils.copyProperties(groupRequest, stringRequest);
         List<String> sqls = formatQueryService.reSqls(stringRequest, tableName);
+        sqls=this.loadSearchSql(sqls);
         //格式化 分组
         GroupConfig groupConfig = null;
         if (groupRequest.getGroupBy() != null) {
@@ -867,6 +869,22 @@ public class PatentProjectService extends ServiceImpl<PatentProjectMapper, Paten
         }
 
     }
+    //装载查询语句
+    private List<String> loadSearchSql(List<String> sqls){
+        PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
+        String id =personnelVO.getId();
+        String rootSql ="(p.create_id ="+id+" or p.head_id="+id+" or p.id in (select project_id from asso_project_person where person_id ="+id+"))";
+        if(sqls.get(0)!=null&&!sqls.get(0).equals(""))
+        {
+            sqls.set(0,rootSql+" and"+"("+sqls.get(0)+")");
 
+        }
+        else {
+            sqls.set(0,rootSql);
+        }
+
+        return sqls;
+
+    }
 
 }

+ 24 - 0
src/main/java/cn/cslg/pas/service/business/ProductCategoryService.java

@@ -77,6 +77,7 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
     @Override
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
         List<String> sqls = formatQueryService.reSqls(queryRequest,"productCategory");
+        sqls =this.loadSearchSql(sqls);
         //根据sql查询产品类别信息
         List<ProductCategoryVO> productCategoryVOS = productCategoryMapper.getProductCategory(sqls.get(0),sqls.get(1),sqls.get(2));
         //查询总数
@@ -502,4 +503,27 @@ public class ProductCategoryService extends ServiceImpl<ProductCategoryMapper, P
             productCategoryVO.setAdminIds(adminIds);
         }
     }
+
+    //装载查询语句
+    private List<String> loadSearchSql(List<String> sqls){
+        PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
+        String id =personnelVO.getId();
+        Integer tenantId =personnelVO.getTenantId();
+        String rootSql ="category.create_id="+id+" or(category.show_type =0 and category.tenant ="+tenantId+") or ( category.id in (select product_category_id from asso_product_category_person where" +
+                " person_id="+id+" and role=0)) or (category.show_type=2 and  category.id in (select product_category_id from asso_product_category_person where" +
+                " person_id="+id+" and role=1)) or(category.show_type =3 and category.id not in(select product_category_id from asso_product_category_person where" +
+                " person_id="+id+" and role=2))";
+        if(sqls.get(0)!=null&&!sqls.get(0).equals(""))
+        {
+            sqls.set(0,rootSql+" and"+"("+sqls.get(0)+")");
+
+        }
+        else {
+            sqls.set(0,rootSql);
+        }
+
+        return sqls;
+
+    }
+
 }

+ 24 - 0
src/main/java/cn/cslg/pas/service/business/ProductService.java

@@ -70,6 +70,7 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> implemen
     @Transactional(rollbackFor = Exception.class)
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
         List<String> sqls = formatQueryService.reSqls(queryRequest,"product");
+       sqls= this.loadSearchSql(sqls);
         //根据sql查询产品信息
         List<ProductVO> productVOS = productMapper.getProduct(sqls.get(0), sqls.get(1), sqls.get(2));
         //查询总数
@@ -493,4 +494,27 @@ public class ProductService extends ServiceImpl<ProductMapper, Product> implemen
             productVO.setAdminIds(adminIds);
         }
     }
+
+    //装载查询语句
+    //装载查询语句
+    private List<String> loadSearchSql(List<String> sqls){
+        PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
+        String id =personnelVO.getId();
+        Integer tenantId =personnelVO.getTenantId();
+        String rootSql ="product.create_id="+id+" or(product.show_type =0 and product.tenant_id ="+tenantId+") or ( product.id in (select product_id from asso_product_person where" +
+                " person_id="+id+" and role=0)) or (product.show_type=2 and  product.id in (select product_id from asso_product_person where" +
+                " person_id="+id+" and role=1)) or(product.show_type =3 and product.id not in(select product_id from asso_product_person where" +
+                " person_id="+id+" and role=2))";
+        if(sqls.get(0)!=null&&!sqls.get(0).equals(""))
+        {
+            sqls.set(0,rootSql+" and"+"("+sqls.get(0)+")");
+
+        }
+        else {
+            sqls.set(0,rootSql);
+        }
+
+        return sqls;
+
+    }
 }

+ 18 - 0
src/main/java/cn/cslg/pas/service/business/ProjectTaskService.java

@@ -238,6 +238,7 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
     @Override
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
         List<String> sqls = formatQueryService.reSqls(queryRequest, "projectTask");
+        sqls=this.loadSearchSql(sqls);
         //根据sql查询任务信息
         List<ProjectTaskVO> projectTaskVOS = projectTaskMapper.getProjectTask(sqls.get(0), sqls.get(1), sqls.get(2));
         //查询总数
@@ -1207,4 +1208,21 @@ public class ProjectTaskService extends ServiceImpl<ProjectTaskMapper, ProjectTa
         }
         return projectTask.getId();
     }
+    //装载查询语句
+    private List<String> loadSearchSql(List<String> sqls){
+        PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
+        String id =personnelVO.getId();
+        String rootSql ="(create_id ="+id+" or handler="+id+")";
+        if(sqls.get(0)!=null&&!sqls.get(0).equals(""))
+        {
+            sqls.set(0,rootSql+" and"+"("+sqls.get(0)+")");
+
+        }
+        else {
+            sqls.set(0,rootSql);
+        }
+
+        return sqls;
+
+    }
 }

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

@@ -106,7 +106,7 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
     @Transactional(rollbackFor = Exception.class)
     public Object queryMessage(QueryRequest queryRequest) throws Exception {
         List<String> sqls = formatQueryService.reSqls(queryRequest, "reportProject");
-
+             sqls=this.loadSearchSql(sqls);
         //根据sql查询事件信息
         List<ReportProjectVO> reportProject = reportProjectMapper.getReportProject(sqls.get(0), sqls.get(1), sqls.get(2));
         this.loadReportProjectVO(reportProject);
@@ -873,4 +873,21 @@ public class ReportProjectService extends ServiceImpl<ReportProjectMapper, Repor
         return true;
     }
 
+ //装载查询语句
+    private List<String> loadSearchSql(List<String> sqls){
+        PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
+        String id =personnelVO.getId();
+        String rootSql ="(p.create_id ="+id+" or p.head_id="+id+" or p.id in (select project_id from asso_project_person where person_id ="+id+"))";
+        if(sqls.get(0)!=null&&!sqls.get(0).equals(""))
+        {
+            sqls.set(0,rootSql+" and"+"("+sqls.get(0)+")");
+
+        }
+        else {
+            sqls.set(0,rootSql);
+        }
+
+        return sqls;
+
+    }
 }

+ 1 - 1
src/main/resources/jsons/patent.json

@@ -219,7 +219,7 @@
   {
     "name": "合并发明人",
     "type": "Array",
-    "value": "mergeRightHolder",
+    "value": "mergeInventor",
     "field": "MIN",
     "esField": "merge_inventor.name",
     "esClass": "nestedQueryBuilder",

+ 1 - 1
src/main/resources/jsons/product.json

@@ -2,7 +2,7 @@
   {"name":"产品Id",
     "type":"Integer",
     "value":"product_id",
-    "field":"id",
+    "field":"product_id",
     "sqlField": "product.id",
     "sqlClass": "getComSql",
     "orderClass": "getComOrder",

+ 2 - 2
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(*) as num from ${tableName}
+        select ${selectField} as value ,count(${selectField}) as num from ${tableName}
         <if test="sqls.get(0)!=''">
             where ${sqls.get(0)}
         </if>
@@ -55,7 +55,7 @@
 
 
     <select id="getEntrustGroup" resultType="cn.cslg.pas.common.vo.EntrustVO">
-        select distinct ${selectField} ,p.id,count(*) as num from ${tableName}
+        select distinct ${selectField} ,p.id,count(distinct p.id ) as num from ${tableName}
         <if test="sqls.get(0)!=''">
             where ${sqls.get(0)}
         </if>