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

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

......@@ -10,6 +10,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
......@@ -32,19 +33,26 @@ public class EvaluationController {
evaluationService.save(evaluation);
return ResponseEntity.ok(200);
}
@ApiOperation("根据用户名查询输出")
@GetMapping(value = "/{name}")
public ResponseEntity getName(@PathVariable String name) {
Evaluation evaluation = evaluationService.findByName(name);
@ApiOperation("根据用户名查询最新的报告输出")
@GetMapping(value = "/eva")
public ResponseEntity getName(@RequestParam String name,@RequestParam String id) {
if(StringUtils.isEmpty(id)||id.equals("null")){
Evaluation e = evaluationService.findByName(name);
if(e!=null){
return ResponseEntity.ok(e.getOutEva());
}
return ResponseEntity.ok(null);
}
Evaluation evaluation = evaluationService.findById(id);
if(evaluation!=null){
return ResponseEntity.ok(evaluation.getOutEva());
}
return ResponseEntity.ok(null);
}
@ApiOperation("根据用户名查询输如")
@ApiOperation("根据id查询输入")
@GetMapping(value = "/in/{name}")
public ResponseEntity getInName(@PathVariable String name) {
Evaluation evaluation = evaluationService.findByName(name);
Evaluation evaluation = evaluationService.findById(name);
if(evaluation!=null){
return ResponseEntity.ok(evaluation.getInEva());
}
......
......@@ -427,8 +427,10 @@ public class InspectController {
evaluation.setOutEva(out);
evaluation.setUsername(reform.getUsername());
evaluationService.save(evaluation);
return ResponseEntity.ok(assessmentReport);
evaluation.setProjectName(reform.getProjectName());
evaluation.setAuthority(reform.getAuthority());
Evaluation save = evaluationService.save(evaluation);
return ResponseEntity.ok(save.getId());
}
@PostMapping("/uploads")
......
......@@ -3,9 +3,12 @@ package com.zjty.inspect.dao;
import com.zjty.inspect.entity.Evaluation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
public interface EvaluationDao extends JpaRepository<Evaluation,String>, JpaSpecificationExecutor<Evaluation> {
Evaluation findByUsernameAndIdNot(String username,String id);
Evaluation findByUsername(String username);
@Query(value = "SELECT * FROM evaluation WHERE username=:username AND create_time = (SELECT MAX(create_time) FROM evaluation WHERE username=:username)",nativeQuery = true)
Evaluation findByUsernameAndMaxCreateDate(String username);
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -14,6 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "额外申请")
public class Apply {
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -16,11 +18,13 @@ import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "评估报告")
public class AssessmentReport {
/**
* 数据的状态
*/
@ApiModelProperty(value = "数据的状态",example = "1")
private Integer code;
/**
* 单位名称
......@@ -45,16 +49,19 @@ public class AssessmentReport {
/**
* 语言
*/
@ApiModelProperty(value = "语言",example = "1")
private Integer language;
/**
* 类型预算 1:适配、2:改造
*/
@ApiModelProperty(value = "类型预算",example = "2")
private Integer type;
/**
* 架构
*/
@ApiModelProperty(value = "架构",example = "1")
private Integer framework;
/**
......
package com.zjty.inspect.entity;
import com.github.junrar.Volume;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -14,6 +14,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "Basis")
public class Basis {
/**
* 开发量
......
package com.zjty.inspect.entity;
import com.zjty.inspect.enums.CompatibleBrowser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -16,6 +18,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "前端浏览器相关")
public class Browser {
/**
......@@ -26,6 +29,7 @@ public class Browser {
/**
* 插件安装情况int 1:是 2:否
*/
@ApiModelProperty(value = "插件安装情况int",example = "1")
private Integer PlugInUnit = -1;
/**
......@@ -41,39 +45,47 @@ public class Browser {
/**
* 地理信息系统 int 1:是 2:否
*/
@ApiModelProperty(value = "地理信息系统",example = "1")
private Integer geography = -1;
/**
* 调用外设
*/
@ApiModelProperty(value = "调用外设",example = "1")
private Integer peripheral = -1;
/**
*动画
*/
@ApiModelProperty(value = "动画",example = "1")
private Integer animation = -1;
/**
* 3d展示
*/
@ApiModelProperty(value = "3d展示",example = "1")
private Integer threeD = -1;
/**
* 公文显现与编辑
*/
@ApiModelProperty(value = "公文显现与编辑",example = "1")
private Integer document = -1;
/**
* 多媒体
*/
@ApiModelProperty(value = "多媒体",example = "1")
private Integer media = -1;
/**
* Flash
*/
@ApiModelProperty(value = "Flash",example = "1")
private Integer flash = -1;
/**
* 其他
*/
@ApiModelProperty(value = "其他",example = "1")
private Integer otherDemand = -1;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "浏览器难度")
public class BrowserDifficulty {
/**
* 系统评估
......@@ -37,16 +40,19 @@ public class BrowserDifficulty {
/**
* 样式
*/
@ApiModelProperty(value = "样式",example = "1")
private Integer style;
/**
* api
*/
@ApiModelProperty(value = "api",example = "1")
private Integer api;
/**
* 插件
*/
@ApiModelProperty(value = "插件",example = "1")
private Integer plugInUnit;
/**
......@@ -55,40 +61,48 @@ public class BrowserDifficulty {
/**
* 地理信息系统 int 1:是 2:否
*/
@ApiModelProperty(value = "地理信息系统 int 1:是 2:否",example = "1")
private Integer geography;
/**
* 调用外设
*/
@ApiModelProperty(value = "调用外设",example = "1")
private Integer peripheral;
/**
*动画
*/
@ApiModelProperty(value = "动画",example = "1")
private Integer animation;
/**
* 3d展示
*/
@ApiModelProperty(value = "3d展示",example = "1")
private Integer threeD;
/**
* 公文显现与编辑
*/
@ApiModelProperty(value = "公文显现与编辑",example = "1")
private Integer document;
/**
* 多媒体
*/
@ApiModelProperty(value = "多媒体",example = "1")
private Integer media;
/**
* Flash
*/
@ApiModelProperty(value = "Flash",example = "1")
private Integer flash;
/**
* 其他
*/
@ApiModelProperty(value = "其他",example = "1")
private Integer otherDemand;
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;
......@@ -14,7 +16,7 @@ import java.sql.Timestamp;
* @author Mcj
* @date 2020-02-27 19:05
*/
@ApiModel(value = "预算")
@Data
public class Budget {
......@@ -42,6 +44,7 @@ public class Budget {
/**
* 系统开发费用
*/
@ApiModelProperty(value = "系统开发费用",example = "1")
private Integer sysFund;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.ArrayList;
......@@ -12,6 +13,7 @@ import java.util.List;
*/
@Data
@ApiModel(value = "预算")
public class BudgetVo {
private List<Budget> budget = new ArrayList<>();
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -11,6 +12,7 @@ import javax.persistence.Id;
@NoArgsConstructor
@AllArgsConstructor
@Entity
@ApiModel(value = "类型")
public class Category {
@Id
@Column(length = 48)
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Entity;
......@@ -13,6 +15,7 @@ import javax.persistence.Id;
@Entity
@Data
@ApiModel(value = "系数计算")
public class CoefficientModel {
@Id
......@@ -39,10 +42,11 @@ public class CoefficientModel {
/**
* 最小值4
*/
@ApiModelProperty(value = "最小值4",example = "4")
private Integer min;
@ApiModelProperty(value = "最大值4",example = "4")
private Integer max;
@ApiModelProperty(value = "scale",example = "4")
private Integer scale;
public Double countCoefficient(Integer data) {
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import javax.persistence.Entity;
......@@ -11,6 +12,7 @@ import javax.persistence.Id;
* @author Mcj
*/
@Data
@ApiModel(value = "系数计算")
public class CoefficientModelVo {
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -12,12 +14,14 @@ import javax.persistence.Id;
@NoArgsConstructor
@AllArgsConstructor
@Entity
@ApiModel(value = "配置")
public class Config {
@Id
@Column(length = 48)
private String id;
private String name;
private String value;
@ApiModelProperty(value = "类型",example = "1")
private Integer type;
private String des;
private String arrs;
......
......@@ -2,6 +2,8 @@ package com.zjty.inspect.entity;
import com.zjty.inspect.enums.DatabaseType;
import com.zjty.inspect.task.task;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -17,6 +19,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "数据库相关")
public class Database {
/**
......@@ -32,35 +35,42 @@ public class Database {
/**
* 视图 int 1:是 2:否
*/
@ApiModelProperty(value = "视图 int 1:是 2:否",example = "1")
private Integer view = -1;
/**
* 存储过程 1:是 2:否
*/
@ApiModelProperty(value = "存储过程 1:是 2:否",example = "1")
private Integer storage = -1;
/**
* 函数 1:是 2:否
*/
@ApiModelProperty(value = "函数 1:是 2:否",example = "1")
private Integer function = -1;
/**
* Dblink 1:是 2:否
*/
@ApiModelProperty(value = "Dblink 1:是 2:否",example = "1")
private Integer dbLink = -1;
/**
* 定时任务 1:是 2:否
*/
@ApiModelProperty(value = "定时任务 1:是 2:否",example = "1")
private Integer timeTask = -1;
/**
* 序列 1:是 2:否
*/
@ApiModelProperty(value = "序列 1:是 2:否",example = "1")
private Integer sequence = -1;
/**
* 触发器 1:是 2:否
*/
@ApiModelProperty(value = "触发器 1:是 2:否",example = "1")
private Integer trigger = -1;
/*
......@@ -70,21 +80,25 @@ public class Database {
/**
* 容灾 (1:否 2:主备 3:分布式)
*/
@ApiModelProperty(value = "容灾 (1:否 2:主备 3:分布式)",example = "1")
private Integer disasterTolerance = -1;
/**
* 安全 1:是 2:否
*/
@ApiModelProperty(value = "安全 1:是 2:否",example = "1")
private Integer safe = -1;
/**
* 读写分离 1:是 2:否
*/
@ApiModelProperty(value = "读写分离 1:是 2:否",example = "1")
private Integer separate = -1;
/**
* 更高性能 1:是 2:否
*/
@ApiModelProperty(value = "更高性能 1:是 2:否",example = "1")
private Integer performance = -1;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -16,6 +18,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "数据库难度")
public class DatabaseDifficulty {
/**
* 系统评估
......@@ -45,21 +48,25 @@ public class DatabaseDifficulty {
/**
* 容灾 (1:否 2:主备 3:分布式)
*/
@ApiModelProperty(value = "容灾 (1:否 2:主备 3:分布式)",example = "1")
private Integer disasterTolerance;
/**
* 安全 1:是 2:否
*/
@ApiModelProperty(value = "安全 1:是 2:否",example = "1")
private Integer safe;
/**
* 读写分离 1:是 2:否
*/
@ApiModelProperty(value = "读写分离 1:是 2:否",example = "1")
private Integer separate;
/**
* 更高性能 1:是 2:否
*/
@ApiModelProperty(value = "更高性能 1:是 2:否",example = "1")
private Integer performance;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -12,6 +14,7 @@ import java.util.List;
* @date 2020-02-18 11:19
*/
@Data
@ApiModel(value = "依赖树")
public class DepTree implements Serializable {
......@@ -22,5 +25,6 @@ public class DepTree implements Serializable {
* 0,未违规
* 1,违规
*/
@ApiModelProperty(value = "未违规",example = "0")
private Integer violation = 0;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.ArrayList;
......@@ -12,6 +13,7 @@ import java.util.Set;
* @date 2020-03-01 21:18
*/
@Data
@ApiModel(value = "依赖树")
public class DepTreePom {
Set<String> technologies = new HashSet<>();
private String id;
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "依赖或jni数量")
public class DependOnNum {
/**
......@@ -23,5 +26,6 @@ public class DependOnNum {
/**
* 数量
*/
@ApiModelProperty(value = "数量",example = "1")
private Integer num;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
......@@ -12,6 +13,7 @@ import java.util.List;
* @date 2020-02-21 20:26
*/
@Data
@ApiModel(value = "依赖树封装")
public class DependencyVo implements Serializable {
private List<ProjectPom> depTreeList = new ArrayList<>(64);
private List<ProjectPom> frontend = new ArrayList<>(64);
......
package com.zjty.inspect.entity;
import com.zjty.inspect.enums.OperateSystem;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -14,10 +16,12 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "原系统部署架构")
public class Details {
/**
* 部署情况 1、本地 2:政务云
*/
@ApiModelProperty(value = "部署情况 1、本地 2:政务云",example = "1")
private Integer deploy = -1;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "适配难度评估")
public class DifficultyAssessment {
/**
* 1.描述
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "价格估算")
public class Estimate {
/**
......
package com.zjty.inspect.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -25,21 +26,29 @@ public class Evaluation {
@Column( length = 48)
private String id;
private String username;
/**
* 0:用户
* 1: 管理员
*/
private Integer authority;
private String projectName;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@Column(columnDefinition = "TEXT")
private String inEva;
@Column(columnDefinition = "TEXT")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
private String outEva;
/**
* 数据创建时间
*/
@Column(name="create_time",columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP",insertable = false,updatable = false)
@Column(name="create_time",nullable = false,updatable = false)
@CreatedDate
private Date createDate;
/**
* 数据更新时间
*/
@Column(name="update_time",columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP",insertable = false)
@Column(name="update_time",nullable = false)
@LastModifiedDate
private Date updateDate;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -7,6 +8,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "ExcelDataVo")
public class ExcelDataVo {
private String name;
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "File")
public class File {
private String name;
private String path;
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "框架难度")
public class FrameDifficulty {
//系统评估、额外信息、综合难度
/**
......@@ -38,21 +41,25 @@ public class FrameDifficulty {
/**
* 详情 1:混合 2:前后端分离
*/
@ApiModelProperty(value = "详情 1:混合 2:前后端分离",example = "1")
private Integer details;
/**
* 分布式 int 1:是 2:否
*/
@ApiModelProperty(value = "分布式 int 1:是 2:否",example = "1")
private Integer distributed;
/**
* 负载均衡 int 1:是 2:否
*/
@ApiModelProperty(value = "负载均衡 int 1:是 2:否",example = "1")
private Integer loadBalance;
/**
* 容灾 int 1:是 2:否
*/
@ApiModelProperty(value = "容灾 int 1:是 2:否",example = "1")
private Integer disaster;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -17,6 +19,7 @@ import javax.persistence.Id;
@AllArgsConstructor
@NoArgsConstructor
@Entity
@ApiModel(value = "传入参数表")
public class InspectParameter {
@Id
......@@ -39,40 +42,48 @@ public class InspectParameter {
/**
* 软件开发时间
*/
@ApiModelProperty(value = "软件开发时间",example = "1")
private Integer years;
/**
* 原系统费用
*/
@ApiModelProperty(value = "原系统费用",example = "1")
private Integer systemFund;
/**
* 模块数
*/
@ApiModelProperty(value = "模块数",example = "1")
private Integer modules;
/**
* 数据量
*/
@ApiModelProperty(value = "数据量",example = "1")
private Integer data;
/**
* 代码量
*/
@ApiModelProperty(value = "代码量",example = "1")
private Integer codeSize;
/**
* 内容
*/
@ApiModelProperty(value = "内容",example = "1")
private Integer content;
/**
* 架构
*/
@ApiModelProperty(value = "架构",example = "1")
private Integer framework;
/**
* 数据库表数量
*/
@ApiModelProperty(value = "数据库表数量",example = "1")
private Integer tables;
/**
......@@ -81,6 +92,7 @@ public class InspectParameter {
* 2:弱
* 4:强
*/
@ApiModelProperty(value = "安全能力",example = "0")
private Integer safety;
/**
......@@ -89,6 +101,7 @@ public class InspectParameter {
* 2:有0,无-0.05
* 4:有0,无-0.1
*/
@ApiModelProperty(value = "容灾",example = "2")
private Integer disaster;
/**
......@@ -121,6 +134,7 @@ public class InspectParameter {
* 1:是
* 0:否
*/
@ApiModelProperty(value = "是否管理员",example = "1")
private Integer admin;
/**
......@@ -128,6 +142,7 @@ public class InspectParameter {
* 1:修改
* 2:适配:
*/
@ApiModelProperty(value = "方式",example = "1")
private Integer recastMethod;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +14,7 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "造价估算")
public class ManufacturingCost {
/**
......
package com.zjty.inspect.entity;
import com.zjty.inspect.enums.MiddlewareEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -16,6 +18,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "中间件")
public class Middleware {
......@@ -36,20 +39,24 @@ public class Middleware {
/**
*Web集群 1:是 2:否
*/
@ApiModelProperty(value = "Web集群 1:是 2:否",example = "1")
private Integer web = -1;
/**
* Jndi集群 1:是 2:否
*/
@ApiModelProperty(value = "Jndi集群 1:是 2:否",example = "1")
private Integer jndi = -1;
/**
* Jms集群 1:是 2:否
*/
@ApiModelProperty(value = "Jms集群 1:是 2:否",example = "1")
private Integer jms = -1;
/**
* 消息路由 1:是 2:否
*/
@ApiModelProperty(value = "消息路由 1:是 2:否",example = "1")
private Integer route = -1;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -16,6 +18,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "中间件难度")
public class MiddlewareDifficulty {
/**
* 系统评估
......@@ -40,11 +43,13 @@ public class MiddlewareDifficulty {
/**
* 依赖详情(国产化支持的,王永磊要用)
*/
@ApiModelProperty(value = "依赖详情",example = "1")
private Integer dependOnNum;
/**
* 依赖数量
*/
@ApiModelProperty(value = "依赖数量",example = "1")
private Integer number;
/*
*用户额外信息详情
......@@ -52,21 +57,25 @@ public class MiddlewareDifficulty {
/**
*Web集群 1:是 2:否
*/
@ApiModelProperty(value = "Web集群 1:是 2:否",example = "1")
private Integer web;
/**
* Jndi集群 1:是 2:否
*/
@ApiModelProperty(value = "Jndi集群 1:是 2:否",example = "1")
private Integer jndi;
/**
* Jms集群 1:是 2:否
*/
@ApiModelProperty(value = "Jms集群 1:是 2:否",example = "1")
private Integer jms;
/**
* 消息路由 1:是 2:否
*/
@ApiModelProperty(value = "消息路由 1:是 2:否",example = "1")
private Integer route;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -11,6 +13,7 @@ import java.io.Serializable;
*/
@NoArgsConstructor
@Data
@ApiModel(value = "依赖")
public class PomDependency implements Serializable {
private String groupId = "";
......@@ -20,6 +23,7 @@ public class PomDependency implements Serializable {
* 1:前端依赖
* 2:后端依赖
*/
@ApiModelProperty(value = "前端依赖",example = "1")
private Integer type = 2;
/**
......@@ -27,5 +31,6 @@ public class PomDependency implements Serializable {
* 2:不支持
* 3:未知
*/
@ApiModelProperty(value = "支持",example = "1")
private Integer support;
}
package com.zjty.inspect.entity;
import com.zjty.inspect.enums.ApplicationType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -18,6 +20,7 @@ import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "应用系统改造替换表单")
public class Reform {
/*
基础
......@@ -26,7 +29,10 @@ public class Reform {
/**
* admin 是否是管理员
*/
@ApiModelProperty(value = "是否是管理员",example = "1")
private Integer admin = -1;
@ApiModelProperty(value = "权限",example = "1")
private Integer authority;
/**
* username
......@@ -36,6 +42,7 @@ public class Reform {
/**
*评估类型1:快速 2:详细
*/
@ApiModelProperty(value = "评估类型1",example = "1")
private Integer assessmentType;
/*
快速评估部分
......@@ -44,6 +51,7 @@ public class Reform {
/**
* 替换方式 int(1:改造 2:适配)
*/
@ApiModelProperty(value = "替换方式",example = "1")
private Integer mode = -1;
/**
......@@ -70,27 +78,32 @@ public class Reform {
/**
* 模块数
*/
@ApiModelProperty(value = "模块数",example = "1")
private Integer moduleNum = -1;
/**
* 原开发费用
*/
@ApiModelProperty(value = "原开发费用",example = "1")
private Integer cost = -1;
/**
* 开发单位是否在本地int 1:是 2:否
*/
@ApiModelProperty(value = "开发单位是否在本地int",example = "1")
private Integer address = -1;
/**
* 是否为涉密信息系统 int 1:是 2:否
*/
@ApiModelProperty(value = "是否为涉密信息系统",example = "1")
private Integer secret = -1;
/**
* 容灾能力 int 1:是 2:否
*/
@ApiModelProperty(value = "容灾能力",example = "1")
private Integer disasterTolerance = -1;
/**
......@@ -99,11 +112,13 @@ public class Reform {
* 2:弱
* 3:强
*/
@ApiModelProperty(value = "安全能力",example = "1")
private Integer safe = -1;
/**
* 架构
*/
@ApiModelProperty(value = "架构",example = "1")
private Integer framework = -1;
/**
......@@ -114,16 +129,19 @@ public class Reform {
/**
* 运行时间
*/
@ApiModelProperty(value = "运行时间",example = "1")
private Integer time = -1;
/**
* 数据库表数量
*/
@ApiModelProperty(value = "数据库表数量",example = "1")
private Integer tableNum = -1;
/**
* 数据库数据量
*/
@ApiModelProperty(value = "数据库数据量",example = "1")
private Integer databaseNum = -1;
/*
详细填写
......@@ -152,6 +170,7 @@ public class Reform {
/**
* 迁移策略 1:休息日 2:晚间切换 3:短暂停止
*/
@ApiModelProperty(value = "迁移策略",example = "1")
private Integer strategy = -1;
/**
* 额外申请
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -17,6 +18,7 @@ import java.sql.Timestamp;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "报告")
public class Report {
@Id
......
package com.zjty.inspect.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
......@@ -12,6 +14,7 @@ import java.util.List;
* @author Mcj
*/
@Data
@ApiModel(value = "ReportVo")
public class ReportVo {
private String id;
......@@ -35,11 +38,13 @@ public class ReportVo {
/**
* 架构,整合型还是分离型,根据jsp数量决定
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer framework;
/**
* 代码管理方式,
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer manager;
/**
......@@ -50,6 +55,7 @@ public class ReportVo {
/**
* 语言
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer language;
/**
......@@ -62,6 +68,7 @@ public class ReportVo {
* 1:重构
* 2:修改
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer recastMethod;
/**
......@@ -92,23 +99,27 @@ public class ReportVo {
/**
* 关键技术个数
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer technologiesNum;
/**
* 需要改造的技术
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer technologiesRepair;
/**
* 文件个数
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer fileNum;
/**
* 文件行数
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer fileLine;
@ApiModelProperty(value = "权限",example = "1")
private Integer supportSize = 0;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -21,6 +22,7 @@ import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Entity
@ApiModel(value = "规则类")
public class Rule {
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -8,6 +10,7 @@ import lombok.Data;
*/
@Data
@ApiModel(value = "规则类")
public class RuleAndReportVo {
/**
......@@ -18,6 +21,7 @@ public class RuleAndReportVo {
/**
* 匹配行数
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer lineNum;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,11 +15,13 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "原系统规模")
public class Scale {
/**
* 数量
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer num;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "原系统架构")
public class SystemStructure {
......@@ -48,11 +51,13 @@ public class SystemStructure {
/**
* 分布式 int 1:是 2:否
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer distributed = -1;
/**
* 负载均衡 int 1:是 2:否
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer loadBalance = -1;
/**
......@@ -61,6 +66,7 @@ public class SystemStructure {
* 2:有0,无-0.05
* 3:有0,无-0.1
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer disaster = -1;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "TechnologyContent")
public class TechnologyContent {
/**
......@@ -38,5 +41,6 @@ public class TechnologyContent {
/**
* 替换策略
*/
@ApiModelProperty(value = "替换策略",example = "1")
private Integer strategy;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -8,6 +10,7 @@ import lombok.Data;
* @date 2020-02-27 12:01
*/
@Data
@ApiModel(value = "TechnologyQo")
public class TechnologyQo {
private String id;
......@@ -25,5 +28,6 @@ public class TechnologyQo {
/**
* 金额
*/
@ApiModelProperty(value = "金额",example = "10")
private Integer fund;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
......@@ -10,6 +12,7 @@ import java.util.List;
* @date 2020-02-27 10:31
*/
@Data
@ApiModel(value = "建议")
public class TechnologyVo {
......@@ -25,6 +28,7 @@ public class TechnologyVo {
/**
* 资金
*/
@ApiModelProperty(value = "金额",example = "10")
private Integer fund;
}
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Entity;
......@@ -10,7 +12,7 @@ import javax.persistence.Id;
* @author Mcj
* @date 2020-02-26 14:57
*/
@ApiModel(value = "规则与报告中间表")
@Data
public class Warn {
......@@ -22,6 +24,7 @@ public class Warn {
/**
* 匹配行数
*/
@ApiModelProperty(value = "权限",example = "1")
private Integer lineNum;
/**
......
package com.zjty.inspect.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -13,6 +15,7 @@ import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "基础工作量评估")
public class Workload {
/**
* 描述
......@@ -27,6 +30,7 @@ public class Workload {
/**
*模块数
*/
@ApiModelProperty(value = "模块数",example = "1")
private Integer mode;
/*
......
......@@ -9,11 +9,11 @@ import java.util.Map;
public interface EvaluationService {
void save(Evaluation evaluation);
Evaluation save(Evaluation evaluation);
void update(Evaluation evaluation);
void delete(String id);
Page<Evaluation> findSearch(Map searchMap, int page, int size);
Evaluation findById(String id);
Evaluation findByName(String name);
}
......@@ -10,9 +10,11 @@ import io.netty.util.internal.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
......@@ -21,6 +23,7 @@ import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service
@Transactional(rollbackFor = Exception.class)
......@@ -28,19 +31,22 @@ public class EvaluationServiceImpl implements EvaluationService {
@Autowired
private EvaluationDao evaluationDao;
@Override
public void save(Evaluation evaluation) {
Evaluation evaluation2 = evaluationDao.findByUsername(evaluation.getUsername());
if(evaluation2==null){
public Evaluation save(Evaluation evaluation) {
if(StringUtils.isEmpty(evaluation.getInEva())) {
return null;
}
if(StringUtil.isNullOrEmpty(evaluation.getOutEva())) {
return null;
}
if(StringUtil.isNullOrEmpty(evaluation.getUsername())){
return null;
}
if(StringUtil.isNullOrEmpty(evaluation.getProjectName())){
return null;
}
String uuid = UUIDUtil.getUUID();
evaluation.setId(uuid);
evaluationDao.save(evaluation);
}else{
evaluation2.setId(evaluation2.getId());
evaluation2.setInEva(evaluation.getInEva());
evaluation2.setOutEva(evaluation.getOutEva());
evaluationDao.save(evaluation2);
}
return evaluationDao.save(evaluation);
}
@Override
......@@ -67,13 +73,22 @@ public class EvaluationServiceImpl implements EvaluationService {
@Override
public Page<Evaluation> findSearch(Map searchMap, int page, int size) {
Specification<Evaluation> specification = createSpecification(searchMap);
PageRequest pageRequest = PageRequest.of(page - 1, size);
PageRequest pageRequest = PageRequest.of(page - 1, size, Sort.Direction.DESC,"createDate");
return evaluationDao.findAll(specification, pageRequest);
}
@Override
public Evaluation findById(String id) {
Optional<Evaluation> evaluation = evaluationDao.findById(id);
if(evaluation.isPresent()){
return evaluation.get();
}
return null;
}
@Override
public Evaluation findByName(String name) {
Evaluation evaluation = evaluationDao.findByUsername(name);
Evaluation evaluation = evaluationDao.findByUsernameAndMaxCreateDate(name);
if(evaluation!=null){
return evaluation;
}
......@@ -98,6 +113,10 @@ public class EvaluationServiceImpl implements EvaluationService {
if (searchMap.get("username") != null && !"".equals(searchMap.get("username"))) {
predicateList.add(cb.like(root.get("username").as(String.class), "%" + (String) searchMap.get("username") + "%"));
}
if (searchMap.get("projectName") != null && !"".equals(searchMap.get("projectName"))) {
predicateList.add(cb.like(root.get("projectName").as(String.class), "%" + (String) searchMap.get("projectName") + "%"));
}
return cb.and(predicateList.toArray(new Predicate[predicateList.size()]));
}
......
......@@ -122,6 +122,9 @@ public class RuleServiceImpl implements RuleService {
if (searchMap.get("technologyName") != null && !"".equals(searchMap.get("technologyName"))) {
predicateList.add(cb.like(root.get("technologyName").as(String.class), "%" + (String) searchMap.get("technologyName") + "%"));
}
if (searchMap.get("target") != null && !"".equals(searchMap.get("target"))) {
predicateList.add(cb.like(root.get("target").as(String.class), "%" + (String) searchMap.get("target") + "%"));
}
return cb.and(predicateList.toArray(new Predicate[predicateList.size()]));
}
......
......@@ -28,8 +28,8 @@ spring.jpa.open-in-view=true
spring.jpa.properties.javax.persistence.validation.mode=none
# spring-http-\u6587\u4EF6\u4E0A\u4F20\u76F8\u5173\u914D\u7F6E
spring.servlet.multipart.max-file-size=200MB
spring.servlet.multipart.max-request-size=200MB
spring.servlet.multipart.max-file-size=500MB
spring.servlet.multipart.max-request-size=500MB
#\u914D\u7F6E\u65F6\u95F4\u683C\u5F0F
spring.jacksondate-format = yyyy-MM-dd HH:mm:ss
......@@ -38,6 +38,8 @@ spring.thymeleaf.cache=false
spring.mvc.static-path-pattern=/**
spring.resources.static-locations=classpath:/uploads/
serverTimezone=Hongkong
spring.jackson.time-zone=GMT
#highgo
#highgo.driver=org.postgresql.Driver
#highgo.connectionType=postgresql
......
......@@ -54,6 +54,8 @@ spring.datasource.url=jdbc:mysql://localhost:3306/adaptation?useSSL=false&server
spring.datasource.username=root
spring.datasource.password=root
serverTimezone=Hongkong
spring.jackson.time-zone=GMT
maven.home=/Users/mcj/apache-maven-3.6.1
maven.command=dependency:tree -DoutputType=txt -DoutputFile=
maven.treefile=./hello
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论