历史图片修改

master
liuguijing 2 years ago
parent 616abf302a
commit faff17f126

@ -89,11 +89,11 @@
<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>

@ -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 ;
} }

@ -75,7 +75,7 @@ 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;
Number add = XyNumberUtils.add((Number) dtoList.get(i).getMinute(), 60); Number add = XyNumberUtils.add((Number) dtoList.get(i).getMinute(), offset);
if (add.intValue() >= 60) { if (add.intValue() >= 60) {
Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1); Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1);
if (add1.intValue() >= 24) { if (add1.intValue() >= 24) {
@ -92,7 +92,7 @@ public class ScheduleListUtils {
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;
Number add = XyNumberUtils.add((Number) dtoList.get(i).getMinute(), 60); Number add = XyNumberUtils.add((Number) dtoList.get(i).getMinute(), offset);
if (add.intValue() >= 60) { if (add.intValue() >= 60) {
Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1); Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1);
if (add1.intValue() >= 24) { if (add1.intValue() >= 24) {

@ -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);

@ -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);

@ -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,

@ -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,

@ -47,28 +47,11 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>--> <!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-tomcat</artifactId>--> <!-- <artifactId>spring-boot-starter-tomcat</artifactId>-->
<!-- <scope>provided</scope>--> <!-- <scope>provided</scope>-->
<!-- </dependency>--> <!-- </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 拦截器 --> <!-- SpringBoot 拦截器 -->
<dependency> <dependency>

@ -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/");
} }
} }

@ -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<>());

@ -361,6 +361,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
if (offset == null) { if (offset == null) {
offset = 0; offset = 0;
} }
model.setOffset(offset);
if (mapper == null) { if (mapper == null) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
@ -376,15 +377,18 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = ScheduleListUtils.getScheduleDetailsBeans(list); ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = ScheduleListUtils.getScheduleDetailsBeans(list);
ArrayList<String> timestrlist = new ArrayList<>(); ArrayList<String> timestrlist = new ArrayList<>();
for (TerminalScheduleRuleModel.ScheduleRuleBean item : detailsBeans) { for (TerminalScheduleRuleModel.ScheduleRuleBean item : detailsBeans) {
DateTime startTime = MyDateUtils.offsetMinute(item.getStartTime(), offset); // DateTime startTime = MyDateUtils.offsetMinute(item.getStartTime(), offset);
if (startTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getStartTime()))) { // if (startTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getStartTime()))) {
startTime = MyDateUtils.endOfDay(item.getStartTime()); // startTime = MyDateUtils.endOfDay(item.getStartTime());
//
} // }
DateTime endTime = MyDateUtils.offsetMinute(item.getEndTime(), offset); // DateTime endTime = MyDateUtils.offsetMinute(item.getEndTime(), offset);
if (endTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getEndTime()))) { // if (endTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getEndTime()))) {
endTime = MyDateUtils.endOfDay(item.getEndTime()); // endTime = MyDateUtils.endOfDay(item.getEndTime());
} // }
Time startTime = item.getStartTime();
Time endTime = item.getEndTime();
Integer span = item.getSpan(); Integer span = item.getSpan();
List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span); List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span);
for (DateTime data : dateTimes) { for (DateTime data : dateTimes) {

Loading…
Cancel
Save