war包修改 时间表查询修改 时间表下发时间偏移

master
liuguijing 2 years ago
parent fba6b5f0ff
commit 616abf302a

@ -139,6 +139,15 @@
<version>5.9.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>javax.servlet</groupId>-->
<!-- <artifactId>javax.servlet-api</artifactId>-->
<!-- <version>4.0.1</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>

@ -13,7 +13,7 @@
<name>xymanager_admin</name>
<description>Demo project for Spring Boot</description>
<!-- <packaging>war</packaging>-->
<packaging>war</packaging>
<properties>
<java.version>1.8</java.version>
</properties>
@ -39,6 +39,7 @@
<scope>test</scope>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>com.shxy</groupId>
<artifactId>xymanager_framework</artifactId>
@ -84,17 +85,17 @@
</plugin>
</plugins>
<!-- <resources>-->
<!-- <resource>-->
<!-- <directory>src/main/resources</directory>-->
<resources>
<resource>
<directory>src/main/resources</directory>
<!-- 打包时排除src/main/resources下的所有以.properties .yml .xml为后缀的配置文件-->
<!-- <excludes>-->
<!-- <exclude>**/*.properties</exclude>-->
<!-- <exclude>**/*.yml</exclude>-->
<excludes>
<exclude>**/*.properties</exclude>
<exclude>**/*.yml</exclude>
<!-- <exclude>**/*.xml</exclude>-->
<!-- </excludes>-->
<!-- </resource>-->
<!-- </resources>-->
</excludes>
</resource>
</resources>
<finalName>xymanager-admin</finalName>
</build>

@ -1,12 +1,12 @@
package com.shxy.xymanager_admin;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class SpringBootStartApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// 注意这里要指向原先用main方法执行的Application启动类
return builder.sources(XymanagerAdminApplication.class);
}
}
//package com.shxy.xymanager_admin;
//
//import org.springframework.boot.builder.SpringApplicationBuilder;
//import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
//
//public class SpringBootStartApplication extends SpringBootServletInitializer {
// @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// // 注意这里要指向原先用main方法执行的Application启动类
// return builder.sources(XymanagerAdminApplication.class);
// }
//}

@ -19,7 +19,7 @@ import org.springframework.core.env.Environment;
@Slf4j
@EnableConfigurationProperties
@ComponentScan(basePackages = {"com.shxy"})
public class XymanagerAdminApplication {
public class XymanagerAdminApplication extends SpringBootServletInitializer{
public static void main(String[] args) {
try {
@ -34,5 +34,8 @@ public class XymanagerAdminApplication {
log.error("error>>>>>>>>>>>>>>>>>>>>>>>>>>>", e);
}
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application){
return application.sources(XymanagerAdminApplication.class);
}
}

@ -1 +1 @@
#org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor
org.springframework.boot.env.EnvironmentPostProcessor=com.shxy.xymanager_framework.config.MyEnvironmentPostProcessor

@ -15,6 +15,8 @@ public class TerminalSchedule implements Serializable {
private Integer scheduleId;
private Integer offset;
private Date createTime;
private Date updateTime;

@ -6,11 +6,12 @@
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="TINYINT" property="channelId"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="offset" jdbcType="INTEGER" property="offset"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, term_id, channel_id, schedule_id, create_time, update_time
id, term_id, channel_id, schedule_id, `offset`,create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select

@ -40,13 +40,35 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <exclusion>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-tomcat</artifactId>-->
<!-- </exclusion>-->
</exclusions>
</dependency>
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!--打war包引入的下面依赖-->
<!-- <dependency>-->
<!-- <groupId>javax.servlet</groupId>-->
<!-- <artifactId>javax.servlet-api</artifactId>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.tomcat</groupId>-->
<!-- <artifactId>tomcat-servlet-api</artifactId>-->
<!-- <version>8.0.36</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- SpringBoot 拦截器 -->
<dependency>
@ -77,15 +99,6 @@
<optional>true</optional>
</dependency>
<!--打war包引入的下面依赖-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.shxy</groupId>
<artifactId>xymanager_common</artifactId>

@ -1,19 +1,11 @@
package com.shxy.xymanager_framework.interaction;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.annotation.JwtIgnore;
import com.shxy.xymanager_common.entity.UserSession;
import com.shxy.xymanager_common.enums.HttpMethod;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_service.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

@ -357,6 +357,10 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
public ServiceBody<TerminalScheduleRuleTimeListModel> getChannelSchelduleRule(TerminalAndChannelIdVo vo) {
TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel();
TerminalSchedule mapper = terminalScheduleDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid());
Integer offset = mapper.getOffset();
if (offset == null) {
offset = 0;
}
if (mapper == null) {
model.setList(new ArrayList<>());
} else {
@ -372,8 +376,15 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = ScheduleListUtils.getScheduleDetailsBeans(list);
ArrayList<String> timestrlist = new ArrayList<>();
for (TerminalScheduleRuleModel.ScheduleRuleBean item : detailsBeans) {
Time startTime = item.getStartTime();
Time endTime = item.getEndTime();
DateTime startTime = MyDateUtils.offsetMinute(item.getStartTime(), offset);
if (startTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getStartTime()))) {
startTime = MyDateUtils.endOfDay(item.getStartTime());
}
DateTime endTime = MyDateUtils.offsetMinute(item.getEndTime(), offset);
if (endTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getEndTime()))) {
endTime = MyDateUtils.endOfDay(item.getEndTime());
}
Integer span = item.getSpan();
List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span);
for (DateTime data : dateTimes) {

Loading…
Cancel
Save