소스 검색

高企一件事自检系统

liyisong 3 년 전
부모
커밋
0f28d4918d
19개의 변경된 파일1712개의 추가작업 그리고 1개의 파일을 삭제
  1. 22 0
      ttc-app/src/main/java/cn/ubitech/ttc/controller/ManageController.java
  2. 30 0
      ttc-app/src/main/java/cn/ubitech/ttc/controller/UserController.java
  3. 1 1
      ttc-app/src/main/resources/application-dev.yml
  4. 13 0
      ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionEyasOrgMapper.java
  5. 13 0
      ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionFeidiMapper.java
  6. 13 0
      ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionMunicipalMapper.java
  7. 13 0
      ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionPropertyMapper.java
  8. 13 0
      ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionProvincialMapper.java
  9. 13 0
      ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionProvincialScienceSmallMapper.java
  10. 116 0
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionEyasOrg.java
  11. 149 0
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionFeidi.java
  12. 144 0
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionMunicipal.java
  13. 51 0
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionProperty.java
  14. 134 0
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionProvincial.java
  15. 107 0
      ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionProvincialScienceSmall.java
  16. 1 0
      ttc-backen/src/main/java/cn/ubitech/ttc/model/common/RequestModel.java
  17. 17 0
      ttc-backen/src/main/java/cn/ubitech/ttc/model/user/InspectionPropertyModel.java
  18. 1 0
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/entry/EntryServiceImpl.java
  19. 861 0
      ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/user/SysUsersInfoServiceImpl.java

+ 22 - 0
ttc-app/src/main/java/cn/ubitech/ttc/controller/ManageController.java

@@ -14,6 +14,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -494,4 +495,25 @@ public class ManageController {
         }
         return resultModel;
     }
+
+    @GetMapping("/get/insepct/{userid}/{restype}/{node}/{sortkey}/{orgname}")
+    @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 = "关键词搜索")
+    })
+    public ResultModel getInspect(@PathVariable Integer userid, @PathVariable Integer restype, @PathVariable Integer node,
+                                  @PathVariable String sortkey, @PathVariable String orgname) {
+        ResultModel resultModel = new ResultModel();
+        try {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
+        } catch (Exception e) {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
+            resultModel.setData(e.toString());
+        }
+        return resultModel;
+    }
 }

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

@@ -1138,4 +1138,34 @@ public class UserController {
     }
 
 
+    @GetMapping("/inspection/property/list/{restype}")
+    @ApiOperation(value = "获取自检系统字段列表")
+    public ResultModel inspectionPropertyList(@PathVariable Integer restype) {
+        ResultModel resultModel = new ResultModel();
+        try {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
+            resultModel.setData(sysUsersInfoService.inspectionPropertyList(restype));
+            return resultModel;
+        } catch (Exception e) {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
+            resultModel.setData(e.toString());
+            return resultModel;
+        }
+    }
+
+    @PostMapping("/inspect")
+    @ApiOperation(value = "高企自检除外的其余自检系统")
+    public ResultModel inspectMunicipal(@RequestBody RequestModel requestModel) {
+        ResultModel resultModel = new ResultModel();
+        try {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3350);
+            requestModel.setData(sysUsersInfoService.inspect(requestModel));
+            return resultModel;
+        } catch (Exception e) {
+            resultModel.setCode(Constant.INTERFACE_STATUS_CODE_3351);
+            resultModel.setData(e.toString());
+            return resultModel;
+        }
+    }
+
 }

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

@@ -13,7 +13,7 @@ spring:
     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.119:9300,192.168.1.119:9301,192.168.1.119:9302
+      cluster-nodes: 192.168.1.128:9300,192.168.1.128:9301,192.168.1.128:9302
       #      typename: esttc
       #      indexname: ttcdev
       #      label_common_indexname: label_common_dev

+ 13 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionEyasOrgMapper.java

@@ -0,0 +1,13 @@
+package cn.ubitech.ttc.dao;
+
+import cn.ubitech.ttc.entity.InspectionEyasOrg;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lys
+ * @create 2021-11-08 11:05
+ */
+@Component
+public interface InspectionEyasOrgMapper extends BaseMapper<InspectionEyasOrg> {
+}

+ 13 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionFeidiMapper.java

@@ -0,0 +1,13 @@
+package cn.ubitech.ttc.dao;
+
+import cn.ubitech.ttc.entity.InspectionFeidi;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lys
+ * @create 2021-11-11 11:16
+ */
+@Component
+public interface InspectionFeidiMapper extends BaseMapper<InspectionFeidi> {
+}

+ 13 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionMunicipalMapper.java

@@ -0,0 +1,13 @@
+package cn.ubitech.ttc.dao;
+
+import cn.ubitech.ttc.entity.InspectionMunicipal;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lys
+ * @create 2021-11-08 14:20
+ */
+@Component
+public interface InspectionMunicipalMapper extends BaseMapper<InspectionMunicipal> {
+}

+ 13 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionPropertyMapper.java

@@ -0,0 +1,13 @@
+package cn.ubitech.ttc.dao;
+
+import cn.ubitech.ttc.entity.InspectionProperty;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lys
+ * @create 2021-11-05 13:28
+ */
+@Component
+public interface InspectionPropertyMapper extends BaseMapper<InspectionProperty> {
+}

+ 13 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionProvincialMapper.java

@@ -0,0 +1,13 @@
+package cn.ubitech.ttc.dao;
+
+import cn.ubitech.ttc.entity.InspectionProvincial;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lys
+ * @create 2021-11-11 9:55
+ */
+@Component
+public interface InspectionProvincialMapper extends BaseMapper<InspectionProvincial> {
+}

+ 13 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/dao/InspectionProvincialScienceSmallMapper.java

@@ -0,0 +1,13 @@
+package cn.ubitech.ttc.dao;
+
+import cn.ubitech.ttc.entity.InspectionProvincialScienceSmall;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lys
+ * @create 2021-11-08 11:06
+ */
+@Component
+public interface InspectionProvincialScienceSmallMapper extends BaseMapper<InspectionProvincialScienceSmall> {
+}

+ 116 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionEyasOrg.java

@@ -0,0 +1,116 @@
+package cn.ubitech.ttc.entity;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.data.annotation.Id;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author lys
+ * @create 2021-11-05 16:56
+ * 雏鹰企业自检录入信息
+ */
+@Data
+@EqualsAndHashCode
+@Accessors(chain = true)
+public class InspectionEyasOrg implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    //关联企业id
+    private Long orgid;
+
+    //企业名称
+    private String orgname;
+
+    //注册地址
+    private String registeraddress;
+
+    //注册日期
+    private Date registerdate;
+
+    //联系人
+    private String contract;
+
+    //联系电话
+    private String contracttel;
+
+    //统一社会信用代码
+    private String orgcode;
+
+    //拟申报年份
+    private Date declaredate;
+
+    //产业领域
+    private String category;
+
+    //上年度职工总数
+    private Integer lastyearworkercount;
+
+    //科技人员数
+    private Integer technicalcount;
+
+    //当年职工总数
+    private Integer thisyearworkercount;
+
+    //科技人员数占企业当年度职工总数比例(系统计算)
+    private Double technicalinworkerrate;
+
+    //I类自主知识产权数
+    private Integer oneintellectualcount;
+
+    //II类自主知识产权数
+    private Integer twointellectualcount;
+
+    //发明专利数
+    private Integer patentcount;
+
+    //实用新型专利数
+    private Integer practicalpatentcount;
+
+    //外观设计专利数
+    private Integer appearancepatentcount;
+
+    //知识产权获得方式
+    private String obtainway;
+
+    //技术的先进程度
+    private Double technicaladvanced;
+
+    //对企业产品(服务)在技术上发挥核心支持的作用
+    private Double coresupport;
+
+    //企业研发经费是否单独建帐
+    private Integer isresearchexpenditurealoneaccounts;
+
+    //上年度销售收入
+    private Double lastyearsaletotal;
+
+    //上年度研发收入
+    private Double lastyearresearchtotal;
+
+    //上年度研发投入/上年度销售收入
+    private Double researchdividesalerate;
+
+    //在6年以内,是否具有良好的成长性
+    private Integer issixyearshaswellgrowth;
+
+    //申请认定前一年内是否发生重大安全事故、重大质量事故、严重环境违法行为或严重失信行为
+    private Integer ishasillegalbehaviorinlastyear;
+
+    private Integer creator;
+
+    private Date creattime;
+
+    //判断之后存放不符合条件
+    private String inconformity;
+}
+

+ 149 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionFeidi.java

