Commit 47044d70 authored by maoying's avatar maoying

修改风险管控评价,风险等级相关代码

parent 93121db8
package com.yeejoin.amos.fas.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 管控级别
*/
public enum ManageLevelEum {
company("单位级",1),
department("部门级",2),
group("班组级",3),
person("个人级",4);
private String name;
private int manageLevel;
ManageLevelEum(String name,int manageLevel){
this.name = name;
this.manageLevel = manageLevel;
}
public static List<Map> getManageLevelEumList(){
List<Map> eumList = new ArrayList<>();
for(ManageLevelEum eum :ManageLevelEum.values()){
Map<String,Object> param = new HashMap<>();
param.put("key",eum.getManageLevel());
param.put("label",eum.getName());
eumList.add(param);
}
return eumList;
}
public static String getNameByManageLevel(int level){
String name = "";
for(ManageLevelEum eum : ManageLevelEum.values()){
if(level == eum.getManageLevel()){
name = eum.getName();
break;
}
}
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getManageLevel() {
return manageLevel;
}
public void setManageLevel(int manageLevel) {
this.manageLevel = manageLevel;
}
}
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService; import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService;
import com.yeejoin.amos.fas.business.util.CommonPageParamUtil; import com.yeejoin.amos.fas.business.util.CommonPageParamUtil;
import com.yeejoin.amos.fas.common.enums.ManageLevelEum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.request.CommonRequest; import com.yeejoin.amos.fas.core.common.request.CommonRequest;
import com.yeejoin.amos.fas.dao.entity.RiskLevel; import com.yeejoin.amos.fas.dao.entity.RiskLevel;
...@@ -16,6 +17,7 @@ import org.slf4j.Logger; ...@@ -16,6 +17,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
...@@ -96,5 +98,11 @@ public class RiskLevelController extends BaseController { ...@@ -96,5 +98,11 @@ public class RiskLevelController extends BaseController {
return CommonResponseUtil.failure(e.getMessage() + ",风险等级删除失败"); return CommonResponseUtil.failure(e.getMessage() + ",风险等级删除失败");
} }
} }
@ApiOperation(value = "风险管控级别查询",notes = "风险管控级别查询")
@GetMapping(value = "/manageLevel/list")
public CommonResponse getManageLevelEumList(){
return CommonResponseUtil.success(ManageLevelEum.getManageLevelEumList());
}
} }
...@@ -15,9 +15,11 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao; ...@@ -15,9 +15,11 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao; import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService; import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService;
import com.yeejoin.amos.fas.common.enums.ManageLevelEum;
import com.yeejoin.amos.fas.dao.entity.RiskLevel; import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import com.yeejoin.amos.fas.dao.entity.RiskSource; import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.op.core.util.StringUtil;
@Service("riskLevelService") @Service("riskLevelService")
public class RiskLevelServiceImpl implements IRiskLevelService { public class RiskLevelServiceImpl implements IRiskLevelService {
@Autowired @Autowired
...@@ -31,6 +33,9 @@ public class RiskLevelServiceImpl implements IRiskLevelService { ...@@ -31,6 +33,9 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
public Page<HashMap<String, Object>> queryRiskLevelPage(CommonPageInfoParam param) { public Page<HashMap<String, Object>> queryRiskLevelPage(CommonPageInfoParam param) {
long total = riskLevelMapper.countPageData(param); long total = riskLevelMapper.countPageData(param);
List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param); List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param);
content.forEach(action->{
action.put("manageLevelName",StringUtil.isNotEmpty(action.get("manageLevel")) ? ManageLevelEum.getNameByManageLevel(Integer.parseInt(action.get("manageLevel").toString())) : "");
});
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result; return result;
} }
......
...@@ -98,7 +98,7 @@ public class RsDataQueue { ...@@ -98,7 +98,7 @@ public class RsDataQueue {
} }
} }
} catch (Exception e) { } catch (Exception e) {
Logger.getLogger(this.getClass()).error(e.getMessage()); Logger.getLogger(this.getClass()).error(e.getMessage(),e);
} }
} }
} }
......
...@@ -392,5 +392,28 @@ ...@@ -392,5 +392,28 @@
add COLUMN `trigger_type` varchar(20) DEFAULT NULL COMMENT '触发类型:巡检、告警、评价、删除' after `trigger_by`; add COLUMN `trigger_type` varchar(20) DEFAULT NULL COMMENT '触发类型:巡检、告警、评价、删除' after `trigger_by`;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="suhuiguang" id="1588990926789-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="f_risk_level " columnName="manage_level"/>
</not>
</preConditions>
<comment>f_risk_level add column manage_level 管控级别</comment>
<sql>
ALTER TABLE `f_risk_level`
add COLUMN `manage_level` tinyint(4) DEFAULT NULL COMMENT '管控级别';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1589769364577-1">
<preConditions onFail="MARK_RAN">
<columnExists tableName="f_risk_level " columnName="manage_level"/>
</preConditions>
<comment>f_risk_level 增加管控级别 初始化数据</comment>
<sql>
update f_risk_level set manage_level = 1 where level = '1';
update f_risk_level set manage_level = 2 where level = '2';
update f_risk_level set manage_level = 3 where level = '3';
update f_risk_level set manage_level = 4 where level = '4';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -117,5 +117,18 @@ ...@@ -117,5 +117,18 @@
END# END#
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="maoying" id="1589954524000-1" runOnChange="true">
<comment>updatePointConfig 触发器创建</comment>
<sql endDelimiter="#">
DROP TRIGGER IF EXISTS `updatePointConfig`;
CREATE TRIGGER `updatePointConfig` AFTER UPDATE ON `p_point` FOR EACH ROW
BEGIN
IF (new.name != old.name)
THEN
UPDATE p_point_config pc SET pc.`name` = CONCAT(new.name,'合格') WHERE pc.name LIKE '%合格' AND pc.point_id = new.id;
UPDATE p_point_config pc SET pc.`name` = CONCAT(new.name,'漏检') WHERE pc.name LIKE '%漏检' AND pc.point_id = new.id;
END IF;
END#
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
a.severity, a.severity,
a.name, a.name,
a.color, a.color,
a.manage_level manageLevel,
b.name as userName , b.name as userName ,
a.create_date as createDate, a.create_date as createDate,
a.remark a.remark
......
...@@ -252,8 +252,8 @@ ...@@ -252,8 +252,8 @@
<url>http://172.16.1.6:8081/nexus/content/repositories/maven-public/</url> <url>http://172.16.1.6:8081/nexus/content/repositories/maven-public/</url>
</repository> </repository>
<repository> <repository>
<id>maven-public</id> <id>maven-public-t</id>
<name>maven-public</name> <name>maven-public-t</name>
<url>http://repo.typroject.org:8081/repository/maven-public/</url> <url>http://repo.typroject.org:8081/repository/maven-public/</url>
</repository> </repository>
<repository> <repository>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment