提交 245fec19 authored 作者: 马晨俊's avatar 马晨俊

Merge branch 'master' of git.yfzx.zjtys.com.cn:912-system/monitor/inspect

...@@ -24,6 +24,7 @@ public interface RuleDao extends JpaRepository<Rule,String>,JpaSpecificationExec ...@@ -24,6 +24,7 @@ public interface RuleDao extends JpaRepository<Rule,String>,JpaSpecificationExec
Rule findAllByTargetEqualsAndTechnologyIdEquals(String target,String techId); Rule findAllByTargetEqualsAndTechnologyIdEquals(String target,String techId);
List<Rule> findAllByTargetLike(String target); List<Rule> findAllByTargetLike(String target);
List<Rule> findAllByTarget(String target);
Rule findByTarget(String target); Rule findByTarget(String target);
......
...@@ -2,11 +2,13 @@ package com.zjty.inspect.service.impl; ...@@ -2,11 +2,13 @@ package com.zjty.inspect.service.impl;
import com.zjty.inspect.dao.TechnologyDao; import com.zjty.inspect.dao.TechnologyDao;
import com.zjty.inspect.dao.RuleDao; import com.zjty.inspect.dao.RuleDao;
import com.zjty.inspect.entity.ExcelDataVo;
import com.zjty.inspect.entity.Technology; import com.zjty.inspect.entity.Technology;
import com.zjty.inspect.entity.Rule; import com.zjty.inspect.entity.Rule;
import com.zjty.inspect.entity.RuleQo; import com.zjty.inspect.entity.RuleQo;
import com.zjty.inspect.service.RuleService; import com.zjty.inspect.service.RuleService;
import com.zjty.inspect.service.TechnologyService; import com.zjty.inspect.service.TechnologyService;
import com.zjty.inspect.utils.ExcelReader;
import com.zjty.inspect.utils.UUIDUtil; import com.zjty.inspect.utils.UUIDUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
...@@ -20,10 +22,7 @@ import javax.persistence.criteria.CriteriaBuilder; ...@@ -20,10 +22,7 @@ import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root; import javax.persistence.criteria.Root;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/** /**
* 规则库 * 规则库
...@@ -46,12 +45,25 @@ public class RuleServiceImpl implements RuleService { ...@@ -46,12 +45,25 @@ public class RuleServiceImpl implements RuleService {
@Override @Override
public void test() { public void test() {
List<Rule> rules = ruleDao.findAll(); List<ExcelDataVo> excelDataVos = ExcelReader.readExcel("C:\\Users\\Jey\\Desktop\\生成代码\\规则表.xlsx");
for (Rule rule : rules) { System.out.println(excelDataVos);
Technology technology = technologyService.findByid(rule.getTechnologyId()); HashSet<String> set=new HashSet();
rule.setTechnologyName(technology.getTechnologyName()); for (ExcelDataVo excelDataVo : excelDataVos) {
List<Rule> rules = ruleDao.findAllByTarget(excelDataVo.getName());
if(rules==null||rules.size()==0){
set.add(excelDataVo.getName());
}
} }
ruleDao.saveAll(rules); for (String s : set) {
Rule rule=new Rule();
rule.setTechnologyName("国产化依赖(支持)");
rule.setTechnologyId("967a8bd0-eb27-4fb6-ba1d-1bca21cea5b4");
rule.setSuffix("java");
rule.setTarget(s);
rule.setId(UUIDUtil.getUUID());
ruleDao.save(rule);
}
} }
/** /**
......
...@@ -37,6 +37,7 @@ public class ExcelReader { ...@@ -37,6 +37,7 @@ public class ExcelReader {
return workbook; return workbook;
} }
/** /**
* 读取Excel文件内容 * 读取Excel文件内容
* @param fileName 要读取的Excel文件所在路径 * @param fileName 要读取的Excel文件所在路径
......
...@@ -401,7 +401,11 @@ public class WorkLoadUtil { ...@@ -401,7 +401,11 @@ public class WorkLoadUtil {
string.append("其中"); string.append("其中");
} }
for(TechnologyReport technologyReport:report.getTechnologyList().getTechnologyReports()){ for(TechnologyReport technologyReport:report.getTechnologyList().getTechnologyReports()){
string .append( technologyReport.getTechnology()+"修改项"+technologyReport.getTechnologyContents().size()+"个,"); int size = technologyReport.getTechnologyContents().size();
if(technologyReport.getTechnology().contains("国产化依赖(支持)")){
size = report.getDifficultyAssessment().getMiddlewareDifficulty().getDependOnNum();
}
string .append( technologyReport.getTechnology()+"修改项"+size+"个,");
} }
report.getTechnologyList().setDes(string.substring(0,string.length()-1)+"。"); report.getTechnologyList().setDes(string.substring(0,string.length()-1)+"。");
String type = ""; String type = "";
......
...@@ -28,8 +28,8 @@ spring.jpa.open-in-view=true ...@@ -28,8 +28,8 @@ spring.jpa.open-in-view=true
spring.jpa.properties.javax.persistence.validation.mode=none spring.jpa.properties.javax.persistence.validation.mode=none
# spring-http-\u6587\u4EF6\u4E0A\u4F20\u76F8\u5173\u914D\u7F6E # spring-http-\u6587\u4EF6\u4E0A\u4F20\u76F8\u5173\u914D\u7F6E
spring.servlet.multipart.max-file-size=200MB spring.servlet.multipart.max-file-size=500MB
spring.servlet.multipart.max-request-size=200MB spring.servlet.multipart.max-request-size=500MB
#\u914D\u7F6E\u65F6\u95F4\u683C\u5F0F #\u914D\u7F6E\u65F6\u95F4\u683C\u5F0F
spring.jacksondate-format = yyyy-MM-dd HH:mm:ss spring.jacksondate-format = yyyy-MM-dd HH:mm:ss
...@@ -50,7 +50,7 @@ spring.resources.static-locations=classpath:/uploads/ ...@@ -50,7 +50,7 @@ spring.resources.static-locations=classpath:/uploads/
# mysql\u6570\u636E\u5E93\u914D\u7F6E # mysql\u6570\u636E\u5E93\u914D\u7F6E
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.url=jdbc:mysql://192.168.1.249:3306/bservice?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8 #spring.datasource.url=jdbc:mysql://192.168.1.249:3306/bservice?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.url=jdbc:mysql://120.55.57.35:3306/adaptation?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8 spring.datasource.url=jdbc:mysql://localhost:3306/adaptation?useSSL=false&serverTimezone=UTC&autoReconnect=true&characterEncoding=utf-8
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=root spring.datasource.password=root
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论