@@ -0,0 +1,149 @@
+package cn.ubitech.ttc.entity;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author lys
+ * @create 2021-11-09 17:52
+ */
+@Data
+@EqualsAndHashCode
+@Accessors(chain = true)
+public class InspectionFeidi implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    //关联企业id
+    private Long orgid;
+
+    //企业名称
+    private String orgname;
+
+    //是否具有独立的法人资格
+    private Integer ishaslegalpersonstatus;
+
+    //注册地址
+    private String registeraddress;
+
+    //注册日期
+    private Date registerdate;
+
+    //联系人
+    private String contract;
+
+    //联系电话
+    private String contracttel;
+
+    //统一社会信用代码
+    private String orgcode;
+
+    //拟申报年份
+    private Date declaredate;
+
+    //产业领域
+    private String category;
+
+    //是否已有桐庐县飞地研发中心
+    private Integer ishasfeidiresearchcenter;
+
+    //飞地研发中心全称
+    private String feidiname;
+
+    //飞地研发中心地址
+    private String feidiaddress;
+
+    //企业占股飞地研发中心是否超过50%
+    private Integer isratioofshareholdhalf;
+
+    //飞地研发中心统一社会信用代码
+    private String feidicode;
+
+    //是否目标任务明确
+    private Integer istargetclear;
+
+    //当年企业职工总数
+    private Integer thisyearworkercount;
+
+    //专职科技人员数
+    private Integer technicalcount;
+
+    //科技人员数占企业当年度职工总数比例(系统计算)
+    private Double technicalinworkerrate;
+
+    //专职研究开发人员中,有中级职称以上人员数
+    private Integer intermediateprofessionaltitleorabove;
+
+    //专职研究开发人员中,最高学历为硕士研究生及以上学历人员数
+    private Integer masterdegreecandidate;
+
+    //专职研究开发人员中,最高学历为本科且没有中级以上职称的人员数
+    private Integer undergraduateandnohasintermediate;
+
+    //专职研究开发人员是否在研发中心从事研发工作183天以上
+    private Integer workleasthalfyear;
+
+    //专职研究开发人员是否从事相关工作不少于2年
+    private Integer worktimeuptwoyear;
+
+    //上年度Ⅰ类知识产权数
+    private Integer lastyearoneintellectualcount;
+
+    //上年度Ⅱ类知识产权数(不含外观设计)
+    private Integer lastyeartwointellectualcount;
+
+    //近三年Ⅰ类知识产权数
+    private Integer threeyearoneintellectualcount;
+
+    //近三年Ⅱ类知识产权数
+    private Integer threeyeartwointellectualcount;
+
+    //技术创新项目数
+    private Integer innovatecount;
+
+    //县级以上科研项目数
+    private Integer abovecountylevel;
+
+    //企业内部立项技术创新项目数
+    private Integer inorginnovatecount;
+
+    //上年度销售收入
+    private Double lastyearsaletotal;
+
+    //上年度研究开发费用
+    private Double lastyearresearchtotal;
+
+    //上年度研发投入 / 上年度销售收入
+    private Double researchinsalerate;
+
+    //上一年度专职研究开发人员平均薪金
+    private Double lastyearavgpay;
+
+    //研发场地面积
+    private Double researcharea;
+
+    //科研设备原值总额
+    private Double researchtotal;
+
+    //是否具有相对独立地位,运行满1年。若具有独立法人资格的,申报主体是否占该飞地研发中心50%以上股份。
+    private Integer ishasindependentstatus;
+
+    //申报前一年度内,未列入严重失信名单
+    private Integer nohaspromise;
+
+    //自检后不符合的条件
+    private String inconformity;
+
+    private Integer creator;
+
+    private Date creattime;
+}

+ 144 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionMunicipal.java

@@ -0,0 +1,144 @@
+package cn.ubitech.ttc.entity;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import io.swagger.models.auth.In;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author lys
+ * @create 2021-11-08 11:08
+ * 市级研发中心自检系统录入
+ */
+@Data
+@EqualsAndHashCode
+@Accessors(chain = true)
+public class InspectionMunicipal implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    //关联企业id
+    private Long orgid;
+
+    //企业名称
+    private String orgname;
+
+    //注册地址
+    private String registeraddress;
+
+    //注册日期
+    private Date registerdate;
+
+    //联系人
+    private String contract;
+
+    //联系电话
+    private String contracttel;
+
+    //统一社会信用代码
+    private String orgcode;
+
+    //拟申报年份
+    private Date declaredate;
+
+    //产业领域
+    private String category;
+
+    //企业类型
+    private String orgtype;
+
+    //是否为软件类企业
+    private Integer issoftwareenterprise;
+
+    //职工总数
+    private Integer workercount;
+
+    //专职科技人员数
+    private Integer technicalcount;
+
+    //科技人员数占企业当年度职工总数比例(系统计算)
+    private Double technicalinworkerrate;
+
+    //技术创新项目
+    private Integer technologicalinnovationproject;
+
+    //市级以上科研项目
+    private Integer cityabovescientificproject;
+
+    //企业自主立项技术创新项目
+    private Integer selfdependentproject;
+
+    //知识产权数
+    private Integer intellectualpropertycount;
+
+    //发明专利授权数
+    private Integer patentcount;
+
+    //集成电路布图设计专有权
+    private Integer integratedcircuitcount;
+
+    //新型专利
+    private Integer newpatentcount;
+
+    //外观设计专利
+    private Integer appearancepatentcount;
+
+    //软件著作权
+    private Integer patentforsoftwarecount;
+
+    //登记(奖励)成果
+    private Integer awardcount;
+
+    //上年度销售收入
+    private Double lastyearsaletotal;
+
+    //上年度研发收入
+    private Double lastyearresearchtotal;
+
+    //上年度自筹研发投入
+    private Double lastyearselfraisedtotal;
+
+    //研发投入占企业年销售收入总额比例
+    private Double researchinsalerate;
+
+    //是否财务实行单独建账核算,所需经费纳入建设企业财务年度预算
+    private Integer isoneselfaccounts;
+
+    //科研活动各项规章制度是否健全
+    private Integer issaneresearchsystem;
+
+    //科研场地面积
+    private Double researchsitearea;
+
+    //专用科研设备原值总额
+    private Double researchequipmenttotal;
+
+    //企业、高校或科研机构是否联合组建中心
+    private Integer isunitecentre;
+
+    //组建中心设施总值
+    private Double unitecentretotal;
+
+    //专用科研设备原值总额/组建中心设施总值
+    private Double facilityinunitecentrerate;
+
+    //企业近三年未发生重大安全事故、重大质量事故、严重环境违法行为或严重失信等行为
+    private Integer ishasillegalbehaviorinthreeyear;
+
+    //自检后不符合的条件
+    private String inconformity;
+
+    private Integer creator;
+
+    private Date creattime;
+
+
+}

+ 51 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionProperty.java

@@ -0,0 +1,51 @@
+package cn.ubitech.ttc.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.data.annotation.Id;
+
+import java.io.Serializable;
+
+/**
+ * @author lys
+ * @create 2021-11-05 11:36
+ * 自检系统存放字段表
+ */
+@Data
+@EqualsAndHashCode
+@Accessors(chain = true)
+public class InspectionProperty implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String info;
+
+    private String property;
+
+    //标签类型(用于给前端做样式)
+    private Integer type;
+
+    //区分自检类型
+    private Integer restype;
+
+    //是否必填项
+    private Integer ismust;
+
+    //选择项下的选择值
+    private String selectionvalue;
+
+    //分成不同页面的依据
+    private String group;
+
+    @TableField(exist = false)
+    private String tablename = "inpection_property";
+    @TableField(exist = false)
+    private Integer tablecode;
+}

+ 134 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionProvincial.java

@@ -0,0 +1,134 @@
+package cn.ubitech.ttc.entity;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author lys
+ * @create 2021-11-09 14:33
+ * 省级研发中心自检系统  省级研究院自检系统
+ */
+@Data
+@EqualsAndHashCode
+@Accessors(chain = true)
+public class InspectionProvincial implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    //关联企业id
+    private Long orgid;
+
+    //企业名称
+    private String orgname;
+
+    //注册地址
+    private String registeraddress;
+
+    //注册日期
+    private Date registerdate;
+
+    //联系人
+    private String contract;
+
+    //联系电话
+    private String contracttel;
+
+    //统一社会信用代码
+    private String orgcode;
+
+    //拟申报年份
+    private Date declaredate;
+
+    //产业领域
+    private String category;
+
+    //是否为软件类企业
+    private Integer issoftwareenterprise;
+
+    //当年企业职工总数
+    private Integer thisyearworkercount;
+
+    //专职科技人员数
+    private Integer technicalcount;
+
+    //科技人员数占企业当年度职工总数比例(系统计算)
+    private Double technicalinworkerrate;
+
+    //本科以上学历或中级以上职称的工程技术人员数
+    private Integer bachelororaboveeducation;
+
+    //本科以上学历或中级以上职称的工程技术人员数 / 专职研究开发人员数
+    private Double bachelorintechrate;
+
+    //是否建有市级高新技术企业研发中心
+    private Integer ishasmunicipalresearchcenter;
+
+    //近三年累计转化科技成果
+    private Integer threeyearchangeachievement;
+
+    //I类自主知识产权数
+    private Integer oneintellectualcount;
+
+    //II类自主知识产权数
+    private Integer twointellectualcount;
+
+    //发明专利数
+    private Integer patentcount;
+
+    //实用新型专利数
+    private Integer practicalpatentcount;
+
+    //外观设计专利数
+    private Integer appearancepatentcount;
+
+    //软件著作权等(不含商标)
+    private Integer patentforsoftwarecount;
+
+    //知识产权获得方式
+    private String obtainway;
+
+    //上年度销售收入
+    private Double lastyearsaletotal;
+
+    //上年度研究开发费用
+    private Double lastyearresearchtotal;
+
+    //上年度研发投入 / 上年度销售收入
+    private Double researchinsalerate;
+
+    //研发场地面积
+    private Double sitearea;
+
+    //科研设备原值总额
+    private Double researchtotal;
+
+    //科研生产共用的设备原值
+    private Double sharetotal;
+
+    //科研生产共用的设备原值总额 / 科研设备原值总额
+    private Double shareinresearchrate;
+
+    //建立完整规范的技术创新管理体制
+    private Integer isfullmanagesystem;
+
+    //企业申请认定前一年度至申请之日内是否发生重大的安全、质量事故,严重的环境违法、知识产权违法、税务违法、科研失信等行为
+    private Integer ishasillegalbehaviorinlastyear;
+
+    private Integer creator;
+
+    private Date creattime;
+
+    //判断之后存放不符合条件
+    private String inconformity;
+
+
+}

