Commit fb758e20 authored by suhuiguang's avatar suhuiguang

1.修改人员及增加告警发送手机

parent 0cb2f733
......@@ -9,7 +9,8 @@ public enum TriggerRpnChangeTypeEum {
* 触发类型枚举
*/
patrol("巡检","patrol"),
equipment("设备告警","equipment"),
alarm("设备告警","alarm"),
alarmRecovery("设备告警恢复","recovery"),
fmeaUpdate("危险因素评价","fmeaUpdate"),
fmeaDelete("危险因素删除","fmeaDelete"),
riskDelete("风险点删除","riskDelete");
......
......@@ -95,14 +95,6 @@ public class RiskSource extends BasicEntity {
return rpni;
}
public Integer getFlickerFrequency() {
return flickerFrequency;
}
public void setFlickerFrequency(Integer flickerFrequency) {
this.flickerFrequency = flickerFrequency;
}
public void setRpni(BigDecimal rpni) {
this.rpni = rpni;
}
......@@ -111,6 +103,14 @@ public class RiskSource extends BasicEntity {
return increment;
}
public Integer getFlickerFrequency() {
return flickerFrequency;
}
public void setFlickerFrequency(Integer flickerFrequency) {
this.flickerFrequency = flickerFrequency;
}
public void setIncrement(BigDecimal increment) {
this.increment = increment;
}
......
package com.yeejoin.amos.fas.business.bo;
import java.util.Set;
/**
* 手机消息对象
*/
public class JpushMsgBo {
/**
* 接收人集合
*/
Set<String> target;
/**
* 消息体
*/
JpushMsgContentBo msg;
public Set<String> getTarget() {
return target;
}
public void setTarget(Set<String> target) {
this.target = target;
}
public JpushMsgContentBo getMsg() {
return msg;
}
public void setMsg(JpushMsgContentBo msg) {
this.msg = msg;
}
}
package com.yeejoin.amos.fas.business.bo;
import com.yeejoin.amos.fas.common.enums.TriggerRpnChangeTypeEum;
import com.yeejoin.amos.fas.core.util.DateUtil;
import java.math.BigDecimal;
/**
* 手机消息推送内容
*/
public class JpushMsgContentBo {
/**
* 危险因素名称
*/
private String fmeaName;
/**
* 触发类型
*/
private String notifyType;
/**
* 巡检状态
*/
private String checkStatus;
/**
* 执行日期
*/
private String executeDate = DateUtil.getLongCurrentDate();
/**
* 执行人
*/
private String execute;
/**
* 等级变化范围
*/
private int levelIsChange;
/**
* 当前rpn
*/
private BigDecimal rpn;
/**
*风险等级
*/
private String level;
/**
*标题
*/
private String subject;
/**
* 关联名称
*/
private String relationName;
/**
* 是否需要发送
*/
private Boolean isSend;
public JpushMsgContentBo(String fmeaName, String notifyType){
this.fmeaName = fmeaName;
this.notifyType = notifyType;
this.setSubject(notifyType);
}
public Boolean getSend() {
return isSend;
}
private void setSubject(String notifyType){
if(notifyType.equals(TriggerRpnChangeTypeEum.patrol.getCode())){
//巡检
this.subject = "风险预警";
this.isSend = true;
} else if(notifyType.equals(TriggerRpnChangeTypeEum.alarm.getCode())){
//设备告警
this.subject = "风险预警";
this.isSend = true;
} else if(notifyType.equals(TriggerRpnChangeTypeEum.alarmRecovery.getCode())){
//告警恢复
this.subject = "告警恢复";
this.isSend = true;
} else if(notifyType.equals(TriggerRpnChangeTypeEum.fmeaUpdate.getCode())){
//风险评价
this.subject = "风险评价";
this.isSend = true;
}
}
public String genMessage(){
StringBuilder message = new StringBuilder();
if(notifyType.equals(TriggerRpnChangeTypeEum.patrol.getCode())){
//巡检
message.append("执行人:").append(execute).append("\n");
message.append("执行时间:").append(executeDate).append("\n");
message.append("危险因素名称:").append(fmeaName).append("\n");
message.append("描述:").append("当前风险值上升到").append(rpn).append(",风险等级").append(getLevelChangeType()).append(level).append("\n");
message.append("触发原因:").append("关联巡检点").append(relationName).append("检查").append(checkStatus);
} else if(notifyType.equals(TriggerRpnChangeTypeEum.alarm.getCode())){
//设备告警
message.append("执行时间:").append(executeDate).append("\n");
message.append("危险因素名称:").append(fmeaName).append("\n");
message.append("描述:").append("当前风险值上升到").append(rpn).append(",风险等级").append(getLevelChangeType()).append(level).append("\n");
message.append("触发原因:").append("关联设备").append(relationName).append("指标项报警");
} else if(notifyType.equals(TriggerRpnChangeTypeEum.alarmRecovery.getCode())){
//告警恢复
message.append(relationName).append("设备告警解除");
} else if(notifyType.equals(TriggerRpnChangeTypeEum.fmeaUpdate.getCode())){
//风险评价
message.append("评价人:").append(execute).append("\n");;
message.append("评价时间:").append(executeDate).append("\n");
message.append("评价内容:").append(fmeaName).append("\n");
message.append("评价等级:").append(level);
}
return message.toString();
}
private String getLevelChangeType(){
String changeType = "";
if(levelIsChange > 0){
changeType = "上升到";
}else if(levelIsChange == 0){
changeType = "不变";
} else {
changeType = "下降到";
}
return changeType;
}
public String getExecute() {
return execute;
}
public void setExecute(String execute) {
this.execute = execute;
}
public int getLevelIsChange() {
return levelIsChange;
}
public void setLevelIsChange(int levelIsChange) {
this.levelIsChange = levelIsChange;
}
public BigDecimal getRpn() {
return rpn;
}
public void setRpn(BigDecimal rpn) {
this.rpn = rpn;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getRelationName() {
return relationName;
}
public String getSubject() {
return subject;
}
public void setRelationName(String relationName) {
this.relationName = relationName;
}
}
package com.yeejoin.amos.fas.business.bo;
import com.yeejoin.amos.fas.dao.entity.Fmea;
import java.math.BigDecimal;
/**
* 参数对象
*/
public class MsgParamBo {
private String toke;
private String product;
private String appKey;
private Fmea fmea;
private Integer managerLevel;
private String notifyType;
private String userName;
private int levelIsChange;
private BigDecimal rpn;
private String level;
private String relationName;
public String getToke() {
return toke;
}
public void setToke(String toke) {
this.toke = toke;
}
public String getProduct() {
return product;
}
public void setProduct(String product) {
this.product = product;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public Fmea getFmea() {
return fmea;
}
public void setFmea(Fmea fmea) {
this.fmea = fmea;
}
public Integer getManagerLevel() {
return managerLevel;
}
public void setManagerLevel(Integer managerLevel) {
this.managerLevel = managerLevel;
}
public String getNotifyType() {
return notifyType;
}
public void setNotifyType(String notifyType) {
this.notifyType = notifyType;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public int getLevelIsChange() {
return levelIsChange;
}
public void setLevelIsChange(int levelIsChange) {
this.levelIsChange = levelIsChange;
}
public BigDecimal getRpn() {
return rpn;
}
public void setRpn(BigDecimal rpn) {
this.rpn = rpn;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getRelationName() {
return relationName;
}
public void setRelationName(String relationName) {
this.relationName = relationName;
}
}
......@@ -153,7 +153,6 @@ public class BaseController {
RequestContext.setToken(getToken());
RequestContext.setProduct(getProduct());
RequestContext.setAppKey(getAppKey());
FeignClientResult feignClientResult;
try {
feignClientResult = Privilege.agencyUserClient.getme();
......
......@@ -169,8 +169,8 @@ public class CommonController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取公司下人员列表", notes = "获取公司下人员列表")
@GetMapping(value = "/user/list", produces = "application/json;charset=UTF-8")
public CommonResponse getAllUser() {
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
ReginParams reginParams = getSelectedOrgInfo();
String compCode = getOrgCode(reginParams);
List<AgencyUserModel> users = commonService.getAllUser(getToken(),getProduct(),getAppKey(), compCode);
return CommonResponseUtil.success(users);
}
......
......@@ -125,7 +125,7 @@ public class RiskModelController extends BaseController {
RsDataQueue rs = RsDataQueue.getInstance();
params.forEach(param -> {
if (!ObjectUtils.isEmpty(param.getId())) {
rs.addUpdateMessage(param.getId());
rs.addUpdateMessage(param.getId(),user.getRealName());
}
});
return CommonResponseUtil.success();
......@@ -163,7 +163,7 @@ public class RiskModelController extends BaseController {
public CommonResponse queryFmeaByPage(@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<HashMap<String, Object>> fmeaList = fmeaService.queryFmeaList(param);
Page<HashMap<String, Object>> fmeaList = fmeaService.queryFmeaList(param,getToken(),getProduct(),getAppKey());
return CommonResponseUtil.success(fmeaList);
}
......
package com.yeejoin.amos.fas.business.controller;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.fas.business.bo.BindPointBo;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.intfc.IView3dService;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.business.vo.ExceptionRegionVo;
import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/view3d")
......@@ -49,8 +38,6 @@ public class View3dController extends BaseController {
public CommonResponse getRegionTree() {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
String channelType = this.getChannelType();
return CommonResponseUtil.success(riskSourceService.findRegionTree(channelType,orgCode));
}
......@@ -60,8 +47,6 @@ public class View3dController extends BaseController {
public CommonResponse getRegionDetail(@PathVariable("riskSourceId") Long riskSourceId) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1";
String channelType = this.getChannelType();
return CommonResponseUtil.success(riskSourceService.findRegionById(riskSourceId,orgCode,channelType));
}
......@@ -89,8 +74,6 @@ public class View3dController extends BaseController {
if(ResourceTypeDefEnum.containsTypeCode(type)) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
String channelType = this.getChannelType();
return CommonResponseUtil.success(view3dService.getPointTreeByType(type,orgCode,channelType));
}
......@@ -102,8 +85,6 @@ public class View3dController extends BaseController {
public CommonResponse getPointDetail(String type,Long pointId) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1";
return CommonResponseUtil.success(view3dService.getPointDetailByTypeAndId(type,pointId,orgCode));
}
......@@ -112,8 +93,6 @@ public class View3dController extends BaseController {
public CommonResponse safetyIndexWeek(String type,Long pointId) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getSafetyIndexWeek(orgCode));
}
......@@ -122,8 +101,6 @@ public class View3dController extends BaseController {
public CommonResponse getSafetyIndexInfoByDate(@RequestParam(name = "date",required = false) String date){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getSafetyIndexInfoByDate(orgCode,date));
}
......@@ -132,7 +109,6 @@ public class View3dController extends BaseController {
public CommonResponse getSafetyIndexDetail(@ApiParam(value = "risk-风险异常,check-巡检异常,equip-设备故障") @PathVariable String type){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getSafetyIndexDetail(type,orgCode));
}
......@@ -150,8 +126,6 @@ public class View3dController extends BaseController {
public CommonResponse getStatisticsCheck(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getStatisticsCheck(orgCode));
}
......@@ -160,8 +134,6 @@ public class View3dController extends BaseController {
public CommonResponse getSafetyExecuteListTop5(@PathVariable("type")String type){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.getSafetyExecuteListTop5(type,orgCode));
}
......@@ -170,7 +142,6 @@ public class View3dController extends BaseController {
public CommonResponse getStatisticsDuty(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
CommonResponse statisticsDuty = view3dService.getStatisticsDuty(getAppKey(),getProduct(),orgCode);
return statisticsDuty;
}
......@@ -180,7 +151,6 @@ public class View3dController extends BaseController {
public CommonResponse getExceptionRegion(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
List<ExceptionRegionVo> exceptionRegionVoList = view3dService.getExceptionRegion(orgCode);
return CommonResponseUtil.success(exceptionRegionVoList);
}
......@@ -198,8 +168,6 @@ public class View3dController extends BaseController {
public CommonResponse initViewNode(String type,Long riskSourceId){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.initViewErrorNode(type,riskSourceId,orgCode));
}
......@@ -208,7 +176,6 @@ public class View3dController extends BaseController {
public CommonResponse get3dPointsByType(@RequestParam(required = false,defaultValue = "grain") String model){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.get3dPointsByModel(orgCode,model));
}
......@@ -237,8 +204,6 @@ public class View3dController extends BaseController {
@ApiParam(value = "区域ID", required = false) @RequestParam(required = false) Long riskSourceId) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
//TODO:待删除
orgCode = "1*2";
return CommonResponseUtil.success(view3dService.find3dViewDataByType(type,riskSourceId,orgCode));
}
......@@ -252,7 +217,6 @@ public class View3dController extends BaseController {
) {
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return view3dService.retrieveAll(type,inputText,current,pageSize,orgCode);
}
......
......@@ -4,25 +4,19 @@ package com.yeejoin.amos.fas.business.feign;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.vo.Toke;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.privilege.model.PermissionModel;
import com.yeejoin.amos.feign.privilege.model.*;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.LinkedHashMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -219,42 +213,44 @@ public class RemoteSecurityService {
}
return agencyUserModel;
}
//根据orgCode查询机构用户
/**
* 根据orgCode查询机构用户
* @param toke toke
* @param product product
* @param appKey appKey
* @param orgCode orgCode
* @return List<AgencyUserModel>
*/
public List<AgencyUserModel> listUserByOrgCode(String toke,String product,String appKey,String orgCode) {
if (orgCode == null || orgCode.equals("")) {
return null;
}
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
List<AgencyUserModel> agencyUserModel=null;
FeignClientResult feignClientResult;
FeignClientResult feignClientResult = new FeignClientResult();
try {
feignClientResult = Privilege.agencyUserClient.queryByOrgCode(orgCode);
agencyUserModel = (List<AgencyUserModel>)feignClientResult.getResult();
} catch (InnerInvokException e) {
e.printStackTrace();
}
return agencyUserModel;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByOrgCode(orgCode);
// return handleArray(commonResponse, UserModel.class);
return handleArray(feignClientResult,AgencyUserModel.class);
}
//根据orgCode查询机构
/**
* 根据orgCode查询机构
* @param toke toke
* @param product product
* @param appKey appKey
* @param orgCode orgCode
* @return Map<String, Object>
*/
public Map<String, Object> listByOrgCode(String toke,String product,String appKey,String orgCode) {
if (orgCode == null || orgCode.equals("")) {
return null;
}
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......@@ -268,11 +264,6 @@ public class RemoteSecurityService {
e.printStackTrace();
}
return agencyUserModel;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByOrgCode(orgCode);
// return handleArray(commonResponse, UserModel.class);
}
......@@ -363,37 +354,35 @@ public class RemoteSecurityService {
// CommonResponse commonResponse = iAmosSecurityServer.getDepartmentTreeByCompanyId(companyId);
// return handleArray(commonResponse, DepartmentBo.class);
}
//根据id批量获取部门信息
public List<LinkedHashMap> listDepartmentByDeptIds(String toke,String product,String appKey,String departmentIds) {
/**
* 根据id批量获取部门信息
* @param toke token
* @param product product
* @param appKey appKey
* @param "200".equals(feignClientResult.getStatus())departmentIds 部门ids
* @return List<DepartmentModel>
*/
public List<DepartmentModel> listDepartmentByDeptIds(String toke,String product,String appKey,String departmentIds) {
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
List<LinkedHashMap> departmentModel=null;
FeignClientResult feignClientResult;
FeignClientResult feignClientResult = new FeignClientResult();
try {
feignClientResult = Privilege.departmentClient.queryDeptByIds(departmentIds);
departmentModel = (List<LinkedHashMap>)feignClientResult.getResult();
} catch (InnerInvokException e) {
e.printStackTrace();
}
return departmentModel;
//CommonResponse commonResponse = iAmosSecurityServer.listDepartmentByDeptIds(departmentIds);
//return handleArray(commonResponse, DepartmentBo.class);
return handleArray(feignClientResult,DepartmentModel.class);
}
private <T> List<T> handleArray(CommonResponse commonResponse, Class<T> t) {
if (commonResponse != null && commonResponse.isSuccess()) {
String jsonStr = JSON.toJSONString(commonResponse.getDataList());
return JSONArray.parseArray(jsonStr, t);
private <T> List<T> handleArray(FeignClientResult feignClientResult, Class<T> t) {
List<T> list = new ArrayList<>();
if (feignClientResult != null && feignClientResult.getStatus() == 200) {
String jsonStr = JSON.toJSONString(feignClientResult.getResult());
list = JSONArray.parseArray(jsonStr, t);
}
return null;
return list;
}
private <T> T handleObj(CommonResponse commonResponse, Class<T> t) {
......
......@@ -72,18 +72,11 @@ public class AppMessagePushService {
}
public void sendMessage(PushMsgParam response) {
CommonResponse commonResponse = PushFeign.sendMessageone(response);
// try {
// if (null != response && "true".equals(isPush)) {
// PushPayload payload = PushPayload.newBuilder().setPlatform(Platform.android())
// .setAudience(Audience.all())
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// jpushClient.sendPush(payload);
// }
// } catch (Exception e) {
// log.error("极光推送异常", e);
// }
try {
CommonResponse commonResponse = PushFeign.sendMessageone(response);
} catch (Exception e) {
log.error("极光推送异常", e);
}
}
}
package com.yeejoin.amos.fas.business.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
......@@ -24,6 +21,7 @@ import com.yeejoin.amos.fas.dao.entity.AccidentType;
import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.util.CollectionUtils;
@Service("accidentTypeService")
public class AccidentTypeServiceImpl implements IAccidentTypeService {
......@@ -71,8 +69,7 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
}
@Override
public List<HashMap<String,Object>> queryAccidentType(String orgCode) {
public List<HashMap<String,Object>> queryAccidentType(String orgCode) {
return accidentTypeMapper.findAccidentTypeListByOrgCode(orgCode);
}
......@@ -80,35 +77,35 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
public Page<HashMap<String, Object>> queryAccidentTypePage(String toke,String product,String appKey,CommonPageInfoParam param) {
long total = accidentTypeMapper.countPageData(param);
List<HashMap<String, Object>> content = accidentTypeMapper.findAccidentTypePage(param);
List<String> userIdList = new ArrayList<String>();
List<String> deptIdList = new ArrayList<String>();
for(HashMap<String, Object> map : content)
{
String userId = String.valueOf(map.get("createBy"));
String deptId = String.valueOf(map.get("deptId"));
if(userId!=null&&!userIdList.contains(userId))
if(!CollectionUtils.isEmpty(content)){
Set<String> userIds = new HashSet<>();
Set<String> deptIds = new HashSet<>();
for(HashMap<String, Object> map : content)
{
userIdList.add(userId);
String userId = String.valueOf(map.get("createBy"));
String deptId = String.valueOf(map.get("deptId"));
userIds.add(userId);
deptIds.add(deptId);
}
if(deptId!=null&&!deptIdList.contains(deptId))
{
deptIdList.add(deptId);
userIds.remove(null);
userIds.remove("");
deptIds.remove(null);
deptIds.remove("");
List<AgencyUserModel> users = new ArrayList<>();
if(!CollectionUtils.isEmpty(userIds)){
users = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
List<DepartmentModel> depts = new ArrayList<>();
if(!CollectionUtils.isEmpty(deptIds)){
depts = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds));
}
Map<String, String > deptMap = depts.stream().collect(Collectors.toMap(e-> e.getSequenceNbr().toString(),DepartmentModel::getDepartmentName));
content.forEach(e -> {
e.put("userName",userMap.get(e.get("createBy")));
e.put("deptName",deptMap.get(e.get("deptId")));
});
}
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
Map<String, String> userMap = new HashMap<String,String>();
for (int i = 0; i < users.size(); i++) {
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
}
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
Map<String, String> deptMap = new HashMap<String,String>();
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
content.forEach(e -> {
e.put("userName",userMap.get(e.get("createBy")));
e.put("deptName",deptMap.get(e.get("deptId")));
});
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result;
}
......
......@@ -9,6 +9,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Sets;
......@@ -100,17 +101,13 @@ public class FireCarServiceImpl implements IFireCarService {
Set<String> deptIds = Sets.newHashSet(Lists.transform(content, Map->Map.get("dept_id")+""));
deptIds.remove("");
deptIds.remove(null);
Map<String, String> deptMap = new HashMap<String,String>();
if(!CollectionUtils.isEmpty(deptIds)){
List<LinkedHashMap> deptList = remoteSecurityService.listDepartmentByDeptIds( toke, product, appKey,Joiner.on(",").join(deptIds));
for (int i = 0; i < deptList.size(); i++) {
deptMap.put(deptList.get(i).get("sequenceNbr").toString(), deptList.get(i).get("departmentName").toString());
}
List<DepartmentModel> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds));
Map<Long, String> deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName));
content.forEach(e -> {
e.put("departmentName",deptMap.get(e.get("dept_id")));
});
}
Map<String, String> deptMapNew= deptMap;
content.forEach(e -> {
e.put("departmentName",deptMapNew.get(e.get("dept_id")));
});
}
Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total);
return result;
......
package com.yeejoin.amos.fas.business.service.impl;
import com.google.common.base.Joiner;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper;
......@@ -10,6 +11,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.feign.RemoteRuleServer;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IFmeaService;
import com.yeejoin.amos.fas.business.service.model.RiskSourceRo;
......@@ -28,12 +30,8 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors;
@Service("fmeaService")
public class FmeaServiceImpl implements IFmeaService {
......@@ -58,7 +56,7 @@ public class FmeaServiceImpl implements IFmeaService {
IRiskFactorDao iRiskFactorDao;
@Autowired
private RemoteRuleServer remoteRuleServer;
private RemoteSecurityService remoteSecurityService;
@Autowired
private FmeaEquipmentPointMapper fmeaEquipmentPointMapper;
......@@ -84,76 +82,37 @@ public class FmeaServiceImpl implements IFmeaService {
}
@Override
public Page<HashMap<String, Object>> queryFmeaList(CommonPageInfoParam param) {
public Page<HashMap<String, Object>> queryFmeaList(CommonPageInfoParam param,String toke,String product,String appKey) {
long total = fmeaMapper.countPageData(param);
List<HashMap<String, Object>> content = fmeaMapper.queryFmeaPage(param);
StringBuffer sb = new StringBuffer();
for(HashMap<String, Object> map : content)
{
//String[] ids = sb.toString().split(",");
//String companyLeaderId = String.valueOf(map.get("companyLeaderId"));
sb.append(map.get("companyLeaderId"));
sb.append(map.get(","));
//String departmentLeaderId = String.valueOf(map.get("departmentLeaderId"));
sb.append(map.get("departmentLeaderId"));
sb.append(map.get(","));
//String groupLeaderId = String.valueOf(map.get("groupLeaderId"));
sb.append(map.get("groupLeaderId"));
sb.append(map.get(","));
//String personLeaderId = String.valueOf(map.get("personLeaderId"));
sb.append(map.get("personLeaderId"));
sb.append(map.get(","));
//String identifyUserId = String.valueOf(map.get("identifyUserId"));
sb.append(map.get("identifyUserId"));
sb.append(map.get(","));
}
sb.deleteCharAt(sb.length()-1);
FeignClientResult<List<AgencyUserModel>> resultSec = Privilege.agencyUserClient.queryByIds(sb.toString());
for(HashMap<String, Object> map : content)
{
String companyLeaderId = String.valueOf(map.get("companyLeaderId"));
String departmentLeaderId = String.valueOf(map.get("departmentLeaderId"));
String groupLeaderId = String.valueOf(map.get("groupLeaderId"));
String personLeaderId = String.valueOf(map.get("personLeaderId"));
String identifyUserId = String.valueOf(map.get("identifyUserId"));
for(AgencyUserModel user : resultSec.getResult())
{
if(companyLeaderId!=null&& companyLeaderId.equals(user.getUserId()))
{
map.put("companyLeaderName", user.getRealName());
}
if(departmentLeaderId!=null&& departmentLeaderId.equals(user.getUserId()))
{
map.put("departmentLeaderName", user.getRealName());
}
if(groupLeaderId!=null&& groupLeaderId.equals(user.getUserId()))
{
map.put("groupLeaderName", user.getRealName());
}
if(personLeaderId!=null&& personLeaderId.equals(user.getUserId()))
{
map.put("personLeaderName", user.getRealName());
}
if(identifyUserId!=null&& identifyUserId.equals(user.getUserId()))
{
map.put("identifyUserName", user.getRealName());
}
}
}
Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total);
return result;
if(!CollectionUtils.isEmpty(content)) {
Set<String> userIds = new HashSet<>();
for (HashMap<String, Object> map : content) {
userIds.add(String.valueOf(map.get("companyLeaderId")));
userIds.add(String.valueOf(map.get("departmentLeaderId")));
userIds.add(String.valueOf(map.get("groupLeaderId")));
userIds.add(String.valueOf(map.get("personLeaderId")));
userIds.add(String.valueOf(map.get("identifyUserId")));
}
userIds.remove(null);
userIds.remove("");
if(!CollectionUtils.isEmpty(userIds)){
List<AgencyUserModel> users = new ArrayList<>();
if(!CollectionUtils.isEmpty(userIds)){
users = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
for (HashMap<String, Object> map : content) {
map.put("companyLeaderName", userMap.get(map.get("companyLeaderId")));
map.put("departmentLeaderName", userMap.get(map.get("departmentLeaderId")));
map.put("groupLeaderName", userMap.get(map.get("groupLeaderId")));
map.put("personLeaderName", userMap.get(map.get("personLeaderId")));
map.put("identifyUserName", userMap.get(map.get("identifyUserId")));
}
}
}
return new PageImpl<HashMap<String, Object>>(content, param, total);
}
......
package com.yeejoin.amos.fas.business.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import com.google.common.base.Joiner;
import com.yeejoin.amos.fas.business.dao.mapper.RiskFactorMapper;
import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
......@@ -25,6 +13,15 @@ import com.yeejoin.amos.fas.dao.entity.Fmea;
import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
@Service("riskFactorService")
public class RiskFactorServiceImpl implements IRiskFactorService {
......@@ -46,35 +43,35 @@ public class RiskFactorServiceImpl implements IRiskFactorService {
public Page<HashMap<String, Object>> queryRiskFactorPage(String toke,String product,String appKey,CommonPageInfoParam param) {
long total = riskFactorMapper.countPageData(param);
List<HashMap<String, Object>> content = riskFactorMapper.queryRiskFactorPage(param);
List<String> userIdList = new ArrayList<String>();
List<String> deptIdList = new ArrayList<String>();
for(HashMap<String, Object> map : content)
{
String userId = String.valueOf(map.get("createBy"));
String deptId = String.valueOf(map.get("deptId"));
if(userId!=null&&!userIdList.contains(userId))
{
userIdList.add(userId);
}
if(deptId!=null&&!deptIdList.contains(deptId))
{
deptIdList.add(deptId);
}
}
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
Map<String, String> userMap = new HashMap<String,String>();
for (int i = 0; i < users.size(); i++) {
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
}
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
Map<String, String> deptMap = new HashMap<String,String>();
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
content.forEach(e -> {
e.put("userName",userMap.get(e.get("createBy")));
e.put("deptName",deptMap.get(e.get("deptId")));
});
if(!CollectionUtils.isEmpty(content)){
Set<String> userIds = new HashSet<>();
Set<String> deptIds = new HashSet<>();
for(HashMap<String, Object> map : content)
{
String userId = String.valueOf(map.get("createBy"));
String deptId = String.valueOf(map.get("deptId"));
userIds.add(userId);
deptIds.add(deptId);
}
userIds.remove(null);
userIds.remove("");
deptIds.remove(null);
deptIds.remove("");
List<AgencyUserModel> users = new ArrayList<>();
if(!CollectionUtils.isEmpty(userIds)){
users = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
List<DepartmentModel> depts = new ArrayList<>();
if(!CollectionUtils.isEmpty(deptIds)){
depts = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds));
}
Map<String, String > deptMap = depts.stream().collect(Collectors.toMap(e-> e.getSequenceNbr().toString(),DepartmentModel::getDepartmentName));
content.forEach(e -> {
e.put("userName",userMap.get(e.get("createBy")));
e.put("deptName",deptMap.get(e.get("deptId")));
});
}
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result;
}
......
......@@ -31,6 +31,8 @@ import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.util.CollectionUtils;
@Service("riskLevelService")
public class RiskLevelServiceImpl implements IRiskLevelService {
@Autowired
......@@ -46,25 +48,26 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
public Page<HashMap<String, Object>> queryRiskLevelPage(String toke,String product,String appKey,CommonPageInfoParam param) {
long total = riskLevelMapper.countPageData(param);
List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param);
Set<String> userIdList = new HashSet<String>();
for(HashMap<String, Object> map : content)
{
userIdList.add(String.valueOf(map.get("createBy")));
}
Map<String, String> userMap = new HashMap<String,String>();
if(userIdList.size()>0)
{
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
for (int i = 0; i < users.size(); i++) {
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
}
if(!CollectionUtils.isEmpty(content)){
Set<String> userIds = new HashSet<String>();
for(HashMap<String, Object> map : content)
{
String userId = String.valueOf(map.get("createBy"));
userIds.add(userId);
}
userIds.remove(null);
userIds.remove("");
List<AgencyUserModel> users = new ArrayList<>();
if(!CollectionUtils.isEmpty(userIds)){
users = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName));
content.forEach(e -> {
e.put("userName", userMap.get(String.valueOf(e.get("createBy"))));
e.put("manageLevelName",
StringUtil.isNotEmpty(e.get("manageLevel")) ? ManageLevelEum.getNameByManageLevel(Integer.parseInt(e.get("manageLevel").toString())) : "");
});
}
content.forEach(e -> {
e.put("userName",userMap.get(String.valueOf(e.get("createBy"))));
e.put("manageLevelName",
StringUtil.isNotEmpty(e.get("manageLevel")) ? ManageLevelEum.getNameByManageLevel(Integer.parseInt(e.get("manageLevel").toString())) : "");
});
return new PageImpl<>(content, param, total);
}
......
package com.yeejoin.amos.fas.business.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.bo.RpnCalculationBo;
import com.yeejoin.amos.fas.business.bo.*;
import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
import com.yeejoin.amos.fas.business.dao.mapper.*;
import com.yeejoin.amos.fas.business.dao.mongo.EquipCommunicationDao;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IDictDao;
import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentPointDao;
import com.yeejoin.amos.fas.business.dao.repository.IFmeaDao;
import com.yeejoin.amos.fas.business.dao.repository.IPPointDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
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.IRpnChangeLogDao;
import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.feign.RemoteRuleServer;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer;
......@@ -82,12 +25,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.model.CheckInputItemRo;
import com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus;
import com.yeejoin.amos.fas.business.service.model.ContingencyRo;
import com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.service.model.ProtalDataRo;
import com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo;
import com.yeejoin.amos.fas.business.service.model.*;
import com.yeejoin.amos.fas.business.util.DateUtils;
import com.yeejoin.amos.fas.business.util.JexlUtil;
import com.yeejoin.amos.fas.business.util.RpnUtils;
......@@ -97,24 +35,32 @@ import com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import com.yeejoin.amos.fas.dao.entity.Dict;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.EvaluationModel;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentData;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
import com.yeejoin.amos.fas.dao.entity.Fmea;
import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
import com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem;
import com.yeejoin.amos.fas.dao.entity.PPoint;
import com.yeejoin.amos.fas.dao.entity.PreplanPicture;
import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.dao.entity.RpnChangeLog;
import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
@Service("riskSourceService")
......@@ -216,6 +162,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private FmeaPointInputitemMapper fmeaPointInputitemMapper;
@Autowired
private IRiskFactorDao iRiskFactorDao;
public static String cacheKeyForCanBeRunning() {
return Redis.genKey(CacheType.ERASABLE.name(), "CONTINGENCYRUNING");
}
......@@ -404,10 +353,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaEquipmentPoint.setEquipmentPointId(equipmentPointId);
returnList.add(fmeaEquipmentPoint);
}
if (!CollectionUtils.isEmpty(returnList)) {
Equipment equipment = equipmentService.queryOne(importantEquipId);
if (!CollectionUtils.isEmpty(returnList) && equipment != null) {
fmeaEquipmentPointMapper.saveBatch(returnList);
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
rsDataQueue.addEquipmentMessage(fmeaId);
rsDataQueue.addEquipmentMessage(fmeaId,equipment.getName());
}
return returnList;
}
......@@ -582,44 +532,34 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return new PageImpl<>(content, null, total);
}
content = fmeaPointInputitemMapper.listByFmeaId(fmeaId, pageNumber, pageSize);
List<String> userIdList = new ArrayList<String>();
List<String> deptIdList = new ArrayList<String>();
for(Map<String, Object> map : content)
{
String userId = String.valueOf(map.get("userId"));
String deptId = String.valueOf(map.get("deptId"));
if(userId!=null&&!userIdList.contains(userId))
{
userIdList.add(userId);
}
if(deptId!=null&&!deptIdList.contains(deptId))
{
deptIdList.add(deptId);
}
}
Map<String, String> userMap = new HashMap<String,String>();
Map<String, String> deptMap = new HashMap<String,String>();
if(userIdList.size()>0)
{
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
for (int i = 0; i < users.size(); i++) {
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
}
}
if(deptIdList.size()>0)
{
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
if(!CollectionUtils.isEmpty(content)){
Set<String> userIds = new HashSet<>();
Set<String> deptIds = new HashSet<>();
for(Map<String, Object> map : content)
{
String userId = String.valueOf(map.get("userId"));
String deptId = String.valueOf(map.get("deptId"));
userIds.add(userId);
deptIds.add(deptId);
}
userIds.remove(null);
deptIds.remove(null);
List<AgencyUserModel> users = new ArrayList<>();
if(!CollectionUtils.isEmpty(userIds)){
users = remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIds));
}
Map<String, String> userMap = users.stream().collect(Collectors.toMap(AgencyUserModel::getUserId,AgencyUserModel::getRealName));
List<DepartmentModel> depts = new ArrayList<>();
if(!CollectionUtils.isEmpty(deptIds)){
depts = remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIds));
}
Map<Long, String > deptMap = depts.stream().collect(Collectors.toMap(DepartmentModel::getSequenceNbr,DepartmentModel::getDepartmentName));
content.forEach(e -> {
e.put("userName",userMap.get(e.get("userId")));
e.put("deptName",deptMap.get(e.get("deptId")));
e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel")));
});
}
content.forEach(e -> {
e.put("username",userMap.get(String.valueOf(e.get("userId"))));
e.put("depName",deptMap.get(String.valueOf(e.get("deptId"))));
e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel")));
});
return new PageImpl<>(content, null, total);
}
......@@ -642,25 +582,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Async
public void processProtalData(String toke, String product, String appKey, ProtalDataRo protalData) {
String bacthNo = UUID.randomUUID().toString();
protalData.setBatchNo(bacthNo);
Optional<PPoint> pPoint1 = iPPointDao.findById(protalData.getId());
PPoint pPoint = null;
if (pPoint1.isPresent()) {
pPoint = pPoint1.get();
}
if (pPoint != null) {
protalData.setOriginalNodeState(pPoint.getStatus());
protalData.setLevel(pPoint.getLevel());
protalData.setPointNo(pPoint.getPointNo());
protalData.setPointName(pPoint.getName());
AgencyUserModel sUser = remoteSecurityService.getUserById(toke, product, appKey, pPoint.getChargePersonId());
if (sUser != null) {
protalData.setUserName(sUser.getUserName());
} else {
protalData.setUserName("");
}
}
if (!CollectionUtils.isEmpty(protalData.getItems())) {
Long pointId = protalData.getId();
List<Long> inputIds = Lists.newArrayList();
......@@ -690,7 +611,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaPointInputitemMapper.updateStateByIds(0, successIds);
}
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
fmeaIds.forEach(fmeaId -> rsDataQueue.addPatrolMessage(fmeaId));
fmeaIds.forEach(fmeaId ->
rsDataQueue.addPatrolMessage(fmeaId,protalData.getCheckUser(),protalData.getName(),protalData.getNodeState()));
}
iDataRefreshService.refreshViewData(DataRefreshTypeEum.check.getCode());
}
......@@ -770,7 +692,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private void processFireData(AlarmParam deviceData) throws Exception {
//处理设备和巡检数据
deviceData.setNodeState(deviceData.getState());
FireEquipmentPoint fireEquipmentPoint = iFireEquipmentPointDao.findOneByCode(deviceData.getPointCode());
fireEquipmentPoint.setValue(deviceData.getState());
updateFirePointValue(fireEquipmentPoint.getId(), deviceData.getState());
......@@ -817,7 +738,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return;
}
deviceData.setBatchNo(batchNo);
deviceData.setMonitor(equipment.getName());
deviceData.setEquimentId(String.valueOf(equipment.getId()));
if ("alarm_type_fire".equals(fireEquipmentPointType)) {
......@@ -972,7 +892,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaEquipmentPointMapper.updateStateByIds(state, ids);
}
RsDataQueue rsDataQueue = RsDataQueue.getInstance();
fmeaIds.forEach(fmeaId -> rsDataQueue.addEquipmentMessage(fmeaId));
fmeaIds.forEach(fmeaId -> rsDataQueue.addEquipmentMessage(fmeaId,param.getMonitor()));
}
}
......@@ -1117,12 +1037,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 修改、添加导致rpn、rpni改变
*/
@Override
public void notifyFmeaFromUpdate(String toke, String product, String appKey, Long fmeaId, String nofityType) {
public void notifyFmeaFromUpdate(String toke, String product, String appKey, Long fmeaId, String nofityType,String userName) {
Fmea fmea = fmeaMapper.getById(fmeaId);
if (fmea == null) {
return;
}
if (fmea.getEvaluationOid() != null && fmea.getEvaluationSid() != null && fmea.getEvaluationDid() != null) {
MsgParamBo msgParamBo = new MsgParamBo();
BigDecimal oidValue = new BigDecimal(fmea.getOidValue());
BigDecimal sidValue = new BigDecimal(fmea.getSidValue());
BigDecimal didValue = new BigDecimal(fmea.getDidValue());
......@@ -1136,29 +1057,52 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} else {
BigDecimal newOidValue = new BigDecimal(fmea.getNewOidValue());
rpn = newOidValue.multiply(sidValue).multiply(didValue).setScale(2, BigDecimal.ROUND_HALF_UP);
;
}
List<RiskLevel> levels = riskLevelDao.findAll();
RiskLevel newLevel = RpnUtils.getBetweenLevel(rpn, levels);
Set<String> jpushTargets = new LinkedHashSet<>();
JpushMsgBo jpushMsgBo = new JpushMsgBo();
fmea.setRpni(rpni);
fmea.setRpn(rpn);
if (newLevel != null) {
fmea.setRiskLevelId(newLevel.getId());
getJpushTarget(toke, product, appKey, fmea, newLevel.getManageLevel());
msgParamBo.setAppKey(appKey);
msgParamBo.setToke(toke);
msgParamBo.setProduct(product);
msgParamBo.setFmea(fmea);
msgParamBo.setManagerLevel(newLevel.getManageLevel());
msgParamBo.setLevel(newLevel.getName());
msgParamBo.setUserName(userName);
msgParamBo.setNotifyType(nofityType);
jpushMsgBo = this.getJushMessageInfo(msgParamBo);
}
//1.3更新fmea
fmeaMapper.updateRpn(fmea);
//2.计算上级风险值(风险点及父节点)
this.notifyRiskSource(fmeaId, fmea.getRiskSourceId(), nofityType, jpushTargets);
this.notifyRiskSource(fmeaId, fmea.getRiskSourceId(), nofityType, jpushMsgBo);
}
}
private Set<String> getJpushTarget(String toke, String product, String appKey, Fmea fmea, Integer managerLevel) {
private JpushMsgBo getJushMessageInfo(MsgParamBo msgParam){
JpushMsgBo msgBo = new JpushMsgBo();
Optional<RiskFactor> optional = iRiskFactorDao.findById(msgParam.getFmea().getRiskFactorsId());
if(optional.isPresent()){
JpushMsgContentBo jpushMsgContentBo = new JpushMsgContentBo(optional.get().getName(),msgParam.getNotifyType());
jpushMsgContentBo.setExecute(msgParam.getUserName());
jpushMsgContentBo.setLevelIsChange(msgParam.getLevelIsChange());
jpushMsgContentBo.setLevel(msgParam.getLevel());
jpushMsgContentBo.setRelationName(msgParam.getRelationName());
jpushMsgContentBo.setRpn(msgParam.getRpn());
msgBo.setTarget(this.getJpushTarget(msgParam));
msgBo.setMsg(jpushMsgContentBo);
}
return msgBo;
}
private Set<String> getJpushTarget(MsgParamBo msgParam) {
Set<String> targets = new LinkedHashSet<>();
Set<String> userIds = this.getUsersByLevel(managerLevel, fmea);
Set<String> userIds = this.getUsersByLevel(msgParam.getManagerLevel(), msgParam.getFmea());
userIds.forEach(userId -> {
AgencyUserModel user = remoteSecurityService.getUserById(toke, product, appKey, userId);
AgencyUserModel user = remoteSecurityService.getUserById(msgParam.getToke(), msgParam.getProduct(), msgParam.getAppKey(), userId);
if (user != null) {
String target = user.getMobile();
targets.add(target);
......@@ -1192,7 +1136,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 告警或者不合格项导致fmea的rpn、new_evaluation_oid改变
*/
@Override
public void notifyFmeaFromAbnormal(String toke, String product, String appKey, Long fmeaId, String notifyType) {
public void notifyFmeaFromAbnormal(
String toke, String product, String appKey,
Long fmeaId, String notifyType,String userName, String relationName) {
Fmea fmea = fmeaMapper.getById(fmeaId);
if (fmea == null) {
return;
......@@ -1215,16 +1161,26 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
RiskLevel newLevel = RpnUtils.getBetweenLevel(rpn, levels);
fmea.setRpn(rpn);
fmea.setNewEvaluationOid(oEvaluationModel.getId());
Set<String> jpushTargets = new LinkedHashSet<>();
JpushMsgBo jpushMsgBo = new JpushMsgBo();
MsgParamBo msgParamBo = new MsgParamBo();
if (newLevel != null) {
//1.2根据风险等级对应的责任等级获取责任人
jpushTargets = getJpushTarget(toke, product, appKey, fmea, newLevel.getManageLevel());
fmea.setRiskLevelId(newLevel.getId());
msgParamBo.setAppKey(appKey);
msgParamBo.setToke(toke);
msgParamBo.setProduct(product);
msgParamBo.setFmea(fmea);
msgParamBo.setManagerLevel(newLevel.getManageLevel());
msgParamBo.setLevel(newLevel.getName());
msgParamBo.setUserName(userName);
msgParamBo.setNotifyType(notifyType);
msgParamBo.setRelationName(relationName);
jpushMsgBo = this.getJushMessageInfo(msgParamBo);
}
//1.3.更新fmea的rpn、风险等级及newOid
fmeaMapper.updateRpn(fmea);
//2.计算风险点rpn、rpni、riskLevelId
this.notifyRiskSource(fmeaId, fmea.getRiskSourceId(), notifyType, jpushTargets);
this.notifyRiskSource(fmeaId, fmea.getRiskSourceId(), notifyType, jpushMsgBo);
}
}
}
......@@ -1256,7 +1212,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* fmea的更新导致rpn、rpni的值改变
*/
@Override
public void notifyRiskSource(Long fmeaId, Long riskSourceId, String notifyType, Set<String> jpushTargets) {
public void notifyRiskSource(Long fmeaId, Long riskSourceId, String notifyType, JpushMsgBo jpushMsgBo) {
Optional<RiskSource> riskSource1 = iRiskSourceDao.findById(riskSourceId);
RiskSource riskSource = null;
if (riskSource1.isPresent()) {
......@@ -1277,7 +1233,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
this.saveRpnLog(riskSource.getId(), fmeaId, resetValue, resetValue, notifyType);
//3.更新父节点rpn、rpni、风险等级
this.updateParentRpn(riskSource.getParentId());
//4.知全景监控屏幕数据刷新
//4.知全景监控屏幕数据刷新
iDataRefreshService.refreshViewData(DataRefreshTypeEum.rpn.getCode());
} else {//fmea评价、巡检、告警
RpnCalculationBo rpnValueBo = RpnUtils.calRpnAndRpni(fmeas);
......@@ -1302,7 +1258,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//3.更新父节点rpn、rpni、风险等级
this.updateParentRpn(riskSource.getParentId());
//4.极光推送给手机客户端
jpushRiskSourceMessage("风险预警", jpushTargets);
jpushRiskSourceMessage(jpushMsgBo);
//5.规则告警(消息)TODO
notifyRule(riskSourceId, rpn, rpni, notifyType,changeType);
//6.通知全景监控屏幕数据刷新
......@@ -1385,16 +1341,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
/**
* 极光推送
*/
private void jpushRiskSourceMessage(String content, Set<String> jpushTarget) {
if (CollectionUtils.isEmpty(jpushTarget)) {
private void jpushRiskSourceMessage(JpushMsgBo jpushMsgBo) {
if (jpushMsgBo == null) {
return;
}
PushMsgParam pushMsgParam = new PushMsgParam();
pushMsgParam.setRecivers(Lists.newArrayList(jpushTarget));
pushMsgParam.setContent(content);
pushMsgParam.setSubject("风险点RPN值改变");
pushMsgParam.setType(JPushTypeEnum.ALIAS.getCode());
appMessagePushService.sendMessage(pushMsgParam);
JpushMsgContentBo jpushMsgContentBo = jpushMsgBo.getMsg();
Set<String> target = jpushMsgBo.getTarget();
if(jpushMsgContentBo.getSend()){
PushMsgParam pushMsgParam = new PushMsgParam();
pushMsgParam.setRecivers(Lists.newArrayList(target));
pushMsgParam.setContent(jpushMsgContentBo.genMessage());
pushMsgParam.setSubject(jpushMsgContentBo.getSubject());
pushMsgParam.setType(JPushTypeEnum.ALIAS.getCode());
appMessagePushService.sendMessage(pushMsgParam);
}
}
/**
......
......@@ -20,7 +20,7 @@ public interface IFmeaService {
/**
* 分页查询Fmea
*/
Page<HashMap<String, Object>> queryFmeaList(CommonPageInfoParam param);
Page<HashMap<String, Object>> queryFmeaList(CommonPageInfoParam param,String toke,String product,String appKey);
//
// void updateRpniInfo(Long riskSourceId);
......
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.bo.JpushMsgBo;
import com.yeejoin.amos.fas.business.param.AlarmParam;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.param.FmeaBindParam;
......@@ -108,9 +109,9 @@ public interface IRiskSourceService {
Integer getChildTypeByPid(Long riskSourceId);
void notifyFmeaFromAbnormal(String toke,String product,String appKey,Long fmeaId, String notifyType);
void notifyFmeaFromAbnormal(String toke,String product,String appKey,Long fmeaId, String notifyType,String userName, String relationName);
void notifyFmeaFromUpdate(String toke,String product,String appKey,Long fmeaId, String nofityType);
void notifyFmeaFromUpdate(String toke,String product,String appKey,Long fmeaId, String nofityType,String userName);
/**
* 按照机构重新区域树
......@@ -133,7 +134,7 @@ public interface IRiskSourceService {
*/
void batchSaveRegionUe4(List<BindRegionBo> regionBoList);
void notifyRiskSource(Long fmeaId, Long riskSourceId, String notifyType, Set<String> jpushTargets);
void notifyRiskSource(Long fmeaId, Long riskSourceId, String notifyType, JpushMsgBo jpushMsgBo);
void notifyFmeaFromDelete(Long handId, String from);
......
......@@ -21,6 +21,11 @@ public class ProtalDataRo extends BasicsRo {
private String userName;
/**
* 巡检人员
*/
private String checkUser;
/**
* 任务编号,如果无任务,则填充0
*/
private long taskId = 0;
......@@ -92,6 +97,14 @@ public class ProtalDataRo extends BasicsRo {
this.originalTaskState = originalTaskState;
}
public String getCheckUser() {
return checkUser;
}
public void setCheckUser(String checkUser) {
this.checkUser = checkUser;
}
public String getTaskName() {
return taskName;
}
......
......@@ -6,11 +6,39 @@ public class FmeaMessage {
private String norifyFrom;
private String userName;
/**
* 设备名称或者巡检点名称
*/
private String relationName;
private String checkStatus;
public FmeaMessage(Long handId, String norifyFrom,String userName) {
this.handId = handId;
this.norifyFrom = norifyFrom;
this.userName = userName;
}
public FmeaMessage(Long handId, String norifyFrom) {
this.handId = handId;
this.norifyFrom = norifyFrom;
}
public FmeaMessage(Long handId, String norifyFrom,String userName, String relationName, String checkStatus) {
this.handId = handId;
this.norifyFrom = norifyFrom;
this.userName = userName;
this.relationName = relationName;
this.checkStatus = checkStatus;
}
public Long getHandId() {
return handId;
}
......@@ -26,4 +54,28 @@ public class FmeaMessage {
public void setNorifyFrom(String norifyFrom) {
this.norifyFrom = norifyFrom;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getRelationName() {
return relationName;
}
public void setRelationName(String relationName) {
this.relationName = relationName;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
}
......@@ -26,12 +26,11 @@ public class RsDataQueue {
private IRiskSourceService riskSourceService;
private volatile static RsDataQueue instance = null;
private static final String TOKE = "TOKE";
@Autowired
private RemoteSecurityService remoteSecurityService;
private RsDataQueue() {
riskSourceService = (IRiskSourceService) IotContext.getInstance().getBean(IRiskSourceService.class);
remoteSecurityService = (RemoteSecurityService)IotContext.getInstance().getBean(RemoteSecurityService.class);
}
/**
......@@ -62,16 +61,21 @@ public class RsDataQueue {
service_apdu.execute(task_runnable);
}
public void addUpdateMessage(Long fmeaId) {
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.fmeaUpdate.getCode()));
public void addUpdateMessage(Long fmeaId,String userName) {
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.fmeaUpdate.getCode(),userName));
}
public void addPatrolMessage(Long fmeaId) {
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.patrol.getCode()));
}
public void addEquipmentMessage(Long fmeaId) {
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.equipment.getCode()));
public void addPatrolMessage(Long fmeaId, String userName, String pointName, String checkStatus) {
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.patrol.getCode(),userName,pointName,checkStatus));
}
public void addEquipmentMessage(Long fmeaId,String equipmentName) {
blockingQueue.add(new FmeaMessage(fmeaId, TriggerRpnChangeTypeEum.alarm.getCode(),"",equipmentName,""));
}
public void addDeleteMessage(Long riskSourceId) {
......@@ -99,15 +103,17 @@ public class RsDataQueue {
}
String from = fmeaMessage.getNorifyFrom();
Long handId = fmeaMessage.getHandId();
String userName = fmeaMessage.getUserName();
String relationName = fmeaMessage.getRelationName();
if (from.equals(TriggerRpnChangeTypeEum.patrol.getCode())) {
//巡检不合格通知
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from);
} else if (from.equals(TriggerRpnChangeTypeEum.equipment.getCode())) {
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName,relationName);
} else if (from.equals(TriggerRpnChangeTypeEum.alarm.getCode())) {
//设备告警
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from);
riskSourceService.notifyFmeaFromAbnormal(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName,relationName);
} else if (from.equals(TriggerRpnChangeTypeEum.fmeaUpdate.getCode())) {
//危险因素评价修改通知
riskSourceService.notifyFmeaFromUpdate(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from);
riskSourceService.notifyFmeaFromUpdate(toke.getToke(), toke.getProduct(), toke.getAppKey(), handId, from, userName);
} else if (from.equals(TriggerRpnChangeTypeEum.fmeaDelete.getCode())) {
//危险因素删除通知
riskSourceService.notifyFmeaFromDelete(handId, from);
......@@ -117,7 +123,7 @@ public class RsDataQueue {
}
}
} catch (Exception e) {
LoggerFactory.getLogger(this.getClass()).error(e.getMessage());
LoggerFactory.getLogger(this.getClass()).error(e.getMessage(),e);
}
}
}
......
......@@ -12,9 +12,9 @@ eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry = true
#DB properties:
spring.datasource.url=jdbc:mysql://47.103.14.66:3306/91-safety-business?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url=jdbc:mysql://172.16.11.33:3306/safety-business-2.0?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root_123
spring.datasource.password=admin_1234
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
spring.datasource.hikari.maxLifetime = 1765000
spring.datasource.hikari.maximum-pool-size = 10
......@@ -45,3 +45,4 @@ file.uploadUrl=D:\\upload\\files\\
#picture read
file.readUrl=http://172.16.3.89:8083/file/getFile?in=
params.isPush=true
Push.fegin.name=PPMESSAGEPUSHSERVICE15
\ No newline at end of file
......@@ -669,8 +669,8 @@
<if test="riskLevelId != null">
risk_level_id = #{riskLevelId},
</if>
<if test="flicker_frequency != null">
flicker_frequency = #{flicker_frequency}
<if test="flickerFrequency != null">
flicker_frequency = #{flickerFrequency}
</if>
</set>
where id = #{id}
......
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