Commit 85cbc010 authored by zhoushiguang's avatar zhoushiguang

修改为批量插入

parent 05a703a4
...@@ -9,9 +9,13 @@ import java.util.List; ...@@ -9,9 +9,13 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public interface AnalysisProblemAndStrategyDayMapper extends BaseMapper<AnalysisProblemAndStrategyDay> { public interface AnalysisProblemAndStrategyDayMapper extends BaseMapper<AnalysisProblemAndStrategyDay> {
List<AnalysisProblemAndStrategyDay> selectCrossEvent(); List<AnalysisProblemAndStrategyDay> selectCrossEvent(@Param("dtStart") Integer dtStart,@Param("dtEnd") Integer dtEnd);
List<AnalysisProblemAndStrategyDay> selectGreenEvent();
Integer insertProblemAndStrategy(AnalysisProblemAndStrategyDay analysisProblemAndStrategyDay); List<AnalysisProblemAndStrategyDay> selectGreenEvent(@Param("dtStart") Integer dtStart,@Param("dtEnd") Integer dtEnd);
Integer insertProblemAndStrategy(List<AnalysisProblemAndStrategyDay> list);
AnalysisProblemAndStrategyDay getGreenStrategy(@Param("greenID") String greenID, @Param("time") String time); AnalysisProblemAndStrategyDay getGreenStrategy(@Param("greenID") String greenID, @Param("time") String time);
AnalysisProblemAndStrategyDay getCrossStrategy(@Param("crossID") String crossID, @Param("time") String time,@Param("eventSerialNumber") String eventSerialNumber); AnalysisProblemAndStrategyDay getCrossStrategy(@Param("crossID") String crossID, @Param("time") String time,@Param("eventSerialNumber") String eventSerialNumber);
} }
package net.wanji.opt.servicev2.judgeanalysis; package net.wanji.opt.servicev2.judgeanalysis;
import org.apache.ibatis.annotations.Param;
public interface AnalysisProblemAndStrategyDayService { public interface AnalysisProblemAndStrategyDayService {
public void selectCountByType(); public void selectCountByTypeOfCross(Integer dtStart, Integer dtEnd);
public void selectCountByTypeOfGreen(Integer dtStart,Integer dtEnd);
} }
...@@ -12,7 +12,11 @@ import javax.annotation.Resource; ...@@ -12,7 +12,11 @@ import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* <p> * <p>
...@@ -29,15 +33,20 @@ public class AnalysisProblemAndStrategyDayImpl extends ServiceImpl<AnalysisProbl ...@@ -29,15 +33,20 @@ public class AnalysisProblemAndStrategyDayImpl extends ServiceImpl<AnalysisProbl
private AnalysisProblemAndStrategyDayMapper analysisProblemAndStrategyDayMapper; private AnalysisProblemAndStrategyDayMapper analysisProblemAndStrategyDayMapper;
public void selectCountByType() { public void selectCountByTypeOfGreen(Integer dtStart,Integer dtEnd) {
StopWatch stopWatch = new StopWatch("事件优化时长计算监控"); StopWatch stopWatch = new StopWatch("干线事件优化时长计算监控");
stopWatch.start(); stopWatch.start();
//查询路口事件数据 //查询干线事件数据
List<AnalysisProblemAndStrategyDay> crossEvenList = analysisProblemAndStrategyDayMapper.selectCrossEvent(); List<AnalysisProblemAndStrategyDay> greenEvenList = analysisProblemAndStrategyDayMapper.selectGreenEvent(dtStart,dtEnd);
if (crossEvenList.size() > 0) {
//循环查找路口事件数据是否有策略下发 int size = greenEvenList.size();
for (AnalysisProblemAndStrategyDay vo : crossEvenList) {
AnalysisProblemAndStrategyDay temp = analysisProblemAndStrategyDayMapper.getCrossStrategy(vo.getCrossId(), vo.getHappenStartTime(),vo.getEventSerialNumber()); if (greenEvenList.size() > 0) {
long st = System.currentTimeMillis();
List<AnalysisProblemAndStrategyDay> saveList = new ArrayList<>();// greenEvenList.stream().filter(o->o.getGreenId().equals("1")).collect(Collectors.toList());
long total = 0;
for (AnalysisProblemAndStrategyDay vo : greenEvenList) {
AnalysisProblemAndStrategyDay temp = analysisProblemAndStrategyDayMapper.getGreenStrategy(vo.getGreenId(), vo.getHappenStartTime());
if (temp == null) { if (temp == null) {
vo.setOptStatus(0); vo.setOptStatus(0);
} else { } else {
...@@ -46,23 +55,49 @@ public class AnalysisProblemAndStrategyDayImpl extends ServiceImpl<AnalysisProbl ...@@ -46,23 +55,49 @@ public class AnalysisProblemAndStrategyDayImpl extends ServiceImpl<AnalysisProbl
vo.setOptEndTime(temp.getOptEndTime()); vo.setOptEndTime(temp.getOptEndTime());
vo.setOptDuration(temp.getOptDuration()); vo.setOptDuration(temp.getOptDuration());
} }
// LocalDate previousDay = LocalDate.now().minusDays(1);
LocalDate previousDay = LocalDate.now().minusDays(1); // String formattedDate = previousDay.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
String formattedDate = previousDay.format(DateTimeFormatter.ofPattern("yyyyMMdd")); vo.setDt(vo.getDt());
vo.setDt(formattedDate);
vo.setInsertTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); vo.setInsertTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
//路口数据设置干线ID为不存在的ID //干线数据设置路口ID为不存在的null字符串
vo.setGreenId("-1"); vo.setCrossId("null");
//写入数据--Error saveList.add(vo);
analysisProblemAndStrategyDayMapper.insertProblemAndStrategy(vo); //写入数据
if (saveList.size() % 100 == 0) {
analysisProblemAndStrategyDayMapper.insertProblemAndStrategy(saveList);
long et = System.currentTimeMillis();
total += 100;
log.info("干线事件优化记录挂接-批量插入优化挂接记录耗时:{}ms,已入库数量:{},总记录数:{}", et - st,total,size);
st = et;
}
}
if (saveList.size() > 0) {
total += saveList.size();
analysisProblemAndStrategyDayMapper.insertProblemAndStrategy(saveList);
long et = System.currentTimeMillis();
log.info("干线事件优化记录挂接-批量插入优化挂接记录耗时:{}ms,已入库数量:{},总记录数:{}", et - st,total,size);
saveList.clear();
} }
} }
stopWatch.stop();
log.info("干线事件优化时长计算监控 耗时:{}ms", stopWatch.getTotalTimeMillis());
//查询干线事件数据 }
List<AnalysisProblemAndStrategyDay> greenEvenList = analysisProblemAndStrategyDayMapper.selectGreenEvent();
if (greenEvenList.size() > 0) { public void selectCountByTypeOfCross(Integer dtStart,Integer dtEnd) {
for (AnalysisProblemAndStrategyDay vo : greenEvenList) { StopWatch stopWatch = new StopWatch("路口事件优化时长计算监控");
AnalysisProblemAndStrategyDay temp = analysisProblemAndStrategyDayMapper.getGreenStrategy(vo.getGreenId(), vo.getHappenStartTime()); stopWatch.start();
//查询路口事件数据
List<AnalysisProblemAndStrategyDay> crossEvenList = analysisProblemAndStrategyDayMapper.selectCrossEvent(dtStart,dtEnd);
int size = crossEvenList.size();
if (crossEvenList.size() > 0) {
long st = System.currentTimeMillis();
long total = 0;
//循环查找路口事件数据是否有策略下发
List<AnalysisProblemAndStrategyDay> saveList = new ArrayList<>();
for (AnalysisProblemAndStrategyDay vo : crossEvenList) {
AnalysisProblemAndStrategyDay temp = analysisProblemAndStrategyDayMapper.getCrossStrategy(vo.getCrossId(), vo.getHappenStartTime(), vo.getEventSerialNumber());
if (temp == null) { if (temp == null) {
vo.setOptStatus(0); vo.setOptStatus(0);
} else { } else {
...@@ -71,18 +106,34 @@ public class AnalysisProblemAndStrategyDayImpl extends ServiceImpl<AnalysisProbl ...@@ -71,18 +106,34 @@ public class AnalysisProblemAndStrategyDayImpl extends ServiceImpl<AnalysisProbl
vo.setOptEndTime(temp.getOptEndTime()); vo.setOptEndTime(temp.getOptEndTime());
vo.setOptDuration(temp.getOptDuration()); vo.setOptDuration(temp.getOptDuration());
} }
LocalDate previousDay = LocalDate.now().minusDays(1);
String formattedDate = previousDay.format(DateTimeFormatter.ofPattern("yyyyMMdd")); // LocalDate previousDay = LocalDate.now().minusDays(1);
vo.setDt(formattedDate); // String formattedDate = previousDay.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
vo.setDt(vo.getDt());
vo.setInsertTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); vo.setInsertTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
//干线数据设置路口ID为不存在的null字符串 //路口数据设置干线ID为不存在的ID
vo.setCrossId("null"); vo.setGreenId("-1");
//写入数据 saveList.add(vo);
analysisProblemAndStrategyDayMapper.insertProblemAndStrategy(vo); //写入数据--Error
if (saveList.size() % 100 == 0) {
analysisProblemAndStrategyDayMapper.insertProblemAndStrategy(saveList);
long et = System.currentTimeMillis();
total += 100;
log.info("干线事件优化记录挂接-批量插入优化挂接记录耗时:{}ms,已入库数量:{},总记录数:{}", et - st,total,size);
st = et;
}
} }
if (saveList.size() > 0) {
analysisProblemAndStrategyDayMapper.insertProblemAndStrategy(saveList);
long et = System.currentTimeMillis();
total += saveList.size();
log.info("干线事件优化记录挂接-批量插入优化挂接记录耗时:{}ms,已入库数量:{},总记录数:{}", et - st,total,size);
saveList.clear();
} }
}
stopWatch.stop(); stopWatch.stop();
log.info("事件优化记录优化耗时:{}ms",stopWatch.getTotalTimeMillis()); log.info("路口事件优化时长计算监控总耗时:{}ms", stopWatch.getTotalTimeMillis());
} }
......
...@@ -22,9 +22,21 @@ public class AnalysisProblemAndStrategyDayTask { ...@@ -22,9 +22,21 @@ public class AnalysisProblemAndStrategyDayTask {
private AnalysisProblemAndStrategyDayService analysisProblemAndStrategyDayService; private AnalysisProblemAndStrategyDayService analysisProblemAndStrategyDayService;
@Scheduled(cron = "0 15 1 * * ?") @Scheduled(cron = "0 15 1 * * ?")
public void task() { public void taskCross() {
try { try {
analysisProblemAndStrategyDayService.selectCountByType();
analysisProblemAndStrategyDayService.selectCountByTypeOfCross(null,null);
} catch (Exception e) {
log.error("获取事件优化记录异常", e);
}
}
@Scheduled(cron = "0 15 1 * * ?")
public void taskGreen() {
try {
analysisProblemAndStrategyDayService.selectCountByTypeOfGreen(null,null);
} catch (Exception e) { } catch (Exception e) {
log.error("获取事件优化记录异常", e); log.error("获取事件优化记录异常", e);
} }
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<mapper namespace="net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemAndStrategyDayMapper"> <mapper namespace="net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemAndStrategyDayMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="AnalysisProblemAndStrategyDayMap" type="net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay"> <resultMap id="AnalysisProblemAndStrategyDayMap"
type="net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay">
<result column="crossId" property="crossId"/> <result column="crossId" property="crossId"/>
<result column="eventSerialNumber" property="eventSerialNumber"/> <result column="eventSerialNumber" property="eventSerialNumber"/>
<result column="eventCategory" property="eventCategory"/> <result column="eventCategory" property="eventCategory"/>
...@@ -22,88 +23,112 @@ ...@@ -22,88 +23,112 @@
</resultMap> </resultMap>
<select id="selectCrossEvent" resultMap="AnalysisProblemAndStrategyDayMap"> <select id="selectCrossEvent" resultMap="AnalysisProblemAndStrategyDayMap">
select a.event_serial_number as eventSerialNumber , a.cross_id as crossId ,a.green_id as greenId, select a.event_serial_number as eventSerialNumber,
a.category as eventCategory,a.type as eventType ,a.start_time as happenStartTime ,a.end_time as happenEndTime, a.cross_id as crossId,
TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) as duration , a.dir a.green_id as greenId,
from t_event_info a where a.dt = DATE_FORMAT(DATE_sub(now(),INTERVAL 24 HOUR ),'%Y%m%d') and a.type in (701,702,703,707) a.category as eventCategory,
a.type as eventType,
a.start_time as happenStartTime,
a.end_time as happenEndTime,
TIMESTAMPDIFF(SECOND, a.start_time, a.end_time) as duration,
a.dir,
dt
from t_event_info a
where 1=1
<choose>
<when test="dtStart !=null and dtEnd!=null">
and a.dt >= #{dtStart} and a.dt &lt;= #{dtEnd}
</when>
<otherwise>
and a.dt = DATE_FORMAT(DATE_sub(now(), INTERVAL 24 HOUR ), '%Y%m%d')
</otherwise>
</choose>
and a.type in (701, 702, 703, 707)
</select> </select>
<select id="selectGreenEvent" resultMap="AnalysisProblemAndStrategyDayMap"> <select id="selectGreenEvent" resultMap="AnalysisProblemAndStrategyDayMap">
select a.event_serial_number as eventSerialNumber , a.cross_id as crossId ,a.green_id as greenId, select a.event_serial_number as eventSerialNumber , a.cross_id as crossId ,a.green_id as greenId,
a.category as eventCategory,a.type as eventType ,a.start_time as happenStartTime ,a.end_time as happenEndTime, a.category as eventCategory,a.type as eventType ,a.start_time as happenStartTime ,a.end_time as happenEndTime,
TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) as duration , a.dir TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) as duration , a.dir,dt
from t_event_info a where a.dt = DATE_FORMAT(DATE_sub(now(),INTERVAL 24 HOUR ),'%Y%m%d') and a.type in (705,706) from t_event_info a
where 1=1
<choose>
<when test="dtStart !=null and dtEnd!=null">
and a.dt >= #{dtStart} and a.dt &lt;= #{dtEnd}
</when>
<otherwise>
and a.dt = DATE_FORMAT(DATE_sub(now(), INTERVAL 24 HOUR ), '%Y%m%d')
</otherwise>
</choose>
and a.type in (705,706)
</select> </select>
<select id="getGreenStrategy" parameterType="String" resultMap="AnalysisProblemAndStrategyDayMap"> <select id="getGreenStrategy" parameterType="String" resultMap="AnalysisProblemAndStrategyDayMap">
select DISTINCT a.control_time as optStartTime,DATE_ADD(a.control_time,INTERVAL a.control_duration SECOND ) as optEndTime ,a.control_duration as optDuration from t_strategy_green_opt_hist a select DISTINCT a.control_time as optStartTime,
where a.control_time = (select MAX(control_time) from t_strategy_green_opt_hist where green_id = #{greenID} DATE_ADD(a.control_time, INTERVAL a.control_duration SECOND ) as optEndTime,
and control_time <![CDATA[ >= ]]> DATE_FORMAT(DATE_sub(#{time},INTERVAL control_duration SECOND),'%Y-%m-%d %H:%i:%s') and control_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s') a.control_duration as optDuration
and response_code = 200 ) from t_strategy_green_opt_hist a
where a.control_time = (select MAX(control_time)
from t_strategy_green_opt_hist
where green_id = #{greenID}
and control_time <![CDATA[ >= ]]> DATE_FORMAT(DATE_sub(#{time}, INTERVAL control_duration SECOND), '%Y-%m-%d %H:%i:%s')
and control_time <![CDATA[ <= ]]> DATE_FORMAT(#{time}, '%Y-%m-%d %H:%i:%s')
and response_code = 200)
and a.green_id = #{greenID} and a.green_id = #{greenID}
</select> </select>
<select id="getCrossStrategy" parameterType="String" resultMap="AnalysisProblemAndStrategyDayMap"> <select id="getCrossStrategy" parameterType="String" resultMap="AnalysisProblemAndStrategyDayMap">
select a.issue_time as optStartTime,DATE_ADD(a.issue_time,INTERVAL a.duration SECOND ) as optEndTime,a.duration as optDuration from t_strategy_cross_result a select a.issue_time as optStartTime,
DATE_ADD(a.issue_time, INTERVAL a.duration SECOND ) as optEndTime,
a.duration as optDuration
from t_strategy_cross_result a
where a.event_id = #{eventSerialNumber} where a.event_id = #{eventSerialNumber}
and response_code = 200 and response_code = 200
and dt = DATE_FORMAT(#{time}, '%Y%m%d') and dt = DATE_FORMAT(#{time}, '%Y%m%d')
and a.cross_id = #{crossID} and a.cross_id = #{crossID}
</select> </select>
<insert id="insertProblemAndStrategy" parameterType="net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay"> <insert id="insertProblemAndStrategy"
insert into t_event_optimize_info parameterType="net.wanji.opt.entity.judgeanalysis.AnalysisProblemAndStrategyDay">
<trim prefix="(" suffix=")" suffixOverrides=","> insert into
<if test="crossId != null">cross_id,</if> t_event_optimize_info(cross_id,event_serial_number,event_category,event_type,happen_start_time,happen_end_time,duration,
<if test="eventSerialNumber != null">event_serial_number,</if> opt_status,dir,opt_start_time,opt_end_time,opt_duration,dt,insert_time,green_id)
<if test="eventCategory != null">event_category,</if> VALUES
<if test="eventType != null">event_type,</if> <foreach collection="list" item="entity" separator=",">
<if test="happenStartTime != null">happen_start_time,</if> (
<if test="happenEndTime != null">happen_end_time,</if> #{entity.crossId},
<if test="duration != null">duration,</if> #{entity.eventSerialNumber},
<if test="optStatus != null">opt_status,</if> #{entity.eventCategory},
<if test="dir != null">dir,</if> #{entity.eventType},
<if test="optStartTime != null">opt_start_time,</if> DATE_FORMAT(#{entity.happenStartTime},'%Y-%m-%d %H:%i:%s'),
<if test="optEndTime != null">opt_end_time,</if> DATE_FORMAT(#{entity.happenEndTime},'%Y-%m-%d %H:%i:%s'),
<if test="optDuration != null">opt_duration,</if> #{entity.duration},
<if test="dt != null">dt,</if> #{entity.optStatus},
<if test="insertTime != null">insert_time,</if> #{entity.dir},
<if test="greenId != null and greenId != '' ">green_id,</if> DATE_FORMAT(#{entity.optStartTime},'%Y-%m-%d %H:%i:%s'),
</trim> DATE_FORMAT(#{entity.optEndTime},'%Y-%m-%d %H:%i:%s'),
<trim prefix="values (" suffix=")" suffixOverrides=","> #{entity.optDuration},
<if test="crossId != null">#{crossId},</if> #{entity.dt},
<if test="eventSerialNumber != null">#{eventSerialNumber},</if> DATE_FORMAT(#{entity.insertTime},'%Y-%m-%d %H:%i:%s'),
<if test="eventCategory != null">#{eventCategory},</if> #{entity.greenId}
<if test="eventType != null">#{eventType},</if> )
<if test="happenStartTime != null">DATE_FORMAT(#{happenStartTime},'%Y-%m-%d %H:%i:%s'),</if> </foreach>
<if test="happenEndTime != null">DATE_FORMAT(#{happenEndTime},'%Y-%m-%d %H:%i:%s'),</if>
<if test="duration != null">#{duration},</if>
<if test="optStatus != null">#{optStatus},</if>
<if test="dir != null">#{dir},</if>
<if test="optStartTime != null">DATE_FORMAT(#{optStartTime},'%Y-%m-%d %H:%i:%s'),</if>
<if test="optEndTime != null">DATE_FORMAT(#{optEndTime},'%Y-%m-%d %H:%i:%s'),</if>
<if test="optDuration != null">#{optDuration},</if>
<if test="dt != null">#{dt},</if>
<if test="insertTime != null">DATE_FORMAT(#{insertTime},'%Y-%m-%d %H:%i:%s'),</if>
<if test="greenId != null and greenId != ''">#{greenId},</if>
</trim>
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
event_serial_number=VALUES(event_serial_number), event_serial_number=VALUES(event_serial_number),
<if test="crossId != null">cross_id=VALUES(cross_id),</if> cross_id=VALUES(cross_id),
<if test="eventCategory != null"> event_category=VALUES(event_category),</if> event_category=VALUES(event_category),
<if test="eventType != null">event_type=VALUES(event_type),</if> event_type=VALUES(event_type),
<if test="happenStartTime != null">happen_start_time=VALUES(happen_start_time),</if> happen_start_time=VALUES(happen_start_time),
<if test="happenEndTime != null">happen_end_time=VALUES(happen_end_time),</if> happen_end_time=VALUES(happen_end_time),
<if test="duration != null">duration=VALUES(duration),</if> duration=VALUES(duration),
<if test="optStatus != null">opt_status=VALUES(opt_status),</if> opt_status=VALUES(opt_status),
<if test="dir != null">dir=VALUES(dir),</if> dir=VALUES(dir),
<if test="optStartTime != null">opt_start_time=VALUES(opt_start_time),</if> opt_start_time=VALUES(opt_start_time),
<if test="optEndTime != null">opt_end_time=VALUES(opt_end_time),</if> opt_end_time=VALUES(opt_end_time),
<if test="optDuration != null">opt_duration=VALUES(opt_duration),</if> opt_duration=VALUES(opt_duration),
<if test="insertTime != null">insert_time=VALUES(insert_time),</if> insert_time=VALUES(insert_time),
<if test="greenId != null and greenId != ''">green_id=VALUES(green_id),</if> green_id=VALUES(green_id),
dt=VALUES(dt) dt=VALUES(dt)
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file
/**
*
*/
import cn.hutool.core.date.DateUtil;
import net.wanji.opt.SignalOptimizeApplication;
import net.wanji.opt.dao.mapper.judgeanalysis.AnalysisProblemCrossDayMapper;
import net.wanji.opt.servicev2.judgeanalysis.AnalysisProblemAndStrategyDayService;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Date;
/**
* @author fengyi
* @date
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SignalOptimizeApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class EventOptimizeTaskTest {
@Autowired
private AnalysisProblemAndStrategyDayService analysisProblemAndStrategyDayService;
@Test
public void taskGreen() {
try {
//analysisProblemAndStrategyDayService.selectCountByTypeOfCross();
Integer dtStart = 20250423;// Integer.valueOf(DateUtil.beginOfMonth(new Date()).toString("yyyyMMdd"));
Integer dtEnd = 20250423;// Integer.valueOf(DateUtil.format(new Date(),"yyyyMMdd"));
analysisProblemAndStrategyDayService.selectCountByTypeOfGreen(dtStart,dtEnd);
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void taskCross() {
try {
Integer dtStart = 20250423;// Integer.valueOf(DateUtil.beginOfMonth(new Date()).toString("yyyyMMdd"));
Integer dtEnd = 20250423; //Integer.valueOf(DateUtil.format(new Date(),"yyyyMMdd"));
analysisProblemAndStrategyDayService.selectCountByTypeOfCross(dtStart,dtEnd);
} catch (Exception e) {
e.printStackTrace();
}
}
}
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