Merge remote-tracking branch 'origin/master' into dev

master
18616268358 2 years ago
commit 1b8957e6b2

@ -75,11 +75,11 @@
<version>${swagger.version}</version> <version>${swagger.version}</version>
</dependency> </dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>io.jsonwebtoken</groupId>--> <!-- <groupId>io.jsonwebtoken</groupId>-->
<!-- <artifactId>jjwt</artifactId>--> <!-- <artifactId>jjwt</artifactId>-->
<!-- <version>${jwt.version}</version>--> <!-- <version>${jwt.version}</version>-->
<!-- </dependency>--> <!-- </dependency>-->
<!-- swagger ui--> <!-- swagger ui-->
<dependency> <dependency>
@ -124,12 +124,12 @@
<version>5.7.20</version> <version>5.7.20</version>
</dependency> </dependency>
<!-- &lt;!&ndash;shiro&ndash;&gt;--> <!-- &lt;!&ndash;shiro&ndash;&gt;-->
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.apache.shiro</groupId>--> <!-- <groupId>org.apache.shiro</groupId>-->
<!-- <artifactId>shiro-spring-boot-starter</artifactId>--> <!-- <artifactId>shiro-spring-boot-starter</artifactId>-->
<!-- <version>1.11.0</version>--> <!-- <version>1.11.0</version>-->
<!-- </dependency>--> <!-- </dependency>-->
<!--JNA:调用本地dll--> <!--JNA:调用本地dll-->
@ -139,6 +139,15 @@
<version>5.9.0</version> <version>5.9.0</version>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>javax.servlet</groupId>-->
<!-- <artifactId>javax.servlet-api</artifactId>-->
<!-- <version>4.0.1</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>

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

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

