Commit 2c10d4ca authored by 韩桐桐's avatar 韩桐桐

fix():1,接口迁移

parent 52475bdc
......@@ -865,29 +865,4 @@ public class AlertCalledController extends BaseController {
page.setSize(pageSize);
return ResponseHelper.buildResponse(iAlertCalledService.getAlertCalledRecords(page, alertCalledQueryDto, cityCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-警情类型", notes = "应急大屏使用-警情类型")
@GetMapping("/alertOperations/dp")
public ResponseModel<Object> alertOperations() {
return ResponseHelper.buildResponse(iAlertCalledService.alertOperations());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-报警类型", notes = "应急大屏使用-报警类型")
@GetMapping("/alertTypeOperations/dp")
public ResponseModel<Object> alertTypeOperations() {
HashMap<String, String> map = new HashMap<>();
map.put(AlertStageEnums.JQCB.getId(),AlertStageEnums.JQCB.getValue());
map.put(AlertStageEnums.JQGB.getId(),AlertStageEnums.JQGB.getValue());
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格",
notes = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格")
@PostMapping("/alertRecordTable/dp")
public ResponseModel<IPage<AlertCalledDto>> alertRecordTableForDP(DPFilterParamForDetailDto recordFilterVo) {
return iAlertCalledService.alertRecordTableForDP(recordFilterVo);
}
}
......@@ -1318,70 +1318,4 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return parseArray(json, FormValue.class);
}
public JSONObject alertOperations() {
Collection<DataDictionary> JQLXList = iDataDictionaryService.list(
new QueryWrapper<DataDictionary>()
.eq("type", "JQLX")
.eq("is_delete", false)
.orderByAsc("sort_num")
);
List<JSONObject> subList = JQLXList.stream()
.map(jq -> {
JSONObject obj = new JSONObject();
obj.put("value", jq.getCode());
obj.put("title", jq.getName());
return obj;
}).collect(Collectors.toList());
JSONObject jsonObject = new JSONObject();
jsonObject.put("title", "应急事件");
jsonObject.put("value", "yjsj");
jsonObject.put("children", subList);
return jsonObject;
}
public ResponseModel<IPage<AlertCalledDto>> alertRecordTableForDP(DPFilterParamForDetailDto recordFilterVo) {
String orgCode = getAndSetOrgCode(recordFilterVo.getCityCode());
QueryWrapper<AlertCalled> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_delete", 0);
queryWrapper.orderByDesc("rec_date");
// 组织机构
if (!ValidationUtil.isEmpty(orgCode)) {
queryWrapper.likeRight("biz_org_code", orgCode);
}
// 分页参数
if (ValidationUtil.isEmpty(recordFilterVo.getCurrent()) || ValidationUtil.isEmpty(recordFilterVo.getSize())) {
recordFilterVo.setCurrent(0);
recordFilterVo.setSize(Integer.MAX_VALUE);
}
// 警情类型
if (!ValidationUtil.isEmpty(recordFilterVo.getTreeValue()) && !"yjsj".equals(recordFilterVo.getTreeValue())) {
queryWrapper.eq("alarm_type_code", recordFilterVo.getTreeValue());
}
// 报警类型
if (!ValidationUtil.isEmpty(recordFilterVo.getTypeCode())) {
queryWrapper.eq("type_code", recordFilterVo.getTypeCode());
}
// 警情来源
if (!ValidationUtil.isEmpty(recordFilterVo.getAlertSourceCode())) {
queryWrapper.eq("alert_source_code", recordFilterVo.getAlertSourceCode());
}
// 警情起止时间
if (!ValidationUtil.isEmpty(recordFilterVo.getTimeSearchOne())){
if (!ValidationUtil.isEmpty(recordFilterVo.getTimeSearchOne().getBeginDate()) && !ValidationUtil.isEmpty(recordFilterVo.getTimeSearchOne().getEndDate())) {
queryWrapper.between("call_time", recordFilterVo.getTimeSearchOne().getBeginDate(), recordFilterVo.getTimeSearchOne().getEndDate());
}
}
IPage<AlertCalled> page = this.page(new Page<>(recordFilterVo.getCurrent(), recordFilterVo.getSize()), queryWrapper);
IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page);
return ResponseHelper.buildResponse(calledVoIPage);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* Mapper 接口
......@@ -40,4 +43,9 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
* @return 被困人数
*/
Long countRescuedPersonNum(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto filterParamDto);
@MapKey(value = "alertRecordForPage")
Page<Map<String, Object>> alertRecordForPage(@Param("page") Page<Map<String, Object>> page,
@Param("dto") DPFilterParamForDetailDto dto,
@Param("orgCode") String orgCode);
}
......@@ -185,12 +185,14 @@
<if test="dto != null and dto.timeSearchOne != null and dto.timeSearchOne.endDate != null and dto.timeSearchOne.endDate != ''">
and date_le(CAST(call_time as date), #{dto.timeSearchOne.endDate})
</if>
<if test="dto.alertTypeCode !=null and dto.alertTypeCode !=''">
<choose>
<when test="dto.alertTypeCode != null and dto.alertTypeCode != ''">
and alarm_type_code = #{dto.alertTypeCode}
</if>
<if test="dto.alertTypeCode == null or dto.alertTypeCode == ''">
</when>
<otherwise>
and (alarm_type_code = '960' or alarm_type_code = '961' or alarm_type_code = '962')
</if>
</otherwise>
</choose>
<if test="dto.typeCode !=null and dto.typeCode !=''">
and type_code = #{dto.typeCode}
</if>
......@@ -198,4 +200,40 @@
and alert_source_code = #{dto.alertSourceCode}
</if>
</select>
<select id="alertRecordForPage" resultType="java.util.Map">
SELECT *
FROM tz_alert_called
<where>
is_delete = 0
and biz_org_code like concat(#{orgCode}, '%')
<if test="dto != null and dto.timeSearchOne != null and dto.timeSearchOne.beginDate != null and dto.timeSearchOne.beginDate != ''">
and date_ge(CAST(call_time as date), #{dto.timeSearchOne.beginDate})
</if>
<if test="dto != null and dto.timeSearchOne != null and dto.timeSearchOne.endDate != null and dto.timeSearchOne.endDate != ''">
and date_le(CAST(call_time as date), #{dto.timeSearchOne.endDate})
</if>
<choose>
<when test="dto.alertTypeCode != null and dto.alertTypeCode != ''">
and alarm_type_code = #{dto.alertTypeCode}
</when>
<otherwise>
and (alarm_type_code = '960' or alarm_type_code = '961' or alarm_type_code = '962')
</otherwise>
</choose>
<if test="dto.typeCode != null and dto.typeCode != ''">
and type_code = #{dto.typeCode}
</if>
<if test="dto.alertSourceCode != null and dto.alertSourceCode != ''">
and alert_source_code = #{dto.alertSourceCode}
</if>
</where>
ORDER BY rec_date DESC
</select>
</mapper>
package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.YJDPStatisticsServiceImpl;
import com.yeejoin.amos.boot.module.statistics.api.dto.AlertUseUnitStatisticsDto;
import com.yeejoin.amos.boot.module.ymt.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.ymt.api.enums.AlertStageEnums;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
......@@ -18,6 +20,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -166,4 +169,28 @@ public class YJDPStatisticsController {
public ResponseModel<Object> alertRecordBarChartForDP(@RequestBody DPFilterParamForDetailDto recordFilterVo) {
return ResponseHelper.buildResponse(statisticsService.alertRecordBarChartForDP(recordFilterVo));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-警情类型", notes = "应急大屏使用-警情类型")
@GetMapping("/alertOperations/dp")
public ResponseModel<Object> alertOperations() {
return ResponseHelper.buildResponse(statisticsService.alertOperations());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-报警类型", notes = "应急大屏使用-报警类型")
@GetMapping("/alertTypeOperations/dp")
public ResponseModel<Object> alertTypeOperations() {
HashMap<String, String> map = new HashMap<>();
map.put(AlertStageEnums.JQCB.getId(),AlertStageEnums.JQCB.getValue());
map.put(AlertStageEnums.JQGB.getId(), AlertStageEnums.JQGB.getValue());
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格",
notes = "应急大屏使用-办理量 (近7天)-右上角更多-各地市业务办理情况-底部表格")
@PostMapping("/alertRecordTable/dp")
public ResponseModel<IPage<Map<String, Object>>> alertRecordTableForDP(DPFilterParamForDetailDto recordFilterVo) {
return statisticsService.alertRecordTableForDP(recordFilterVo);
}
}
......@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
......@@ -42,6 +44,8 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.DateTimeUtil;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.IOException;
import java.time.LocalDate;
......@@ -505,4 +509,36 @@ public class YJDPStatisticsServiceImpl {
legendSubData.put("chartType", "bar");
return legendSubData;
}
public JSONObject alertOperations() {
Collection<DataDictionary> JQLXList = dataDictionaryService.list(
new QueryWrapper<DataDictionary>()
.eq("type", "JQLX")
.eq("is_delete", false)
.orderByAsc("sort_num")
);
List<JSONObject> subList = JQLXList.stream()
.map(jq -> {
JSONObject obj = new JSONObject();
obj.put("value", jq.getCode());
obj.put("title", jq.getName());
return obj;
}).collect(Collectors.toList());
JSONObject jsonObject = new JSONObject();
jsonObject.put("title", "应急事件");
jsonObject.put("value", "yjsj");
jsonObject.put("children", subList);
return jsonObject;
}
public ResponseModel<IPage<Map<String, Object>>> alertRecordTableForDP(DPFilterParamForDetailDto recordFilterVo) {
String orgCode = stCommonService.getAndSetOrgCode(recordFilterVo.getCityCode());
if (!ValidationUtil.isEmpty(recordFilterVo.getTreeValue())){
recordFilterVo.setAlertTypeCode(recordFilterVo.getTreeValue());
}
Page<Map<String, Object>> mapPage = alertStatisticsMapper.alertRecordForPage(new Page<>(recordFilterVo.getCurrent(), recordFilterVo.getSize()),recordFilterVo,orgCode);
return ResponseHelper.buildResponse(mapPage);
}
}
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