Commit 9d09c034 authored by maoying's avatar maoying

合并devev_upgrade分支代码

parents 0d1cb7cd af3c82a5
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(description = "消防整改 消防要求实体类")
public class FireInfoBo {
/**
* 风险类型
*/
private String type;
/**
* 实际完成数量
*/
private int realNum;
/**
* 阈值
*/
private int threshold;
public FireInfoBo(int realNum, int threshold) {
this.realNum = realNum;
this.threshold = threshold;
}
public FireInfoBo() {
}
}
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(description = "消防整改 整改数据实体")
public class FireMoreDataBo {
/**
* req 主键
*/
private String req;
/**
* 类型或登记
*/
private String lvl;
/**
* 设备名称
*/
private String name;
/**
* 描述
*/
private String persent;
/**
* 影响
*/
private String affect;
/**
* 处理结果
*/
private String doneResult;
/**
* 反馈
*/
private String backResult;
/**
* 反馈
*/
private String filePath;
}
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(description = "消防整改 单据修改实体类")
public class FireParamBo {
private List<FireMoreDataBo> warnningData;
private List<FireMoreDataBo> hiddenData;
private List<FireMoreDataBo> dangerData;
private String backResult;
private String refResult;
private String billNo;
}
package com.yeejoin.amos.fas.business.bo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel(description = "消防整改数据展示实体")
public class FireRectificationBo {
/**
* 登记单号
*/
private String billno;
/**
* 站编号
*/
private String stationNum;
/**
* 站名称
*/
private String stationName;
/**
* 需处理告警
*/
private Integer warnning;
/**
* 需关注风险
*/
private Integer danger;
/**
* 需处理隐患
*/
private Integer hiddenTrouble;
/**
* 需加强消防管理
*/
private Integer adminOfFire;
/**
* 安全负责人
*/
private String chargePerson;
/**
* 联系人电话
*/
private String chargePersonTel;
/**
* 治理完成日期
*/
private String completionDate;
/**
* 实际完成日期
*/
private String reCompletionDate;
/**
* 状态
*/
private String status;
/**
* 状态code
*/
private String statuscode;
/**
* 整改下发人员
*/
private String disUser;
/**
* 整改下发登记日期
*/
private String disDate;
/**
* 环流站复制人员
*/
private String stationUser;
/**
* 整改下发人员联系电话
*/
private String stationUserTel;
/**
* 安全负责人
*/
private String safeUser;
/**
* 安全负责人电话
*/
private String safeUserTel;
/**
* 要求完成日
*/
private String reqDate;
/**
* 实际完成日
*/
private String finishDate;
/**
* 整改结果
*/
private String refResult;
/**
* 意见及建议
*/
private String viewsAndSuggestions;
/**
* 反馈结果
*/
private String backResult;
}
......@@ -32,7 +32,7 @@ public class AlarmController extends BaseController {
/**
* 风险等级分页查询
*
* @param id
* @param queryRequests
* @return
*/
@Permission
......
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.bo.FireParamBo;
import com.yeejoin.amos.fas.business.service.intfc.FireRectificationService;
import com.yeejoin.amos.fas.config.Permission;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 安全执行-消防整改 控制器
*
* @author 郑嘉伟
*/
@RestController
@RequestMapping(value = "/api/fireRectification")
@Api(tags = "消防整改")
public class FireRectificationController extends BaseController {
@Autowired
private FireRectificationService fireRectificationService;
@Permission
@ApiOperation(httpMethod = "GET", value = "按条件查询消防整改列表信息", notes = "按条件查询消防整改列表信息")
@GetMapping(value = "/list")
public CommonResponse queryFireList(
@RequestParam(value = "nameLike") String nameLike,
@RequestParam(value = "sDate") String sDate,
@RequestParam(value = "eDate") String eDate,
@RequestParam(value = "states") int states,
@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize) {
return CommonResponseUtil.success(fireRectificationService.queryFiresAndCount(nameLike,sDate,eDate,states,pageNum,pageSize));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "获取单个单据详细数据", notes = "获取单个单据详细数据")
@GetMapping(value = "/getMoreData")
public CommonResponse seleteOne(@RequestParam(value = "billNo") String billNo){
return CommonResponseUtil.success(fireRectificationService.selectOneById(billNo));
}
@Permission
@ApiOperation(httpMethod = "POST", value = "下载附件", notes = "下载附件")
@PostMapping(value = "/downLoad")
public void downLoad(@RequestBody List<String> path, HttpServletResponse response){
fireRectificationService.downLoadFilesByUrll(path.get(0),response);
}
@Permission
@ApiOperation(httpMethod = "POST", value = "修改表单数据", notes = "修改表单数据")
@PostMapping(value = "/update")
public CommonResponse update(@RequestBody FireParamBo paramBo){
return CommonResponseUtil.success(fireRectificationService.updateByid(paramBo));
}
}
......@@ -9,6 +9,10 @@ public interface AlarmMapper extends BaseMapper {
long countPageData(CommonPageInfoParam param);
long countAlarmData();
List<HashMap<String, Object>> getAlarmMapperPage(CommonPageInfoParam param);
List<HashMap<String, Object>> getAlarmSingleMapperPage(CommonPageInfoParam param);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.yeejoin.amos.fas.business.bo.FireInfoBo;
import com.yeejoin.amos.fas.business.bo.FireMoreDataBo;
import com.yeejoin.amos.fas.business.bo.FireRectificationBo;
import java.util.List;
import java.util.Map;
public interface FireRectificationMapper extends BaseMapper{
/**
* 查询当前页数据和数量
* @param param
* @return
*/
List<FireRectificationBo> queryFiresAndCount(Map<String,Object> param);
long countQueryFireList(Map<String,Object> param);
/**
* 查询详细信息
* @param billNo
* @return
*/
FireRectificationBo selectOneForBase(String billNo);
List<FireMoreDataBo> selectOneForEmergency(String billNo);
List<FireMoreDataBo> selectOneForDanger(String billNo);
List<FireMoreDataBo> selectOneForHidden (String billNo);
FireInfoBo selectOneForfire(String billNo, int id);
/**
* 修改单据及其相关信息
* @param param
* @return
*/
int updateBill(Map<String,String > param);
int updateWarnning(FireMoreDataBo param);
int updateHidden(FireMoreDataBo param);
int updateDanger(FireMoreDataBo param);
}
/*package com.yeejoin.amos.fas.business.feign;
import com.yeejoin.amos.op.core.common.response.CommonResponse;
public class AMOSSecurityFallback implements IAMOSSecurityServer{
@Override
public CommonResponse queryAllUserByCompany(String companyId, String roleType) {
CommonResponse res = new CommonResponse();
res.setResult("FAILED");
return res;
}
@Override
public CommonResponse queryDeptUserTree(String companyId, String roleType) {
CommonResponse res = new CommonResponse();
res.setResult("FAILED");
return res;
}
@Override
public CommonResponse queryDeptUser(String deptId) {
CommonResponse res = new CommonResponse();
res.setResult("FAILED");
return res;
}
@Override
public CommonResponse queryCompanyLeavesById(String companyId) {
CommonResponse res = new CommonResponse();
res.setResult("FAILED");
return res;
}
}
*/
\ No newline at end of file
/*package com.yeejoin.amos.fas.business.feign;
import java.util.concurrent.CountDownLatch;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.op.core.common.response.CommonResponse;
public class CompanyUserFeignServer extends Thread{
private CommonResponse response;
CountDownLatch latch = null;
String companyId;
String roleType;
IAMOSSecurityServer amosSecurityServer;
public CompanyUserFeignServer(IAMOSSecurityServer amosSecurityServer, CountDownLatch latch, String companyId, String roleType) {
this.latch = latch;
this.amosSecurityServer = amosSecurityServer;
this.companyId = companyId;
this.roleType = roleType;
}
public CommonResponse getResponse() {
return response;
}
public void setResponse(CommonResponse response) {
this.response = response;
}
@Override
public void run() {
CommonResponse res = null;
try {
res = amosSecurityServer.queryAllUserByCompany(companyId, roleType);
} catch (Exception e) {
}
if (ObjectUtils.isEmpty(res)) {
res = new CommonResponse();
res.setResult("FAILED");
}
this.setResponse(res);
latch.countDown();
}
}
*/
\ No newline at end of file
/*package com.yeejoin.amos.fas.business.feign;
import java.util.concurrent.CountDownLatch;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.op.core.common.response.CommonResponse;
public class DeptmentServer extends Thread{
private CommonResponse response;
CountDownLatch latch = null;
String deptId;
IAMOSSecurityServer amosSecurityServer;
public DeptmentServer(IAMOSSecurityServer amosSecurityServer, CountDownLatch latch, String deptId) {
this.latch = latch;
this.amosSecurityServer = amosSecurityServer;
this.deptId = deptId;
}
public CommonResponse getResponse() {
return response;
}
public void setResponse(CommonResponse response) {
this.response = response;
}
@Override
public void run() {
CommonResponse res = amosSecurityServer.queryDeptUser(deptId);
if (ObjectUtils.isEmpty(res)) {
res = new CommonResponse();
res.setResult("FAILED");
}
this.setResponse(res);
latch.countDown();
}
}
*/
\ No newline at end of file
/*package com.yeejoin.amos.fas.business.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
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.op.core.common.response.CommonResponse;
@FeignClient(name="${security.fegin.name}", fallback=AMOSSecurityFallback.class, configuration=FeignConfiguration.class)
public interface IAMOSSecurityServer {
@RequestMapping(value = "/user/users/{companyId}", method = RequestMethod.GET)
public CommonResponse queryAllUserByCompany(@PathVariable("companyId") String companyId, @RequestParam("roleType") String roleType);
@RequestMapping(value = "/user/user-tree/{companyId}", method = RequestMethod.GET)
public CommonResponse queryDeptUserTree(@PathVariable("companyId") String companyId, @RequestParam("roleType") String roleType);
@RequestMapping(value = "/user/department-users/{deptId}", method = RequestMethod.GET)
public CommonResponse queryDeptUser(@PathVariable("deptId") String deptId);
@RequestMapping(value = "/company/specify-tree/{companyId}", method = RequestMethod.GET)
public CommonResponse queryCompanyLeavesById(@PathVariable("companyId") String companyId);
}
*/
\ No newline at end of file
......@@ -12,16 +12,15 @@ import org.springframework.cloud.openfeign.FeignClient;
//推送
/**
* 消息推送
* @author maoying
*
*/
@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);
......
......@@ -2,7 +2,6 @@ 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;
......
......@@ -166,14 +166,15 @@ public class RemoteSecurityService {
return oked;
}
/* public List<UserModel> listUserByRoleIds(String roleIds) {
CommonResponse commonResponse = iAmosSecurityServer.listUserByRoleIds(roleIds);
return handleArray(commonResponse, UserModel.class);
}*/
//用户id批量获取用户信息
/**
* 用户id批量获取用户信息
* @param toke
* @param product
* @param appKey
* @param userIds
* @return
*/
public List<AgencyUserModel> listUserByUserIds(String toke,String product,String appKey,String userIds) {
// CommonResponse commonResponse = iAmosSecurityServer.listUserByUserIds(userIds);
//return handleArray(commonResponse, UserModel.class);
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......@@ -347,18 +348,16 @@ public class RemoteSecurityService {
e.printStackTrace();
}
return agencyUserModel;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByDepartmentId(departmentId);
// return handleArray(commonResponse, UserModel.class);
}
/* public UserModel getUserByToken() {
CommonResponse commonResponse = iAmosSecurityServer.getUserByToken();
return handleObj(commonResponse, UserModel.class);
}*/
//* 获取子公司信息树结构
/**
* 获取子公司信息树结构
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public List<CompanyModel> getCompanyTreeByCompanyId(String toke,String product,String appKey,String companyId) {
if (companyId == null || companyId.equals("")) {
return null;
......@@ -376,14 +375,15 @@ public class RemoteSecurityService {
e.printStackTrace();
}
return companyModel;
//CommonResponse commonResponse = iAmosSecurityServer.getCompanyTreeByCompanyId(companyId);
//return handleArray(commonResponse, CompanyBo.class);
}
//查询指定公司的部门树
/**
* 查询指定公司的部门树
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public List<DepartmentModel> getDepartmentTreeByCompanyId(String toke,String product,String appKey,String companyId) {
if (companyId == null || companyId.equals("")) {
return null;
......@@ -447,12 +447,6 @@ public class RemoteSecurityService {
* 基础平台全部菜单权限树,用于平台登录前端初始化路由
*/
public CommonResponse searchPermissionTree(String toke,String product,String appKey,String appType) {
// CommonResponse commonResponse = iAmosSecurityServer.listPermissionTree(appType);
// return commonResponse;
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......@@ -466,22 +460,17 @@ public class RemoteSecurityService {
e.printStackTrace();
}
CommonResponse commonResponse =new CommonResponse("SUCCESS",dictionarieModel);
return commonResponse ;
}
//根据Code查询指定的字典信息.
/**
* 根据Code查询指定的字典信息.
* @param toke
* @param product
* @param appKey
* @param dictCode
* @return
*/
public JSONArray listDictionaryByDictCode(String toke,String product,String appKey,String dictCode) {
/* CommonResponse commonResponse = iAmosSecurityServer.listDictionaryByDictCode(dictCode);
if (commonResponse != null && commonResponse.isSuccess()) {
String jsonStr = JSON.toJSONString(commonResponse.getDataList());
return JSONArray.parseArray(jsonStr);
}*/
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......@@ -498,25 +487,24 @@ public class RemoteSecurityService {
String jsonStr = JSON.toJSONString(dictionarieModel);
return JSONArray.parseArray(jsonStr);
}
return null;
}
/**
* 查询指定公司信息与其部门用户树
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/
public CompanyModel listUserByCompanyId1(String toke,String product,String appKey,String companyId) {
if (companyId == null || companyId.equals("")) {
return null;
}
//CommonResponse commonResponse = iAmosSecurityServer.getuserTreeByCompanyId(companyId);
// String jsonStr = JSON.toJSONString(commonResponse);
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
//List<CompanyModel> companyModel=null;
CompanyModel companyModel=null;
FeignClientResult feignClientResult;
try {
......@@ -527,21 +515,12 @@ public class RemoteSecurityService {
e.printStackTrace();
}
return companyModel;
// return JSONObject.parseObject(jsonStr);
}
public boolean loginOutFromApp(String toke,String product,String appKey) {
// CommonResponse commonResponse = iAmosSecurityServer.loginOutFromApp();
// if (commonResponse != null && commonResponse.isSuccess()) {
// return true;
// }
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......@@ -558,7 +537,6 @@ public class RemoteSecurityService {
}
public JSONArray listDepartmentUserTree(String toke,String product,String appKey,String companyId) {
RequestContext.setToken(toke);
RequestContext.setProduct(product);
RequestContext.setAppKey(appKey);
......@@ -580,24 +558,9 @@ public class RemoteSecurityService {
return JSONArray.parseArray(jsonStr);
}
return null;
/*CommonResponse commonResponse = iAmosSecurityServer.listDepartmentUserTree(companyId);
if (commonResponse != null && commonResponse.isSuccess()) {
String jsonStr = JSON.toJSONString(commonResponse.getDataList());
return JSONArray.parseArray(jsonStr);
}
return null;*/
}
public boolean editPassword(String toke,String product,String appKey,String userId, String oldPassword, String newPassword) {
// JSONObject request = new JSONObject();
//
//
// request.put("originalPassword", oldPassword);
// request.put("userId", userId);
// request.put("password", newPassword);
// request.put("rePassword", newPassword);
boolean flag=false;
RequestContext.setToken(toke);
RequestContext.setProduct(product);
......@@ -620,11 +583,6 @@ public class RemoteSecurityService {
if(agencyUserModel2!=null){
flag=true;
}
// CommonResponse commonResponse = iAmosSecurityServer.editPassword(userId, request);
// if (commonResponse != null && commonResponse.isSuccess()) {
// return true;
// }
return false;
}
}
......
/*package com.yeejoin.amos.fas.business.feign;
import java.util.concurrent.CountDownLatch;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.op.core.common.response.CommonResponse;
public class TreeUserFeignServer extends Thread{
private CommonResponse response;
CountDownLatch latch = null;
String companyId;
String roleType;
IAMOSSecurityServer amosSecurityServer;
public TreeUserFeignServer(IAMOSSecurityServer amosSecurityServer, CountDownLatch latch, String companyId, String roleType) {
this.latch = latch;
this.amosSecurityServer = amosSecurityServer;
this.companyId = companyId;
this.roleType = roleType;
}
public CommonResponse getResponse() {
return response;
}
public void setResponse(CommonResponse response) {
this.response = response;
}
@Override
public void run() {
CommonResponse res = amosSecurityServer.queryDeptUserTree(companyId, roleType);
if (ObjectUtils.isEmpty(res)) {
res = new CommonResponse();
res.setResult("FAILED");
}
this.setResponse(res);
latch.countDown();
}
}
*/
\ No newline at end of file
......@@ -27,8 +27,8 @@ public class AlarmServiceImpl implements IAlarmService {
if(StringUtil.isNotEmpty(param.getEndDate())){
param.setEndDate(param.getEndDate()+" "+"23:59:59");
}
long total = alarmMapper.countPageData(param);
List<HashMap<String, Object>> content = alarmMapper.getAlarmMapperPage(param);
long total = alarmMapper.countAlarmData();
List<HashMap<String, Object>> content = alarmMapper.getAlarmSingleMapperPage(param);
Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total);
return result;
}
......
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.bo.FireInfoBo;
import com.yeejoin.amos.fas.business.bo.FireMoreDataBo;
import com.yeejoin.amos.fas.business.bo.FireParamBo;
import com.yeejoin.amos.fas.business.bo.FireRectificationBo;
import com.yeejoin.amos.fas.business.dao.mapper.FireRectificationMapper;
import com.yeejoin.amos.fas.business.service.intfc.FireRectificationService;
import com.yeejoin.amos.fas.business.util.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("fireRectificationService")
public class FireRectificationServiceImpl implements FireRectificationService {
@Autowired
FireRectificationMapper fireRectificationMapper;
/**
* 文件服务器地址
*/
@Value("${file.downLoad.url}")
private String ipUrl;
/**
* 根据条件查询对应单据
* @param nameLike 单据模糊查询
* @param sDate 起始日
* @param eDate 终止日
* @param states 状态
* @param pageNum 页码
* @param pageSize
* @return
*/
@Override
public Map<String, Object> queryFiresAndCount(String nameLike, String sDate, String eDate, int states, int pageNum,int pageSize) {
if(nameLike.trim().equals("")){
nameLike = null;
}
Map<String, Object> map = new HashMap<>();
int spage = (pageNum-1)*pageSize;
map.put("nameLike",nameLike);
map.put("sDate",sDate);
map.put("eDate",eDate);
map.put("states",states);
map.put("spage",spage);
map.put("pageSize",pageSize);
List<FireRectificationBo> fireRectificationBos = fireRectificationMapper.queryFiresAndCount(map);
long countFires = fireRectificationMapper.countQueryFireList(map);
map.clear();
map.put("fireRectificationBos",fireRectificationBos);
map.put("countFires",countFires);
return map;
}
/**
* 查询详细单据信息
* @param billNo
* @return
*/
@Override
public Map<String, Object> selectOneById(String billNo) {
Map<String ,Object> result = new HashMap();
FireRectificationBo base = fireRectificationMapper.selectOneForBase(billNo);
List<FireMoreDataBo> warnnings = fireRectificationMapper.selectOneForEmergency(billNo);
List<FireMoreDataBo> danger = fireRectificationMapper.selectOneForDanger(billNo);
List<FireMoreDataBo> hidden = fireRectificationMapper.selectOneForHidden(billNo);
List<FireInfoBo> files = new ArrayList<>();
for (int i=0;i<4;i++){
files.add(fireRectificationMapper.selectOneForfire(billNo,i));
}
Map<String ,Object> backResult = makeFIreString(files);
result.put("base", base);
result.put("warnnings", warnnings);
result.put("danger", danger);
result.put("hidden", hidden);
result.put("fires", backResult.get("fires"));
result.put("backResult", backResult.get("backResult"));
return result;
}
/**
* 下载文件
* @param path
* @param response
*/
@Override
public void downLoadFilesByUrll(String path, HttpServletResponse response) {
List<String> list = Arrays.asList(path.split(","));
try {
FileUtils.downloadZIP(response,list,ipUrl);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 修改单据相关信息
* @param paramBo
* @return
*/
@Override
public Map<String, String> updateByid(FireParamBo paramBo) {
Map<String, String> map = new HashMap<>();
map.put("billNo",paramBo.getBillNo());
map.put("backResult",paramBo.getBackResult());
map.put("refResult",paramBo.getRefResult());
try {
if(isDataEmpty(paramBo.getBillNo(),null) ||
isDataEmpty(paramBo.getBackResult(),null) ||
isDataEmpty(paramBo.getRefResult(),null)
){
fireRectificationMapper.updateBill(map);
}
if (isDataEmpty(null,paramBo.getWarnningData())){
for (FireMoreDataBo bo : paramBo.getWarnningData()) {
fireRectificationMapper.updateWarnning(bo);
}
}
if (isDataEmpty(null,paramBo.getHiddenData())){
for (FireMoreDataBo bo : paramBo.getHiddenData()) {
fireRectificationMapper.updateHidden(bo);
}
}
if (isDataEmpty(null,paramBo.getDangerData())){
for (FireMoreDataBo bo : paramBo.getDangerData()) {
fireRectificationMapper.updateDanger(bo);
}
}
map.clear();
}catch (Exception e) {
map.put("result","数据保存失败");
map.put("message","error");
return map;
}
map.put("result","数据保存成功");
map.put("message","success");
return map;
}
/**
* 判空
* @param data
* @param list
* @return
*/
public boolean isDataEmpty (String data,List<FireMoreDataBo> list) {
if (data != null){
return !("").equals(data);
}
return list != null && list.size() != 0;
}
/**
* 生成返回拼接评价
* @param files
* @return
*/
public Map<String ,Object> makeFIreString( List<FireInfoBo> files){
Map<String ,Object> result = new HashMap();
Map<String ,Object> newfires = new HashMap();
String backResult = ",需加强";
FireInfoBo fire1= files.get(0);
FireInfoBo fire2= files.get(1);
FireInfoBo fire3= files.get(2);
FireInfoBo fire4= files.get(3);
if (fire1 == null){
fire1 = new FireInfoBo(0,0);
}
if (fire2 == null){
fire2 = new FireInfoBo(0,0);
}
if (fire3 == null){
fire3 = new FireInfoBo(0,0);
}
if (fire4 == null){
fire4 = new FireInfoBo(0,0);
}
newfires.put("fire1rel",fire1.getRealNum());
newfires.put("fire1thr",fire1.getThreshold());
newfires.put("fire2rel",fire2.getRealNum());
newfires.put("fire2thr",fire2.getThreshold());
newfires.put("fire3rel",fire3.getRealNum());
newfires.put("fire3thr",fire3.getThreshold());
newfires.put("fire4rel",fire4.getRealNum());
newfires.put("fire4thr",fire4.getThreshold());
if (fire1.getRealNum()<fire1.getThreshold() && fire1.getRealNum()!=fire1.getThreshold()){
backResult = backResult+"消防应急预案";
}
if (fire2.getRealNum()<fire2.getThreshold() && fire2.getRealNum()!=fire2.getThreshold()){
if(!backResult.equals(",需加强")){
backResult = backResult+",";
}
backResult = backResult+"消防安全教育培训";
}
if (fire3.getRealNum()<fire3.getThreshold() && fire3.getRealNum()!=fire3.getThreshold()){
if(!backResult.equals(",需加强")){
backResult = backResult+",";
}
backResult = backResult+"消防日常训练";
}
if ( fire4.getRealNum()<fire4.getThreshold() && fire4.getRealNum()!=fire4.getThreshold()){
if(!backResult.equals(",需加强")){
backResult = backResult+",";
}
backResult = backResult+"消防器材保养";
}
if (backResult.equals(",需加强")){
backResult = "。";
}else {
backResult = backResult+"工作。";
}
result.put("fires", newfires);
result.put("backResult", backResult);
return result;
}
}
......@@ -566,7 +566,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
// 获取遥信指标
List<Map> points = fireEquipPointMapper.getPointsByEquipmentIdAndType(equipment.getId(), "SWITCH");
HashMap<String, Integer> telesignallingMap = new HashMap<>();
......@@ -900,14 +899,41 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
@Override
@javax.transaction.Transactional
public String processFireEqumtData(AlarmParam deviceData) throws Exception {
// 格式化发送数据
sendRiskSourceData(deviceData);
blockingQueue.add(deviceData);
return "SUCCESS";
}
/**
* webSocket向前台推送消防设备数据
* @param param
*/
@Async
public void sendRiskSourceData(AlarmParam param) {
try {
Map<String, Object> map = new HashMap<>();
map.put("value", param.getState());
map.put("id", param.getPointCode());
Map<String, Map<String, Object>> riskSourceMap = new HashMap();
riskSourceMap.put("equipments", map);
remoteWebSocketServer.sendMessage("equipmentMode", JSON.toJSONString(riskSourceMap));
} catch (Exception e) {
log.error("推送前端数据失败-->"+JSON.toJSONString(param));
}
}
private void saveFireEquipmentData(FireEquipmentPoint fireEquipmentPoint, FireEquipment fireEquipment, AlarmParam deviceData, String fireEquipmentPointType) {
if ("alarm_type_fire".equals(fireEquipmentPointType) || "alarm_type_trouble".equals(fireEquipmentPointType)) {
Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(deviceData.getPointCode());
......@@ -982,7 +1008,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
public void saveData(List<AlarmParam> deviceDatas, String type) {
List<EquipCommunicationData> list = deviceDatas.stream().map(param -> {
log.debug("pointCode==" + param.getPointCode() + " InformationAddress==" + param.getInformationAddress());
// 格式化发送数据
sendRiskSourceData(param);
if (ObjectUtils.isEmpty(param.getPointCode())) {
EquipCommunicationData data = new EquipCommunicationData();
data.setIsInvalid(param.getIsInvalid());
......
......@@ -43,6 +43,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
......@@ -573,14 +574,19 @@ public class View3dServiceImpl implements IView3dService {
CommonPageable pageable = new CommonPageable( current, pageSize);
Long count = view3dMapper.retrieveAllCount(type,inputText,orgCode,dataLevel,protectObjName);
List<HashMap<String, Object>> retrieveAll = view3dMapper.retrieveAll(type, inputText,pageable.getOffset(),pageable.getPageSize(),orgCode,dataLevel,protectObjName);
Set<Object> userIds = new HashSet<>();
retrieveAll.forEach(action->{
if(!ObjectUtils.isEmpty(action.get("person"))){
userIds.add(action.get("person").toString());
}
});
Map<String,String> userMap = remoteSecurityService.getUserRealName(token, product, appKey, userIds);
retrieveAll.stream().forEach(e->{
String person = (String)e.get("person");
String positionDTO = (String)e.get("positionDTO");
JSONArray ue4Location = this.getInitJSONArray(String.valueOf(e.get("ue4Location")));
JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(e.get("ue4Rotation")));
if(person != null && !person.equals("")) {
AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person);
e.put("person", user != null ? user.getRealName() : "");
if(!ObjectUtils.isEmpty(e.get("person"))){
e.put("person", userMap.get(e.get("person").toString()));
}
CoordDTO position = null;
if(positionDTO != null && !positionDTO.equals("")) {
......
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.bo.FireParamBo;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 安全监管-单据管理 服务类
*
* @author 郑嘉伟
*/
public interface FireRectificationService {
/**
* 按条件查询消防整改列表信息
* @param nameLike 单据模糊查询
* @param sDate 起始日
* @param eDate 终止日
* @param states 状态
* @param pageNum 页码
* @return
*/
Map<String, Object> queryFiresAndCount(String nameLike, String sDate, String eDate, int states, int pageNum ,int pageSize);
/**
* 查询详细单据信息
* @param billNo
* @return
*/
Map<String ,Object> selectOneById(String billNo);
/**
* 下载文件
* @param path
* @param response
*/
void downLoadFilesByUrll(String path, HttpServletResponse response );
/**
* 修改单据相关信息
* @param paramBo
* @return
*/
Map<String, String> updateByid(FireParamBo paramBo);
}
package com.yeejoin.amos.fas.business.util;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
* 文件下载 工具类
*
* @author 郑嘉伟
* @since 2020-08-05
*/
public class FileUtils {
private static final Logger logger = LogManager.getLogger(FileUtils.class);
/**
* 获取压缩好zip——>设置消息头——>输出
* @param response
* @param list
* @param ipUrl
* @throws IOException
*/
public static void downloadZIP(HttpServletResponse response, List<String> list, String ipUrl) throws IOException {
//构建zip
String zipname = "单据相关附件.zip";
String zippath = fileToZip(list, zipname, ipUrl);
OutputStream out = null;
BufferedInputStream br = null;
try {
String fileName = new String(zipname.getBytes("UTF-8"), "iso-8859-1");
br = new BufferedInputStream(new FileInputStream(zippath));
byte[] buf = new byte[1024];
int len = 0;
response.reset();
response.setHeader("Content-Type", "application/octet-stream;charset=utf-8");
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
response.setHeader("Access-Control-Expose-Headers", "access_token");
response.setHeader("Access-Control-Allow-Origin", "*");
response.setContentType("application/zip");
out = response.getOutputStream();
while ((len = br.read(buf)) > 0) {
out.write(buf, 0, len);
out.flush();
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
br.close();
out.close();
}
}
/**
* 通过文件服务器——>获取流——>输出——>压缩
*
* @param list
* @param fileName
* @return
*/
public static String fileToZip(List<String> list, String fileName, String ipUrl) {
InputStream fis = null;
BufferedInputStream bis = null;
FileOutputStream fos = null;
ZipOutputStream zos = null;
// 临时目录
String path = System.getProperty("java.io.tmpdir") + fileName;
try {
File zipFile = new File(path);
zipFile.deleteOnExit();
zipFile.createNewFile();
fos = new FileOutputStream(zipFile);
zos = new ZipOutputStream(new BufferedOutputStream(fos));
byte[] bufs = new byte[1024 * 10];
for (String a : list) {
fis = getInputStreamFromURL(ipUrl + a);
String subFileName = new File(ipUrl + a).getName();
//创建ZIP实体,并添加进压缩包
ZipEntry zipEntry = new ZipEntry(subFileName);
zos.putNextEntry(zipEntry);
bis = new BufferedInputStream(fis, 1024 * 10);
int read = 0;
while ((read = bis.read(bufs, 0, 1024 * 10)) != -1) {
zos.write(bufs, 0, read);
}
}
System.out.println("压缩成功");
} catch (FileNotFoundException e) {
e.printStackTrace();
throw new RuntimeException(e);
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
} finally {
try {
if (null != bis) {
bis.close();
}
if (null != zos) {
zos.close();
}
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
return path;
}
/**
* 从URL中读取图片,转换成流形式.
*
* @param destUrl
* @return
*/
public static InputStream getInputStreamFromURL(String destUrl) {
HttpURLConnection httpUrl = null;
URL url = null;
InputStream in = null;
try {
url = new URL(destUrl);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
in = httpUrl.getInputStream();
return in;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
\ No newline at end of file
#security.password=a1234560
#security.loginId=station_safety
security.password=a1234560
security.loginId=shg
security.productWeb=CONVERTER_STATION_WEB
......@@ -69,4 +66,8 @@ rule.definition.default-agency=STATE_GRID
amos.feign.gennerator.use-gateway=true
autoSys.push.type=mqtt
\ No newline at end of file
autoSys.push.type=mqtt
amos.feign.gennerator.use-gateway=true
#�����
file.downLoad.url=http://172.16.10.175:8888/
......@@ -60,4 +60,7 @@ DutyMode.dutyUrl=http://172.16.11.36:10005/
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
#\uFFFD\u013C\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
file.downLoad.url=http://172.16.10.175:8888/
......@@ -60,4 +60,7 @@ DutyMode.dutyUrl=http://172.16.11.36:10005/
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
#\uFFFD\u013C\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
file.downLoad.url=http://172.16.10.175:8888/
spring.application.name = Amos-autosys
spring.application.name = AMOS-AUTOSYS
server.port = 8083
......@@ -32,6 +31,8 @@ mybatis.mapper-locations = classpath:db/mapper/*.xml
# mybatis entity package
mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase=true
mybatis.configuration.call-setters-on-nulls = true
logging.level.com.yeejoin.amos.fas.business.dao.mapper=debug
#liquibase
......@@ -56,3 +57,4 @@ param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey=
......@@ -110,4 +110,61 @@
END#
</sql>
</changeSet>
<changeSet author="shanqiyun" id="1597831211780-1" runOnChange="true">
<comment>create view toip_biz_message</comment>
<sql>
DROP VIEW IF EXISTS toip_biz_message;
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `toip_biz_message` AS SELECT
`m`.`id` AS `id`,
`m`.`id` AS `originId`,
`m`.`time` AS `time`,
`m`.`content` AS `content`,
`m`.`title` AS `title`,
`m`.`type` AS `type`,
`m`.`sender` AS `sender`,
`m`.`receiver` AS `receiver`,
`m`.`reader` AS `reader`,
`m`.`biz_id` AS `biz_id`,
`m`.`bizclass_name` AS `bizclass_name`,
`n`.`org_code` AS `org_code`
FROM
( `toip_sys_message` `m` JOIN `f_equipment` `n` )
WHERE
( ( `n`.`id` = `m`.`biz_id` ) AND ( `m`.`bizclass_name` = 'class com.yeejoin.amos.fas.business.service.model.FireEquimentDataRo' ) ) UNION ALL
SELECT
`m`.`id` AS `id`,
`m`.`id` AS `originId`,
`m`.`time` AS `time`,
`m`.`content` AS `content`,
`m`.`title` AS `title`,
`m`.`type` AS `type`,
`m`.`sender` AS `sender`,
`m`.`receiver` AS `receiver`,
`m`.`reader` AS `reader`,
`m`.`biz_id` AS `biz_id`,
`m`.`bizclass_name` AS `bizclass_name`,
`n`.`org_code` AS `org_code`
FROM
( `toip_sys_message` `m` JOIN `p_point` `n` )
WHERE
( ( `n`.`id` = `m`.`biz_id` ) AND ( `m`.`bizclass_name` = 'class com.yeejoin.amos.fas.business.service.model.ProtalDataRo' ) ) UNION ALL
SELECT
`m`.`id` AS `id`,
`m`.`id` AS `originId`,
`m`.`time` AS `time`,
`m`.`content` AS `content`,
`m`.`title` AS `title`,
`m`.`type` AS `type`,
`m`.`sender` AS `sender`,
`m`.`receiver` AS `receiver`,
`m`.`reader` AS `reader`,
`m`.`biz_id` AS `biz_id`,
`m`.`bizclass_name` AS `bizclass_name`,
`n`.`org_code` AS `org_code`
FROM
( `toip_sys_message` `m` JOIN `f_risk_source` `n` )
WHERE
( ( `n`.`id` = `m`.`biz_id` ) AND ( `m`.`bizclass_name` = 'class com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo' ) );
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -24,6 +24,12 @@
<if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if>
</trim>
</select>
<select id="countAlarmData" resultType="long">
SELECT
count(a.id) AS total_num
FROM f_alarm a
</select>
<!--分页查询 -->
<select id="getAlarmMapperPage" resultType="java.util.HashMap">
SELECT
......@@ -31,15 +37,20 @@
sa.code,
sa.equip_code as equipCode,
sa.name,
sa.production_area prodArea,
sa.prodArea,
sa.protectObj,
a.alarm_time AS alarmTime,
a.alarm_type AS alarmType
a.create_date AS createDate,
a.type AS type,
a.fire_equipment_point_name AS pointName,
a.frequency AS frequency,
a.status AS status,
a.recovery_date AS recoveryDate
FROM `f_alarm` a
inner join
(
select
b.fire_equipment_id,c.`name` as protectObj,d.*
b.fire_equipment_id,c.`name` as protectObj,d.production_area as prodArea,d.*
from
f_equipment_fire_equipment b,f_equipment c, f_fire_equipment d
where
......@@ -58,4 +69,31 @@
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
<select id="getAlarmSingleMapperPage" resultType="java.util.HashMap">
SELECT
f.id,
f.fire_equipment_id as fireEquipmentId,
f.fire_equipment_code as fireEquipmentCode,
f.fire_equipment_name as fireEquipmentName,
f.fire_equipment_point_id as fireEquipmentPointId,
f.fire_equipment_point_code as fireEquipmentPointCode,
f.fire_equipment_point_name as fireEquipmentPointName,
f.fire_equipment_point_value as fireEquipmentPointValue,
f.frequency as frequency,
f.status as status,
f.type as type,
f.create_date as createDate,
f.recovery_date as recoveryDate
FROM f_alarm f
WHERE 1=1
<if test="protectObj !=null and protectObj != '' "> and f.fire_equipment_name like concat(concat("%",#{protectObj}),"%") </if>
<if test="beginDate!=null"> and f.create_date >= #{beginDate} </if>
<if test="endDate!=null"> and f.create_date <![CDATA[<=]]> #{endDate} </if>
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.FireRectificationMapper">
<select id="queryFiresAndCount" resultType="com.yeejoin.amos.fas.business.bo.FireRectificationBo">
SELECT * FROM (
SELECT
BILL_NO AS billno,
STATION_SEQ AS stationNum,
STATION_NAME AS stationName,
( SELECT COUNT(1) FROM ELEC_BILLS_ALARM_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS warnning,
( SELECT COUNT(1) FROM ELEC_BILLS_RISK_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR) AS danger,
( SELECT COUNT(1) FROM ELEC_BILLS_DANGER_INFO WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS hiddenTrouble,
( SELECT COUNT(1) FROM ELEC_BILLS_FIRE_SAFETY_CONTROL WHERE EBD.SEQUENCE_NBR = SEQUENCE_NBR ) AS adminOfFire,
SAFETY_CHARGE_PERSON AS chargePerson,
SAFETY_PERSON_PHONE AS chargePersonTel,
date_format(REQUIREMENT_DATE,'%Y / %m / %d') AS completionDate,
REQUIREMENT_DATE,
date_format(ACTUAL_FINISH_DATE,'%Y / %m / %d') AS reCompletionDate,
STATUS AS statuscode,
if(STATUS=1,'未处理','已完成') AS status
FROM
ELEC_BILLS_BASIC_INFO EBD
where STATUS = 1 or STATUS = 2
ORDER BY REQUIREMENT_DATE) BDATA
where 1=1
<if test="nameLike != null ">
and billno like CONCAT('%',#{nameLike},'%')
</if>
<if test="sDate != 'null' and sDate != '1970-1-1' ">
and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')
</if>
<if test="eDate != 'null' and eDate != '1970-1-1' ">
and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')
</if>
<if test="states != 0 ">
and statuscode = #{states}
</if>
LIMIT #{spage},#{pageSize}
</select>
<select id="countQueryFireList" resultType="long">
SELECT COUNT(1) FROM (
SELECT
BILL_NO AS billno,
REQUIREMENT_DATE,
STATUS
FROM
ELEC_BILLS_BASIC_INFO EBD
where STATUS = 1 or STATUS = 2
ORDER BY REQUIREMENT_DATE) BDATA
where 1=1
<if test="nameLike != null ">
and billno like CONCAT('%',#{nameLike},'%')
</if>
<if test="sDate != 'null' and sDate != '1970-1-1' ">
and STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d') >= STR_TO_DATE(#{sDate},'%Y-%m-%d')
</if>
<if test="eDate != 'null' and eDate != '1970-1-1' ">
and STR_TO_DATE(#{eDate},'%Y-%m-%d') >=STR_TO_DATE(REQUIREMENT_DATE,'%Y-%m-%d')
</if>
<if test="states != 0 ">
and STATUS = #{states}
</if>
</select>
<select id="selectOneForBase" resultType="com.yeejoin.amos.fas.business.bo.FireRectificationBo">
select
BILL_NO AS billNo,
STATION_NAME AS stationName,
DISTRIBUTION_USER_NAME AS disUser,
DISTRIBUTION_DATE AS disDate,
STATION_CHARGE_PERSON AS stationUser,
CHARGE_PERSON_PHONE AS stationUserTel,
SAFETY_CHARGE_PERSON AS safeUser,
SAFETY_PERSON_PHONE AS safeUserTel,
REQUIREMENT_DATE AS reqDate,
if(ACTUAL_FINISH_DATE is null, date_format(sysdate(),'%Y-%m-%d') ,ACTUAL_FINISH_DATE) AS finishDate,
REFORM_RESULT AS refResult,
VIEWS_AND_SUGGESTIONS AS viewsAndSuggestions,
FEEDBACK_RESULT AS backResult,
STATUS AS status
from
elec_bills_basic_info EBD
where BILL_NO = #{billNo}
</select>
<select id="selectOneForEmergency" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">
select
SEQUENCE_NBR as req,
FIRE_EQUIPMENT_NAME AS name,
ALARM_DESC AS persent,
HANDLE_STATE AS doneResult,
FILE_PATH as filePath
from
elec_bills_alarm_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select>
<select id="selectOneForDanger" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">
select
SEQUENCE_NBR as req,
LEVEL_NAME AS lvl,
POINT_NAME AS persent,
RISK_FACTOR_NAME AS affect,
FEEDBACK AS backResult
from
elec_bills_risk_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select>
<select id="selectOneForHidden" resultType="com.yeejoin.amos.fas.business.bo.FireMoreDataBo">
select
SEQUENCE_NBR as req,
if(DANGER_LEVEL=1,'一般隐患','重大隐患') AS lvl,
DANGER_NAME AS persent,
INPUT_ITEM_NAME AS affect,
HANDLE_STATE AS doneResult,
FILE_PATH as filePath
from
elec_bills_danger_info
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
</select>
<select id="selectOneForfire" resultType="com.yeejoin.amos.fas.business.bo.FireInfoBo">
select
TYPE AS type,
ACTUAL_NUMBER AS realNum,
THRESHOLD AS threshold
from
elec_bills_fire_safety_control
where BILL_SEQ = (select SEQUENCE_NBR from elec_bills_basic_info where BILL_NO=#{billNo})
and type =${id}
</select>
<update id="updateBill">
UPDATE
ELEC_BILLS_BASIC_INFO
SET STATUS = 2,
REFORM_RESULT =#{refResult} ,
FEEDBACK_RESULT =#{backResult}
where BILL_NO = #{billNo}
</update>
<update id="updateWarnning">
UPDATE
ELEC_BILLS_ALARM_INFO
SET
HANDLE_STATE =#{doneResult} ,
FILE_PATH =#{filePath}
where SEQUENCE_NBR = #{req}
</update>
<update id="updateHidden">
UPDATE
ELEC_BILLS_DANGER_INFO
SET
HANDLE_STATE =#{doneResult} ,
FILE_PATH =#{filePath}
where SEQUENCE_NBR = #{req}
</update>
<update id="updateDanger">
UPDATE
ELEC_BILLS_RISK_INFO
SET
FEEDBACK =#{backResult}
where SEQUENCE_NBR = #{req}
</update>
</mapper>
\ No newline at end of file
......@@ -1240,7 +1240,7 @@
<select id="retrieveAll" resultType="java.util.HashMap">
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
from (select concat('riskSource',r.id) as id,r.id as originId,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE
WHEN (
......@@ -1263,7 +1263,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
r.name as label,
'' as protectObjName,
r.name as protectObjName,
'' as routeName,
'' as person,
r.rpn as title,
......@@ -1275,7 +1275,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
AND rl.level = #{dataLevel}
</if>
UNION all
select concat('patrol-',p.id) as id,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
select concat('patrol-',p.id) as id,p.id as originId,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode,
CASE
WHEN (
......@@ -1298,7 +1298,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
p.name as label,
'' as protectObjName,
p.name as protectObjName,
p.route_name as routeName,
p.charge_person_id as person,
case
......@@ -1311,7 +1311,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
from p_point p
WHERE is_delete = FALSE
UNION all
select concat('impEquipment-',id) as id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode,
select concat('impEquipment-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'impEquipment' as type,org_code as orgCode,
0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode,
CASE
WHEN (
......@@ -1334,14 +1334,14 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
e.name as label,
'' as protectObjName,
e.name as protectObjName,
'' as routeName,
'' as person,
name as title,
concat('impEquipment-',e.id) as `key`
from f_equipment e
UNION all
select concat('monitorEquipment-',m.id) as id,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
select concat('monitorEquipment-',m.id) as id,m.id as originId,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.is_indoor as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode,
CASE
WHEN (
......@@ -1364,7 +1364,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
m.name as label,
group_concat(f.name) as protectObjName,
IFNULL(group_concat(f.name),'') as protectObjName,
'' as routeName,
'' as person,
m.name as title,
......@@ -1378,7 +1378,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
AND f.name = #{protectObjName}
</if>
UNION all
select concat('video-',m.id) as id,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'video' as type,m.org_code as orgCode,
select concat('video-',m.id) as id,m.id as originId,m.name,m.code,m.ue4_location as ue4Location,m.ue4_rotation as ue4Rotation ,'video' as type,m.org_code as orgCode,
m.equip_status as level , concat('level_',m.equip_status) as levelStr,m.is_indoor as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE
WHEN (
......@@ -1412,7 +1412,7 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
where m.equip_classify = 2
UNION all
select concat('hydrant-',id) as id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,
select concat('hydrant-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'hydrant' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
......@@ -1435,14 +1435,14 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
name as label,
'' as protectObjName,
name as protectObjName,
'' as routeName,
'' as person,
name as title,
concat('hydrant-',id) as `key`
from f_water_resource where type = 1
UNION all
select concat('pool-',id) as id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
select concat('pool-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'pool' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防水池' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
......@@ -1465,14 +1465,14 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
name as label,
'' as protectObjName,
name as protectObjName,
'' as routeName,
'' as person,
name as title,
concat('pool-',id) as `key`
from f_water_resource where type = 2
UNION all
select concat('fireCar-',id) as id,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,
select concat('fireCar-',id) as id,id as originId,name,car_num as code,ue4_location as ue4Location,ue4_rotation as ue4Rotation, 'fireCar' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
......@@ -1495,14 +1495,14 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
name as label,
'' as protectObjName,
name as protectObjName,
'' as routeName,
'' as person,
name as title,
concat('fireCar-',id) as `key`
from f_fire_car
UNION all
select concat('fireEquipment-',id) as id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
select concat('fireEquipment-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation,'fireEquipment' as type,org_code as orgCode,
equip_status as level , concat('level_',equip_status) as levelStr,is_indoor as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
......@@ -1525,14 +1525,14 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
name as label,
'' as protectObjName,
name as protectObjName,
'' as routeName,
'' as person,
name as title,
concat('fireEquipment-',id) as `key`
from f_fire_equipment where equip_classify = 3
UNION all
select concat('fireChamber-',id) as id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
select concat('fireChamber-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation , 'fireChamber' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
......@@ -1555,14 +1555,14 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
name as label,
'' as protectObjName,
name as protectObjName,
'' as routeName,
'' as person,
name as title,
concat('fireChamber-',id) as `key`
from f_fire_station where type = 2
UNION all
select concat('fireFoamRoom-',id) as id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
select concat('fireFoamRoom-',id) as id,id as originId,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'fireFoamRoom' as type,org_code as orgCode,
0 as level , 'level_0' as levelStr,is_indoor as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,
CASE
WHEN (
......@@ -1585,26 +1585,27 @@ from (select concat('riskSource',r.id) as id,r.name,r.code,r.ue4_location as ue4
)
END positionDTO,
name as label,
'' as protectObjName,
name as protectObjName,
'' as routeName,
'' as person,
name as title,
concat('fireFoamRoom-',id) as `key`
from f_fire_station where type = 1
) as tmp
where 1=1
<if test="inputText!=null" >
AND (
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if test="type!=null and type!=''">
AND tmp.typeCode = #{type}
</if>
<if test="orgCode!=null">
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
</if>
<where>
<if test="inputText!=null" >
AND (
tmp.code LIKE '%${inputText}%'
OR tmp.name LIKE '%${inputText}%'
)
</if>
<if test="type!=null and type!=''">
AND tmp.typeCode = #{type}
</if>
<if test="orgCode!=null">
AND (tmp.orgCode = #{orgCode} OR tmp.orgCode like CONCAT(#{orgCode},'-%') )
</if>
</where>
LIMIT ${start},${length}
</select>
<select id="getAllPointInRegions" resultType="java.util.Map">
......
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