大屏接口修复
This commit is contained in:
parent
275f043866
commit
d723421778
@ -5,6 +5,7 @@ import cn.hutool.http.HttpUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.zhgd.xmgl.enums.BaseEnum;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionaryItem;
|
||||
import com.zhgd.xmgl.util.NumberUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -99,7 +100,7 @@ public class SectorVo {
|
||||
public static SectorVo getSectorVo(List<SectorOneVo> list) {
|
||||
SectorVo vo = new SectorVo();
|
||||
vo.setData(list);
|
||||
vo.setCount(String.valueOf(list.stream().map(o -> Double.parseDouble(o.getCount())).mapToDouble(value -> value).sum()));
|
||||
vo.setCount(NumberUtils.subZeroAndDot(String.valueOf(list.stream().map(o -> Double.parseDouble(o.getCount())).mapToDouble(value -> value).sum())));
|
||||
calPercent(vo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@ -1,11 +1,23 @@
|
||||
package com.zhgd.xmgl.constant;
|
||||
|
||||
public interface Cts {
|
||||
/*****************sql开始*********************/
|
||||
String ASC = "asc";
|
||||
String DESC = "desc";
|
||||
String ORDER = "order";
|
||||
String DEFAULT_PASSWORD = "a!12345678";
|
||||
String QUERY_TYPE = "queryType";
|
||||
/**
|
||||
* 查询日期
|
||||
*/
|
||||
String QUERY_DATE = "queryDate";
|
||||
String TODAY = "today";
|
||||
String YESTERDAY = "yesterday";
|
||||
String YEAR_MONTH = "yearMonth";
|
||||
String GROUP_BY = "groupBy";
|
||||
String LAST_WEEK_BY_DATE = "lastWeekByDate";
|
||||
|
||||
/*****************sql结束*********************/
|
||||
|
||||
String DEFAULT = "default";
|
||||
String SN = "sn";
|
||||
String PROJECT_LEVEL_AND_CHILDREN = "projectLevelAndChildren";
|
||||
@ -13,24 +25,23 @@ public interface Cts {
|
||||
String PROJECT_SN = "projectSn";
|
||||
String EXPIRED = "expired";
|
||||
String ID = "id";
|
||||
String TODAY = "today";
|
||||
|
||||
String REDIS_HIKVISION_COMPARE_DATA = "HIKVISION_COMPARE_DATA_";
|
||||
String SUCCESS = "success";
|
||||
String MSG = "msg";
|
||||
String ENTERPRISE_ID = "enterpriseId";
|
||||
|
||||
/**
|
||||
* 数据校验重试是否成功
|
||||
*/
|
||||
String TL_XZ_HIKVISION_COMPARE_DATA_RETRY = "tl_xz_hikvision_compare_data";
|
||||
String TL_IS_FROM_TASK = "isFromTask";
|
||||
String TL_IS_FROM_WEB = "isFromWeb";
|
||||
|
||||
String TYPE = "type";
|
||||
String TEAM_ID = "teamId";
|
||||
String TL_IS_FROM_TASK = "isFromTask";
|
||||
String DEPARTMENT_ID = "departmentId";
|
||||
String RESERVATION_TYPE = "reservationType";
|
||||
String TL_IS_FROM_WEB = "isFromWeb";
|
||||
String QUERY_DATE = "queryDate";
|
||||
String YESTERDAY = "yesterday";
|
||||
String YEAR_MONTH = "yearMonth";
|
||||
String GROUP_BY = "groupBy";
|
||||
String LAST_WEEK_BY_DATE = "lastWeekByDate";
|
||||
String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
String YYYY_MM_DD = "yyyy-MM-dd";
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@ public class ProjectCompanyWorkTotal {
|
||||
private Integer presencePersonNum;
|
||||
@ApiModelProperty(value = "出勤人数")
|
||||
private Integer attendancePersonNum;
|
||||
@ApiModelProperty(value = "昨日出勤人数")
|
||||
private Integer attendancePersonNumYesterday;
|
||||
@ApiModelProperty(value = "在册人数")
|
||||
private Integer totalPersonNum;
|
||||
@ApiModelProperty(value = "企业id")
|
||||
|
||||
@ -95,14 +95,6 @@ public interface WorkerAttendanceMapper extends BaseMapper<WorkerAttendance> {
|
||||
|
||||
List<SafetyPerformanceAnalysisVo> safetyPerformanceAnalysis(@Param("param") Map<String, Object> paramMap);
|
||||
|
||||
/**
|
||||
* 查询每个公司的在册、出勤情况
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
List<ProjectCompanyWorkTotal> queryAttendanceOfEachCompany(@Param("param") Map<String, Object> map);
|
||||
|
||||
List<ProjectCompanyWorkTotal> queryAttendanceOfEachCompanyForMain(@Param("param") Map<String, Object> map);
|
||||
|
||||
|
||||
|
||||
@ -875,57 +875,36 @@
|
||||
where wi.project_sn=#{param.projectSn} AND wi.inService_type = 1
|
||||
group by t.id
|
||||
</select>
|
||||
<sql id="queryAttendanceOfEachCompany">
|
||||
SELECT t.enterprise_id as enterpriseId,
|
||||
COUNT(DISTINCT p.person_sn) as presencePersonNum,
|
||||
ei.enterprise_name,
|
||||
COUNT(DISTINCT a.person_sn) attendancePersonNum,
|
||||
COUNT(DISTINCT t.person_sn) totalPersonNum,
|
||||
t.enterprise_id as mainEnterpriseId
|
||||
from worker_info t
|
||||
LEFT JOIN enterprise_info ei on ei.id=t.enterprise_id
|
||||
LEFT JOIN project_enterprise pe on pe.enterprise_id=t.enterprise_id and pe.project_sn=t.project_sn
|
||||
LEFT JOIN worker_attendance_presence p ON t.person_sn = p.person_sn
|
||||
LEFT JOIN worker_attendance a ON t.person_sn = a.person_sn
|
||||
WHERE t.project_sn = #{param.projectSn}
|
||||
and pe.parent_project_enterprise_id = 0
|
||||
and t.inService_type = 1
|
||||
group by t.enterprise_id
|
||||
</sql>
|
||||
<select id="queryAttendanceOfEachCompany"
|
||||
resultType="com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal">
|
||||
<include refid="queryAttendanceOfEachCompany">
|
||||
</include>
|
||||
</select>
|
||||
|
||||
<select id="queryAttendanceOfEachCompanyForMain"
|
||||
resultType="com.zhgd.xmgl.modules.worker.entity.vo.ProjectCompanyWorkTotal">
|
||||
select
|
||||
t.mainEnterpriseId as enterpriseId,
|
||||
t.enterprise_name,
|
||||
ifnull(sum(t.presencePersonNum),0) as presencePersonNum,
|
||||
ifnull(sum(t.attendancePersonNum),0) as attendancePersonNum,
|
||||
ifnull(sum(t.totalPersonNum),0) as totalPersonNum
|
||||
t.*,
|
||||
ifnull(round(t.attendancePersonNum/t.totalPersonNum*100,2),0) as attendancePersonRate,
|
||||
ifnull(round((t.attendancePersonNum - t.attendancePersonNumYesterday)/t.attendancePersonNumYesterday*100,2),0)
|
||||
as attendancePersonRhbRate
|
||||
from (
|
||||
<include refid="queryAttendanceOfEachCompany">
|
||||
</include>
|
||||
union all
|
||||
SELECT t.enterprise_id as enterpriseId,
|
||||
SELECT
|
||||
mei.id as enterpriseId,
|
||||
COUNT(DISTINCT p.person_sn) as presencePersonNum,
|
||||
ei.enterprise_name,
|
||||
mei.enterprise_name,
|
||||
COUNT(DISTINCT a.person_sn) attendancePersonNum,
|
||||
COUNT(DISTINCT t.person_sn) totalPersonNum,
|
||||
e.enterprise_id as mainEnterpriseId
|
||||
COUNT(DISTINCT a1.person_sn) attendancePersonNumYesterday,
|
||||
COUNT(DISTINCT t.person_sn) totalPersonNum
|
||||
from worker_info t
|
||||
JOIN enterprise_info ei on ei.id=t.enterprise_id
|
||||
JOIN project_enterprise e on e.enterprise_id=t.enterprise_id and e.project_sn=t.project_sn and
|
||||
e.parent_project_enterprise_id = 0
|
||||
join project_enterprise pe2 on find_in_set(e.id,pe2.ancestors)
|
||||
LEFT JOIN worker_attendance_presence p ON t.person_sn = p.person_sn
|
||||
LEFT JOIN worker_attendance a ON t.person_sn = a.person_sn
|
||||
where e.project_sn = #{param.projectSn}
|
||||
JOIN project_enterprise pe on pe.enterprise_id=t.enterprise_id and pe.project_sn=t.project_sn
|
||||
JOIN enterprise_info mei ON mei.id =
|
||||
IF( pe.parent_enterprise_id = 0,ei.id, (SELECT enterprise_id from project_enterprise WHERE id = substring_index(
|
||||
substring_index( pe.ancestors, ',', 2 ), ',', - 1 ))) LEFT JOIN worker_attendance_presence p ON t.person_sn =
|
||||
p.person_sn
|
||||
LEFT JOIN worker_attendance a ON t.person_sn = a.person_sn and a.create_time >= CURRENT_DATE
|
||||
LEFT JOIN worker_attendance a1 ON t.person_sn = a1.person_sn
|
||||
and a1.create_time >= CONCAT(DATE_FORMAT(DATE_SUB(now(), interval 1 day), '%Y-%m-%d'), ' 00:00:00')
|
||||
and a1.create_time <= CONCAT(DATE_FORMAT(DATE_SUB(now(), interval 1 day), '%Y-%m-%d'), ' 23:59:59')
|
||||
WHERE t.project_sn = #{param.projectSn}
|
||||
and t.inService_type = 1
|
||||
group by mainEnterpriseId
|
||||
)t group by mainEnterpriseId
|
||||
group by enterpriseId
|
||||
)t
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1078,7 +1078,7 @@ status 状态码 String 1表示成功;其余表示失败
|
||||
AttendanceOfEachCompanyVo vo = new AttendanceOfEachCompanyVo();
|
||||
if (Objects.equals(isCountMainEnterprise, 1)) {
|
||||
List<ProjectCompanyWorkTotal> list = baseMapper.queryAttendanceOfEachCompanyForMain(map);
|
||||
vo.setAttendanceNum(null);
|
||||
vo.setAttendanceNum(list.stream().mapToInt(ProjectCompanyWorkTotal::getAttendancePersonNum).sum());
|
||||
vo.setProjectCompanyWorkTotalList(list);
|
||||
|
||||
} else {
|
||||
|
||||
@ -586,7 +586,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
private void setYesterday(Map<String, Object> map, PersonTypeAndEduStatisticsVo.AttendancePerson attendancePerson) {
|
||||
map.put(Cts.QUERY_DATE, Cts.YESTERDAY);
|
||||
Map<String, Object> ap = workerInfoMapper.selectAttendanceWorkerPersonTypeTotal(map);
|
||||
attendancePerson.setTotalPersonRhbRatio(NumberUtils.rate(Double.valueOf(attendancePerson.getTotalPerson()), MapUtils.getDouble(map, "totalPerson"), 2));
|
||||
attendancePerson.setTotalPersonRhbRatio(NumberUtils.rate(Double.valueOf(attendancePerson.getTotalPerson()), MapUtils.getDouble(ap, "totalPerson"), 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -29,6 +29,27 @@ public class XzSecurityQualityInspectionRecordTotalVo {
|
||||
private Integer lowRiskNum;
|
||||
|
||||
|
||||
@ApiModelProperty("未(待)整改数(今日)")
|
||||
private Integer rectificationNumToday;
|
||||
@ApiModelProperty("待(未)复查(今日)")
|
||||
private Integer reviewNumToday;
|
||||
@ApiModelProperty("待(未)核验(今日)")
|
||||
private Integer verificationNumToday;
|
||||
@ApiModelProperty("合格(已闭合)(今日)")
|
||||
private Integer closeNumToday;
|
||||
@ApiModelProperty("超期未关闭(今日)")
|
||||
private Integer overdueNotCloseNumToday;
|
||||
|
||||
@ApiModelProperty(value = "重大隐患(今日)")
|
||||
private Integer greatFaultLevelNumToday;
|
||||
@ApiModelProperty(value = "较大风险(今日)")
|
||||
private Integer largerRiskNumToday;
|
||||
@ApiModelProperty(value = "一般风险(今日)")
|
||||
private Integer generalRiskNumToday;
|
||||
@ApiModelProperty(value = "低风险(今日)")
|
||||
private Integer lowRiskNumToday;
|
||||
|
||||
|
||||
@ApiModelProperty("未(待)整改数(昨日)")
|
||||
private Integer rectificationNumYesterday;
|
||||
@ApiModelProperty("待(未)复查(昨日)")
|
||||
@ -38,7 +59,7 @@ public class XzSecurityQualityInspectionRecordTotalVo {
|
||||
@ApiModelProperty("合格(已闭合)(昨日)")
|
||||
private Integer closeNumYesterday;
|
||||
@ApiModelProperty("超期未关闭(昨日)")
|
||||
private Integer overdueNotCloseNYesterdayum;
|
||||
private Integer overdueNotCloseNumYesterday;
|
||||
|
||||
@ApiModelProperty(value = "重大隐患(昨日)")
|
||||
private Integer greatFaultLevelNumYesterday;
|
||||
@ -109,4 +130,7 @@ public class XzSecurityQualityInspectionRecordTotalVo {
|
||||
@ApiModelProperty(value = "月环比")
|
||||
private String monthlyBasis;
|
||||
|
||||
@ApiModelProperty(value = "过去一周每天")
|
||||
private String lastWeekByDate;
|
||||
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
|
||||
private XzSecurityQualityInspectionRecordTotalVo getXzSecurityQualityInspectionRecordTotalVo(Map<String, Object> map) {
|
||||
XzSecurityQualityInspectionRecordTotalVo total = xzSecurityQualityInspectionRecordMapper.selectQualityInspectionRecordPageTotal(map);
|
||||
setDifferYesterday(map, total);
|
||||
setTodayAndYesterday(map, total);
|
||||
return total;
|
||||
}
|
||||
|
||||
@ -243,34 +243,38 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
return xzSecuritySelectQualityStatisticsVo;
|
||||
}
|
||||
|
||||
private void setDifferYesterday(Map<String, Object> map, XzSecurityQualityInspectionRecordTotalVo vo) {
|
||||
private void setTodayAndYesterday(Map<String, Object> map, XzSecurityQualityInspectionRecordTotalVo vo) {
|
||||
map.put("inspectStartTime", DateUtil.format(DateUtil.beginOfDay(DateUtil.yesterday()), Cts.YYYY_MM_DD_HH_MM_SS));
|
||||
map.put("inspectEndTime", DateUtil.today());
|
||||
XzSecurityQualityInspectionRecordTotalVo yesterday = xzSecurityQualityInspectionRecordMapper.selectQualityInspectionRecordPageTotal(map);
|
||||
vo.setRectificationNumYesterday(yesterday.getRectificationNum());
|
||||
vo.setReviewNumYesterday(yesterday.getReviewNum());
|
||||
vo.setVerificationNumYesterday(yesterday.getVerificationNum());
|
||||
vo.setCloseNumYesterday(yesterday.getCloseNum());
|
||||
vo.setOverdueNotCloseNumYesterday(yesterday.getOverdueNotCloseNum());
|
||||
vo.setGreatFaultLevelNumYesterday(yesterday.getGreatFaultLevelNum());
|
||||
vo.setLargerRiskNumYesterday(yesterday.getLargerRiskNum());
|
||||
vo.setGeneralRiskNumYesterday(yesterday.getGeneralRiskNum());
|
||||
vo.setLowRiskNumYesterday(yesterday.getLowRiskNum());
|
||||
|
||||
map.put("inspectStartTime", DateUtil.today());
|
||||
map.put("inspectEndTime", DateUtil.format(DateUtil.endOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"));
|
||||
XzSecurityQualityInspectionRecordTotalVo t = xzSecurityQualityInspectionRecordMapper.selectQualityInspectionRecordPageTotal(map);
|
||||
vo.setRectificationNumYesterday(t.getRectificationNum());
|
||||
vo.setReviewNumYesterday(vo.getReviewNum());
|
||||
vo.setVerificationNumYesterday(vo.getVerificationNum());
|
||||
vo.setCloseNumYesterday(vo.getCloseNum());
|
||||
vo.setOverdueNotCloseNYesterdayum(vo.getOverdueNotCloseNum());
|
||||
vo.setGreatFaultLevelNumYesterday(vo.getGreatFaultLevelNum());
|
||||
vo.setLargerRiskNumYesterday(vo.getLargerRiskNum());
|
||||
vo.setGeneralRiskNumYesterday(vo.getGeneralRiskNum());
|
||||
vo.setLowRiskNumYesterday(vo.getLowRiskNum());
|
||||
map.put("inspectEndTime", DateUtil.format(DateUtil.endOfDay(new Date()), Cts.YYYY_MM_DD_HH_MM_SS));
|
||||
XzSecurityQualityInspectionRecordTotalVo today = xzSecurityQualityInspectionRecordMapper.selectQualityInspectionRecordPageTotal(map);
|
||||
|
||||
vo.setRectificationNumJzrRate(NumberUtils.rate(vo.getRectificationNum() + 0D, vo.getRectificationNumYesterday() + 0D, 2));
|
||||
vo.setReviewNumJzrRate(NumberUtils.rate(vo.getReviewNum() + 0D, vo.getLowRiskNumYesterday() + 0D, 2));
|
||||
vo.setVerificationNumJzrRate(NumberUtils.rate(vo.getVerificationNum() + 0D, vo.getVerificationNumYesterday() + 0D, 2));
|
||||
vo.setCloseNumJzrRate(NumberUtils.rate(vo.getCloseNum() + 0D, vo.getCloseNumYesterday() + 0D, 2));
|
||||
vo.setOverdueNotCloseNumJzrRate(NumberUtils.rate(vo.getOverdueNotCloseNum() + 0D, vo.getOverdueNotCloseNumDifferYesterday() + 0D, 2));
|
||||
vo.setGreatFaultLevelNumJzrRate(NumberUtils.rate(vo.getGreatFaultLevelNum() + 0D, vo.getGreatFaultLevelNumYesterday() + 0D, 2));
|
||||
vo.setLargerRiskNumJzrRate(NumberUtils.rate(vo.getLargerRiskNum() + 0D, vo.getLargerRiskNumYesterday() + 0D, 2));
|
||||
vo.setGeneralRiskNumJzrRate(NumberUtils.rate(vo.getGeneralRiskNum() + 0D, vo.getLowRiskNumYesterday() + 0D, 2));
|
||||
vo.setLowRiskNumJzrRate(NumberUtils.rate(vo.getLowRiskNum() + 0D, vo.getLowRiskNumYesterday() + 0D, 2));
|
||||
vo.setRectificationNumJzrRate(NumberUtils.rate(today.getRectificationNum() + 0D, vo.getRectificationNumYesterday() + 0D, 2));
|
||||
vo.setReviewNumJzrRate(NumberUtils.rate(today.getReviewNum() + 0D, vo.getLowRiskNumYesterday() + 0D, 2));
|
||||
vo.setVerificationNumJzrRate(NumberUtils.rate(today.getVerificationNum() + 0D, vo.getVerificationNumYesterday() + 0D, 2));
|
||||
vo.setCloseNumJzrRate(NumberUtils.rate(today.getCloseNum() + 0D, vo.getCloseNumYesterday() + 0D, 2));
|
||||
vo.setOverdueNotCloseNumJzrRate(NumberUtils.rate(today.getOverdueNotCloseNum() + 0D, vo.getOverdueNotCloseNumYesterday() + 0D, 2));
|
||||
vo.setGreatFaultLevelNumJzrRate(NumberUtils.rate(today.getGreatFaultLevelNum() + 0D, vo.getGreatFaultLevelNumYesterday() + 0D, 2));
|
||||
vo.setLargerRiskNumJzrRate(NumberUtils.rate(today.getLargerRiskNum() + 0D, vo.getLargerRiskNumYesterday() + 0D, 2));
|
||||
vo.setGeneralRiskNumJzrRate(NumberUtils.rate(today.getGeneralRiskNum() + 0D, vo.getLowRiskNumYesterday() + 0D, 2));
|
||||
vo.setLowRiskNumJzrRate(NumberUtils.rate(today.getLowRiskNum() + 0D, vo.getLowRiskNumYesterday() + 0D, 2));
|
||||
|
||||
vo.setTotalNumDifferYesterday(Integer.parseInt(t.getTotalNum()));
|
||||
vo.setCloseNumDifferYesterday(t.getCloseNum());
|
||||
vo.setNotCloseNumDifferYesterday(t.getNotCloseNum());
|
||||
vo.setOverdueNotCloseNumDifferYesterday(t.getOverdueNotCloseNum());
|
||||
vo.setTotalNumDifferYesterday(Integer.parseInt(today.getTotalNum()));
|
||||
vo.setCloseNumDifferYesterday(today.getCloseNum());
|
||||
vo.setNotCloseNumDifferYesterday(today.getNotCloseNum());
|
||||
vo.setOverdueNotCloseNumDifferYesterday(today.getOverdueNotCloseNum());
|
||||
|
||||
|
||||
map.put("inspectStartTime", null);
|
||||
@ -315,7 +319,7 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
|
||||
@Override
|
||||
public void saveQualityInspectionRecord(XzSecurityQualityInspectionRecord record) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat df = new SimpleDateFormat(Cts.YYYY_MM_DD_HH_MM_SS);
|
||||
record.setCreateTime(df.format(new Date()));
|
||||
if (Objects.equals(record.getRecordType(), 2)) {
|
||||
record.setStatus(5);
|
||||
@ -814,18 +818,27 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
datas = baseMapper.riskChart(map);
|
||||
}
|
||||
List<XzSecurityQualityInspectionRecordTotalVo> rsList = new ArrayList<>();
|
||||
Map<String, XzSecurityQualityInspectionRecordTotalVo> ymMap = datas.stream().collect(Collectors.toMap(XzSecurityQualityInspectionRecordTotalVo::getYearMonth, Function.identity(), (k1, k2) -> k1));
|
||||
Map<String, XzSecurityQualityInspectionRecordTotalVo> ymMap;
|
||||
if (Objects.equals(type, 2)) {
|
||||
ymMap = datas.stream().collect(Collectors.toMap(XzSecurityQualityInspectionRecordTotalVo::getLastWeekByDate, Function.identity(), (k1, k2) -> k1));
|
||||
} else {
|
||||
ymMap = datas.stream().collect(Collectors.toMap(XzSecurityQualityInspectionRecordTotalVo::getYearMonth, Function.identity(), (k1, k2) -> k1));
|
||||
}
|
||||
List<String> dateTimeStrList;
|
||||
if (Objects.equals(type, 2)) {
|
||||
dateTimeStrList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd");
|
||||
} else {
|
||||
dateTimeStrList = DateUtils.getDateTimeStrList(93, "yyyy-MM");
|
||||
}
|
||||
for (String month : dateTimeStrList) {
|
||||
XzSecurityQualityInspectionRecordTotalVo vo = ymMap.get(month);
|
||||
for (String time : dateTimeStrList) {
|
||||
XzSecurityQualityInspectionRecordTotalVo vo = ymMap.get(time);
|
||||
if (vo == null) {
|
||||
vo = new XzSecurityQualityInspectionRecordTotalVo();
|
||||
vo.setYearMonth(month);
|
||||
if (Objects.equals(type, 2)) {
|
||||
vo.setLastWeekByDate(time);
|
||||
} else {
|
||||
vo.setYearMonth(time);
|
||||
}
|
||||
vo.setVerificationNum(0);
|
||||
vo.setRectificationRatio(0.0D);
|
||||
vo.setCloseNum(0);
|
||||
@ -854,7 +867,7 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
||||
vo.setWhichWeekOfMonth(0);
|
||||
vo.setMonthlyBasis("-");
|
||||
}
|
||||
vo.setLastMonth(DateUtil.month(DateUtil.parse(month, "yyyy-MM")) + "月");
|
||||
vo.setLastMonth(DateUtil.month(DateUtil.parse(time, "yyyy-MM")) + "月");
|
||||
rsList.add(vo);
|
||||
}
|
||||
return rsList;
|
||||
|
||||
@ -161,5 +161,14 @@ public class XzEmergencyRecordController {
|
||||
return Result.success(xzEmergencyRecordService.countAlarmNumByEnterprise(param));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计烟感报警数据", notes = "统计烟感报警数据", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result queryById(@ApiIgnore @RequestBody Map<String, Object> param) {
|
||||
return Result.success(queryById(param));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -221,8 +221,11 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
|
||||
|
||||
@Override
|
||||
public List<CountAlarmNumByEnterpriseVo> countAlarmNumByEnterprise(Map<String, Object> param) {
|
||||
List<CountAlarmNumByEnterpriseVo> countAlarmNumByEnterpriseVolist = Lists.newArrayList();
|
||||
List<CountAlarmNumByEnterpriseOne> list = baseMapper.countAlarmNumByEnterprise(param);
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
List<CountAlarmNumByEnterpriseVo> countAlarmNumByEnterpriseVolist = Lists.newArrayList();
|
||||
Map<String, CountAlarmNumByEnterpriseOne> enterpriseIdMap = list.stream().collect(Collectors.toMap(CountAlarmNumByEnterpriseOne::getEnterpriseId, Function.identity(), (key1, key2) -> key1));
|
||||
//企业id 日期
|
||||
Map<String, List<CountAlarmNumByEnterpriseOne>> dateMap = list.stream().collect(Collectors.groupingBy(CountAlarmNumByEnterpriseOne::getDate));
|
||||
|
||||
@ -18,5 +18,6 @@
|
||||
join xz_task_progress_total x on x.enterprise_id = ei.id
|
||||
join project_enterprise pe on pe.enterprise_id=ei.id and pe.project_sn = x.project_sn
|
||||
where x.project_sn = #{param.projectSn} and pe.parent_project_enterprise_id = 0 and x.is_current=1 and x.type=2
|
||||
order by x.change_after desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -162,6 +162,20 @@ public class NumberUtils {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用java正则表达式去掉多余的.与0
|
||||
*
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
public static String subZeroAndDot(String number) {
|
||||
if (number.indexOf(".") > 0) {
|
||||
number = number.replaceAll("0+?$", "");//去掉多余的0
|
||||
number = number.replaceAll("[.]$", "");//如最后一位是.则去掉
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(randomNum(6));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user