Ver código fonte

2021-12-15 版本提交 lys

liyisong 3 anos atrás
pai
commit
7c1bc87b7d
35 arquivos alterados com 962 adições e 184 exclusões
  1. 20 4
      ttc-app/src/main/java/cn/ubitech/ttc/controller/IndexController.java
  2. 36 9
      ttc-app/src/main/java/cn/ubitech/ttc/controller/ManageController.java
  3. 18 0
      ttc-app/src/main/java/cn/ubitech/ttc/controller/ResourceChoiceController.java
  4. 1 0
      ttc-app/src/main/java/cn/ubitech/ttc/controller/ResourceController.java
  5. 73 4
      ttc-app/src/main/java/cn/ubitech/ttc/controller/TestController.java
  6. 1 1
      ttc-app/src/main/java/cn/ubitech/ttc/controller/UserController.java
  7. 4 1
      ttc-app/src/main/resources/application-dev.yml
  8. 68 4
      ttc-app/src/test/cn/ubitech/ttc/Test1.java
  9. 5 1
      ttc-backen/src/main/java/cn/ubitech/ttc/common/ImageSpiderCommon.java
  10. 10 2
      ttc-backen/src/main/java/cn/ubitech/ttc/common/Util.java
  11. 15 8
      ttc-backen/src/main/java/cn/ubitech/ttc/common/utils/ExcelPatternMsgUtils.java
  12. 1 0
      ttc-backen/src/main/java/cn/ubitech/ttc/dao/OrganizationInfoMapper.java
  13. 53 53
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/MunicipalEnterprise.java
  14. 4 8
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/OrganizationInfo.java
  15. 4 1
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/ResourceChoiceMore.java
  16. 4 1
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/Resourcelibrary.java
  17. 4 0
      ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/CompanyTaxLkExcelData.java
  18. 10 4
      ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/CompanyTaxLkExcelDataListener.java
  19. 24 0
      ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/EnterpriseBasicInfoExcelData.java
  20. 32 1
      ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/EnterpriseBasicInfoExcelDataListener.java
  21. 5 5
      ttc-backen/src/main/java/cn/ubitech/ttc/model/common/ElasticSearchTTCModel.java
  22. 2 0
      ttc-backen/src/main/java/cn/ubitech/ttc/repository/ResourceRepository.java
  23. 1 1
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/common/InfoPageServiceImpl.java
  24. 97 8
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/datatools/DataEntryResourceImpl.java
  25. 76 2
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/datatools/InterviewDataEntryServiceImpl.java
  26. 205 13
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/entry/EntryServiceImpl.java
  27. 7 0
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/index/IndexServiceImpl.java
  28. 39 10
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/label/LabelCommonService.java
  29. 25 0
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/mybaits/OrganizationInfoServiceImpl.java
  30. 27 19
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/resource/ElasticSearchServiceImpl.java
  31. 7 6
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/resource/ResourceLibraryServiceImpl.java
  32. 65 16
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/resourceChoice/ResouceChoiceServiceImpl.java
  33. 2 0
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/search/SearchServiceImpl.java
  34. 2 2
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/user/SysUsersInfoServiceImpl.java
  35. 15 0
      ttc-backen/src/main/resources/mapper/OrganizationInfoMapper.xml

+ 20 - 4
ttc-app/src/main/java/cn/ubitech/ttc/controller/IndexController.java

@@ -10,10 +10,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -149,4 +146,23 @@ public class IndexController {
         }
         return resultModel;
     }
+
+    @ApiOperation(value = "自检系统列表")
+    @GetMapping(value = "/inspect/list/{node}/{restype}")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "node", paramType = "path", dataType = "String", value = "节点id"),
+            @ApiImplicitParam(name = "restype", paramType = "path", dataType = "Integer", value = "资源类型")
+    })
+    public ResultModel inspectList(@PathVariable String node, @PathVariable Integer restype) {
+        ResultModel resultModel = new ResultModel();
+        try {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
+            resultModel.setData(indexService.inspectList(node,restype));
+        } catch (Exception e) {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
+            resultModel.setData(e.toString());
+            e.printStackTrace();
+        }
+        return resultModel;
+    }
 }

+ 36 - 9
ttc-app/src/main/java/cn/ubitech/ttc/controller/ManageController.java

@@ -3,10 +3,7 @@ package cn.ubitech.ttc.controller;
 import cn.ubitech.ttc.common.Util;
 import cn.ubitech.ttc.entity.Admap;
 import cn.ubitech.ttc.entity.Notify;
-import cn.ubitech.ttc.model.common.AdvertiseDetailPageModel;
-import cn.ubitech.ttc.model.common.Constant;
-import cn.ubitech.ttc.model.common.RequestModel;
-import cn.ubitech.ttc.model.common.ResultModel;
+import cn.ubitech.ttc.model.common.*;
 import cn.ubitech.ttc.service.impl.manage.ManageServiceImpl;
 import cn.ubitech.ttc.service.impl.mybaits.OrganizationInfoServiceImpl;
 import com.alibaba.fastjson.JSON;
@@ -496,19 +493,49 @@ public class ManageController {
         return resultModel;
     }
 
-    @GetMapping("/get/insepct/{userid}/{restype}/{node}/{sortkey}/{orgname}")
-    @ApiOperation(value = "获取培育库列表,即自检后的企业列表")
+
+    @GetMapping("/inspect/list/{userid}/{restype}/{node}")
+    @ApiOperation(value = "获取自检列表,用权限划分")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "userid", paramType = "path", dataType = "Integer", value = "用户id"),
+            @ApiImplicitParam(name = "restype", paramType = "path", dataType = "Integer", value = "培育库类别; 1:雏鹰; 2:省科小; 3:市级研发中西; 4:省级研发中心; 5:省级企业研究院; 6:飞地研发中心"),
+            @ApiImplicitParam(name = "node", paramType = "path", dataType = "Integer", value = "节点id")
+    })
+    public ResultModel inspectList(@PathVariable Integer userid, @PathVariable Integer restype, @PathVariable Integer node) {
+        ResultModel resultModel = new ResultModel();
+        try {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
+            return resultModel;
+        } catch (Exception e) {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
+            resultModel.setData(e.toString());
+            return resultModel;
+        }
+    }
+
+
+
+    @GetMapping("/get/insepct/list/{userid}/{restype}/{node}/{sortkey}/{orgname}/{lablename}")
+    @ApiOperation(value = "获取培育库列表,即自检后符合条件的企业列表")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "userid", paramType = "path", dataType = "Integer", value = "用户id"),
             @ApiImplicitParam(name = "restype", paramType = "path", dataType = "Integer", value = "培育库类别; 1:雏鹰; 2:省科小; 3:市级研发中西; 4:省级研发中心; 5:省级企业研究院; 6:飞地研发中心"),
             @ApiImplicitParam(name = "node", paramType = "path", dataType = "Integer", value = "节点id"),
             @ApiImplicitParam(name = "sortkey", paramType = "path", dataType = "String", value = "排序"),
-            @ApiImplicitParam(name = "orgname", paramType = "path", dataType = "String", value = "关键词搜索")
+            @ApiImplicitParam(name = "orgname", paramType = "path", dataType = "String", value = "关键词搜索"),
+            @ApiImplicitParam(name = "lablename", paramType = "path", dataType = "String", value = "筛选条件"),
+            @ApiImplicitParam(name = "pagenum", paramType = "path", dataType = "Integer", value = "页码,默认从1开始"),
     })
