Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 3 months ago
parent
commit
c597fb9127
  1. 2
      zc-business/src/main/java/com/zc/business/controller/WordController.java
  2. 24
      zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java
  3. 6
      zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml
  4. 2
      zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml
  5. 19
      zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml
  6. BIN
      zc-business/src/main/resources/wordTemplate/chartTemplate.docx

2
zc-business/src/main/java/com/zc/business/controller/WordController.java

@ -1028,7 +1028,7 @@ public class WordController {
if (closeList != null && closeList.size() > UniversalEnum.ZERO.getNumber() && restrictionList != null && restrictionList.size() > UniversalEnum.ZERO.getNumber() ) {
XWPFTable table = doc.createTable(UniversalEnum.THIRTEEN.getNumber(), UniversalEnum.THREE.getNumber());
XWPFTable table = doc.createTable(15, UniversalEnum.THREE.getNumber());
//列宽自动分割
CTTblWidth infoTableWidth = table.getCTTbl().addNewTblPr().addNewTblW();
infoTableWidth.setType(STTblWidth.DXA);

24
zc-business/src/main/java/com/zc/business/interfaces/OperationLogAspect.java

@ -27,9 +27,8 @@ import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import java.util.concurrent.atomic.AtomicBoolean;
@Aspect
@Component
@ -144,7 +143,24 @@ public class OperationLogAspect {
//SimpleDateFormat df = new SimpleDateFormat(UniversalEnum.TIME_FORMAT_ALL.getValue());
//String date = df.format(new Date());
//String sta = UniversalEnum.EMPTY_STRING.getValue();
if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), UniversalEnum.TWO_HUNDRED.getValue()) && !Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("msg")), UniversalEnum.FIVE_HUNDRED.getValue())) {
AtomicBoolean status = new AtomicBoolean(true);
AjaxResult ajaxResult = (AjaxResult) jsonResult;
try {
JSONArray datas = (JSONArray) JSON.toJSON(ajaxResult.get("data"));
datas.forEach(item -> {
JSONObject json = (JSONObject) JSON.toJSON(item);
if (json.getJSONObject("result").getInteger("code") != UniversalEnum.TWO_HUNDRED.getNumber()) {
status.set(false);
}
});
} catch (Exception e) {
status.set(false);
}
// List<Object> result = datas.stream().filter(item -> {
// JSONObject json = (JSONObject) JSON.toJSON(item);
// return Objects.equals(json.getString("device"), "2");
// }).collect(Collectors.toList());
if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(ajaxResult.get("code")), UniversalEnum.TWO_HUNDRED.getValue()) && !Objects.equals(String.valueOf(ajaxResult.get("msg")), UniversalEnum.FIVE_HUNDRED.getValue()) && status.get()) {
operLog.setStatus(UniversalEnum.ZERO.getNumber());
//sta = UniversalEnum.SUCCESSFUL.getValue();
} else {
@ -498,7 +514,7 @@ public class OperationLogAspect {
DcPublishManage dcPublishManage = new DcPublishManage();
if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), UniversalEnum.TWO_HUNDRED.getValue())) {
if (Objects.equals(state, UniversalEnum.ZERO.getValue()) && Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("code")), UniversalEnum.TWO_HUNDRED.getValue()) && !Objects.equals(String.valueOf(((AjaxResult) jsonResult).get("msg")), UniversalEnum.FIVE_HUNDRED.getValue()) && status.get()) {
dcPublishManage.setPublishStatus(UniversalEnum.ONE.getNumber());//发布状态1-成功2-失败
} else {
dcPublishManage.setPublishStatus(UniversalEnum.TWO.getNumber());//发布状态1-成功2-失败

6
zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml

@ -83,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="exitsInlets != null">exits_inlets,</if>
<if test="facilityId != null">facility_id,</if>
<if test="rampId != null">ramp_id,</if>
<if test="causeType != null">cause_type,</if>
cause_type,
<if test="measure != null">measure,</if>
<if test="classify != null">classify,</if>
@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="exitsInlets != null">#{exitsInlets},</if>
<if test="facilityId != null">#{facilityId},</if>
<if test="rampId != null">#{rampId},</if>
<if test="causeType != null">#{causeType},</if>
#{causeType},
<if test="measure != null">#{measure},</if>
<if test="classify != null">#{classify},</if>
@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="exitsInlets != null">exits_inlets = #{exitsInlets},</if>
<if test="facilityId != null">facility_id = #{facilityId},</if>
<if test="rampId != null">ramp_id = #{rampId},</if>
<if test="causeType != null">cause_type = #{causeType},</if>
cause_type = #{causeType},
<if test="measure != null">measure = #{measure},</if>
<if test="classify != null">classify = #{classify},</if>
<if test="vehicleType != null">vehicle_type = #{vehicleType},</if>

2
zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml

@ -216,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dgsd.period_type = #{periodType}
ORDER BY
dgsd.statistical_date DESC
dgsd.statistical_date DESC , i.stake_make asc
</select>
</mapper>

19
zc-business/src/main/resources/mapper/business/DcTrafficIncidentsMapper.xml

@ -226,7 +226,13 @@
UNION ALL select 5 control_cause,'' cause_type,'警备任务' controlCauseName,'' causeTypeName
UNION ALL select 6 control_cause,'' cause_type,'其他' controlCauseName,'' causeTypeName) t3
LEFT JOIN
(select t2.control_type,t2.control_cause,ifnull(t2.cause_type,'') cause_type,count(*) num,sum(
(select t2.control_type,t2.control_cause,
case when t2.cause_type = '4-1' then ''
when t2.cause_type = '4-2' then ''
when t2.cause_type = '4-3' then ''
when ISNULL(t2.cause_type) then ''
else cause_type end causeType,
count(*) num,sum(
case when date_format(#{startTime},'%Y-%m-%d %H:%i:%s') >= date_format(t1.start_time,'%Y-%m-%d %H:%i:%s')
and (DATE_FORMAT(t1.end_time,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(#{endTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time))
then TIMESTAMPDIFF(MINUTE,t1.start_time,now())
@ -252,8 +258,8 @@
and date_format(t1.start_time,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
and (date_format(t1.end_time,'%Y-%m-%d %H:%i:%s') > date_format(#{startTime},'%Y-%m-%d %H:%i:%s') or ISNULL(t1.end_time))
</where>
GROUP BY t2.control_cause,t2.cause_type) t4
on t3.control_cause = t4.control_cause and t3.cause_type = t4.cause_type
GROUP BY t2.control_cause,causeType) t4
on t3.control_cause = t4.control_cause and t3.cause_type = t4.causeType
ORDER BY t3.control_cause, t3.cause_type
</select>
@ -406,7 +412,7 @@
<select id="selectTrafficControlAnalysis" resultType="java.util.Map">
select t1.controlCause,t1.controlCauseName,IFNULL(t2.facilityClose,0) facilityClose,
IFNULL(t2.facilityRestriction,0) facilityRestriction,IFNULL(t2.facilityInterval,0) facilityInterval
IFNULL(t2.facilityRestriction,0) facilityRestriction
from
(select '1' controlCause,'车流量大' controlCauseName
union all select '2' controlCause,'交通事故' controlCauseName
@ -418,9 +424,8 @@
left join
(select
t2.control_cause,
SUM(case when t2.classify = '6' then 1 else 0 end) facilityClose,
SUM(case when t2.classify = '7' then 1 else 0 end) facilityRestriction,
SUM(case when t2.classify = '9' then 1 else 0 end) facilityInterval
SUM(case when t2.control_type = '1' then 1 else 0 end) facilityClose,
SUM(case when t2.control_type = '2' then 1 else 0 end) facilityRestriction
from dc_event t1
LEFT JOIN dc_event_traffic_control t2 on t1.id = t2.id
where

BIN
zc-business/src/main/resources/wordTemplate/chartTemplate.docx

Binary file not shown.
Loading…
Cancel
Save