Forráskód Böngészése

溧水节点一键导入(企业专利信息模板,专家库专家信息模板,平台库平台信息模板)

liyisong 4 éve
szülő
commit
679f2df04e

+ 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.110:9300,192.168.1.110:9301,192.168.1.110:9302
+      cluster-nodes: 192.168.1.114:9300,192.168.1.114:9301,192.168.1.114:9302
       #      typename: esttc
       #      indexname: ttcdev
       #      label_common_indexname: label_common_dev

+ 78 - 2
ttc-backen/src/main/java/cn/ubitech/ttc/common/utils/ExcelPatternMsgUtils.java

@@ -151,8 +151,13 @@ public class ExcelPatternMsgUtils {
     /**
      * 溧水节点模板表头
      */
-    // todo 待完成。
-
+    // todo 待完成
+    //企业专利信息模板表头
+    public static final String PATENT_TL_HEAD_LISHUI = "{0:\"企业名称\",1:\"统一社会信用代码\",2:\"专利名称\",3:\"申请号\",4:\"申请日\",5:\"专利类型\",6:\"专利权人\",7:\"授权号\"}";
+    //专家库专家信息模板表头
+    public static final String EXPERT_TL_HEAD_LISHUI = "{0:\"所属单位\",1:\"所属院校\",2:\"专家姓名\",3:\"研究领域\",4:\"学历\",5:\"职称/职位\",6:\"联系方式\",7:\"邮箱\",8:\"简介≤200字\",9:\"关键词(输入多个标签时以“,”隔开\"}";    // 政策库政策信息模板表头
+    //平台库平台信息模板表头
+    public static final String PLATFORM_TL_HEAD_LISHUI = "{0:\"级别\",1:\"平台名称\",2:\"联系地址\",3:\"孵化面积/㎡\",4:\"运营单位\",5:\"统一社会信用代码\",6:\"联系人\",7:\"联系方式\",8:\"截止目前在孵企业数量\",9:\"截止目前毕业企业数量\",10:\"备注\",11:\"简介\"}";
 
     // public static void main(String[] args) {
     //     System.out.println(Pattern.matches(DATE1, "2020/02/30"));
@@ -554,6 +559,32 @@ public class ExcelPatternMsgUtils {
         return excelData;
     }
 
+    /**
+     * 平台库
+     * @return
+     */
+    public static PlatformInfoExcelDate initLishuiPlatformHeadInfo() {
+        String initHead = PLATFORM_TL_HEAD_LISHUI;
+        Map<Integer,Object> map = JSONObject.parseObject(initHead, Map.class);
+        //级别    平台名称    联系地址    孵化面积/㎡  运营单位    统一社会信用代码
+        //联系人   联系方式    截止目前在孵企业数量  截止目前毕业企业数量  备注  简介
+        PlatformInfoExcelDate platformInfoExcelDate = PlatformInfoExcelDate.builder()
+                .category(map.get(0).toString())
+                .title(map.get(1).toString())
+                .address(map.get(2).toString())
+                .factoryarea(map.get(3).toString())
+                .affiliatedorg(map.get(4).toString())
+                .code(map.get(5).toString())
+                .contactor(map.get(6).toString())
+                .tel(map.get(7).toString())
+                .techtype(map.get(8).toString())
+                .starType(map.get(9).toString())
+                .remark(map.get(10).toString())
+                .content(map.get(11).toString())
+                .build();
+        return platformInfoExcelDate;
+    }
+
 
 
 
@@ -596,4 +627,49 @@ public class ExcelPatternMsgUtils {
         }
         return -1;
     }
+
+    //溧水节点专利类型
+    public static Integer checkIntelTypeLiShui(String intelType){
+        if (intelType.equals("发明专利"))
+            return 10802;
+        if (intelType.equals("实用新型"))
+            return 10801;
+        if (intelType.equals("外观设计"))
+            return 10808;
+        if (intelType.equals("PTC"))
+            return 10810;
+        return -1;
+    }
+
+    //溧水节点学历类型
+    public static Integer checkAcademicdegreeTypeLishui(String academicdegreeType) {
+        if (academicdegreeType.equals("博士研究生"))
+            return 3743;
+        if (academicdegreeType.equals("硕士研究生"))
+            return 3744;
+        if (academicdegreeType.equals("本科"))
+            return 3745;
+        if (academicdegreeType.equals("专科"))
+            return 3746;
+        if (academicdegreeType.equals("其他"))
+            return 3747;
+        return -1;
+    }
+
+    //溧水节点平台平台类型
+    public static Integer checkPlatformLevelTypeLishui(String platformLevel) {
+        if (platformLevel.equals("国家级"))
+            return 3790;
+        if (platformLevel.equals("省级"))
+            return 3791;
+        if (platformLevel.equals("市级"))
+            return 3792;
+        if (platformLevel.equals("区级"))
+            return 3793;
+        if (platformLevel.equals("其他"))
+            return 3794;
+        return -1;
+    }
+
+
 }

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

@@ -535,6 +535,10 @@ public class Resourcelibrary extends AuthorityModel<Resourcelibrary> implements
      * (上一字段选是)技术合同预计签约时间 yyyy年mm月
      */
     private String expectsigncontractdate;
+    /**
+     * 导入文件唯一表示id
+     */
+    private String reqId;
     /**
      * 表名
      */

+ 13 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/excel/ExcelUtils.java

@@ -164,6 +164,19 @@ public class ExcelUtils {
         return parsedDataSets.get();
     }
 
