历史图片修改

master
liuguijing 2 years ago
parent 616abf302a
commit faff17f126

@ -89,11 +89,11 @@
<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>
<!-- </excludes>-->
</resource>
</resources>
<finalName>xymanager-admin</finalName>

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

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

@ -75,7 +75,7 @@ public class ScheduleListUtils {
String string = "";
if (XyNumberUtils.remainder(i, 3) == 0) {
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) {
Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1);
if (add1.intValue() >= 24) {
@ -92,7 +92,7 @@ public class ScheduleListUtils {
string = " --hour" + index + "=" + startHour + " --min" + index + "=" + startMin + " --preset" + index + "=" + perset;
} else if (XyNumberUtils.remainder(i, 3) == 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) {
Number add1 = XyNumberUtils.add((Number) dtoList.get(i).getHour(), 1);
if (add1.intValue() >= 24) {

@ -1,6 +1,7 @@
package com.shxy.xymanager_dao.dao;
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.vo.*;
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> selectPhotoListByTermList(@Param("terminalidlist") List<Integer> terminalid, @Param("channelidlist") List<Integer> channelid, @Param("starttime") BigInteger starttime, @Param("endtime") BigInteger endtime);
int deleteByPrimaryKey(Long id);
int insert(TerminalPhoto record);

@ -24,7 +24,7 @@ public interface TerminalsDao {
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);

@ -16,6 +16,8 @@ public interface TowerDao {
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 updateByPrimaryKeySelective(@Param("data") Tower record, @Param("update") Date update);

@ -52,7 +52,8 @@
</collection>
</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"/>
<result column="term_id" jdbcType="INTEGER" property="termid"/>
<result column="channel_id" jdbcType="INTEGER" property="channelid"/>
@ -110,6 +111,25 @@
</if>
order by photo_time desc
</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-->
@ -397,7 +417,8 @@
order by create_time desc limit 1
</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,
color, width, height,boder_width ,create_time
)
@ -451,7 +472,6 @@
</delete>
<select id="selectPhotoMark" resultMap="PhotoMarkMap" parameterType="com.shxy.xymanager_common.vo.MarkReqVo">
select
tpm.term_id as term_id,

@ -176,7 +176,13 @@
select
<include refid="Base_Column_List"/>
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 id="selectByTowerId" resultMap="BaseResultMap">
select

@ -33,6 +33,19 @@
</if>
</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
t.id as id,

@ -53,23 +53,6 @@
<!-- <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>
<groupId>org.springframework.boot</groupId>

@ -10,5 +10,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
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();
// }
@Scheduled(cron = "0 0 0/2 * * ?")
@Scheduled(cron = "0 0/5 0 * * ?")
public void cacheinit() {
//每2小时执行一次缓存
//每5分钟执行一次缓存
cache.init();
}
}

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

@ -1,6 +1,8 @@
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.date.DateTime;
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.enums.CommonStatus;
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.page.PageUtils;
import com.shxy.xymanager_common.util.MyDateUtils;
@ -194,13 +197,16 @@ public class SysUserServiceImpl implements SysUserService {
if (empty) {
model.setList(new ArrayList<>());
} else {
List<SysUserModel.SysUserBean> beans = Lists.newArrayList();
list.forEach(var->{
SysUserModel.SysUserBean bean = new SysUserModel.SysUserBean();
BeanUtils.copyProperties(var,bean);
bean.setCreateTime(MyDateUtils.TimeMillSecondToSecond(MyDateUtils.beginOfDay(var.getCreateTime())));
beans.add(bean);
});
List<SysUserModel.SysUserBean> beans = BeanUtil.copyToList(list,SysUserModel.SysUserBean.class, CopyOptions.create().ignoreCase());
// BeanUtil.copyToList()
// List<SysUserModel.SysUserBean> beans = Lists.newArrayList();
// list.forEach(var->{
// SysUserModel.SysUserBean bean = new SysUserModel.SysUserBean();
// BeanUtils.copyProperties(var,bean);
// bean.setCreateTime(var.getCreateTime());
// beans.add(bean);
// });
model.setList(beans);
}
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.constant.Constants;
import com.shxy.xymanager_common.dto.*;
import com.shxy.xymanager_common.entity.Lines;
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.entity.*;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
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.StringUtils;
import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.LinesDao;
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_dao.dao.*;
import com.shxy.xymanager_service.cache.XyCache;
import com.shxy.xymanager_service.service.TerminalPhotoService;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
@ -59,6 +53,9 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
@Autowired
LinesDao linesDao;
@Autowired
TowerDao towerDao;
@Autowired
TerminalChannelsDao terminalChannelsDao;
@ -143,6 +140,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>();
Integer dyid = vo.getDyid();
Integer lineid = vo.getLineid();
Integer termid = vo.getTermid();
Integer towerid = vo.getTowerid();
Integer channelid = vo.getChannelid();
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)) {
model.setList(beans);
} else {
Integer termid = null;
List<Integer> termidlist = new ArrayList<>();
ArrayList<Integer> channelidlist = new ArrayList<>();
if (dyid == null || dyid.intValue() == 0) {
} else {
ArrayList<Integer> lineidlist = new ArrayList<>();
ArrayList<Integer> toweridlist = new ArrayList<>();
if (dyid == null || dyid.intValue() == 0) {//电压选择全部
} else {//电压选择某一个
if (lineid == null || lineid.intValue() == 0) {//线路选择全部
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);
Terminals terminals = terminalsDao.selectByToweridAndLineid(lineid, towerid, CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(terminals)) {
return Asserts.error("没有该装置信息");
}
}
list = terminalPhotoDao.selectPhotoList(termid, channelidlist, start, end);
}
}
}
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, start, end);
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
model.setList(new ArrayList<>());

@ -361,6 +361,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
if (offset == null) {
offset = 0;
}
model.setOffset(offset);
if (mapper == null) {
model.setList(new ArrayList<>());
} else {
@ -376,15 +377,18 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = ScheduleListUtils.getScheduleDetailsBeans(list);
ArrayList<String> timestrlist = new ArrayList<>();
for (TerminalScheduleRuleModel.ScheduleRuleBean item : detailsBeans) {
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());
}
// 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());
// }
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) {

Loading…
Cancel
Save