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 { ...@@ -32,7 +32,7 @@ public class AlarmController extends BaseController {
/** /**
* 风险等级分页查询 * 风险等级分页查询
* *
* @param id * @param queryRequests
* @return * @return
*/ */
@Permission @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 { ...@@ -9,6 +9,10 @@ public interface AlarmMapper extends BaseMapper {
long countPageData(CommonPageInfoParam param); long countPageData(CommonPageInfoParam param);
long countAlarmData();
List<HashMap<String, Object>> getAlarmMapperPage(CommonPageInfoParam param); 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; ...@@ -12,16 +12,15 @@ import org.springframework.cloud.openfeign.FeignClient;
//推送 /**
* 消息推送
* @author maoying
*
*/
@FeignClient(name = "${Push.fegin.name}", configuration={MultipartSupportConfig.class}) @FeignClient(name = "${Push.fegin.name}", configuration={MultipartSupportConfig.class})
public interface PushFeign { 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) @RequestMapping(value = "/api/user/sendMessageone", method = RequestMethod.POST)
CommonResponse sendMessageone( @RequestBody PushMsgParam responses); CommonResponse sendMessageone( @RequestBody PushMsgParam responses);
......
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.fas.business.feign; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.fas.business.feign;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
......
...@@ -166,14 +166,15 @@ public class RemoteSecurityService { ...@@ -166,14 +166,15 @@ public class RemoteSecurityService {
return oked; return oked;
} }
/* public List<UserModel> listUserByRoleIds(String roleIds) { /**
CommonResponse commonResponse = iAmosSecurityServer.listUserByRoleIds(roleIds); * 用户id批量获取用户信息
return handleArray(commonResponse, UserModel.class); * @param toke
}*/ * @param product
//用户id批量获取用户信息 * @param appKey
* @param userIds
* @return
*/
public List<AgencyUserModel> listUserByUserIds(String toke,String product,String appKey,String userIds) { 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.setToken(toke);
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
...@@ -347,18 +348,16 @@ public class RemoteSecurityService { ...@@ -347,18 +348,16 @@ public class RemoteSecurityService {
e.printStackTrace(); e.printStackTrace();
} }
return agencyUserModel; 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) { public List<CompanyModel> getCompanyTreeByCompanyId(String toke,String product,String appKey,String companyId) {
if (companyId == null || companyId.equals("")) { if (companyId == null || companyId.equals("")) {
return null; return null;
...@@ -376,14 +375,15 @@ public class RemoteSecurityService { ...@@ -376,14 +375,15 @@ public class RemoteSecurityService {
e.printStackTrace(); e.printStackTrace();
} }
return companyModel; 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) { public List<DepartmentModel> getDepartmentTreeByCompanyId(String toke,String product,String appKey,String companyId) {
if (companyId == null || companyId.equals("")) { if (companyId == null || companyId.equals("")) {
return null; return null;
...@@ -447,12 +447,6 @@ public class RemoteSecurityService { ...@@ -447,12 +447,6 @@ public class RemoteSecurityService {
* 基础平台全部菜单权限树,用于平台登录前端初始化路由 * 基础平台全部菜单权限树,用于平台登录前端初始化路由
*/ */
public CommonResponse searchPermissionTree(String toke,String product,String appKey,String appType) { public CommonResponse searchPermissionTree(String toke,String product,String appKey,String appType) {
// CommonResponse commonResponse = iAmosSecurityServer.listPermissionTree(appType);
// return commonResponse;
RequestContext.setToken(toke); RequestContext.setToken(toke);
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
...@@ -466,22 +460,17 @@ public class RemoteSecurityService { ...@@ -466,22 +460,17 @@ public class RemoteSecurityService {
e.printStackTrace(); e.printStackTrace();
} }
CommonResponse commonResponse =new CommonResponse("SUCCESS",dictionarieModel); CommonResponse commonResponse =new CommonResponse("SUCCESS",dictionarieModel);
return commonResponse ; return commonResponse ;
} }
//根据Code查询指定的字典信息. /**
* 根据Code查询指定的字典信息.
* @param toke
* @param product
* @param appKey
* @param dictCode
* @return
*/
public JSONArray listDictionaryByDictCode(String toke,String product,String appKey,String dictCode) { 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.setToken(toke);
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
...@@ -498,25 +487,24 @@ public class RemoteSecurityService { ...@@ -498,25 +487,24 @@ public class RemoteSecurityService {
String jsonStr = JSON.toJSONString(dictionarieModel); String jsonStr = JSON.toJSONString(dictionarieModel);
return JSONArray.parseArray(jsonStr); return JSONArray.parseArray(jsonStr);
} }
return null; return null;
} }
/** /**
* 查询指定公司信息与其部门用户树 * 查询指定公司信息与其部门用户树
* @param toke
* @param product
* @param appKey
* @param companyId
* @return
*/ */
public CompanyModel listUserByCompanyId1(String toke,String product,String appKey,String companyId) { public CompanyModel listUserByCompanyId1(String toke,String product,String appKey,String companyId) {
if (companyId == null || companyId.equals("")) { if (companyId == null || companyId.equals("")) {
return null; return null;
} }
//CommonResponse commonResponse = iAmosSecurityServer.getuserTreeByCompanyId(companyId);
// String jsonStr = JSON.toJSONString(commonResponse);
RequestContext.setToken(toke); RequestContext.setToken(toke);
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
//List<CompanyModel> companyModel=null;
CompanyModel companyModel=null; CompanyModel companyModel=null;
FeignClientResult feignClientResult; FeignClientResult feignClientResult;
try { try {
...@@ -527,21 +515,12 @@ public class RemoteSecurityService { ...@@ -527,21 +515,12 @@ public class RemoteSecurityService {
e.printStackTrace(); e.printStackTrace();
} }
return companyModel; return companyModel;
// return JSONObject.parseObject(jsonStr);
} }
public boolean loginOutFromApp(String toke,String product,String appKey) { public boolean loginOutFromApp(String toke,String product,String appKey) {
// CommonResponse commonResponse = iAmosSecurityServer.loginOutFromApp();
// if (commonResponse != null && commonResponse.isSuccess()) {
// return true;
// }
RequestContext.setToken(toke); RequestContext.setToken(toke);
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
...@@ -558,7 +537,6 @@ public class RemoteSecurityService { ...@@ -558,7 +537,6 @@ public class RemoteSecurityService {
} }
public JSONArray listDepartmentUserTree(String toke,String product,String appKey,String companyId) { public JSONArray listDepartmentUserTree(String toke,String product,String appKey,String companyId) {
RequestContext.setToken(toke); RequestContext.setToken(toke);
RequestContext.setProduct(product); RequestContext.setProduct(product);
RequestContext.setAppKey(appKey); RequestContext.setAppKey(appKey);
...@@ -580,24 +558,9 @@ public class RemoteSecurityService { ...@@ -580,24 +558,9 @@ public class RemoteSecurityService {
return JSONArray.parseArray(jsonStr); return JSONArray.parseArray(jsonStr);
} }
return null; 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) { 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; boolean flag=false;
RequestContext.setToken(toke); RequestContext.setToken(toke);
RequestContext.setProduct(product); RequestContext.setProduct(product);
...@@ -620,11 +583,6 @@ public class RemoteSecurityService { ...@@ -620,11 +583,6 @@ public class RemoteSecurityService {
if(agencyUserModel2!=null){ if(agencyUserModel2!=null){
flag=true; flag=true;
} }
// CommonResponse commonResponse = iAmosSecurityServer.editPassword(userId, request);
// if (commonResponse != null && commonResponse.isSuccess()) {
// return true;
// }
return false; 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 { ...@@ -27,8 +27,8 @@ public class AlarmServiceImpl implements IAlarmService {
if(StringUtil.isNotEmpty(param.getEndDate())){ if(StringUtil.isNotEmpty(param.getEndDate())){
param.setEndDate(param.getEndDate()+" "+"23:59:59"); param.setEndDate(param.getEndDate()+" "+"23:59:59");
} }
long total = alarmMapper.countPageData(param); long total = alarmMapper.countAlarmData();
List<HashMap<String, Object>> content = alarmMapper.getAlarmMapperPage(param); List<HashMap<String, Object>> content = alarmMapper.getAlarmSingleMapperPage(param);
Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total); Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total);
return result; return result;
} }
......
package com.yeejoin.amos.fas.business.service.impl;
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 { ...@@ -566,7 +566,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
} }
} }
// 获取遥信指标 // 获取遥信指标
List<Map> points = fireEquipPointMapper.getPointsByEquipmentIdAndType(equipment.getId(), "SWITCH"); List<Map> points = fireEquipPointMapper.getPointsByEquipmentIdAndType(equipment.getId(), "SWITCH");
HashMap<String, Integer> telesignallingMap = new HashMap<>(); HashMap<String, Integer> telesignallingMap = new HashMap<>();
...@@ -900,14 +899,41 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -900,14 +899,41 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
} }
} }
@Override @Override
@javax.transaction.Transactional @javax.transaction.Transactional
public String processFireEqumtData(AlarmParam deviceData) throws Exception { public String processFireEqumtData(AlarmParam deviceData) throws Exception {
// 格式化发送数据
sendRiskSourceData(deviceData);
blockingQueue.add(deviceData); blockingQueue.add(deviceData);
return "SUCCESS"; 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) { private void saveFireEquipmentData(FireEquipmentPoint fireEquipmentPoint, FireEquipment fireEquipment, AlarmParam deviceData, String fireEquipmentPointType) {
if ("alarm_type_fire".equals(fireEquipmentPointType) || "alarm_type_trouble".equals(fireEquipmentPointType)) { if ("alarm_type_fire".equals(fireEquipmentPointType) || "alarm_type_trouble".equals(fireEquipmentPointType)) {
Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(deviceData.getPointCode()); Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(deviceData.getPointCode());
...@@ -982,7 +1008,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService { ...@@ -982,7 +1008,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override @Override
public void saveData(List<AlarmParam> deviceDatas, String type) { public void saveData(List<AlarmParam> deviceDatas, String type) {
List<EquipCommunicationData> list = deviceDatas.stream().map(param -> { List<EquipCommunicationData> list = deviceDatas.stream().map(param -> {
log.debug("pointCode==" + param.getPointCode() + " InformationAddress==" + param.getInformationAddress()); log.debug("pointCode==" + param.getPointCode() + " InformationAddress==" + param.getInformationAddress());
// 格式化发送数据
sendRiskSourceData(param);
if (ObjectUtils.isEmpty(param.getPointCode())) { if (ObjectUtils.isEmpty(param.getPointCode())) {
EquipCommunicationData data = new EquipCommunicationData(); EquipCommunicationData data = new EquipCommunicationData();
data.setIsInvalid(param.getIsInvalid()); data.setIsInvalid(param.getIsInvalid());
......
...@@ -43,6 +43,7 @@ import org.springframework.data.domain.PageImpl; ...@@ -43,6 +43,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -573,14 +574,19 @@ public class View3dServiceImpl implements IView3dService { ...@@ -573,14 +574,19 @@ public class View3dServiceImpl implements IView3dService {
CommonPageable pageable = new CommonPageable( current, pageSize); CommonPageable pageable = new CommonPageable( current, pageSize);
Long count = view3dMapper.retrieveAllCount(type,inputText,orgCode,dataLevel,protectObjName); 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); 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->{ retrieveAll.stream().forEach(e->{
String person = (String)e.get("person");
String positionDTO = (String)e.get("positionDTO"); String positionDTO = (String)e.get("positionDTO");
JSONArray ue4Location = this.getInitJSONArray(String.valueOf(e.get("ue4Location"))); JSONArray ue4Location = this.getInitJSONArray(String.valueOf(e.get("ue4Location")));
JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(e.get("ue4Rotation"))); JSONArray ue4Rotation = this.getInitJSONArray(String.valueOf(e.get("ue4Rotation")));
if(person != null && !person.equals("")) { if(!ObjectUtils.isEmpty(e.get("person"))){
AgencyUserModel user = remoteSecurityService.getUserById(token, product, appKey, person); e.put("person", userMap.get(e.get("person").toString()));
e.put("person", user != null ? user.getRealName() : "");
} }
CoordDTO position = null; CoordDTO position = null;
if(positionDTO != null && !positionDTO.equals("")) { 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.password=a1234560
security.loginId=shg security.loginId=shg
security.productWeb=CONVERTER_STATION_WEB security.productWeb=CONVERTER_STATION_WEB
...@@ -69,4 +66,8 @@ rule.definition.default-agency=STATE_GRID ...@@ -69,4 +66,8 @@ rule.definition.default-agency=STATE_GRID
amos.feign.gennerator.use-gateway=true amos.feign.gennerator.use-gateway=true
autoSys.push.type=mqtt autoSys.push.type=mqtt
\ No newline at end of file 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/ ...@@ -60,4 +60,7 @@ DutyMode.dutyUrl=http://172.16.11.36:10005/
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF ##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
#\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/ ...@@ -60,4 +60,7 @@ DutyMode.dutyUrl=http://172.16.11.36:10005/
##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF ##\u89C4\u5219\u5BF9\u8C61\u81EA\u52A8\u626B\u63CF
rule.definition.load=true rule.definition.load=true
rule.definition.model-package=com.yeejoin.amos.fas.business.service.model rule.definition.model-package=com.yeejoin.amos.fas.business.service.model
\ No newline at end of file
#\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 server.port = 8083
...@@ -32,6 +31,8 @@ mybatis.mapper-locations = classpath:db/mapper/*.xml ...@@ -32,6 +31,8 @@ mybatis.mapper-locations = classpath:db/mapper/*.xml
# mybatis entity package # mybatis entity package
mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis mybatis.type-aliases-package = com.yeejoin.amos.fas.business.entity.mybatis
mybatis.configuration.mapUnderscoreToCamelCase=true mybatis.configuration.mapUnderscoreToCamelCase=true
mybatis.configuration.call-setters-on-nulls = true
logging.level.com.yeejoin.amos.fas.business.dao.mapper=debug logging.level.com.yeejoin.amos.fas.business.dao.mapper=debug
#liquibase #liquibase
...@@ -56,3 +57,4 @@ param.safetyIndexChange.cron = 0 0 2 * * ? ...@@ -56,3 +57,4 @@ param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey= param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey=
...@@ -110,4 +110,61 @@ ...@@ -110,4 +110,61 @@
END# END#
</sql> </sql>
</changeSet> </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> </databaseChangeLog>
\ No newline at end of file
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
<if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if> <if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if>
</trim> </trim>
</select> </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 id="getAlarmMapperPage" resultType="java.util.HashMap">
SELECT SELECT
...@@ -31,15 +37,20 @@ ...@@ -31,15 +37,20 @@
sa.code, sa.code,
sa.equip_code as equipCode, sa.equip_code as equipCode,
sa.name, sa.name,
sa.production_area prodArea, sa.prodArea,
sa.protectObj, sa.protectObj,
a.alarm_time AS alarmTime, a.create_date AS createDate,
a.alarm_type AS alarmType 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 FROM `f_alarm` a
inner join inner join
( (
select 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 from
f_equipment_fire_equipment b,f_equipment c, f_fire_equipment d f_equipment_fire_equipment b,f_equipment c, f_fire_equipment d
where where
...@@ -58,4 +69,31 @@ ...@@ -58,4 +69,31 @@
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose>
</select> </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> </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
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