Commit 64033a4b authored by maoying's avatar maoying

修改冲突

parents a505c4dd 013a5b87
......@@ -9,7 +9,8 @@ public enum TriggerRpnChangeTypeEum {
* 触发类型枚举
*/
patrol("巡检","patrol"),
equipment("设备告警","equipment"),
alarm("设备告警","alarm"),
alarmRecovery("设备告警恢复","recovery"),
fmeaUpdate("危险因素评价","fmeaUpdate"),
fmeaDelete("危险因素删除","fmeaDelete"),
riskDelete("风险点删除","riskDelete");
......
package com.yeejoin.amos.fas.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
......@@ -39,7 +42,8 @@ public class FireEquipment extends BasicEntity {
@Column(name="create_by")
private String createBy;
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@Column(name="effective_date")
private Date effectiveDate;
......@@ -66,7 +70,8 @@ public class FireEquipment extends BasicEntity {
@Column(name="production_area")
private String productionArea;
@Temporal(TemporalType.DATE)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@Column(name="production_date")
private Date productionDate;
......
......@@ -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);
}
......
......@@ -90,7 +90,6 @@ public class FireSourceController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询消防车", notes = "查询消防车")
@RequestMapping(value = "/fire-car/det/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryFireCar(@ApiParam(value = "查询条件", required = true) @PathVariable Long id) {
FireCarDetailVo car = fireCarService.findFireCarById(getToken(),getProduct(),getAppKey(),id);
return CommonResponseUtil.success(car);
}
......
......@@ -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,8 +142,8 @@ public class View3dController extends BaseController {
public CommonResponse getStatisticsDuty(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
orgCode = "1*2";
return view3dService.getStatisticsDuty(getAppKey(),getProduct(),orgCode);
CommonResponse statisticsDuty = view3dService.getStatisticsDuty(getAppKey(),getProduct(),orgCode);
return statisticsDuty;
}
@ApiOperation(value = "异常区域信息查询",notes = "异常区域信息查询")
......@@ -179,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);
}
......@@ -197,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));
}
......@@ -207,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));
}
......@@ -236,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));
}
......@@ -251,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;
......@@ -120,7 +117,7 @@ public class FireCarServiceImpl implements IFireCarService {
public FireCarDetailVo findFireCarById(String toke,String product,String appKey,Long truckId) {
FireCarDetailVo carVo = fireCarMapper.getFireCarDetailById(truckId);
DepartmentModel departmentModel= remoteSecurityService.getDepartmentByDeptId(toke, product, appKey, carVo.getDeptId());
carVo.setDepartmentName(departmentModel.getDepartmentName());
carVo.setDepartmentName(departmentModel != null ? departmentModel.getDepartmentName() : "");
return carVo;
}
......
......@@ -53,6 +53,7 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
return fireCar;
}
@Override
public String[] deletePoint(String[] idArray) throws Exception {
for (String id : idArray) {
Optional<FireEquipmentPoint> fireEquipmentPoint1 = fireEquipmentPointDao.findById(Long.parseLong(id));
......@@ -95,8 +96,11 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
if (total.equals(0L)) {
return CommonResponseUtil.success(new PageImpl<>(Lists.newArrayList(), null, total));
}
int pageNumber = map.get("pageNumber") != null ? Integer.parseInt(map.get("pageNumber").toString()) : 0;
int pageSize = map.get("pageSize") != null ? Integer.parseInt(map.get("pageSize").toString()) : 0;
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
List<FireEquipmentPointEntity> list = fireEquipPointMapper.listByMap(map);
return CommonResponseUtil.success(new PageImpl<>(list, null, total));
return CommonResponseUtil.success(new PageImpl<>(list, commonPageable, total));
}
@Override
......
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);
}
......
......@@ -462,7 +462,7 @@ public class View3dServiceImpl implements IView3dService {
return view3dMapper.getRiskErrorTop5(orgCode);
case "check"://巡检异常
return view3dMapper.getCheckErrorTop5(orgCode);
case "equip":
case "fire":
return JSON.parseArray(" [\r\n" +
" {\r\n" +
" \"id\": 35781,\r\n" +
......
......@@ -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
......@@ -30,7 +30,7 @@ spring.data.mongodb.uri = mongodb://172.16.11.33:27017/iecmonitor
params.remoteRuleUrl=http://magintursh.xicp.net:18080/
params.remoteWebsocketUrl=http://172.16.10.91:10600/
spring.redis.database=5
spring.redis.database=1
spring.redis.host=172.16.11.33
spring.redis.port=6379
spring.redis.password=1234560
......@@ -45,3 +45,6 @@ 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
dutyMode.fegin.name=AMOS-DUTY
\ No newline at end of file
......@@ -30,7 +30,7 @@ spring.data.mongodb.uri = mongodb://amos-mongo:27017/iecmonitor
params.remoteRuleUrl=http://station-rule:8080/
params.remoteWebsocketUrl=http://station-websocket:10600/
spring.redis.database=5
spring.redis.database=1
spring.redis.host=amos-redis
spring.redis.port=6379
spring.redis.password=redis2020
......@@ -45,3 +45,5 @@ file.uploadUrl=D:\\upload\\files\\
#picture read
file.readUrl=http://station-fireautosys:8083/file/getFile?in=
params.isPush=true
Push.fegin.name=AMOS-PUSH
dutyMode.fegin.name=AMOS-DUTY
\ No newline at end of file
......@@ -30,7 +30,7 @@ spring.data.mongodb.uri = mongodb://172.16.11.33:27017/iecmonitor
params.remoteRuleUrl=http://magintursh.xicp.net:18080/
params.remoteWebsocketUrl=http://172.16.10.91:10600/
spring.redis.database=5
spring.redis.database=1
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=
......@@ -45,3 +45,6 @@ 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
dutyMode.fegin.name=AMOS-DUTY
\ No newline at end of file
spring.application.name = AMOS-AUTOSYS-XKQ1
spring.application.name = AMOS-AUTOSYS
server.port = 8083
......
......@@ -265,6 +265,18 @@
PRIMARY KEY (`id`),
UNIQUE KEY `type_index` (`type`) USING HASH
) ENGINE=InnoDB DEFAULT CHARSET=utf8 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>
\ No newline at end of file
......@@ -429,8 +429,6 @@
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and
fire_equipment_id = 0
</delete>
</mapper>
\ 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}
......
......@@ -390,7 +390,7 @@
<select id="getSafetyIndexWeek" resultType="java.util.HashMap">
<![CDATA[
SELECT temp1.*,IFNULL(S.safety_index,0) as value
SELECT distinct temp1.*,IFNULL(S.safety_index,0) as value
FROM (
SELECT @s :=@s + 1 as `index`, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date
FROM mysql.help_topic,(SELECT @s := 0) temp
......@@ -491,7 +491,9 @@
</select>
<select id="getCheckErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT p.id,I.point_no as code,I.name as label,p.point_id,'check' as type,p.check_time as changeDate
SELECT p.id,I.point_no as code,
IF(p.is_ok = '2', CONCAT(I.name,' 不合格') ,CONCAT(I.name,' 漏检') ) as label,
p.point_id,'check' as type,p.check_time as changeDate
FROM p_check p
left join p_point I ON I.id = p.point_id
where p.is_ok IN ('2', '3')
......
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