Commit 6fa1c822 authored by 王果's avatar 王果

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into…

Merge remote-tracking branch 'origin/develop_tzs_register_to_0715' into develop_tzs_register_to_0715
parents 03d9ae5c 591a4d3f
......@@ -43,6 +43,23 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
* @param endDate
* @return
*/
List<Map<String, Object>> queryNearlyList(@Param("beginDate") String beginDate,
@Param("endDate") String endDate,
@Param("regionCode") String regionCode
);
/**
* 接警情况统计(按场所)
*
* @return
*/
List<Map<String, Object>> queryListByLocation(@Param("regionCode") String regionCode);
/**
* 接警情况统计
*
* @param beginDate
* @param endDate
* @return
*/
Map<String, Long> queryAlertStatusCount(@Param("beginDate") String beginDate,
@Param("endDate") String endDate,
@Param("groupCode") String groupCode,
......
......@@ -70,4 +70,6 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
Map<String, Object> selectMainUnitMessage(String sequenceNbr);
Map<String, Object> selectUseUnitByAlertId(String sequenceNbr);
List<Map<String, Object>> elevatorCountStat(@Param("regionCodes") List<String> regionCodes);
}
package com.yeejoin.amos.boot.module.elevator.api.mapper;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import org.apache.ibatis.annotations.Mapper;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-12-13
*/
@Mapper
public interface YjBaseMapper {
CompanyModel selectOneCompanyByCode(String companyCode);
String getOrgCodeByCompanyCode(String companyCode);
}
......@@ -122,6 +122,40 @@
</if>
</select>
<select id="queryNearlyList" resultType="java.util.Map">
SELECT
date_format (call_time, '%Y-%m-%d') AS day,
alarm_type as alarmType,
ifnull ( SUM ( CASE WHEN father_alert IS NULL THEN 1 ELSE 0 END ), 0) AS majorAlertCount
FROM
tz_alert_called
WHERE
biz_org_code like concat(#{regionCode}, '%')
AND day BETWEEN #{beginDate} AND #{endDate}
GROUP BY
day, alarm_type
ORDER BY
day ASC
</select>
<select id="queryListByLocation" resultType="java.util.Map">
SELECT
ifnull ( SUM ( CASE WHEN father_alert IS NULL THEN 1 ELSE 0 END ), 0 ) AS majorAlertCount,
cdd.NAME as name
FROM
tz_alert_called tac
LEFT JOIN idx_biz_jg_use_info ibjuj ON tac.equipment_id = ibjuj.RECORD
LEFT JOIN cb_data_dictionary cdd ON ibjuj.USE_PLACE = cdd.sequence_nbr
WHERE
biz_org_code LIKE concat(#{regionCode}, '%')
AND
ibjuj.USE_PLACE is NOT NULL
AND cdd.NAME is NOT NULL
GROUP BY
cdd.NAME
ORDER BY ibjuj.USE_PLACE ASC
</select>
<select id="queryAlertListByQueryDto" resultType="java.util.Map">
SELECT
a.sequence_nbr AS sequenceNbr,
......
......@@ -581,4 +581,20 @@
ibjmri.SEQUENCE_NBR = #{sequenceNbr}
</select>
<select id="elevatorCountStat" resultType="java.util.Map">
SELECT
district,
region_code as regionCode,
count(region_code) as total
FROM
tcb_elevator
WHERE
<if test="regionCodes != null">
<foreach collection="regionCodes" index="index" item="item" open="(" separator=" OR " close=")">
tcb_elevator.region_code LIKE CONCAT('%', #{item}, '%')
</foreach>
</if>
GROUP BY region_code
</select>
</mapper>
<?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.boot.module.elevator.api.mapper.YjBaseMapper">
<select id="getOrgCodeByCompanyCode" resultType="java.lang.String">
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select>
</mapper>
package com.yeejoin.amos.boot.module.elevator.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertMaintenanceUnitStatisticsDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto;
import com.yeejoin.amos.boot.module.elevator.biz.service.impl.DPStatisticsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.annotation.Validated;
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.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
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.List;
import java.util.Map;
/**
* 大屏统计controller
*
* @author Administrator
*/
@RestController
@RequestMapping("/db/statistics")
@Api(tags = "大屏统计")
public class DPStatisticsController {
private DPStatisticsServiceImpl statisticsService;
public DPStatisticsController(DPStatisticsServiceImpl statisticsService) {
this.statisticsService = statisticsService;
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-办理量 (近7日)", notes = "大屏-应急-办理量 (近7日)")
@PostMapping(value = "/yj/eventStatByDay")
public ResponseModel<JSONObject> eventStatByDay(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.eventStatByDay(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-电梯数量统计 (按区域)", notes = "大屏-应急-电梯数量统计 (按区域)")
@PostMapping(value = "/yj/elevatorCountStat")
public ResponseModel<JSONObject> elevatorCountStat(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.elevatorCountStat(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-事件分布 (按场所)", notes = "大屏-应急-事件分布 (按场所)")
@PostMapping(value = "/yj/eventStatByLocation")
public ResponseModel<JSONObject> eventStatByLocation(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.eventStatByLocation(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-困人救援月度情况", notes = "大屏-应急-困人救援月度情况")
@PostMapping(value = "/yj/trappedUserCount")
public ResponseModel<JSONObject> trappedUserCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.trappedUserCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-月度困人故障高发使用单位", notes = "大屏-应急-月度困人故障高发使用单位")
@PostMapping(value = "/yj/trappedUserHighCompanyCount")
public ResponseModel<List<AlertUseUnitStatisticsDto>> trappedUserHighCompanyCount(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.trappedUserHighCompanyCount(dpFilterParamDto));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "大屏-应急-维保单位平均救援时间排名", notes = "大屏-应急-维保单位平均救援时间排名")
@PostMapping(value = "/yj/rankUnitByRescueTime")
public ResponseModel<List<AlertMaintenanceUnitStatisticsDto>> rankUnitByRescueTime(@Validated @RequestBody DPFilterParamDto dpFilterParamDto, BindingResult result) throws Exception {
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
throw new BadRequest(fieldErrors.get(0).getDefaultMessage());
}
return ResponseHelper.buildResponse(statisticsService.rankUnitByRescueTime(dpFilterParamDto));
}
}
package com.yeejoin.amos.boot.module.elevator.biz.service.impl;
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.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertMaintenanceUnitStatisticsDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertUseUnitStatisticsDto;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertMaintenanceUnitStatistics;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertRescueStatistics;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertUseUnitStatistics;
import com.yeejoin.amos.boot.module.elevator.api.mapper.*;
import com.yeejoin.amos.boot.module.elevator.api.service.IAlertRescueStatisticsService;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
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 java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
* 大屏统计实现类
*
* @author Administrator
*/
@Service
@Slf4j
public class DPStatisticsServiceImpl {
private YjBaseMapper yjBaseMapper;
private AlertCalledMapper alertCalledMapper;
private ElevatorMapper elevatorMapper;
private AlertRescueStatisticsMapper alertRescueStatisticsMapper;
private AlertUseUnitStatisticsMapper alertUseUnitStatisticsMapper;
private AlertMaintenanceUnitStatisticsMapper alertMaintenanceUnitStatisticsMapper;
private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
private static Map<String, List<RegionModel>> regionChildRegionMap = new ConcurrentHashMap<>();
public DPStatisticsServiceImpl(YjBaseMapper yjBaseMapper, AlertCalledMapper alertCalledMapper, ElevatorMapper elevatorMapper, AlertRescueStatisticsMapper alertRescueStatisticsMapper, AlertUseUnitStatisticsMapper alertUseUnitStatisticsMapper, AlertMaintenanceUnitStatisticsMapper alertMaintenanceUnitStatisticsMapper) {
this.yjBaseMapper = yjBaseMapper;
this.alertCalledMapper = alertCalledMapper;
this.elevatorMapper = elevatorMapper;
this.alertRescueStatisticsMapper = alertRescueStatisticsMapper;
this.alertUseUnitStatisticsMapper = alertUseUnitStatisticsMapper;
this.alertMaintenanceUnitStatisticsMapper = alertMaintenanceUnitStatisticsMapper;
}
public JSONObject eventStatByDay(DPFilterParamDto dpFilterParamDto) throws Exception {
String beginDate = DateUtil.formatDate(DateTimeUtil.addDays(new Date(), -6), DateUtil.Y_M_D);
String endDate = DateUtil.getNow(DateUtil.Y_M_D);
String orgCode = this.getAndSetOrgCode(dpFilterParamDto);
List<String> everyDay = this.getEveryDay(beginDate, endDate);
JSONObject jsonObject = this.buildLegendData(null, "trapped", "困人");
this.buildLegendData(jsonObject, "complaint", "投诉");
this.buildLegendData(jsonObject, "fault", "故障");
List<String> xdata = new ArrayList<>();
List<Object> trapped = new ArrayList<>();
List<Object> complaint = new ArrayList<>();
List<Object> fault = new ArrayList<>();
List<Map<String, Object>> maps = alertCalledMapper.queryNearlyList(beginDate, endDate, orgCode);
everyDay.stream().forEach(day -> {
try {
xdata.add(DateUtil.formatDate(DateUtil.formatStringToDate(day, DateUtil.Y_M_D), "MM.dd"));
} catch (Exception e) {
throw new RuntimeException(e);
}
Map<String, Object> map = maps.stream().filter(x -> day.equals(x.get("day"))).collect(Collectors.toMap(
item -> (String) item.get("alarmType"),
item -> item.get("majorAlertCount")));
trapped.add(!ValidationUtil.isEmpty(map.get("困人救援")) ? Integer.valueOf(map.get("困人救援").toString()) : 0);
complaint.add(!ValidationUtil.isEmpty(map.get("投诉咨询")) ? Integer.valueOf(map.get("投诉咨询").toString()) : 0);
fault.add(!ValidationUtil.isEmpty(map.get("故障维修")) ? Integer.valueOf(map.get("故障维修").toString()) : 0);
});
jsonObject.put("xdata", xdata);
jsonObject.put("trapped", trapped);
jsonObject.put("complaint", complaint);
jsonObject.put("fault", fault);
return jsonObject;
}
public JSONObject elevatorCountStat(DPFilterParamDto dpFilterParamDto) throws Exception {
List<RegionModel> regionList = this.getRegionList(dpFilterParamDto);
List<String> regionCodes = regionList.stream().map(r -> r.getRegionCode().toString()).collect(Collectors.toList());
List<CompanyModel> companyList = Privilege.companyClient.queryListByCompanyCode(String.join(",", regionCodes)).getResult();
companyList = companyList.stream().sorted(Comparator.comparing(CompanyModel::getRegionSeq, Comparator.naturalOrder())).collect(Collectors.toList());
Map<String, RegionModel> regionMap = regionList.stream().collect(Collectors.toMap(r ->r.getRegionCode().toString(), r -> r));
List<Map<String, Object>> maps = elevatorMapper.elevatorCountStat(regionCodes);
Map<String, Object> map = maps.stream().collect(Collectors.toMap(
item -> (String) item.get("regionCode"),
item -> item.get("total")));
List<String> xdata = new ArrayList<>();
List<String> ydata = new ArrayList<>();
JSONObject jsonObject = new JSONObject();
companyList.stream().forEach(x -> {
xdata.add(x.getCompanyName());
});
jsonObject.put("xdata", xdata);
jsonObject.put("ydata", ydata);
return jsonObject;
}
public JSONObject eventStatByLocation(DPFilterParamDto dpFilterParamDto) throws Exception {
String orgCode = this.getAndSetOrgCode(dpFilterParamDto);
List<Map<String, Object>> maps = alertCalledMapper.queryListByLocation(orgCode);
List<Object> xdata = maps.stream().map(item -> item.get("name")).collect(Collectors.toList());
List<Object> ydata = maps.stream().map(item -> item.get("majorAlertCount")).collect(Collectors.toList());
JSONObject jsonObject = new JSONObject();
jsonObject.put("xdata", xdata);
jsonObject.put("ydata", ydata);
return jsonObject;
}
public JSONObject trappedUserCount(DPFilterParamDto dpFilterParamDto) throws Exception {
String date = DateUtil.formatDate(new Date(), "yyyy-MM");
String orgCode = this.getAndSetOrgCode(dpFilterParamDto);
LambdaQueryWrapper<AlertRescueStatistics> lambda = new QueryWrapper<AlertRescueStatistics>().lambda();
lambda.likeLeft(AlertRescueStatistics::getSupervisoryUnitOrgCode, orgCode);
lambda.eq(AlertRescueStatistics::getStatisticsDate, date);
List<AlertRescueStatistics> alertRescueStatistics = alertRescueStatisticsMapper.selectList(lambda);
List<Long> ydata = new ArrayList<>();
ydata.add(alertRescueStatistics.stream().collect(Collectors.summingLong(AlertRescueStatistics::getLessNum)));
ydata.add(alertRescueStatistics.stream().collect(Collectors.summingLong(AlertRescueStatistics::getGreaterNum)));
ydata.add(alertRescueStatistics.stream().collect(Collectors.summingLong(AlertRescueStatistics::getLevelOne)));
ydata.add(alertRescueStatistics.stream().collect(Collectors.summingLong(AlertRescueStatistics::getLevelTwo)));
ydata.add(alertRescueStatistics.stream().collect(Collectors.summingLong(AlertRescueStatistics::getLevelThree)));
JSONObject jsonObject = new JSONObject();
jsonObject.put("xdata", Arrays.asList("30分钟内到达次数", "超过30分钟到次数", "一级救援次数", "二级救援次数", "三级救援次数"));
jsonObject.put("ydata", ydata);
return jsonObject;
}
public List<AlertUseUnitStatisticsDto> trappedUserHighCompanyCount(DPFilterParamDto dpFilterParamDto) throws Exception {
String date = DateUtil.formatDate(new Date(), "yyyy-MM");
String orgCode = this.getAndSetOrgCode(dpFilterParamDto);
LambdaQueryWrapper<AlertUseUnitStatistics> lambda = new QueryWrapper<AlertUseUnitStatistics>().lambda();
lambda.likeLeft(AlertUseUnitStatistics::getSupervisoryUnitOrgCode, orgCode);
lambda.eq(AlertUseUnitStatistics :: getStatisticsDate, date);
List<AlertUseUnitStatistics> alertUseUnitStatistics = alertUseUnitStatisticsMapper.selectList(lambda);
return Bean.toModels(alertUseUnitStatistics, AlertUseUnitStatisticsDto.class);
}
public List<AlertMaintenanceUnitStatisticsDto> rankUnitByRescueTime(DPFilterParamDto dpFilterParamDto) throws Exception {
String date = DateUtil.formatDate(new Date(), "yyyy-MM");
String orgCode = this.getAndSetOrgCode(dpFilterParamDto);
LambdaQueryWrapper<AlertMaintenanceUnitStatistics> lambda = new QueryWrapper<AlertMaintenanceUnitStatistics>().lambda();
lambda.likeLeft(AlertMaintenanceUnitStatistics::getSupervisoryUnitOrgCode, orgCode);
lambda.eq(AlertMaintenanceUnitStatistics :: getStatisticsDate, "2023-12");
List<AlertMaintenanceUnitStatistics> alertMaintenanceUnitStatistics = alertMaintenanceUnitStatisticsMapper.selectList(lambda);
List<AlertMaintenanceUnitStatisticsDto> models = Bean.toModels(alertMaintenanceUnitStatistics, AlertMaintenanceUnitStatisticsDto.class);
return models;
}
private List<RegionModel> getRegionList(DPFilterParamDto dpFilterParamDto) {
try {
if (regionChildRegionMap.get(dpFilterParamDto.getCityCode()) == null) {
List<RegionModel> regionModels = this.setRegionIfRootParent(dpFilterParamDto.getCityCode());
regionChildRegionMap.put(dpFilterParamDto.getCityCode(), regionModels);
return regionModels;
} else {
return regionChildRegionMap.get(dpFilterParamDto.getCityCode());
}
} catch (Exception e) {
log.error("查询行政区域失败:{}", e.getMessage());
}
return new ArrayList<>();
}
private List<RegionModel> setRegionIfRootParent(String regionCode) throws Exception {
List<RegionModel> regionList = Systemctl.regionClient.queryByParentRegionCode(Integer.parseInt(regionCode)).getResult();
// 陕西省时需要在地图返回独立的地级市:韩城、杨凌、西咸
if (regionCode.equals(TZSCommonConstant.SHAN_XI_REGION_CODE)) {
List<RegionModel> independentRegions = ReginStepEnum.enum2RegionList("map");
regionList.addAll(independentRegions);
}
return regionList;
}
private String getAndSetOrgCode(DPFilterParamDto dpFilterParamDto) {
this.getRegionList(dpFilterParamDto);
String orgCode = regionCodeOrgCodeMap.get(dpFilterParamDto.getCityCode());
if (orgCode == null) {
orgCode = yjBaseMapper.getOrgCodeByCompanyCode(dpFilterParamDto.getCityCode());
if (orgCode == null) {
return "";
}
regionCodeOrgCodeMap.put(dpFilterParamDto.getCityCode(), orgCode);
}
return orgCode;
}
/**
* 获取两个时间段之间的每一天
* @param startTime 开始时间
* @param endTime 结束时间
* @return 结果
*/
public List<String> getEveryDay(String startTime, String endTime) {
List<String> dateList = new ArrayList<>();
LocalDate startDate = LocalDate.parse(startTime);
LocalDate endDate = LocalDate.parse(endTime);
long numOfDays = ChronoUnit.DAYS.between(startDate, endDate);
for (int i = 0; i <= numOfDays; i++) {
LocalDate currentDate = startDate.plusDays(i);
String format = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
dateList.add(format);
}
return dateList;
}
private JSONObject buildLegendData(JSONObject jsonObject, String dataKey, String value) {
if (ValidationUtil.isEmpty(jsonObject)){
jsonObject = new JSONObject();
}
JSONObject legendData = jsonObject.getJSONObject("legendData");
if (ValidationUtil.isEmpty(legendData)){
legendData = new JSONObject();
jsonObject.put("legendData", legendData);
}
legendData.put(dataKey, value);
return jsonObject;
};
}
package com.yeejoin.amos.boot.module.common.api.enums;
import lombok.Getter;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
@Getter
public enum IssueMainBodyEnum {
//个人
PERSON("个人","1"),
//企业
COMPANY("企业","2"),
//设备
EQUIPMENT("设备","3"),
//气瓶
CYLINDER("气瓶","4"),
;
String name;
String code;
private IssueMainBodyEnum(String name, String code) {
this.name = name;
this.code = code;
}
public static List<HashMap<String,String>> getEnumList() {
List<HashMap<String, String>> list = new ArrayList<>();
for (IssueMainBodyEnum testEnum : EnumSet.allOf(IssueMainBodyEnum.class)) {
HashMap<String, String> map = new HashMap<>();
map.put(testEnum.name,testEnum.code.toString());
list.add(map);
}
return list;
}
public static List<String> getEnumNameList() {
List<String> list = new ArrayList<>();
for (IssueMainBodyEnum testEnum : EnumSet.allOf(IssueMainBodyEnum.class)) {
list.add(testEnum.getName());
}
return list;
}
}
package com.yeejoin.amos.boot.module.common.api.enums;
import lombok.Getter;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
@Getter
public enum IssueTypeEnum {
//检验超期(设备)
CHECK_OVERDUE_EQUMENT("检验超期","2","3"),
//维保超期(设备)
MAINTENANCE_OVERDUE_EQUMENT("维保超期","1","3"),
//资质超期(设备)
QUALIFICATION_OVERDUE_EQUMENT("资质超期","3","3"),
//检验不合格(设备)
CHECK_UNQUALIFIED_EQUMENT("检验不合格","4","3"),
//超设计使用年限(设备)
DESIGN_OVERDUE_EQUMENT("超设计使用年限","5","3"),
//电梯困人(设备)
ELEVATOR_TRAPPED_EQUMENT("电梯困人","6","3"),
//电梯故障(设备)
ELEVATOR_FAULT_EQUMENT("电梯故障","7","3"),
//许可临期(公司)
LICENSE_EXPIRY_COMPANY("许可临期","8","2"),
//许可超期(公司)
LICENSE_OVERDUE_COMPANY("许可超期","9","2"),
//维保备案超期(公司)
MAINTENANCE_RECORD_OVERDUE_COMPANY("维保备案超期","10","2"),
//许可临期(个人)
LICENSE_EXPIRY_PERSON("许可临期","11","1"),
//许可超期(个人)
LICENSE_OVERDUE_PERSON("许可超期","12","1"),
//许可超期(气瓶)
LICENSE_OVERDUE_CYLINDER("许可超期","13","4"),
//检验超期(气瓶)
CHECK_OVERDUE_CYLINDER("检验超期","14","4"),
//检验不合格(气瓶)
CHECK_UNQUALIFIED_CYLINDER("检验不合格","15","4"),
//操作人员资质超期(气瓶)
OPERATOR_QUALIFICATION_OVERDUE_CYLINDER("操作人员资质超期","16","1"),
//充装异常(气瓶)
CHARGE_EXCEPTION_CYLINDER("充装异常","17","4"),
;
String name;
String code;
String mainBody;
private IssueTypeEnum(String name, String code, String mainBody) {
this.name = name;
this.code = code;
this.mainBody = mainBody;
}
public static List<HashMap<String,String>> getEnumList() {
List<HashMap<String, String>> list = new ArrayList<>();
for (IssueTypeEnum testEnum : EnumSet.allOf(IssueTypeEnum.class)) {
HashMap<String, String> map = new HashMap<>();
map.put(testEnum.name,testEnum.code.toString());
list.add(map);
}
return list;
}
public static List<String> getEnumNameListByMainBody(String mainBody) {
List<String> list = new ArrayList<>();
for (IssueTypeEnum testEnum : EnumSet.allOf(IssueTypeEnum.class)) {
if(mainBody.equals(testEnum.getMainBody())){
list.add(testEnum.getName());
}
}
return list;
}
}
package com.yeejoin.amos.boot.module.cylinder.api.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
@Mapper
public interface DPStatisticsMapper {
String getOrgCodeByCompanyCode(@Param("cityCode") String cityCode);
List<Map<String, Object>> selectByOrgAndMainBody(@Param("orgCode") String orgCode, @Param("mainBodyNameList") List<String> mainBodyNameList,
@Param("startDate") String startDate, @Param("status") String status);
List<Map<String, Object>> selectByOrgAndProblemType(@Param("orgCode") String orgCode, @Param("enumNameList") List<String> enumNameList,
@Param("startDate") String startDate, @Param("sourceType") String sourceType);
List<Map<String, Object>> getIssueCountByMonth(@Param("orgCode") String orgCode, @Param("year") String year, @Param("status") String status);
List<Map<String, Object>> getIssueCountByDate(@Param("orgCode") String orgCode, @Param("year") String year, @Param("status") String status);
}
<?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.boot.module.cylinder.api.mapper.DPStatisticsMapper">
<select id="getOrgCodeByCompanyCode" resultType="java.lang.String">
select org_code from privilege_company where company_code = #{cityCode} limit 1
</select>
<select id="selectByOrgAndMainBody" resultType="java.util.Map">
SELECT COUNT
( 1 ),
source_type AS sourceType
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND create_date &gt;= #{startDate}
AND source_type IN
<foreach collection="mainBodyNameList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
<if test="null != status">
AND problem_status_code = #{status}
</if>
GROUP BY
source_type
</select>
<select id="selectByOrgAndProblemType" resultType="java.util.Map">
SELECT COUNT
( 1 ),
problem_type AS problemType
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND create_date &gt;= #{startDate}
AND source_type = #{sourceType}
AND problem_type IN
<foreach collection="enumNameList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
GROUP BY
problem_type
</select>
<select id="getIssueCountByMonth" resultType="java.util.Map">
SELECT COUNT
( 1 ),
DATE_FORMAT(create_date,'%Y-%m') AS time
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND DATE_FORMAT(create_date,'%Y') = #{year}
<if test="null != status">
AND problem_status_code = #{status}
</if>
GROUP BY
DATE_FORMAT(create_date,'%Y-%m')
</select>
<select id="getIssueCountByDate" resultType="java.util.Map">
SELECT COUNT
( 1 ),
DATE_FORMAT(create_date,'%Y-%m-%d') AS time
FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
AND DATE_FORMAT(create_date,'%Y-%m-%d') &gt;= #{year}
<if test="null != status">
AND problem_status_code = #{status}
</if>
GROUP BY
DATE_FORMAT(create_date,'%Y-%m-%d')
</select>
</mapper>
......@@ -74,4 +74,88 @@ public class CylinderStatisticsController {
Map<String, Object> result = service.getsecurityIndex(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "问题类型主体统计")
@PostMapping(value = "/mainBodyCount")
public ResponseModel<Map<String, Object>> mainBodyCount(@RequestBody Map<String, Object> map ) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
}
Map<String, Object> result = service.mainBodyCount(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "设备问题近30天统计")
@PostMapping(value = "/equipmentCount")
public ResponseModel<Map<String, Object>> equipmentCount(@RequestBody Map<String, Object> map ) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
}
Map<String, Object> result = service.equipmentCount(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "企业问题近30天统计")
@PostMapping(value = "/companyCount")
public ResponseModel<List<Map<String, Object>>> companyCount(@RequestBody Map<String, Object> map ) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
}
List<Map<String, Object>> result = service.companyCount(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "人员问题近30天统计")
@PostMapping(value = "/personCount")
public ResponseModel<Map<String, Object>> personCount(@RequestBody Map<String, Object> map ) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
}
Map<String, Object> result = service.personCount(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "气瓶问题近30天统计")
@PostMapping(value = "/cylinderCount")
public ResponseModel<Map<String, Object>> cylinderCount(@RequestBody Map<String, Object> map ) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
}
Map<String, Object> result = service.cylinderCount(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "按月统计近12个月的问题数量趋势")
@PostMapping(value = "/issueCountByMonth")
public ResponseModel<Map<String, Object>> issueCountByMonth(@RequestBody Map<String, Object> map ) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
}
Map<String, Object> result = service.issueCountByMonth(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "按月统计近30天的问题数量趋势")
@PostMapping(value = "/issueCountByDay")
public ResponseModel<Map<String, Object>> issueCountByDay(@RequestBody Map<String, Object> map ) throws Exception {
Object regionCode = map.get("cityCode");
if (ObjectUtils.isEmpty(regionCode)) {
regionCode = "610000";
}
Map<String, Object> result = service.issueCountByDay(regionCode.toString());
return ResponseHelper.buildResponse(result);
};
}
......@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.module.common.api.constant.TZSCommonConstant;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.enums.IssueMainBodyEnum;
import com.yeejoin.amos.boot.module.common.api.enums.IssueTypeEnum;
import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum;
import com.yeejoin.amos.boot.module.cylinder.api.dto.KeyValueDto;
import com.yeejoin.amos.boot.module.cylinder.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.cylinder.api.entity.ESCylinderFillingRecordDto;
import com.yeejoin.amos.boot.module.cylinder.api.mapper.DPStatisticsMapper;
import com.yeejoin.amos.boot.module.cylinder.api.service.ITzBaseEnterpriseInfoService;
import com.yeejoin.amos.boot.module.cylinder.biz.dao.ESCylinderFillingRecordRepository;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CityCylinderInfoDto;
......@@ -39,11 +41,15 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
......@@ -67,6 +73,12 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
@Autowired
ITzBaseEnterpriseInfoService iTzBaseEnterpriseInfoService;
private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
@Resource
private DPStatisticsMapper statisticsMapper;
/**
* 分页查询
*/
......@@ -788,4 +800,265 @@ public class CylinderAreaDataServiceImpl extends BaseService<CylinderAreaDataDto
return result;
}
public Map<String, Object> mainBodyCount(String cityCode) {
Map<String,Object> resultMap = new HashMap<>();
Map<String,Object> dataMap = new HashMap<>();
String startDate = LocalDate.now().minusDays(100).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<String> mainBodyNameList = IssueMainBodyEnum.getEnumNameList();
String orgCode = getAndSetOrgCode(cityCode);
List<Map<String, Object>> list = statisticsMapper.selectByOrgAndMainBody(orgCode, mainBodyNameList, startDate,null);
List<Object> legendDataList = new ArrayList<>();
for(int i = 0; i < 2; i++){
Map<String, Object> map = new HashMap<>();
if(0 == i) {
map.put("dataKey", "problemCount");
map.put("value","问题数量");
}else if(1 == i){
map.put("dataKey", "problemRate");
map.put("value","问题闭环率");
}
legendDataList.add(map);
}
resultMap.put("legendData",legendDataList);
List<String> xdata = new ArrayList<>();
List<Object> problemCount = new ArrayList<>();
List<Object> problemRate = new ArrayList<>();
list.stream().forEach(t->{
dataMap.put(t.get("sourceType").toString(),t.get("count").toString());
});
for(int i = 0; i < mainBodyNameList.size(); i++){
if(null != dataMap.get(mainBodyNameList.get(i))){
problemCount.add(dataMap.get(mainBodyNameList.get(i)));
List<String> list1 = new ArrayList<>();
list1.add(mainBodyNameList.get(i));
List<Map<String, Object>> maps = statisticsMapper.selectByOrgAndMainBody(orgCode, list1, startDate, "1");
if(maps.size() > 0){
problemRate.add(new DecimalFormat("0.00").format(Double.parseDouble(dataMap.get(mainBodyNameList.get(i)).toString()) / Double.parseDouble(maps.get(0).get("count").toString())));
}else{
problemRate.add("0");
}
}else{
problemCount.add("0");
problemRate.add("0");
}
xdata.add(mainBodyNameList.get(i));
}
resultMap.put("xdata",xdata);
resultMap.put("problemCount",problemCount);
resultMap.put("problemRate",problemRate);
return resultMap;
}
private String getAndSetOrgCode(String cityCode) {
String orgCode = regionCodeOrgCodeMap.get(cityCode);
if (orgCode == null) {
orgCode = statisticsMapper.getOrgCodeByCompanyCode(cityCode);
if (orgCode != null) {
regionCodeOrgCodeMap.put(cityCode, orgCode);
}
}
return orgCode;
}
public Map<String, Object> equipmentCount(String cityCode) {
Map<String,Object> resultMap = new HashMap<>();
Map<String,Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String,Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate,IssueMainBodyEnum.EQUIPMENT.getName());
list.stream().forEach(t->{
dataMap.put(t.get("problemType").toString(),t.get("count").toString());
});
for(int i = 0; i < enumNameList.size(); i++){
xdata.add(enumNameList.get(i));
ydata.add(dataMap.getOrDefault(enumNameList.get(i),"0"));
}
resultMap.put("xdata",xdata);
resultMap.put("ydata",ydata);
return resultMap;
}
public List<Map<String, Object>> companyCount(String cityCode) {
List<Map<String,Object>> resultList = new ArrayList<>();
Map<String,Object> dataMap = new HashMap<>();
String orgCode = getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("2");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String,Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate,IssueMainBodyEnum.COMPANY.getName());
list.stream().forEach(t->{
dataMap.put(t.get("problemType").toString(),t.get("count").toString());
});
for(int i = 0; i < enumNameList.size(); i++){
Map<String,Object> map = new HashMap<>();
if(enumNameList.get(i).equals("许可临期")){
map.put("key","licenseExpirationDateNumber");
map.put("label","许可临期数");
map.put("value",dataMap.getOrDefault(enumNameList.get(i),"0"));
}else if(enumNameList.get(i).equals("许可超期")){
map.put("key","licenseOverdueNumber");
map.put("label","许可超期数");
map.put("value",dataMap.getOrDefault(enumNameList.get(i),"0"));
}else if(enumNameList.get(i).equals("维保备案超期")){
map.put("key","maintenanceFilingOverdueNumber");
map.put("label","维保备案超期数(仅电梯)");
map.put("value",dataMap.getOrDefault(enumNameList.get(i),"0"));
}
resultList.add(map);
}
return resultList;
}
public Map<String, Object> personCount(String cityCode) {
Map<String,Object> resultMap = new HashMap<>();
Map<String,Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("1");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String,Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.PERSON.getName());
list.stream().forEach(t->{
dataMap.put(t.get("problemType").toString(),t.get("count").toString());
});
for(int i = 0; i < enumNameList.size(); i++){
xdata.add(enumNameList.get(i));
ydata.add(dataMap.getOrDefault(enumNameList.get(i),"0"));
}
resultMap.put("xdata",xdata);
resultMap.put("ydata",ydata);
return resultMap;
}
public Map<String, Object> cylinderCount(String cityCode) {
Map<String,Object> resultMap = new HashMap<>();
Map<String,Object> dataMap = new HashMap<>();
List<Object> xdata = new ArrayList<>();
List<Object> ydata = new ArrayList<>();
String orgCode = getAndSetOrgCode(cityCode);
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("4");
String startDate = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String,Object>> list = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, startDate, IssueMainBodyEnum.CYLINDER.getName());
list.stream().forEach(t->{
dataMap.put(t.get("problemType").toString(),t.get("count").toString());
});
for(int i = 0; i < enumNameList.size(); i++){
xdata.add(enumNameList.get(i));
ydata.add(dataMap.getOrDefault(enumNameList.get(i),"0"));
}
resultMap.put("xdata",xdata);
resultMap.put("ydata",ydata);
return resultMap;
}
public Map<String, Object> issueCountByMonth(String cityCode) {
Map<String,Object> resultMap = new HashMap<>();
List<Object> legendData = new ArrayList<>();
for(int i = 0; i < 2; i++){
Map<String,Object> map = new HashMap<>();
if(i == 0){
map.put("key","problemCount");
map.put("value","问题数量");
}else{
map.put("key","processedRate");
map.put("value","已处理");
}
legendData.add(map);
}
resultMap.put("legendData",legendData);
String orgCode = getAndSetOrgCode(cityCode);
int year = LocalDate.now().getYear();
List<Map<String,Object>> allIssue = statisticsMapper.getIssueCountByMonth(orgCode,String.valueOf(year),null);
List<Map<String,Object>> endIssue = statisticsMapper.getIssueCountByMonth(orgCode,String.valueOf(year),"1");
Map<String,Object> allIssueMap = new HashMap<>();
Map<String,Object> endIssueMap = new HashMap<>();
allIssue.stream().forEach(t->{
allIssueMap.put(t.get("time").toString(),t.get("count"));
});
endIssue.stream().forEach(t->{
endIssueMap.put(t.get("time").toString(),t.get("count"));
});
List<Object> problemCount = new ArrayList<>();
List<Object> processedRate = new ArrayList<>();
List<Object> xdata = new ArrayList<>();
for(int i = 1; i <= 12; i++){
xdata.add(i+"月");
String time = LocalDate.now().minusMonths(i).format(DateTimeFormatter.ofPattern("yyyy-MM"));
if(allIssueMap.get(time) == null){
problemCount.add("0");
processedRate.add("0");
}else{
problemCount.add(allIssueMap.get(time));
if(endIssueMap.get(time) == null){
processedRate.add("0");
}else{
processedRate.add(new DecimalFormat("0.00").format(Double.parseDouble(endIssueMap.get(time).toString()) / Double.parseDouble(allIssueMap.get(time).toString())));
}
}
}
Collections.reverse(problemCount);
Collections.reverse(processedRate);
resultMap.put("xdata",xdata);
resultMap.put("problemCount",problemCount);
resultMap.put("processedRate",processedRate);
return resultMap;
}
public Map<String, Object> issueCountByDay(String cityCode) {
Map<String,Object> resultMap = new HashMap<>();
List<Object> legendData = new ArrayList<>();
for(int i = 0; i < 2; i++){
Map<String,Object> map = new HashMap<>();
if(i == 0){
map.put("key","problemCount");
map.put("value","问题数量");
}else{
map.put("key","processedRate");
map.put("value","已处理");
}
legendData.add(map);
}
resultMap.put("legendData",legendData);
String orgCode = getAndSetOrgCode(cityCode);
String year = LocalDate.now().minusDays(29).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<Map<String,Object>> allIssue = statisticsMapper.getIssueCountByDate(orgCode,year,null);
List<Map<String,Object>> endIssue = statisticsMapper.getIssueCountByDate(orgCode,year,"1");
Map<String,Object> allIssueMap = new HashMap<>();
Map<String,Object> endIssueMap = new HashMap<>();
allIssue.stream().forEach(t->{
allIssueMap.put(t.get("time").toString(),t.get("count"));
});
endIssue.stream().forEach(t->{
endIssueMap.put(t.get("time").toString(),t.get("count"));
});
List<Object> problemCount = new ArrayList<>();
List<Object> processedRate = new ArrayList<>();
List<Object> xdata = new ArrayList<>();
for(int i = 0; i < 29; i++){
xdata.add(LocalDate.now().minusDays(i).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
String time = LocalDate.now().minusMonths(i).format(DateTimeFormatter.ofPattern("yyyy-MM"));
if(allIssueMap.get(time) == null){
problemCount.add("0");
processedRate.add("0");
}else{
problemCount.add(allIssueMap.get(time));
if(endIssueMap.get(time) == null){
processedRate.add("0");
}else{
processedRate.add(new DecimalFormat("0.00").format(Double.parseDouble(endIssueMap.get(time).toString()) / Double.parseDouble(allIssueMap.get(time).toString())));
}
}
}
Collections.reverse(xdata);
Collections.reverse(problemCount);
Collections.reverse(processedRate);
resultMap.put("xdata",xdata);
resultMap.put("problemCount",problemCount);
resultMap.put("processedRate",processedRate);
return resultMap;
}
}
\ 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