+    /**
+     * todo lys 解析平台库平台信息数据
+     * @param filePath
+     * @return
+     */
+    public static List<PlatformInfoExcelDate> parsePlatformInfoExcelDate(String filePath) {
+        AtomicReference<List<PlatformInfoExcelDate>> parsedDataSets = new AtomicReference<>();
+        read(filePath,PlatformInfoExcelDate.class,new PlatformInfoExcelDateListener(parsedDaaSetList -> {
+            parsedDataSets.set(parsedDaaSetList);
+        })).sheet("Sheet1").headRowNumber(2).doRead();
+        return parsedDataSets.get();
+    }
+
     /**
      * 文件大小获取转换。
      * @param size

+ 2 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/EnterprisePatentInfoExcelData.java

@@ -71,4 +71,6 @@ public class EnterprisePatentInfoExcelData {
     private JSONObject errorMsg;
     private JSONObject repeatInfo;
     private JSONObject unExistInfo;
+
+    private String node;
 }

+ 7 - 2
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/EnterprisePatentInfoExcelDataListener.java

@@ -84,7 +84,7 @@ public class EnterprisePatentInfoExcelDataListener extends AnalysisEventListener
         log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
         Map<Integer, Map<Integer, String>> map = new HashMap<>();
         map.put(context.readRowHolder().getRowIndex(), headMap);
-        String patentStr = ExcelPatternMsgUtils.PATENT_TL_HEAD;
+        String patentStr = ExcelPatternMsgUtils.PATENT_TL_HEAD_LISHUI;
         if (map.containsKey(1)) {
             if (!JSON.toJSONString(map.get(1)).equals(patentStr)) {
                 resultMessage = ExcelPatternMsgUtils.HEAD_ERROR;
@@ -110,6 +110,11 @@ public class EnterprisePatentInfoExcelDataListener extends AnalysisEventListener
         // if (!StringUtils.isEmpty(excelData.getUnifiedSocialCreditCode()) && Util.isLetterDigit(excelData.getUnifiedSocialCreditCode()) == false){
         //     js.put("unifiedSocialCreditCode","纳税人识别号" + ExcelPatternMsgUtils.NUMBER_LETTER_MSG);
         // }
+        log.info("企业专利信息excelDate:{}",excelData.getNode());
+        if (!StringUtils.isEmpty(excelData.getOrgcode())
+                && Util.isLetterDigit(excelData.getOrgcode()) == false){
+            js.put("orgcode","统一社会信用代码" + ExcelPatternMsgUtils.NUMBER_LETTER_MSG);
+        }
         System.out.println("applydate:" + excelData.getApplydate());
         if (!StringUtils.isEmpty(excelData.getApplydate()) && Util.isDate(excelData.getApplydate()) == false){
             // todo 待处理msg
@@ -121,7 +126,7 @@ public class EnterprisePatentInfoExcelDataListener extends AnalysisEventListener
         }
         System.out.println("intelType:" + excelData.getInteltype());
         System.out.println("intelType:" + ExcelPatternMsgUtils.checkIntelType(excelData.getInteltypename()));
-        if (!StringUtils.isEmpty(excelData.getInteltypename()) && ExcelPatternMsgUtils.checkIntelType(excelData.getInteltypename()) == -1){
+        if (!StringUtils.isEmpty(excelData.getInteltypename()) && ExcelPatternMsgUtils.checkIntelTypeLiShui(excelData.getInteltypename()) == -1){
             js.put("inteltype","专利类型必须为下拉选择项");
         }
 

+ 5 - 2
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/ExpertInfoExcelDataListener.java

@@ -83,7 +83,7 @@ public class ExpertInfoExcelDataListener extends AnalysisEventListener<ExpertInf
         log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
         Map<Integer, Map<Integer, String>> map = new HashMap<>();
         map.put(context.readRowHolder().getRowIndex(), headMap);
-        String expertStr = ExcelPatternMsgUtils.EXPERT_TL_HEAD;
+        String expertStr = ExcelPatternMsgUtils.EXPERT_TL_HEAD_LISHUI;
         if (map.containsKey(1)) {
             if (!JSON.toJSONString(map.get(1)).equals(expertStr)) {
                 resultMessage = ExcelPatternMsgUtils.HEAD_ERROR;
@@ -111,7 +111,7 @@ public class ExpertInfoExcelDataListener extends AnalysisEventListener<ExpertInf
         // }
         if (!StringUtils.isEmpty(excelData.getTel())){
             if (Util.isTelephone(excelData.getTel()) == false){
-                js.put("tel","联系方式," + ExcelPatternMsgUtils.TEL_OR_PHONE);
+                js.put("tel","联系方式," + ExcelPatternMsgUtils.TEL_OR_PHONE_MSG);
                 System.out.println("contactWay");
             }
         }
@@ -121,6 +121,9 @@ public class ExpertInfoExcelDataListener extends AnalysisEventListener<ExpertInf
         if (!StringUtils.isEmpty(excelData.getAbout()) && Util.toLength(excelData.getAbout(),200) == false){
             js.put("about","简介" + ExcelPatternMsgUtils.ZISHU_LIMIT);
         }
+        if (!StringUtils.isEmpty(excelData.getAcademicdegreename()) && ExcelPatternMsgUtils.checkAcademicdegreeTypeLishui(excelData.getAcademicdegreename()) == -1) {
+            js.put("academicdegree","学历类型必须为下拉选择项");
+        }
 
         System.out.println(js.toJSONString());
         list.add(js);

+ 59 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/PlatformInfoExcelDate.java

@@ -0,0 +1,59 @@
+package cn.ubitech.ttc.excel.entry;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.*;
+
+/**
+ * 平台库平台信息
+ * @author lys
+ * @create 2021-08-16 14:39
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class PlatformInfoExcelDate {
+
+    //平台级别
+    private String category;
+
+    //平台名称
+    private String title;
+
+    //联系地址
+    private String address;
+
+    //孵化面积
+    private String factoryarea;
+
+    //运营单位
+    private String affiliatedorg;
+
+    //统一社会信用代码
+    private String code;
+
+    //联系人
+    private String contactor;
+
+    //联系方式
+    private String tel;
+
+    //截至目前在孵企业数量
+    private String techtype;
+
+    //截止目前毕业企业数量
+    private String starType;
+
+    //备注
+    private String remark;
+
+    //简介
+    private String content;
+
+    private Long id;
+    private String errorRemark;
+    private JSONObject errorMsg;
+
+
+}

+ 146 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/excel/entry/PlatformInfoExcelDateListener.java

@@ -0,0 +1,146 @@
+package cn.ubitech.ttc.excel.entry;
+
+import cn.ubitech.ttc.common.Util;
+import cn.ubitech.ttc.common.utils.ExcelPatternMsgUtils;
+import cn.ubitech.ttc.excel.OnAllAnalysedListener;
+import cn.ubitech.ttc.exception.ErrorCode;
+import cn.ubitech.ttc.exception.ExcelHeadException;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Lists;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author lys
+ * @create 2021-08-16 15:00
+ */
+@Slf4j
+public class PlatformInfoExcelDateListener extends AnalysisEventListener<PlatformInfoExcelDate> {
+
+    private OnAllAnalysedListener<PlatformInfoExcelDate> onAllAnalysedListener;
+
+    private List<PlatformInfoExcelDate> platformInfoExcelDates = Lists.newArrayList();
+
+    /**
+     * 结果标记  默认错误
+     */
+    private boolean isCorrectFormat = true;
+
+    /**
+     * 结果信息
+     */
+    private String resultMessage = "";
+
+    /**
+     * 格式验证。
+     */
+    JSONObject js = new JSONObject();
+
+    public PlatformInfoExcelDateListener(OnAllAnalysedListener<PlatformInfoExcelDate> onAllAnalysedListener) {
+        this.onAllAnalysedListener = onAllAnalysedListener;
+    }
+
+    @Override
+    public void invoke(PlatformInfoExcelDate data, AnalysisContext context) {
+        if (resultMessage.equals(ExcelPatternMsgUtils.HEAD_NULL_ERROR)
+                || resultMessage.equals(ExcelPatternMsgUtils.HEAD_ERROR)) {
+            try {
+                throw new ExcelHeadException(ErrorCode.ERROR.getCode(), ErrorCode.ERROR.getMessage());
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        } else {
+            js = checkError(data);
+            data.setErrorRemark(js.toJSONString());
+            System.out.println("***>" + JSON.toJSONString(data));
+            platformInfoExcelDates.add(data);
+            js.clear();
+        }
+    }
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext context) {
+        onAllAnalysedListener.onAllAnalysed(platformInfoExcelDates);
+    }
+
+    /**
+     * 这里会一行行的返回头
+     *
+     * @param headMap
+     * @param context
+     */
+    @Override
+    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
+        log.info("解析到一条头数据:{}", JSON.toJSONString(headMap));
+        Map<Integer, Map<Integer, String>> map = new HashMap<>();
+        map.put(context.readRowHolder().getRowIndex(), headMap);
+        String expertStr = ExcelPatternMsgUtils.PLATFORM_TL_HEAD_LISHUI;
+        if (map.containsKey(1)) {
+            if (!JSON.toJSONString(map.get(1)).equals(expertStr)) {
+                resultMessage = ExcelPatternMsgUtils.HEAD_ERROR;
+                platformInfoExcelDates.clear();
+                isCorrectFormat = false;
+                log.info("head:{}",resultMessage);
+            }
+        }
+        // if (!map.containsKey(0))  {
+        //     resultMessage = ExcelPatternMsgUtils.HEAD_NULL_ERROR;
+        //     log.info("none head:{}",resultMessage);
+        // }
+    }
+
+    /**
+     * 解析各字段是否符合要求。
+     * @param excelData
+     * @return
+     */
+    public JSONObject checkError(PlatformInfoExcelDate excelData){
+        List<JSONObject> list = new ArrayList<>();
+        System.out.println(excelData.getTitle());
+        // if (!StringUtils.isEmpty(excelData.getExpertsName()) && Util.isChinese(excelData.getExpertsName()) == false){
+        //     js.put("expertsName","专家姓名" + ExcelPatternMsgUtils.CHINESE_MSG);
+        // }
+
+        if (!StringUtils.isEmpty(excelData.getContent()) && Util.toLength(excelData.getContent(),200) == false){
+            js.put("content","简介" + ExcelPatternMsgUtils.ZISHU_LIMIT);
+            System.out.println("PlatformBriefIntroduction");
+        }
+
+        if (!StringUtils.isEmpty(excelData.getRemark()) && Util.toLength(excelData.getRemark(),200) == false){
+            js.put("remark","备注" + ExcelPatternMsgUtils.ZISHU_LIMIT);
+            System.out.println("PlatformBriefIntroduction");
+        }
+
+        if (!StringUtils.isEmpty(excelData.getTel())){
+            if (Util.isTelephone(excelData.getTel()) == false){
+                js.put("tel","联系方式," + ExcelPatternMsgUtils.TEL_OR_PHONE_MSG);
+                System.out.println("contactWay");
+            }
+        }
+
+        if (!StringUtils.isEmpty(excelData.getCategory()) && ExcelPatternMsgUtils.checkPlatformLevelTypeLishui(excelData.getCategory()) == -1) {
+            js.put("academicdegree","学历类型必须为下拉选择项");
+        }
+
+        System.out.println(js.toJSONString());
+        list.add(js);
+        System.out.println("listttt>" + JSON.toJSONString(list));
+        return js;
+    }
+
+    /**
+     * 解析出现错误会进入该方法 具体看源代码或文档
+     */
+    @Override
+    public void onException(Exception exception, AnalysisContext context) throws Exception {
+        throw exception;
+    }
+}

