Commit 0cb2f733 authored by 单奇雲's avatar 单奇雲

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

parents 6e37ce61 fc083344
package com.yeejoin.amos.fas.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 管控级别
*/
public enum ManageLevelEum {
company("单位级",1),
department("部门级",2),
group("班组级",3),
person("个人级",4);
private String name;
private int manageLevel;
ManageLevelEum(String name,int manageLevel){
this.name = name;
this.manageLevel = manageLevel;
}
public static List<Map> getManageLevelEumList(){
List<Map> eumList = new ArrayList<>();
for(ManageLevelEum eum :ManageLevelEum.values()){
Map<String,Object> param = new HashMap<>();
param.put("key",eum.getManageLevel());
param.put("label",eum.getName());
eumList.add(param);
}
return eumList;
}
public static String getNameByManageLevel(int level){
String name = "";
for(ManageLevelEum eum : ManageLevelEum.values()){
if(level == eum.getManageLevel()){
name = eum.getName();
break;
}
}
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getManageLevel() {
return manageLevel;
}
public void setManageLevel(int manageLevel) {
this.manageLevel = manageLevel;
}
}
...@@ -19,6 +19,8 @@ public class EquipDetailsResponse { ...@@ -19,6 +19,8 @@ public class EquipDetailsResponse {
private String tel; private String tel;
private String remarks; private String remarks;
private String userId;
public String getName() { public String getName() {
return name; return name;
...@@ -83,4 +85,14 @@ public class EquipDetailsResponse { ...@@ -83,4 +85,14 @@ public class EquipDetailsResponse {
public void setStationName(String stationName) { public void setStationName(String stationName) {
this.stationName = stationName; this.stationName = stationName;
} }
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
} }
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
/** /**
* The persistent class for the accident_type database table. * The persistent class for the accident_type database table.
* *
*/ */
@Entity @Entity
@Table(name="f_accident_type") @Table(name="f_accident_type")
@NamedQuery(name="AccidentType.findAll", query="SELECT a FROM AccidentType a") @NamedQuery(name="AccidentType.findAll", query="SELECT a FROM AccidentType a")
public class AccidentType extends BasicEntity { public class AccidentType extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column(name="create_by") @Column(name="create_by")
private Long createBy; private String createBy;
@Column(name="dept_id") @Column(name="dept_id")
private Long deptId; private String deptId;
private String name; private String name;
@Column(name="evaluation_sid") @Column(name="evaluation_sid")
private String evaluationSid; private String evaluationSid;
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
private String remark; private String remark;
private String severity; private String severity;
private String influence; private String influence;
public AccidentType() { public AccidentType() {
} }
public Long getCreateBy() {
return this.createBy;
} public String getCreateBy() {
return createBy;
public void setCreateBy(Long createBy) { }
this.createBy = createBy;
}
public Long getDeptId() {
return this.deptId; public void setCreateBy(String createBy) {
} this.createBy = createBy;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
@Transient public String getDeptId() {
public String getInfluence() { return deptId;
return this.influence; }
}
public void setInfluence(String influence) {
this.influence = influence;
} public void setDeptId(String deptId) {
this.deptId = deptId;
public String getName() { }
return this.name;
}
public void setName(String name) {
this.name = name; @Transient
} public String getInfluence() {
return this.influence;
public String getEvaluationSid() { }
return evaluationSid;
} public void setInfluence(String influence) {
this.influence = influence;
}
public void setEvaluationSid(String evaluationSid) {
this.evaluationSid = evaluationSid; public String getName() {
} return this.name;
}
public String getOrgCode() {
return this.orgCode; public void setName(String name) {
} this.name = name;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode; public String getEvaluationSid() {
} return evaluationSid;
}
public String getRemark() {
return this.remark;
} public void setEvaluationSid(String evaluationSid) {
this.evaluationSid = evaluationSid;
public void setRemark(String remark) { }
this.remark = remark;
} public String getOrgCode() {
return this.orgCode;
@Transient }
public String getSeverity() {
return this.severity; public void setOrgCode(String orgCode) {
} this.orgCode = orgCode;
}
public void setSeverity(String severity) {
this.severity = severity; public String getRemark() {
} return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
@Transient
public String getSeverity() {
return this.severity;
}
public void setSeverity(String severity) {
this.severity = severity;
}
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.*; import javax.persistence.*;
/** /**
* The persistent class for the equipment database table. * The persistent class for the equipment database table.
* *
*/ */
@Entity @Entity
@Table(name="f_equipment") @Table(name="f_equipment")
@NamedQuery(name="Equipment.findAll", query="SELECT e FROM Equipment e") @NamedQuery(name="Equipment.findAll", query="SELECT e FROM Equipment e")
public class Equipment extends BasicEntity { public class Equipment extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String address; private String address;
private String building; private String building;
/** /**
* 所属风险区域id * 所属风险区域id
*/ */
@Column(name="risk_source_id") @Column(name="risk_source_id")
private Long riskSourceId; private Long riskSourceId;
/** /**
* 3维坐标 * 3维坐标
*/ */
private String position3d; private String position3d;
/** /**
* 3维楼层 * 3维楼层
*/ */
private String floor3d; private String floor3d;
/** /**
* 预案配置 * 预案配置
*/ */
@Column(name="reserve_plan") @Column(name="reserve_plan")
private String reservePlan; private String reservePlan;
/** /**
* 是否室内 0-否 1-是 * 是否室内 0-否 1-是
*/ */
@Column(name="is_indoor") @Column(name="is_indoor")
private Boolean isIndoor; private Boolean isIndoor;
@Column(name="charge_dept_id") @Column(name="charge_dept_id")
private int chargeDeptId; private String chargeDeptId;
@Column(name="charge_user_id") @Column(name="charge_user_id")
private int chargeUserId; private String chargeUserId;
private String code; private String code;
@Column(name="fire_truck_route") @Column(name="fire_truck_route")
private String fireTruckRoute; private String fireTruckRoute;
public String getFireTruckRoute() { public String getFireTruckRoute() {
return fireTruckRoute; return fireTruckRoute;
} }
public void setFireTruckRoute(String fireTruckRoute) { public void setFireTruckRoute(String fireTruckRoute) {
this.fireTruckRoute = fireTruckRoute; this.fireTruckRoute = fireTruckRoute;
} }
public String getPosition3d() { public String getPosition3d() {
return position3d; return position3d;
} }
public void setPosition3d(String position3d) { public void setPosition3d(String position3d) {
this.position3d = position3d; this.position3d = position3d;
} }
public String getFloor3d() { public String getFloor3d() {
return floor3d; return floor3d;
} }
public void setFloor3d(String floor3d) { public void setFloor3d(String floor3d) {
this.floor3d = floor3d; this.floor3d = floor3d;
} }
public Boolean getIsIndoor() { public Boolean getIsIndoor() {
return isIndoor; return isIndoor;
} }
public void setIsIndoor(Boolean isIndoor) { public void setIsIndoor(Boolean isIndoor) {
this.isIndoor = isIndoor; this.isIndoor = isIndoor;
} }
private String room; private String room;
/** /**
* 关联消防小室id * 关联消防小室id
*/ */
@Column(name="fire_station_id") @Column(name="fire_station_id")
private Long fireStationId; private Long fireStationId;
@Column(name="create_by") @Column(name="create_by")
private String createBy; private String createBy;
private String name; private String name;
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
private String remark; private String remark;
/** /**
* ue4位置 * ue4位置
*/ */
@Lob @Lob
private String ue4Location; private String ue4Location;
/** /**
* ue4旋转 * ue4旋转
*/ */
@Lob @Lob
private String ue4Rotation; private String ue4Rotation;
public Equipment() { public Equipment() {
} }
public String getAddress() { public String getAddress() {
return this.address; return this.address;
} }
public void setAddress(String address) { public void setAddress(String address) {
this.address = address; this.address = address;
} }
public String getBuilding() { public String getBuilding() {
return this.building; return this.building;
} }
public void setBuilding(String building) { public void setBuilding(String building) {
this.building = building; this.building = building;
} }
public Long getRiskSourceId() { public Long getRiskSourceId() {
return riskSourceId; return riskSourceId;
} }
public void setRiskSourceId(Long riskSourceId) { public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId; this.riskSourceId = riskSourceId;
} }
public int getChargeDeptId() {
return this.chargeDeptId;
} public String getChargeDeptId() {
return chargeDeptId;
public void setChargeDeptId(int chargeDeptId) { }
this.chargeDeptId = chargeDeptId;
} public void setChargeDeptId(String chargeDeptId) {
this.chargeDeptId = chargeDeptId;
public int getChargeUserId() { }
return this.chargeUserId;
} public String getChargeUserId() {
return chargeUserId;
public void setChargeUserId(int chargeUserId) { }
this.chargeUserId = chargeUserId;
} public void setChargeUserId(String chargeUserId) {
this.chargeUserId = chargeUserId;
public String getCode() { }
return this.code;
} public String getCode() {
return this.code;
public void setCode(String code) { }
this.code = code;
} public void setCode(String code) {
this.code = code;
public String getCreateBy() { }
return this.createBy;
} public String getCreateBy() {
return this.createBy;
public void setCreateBy(String createBy) { }
this.createBy = createBy;
} public void setCreateBy(String createBy) {
this.createBy = createBy;
public String getName() { }
return this.name;
} public String getName() {
return this.name;
public void setName(String name) { }
this.name = name;
} public void setName(String name) {
this.name = name;
public String getOrgCode() { }
return this.orgCode;
} public String getOrgCode() {
return this.orgCode;
public void setOrgCode(String orgCode) { }
this.orgCode = orgCode;
} public void setOrgCode(String orgCode) {
public Long getFireStationId() { this.orgCode = orgCode;
return fireStationId; }
} public Long getFireStationId() {
return fireStationId;
public void setFireStationId(Long fireStationId) { }
this.fireStationId = fireStationId;
} public void setFireStationId(Long fireStationId) {
public String getRemark() { this.fireStationId = fireStationId;
return this.remark; }
} public String getRemark() {
return this.remark;
public void setRemark(String remark) { }
this.remark = remark;
} public void setRemark(String remark) {
this.remark = remark;
}
public String getRoom() {
return room;
} public String getRoom() {
return room;
public void setRoom(String room) { }
this.room = room;
} public void setRoom(String room) {
this.room = room;
public String getReservePlan() { }
return reservePlan;
} public String getReservePlan() {
return reservePlan;
public void setReservePlan(String reservePlan) { }
this.reservePlan = reservePlan;
} public void setReservePlan(String reservePlan) {
this.reservePlan = reservePlan;
@Column(name = "ue4_location") }
public String getUe4Location() {
return ue4Location; @Column(name = "ue4_location")
} public String getUe4Location() {
return ue4Location;
public void setUe4Location(String ue4Location) { }
this.ue4Location = ue4Location;
} public void setUe4Location(String ue4Location) {
this.ue4Location = ue4Location;
@Column(name = "ue4_rotation") }
public String getUe4Rotation() {
return ue4Rotation; @Column(name = "ue4_rotation")
} public String getUe4Rotation() {
return ue4Rotation;
public void setUe4Rotation(String ue4Rotation) { }
this.ue4Rotation = ue4Rotation;
} public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation;
}
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Lob; import javax.persistence.Lob;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
/** /**
* The persistent class for the evaluation_model database table. * The persistent class for the evaluation_model database table.
* *
*/ */
@Entity @Entity
@Table(name="f_evaluation_model") @Table(name="f_evaluation_model")
@NamedQuery(name="EvaluationModel.findAll", query="SELECT e FROM EvaluationModel e") @NamedQuery(name="EvaluationModel.findAll", query="SELECT e FROM EvaluationModel e")
public class EvaluationModel extends BasicEntity { public class EvaluationModel extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column(name="create_by") @Column(name="create_by")
private int createBy; private String createBy;
private String name; private String name;
/** /**
* 系数 * 系数
*/ */
private String coefficient; private String coefficient;
/** /**
* 影响 * 影响
*/ */
private String influence; private String influence;
/** /**
* 描述 * 描述
*/ */
private String describe; private String describe;
/** /**
* S,D,O * S,D,O
*/ */
private String type; private String type;
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
private String remark; private String remark;
@Lob @Lob
private String standard; private String standard;
public EvaluationModel() { public EvaluationModel() {
} }
public int getCreateBy() { public String getCreateBy() {
return this.createBy; return this.createBy;
} }
public void setCreateBy(int createBy) { public void setCreateBy(String createBy) {
this.createBy = createBy; this.createBy = createBy;
} }
public String getName() { public String getName() {
return this.name; return this.name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getOrgCode() { public String getOrgCode() {
return this.orgCode; return this.orgCode;
} }
public void setOrgCode(String orgCode) { public void setOrgCode(String orgCode) {
this.orgCode = orgCode; this.orgCode = orgCode;
} }
public String getRemark() { public String getRemark() {
return this.remark; return this.remark;
} }
public void setRemark(String remark) { public void setRemark(String remark) {
this.remark = remark; this.remark = remark;
} }
public String getStandard() { public String getStandard() {
return this.standard; return this.standard;
} }
public void setStandard(String standard) { public void setStandard(String standard) {
this.standard = standard; this.standard = standard;
} }
public String getCoefficient() { public String getCoefficient() {
return coefficient; return coefficient;
} }
public void setCoefficient(String coefficient) { public void setCoefficient(String coefficient) {
this.coefficient = coefficient; this.coefficient = coefficient;
} }
public String getInfluence() { public String getInfluence() {
return influence; return influence;
} }
public void setInfluence(String influence) { public void setInfluence(String influence) {
this.influence = influence; this.influence = influence;
} }
public String getDescribe() { public String getDescribe() {
return describe; return describe;
} }
public void setDescribe(String describe) { public void setDescribe(String describe) {
this.describe = describe; this.describe = describe;
} }
public String getType() { public String getType() {
return type; return type;
} }
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.persistence.*; import javax.persistence.*;
/** /**
* 消防站点 * 消防站点
* @author Administrator * @author Administrator
* *
*/ */
@Entity @Entity
@Table(name="f_fire_station") @Table(name="f_fire_station")
@NamedQuery(name="FireStation.findAll", query="SELECT f FROM FireStation f") @NamedQuery(name="FireStation.findAll", query="SELECT f FROM FireStation f")
public class FireStation extends BasicEntity{ public class FireStation extends BasicEntity{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 名称 * 名称
*/ */
private String name; private String name;
/** /**
* 编号 * 编号
*/ */
private String code; private String code;
/** /**
* 类型 1:消防小室,2:消防泡沫间 * 类型 1:消防小室,2:消防泡沫间
*/ */
private String type; private String type;
/** /**
* 所属风险区域id * 所属风险区域id
*/ */
@Column(name="risk_source_id") @Column(name="risk_source_id")
private Long riskSourceId; private Long riskSourceId;
/** /**
* 位置 * 位置
*/ */
private String address; private String address;
/** /**
* 3纬坐标 * 3纬坐标
*/ */
private String position3d; private String position3d;
/** /**
* 3维楼层 * 3维楼层
*/ */
private String floor3d; private String floor3d;
/** /**
* 是否室内 * 是否室内
*/ */
@Column(name="is_indoor") @Column(name="is_indoor")
private Boolean isIndoor=true; private Boolean isIndoor=true;
/** /**
* 组织 * 组织
*/ */
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
/** /**
* 创建人 * 创建人
*/ */
@Column(name="create_by") @Column(name="create_by")
private int createBy; private String createBy;
@Column(name="picture") @Column(name="picture")
private String picture; private String picture;
private List<Map> fireEquipmentInfo; private List<Map> fireEquipmentInfo;
/** /**
* ue4位置 * ue4位置
*/ */
@Lob @Lob
private String ue4Location; private String ue4Location;
/** /**
* ue4旋转 * ue4旋转
*/ */
@Lob @Lob
private String ue4Rotation; private String ue4Rotation;
@Transient @Transient
public List<Map> getFireEquipmentInfo() { public List<Map> getFireEquipmentInfo() {
return fireEquipmentInfo; return fireEquipmentInfo;
} }
public void setFireEquipmentInfo(List<Map> fireEquipmentInfo) { public void setFireEquipmentInfo(List<Map> fireEquipmentInfo) {
this.fireEquipmentInfo = fireEquipmentInfo; this.fireEquipmentInfo = fireEquipmentInfo;
} }
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getCode() { public String getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(String code) {
this.code = code; this.code = code;
} }
public String getType() { public String getType() {
return type; return type;
} }
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
public String getAddress() { public String getAddress() {
return address; return address;
} }
public void setAddress(String address) { public void setAddress(String address) {
this.address = address; this.address = address;
} }
public String getPosition3d() { public String getPosition3d() {
return position3d; return position3d;
} }
public void setPosition3d(String position3d) { public void setPosition3d(String position3d) {
this.position3d = position3d; this.position3d = position3d;
} }
public String getFloor3d() { public String getFloor3d() {
return floor3d; return floor3d;
} }
public void setFloor3d(String floor3d) { public void setFloor3d(String floor3d) {
this.floor3d = floor3d; this.floor3d = floor3d;
} }
public Boolean getIsIndoor() { public Boolean getIsIndoor() {
return isIndoor; return isIndoor;
} }
public void setIsIndoor(Boolean isIndoor) { public void setIsIndoor(Boolean isIndoor) {
this.isIndoor = isIndoor; this.isIndoor = isIndoor;
} }
public String getOrgCode() { public String getOrgCode() {
return orgCode; return orgCode;
} }
public void setOrgCode(String orgCode) { public void setOrgCode(String orgCode) {
this.orgCode = orgCode; this.orgCode = orgCode;
} }
public int getCreateBy() { public String getCreateBy() {
return createBy; return createBy;
} }
public void setCreateBy(int createBy) { public void setCreateBy(String createBy) {
this.createBy = createBy; this.createBy = createBy;
} }
public String getPicture() { public String getPicture() {
return picture; return picture;
} }
public void setPicture(String picture) { public void setPicture(String picture) {
this.picture = picture; this.picture = picture;
} }
public Long getRiskSourceId() { public Long getRiskSourceId() {
return riskSourceId; return riskSourceId;
} }
public void setRiskSourceId(Long riskSourceId) { public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId; this.riskSourceId = riskSourceId;
} }
@Column(name = "ue4_location") @Column(name = "ue4_location")
public String getUe4Location() { public String getUe4Location() {
return ue4Location; return ue4Location;
} }
public void setUe4Location(String ue4Location) { public void setUe4Location(String ue4Location) {
this.ue4Location = ue4Location; this.ue4Location = ue4Location;
} }
@Column(name = "ue4_rotation") @Column(name = "ue4_rotation")
public String getUe4Rotation() { public String getUe4Rotation() {
return ue4Rotation; return ue4Rotation;
} }
public void setUe4Rotation(String ue4Rotation) { public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation; this.ue4Rotation = ue4Rotation;
} }
} }
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
/** /**
* 消防站关联物资 * 消防站关联物资
* @author Administrator * @author Administrator
* *
*/ */
@Entity @Entity
@Table(name="f_fire_station_equipment") @Table(name="f_fire_station_equipment")
@NamedQuery(name="FireStationFireEquipment.findAll", query="SELECT f FROM FireStationFireEquipment f") @NamedQuery(name="FireStationFireEquipment.findAll", query="SELECT f FROM FireStationFireEquipment f")
public class FireStationFireEquipment extends BasicEntity{ public class FireStationFireEquipment extends BasicEntity{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 消防站id * 消防站id
*/ */
@Column(name="fire_station_id") @Column(name="fire_station_id")
private Long fireStationId; private Long fireStationId;
/** /**
* 消防资源 * 消防资源
*/ */
@Column(name="fire_equipment_id") @Column(name="fire_equipment_id")
private Long fireEquipmentId; private Long fireEquipmentId;
/** /**
* 个数 * 个数
*/ */
private Double number; private Double number;
/** /**
* 单位 * 单位
*/ */
private String unit; private String unit;
/** /**
* 创建人 * 创建人
*/ */
@Column(name="create_by") @Column(name="create_by")
private int createBy; private String createBy;
public Long getFireStationId() { public Long getFireStationId() {
return fireStationId; return fireStationId;
} }
public void setFireStationId(Long fireStationId) { public void setFireStationId(Long fireStationId) {
this.fireStationId = fireStationId; this.fireStationId = fireStationId;
} }
public Long getFireEquipmentId() { public Long getFireEquipmentId() {
return fireEquipmentId; return fireEquipmentId;
} }
public void setFireEquipmentId(Long fireEquipmentId) { public void setFireEquipmentId(Long fireEquipmentId) {
this.fireEquipmentId = fireEquipmentId; this.fireEquipmentId = fireEquipmentId;
} }
public Double getNumber() { public Double getNumber() {
return number; return number;
} }
public void setNumber(Double number) { public void setNumber(Double number) {
this.number = number; this.number = number;
} }
public String getUnit() { public String getUnit() {
return unit; return unit;
} }
public void setUnit(String unit) { public void setUnit(String unit) {
this.unit = unit; this.unit = unit;
} }
public int getCreateBy() { public String getCreateBy() {
return createBy; return createBy;
} }
public void setCreateBy(int createBy) { public void setCreateBy(String createBy) {
this.createBy = createBy; this.createBy = createBy;
} }
} }
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import java.sql.Time; import java.sql.Time;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
/** /**
* 消防力量 * 消防力量
* @author Administrator * @author Administrator
* *
*/ */
@Entity @Entity
@Table(name="f_fire_strength") @Table(name="f_fire_strength")
@NamedQuery(name="FireStrength.findAll", query="SELECT f FROM FireStrength f") @NamedQuery(name="FireStrength.findAll", query="SELECT f FROM FireStrength f")
public class FireStrength extends BasicEntity{ public class FireStrength extends BasicEntity{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 编号 * 编号
*/ */
private String code; private String code;
/** /**
* 姓名 * 姓名
*/ */
private String username; private String username;
/** /**
* 职位 * 职位
*/ */
private String position; private String position;
/** /**
* 固话 * 固话
*/ */
private String tel; private String tel;
/** /**
* 开始时间 * 开始时间
*/ */
@Column(name="day_begin") @Column(name="day_begin")
private Time dayBegin; private Time dayBegin;
/** /**
* 结束时间 * 结束时间
*/ */
@Column(name="day_end") @Column(name="day_end")
private Time dayEnd; private Time dayEnd;
/** /**
* 手机 * 手机
*/ */
@Column(name="phone_num") @Column(name="phone_num")
private String phoneNum; private String phoneNum;
/** /**
* 工作描述 * 工作描述
*/ */
@Column(name="job_des") @Column(name="job_des")
private String jobDes; private String jobDes;
/** /**
* 备注 * 备注
*/ */
private String remark; private String remark;
/** /**
* 组织 * 组织
*/ */
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
/** /**
* 创建人 * 创建人
*/ */
@Column(name="create_by") @Column(name="create_by")
private int createBy; private String createBy;
public String getCode() { public String getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(String code) {
this.code = code; this.code = code;
} }
public String getUsername() { public String getUsername() {
return username; return username;
} }
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
public String getPosition() { public String getPosition() {
return position; return position;
} }
public void setPosition(String position) { public void setPosition(String position) {
this.position = position; this.position = position;
} }
public String getTel() { public String getTel() {
return tel; return tel;
} }
public void setTel(String tel) { public void setTel(String tel) {
this.tel = tel; this.tel = tel;
} }
public String getPhoneNum() { public String getPhoneNum() {
return phoneNum; return phoneNum;
} }
public void setPhoneNum(String phoneNum) { public void setPhoneNum(String phoneNum) {
this.phoneNum = phoneNum; this.phoneNum = phoneNum;
} }
public String getJobDes() { public String getJobDes() {
return jobDes; return jobDes;
} }
public void setJobDes(String jobDes) { public void setJobDes(String jobDes) {
this.jobDes = jobDes; this.jobDes = jobDes;
} }
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
public void setRemark(String remark) { public void setRemark(String remark) {
this.remark = remark; this.remark = remark;
} }
public String getOrgCode() { public String getOrgCode() {
return orgCode; return orgCode;
} }
public void setOrgCode(String orgCode) { public void setOrgCode(String orgCode) {
this.orgCode = orgCode; this.orgCode = orgCode;
} }
public int getCreateBy() { public String getCreateBy() {
return createBy; return createBy;
} }
public void setCreateBy(int createBy) { public void setCreateBy(String createBy) {
this.createBy = createBy; this.createBy = createBy;
} }
public Time getDayBegin() { public Time getDayBegin() {
return dayBegin; return dayBegin;
} }
public void setDayBegin(Time dayBegin) { public void setDayBegin(Time dayBegin) {
this.dayBegin = dayBegin; this.dayBegin = dayBegin;
} }
public Time getDayEnd() { public Time getDayEnd() {
return dayEnd; return dayEnd;
} }
public void setDayEnd(Time dayEnd) { public void setDayEnd(Time dayEnd) {
this.dayEnd = dayEnd; this.dayEnd = dayEnd;
} }
} }
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Lob; import javax.persistence.Lob;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
/** /**
* The persistent class for the preplan_picture database table. * The persistent class for the preplan_picture database table.
*/ */
@Entity @Entity
@Table(name = "f_preplan_picture") @Table(name = "f_preplan_picture")
@NamedQuery(name = "PreplanPicture.findAll", query = "SELECT p FROM PreplanPicture p") @NamedQuery(name = "PreplanPicture.findAll", query = "SELECT p FROM PreplanPicture p")
public class PreplanPicture extends BasicEntity { public class PreplanPicture extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column(name = "create_by") @Column(name = "create_by")
private int createBy; private String createBy;
@Column(name = "equipment_id") @Column(name = "equipment_id")
private Long equipmentId; private Long equipmentId;
private String name; private String name;
@Lob @Lob
private String picture; private String picture;
private String remark; private String remark;
private int type; private int type;
public PreplanPicture() { public PreplanPicture() {
} }
public int getCreateBy() { public String getCreateBy() {
return this.createBy; return this.createBy;
} }
public void setCreateBy(int createBy) { public void setCreateBy(String createBy) {
this.createBy = createBy; this.createBy = createBy;
} }
public Long getEquipmentId() { public Long getEquipmentId() {
return this.equipmentId; return this.equipmentId;
} }
public void setEquipmentId(Long equipmentId) { public void setEquipmentId(Long equipmentId) {
this.equipmentId = equipmentId; this.equipmentId = equipmentId;
} }
public String getName() { public String getName() {
return this.name; return this.name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getPicture() { public String getPicture() {
return this.picture; return this.picture;
} }
public void setPicture(String picture) { public void setPicture(String picture) {
this.picture = picture; this.picture = picture;
} }
public String getRemark() { public String getRemark() {
return this.remark; return this.remark;
} }
public void setRemark(String remark) { public void setRemark(String remark) {
this.remark = remark; this.remark = remark;
} }
public int getType() { public int getType() {
return this.type; return this.type;
} }
public void setType(int type) { public void setType(int type) {
this.type = type; this.type = type;
} }
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
/** /**
* The persistent class for the risk_factors database table. * The persistent class for the risk_factors database table.
* *
*/ */
@Entity @Entity
@Table(name="f_risk_factor") @Table(name="f_risk_factor")
@NamedQuery(name="RiskFactor.findAll", query="SELECT r FROM RiskFactor r") @NamedQuery(name="RiskFactor.findAll", query="SELECT r FROM RiskFactor r")
public class RiskFactor extends BasicEntity { public class RiskFactor extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Column(name="accident_type_id") @Column(name="accident_type_id")
private Long accidentTypeId; private Long accidentTypeId;
@Column(name="create_by") @Column(name="create_by")
private int createBy; private String createBy;
@Column(name="dept_id") @Column(name="dept_id")
private Long deptId; private String deptId;
private String name; private String name;
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
private String remark; private String remark;
private String type; private String type;
public RiskFactor() { public RiskFactor() {
} }
public Long getAccidentTypeId() { public Long getAccidentTypeId() {
return this.accidentTypeId; return this.accidentTypeId;
} }
public void setAccidentTypeId(Long accidentTypeId) { public void setAccidentTypeId(Long accidentTypeId) {
this.accidentTypeId = accidentTypeId; this.accidentTypeId = accidentTypeId;
} }
public int getCreateBy() { public String getCreateBy() {
return this.createBy; return this.createBy;
} }
public void setCreateBy(int createBy) { public void setCreateBy(String createBy) {
this.createBy = createBy; this.createBy = createBy;
} }
public Long getDeptId() { public String getDeptId() {
return this.deptId; return this.deptId;
} }
public void setDeptId(Long deptId) { public void setDeptId(String deptId) {
this.deptId = deptId; this.deptId = deptId;
} }
public String getName() { public String getName() {
return this.name; return this.name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getOrgCode() { public String getOrgCode() {
return this.orgCode; return this.orgCode;
} }
public void setOrgCode(String orgCode) { public void setOrgCode(String orgCode) {
this.orgCode = orgCode; this.orgCode = orgCode;
} }
public String getRemark() { public String getRemark() {
return this.remark; return this.remark;
} }
public void setRemark(String remark) { public void setRemark(String remark) {
this.remark = remark; this.remark = remark;
} }
public String getType() { public String getType() {
return type; return type;
} }
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
* The persistent class for the risk_level database table. * The persistent class for the risk_level database table.
*/ */
@Entity @Entity
@Table(name = "f_risk_level") @Table(name = "f_risk_level")
@NamedQuery(name = "RiskLevel.findAll", query = "SELECT r FROM RiskLevel r") @NamedQuery(name = "RiskLevel.findAll", query = "SELECT r FROM RiskLevel r")
public class RiskLevel extends BasicEntity { public class RiskLevel extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String color; private String color;
@Column(name = "create_by") @Column(name = "create_by")
private Long createBy; private String createBy;
@Column(name = "evaluation_model_id") @Column(name = "evaluation_model_id")
private Long evaluationModelId; private Long evaluationModelId;
@Column(name = "name") @Column(name = "name")
private String name; private String name;
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@Column(name = "level") @Column(name = "level")
private Integer level; private Integer level;
@Column(name = "org_code") @Column(name = "org_code")
private String orgCode; private String orgCode;
@Column(name = "top_limit") @Column(name = "top_limit")
private BigDecimal topLimit; private BigDecimal topLimit;
@Column(name = "down_limit") @Column(name = "down_limit")
private BigDecimal downLimit; private BigDecimal downLimit;
private Integer manageLevel; private Integer manageLevel;
private String remark; private String remark;
private String severity; private String severity;
public RiskLevel() { public RiskLevel() {
} }
public String getColor() { public String getColor() {
return this.color; return this.color;
} }
public void setColor(String color) { public void setColor(String color) {
this.color = color; this.color = color;
} }
public Long getCreateBy() {
return this.createBy;
} public String getCreateBy() {
return createBy;
public void setCreateBy(Long createBy) { }
this.createBy = createBy;
} public void setCreateBy(String createBy) {
this.createBy = createBy;
public Integer getLevel() { }
return this.level;
} public Integer getLevel() {
return this.level;
public void setLevel(Integer level) { }
this.level = level;
} public void setLevel(Integer level) {
this.level = level;
public String getOrgCode() { }
return this.orgCode;
} public String getOrgCode() {
return this.orgCode;
public void setOrgCode(String orgCode) { }
this.orgCode = orgCode;
} public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
public String getRemark() { }
return this.remark;
} public String getRemark() {
return this.remark;
public void setRemark(String remark) { }
this.remark = remark;
} public void setRemark(String remark) {
this.remark = remark;
public String getSeverity() { }
return this.severity;
} public String getSeverity() {
return this.severity;
public void setSeverity(String severity) { }
this.severity = severity;
} public void setSeverity(String severity) {
this.severity = severity;
public Long getEvaluationModelId() { }
return evaluationModelId;
} public Long getEvaluationModelId() {
return evaluationModelId;
public void setEvaluationModelId(Long evaluationModelId) { }
this.evaluationModelId = evaluationModelId;
} public void setEvaluationModelId(Long evaluationModelId) {
this.evaluationModelId = evaluationModelId;
public BigDecimal getTopLimit() { }
return topLimit;
} public BigDecimal getTopLimit() {
return topLimit;
public void setTopLimit(BigDecimal topLimit) { }
this.topLimit = topLimit;
} public void setTopLimit(BigDecimal topLimit) {
this.topLimit = topLimit;
public BigDecimal getDownLimit() { }
return downLimit;
} public BigDecimal getDownLimit() {
return downLimit;
public void setDownLimit(BigDecimal downLimit) { }
this.downLimit = downLimit;
} public void setDownLimit(BigDecimal downLimit) {
this.downLimit = downLimit;
public Integer getManageLevel() { }
return manageLevel;
} public Integer getManageLevel() {
return manageLevel;
public void setManageLevel(Integer manageLevel) { }
this.manageLevel = manageLevel;
} public void setManageLevel(Integer manageLevel) {
this.manageLevel = manageLevel;
}
} }
\ No newline at end of file
package com.yeejoin.amos.fas.dao.entity; package com.yeejoin.amos.fas.dao.entity;
import javax.persistence.*; import javax.persistence.*;
/** /**
* 水资源 * 水资源
* @author * @author
* *
*/ */
@Entity @Entity
@Table(name="f_water_resource") @Table(name="f_water_resource")
@NamedQuery(name="WaterResource.findAll", query="SELECT f FROM WaterResource f") @NamedQuery(name="WaterResource.findAll", query="SELECT f FROM WaterResource f")
public class WaterResource extends BasicEntity{ public class WaterResource extends BasicEntity{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 名称 * 名称
*/ */
private String name; private String name;
/** /**
* 编号 * 编号
*/ */
private String code; private String code;
/** /**
* 类型 1:消火栓,2:消防水池,3:喷淋 * 类型 1:消火栓,2:消防水池,3:喷淋
*/ */
private String type; private String type;
/** /**
* 区域 * 区域
*/ */
@Column(name="production_area") @Column(name="production_area")
private String productionArea; private String productionArea;
/** /**
* 3纬坐标 * 3纬坐标
*/ */
private String position3d; private String position3d;
/** /**
* 3维楼层 * 3维楼层
*/ */
private String floor3d; private String floor3d;
/** /**
* 是否室内 * 是否室内
*/ */
@Column(name="is_indoor") @Column(name="is_indoor")
private Boolean isIndoor=true; private Boolean isIndoor=true;
/** /**
* 所属风险区域id * 所属风险区域id
*/ */
@Column(name="risk_source_id") @Column(name="risk_source_id")
private Long riskSourceId; private Long riskSourceId;
/** /**
* 房间 * 房间
*/ */
private String room; private String room;
/** /**
* 位置 * 位置
*/ */
private String address; private String address;
/** /**
* 组织 * 组织
*/ */
@Column(name="org_code") @Column(name="org_code")
private String orgCode; private String orgCode;
/** /**
* 创建人 * 创建人
*/ */
@Column(name="create_by") @Column(name="create_by")
private int createBy; private String createBy;
/** /**
* ue4位置 * ue4位置
*/ */
@Lob @Lob
private String ue4Location; private String ue4Location;
/** /**
* ue4旋转 * ue4旋转
*/ */
@Lob @Lob
private String ue4Rotation; private String ue4Rotation;
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getCode() { public String getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(String code) {
this.code = code; this.code = code;
} }
public String getType() { public String getType() {
return type; return type;
} }
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
public String getProductionArea() { public String getProductionArea() {
return productionArea; return productionArea;
} }
public void setProductionArea(String productionArea) { public void setProductionArea(String productionArea) {
this.productionArea = productionArea; this.productionArea = productionArea;
} }
public String getPosition3d() { public String getPosition3d() {
return position3d; return position3d;
} }
public void setPosition3d(String position3d) { public void setPosition3d(String position3d) {
this.position3d = position3d; this.position3d = position3d;
} }
public String getFloor3d() { public String getFloor3d() {
return floor3d; return floor3d;
} }
public void setFloor3d(String floor3d) { public void setFloor3d(String floor3d) {
this.floor3d = floor3d; this.floor3d = floor3d;
} }
public Boolean getIsIndoor() { public Boolean getIsIndoor() {
return isIndoor; return isIndoor;
} }
public void setIsIndoor(Boolean isIndoor) { public void setIsIndoor(Boolean isIndoor) {
this.isIndoor = isIndoor; this.isIndoor = isIndoor;
} }
public String getRoom() { public String getRoom() {
return room; return room;
} }
public void setRoom(String room) { public void setRoom(String room) {
this.room = room; this.room = room;
} }
public Long getRiskSourceId() { public Long getRiskSourceId() {
return riskSourceId; return riskSourceId;
} }
public void setRiskSourceId(Long riskSourceId) { public void setRiskSourceId(Long riskSourceId) {
this.riskSourceId = riskSourceId; this.riskSourceId = riskSourceId;
} }
public String getAddress() { public String getAddress() {
return address; return address;
} }
public void setAddress(String address) { public void setAddress(String address) {
this.address = address; this.address = address;
} }
public String getOrgCode() { public String getOrgCode() {
return orgCode; return orgCode;
} }
public void setOrgCode(String orgCode) { public void setOrgCode(String orgCode) {
this.orgCode = orgCode; this.orgCode = orgCode;
} }
public int getCreateBy() { public String getCreateBy() {
return createBy; return createBy;
} }
public void setCreateBy(int createBy) { public void setCreateBy(String createBy) {
this.createBy = createBy; this.createBy = createBy;
} }
@Column(name = "ue4_location") @Column(name = "ue4_location")
public String getUe4Location() { public String getUe4Location() {
return ue4Location; return ue4Location;
} }
public void setUe4Location(String ue4Location) { public void setUe4Location(String ue4Location) {
this.ue4Location = ue4Location; this.ue4Location = ue4Location;
} }
@Column(name = "ue4_rotation") @Column(name = "ue4_rotation")
public String getUe4Rotation() { public String getUe4Rotation() {
return ue4Rotation; return ue4Rotation;
} }
public void setUe4Rotation(String ue4Rotation) { public void setUe4Rotation(String ue4Rotation) {
this.ue4Rotation = ue4Rotation; this.ue4Rotation = ue4Rotation;
} }
} }
...@@ -45,7 +45,7 @@ public class AccidentTypeController extends BaseController { ...@@ -45,7 +45,7 @@ public class AccidentTypeController extends BaseController {
public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests, public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) { @ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<HashMap<String, Object>> list = iAccidentTypeService.queryAccidentTypePage(param); Page<HashMap<String, Object>> list = iAccidentTypeService.queryAccidentTypePage(getToken(),getProduct(),getAppKey(),param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
......
package com.yeejoin.amos.fas.business.controller; package com.yeejoin.amos.fas.business.controller;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.yeejoin.amos.fas.business.param.ImgParam; import com.yeejoin.amos.fas.business.param.ImgParam;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService; import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import com.yeejoin.amos.fas.business.vo.ReginParams; import com.yeejoin.amos.fas.business.vo.ReginParams;
...@@ -12,25 +28,10 @@ import com.yeejoin.amos.fas.core.util.StringUtil; ...@@ -12,25 +28,10 @@ import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.Equipment; import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment; import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment;
import com.yeejoin.amos.fas.dao.entity.PreplanPicture; import com.yeejoin.amos.fas.dao.entity.PreplanPicture;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@RestController @RestController
@RequestMapping(value = "/api/impEquip") @RequestMapping(value = "/api/impEquip")
...@@ -249,7 +250,7 @@ public class EquipmentController extends BaseController { ...@@ -249,7 +250,7 @@ public class EquipmentController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "重点装备详情", notes = "重点装备详情") @ApiOperation(httpMethod = "GET", value = "重点装备详情", notes = "重点装备详情")
@GetMapping(value = "/detail/{equipmentId}", produces = "application/json;charset=UTF-8") @GetMapping(value = "/detail/{equipmentId}", produces = "application/json;charset=UTF-8")
public CommonResponse findEquipDetail(@PathVariable Long equipmentId) { public CommonResponse findEquipDetail(@PathVariable Long equipmentId) {
return CommonResponseUtil.success(iEquipService.findEquipDetailsById(equipmentId)); return CommonResponseUtil.success(iEquipService.findEquipDetailsById(getToken(),getProduct(),getAppKey(),equipmentId));
} }
/** /**
......
...@@ -91,7 +91,7 @@ public class FireSourceController extends BaseController { ...@@ -91,7 +91,7 @@ public class FireSourceController extends BaseController {
@RequestMapping(value = "/fire-car/det/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @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) { public CommonResponse queryFireCar(@ApiParam(value = "查询条件", required = true) @PathVariable Long id) {
FireCarDetailVo car = fireCarService.findFireCarById(id); FireCarDetailVo car = fireCarService.findFireCarById(getToken(),getProduct(),getAppKey(),id);
return CommonResponseUtil.success(car); return CommonResponseUtil.success(car);
} }
......
package com.yeejoin.amos.fas.business.controller; package com.yeejoin.amos.fas.business.controller;
import java.util.Date; import java.util.Date;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.fas.business.service.intfc.FireStengthService; import com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.FireStrength; import com.yeejoin.amos.fas.dao.entity.FireStrength;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
@RestController @RestController
@RequestMapping(value = "/api/firestrength") @RequestMapping(value = "/api/firestrength")
@Api(tags="消防专职人API") @Api(tags="消防专职人API")
public class FireStrengthController extends BaseController{ public class FireStrengthController extends BaseController{
@Autowired @Autowired
FireStengthService fireStengthService; FireStengthService fireStengthService;
//@Authorization(ingore = true) //@Authorization(ingore = true)
@ApiOperation(httpMethod = "POST",value = "添加专职人员", notes = "添加专职人员") @ApiOperation(httpMethod = "POST",value = "添加专职人员", notes = "添加专职人员")
@RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse createPoint(@RequestBody FireStrength fireStrength) throws Exception{ public CommonResponse createPoint(@RequestBody FireStrength fireStrength) throws Exception{
if(fireStrength == null if(fireStrength == null
|| StringUtils.isEmpty(fireStrength.getUsername()) || StringUtils.isEmpty(fireStrength.getUsername())
|| StringUtils.isEmpty(fireStrength.getPhoneNum()) || StringUtils.isEmpty(fireStrength.getPhoneNum())
|| StringUtils.isEmpty(fireStrength.getPosition()) || StringUtils.isEmpty(fireStrength.getPosition())
|| StringUtils.isEmpty(fireStrength.getCode() )) || StringUtils.isEmpty(fireStrength.getCode() ))
throw new Exception("数据校验失败."); throw new Exception("数据校验失败.");
fireStrength.setCreateBy(0); fireStrength.setCreateBy("0");
fireStrength.setCreateDate(new Date()); fireStrength.setCreateDate(new Date());
return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength)); return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength));
} }
// @Authorization(ingore = true) // @Authorization(ingore = true)
@ApiOperation(httpMethod = "PUT",value = "编辑专职人员", notes = "编辑专职人员") @ApiOperation(httpMethod = "PUT",value = "编辑专职人员", notes = "编辑专职人员")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT) @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse udpatePoint(@PathVariable Long id, @RequestBody FireStrength fireStrength) { public CommonResponse udpatePoint(@PathVariable Long id, @RequestBody FireStrength fireStrength) {
fireStrength.setId(id); fireStrength.setId(id);
return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength)); return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength));
} }
//@Authorization(ingore = true) //@Authorization(ingore = true)
@ApiOperation(httpMethod = "GET",value = "查询单个专职人员", notes = "查询单个专职人员") @ApiOperation(httpMethod = "GET",value = "查询单个专职人员", notes = "查询单个专职人员")
@RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryPoint(@PathVariable Long id) { public CommonResponse queryPoint(@PathVariable Long id) {
return CommonResponseUtil.success(fireStengthService.queryOne(id)); return CommonResponseUtil.success(fireStengthService.queryOne(id));
} }
//@Authorization(ingore = true) //@Authorization(ingore = true)
@ApiOperation(httpMethod = "DELETE",value = "删除专职人员", notes = "查询单个专职人员") @ApiOperation(httpMethod = "DELETE",value = "删除专职人员", notes = "查询单个专职人员")
@RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE) @RequestMapping(value = "/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
public CommonResponse deletePoint(@PathVariable String ids) throws Exception { public CommonResponse deletePoint(@PathVariable String ids) throws Exception {
String [] idArray = ids.split(","); String [] idArray = ids.split(",");
return CommonResponseUtil.success(fireStengthService.deletePoint(idArray)); return CommonResponseUtil.success(fireStengthService.deletePoint(idArray));
} }
//@Authorization(ingore = true) //@Authorization(ingore = true)
@ApiOperation(httpMethod = "GET",value = "分页查询专职人员", notes = "分页查询专职人员") @ApiOperation(httpMethod = "GET",value = "分页查询专职人员", notes = "分页查询专职人员")
@RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/page", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse pointList( public CommonResponse pointList(
@ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false)String name, @ApiParam(value = "名称模糊查询", required = false) @RequestParam(required = false)String name,
@ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String code, @ApiParam(value = "编号模糊查询", required = false) @RequestParam(required = false)String code,
@RequestParam int pageNumber, @RequestParam int pageNumber,
@RequestParam int pageSize @RequestParam int pageSize
) { ) {
CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize); CommonPageable commonPageable = new CommonPageable(pageNumber,pageSize);
return CommonResponseUtil.success(fireStengthService.queryByFireEquimt(StringUtils.trimToNull(name),StringUtils.trimToNull(code),commonPageable)); return CommonResponseUtil.success(fireStengthService.queryByFireEquimt(StringUtils.trimToNull(name),StringUtils.trimToNull(code),commonPageable));
} }
} }
...@@ -41,7 +41,7 @@ public class RiskFactorController extends BaseController { ...@@ -41,7 +41,7 @@ public class RiskFactorController extends BaseController {
public CommonResponse queryRiskFactorPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests, public CommonResponse queryRiskFactorPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) { @ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<HashMap<String, Object>> list = iRiskFactorService.queryRiskFactorPage(param); Page<HashMap<String, Object>> list = iRiskFactorService.queryRiskFactorPage(getToken(),getProduct(),getAppKey(),param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
......
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService; import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService;
import com.yeejoin.amos.fas.business.util.CommonPageParamUtil; import com.yeejoin.amos.fas.business.util.CommonPageParamUtil;
import com.yeejoin.amos.fas.business.vo.ReginParams; import com.yeejoin.amos.fas.business.vo.ReginParams;
import com.yeejoin.amos.fas.common.enums.ManageLevelEum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.request.CommonRequest; import com.yeejoin.amos.fas.core.common.request.CommonRequest;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
...@@ -17,14 +18,11 @@ import org.slf4j.Logger; ...@@ -17,14 +18,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("/api/riskLevel") @RequestMapping("/api/riskLevel")
...@@ -44,7 +42,7 @@ public class RiskLevelController extends BaseController { ...@@ -44,7 +42,7 @@ public class RiskLevelController extends BaseController {
public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests, public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) { @ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable); CommonPageInfoParam param = CommonPageParamUtil.fillCommonPageInfoParam(queryRequests, commonPageable);
Page<HashMap<String, Object>> list = iRiskLevelService.queryRiskLevelPage(param); Page<HashMap<String, Object>> list = iRiskLevelService.queryRiskLevelPage(getToken(),getProduct(),getAppKey(),param);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} }
...@@ -100,4 +98,10 @@ public class RiskLevelController extends BaseController { ...@@ -100,4 +98,10 @@ public class RiskLevelController extends BaseController {
} }
} }
@ApiOperation(value = "风险管控级别查询",notes = "风险管控级别查询")
@GetMapping(value = "/manageLevel/list")
public CommonResponse getManageLevelEumList(){
return CommonResponseUtil.success(ManageLevelEum.getManageLevelEumList());
}
} }
package com.yeejoin.amos.fas.business.controller; package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.param.AlarmParam; import java.util.ArrayList;
import com.yeejoin.amos.fas.business.param.FmeaBindParam; import java.util.HashMap;
import com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService; import java.util.List;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService; import java.util.Map;
import com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus;
import com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.service.model.ProtalDataRo;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
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.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -30,10 +20,21 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -30,10 +20,21 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import com.yeejoin.amos.fas.business.param.AlarmParam;
import java.util.HashMap; import com.yeejoin.amos.fas.business.param.FmeaBindParam;
import java.util.List; import com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService;
import java.util.Map; import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus;
import com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.service.model.ProtalDataRo;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
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;
@RestController @RestController
@RequestMapping("/api/risksource") @RequestMapping("/api/risksource")
...@@ -484,7 +485,7 @@ public class RiskSourceController extends BaseController { ...@@ -484,7 +485,7 @@ public class RiskSourceController extends BaseController {
@ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber, @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
@ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) { @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
try { try {
Page<Map<String, Object>> list = riskSourceService.listFmeaPointInputitem(fmeaId, pageNumber, pageSize); Page<Map<String, Object>> list = riskSourceService.listFmeaPointInputitem(getToken(),getProduct(),getAppKey(),fmeaId, pageNumber, pageSize);
return CommonResponseUtil.success(list); return CommonResponseUtil.success(list);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
......
...@@ -7,14 +7,6 @@ import feign.Logger; ...@@ -7,14 +7,6 @@ import feign.Logger;
@Configuration @Configuration
public class FeignConfiguration { public class FeignConfiguration {
/**
* 日志级别
* @return
*/
@Bean
Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
/** /**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用 * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
......
package com.yeejoin.amos.fas.business.feign;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
/**
* @Author: xinglei
* @Description:
* @Date: 2020/3/30 16:26
*/
@Configuration
public class MultipartSupportConfig {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public RequestContextListener requestInterceptor() {
return new RequestContextListener();
}
}
package com.yeejoin.amos.fas.business.feign;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
//推送
@FeignClient(name = "${Push.fegin.name}", configuration={MultipartSupportConfig.class})
public interface PushFeign {
//
// @RequestMapping(value = "/api/user/sendMessage", method = RequestMethod.POST)
// CommonResponse sendMessage( @RequestBody List<PushMsgParam> responses);
@RequestMapping(value = "/api/user/sendMessageone", method = RequestMethod.POST)
CommonResponse sendMessageone( @RequestBody PushMsgParam responses);
@RequestMapping(value = "/api/user/pushNoticeMany", method = RequestMethod.POST)
CommonResponse pushNoticeMany( @RequestBody PushMsgParam responses);
@RequestMapping(value = "/api/user/buildPushPayload", method = RequestMethod.POST)
CommonResponse buildPushPayload( @RequestBody PushMsgParam responses);
@RequestMapping(value = "/api/user/pushDevice", method = RequestMethod.GET)
CommonResponse PushDevice( @RequestParam("alias") String alias);
@RequestMapping(value = "/api/user/PushDeviceRegistration", method = RequestMethod.GET)
CommonResponse PushDeviceRegistration( @RequestParam("registrationId") String registrationId,@RequestParam("alias") String alias);
}
package com.yeejoin.amos.fas.business.feign;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
@Service("pushFeignServer")
public class PushFeignServer {
private final RestTemplate restTemplate;
public PushFeignServer() {
this.restTemplate = new RestTemplate();
}
@Value("${Push.fegin.name}")
private String RPushFeginName;
private static String sendMessage = "/api/user/sendMessage";
public String geturls(String url){
return "http://"+RPushFeginName+url;
}
public HttpHeaders getHeader(String toke,String product,String appKey){
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Content-Type", "application/json");
headers.set("token", toke);
headers.set("product",product);
headers.set("appKey", appKey);
return headers;
}
public CommonResponse sendMessage( String toke,String product,String appKey, List<PushMsgParam> pushMsgParam){
try {
HttpEntity httpEntity = new HttpEntity<>(pushMsgParam, getHeader( toke, product, appKey));
CommonResponse commonResponse1 = restTemplate.postForObject(geturls(sendMessage),httpEntity, CommonResponse.class);
return commonResponse1;
} catch (Exception e) {
e.printStackTrace();
return CommonResponseUtil.failure("发送失败");
}
}
}
package com.yeejoin.amos.fas.business.jpush; package com.yeejoin.amos.fas.business.jpush;
import cn.jpush.api.JPushClient; import cn.jpush.api.JPushClient;
import cn.jpush.api.push.model.Platform; import cn.jpush.api.push.model.Platform;
import cn.jpush.api.push.model.PushPayload; import cn.jpush.api.push.model.PushPayload;
import cn.jpush.api.push.model.audience.Audience; import cn.jpush.api.push.model.audience.Audience;
import cn.jpush.api.push.model.notification.Notification; import cn.jpush.api.push.model.notification.Notification;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import java.util.List;
@Service
@Service public class AppMessagePushService {
public class AppMessagePushService {
protected static final Logger log = LoggerFactory.getLogger(AppMessagePushService.class);
protected static final Logger log = LoggerFactory.getLogger(AppMessagePushService.class); /*
@Value("${params.isPush}")
@Value("${params.isPush}") private String isPush;
private String isPush;
private static final String APP_KEY = "1b3f7b961200f4b236811dfe";
private static final String APP_KEY = "1b3f7b961200f4b236811dfe";
private static final String MASTER_SECRET = "8b650e645fb3a43c96be02b2";
private static final String MASTER_SECRET = "8b650e645fb3a43c96be02b2";
private static JPushClient jpushClient = new JPushClient(MASTER_SECRET, APP_KEY);
private static JPushClient jpushClient = new JPushClient(MASTER_SECRET, APP_KEY); */
public void sendMessage(List<PushMsgParam> responses) { @Autowired
try { private com.yeejoin.amos.fas.business.feign.PushFeign PushFeign;
if (responses != null && "true".equals(isPush)) {
for (PushMsgParam response : responses) {
PushPayload payload = buildPushPayload(response);
jpushClient.sendPush(payload);
}
} // public void sendMessage(List<PushMsgParam> responses) {
} catch (Exception e) { // try {
log.error("极光推送异常", e); // if (responses != null && "true".equals(isPush)) {
} // for (PushMsgParam response : responses) {
} // PushPayload payload = buildPushPayload(response);
// jpushClient.sendPush(payload);
private PushPayload buildPushPayload(PushMsgParam response) { // }
if (JPushTypeEnum.ALL.getCode().equals(response.getType())) { // }
return PushPayload.newBuilder() // } catch (Exception e) {
.setPlatform(Platform.android()) // log.error("极光推送异常", e);
.setAudience(Audience.all()) // }
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras())) // }
.build();
} else if (JPushTypeEnum.TAG.getCode().equals(response.getType())) { private PushPayload buildPushPayload(PushMsgParam response) {
return PushPayload.newBuilder() CommonResponse commonResponse = PushFeign.buildPushPayload(response);
.setPlatform(Platform.android()) return (PushPayload)commonResponse.getDataList();
.setAudience(Audience.tag(response.getRecivers())) // if (JPushTypeEnum.ALL.getCode().equals(response.getType())) {
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras())) // return PushPayload.newBuilder()
.build(); // .setPlatform(Platform.android())
} else { // .setAudience(Audience.all())
return PushPayload.newBuilder() // .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.setPlatform(Platform.android()) // .build();
.setAudience(Audience.alias(response.getRecivers())) // } else if (JPushTypeEnum.TAG.getCode().equals(response.getType())) {
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras())) // return PushPayload.newBuilder()
.build(); // .setPlatform(Platform.android())
} // .setAudience(Audience.tag(response.getRecivers()))
} // .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
public void sendMessage(PushMsgParam response) { // } else {
try { // return PushPayload.newBuilder()
if (null != response && "true".equals(isPush)) { // .setPlatform(Platform.android())
PushPayload payload = PushPayload.newBuilder().setPlatform(Platform.android()) // .setAudience(Audience.alias(response.getRecivers()))
.setAudience(Audience.all()) // .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras())) // .build();
.build(); // }
jpushClient.sendPush(payload); }
}
} catch (Exception e) { public void sendMessage(PushMsgParam response) {
log.error("极光推送异常", e); 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);
// }
}
}
package com.yeejoin.amos.fas.business.service.impl;
import java.util.Date; package com.yeejoin.amos.fas.business.service.impl;
import java.util.HashMap;
import java.util.List; import java.util.ArrayList;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired; import java.util.HashMap;
import org.springframework.data.domain.Page; import java.util.LinkedHashMap;
import org.springframework.data.domain.PageImpl; import java.util.List;
import org.springframework.stereotype.Service; import java.util.Map;
import com.yeejoin.amos.fas.business.dao.mapper.AccidentTypeMapper; import org.springframework.beans.factory.annotation.Autowired;
import com.yeejoin.amos.fas.business.dao.repository.IAccidentTypeDao; import org.springframework.data.domain.Page;
import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao; import org.springframework.data.domain.PageImpl;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import org.springframework.stereotype.Service;
import com.yeejoin.amos.fas.business.service.intfc.IAccidentTypeService;
import com.yeejoin.amos.fas.dao.entity.AccidentType; import com.google.common.base.Joiner;
import com.yeejoin.amos.fas.dao.entity.RiskFactor; import com.yeejoin.amos.fas.business.dao.mapper.AccidentTypeMapper;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.business.dao.repository.IAccidentTypeDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
@Service("accidentTypeService") import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
public class AccidentTypeServiceImpl implements IAccidentTypeService { import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IAccidentTypeService;
@Autowired import com.yeejoin.amos.fas.dao.entity.AccidentType;
AccidentTypeMapper accidentTypeMapper; import com.yeejoin.amos.fas.dao.entity.RiskFactor;
@Autowired import com.yeejoin.amos.fas.exception.YeeException;
IAccidentTypeDao iAccidentTypeDao; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
@Autowired
IRiskFactorDao iRiskFactorDao; @Service("accidentTypeService")
public class AccidentTypeServiceImpl implements IAccidentTypeService {
@Override
public void detAccidentType(Long[] param) { @Autowired
//1.校验 AccidentTypeMapper accidentTypeMapper;
for(Long id : param){ @Autowired
checkBeforeDet(id); IAccidentTypeDao iAccidentTypeDao;
} @Autowired
//2.删除 IRiskFactorDao iRiskFactorDao;
iAccidentTypeDao.deleteAllByIds(param); @Autowired
} private RemoteSecurityService remoteSecurityService;
@Override
/** public void detAccidentType(Long[] param) {
* 关联数据校验 //1.校验
* @param id for(Long id : param){
*/ checkBeforeDet(id);
private void checkBeforeDet(Long id) { }
List<RiskFactor> list = iRiskFactorDao.findByAccidentTypeId(id); //2.删除
if(null != list && list.size()>0){ iAccidentTypeDao.deleteAllByIds(param);
throw new YeeException("危险因素"+list.get(0).getName()+"在使用中,不能删除"); }
}
} /**
* 关联数据校验
@Override * @param id
public void editAccidentType(HashMap<String, Object> map) { */
AccidentType param = (AccidentType)map.get("param"); private void checkBeforeDet(Long id) {
String orgCode = map.get("org_code") == null ? "":map.get("org_code").toString(); List<RiskFactor> list = iRiskFactorDao.findByAccidentTypeId(id);
String userId = map.get("user_id")== null ? "0":map.get("user_id").toString(); if(null != list && list.size()>0){
String deptId = map.get("dept_id")== null ? "0":map.get("dept_id").toString(); throw new YeeException("危险因素"+list.get(0).getName()+"在使用中,不能删除");
param.setOrgCode(orgCode); }
param.setDeptId(Long.parseLong(deptId)); }
param.setCreateBy(Long.parseLong(userId));
param.setCreateDate(new Date()); @Override
iAccidentTypeDao.save(param); public void editAccidentType(HashMap<String, Object> map) {
} AccidentType param = (AccidentType)map.get("param");
String orgCode = map.get("org_code") == null ? "":map.get("org_code").toString();
@Override String userId = map.get("user_id")== null ? "0":map.get("user_id").toString();
public List<HashMap<String,Object>> queryAccidentType(String orgCode) { String deptId = map.get("dept_id")== null ? "0":map.get("dept_id").toString();
param.setOrgCode(orgCode);
return accidentTypeMapper.findAccidentTypeListByOrgCode(orgCode); param.setDeptId(deptId);
} param.setCreateBy(userId);
param.setCreateDate(new Date());
@Override iAccidentTypeDao.save(param);
public Page<HashMap<String, Object>> queryAccidentTypePage(CommonPageInfoParam param) { }
long total = accidentTypeMapper.countPageData(param);
List<HashMap<String, Object>> content = accidentTypeMapper.findAccidentTypePage(param); @Override
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); public List<HashMap<String,Object>> queryAccidentType(String orgCode) {
return result;
} return accidentTypeMapper.findAccidentTypeListByOrgCode(orgCode);
}
}
@Override
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))
{
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")));
});
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result;
}
}
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Sets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.fas.business.constants.FasConstant; import com.yeejoin.amos.fas.business.constants.FasConstant;
...@@ -11,19 +31,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService; ...@@ -11,19 +31,7 @@ import com.yeejoin.amos.fas.business.service.intfc.IFireCarService;
import com.yeejoin.amos.fas.business.vo.FireCarDetailVo; import com.yeejoin.amos.fas.business.vo.FireCarDetailVo;
import com.yeejoin.amos.fas.dao.entity.FireCar; import com.yeejoin.amos.fas.dao.entity.FireCar;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import org.apache.commons.collections.CollectionUtils; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import org.assertj.core.util.Sets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.*;
@Service("fireCarService") @Service("fireCarService")
...@@ -109,8 +117,10 @@ public class FireCarServiceImpl implements IFireCarService { ...@@ -109,8 +117,10 @@ public class FireCarServiceImpl implements IFireCarService {
} }
@Override @Override
public FireCarDetailVo findFireCarById(Long truckId) { public FireCarDetailVo findFireCarById(String toke,String product,String appKey,Long truckId) {
FireCarDetailVo carVo = fireCarMapper.getFireCarDetailById(truckId); FireCarDetailVo carVo = fireCarMapper.getFireCarDetailById(truckId);
DepartmentModel departmentModel= remoteSecurityService.getDepartmentByDeptId(toke, product, appKey, carVo.getDeptId());
carVo.setDepartmentName(departmentModel.getDepartmentName());
return carVo; return carVo;
} }
......
...@@ -12,7 +12,6 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable; ...@@ -12,7 +12,6 @@ import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.core.util.StringUtil; import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.FireCar;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint; import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
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.FmeaEquipmentPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper; 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.FmeaPointInputitemMapper;
...@@ -16,6 +17,10 @@ import com.yeejoin.amos.fas.dao.entity.Fmea; ...@@ -16,6 +17,10 @@ import com.yeejoin.amos.fas.dao.entity.Fmea;
import com.yeejoin.amos.fas.dao.entity.RiskFactor; import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import com.yeejoin.amos.fas.dao.entity.RiskLevel; import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import com.yeejoin.amos.fas.dao.entity.RiskSource; import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.bouncycastle.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
...@@ -82,6 +87,71 @@ public class FmeaServiceImpl implements IFmeaService { ...@@ -82,6 +87,71 @@ public class FmeaServiceImpl implements IFmeaService {
public Page<HashMap<String, Object>> queryFmeaList(CommonPageInfoParam param) { public Page<HashMap<String, Object>> queryFmeaList(CommonPageInfoParam param) {
long total = fmeaMapper.countPageData(param); long total = fmeaMapper.countPageData(param);
List<HashMap<String, Object>> content = fmeaMapper.queryFmeaPage(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); Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total);
return result; return result;
} }
......
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.RiskFactorMapper; import java.util.ArrayList;
import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper; import java.util.Date;
import com.yeejoin.amos.fas.business.dao.repository.IFmeaDao; import java.util.HashMap;
import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao; import java.util.LinkedHashMap;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao; import java.util.List;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import java.util.Map;
import com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService;
import com.yeejoin.amos.fas.dao.entity.Fmea; import org.springframework.beans.factory.annotation.Autowired;
import com.yeejoin.amos.fas.dao.entity.RiskFactor; import org.springframework.data.domain.Page;
import com.yeejoin.amos.fas.exception.YeeException; import org.springframework.data.domain.PageImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import com.google.common.base.Joiner;
import org.springframework.stereotype.Service; import com.yeejoin.amos.fas.business.dao.mapper.RiskFactorMapper;
import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
import java.util.Date; import com.yeejoin.amos.fas.business.dao.repository.IFmeaDao;
import java.util.HashMap; import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
import java.util.List; import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
@Service("riskFactorService") import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
public class RiskFactorServiceImpl implements IRiskFactorService { import com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService;
import com.yeejoin.amos.fas.dao.entity.Fmea;
@Autowired import com.yeejoin.amos.fas.dao.entity.RiskFactor;
RiskFactorMapper riskFactorMapper; import com.yeejoin.amos.fas.exception.YeeException;
@Autowired import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
IRiskFactorDao iRiskFactorDao;
@Autowired @Service("riskFactorService")
IFmeaDao iFmeaDao; public class RiskFactorServiceImpl implements IRiskFactorService {
@Autowired @Autowired
RiskSourceMapper riskSourceMapper; RiskFactorMapper riskFactorMapper;
@Autowired @Autowired
IRiskLevelDao iRiskLevelDao; IRiskFactorDao iRiskFactorDao;
@Autowired
@Override IFmeaDao iFmeaDao;
public Page<HashMap<String, Object>> queryRiskFactorPage(CommonPageInfoParam param) {
long total = riskFactorMapper.countPageData(param); @Autowired
List<HashMap<String, Object>> content = riskFactorMapper.queryRiskFactorPage(param); RiskSourceMapper riskSourceMapper;
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); @Autowired
return result; IRiskLevelDao iRiskLevelDao;
} @Autowired
private RemoteSecurityService remoteSecurityService;
@Override @Override
public List<RiskFactor> queryRiskFactor() { public Page<HashMap<String, Object>> queryRiskFactorPage(String toke,String product,String appKey,CommonPageInfoParam param) {
return iRiskFactorDao.findAll(); long total = riskFactorMapper.countPageData(param);
} List<HashMap<String, Object>> content = riskFactorMapper.queryRiskFactorPage(param);
List<String> userIdList = new ArrayList<String>();
@Override List<String> deptIdList = new ArrayList<String>();
public void editRiskFactor(HashMap<String, Object> map) { for(HashMap<String, Object> map : content)
RiskFactor param = (RiskFactor) map.get("param"); {
String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString(); String userId = String.valueOf(map.get("createBy"));
String userId = map.get("user_id") == null ? "0" : map.get("user_id").toString(); String deptId = String.valueOf(map.get("deptId"));
String deptId = map.get("dept_id") == null ? "0" : map.get("dept_id").toString(); if(userId!=null&&!userIdList.contains(userId))
param.setOrgCode(orgCode); {
param.setDeptId(Long.parseLong(deptId)); userIdList.add(userId);
param.setCreateBy(Integer.parseInt(userId)); }
param.setCreateDate(new Date()); if(deptId!=null&&!deptIdList.contains(deptId))
{
deptIdList.add(deptId);
iRiskFactorDao.save(param); }
} }
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());
@Override }
public void detRiskFactor(Long[] param) { List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
//1.校验 Map<String, String> deptMap = new HashMap<String,String>();
for (Long id : param) { for (int i = 0; i < depts.size(); i++) {
checkBeforeDet(id); deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
} }
//2.删除 content.forEach(e -> {
iRiskFactorDao.deleteAllByIds(param); 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;
/** }
* 删除前校验
* @Override
* @param id public List<RiskFactor> queryRiskFactor() {
*/ return iRiskFactorDao.findAll();
private void checkBeforeDet(Long id) { }
List<Fmea> list = iFmeaDao.findByRiskFactorsId(id);
if (null != list && list.size() > 0) { @Override
throw new YeeException("FMEA" + list.get(0).getId() + "在使用中,不能删除"); public void editRiskFactor(HashMap<String, Object> map) {
} RiskFactor param = (RiskFactor) map.get("param");
} String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString();
String userId = map.get("user_id") == null ? "0" : map.get("user_id").toString();
@Override String deptId = map.get("dept_id") == null ? "0" : map.get("dept_id").toString();
public Long countRepeatData(RiskFactor param) { param.setOrgCode(orgCode);
// TODO Auto-generated method stub param.setDeptId(deptId);
return riskFactorMapper.countRepeatData(param); param.setCreateBy(userId);
} param.setCreateDate(new Date());
}
iRiskFactorDao.save(param);
}
@Override
public void detRiskFactor(Long[] param) {
//1.校验
for (Long id : param) {
checkBeforeDet(id);
}
//2.删除
iRiskFactorDao.deleteAllByIds(param);
}
/**
* 删除前校验
*
* @param id
*/
private void checkBeforeDet(Long id) {
List<Fmea> list = iFmeaDao.findByRiskFactorsId(id);
if (null != list && list.size() > 0) {
throw new YeeException("FMEA" + list.get(0).getId() + "在使用中,不能删除");
}
}
@Override
public Long countRepeatData(RiskFactor param) {
// TODO Auto-generated method stub
return riskFactorMapper.countRepeatData(param);
}
}
package com.yeejoin.amos.fas.business.service.impl; package com.yeejoin.amos.fas.business.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import com.yeejoin.amos.fas.business.util.StringUtil;
import com.yeejoin.amos.fas.common.enums.ManageLevelEum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.google.common.base.Joiner;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.dao.mapper.RiskLevelMapper; import com.yeejoin.amos.fas.business.dao.mapper.RiskLevelMapper;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao; import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao; import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam; import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService; import com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService;
import com.yeejoin.amos.fas.dao.entity.RiskLevel; import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import com.yeejoin.amos.fas.dao.entity.RiskSource; import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.exception.YeeException; import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
@Service("riskLevelService") @Service("riskLevelService")
public class RiskLevelServiceImpl implements IRiskLevelService { public class RiskLevelServiceImpl implements IRiskLevelService {
@Autowired @Autowired
...@@ -26,22 +39,43 @@ public class RiskLevelServiceImpl implements IRiskLevelService { ...@@ -26,22 +39,43 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
IRiskLevelDao iRiskLevelDao; IRiskLevelDao iRiskLevelDao;
@Autowired @Autowired
IRiskSourceDao iRiskSourceDao; IRiskSourceDao iRiskSourceDao;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Override @Override
public Page<HashMap<String, Object>> queryRiskLevelPage(CommonPageInfoParam param) { public Page<HashMap<String, Object>> queryRiskLevelPage(String toke,String product,String appKey,CommonPageInfoParam param) {
long total = riskLevelMapper.countPageData(param); long total = riskLevelMapper.countPageData(param);
List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param); List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param);
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); Set<String> userIdList = new HashSet<String>();
return result; 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());
}
}
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);
} }
@Override @Override
public void editRiskLevel(HashMap<String, Object> map) { public void editRiskLevel(HashMap<String, Object> map) {
RiskLevel param = (RiskLevel) map.get("param"); RiskLevel param = (RiskLevel) map.get("param");
String orgCode = map.get("org_code") == null ? "":map.get("org_code").toString(); String orgCode = map.get("org_code") == null ? "":map.get("org_code").toString();
String userId = map.get("user_id")== null ? "0":map.get("user_id").toString(); String userId = map.get("user_id")== null ? "0":map.get("user_id").toString();
param.setOrgCode(orgCode); param.setOrgCode(orgCode);
param.setCreateBy(Long.parseLong(userId)); param.setCreateBy(userId);
param.setCreateDate(new Date()); param.setCreateDate(new Date());
iRiskLevelDao.save(param); iRiskLevelDao.save(param);
} }
...@@ -54,7 +88,6 @@ public class RiskLevelServiceImpl implements IRiskLevelService { ...@@ -54,7 +88,6 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
} }
//2.删除 //2.删除
iRiskLevelDao.deleteAllByIds(param); iRiskLevelDao.deleteAllByIds(param);
} }
/** /**
...@@ -87,3 +120,4 @@ public class RiskLevelServiceImpl implements IRiskLevelService { ...@@ -87,3 +120,4 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
} }
} }
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