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;
}
}
......@@ -20,6 +20,8 @@ public class EquipDetailsResponse {
private String remarks;
private String userId;
public String getName() {
return name;
}
......@@ -83,4 +85,14 @@ public class EquipDetailsResponse {
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}
......@@ -19,10 +19,10 @@ public class AccidentType extends BasicEntity {
@Column(name="create_by")
private Long createBy;
private String createBy;
@Column(name="dept_id")
private Long deptId;
private String deptId;
private String name;
......@@ -45,22 +45,36 @@ public class AccidentType extends BasicEntity {
}
public Long getCreateBy() {
return this.createBy;
public String getCreateBy() {
return createBy;
}
public void setCreateBy(Long createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Long getDeptId() {
return this.deptId;
public String getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
public void setDeptId(String deptId) {
this.deptId = deptId;
}
@Transient
public String getInfluence() {
return this.influence;
......
......@@ -45,10 +45,10 @@ public class Equipment extends BasicEntity {
private Boolean isIndoor;
@Column(name="charge_dept_id")
private int chargeDeptId;
private String chargeDeptId;
@Column(name="charge_user_id")
private int chargeUserId;
private String chargeUserId;
private String code;
......@@ -147,19 +147,21 @@ public class Equipment extends BasicEntity {
this.riskSourceId = riskSourceId;
}
public int getChargeDeptId() {
return this.chargeDeptId;
public String getChargeDeptId() {
return chargeDeptId;
}
public void setChargeDeptId(int 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) {
public void setChargeUserId(String chargeUserId) {
this.chargeUserId = chargeUserId;
}
......
......@@ -18,7 +18,7 @@ public class EvaluationModel extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name="create_by")
private int createBy;
private String createBy;
private String name;
......@@ -54,11 +54,11 @@ public class EvaluationModel extends BasicEntity {
public EvaluationModel() {
}
public int getCreateBy() {
public String getCreateBy() {
return this.createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -72,7 +72,7 @@ public class FireStation extends BasicEntity{
* 创建人
*/
@Column(name="create_by")
private int createBy;
private String createBy;
@Column(name="picture")
......@@ -165,11 +165,11 @@ public class FireStation extends BasicEntity{
this.orgCode = orgCode;
}
public int getCreateBy() {
public String getCreateBy() {
return createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -45,7 +45,7 @@ public class FireStationFireEquipment extends BasicEntity{
* 创建人
*/
@Column(name="create_by")
private int createBy;
private String createBy;
public Long getFireStationId() {
return fireStationId;
......@@ -79,11 +79,11 @@ public class FireStationFireEquipment extends BasicEntity{
this.unit = unit;
}
public int getCreateBy() {
public String getCreateBy() {
return createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -78,7 +78,7 @@ public class FireStrength extends BasicEntity{
* 创建人
*/
@Column(name="create_by")
private int createBy;
private String createBy;
public String getCode() {
return code;
......@@ -144,11 +144,11 @@ public class FireStrength extends BasicEntity{
this.orgCode = orgCode;
}
public int getCreateBy() {
public String getCreateBy() {
return createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -91,7 +91,7 @@ public class Fmea extends BasicEntity {
private String personLeader;
@Column(name = "identify_user")
private Integer identifyUser;
private String identifyUser;
@Column(name = "identify_method")
private String identifyMethod;
......@@ -298,11 +298,11 @@ public class Fmea extends BasicEntity {
this.personLeader = personLeader;
}
public Integer getIdentifyUser() {
public String getIdentifyUser() {
return identifyUser;
}
public void setIdentifyUser(Integer identifyUser) {
public void setIdentifyUser(String identifyUser) {
this.identifyUser = identifyUser;
}
......
......@@ -17,7 +17,7 @@ public class PreplanPicture extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name = "create_by")
private int createBy;
private String createBy;
@Column(name = "equipment_id")
private Long equipmentId;
......@@ -34,11 +34,11 @@ public class PreplanPicture extends BasicEntity {
public PreplanPicture() {
}
public int getCreateBy() {
public String getCreateBy() {
return this.createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -20,10 +20,10 @@ public class RiskFactor extends BasicEntity {
private Long accidentTypeId;
@Column(name="create_by")
private int createBy;
private String createBy;
@Column(name="dept_id")
private Long deptId;
private String deptId;
private String name;
......@@ -45,19 +45,19 @@ public class RiskFactor extends BasicEntity {
this.accidentTypeId = accidentTypeId;
}
public int getCreateBy() {
public String getCreateBy() {
return this.createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Long getDeptId() {
public String getDeptId() {
return this.deptId;
}
public void setDeptId(Long deptId) {
public void setDeptId(String deptId) {
this.deptId = deptId;
}
......
......@@ -19,7 +19,7 @@ public class RiskLevel extends BasicEntity {
private String color;
@Column(name = "create_by")
private Long createBy;
private String createBy;
@Column(name = "evaluation_model_id")
private Long evaluationModelId;
......@@ -64,11 +64,13 @@ public class RiskLevel extends BasicEntity {
this.color = color;
}
public Long getCreateBy() {
return this.createBy;
public String getCreateBy() {
return createBy;
}
public void setCreateBy(Long createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -29,7 +29,7 @@ public class RiskSource extends BasicEntity {
private Boolean isIndoor;
@Column(name = "create_by")
private int createBy;
private String createBy;
private String name;
......@@ -142,11 +142,11 @@ public class RiskSource extends BasicEntity {
this.code = code;
}
public int getCreateBy() {
public String getCreateBy() {
return this.createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -81,7 +81,7 @@ public class WaterResource extends BasicEntity{
* 创建人
*/
@Column(name="create_by")
private int createBy;
private String createBy;
/**
* ue4位置
......@@ -184,11 +184,11 @@ public class WaterResource extends BasicEntity{
this.orgCode = orgCode;
}
public int getCreateBy() {
public String getCreateBy() {
return createBy;
}
public void setCreateBy(int createBy) {
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
......
......@@ -45,7 +45,7 @@ public class AccidentTypeController extends BaseController {
public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable 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);
}
......
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.service.intfc.IEquipmentService;
import com.yeejoin.amos.fas.business.vo.ReginParams;
......@@ -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.EquipmentFireEquipment;
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.ApiOperation;
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
@RequestMapping(value = "/api/impEquip")
......@@ -249,7 +250,7 @@ public class EquipmentController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "重点装备详情", notes = "重点装备详情")
@GetMapping(value = "/detail/{equipmentId}", produces = "application/json;charset=UTF-8")
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 {
@RequestMapping(value = "/fire-car/det/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryFireCar(@ApiParam(value = "查询条件", required = true) @PathVariable Long id) {
FireCarDetailVo car = fireCarService.findFireCarById(id);
FireCarDetailVo car = fireCarService.findFireCarById(getToken(),getProduct(),getAppKey(),id);
return CommonResponseUtil.success(car);
}
......
......@@ -37,7 +37,7 @@ public class FireStationController extends BaseController {
throw new Exception("数据校验失败.");
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
fireStation.setCreateBy(0);
fireStation.setCreateBy("0");
fireStation.setCreateDate(new Date());
fireStation.setOrgCode(compCode);
return CommonResponseUtil.success(iFireStationService.save(fireStation));
......@@ -52,7 +52,7 @@ public class FireStationController extends BaseController {
throw new Exception("数据校验失败.");
for (FireStationFireEquipment fireStationFireEquipment : fireStationFireEquipments) {
fireStationFireEquipment.setCreateBy(0);
fireStationFireEquipment.setCreateBy("0");
fireStationFireEquipment.setCreateDate(new Date());
}
return CommonResponseUtil.success(iFireStationService.saveStationFireEquipment(fireStationFireEquipments));
......@@ -136,7 +136,7 @@ public class FireStationController extends BaseController {
throw new Exception("数据校验失败.");
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
fireStation.setCreateBy(0);
fireStation.setCreateBy("0");
fireStation.setCreateDate(new Date());
fireStation.setOrgCode(compCode);
return CommonResponseUtil.success(iFireStationService.saveAndUpd(fireStation, file));
......
......@@ -41,7 +41,7 @@ public class FireStrengthController extends BaseController{
|| StringUtils.isEmpty(fireStrength.getCode() ))
throw new Exception("数据校验失败.");
fireStrength.setCreateBy(0);
fireStrength.setCreateBy("0");
fireStrength.setCreateDate(new Date());
return CommonResponseUtil.success(fireStengthService.savePoint(fireStrength));
}
......
......@@ -41,7 +41,7 @@ public class RiskFactorController extends BaseController {
public CommonResponse queryRiskFactorPage(@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable 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);
}
......
......@@ -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.util.CommonPageParamUtil;
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.CommonRequest;
import com.yeejoin.amos.fas.core.util.CommonResponse;
......@@ -17,14 +18,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
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.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/riskLevel")
......@@ -44,7 +42,7 @@ public class RiskLevelController extends BaseController {
public CommonResponse queryRiskLevelPage(@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable 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);
}
......@@ -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;
import com.yeejoin.amos.fas.business.param.AlarmParam;
import com.yeejoin.amos.fas.business.param.FmeaBindParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService;
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 java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -30,10 +20,21 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.fas.business.param.AlarmParam;
import com.yeejoin.amos.fas.business.param.FmeaBindParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService;
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
@RequestMapping("/api/risksource")
......@@ -484,7 +485,7 @@ public class RiskSourceController extends BaseController {
@ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
@ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
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);
} catch (Exception e) {
log.error(e.getMessage(), e);
......
......@@ -48,7 +48,7 @@ public class WaterResourceController extends BaseController{
throw new Exception("数据校验失败.");
ReginParams reginParams =getSelectedOrgInfo();
String compCode=getOrgCode(reginParams);
waterResource.setCreateBy(0);
waterResource.setCreateBy("0");
waterResource.setCreateDate(new Date());
waterResource.setOrgCode(compCode);
return CommonResponseUtil.success(iWaterResourceService.save(waterResource));
......
......@@ -7,14 +7,6 @@ import feign.Logger;
@Configuration
public class FeignConfiguration {
/**
* 日志级别
* @return
*/
@Bean
Logger.Level feignLoggerLevel() {
return Logger.Level.FULL;
}
/**
* 创建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("发送失败");
}
}
}
......@@ -7,17 +7,16 @@ import cn.jpush.api.push.model.audience.Audience;
import cn.jpush.api.push.model.notification.Notification;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.yeejoin.amos.fas.core.util.CommonResponse;
@Service
public class AppMessagePushService {
protected static final Logger log = LoggerFactory.getLogger(AppMessagePushService.class);
/*
@Value("${params.isPush}")
private String isPush;
......@@ -26,54 +25,65 @@ public class AppMessagePushService {
private static final String MASTER_SECRET = "8b650e645fb3a43c96be02b2";
private static JPushClient jpushClient = new JPushClient(MASTER_SECRET, APP_KEY);
*/
@Autowired
private com.yeejoin.amos.fas.business.feign.PushFeign PushFeign;
public void sendMessage(List<PushMsgParam> responses) {
try {
if (responses != null && "true".equals(isPush)) {
for (PushMsgParam response : responses) {
PushPayload payload = buildPushPayload(response);
jpushClient.sendPush(payload);
}
}
} catch (Exception e) {
log.error("极光推送异常", e);
}
}
// public void sendMessage(List<PushMsgParam> responses) {
// try {
// if (responses != null && "true".equals(isPush)) {
// for (PushMsgParam response : responses) {
// PushPayload payload = buildPushPayload(response);
// jpushClient.sendPush(payload);
// }
// }
// } catch (Exception e) {
// log.error("极光推送异常", e);
// }
// }
private PushPayload buildPushPayload(PushMsgParam response) {
if (JPushTypeEnum.ALL.getCode().equals(response.getType())) {
return PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.all())
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
} else if (JPushTypeEnum.TAG.getCode().equals(response.getType())) {
return PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.tag(response.getRecivers()))
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
} else {
return PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.alias(response.getRecivers()))
.setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
.build();
}
CommonResponse commonResponse = PushFeign.buildPushPayload(response);
return (PushPayload)commonResponse.getDataList();
// if (JPushTypeEnum.ALL.getCode().equals(response.getType())) {
// return PushPayload.newBuilder()
// .setPlatform(Platform.android())
// .setAudience(Audience.all())
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// } else if (JPushTypeEnum.TAG.getCode().equals(response.getType())) {
// return PushPayload.newBuilder()
// .setPlatform(Platform.android())
// .setAudience(Audience.tag(response.getRecivers()))
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// } else {
// return PushPayload.newBuilder()
// .setPlatform(Platform.android())
// .setAudience(Audience.alias(response.getRecivers()))
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// }
}
public void sendMessage(PushMsgParam 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);
}
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.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import com.google.common.base.Joiner;
import com.yeejoin.amos.fas.business.dao.mapper.AccidentTypeMapper;
import com.yeejoin.amos.fas.business.dao.repository.IAccidentTypeDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IAccidentTypeService;
import com.yeejoin.amos.fas.dao.entity.AccidentType;
import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
@Service("accidentTypeService")
public class AccidentTypeServiceImpl implements IAccidentTypeService {
......@@ -27,7 +34,8 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
IAccidentTypeDao iAccidentTypeDao;
@Autowired
IRiskFactorDao iRiskFactorDao;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Override
public void detAccidentType(Long[] param) {
//1.校验
......@@ -56,8 +64,8 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
String userId = map.get("user_id")== null ? "0":map.get("user_id").toString();
String deptId = map.get("dept_id")== null ? "0":map.get("dept_id").toString();
param.setOrgCode(orgCode);
param.setDeptId(Long.parseLong(deptId));
param.setCreateBy(Long.parseLong(userId));
param.setDeptId(deptId);
param.setCreateBy(userId);
param.setCreateDate(new Date());
iAccidentTypeDao.save(param);
}
......@@ -69,9 +77,38 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
}
@Override
public Page<HashMap<String, Object>> queryAccidentTypePage(CommonPageInfoParam param) {
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;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
......@@ -10,6 +41,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.ImgParam;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import com.yeejoin.amos.fas.business.vo.EquipCommunicationData;
......@@ -22,29 +54,10 @@ import com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.PreplanPicture;
import com.yeejoin.amos.fas.exception.YeeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.PostConstruct;
import java.io.File;
import java.io.IOException;
import java.util.*;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
@Service("equipService")
public class EquipmentServiceImpl implements IEquipmentService {
......@@ -89,6 +102,9 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Value("${linux.img.path}")
private String linuxImgPath;
@Autowired
private RemoteSecurityService remoteSecurityService;
public Equipment save(Equipment equipment) {
Long eqId = equipment.getId();
equipment = iEquipmentDao.saveAndFlush(equipment);
......@@ -243,7 +259,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
pp.setEquipmentId(equipmentId);
pp.setType(type);
pp.setCreateDate(new Date());
pp.setCreateBy(userId.intValue());
pp.setCreateBy(userId.intValue()+"");
}
String path = FasConstant.UPLOAD_ROOT_PATH + File.separator + FasConstant.UPLOAD_EQUIPMENT_PATH + File.separator
......@@ -267,7 +283,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
throw new YeeException("上传图片失败");
}
String picture = path + fileName;
pp.setCreateBy(userId.intValue());
pp.setCreateBy(userId.intValue()+"");
pp.setPicture(picture);
if (equipment.getCreateDate() == null) {
Optional<Equipment> date=iEquipmentDao.findById(equipment.getId());
......@@ -398,8 +414,24 @@ public class EquipmentServiceImpl implements IEquipmentService {
}
@Override
public EquipDetailsResponse findEquipDetailsById(Long id) {
return fireEquipMapper.findEquipDetailsById(id);
public EquipDetailsResponse findEquipDetailsById(String toke,String product,String appKey,Long id) {
EquipDetailsResponse equipDetailsResponse = fireEquipMapper.findEquipDetailsById(id);
AgencyUserModel user = remoteSecurityService.getUserById(toke, product, appKey, equipDetailsResponse.getUserId());
equipDetailsResponse.setUsername(user.getRealName());
equipDetailsResponse.setTel(user.getMobile());
if(user.getCompanys().get(0)!=null)
{
CompanyModel companyModel = user.getCompanys().get(0);
if(user.getCompanyDepartments().get(companyModel.getSequenceNbr())!=null)
{
List<DepartmentModel> departList = user.getCompanyDepartments().get(companyModel.getSequenceNbr());
if(!departList.isEmpty())
{
equipDetailsResponse.setDepName(departList.get(0).getDepartmentName());
}
}
}
return equipDetailsResponse;
}
......
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.collect.Lists;
import com.yeejoin.amos.fas.business.constants.FasConstant;
......@@ -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.dao.entity.FireCar;
import com.yeejoin.amos.fas.exception.YeeException;
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 java.io.File;
import java.io.IOException;
import java.util.*;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
@Service("fireCarService")
......@@ -109,8 +117,10 @@ public class FireCarServiceImpl implements IFireCarService {
}
@Override
public FireCarDetailVo findFireCarById(Long truckId) {
public FireCarDetailVo findFireCarById(String toke,String product,String appKey,Long truckId) {
FireCarDetailVo carVo = fireCarMapper.getFireCarDetailById(truckId);
DepartmentModel departmentModel= remoteSecurityService.getDepartmentByDeptId(toke, product, appKey, carVo.getDeptId());
carVo.setDepartmentName(departmentModel.getDepartmentName());
return carVo;
}
......
......@@ -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.CommonResponseUtil;
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 org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired;
......
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.FmeaMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper;
......@@ -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.RiskLevel;
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.data.domain.Page;
import org.springframework.data.domain.PageImpl;
......@@ -82,6 +87,71 @@ public class FmeaServiceImpl implements IFmeaService {
public Page<HashMap<String, Object>> queryFmeaList(CommonPageInfoParam param) {
long total = fmeaMapper.countPageData(param);
List<HashMap<String, Object>> content = fmeaMapper.queryFmeaPage(param);
StringBuffer sb = new StringBuffer();
for(HashMap<String, Object> map : content)
{
//String[] ids = sb.toString().split(",");
//String companyLeaderId = String.valueOf(map.get("companyLeaderId"));
sb.append(map.get("companyLeaderId"));
sb.append(map.get(","));
//String departmentLeaderId = String.valueOf(map.get("departmentLeaderId"));
sb.append(map.get("departmentLeaderId"));
sb.append(map.get(","));
//String groupLeaderId = String.valueOf(map.get("groupLeaderId"));
sb.append(map.get("groupLeaderId"));
sb.append(map.get(","));
//String personLeaderId = String.valueOf(map.get("personLeaderId"));
sb.append(map.get("personLeaderId"));
sb.append(map.get(","));
//String identifyUserId = String.valueOf(map.get("identifyUserId"));
sb.append(map.get("identifyUserId"));
sb.append(map.get(","));
}
sb.deleteCharAt(sb.length()-1);
FeignClientResult<List<AgencyUserModel>> resultSec = Privilege.agencyUserClient.queryByIds(sb.toString());
for(HashMap<String, Object> map : content)
{
String companyLeaderId = String.valueOf(map.get("companyLeaderId"));
String departmentLeaderId = String.valueOf(map.get("departmentLeaderId"));
String groupLeaderId = String.valueOf(map.get("groupLeaderId"));
String personLeaderId = String.valueOf(map.get("personLeaderId"));
String identifyUserId = String.valueOf(map.get("identifyUserId"));
for(AgencyUserModel user : resultSec.getResult())
{
if(companyLeaderId!=null&& companyLeaderId.equals(user.getUserId()))
{
map.put("companyLeaderName", user.getRealName());
}
if(departmentLeaderId!=null&& departmentLeaderId.equals(user.getUserId()))
{
map.put("departmentLeaderName", user.getRealName());
}
if(groupLeaderId!=null&& groupLeaderId.equals(user.getUserId()))
{
map.put("groupLeaderName", user.getRealName());
}
if(personLeaderId!=null&& personLeaderId.equals(user.getUserId()))
{
map.put("personLeaderName", user.getRealName());
}
if(identifyUserId!=null&& identifyUserId.equals(user.getUserId()))
{
map.put("identifyUserName", user.getRealName());
}
}
}
Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total);
return result;
}
......
package com.yeejoin.amos.fas.business.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import com.google.common.base.Joiner;
import com.yeejoin.amos.fas.business.dao.mapper.RiskFactorMapper;
import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
import com.yeejoin.amos.fas.business.dao.repository.IFmeaDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IRiskFactorService;
import com.yeejoin.amos.fas.dao.entity.Fmea;
import com.yeejoin.amos.fas.dao.entity.RiskFactor;
import com.yeejoin.amos.fas.exception.YeeException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
@Service("riskFactorService")
public class RiskFactorServiceImpl implements IRiskFactorService {
......@@ -33,11 +40,41 @@ public class RiskFactorServiceImpl implements IRiskFactorService {
RiskSourceMapper riskSourceMapper;
@Autowired
IRiskLevelDao iRiskLevelDao;
@Autowired
private RemoteSecurityService remoteSecurityService;
@Override
public Page<HashMap<String, Object>> queryRiskFactorPage(CommonPageInfoParam param) {
public Page<HashMap<String, Object>> queryRiskFactorPage(String toke,String product,String appKey,CommonPageInfoParam param) {
long total = riskFactorMapper.countPageData(param);
List<HashMap<String, Object>> content = riskFactorMapper.queryRiskFactorPage(param);
List<String> userIdList = new ArrayList<String>();
List<String> deptIdList = new ArrayList<String>();
for(HashMap<String, Object> map : content)
{
String userId = String.valueOf(map.get("createBy"));
String deptId = String.valueOf(map.get("deptId"));
if(userId!=null&&!userIdList.contains(userId))
{
userIdList.add(userId);
}
if(deptId!=null&&!deptIdList.contains(deptId))
{
deptIdList.add(deptId);
}
}
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
Map<String, String> userMap = new HashMap<String,String>();
for (int i = 0; i < users.size(); i++) {
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
}
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
Map<String, String> deptMap = new HashMap<String,String>();
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
content.forEach(e -> {
e.put("userName",userMap.get(e.get("createBy")));
e.put("deptName",deptMap.get(e.get("deptId")));
});
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result;
}
......@@ -54,8 +91,8 @@ public class RiskFactorServiceImpl implements IRiskFactorService {
String userId = map.get("user_id") == null ? "0" : map.get("user_id").toString();
String deptId = map.get("dept_id") == null ? "0" : map.get("dept_id").toString();
param.setOrgCode(orgCode);
param.setDeptId(Long.parseLong(deptId));
param.setCreateBy(Integer.parseInt(userId));
param.setDeptId(deptId);
param.setCreateBy(userId);
param.setCreateDate(new Date());
......
package com.yeejoin.amos.fas.business.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
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.data.domain.Page;
import org.springframework.data.domain.PageImpl;
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.repository.IRiskLevelDao;
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.service.intfc.IRiskLevelService;
import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
@Service("riskLevelService")
public class RiskLevelServiceImpl implements IRiskLevelService {
@Autowired
......@@ -26,22 +39,43 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
IRiskLevelDao iRiskLevelDao;
@Autowired
IRiskSourceDao iRiskSourceDao;
@Autowired
private RemoteSecurityService remoteSecurityService;
@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);
List<HashMap<String, Object>> content = riskLevelMapper.queryRiskLevelPage(param);
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total);
return result;
Set<String> userIdList = new HashSet<String>();
for(HashMap<String, Object> map : content)
{
userIdList.add(String.valueOf(map.get("createBy")));
}
Map<String, String> userMap = new HashMap<String,String>();
if(userIdList.size()>0)
{
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
for (int i = 0; i < users.size(); i++) {
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
}
}
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
public void editRiskLevel(HashMap<String, Object> map) {
RiskLevel param = (RiskLevel) 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();
param.setOrgCode(orgCode);
param.setCreateBy(Long.parseLong(userId));
param.setCreateBy(userId);
param.setCreateDate(new Date());
iRiskLevelDao.save(param);
}
......@@ -54,7 +88,6 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
}
//2.删除
iRiskLevelDao.deleteAllByIds(param);
}
/**
......@@ -87,3 +120,4 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
}
}
package com.yeejoin.amos.fas.business.service.impl;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.fas.business.bo.BindRegionBo;
import com.yeejoin.amos.fas.business.bo.RpnCalculationBo;
import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.*;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper;
import com.yeejoin.amos.fas.business.dao.mongo.EquipCommunicationDao;
import com.yeejoin.amos.fas.business.dao.repository.*;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IDictDao;
import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentPointDao;
import com.yeejoin.amos.fas.business.dao.repository.IFmeaDao;
import com.yeejoin.amos.fas.business.dao.repository.IPPointDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao;
import com.yeejoin.amos.fas.business.dao.repository.IRpnChangeLogDao;
import com.yeejoin.amos.fas.business.feign.RemoteRuleServer;
import com.yeejoin.amos.fas.business.feign.RemoteSecurityService;
import com.yeejoin.amos.fas.business.feign.RemoteWebSocketServer;
......@@ -24,7 +82,12 @@ import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import com.yeejoin.amos.fas.business.service.intfc.IEquipmentService;
import com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService;
import com.yeejoin.amos.fas.business.service.model.*;
import com.yeejoin.amos.fas.business.service.model.CheckInputItemRo;
import com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus;
import com.yeejoin.amos.fas.business.service.model.ContingencyRo;
import com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.service.model.ProtalDataRo;
import com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo;
import com.yeejoin.amos.fas.business.util.DateUtils;
import com.yeejoin.amos.fas.business.util.JexlUtil;
import com.yeejoin.amos.fas.business.util.RpnUtils;
......@@ -34,31 +97,24 @@ import com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import com.yeejoin.amos.fas.dao.entity.*;
import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import com.yeejoin.amos.fas.dao.entity.Dict;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.EvaluationModel;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentData;
import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
import com.yeejoin.amos.fas.dao.entity.Fmea;
import com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint;
import com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem;
import com.yeejoin.amos.fas.dao.entity.PPoint;
import com.yeejoin.amos.fas.dao.entity.PreplanPicture;
import com.yeejoin.amos.fas.dao.entity.RiskLevel;
import com.yeejoin.amos.fas.dao.entity.RiskSource;
import com.yeejoin.amos.fas.dao.entity.RpnChangeLog;
import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.cache.Redis;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.Collectors;
@Service("riskSourceService")
......@@ -174,7 +230,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
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();
riskSource.setOrgCode(orgCode);
riskSource.setCreateBy(Integer.parseInt(userId));
riskSource.setCreateBy(userId);
Optional<RiskSource> oldRiskSource1 = iRiskSourceDao.findById(id);
RiskSource oldRiskSource = null;
if (oldRiskSource1.isPresent()) {
......@@ -519,13 +575,51 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
@Override
public Page<Map<String, Object>> listFmeaPointInputitem(Long fmeaId, Integer pageNumber, Integer pageSize) {
public Page<Map<String, Object>> listFmeaPointInputitem(String toke,String product,String appKey,Long fmeaId, Integer pageNumber, Integer pageSize) {
List<Map<String, Object>> content = Lists.newArrayList();
long total = fmeaPointInputitemMapper.countByFmeaId(fmeaId);
if (total == 0L) {
return new PageImpl<>(content, null, total);
}
content = fmeaPointInputitemMapper.listByFmeaId(fmeaId, pageNumber, pageSize);
List<String> userIdList = new ArrayList<String>();
List<String> deptIdList = new ArrayList<String>();
for(Map<String, Object> map : content)
{
String userId = String.valueOf(map.get("userId"));
String deptId = String.valueOf(map.get("deptId"));
if(userId!=null&&!userIdList.contains(userId))
{
userIdList.add(userId);
}
if(deptId!=null&&!deptIdList.contains(deptId))
{
deptIdList.add(deptId);
}
}
Map<String, String> userMap = new HashMap<String,String>();
Map<String, String> deptMap = new HashMap<String,String>();
if(userIdList.size()>0)
{
List<AgencyUserModel> users =remoteSecurityService.listUserByUserIds(toke, product, appKey, Joiner.on(",").join(userIdList));
for (int i = 0; i < users.size(); i++) {
userMap.put(users.get(i).getUserId(), users.get(i).getUserName());
}
}
if(deptIdList.size()>0)
{
List<LinkedHashMap> depts =remoteSecurityService.listDepartmentByDeptIds(toke, product, appKey, Joiner.on(",").join(deptIdList));
for (int i = 0; i < depts.size(); i++) {
deptMap.put(depts.get(i).get("sequenceNbr").toString(), depts.get(i).get("departmentName").toString());
}
}
content.forEach(e -> {
e.put("username",userMap.get(String.valueOf(e.get("userId"))));
e.put("depName",deptMap.get(String.valueOf(e.get("deptId"))));
e.put("tel",userMap.get(String.valueOf(e.get("deptId")+"tel")));
});
return new PageImpl<>(content, null, total);
}
......
......@@ -2,12 +2,10 @@ package com.yeejoin.amos.fas.business.service.intfc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.dao.entity.AccidentType;
public interface IAccidentTypeService {
......@@ -15,8 +13,9 @@ public interface IAccidentTypeService {
void editAccidentType(HashMap<String, Object> map);
List<HashMap<String,Object>> queryAccidentType(String orgCode);
List<HashMap<String, Object>> queryAccidentType(String orgCode);
Page<HashMap<String, Object>> queryAccidentTypePage(CommonPageInfoParam param);
Page<HashMap<String, Object>> queryAccidentTypePage(String toke, String product, String appKey,
CommonPageInfoParam param);
}
......@@ -88,7 +88,7 @@ public interface IEquipmentService {
*/
List<Map<String, Object>> findEquipVideoList();
EquipDetailsResponse findEquipDetailsById(Long id);
EquipDetailsResponse findEquipDetailsById(String toke,String product,String appKey,Long id);
/**
* 获取所有重点装备
......
......@@ -13,13 +13,10 @@ public interface IFireCarService {
Page<HashMap<String, Object>> queryFireCar(String toke,String product,String appKey,CommonPageInfoParam param);
FireCarDetailVo findFireCarById(Long id);
FireCarDetailVo findFireCarById(String toke,String product,String appKey,Long id);
FireCar save(FireCar fireCar);
FireCar queryOne(Long id);
String [] delete(String []idArray) throws Exception;
......
......@@ -14,7 +14,7 @@ public interface IRiskFactorService {
* @param param
* @return
*/
Page<HashMap<String, Object>> queryRiskFactorPage(CommonPageInfoParam param);
Page<HashMap<String, Object>> queryRiskFactorPage(String toke,String product,String appKey,CommonPageInfoParam param);
/**
* 危险因素查询不分页
*/
......
......@@ -10,7 +10,7 @@ import com.yeejoin.amos.fas.dao.entity.RiskLevel;
public interface IRiskLevelService {
Page<HashMap<String, Object>> queryRiskLevelPage(CommonPageInfoParam param);
Page<HashMap<String, Object>> queryRiskLevelPage(String toke,String product,String appKey,CommonPageInfoParam param);
void editRiskLevel(HashMap<String, Object> map);
......
......@@ -64,7 +64,7 @@ public interface IRiskSourceService {
List<Map<String, Object>> listEquipmentPointById(Long fmeaId, Long importantEquipId, Long equipmentId, String equipmentPointName);
Page<Map<String, Object>> listFmeaPointInputitem(Long fmeaId, Integer pageNumber, Integer pageSize);
Page<Map<String, Object>> listFmeaPointInputitem(String toke,String product,String appKey,Long fmeaId, Integer pageNumber, Integer pageSize);
Page<Map<String, Object>> listFeamEquipmentPoint(Long fmeaId, Integer pageNumber, Integer pageSize);
......
spring.application.name = AMOS-FIREAUTOSYS-SUHG
spring.application.name = AMOS-AUTOSYS-XKQ1
server.port = 8083
......@@ -44,6 +44,8 @@ spring.http.multipart.MaxRequestSize = 50480000
windows.img.path = D:\\
linux.img.path = /
Push.fegin.name=PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name=AMOSDUTYMODE
param.safetyIndexChange.cron = 0 0 2 * * ?
......
......@@ -11,8 +11,8 @@ CREATE TABLE `f_accident_type` (
`evaluation_sid` bigint(32) DEFAULT NULL COMMENT 'evaluation_model 中 type 为s 的id',
`influence` varchar(255) DEFAULT NULL COMMENT '失效/事故影响',
`severity` varchar(255) DEFAULT NULL COMMENT '严重度',
`dept_id` int(11) DEFAULT '0' COMMENT '维护部门',
`create_by` int(11) DEFAULT '0' COMMENT '维护人员',
`dept_id` varchar(255) DEFAULT '0' COMMENT '维护部门',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
......@@ -67,8 +67,8 @@ CREATE TABLE `f_equipment` (
`building` varchar(255) DEFAULT NULL COMMENT '建筑物',
`room` varchar(255) DEFAULT NULL COMMENT '房间号',
`address` varchar(255) DEFAULT NULL COMMENT '位置',
`charge_dept_id` int(11) DEFAULT '0' COMMENT '责任部门',
`charge_user_id` int(1) DEFAULT '0' COMMENT '责任人',
`charge_dept_id` varchar(255) DEFAULT '0' COMMENT '责任部门',
`charge_user_id` varchar(255) DEFAULT '0' COMMENT '责任人',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`create_by` varchar(255) DEFAULT '0' COMMENT '创建者',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
......@@ -102,7 +102,7 @@ CREATE TABLE `f_evaluation_model` (
`name` varchar(100) DEFAULT NULL COMMENT '模型名称',
`standard` text COMMENT '模型内容',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`create_by` int(11) DEFAULT '0' COMMENT '创建者',
`create_by` varchar(255) DEFAULT '0' COMMENT '创建者',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`coefficient` varchar(50) DEFAULT NULL COMMENT '系数',
`influence` varchar(500) DEFAULT NULL COMMENT '影响',
......@@ -240,7 +240,7 @@ CREATE TABLE `f_fire_station` (
`position3d` varchar(100) DEFAULT NULL COMMENT '3维坐标',
`is_indoor` bit(1) DEFAULT b'1' COMMENT '是否室内点:默认是',
`org_code` varchar(50) DEFAULT NULL COMMENT '组织',
`create_by` bigint(20) DEFAULT '0' COMMENT '维护人员',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`picture` varchar(1000) DEFAULT NULL COMMENT '图片',
`risk_source_id` bigint(20) DEFAULT '0' COMMENT '风险区域id',
......@@ -256,7 +256,7 @@ CREATE TABLE `f_fire_station_equipment` (
`fire_station_id` bigint(20) NOT NULL COMMENT '消防站id',
`fire_equipment_id` bigint(20) NOT NULL COMMENT '消防物资id',
`number` double DEFAULT NULL COMMENT '个数',
`create_by` bigint(20) DEFAULT '0' COMMENT '维护人员',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`unit` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
......@@ -276,7 +276,7 @@ CREATE TABLE `f_fire_strength` (
`job_des` varchar(500) DEFAULT NULL COMMENT '工作描述',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`org_code` varchar(255) DEFAULT NULL COMMENT '组织',
`create_by` bigint(20) DEFAULT '0' COMMENT '维护人员',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`day_end` time DEFAULT NULL COMMENT '结束时间',
`day_begin` time DEFAULT NULL COMMENT '开始时间',
......@@ -307,7 +307,7 @@ CREATE TABLE `f_fmea` (
`department_leader` varchar(255) DEFAULT NULL COMMENT '部门负责人',
`group_leader` varchar(255) DEFAULT NULL COMMENT '班组负责人',
`person_leader` varchar(255) DEFAULT NULL COMMENT '个人负责人',
`identify_user` int(11) DEFAULT NULL COMMENT '辨识人',
`identify_user` varchar(255) DEFAULT NULL COMMENT '辨识人',
`identify_method` varchar(255) DEFAULT NULL COMMENT '辨识方法',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`create_by` varchar(255) DEFAULT '0' COMMENT '创建者',
......@@ -353,7 +353,7 @@ CREATE TABLE `f_preplan_picture` (
`name` varchar(255) DEFAULT NULL COMMENT '装备名称',
`picture` text COMMENT '图片路径地址',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`create_by` int(11) DEFAULT '0' COMMENT '创建者',
`create_by` varchar(255) DEFAULT '0' COMMENT '创建者',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=161 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='重点设备预案图';
......@@ -368,8 +368,8 @@ CREATE TABLE `f_risk_factor` (
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`accident_type_id` bigint(20) NOT NULL COMMENT '失效/事故影响',
`type` varchar(255) DEFAULT NULL COMMENT '分类',
`dept_id` int(11) DEFAULT '0' COMMENT '维护部门',
`create_by` int(11) DEFAULT '0' COMMENT '维护人员',
`dept_id` varchar(255) DEFAULT '0' COMMENT '维护部门',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
......@@ -387,7 +387,7 @@ CREATE TABLE `f_risk_level` (
`severity` varchar(255) DEFAULT NULL COMMENT '严重度',
`name` varchar(255) DEFAULT NULL COMMENT '结果描述',
`color` varchar(255) DEFAULT NULL COMMENT '图标颜色',
`create_by` int(11) DEFAULT '0' COMMENT '维护人员',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`top_limit` decimal(10,2) DEFAULT NULL COMMENT '上限',
......@@ -411,7 +411,7 @@ CREATE TABLE `f_risk_source` (
`risk_level_id` bigint(20) DEFAULT '0' COMMENT '风险等级id',
`rpn` decimal(10,2) DEFAULT NULL COMMENT '实时rpn',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`create_by` int(11) DEFAULT '0' COMMENT '创建者',
`create_by` varchar(255) DEFAULT '0' COMMENT '创建者',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`is_region` varchar(16) DEFAULT NULL,
`status` varchar(16) DEFAULT NULL COMMENT '状态(正常NORMAL,异常ANOMALY)',
......@@ -563,7 +563,7 @@ CREATE TABLE `f_water_resource` (
`address` varchar(255) DEFAULT NULL COMMENT '位置',
`position3d` varchar(100) DEFAULT NULL COMMENT '3维坐标',
`org_code` varchar(50) DEFAULT NULL COMMENT '组织',
`create_by` bigint(20) DEFAULT '0' COMMENT '维护人员',
`create_by` varchar(255) DEFAULT '0' COMMENT '维护人员',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '维护时间',
`is_indoor` bit(1) DEFAULT b'1' COMMENT '是否室内点:默认是',
`risk_source_id` bigint(20) DEFAULT '0' COMMENT '风险区域id',
......
......@@ -8,8 +8,6 @@
count(1) AS total_num
FROM
f_accident_type a
left join s_user b on a.create_by = b.id
left join s_department c on a.dept_id = c.id
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if>
</trim>
......@@ -21,15 +19,12 @@
a.name,
a.influence,
a.severity,
c.id as deptId ,
c.department_name as deptName,
b.name as userName ,
a.dept_id as deptId ,
a.create_by as createBy ,
a.create_date as createDate,
a.remark
FROM
f_accident_type a
left join s_user b on a.create_by = b.id
left join s_department c on a.dept_id = c.id
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if>
</trim>
......@@ -46,17 +41,14 @@
a.name,
CONCAT(fem.influence,'-',fem.`describe`) as influence,
fem.coefficient as severity,
c.id as deptId ,
c.department_name as deptName,
b.name as userName ,
a.dept_id as deptId ,
a.create_by as createBy ,
a.create_date as createDate,
a.evaluation_sid as evaluationSid,
a.remark
FROM
f_accident_type a
left join f_evaluation_model fem on fem.id = a.evaluation_sid
left join s_user b on a.create_by = b.id
left join s_department c on a.dept_id = c.id
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%") </if>
</trim>
......
......@@ -27,7 +27,6 @@
a.remark,
a.create_by createBy,
date_format(a.create_date , '%Y-%m-%d %H:%i:%s') as createDate,
d.department_name AS departmentName,
a.performance_index AS performanceIndex,
a.floor3d,
a.org_code AS orgCode,
......@@ -36,7 +35,6 @@
rs.name riskSourceName
FROM
f_fire_car a
LEFT JOIN s_department d ON d.id = a.dept_id
LEFT JOIN f_risk_source rs on rs.id = a.risk_source_id
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and (a.name like concat(concat("%",#{name}),"%") or a.type like concat(concat("%",#{name}),"%"))</if>
......@@ -65,7 +63,6 @@
a.create_date,
'%Y-%m-%d %H:%i:%s'
) AS createDate,
d.department_name AS departmentName,
a.performance_index AS performanceIndex,
a.floor3d,
a.is_indoor as isIndoor,
......@@ -75,7 +72,6 @@
a.risk_source_id as riskSourceId
FROM
f_fire_car a
LEFT JOIN s_department d ON d.id = a.dept_id
WHERE 1=1
<if test="truckId!=null"> AND a.id = #{truckId}</if>
</select>
......
......@@ -297,13 +297,9 @@
eq.`code`,
eq.address,
fs.`name` stationName,
sd.department_name depName,
su.`name` username,
su.telephone tel
eq.charge_user_id userId
FROM
f_equipment eq
LEFT JOIN s_user su ON su.id = eq.charge_user_id
LEFT JOIN s_department sd ON sd.id = su.department_id
LEFT JOIN f_fire_station fs ON fs.id = eq.fire_station_id
WHERE 1=1
<if test="id!=null">AND eq.id = #{id}</if>
......
......@@ -45,16 +45,16 @@
fm.department_leader as departmentLeader,
fm.group_leader as groupLeader,
fm.person_leader as personLeader,
(select name from s_user where id = fm.company_leader) as companyLeaderName,
(select name from s_user where id = fm.department_leader) as departmentLeaderName,
(select name from s_user where id = fm.group_leader) as groupLeaderName,
(select name from s_user where id = fm.person_leader) as personLeaderName,
fm.company_leader as companyLeaderId,
fm.department_leader as departmentLeaderId,
fm.group_leader as groupLeaderId,
fm.person_leader as personLeaderId,
fm.identify_user as identifyUserId,
rf.`name` AS riskFactorName,
fat.`name` AS accidentTypeName,
fat.id AS accidentTypeId,
concat(fems.influence,'-',fems.describe) as influence,
fm.identify_user as identifyUser,
(select name from s_user where id = fm.identify_user) as identifyUserName,
fm.identify_method as identifyMethod,
fr.name AS level
FROM
......
......@@ -54,10 +54,6 @@
p_input_item as pii on pii.id = b.input_item_id
left join
p_point as pp on pp.id = b.point_id
left join
s_user as su on su.id = pp.charge_person_id
left join
s_department as sd on sd.id = pp.charge_dept_id
where
a.fmea_id = #{fmeaId}
group by b.point_id
......@@ -74,9 +70,8 @@
pp.id as pointId,
pp.point_no as pointNo,
pp.name as pointName,
sd.department_name as depName,
su.name as username,
su.telephone as tel,
pp.charge_person_id as userId,
pp.charge_dept_id as deptId,
group_concat(concat(pii.name, '##', a.state) SEPARATOR <![CDATA[ '\n' ]]>) as inputItems
from
f_fmea_point_inputitem a
......@@ -86,10 +81,6 @@
p_input_item as pii on pii.id = b.input_item_id
left join
p_point as pp on pp.id = b.point_id
left join
s_user as su on su.id = pp.charge_person_id
left join
s_department as sd on sd.id = pp.charge_dept_id
where
a.fmea_id = #{fmeaId}
group by b.point_id
......
......@@ -21,14 +21,11 @@
d.name as accidentName,
a.type,
a.dept_id as deptId,
c.department_name as deptName,
b.name as userName,
a.create_by as createBy,
a.create_date as createDate,
a.remark
FROM
f_risk_factor a
left join s_user b on a.create_by = b.id
left join s_department c on a.dept_id = c.id
left join f_accident_type d on a.accident_type_id = d.id
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if>
......
......@@ -23,12 +23,12 @@
a.severity,
a.name,
a.color,
b.name as userName ,
a.create_by as createBy,
a.create_date as createDate,
a.remark
a.remark,
a.manage_level as manageLevel
FROM
f_risk_level a
left join s_user b on a.create_by = b.id
<trim prefix="WHERE" prefixOverrides="AND ">
<if test="evalModelId!=null"> and a.evaluation_model_id = #{evalModelId} </if>
</trim>
......
......@@ -331,16 +331,13 @@
pp.id pointId,
pp.point_no pointNo,
pp.`name` pointName,
sd.department_name depName,
su.`name` username,
su.telephone tel,
pp.charge_person_id userId,
pp.charge_dept_id deptId,
GROUP_CONCAT(pii.`name`) inputItems
FROM
`f_risk_source_point_inputitem` rspi
LEFT JOIN p_point pp ON pp.id = rspi.point_id
LEFT JOIN p_input_item pii ON pii.id = rspi.point_inputitem_id
LEFT JOIN s_user su ON su.id = pp.charge_person_id
LEFT JOIN s_department sd ON sd.id = pp.charge_dept_id
WHERE pii.`name` is not NULL
AND rspi.risk_source_id = #{riskSourceId}
GROUP BY riskId,pointId,pointNo,pointName,depName,username,telephone
......
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