@ -19,7 +19,7 @@ import org.springframework.core.env.Environment;
@Slf4j @Slf4j
@EnableConfigurationProperties @EnableConfigurationProperties
@ComponentScan(basePackages = {"com.shxy"}) @ComponentScan(basePackages = {"com.shxy"})
public class XymanagerAdminApplication { public class XymanagerAdminApplication extends SpringBootServletInitializer{
public static void main(String[] args) { public static void main(String[] args) {
try { try {
@ -34,5 +34,8 @@ public class XymanagerAdminApplication {
log.error("error>>>>>>>>>>>>>>>>>>>>>>>>>>>", e); 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

@ -13,11 +13,11 @@ public class ScheduleDetails implements Serializable {
private Integer scheduleId; private Integer scheduleId;
private Time startTime; private Integer hour;
private Time endTime; private Integer minute;
private Integer span; private Integer preset;
private Date createTime; private Date createTime;

@ -1,28 +0,0 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.sql.Time;
import java.util.Date;
@Data
public class ScheduleDetailss implements Serializable {
private Integer id;
private Integer scheduleId;
private Integer hour;
private Integer minute;
private Integer preset;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
}

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

@ -13,9 +13,9 @@ public class TerminalScheduleDetails implements Serializable {
private Integer channelId; private Integer channelId;
private Date startTime; private Integer hour;
private Date endTime; private Integer minute;
private Integer span; private Integer span;

@ -1,28 +0,0 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class TerminalScheduleDetailss implements Serializable {
private Integer id;
private Integer termId;
private Integer channelId;
private Integer hour;
private Integer minute;
private Integer span;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -42,7 +42,7 @@ public class SysUserModel implements Serializable {
private String nickName; private String nickName;
@ApiModelProperty(value = "创建时间", example = "120") @ApiModelProperty(value = "创建时间", example = "120")
private BigInteger createTime; private Date createTime;
} }

@ -22,4 +22,7 @@ public class TerminalScheduleRuleTimeListModel implements Serializable {
@ApiModelProperty(value = "是否最新", example = "123456") @ApiModelProperty(value = "是否最新", example = "123456")
private Boolean isNew = false; private Boolean isNew = false;
@ApiModelProperty(value = "偏移量", example = "123456")
private Integer offset ;
} }

@ -1,7 +1,7 @@
package com.shxy.xymanager_common.util; package com.shxy.xymanager_common.util;
import com.shxy.xymanager_common.dto.ScheduleDetailsDto; import com.shxy.xymanager_common.dto.ScheduleDetailsDto;
import com.shxy.xymanager_common.entity.ScheduleDetailss; import com.shxy.xymanager_common.entity.ScheduleDetails;
import com.shxy.xymanager_common.model.TerminalScheduleRuleModel; import com.shxy.xymanager_common.model.TerminalScheduleRuleModel;
import com.shxy.xymanager_common.vo.ScheduleRuleVo; import com.shxy.xymanager_common.vo.ScheduleRuleVo;
@ -21,11 +21,11 @@ public class ScheduleListUtils {
* @param scheduleid * @param scheduleid
* @return * @return
*/ */
public static ArrayList<ScheduleDetailss> getScheduleDetailsses(List<ScheduleRuleVo> beans, Integer scheduleid) { public static ArrayList<ScheduleDetails> getScheduleDetailsses(List<ScheduleRuleVo> beans, Integer scheduleid) {
ArrayList<ScheduleDetailss> list = new ArrayList<>(); ArrayList<ScheduleDetails> list = new ArrayList<>();
for (ScheduleRuleVo item : beans) { for (ScheduleRuleVo item : beans) {
ScheduleDetailss startrule = new ScheduleDetailss(); ScheduleDetails startrule = new ScheduleDetails();
startrule.setScheduleId(scheduleid); startrule.setScheduleId(scheduleid);
Time startTime = item.getStartTime(); Time startTime = item.getStartTime();
startrule.setHour(MyDateUtils.hour(startTime, true)); startrule.setHour(MyDateUtils.hour(startTime, true));
@ -33,7 +33,7 @@ public class ScheduleListUtils {
startrule.setPreset(255); startrule.setPreset(255);
list.add(startrule); list.add(startrule);
ScheduleDetailss endrule = new ScheduleDetailss(); ScheduleDetails endrule = new ScheduleDetails();
endrule.setScheduleId(scheduleid); endrule.setScheduleId(scheduleid);
Time endTime = item.getEndTime(); Time endTime = item.getEndTime();
endrule.setHour(MyDateUtils.hour(endTime, true)); endrule.setHour(MyDateUtils.hour(endTime, true));
@ -42,7 +42,7 @@ public class ScheduleListUtils {
list.add(endrule); list.add(endrule);
Integer span = item.getSpan(); Integer span = item.getSpan();
ScheduleDetailss spanrule = new ScheduleDetailss(); ScheduleDetails spanrule = new ScheduleDetails();
spanrule.setScheduleId(scheduleid); spanrule.setScheduleId(scheduleid);
spanrule.setHour(XyNumberUtils.delivery(span, 60)); spanrule.setHour(XyNumberUtils.delivery(span, 60));
spanrule.setMinute(XyNumberUtils.remainder(span, 60)); spanrule.setMinute(XyNumberUtils.remainder(span, 60));
@ -75,15 +75,38 @@ public class ScheduleListUtils {
String string = ""; String string = "";
if (XyNumberUtils.remainder(i, 3) == 0) { if (XyNumberUtils.remainder(i, 3) == 0) {
index = index + 3; index = index + 3;
startHour = dtoList.get(i).getHour().shortValue(); Number add = XyNumberUtils.add((Number) dtoList.get(i).getMinute(), offset);
startMin = dtoList.get(i).getMinute().shortValue(); if (add.intValue() >= 60) {
Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1);
if (add1.intValue() >= 24) {
startHour = Integer.valueOf(24).shortValue();
startMin = Integer.valueOf(0).shortValue();
} else {
startHour = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1).shortValue();
startMin = XyNumberUtils.sub(add, 60).shortValue();
}
} else {
startHour = dtoList.get(i).getHour().shortValue();
startMin = add.shortValue();
}
string = " --hour" + index + "=" + startHour + " --min" + index + "=" + startMin + " --preset" + index + "=" + perset; string = " --hour" + index + "=" + startHour + " --min" + index + "=" + startMin + " --preset" + index + "=" + perset;
} else if (XyNumberUtils.remainder(i, 3) == 1) { } else if (XyNumberUtils.remainder(i, 3) == 1) {
index = index - 1; index = index - 1;
endHour = dtoList.get(i).getHour().shortValue(); Number add = XyNumberUtils.add((Number) dtoList.get(i).getMinute(), offset);
endMin = dtoList.get(i).getMinute().shortValue(); if (add.intValue() >= 60) {
Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1);
if (add1.intValue() >= 24) {
endHour = Integer.valueOf(24).shortValue();
endMin = Integer.valueOf(0).shortValue();
} else {
endHour = add1.shortValue();
endMin = XyNumberUtils.sub(add, 60).shortValue();
}
} else {
endHour = dtoList.get(i).getHour().shortValue();
endMin = add.shortValue();
}
string = " --hour" + index + "=" + endHour + " --min" + index + "=" + endMin + " --preset" + index + "=" + perset; string = " --hour" + index + "=" + endHour + " --min" + index + "=" + endMin + " --preset" + index + "=" + perset;
} else if (XyNumberUtils.remainder(i, 3) == 2) { } else if (XyNumberUtils.remainder(i, 3) == 2) {
index = index - 1; index = index - 1;
spanHour = dtoList.get(i).getHour().shortValue(); spanHour = dtoList.get(i).getHour().shortValue();

@ -32,6 +32,9 @@ public class RelateTerminalListRuleIdVo {
@NotNull(message = "通道编号列表不能缺少") @NotNull(message = "通道编号列表不能缺少")
@ApiModelProperty(value = "通道编号列表", example = "123455") @ApiModelProperty(value = "通道编号列表", example = "123455")
private List<Integer> channelidlist; private List<Integer> channelidlist;
@ApiModelProperty(value = "偏移量", example = "123455")
private Integer offset;
} }
} }

@ -4,7 +4,6 @@ import com.shxy.xymanager_common.entity.ScheduleDetails;
import com.shxy.xymanager_common.entity.TerminalSchedule; import com.shxy.xymanager_common.entity.TerminalSchedule;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

@ -1,31 +0,0 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.ScheduleDetails;
import com.shxy.xymanager_common.entity.ScheduleDetailss;
import com.shxy.xymanager_common.entity.TerminalSchedule;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface ScheduleDetailssDao {
int insertSelective(ScheduleDetailss record);
int insertList(@Param("list") List<ScheduleDetailss> record, @Param("createat") Date create, @Param("updateat") Date update);
ScheduleDetails selectByPrimaryKey(Integer id);
List<ScheduleDetailss> selectAll(@Param("status") Integer status);
List<ScheduleDetailss> selectAllByList(@Param("list") List<TerminalSchedule> list);
int deleteById(@Param("scheduleid") Integer id);
int updateByPrimaryKeySelective(@Param("data") ScheduleDetailss record, @Param("updateat") Date update);
int updateByPrimaryKey(ScheduleDetailss record);
List<ScheduleDetailss> selectAllBySceduleidList(@Param("list") List<Integer> distinct);
}

@ -1,6 +1,7 @@
package com.shxy.xymanager_dao.dao; package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.*; import com.shxy.xymanager_common.dto.*;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.TerminalPhoto; import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -14,6 +15,8 @@ public interface TerminalPhotoDao {
List<TerminalPhoto> selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") List<Integer> channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime); List<TerminalPhoto> selectPhotoList(@Param("terminalid") Integer terminalid, @Param("channelid") List<Integer> channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
List<TerminalPhoto> selectPhotoListByTermList(@Param("terminalidlist") List<Integer> terminalid, @Param("channelidlist") List<Integer> channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(TerminalPhoto record); int insert(TerminalPhoto record);

@ -4,7 +4,6 @@ import com.shxy.xymanager_common.entity.TerminalSchedule;
import com.shxy.xymanager_common.entity.TerminalScheduleDetails; import com.shxy.xymanager_common.entity.TerminalScheduleDetails;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import javax.xml.crypto.Data;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

@ -1,27 +0,0 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.entity.TerminalSchedule;
import com.shxy.xymanager_common.entity.TerminalScheduleDetailss;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface TerminalScheduleDetailssDao {
int deleteByTermiAndChannel(Integer id);
int deleteByTermidAndChannelIdList(@Param("list") List<TerminalSchedule> lsit);
int insert(TerminalScheduleDetailss record);
int insertList(@Param("list") List<TerminalScheduleDetailss> record, @Param("createat") Date createat, @Param("updateat") Date updateat);
int insertSelective(TerminalScheduleDetailss record);
TerminalScheduleDetailss selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TerminalScheduleDetailss record);
int updateByPrimaryKey(TerminalScheduleDetailss record);
}

@ -24,7 +24,7 @@ public interface TerminalsDao {
List<Terminals> selectByTowerId(@Param("towerid") Integer towerid, @Param("status") Integer status); List<Terminals> selectByTowerId(@Param("towerid") Integer towerid, @Param("status") Integer status);
Terminals selectByToweridAndLineid(@Param("lineid") Integer lineid,@Param("towerid") Integer towerid, @Param("status") Integer status); List<Terminals> selectByToweridAndLineid(@Param("toweridlist") List<Integer> towerid, @Param("status") Integer status);
int insertList(@Param("item") Terminals record, @Param("status") Integer status, @Param("createat") Date create, @Param("updateat") Date update); int insertList(@Param("item") Terminals record, @Param("status") Integer status, @Param("createat") Date create, @Param("updateat") Date update);

@ -16,6 +16,8 @@ public interface TowerDao {
List<Tower> selectAllByLineid(@Param("lineid") Integer id,@Param("status") Integer status); List<Tower> selectAllByLineid(@Param("lineid") Integer id,@Param("status") Integer status);
List<Tower> selectAllByLineidList(@Param("lineidlist") List<Integer> id,@Param("status") Integer status);
int deleteById(@Param("list") List<Tower> record, @Param("status") Integer status, @Param("update") Date update); int deleteById(@Param("list") List<Tower> record, @Param("status") Integer status, @Param("update") Date update);
int updateByPrimaryKeySelective(@Param("data") Tower record, @Param("update") Date update); int updateByPrimaryKeySelective(@Param("data") Tower record, @Param("update") Date update);

@ -4,14 +4,14 @@
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.ScheduleDetails"> <resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.ScheduleDetails">
<id column="id" jdbcType="INTEGER" property="id"/> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/> <result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="start_time" jdbcType="TIME" property="startTime"/> <result column="hour" jdbcType="INTEGER" property="hour"/>
<result column="end_time" jdbcType="TIME" property="endTime"/> <result column="minute" jdbcType="INTEGER" property="minute"/>
<result column="span" jdbcType="INTEGER" property="span"/> <result column="preset" jdbcType="INTEGER" property="preset"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, schedule_id, start_time, end_time, span, create_time, update_time id, schedule_id, start_time, end_time, create_time, update_time
</sql> </sql>
<select id="selectByScheduleId" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByScheduleId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
@ -34,7 +34,6 @@
where status = #{status} where status = #{status}
</select> </select>
<select id="selectAllBySceduleidList" resultMap="BaseResultMap"> <select id="selectAllBySceduleidList" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
@ -58,10 +57,10 @@
<insert id="insertList" parameterType="java.util.List"> <insert id="insertList" parameterType="java.util.List">
insert into schedule_details insert into schedule_details
(schedule_id,start_time,end_time,span,create_time,update_time) (schedule_id,`hour`,`minute`,preset,create_time,update_time)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.scheduleId},#{item.startTime},#{item.endTime},#{item.span},#{createat},#{updateat}) (#{item.scheduleId},#{item.hour},#{item.minute},#{item.preset},#{createat},#{updateat})
</foreach> </foreach>
</insert> </insert>

@ -1,156 +0,0 @@
<?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.shxy.xymanager_dao.dao.ScheduleDetailssDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.ScheduleDetailss">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="schedule_id" jdbcType="INTEGER" property="scheduleId"/>
<result column="hour" jdbcType="INTEGER" property="hour"/>
<result column="minute" jdbcType="INTEGER" property="minute"/>
<result column="preset" jdbcType="INTEGER" property="preset"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, schedule_id, start_time, end_time, create_time, update_time
</sql>
<select id="selectByScheduleId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from schedule_detailss
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from schedule_detailss
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from schedule_detailss
where status = #{status}
</select>
<select id="selectAllBySceduleidList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from schedule_detailss
<if test="list != null and list.size > 0">
where schedule_id in
<foreach collection="list" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</select>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
insert into schedule_detailss (id, name, start_time,
end_time, span, remark,
create_time, update_time)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{startTime,jdbcType=TIME},
#{endTime,jdbcType=TIME}, #{span,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertList" parameterType="java.util.List">
insert into schedule_detailss
(schedule_id,`hour`,`minute`,preset,create_time,update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.scheduleId},#{item.hour},#{item.minute},#{item.preset},#{createat},#{updateat})
</foreach>
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
insert into schedule_detailss
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="span != null">
span,
</if>
<if test="remark != null">
remark,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIME},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIME},
</if>
<if test="span != null">
#{span,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<delete id="deleteById">
delete from schedule_detailss
where schedule_id = #{scheduleid}
</delete>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
update schedules
<set>
<if test="data.name != null">
name = #{data.name,jdbcType=VARCHAR},
</if>
<if test="data.remark != null">
remark = #{data.remark,jdbcType=VARCHAR},
</if>
<if test="updateat != null">
update_time = #{updateat,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{data.id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.ScheduleDetails">
update schedule_detailss
set name = #{name,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIME},
end_time = #{endTime,jdbcType=TIME},
span = #{span,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

@ -53,7 +53,7 @@
y.minute as minute, y.minute as minute,
y.preset as preset y.preset as preset
from schedules x, from schedules x,
schedule_detailss y schedule_details y
where y.schedule_id = x.id and x.status = #{status} where y.schedule_id = x.id and x.status = #{status}
<if test="list != null and list.size > 0"> <if test="list != null and list.size > 0">
and y.schedule_id in and y.schedule_id in
@ -61,7 +61,7 @@
#{item.id} #{item.id}
</foreach> </foreach>
</if> </if>
order by x.create_time desc order by y.id asc
</select> </select>
<select id="selectSingleScheduleAndDetailsList" resultMap="ScheduleAndRule"> <select id="selectSingleScheduleAndDetailsList" resultMap="ScheduleAndRule">
@ -76,7 +76,7 @@
y.minute as minute, y.minute as minute,
y.preset as preset y.preset as preset
from schedules x, from schedules x,
schedule_detailss y schedule_details y
where y.schedule_id = x.id and x.status = #{status} and y.schedule_id = #{id} where y.schedule_id = x.id and x.status = #{status} and y.schedule_id = #{id}
order by y.id asc order by y.id asc
</select> </select>

@ -52,7 +52,8 @@
</collection> </collection>
</resultMap> </resultMap>
<resultMap id="TermAndChannelLatestPhotoMap" type="com.shxy.xymanager_common.dto.TermAndChannelLatestPhotoMapperDto"> <resultMap id="TermAndChannelLatestPhotoMap"
type="com.shxy.xymanager_common.dto.TermAndChannelLatestPhotoMapperDto">
<id column="id" jdbcType="BIGINT" property="id"/> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termid"/> <result column="term_id" jdbcType="INTEGER" property="termid"/>
<result column="channel_id" jdbcType="INTEGER" property="channelid"/> <result column="channel_id" jdbcType="INTEGER" property="channelid"/>
@ -98,7 +99,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminal_photos from terminal_photos
where photo_time between #{starttime} and #{endtime} where photo_time between #{starttime} and #{endtime}
<if test="terminalid != null"> <if test="terminalid != null">
and term_id = #{terminalid} and term_id = #{terminalid}
</if> </if>
@ -110,6 +111,25 @@
</if> </if>
order by photo_time desc order by photo_time desc
</select> </select>
<select id="selectPhotoListByTermList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
where photo_time between #{starttime} and #{endtime}
<if test="terminalidlist != null">
and term_id in
<foreach collection="terminalidlist" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="channelidlist != null and channelidlist.size > 0">
and channel_id in
<foreach collection="channelidlist" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
order by photo_time desc
</select>
<!-- <select id="selectPhotos" resultMap="BaseResultMap">--> <!-- <select id="selectPhotos" resultMap="BaseResultMap">-->
<!-- select--> <!-- select-->
@ -397,7 +417,8 @@
order by create_time desc limit 1 order by create_time desc limit 1
</select> </select>
<insert id="addPhotoMark" keyProperty="id" useGeneratedKeys="true" parameterType="com.shxy.xymanager_common.vo.PhotoMarkVo"> <insert id="addPhotoMark" keyProperty="id" useGeneratedKeys="true"
parameterType="com.shxy.xymanager_common.vo.PhotoMarkVo">
insert into terminal_photo_marks (term_id, channel_id, insert into terminal_photo_marks (term_id, channel_id,
color, width, height,boder_width ,create_time color, width, height,boder_width ,create_time
) )
@ -451,7 +472,6 @@
</delete> </delete>
<select id="selectPhotoMark" resultMap="PhotoMarkMap" parameterType="com.shxy.xymanager_common.vo.MarkReqVo"> <select id="selectPhotoMark" resultMap="PhotoMarkMap" parameterType="com.shxy.xymanager_common.vo.MarkReqVo">
select select
tpm.term_id as term_id, tpm.term_id as term_id,

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

@ -5,8 +5,8 @@
<id column="id" jdbcType="INTEGER" property="id"/> <id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/> <result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/> <result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="start_time" jdbcType="TIME" property="startTime"/> <result column="hour" jdbcType="INTEGER" property="hour"/>
<result column="end_time" jdbcType="TIME" property="endTime"/> <result column="minute" jdbcType="INTEGER" property="minute"/>
<result column="span" jdbcType="INTEGER" property="span"/> <result column="span" jdbcType="INTEGER" property="span"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
@ -25,7 +25,7 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails"> <insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
insert into terminal_schedule_details (id, schedule_id, start_time, insert into terminal_schedule_details (id, schedule_id, start_time,
end_time, span, create_time, end_time, span, create_time,
update_time) update_time)
values (#{id,jdbcType=INTEGER}, #{scheduleId,jdbcType=INTEGER}, #{startTime,jdbcType=TIME}, values (#{id,jdbcType=INTEGER}, #{scheduleId,jdbcType=INTEGER}, #{startTime,jdbcType=TIME},

@ -1,135 +0,0 @@
<?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.shxy.xymanager_dao.dao.TerminalScheduleDetailssDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.TerminalScheduleDetailss">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="hour" jdbcType="INTEGER" property="hour"/>
<result column="minute" jdbcType="INTEGER" property="minute"/>
<result column="span" jdbcType="INTEGER" property="span"/>
<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, start_time, end_time, span, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_detailss
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedule_detailss
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
insert into terminal_schedule_detailss (id, schedule_id, start_time,
end_time, span, create_time,
update_time)
values (#{id,jdbcType=INTEGER}, #{scheduleId,jdbcType=INTEGER}, #{startTime,jdbcType=TIME},
#{endTime,jdbcType=TIME}, #{span,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertList">
insert into terminal_schedule_detailss
(term_id, channel_id,start_time, end_time, span, create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{item.startTime},#{item.endTime},#{item.span},#{createat},#{updateat})
</foreach>
</insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
insert into terminal_schedule_detailss
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="scheduleId != null">
schedule_id,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="span != null">
span,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="scheduleId != null">
#{scheduleId,jdbcType=INTEGER},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIME},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIME},
</if>
<if test="span != null">
#{span,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
update terminal_schedule_detailss
<set>
<if test="scheduleId != null">
schedule_id = #{scheduleId,jdbcType=INTEGER},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIME},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIME},
</if>
<if test="span != null">
span = #{span,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.TerminalScheduleDetails">
update terminal_schedule_detailss
set schedule_id = #{scheduleId,jdbcType=INTEGER},
start_time = #{startTime,jdbcType=TIME},
end_time = #{endTime,jdbcType=TIME},
span = #{span,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteByTermidAndChannelIdList">
delete from terminal_schedule_detailss
where
<foreach collection="list" item="item" index="index" separator="or" open="(" close=")">
term_id = #{item.termId} and channel_id = #{item.channelId}
</foreach>
</delete>
</mapper>

@ -98,16 +98,16 @@
</foreach> </foreach>
</if> </if>
<!-- select--> <!-- select-->
<!-- <include refid="Base_Column_List"/>--> <!-- <include refid="Base_Column_List"/>-->
<!-- from terminals--> <!-- from terminals-->
<!-- where status = #{status}--> <!-- where status = #{status}-->
<!-- <if test="list != null and list.size>0">--> <!-- <if test="list != null and list.size>0">-->
<!-- and id in--> <!-- and id in-->
<!-- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">--> <!-- <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">-->
<!-- #{id}--> <!-- #{id}-->
<!-- </foreach>--> <!-- </foreach>-->
<!-- </if>--> <!-- </if>-->
</select> </select>
<select id="selectChannelAndTermList" resultMap="ChannelAndTerm"> <select id="selectChannelAndTermList" resultMap="ChannelAndTerm">
@ -176,7 +176,13 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from terminals from terminals
where line_id = #{lineid} and tower_id = #{towerid} and status = #{status} where status = #{status}
<if test="toweridlist != null and toweridlist.size > 0">
and tower_id in
<foreach collection="toweridlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</select> </select>
<select id="selectByTowerId" resultMap="BaseResultMap"> <select id="selectByTowerId" resultMap="BaseResultMap">
select select

@ -27,12 +27,25 @@
select select
id, name, line_id id, name, line_id
from tower from tower
where status = #{status} where status = #{status}
<if test="lineid != null"> <if test="lineid != null">
and line_id = #{lineid} and line_id = #{lineid}
</if> </if>
</select> </select>
<select id="selectAllByLineidList" resultType="com.shxy.xymanager_common.entity.Tower">
select
id, name, line_id
from tower
where status = #{status}
<if test="lineidlist != null and lineidlist.size>0">
and line_id in
<foreach collection="lineidlist" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="getInfoByPrimaryKey" resultType="com.shxy.xymanager_common.dto.TowerDto"> <select id="getInfoByPrimaryKey" resultType="com.shxy.xymanager_common.dto.TowerDto">
select select
t.id as id, t.id as id,

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

@ -10,5 +10,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/download/**").addResourceLocations("file:/usr/local/home/manager/download/"); registry.addResourceHandler("/download/**").addResourceLocations("file:/usr/local/home/manager/download/");
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
} }
} }

@ -1,19 +1,11 @@
package com.shxy.xymanager_framework.interaction; 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 com.shxy.xymanager_service.service.SysUserService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;

@ -26,9 +26,9 @@ public class ScheduledTask {
// terminalTask.execute(); // terminalTask.execute();
// } // }
@Scheduled(cron = "0 0 0/2 * * ?") @Scheduled(cron = "0 0/5 0 * * ?")
public void cacheinit() { public void cacheinit() {
//每2小时执行一次缓存 //每5分钟执行一次缓存
cache.init(); cache.init();
} }
} }

@ -153,42 +153,45 @@ public class LineServiceImpl implements LineService {
if (id != null && id.intValue() == 0) { if (id != null && id.intValue() == 0) {
id = null; id = null;
} }
List<LineAndGtAndChannelListModel.Bean> beans = new ArrayList<>();
//查询所有 //查询所有
if (type == 1) { if (type == 1) {
List<DyLevel> list = dyLevelDao.selectAll(CommonStatus.EFFECTIVE.value()); List<DyLevel> list = dyLevelDao.selectAll(CommonStatus.EFFECTIVE.value());
List<LineAndGtAndChannelListModel.Bean> beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class); beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
model.setList(beans);
} else if (type == 2) { } else if (type == 2) {
List<Lines> list = linesDao.selectLineByDyId(id, CommonStatus.EFFECTIVE.value()); if (id != null) {
List<LineAndGtAndChannelListModel.Bean> beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class); List<Lines> list = linesDao.selectLineByDyId(id, CommonStatus.EFFECTIVE.value());
model.setList(beans); beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
}
} else if (type == 3) { } else if (type == 3) {
List<Tower> list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value()); if (id != null) {
List<LineAndGtAndChannelListModel.Bean> beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class); List<Tower> list = towerDao.selectAllByLineid(id, CommonStatus.EFFECTIVE.value());
model.setList(beans); beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
}
} else if (type == 4) { } else if (type == 4) {
List<Terminals> list = terminalsDao.selectByTowerId(id, CommonStatus.EFFECTIVE.value()); if (id != null) {
List<LineAndGtAndChannelListModel.Bean> beans = new ArrayList<>(); List<Terminals> list = terminalsDao.selectByTowerId(id, CommonStatus.EFFECTIVE.value());
for (Terminals item : list) { for (Terminals item : list) {
LineAndGtAndChannelListModel.Bean bean = new LineAndGtAndChannelListModel.Bean(); LineAndGtAndChannelListModel.Bean bean = new LineAndGtAndChannelListModel.Bean();
bean.setId(item.getId()); bean.setId(item.getId());
bean.setName(item.getDisplayName()); bean.setName(item.getDisplayName());
beans.add(bean); beans.add(bean);
}
} }
model.setList(beans);
} else if (type == 5) { } else if (type == 5) {
List<TermChannelAndMapperDto> list = terminalChannelsDao.selectByTermid(id, CommonStatus.EFFECTIVE.value()); if (id != null) {
List<LineAndGtAndChannelListModel.Bean> beans = new ArrayList<>(); List<TermChannelAndMapperDto> list = terminalChannelsDao.selectByTermid(id, CommonStatus.EFFECTIVE.value());
for (TermChannelAndMapperDto item : list) { for (TermChannelAndMapperDto item : list) {
LineAndGtAndChannelListModel.Bean bean = new LineAndGtAndChannelListModel.Bean(); LineAndGtAndChannelListModel.Bean bean = new LineAndGtAndChannelListModel.Bean();
Integer channelid = item.getChannelid(); Integer channelid = item.getChannelid();
String channelname = item.getChannelname(); String channelname = item.getChannelname();
bean.setId(channelid); bean.setId(channelid);
bean.setName(channelname); bean.setName(channelname);
beans.add(bean); beans.add(bean);
}
} }
model.setList(beans);
} }
model.setList(beans);
return Asserts.success(model); return Asserts.success(model);
} }

@ -1,6 +1,8 @@
package com.shxy.xymanager_service.impl; package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -11,6 +13,7 @@ import com.shxy.xymanager_common.config.CustomRsaProperties;
import com.shxy.xymanager_common.entity.UserSession; import com.shxy.xymanager_common.entity.UserSession;
import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.LineListModel;
import com.shxy.xymanager_common.model.SysUserModel; import com.shxy.xymanager_common.model.SysUserModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils; import com.shxy.xymanager_common.util.MyDateUtils;
@ -194,13 +197,16 @@ public class SysUserServiceImpl implements SysUserService {
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
List<SysUserModel.SysUserBean> beans = Lists.newArrayList(); List<SysUserModel.SysUserBean> beans = BeanUtil.copyToList(list,SysUserModel.SysUserBean.class, CopyOptions.create().ignoreCase());
list.forEach(var->{
SysUserModel.SysUserBean bean = new SysUserModel.SysUserBean(); // BeanUtil.copyToList()
BeanUtils.copyProperties(var,bean); // List<SysUserModel.SysUserBean> beans = Lists.newArrayList();
bean.setCreateTime(MyDateUtils.TimeMillSecondToSecond(MyDateUtils.beginOfDay(var.getCreateTime()))); // list.forEach(var->{
beans.add(bean); // SysUserModel.SysUserBean bean = new SysUserModel.SysUserBean();
}); // BeanUtils.copyProperties(var,bean);
// bean.setCreateTime(var.getCreateTime());
// beans.add(bean);
// });
model.setList(beans); model.setList(beans);
} }
PageInfo pageData = PageUtils.getPageData(list); PageInfo pageData = PageUtils.getPageData(list);

@ -12,10 +12,7 @@ import com.google.common.collect.Lists;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.constant.Constants; import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.*; import com.shxy.xymanager_common.dto.*;
import com.shxy.xymanager_common.entity.Lines; import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.entity.Terminals;
import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
@ -24,10 +21,7 @@ import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.ProcessExecUtils; import com.shxy.xymanager_common.util.ProcessExecUtils;
import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.LinesDao; import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.cache.XyCache; import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.TerminalPhotoService; import com.shxy.xymanager_service.service.TerminalPhotoService;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService; import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
@ -59,6 +53,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Autowired @Autowired
LinesDao linesDao; LinesDao linesDao;
@Autowired
TowerDao towerDao;
@Autowired @Autowired
TerminalChannelsDao terminalChannelsDao; TerminalChannelsDao terminalChannelsDao;
@ -143,6 +140,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>(); List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>();
Integer dyid = vo.getDyid(); Integer dyid = vo.getDyid();
Integer lineid = vo.getLineid(); Integer lineid = vo.getLineid();
Integer termid = vo.getTermid();
Integer towerid = vo.getTowerid(); Integer towerid = vo.getTowerid();
Integer channelid = vo.getChannelid(); Integer channelid = vo.getChannelid();
int pageindex = vo.getPageindex(); int pageindex = vo.getPageindex();
@ -155,18 +153,58 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
if (BeanUtil.isEmpty(dyid) || BeanUtil.isEmpty(lineid) || BeanUtil.isEmpty(towerid) || BeanUtil.isEmpty(channelid)) { if (BeanUtil.isEmpty(dyid) || BeanUtil.isEmpty(lineid) || BeanUtil.isEmpty(towerid) || BeanUtil.isEmpty(channelid)) {
model.setList(beans); model.setList(beans);
} else { } else {
Integer termid = null; List<Integer> termidlist = new ArrayList<>();
ArrayList<Integer> channelidlist = new ArrayList<>(); ArrayList<Integer> channelidlist = new ArrayList<>();
if (dyid == null || dyid.intValue() == 0) { ArrayList<Integer> lineidlist = new ArrayList<>();
ArrayList<Integer> toweridlist = new ArrayList<>();
} else { if (dyid == null || dyid.intValue() == 0) {//电压选择全部
channelidlist.add(channelid);
Terminals terminals = terminalsDao.selectByToweridAndLineid(lineid, towerid, CommonStatus.EFFECTIVE.value()); } else {//电压选择某一个
if (BeanUtil.isEmpty(terminals)) { if (lineid == null || lineid.intValue() == 0) {//线路选择全部
return Asserts.error("没有该装置信息"); List<Lines> lines = linesDao.selectLineByDyId(dyid, CommonStatus.EFFECTIVE.value());
for (Lines item : lines) {
lineidlist.add(item.getId());
}
List<Tower> towers = towerDao.selectAllByLineidList(lineidlist, CommonStatus.EFFECTIVE.value());
for (Tower item : towers) {
toweridlist.add(item.getId());
}
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
for (Terminals item : terminals) {
termidlist.add(item.getId());
}
} else {//线路选择某一个
if (towerid == null || towerid.intValue() == 0) {//杆塔选择全部
List<Tower> towers = towerDao.selectAllByLineid(lineid, CommonStatus.EFFECTIVE.value());
for (Tower item : towers) {
toweridlist.add(item.getId());
}
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
for (Terminals item : terminals) {
termidlist.add(item.getId());
}
} else {//杆塔选择一个
if (termid == null || termid.intValue() == 0) {//装置选择全部
toweridlist.add(towerid);
List<Terminals> terminals = terminalsDao.selectByToweridAndLineid(toweridlist, CommonStatus.EFFECTIVE.value());
for (Terminals item : terminals) {
termidlist.add(item.getId());
}
} else {//装置选择一个
if (channelid == null || channelid.intValue() == 0) {//通道选择全部
List<TermChannelAndMapperDto> dtos = terminalChannelsDao.selectByTermid(termid, CommonStatus.EFFECTIVE.value());
for (TermChannelAndMapperDto item : dtos) {
channelidlist.add(item.getChannelid());
}
} else {//通道选择某一个
channelidlist.add(channelid);
}
}
}
} }
} }
list = terminalPhotoDao.selectPhotoList(termid, channelidlist, start, end);
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, start, end);
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());

@ -5,7 +5,6 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
@ -47,7 +46,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
SchedulesDao schedulesDao; SchedulesDao schedulesDao;
@Autowired @Autowired
ScheduleDetailssDao scheduleDetailssDao; ScheduleDetailsDao scheduleDetailsDao;
@Autowired @Autowired
TerminalScheduleDao terminalScheduleDao; TerminalScheduleDao terminalScheduleDao;
@ -157,8 +156,8 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
schedules.setUpdateTime(date); schedules.setUpdateTime(date);
int i1 = schedulesDao.insertSelective(schedules); int i1 = schedulesDao.insertSelective(schedules);
if (i1 != 0) { if (i1 != 0) {
ArrayList<ScheduleDetailss> list = ScheduleListUtils.getScheduleDetailsses(vo.getList(), schedules.getId()); ArrayList<ScheduleDetails> list = ScheduleListUtils.getScheduleDetailsses(vo.getList(), schedules.getId());
int i = scheduleDetailssDao.insertList(list, date, date); int i = scheduleDetailsDao.insertList(list, date, date);
if (i != 0) { if (i != 0) {
return Asserts.success("录入成功"); return Asserts.success("录入成功");
} else { } else {
@ -189,9 +188,9 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
schedule.setRemark(vo.getRemark()); schedule.setRemark(vo.getRemark());
schedule.setUpdateTime(date); schedule.setUpdateTime(date);
schedulesDao.updateByPrimaryKeySelective(schedule); schedulesDao.updateByPrimaryKeySelective(schedule);
scheduleDetailssDao.deleteById(scheduleid); scheduleDetailsDao.deleteById(scheduleid);
ArrayList<ScheduleDetailss> list = ScheduleListUtils.getScheduleDetailsses(vo.getList(), scheduleid); ArrayList<ScheduleDetails> list = ScheduleListUtils.getScheduleDetailsses(vo.getList(), scheduleid);
int i = scheduleDetailssDao.insertList(list, date, date); int i = scheduleDetailsDao.insertList(list, date, date);
if (i != 0) { if (i != 0) {
return Asserts.success("修改成功"); return Asserts.success("修改成功");
} else { } else {
@ -253,8 +252,13 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
for (int x = 0; x < terminalsList.size(); x++) { for (int x = 0; x < terminalsList.size(); x++) {
ChannelAndTermDto channelAndTermDto = terminalsList.get(x); ChannelAndTermDto channelAndTermDto = terminalsList.get(x);
int requestId = Constants.REQUEST_ID.addAndGet(1); int requestId = Constants.REQUEST_ID.addAndGet(1);
int offset = 0;
int offset = RandomUtil.randomInt(10); for (int i = 0; i < termlist.size(); i++) {
if (channelAndTermDto.getTermid().intValue() == termlist.get(i).getTermid().intValue()) {
offset = termlist.get(i).getOffset();
}
}
// int offset = RandomUtil.randomInt(10);
String timestr = ScheduleListUtils.relateTime(dtoList, offset); String timestr = ScheduleListUtils.relateTime(dtoList, offset);
String cmd = Constants.CMD + "schedule --group=" + dtoList.size() + " --flag=1 --clientid=10 --cmdid=" String cmd = Constants.CMD + "schedule --group=" + dtoList.size() + " --flag=1 --clientid=10 --cmdid="
@ -353,26 +357,48 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
public ServiceBody<TerminalScheduleRuleTimeListModel> getChannelSchelduleRule(TerminalAndChannelIdVo vo) { public ServiceBody<TerminalScheduleRuleTimeListModel> getChannelSchelduleRule(TerminalAndChannelIdVo vo) {
TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel(); TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel();
TerminalSchedule mapper = terminalScheduleDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid()); TerminalSchedule mapper = terminalScheduleDao.selectByChannelId(vo.getChannelid(), vo.getTerminalid());
Integer offset = mapper.getOffset();
if (offset == null) {
offset = 0;
}
model.setOffset(offset);
if (mapper == null) { if (mapper == null) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
Integer scheduleId = mapper.getScheduleId(); Integer scheduleId = mapper.getScheduleId();
ScheduleAndRuleDto bean = schedulesDao.selectSingleScheduleAndDetailsList(scheduleId, CommonStatus.EFFECTIVE.value()); ScheduleAndRuleDto bean = schedulesDao.selectSingleScheduleAndDetailsList(scheduleId, CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(bean)) {
List<ScheduleDetailsDto> list = bean.getList(); model.setList(new ArrayList<>());
ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = ScheduleListUtils.getScheduleDetailsBeans(list); } else {
ArrayList<String> timestrlist = new ArrayList<>(); List<ScheduleDetailsDto> list = bean.getList();
for (TerminalScheduleRuleModel.ScheduleRuleBean item : detailsBeans) { if (CollectionUtil.isEmpty(list)) {
Time startTime = item.getStartTime(); model.setList(new ArrayList<>());
Time endTime = item.getEndTime(); } else {
Integer span = item.getSpan(); ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = ScheduleListUtils.getScheduleDetailsBeans(list);
List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span); ArrayList<String> timestrlist = new ArrayList<>();
for (DateTime data : dateTimes) { for (TerminalScheduleRuleModel.ScheduleRuleBean item : detailsBeans) {
String dateTime = DateUtil.formatTime(data); // DateTime startTime = MyDateUtils.offsetMinute(item.getStartTime(), offset);
timestrlist.add(dateTime); // 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());
// }
Time startTime = item.getStartTime();
Time endTime = item.getEndTime();
Integer span = item.getSpan();
List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span);
for (DateTime data : dateTimes) {
String dateTime = DateUtil.formatTime(data);
timestrlist.add(dateTime);
}
}
model.setList(timestrlist);
} }
} }
model.setList(timestrlist);
} }
return Asserts.success(model); return Asserts.success(model);
} }

Loading…
Cancel
Save