-    public ResultModel getInspect(@PathVariable Integer userid, @PathVariable Integer restype, @PathVariable Integer node,
-                                  @PathVariable String sortkey, @PathVariable String orgname) {
+    public ResultModel getInspectList(@PathVariable Integer userid, @PathVariable Integer restype, @PathVariable Integer node,
+                                      @PathVariable String sortkey, @PathVariable String orgname, @PathVariable String lablename,
+                                      @PathVariable Integer pagenum) {
         ResultModel resultModel = new ResultModel();
         try {
+            PageModel pageModel = new PageModel();
+            pageModel.setStartIndex(pagenum);
+            pageModel.setCurrentPage(pagenum);
+            resultModel.setPage(pageModel);
+            resultModel.setData(organizationInfoServiceImpl.inspectOrgList(pageModel,restype,node,sortkey,orgname,lablename,pagenum));
             resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
         } catch (Exception e) {
             resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);

+ 18 - 0
ttc-app/src/main/java/cn/ubitech/ttc/controller/ResourceChoiceController.java

@@ -206,6 +206,7 @@ public class ResourceChoiceController {
     public ResultModel moreChoice(@PathVariable String nodeId, @PathVariable Integer restype) {
         ResultModel resultModel = new ResultModel();
         try {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
             resultModel.setData(resouceChoiceService.getResourceChoiceMoreList(nodeId, restype));
         } catch (Exception e) {
             resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
@@ -214,6 +215,23 @@ public class ResourceChoiceController {
         return resultModel;
     }
 
+    @GetMapping(value = "/choice/foster/list/{nodeId}/{restype}")
+    @ApiOperation(value = "培育库筛选条件列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "nodeId", paramType = "path", dataType = "String", value = "节点id"),
+            @ApiImplicitParam(name = "restype", paramType = "path", dataType = "Integer", value = "培育库标识")
+    })
+    public ResultModel choiceFosterList(@PathVariable String nodeId, @PathVariable Integer restype) {
+        ResultModel resultModel = new ResultModel();
+        try {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
+            resultModel.setData(resouceChoiceService.choiceFosterList(nodeId, restype));
+        } catch (Exception e) {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
+            resultModel.setData(e.toString());
+        }
+        return resultModel;
+    }
 
 
 }

+ 1 - 0
ttc-app/src/main/java/cn/ubitech/ttc/controller/ResourceController.java

@@ -24,6 +24,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.io.IOUtils;

+ 73 - 4
ttc-app/src/main/java/cn/ubitech/ttc/controller/TestController.java

@@ -1,29 +1,52 @@
 package cn.ubitech.ttc.controller;
 
+import cn.ubitech.ttc.dao.LabelIntelligentCommonInfoMapper;
+import cn.ubitech.ttc.dao.ResourcelibraryMapper;
+import cn.ubitech.ttc.entity.LabelIntelligentCommonInfo;
+import cn.ubitech.ttc.entity.Resourcelibrary;
 import cn.ubitech.ttc.model.common.Constant;
+import cn.ubitech.ttc.model.common.ElasticSearchTTCModel;
 import cn.ubitech.ttc.model.common.ResultModel;
 import cn.ubitech.ttc.model.test.RecoverCount;
+import cn.ubitech.ttc.repository.ResourceRepository;
 import cn.ubitech.ttc.service.test.TestService;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.elasticsearch.index.query.BoolQueryBuilder;
+import org.elasticsearch.index.query.QueryBuilders;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
+import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
+import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
+import org.springframework.web.bind.annotation.*;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 @RestController
 @RequestMapping("/test")
 @Api(description = "内部人员测试接口类")
+@Slf4j
 public class TestController {
 
     @Autowired
     private TestService testService;
+    @Autowired
+    private ElasticsearchTemplate elasticsearchTemplate;
+    @Autowired
+    private ResourcelibraryMapper resourcelibraryMapper;
+    @Autowired
+    private LabelIntelligentCommonInfoMapper labelMapper;
+    @Autowired
+    private ResourceRepository resourceRepository;
 
     /**
      * 统计中心数据恢复为实时计算模式。
@@ -95,4 +118,50 @@ public class TestController {
         }
         return resultModel;
     }
+
+    @GetMapping("/positionaltitles")
+    @ApiOperation(value = "将原有数据的职称转换为标签对应的code")
+    public ResultModel positionaltitles() {
+        ResultModel resultModel = new ResultModel();
+        try {
+            log.info("开始执行。。。。。。。。。。。。。");
+            List<LabelIntelligentCommonInfo> labels = labelMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("by1", "positionaltitles").eq("node", 320117400));
+            List<String> names = labels.stream().map(LabelIntelligentCommonInfo::getName).collect(Collectors.toList());
+            NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder();
+            BoolQueryBuilder bqb = QueryBuilders.boolQuery();
+            bqb.must(QueryBuilders.termQuery("type", 8));
+            bqb.must(QueryBuilders.matchQuery("groupid", 1994));
+            nativeSearchQueryBuilder.withQuery(bqb).withPageable(new PageRequest(0, 10000));
+            NativeSearchQuery build = nativeSearchQueryBuilder.build();
+            List<ElasticSearchTTCModel> elasticSearchTTCModels = elasticsearchTemplate.queryForList(build, ElasticSearchTTCModel.class);
+
+            for (ElasticSearchTTCModel model : elasticSearchTTCModels) {
+                Resourcelibrary resourcelibrary = resourcelibraryMapper.selectById(model.getUnique());
+                if (StringUtils.isNotBlank(resourcelibrary.getPositionaltitles())) {
+                    StringBuilder codes = new StringBuilder();
+                    for (LabelIntelligentCommonInfo label : labels) {
+                        if (resourcelibrary.getPositionaltitles().contains(label.getName()) || resourcelibrary.getPositionaltitles().contains(label.getCode())) {
+                            codes.append(label.getCode()).append(",");
+                        }
+                    }
+                    if (StringUtils.isNotEmpty(codes.toString())) {   //遍历codes为了去重
+                        List<String> list1 = Arrays.asList(codes.toString().split(",")).stream().distinct().collect(Collectors.toList());
+                        codes = new StringBuilder();
+                        for (String s : list1) {
+                            codes.append(s).append(",");
+                        }
+                        codes = new StringBuilder(codes.substring(0, codes.length() - 1));
+                    }
+                    model.setBy6(codes.toString());
+                    resourceRepository.save(model);
+                    System.out.println("修改的es id为:" + model.getId() + " , 修改的资源库id为:" + model.getUnique() + ", 修改的职称数据为:" + model.getBy6());
+                }
+            }
+            resultModel.setData(Constant.INTERFACE_STATUS_CODE_3350);
+        } catch (Exception e) {
+            resultModel.setData(e.toString());
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
+        }
+        return resultModel;
+    }
 }

+ 1 - 1
ttc-app/src/main/java/cn/ubitech/ttc/controller/UserController.java

@@ -1154,7 +1154,7 @@ public class UserController {
     }
 
     @PostMapping("/inspect")
-    @ApiOperation(value = "高企自检除外的其余自检系统")
+    @ApiOperation(value = "自检系统")
     public ResultModel inspectMunicipal(@RequestBody RequestModel requestModel) {
         ResultModel resultModel = new ResultModel();
         try {

+ 4 - 1
ttc-app/src/main/resources/application-dev.yml

@@ -8,12 +8,15 @@ spring:
       url: jdbc:mysql://192.168.1.127:3306/std_ttc_dev_1?autoReconnect=true&allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
       username: root
       password: root
+#      url: jdbc:mysql://117.81.233.247:3307/std_ttc_test?autoReconnect=true&amp;useUnicode=TRUE&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull
+#      username: ttcTest
+#      password: ttc123456
 
   data:
     elasticsearch:
       cluster-name: ttc_test_es
       #      cluster-nodes: 192.168.0.28:9300,192.168.0.29:9300,192.168.0.30:9300
-      cluster-nodes: 192.168.1.128:9300,192.168.1.128:9301,192.168.1.128:9302
+      cluster-nodes: 192.168.1.118:9300,192.168.1.118:9301,192.168.1.118:9302
       #      typename: esttc
       #      indexname: ttcdev
       #      label_common_indexname: label_common_dev

+ 68 - 4
ttc-app/src/test/cn/ubitech/ttc/Test1.java

@@ -1,21 +1,38 @@
 package cn.ubitech.ttc;
 
+import cn.ubitech.ttc.common.SnowflakeIdWorker;
+import cn.ubitech.ttc.dao.LabelIntelligentCommonInfoMapper;
+import cn.ubitech.ttc.dao.ResourcelibraryMapper;
 import cn.ubitech.ttc.entity.CompanyProvincialScienceSmall;
+import cn.ubitech.ttc.entity.LabelIntelligentCommonInfo;
 import cn.ubitech.ttc.entity.OrganizationInfo;
+import cn.ubitech.ttc.entity.Resourcelibrary;
+import cn.ubitech.ttc.model.common.Constant;
+import cn.ubitech.ttc.model.common.ElasticSearchTTCModel;
+import cn.ubitech.ttc.repository.ResourceRepository;
 import cn.ubitech.ttc.service.mybaits.ICompanyProvincialScienceSmallService;
 import cn.ubitech.ttc.service.mybaits.IOrganizationInfoService;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.elasticsearch.index.query.BoolQueryBuilder;
+import org.elasticsearch.index.query.QueryBuilders;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
+import org.springframework.data.elasticsearch.core.query.NativeSearchQuery;
+import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
 import org.springframework.test.context.junit4.SpringRunner;
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author lys
@@ -23,12 +40,21 @@ import java.util.List;
  */
 @RunWith(SpringRunner.class)
 @SpringBootTest
+@Slf4j
 public class Test1 {
 
     @Autowired
     private IOrganizationInfoService infoService;
     @Autowired
     private ICompanyProvincialScienceSmallService companyProvincialScienceSmallService;
+    @Autowired
+    private ElasticsearchTemplate elasticsearchTemplate;
+    @Autowired
+    private ResourcelibraryMapper resourcelibraryMapper;
+    @Autowired
+    private LabelIntelligentCommonInfoMapper labelMapper;
+    @Autowired
+    private ResourceRepository resourceRepository;
 
     @Test
     public void test1() throws ParseException {
@@ -72,5 +98,43 @@ public class Test1 {
         companyProvincialScienceSmallService.insertOrUpdateAllColumnBatch(list);
     }
 
+    @Test
+    public void test5() {
+
+        List<LabelIntelligentCommonInfo> labels = labelMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("by1", "positionaltitles").eq("node", 320117400));
+
+        List<String> names = labels.stream().map(LabelIntelligentCommonInfo::getName).collect(Collectors.toList());
+
+        NativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder();
+        BoolQueryBuilder bqb = QueryBuilders.boolQuery();
+        bqb.must(QueryBuilders.termQuery("type", 8));
+        bqb.must(QueryBuilders.matchQuery("groupid", 1994));
+        nativeSearchQueryBuilder.withQuery(bqb).withPageable(new PageRequest(0,10000));
+        NativeSearchQuery build = nativeSearchQueryBuilder.build();
+        List<ElasticSearchTTCModel> elasticSearchTTCModels = elasticsearchTemplate.queryForList(build, ElasticSearchTTCModel.class);
+
+        for (ElasticSearchTTCModel model : elasticSearchTTCModels) {
+            Resourcelibrary resourcelibrary = resourcelibraryMapper.selectById(model.getUnique());
+            if (StringUtils.isNotBlank(resourcelibrary.getPositionaltitles())) {
+                StringBuilder codes = new StringBuilder();
+                for (LabelIntelligentCommonInfo label : labels) {
+                    if (resourcelibrary.getPositionaltitles().contains(label.getName()) || resourcelibrary.getPositionaltitles().contains(label.getCode())) {
+                        codes.append(label.getCode()).append(",");
+                    }
+                }
+                if (StringUtils.isNotEmpty(codes.toString())) {
+                    List<String> list1 = Arrays.asList(codes.toString().split(",")).stream().distinct().collect(Collectors.toList());
+                    codes = new StringBuilder();
+                    for (String s : list1) {
+                        codes.append(s).append(",");
+                    }
+                    codes = new StringBuilder(codes.substring(0, codes.length() - 1));
+                }
+                model.setBy6(codes.toString());
+                resourceRepository.save(model);
+                System.out.println("修改的es id为:" + model.getId() + " , 修改的资源库id为:" + model.getUnique() + ", 修改的职称数据为:" + model.getBy6());
+            }
+        }
+    }
 
 }

+ 5 - 1
ttc-backen/src/main/java/cn/ubitech/ttc/common/ImageSpiderCommon.java

@@ -5,6 +5,7 @@ import cn.ubitech.ttc.dao.OrganizationInfoMapper;
 import cn.ubitech.ttc.model.common.FdfsTrackerHelper;
 import cn.ubitech.ttc.service.impl.redis.RedisTypeHelper;
 import com.alibaba.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
 import net.coobird.thumbnailator.Thumbnails;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -59,6 +60,7 @@ import java.util.List;
  */
 @Repository
 @Component
+@Slf4j
 public class ImageSpiderCommon {
     //    @Autowired
 //    private FastFileStorageClient storageClient;
@@ -205,11 +207,12 @@ public class ImageSpiderCommon {
         String r = null;
         if (file != null) {
             // 观察MD5值
+            log.info("file.getButes() : {}",file.getBytes());
             EncryptUtil.messagedigest.update(file.getBytes());
             r = EncryptUtil.bufferToHex(EncryptUtil.messagedigest.digest());
         }
 
-
+        log.info("--------------------------------------------------------------");
         Pool jedispool = redisTypeHelper.getRedisPool();
         JedisCommands jedis = (JedisCommands) jedispool.getResource();
         try {
@@ -279,6 +282,7 @@ public class ImageSpiderCommon {
                 res.append(fileName_one + "," + fileName_two + "," + fileName_three + "," + source_size);
             }
         }
+        log.info("res:{}",res);
         return res;
     }
 

+ 10 - 2
ttc-backen/src/main/java/cn/ubitech/ttc/common/Util.java

@@ -2189,6 +2189,14 @@ public class Util {
         return timestamp / 1000;
     }
 
+    /**
+     * 验证是否为数字
+     */
+    public static boolean isnumber(String str) {
+        String regex = ExcelPatternMsgUtils.NUMBER;
+        return match(regex, str);
+    }
+
     /**
      * 高企自评数据判断是否合法。
      * @return
@@ -2236,12 +2244,12 @@ public class Util {
                 return map;
             }
             String oneintellectualcount = highOrgMap.containsKey("oneintellectualcount") ? highOrgMap.get("oneintellectualcount").toString() : "";
-            if (!StringUtils.isEmpty(oneintellectualcount) && Util.isIntNumber(oneintellectualcount) == false){
+            if (!StringUtils.isEmpty(oneintellectualcount) && Util.isnumber(oneintellectualcount) == false){
                 map.put("I类自主知识产权数量","格式有误,只可为数字或小数,请检查并重新填写后重试。");
                 return map;
             }
             String twointellectualcount = highOrgMap.containsKey("twointellectualcount") ? highOrgMap.get("twointellectualcount").toString() : "";
-            if (!StringUtils.isEmpty(twointellectualcount) && Util.isIntNumber(twointellectualcount) == false){
+            if (!StringUtils.isEmpty(twointellectualcount) && Util.isnumber(twointellectualcount) == false){
                 map.put("II类自主知识产权数量","格式有误,只可为数字或小数,请检查并重新填写后重试。");
                 return map;
             }

+ 15 - 8
ttc-backen/src/main/java/cn/ubitech/ttc/common/utils/ExcelPatternMsgUtils.java

@@ -132,10 +132,10 @@ public class ExcelPatternMsgUtils {
     // 企业基本信息模板表头
     // public static final String BASIC_TL_HEAD = "{0:\"企业名称\",1:\"法定代表人\",2:\"注册资本(万元)\",3:\"成立日期\",4:\"统一社会信用代码\",5:\"纳税人识别号\",6:\"组织机构代码\",7:\"企业类型\",8:\"所属行业\",9:\"曾用名\",10:\"官网\",11:\"所属乡镇\",12:\"企业地址\",13:\"资质1\",14:\"认定年限1\",15:\"资质2\",16:\"认定年限2\",17:\"资质3\",18:\"认定年限3\",19:\"是否规上\",20:\"老总姓名\",21:\"电话1\",22:\"研发总监姓名\",23:\"电话2\",24:\"科技联络人姓名\",25:\"电话3\",26:\"企业简介\",27:\"主导产品1\",28:\"主导产品2\",29:\"主导产品3\",30:\"发明专利\",31:\"实用新型\",32:\"外观设计\",33:\"软件著作权\",34:\"研究机构\",35:\"研究机构名称\"}";
     // public static final String BASIC_TL_HEAD = "{0:\"企业名称\",1:\"法定代表人\",2:\"注册资本(万元)\",3:\"成立日期\",4:\"统一社会信用代码\",5:\"组织机构代码\",6:\"企业类型\",7:\"所属行业\",8:\"曾用名\",9:\"官网\",10:\"所属乡镇\",11:\"企业地址\",12:\"资质1\",13:\"认定年限1\",14:\"资质2\",15:\"认定年限2\",16:\"资质3\",17:\"认定年限3\",18:\"是否规上\",19:\"企业负责人姓名\",20:\"企业负责人联系方式\",21:\"研发总监姓名\",22:\"研发总监联系方式\",23:\"科技联络人姓名\",24:\"科技联络人联系方式\",25:\"企业简介\",26:\"主导产品1\",27:\"主导产品2\",28:\"主导产品3\",29:\"发明专利\",30:\"实用新型\",31:\"外观设计\",32:\"软件著作权\",33:\"研究机构\",34:\"研究机构名称\",35:\"机构类型\"}";
-    public static final String BASIC_TL_HEAD = "{0:\"企业名称\",1:\"法定代表人\",2:\"经营状态\",3:\"注册资本(万元)\",4:\"实缴资本(万元)\",5:\"曾用名\",6:\"所属行业\",7:\"统一社会信用代码\",8:\"纳税人识别号\",9:\"工商注册号\",10:\"组织机构代码\",11:\"登记机关\",12:\"成立日期\",13:\"企业类型\",14:\"营业期限\",15:\"行政区划\",16:\"核准日期\",17:\"注册地址\",18:\"经营范围\",19:\"发明专利数\",20:\"实用新型授权数\",21:\"软件著作权数\",22:\"是否国高\",23:\"高企证书号\",24:\"高新领域代码\",25:\"是否省级重点企业研究院\",26:\"认定年份\",27:\"省级重点企业研究院名称\",28:\"是否省级企业研究院\",29:\"认定年份\",30:\"省级企业研究院名称\",31:\"是否浙江省高新技术研究开发中心\",32:\"认定年份\",33:\"浙江省高新技术研究开发中心名称\",34:\"是否省科小\",35:\"认定年份\",36:\"是否雏鹰计划\",37:\"认定年份\",38:\"是否市级研发中心\",39:\"认定年份\",40:\"市级研发中心名称\",41:\"是否在建飞地研发中心\",42:\"飞地研发中心专职人员数\",43:\"飞地研发中心场地面积\",44:\"企业法定代表人联系电话\",45:\"技术负责人姓名\",46:\"技术负责人联系电话\",47:\"财务负责人\",48:\"财务负责人联系电话\",49:\"科技联络人姓名\",50:\"科技联络人联系电话\",51:\"职工总数\",52:\"乡镇(街道)平台\",53:\"是否规上\"}";
+    public static final String BASIC_TL_HEAD = "{0:\"企业名称\",1:\"法定代表人\",2:\"经营状态\",3:\"注册资本(万元)\",4:\"实缴资本(万元)\",5:\"曾用名\",6:\"所属行业\",7:\"统一社会信用代码\",8:\"纳税人识别号\",9:\"工商注册号\",10:\"组织机构代码\",11:\"登记机关\",12:\"成立日期\",13:\"企业类型\",14:\"营业期限\",15:\"行政区划\",16:\"核准日期\",17:\"注册地址\",18:\"经营范围\",19:\"发明专利数\",20:\"实用新型授权数\",21:\"软件著作权数\",22:\"是否国高\",23:\"高企证书号\",24:\"高新领域代码\",25:\"是否省级重点企业研究院\",26:\"认定年份\",27:\"省级重点企业研究院名称\",28:\"是否省级企业研究院\",29:\"认定年份\",30:\"省级企业研究院名称\",31:\"是否浙江省高新技术研究开发中心\",32:\"认定年份\",33:\"浙江省高新技术研究开发中心名称\",34:\"是否省科小\",35:\"认定年份\",36:\"是否雏鹰计划\",37:\"认定年份\",38:\"是否市级研发中心\",39:\"认定年份\",40:\"市级研发中心名称\",41:\"是否在建飞地研发中心\",42:\"飞地研发中心专职人员数\",43:\"飞地研发中心场地面积\",44:\"企业法定代表人联系电话\",45:\"技术负责人姓名\",46:\"技术负责人联系电话\",47:\"财务负责人\",48:\"财务负责人联系电话\",49:\"科技联络人姓名\",50:\"科技联络人联系电话\",51:\"职工总数\",52:\"乡镇(街道)平台\",53:\"是否规上\",54:\"前三年营业收入\",55:\"前三年允许扣除的研发费用\",56:\"前两年营业收入\",57:\"前两年允许扣除的研发费用\",58:\"前一年营业收入\",59:\"前一年允许扣除的研发费用\"}";
     // 企业税务数据信息模板表头
     // public static final String TAX_TL_HEAD = "{0:\"企业名称\",1:\"统一社会信用代码\",2:\"时间段1\",3:\"企业税收利润1\",4:\"企业税收收入1\",5:\"研发费加计扣除1\",6:\"留县税收1\",7:\"时间段2\",8:\"企业税收利润2\",9:\"企业税收收入2\",10:\"研发费加计扣除2\",11:\"留县税收2\",12:\"时间段3\",13:\"企业税收利润3\",14:\"企业税收收入3\",15:\"研发费加计扣除3\",16:\"留县税收3\",17:\"时间段4\",18:\"企业税收利润4\",19:\"企业税收收入4\",20:\"研发费加计扣除4\",21:\"留县税收4\"}";
-    public static final String TAX_TL_HEAD = "{0:\"企业名称\",1:\"前三年营业收入\",2:\"前三年允许扣除的研发费用\",3:\"前两年营业收入\",4:\"前两年允许扣除的研发费用\",5:\"前一年营业收入\",6:\"前一年允许扣除的研发费用\"}";
+    public static final String TAX_TL_HEAD = "{0:\"企业名称\",1:\"统一社会信用代码\",2:\"前三年营业收入\",3:\"前三年允许扣除的研发费用\",4:\"前两年营业收入\",5:\"前两年允许扣除的研发费用\",6:\"前一年营业收入\",7:\"前一年允许扣除的研发费用\"}";
     // 企业专利信息模板表头
     // public static final String PATENT_TL_HEAD = "{0:\"企业名称\",1:\"统一社会信用代码\",2:\"专利名称\",3:\"申请号\",4:\"申请日\",5:\"专利类型\",6:\"专利权人\",7:\"授权号\"}";
     public static final String PATENT_TL_HEAD = "{0:\"企业名称\",1:\"统一社会信用代码\",2:\"专利名称\",3:\"申请号\",4:\"申请日\",5:\"专利类型\",6:\"专利权人\",7:\"授权号\",8:\"授权日期\"}";
@@ -237,6 +237,12 @@ public class ExcelPatternMsgUtils {
                 .workercount(map.get(51).toString())
                 .townplatform(map.get(52).toString())
                 .hasregulationorg(map.get(53).toString())
+                .threeyeardeductexpenses(map.get(54).toString())
+                .threeyearsrevenue(map.get(55).toString())
+                .twoyearrevenue(map.get(56).toString())
+                .twoyeardeductexpenses(map.get(57).toString())
+                .lastyearrevenue(map.get(58).toString())
+                .lastyeardeductexpenses(map.get(59).toString())
                 .build();
 
        // todo 组织机构代码 institutioncode、曾用名 formername
@@ -320,12 +326,13 @@ public class ExcelPatternMsgUtils {
         CompanyTaxLkExcelData excelData = CompanyTaxLkExcelData.builder()
                 // 企业名称
                 .orgname(map.get(0).toString())
-                .threeyearsrevenue(map.get(1).toString())
-                .threeyeardeductexpenses(map.get(2).toString())
-                .twoyearrevenue(map.get(3).toString())
-                .twoyeardeductexpenses(map.get(4).toString())
-                .lastyearrevenue(map.get(5).toString())
-                .lastyeardeductexpenses(map.get(6).toString())
+                .orgcode(map.get(1).toString())
+                .threeyearsrevenue(map.get(2).toString())
+                .threeyeardeductexpenses(map.get(3).toString())
+                .twoyearrevenue(map.get(4).toString())
+                .twoyeardeductexpenses(map.get(5).toString())
+                .lastyearrevenue(map.get(6).toString())
+                .lastyeardeductexpenses(map.get(7).toString())
                 .build();
         return excelData;
     }

+ 1 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/dao/OrganizationInfoMapper.java

@@ -74,4 +74,5 @@ public interface OrganizationInfoMapper extends BaseMapper<OrganizationInfo> {
 
     List<OrganizationInfo> getOrgListByCodeAndNameAndNode1(@Param("orgname") String orgname, @Param("orgcode") String orgcode, @Param("node") String node);
 
+    List<OrganizationInfo> getInspectMunicipalOrgList(@Param("sortColumn") String sortColumn, @Param("sortType") String sortType, @Param("orgname") String orgname, @Param("lablename") String lablename);
 }

+ 53 - 53
ttc-backen/src/main/java/cn/ubitech/ttc/entity/MunicipalEnterprise.java

@@ -1,53 +1,53 @@
-package cn.ubitech.ttc.entity;
-
-import com.baomidou.mybatisplus.annotations.TableField;
-import com.baomidou.mybatisplus.annotations.TableId;
-import com.baomidou.mybatisplus.enums.FieldFill;
-import com.baomidou.mybatisplus.enums.IdType;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-import java.io.File;
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 市级研发中心信息
- * @author lys
- * @create 2021-09-23 11:26
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@Accessors(chain = true)
-public class MunicipalEnterprise {
-    private static final long serialVersionUID = 1L;
-
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    //企业id
-    private Integer orgid;
-
-    //资源id
-    private Integer resid;
-
-    //是否市级研发中心
-    private Integer ismunicipal;
-
-    //认定年份
-    @TableField(value = "recognizedate",fill = FieldFill.INSERT)
-    private Date recognizedate;
-
-    //市级研发中心名称
-    private String municipalname;
-
-    @TableField(exist = false)
-    private String tablename = "municipal_enterprise";
-    @TableField(exist = false)
-    private Integer tablecode;
-
-    protected Serializable pkVal() {
-        return this.id;
-    }
-}
+// package cn.ubitech.ttc.entity;
+//
+// import com.baomidou.mybatisplus.annotations.TableField;
+// import com.baomidou.mybatisplus.annotations.TableId;
+// import com.baomidou.mybatisplus.enums.FieldFill;
+// import com.baomidou.mybatisplus.enums.IdType;
+// import lombok.Data;
+// import lombok.EqualsAndHashCode;
+// import lombok.experimental.Accessors;
+//
+// import java.io.File;
+// import java.io.Serializable;
+// import java.util.Date;
+//
+// /**
+//  * 市级研发中心信息
+//  * @author lys
+//  * @create 2021-09-23 11:26
+//  */
+// @Data
+// @EqualsAndHashCode(callSuper = false)
+// @Accessors(chain = true)
+// public class MunicipalEnterprise {
+//     private static final long serialVersionUID = 1L;
+//
+//     @TableId(value = "id", type = IdType.AUTO)
+//     private Long id;
+//
+//     //企业id
+//     private Integer orgid;
+//
+//     //资源id
+//     private Integer resid;
+//
+//     //是否市级研发中心
+//     private Integer ismunicipal;
+//
+//     //认定年份
+//     @TableField(value = "recognizedate",fill = FieldFill.INSERT)
+//     private Date recognizedate;
+//
+//     //市级研发中心名称
+//     private String municipalname;
+//
+//     @TableField(exist = false)
+//     private String tablename = "municipal_enterprise";
+//     @TableField(exist = false)
+//     private Integer tablecode;
+//
+//     protected Serializable pkVal() {
+//         return this.id;
+//     }
+// }

+ 4 - 8
ttc-backen/src/main/java/cn/ubitech/ttc/entity/OrganizationInfo.java

@@ -97,11 +97,11 @@ public class OrganizationInfo extends AuthorityModel<OrganizationInfo>  implemen
      */
     private String taxcode;
     /**
-     * 行业领域
+     * 行业
      */
     private String categoryid;
     /**
-     * 行业领域名称
+     * 行业名称
      */
     private String categoryname;
     /**
@@ -432,6 +432,8 @@ public class OrganizationInfo extends AuthorityModel<OrganizationInfo>  implemen
     private String highenterprisecode;
     //高新领域代码
     private String highandnewcode;
+    //国高八大领域
+    private String highdomain;
     //是否省级重点企业研究院
     private Integer isprovincialemphasisenterprise;
     //省级重点企业认定年份
@@ -476,22 +478,16 @@ public class OrganizationInfo extends AuthorityModel<OrganizationInfo>  implemen
     private String researchdirectorphone;
 
     //前三年营业收入
-    @TableField(exist = false)
     private Double threeyearsrevenue;
     //前三年允许扣除的研发费用
-    @TableField(exist = false)
     private Double threeyeardeductexpenses;
     //前两年营业收入
-    @TableField(exist = false)
     private Double twoyearrevenue;
     //前两年允许扣除的研发费用
-    @TableField(exist = false)
     private Double twoyeardeductexpenses;
     //前一年营业收入
-    @TableField(exist = false)
     private Double lastyearrevenue;
     //前一年允许扣除的研发费用
-    @TableField(exist = false)
     private Double lastyeardeductexpenses;
 
     /**

+ 4 - 1
ttc-backen/src/main/java/cn/ubitech/ttc/entity/ResourceChoiceMore.java

@@ -6,9 +6,12 @@ import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.enums.IdType;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * @author lys
@@ -17,7 +20,7 @@ import java.io.Serializable;
 @Data
 @EqualsAndHashCode
 @Accessors(chain = true)
-public class ResourceChoiceMore extends AuthorityModel<ResourceChoiceMore> implements Serializable {
+public class ResourceChoiceMore implements Serializable {
 
     private static final long serialVersionUID = 1L;
 

+ 4 - 1
ttc-backen/src/main/java/cn/ubitech/ttc/entity/Resourcelibrary.java

@@ -256,7 +256,7 @@ public class Resourcelibrary extends AuthorityModel<Resourcelibrary> implements
      */
     private Integer education;
     /**
-     * 职位
+     * 职位/职务
      */
     private String positionaltitles;
     /**
@@ -615,6 +615,9 @@ public class Resourcelibrary extends AuthorityModel<Resourcelibrary> implements
     //上年度允许扣除的研发费用
     @TableField(exist = false)
     private Double lastyeardeductexpenses;
+    //桐庐节点自定义标签专属字段
+    @TableField(exist = false)
+    private String customLabel;
 
     /**
      * 表名

+ 4 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/CompanyTaxLkExcelData.java

@@ -22,6 +22,10 @@ public class CompanyTaxLkExcelData {
      * 企业名称
      */
     private String orgname;
+    /**
+     * 企业社会信用代码
+     */
+    private String orgcode;
     /**
      * 前三年营业收入
      */

+ 10 - 4
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/CompanyTaxLkExcelDataListener.java

@@ -109,10 +109,16 @@ public class CompanyTaxLkExcelDataListener extends AnalysisEventListener<Company
     public JSONObject checkError(CompanyTaxLkExcelData excelData){
         List<JSONObject> list = new ArrayList<>();
         System.out.println(excelData.getOrgname());
-        // if (!StringUtils.isEmpty(excelData.getOrgcode())
-        //         && Util.isLetterDigit(excelData.getOrgcode()) == false){
-        //     js.put("orgcode","统一社会信用代码" + ExcelPatternMsgUtils.NUMBER_LETTER_MSG);
-        // }
+        if (StringUtils.isEmpty(excelData.getOrgname())) {
+            js.put("orgname","企业名称不能为空");
+        }
+        if (StringUtils.isEmpty(excelData.getOrgcode())) {
+            js.put("orgcode","统一社会信用代码不能为空");
+        }
+        if (!StringUtils.isEmpty(excelData.getOrgcode())
+                && Util.isLetterDigit(excelData.getOrgcode()) == false){
+            js.put("orgcode","统一社会信用代码" + ExcelPatternMsgUtils.NUMBER_LETTER_MSG);
+        }
 //        if (!StringUtils.isEmpty(excelData.getTaxprofitsone()) && Util.isTaxNum(excelData.getTaxprofitsone()) == false){
 //            js.put("taxprofitsone","企业税收利润1" + ExcelPatternMsgUtils.TAX_NUM_MSG);
 //        }

+ 24 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/EnterpriseBasicInfoExcelData.java

@@ -237,6 +237,30 @@ public class EnterpriseBasicInfoExcelData {
      * 是否规上
      */
     private String hasregulationorg;
+    /**
+     * 前三年营业收入
+     */
+    private String threeyearsrevenue;
+    /**
+     * 前三年允许扣除的研发费用
+     */
+    private String threeyeardeductexpenses;
+    /**
+     * 前两年营业收入
+     */
+    private String twoyearrevenue;
+    /**
+     * 前两年允许扣除的研发费用
+     */
+    private String twoyeardeductexpenses;
+    /**
+     * 前一年营业收入
+     */
+    private String lastyearrevenue;
+    /**
+     * 前一年允许扣除的研发费用
+     */
+    private String lastyeardeductexpenses;
 
 
     private Long id;

+ 32 - 1
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/EnterpriseBasicInfoExcelDataListener.java

@@ -132,6 +132,9 @@ public class EnterpriseBasicInfoExcelDataListener extends AnalysisEventListener<
         List<JSONObject> list = new ArrayList<>();
         System.out.println(excelData.getName());
 
+        if (StringUtils.isBlank(excelData.getOrgcode())) {
+            js.put("orgcode","统一社会信用代码不能为空");
+        }
         if (StringUtils.isNotEmpty(excelData.getRegistrationcapital()) && !Util.isNumeric(excelData.getRegistrationcapital())) {
             log.info("注册资本(万元):{}",excelData.getRegistrationcapital());
             js.put("registrationcapital", "注册资本(万元)格式有误," + ExcelPatternMsgUtils.NUMBER_MSG);
@@ -149,9 +152,13 @@ public class EnterpriseBasicInfoExcelDataListener extends AnalysisEventListener<
             js.put("operatingperiod", "营业期限格式有误," + ExcelPatternMsgUtils.DATE2_MSG);
         }
         if (StringUtils.isNotEmpty(excelData.getApprovaltime()) && !Util.isDate(excelData.getApprovaltime())) {
-            log.info("营业期限:{}",excelData.getApprovaltime());
+            log.info("核准日期:{}",excelData.getApprovaltime());
             js.put("approvaltime", "核准日期格式有误," + ExcelPatternMsgUtils.DATE2_MSG);
         }
+        // if (StringUtils.isNotEmpty(excelData.getBusinessscope()) && !Util.toLength(excelData.getBusinessscope(),200)) {
+        //     log.info("经营范围:{}",excelData.getBusinessscope());
+        //     js.put("businessscope","经营范围格式有误," + ExcelPatternMsgUtils.ZISHU_LIMIT);
+        // }
         if (StringUtils.isNotEmpty(excelData.getEmphasisdate()) && !Util.isDate(excelData.getEmphasisdate())) {
             log.info("省级重点企业研究院认定年份:{}",excelData.getEyasdate());
             js.put("emphasisdate","省级重点企业研究院认定年份格式有误," + ExcelPatternMsgUtils.DATE2_MSG);
@@ -188,6 +195,30 @@ public class EnterpriseBasicInfoExcelDataListener extends AnalysisEventListener<
             log.info("科技联络人联系电话," + excelData.getSciencecontactphone());
             js.put("sciencecontactphone","财务联络人联系电话格式有误," + ExcelPatternMsgUtils.TEL_MSG);
         }
+        if (StringUtils.isNotEmpty(excelData.getThreeyearsrevenue()) && !Util.isTaxNum(excelData.getThreeyearsrevenue())) {
+            log.info("前三年营业收入," + excelData.getThreeyearsrevenue());
+            js.put("threeyearsrevenue","前三年营业收入格式有误," + ExcelPatternMsgUtils.TAX_NUM_MSG);
+        }
+        if (StringUtils.isNotEmpty(excelData.getThreeyeardeductexpenses()) && !Util.isTaxNum(excelData.getThreeyeardeductexpenses())) {
+            log.info("前三年允许扣除的研发费用," + excelData.getThreeyeardeductexpenses());
+            js.put("threeyeardeductexpenses", "前三年允许扣除的研发费用格式有误," + ExcelPatternMsgUtils.TAX_NUM_MSG);
+        }
+        if (StringUtils.isNotEmpty(excelData.getTwoyearrevenue()) && !Util.isTaxNum(excelData.getTwoyearrevenue())) {
+            log.info("前两年营业收入," + excelData.getTwoyearrevenue());
+            js.put("twoyearrevenue", "前两年营业收入格式有误," + ExcelPatternMsgUtils.TAX_NUM_MSG);
+        }
+        if (StringUtils.isNotEmpty(excelData.getTwoyeardeductexpenses()) && !Util.isTaxNum(excelData.getTwoyeardeductexpenses())) {
+            log.info("前两年允许扣除的研发费用," + excelData.getTwoyeardeductexpenses());
+            js.put("twoyeardeductexpenses", "前两年允许扣除的研发费用格式有误," + ExcelPatternMsgUtils.TAX_NUM_MSG);
+        }
+        if (StringUtils.isNotEmpty(excelData.getLastyearrevenue()) && !Util.isTaxNum(excelData.getLastyearrevenue())) {
+            log.info("前一年营业收入," + excelData.getLastyearrevenue());
+            js.put("lastyearrevenue", "前一年营业收入格式有误," + ExcelPatternMsgUtils.TAX_NUM_MSG);
+        }
+        if (StringUtils.isNotEmpty(excelData.getLastyeardeductexpenses()) && !Util.isTaxNum(excelData.getLastyeardeductexpenses())) {
+            log.info("前一年允许扣除的研发费用," + excelData.getLastyeardeductexpenses());
+            js.put("lastyeardeductexpenses", "前一年允许扣除的研发费用格式有误," + ExcelPatternMsgUtils.TAX_NUM_MSG);
+        }
         System.out.println(js.toJSONString());
         list.add(js);
         System.out.println("企业基本信息,listttt>" + JSON.toJSONString(list));

+ 5 - 5
ttc-backen/src/main/java/cn/ubitech/ttc/model/common/ElasticSearchTTCModel.java

@@ -70,7 +70,7 @@ public class ElasticSearchTTCModel implements ILabelESInterface {
     private Integer grouptype;//信息类别(备用字段,初始值设为0)
     private Integer isipr;
     private String logo;
-    private Integer positionaltitles;//职称
+    private Integer positionaltitles;//职称   (弃用,改用为by6备用字段,)
     private String newpositionaltitles;//职位
     private String proficiencyName; //技术成熟度中文名
     private double ratiofSecTag;
@@ -80,12 +80,12 @@ public class ElasticSearchTTCModel implements ILabelESInterface {
     private Integer by3; //备用字段3    (该字段已用于资源置顶功能)
     private Integer by4; //备用字段4    (该字段已用于资源置顶功能)
     private String by5; //备用字段5,逗号分词,用于查询,modify by cc:180711 该字段用于存储收藏该信息的用户
-    private String by6; //备用字段6,逗号分词,用于查询
+    private String by6; //备用字段6,逗号分词,用于查询   (该字段已用于存储职称)
     private String by7; //备用字段7,ik分词,用于查询
     private String by8; //备用字段8,ik分词,用于查询
     private Double by9; //备用字段9     (该字段已用于高校等级排序)
     private String newtitle; //不分词的title,用于term查询
-    private String keyword1; //不分词的备用字段1,用于term查询
+    private String keyword1; //不分词的备用字段1,用于term查询 (该字段已用于存储桐庐节点自定义标签)
     private String keyword2; //不分词的备用字段2,用于term查询
 
     private String isenable;//该条资源是否有效(0无效,其他为有效)
@@ -132,6 +132,6 @@ public class ElasticSearchTTCModel implements ILabelESInterface {
     private Double deductexpenses2025;  //2025年允许扣除的研发费用
 
 
-    // private Double yesteryearrevenue;  //上年度营收(税务)
-    // private Double yesteryeardeduct;   //上年度允许扣除研发费用
+    private Double yesteryearrevenue;  //上年度营收(税务)
+    private Double yesteryeardeduct;   //上年度允许扣除研发费用
 }

+ 2 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/repository/ResourceRepository.java

@@ -44,4 +44,6 @@ public interface ResourceRepository extends ElasticsearchRepository<ElasticSearc
 
     List<ElasticSearchTTCModel> findByGroupidAndSource(String groupid,String source);
 
+    List<ElasticSearchTTCModel> findByTitleAndSource(String title, String source);
+
 }

+ 1 - 1
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/common/InfoPageServiceImpl.java

@@ -307,7 +307,7 @@ public class InfoPageServiceImpl {
                                         result = result + infoList.get(0).getName() + ",";
                                     }
                                 }
-                                result = result.length() > 0 ? result.substring(0, result.length() - 1) : "";
+                                result = result.length() > 0 ? result.substring(0, result.length() - 1) : i.getContent();
                                 i.setContent(result);
                             } else {
                                 i.setContent(commonService.resetContentByDictionary(i.getDictionarytype(), i.getContent()));

+ 97 - 8
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/datatools/DataEntryResourceImpl.java

@@ -13,6 +13,7 @@ import cn.ubitech.ttc.model.common.ElasticSearchTTCModel;
 import cn.ubitech.ttc.model.common.ResultModel;
 import cn.ubitech.ttc.repository.ResourceRepository;
 import cn.ubitech.ttc.service.impl.common.CommonServiceImpl;
+import cn.ubitech.ttc.service.mybaits.ICompanyYearMultipleoptionsLkService;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import lombok.extern.slf4j.Slf4j;
@@ -110,6 +111,10 @@ public class DataEntryResourceImpl {
     private CompanyYearMultipleoptionsLkMapper yearMultipleoptionsLkMapper;
     @Autowired
     private YearMultipleoptionsSetupMapper yearMultipleoptionsSetupMapper;
+    @Autowired
+    private ICompanyYearMultipleoptionsLkService yearMultipleoptionsLkService;
+    @Autowired
+    private LabelIntelligentCommonInfoMapper labelIntelligentCommonInfoMapper;
 
     public static Map<String, Integer> ORG_SCALE_MAP = new HashMap<>();
 
@@ -221,7 +226,7 @@ public class DataEntryResourceImpl {
     public Resourcelibrary insertResourceLibrary2(OrganizationInfo organizationInfo, String claid, String node) {
         Resourcelibrary resourcelibrary = transferToResourceLibrary(organizationInfo, node);
         List<Resourcelibrary> resourcelibraryList = resourcelibraryMapper.selectList(new EntityWrapper<Resourcelibrary>()
-                .eq("title", resourcelibrary.getTitle()).eq("restype", resourcelibrary.getRestype()).eq("comefrom", node));
+                .eq("code",organizationInfo.getOrgcode()).eq("oid",organizationInfo.getId()));
         //资源库中有同名资源进行修改操作
         if (CollectionUtils.isNotEmpty(resourcelibraryList)) {
             resourcelibrary.setId(resourcelibraryList.get(0).getId());
@@ -261,7 +266,13 @@ public class DataEntryResourceImpl {
     public Resourcelibrary updateResourceLibrary(OrganizationInfo organizationInfo, String claid, String node, long resid) {
         Resourcelibrary resourcelibrary = transferToResourceLibrary(organizationInfo, node);
         resourcelibrary.setId(resid);
+        Resourcelibrary resource = resourcelibraryMapper.selectById(resid);
+        resourcelibrary.setSnowflakeid(resource.getSnowflakeid());
         resourcelibraryMapper.updateById(resourcelibrary);
+        // List<ElasticSearchTTCModel> esList = resourceRepository.findByTitleAndSource(organizationInfo.getName(), String.valueOf(resid));
+        // if (esList.size() > 0) {
+        //     resourceRepository.delete(esList);
+        // }
         insertES(resourcelibrary, claid, node);
         return resourcelibrary;
     }
@@ -605,6 +616,7 @@ public class DataEntryResourceImpl {
         resourcelibrary.setTel(organizationInfo.getContactnum() != null ? organizationInfo.getContactnum() : "");
         resourcelibrary.setLogo(organizationInfo.getLogo() != null ? organizationInfo.getLogo() : "");
         resourcelibrary.setCategory(organizationInfo.getCategoryid() != null ? organizationInfo.getCategoryid() : "");
+        resourcelibrary.setDomain(organizationInfo.getHighdomain() != null ? organizationInfo.getHighdomain() : "");   //国高八大领域领域
         resourcelibrary.setCreator(organizationInfo.getCreator());
         resourcelibrary.setUpdater(organizationInfo.getUpdator());
         resourcelibrary.setCreatetime(organizationInfo.getCreatetime());
@@ -1119,7 +1131,7 @@ public class DataEntryResourceImpl {
         elasticSearchTTCModel.setStatus(StringUtils.isBlank(resourcelibrary.getIshigh()) ? "" : resourcelibrary.getIshigh());
         elasticSearchTTCModel.setCapitalScale(resourcelibrary.getCapitalScale() == null ? 0f : resourcelibrary.getCapitalScale());
         // elasticSearchTTCModel.setAddress(resourcelibrary.getRegion());
-        elasticSearchTTCModel.setAddress(resourcelibrary.getAddress());
+        elasticSearchTTCModel.setAddress(StringUtils.isNotBlank(resourcelibrary.getTownPlatform()) ? resourcelibrary.getTownPlatform() : (StringUtils.isNotBlank(resourcelibrary.getAddress()) ? resourcelibrary.getAddress() : ""));
         elasticSearchTTCModel.setGroupid(claid);
         elasticSearchTTCModel.setCooperationmodel(resourcelibrary.getCooperationmodel() == null ? "" : resourcelibrary.getCooperationmodel());
         elasticSearchTTCModel.setPrimTag(resourcelibrary.getCategory());
@@ -1139,6 +1151,22 @@ public class DataEntryResourceImpl {
             elasticSearchTTCModel.setBy4(resourceSortLkList.get(0).getBy4());
             elasticSearchTTCModel.setBy3(resourceSortLkList.get(0).getBy3());
         }
+        //溧水节点专家信息录入职称字段做标签转换(专家职称es所用字段为 by6) todo lys  2021-12-14
+        if ("320117400".equals(node)) {
+            List<LabelIntelligentCommonInfo> labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("node", node).eq("by1", "positionaltitles"));
+            if (labelIntelligentCommonInfos != null && resourcelibrary.getPositionaltitles() != null && !resourcelibrary.getPositionaltitles().equals("")) {
+                StringBuilder codes = new StringBuilder();
+                for (LabelIntelligentCommonInfo label : labelIntelligentCommonInfos) {
+                    if (resourcelibrary.getPositionaltitles().equals(label.getName())) {
+                        codes.append(label.getCode()).append(",");
+                    }
+                }
+                if (codes.length() > 0) {
+                    codes = new StringBuilder(codes.substring(0, codes.length() - 1));
+                    elasticSearchTTCModel.setBy6(codes.toString());
+                }
+            }
+        }
         elasticSearchTTCModel.setCreator(String.valueOf(resourcelibrary.getCreator()));
         elasticSearchTTCModel.setFixtype(resourcelibrary.getFixtype());
         elasticSearchTTCModel.setNewpositionaltitles(resourcelibrary.getPositionaltitles());//职位
@@ -1148,12 +1176,12 @@ public class DataEntryResourceImpl {
         elasticSearchTTCModel.setPatentcount(resourcelibrary.getPatentcount());   //发明专利数量
         elasticSearchTTCModel.setPatentforutilitycount(resourcelibrary.getPatentforutilitycount());   //实用新型数
         elasticSearchTTCModel.setPatentforsoftwarecount(resourcelibrary.getPatentforsoftwarecount());   //软件著作权数
-        // elasticSearchTTCModel.setYesteryearrevenue(resourcelibrary.getLastyearrevenue());   //上年度营业收入(做筛选时以最新更新的为准)
-        // elasticSearchTTCModel.setYesteryeardeduct(resourcelibrary.getLastyeardeductexpenses());   //上年度允许扣除的研发费用(做筛选时以最新更新的为准)
+        elasticSearchTTCModel.setYesteryearrevenue(resourcelibrary.getLastyearrevenue());   //上年度营业收入(做筛选时以最新更新的为准)
+        elasticSearchTTCModel.setYesteryeardeduct(resourcelibrary.getLastyeardeductexpenses());   //上年度允许扣除的研发费用(做筛选时以最新更新的为准)
         elasticSearchTTCModel.setHighidentificationdate(StringUtils.isNotEmpty(resourcelibrary.getHighidentificationyear()) ? Integer.valueOf(resourcelibrary.getHighidentificationyear()) : 0);   //国高最新认定年份
         elasticSearchTTCModel.setFeidiarea(resourcelibrary.getFeidiarea() != null ? resourcelibrary.getFeidiarea() : 0.00);
         elasticSearchTTCModel.setFeidipeoplecount(resourcelibrary.getFeidipeoplecount() != null ? resourcelibrary.getFeidipeoplecount() : 0);
-
+        elasticSearchTTCModel.setHighdomain(resourcelibrary.getDomain());  //国高八大领域
 
         //利用反射将税务数据存储到es中
         try{
@@ -1422,6 +1450,11 @@ public class DataEntryResourceImpl {
             companyPatentInfo.setCreatetime(new Date());
             companyPatentInfoMapper.insert(companyPatentInfo);
         } else {
+            if (CollectionUtils.isNotEmpty(patentInfos)) {
+                companyPatentInfo.setId(patentInfos.get(0).getId());
+                companyPatentInfo.setCompanyid(patentInfos.get(0).getCompanyid());
+                companyPatentInfoMapper.updateById(companyPatentInfo);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1448,6 +1481,11 @@ public class DataEntryResourceImpl {
             kunitakainfo.setCreatetime(new Date());
             kunitakainfoMapper.insert(kunitakainfo);
         } else {
+            if (CollectionUtils.isNotEmpty(kunitakainfos)) {
+                kunitakainfo.setId(kunitakainfos.get(0).getId());
+                kunitakainfo.setCompanyid(kunitakainfos.get(0).getCompanyid());
+                kunitakainfoMapper.updateAllColumnById(kunitakainfo);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1461,6 +1499,11 @@ public class DataEntryResourceImpl {
             companyProvincialEmphasis.setCreatetime(new Date());
             provincialEmphasisMapper.insert(companyProvincialEmphasis);
         } else {
+            if (CollectionUtils.isNotEmpty(companyProvincialEmphases)) {
+                companyProvincialEmphasis.setId(companyProvincialEmphases.get(0).getId());
+                companyProvincialEmphasis.setCompanyid(companyProvincialEmphases.get(0).getCompanyid());
+                provincialEmphasisMapper.updateById(companyProvincialEmphasis);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1486,6 +1529,11 @@ public class DataEntryResourceImpl {
             companyProvincial.setCreatetime(new Date());
             provincialMapper.insert(companyProvincial);
         } else {
+            if (CollectionUtils.isNotEmpty(companyProvincials)) {
+                companyProvincial.setId(companyProvincials.get(0).getId());
+                companyProvincial.setCompanyid(companyProvincials.get(0).getCompanyid());
+                provincialMapper.updateById(companyProvincial);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1512,6 +1560,11 @@ public class DataEntryResourceImpl {
             companyProvincialHighandnew.setCreatetime(new Date());
             provincialHighandnewMapper.insert(companyProvincialHighandnew);
         } else {
+            if (CollectionUtils.isNotEmpty(companyProvincialHighandnews)) {
+                companyProvincialHighandnew.setId(companyProvincialHighandnews.get(0).getId());
+                companyProvincialHighandnew.setCompanyid(companyProvincialHighandnews.get(0).getCompanyid());
+                provincialHighandnewMapper.updateById(companyProvincialHighandnew);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1539,6 +1592,11 @@ public class DataEntryResourceImpl {
             companyProvincialScienceSmall.setCreatetime(new Date());
             provincialScienceSmallMapper.insert(companyProvincialScienceSmall);
         } else {
+            if (CollectionUtils.isNotEmpty(companyProvincialScienceSmalls)) {
+                companyProvincialScienceSmall.setId(companyProvincialScienceSmalls.get(0).getId());
+                companyProvincialScienceSmall.setCompanyid(companyProvincialScienceSmalls.get(0).getCompanyid());
+                provincialScienceSmallMapper.updateById(companyProvincialScienceSmall);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1564,6 +1622,11 @@ public class DataEntryResourceImpl {
             companyEyas.setCreatetime(new Date());
             companyEyasMapper.insert(companyEyas);
         } else {
+            if (CollectionUtils.isNotEmpty(companyEyasList)) {
+                companyEyas.setId(companyEyasList.get(0).getId());
+                companyEyas.setCompanyid(companyEyasList.get(0).getCompanyid());
+                companyEyasMapper.updateById(companyEyas);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1588,6 +1651,11 @@ public class DataEntryResourceImpl {
             companyMunicipalResearch.setCreatetime(new Date());
             municipalResearchMapper.insert(companyMunicipalResearch);
         } else {
+            if (CollectionUtils.isNotEmpty(companyMunicipalResearches)) {
+                companyMunicipalResearch.setId(companyMunicipalResearches.get(0).getId());
+                companyMunicipalResearch.setCompanyid(companyMunicipalResearches.get(0).getCompanyid());
+                municipalResearchMapper.updateById(companyMunicipalResearch);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1614,6 +1682,11 @@ public class DataEntryResourceImpl {
             companyFeidi.setCreatetime(new Date());
             companyFeidiMapper.insert(companyFeidi);
         } else {
+            if (CollectionUtils.isNotEmpty(companyFeidis)) {
+                companyFeidi.setId(companyFeidis.get(0).getId());
+                companyFeidi.setCompanyid(companyFeidis.get(0).getCompanyid());
+                companyFeidiMapper.updateById(companyFeidi);
+            }
             Util.IS_HAS_SAME_ORG = true;
         }
     }
@@ -1631,6 +1704,8 @@ public class DataEntryResourceImpl {
     }
 
     public void insertCompanyYearMultipleoptionsLk(OrganizationInfo organizationInfo, String node) {
+        List<CompanyYearMultipleoptionsLk> list = new ArrayList<>();
+        List<OrganizationInfo> infos = organizationInfoMapper.selectList(new EntityWrapper<OrganizationInfo>().eq("orgcode", organizationInfo.getOrgcode()));
         if (organizationInfo.getThreeyearsrevenue() != null || organizationInfo.getThreeyeardeductexpenses() != null) {
             CompanyYearMultipleoptionsLk yearMultipleoptionsLk = new CompanyYearMultipleoptionsLk();
             yearMultipleoptionsLk.setCompanyid(organizationInfo.getId());
@@ -1640,7 +1715,11 @@ public class DataEntryResourceImpl {
             yearMultipleoptionsLk.setYvalue7(organizationInfo.getThreeyeardeductexpenses().toString());
             yearMultipleoptionsLk.setIsenabled(Constant.ONE);
             yearMultipleoptionsLk.setIssave(Constant.ONE);
-            yearMultipleoptionsLkMapper.insert(yearMultipleoptionsLk);
+            yearMultipleoptionsLk.setTaxflag("1");
+            List<CompanyYearMultipleoptionsLk> list1 = yearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>().eq("companyid", infos.get(0).getId()).eq("taxflag", "1"));
+            if (CollectionUtils.isNotEmpty(list1))
+                yearMultipleoptionsLk.setId(list1.get(0).getId());
+            list.add(yearMultipleoptionsLk);
         }
         if (organizationInfo.getTwoyearrevenue() != null || organizationInfo.getTwoyeardeductexpenses() != null) {
             CompanyYearMultipleoptionsLk yearMultipleoptionsLk = new CompanyYearMultipleoptionsLk();
@@ -1651,7 +1730,11 @@ public class DataEntryResourceImpl {
             yearMultipleoptionsLk.setYvalue7(organizationInfo.getTwoyeardeductexpenses().toString());
             yearMultipleoptionsLk.setIsenabled(Constant.ONE);
             yearMultipleoptionsLk.setIssave(Constant.ONE);
-            yearMultipleoptionsLkMapper.insert(yearMultipleoptionsLk);
+            yearMultipleoptionsLk.setTaxflag("2");
+            List<CompanyYearMultipleoptionsLk> list1 = yearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>().eq("companyid", infos.get(0).getId()).eq("taxflag", "2"));
+            if (CollectionUtils.isNotEmpty(list1))
+                yearMultipleoptionsLk.setId(list1.get(0).getId());
+            list.add(yearMultipleoptionsLk);
         }
         if (organizationInfo.getLastyearrevenue() != null || organizationInfo.getLastyeardeductexpenses() != null) {
             CompanyYearMultipleoptionsLk yearMultipleoptionsLk = new CompanyYearMultipleoptionsLk();
@@ -1662,8 +1745,14 @@ public class DataEntryResourceImpl {
             yearMultipleoptionsLk.setYvalue7(organizationInfo.getLastyeardeductexpenses().toString());
             yearMultipleoptionsLk.setIsenabled(Constant.ONE);
             yearMultipleoptionsLk.setIssave(Constant.ONE);
-            yearMultipleoptionsLkMapper.insert(yearMultipleoptionsLk);
+            yearMultipleoptionsLk.setTaxflag("3");
+            List<CompanyYearMultipleoptionsLk> list1 = yearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>().eq("companyid", infos.get(0).getId()).eq("taxflag", "3"));
+            if (CollectionUtils.isNotEmpty(list1))
+                yearMultipleoptionsLk.setId(list1.get(0).getId());
+            list.add(yearMultipleoptionsLk);
         }
+        if (CollectionUtils.isNotEmpty(list))
+            yearMultipleoptionsLkService.insertOrUpdateAllColumnBatch(list);
     }
 
     public List<YearMultipleoptionsSetup> getYear() {

+ 76 - 2
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/datatools/InterviewDataEntryServiceImpl.java

@@ -613,7 +613,7 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
 //            connectioninfoModel.setOrglogo(logo);
 //            connectioninfoModel.getOrganizationInfo().setLogo(logo);
 //        }
-        if (connectioninfoModel.getOrganizationInfo().getId() == null) {
+        if ("320117400".equals(node) && (connectioninfoModel.getOrganizationInfo().getId() == null || connectioninfoModel.getOrganizationInfo().getId() == 0)) {
             log.info("connectioninfoModel.getOrganizationInfo().getId() == null ...");
             List<OrganizationInfo> orglist = organizationInfoMapper.getOrgListByNode(connectioninfoModel.getOrganizationInfo().getName(), node);
             if (CollectionUtils.isNotEmpty(orglist)) {
@@ -621,6 +621,23 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
                 connectioninfoModel.getOrganizationInfo().setId(orglist.get(0).getId());
             }
         }
+        //判断企业是否已存在,存在将id赋值(桐庐节点)
+        if ("330122000".equals(node) && connectioninfoModel.getOrganizationInfo().getId() != null && connectioninfoModel.getOrganizationInfo().getId() == 0) {
+            Long id;
+            List<Resourcelibrary> resourcelibraries = resourcelibraryMapper.selectList(new EntityWrapper<Resourcelibrary>().eq("code",connectioninfoModel.getOrganizationInfo().getOrgcode()));
+            if (resourcelibraries.size() > 0) {
+                id = resourcelibraries.get(0).getOid();
+            } else {
+                List<OrganizationInfo> infos = organizationInfoMapper.selectList(new EntityWrapper<OrganizationInfo>().eq("orgcode", connectioninfoModel.getOrganizationInfo().getOrgcode()));
+                if (infos.size() > 0) {
+                    id = infos.get(0).getId();
+                } else {
+                    id = 0L;
+                }
+            }
+            log.info("根据社会信用代码查询企业是否存在:{}",id);
+            connectioninfoModel.getOrganizationInfo().setId(id);
+        }
         if (connectioninfoModel.getId() == null || connectioninfoModel.getId() == 0) {
             //新增对接信息
             log.info("新增对接信息...connectioninfoModel.getId() == null || connectioninfoModel.getId() == 0");
@@ -648,7 +665,17 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
                 insertSystemPicture(connectioninfoModel.getImages(), connectioninfoModel.getTablename(), user.getUserid(), connectioninfoModel.getId());
             }
             OrganizationInfo organizationInfo = connectioninfoModel.getOrganizationInfo();
+            if ("330122000".equals(node) && 1 == organizationInfo.getIskunitaka() && StringUtils.isNotBlank(organizationInfo.getHighandnewcode())) {  //在高新领域代码字段截取国高八大领域(桐庐节点)
+                String i = organizationInfo.getHighandnewcode().substring(0);
+                if (!"0".equals(i)) {
+                    organizationInfo.setHighdomain(highdomainNumberToType(i));
+                } else {
+                    i = organizationInfo.getHighandnewcode().substring(1,2);
+                    organizationInfo.setHighdomain(highdomainNumberToType(i));
+                }
+            }
             if (organizationInfo != null && organizationInfo.getId() != null && organizationInfo.getId() != Constant.ZERO) {   //修改基本信息
+                log.info("修改基本信息:{}",organizationInfo.getId());
                 update(organizationInfo, node, user.getUserid());
                 organizationInfo = organizationInfoMapper.selectById(organizationInfo.getId());//重新获取该机构,得到最完整的信息
                 ConnOrgLk connOrgLk = new ConnOrgLk();
@@ -706,13 +733,15 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
                 }
             } else if (organizationInfo != null && (organizationInfo.getId() == null || organizationInfo.getId() == Constant.ZERO)) {//新增机构
 
-                List<OrganizationInfo> orglist = organizationInfoMapper.getOrgListByNode(organizationInfo.getName(), node);
+                // List<OrganizationInfo> orglist = organizationInfoMapper.getOrgListByNode(organizationInfo.getName(), node);
+                List<OrganizationInfo> orglist = organizationInfoMapper.selectList(new EntityWrapper<OrganizationInfo>().eq("orgcode", organizationInfo.getOrgcode()));
                 Typeentry orgtypeentry = commonService.getTypeEntryByTypeNameAndTcname(Constant.TYPEENTRY_REMARK_TABLECODE, organizationInfo.getTablename());
                 Typeentry conntypeentry = commonService.getTypeEntryByTypeNameAndTcname(Constant.TYPEENTRY_REMARK_TABLECODE, connectioninfoModel.getTablename());
                 boolean isexist = true;//是否已存在资源库中
                 long resid = 0L;
                 if (orglist.size() == 0) {
                     if (user.getUserid() != null) {
+                        organizationInfo.setRegionid(Long.valueOf(connectioninfoModel.getNode()));
                         organizationInfo.setCreator(user.getUserid());
                         organizationInfo.setUpdator(user.getUserid());
                         organizationInfoMapper.insert(organizationInfo);
@@ -1962,6 +1991,19 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
             }
         }
         if (ifinorg) {
+            if ("330122000".equals(node)) {    //桐庐节点高企一件事录入相关
+                dataEntryResource.insertCompanyPatentInfo(organizationInfo, node);       //专利信息
+                dataEntryResource.insertCompanyKunitakainfo(organizationInfo, node);    //国高信息
+                dataEntryResource.insertCompanyProvincialEmphasis(organizationInfo, node);   //省级重点企业研究院信息
+                dataEntryResource.insertCompanyProvincial(organizationInfo, node);   //省级企业研究院信息
+                dataEntryResource.insertCompanyProvincialHighandnew(organizationInfo, node);   //(浙江)省高新技术研究开发中心信息
+                dataEntryResource.insertCompanyProvincialScienceSmall(organizationInfo, node);   //省科小信息
+                dataEntryResource.insertCompanyEyas(organizationInfo, node);      //雏鹰计划
+                dataEntryResource.insertcompanymunicipalresearch(organizationInfo, node);      //市级企业研发中心信息
+                dataEntryResource.isnertcompanyfeidi(organizationInfo, node);    //飞地信息
+                dataEntryResource.insertCompanyYearMultipleoptionsLk(organizationInfo,node);    //税务数据
+            }
+            organizationInfo.setRegionid(Long.valueOf(node));
             organizationInfoMapper.updateById(organizationInfo);
             Typeentry orgtypeentry = commonService.getTypeEntryByTypeNameAndTcname(Constant.TYPEENTRY_REMARK_TABLECODE, organizationInfo.getTablename());
             List<ResDtLk> dtlist = dataEntryResource.getResDtLkByOrgid(organizationInfo.getId(), orgtypeentry.getItemvalue());
@@ -6145,4 +6187,36 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
         log.info("otherinfo***:{}", JSON.toJSONString(otherinfo));
         return otherinfo;
     }
+
+    public String highdomainNumberToType(String i) {
+        String highdomain = "";
+        switch (i) {
+            case "1":
+                highdomain = "E";   //E表示电子信息
+                break;
+            case "2":
+                highdomain = "D"; //D表示生物与新医药
+                break;
+            case "3":
+                highdomain = "A";  //A表示航空航天
+                break;
+            case "4":
+                highdomain = "C";  //C表示新材料
+                break;
+            case "5":
+                highdomain = "H";  //H表示搞技术服务
+                break;
+            case "6":
+                highdomain = "B";   //B表示新能源与节能
+                break;
+            case "7":
+                highdomain = "G";  //G表示资源与环境
+                break;
+            case "8":
+                highdomain = "F";  //F表示先进制造与自动化
+                break;
+        }
+        return highdomain;
+    }
+
 }

+ 205 - 13
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/entry/EntryServiceImpl.java

@@ -35,6 +35,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.poi.xwpf.usermodel.TOC;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -281,6 +282,7 @@ public class EntryServiceImpl implements EntryService {
                     resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
                     // todo 也要做。
                     resultModel.setMessage("文件不能为空或文件类型不匹配,请上传正确类型的文件后再试!");
+                    uploadMapper.deleteById(upload.getId());
                     return resultModel;
                 } else {
                     Map<String, Object> checkMap = toCheckData(parselist, uploadParam.getFileType(), uploadParam.getNodeId());
@@ -307,6 +309,7 @@ public class EntryServiceImpl implements EntryService {
                             resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
                             // todo 也要做。
                             resultModel.setMessage("文件内容不能为空,请勿上传空文件!");
+                            uploadMapper.deleteById(upload.getId());
                             return resultModel;
                         }else {
                             resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
@@ -437,11 +440,17 @@ public class EntryServiceImpl implements EntryService {
         List<CompanyMunicipalResearch> companyMunicipalResearches = new ArrayList<>();
         //飞地在建研发中心
         List<CompanyFeidi> companyFeidis = new ArrayList<>();
+        //税务数据
+        List<List<CompanyYearMultipleoptionsLk>> years = new ArrayList<>();
+        List<CompanyYearMultipleoptionsLk> taxs = new ArrayList<>();
         if ("320117400".equals(nodeId)) {
             List<EnterpriseBasicInfoExcelDataLishui> excelDatas = JSONObject.parseArray(JSONObject.toJSONString(basicInfos), EnterpriseBasicInfoExcelDataLishui.class);
             for (EnterpriseBasicInfoExcelDataLishui excelData : excelDatas) {
                 OrganizationInfo info = new OrganizationInfo();
                 BeanUtils.copyProperties(excelData,info);
+                info.setRegionid(Long.valueOf(nodeId));
+                info.setOrgtype(10104L);
+                info.setIsenabled(1);
                 info.setCategoryname(StringUtils.isNotEmpty(excelData.getCategory()) ? excelData.getCategory() : "");
                 info.setCategoryid(StringUtils.isNotEmpty(excelData.getCategory()) ? domainNameToType(excelData.getCategory()) : "");
                 info.setPeopleengagedNum(StringUtils.isNotEmpty(excelData.getPeopleengagedNum()) ? Integer.valueOf(excelData.getPeopleengagedNum()) : 0);
@@ -457,6 +466,8 @@ public class EntryServiceImpl implements EntryService {
             for (EnterpriseBasicInfoExcelData excelData : excelDatas) {
                 OrganizationInfo info = new OrganizationInfo();
                 BeanUtils.copyProperties(excelData, info);
+                info.setRegionid(Long.valueOf(nodeId));
+                info.setIsenabled(1);
                 info.setRegistrationcapital(StringUtils.isNotBlank(excelData.getRegistrationcapital()) ? Long.valueOf(excelData.getRegistrationcapital()) : 0);
                 info.setPracticalcapital(StringUtils.isNotBlank(excelData.getPracticalcapital()) ? Float.valueOf(excelData.getPracticalcapital()) : 0);
                 info.setRegistrationdate(StringUtils.isNotBlank(excelData.getRegistrationdate()) ? DateUtils.stringToDate(excelData.getRegistrationdate()) : null);
@@ -484,11 +495,17 @@ public class EntryServiceImpl implements EntryService {
                 info.setFeidiarea(StringUtils.isNotBlank(excelData.getFeidiarea()) ? Double.valueOf(excelData.getFeidiarea()) : 0);
                 info.setWorkercount(StringUtils.isNotBlank(excelData.getWorkercount()) ? Integer.valueOf(excelData.getWorkercount()) : 0);
                 info.setHasregulationorg("是".equals(excelData.getHasregulationorg()) ? 1 : 0);
+                info.setThreeyearsrevenue(StringUtils.isNotEmpty(excelData.getThreeyearsrevenue()) ? Double.valueOf(excelData.getThreeyearsrevenue()) : 0);
+                info.setThreeyeardeductexpenses(StringUtils.isNotEmpty(excelData.getThreeyeardeductexpenses()) ? Double.valueOf(excelData.getThreeyeardeductexpenses()) : 0);
+                info.setTwoyearrevenue(StringUtils.isNotEmpty(excelData.getTwoyearrevenue()) ? Double.valueOf(excelData.getTwoyearrevenue()) : 0);
+                info.setTwoyeardeductexpenses(StringUtils.isNotEmpty(excelData.getTwoyeardeductexpenses()) ? Double.valueOf(excelData.getTwoyeardeductexpenses()) : 0);
+                info.setLastyearrevenue(StringUtils.isNotEmpty(excelData.getLastyearrevenue()) ? Double.valueOf(excelData.getLastyearrevenue()) : 0);
+                info.setLastyeardeductexpenses(StringUtils.isNotEmpty(excelData.getLastyeardeductexpenses()) ? Double.valueOf(excelData.getLastyeardeductexpenses()) : 0);
                 System.out.println("save orginfo:" + JSON.toJSONString(info));
                 System.out.println("save errorremark:" + excelData.getErrorRemark());
                 infos.add(info);
-                String claid = interviewDataEntryService.getClaid(nodeId, 0);
-                dataEntryResource.insertResourceLibrary2(info, claid, nodeId);
+                // String claid = interviewDataEntryService.getClaid(nodeId, 0);
+                // dataEntryResource.insertResourceLibrary2(info, claid, nodeId);
                 // 专利信息
                 CompanyPatentInfo companyPatentInfo = baseToPatentInfo(info, excelData, excelData.getReqId());
                 if (companyPatentInfo != null) companyPatentInfos.add(companyPatentInfo);
@@ -516,7 +533,9 @@ public class EntryServiceImpl implements EntryService {
                 //飞地在建研发中心
                 CompanyFeidi companyFeidi = baseToCompanyFeidi(info, excelData, excelData.getReqId());
                 if (companyFeidi != null) companyFeidis.add(companyFeidi);
-
+                //税务数据
+                List<CompanyYearMultipleoptionsLk> list = baseToYearMultipleoptionsLk(info, excelData, excelData.getReqId(), nodeId);
+                if (CollectionUtils.isNotEmpty(list)) years.add(list);
             }
         }
         for (int i = 0; i < infos.size(); i++) {
@@ -592,6 +611,37 @@ public class EntryServiceImpl implements EntryService {
                     companyFeidi.setId(feidis.get(0).getId());
                 }
             }
+            if (CollectionUtils.isNotEmpty(years)) {
+                List<CompanyYearMultipleoptionsLk> list = years.get(i);
+                for (CompanyYearMultipleoptionsLk tax : list) {
+                    tax.setCompanyid(infos.get(i).getId());
+                    if ("1".equals(tax.getTaxflag())) {
+                        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks1 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>()
+                                .eq("companyid", infos.get(i).getId())
+                                .eq("taxflag", "1"));
+                        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks1)) {
+                            tax.setId(yearMultipleoptionsLks1.get(0).getId());
+                        }
+                    }
+                    if ("2".equals(tax.getTaxflag())) {
+                        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks1 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>()
+                                .eq("companyid", infos.get(i).getId())
+                                .eq("taxflag", "2"));
+                        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks1)) {
+                            tax.setId(yearMultipleoptionsLks1.get(0).getId());
+                        }
+                    }
+                    if ("3".equals(tax.getTaxflag())) {
+                        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks1 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>()
+                                .eq("companyid", infos.get(i).getId())
+                                .eq("taxflag", "3"));
+                        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks1)) {
+                            tax.setId(yearMultipleoptionsLks1.get(0).getId());
+                        }
+                    }
+                    taxs.add(tax);
+                }
+            }
         }
         companyPatentInfoService.insertOrUpdateAllColumnBatch(companyPatentInfos);
         companyKunitakainfoService.insertOrUpdateAllColumnBatch(companyKunitakainfos);
@@ -602,10 +652,28 @@ public class EntryServiceImpl implements EntryService {
         companyProvincialScienceSmallService.insertOrUpdateAllColumnBatch(companyProvincialScienceSmalls);
         companyMunicipalResearchService.insertOrUpdateAllColumnBatch(companyMunicipalResearches);
         companyFeidiService.insertOrUpdateAllColumnBatch(companyFeidis);
-
+        companyYearMultipleoptionsLkService.insertOrUpdateAllColumnBatch(taxs);
         if (infos.size() > 0){
             boolean b = organizationInfoService.insertOrUpdateAllColumnBatch(infos);
             System.out.println("更新状态****---:"+b);
+            if (b) {
+                String claid = interviewDataEntryService.getClaid(nodeId, 0L);
+                System.out.println("一键导入保存es库获取claid" + claid);
+                try {
+                    System.out.println("--**--开始保存--**--");
+                    for (OrganizationInfo organizationInfo : infos) {
+                        Resourcelibrary resourcelibrary = dataEntryResource.insertResourceLibrary2(organizationInfo, claid, nodeId);
+                        if (resourcelibrary != null) {
+                            System.out.println("保存成功");
+                        }else {
+                            System.out.println("保存失败");
+                        }
+                    }
+                } catch (Exception e) {
+                    System.out.println("保存es库异常");
+                    e.printStackTrace();
+                }
+            }
             return b ? 1 : 0;
         }
         return 0;
@@ -619,7 +687,8 @@ public class EntryServiceImpl implements EntryService {
             for (CompanyTaxLkExcelData excelData : excelDatas) {
                 log.info("解析出的税务信息:info:{}", JSON.toJSONString(excelData));
                 // 根据企业名称获取对应的税务数据的id
-                List<OrganizationInfo> orgInfos = organizationInfoMapper.getOrgListByNode(excelData.getOrgname(), "330122000");
+                // List<OrganizationInfo> orgInfos = organizationInfoMapper.getOrgListByNode(excelData.getOrgname(), "330122000");
+                List<OrganizationInfo> orgInfos = organizationInfoMapper.selectList(new EntityWrapper<OrganizationInfo>().eq("name", excelData.getOrgname()).eq("orgcode", excelData.getOrgcode()));
                 Long companyid = orgInfos.size() > 0 ? orgInfos.get(0).getId() : 0L;
                 if (orgInfos.size() < 0) {
                     System.out.println("未找到企业,请检查是否修改企业名称");
@@ -1464,6 +1533,12 @@ public class EntryServiceImpl implements EntryService {
                     excelData.setFeidiarea(orginfo.getFeidiarea() != null ? String.valueOf(orginfo.getFeidiarea()) : "");
                     excelData.setWorkercount(orginfo.getWorkercount() != null ? String.valueOf(orginfo.getWorkercount()) : "");
                     excelData.setHasregulationorg(orginfo.getHasregulationorg() == 1 ? "是" : "否");
+                    excelData.setThreeyearsrevenue(orginfo.getThreeyearsrevenue() != null ? String.valueOf(orginfo.getThreeyearsrevenue()) : "");
+                    excelData.setThreeyeardeductexpenses(orginfo.getThreeyeardeductexpenses() != null ? String.valueOf(orginfo.getThreeyeardeductexpenses()) : "");
+                    excelData.setTwoyearrevenue(orginfo.getTwoyearrevenue() != null ? String.valueOf(orginfo.getTwoyearrevenue()) : "");
+                    excelData.setTwoyeardeductexpenses(orginfo.getTwoyeardeductexpenses() != null ? String.valueOf(orginfo.getTwoyeardeductexpenses()) : "");
+                    excelData.setLastyearrevenue(orginfo.getLastyearrevenue() != null ? String.valueOf(orginfo.getLastyearrevenue()) : "");
+                    excelData.setLastyeardeductexpenses(orginfo.getLastyeardeductexpenses() != null ? String.valueOf(orginfo.getLastyeardeductexpenses()) : "");
                     System.err.println("getRdinstitutionname:" + orginfo.getRdinstitutionname());
 
                     return excelData;
@@ -1524,6 +1599,7 @@ public class EntryServiceImpl implements EntryService {
             BeanUtils.copyProperties(taxinfo, taxExcelData);
             OrganizationInfo orgInfo = selOrgInfoById(taxinfo.getCompanyid());
             taxExcelData.setOrgname(null != orgInfo ? orgInfo.getName() : "");
+            taxExcelData.setOrgcode(null != orgInfo ? orgInfo.getOrgcode() : "");
             for (CompanyYearMultipleoptionsLk selList : selLists) {
                 if ("1".equals(selList.getTaxflag())) {
                     taxExcelData.setThreeyearsrevenue(StringUtils.isNotEmpty(selList.getYvalue6()) ? selList.getYvalue6() : "");
@@ -2314,7 +2390,10 @@ public class EntryServiceImpl implements EntryService {
         List<CompanyMunicipalResearch> companyMunicipalResearches = new ArrayList<>();
         //飞地在建研发中心
         List<CompanyFeidi> companyFeidis = new ArrayList<>();
+        //税务数据
+        List<List<CompanyYearMultipleoptionsLk>> yearMultipleoptionsLks = new ArrayList();
         List<String> errors = new ArrayList<>();
+        List<CompanyYearMultipleoptionsLk> list = new ArrayList<>();
         for (EnterpriseBasicInfoExcelData excelData : datas) {
             // JSONObject json = baseToOrgInfo(excelData,nodeId,errors);
             // 企业基本信息转OrganizationInfo
@@ -2352,7 +2431,9 @@ public class EntryServiceImpl implements EntryService {
             //飞地在建研发中心
             CompanyFeidi companyFeidi = baseToCompanyFeidi(info, excelData, reqId);
             if (companyFeidi != null) companyFeidis.add(companyFeidi);
-
+            //税务数据
+            List<CompanyYearMultipleoptionsLk> years = baseToYearMultipleoptionsLk(info, excelData, reqId, nodeId);
+            yearMultipleoptionsLks.add(years);
             // 过滤掉表头。
             infos = infos.stream().filter(a -> !a.getName().contains("企业名称")).collect(Collectors.toList());
             System.err.println("filter:" + JSON.toJSONString(infos));
@@ -2446,6 +2527,38 @@ public class EntryServiceImpl implements EntryService {
                     companyFeidi.setId(feidis.get(0).getId());
                 }
             }
+            if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks)) {
+                List<CompanyYearMultipleoptionsLk> taxs = yearMultipleoptionsLks.get(i);
+                for (CompanyYearMultipleoptionsLk tax : taxs) {
+                    tax.setCompanyid(infos.get(i).getId());
+                    if ("1".equals(tax.getTaxflag())) {
+                        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks1 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>()
+                                .eq("companyid", infos.get(i).getId())
+                                .eq("taxflag", "1"));
+                        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks1)) {
+                            tax.setId(yearMultipleoptionsLks1.get(0).getId());
+                        }
+                    }
+                    if ("2".equals(tax.getTaxflag())) {
+                        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks1 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>()
+                                .eq("companyid", infos.get(i).getId())
+                                .eq("taxflag", "2"));
+                        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks1)) {
+                            tax.setId(yearMultipleoptionsLks1.get(0).getId());
+                        }
+                    }
+                    if ("3".equals(tax.getTaxflag())) {
+                        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks1 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>()
+                                .eq("companyid", infos.get(i).getId())
+                                .eq("taxflag", "3"));
+                        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks1)) {
+                            tax.setId(yearMultipleoptionsLks1.get(0).getId());
+                        }
+                    }
+                    list.add(tax);
+                }
+
+            }
 
             // 初始化节点与公司关联列表。
             companyNodeLks.add(toCompanyNodeLk(infos.get(i), nodeId));
@@ -2459,8 +2572,9 @@ public class EntryServiceImpl implements EntryService {
         companyProvincialScienceSmallService.insertOrUpdateAllColumnBatch(companyProvincialScienceSmalls);
         companyMunicipalResearchService.insertOrUpdateAllColumnBatch(companyMunicipalResearches);
         companyFeidiService.insertOrUpdateAllColumnBatch(companyFeidis);
+        companyYearMultipleoptionsLkService.insertOrUpdateAllColumnBatch(list);
         // 插入节点与公司关联表。
-        companyNodeLkService.insertBatch(companyNodeLks);
+        companyNodeLkService.insertOrUpdateAllColumnBatch(companyNodeLks);
         // upload表更新错误数据字段。
         savedUploadByReqId(reqId, JSON.toJSONString(errors));
 
@@ -2586,7 +2700,8 @@ public class EntryServiceImpl implements EntryService {
         CompanyYearMultipleoptionsLk info;
         List<CompanyYearMultipleoptionsLk> infos = new ArrayList<>();
         for (CompanyTaxLkExcelData excelData : datas) {
-            List<OrganizationInfo> orgInfos = organizationInfoMapper.getOrgListByNode(excelData.getOrgname(), nodeId);
+            // List<OrganizationInfo> orgInfos = organizationInfoMapper.getOrgListByNode(excelData.getOrgname(), nodeId);
+            List<OrganizationInfo> orgInfos = organizationInfoMapper.selectList(new EntityWrapper<OrganizationInfo>().eq("name", excelData.getOrgname()).eq("orgcode", excelData.getOrgcode()));
             Long companyid = orgInfos.size() > 0 ? orgInfos.get(0).getId() : 0L;
             CompanyYearMultipleoptionsLk year = CompanyYearMultipleoptionsLk.builder()
                     .companyid(companyid)
@@ -4450,6 +4565,8 @@ public class EntryServiceImpl implements EntryService {
                 .creator(2865L)
                 .serialnum(1)
                 .build();
+        List<CompanyNodeLk> companyNodeLks = companyNodeLkService.selectList(new EntityWrapper<CompanyNodeLk>().eq("companyid", info.getId()).eq("comefrom", nodeId));
+        if (CollectionUtils.isNotEmpty(companyNodeLks)) companyNodeLk.setId(companyNodeLks.get(0).getId());
         return companyNodeLk;
     }
 
@@ -4465,12 +4582,12 @@ public class EntryServiceImpl implements EntryService {
         // public JSONObject baseToOrgInfo(EnterpriseBasicInfoExcelData excelData, String nodeId, List<String> errors) throws ParseException {
         OrganizationInfo info = new OrganizationInfo();
         BeanUtils.copyProperties(excelData, info);
-        List<OrganizationInfo> infos = organizationInfoMapper.selectList(new EntityWrapper<OrganizationInfo>().eq("name", excelData.getName()).eq("regionid", nodeId));
+        List<OrganizationInfo> infos = organizationInfoMapper.selectList(new EntityWrapper<OrganizationInfo>().eq("orgcode",excelData.getOrgcode()));
         if (CollectionUtils.isNotEmpty(infos)) {   //高企一件事需求,对已有数据导入时进行修改操作
             info.setId(infos.get(0).getId());
         }
         List<LabelIntelligentCommonInfo> commonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", excelData.getCategoryname()));
-        info.setCategoryid(commonInfos.get(0).getCode());
+        info.setCategoryid(CollectionUtils.isNotEmpty(commonInfos) ? commonInfos.get(0).getCode() : "");
         info.setRegistrationcapital(StringUtils.isNotEmpty(excelData.getRegistrationcapital()) ? Long.valueOf(excelData.getRegistrationcapital()) : null);
         info.setPracticalcapital(StringUtils.isNotEmpty(excelData.getPracticalcapital()) ? Float.valueOf(excelData.getPracticalcapital()) : null);
         info.setRegistrationdate(StringUtils.isNotEmpty(excelData.getRegistrationdate()) ? DateUtils.stringToDate(excelData.getRegistrationdate()) : null);
@@ -4481,6 +4598,15 @@ public class EntryServiceImpl implements EntryService {
         info.setPatentforutilitycount(StringUtils.isNotEmpty(excelData.getPatentforutilitycount()) ? Integer.valueOf(excelData.getPatentforutilitycount()) : null);
         info.setPatentforsoftwarecount(StringUtils.isNotEmpty(excelData.getPatentforsoftwarecount()) ? Integer.valueOf(excelData.getPatentforsoftwarecount()) : null);
         info.setIskunitaka(StringUtils.isNotEmpty(excelData.getIskunitaka()) ? (excelData.getIskunitaka().equals("是") ? 1 : 0) : 0);
+        if (info.getIskunitaka() == 1 && StringUtils.isNotBlank(info.getHighandnewcode())) {  //在高新领域代码字段截取国高八大领域
+            String i = info.getHighandnewcode().substring(0);
+            if (!"0".equals(i)) {
+                info.setHighdomain(interviewDataEntryService.highdomainNumberToType(i));
+            } else {
+                i = info.getHighandnewcode().substring(1,2);
+                info.setHighdomain(interviewDataEntryService.highdomainNumberToType(i));
+            }
+        }
         info.setIsprovincialemphasisenterprise(StringUtils.isNotEmpty(excelData.getIsprovincialemphasisenterprise()) ? (excelData.getIsprovincialemphasisenterprise().equals("是") ? 1 : 0) : 0);
         info.setEmphasisdate(StringUtils.isNotEmpty(excelData.getEmphasisdate()) ? DateUtils.stringToDate(excelData.getEmphasisdate()) : null);
         info.setIsprovincialenterprise(StringUtils.isNotEmpty(excelData.getIsprovincialenterprise()) ? (excelData.getIsprovincialenterprise().equals("是")) ? 1 : 0 : 0);
@@ -4499,6 +4625,12 @@ public class EntryServiceImpl implements EntryService {
         info.setWorkercount(StringUtils.isNotEmpty(excelData.getWorkercount()) ? Integer.valueOf(excelData.getWorkercount()) : null);
         info.setHasregulationorg(StringUtils.isNotEmpty(excelData.getHasregulationorg()) ? (excelData.getHasregulationorg().equals("是") ? 1 : 0) : 0);
         info.setRegionid(Long.valueOf(nodeId));
+        info.setThreeyearsrevenue(StringUtils.isNotEmpty(excelData.getThreeyearsrevenue()) ? Double.valueOf(excelData.getThreeyearsrevenue()) : 0);
+        info.setThreeyeardeductexpenses(StringUtils.isNotEmpty(excelData.getThreeyeardeductexpenses()) ? Double.valueOf(excelData.getThreeyeardeductexpenses()) : 0);
+        info.setTwoyearrevenue(StringUtils.isNotEmpty(excelData.getTwoyearrevenue()) ? Double.valueOf(excelData.getTwoyearrevenue()) : 0);
+        info.setTwoyeardeductexpenses(StringUtils.isNotEmpty(excelData.getTwoyeardeductexpenses()) ? Double.valueOf(excelData.getTwoyeardeductexpenses()) : 0);
+        info.setLastyearrevenue(StringUtils.isNotEmpty(excelData.getLastyearrevenue()) ? Double.valueOf(excelData.getLastyearrevenue()) : 0);
+        info.setLastyeardeductexpenses(StringUtils.isNotEmpty(excelData.getLastyeardeductexpenses()) ? Double.valueOf(excelData.getLastyeardeductexpenses()) : 0);
         info.setIsenabled(1);
         info.setOperateorg(0L);
         info.setPeopleengagedNum(0);
@@ -4583,9 +4715,9 @@ public class EntryServiceImpl implements EntryService {
     public CompanyPatentInfo baseToPatentInfo(OrganizationInfo info, EnterpriseBasicInfoExcelData excelData, String reqId) {
         CompanyPatentInfo companyPatentInfo = CompanyPatentInfo.builder()
                 .companyid(info.getId())
-                .patentcount(excelData.getPatentcount() != null ? Integer.valueOf(excelData.getPatentcount()) : 0)
-                .patentforutilitycount(excelData.getPatentforutilitycount() != null ? Integer.valueOf(excelData.getPatentforutilitycount()) : 0)
-                .patentforsoftwarecount(excelData.getPatentforsoftwarecount() != null ? Integer.valueOf(excelData.getPatentforsoftwarecount()) : 0)
+                .patentcount(info.getPatentcount() != null ? Integer.valueOf(info.getPatentcount()) : 0)
+                .patentforutilitycount(info.getPatentforutilitycount() != null ? Integer.valueOf(info.getPatentforutilitycount()) : 0)
+                .patentforsoftwarecount(info.getPatentforsoftwarecount() != null ? Integer.valueOf(info.getPatentforsoftwarecount()) : 0)
                 .node("330122000")
                 .isenabled(Constant.ONE)
                 .reqid(reqId)
@@ -4678,6 +4810,66 @@ public class EntryServiceImpl implements EntryService {
                 .build();
         return companyFeidi;
     }
+    public List<CompanyYearMultipleoptionsLk> baseToYearMultipleoptionsLk(OrganizationInfo info, EnterpriseBasicInfoExcelData excelData, String reqId, String nodeId) {
+        List<CompanyYearMultipleoptionsLk> list = new ArrayList();
+        CompanyYearMultipleoptionsLk yearMultipleoptionsLk = CompanyYearMultipleoptionsLk.builder()
+                .companyid(info.getId())
+                .linktype(30030)
+                .yid(dataEntryResource.getYear().get(0).getId())
+                .yvalue6(info.getThreeyearsrevenue() != null ? info.getThreeyearsrevenue().toString() : "")
+                .yvalue7(info.getThreeyeardeductexpenses() != null ? info.getThreeyeardeductexpenses().toString() : "")
+                .isenabled(1)
+                .issave(1)
+                .sourcetype(1)
+                .taxflag("1")
+                .reqId(reqId)
+                .build();
+        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>().eq("companyid", info.getId()).eq("taxflag", "1"));
+        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks)) {
+            yearMultipleoptionsLk.setId(yearMultipleoptionsLks.get(0).getId());
+            yearMultipleoptionsLk.setYid(dataEntryResource.getYear().get(0).getId());
+        }
+        list.add(yearMultipleoptionsLk);
+
+        CompanyYearMultipleoptionsLk yearMultipleoptionsLk1 = CompanyYearMultipleoptionsLk.builder()
+                .companyid(info.getId())
+                .linktype(30030)
+                .yid(dataEntryResource.getYear().get(1).getId())
+                .yvalue6(info.getTwoyearrevenue() != null ? info.getTwoyearrevenue().toString() : "")
+                .yvalue7(info.getTwoyeardeductexpenses() != null ? info.getTwoyeardeductexpenses().toString() : "")
+                .isenabled(1)
+                .issave(1)
+                .sourcetype(1)
+                .taxflag("2")
+                .reqId(reqId)
+                .build();
+        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks1 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>().eq("companyid", info.getId()).eq("taxflag", "2"));
+        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks1)) {
+            yearMultipleoptionsLk1.setId(yearMultipleoptionsLks1.get(0).getId());
+            yearMultipleoptionsLk.setYid(dataEntryResource.getYear().get(0).getId());
+        }
+        list.add(yearMultipleoptionsLk1);
+
+        CompanyYearMultipleoptionsLk yearMultipleoptionsLk2 = CompanyYearMultipleoptionsLk.builder()
+                .companyid(info.getId())
+                .linktype(30030)
+                .yid(dataEntryResource.getYear().get(2).getId())
+                .yvalue6(info.getLastyearrevenue() != null ? info.getLastyearrevenue().toString() : "")
+                .yvalue7(info.getLastyeardeductexpenses() != null ? info.getLastyeardeductexpenses().toString() : "")
+                .isenabled(1)
+                .issave(1)
+                .sourcetype(1)
+                .taxflag("3")
+                .reqId(reqId)
+                .build();
+        List<CompanyYearMultipleoptionsLk> yearMultipleoptionsLks2 = companyYearMultipleoptionsLkMapper.selectList(new EntityWrapper<CompanyYearMultipleoptionsLk>().eq("companyid", info.getId()).eq("taxflag", "3"));
+        if (CollectionUtils.isNotEmpty(yearMultipleoptionsLks2)) {
+            yearMultipleoptionsLk2.setId(yearMultipleoptionsLks2.get(0).getId());
+            yearMultipleoptionsLk2.setYid(dataEntryResource.getYear().get(0).getId());
+        }
+        list.add(yearMultipleoptionsLk2);
+        return list;
+    }
 
     //初始化主导产品信息(溧水节点)
     public List<CompanyProductLk> baseToProductLishui(OrganizationInfo info, EnterpriseBasicInfoExcelDataLishui excelData, String reqId) {

+ 7 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/index/IndexServiceImpl.java

@@ -259,4 +259,11 @@ public class IndexServiceImpl {
         return newAdlist;
     }
 
+    public List<MenusSetting> inspectList(String node, Integer restype) {
+        return menusSettingMapper.selectList(new EntityWrapper<MenusSetting>()
+                .eq("node",node)
+                .eq("restype",restype)
+                .orderBy("sort",true));
+    }
+
 }

+ 39 - 10
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/label/LabelCommonService.java

@@ -7,6 +7,7 @@ import cn.ubitech.ttc.entity.*;
 import cn.ubitech.ttc.model.common.Constant;
 import cn.ubitech.ttc.model.common.ElasticSearchTTCModel;
 import cn.ubitech.ttc.model.label.*;
+import cn.ubitech.ttc.repository.ResourceRepository;
 import cn.ubitech.ttc.service.impl.datatools.InterviewDataEntryServiceImpl;
 import cn.ubitech.ttc.service.impl.resource.ResourceLibraryServiceImpl;
 import cn.ubitech.ttc.service.impl.resourceChoice.ResouceChoiceServiceImpl;
@@ -23,10 +24,7 @@ import org.elasticsearch.index.query.QueryBuilders;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
-import org.springframework.data.elasticsearch.core.query.DeleteQuery;
-import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
-import org.springframework.data.elasticsearch.core.query.SearchQuery;
-import org.springframework.data.elasticsearch.core.query.UpdateQuery;
+import org.springframework.data.elasticsearch.core.query.*;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -76,6 +74,8 @@ public class LabelCommonService {
     private SearchServiceImpl searchService;
     @Autowired
     private ResourceLibraryServiceImpl resourceLibraryService;
+    @Autowired
+    private ResourceRepository resourceRepository;
     /**
      * 点击标签,展示拥有相同标签的信息
      *
@@ -194,6 +194,20 @@ public class LabelCommonService {
             }
         }
 
+        //桐庐节点单独做处理()  todo lys
+        if (330122000L == node) {
+            Resourcelibrary resourcelibrary = resourcelibraryMapper.selectById(resid);
+            if (resourcelibrary != null) {
+                long snowflakeid = resourcelibrary.getSnowflakeid();
+                ElasticSearchTTCModel elasticSearchTTCModel = resourceRepository.findOne(snowflakeid);
+                if (StringUtils.isNotEmpty(elasticSearchTTCModel.getBy7())) {
+                    elasticSearchTTCModel.setKeyword1(elasticSearchTTCModel.getKeyword1() + "," + labelName);
+                } else {
+                    elasticSearchTTCModel.setKeyword1(labelName);
+                }
+                resourceRepository.save(elasticSearchTTCModel);
+            }
+        }
         //标签添加功能中,如果是行业标签信息,则需要修改对应的资源库及索引库数据
         List<LabelIntelligentCommonInfo> labelIntelligentCommonInfoList2 = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>()
                 .eq("node", node)
@@ -338,14 +352,20 @@ public class LabelCommonService {
             //更新资源库
             Resourcelibrary resourcelibrary = resourcelibraryMapper.selectById(resid);
             if (resourcelibrary != null && resourcelibrary.getId() != 0L) {
-                resourcelibrary.setPositionaltitles(code3);
+                String positionaltitles = "";
+                if (StringUtils.isNotBlank(resourcelibrary.getPositionaltitles())) {
+                    positionaltitles = resourcelibrary.getPositionaltitles() + "," + code3;
+                } else {
+                    positionaltitles = code3;
+                }
+                resourcelibrary.setPositionaltitles(positionaltitles);
 
                 // positionaltitles不为空才更新资源库,跟新索引库
                 if (resourcelibrary.getPositionaltitles() != null) {
                     resourcelibraryMapper.updateById(resourcelibrary);
 
                     // 更新索引库的数据
-                    updateEs(resid,code3,"positionaltitles");
+                    updateEs(resid,positionaltitles,"by6");
                 }
             }
         }
@@ -645,11 +665,20 @@ public class LabelCommonService {
 
                         //标签删除功能中,如果是职称标签信息,则需要修改对应的资源库及索引库
                         if ("positionaltitles".equals(by1)) {
-                            if (code.equals(resourcelibrary.getPositionaltitles())) {
-                                resourcelibrary.setPositionaltitles("");
-                                resourcelibraryMapper.updateById(resourcelibrary);
-                                updateEs(resid,null,"positionaltitles");
+                            String positionaltitles = resourcelibrary.getPositionaltitles();
+                            List<String> list = Arrays.asList(positionaltitles.split(","));
+                            ArrayList<String> codes = new ArrayList<>(list);
+                            String newcode = "";
+                            if (codes.contains(code)) {
+                                codes.remove(code);
                             }
+                            if (codes.size() > 0) {
+                                newcode = codes.toString().substring(1, codes.toString().length() - 1).replace(" ", "");
+                            }
+                            resourcelibrary.setPositionaltitles(newcode);
+                            resourcelibraryMapper.updateById(resourcelibrary);
+                            updateEs(resid,newcode,"by6");
+
                         }
 
                         //标签删除功能中,如果是学历标签信息,则需要修改对应的资源库及索引库

+ 25 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/mybaits/OrganizationInfoServiceImpl.java

@@ -5,6 +5,7 @@ import cn.ubitech.ttc.common.Util;
 import cn.ubitech.ttc.dao.*;
 import cn.ubitech.ttc.entity.*;
 import cn.ubitech.ttc.model.common.Constant;
+import cn.ubitech.ttc.model.common.PageModel;
 import cn.ubitech.ttc.model.organization.OrganizationModel;
 import cn.ubitech.ttc.service.impl.common.CommonServiceImpl;
 import cn.ubitech.ttc.service.impl.datatools.DataEntryResourceImpl;
@@ -58,6 +59,8 @@ public class OrganizationInfoServiceImpl extends ServiceImpl<OrganizationInfoMap
     private ResourceServiceImpl resourceServiceImpl;
     @Autowired
     private RedisHelper redisHelper;
+    @Autowired
+    private InspectionMunicipalMapper municipalMapper;
 
     /**
      * 根据orgid获取对应的机构信息
@@ -265,4 +268,26 @@ public class OrganizationInfoServiceImpl extends ServiceImpl<OrganizationInfoMap
         String orgInfo = redisHelper.get(String.valueOf(connid));
         return orgInfo;
     }
+
+
+
+
+
+
+
+    //获取培育库列表
+    public List inspectOrgList(PageModel pageModel, Integer restype, Integer node, String sortkey, String orgname, String lablename, Integer pagenum) {
+        switch (restype) {
+            case 3:
+                return municipalInspectList(pageModel, node, sortkey, orgname, lablename, pagenum);
+        }
+        return null;
+    }
+
+    private List<InspectionMunicipal> municipalInspectList(PageModel pageModel, Integer node, String sortkey, String orgname, String lablename, Integer pagenum) {
+        Page<Object> page = new Page<>(pageModel.getStartIndex(), pageModel.getPageSize());
+        String[] split = sortkey.split(",");
+        List<OrganizationInfo> orgList = organizationInfoMapper.getInspectMunicipalOrgList(split[0], split[1], "%" + orgname + "%", lablename);
+        return null;
+    }
 }

+ 27 - 19
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/resource/ElasticSearchServiceImpl.java

@@ -21,6 +21,7 @@ import org.elasticsearch.search.highlight.HighlightBuilder.Field;
 import org.springframework.stereotype.Service;
 
 import java.lang.reflect.Method;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -470,6 +471,13 @@ public class ElasticSearchServiceImpl {
                 String[] split = feidiarea.split(",");
                 bqb.must(QueryBuilders.rangeQuery("feidiarea").gte(Double.valueOf(split[0])).lte(Double.valueOf(split[1])));
             }
+
+            String customLable = jsonObject.getString("customLable");
+            log.info("自定义标签:{}",customLable);
+            if (StringUtils.isNotEmpty(customLable)) {
+                bqb.minimumShouldMatch("20%");
+                bqb.must(QueryBuilders.wildcardQuery("keyword1","*" + customLable + "*"));
+            }
         }
     }
 
@@ -482,13 +490,12 @@ public class ElasticSearchServiceImpl {
             switch (potentiallibrary) {
                 case Constant.ONE :   //潜力库国高筛选条件
                     log.info("当今年份:{}",i);
-                    Script script2 = new Script("doc['highidentificationdate'].value + 3 >=" + i);   //国高三年到期
-                    Script script3 = new Script("doc['" + "deductexpenses " + (i - 1) + "'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");   //上年度加计扣除 / 允许扣除的研发费用 > 3%
+                    Script script2 = new Script("doc['highidentificationdate'].value + 3 <" + i);   //国高三年到期
+                    Script script3 = new Script("doc['" + "deductexpenses" + (i - 1) + "'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");   //上年度加计扣除 / 允许扣除的研发费用 > 3%
                     ScriptQueryBuilder scriptQueryBuilder2 = QueryBuilders.scriptQuery(script2);
                     ScriptQueryBuilder scriptQueryBuilder3 = QueryBuilders.scriptQuery(script3);
-                    bqb.must(scriptQueryBuilder2);
+                    bqb.must(QueryBuilders.boolQuery().should(scriptQueryBuilder2).should(QueryBuilders.boolQuery().mustNot(QueryBuilders.termQuery("status",8301))));//非国高或国高三年到期
                     bqb.must(scriptQueryBuilder3);
-                    bqb.mustNot(QueryBuilders.termQuery("status",8301));  //非国高
                     bqb.must(QueryBuilders.rangeQuery("revenue" + (i - 1)).gt(300));  //上年度营收>300万元
                     bqb.must(QueryBuilders.rangeQuery("patentcount").gt(0));   //发明专利数量 > 0
                     break;
@@ -508,19 +515,19 @@ public class ElasticSearchServiceImpl {
                     instance.add(Calendar.YEAR,-6);
                     log.info("当前时间:{}",now);
                     log.info("当前时间减去6年:{}",DateUtils.dateToString(instance.getTime()));
-                    bqb.must(QueryBuilders.rangeQuery("registrationdate").lte(now.getTime()).gte(instance.getTime().getTime()));   //成立年限小于6年
+                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
+                    bqb.must(QueryBuilders.rangeQuery("registrationdate").from(simpleDateFormat.format(instance.getTime())).to(simpleDateFormat.format(now)));   //成立年限小于6年
                     Script script5 = new Script("doc['patentcount'].value + doc['patentforutilitycount'].value + doc['patentforsoftwarecount'].value > 1");   //发明专利数 + 实用新型数 + 软件著作权数  > 1
                     ScriptQueryBuilder scriptQueryBuilder5 = QueryBuilders.scriptQuery(script5);
                     bqb.must(scriptQueryBuilder5);
-                    bqb.must(QueryBuilders.rangeQuery("deductexpenses").gt(30));   //上年度允许扣除的研发费用
-                    Script script6 = new Script("doc['" + "deudctexpenses" + (i - 1) + "'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");   //上年度加计扣除 / 上年度营收 > 3%
+                    bqb.must(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(30));   //上年度允许扣除的研发费用
+                    Script script6 = new Script("doc['" + "deductexpenses" + (i - 1) + "'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");   //上年度加计扣除 / 上年度营收 > 3%
                     ScriptQueryBuilder scriptQueryBuilder6 = QueryBuilders.scriptQuery(script6);
                     bqb.must(scriptQueryBuilder6);
                     break;
                 case Constant.FOUR:    //市级研发中心
                     //国高或省科小
-                    bqb.should(QueryBuilders.termQuery("status",8301));
-                    bqb.should(QueryBuilders.termQuery("status",3839));
+                    bqb.must(QueryBuilders.boolQuery().should(QueryBuilders.termQuery("status",8301)).should(QueryBuilders.termQuery("status",3839)));
                     //非市级研发中心
                     bqb.mustNot(QueryBuilders.termQuery("status",3841));
                     //上年度允许扣除的研发费用  > 150万元
@@ -528,7 +535,7 @@ public class ElasticSearchServiceImpl {
                     break;
                 case Constant.FIVE:   //省级研发中心
                     bqb.must(QueryBuilders.termQuery("status",8301));   //国高
-                    bqb.must(QueryBuilders.termQuery("status",3834));   //市级研发中心
+                    bqb.must(QueryBuilders.termQuery("status",3841));   //市级研发中心
                     bqb.mustNot(QueryBuilders.termQuery("status",3838));    //非省级研发中心
                     //发明专利 >1 || 实用新型数 + 软件著作权数 > 6
                     Script script8 = new Script("doc['patentforutilitycount'].value + doc['patentforsoftwarecount'].value > 6");
@@ -551,27 +558,28 @@ public class ElasticSearchServiceImpl {
                     BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
                     Script script10 = new Script("doc['"+ "deductexpenses" + (i - 1) +"'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");
                     ScriptQueryBuilder scriptQueryBuilder10 = QueryBuilders.scriptQuery(script10);
-                    b2.should(boolQueryBuilder.must(QueryBuilders.rangeQuery("revenue" + (i - 1)).gte(5000).lt(20000)).must(scriptQueryBuilder10));
-                    b2.should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(225));
+                    // b2.should(boolQueryBuilder.must(QueryBuilders.rangeQuery("revenue" + (i - 1)).gte(5000).lt(20000)).must(scriptQueryBuilder10));
+                    // b2.should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(225));
+                    b2.must(QueryBuilders.rangeQuery("revenue" + (i - 1)).gte(5000).lt(20000)).must(QueryBuilders.boolQuery().should(scriptQueryBuilder10).should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(225)));
 
                     //(上年度营收 >= 2亿元 && 上年度加计扣除 / 上年度营收 > 2%) || 上年度加计扣除>750万
                     Script script11 = new Script("doc['" + "deductexpenses" + (i - 1) + "'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");
                     ScriptQueryBuilder scriptQueryBuilder11 = QueryBuilders.scriptQuery(script11);
                     BoolQueryBuilder boolQueryBuilder1 = new BoolQueryBuilder();
-                    b3.should(boolQueryBuilder1.must(QueryBuilders.rangeQuery("revenue" + (i -1)).gte(20000)).must(scriptQueryBuilder11));
-                    b3.should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(750));
+                    // b3.should(boolQueryBuilder1.must(QueryBuilders.rangeQuery("revenue" + (i -1)).gte(20000)).must(scriptQueryBuilder11));
+                    // b3.should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(750));
+                    b3.must(QueryBuilders.rangeQuery("revenue" + (i - 1)).gte(20000)).should(scriptQueryBuilder11).should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(750));
 
                     bqb.must(b4.should(b1).should(b2).should(b3));
                     break;
                 case Constant.SIX:   //省级研究院
                     bqb.must(QueryBuilders.termQuery("status",3838));   //省级研发中心
-                    Long[] longs = new Long[]{3836L,3837L};
-                    bqb.mustNot(QueryBuilders.termsQuery("status",longs));   //非省级研究院和非省级重点研究院
+                    bqb.mustNot(QueryBuilders.termQuery("status",3837)); //非省级研究院
                     bqb.must(QueryBuilders.rangeQuery("revenue" + (i - 1)).gt(10000));    //上年度营收大于  >  1亿元(es已万元为单位)
-                    Script script7 = new Script("doc['" + "deductexpenses" + (i - 1) + "'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");   //上年度加计扣除 / 允许扣除的研发费用 > 3%
+
+                    Script script7 = new Script("doc['" + "deductexpenses" + (i - 1) + "'].value / doc['" + "revenue" + (i - 1) + "'].value > 0.03");   //
                     ScriptQueryBuilder scriptQueryBuilder = QueryBuilders.scriptQuery(script7);
-                    bqb.should(scriptQueryBuilder);
-                    bqb.should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(900));    //上年度加计扣除  > 900万元(与上一条件为或关系)
+                    bqb.must(QueryBuilders.boolQuery().should(scriptQueryBuilder).should(QueryBuilders.rangeQuery("deductexpenses" + (i - 1)).gt(900)));//上年度加计扣除 / 允许扣除的研发费用 > 3% 或 上年度加计扣除  > 900万元(与上一条件为或关系)
                     bqb.must(QueryBuilders.rangeQuery("patentcount").gt(2));   //发明专利  > 2
                     break;
                 case Constant.SEVEN:  //飞地研发中心(注:区分已在建飞地研发中心)

+ 7 - 6
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/resource/ResourceLibraryServiceImpl.java

@@ -38,6 +38,7 @@ import org.elasticsearch.common.xcontent.XContentFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
 import org.springframework.data.elasticsearch.core.query.UpdateQuery;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
@@ -587,7 +588,7 @@ public class ResourceLibraryServiceImpl {
         for (int i = 0; i < count; i++) {
             if (exportIndexModel.getIndexMapList().get(i).getSecondPageSettingList().size() > 0) {
                 indexMapList.add(exportIndexModel.getIndexMapList().get(i));
-                if ("基本信息".equals(exportIndexModel.getIndexMapList().get(i).getTitle())) {
+                if ("工商注册信息".equals(exportIndexModel.getIndexMapList().get(i).getTitle())) {
                     basicFlag = true;
                 } else {
                     otherFlag = true;
@@ -627,19 +628,19 @@ public class ResourceLibraryServiceImpl {
             for (int i = 1; i <= uniqueList.size(); i++) {
                 List<InfoSectionModel> basicInfoSectionList = new ArrayList<>();
                 List<InfoSectionModel> infoSectionList = new ArrayList<>();
-                if (basicFlag == true &&  indexMapTitle.equals("基本信息")) {
+                if (basicFlag == true &&  indexMapTitle.equals("工商注册信息")) {
                     basicInfoSectionList = resourceServiceImpl.getResourceDetail(Long.valueOf(uniqueList.get(i - 1)), requestModel.getUserid(), requestModel.getNode(), 1000001, 0).getInfoSectionList();
                     basicInfoSectionList.forEach(l -> {
                         infoSectionList.add(l);
                     });
                 }
-                if (otherFlag == true &&  !indexMapTitle.equals("基本信息")) {
+                if (otherFlag == true &&  !indexMapTitle.equals("工商注册信息")) {
                     List<InfoSectionModel> otherInfoSectionList = resourceServiceImpl.getResourceOtherDetail(Long.valueOf(uniqueList.get(i - 1)), requestModel.getUserid(), requestModel.getNode(), 1000001, 0, true).getInfoSectionList();
                     otherInfoSectionList.forEach(l -> {
                         infoSectionList.add(l);
                     });
                 }
-                if (indexMapTitle.equals("基本信息")) {
+                if (indexMapTitle.equals("工商注册信息")) {
                     row = sheet1.createRow(i);
                     row.createCell(0).setCellValue(String.valueOf(i));
                     sheet1.setColumnWidth(i, "aaaaaaaaaaaa".getBytes().length * 2 * 256);
@@ -653,14 +654,14 @@ public class ResourceLibraryServiceImpl {
                         if (secondPageSettingList.size() > 0) {
                             //再次组装unitlist数据,分成多条数据
                             List<List<InfoUnitModel>> dataUnitList = new ArrayList<>();
-                            if (indexMapTitle.equals("基本信息")) {
+                            if (indexMapTitle.equals("工商注册信息")) {
                                 dataUnitList = splitUnitList(infoSectionList.get(m).getUnitlist(), secondPageSettingList.size());
                             } else {
                                 dataUnitList = splitUnitList(infoSectionList.get(m).getUnitlist(), secondPageSettingList.size());
                             }
 
                             for (int m1 = 0; m1 < dataUnitList.size(); m1++) {
-                                if (!indexMapTitle.equals("基本信息")) {
+                                if (!indexMapTitle.equals("工商注册信息")) {
                                     row = sheet1.createRow(sort);
                                     row.createCell(0).setCellValue(String.valueOf(sort));
                                     sheet1.setColumnWidth(sort, "aaaaaaaaaaaa".getBytes().length * 2 * 256);

+ 65 - 16
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/resourceChoice/ResouceChoiceServiceImpl.java

@@ -18,7 +18,6 @@ import cn.ubitech.ttc.model.label.LabelModel;
 import cn.ubitech.ttc.service.impl.search.SearchServiceImpl;
 import cn.ubitech.ttc.service.impl.user.SysUsersInfoServiceImpl;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.sun.org.apache.bcel.internal.generic.NEW;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
@@ -262,7 +261,9 @@ public class ResouceChoiceServiceImpl {
      */
     public List<ResourceChoiceModel> getResourceSortList(String node, int restype) {
         List<ResourceSort> resourceSortList = resourceSortMapper.selectList(new EntityWrapper<ResourceSort>().like("restype", String.valueOf(restype)).orderBy("id"));
-
+        if ("330122000".equals(node) && 6 == restype) {
+            resourceSortList.addAll(resourceSortMapper.selectList(new EntityWrapper<ResourceSort>().eq("node",node).isNull("restype")));
+        }
         //合并结果集
         List<ResourceChoiceModel> sumList = new ArrayList<>();
 
@@ -339,21 +340,23 @@ public class ResouceChoiceServiceImpl {
                 .eq("restype",restype)
                 .eq("isenabled",Constant.ONE));
 
-        Map<String, List<ResourceChoiceMore>> resourceChoiceMap = resourceChoiceMores.stream().collect(Collectors.groupingBy(ResourceChoiceMore::getType));
-        List<ResourceChoiceMore> list1 = resourceChoiceMap.get("国高八大领域");
-        resourceChoiceMap.remove("国高八大领域");
         List<Object> list = new ArrayList<>();
-        resourceChoiceMap.forEach((k,v) -> {
-            ResourceChoiceMoreModel resourceChoiceMoreModel = new ResourceChoiceMoreModel();
-            ResourceChoiceMore choiceMore = v.get(0);
-            BeanUtils.copyProperties(choiceMore,resourceChoiceMoreModel);
-            list.add(resourceChoiceMoreModel);
-        });
-        ResourceChoiceMoreModel resourceChoiceMoreModel2 = new ResourceChoiceMoreModel();
-        BeanUtils.copyProperties(list1.get(0),resourceChoiceMoreModel2);
-        resourceChoiceMoreModel2.setItems(list1);
-        resourceChoiceMoreModel2.setInfo("国高八大领域");
-        list.add(resourceChoiceMoreModel2);
+        if (CollectionUtils.isNotEmpty(resourceChoiceMores)) {
+            Map<String, List<ResourceChoiceMore>> resourceChoiceMap = resourceChoiceMores.stream().collect(Collectors.groupingBy(ResourceChoiceMore::getType));
+            List<ResourceChoiceMore> list1 = resourceChoiceMap.get("国高八大领域");
+            resourceChoiceMap.remove("国高八大领域");
+            resourceChoiceMap.forEach((k, v) -> {
+                ResourceChoiceMoreModel resourceChoiceMoreModel = new ResourceChoiceMoreModel();
+                ResourceChoiceMore choiceMore = v.get(0);
+                BeanUtils.copyProperties(choiceMore, resourceChoiceMoreModel);
+                list.add(resourceChoiceMoreModel);
+            });
+            ResourceChoiceMoreModel resourceChoiceMoreModel2 = new ResourceChoiceMoreModel();
+            BeanUtils.copyProperties(list1.get(0), resourceChoiceMoreModel2);
+            resourceChoiceMoreModel2.setItems(list1);
+            resourceChoiceMoreModel2.setInfo("国高八大领域");
+            list.add(resourceChoiceMoreModel2);
+        }
         return list;
     }
 
@@ -641,5 +644,51 @@ public class ResouceChoiceServiceImpl {
         return null;
     }
 
+    /**
+     * 培育库筛选条件
+     * @param nodeId
+     * @param restype
+     * @return
+     */
+    public List<Object> choiceFosterList(String nodeId, Integer restype) {
+        List<ResourceChoiceMore> resourceChoiceMores = choiceMoreMapper.selectList(new EntityWrapper<ResourceChoiceMore>()
+                .eq("node", nodeId)
+                .eq("restype", restype)
+                .eq("isenabled", 1));
+        Map<String, List<ResourceChoiceMore>> collect = resourceChoiceMores.stream().collect(Collectors.groupingBy(ResourceChoiceMore::getType));
+        List<ResourceChoiceMore> streets = collect.get("乡镇(街道)平台");
+        collect.remove("乡镇(街道)平台");
+        List<ResourceChoiceMore> highdomain = collect.get("国高八大领域");
+        collect.remove("国高八大领域");
+        List<ResourceChoiceMore> levelscale = collect.get("层次规模");
+        collect.remove("层次规模");
+        List<Object> list = new ArrayList<>();
+        collect.forEach((k,v) -> {
+            ResourceChoiceMoreModel resourceChoiceMoreModel = new ResourceChoiceMoreModel();
+            ResourceChoiceMore choiceMore = v.get(0);
+            BeanUtils.copyProperties(choiceMore,resourceChoiceMoreModel);
+            list.add(resourceChoiceMoreModel);
+        });
+        ResourceChoiceMoreModel resourceChoiceMoreModel = new ResourceChoiceMoreModel();
+        BeanUtils.copyProperties(streets.get(0),resourceChoiceMoreModel);
+        resourceChoiceMoreModel.setItems(streets);
+
+        ResourceChoiceMoreModel resourceChoiceMoreModel2 = new ResourceChoiceMoreModel();
+        BeanUtils.copyProperties(highdomain.get(0),resourceChoiceMoreModel2);
+        resourceChoiceMoreModel2.setItems(highdomain);
+
+        ResourceChoiceMoreModel resourceChoiceMoreModel3 = new ResourceChoiceMoreModel();
+        BeanUtils.copyProperties(levelscale.get(0),resourceChoiceMoreModel3);
+        resourceChoiceMoreModel3.setItems(levelscale);
+
+        list.add(resourceChoiceMoreModel);
+        list.add(resourceChoiceMoreModel2);
+        list.add(resourceChoiceMoreModel3);
+        return list;
+    }
+
+    public List<ResourceSort> fosterSortList(String nodeId, Integer restype) {
+        return resourceSortMapper.selectList(new EntityWrapper<ResourceSort>().eq("node", nodeId).eq("restype", restype));
+    }
 }
 

+ 2 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/search/SearchServiceImpl.java

@@ -15,7 +15,9 @@ import cn.ubitech.ttc.model.user.UserModel;
 import cn.ubitech.ttc.service.impl.resource.ElasticSearchServiceImpl;
 import cn.ubitech.ttc.service.impl.user.UserServiceImpl;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.plugins.Page;
+import org.apache.commons.lang.StringUtils;
 import org.elasticsearch.action.delete.DeleteResponse;
 import org.elasticsearch.client.Client;
 import org.elasticsearch.index.query.*;

+ 2 - 2
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/user/SysUsersInfoServiceImpl.java

@@ -2045,7 +2045,7 @@ public class SysUsersInfoServiceImpl extends ServiceImpl<SysUsersInfoMapper, Sys
             if (StringUtils.isNotEmpty(threeYearInfoMap.get("income"))){
                 threeYearInfoMap.put("income","0");
             }
-            if (threeYearInfoMap.get("income").toString().equals("0")){
+            if (!threeYearInfoMap.containsKey("income") || threeYearInfoMap.get("income").toString().equals("0")){
                 highOrg.setTechincomeinfeetotal(0d);
             }else {
                 highOrg.setTechincomeinfeetotal(Double.valueOf(new BigDecimal(StringUtils.isBlank(threeYearInfoMap.get("techincome")) ? "0"
@@ -3006,7 +3006,7 @@ public class SysUsersInfoServiceImpl extends ServiceImpl<SysUsersInfoMapper, Sys
             case 5: //省级企业研究院自检
                 InspectionProvincial provincial = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionProvincial.class);
                 return insertProvincial2(provincial, node, userid);
-            case 6:
+            case 6: //飞地自检
                 InspectionFeidi inspectionFeidi = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionFeidi.class);
                 return insertFeidi(inspectionFeidi, node, userid);
             default:

+ 15 - 0
ttc-backen/src/main/resources/mapper/OrganizationInfoMapper.xml

@@ -270,4 +270,19 @@
         select id from organization_info where name = #{orgname} or orgcode = #{orgcode}) AND comefrom = #{node})
     </select>
 
+    <select id="getInspectMunicipalOrgList" resultType="cn.ubitech.ttc.entity.OrganizationInfo">
+        select distinct
+          o.name,
+          o.logo,
+          o.categoryname
+        from
+          inspection_municipal i
+          left join organization_info o
+        on
+          i.orgid = o.id
+          and i.name like #{orgname}
+        order by
+          i.${sortColumn} ${sortType};
+    </select>
+
 </mapper>