+ 107 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/entity/InspectionProvincialScienceSmall.java

@@ -0,0 +1,107 @@
+package cn.ubitech.ttc.entity;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * @author lys
+ * @create 2021-11-05 17:19
+ * 省科小自检录入信息
+ */
+@Data
+@Accessors(chain = true)
+@EqualsAndHashCode
+public class InspectionProvincialScienceSmall {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    //关联企业id
+    private Long orgid;
+
+    //企业名称
+    private String orgname;
+
+    //注册地址
+    private String registeraddress;
+
+    //注册日期
+    private Date registerdate;
+
+    //联系人
+    private String contract;
+
+    //联系电话
+    private String contracttel;
+
+    //统一社会信用代码
+    private String orgcode;
+
+    //拟申报年份
+    private Date declaredate;
+
+    //产业领域
+    private String category;
+
+    //职工总数
+    private Integer workercount;
+
+    //科技人员数
+    private Integer technicalcount;
+
+    //科技人员数除以职工总数比例
+    private Double technicalinworkerrate;
+
+    //知识产权总数
+    private Integer intellectualpropertycount;
+
+    //专利(申请或授权)数
+    private Integer patentcount;
+
+    //标准数
+    private Integer standardcount;
+
+    //商标数
+    private Integer brandcount;
+
+    //经认定的科技成果
+    private String affirmscienceachievement;
+
+    //其他
+    private String other;
+
+    //知识产权获得方式
+    private String obtainway;
+
+    //是否有基于自主知识产权、专有技术或先进知识获得的产品或服务
+    private Integer ishasproprietarytechnology;
+
+    //持续开展科技创新活动的能力
+    private Integer continuecarryoutcapacity;
+
+    //上年度销售收入
+    private Double lastyearsale;
+
+    //上年度研发投入
+    private Double lastyearresearch;
+
+    //是否独立核算、自主经营、自负盈亏
+    private Integer isindependentmanagement;
+
+    //企业上年度是否发生重大安全、重大质量事故、有严重环境违法或严重失信行为
+    private Integer islastyearshasincident;
+
+    private Integer creator;
+
+    private Date createtime;
+
+    //判断之后存放不符合条件
+    private String inconformity;
+}

+ 1 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/model/common/RequestModel.java

@@ -2,6 +2,7 @@ package cn.ubitech.ttc.model.common;
 
 import com.baomidou.mybatisplus.plugins.Page;
 import lombok.Data;
+import org.apache.poi.ss.formula.functions.T;
 
 /**
  * code is far away from bug with the animal protecting

+ 17 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/model/user/InspectionPropertyModel.java

@@ -0,0 +1,17 @@
+package cn.ubitech.ttc.model.user;
+
+import cn.ubitech.ttc.entity.InspectionProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Collection;
+
+/**
+ * @author lys
+ * @create 2021-11-05 15:47
+ */
+@Data
+public class InspectionPropertyModel implements Serializable {
+    private String title;
+    private Collection<InspectionProperty> items;
+}

+ 1 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/entry/EntryServiceImpl.java

@@ -4499,6 +4499,7 @@ 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.setIsenabled(1);
         info.setOperateorg(0L);
         info.setPeopleengagedNum(0);
         info.setDevelopNum(0);

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

@@ -15,6 +15,7 @@ import cn.ubitech.ttc.model.common.PageModel;
 import cn.ubitech.ttc.model.common.RequestModel;
 import cn.ubitech.ttc.model.common.ResultModel;
 import cn.ubitech.ttc.model.researchcost.DownModel;
+import cn.ubitech.ttc.model.user.InspectionPropertyModel;
 import cn.ubitech.ttc.model.user.TongTechUser;
 import cn.ubitech.ttc.model.web.InnovationVoucherModel;
 import cn.ubitech.ttc.service.impl.PushIntegral.PushIntegralServiceImpl;
@@ -30,15 +31,19 @@ import cn.ubitech.ttc.service.impl.mybaits.SysUsersTaskInfoServiceImpl;
 import cn.ubitech.ttc.service.mybaits.ISysUsersInfoService;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.sun.org.apache.bcel.internal.generic.NEW;
 import com.tencentcloudapi.common.Credential;
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
 import com.tencentcloudapi.common.profile.ClientProfile;
 import com.tencentcloudapi.common.profile.HttpProfile;
 import com.tencentcloudapi.sms.v20190711.SmsClient;
 import com.tencentcloudapi.sms.v20190711.models.*;
+import io.swagger.models.auth.In;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -46,6 +51,7 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.elasticsearch.client.Client;
 import org.joda.time.DateTime;
+import org.omg.CORBA.LongHolder;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -65,6 +71,7 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 
 /**
@@ -77,6 +84,7 @@ import java.util.stream.Collectors;
  */
 
 @Service