+ 15 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/model/common/Constant.java

@@ -689,6 +689,21 @@ public class Constant {
     public static final String TONGLU_EIGHT = "政策库政策信息";
 
 
+    /**
+     * 一键导入(溧水节点)
+     */
+    //todo lys
+    public static final String LISHUI_ONE = "企业基本信息";
+    public static final String LISHUI_TWO = "企业税务数据";
+    public static final String LISHUI_THREE = "企业专利信息";
+    public static final String LISHUI_FOUR = "成果库成果信息";
+    public static final String LISHUI_FIVE = "金融库金融机构信息";
+    public static final String LISHUI_SIX = "人才库人才信息";
+    public static final String LISHUI_SEVEN = "专家库专家信息";
+    public static final String LISHUI_EIRHT = "政策库政策信息";
+    public static final String LISHUI_NINE = "平台库平台信息";
+    public static final String LISHUI_TEN = "技术经纪人库技术经理人信息";
+
     /**
      * 页码数
      */

+ 14 - 0
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/datatools/DataEntryResourceImpl.java

@@ -404,6 +404,20 @@ public class DataEntryResourceImpl {
         return resourcelibrary;
     }
 
+
+    /**
+     * 平台库信息插入资源库
+     */
+    public void insertPlatformInfoToResourceLibrary(Resourcelibrary resourcelibrary, String claid, String node) {
+        System.out.println("平台参数》》》" + resourcelibrary.toString());
+        //插入资源库
+        resourcelibraryMapper.insert(resourcelibrary);
+
+        insertResclaid(resourcelibrary,claid);
+        //插入es库
+        insertES(resourcelibrary,claid,node);
+    }
+
     /**
      * 技术经纪人插入资源库
      *

+ 7 - 3
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/datatools/InterviewDataEntryServiceImpl.java

@@ -581,7 +581,8 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
     @Transactional
     public ConnectioninfoModel insertOrUpdate(ConnectioninfoModel connectioninfoModel, String node, long pagecode, String pagetitle) {
         log.info("param connectioninfoModel:{}",connectioninfoModel.getOrgcontent());
-        if (connectioninfoModel.getOrglogo() == null && connectioninfoModel.getOrganizationInfo().getLogo() == null) {
+        //溧水节点企业录入logo为空根据企业关键词生成logo
+        if ("320117400".equals(node) && connectioninfoModel.getOrglogo() == null && connectioninfoModel.getOrganizationInfo().getLogo() == null) {
 //            String logo = imgService.drawPicture("");
 //            connectioninfoModel.setOrglogo(logo);
 //            connectioninfoModel.getOrganizationInfo().setLogo(logo);
@@ -1252,10 +1253,13 @@ public class InterviewDataEntryServiceImpl implements IDataEntryService {
         if (StringUtils.isNotEmpty(companyHighleveltalentsLk.getName())) {
 
             //todo lys
-            //丽水节点的企业库和专家库在在录入时未上传logo或者头像自动生成
-            if ("320117400".equals(node) && ("6".equals(companyHighleveltalentsLk.getRestype()) || "8".equals(companyHighleveltalentsLk.getRestype()))) {
+            //溧水节点专家库录入未上传头像根据姓氏生成头像
+            if ("320117400".equals(node)
+                    && companyHighleveltalentsLk.getPhoto() == null
+                    && "8".equals(companyHighleveltalentsLk.getRestype())) {
                 String surname = companyHighleveltalentsLk.getName().trim().substring(0, 1);
                 String logo = imgService.drawPicture(surname,companyHighleveltalentsLk.getRestype());
+                System.out.println("-------------------log:" + logo);
                 companyHighleveltalentsLk.setPhoto(logo);
             }
 

+ 355 - 19
ttc-backen/src/main/java/cn/ubitech/ttc/service/impl/entry/EntryServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.ubitech.ttc.service.impl.entry;
 
 import cn.ubitech.ttc.common.POIWordUtil;
+import cn.ubitech.ttc.common.SnowflakeIdWorker;
 import cn.ubitech.ttc.common.Util;
 import cn.ubitech.ttc.common.utils.DateUtils;
 import cn.ubitech.ttc.common.utils.ExcelPatternMsgUtils;
@@ -152,6 +153,9 @@ public class EntryServiceImpl implements EntryService {
     @Autowired
     private NodeClassificationLkMapper nodeClassificationLkMapper;
 
+    @Autowired
+    private ResourcelibraryMapper resourcelibraryMapper;
+
 
     /**
      * 获取可导入的文件类型列表.
@@ -940,9 +944,18 @@ public class EntryServiceImpl implements EntryService {
             entryTypes.add(EntryType.builder().fileType(Constant.SIX).modelName(Constant.TONGLU_SIX).build());
             entryTypes.add(EntryType.builder().fileType(Constant.SEVEN).modelName(Constant.TONGLU_SEVEN).build());
             entryTypes.add(EntryType.builder().fileType(Constant.EIGHT).modelName(Constant.TONGLU_EIGHT).build());
-        } else if (node.equals(Constant.NODE_320117400)) {
+        } else if (Integer.valueOf(node).equals(Constant.NODE_320117400)) {
             // todo 溧水
-
+            entryTypes.add(EntryType.builder().fileType(Constant.ONE).modelName(Constant.LISHUI_ONE).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.TWO).modelName(Constant.LISHUI_TWO).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.THREE).modelName(Constant.LISHUI_THREE).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.FOUR).modelName(Constant.LISHUI_FOUR).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.FIVE).modelName(Constant.LISHUI_FIVE).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.SIX).modelName(Constant.LISHUI_SIX).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.SEVEN).modelName(Constant.LISHUI_SEVEN).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.EIGHT).modelName(Constant.LISHUI_EIRHT).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.NINE).modelName(Constant.LISHUI_NINE).build());
+            entryTypes.add(EntryType.builder().fileType(Constant.TEN).modelName(Constant.LISHUI_TEN).build());
         }
         log.info("entryTypes:{}",JSON.toJSONString(entryTypes));
         return entryTypes;
@@ -997,6 +1010,8 @@ public class EntryServiceImpl implements EntryService {
                     // 待开发
                     list = toPolicyBasicInfo(parseList, nodeId, path, reqId, isDetails, isParsed);
                     break;
+                case Constant.NINE:
+                    list = toPlatformInfo(parseList,nodeId,path,reqId,isDetails,isParsed,uId);
                 default:
             }
             return list;
@@ -1115,7 +1130,7 @@ public class EntryServiceImpl implements EntryService {
             // false 解析excel内容,并入库。
             int savedId = 0;
             List<EnterpriseBasicInfoExcelData> excelDatas = new ArrayList<>();
-            if (isParsed == true) {
+            if (isParsed) {
                 // 解析excel内容。
                 try {
                     // 解析excel
@@ -1244,9 +1259,10 @@ public class EntryServiceImpl implements EntryService {
         }
     }
 
+    //解析企业专利或查询企业专利详情
     public List toEnterprisePatentInfo(List parseList, String nodeId, String filePath, String reqId, String uId, Boolean isDetails, Boolean isParsed) throws ParseException {
         // todo 20210107
-        if (isDetails == true) {
+        if (isDetails) {
             // 详情页
             List<CompanyIntellectualpropertyLk> intellectualpropertyLks = companyIntellectualpropertyLkMapper
                     .selectList(new EntityWrapper<CompanyIntellectualpropertyLk>()
@@ -1260,8 +1276,12 @@ public class EntryServiceImpl implements EntryService {
                 patentInfoExcelData.setOrgname(null != orgInfo ? orgInfo.getName() : "");
                 patentInfoExcelData.setOrgcode(null != orgInfo ? orgInfo.getOrgcode() : "");
                 patentInfoExcelData.setApplydate(DateUtils.dateToString(patentinfo.getApplydate()));
-                patentInfoExcelData.setLicensedate(DateUtils.dateToString(patentinfo.getLicensedate()));
-                patentInfoExcelData.setInteltypename(changePatentTypeToName(patentinfo.getInteltype()));
+                if ("320117400".equals(nodeId)) {  //溧水节点
+                    patentInfoExcelData.setInteltypename(changePatentTypeToName(patentinfo.getInteltype()));
+                } else if ("330122000".equals(nodeId)){  //桐庐节点
+                    patentInfoExcelData.setLicensedate(DateUtils.dateToString(patentinfo.getLicensedate()));
+                    patentInfoExcelData.setInteltypename(changePatentTypeToNameLiShui(patentinfo.getInteltype()));
+                }
                 return patentInfoExcelData;
             }).collect(Collectors.toList());
             datas.add(0, ExcelPatternMsgUtils.initTongluPatentHeadInfo());
@@ -1273,13 +1293,12 @@ public class EntryServiceImpl implements EntryService {
         } else {
             // List
             List<EnterprisePatentInfoExcelData> excelDatas = new ArrayList<>();
-            if (isParsed == true) {
-                // 解析excel
-                excelDatas = ExcelUtils.parseEnterprisePatentInfoExcelData(filePath);
-                System.out.println("toPatentInfo parsedExlList>" + JSON.toJSONString(excelDatas));
-                System.out.println("解析专利信息excel内容 :" + JSON.toJSONString(excelDatas));
-                // 解析excel
+            if (isParsed) {
                 try {
+                    // 解析excel
+                    excelDatas = ExcelUtils.parseEnterprisePatentInfoExcelData(filePath);
+                    System.out.println("toPatentInfo parsedExlList>" + JSON.toJSONString(excelDatas));
+                    System.out.println("解析专利信息excel内容 :" + JSON.toJSONString(excelDatas));
 
                 } catch (IllegalStateException e) {
                     e.printStackTrace();
@@ -1512,6 +1531,7 @@ public class EntryServiceImpl implements EntryService {
         }
     }
 
+    //解析专家库或专家库详情
     public List toExpertInfo(List parseList, String nodeId, String filePath, String reqId,
                              Boolean isDetails, Boolean isParsed) {
         if (isDetails == true) {
@@ -1526,7 +1546,12 @@ public class EntryServiceImpl implements EntryService {
                 ExpertInfoExcelData personnelInfoExcelData = new ExpertInfoExcelData();
                 BeanUtils.copyProperties(expertinfo, personnelInfoExcelData);
                 personnelInfoExcelData.setSchool(null != orgInfo ? orgInfo.getName() : "");
-                personnelInfoExcelData.setAcademicdegreename(academicdegreeTypeToName(expertinfo.getAcademicdegree()));
+                if ("320117400".equals(nodeId)) {
+                    personnelInfoExcelData.setAcademicdegreename(academicdegreeTypeToNameLiShui(expertinfo.getAcademicdegree()));
+                    personnelInfoExcelData.setPosition(positionTypeToName(Integer.valueOf(expertinfo.getPosition())));
+                } else if ("330122000".equals(nodeId)) {
+                    personnelInfoExcelData.setAcademicdegreename(academicdegreeTypeToName(expertinfo.getAcademicdegree()));
+                }
                 return personnelInfoExcelData;
             }).collect(Collectors.toList());
             datas.add(0, ExcelPatternMsgUtils.initTongluExpertHeadInfo());
@@ -1537,7 +1562,7 @@ public class EntryServiceImpl implements EntryService {
             return datas;
         } else {
             List<ExpertInfoExcelData> excelDatas = new ArrayList<>();
-            if (isParsed == true) {
+            if (isParsed) {
                 // 解析excel内容
                 try {
                     // 解析excel并入库
@@ -1596,6 +1621,46 @@ public class EntryServiceImpl implements EntryService {
 
     }
 
+    //解析平台库平台信息
+    public List toPlatformInfo(List parseList, String nodeId, String filePath, String reqId,
+                               Boolean isDetails, Boolean isParsed, String uid) {
+
+        if (isDetails) {
+            List<Resourcelibrary> platformInfos = resourcelibraryMapper.selectList(new EntityWrapper<Resourcelibrary>().eq("req_id", reqId));
+            List<PlatformInfoExcelDate> datas = platformInfos.stream().map(platformInfo -> {
+                PlatformInfoExcelDate platformInfoExcelDate = new PlatformInfoExcelDate();
+                BeanUtils.copyProperties(platformInfo, platformInfoExcelDate);
+                if ("320117400".equals(nodeId)) {
+                    platformInfoExcelDate.setCategory(platformTypeToName(platformInfo.getCategory()));
+                    platformInfoExcelDate.setTechtype(platformInfo.getTechtype().toString());
+                    platformInfoExcelDate.setStarType(platformInfo.getStarType().toString());
+                    platformInfoExcelDate.setFactoryarea(platformInfo.getFactoryarea().toString());
+                }
+                return platformInfoExcelDate;
+            }).collect(Collectors.toList());
+            datas.add(0,ExcelPatternMsgUtils.initLishuiPlatformHeadInfo());
+            datas.stream().filter(bean -> {
+                bean.setErrorMsg(JSON.parseObject(bean.getErrorRemark()));
+                return true;
+            }).collect(Collectors.toList());
+            return datas;
+        } else {
+            List<PlatformInfoExcelDate> excelDates = new ArrayList<>();
+            if (isParsed) {
+                try {
+                    excelDates = ExcelUtils.parsePlatformInfoExcelDate(filePath);
+                    System.out.println("解析专利信息excel内容 :" + JSON.toJSONString(excelDates));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                return excelDates;
+            } else {
+                List savelist = savePlatformInfoExcelData(parseList, nodeId, reqId, uid);
+                return savelist;
+            }
+        }
+    }
+
 
     /**
      * 获取各类型详情接口.
@@ -1851,7 +1916,10 @@ public class EntryServiceImpl implements EntryService {
                 info = new CompanyIntellectualpropertyLk();
                 BeanUtils.copyProperties(excelData, info);
                 info.setApplydate(DateUtils.stringToDate(excelData.getApplydate()));
-                info.setLicensedate(DateUtils.stringToDate(excelData.getLicensedate()));
+                //todo lys  溧水节点模板没有该字段(授权日期),需要判断
+                if (StringUtils.isNotEmpty(excelData.getLicensedate())) {
+                    info.setLicensedate(DateUtils.stringToDate(excelData.getLicensedate()));
+                }
                 // connectioninfoModel.getOrganizationInfo().setId(orglist.get(0).getId());
                 info.setCompanyid(orglist.get(0).getId());
                 // todo 关联类型参考typeentry,默认0,30030是机构?
@@ -2297,6 +2365,12 @@ public class EntryServiceImpl implements EntryService {
             info.setReqId(reqId);
             info.setRestype("8");
             info.setCreator(2865L);
+            if ("320117400".equals(nodeId)) {
+                info.setAcademicdegree(StringUtils.isNotEmpty(excelData.getAcademicdegreename()) ?
+                        academicdegreeNameToTypeLishui(excelData.getAcademicdegreename()) : 0);
+                info.setPosition(StringUtils.isNotEmpty(excelData.getPosition()) ?
+                        String.valueOf(positionNameToType(excelData.getPosition())) : "");
+            }
             // info.setNodeId(nodeId);
             // policyBasicInfoMapper.insert(info);
             infos.add(info);
@@ -2349,6 +2423,42 @@ public class EntryServiceImpl implements EntryService {
         return infos;
     }
 
+    //9.保存平台库平台信息
+    public List savePlatformInfoExcelData(List<PlatformInfoExcelDate> platformInfoExcelDates, String nodeId, String reqId, String uid) {
+        Resourcelibrary resourcelibrary;
+        List<Resourcelibrary> infos = new ArrayList<>();
+        for (PlatformInfoExcelDate platformInfoExcelDate : platformInfoExcelDates) {
+            resourcelibrary = new Resourcelibrary();
+            BeanUtils.copyProperties(platformInfoExcelDate,resourcelibrary);
+            if ("320117400".equals(nodeId)) {
+                resourcelibrary.setCategory(StringUtils.isNotEmpty(platformInfoExcelDate.getCategory()) ?
+                        platformTypeToName(platformInfoExcelDate.getCategory()) : "");
+                resourcelibrary.setRestype(41);
+                resourcelibrary.setComefrom("320117400");
+                resourcelibrary.setReqId(reqId);
+                resourcelibrary.setFactoryarea(Float.valueOf(platformInfoExcelDate.getFactoryarea()));
+                resourcelibrary.setTechtype(Integer.valueOf(platformInfoExcelDate.getTechtype()));
+                resourcelibrary.setStarType(Integer.valueOf(platformInfoExcelDate.getStarType()));
+            }
+            String claid = interviewDataEntryService.getClaid(nodeId, 0L);
+
+            SnowflakeIdWorker idWorker = new SnowflakeIdWorker(Constant.SNOWFLAKE_GROUPNUM, Constant.SNOWFLAKE_NUM);
+            long snowid = idWorker.nextId();
+            resourcelibrary.setSnowflakeid(snowid);
+            resourcelibrary.setCreator(Long.valueOf(uid));
+            List<Resourcelibrary> lists = resourcelibraryMapper.selectList(new EntityWrapper<Resourcelibrary>()
+                    .eq("comefrom", nodeId)
+                    .eq("title", resourcelibrary.getTitle()));
+            if (CollectionUtils.isEmpty(lists)) {
+                infos.add(resourcelibrary);
+            }
+            log.info("平台库平台信息:{}",resourcelibrary);
+            dataEntryResource.insertPlatformInfoToResourceLibrary(resourcelibrary,claid,nodeId);
+        }
+        System.out.println("infos>" + JSON.toJSONString(infos));
+        return infos;
+    }
+
 
     /**
      * 文件md5值。
@@ -2417,6 +2527,8 @@ public class EntryServiceImpl implements EntryService {
                     // 待开发
                     map = checkPolicyInfo(parseList, nodeId);
                     break;
+                case Constant.NINE:
+                    map = checkPlatformInfo(parseList, nodeId);
                 default:
             }
             return map;
@@ -2822,7 +2934,7 @@ public class EntryServiceImpl implements EntryService {
             } else {
                 // 2.2 企业信息不存在
                 // unExistInfos.add(toExpertErrorList(errorNum, data.getName(), "", "企业基本信息不存在"));
-                errorImportInfos.add(toExpertErrorList(errorNum, data.getName(), data.getName(), "基本信息不存在"));
+                errorImportInfos.add(toExpertErrorList(errorNum, data.getSchool(), data.getSchool(), "基本信息不存在"));
             }
 
         }
@@ -3019,6 +3131,32 @@ public class EntryServiceImpl implements EntryService {
         return checkDataMap(errorImportInfos, unExistInfos, repeatInfos);
     }
 
+    public Map<String,Object> checkPlatformInfo(List paseList,String nodeId) {
+        List<PlatformInfoExcelDate> datas = JSONArray.parseArray
+                (JSONArray.toJSONString(paseList), PlatformInfoExcelDate.class);
+        // 错误信息
+        List<ErrorImportInfo> errorImportInfos = new ArrayList<>();
+        // 平台库信息不存在
+        List<ErrorImportInfo> unExistInfos = new ArrayList<>();
+        // 平台信息重复
+        List<ErrorImportInfo> repeatInfos = new ArrayList<>();
+        int errorNum = 0;
+        for (PlatformInfoExcelDate date : datas) {
+            errorNum = errorNum + 1;
+            if (!date.getErrorRemark().equals("{}")) {
+                errorImportInfos.add(toPolicyErrorList(errorNum,date.getTitle(),date.getContent(),date.getErrorRemark()));
+            }
+            List<Resourcelibrary> resourcelibraries = resourcelibraryMapper.selectList(new EntityWrapper<Resourcelibrary>()
+                    .eq("comefrom", nodeId)
+                    .eq("title", date.getTitle()));
+            if (CollectionUtils.isNotEmpty(resourcelibraries)) {
+                errorImportInfos.add(toPolicyErrorList(errorNum,date.getTitle(),resourcelibraries.get(0).getTitle(),
+                        "该\""+resourcelibraries.get(0) + "\"平台信息已存在"));
+            }
+        }
+        return checkDataMap(errorImportInfos,unExistInfos,repeatInfos);
+    }
+
     /**
      * 初始化错误信息实体。
      *
@@ -3649,7 +3787,7 @@ public class EntryServiceImpl implements EntryService {
 
     /**
      * 专利类型type转name
-     *
+     *  todo 桐庐节点
      * @param patentType
      * @return
      */
@@ -3689,6 +3827,29 @@ public class EntryServiceImpl implements EntryService {
         return patentName;
     }
 
+
+    /**
+     * 专利类型type转name(溧水节点)
+     */
+    public String changePatentTypeToNameLiShui(Integer patentype) {
+        String patentName = "";
+        switch (patentype) {
+            case 10802:
+                patentName = "发明专利";
+                break;
+            case 10801:
+                patentName = "实用新型";
+                break;
+            case 10808:
+                patentName = "外观设计";
+                break;
+            case 10810:
+                patentName = "PTC";
+                break;
+        }
+        return patentName;
+    }
+
     /**
      * 专利类型name转type
      *
@@ -3731,6 +3892,27 @@ public class EntryServiceImpl implements EntryService {
         return patentType;
     }
 
+    /**
+     * 专利类型name转type(溧水节点)
+     */
+    public Integer changePatentNameToTypeLishui(String patentName) {
+        Integer patenType = 0;
+        switch (patentName) {
+            case "发明专利":
+                patenType = 10802;
+                break;
+            case "实用新型":
+                patenType = 10801;
+                break;
+            case "外观设计":
+                patenType = 10808;
+                break;
+            case "PTC":
+                patenType = 10810;
+        }
+        return patenType;
+    }
+
 
     /**
      * 资源资质转sql存储数据类型。
@@ -3823,7 +4005,7 @@ public class EntryServiceImpl implements EntryService {
 
     /**
      * 学历name转type
-     *
+     * todo 桐庐节点
      * @param academicdegreename
      * @return
      */
@@ -3871,7 +4053,7 @@ public class EntryServiceImpl implements EntryService {
 
     /**
      * 学历type转name
-     *
+     * todo 桐庐节点
      * @param academicdegreename
      * @return
      */
@@ -3914,6 +4096,58 @@ public class EntryServiceImpl implements EntryService {
         return academicdegreeType;
     }
 
+    /**
+     * 学历name转type(溧水节点)
+     */
+    public Integer academicdegreeNameToTypeLishui(String academicdegreename) {
+        Integer academicdegreeType = 0;
+        switch (academicdegreename) {
+            case "博士研究生":
+                academicdegreeType = 3743;
+                break;
+            case "硕士研究生":
+                academicdegreeType = 3744;
+                break;
+            case "本科":
+                academicdegreeType = 3745;
+                break;
+            case "专科":
+                academicdegreeType = 3746;
+                break;
+            case "其他":
+                academicdegreeType = 3747;
+        }
+        return academicdegreeType;
+    }
+
+    /**
+     *
+     * @param academicdegreename
+     * @return
+     */
+    public String academicdegreeTypeToNameLiShui(Integer academicdegreename) {
+        String academicdegreeType = "";
+        switch (academicdegreename) {
+            case 3743:
+                academicdegreeType = "博士研究生";
+                break;
+            case 3744:
+                academicdegreeType = "硕士研究生";
+                break;
+            case 3745:
+                academicdegreeType = "本科";
+                break;
+            case 3746:
+                academicdegreeType = "专科";
+                break;
+            case 3747:
+                academicdegreeType = "其他";
+                break;
+        }
+        return academicdegreeType;
+    }
+
+
     /**
      * 技术成熟度
      * @param 成熟度:0:不限 1:正在研发 2:已有小样 3:通过小试 4:通过中试 5:可以量产
@@ -3972,6 +4206,108 @@ public class EntryServiceImpl implements EntryService {
         return academicdegreeType;
     }
 
+    /**
+     * 溧水节点专家库职称
+     * @param positionName
+     * @return
+     */
+    public Integer positionNameToType(String positionName) {
+        Integer positionType = 0;
+        switch (positionName) {
+            case "讲师":
+                positionType = 3749;
+                break;
+            case "副教授":
+                positionType = 3750;
+                break;
+            case "教授":
+                positionType = 3751;
+                break;
+            case "硕士生导师":
+                positionType = 3752;
+                break;
+            case "博士生导师":
+                positionType = 3753;
+                break;
+            case "高级工程师":
+                positionType = 3754;
+                break;
+            case "实验师":
+                positionType = 3755;
+                break;
+            case "研究员":
+                positionType = 3756;
+                break;
+            case "其他":
+                positionType = 3757;
+                break;
+            default:
+                break;
+        }
+        return positionType;
+    }
+
+    public String positionTypeToName(Integer positionType) {
+        String positionName = "";
+        switch (positionType) {
+            case 3749:
+                positionName = "讲师";
+                break;
+            case 3750:
+                positionName = "副教授";
+                break;
+            case 3751:
+                positionName = "教授";
+                break;
+            case 3752:
+                positionName = "硕士生导师";
+                break;
+            case 3753:
+                positionName = "博士生导师";
+                break;
+            case 3754:
+                positionName = "高级工程师";
+                break;
+            case 3755:
+                positionName = "实验师";
+                break;
+            case 3756:
+                positionName = "研究员";
+                break;
+            case 3757:
+                positionName = "其他";
+                break;
+            default:
+                break;
+        }
+        return positionName;
+    }
+
+
+    public String platformTypeToName(String platformName) {
+        String platformType = "";
+        switch (platformName) {
+            case "国家级":
+                platformType = "3790";
+                break;
+            case "省级":
+                platformType = "3791";
+                break;
+            case "市级":
+                platformType = "3792";
+                break;
+            case "区级":
+                platformType = "3793";
+                break;
+            case "其他":
+                platformType = "3794";
+                break;
+        }
+        return platformType;
+    }
+
+
+
     /**
      * 根据企业唯一标识id查询企业信息数据。
      *