Commit 1e68e16e authored by chenhao's avatar chenhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents d8ee8871 9e872afd
...@@ -23,6 +23,7 @@ public class DateUtils { ...@@ -23,6 +23,7 @@ public class DateUtils {
public static final String YEAR_PATTERN = "yyyy"; public static final String YEAR_PATTERN = "yyyy";
public static final String MINUTE_ONLY_PATTERN = "mm"; public static final String MINUTE_ONLY_PATTERN = "mm";
public static final String HOUR_ONLY_PATTERN = "HH"; public static final String HOUR_ONLY_PATTERN = "HH";
public static final String DATE_PATTERN_NUM = "yyyyMMdd";
/** /**
* 获取 当前年、半年、季度、月、日、小时 开始结束时间 * 获取 当前年、半年、季度、月、日、小时 开始结束时间
...@@ -707,4 +708,16 @@ public class DateUtils { ...@@ -707,4 +708,16 @@ public class DateUtils {
timeSdf.setTimeZone(TimeZone.getTimeZone("GMT+00:00")); timeSdf.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
return timeSdf.format(newTimes-oldTimes); return timeSdf.format(newTimes-oldTimes);
} }
/**
* 获取现在日期字符串时间戳格式
*
* @return返回字符串格式 yyyyMMdd
*/
public static String getDateNowShortNumber() {
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN_NUM);
String dateString = formatter.format(currentTime);
return dateString;
}
} }
...@@ -107,6 +107,9 @@ public interface IOrgUsrService { ...@@ -107,6 +107,9 @@ public interface IOrgUsrService {
* @throws Exception * @throws Exception
*/ */
Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception; Map<String, Object> selectForShowById(OrgUsr orgUsr, Long id) throws Exception;
Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception;
List<OrgUsr> selectCompanyDepartmentMsg(); List<OrgUsr> selectCompanyDepartmentMsg();
...@@ -141,7 +144,7 @@ public interface IOrgUsrService { ...@@ -141,7 +144,7 @@ public interface IOrgUsrService {
OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception; OrgDepartmentFormDto selectDepartmentById(Long id) throws Exception;
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception; List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
List<Map<String, Object>> selectForShowByListIdUser(List<Long> ids) throws Exception;
/** /**
* * @param null * * @param null
* *
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto; import com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation; import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -21,4 +22,6 @@ public interface RescueStationMapper extends BaseMapper<RescueStation> { ...@@ -21,4 +22,6 @@ public interface RescueStationMapper extends BaseMapper<RescueStation> {
* @return * @return
*/ */
List<RescueStationDto> getListByLatLonDistance(String lat, String lon, Integer distance); List<RescueStationDto> getListByLatLonDistance(String lat, String lon, Integer distance);
List<RescueStationDto> selectExportData(@Param("ids") List<String> ids);
} }
...@@ -23,4 +23,5 @@ public interface IRescueStationService extends IService<RescueStation> { ...@@ -23,4 +23,5 @@ public interface IRescueStationService extends IService<RescueStation> {
*/ */
List<RescueStationDto> getListByLatLonDistance(String lat, String lon, Integer distance); List<RescueStationDto> getListByLatLonDistance(String lat, String lon, Integer distance);
List<RescueStationDto> selectExportData(String exportId);
} }
...@@ -44,4 +44,18 @@ ...@@ -44,4 +44,18 @@
</select> </select>
<select id="selectExportData" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto">
select t.*
from tcb_rescue_station t where t.is_delete = 0
<if test="ids != null and ids.size() > 0">
and t.sequence_nbr in
<foreach item="item" collection="ids" separator="," open="(" close=")" index=""> #{item}
</foreach>
</if>
</select>
</mapper> </mapper>
...@@ -613,6 +613,49 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -613,6 +613,49 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return result; return result;
} }
@Override
public Map<String, Object> selectForShowByIduser(OrgUsr orgUsr, Long id) throws Exception {
QueryWrapper<DynamicFormColumn> queryWrapper = new QueryWrapper<DynamicFormColumn>();
queryWrapper.eq("group_code", OrgPersonEnum.人员.getCode());
List<DynamicFormColumn> alertForms = alertFormServiceImpl.list(queryWrapper);
// 动态表单数据
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
Map<String, Object> result = new HashMap<>();
result = Bean.BeantoMap(orgUsr);
// 放入所有动态表单数据
for (DynamicFormColumn alertForm : alertForms) {
result.put(alertForm.getFieldCode(), null);
}
result.put("parenName", orgUsr.getParentId() != null?getByIduser(orgUsr.getParentId()).getBizOrgName():"");
for (DynamicFormInstanceDto alertFormValue : list) {
result.put(alertFormValue.getFieldCode(),
ObjectUtils.isEmpty(alertFormValue.getFieldValueLabel()) ? alertFormValue.getFieldValue()
: alertFormValue.getFieldValueLabel());
}
return result;
}
@Override @Override
public List<OrgUsr> selectCompanyDepartmentMsg() { public List<OrgUsr> selectCompanyDepartmentMsg() {
List<OrgUsr> list = this.baseMapper.selectCompanyDepartmentMsg(); List<OrgUsr> list = this.baseMapper.selectCompanyDepartmentMsg();
...@@ -942,7 +985,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -942,7 +985,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
return personResult; return personResult;
} }
@Override
public List<Map<String, Object>> selectForShowByListIdUser(List<Long> ids) throws Exception {
List<Map<String, Object>> personResult = new ArrayList<>();
for (int i = 0; i < ids.size(); i++) {
OrgUsr orgUsr = getByIduser(ids.get(i));
Map<String, Object> result = selectForShowByIduser(orgUsr, ids.get(i));
personResult.add(result);
}
return personResult;
}
@Override @Override
public List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData) { public List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData) {
if (null == pageNum || null == pageSize) { if (null == pageNum || null == pageSize) {
...@@ -1625,6 +1677,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1625,6 +1677,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUser; return orgUser;
} }
public OrgUsr getByIduser(Serializable id) {
OrgUsr orgUser = this.baseMapper.selectById(id);
return orgUser;
}
public Object amosIdExist(String amosId) { public Object amosIdExist(String amosId) {
List<OrgUsr> orgUsrs = orgUsrMapper.amosIdExist(amosId); List<OrgUsr> orgUsrs = orgUsrMapper.amosIdExist(amosId);
if (orgUsrs.size() > 0) { if (orgUsrs.size() > 0) {
......
...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; ...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
...@@ -55,7 +56,6 @@ import java.util.stream.Collectors; ...@@ -55,7 +56,6 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
/** /**
* 警情接警记录 * 警情接警记录
* *
...@@ -85,6 +85,10 @@ public class AlertCalledController extends BaseController { ...@@ -85,6 +85,10 @@ public class AlertCalledController extends BaseController {
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Value("${redis.cache.failure.time}") @Value("${redis.cache.failure.time}")
private long time; private long time;
private static String ALETR_TYPE_AID = "1214";
private static String ALETR_TYPE_AID_STATUS = "patientStatus";
/** /**
* 新增警情接警记录 * 新增警情接警记录
* *
...@@ -94,18 +98,40 @@ public class AlertCalledController extends BaseController { ...@@ -94,18 +98,40 @@ public class AlertCalledController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录") @ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录")
@Transactional @Transactional
public ResponseModel<AlertCalled> saveAlertCalled(@RequestBody AlertCalledObjsDto alertCalledObjsDto) throws Exception{ public ResponseModel<AlertCalled> saveAlertCalled(@RequestBody AlertCalledObjsDto alertCalledObjsDto) throws Exception {
if (ValidationUtil.isEmpty(alertCalledObjsDto) if (ValidationUtil.isEmpty(alertCalledObjsDto)
|| ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalled())) || ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalled()))
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
//获取当前登录人公司 //获取当前登录人公司
String name= reginParams.getCompany().getCompanyName(); String name = reginParams.getCompany().getCompanyName();
AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled(); AlertCalled alertCalled = alertCalledObjsDto.getAlertCalled();
alertCalled.setCompanyName(name); alertCalled.setCompanyName(name);
if (alertCalled.getAlertTypeCode().equals(ALETR_TYPE_AID)) {
List<AlertFormValue> alertFormValue = alertCalledObjsDto.getAlertFormValue();
alertFormValue.forEach(e -> {
if (e.getFieldCode().equals(ALETR_TYPE_AID_STATUS)) {
if (e.getFieldValueCode() != null) {
if (e.getFieldValueCode().contains(",")) {
String[] split = e.getFieldValueCode().split(",");
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < split.length; i++) {
DataDictionary hzxz = dataDictionaryService.getByCode(split[i], "HZXZ");
stringBuilder.append(hzxz.getName() + " ");
e.setFieldValue(stringBuilder.toString());
}
} else {
DataDictionary hzxz = dataDictionaryService.getByCode(e.getFieldValueCode(), "HZXZ");
e.setFieldValue(hzxz.getName());
}
}
}
});
alertCalledObjsDto.setAlertFormValue(alertFormValue);
}
alertCalledObjsDto.setAlertCalled(alertCalled); alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto =iAlertCalledService.createAlertCalled(alertCalledObjsDto); alertCalledObjsDto = iAlertCalledService.createAlertCalled(alertCalledObjsDto);
return ResponseHelper.buildResponse(alertCalledObjsDto.getAlertCalled()); return ResponseHelper.buildResponse(alertCalledObjsDto.getAlertCalled());
} }
...@@ -161,7 +187,7 @@ public class AlertCalledController extends BaseController { ...@@ -161,7 +187,7 @@ public class AlertCalledController extends BaseController {
String alertTypeCode, String alertTypeCode,
String alertSourceCode, String alertSourceCode,
String callTimeStart, String callTimeStart,
String callTimeEnd){ String callTimeEnd) {
/* Page<AlertCalled> pageBean; /* Page<AlertCalled> pageBean;
IPage<AlertCalled> page; IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>(); QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
...@@ -175,7 +201,7 @@ public class AlertCalledController extends BaseController { ...@@ -175,7 +201,7 @@ public class AlertCalledController extends BaseController {
page.setCurrent(0L); page.setCurrent(0L);
page.setSize(Long.MAX_VALUE); page.setSize(Long.MAX_VALUE);
} else { } else {
page.setCurrent( (Long.parseLong(pageNum) - 1) * Long.parseLong(pageSize)); page.setCurrent((Long.parseLong(pageNum) - 1) * Long.parseLong(pageSize));
page.setSize(Long.parseLong(pageSize)); page.setSize(Long.parseLong(pageSize));
} }
/*分页存在问题 修改分页参数 陈召 2021-09-22 结束*/ /*分页存在问题 修改分页参数 陈召 2021-09-22 结束*/
...@@ -184,10 +210,10 @@ public class AlertCalledController extends BaseController { ...@@ -184,10 +210,10 @@ public class AlertCalledController extends BaseController {
/* bug2408 筛选参数解析异常 修改筛选条件方法 修改入参分离筛选条件 /* bug2408 筛选参数解析异常 修改筛选条件方法 修改入参分离筛选条件
alertStatus 警情状态 alertTypeCode 报警类型code alertSourceCode 警情来源code alertStatus 警情状态 alertTypeCode 报警类型code alertSourceCode 警情来源code
陈召 2021-08-21 开始*/ 陈召 2021-08-21 开始*/
IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(page, alertStatus,alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd,sort); IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(page, alertStatus, alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd, sort);
/* bug 2406 接警记录,列表缺少警情状态字段 by litw start*/ /* bug 2406 接警记录,列表缺少警情状态字段 by litw start*/
alertCalledIPage.getRecords().stream().forEach(e->{ alertCalledIPage.getRecords().stream().forEach(e -> {
if(e.getAlertStatus()) { if (e.getAlertStatus()) {
e.setAlertStatusStr(AlertStatusEnum.CLOSED.getName()); e.setAlertStatusStr(AlertStatusEnum.CLOSED.getName());
} else { } else {
e.setAlertStatusStr(AlertStatusEnum.UNCLOSED.getName()); e.setAlertStatusStr(AlertStatusEnum.UNCLOSED.getName());
...@@ -200,7 +226,6 @@ public class AlertCalledController extends BaseController { ...@@ -200,7 +226,6 @@ public class AlertCalledController extends BaseController {
} }
/** /**
*
* <pre> * <pre>
* 相似警情分页查询 * 相似警情分页查询
* </pre> * </pre>
...@@ -223,8 +248,8 @@ public class AlertCalledController extends BaseController { ...@@ -223,8 +248,8 @@ public class AlertCalledController extends BaseController {
List<ESAlertCalledDto> records = esAlertCalledDtoPage.getRecords(); List<ESAlertCalledDto> records = esAlertCalledDtoPage.getRecords();
for (ESAlertCalledDto record : records) { for (ESAlertCalledDto record : records) {
if (record.getResponseLevelCode() != null){ if (record.getResponseLevelCode() != null) {
DataDictionary byCode = dataDictionaryService.getByCode(record.getResponseLevelCode(),"XYJBR"); DataDictionary byCode = dataDictionaryService.getByCode(record.getResponseLevelCode(), "XYJBR");
record.setResponseLevel(byCode.getName()); record.setResponseLevel(byCode.getName());
} }
} }
...@@ -233,7 +258,6 @@ public class AlertCalledController extends BaseController { ...@@ -233,7 +258,6 @@ public class AlertCalledController extends BaseController {
} }
/** /**
*
* <pre> * <pre>
* 初始化ES * 初始化ES
* </pre> * </pre>
...@@ -257,23 +281,23 @@ public class AlertCalledController extends BaseController { ...@@ -257,23 +281,23 @@ public class AlertCalledController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "列表无分页查询", notes = "列表无分页查询") @ApiOperation(httpMethod = "GET", value = "列表无分页查询", notes = "列表无分页查询")
public ResponseModel<List<AlertCalled>> list(AlertCalled alertCalled) { public ResponseModel<List<AlertCalled>> list(AlertCalled alertCalled) {
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>(); QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
setQueryWrapper(alertCalledQueryWrapper, alertCalled,null); setQueryWrapper(alertCalledQueryWrapper, alertCalled, null);
List<AlertCalled> list = iAlertCalledService.list(alertCalledQueryWrapper); List<AlertCalled> list = iAlertCalledService.list(alertCalledQueryWrapper);
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
private QueryWrapper<AlertCalled> setQueryWrapper(QueryWrapper<AlertCalled> queryWrapper, AlertCalled alertCalled,String sort){ private QueryWrapper<AlertCalled> setQueryWrapper(QueryWrapper<AlertCalled> queryWrapper, AlertCalled alertCalled, String sort) {
Class<? extends AlertCalled> aClass = alertCalled.getClass(); Class<? extends AlertCalled> aClass = alertCalled.getClass();
queryWrapper.eq("is_delete", 0); queryWrapper.eq("is_delete", 0);
if(sort!=null) { if (sort != null) {
String[] date= sort.split(","); String[] date = sort.split(",");
if(date[1].equals("ascend")) { if (date[1].equals("ascend")) {
queryWrapper.orderByAsc(RedisKey.humpToLine(date[0])); queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
}else { } else {
queryWrapper.orderByDesc(RedisKey.humpToLine(date[0])); queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
} }
}else { } else {
queryWrapper.orderByDesc("call_time"); queryWrapper.orderByDesc("call_time");
} }
...@@ -283,7 +307,7 @@ public class AlertCalledController extends BaseController { ...@@ -283,7 +307,7 @@ public class AlertCalledController extends BaseController {
if (alertCalled.getIsFatherAlert()) { // 0:接警;1:处警 if (alertCalled.getIsFatherAlert()) { // 0:接警;1:处警
queryWrapper.isNull("father_alert"); queryWrapper.isNull("father_alert");
} }
if (!ValidationUtil.isEmpty(alertCalled.getAlertSourceCodeStr())){ if (!ValidationUtil.isEmpty(alertCalled.getAlertSourceCodeStr())) {
String[] arr = alertCalled.getAlertSourceCodeStr().split(","); String[] arr = alertCalled.getAlertSourceCodeStr().split(",");
List<String> collect = Arrays.stream(arr).collect(Collectors.toList()); List<String> collect = Arrays.stream(arr).collect(Collectors.toList());
queryWrapper.in("alert_source_code", collect); queryWrapper.in("alert_source_code", collect);
...@@ -308,7 +332,7 @@ public class AlertCalledController extends BaseController { ...@@ -308,7 +332,7 @@ public class AlertCalledController extends BaseController {
} else if (type.equals(Boolean.class)) { } else if (type.equals(Boolean.class)) {
Boolean fileValue = (Boolean) field.get(alertCalled); Boolean fileValue = (Boolean) field.get(alertCalled);
queryWrapper.eq(name, fileValue); queryWrapper.eq(name, fileValue);
}else if (type.equals(Long.class) || "long".equals(type.toString())) { } else if (type.equals(Long.class) || "long".equals(type.toString())) {
Long fileValue = (Long) field.get(alertCalled); Long fileValue = (Long) field.get(alertCalled);
queryWrapper.eq(name, fileValue); queryWrapper.eq(name, fileValue);
} }
...@@ -335,7 +359,6 @@ public class AlertCalledController extends BaseController { ...@@ -335,7 +359,6 @@ public class AlertCalledController extends BaseController {
} }
/** /**
*
* <pre> * <pre>
* 设备联动紧急响应 * 设备联动紧急响应
* 启动所有消防队伍的警铃、广播,并自动开启所有车库门 * 启动所有消防队伍的警铃、广播,并自动开启所有车库门
...@@ -349,7 +372,7 @@ public class AlertCalledController extends BaseController { ...@@ -349,7 +372,7 @@ public class AlertCalledController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "设备联动紧急响应", notes = "启动所有消防队伍的警铃、广播,并自动开启所有车库门") @ApiOperation(httpMethod = "POST", value = "设备联动紧急响应", notes = "启动所有消防队伍的警铃、广播,并自动开启所有车库门")
@Transactional @Transactional
@RestEventTrigger(value = "opreateLogEventHandler") @RestEventTrigger(value = "opreateLogEventHandler")
public ResponseModel<Boolean> controlEquip() throws Exception{ public ResponseModel<Boolean> controlEquip() throws Exception {
return ResponseHelper.buildResponse(iAlertCalledService.controlEquip()); return ResponseHelper.buildResponse(iAlertCalledService.controlEquip());
} }
...@@ -366,7 +389,8 @@ public class AlertCalledController extends BaseController { ...@@ -366,7 +389,8 @@ public class AlertCalledController extends BaseController {
@RequestParam String latitude) { @RequestParam String latitude) {
return ResponseHelper.buildResponse(iAlertCalledService.reLocate(alertCalled, longitude, latitude)); return ResponseHelper.buildResponse(iAlertCalledService.reLocate(alertCalled, longitude, latitude));
} }
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/ /*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
/** /**
* 警情填报联系人模糊查询 * 警情填报联系人模糊查询
* *
...@@ -376,14 +400,14 @@ public class AlertCalledController extends BaseController { ...@@ -376,14 +400,14 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAmosId", method = RequestMethod.GET) @RequestMapping(value = "/getAmosId", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询") @ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询")
public ResponseModel< Object> getContact ( ) { public ResponseModel<Object> getContact() {
if (redisUtils.hasKey(RedisKey.CONTACT_USER)) { if (redisUtils.hasKey(RedisKey.CONTACT_USER)) {
Object obj = redisUtils.get(RedisKey.CONTACT_USER); Object obj = redisUtils.get(RedisKey.CONTACT_USER);
return ResponseHelper.buildResponse(obj); return ResponseHelper.buildResponse(obj);
} else { } else {
List<Map<String, String>> contactName = iAlertCalledService.getContactName(); List<Map<String, String>> contactName = iAlertCalledService.getContactName();
redisUtils.set(RedisKey.CONTACT_USER , contactName, time); redisUtils.set(RedisKey.CONTACT_USER, contactName, time);
return ResponseHelper.buildResponse(contactName); return ResponseHelper.buildResponse(contactName);
} }
} }
...@@ -397,7 +421,7 @@ public class AlertCalledController extends BaseController { ...@@ -397,7 +421,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAddress", method = RequestMethod.GET) @RequestMapping(value = "/getAddress", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报地址模糊查询", notes = "警情填报地址模糊查询") @ApiOperation(httpMethod = "GET", value = "警情填报地址模糊查询", notes = "警情填报地址模糊查询")
public ResponseModel<List<String>> getAddress () { public ResponseModel<List<String>> getAddress() {
return ResponseHelper.buildResponse(iAlertCalledService.getCalledAddress()); return ResponseHelper.buildResponse(iAlertCalledService.getCalledAddress());
} }
...@@ -412,12 +436,12 @@ public class AlertCalledController extends BaseController { ...@@ -412,12 +436,12 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAlarmGiveStatistics", method = RequestMethod.GET) @RequestMapping(value = "/getAlarmGiveStatistics", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "app领导统计", notes = "app领导统计") @ApiOperation(httpMethod = "GET", value = "app领导统计", notes = "app领导统计")
public ResponseModel<AlarmGiveStatisticsDto> getAlarmGiveStatistics () { public ResponseModel<AlarmGiveStatisticsDto> getAlarmGiveStatistics() {
AlarmGiveStatisticsDto dto = new AlarmGiveStatisticsDto(); AlarmGiveStatisticsDto dto = new AlarmGiveStatisticsDto();
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.isNull(AlertCalled::getFatherAlert); queryWrapper.isNull(AlertCalled::getFatherAlert);
queryWrapper.eq(AlertCalled::getAlertStatus,true); queryWrapper.eq(AlertCalled::getAlertStatus, true);
queryWrapper.eq(AlertCalled::getIsDelete,false); queryWrapper.eq(AlertCalled::getIsDelete, false);
Integer alertNum = iAlertCalledService.getBaseMapper().selectCount(queryWrapper); Integer alertNum = iAlertCalledService.getBaseMapper().selectCount(queryWrapper);
dto.setAlarmNum(alertNum); dto.setAlarmNum(alertNum);
...@@ -433,13 +457,13 @@ public class AlertCalledController extends BaseController { ...@@ -433,13 +457,13 @@ public class AlertCalledController extends BaseController {
map = monitorEvent.getResult(); map = monitorEvent.getResult();
int monitorEventNum = !ValidationUtil.isEmpty(map.get("monitorEventNum")) ? Integer.valueOf(map.get("monitorEventNum").toString()) : 0; int monitorEventNum = !ValidationUtil.isEmpty(map.get("monitorEventNum")) ? Integer.valueOf(map.get("monitorEventNum").toString()) : 0;
dto.setIotDetection(fireAlarmNum+faultAlarmNum+monitorEventNum); dto.setIotDetection(fireAlarmNum + faultAlarmNum + monitorEventNum);
ResponseModel<Object> currentHiddenDanger = latentDangerFeignClient.getUnFinishedDangerCount(); ResponseModel<Object> currentHiddenDanger = latentDangerFeignClient.getUnFinishedDangerCount();
Integer currentHiddenDangerNum = (Integer) currentHiddenDanger.getResult(); Integer currentHiddenDangerNum = (Integer) currentHiddenDanger.getResult();
dto.setCurrentHiddenDanger(currentHiddenDangerNum); dto.setCurrentHiddenDanger(currentHiddenDangerNum);
dto.setAllNum(dto.getAlarmNum()+dto.getIotDetection()+currentHiddenDangerNum); dto.setAllNum(dto.getAlarmNum() + dto.getIotDetection() + currentHiddenDangerNum);
return ResponseHelper.buildResponse(dto); return ResponseHelper.buildResponse(dto);
} }
......
...@@ -222,11 +222,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -222,11 +222,11 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmitted.setSchedulingTypeCode(alertSchedulingTypeEnum.get().getCode()); alertSubmitted.setSchedulingTypeCode(alertSchedulingTypeEnum.get().getCode());
alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName()); alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName());
alertSubmitted.setSubmissionContent(JSONObject.toJSONString(objectToMap(calledRo))); alertSubmitted.setSubmissionContent(JSONObject.toJSONString(objectToMap(calledRo)));
String token = RequestContext.getToken(); // String token = RequestContext.getToken();
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),token)).toString(), // ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(),token)).toString(),
ReginParams.class); // ReginParams.class);
alertSubmitted.setRecUserName(reginParams.getUserModel().getUserName()); // alertSubmitted.setRecUserName(reginParams.getUserModel().getUserName());
alertSubmitted.setSender(reginParams.getUserModel().getUserName()); // alertSubmitted.setSender(reginParams.getUserModel().getUserName());
alertSubmitted.setUpdateTime(new Date()); alertSubmitted.setUpdateTime(new Date());
alertSubmitted.setSubmissionTime(new Date()); alertSubmitted.setSubmissionTime(new Date());
...@@ -238,7 +238,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -238,7 +238,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsCode = alertBusinessTypeEnum.get().getSms_code(); smsCode = alertBusinessTypeEnum.get().getSms_code();
} }
// 组装人员信息 // 组装人员信息
List<Map<String, Object>> orgUsers = orgUsrService.selectForShowByListId(ids); List<Map<String, Object>> orgUsers = orgUsrService.selectForShowByListIdUser(ids);
for (Map<String, Object> orgUser : orgUsers) { for (Map<String, Object> orgUser : orgUsers) {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
......
...@@ -5,11 +5,13 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,11 +5,13 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ExportDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ExportDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.TemplateExport; import com.yeejoin.amos.boot.module.tzs.api.entity.TemplateExport;
import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService; import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService;
import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService; import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -18,7 +20,11 @@ import io.swagger.annotations.ApiOperation; ...@@ -18,7 +20,11 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TemplateExportServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TemplateExportServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...@@ -57,6 +63,9 @@ public class TemplateExportController extends BaseController { ...@@ -57,6 +63,9 @@ public class TemplateExportController extends BaseController {
@Autowired @Autowired
ElevatorServiceImpl elevatorServiceImpl; ElevatorServiceImpl elevatorServiceImpl;
@Autowired
IRescueStationService iRescueStationService;
/** /**
* 新增模板表 * 新增模板表
* *
...@@ -140,9 +149,23 @@ public class TemplateExportController extends BaseController { ...@@ -140,9 +149,23 @@ public class TemplateExportController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "模板表列表全部数据查询", notes = "模板表列表全部数据查询") @ApiOperation(httpMethod = "GET",value = "模板表列表全部数据查询", notes = "模板表列表全部数据查询")
@GetMapping(value = "/list/{type}") @GetMapping(value = "/list/{type}")
public ResponseModel<List<TemplateExport>> selectForList(@PathVariable String type) { public ResponseModel<Map<String, Object>> selectForList(@PathVariable String type) {
Map<String, Object> result = new HashMap<>();
List<TemplateExport> list = templateExportServiceImpl.list(new LambdaQueryWrapper<TemplateExport>().eq(TemplateExport::getIsDelete,0).eq(TemplateExport::getTemplateType,type).orderByDesc(TemplateExport::getIsStandard)); List<TemplateExport> list = templateExportServiceImpl.list(new LambdaQueryWrapper<TemplateExport>().eq(TemplateExport::getIsDelete,0).eq(TemplateExport::getTemplateType,type).orderByDesc(TemplateExport::getIsStandard));
return ResponseHelper.buildResponse(list); result.put("list",list);
String fileName = null;
if("ELEVATOR".equals(type)) { // 查询电梯数据
fileName = "电梯信息";
} else if("MAINTENANCE_COMPANY".equals(type)) { // 查询维保单位数据
fileName = "维保单位";
} else if("USE_UNIT".equals(type)) { // 查询使用单位数据
fileName = "使用单位";
} else if("RESCUE_STATION".equals(type)) { // 查询救援站数据
fileName = "救援站";
}
fileName += DateUtils.getDateNowShortNumber();
result.put("fileName",fileName);
return ResponseHelper.buildResponse(result);
} }
...@@ -166,7 +189,6 @@ public class TemplateExportController extends BaseController { ...@@ -166,7 +189,6 @@ public class TemplateExportController extends BaseController {
} else { } else {
exportDto.setExportId(""); exportDto.setExportId("");
} }
System.out.println(exportDto.getExportArray());
JSONArray jsonArray = JSONArray.parseArray(exportDto.getExportArray()); JSONArray jsonArray = JSONArray.parseArray(exportDto.getExportArray());
List<List<String>> heads = Lists.newArrayList(); List<List<String>> heads = Lists.newArrayList();
List<String> headstr = Lists.newArrayList(); List<String> headstr = Lists.newArrayList();
...@@ -188,6 +210,9 @@ public class TemplateExportController extends BaseController { ...@@ -188,6 +210,9 @@ public class TemplateExportController extends BaseController {
} else if("USE_UNIT".equals(exportDto.getExportType())) { // 查询使用单位数据 } else if("USE_UNIT".equals(exportDto.getExportType())) { // 查询使用单位数据
sheetName = "使用单位"; sheetName = "使用单位";
list = iUseUnitService.selectExportData(exportDto.getExportId()); list = iUseUnitService.selectExportData(exportDto.getExportId());
} else if("RESCUE_STATION".equals(exportDto.getExportType())) { // 查询救援站数据
sheetName = "救援站";
list = iRescueStationService.selectExportData(exportDto.getExportId());
} }
ExcelUtil.createTemplateWithHeaders(response, fileName, sheetName, list, ElevatorDto.class, null, false, heads, headstr, exportDto.getFileType()); ExcelUtil.createTemplateWithHeaders(response, fileName, sheetName, list, ElevatorDto.class, null, false, heads, headstr, exportDto.getFileType());
......
...@@ -4,10 +4,12 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto; ...@@ -4,10 +4,12 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation; import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation;
import com.yeejoin.amos.boot.module.tzs.api.mapper.RescueStationMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.RescueStationMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService; import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
...@@ -26,4 +28,14 @@ public class RescueStationServiceImpl extends BaseService<RescueStationDto, Resc ...@@ -26,4 +28,14 @@ public class RescueStationServiceImpl extends BaseService<RescueStationDto, Resc
public List<RescueStationDto> getListByLatLonDistance(String lat, String lon, Integer distance) { public List<RescueStationDto> getListByLatLonDistance(String lat, String lon, Integer distance) {
return rescueStationMapper.getListByLatLonDistance(lat,lon,distance); return rescueStationMapper.getListByLatLonDistance(lat,lon,distance);
} }
@Override
public List<RescueStationDto> selectExportData(String exportId) {
List<String> ids = null;
if(StringUtils.isNotEmpty(exportId)) {
String[] idStr = exportId.split(",");
ids = Arrays.asList(idStr);
}
return baseMapper.selectExportData(ids);
}
} }
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