+@Slf4j
 public class SysUsersInfoServiceImpl extends ServiceImpl<SysUsersInfoMapper, SysUsersInfo> implements ISysUsersInfoService {
 
     @Autowired
@@ -164,6 +172,19 @@ public class SysUsersInfoServiceImpl extends ServiceImpl<SysUsersInfoMapper, Sys
     @Autowired
     private SysUsersInfoServiceImpl sysUsersInfoService;
 
+    @Autowired
+    private InspectionPropertyMapper inspectionPropertyMapper;
+    @Autowired
+    private InspectionEyasOrgMapper eyasOrgMapper;
+    @Autowired
+    private InspectionMunicipalMapper municipalMapper;
+    @Autowired
+    private InspectionProvincialScienceSmallMapper provincialScienceSmallMapper;
+    @Autowired
+    private InspectionProvincialMapper inspectionProvincialMapper;
+    @Autowired
+    private InspectionFeidiMapper inspectionFeidiMapper;
+
 
     /**
      * 查询用户是否有认证审核权限
@@ -1913,6 +1934,7 @@ public class SysUsersInfoServiceImpl extends ServiceImpl<SysUsersInfoMapper, Sys
                 org.setPatentfordesigncount(Integer.valueOf(highOrgMap.get("appearancepatentcount") == null ? "0" : highOrgMap.get("appearancepatentcount").toString()));
                 org.setCreator(Long.valueOf(userid));
                 org.setUpdator(Long.valueOf(userid));
+                org.setIsenabled(1);
                 organizationInfoMapper.insert(org);
                 CompanyNodeLk lk = new CompanyNodeLk();
                 lk.setCompanyid(org.getId());
@@ -2020,6 +2042,9 @@ public class SysUsersInfoServiceImpl extends ServiceImpl<SysUsersInfoMapper, Sys
             }
             highOrg.setTechincome(Double.valueOf(threeYearInfoMap.get("techincome") == null ? "0" : threeYearInfoMap.get("techincome").toString()));
             System.err.println(threeYearInfoMap.get("income"));
+            if (StringUtils.isNotEmpty(threeYearInfoMap.get("income"))){
+                threeYearInfoMap.put("income","0");
+            }
             if (threeYearInfoMap.get("income").toString().equals("0")){
                 highOrg.setTechincomeinfeetotal(0d);
             }else {
@@ -2946,4 +2971,840 @@ public class SysUsersInfoServiceImpl extends ServiceImpl<SysUsersInfoMapper, Sys
         trackLog.setCreator(2865L);
         trackLogMapper.insert(trackLog);
     }
+
+    //获取自检录入需要的字段
+    public List<InspectionPropertyModel> inspectionPropertyList(Integer restype) {
+        List<InspectionProperty> inspectionProperties = inspectionPropertyMapper.selectList(new EntityWrapper<InspectionProperty>()
+                .eq("restype", restype));
+        List<InspectionPropertyModel> list = new ArrayList();
+        Map<String, List<InspectionProperty>> collect = inspectionProperties.stream().collect(Collectors.groupingBy(InspectionProperty::getGroup));
+        collect.forEach((k,v) -> {
+            InspectionPropertyModel model = new InspectionPropertyModel();
+            model.setTitle(k);
+            model.setItems(v);
+            list.add(model);
+        });
+        return list;
+    }
+
+    public Map<String, List> inspect(RequestModel requestModel) {
+        long userid = requestModel.getUserid();
+        String node = requestModel.getNode();
+        switch (Integer.valueOf(requestModel.getRestype())) {
+            case 1: //雏鹰自检
+                InspectionEyasOrg inspectionEyasOrg = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionEyasOrg.class);
+                return insertEyasInspection(inspectionEyasOrg, node, userid);
+            case 2: //省科小自检
+                InspectionProvincialScienceSmall provincialScienceSmall = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionProvincialScienceSmall.class);
+                return insertProvincialScienceSmallInspect(provincialScienceSmall, node, userid);
+            case 3: //市级研发中心自检
+                InspectionMunicipal inspectionMunicipal = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionMunicipal.class);
+                return insertMunicipalInspect(inspectionMunicipal, node, userid);
+            case 4: //省级研发中心自检
+                InspectionProvincial inspectionProvincial = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionProvincial.class);
+                return insertProvincial(inspectionProvincial, node, userid);
+            case 5: //省级企业研究院自检
+                InspectionProvincial provincial = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionProvincial.class);
+                return insertProvincial2(provincial, node, userid);
+            case 6:
+                InspectionFeidi inspectionFeidi = JSONObject.parseObject(JSONObject.toJSONString(requestModel.getData()), InspectionFeidi.class);
+                return insertFeidi(inspectionFeidi, node, userid);
+            default:
+                return null;
+        }
+    }
+
+    //市级研发中心自检
+    public Map<String, List> insertMunicipalInspect(InspectionMunicipal inspectionMunicipal, String node, Long userid) {
+
+        Map<String, List> map = new HashMap();
+        List<String> unqualified = new ArrayList();
+        List<String> qualified = new ArrayList();
+
+        List<OrganizationInfo> infos = organizationInfoMapper.getOrgListByNode(inspectionMunicipal.getOrgname(), node);
+        OrganizationInfo info = new OrganizationInfo();
+        if (infos.size() > 0) {
+            info = infos.get(0);
+            inspectionMunicipal.setOrgid(info.getId());
+        } else {
+            //企业不存在,就存入企业库
+            List<LabelIntelligentCommonInfo> labelIntelligentCommonInfos = null;
+            if (StringUtils.isNotEmpty(inspectionMunicipal.getCategory())) {
+                labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionMunicipal.getCategory()).eq("node", node).eq("by1", "category"));
+                if (labelIntelligentCommonInfos.size() == 0) {
+                    labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionMunicipal.getCategory()).eq("node", 0).eq("by1", "category"));
+                }
+            }
+            info.setName(inspectionMunicipal.getOrgname());
+            info.setOrgtype(10104L);
+            info.setRegistrationdate(inspectionMunicipal.getRegisterdate());
+            info.setContact(StringUtils.isNotEmpty(inspectionMunicipal.getContract()) ? inspectionMunicipal.getContract() : "");
+            info.setContactnum(StringUtils.isNotEmpty(inspectionMunicipal.getContracttel()) ? inspectionMunicipal.getContracttel() : "");
+            info.setOrgcode(StringUtils.isNotEmpty(inspectionMunicipal.getOrgcode()) ? inspectionMunicipal.getOrgcode() : "");
+            info.setCategoryid(CollectionUtils.isNotEmpty(labelIntelligentCommonInfos) ? labelIntelligentCommonInfos.get(0).getCode() : "");
+            info.setWorkercount(inspectionMunicipal.getWorkercount());
+            info.setTechnicalpersonnelcount(inspectionMunicipal.getTechnicalcount());
+            info.setPatentcount(inspectionMunicipal.getPatentcount());
+            info.setPatentforutilitycount(inspectionMunicipal.getNewpatentcount());
+            info.setPatentfordesigncount(inspectionMunicipal.getAppearancepatentcount());
+            info.setPatentforsoftwarecount(inspectionMunicipal.getPatentforsoftwarecount());
+            info.setCreator(userid);
+            info.setUpdator(userid);
+            info.setIsenabled(1);
+            organizationInfoMapper.insert(info);
+            inspectionMunicipal.setOrgid(info.getId());
+
+            insertRelevant(info, node, userid);
+        }
+
+        //注册地在杭州市行政区域内
+        if (inspectionMunicipal.getRegisteraddress().equals("非杭州市")) {
+            unqualified.add("注册地址要在杭州市行政区域内");
+        }
+
+        //注册成立时间大于一年
+        if (inspectionMunicipal.getRegisterdate() != null) {
+            Calendar c = Calendar.getInstance();
+            c.setTime(inspectionMunicipal.getRegisterdate());
+            c.add(Calendar.YEAR,1);
+            if (c.getTime().getTime() >= new Date().getTime()) {
+                unqualified.add("注册成立时间要大于等于一年");
+            }
+        }
+
+        //专职科技人员数 >= 10 || 专职科技人员数 \ 职工总数 >= 10%
+        double rate = inspectionMunicipal.getTechnicalcount() / inspectionMunicipal.getWorkercount();
+        inspectionMunicipal.setTechnicalinworkerrate(rate);
+        if (!(inspectionMunicipal.getTechnicalcount() >= 10 || rate >= 0.1)) {
+            unqualified.add("专职科技人员数要大于等于10  或者  专职科技人员数大于等于职工总数的10%");
+        }
+
+        //市级以上科研项目 > 1 || 企业自主立项技术创新项目 > 3
+        if (!(inspectionMunicipal.getCityabovescientificproject() > 1 || inspectionMunicipal.getSelfdependentproject() > 3)) {
+            unqualified.add("市级以上科研项目数要大于1  或者  企业自主创新项目大于3");
+        }
+
+        //发明专利授权数 + 集成电路布图设计专有权 >= 1 || 新型专利 + 外观设计专利 + 软件著作权 + 登记(奖励)结果 >= 3
+        Integer sum2 = inspectionMunicipal.getPatentcount() + inspectionMunicipal.getIntegratedcircuitcount();
+        Integer sum4 = inspectionMunicipal.getNewpatentcount() + inspectionMunicipal.getAppearancepatentcount() + inspectionMunicipal.getPatentforsoftwarecount() + inspectionMunicipal.getAwardcount();
+        if (!(sum2 >= 1 || sum4 >= 3)) {
+            unqualified.add("发明专利数与集成电路布图设计专有权总和要大于等于1  或者  新型专利与外观设计专利与软件著作权与登记(奖励)结果要大于等于3");
+        }
+
+        //上年度自筹研发投入 >= 200万元
+        if (inspectionMunicipal.getLastyearselfraisedtotal() < 200) {
+            unqualified.add("上年度自筹研发投入要大于等于200万元");
+        }
+
+        //上年度研发投入 / 上年度销售收入 > 3% (农业科技企业)
+        double rate1 = inspectionMunicipal.getLastyearresearchtotal() / inspectionMunicipal.getLastyearsaletotal();
+        inspectionMunicipal.setResearchinsalerate(rate1);
+        if ("农业科技企业".equals(inspectionMunicipal.getOrgtype()) && rate1 <= 0.03) {
+            unqualified.add("农业科技企业,上年度研发投入要大于上年度销售收入的3%");
+        }
+
+        //科研产地面积 >= 200
+        if (inspectionMunicipal.getResearchsitearea() < 200) {
+            unqualified.add("科研场地面积要大于等于200平方米");
+        }
+
+        //专用科研设备原值总额,软件类企业和农业科技企业 >= 100万元;其他企业≥200万元(根据企业类型来判断)
+        if ((inspectionMunicipal.getIssoftwareenterprise() == 1 || "农业科技企业".equals(inspectionMunicipal.getOrgtype())) && inspectionMunicipal.getResearchequipmenttotal() < 100) {
+            unqualified.add("软件类企业和农业科技企业专用科研设备原值总额要大于等于100万元");
+        } else if ((inspectionMunicipal.getIssoftwareenterprise() == 0 || !"农业科技企业".equals(inspectionMunicipal.getOrgtype())) && inspectionMunicipal.getResearchequipmenttotal() < 200){
+            unqualified.add("企业专用科研设备原值总额要大于等于200万元");
+        }
+
+        //专用科研设备原值总额 / 组建中心设施总值 >= 80(若有组建中心,此项需作为评判标准,若无则忽略此项)
+        if (inspectionMunicipal.getIsunitecentre() == 1 && inspectionMunicipal.getUnitecentretotal() != null && inspectionMunicipal.getUnitecentretotal() != 0) {
+            double rate2 = inspectionMunicipal.getResearchequipmenttotal() / inspectionMunicipal.getUnitecentretotal();
+            inspectionMunicipal.setFacilityinunitecentrerate(rate2);
+            if (rate2 < 0.8) {
+                unqualified.add("专用科研设备原值总额要大于等于组件研发中心设施的80%");
+            }
+        }
+
+        inspectionMunicipal.setCreator(Integer.valueOf(String.valueOf(userid)));
+
+        StringBuilder stringBuilder = new StringBuilder();
+        unqualified.forEach( u -> {
+            stringBuilder.append(u + ",");
+        });
+        inspectionMunicipal.setInconformity(stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString());
+        municipalMapper.insert(inspectionMunicipal);
+
+        //不合格条件
+        if (unqualified.size() > 0) {
+            map.put(inspectionMunicipal.getOrgname() + " 不符合市级研发中心认定条件", unqualified);
+        } else {
+            map.put(inspectionMunicipal.getOrgname() + " 符合市级研发中心认定条件", null);
+        }
+        return map;
+    }
+
+    //雏鹰自检
+    public Map<String, List> insertEyasInspection(InspectionEyasOrg inspectionEyasOrg, String node, Long userid) {
+        Map<String, List> map = new HashMap();
+        List<String> unqualified = new ArrayList();
+
+        List<OrganizationInfo> infos = organizationInfoMapper.getOrgListByNode(inspectionEyasOrg.getOrgname(), node);
+        OrganizationInfo info = new OrganizationInfo();
+        if (infos.size() > 0) {
+            info = infos.get(0);
+        } else {
+            //企业信息不存在,就存入企业库
+            List<LabelIntelligentCommonInfo> labelIntelligentCommonInfos = null;
+            if (StringUtils.isNotEmpty(inspectionEyasOrg.getCategory())) {
+                labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionEyasOrg.getCategory()).eq("node", node).eq("by1", "category"));
+                if (labelIntelligentCommonInfos.size() == 0) {
+                    labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionEyasOrg.getCategory()).eq("node", 0).eq("by1", "category"));
+                }
+            }
+            info.setName(inspectionEyasOrg.getOrgname());
+            info.setOrgtype(10104L);
+            info.setRegistrationdate(inspectionEyasOrg.getRegisterdate());
+            info.setContact(StringUtils.isNotEmpty(inspectionEyasOrg.getContract()) ? inspectionEyasOrg.getContract() : "");
+            info.setContactnum(StringUtils.isNotEmpty(inspectionEyasOrg.getContracttel()) ? inspectionEyasOrg.getContracttel() : "");
+            info.setOrgcode(StringUtils.isNotEmpty(inspectionEyasOrg.getOrgcode()) ? inspectionEyasOrg.getOrgcode() : "");
+            info.setCategoryid(CollectionUtils.isNotEmpty(labelIntelligentCommonInfos) ? labelIntelligentCommonInfos.get(0).getCode() : "");
+            info.setTechnicalpersonnelcount(inspectionEyasOrg.getTechnicalcount() != null ? inspectionEyasOrg.getTechnicalcount() : 0);
+            info.setWorkercount(inspectionEyasOrg.getThisyearworkercount() != null ? inspectionEyasOrg.getThisyearworkercount() : 0);
+            info.setPatentcount(inspectionEyasOrg.getPatentcount() != null ? inspectionEyasOrg.getPatentcount() : 0);
+            info.setPatentforutilitycount(inspectionEyasOrg.getPracticalpatentcount() != null ? inspectionEyasOrg.getPracticalpatentcount() : 0);
+            info.setPatentfordesigncount(inspectionEyasOrg.getAppearancepatentcount() != null ? inspectionEyasOrg.getAppearancepatentcount() : 0);
+            info.setIntellectualpropertyone(inspectionEyasOrg.getOneintellectualcount() != null ? inspectionEyasOrg.getOneintellectualcount() : 0);
+            info.setIntellectualpropertytwo(inspectionEyasOrg.getTwointellectualcount() != null ? inspectionEyasOrg.getTwointellectualcount() : 0);
+            info.setCreator(userid);
+            info.setUpdator(userid);
+            info.setIsenabled(1);
+            organizationInfoMapper.insert(info);
+
+            insertRelevant(info, node, userid);
+        }
+
+        inspectionEyasOrg.setOrgid(info.getId());
+
+        //注册地在杭州市行政区域内
+        if (inspectionEyasOrg.getRegisteraddress().equals("非杭州市")) {
+            unqualified.add("注册地要在杭州市行政区域内");
+        }
+
+        // 1年 <= 注册成立时间 <= 6年
+        Calendar c = Calendar.getInstance();
+        c.setTime(inspectionEyasOrg.getRegisterdate());
+        c.add(Calendar.YEAR,1);
+        long l1 = c.getTimeInMillis();
+        c.add(Calendar.YEAR, 5);
+        long l2 = c.getTimeInMillis();
+        if (l1 > new Date().getTime() && new Date().getTime() > l2) {
+            unqualified.add("注册成立时间要大于等于1年并且小于等于6年");
+        }
+
+        //上年度职工总数 >= 10
+        if (inspectionEyasOrg.getLastyearworkercount() < 10) {
+            unqualified.add("上年度职工总数要大于等于10");
+        }
+
+        // 科技人员数 / 职工总数 >= 15%
+        double rate = inspectionEyasOrg.getTechnicalcount() / inspectionEyasOrg.getThisyearworkercount();
+        inspectionEyasOrg.setTechnicalinworkerrate(rate);
+        if (rate < 0.15) {
+            unqualified.add("科技人员数要占当年度职工总数的15%以上");
+        }
+
+        //上年度销售收入 <= 5000万元
+        if (inspectionEyasOrg.getLastyearsaletotal() > 5000) {
+            unqualified.add("上年度销售收入要大于等于5000万元");
+        }
+
+        //上年度研发投入 >= 50万元
+        if (inspectionEyasOrg.getLastyearresearchtotal() < 50) {
+            unqualified.add("上年度研发投入要大于等于50万元");
+        }
+
+        /**
+         * 上年度研发投入 / 上年度销售收入
+         *   1.上年度销售收入小于3,000万元的企业 >= 5% ;
+         *   2.上年度销售收入在3,000万元至5000万元的企业 >= 4%
+         *   3.上年度销售收入大于5000万元的企业,直接判定不符合
+         */
+        double rate2 = inspectionEyasOrg.getLastyearresearchtotal() / inspectionEyasOrg.getLastyearsaletotal();
+        inspectionEyasOrg.setResearchdividesalerate(rate2);
+        if (5000 < inspectionEyasOrg.getLastyearsaletotal()) {
+            unqualified.add("上年度销售收入大于5000万元");
+        } else if (3000 <= inspectionEyasOrg.getLastyearsaletotal() && 5000 >= inspectionEyasOrg.getLastyearsaletotal()) {
+            if (rate2 < 0.04) {
+                unqualified.add("上年度销售收入在3000万元至5000万元的企业,上年度的研发投入要占上年度销售收入的4%以上");
+            }
+        } else if (inspectionEyasOrg.getLastyearsaletotal() < 3000) {
+            if (rate2 > 0.05) {
+                unqualified.add("上年度销售收入小于3000万元的企业,上年度的研发投入要占上年度销售收入的5%以上");
+            }
+        }
+
+        StringBuilder stringBuilder = new StringBuilder();
+        unqualified.forEach(u -> {
+            stringBuilder.append(u + ",");
+        });
+        inspectionEyasOrg.setInconformity(stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString());
+        eyasOrgMapper.insert(inspectionEyasOrg);
+
+        //不合格条件
+        if (unqualified.size() > 0) {
+            map.put(inspectionEyasOrg.getOrgname() + " 不符合雏鹰认定条件", unqualified);
+        } else {
+            map.put(inspectionEyasOrg.getOrgname() + " 符合雏鹰认定条件", null);
+        }
+        return map;
+    }
+
+    //省科小自检
+    public Map<String, List> insertProvincialScienceSmallInspect(InspectionProvincialScienceSmall provincialScienceSmall, String node, Long userid) {
+        Map<String, List> map = new HashMap();
+        List<String> unqualified = new ArrayList();
+
+        List<OrganizationInfo> infos = organizationInfoMapper.getOrgListByNode(provincialScienceSmall.getOrgname(), node);
+        OrganizationInfo info = new OrganizationInfo();
+        if (infos.size() > 0) {
+            info = infos.get(0);
+        } else {
+            //企业不存在,就存入企业库
+            List<LabelIntelligentCommonInfo> labelIntelligentCommonInfos = null;
+            if (StringUtils.isNotEmpty(provincialScienceSmall.getCategory())) {
+                labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", provincialScienceSmall.getCategory()).eq("node", node).eq("by1", "category"));
+                if (labelIntelligentCommonInfos.size() == 0) {
+                    labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", provincialScienceSmall.getCategory()).eq("node", 0).eq("by1", "category"));
+                }
+            }
+            info.setName(provincialScienceSmall.getOrgname());
+            info.setOrgtype(10104L);
+            info.setRegistrationdate(provincialScienceSmall.getRegisterdate());
+            info.setContact(StringUtils.isNotEmpty(provincialScienceSmall.getContract()) ? provincialScienceSmall.getContract() : "");
+            info.setContactnum(StringUtils.isNotEmpty(provincialScienceSmall.getContracttel()) ? provincialScienceSmall.getContracttel() : "");
+            info.setOrgcode(StringUtils.isNotEmpty(provincialScienceSmall.getOrgcode()) ? provincialScienceSmall.getOrgcode() : "");
+            info.setCategoryid(CollectionUtils.isNotEmpty(labelIntelligentCommonInfos) ? labelIntelligentCommonInfos.get(0).getCode() : "");
+            info.setWorkercount(provincialScienceSmall.getWorkercount() != null ? provincialScienceSmall.getWorkercount() : 0);
+            info.setTechnicalpersonnelcount(provincialScienceSmall.getTechnicalcount() != null ? provincialScienceSmall.getTechnicalcount() : 0);
+            info.setPatentcount(provincialScienceSmall.getPatentcount() != null ? provincialScienceSmall.getPatentcount() : 0);
+            info.setCreator(userid);
+            info.setUpdator(userid);
+            info.setIsenabled(1);
+            organizationInfoMapper.insert(info);
+
+            insertRelevant(info,node,userid);
+        }
+
+        provincialScienceSmall.setOrgid(info.getId());
+
+        //注册地在杭州市行政区域内
+        if (provincialScienceSmall.getRegisteraddress().equals("非杭州市")) {
+            unqualified.add("注册地址要在杭州市行政区域内");
+        }
+
+        //注册成立时间大于一年
+        if (provincialScienceSmall.getRegisterdate() != null) {
+            Calendar c = Calendar.getInstance();
+            c.setTime(provincialScienceSmall.getRegisterdate());
+            c.add(Calendar.YEAR,1);
+            if (c.getTime().getTime() >= new Date().getTime()) {
+                unqualified.add("注册成立时间要大于等于一年");
+            }
+        }
+
+        //专职科技人员数 \ 职工总数 >= 10%
+        double rate = provincialScienceSmall.getTechnicalcount() / provincialScienceSmall.getWorkercount();
+        provincialScienceSmall.setTechnicalinworkerrate(rate);
+        if (rate < 0.01) {
+            unqualified.add("专职科技人员数要大于等于职工总数的10%");
+        }
+
+        //有基于自主知识产权、专有技术或先进知识获得的产品或服务
+        if (provincialScienceSmall.getIshasproprietarytechnology() == 0) {
+            unqualified.add("必须有基于自主知识产权、专有技术或先进知识获得的产品或服务");
+        }
+
+        //上年度销售收入,根据《中小企业划型标准规定》判定企业规模,需要符合中小企业要求 todo 需求存在问题
+
+
+        //上年度研发投入 > 0
+        if (provincialScienceSmall.getLastyearresearch() <= 0) {
+            unqualified.add("上年度没有研发投入");
+        }
+
+        //独立核算、自主经营、自负盈亏
+        if(provincialScienceSmall.getIsindependentmanagement() == 0) {
+            unqualified.add("必须独立核算、自主经营、自负盈亏");
+        }
+
+        //企业上年度不能发生重大安全、重大质量事故、有严重环境违法或严重失信行为
+        if (provincialScienceSmall.getIslastyearshasincident() == 1) {
+            unqualified.add("企业上年度存在重大安全、重大质量事故、有严重环境违法或严重失信行为");
+        }
+
+        StringBuilder stringBuilder = new StringBuilder();
+        unqualified.forEach(u -> {
+            stringBuilder.append(u + ",");
+        });
+        provincialScienceSmall.setInconformity(stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString());
+        provincialScienceSmallMapper.insert(provincialScienceSmall);
+
+        //不合格条件
+        if (unqualified.size() > 0) {
+            map.put(provincialScienceSmall.getOrgname() + " 不符合省科小认定条件", unqualified);
+        } else {
+            map.put(provincialScienceSmall.getOrgname() + " 符合省科小认定条件", null);
+        }
+        return map;
+    }
+
+    //省级研发中心自检
+    public Map<String, List> insertProvincial(InspectionProvincial inspectionProvincial, String node, Long userid) {
+        Map<String, List> map = new HashMap();
+        List<String> unqualified = new ArrayList();
+
+        List<OrganizationInfo> infos = organizationInfoMapper.getOrgListByNode(inspectionProvincial.getOrgname(), node);
+        OrganizationInfo info = new OrganizationInfo();
+        if (infos.size() > 0) {
+            info = infos.get(0);
+        } else {
+            //企业信息不存在,就存入企业库
+            List<LabelIntelligentCommonInfo> labelIntelligentCommonInfos = null;
+            if (StringUtils.isNotEmpty(inspectionProvincial.getCategory())) {
+                labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionProvincial.getCategory()).eq("node", node).eq("by1", "category"));
+                if (labelIntelligentCommonInfos.size() == 0) {
+                    labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionProvincial.getCategory()).eq("node", 0).eq("by1", "category"));
+                }
+            }
+            info.setName(inspectionProvincial.getOrgname());
+            info.setOrgtype(10104L);
+            info.setRegistrationdate(inspectionProvincial.getRegisterdate());
+            info.setContact(StringUtils.isNotEmpty(inspectionProvincial.getContract()) ? inspectionProvincial.getContract() : "");
+            info.setContactnum(StringUtils.isNotEmpty(inspectionProvincial.getContracttel()) ? inspectionProvincial.getContracttel() : "");
+            info.setOrgcode(StringUtils.isNotEmpty(inspectionProvincial.getOrgcode()) ? inspectionProvincial.getOrgcode() : "");
+            info.setCategoryid(CollectionUtils.isNotEmpty(labelIntelligentCommonInfos) ? labelIntelligentCommonInfos.get(0).getCode() : "");
+            info.setWorkercount(inspectionProvincial.getThisyearworkercount() != null ? inspectionProvincial.getThisyearworkercount() : 0);
+            info.setTechnicalpersonnelcount(inspectionProvincial.getTechnicalcount() != null ? inspectionProvincial.getTechnicalcount() : 0);
+            info.setIntellectualpropertyone(inspectionProvincial.getOneintellectualcount() != null ? inspectionProvincial.getOneintellectualcount() : 0);
+            info.setIntellectualpropertytwo(inspectionProvincial.getTwointellectualcount() != null ? inspectionProvincial.getTwointellectualcount() : 0);
+            info.setPatentcount(inspectionProvincial.getPatentcount() != null ? inspectionProvincial.getPatentcount() : 0);
+            info.setPatentforutilitycount(inspectionProvincial.getPracticalpatentcount() != null ? inspectionProvincial.getPracticalpatentcount() : 0);
+            info.setPatentfordesigncount(inspectionProvincial.getAppearancepatentcount() != null ? inspectionProvincial.getAppearancepatentcount() : 0);
+            info.setPatentforsoftwarecount(inspectionProvincial.getPatentforsoftwarecount() != null ? inspectionProvincial.getPatentforsoftwarecount() : 0);
+            info.setCreator(userid);
+            info.setUpdator(userid);
+            info.setIsenabled(1);
+            organizationInfoMapper.insert(info);
+
+            insertRelevant(info, node, userid);
+        }
+
+        inspectionProvincial.setOrgid(info.getId());
+
+        //注册地在浙江省行政区域内
+        if (inspectionProvincial.getRegisteraddress().equals("非浙江省")) {
+            unqualified.add("注册地必须是在浙江省行政区域内");
+        }
+
+        //注册成立时间≥1年
+        if (inspectionProvincial.getRegisterdate() != null) {
+            Calendar c = Calendar.getInstance();
+            c.setTime(inspectionProvincial.getRegisterdate());
+            c.add(Calendar.YEAR,1);
+            if (c.getTime().getTime() >= new Date().getTime()) {
+                unqualified.add("注册成立时间要大于等于一年");
+            }
+        }
+
+        //专职研究开发人员数 >= 15(软件类企业大于等于30人)
+        if (inspectionProvincial.getIssoftwareenterprise() == 1 && inspectionProvincial.getTechnicalcount() < 30) {
+            unqualified.add("软件类企业专职研究开发人员要大于等于30人");
+        } else if (inspectionProvincial.getIssoftwareenterprise() == 0 && inspectionProvincial.getTechnicalcount() < 15){
+            unqualified.add("非软件类企业专职研究开发人员数要大于等于15");
+        }
+
+        //科技人员数 / 职工总数 >= 10%
+        double rate = inspectionProvincial.getTechnicalcount() / inspectionProvincial.getThisyearworkercount();
+        if (rate < 0.1) {
+            unqualified.add("科技人员数要大于等于企业职工总数的10%");
+        }
+        inspectionProvincial.setTechnicalinworkerrate(rate);
+
+        //本科以上学历或中级以上职称的工程技术人员数 / 专职研究开发人员数 >= 60%
+        double rate1 = inspectionProvincial.getBachelororaboveeducation() / inspectionProvincial.getTechnicalcount();
+        if (rate1 < 0.6) {
+            unqualified.add("本科以上学历或中级以上职称的工程技术人员数要大于或等于专职研究开发人员数的60%");
+        }
+        inspectionProvincial.setBachelorintechrate(rate1);
+
+        //建有市级高新技术企业研发中心
+        if (inspectionProvincial.getIshasmunicipalresearchcenter() == 0) {
+            unqualified.add("企业必须建有市级高新技术企业研究中心");
+        }
+
+        //近三年累计转化科技成果 >= 15
+        if (inspectionProvincial.getThreeyearchangeachievement() < 15) {
+            unqualified.add("近三年累计转化科技成果要大于等于15");
+        }
+
+        //Ⅰ类知识产权数 >= 1
+        if (inspectionProvincial.getOneintellectualcount() < 1) {
+            unqualified.add("Ⅰ类知识产权数要大于都等于1");
+        }
+
+        //Ⅱ类知识产权数
+        if (inspectionProvincial.getTwointellectualcount() < 6) {
+            unqualified.add("Ⅱ类知识产权数要大于等于6");
+        }
+
+        /**
+         * 上年度研发投入 / 上年度销售收入
+         *
+         * 1、若销售收入<5000万元,需≥6%;
+         * 2、若5000万元≤销售收入<20000万元,需≥4%;且开发费用≥于300万元;
+         * 3、若销售收入≥20000万元,需≥3%,且研究开发费用>800万元;
+         * 4、若销售收入≥20000万元,研究开发费用达到1000万元以上
+         */
+        double rate2 = inspectionProvincial.getLastyearresearchtotal() / inspectionProvincial.getLastyearresearchtotal();
+        inspectionProvincial.setResearchinsalerate(rate2);
+        if (inspectionProvincial.getLastyearsaletotal() < 5000 && rate2 < 0.06) {
+            unqualified.add("销售收入小于5000万元,则研发投入需占销售收入的6%以上");
+        } else if (inspectionProvincial.getLastyearsaletotal() >= 5000 && inspectionProvincial.getLastyearsaletotal() < 20000 && rate2 < 0.04 && inspectionProvincial.getLastyearresearchtotal() < 300) {
+            unqualified.add("销售收入大于等于5000万元且小于20000万元,则研发投入需占销售收入的4%以上并且研发费用大于等于300万元");
+        } else if (inspectionProvincial.getLastyearsaletotal() >= 20000 && rate2 < 0.03 && inspectionProvincial.getLastyearresearchtotal() <= 800) {
+            unqualified.add("销售收入大于等于20000元,则研发投入需占销售收入的3%以上并且研发费用需大于800万元");
+        } else if (inspectionProvincial.getLastyearsaletotal() >= 20000 && inspectionProvincial.getLastyearresearchtotal() <= 1000) {
+            unqualified.add("销售收入大于等于20000元,则研发费用需达到1000万元以上");
+        }
+
+        //研发场地面积 >= 500平方
+        if(inspectionProvincial.getSitearea() < 500) {
+            unqualified.add("研发场地面积要大于等于500平方米");
+        }
+
+        /**
+         * 科研设备原值总额
+         *  1.软件类企业 >= 100万元
+         *  2.其他企业 >= 500万元
+         */
+        if (inspectionProvincial.getIssoftwareenterprise() == 1 && inspectionProvincial.getResearchtotal() < 100) {
+            unqualified.add("软件类企业科研设备原值总额要大于等于100万元");
+        } else if (inspectionProvincial.getResearchtotal() < 500){
+            unqualified.add("企业科研设备原值总额要大于等于500万元");
+        }
+
+        //科研生产共用的设备原值总额 / 科研设备原值总额 <= 30%
+        double rate3 = inspectionProvincial.getSharetotal() / inspectionProvincial.getResearchtotal();
+        inspectionProvincial.setShareinresearchrate(rate3);
+        if (rate3 > 0.3) {
+            unqualified.add("科研生产共用的设备原值总额需大于等于科研设备原值总额的30%");
+        }
+
+        //建立完整规范的技术创新管理体制
+        if (0 == inspectionProvincial.getIshasmunicipalresearchcenter()) {
+            unqualified.add("企业需有完整规范的技术创新管理体制");
+        }
+
+        //企业申请认定前一年度至申请之日内未发生重大的安全、质量事故,严重的环境违法、知识产权违法、税务违法、科研失信等行为
+        if (1 == inspectionProvincial.getIshasillegalbehaviorinlastyear()) {
+            unqualified.add("企业申请认定前一年度至申请之日内发生过重大的安全、质量事故,严重的环境违法、知识产权违法、税务违法、科研失信等行为");
+        }
+
+        StringBuilder stringBuilder = new StringBuilder();
+        unqualified.forEach(u -> {
+            stringBuilder.append(u + ",");
+        });
+        inspectionProvincial.setInconformity(stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString());
+        inspectionProvincialMapper.insert(inspectionProvincial);
+
+        if (unqualified.size() > 0) {
+            map.put(inspectionProvincial.getOrgname() + " 不符合省级研发中心认定条件", unqualified);
+        } else {
+            map.put(inspectionProvincial.getOrgname() + " 符合省级研发中心认定条件", null);
+        }
+        return map;
+    }
+
+    //省级企业研究院
+    public Map<String, List> insertProvincial2(InspectionProvincial inspectionProvincial, String node, Long userid) {
+        Map<String, List> map = new HashMap();
+        List<String> unqualified = new ArrayList();
+
+        List<OrganizationInfo> infos = organizationInfoMapper.getOrgListByNode(inspectionProvincial.getOrgname(), node);
+        OrganizationInfo info = new OrganizationInfo();
+        if (infos.size() > 0) {
+            info = infos.get(0);
+        } else {
+            //企业信息不存在,就存入企业库
+            List<LabelIntelligentCommonInfo> labelIntelligentCommonInfos = null;
+            if (StringUtils.isNotEmpty(inspectionProvincial.getCategory())) {
+                labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionProvincial.getCategory()).eq("node", node).eq("by1", "category"));
+                if (labelIntelligentCommonInfos.size() == 0) {
+                    labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionProvincial.getCategory()).eq("node", 0).eq("by1", "category"));
+                }
+            }
+            info.setName(inspectionProvincial.getOrgname());
+            info.setOrgtype(10104L);
+            info.setRegistrationdate(inspectionProvincial.getRegisterdate());
+            info.setContact(StringUtils.isNotEmpty(inspectionProvincial.getContract()) ? inspectionProvincial.getContract() : "");
+            info.setContactnum(StringUtils.isNotEmpty(inspectionProvincial.getContracttel()) ? inspectionProvincial.getContracttel() : "");
+            info.setOrgcode(StringUtils.isNotEmpty(inspectionProvincial.getOrgcode()) ? inspectionProvincial.getOrgcode() : "");
+            info.setCategoryid(CollectionUtils.isNotEmpty(labelIntelligentCommonInfos) ? labelIntelligentCommonInfos.get(0).getCode() : "");
+            info.setWorkercount(inspectionProvincial.getThisyearworkercount() != null ? inspectionProvincial.getThisyearworkercount() : 0);
+            info.setTechnicalpersonnelcount(inspectionProvincial.getTechnicalcount() != null ? inspectionProvincial.getTechnicalcount() : 0);
+            info.setIntellectualpropertyone(inspectionProvincial.getOneintellectualcount() != null ? inspectionProvincial.getOneintellectualcount() : 0);
+            info.setIntellectualpropertytwo(inspectionProvincial.getTwointellectualcount() != null ? inspectionProvincial.getTwointellectualcount() : 0);
+            info.setCreator(userid);
+            info.setUpdator(userid);
+            info.setIsenabled(1);
+            organizationInfoMapper.insert(info);
+
+            insertRelevant(info, node, userid);
+        }
+
+        inspectionProvincial.setOrgid(info.getId());
+
+        //注册地在浙江省行政区域内
+        if (inspectionProvincial.getRegisteraddress().equals("非浙江省")) {
+            unqualified.add("注册地必须是在浙江省行政区域内");
+        }
+
+        //注册成立时间≥1年
+        if (inspectionProvincial.getRegisterdate() != null) {
+            Calendar c = Calendar.getInstance();
+            c.setTime(inspectionProvincial.getRegisterdate());
+            c.add(Calendar.YEAR,1);
+            if (c.getTime().getTime() >= new Date().getTime()) {
+                unqualified.add("注册成立时间要大于等于一年");
+            }
+        }
+
+        //专职研究开发人员数 >= 50 软件类企业大于等于100人
+        if (inspectionProvincial.getIssoftwareenterprise() == 1 && inspectionProvincial.getTechnicalcount() < 100) {
+            unqualified.add("软件类企业专职研究开发人员数要大于等于100");
+        } else if (inspectionProvincial.getIssoftwareenterprise() == 0 && inspectionProvincial.getIssoftwareenterprise() < 50) {
+            unqualified.add("企业专职研究开发人员数要大于等于50");
+        }
+
+        //科技人员数 / 职工总数 >= 10%
+        double rate = inspectionProvincial.getTechnicalcount() / inspectionProvincial.getThisyearworkercount();
+        if (rate < 0.1) {
+            unqualified.add("科技人员数要大于等于企业职工总数的10%");
+        }
+        inspectionProvincial.setTechnicalinworkerrate(rate);
+
+        //本科以上学历或中级以上职称的工程技术人员数 / 专职研究开发人员数 >= 60%
+        double rate1 = inspectionProvincial.getBachelororaboveeducation() / inspectionProvincial.getTechnicalcount();
+        if (rate1 < 0.6) {
+            unqualified.add("本科以上学历或中级以上职称的工程技术人员数要大于或等于专职研究开发人员数的60%");
+        }
+        inspectionProvincial.setBachelorintechrate(rate1);
+
+        //Ⅰ类知识产权数 >= 1
+        if (inspectionProvincial.getOneintellectualcount() < 2) {
+            unqualified.add("Ⅰ类知识产权数要大于都等于1");
+        }
+
+        //知识产权获得方式必须是自主研发
+        if (!inspectionProvincial.getObtainway().equals("有自主研发")) {
+            unqualified.add("知识产权获得方式必须是自主研发");
+        }
+
+        //上年度销售收入 >= 1亿元
+        if (inspectionProvincial.getLastyearsaletotal() < 10000) {
+            unqualified.add("上年度销售收入要大于等于1亿元");
+        }
+
+        //上年度研究开发费用 >= 1200万元 || 上年度研发投入 / 上年度销售收入 >= 4%
+        double rate3 = inspectionProvincial.getLastyearresearchtotal() / inspectionProvincial.getLastyearsaletotal();
+        if (!(inspectionProvincial.getLastyearresearchtotal() >= 1200 || rate3 >= 0.04)) {
+            unqualified.add("上年度研究开发费用要大于等于1200万元或者上年度研发投入要大于等于上年度销售收入的4%");
+        }
+        inspectionProvincial.setResearchinsalerate(rate3);
+
+        //研发场地面积 >= 1000平方米
+        if (inspectionProvincial.getSitearea() < 1000) {
+            unqualified.add("研发场地面积要大于等于1000平方米");
+        }
+
+        //科研设备原值总额 >= 1000万元
+        if (inspectionProvincial.getResearchtotal() < 1000) {
+            unqualified.add("科研设备原值总额要大于等于1000万元");
+        }
+
+        //企业申请认定前一年度至申请之日内未发生重大的安全、质量事故,严重的环境违法、知识产权违法、税务违法、科研失信等行为
+        if (1 == inspectionProvincial.getIshasillegalbehaviorinlastyear()) {
+            unqualified.add("企业申请认定前一年度至申请之日内发生过重大的安全、质量事故,严重的环境违法、知识产权违法、税务违法、科研失信等行为");
+        }
+
+        StringBuilder stringBuilder = new StringBuilder();
+        unqualified.forEach(u -> {
+            stringBuilder.append(u + ",");
+        });
+        inspectionProvincial.setInconformity(stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString());
+        inspectionProvincialMapper.insert(inspectionProvincial);
+
+        if (unqualified.size() > 0) {
+            map.put(inspectionProvincial.getOrgname() + " 不符合省级研究院认定条件", unqualified);
+        } else {
+            map.put(inspectionProvincial.getOrgname() + " 符合省级研究院认定条件", null);
+        }
+        return map;
+    }
+
+    //飞地研发中心自检
+    public Map<String, List> insertFeidi(InspectionFeidi inspectionFeidi, String node, Long userid) {
+        Map<String, List> map = new HashMap();
+        List<String> unqualified = new ArrayList();
+
+        List<OrganizationInfo> infos = organizationInfoMapper.getOrgListByNode(inspectionFeidi.getOrgname(), node);
+        OrganizationInfo info = new OrganizationInfo();
+        if (infos.size() > 0) {
+            info = infos.get(0);
+        } else {
+            //企业信息不存在,就存入企业库
+            List<LabelIntelligentCommonInfo> labelIntelligentCommonInfos = null;
+            if (StringUtils.isNotEmpty(inspectionFeidi.getCategory())) {
+                labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionFeidi.getCategory()).eq("node", node).eq("by1", "category"));
+                if (labelIntelligentCommonInfos.size() == 0) {
+                    labelIntelligentCommonInfos = labelIntelligentCommonInfoMapper.selectList(new EntityWrapper<LabelIntelligentCommonInfo>().eq("name", inspectionFeidi.getCategory()).eq("node", 0).eq("by1", "category"));
+                }
+            }
+            info.setName(inspectionFeidi.getOrgname());
+            info.setOrgtype(10104L);
+            info.setRegistrationdate(inspectionFeidi.getRegisterdate());
+            info.setContact(StringUtils.isNotEmpty(inspectionFeidi.getContract()) ? inspectionFeidi.getContract() : "");
+            info.setContactnum(StringUtils.isNotEmpty(inspectionFeidi.getContracttel()) ? inspectionFeidi.getContracttel() : "");
+            info.setOrgcode(StringUtils.isNotEmpty(inspectionFeidi.getOrgcode()) ? inspectionFeidi.getOrgcode() : "");
+            info.setCategoryid(CollectionUtils.isNotEmpty(labelIntelligentCommonInfos) ? labelIntelligentCommonInfos.get(0).getCode() : "");
+            info.setWorkercount(inspectionFeidi.getThisyearworkercount() != null ? inspectionFeidi.getThisyearworkercount() : 0);
+            info.setTechnicalpersonnelcount(inspectionFeidi.getTechnicalcount() != null ? inspectionFeidi.getTechnicalcount() : 0);
+
+            organizationInfoMapper.insert(info);
+
+            insertRelevant(info, node, userid);
+        }
+        inspectionFeidi.setOrgid(info.getId());
+
+        //所属行业领域,属于《国家重点支持的高新技术领域》
+        List<String> list = Stream.of("电子信息","生物与新医药","航空航天","新材料","高技术服务","新能源与节能","资源与环境","高新技术改造传统产业").collect(Collectors.toList());
+        if (!list.contains(inspectionFeidi.getCategory())) {
+            unqualified.add("所属行业领域不属于国家重点支持的高新技术领域");
+        }
+
+        //专职研究开发人员数 >= 10
+        if (inspectionFeidi.getTechnicalcount() < 10) {
+            unqualified.add("专职研究开发人数要大于等于10");
+        }
+
+        //科技人员数 / 职工总数 >= 80%
+        double rate = inspectionFeidi.getTechnicalcount() / inspectionFeidi.getThisyearworkercount();
+        if (rate < 0.8) {
+            unqualified.add("科技人员数要大于等于职工总数的80%");
+        }
+        inspectionFeidi.setTechnicalinworkerrate(rate);
+
+        //专职研究开发人员中,有中级职称以上人员数 + 专职研究开发人员中,最高学历为硕士研究生及以上学历人员数 >= 1
+        if ((inspectionFeidi.getIntermediateprofessionaltitleorabove() + inspectionFeidi.getMasterdegreecandidate()) < 1) {
+            unqualified.add("专职研究开发人员中,有中级职称以上人员数与最高学历为硕士研究生及以上学历人员数相加要大于等于1");
+        }
+
+        //专职研究开发人员中,最高学历为硕士研究生及以上学历人员数 + 专职研究开发人员中,最高学历为本科且没有中级以上职称的人员数 >= 5
+        if ((inspectionFeidi.getMasterdegreecandidate() + inspectionFeidi.getUndergraduateandnohasintermediate()) >= 5) {
+            unqualified.add("专职研究开发人员中,最高学历为硕士研究生及以上学历人员数与最高学历为本科且没有中级以上职称的人员数相加要大于等于5");
+        }
+
+        //专职研究开发人员在研发中心从事研发工作183天以上
+        if (inspectionFeidi.getWorkleasthalfyear() == 0) {
+            unqualified.add("专职研究开发人员要在研发中心从事研发工作183天以上");
+        }
+
+        //专职研究开发人员从事相关工作不少于2年
+        if (inspectionFeidi.getWorktimeuptwoyear() == 0) {
+            unqualified.add("专职研究开发人员要从事相关工作不少于2年");
+        }
+
+        //近三年Ⅰ类知识产权数 >= 1
+        if (inspectionFeidi.getThreeyearoneintellectualcount() < 1) {
+            unqualified.add("近三年Ⅱ类知识产权数要大于等于1");
+        }
+
+        //近三年Ⅱ类知识产权数 >= 3
+        if (inspectionFeidi.getThreeyeartwointellectualcount() < 3) {
+            unqualified.add("近三年Ⅱ类知识产权数要大于等于3");
+        }
+
+        //县级以上科研项目数 >= 1
+        if (inspectionFeidi.getAbovecountylevel() < 1) {
+            unqualified.add("县级以上科研项目数要大于等于1");
+        }
+
+        //企业内部立项技术创新项目数 >= 3
+        if (inspectionFeidi.getInorginnovatecount() < 3) {
+            unqualified.add("企业内部立项技术创新项目数要大于等于3");
+        }
+
+        //上年度研究开发费用 >= 100万元
+        if (inspectionFeidi.getLastyearresearchtotal() < 100) {
+            unqualified.add("上年度研究开发费用要大于等于100万元");
+        }
+
+        //上年度研发投入 / 上年度销售收入 >= 1%
+        double rate1 = inspectionFeidi.getLastyearresearchtotal() / inspectionFeidi.getLastyearsaletotal();
+        if (rate1 < 0.01) {
+            unqualified.add("上年度研发投入要大于等于上年度销售收入的1%");
+        }
+        inspectionFeidi.setResearchinsalerate(rate1);
+
+        //上一年度专职研究开发人员平均薪金 >= 10万元
+        if (inspectionFeidi.getLastyearavgpay() < 10) {
+            unqualified.add("上一年度专职研究开发人员平均工资要大于等于10万元");
+        }
+
+        //研发场地面积 >= 100平方米
+        if (inspectionFeidi.getResearcharea() < 100) {
+            unqualified.add("研发场地面积要大于等于100平方米");
+        }
+
+        //申报前一年度内,未列入严重失信名单
+        if (inspectionFeidi.getNohaspromise() == 0) {
+            unqualified.add("申报前一年度内不得列入严重失信名单");
+        }
+
+        StringBuilder stringBuilder = new StringBuilder();
+        unqualified.forEach(u -> {
+            stringBuilder.append(u + ",");
+        });
+        inspectionFeidi.setInconformity(stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString());
+
+        inspectionFeidiMapper.insert(inspectionFeidi);
+
+        //不合格条件
+        if (unqualified.size() > 0) {
+            map.put(inspectionFeidi.getOrgname() + " 不符合飞地研发中心认定条件", unqualified);
+        } else {
+            map.put(inspectionFeidi.getOrgname() + " 符合飞地研发中心认定条件", null);
+        }
+        return map;
+    }
+
+    //企业自检时,企业库没有该企业插入时需要插入的相关步骤
+    public void insertRelevant(OrganizationInfo info, String node, Long userid) {
+        CompanyNodeLk lk = new CompanyNodeLk();
+        lk.setCompanyid(info.getId());
+        lk.setComefrom(node);
+        lk.setCreator(userid);
+        lk.setUpdater(userid);
+        Resourcelibrary resourcelibrary = dataEntryResource.transferToResourceLibrary(info, node);
+        resourcelibrary.setCreator(userid);
+        resourcelibrary.setUpdater(userid);
+        resourcelibraryMapper.insert(resourcelibrary);
+        String claid = interviewDataEntryService.getClaid(node, userid);
+        dataEntryResource.insertResclaid(resourcelibrary, claid);
+        dataEntryResource.insertResTypeLk(resourcelibrary, resourcelibrary.getRestype());
+        Map<String, Object> m = commonService.getObjectDefalutAuthority(resourcelibrary.getTablename(), userid);
+        resourcelibrary.setMap(m);
+        commonService.insertAuthority(resourcelibrary);
+        dataEntryResource.insertES(resourcelibrary, claid, node);
+    }
+
 }