系统升级

hunan
liuguijing 2 years ago
parent d7820a3ec1
commit 7ddd07d908

@ -16,6 +16,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -36,8 +37,8 @@ public class DyLevelController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getdyTreeList") @RequestMapping("/getdyTreeList")
@Log(title = "获取电压等级树状列表接口", type = "查询") @Log(title = "获取电压等级树状列表接口", type = "查询")
public ResponseReult<DyLineTreeListModel> getdyTreeList() { public ResponseReult<DyLineTreeListModel> getdyTreeList(@Param("type") Integer type) {
ServiceBody<DyLineTreeListModel> serviceBody = dyLevelService.getdyTreeList(); ServiceBody<DyLineTreeListModel> serviceBody = dyLevelService.getdyTreeList(type);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {

@ -5,6 +5,7 @@ import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult; import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.entity.RequestResults;
import com.shxy.xymanager_common.model.*; import com.shxy.xymanager_common.model.*;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_service.service.TermSetService; import com.shxy.xymanager_service.service.TermSetService;
@ -54,4 +55,6 @@ public class TermSetController extends BaseController {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg()); return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
} }
} }
} }

@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -257,8 +258,8 @@ public class TerminalController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getOnlineTerminalList") @RequestMapping("/getOnlineTerminalList")
@Log(title = "获取设备列表", type = "查询") @Log(title = "获取设备列表", type = "查询")
public ResponseReult<List<TerminalAndLastPicListExcelModel>> getOnlineTerminalList() { public ResponseReult<List<TerminalAndLastPicListExcelModel>> getOnlineTerminalList(@Param("type") Integer type) {
ServiceBody<List<TerminalAndLastPicListExcelModel>> serviceBody = terminalService.getOnlineTerminalList(); ServiceBody<List<TerminalAndLastPicListExcelModel>> serviceBody = terminalService.getOnlineTerminalList(type);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) { if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData()); return ResponseReult.success(serviceBody.getData());
} else { } else {
@ -270,8 +271,8 @@ public class TerminalController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getOnlineTerminalListExcel") @RequestMapping("/getOnlineTerminalListExcel")
@Log(title = "导出设备在线和心跳时间和照片时间列表Excel", type = "查询") @Log(title = "导出设备在线和心跳时间和照片时间列表Excel", type = "查询")
public void getOnlineTerminalListExcel(HttpServletResponse response) throws IOException { public void getOnlineTerminalListExcel(HttpServletResponse response,@Param("type") Integer type) throws IOException {
ServiceBody<List<TerminalAndLastPicListExcelModel>> serviceBody = terminalService.getOnlineTerminalList(); ServiceBody<List<TerminalAndLastPicListExcelModel>> serviceBody = terminalService.getOnlineTerminalList(type);
EasyExcelUtil.createExcel(response,"设备在线表",serviceBody.getData(), TerminalAndLastPicListExcelModel.class); EasyExcelUtil.createExcel(response,"设备在线表",serviceBody.getData(), TerminalAndLastPicListExcelModel.class);
} }

@ -94,19 +94,6 @@ public class TerminalPhotoController extends BaseController {
} }
} }
@ApiOperation(value = "拍照时间表查询", notes = "拍照时间表查询", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/selectPhotoTime")
@Log(title = "拍照时间表查询", type = "查询")
public ResponseReult<TerminalScheduleRuleTimeListModel> selectPhotoTime(@RequestBody @Validated TerminalReqPhotoTimeVo vo) {
ServiceBody<TerminalScheduleRuleTimeListModel> serviceBody = terminalPhotoService.selectPhotoTime(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
@ApiOperation(value = "图片查询", notes = "图片查询接口", httpMethod = "POST") @ApiOperation(value = "图片查询", notes = "图片查询接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")}) @ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getPhotoList") @RequestMapping("/getPhotoList")

@ -119,7 +119,7 @@ xymanager:
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 8093 port: 8094
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: /api context-path: /api

@ -10,11 +10,10 @@ import java.util.concurrent.atomic.AtomicInteger;
/** /**
* *
* *
* @author xzg * @author jingjing
*/ */
@Component @Component
public class Constants public class Constants {
{
@Value("${cma.server}") @Value("${cma.server}")
public String cmServer; public String cmServer;
@ -22,23 +21,28 @@ public class Constants
@Value("${cma.port}") @Value("${cma.port}")
public int cmaPort; public int cmaPort;
private static String server; public static String server;
private static int port; public static int port;
public static String CMD = ""; public static String CMD = "";
public static String newCMD = "";
public static String shpath = "/usr/local/bin/xympadmn";
public static String serverpath = "";
public static String portpath = "";
@PostConstruct @PostConstruct
private void init(){ private void init() {
server = cmServer; server = cmServer;
port = cmaPort; port = cmaPort;
CMD = "/usr/local/bin/xympadmn --server="+server+" --port="+port+" --act="; CMD = "/usr/local/bin/xympadmn --server=" + server + " --port=" + port + " --act=";
newCMD = "/usr/local/bin/xympadmn --server=" + server + " --port=" + port;
serverpath = "--server=" + server;
portpath = "--port=" + port;
} }
/** /**
* UTF-8 * UTF-8
*/ */
@ -182,8 +186,8 @@ public class Constants
/** /**
* *
*/ */
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework.jndi" }; "org.springframework.jndi"};
/** /**
* *
@ -193,7 +197,7 @@ public class Constants
/** /**
* JNIID * JNIID
*/ */
public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis()/1000 - 1672502400)); // Based On 2023-01-01 00:00:00 public static AtomicInteger REQUEST_ID = new AtomicInteger((int) (System.currentTimeMillis() / 1000 - 1672502400)); // Based On 2023-01-01 00:00:00
} }

@ -29,6 +29,12 @@ public class TerminalsAndStatusAndLastPicDto implements Serializable {
private BigInteger lastHeartbeat; private BigInteger lastHeartbeat;
private Double latitude;
private Double longitude;
private Integer radius;
private List<LastPicTimeDto> list; private List<LastPicTimeDto> list;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -1,6 +1,7 @@
package com.shxy.xymanager_common.dto; package com.shxy.xymanager_common.dto;
import lombok.Data; import lombok.Data;
import org.omg.CORBA.INTERNAL;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigInteger; import java.math.BigInteger;
@ -27,7 +28,7 @@ public class TerminalsAndStatusDto implements Serializable {
private String essentialInfoVersion; private String essentialInfoVersion;
private Byte hasPan; private Integer hasPan;
private String bsManufacturer; private String bsManufacturer;
@ -41,6 +42,8 @@ public class TerminalsAndStatusDto implements Serializable {
private Integer status; private Integer status;
private Integer protocol;
private Short signalStrength4g; private Short signalStrength4g;
private BigInteger bootTime; private BigInteger bootTime;
@ -51,6 +54,10 @@ public class TerminalsAndStatusDto implements Serializable {
private BigInteger lastHeartbeat; private BigInteger lastHeartbeat;
private String sim;
private Date workingDate;
private Integer netType;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

@ -30,7 +30,7 @@ public class TerminalsWithHeart implements Serializable {
private String essentialInfoVersion; private String essentialInfoVersion;
private Byte hasPan; private Integer hasPan;
private String bsManufacturer; private String bsManufacturer;
@ -48,6 +48,9 @@ public class TerminalsWithHeart implements Serializable {
private BigInteger lastheartbeat; private BigInteger lastheartbeat;
private Integer protocol;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

@ -17,7 +17,7 @@ public class TerminalScheduleDetails implements Serializable {
private Integer minute; private Integer minute;
private Integer span; private Integer preset;
private Date createTime; private Date createTime;

@ -21,6 +21,12 @@ public class TerminalSchedulesTemp implements Serializable {
private Integer offset; private Integer offset;
private Integer hour;
private Integer minute;
private Integer preset;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;

@ -26,12 +26,16 @@ public class Terminals implements Serializable {
private String essentialInfoVersion; private String essentialInfoVersion;
private Byte hasPan; private Integer hasPan;
private String bsManufacturer; private String bsManufacturer;
private String sim;
private Date bsProductionDate; private Date bsProductionDate;
private Date workingDate;
private String bsIdentifier; private String bsIdentifier;
private Double latitude; private Double latitude;
@ -46,6 +50,10 @@ public class Terminals implements Serializable {
private Integer onlinestatus; private Integer onlinestatus;
private Integer netType;
private Integer protocol;
/*展示名字 等价与displayname 用于方便*/ /*展示名字 等价与displayname 用于方便*/
private String name; private String name;

@ -45,4 +45,19 @@ public class TerminalAndLastPicListExcelModel implements Serializable {
@ApiModelProperty(value = "最新照片上传时间", example = "123456") @ApiModelProperty(value = "最新照片上传时间", example = "123456")
private String pictime; private String pictime;
@ColumnWidth(20)
@ExcelProperty("纬度")
@ApiModelProperty(value = "纬度", example = "21321")
private Double latitude;
@ColumnWidth(20)
@ExcelProperty("经度")
@ApiModelProperty(value = "经度", example = "213")
private Double longitude;
@ColumnWidth(20)
@ExcelProperty("半径")
@ApiModelProperty(value = "经度", example = "123456")
private Integer radius;
} }

@ -32,12 +32,21 @@ public class TerminalListModel implements Serializable {
@ApiModelProperty(value = "设备编号", example = "123456") @ApiModelProperty(value = "设备编号", example = "123456")
private Integer id; private Integer id;
@ApiModelProperty(value = "电压编号", example = "123456")
private Integer dyId;
@ApiModelProperty(value = "电压名称", example = "123456")
private String dyName;
@ApiModelProperty(value = "线路编号", example = "123456") @ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineId; private Integer lineId;
@ApiModelProperty(value = "线路名称", example = "123456") @ApiModelProperty(value = "线路名称", example = "123456")
private String lineName; private String lineName;
@ApiModelProperty(value = "线路公司名称", example = "123456")
private String lineBsManufacturer;
@ApiModelProperty(value = "杆塔编号", example = "123456") @ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerId; private Integer towerId;
@ -63,7 +72,7 @@ public class TerminalListModel implements Serializable {
private String essentialInfoVersion; private String essentialInfoVersion;
@ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台") @ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台")
private Byte hasPan; private Integer hasPan;
@ApiModelProperty(value = "生产厂家", example = "生产厂家") @ApiModelProperty(value = "生产厂家", example = "生产厂家")
private String bsManufacturer; private String bsManufacturer;
@ -74,6 +83,12 @@ public class TerminalListModel implements Serializable {
@ApiModelProperty(value = "出厂编号", example = "123456") @ApiModelProperty(value = "出厂编号", example = "123456")
private String bsIdentifier; private String bsIdentifier;
@ApiModelProperty(value = "地址", example = "地址")
private String address;
@ApiModelProperty(value = "杆塔排序", example = "1")
private Integer order;
@ApiModelProperty(value = "纬度", example = "21321") @ApiModelProperty(value = "纬度", example = "21321")
private Double latitude; private Double latitude;

@ -35,13 +35,13 @@ public class TerminalScheduleRuleModel implements Serializable {
@ApiModelProperty(value = "任务规则编号", example = "123456") @ApiModelProperty(value = "任务规则编号", example = "123456")
private Integer scheduleId; private Integer scheduleId;
@ApiModelProperty(value = "间隔", example = "213") @ApiModelProperty(value = "", example = "213")
private Integer span; private Integer hour;
@ApiModelProperty(value = "开始时间", example = "2022-06-08") @ApiModelProperty(value = "", example = "2022-06-08")
private Time startTime; private Integer minute;
@ApiModelProperty(value = "结束时间", example = "2022-06-08") @ApiModelProperty(value = "预置位", example = "2022-06-08")
private Time endTime; private Integer preset;
} }
} }

@ -16,13 +16,24 @@ import java.util.List;
public class TerminalScheduleRuleTimeListModel implements Serializable { public class TerminalScheduleRuleTimeListModel implements Serializable {
@ApiModelProperty(value = "任务名称", example = "123456") @ApiModelProperty(value = "任务名称", example = "123456")
private List<String> list; private List<ScheduleRuleBean> list;
@ApiModelProperty(value = "是否最新", example = "123456") @ApiModelProperty(value = "是否最新", example = "123456")
private Boolean isNew = false; private Boolean isNew = false;
@ApiModelProperty(value = "偏移量", example = "123456") @ApiModelProperty(value = "偏移量", example = "123456")
private Integer offset ; private Integer offset;
@Data
public static class ScheduleRuleBean {
@ApiModelProperty(value = "时", example = "213")
private Integer hour;
@ApiModelProperty(value = "分", example = "2022-06-08")
private Integer minute;
@ApiModelProperty(value = "预置位", example = "2022-06-08")
private Integer preset;
}
} }

@ -1,8 +1,13 @@
package com.shxy.xymanager_common.util; package com.shxy.xymanager_common.util;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.constant.Constants; import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.dto.ScheduleDetailsDto; import com.shxy.xymanager_common.dto.ScheduleDetailsDto;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.vo.ScheduleRuleVo;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -97,7 +102,7 @@ public class CmaUtil {
* *
* @return * @return
*/ */
public static String relateSchelduleRule(List<ScheduleDetailsDto> dtoList, String cmdid, Integer requestId, Integer channel, String timestr) { public static String relateSchelduleRule(List<ScheduleRuleVo> dtoList, String cmdid, Integer requestId, Integer channel, String timestr) {
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="
+ cmdid + " --reqid=" + requestId + " --channel=" + channel + " " + + cmdid + " --reqid=" + requestId + " --channel=" + channel + " " +
timestr; timestr;
@ -212,5 +217,17 @@ public class CmaUtil {
return cmd; return cmd;
} }
/**
*
*
* @param cmdid
* @param requestId
* @return
*/
public static String cameractrl(String cmdid, Integer channel, Integer requestId, Integer ctrl) {
String cmd = Constants.CMD + "cameractrl --clientid=10 --preset=0 --cmdid=" + cmdid + " --channel=" + channel + " --ctrl=" + ctrl + " --reqid=" + requestId;
return cmd;
}
} }

@ -1,5 +1,6 @@
package com.shxy.xymanager_common.util.xinyin; package com.shxy.xymanager_common.util.xinyin;
import com.shxy.xymanager_common.constant.Constants;
import com.shxy.xymanager_common.util.StringUtils; import com.shxy.xymanager_common.util.StringUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -7,16 +8,16 @@ import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.List;
import java.util.UUID; import java.util.UUID;
/** /**
*
* *
*
* @author cy * @author cy
*/ */
@Slf4j @Slf4j
public class ProcessExecUtils public class ProcessExecUtils {
{
/** /**
* *
@ -48,6 +49,35 @@ public class ProcessExecUtils
return sendToCode; return sendToCode;
} }
/**
*
*/
public static Integer execArray(List<String> cmd) {
String[] strings = new String[cmd.size()];
String[] cmdstring = cmd.toArray(strings);
String line = "";
StringBuffer sb = new StringBuffer();
String result = "";
Integer sendToCode = -1;
try {
Process ps = Runtime.getRuntime().exec(cmdstring);
log.info("传入cmd信息:{}", cmd.toString());
BufferedReader reader = new BufferedReader(new InputStreamReader(ps.getInputStream()));
sendToCode = ps.waitFor();
log.info("进程返回结果:{}", sendToCode);
while ((line = reader.readLine()) != null) {
sb.append(line).append("\n");
}
result = sb.toString();
if (StringUtils.isNotBlank(result)) {
log.info("查询最新结果:{}", result);
}
} catch (IOException e) {
log.error("IOException", e);
} catch (InterruptedException e) {
log.error("InterruptedException", e);
}
return sendToCode;
}
} }

@ -33,31 +33,41 @@ public class ScheduleListUtils {
ArrayList<ScheduleDetails> list = new ArrayList<>(); ArrayList<ScheduleDetails> list = new ArrayList<>();
for (ScheduleRuleVo item : beans) { for (ScheduleRuleVo item : beans) {
Integer span = item.getSpan(); // Integer span = item.getSpan();
ScheduleDetails spanrule = new ScheduleDetails(); // 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));
spanrule.setPreset(255); // spanrule.setPreset(255);
list.add(spanrule); // list.add(spanrule);
//
ScheduleDetails startrule = new ScheduleDetails();
startrule.setScheduleId(scheduleid);
Time startTime = item.getStartTime();
startrule.setHour(MyDateUtils.hour(startTime, true));
startrule.setMinute(MyDateUtils.minute(startTime));
startrule.setPreset(255);
list.add(startrule);
ScheduleDetails endrule = new ScheduleDetails();
endrule.setScheduleId(scheduleid);
Time endTime = item.getEndTime();
endrule.setHour(MyDateUtils.hour(endTime, true));
endrule.setMinute(MyDateUtils.minute(endTime));
endrule.setPreset(255);
list.add(endrule);
// ScheduleDetails startrule = new ScheduleDetails();
// startrule.setScheduleId(scheduleid);
// Time startTime = item.getStartTime();
// startrule.setHour(MyDateUtils.hour(startTime, true));
// startrule.setMinute(MyDateUtils.minute(startTime));
// startrule.setPreset(255);
// list.add(startrule);
//
// ScheduleDetails endrule = new ScheduleDetails();
// endrule.setScheduleId(scheduleid);
// Time endTime = item.getEndTime();
// endrule.setHour(MyDateUtils.hour(endTime, true));
// endrule.setMinute(MyDateUtils.minute(endTime));
// endrule.setPreset(255);
// list.add(endrule);
ScheduleDetails rule = new ScheduleDetails();
Integer hour = item.getHour();
Integer minute = item.getMinute();
Integer preset = item.getPreset();
rule.setScheduleId(scheduleid);
rule.setHour(hour);
rule.setMinute(minute);
rule.setPreset(preset);
list.add(rule);
} }
return list; return list;
} }
@ -67,70 +77,86 @@ public class ScheduleListUtils {
* CMA * CMA
* *
* @param dtoList * @param dtoList
* @param offset
* @return * @return
*/ */
public static String relateTime(List<ScheduleDetailsDto> dtoList, int offset) { public static String relateTime(List<ScheduleRuleVo> dtoList) {
StringBuffer timestr = new StringBuffer(); StringBuffer timestr = new StringBuffer();
if (CollectionUtil.isNotEmpty(dtoList)) {
short perset = dtoList.get(0).getPreset().shortValue(); short perset = dtoList.get(0).getPreset().shortValue();
int index = 0; int index = 0;
String startstring = "";
String endstring = "";
String spanstring = ""; String spanstring = "";
for (int i = 0; i < dtoList.size(); i++) { for (int i = 0; i < dtoList.size(); i++) {
short startHour = 0;
short startMin = 0;
short endHour = 0;
short endMin = 0;
short spanHour = 0;
short spanMin = 0;
if (XyNumberUtils.remainder(i, 3) == 0) {
index = i + 1; index = i + 1;
spanHour = dtoList.get(i).getHour().shortValue(); short spanHour = dtoList.get(i).getHour().shortValue();
spanMin = dtoList.get(i).getMinute().shortValue(); short spanMin = dtoList.get(i).getMinute().shortValue();
spanstring = " --hour" + index + "=" + spanHour + " --min" + index + "=" + spanMin + " --preset" + index + "=" + perset; spanstring = " --hour" + index + "=" + spanHour + " --min" + index + "=" + spanMin + " --preset" + index + "=" + perset;
} else if (XyNumberUtils.remainder(i, 3) == 1) { timestr.append(spanstring);
index = i + 1;
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) {
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();
}
startstring = " --hour" + index + "=" + startHour + " --min" + index + "=" + startMin + " --preset" + index + "=" + perset;
} else if (XyNumberUtils.remainder(i, 3) == 2) {
index = i + 1;
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) {
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();
}
endstring = " --hour" + index + "=" + endHour + " --min" + index + "=" + endMin + " --preset" + index + "=" + perset;
if (StrUtil.isNotEmpty(spanstring) && StrUtil.isNotEmpty(startstring) && StrUtil.isNotEmpty(endstring)) {
timestr.append(spanstring).append(startstring).append(endstring);
}
} }
} }
return timestr.toString(); return timestr.toString();
} }
// public static String relateTime(List<ScheduleDetailsDto> dtoList, int offset) {
// StringBuffer timestr = new StringBuffer();
// short perset = dtoList.get(0).getPreset().shortValue();
// int index = 0;
// String startstring = "";
// String endstring = "";
// String spanstring = "";
// for (int i = 0; i < dtoList.size(); i++) {
// short startHour = 0;
// short startMin = 0;
// short endHour = 0;
// short endMin = 0;
// short spanHour = 0;
// short spanMin = 0;
// if (XyNumberUtils.remainder(i, 3) == 0) {
// index = i + 1;
// spanHour = dtoList.get(i).getHour().shortValue();
// spanMin = dtoList.get(i).getMinute().shortValue();
// spanstring = " --hour" + index + "=" + spanHour + " --min" + index + "=" + spanMin + " --preset" + index + "=" + perset;
// } else if (XyNumberUtils.remainder(i, 3) == 1) {
// index = i + 1;
// 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) {
// 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();
// }
// startstring = " --hour" + index + "=" + startHour + " --min" + index + "=" + startMin + " --preset" + index + "=" + perset;
// } else if (XyNumberUtils.remainder(i, 3) == 2) {
// index = i + 1;
// 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) {
// 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();
// }
// endstring = " --hour" + index + "=" + endHour + " --min" + index + "=" + endMin + " --preset" + index + "=" + perset;
// if (StrUtil.isNotEmpty(spanstring) && StrUtil.isNotEmpty(startstring) && StrUtil.isNotEmpty(endstring)) {
// timestr.append(spanstring).append(startstring).append(endstring);
// }
// }
// }
// return timestr.toString();
// }
// /** // /**
// * 将数据库标准转为前端的时间列表 // * 将数据库标准转为前端的时间列表
@ -171,32 +197,49 @@ public class ScheduleListUtils {
* @return * @return
*/ */
public static ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> getScheduleDetailsBeans(List<ScheduleDetailsDto> details) { public static ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> getScheduleDetailsBeans(List<ScheduleDetailsDto> details) {
// ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = new ArrayList<>();
// TerminalScheduleRuleModel.ScheduleRuleBean scheduleDetailsBean = new TerminalScheduleRuleModel.ScheduleRuleBean();
// for (int i = 0; i < details.size(); i++) {
// ScheduleDetailsDto dto = details.get(i);
// if (XyNumberUtils.remainder(i, 3) == 0) {
// scheduleDetailsBean = new TerminalScheduleRuleModel.ScheduleRuleBean();
// Integer hour = dto.getHour();
// Integer minute = dto.getMinute();
// Number mul = XyNumberUtils.mul((Number) hour, 60);
// Number add = XyNumberUtils.add(mul, minute);
// scheduleDetailsBean.setId(dto.getId());
// scheduleDetailsBean.setScheduleId(dto.getScheduleId());
// scheduleDetailsBean.setSpan(add.intValue());
// } else if (XyNumberUtils.remainder(i, 3) == 1) {
// Integer hour = dto
// .getHour();
// Integer minute = dto.getMinute();
// Time time = MyDateUtils.HHMMToTime(hour, minute);
// scheduleDetailsBean.setStartTime(time);
// } else if (XyNumberUtils.remainder(i, 3) == 2) {
// Integer hour = dto.getHour();
// Integer minute = dto.getMinute();
// Time time = MyDateUtils.HHMMToTime(hour, minute);
// scheduleDetailsBean.setEndTime(time);
// detailsBeans.add(scheduleDetailsBean);
// }
// }
ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = new ArrayList<>(); ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = new ArrayList<>();
TerminalScheduleRuleModel.ScheduleRuleBean scheduleDetailsBean = new TerminalScheduleRuleModel.ScheduleRuleBean();
for (int i = 0; i < details.size(); i++) { for (int i = 0; i < details.size(); i++) {
ScheduleDetailsDto dto = details.get(i); ScheduleDetailsDto dto = details.get(i);
if (XyNumberUtils.remainder(i, 3) == 0) { TerminalScheduleRuleModel.ScheduleRuleBean scheduleDetailsBean = new TerminalScheduleRuleModel.ScheduleRuleBean();
scheduleDetailsBean = new TerminalScheduleRuleModel.ScheduleRuleBean();
Integer hour = dto.getHour(); Integer hour = dto.getHour();
Integer minute = dto.getMinute(); Integer minute = dto.getMinute();
Number mul = XyNumberUtils.mul((Number) hour, 60); Integer preset = dto.getPreset();
Number add = XyNumberUtils.add(mul, minute);
scheduleDetailsBean.setId(dto.getId()); scheduleDetailsBean.setId(dto.getId());
scheduleDetailsBean.setScheduleId(dto.getScheduleId()); scheduleDetailsBean.setScheduleId(dto.getScheduleId());
scheduleDetailsBean.setSpan(add.intValue()); scheduleDetailsBean.setHour(hour);
} else if (XyNumberUtils.remainder(i, 3) == 1) { scheduleDetailsBean.setMinute(minute);
Integer hour = dto.getHour(); scheduleDetailsBean.setPreset(preset);
Integer minute = dto.getMinute();
Time time = MyDateUtils.HHMMToTime(hour, minute);
scheduleDetailsBean.setStartTime(time);
} else if (XyNumberUtils.remainder(i, 3) == 2) {
Integer hour = dto.getHour();
Integer minute = dto.getMinute();
Time time = MyDateUtils.HHMMToTime(hour, minute);
scheduleDetailsBean.setEndTime(time);
detailsBeans.add(scheduleDetailsBean); detailsBeans.add(scheduleDetailsBean);
} }
}
return detailsBeans; return detailsBeans;
} }

@ -1,6 +1,7 @@
package com.shxy.xymanager_common.util.xinyin; package com.shxy.xymanager_common.util.xinyin;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUnit;
import com.shxy.xymanager_common.dto.LineAndDyNameDto; import com.shxy.xymanager_common.dto.LineAndDyNameDto;
@ -19,6 +20,7 @@ import org.springframework.stereotype.Component;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -72,6 +74,16 @@ public class TerminalUtils {
} }
} }
/**
*
*/
public static BigInteger generateOnlineTime() {
DateTime offset = MyDateUtils.offset(new Date(), DateField.MINUTE, -hearttime);
long l = MyDateUtils.TimeMillSecond2Second(offset);
BigInteger bigInteger = BigInteger.valueOf(l);
return bigInteger;
}
/** /**
* *
*/ */
@ -164,7 +176,7 @@ public class TerminalUtils {
for (int y = 0; y < photoList.size(); y++) { for (int y = 0; y < photoList.size(); y++) {
TerminalPhoto terminalPhoto = photoList.get(y); TerminalPhoto terminalPhoto = photoList.get(y);
if (BeanUtil.isNotEmpty(terminalPhoto)) { if (BeanUtil.isNotEmpty(terminalPhoto)) {
if (terminalPhoto.getId() != null) { if (terminalPhoto.getId() != null && photoId != null) {
if (terminalPhoto.getId().longValue() == photoId.longValue()) { if (terminalPhoto.getId().longValue() == photoId.longValue()) {
Integer mediatype = terminalPhoto.getMediaType(); Integer mediatype = terminalPhoto.getMediaType();
if (mediatype != null && (mediatype.intValue() == 0 || mediatype.intValue() == 1)) { if (mediatype != null && (mediatype.intValue() == 0 || mediatype.intValue() == 1)) {
@ -292,7 +304,7 @@ public class TerminalUtils {
} }
public static List<TerminalPhotoSelectListModel.PhotoBean> fdsa(String requestIp, List<TerminalPhoto> list, Map<Integer, Terminals> terminalMap, Map<Integer, LineAndDyNameDto> lineMap, Map<Integer, TerminalChannels> termchannelMap, Map<String, TerminalChannelMapper> termchannelMapMap) { public static List<TerminalPhotoSelectListModel.PhotoBean> fdsa(String requestIp, List<TerminalPhoto> list, Map<Integer, Terminals> terminalMap, Map<Integer, LineAndDyNameDto> lineMap, Map<Integer, TowerDto> towerMap, Map<Integer, TerminalChannels> termchannelMap, Map<String, TerminalChannelMapper> termchannelMapMap) {
List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>(); List<TerminalPhotoSelectListModel.PhotoBean> beans = new ArrayList<>();
for (TerminalPhoto item : list) { for (TerminalPhoto item : list) {
TerminalPhotoSelectListModel.PhotoBean photoBean = new TerminalPhotoSelectListModel.PhotoBean(); TerminalPhotoSelectListModel.PhotoBean photoBean = new TerminalPhotoSelectListModel.PhotoBean();
@ -302,8 +314,18 @@ public class TerminalUtils {
Integer mediaType = item.getMediaType(); Integer mediaType = item.getMediaType();
if (mediaType != null && (mediaType.intValue() == 0 || mediaType.intValue() == 1)) { if (mediaType != null && (mediaType.intValue() == 0 || mediaType.intValue() == 1)) {
photoBean.setDisplayname(terminals.getDisplayName()); photoBean.setDisplayname(terminals.getDisplayName());
photoBean.setLineid(terminals.getLineid()); Integer towerid = terminals.getTowerid();
photoBean.setLinename(lineMap.get(terminals.getLineid()).getName()); if (towerMap != null) {
TowerDto towerDto = towerMap.get(towerid);
Integer lineId = towerDto.getLineId();
photoBean.setLineid(lineId);
if (lineMap != null) {
LineAndDyNameDto lineAndDyNameDto = lineMap.get(lineId);
if (lineAndDyNameDto != null) {
photoBean.setLinename(lineAndDyNameDto.getName());
}
}
}
Integer channelId = item.getChannelId(); Integer channelId = item.getChannelId();
photoBean.setChannelid(channelId); photoBean.setChannelid(channelId);
photoBean.setCmdid(terminals.getCmdid()); photoBean.setCmdid(terminals.getCmdid());

@ -31,10 +31,15 @@ public class RelateTerminalListRuleIdVo {
@NotNull(message = "通道编号列表不能缺少") @NotNull(message = "通道编号列表不能缺少")
@ApiModelProperty(value = "通道编号列表", example = "123455") @ApiModelProperty(value = "通道编号列表", example = "123455")
private List<Integer> channelidlist; private Integer channelid;
@ApiModelProperty(value = "偏移量", example = "123455") @ApiModelProperty(value = "偏移量", example = "123455")
private Integer offset; private Integer offset;
@NotNull(message = "不能传入空值")
@ApiModelProperty(value = "任务规则对象数组", required = true, example = "A0001")
private List<ScheduleRuleVo> list;
} }
} }

@ -13,17 +13,17 @@ import java.util.List;
@ApiModel(value = "任务规则对象详情", description = "任务规则对象详情描述") @ApiModel(value = "任务规则对象详情", description = "任务规则对象详情描述")
public class ScheduleRuleVo { public class ScheduleRuleVo {
@ApiModelProperty(value = "开始", example = "单位") @ApiModelProperty(value = "时", example = "单位")
@NotBlank(message = "开始不能缺少") @NotBlank(message = "时不能缺少")
private Time startTime; private Integer hour;
@ApiModelProperty(value = "结束时间", example = "型号型号") @ApiModelProperty(value = "", example = "型号型号")
@NotBlank(message = "结束时间不能缺少") @NotBlank(message = "不能缺少")
private Time endTime; private Integer minute;
@ApiModelProperty(value = "时间间隔", example = "型号型号") @ApiModelProperty(value = "预置位", example = "型号型号")
@NotBlank(message = "时间间隔不能缺少") @NotBlank(message = "预置位不能缺少")
private Integer span; private Integer preset;
} }

@ -38,6 +38,9 @@ public class TerminalPhotoSelectVo {
@ApiModelProperty(value = "查询结束时间", example = "123455") @ApiModelProperty(value = "查询结束时间", example = "123455")
private Date endtime; private Date endtime;
@ApiModelProperty(value = "搜索内容", example = "搜索内容字段")
private String search;
@Min(value = 1, message = "分页位置最小从1开始") @Min(value = 1, message = "分页位置最小从1开始")
@ApiModelProperty(value = "分页位置从1开始", required = true, example = "1") @ApiModelProperty(value = "分页位置从1开始", required = true, example = "1")
private int pageindex; private int pageindex;

@ -24,6 +24,9 @@ public class TerminalSelectVo {
@ApiModelProperty(value = "搜索内容", example = "搜索内容") @ApiModelProperty(value = "搜索内容", example = "搜索内容")
private String search; private String search;
@ApiModelProperty(value = "在线离线", example = "0--掉线 1--在线")
private Integer isonline;
@Min(value = 1, message = "分页位置最小从1开始") @Min(value = 1, message = "分页位置最小从1开始")
@ApiModelProperty(value = "分页位置从1开始", required = true, example = "1") @ApiModelProperty(value = "分页位置从1开始", required = true, example = "1")
private int pageindex; private int pageindex;

@ -45,11 +45,20 @@ public class TerminalVo {
private String essentialInfoVersion; private String essentialInfoVersion;
@ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台") @ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台")
private Byte hasPan; private Integer hasPan;
@ApiModelProperty(value = "生产厂家", example = "生产厂家") @ApiModelProperty(value = "生产厂家", example = "生产厂家")
private String bsManufacturer; private String bsManufacturer;
@ApiModelProperty(value = "规约版本", example = "规约版本")
private Integer protocol;
@ApiModelProperty(value = "网络类型", example = "网络类型")
private Integer netType;
@ApiModelProperty(value = "投运日期", example = "2022-06-12")
private Date workingDate;
@ApiModelProperty(value = "生产日期", example = "2022-06-12") @ApiModelProperty(value = "生产日期", example = "2022-06-12")
private Date bsProductionDate; private Date bsProductionDate;

@ -50,11 +50,20 @@ public class UpdateTerminalVo {
private String essentialInfoVersion; private String essentialInfoVersion;
@ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台") @ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台")
private Byte hasPan; private Integer hasPan;
@ApiModelProperty(value = "生产厂家", example = "生产厂家") @ApiModelProperty(value = "生产厂家", example = "生产厂家")
private String bsManufacturer; private String bsManufacturer;
@ApiModelProperty(value = "规约版本", example = "规约版本")
private Integer protocol;
@ApiModelProperty(value = "网络类型", example = "网络类型")
private Integer netType;
@ApiModelProperty(value = "投运日期", example = "2022-06-12")
private Date workingDate;
@ApiModelProperty(value = "生产日期", example = "2022-06-12") @ApiModelProperty(value = "生产日期", example = "2022-06-12")
private Date bsProductionDate; private Date bsProductionDate;

@ -19,5 +19,4 @@ public class VideoGetVo {
@ApiModelProperty(value = "通道编号", example = "01") @ApiModelProperty(value = "通道编号", example = "01")
private Integer channelId; private Integer channelId;
} }

@ -22,5 +22,4 @@ public class VoiceCtrlVo {
@ApiModelProperty(value = "声光报警开关", example = "0:关闭 1:开启") @ApiModelProperty(value = "声光报警开关", example = "0:关闭 1:开启")
private Integer ctrl; private Integer ctrl;
} }

@ -13,7 +13,7 @@ public interface DyLevelDao {
List<DyAndLineAndTowerAndTermDto> selectDyAndLineAndTowerAnTermList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("termid") Integer termid, @Param("search") String search, @Param("status") Integer status); List<DyAndLineAndTowerAndTermDto> selectDyAndLineAndTowerAnTermList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("termid") Integer termid, @Param("search") String search, @Param("status") Integer status);
List<DyLineAndTowertDto> selectDyAndLineAndTowerList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid,@Param("status") Integer status); List<DyLineAndTowertDto> selectDyAndLineAndTowerList(@Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("status") Integer status);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
@ -25,7 +25,7 @@ public interface DyLevelDao {
List<DyLevel> selectAll(@Param("status") Integer status); List<DyLevel> selectAll(@Param("status") Integer status);
List<DyLineAndTerminalWithHeartDto> selectTreeList(@Param("status") Integer status); List<DyLineAndTerminalWithHeartDto> selectTreeList( @Param("status") Integer status);
List<DyLineAndTerminalNoHeartDto> selectTreeListByChannelId(@Param("channelid") Integer channelid, @Param("status") Integer status); List<DyLineAndTerminalNoHeartDto> selectTreeListByChannelId(@Param("channelid") Integer channelid, @Param("status") Integer status);

@ -26,7 +26,8 @@ public interface TerminalChannelMapperDao {
List<TerminalChannelMapper> selectAll(); List<TerminalChannelMapper> selectAll();
List<TerminalChannelMapper> selectAllByPhotoTime(@Param("time") BigInteger time); // List<TerminalChannelMapper> selectAllByPhotoTime(@Param("time") BigInteger time);
List<TerminalChannelMapper> selectAllByPhotoTime(@Param("status") Integer status);
int updateByPrimaryKeySelective(TerminalChannelMapper record); int updateByPrimaryKeySelective(TerminalChannelMapper record);

@ -9,10 +9,6 @@ import java.util.List;
public interface TerminalScheduleDetailsDao { public interface TerminalScheduleDetailsDao {
int deleteByTermiAndChannel(Integer id);
int deleteByTermidAndChannelIdList(@Param("list") List<TerminalSchedule> lsit);
int insert(TerminalScheduleDetails record); int insert(TerminalScheduleDetails record);
int insertList(@Param("list") List<TerminalScheduleDetails> record, @Param("createat") Date createat, @Param("updateat") Date updateat); int insertList(@Param("list") List<TerminalScheduleDetails> record, @Param("createat") Date createat, @Param("updateat") Date updateat);
@ -21,6 +17,8 @@ public interface TerminalScheduleDetailsDao {
TerminalScheduleDetails selectByPrimaryKey(Integer id); TerminalScheduleDetails selectByPrimaryKey(Integer id);
List<TerminalScheduleDetails> selectByTermidAndChannelid(@Param("termid") Integer termid, @Param("channelid") Integer channelid);
int updateByPrimaryKeySelective(TerminalScheduleDetails record); int updateByPrimaryKeySelective(TerminalScheduleDetails record);
int updateByPrimaryKey(TerminalScheduleDetails record); int updateByPrimaryKey(TerminalScheduleDetails record);

@ -13,8 +13,8 @@ public interface TerminalSchedulesTempDao {
List<TerminalSchedulesTemp> selectByRequestId(@Param("list") List<Integer> id, @Param("status") Integer status); List<TerminalSchedulesTemp> selectByRequestId(@Param("list") List<Integer> id, @Param("status") Integer status);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int deleteByTermidAndChannelid(@Param("list") List<TerminalSchedulesTemp> record);
int insert(TerminalSchedulesTemp record); int insert(TerminalSchedulesTemp record);

@ -18,7 +18,7 @@ public interface TerminalsDao {
Terminals selectById(@Param("id") Integer id, @Param("status") Integer status); Terminals selectById(@Param("id") Integer id, @Param("status") Integer status);
List<TerminalsAndStatusDto> selectTermAndStatusList(@Param("status") Integer status, @Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("search") String search); List<TerminalsAndStatusDto> selectTermAndStatusList(@Param("status") Integer status, @Param("dyid") Integer dyid, @Param("lineid") Integer lineid, @Param("towerid") Integer towerid, @Param("search") String search,@Param("isonline") Integer isonline,@Param("time") BigInteger time);
List<TerminalsAndStatusDto> selectTermAndStatusStatisticsList(@Param("status") Integer status); List<TerminalsAndStatusDto> selectTermAndStatusStatisticsList(@Param("status") Integer status);

@ -22,6 +22,7 @@
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalsWithHeart"> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.TerminalsWithHeart">
<result column="term_id" jdbcType="INTEGER" property="id"/> <result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/> <result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="tower_name" jdbcType="VARCHAR" property="name"/> <result column="tower_name" jdbcType="VARCHAR" property="name"/>
<result column="address" jdbcType="VARCHAR" property="address"/> <result column="address" jdbcType="VARCHAR" property="address"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/> <result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
@ -29,6 +30,7 @@
<result column="display_name" jdbcType="VARCHAR" property="displayname"/> <result column="display_name" jdbcType="VARCHAR" property="displayname"/>
<result column="model" jdbcType="VARCHAR" property="model"/> <result column="model" jdbcType="VARCHAR" property="model"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/> <result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/>
<result column="has_pan" jdbcType="INTEGER" property="hasPan"/>
</collection> </collection>
</collection> </collection>
</resultMap> </resultMap>
@ -45,6 +47,7 @@
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals"> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals">
<result column="term_id" jdbcType="INTEGER" property="id"/> <result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="tower_id" jdbcType="INTEGER" property="towerid"/> <result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/> <result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/> <result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/>
<result column="display_name" jdbcType="VARCHAR" property="name"/> <result column="display_name" jdbcType="VARCHAR" property="name"/>
@ -66,6 +69,7 @@
<result column="tower_name" jdbcType="VARCHAR" property="name"/> <result column="tower_name" jdbcType="VARCHAR" property="name"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals"> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals">
<result column="term_id" jdbcType="INTEGER" property="id"/> <result column="term_id" jdbcType="INTEGER" property="id"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/> <result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipName"/> <result column="equip_name" jdbcType="VARCHAR" property="equipName"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/> <result column="display_name" jdbcType="VARCHAR" property="displayName"/>
@ -189,6 +193,8 @@
d.equip_name as equip_name, d.equip_name as equip_name,
d.display_name as display_name, d.display_name as display_name,
d.model as model, d.model as model,
d.protocol as protocol,
d.has_pan as has_pan,
e.last_heartbeat as last_heartbeat e.last_heartbeat as last_heartbeat
from ((((dy_level a left join `lines` b on a.id = b.dy_level_id ) from ((((dy_level a left join `lines` b on a.id = b.dy_level_id )
left join towers c on b.id = c.line_id ) left join towers c on b.id = c.line_id )
@ -208,6 +214,7 @@
c.id AS term_id, c.id AS term_id,
c.tower_id AS tower_id, c.tower_id AS tower_id,
c.cmdid AS cmdid, c.cmdid AS cmdid,
c.protocol AS protocol,
ts.last_heartbeat as last_heartbeat, ts.last_heartbeat as last_heartbeat,
c.display_name AS display_name c.display_name AS display_name
FROM FROM

@ -35,13 +35,21 @@
</select> </select>
<select id="selectAllByPhotoTime" resultMap="BaseResultMap"> <select id="selectAllByPhotoTime" resultMap="BaseResultMap">
<!-- select-->
<!-- from terminal_channel_mapper-->
<!-- <if test="time != null">-->
<!-- where photo_time > #{time}-->
<!-- </if>-->
<!-- group by term_id,channel_id-->
select select
<include refid="Base_Column_List"/> a.id as term_id,
from terminal_channel_mapper b.channel_id as channel_id,
<if test="time != null"> b.photo_id as photo_id,
where photo_time > #{time} b.photo_time as photo_time,
</if> b.alias as alias
group by term_id,channel_id from (terminals a left join
terminal_channel_mapper b on a.id = b.term_id)
where a.status = #{status}
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select

@ -148,28 +148,29 @@
</select> </select>
<select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap"> <select id="selectAllAndChannelByTermid" resultMap="LineAndTerminalMap">
SELECT SELECT
z.id AS id, a.id AS id,
z.name AS name, a.name AS name,
z.dy_value AS dyvalue, a.dy_value AS dyvalue,
x.id AS line_id, b.id AS line_id,
x.name AS line_name, b.name AS line_name,
x.bs_manufacturer AS bs_manufacturer, b.bs_manufacturer AS bs_manufacturer,
y.id AS term_id, d.id AS term_id,
y.tower_id AS tower_id, d.tower_id AS tower_id,
y.cmdid AS cmdid, d.cmdid AS cmdid,
y.display_name AS display_name, d.display_name AS display_name,
k.id AS channel_id, f.id AS channel_id,
k.channel_name AS channel_name, f.channel_name AS channel_name,
l.schedule_id AS schedule_id g.schedule_id AS schedule_id
FROM FROM
(((((dy_level z (((((dy_level a
left JOIN `lines` x ON z.id = x.dy_level_id and z.status = #{status} and x.status = #{status}) left JOIN `lines` b ON a.id = b.dy_level_id and a.status = #{status} and b.status = #{status})
left JOIN terminals y ON x.id = y.line_id and y.status = #{status}) left join towers c on b.id = c.line_id
left JOIN terminal_channel_mapper j ON j.term_id = y.id) left JOIN terminals d ON c.id = d.tower_id and d.status = #{status})
left JOIN terminal_channels k ON j.channel_id = k.id and k.status = #{status}) left JOIN terminal_channel_mapper e ON e.term_id = d.id)
left JOIN terminal_schedule l ON k.id = l.channel_id and l.term_id = y.id) left JOIN terminal_channels f ON e.channel_id = f.id and f.status = #{status})
left JOIN terminal_schedule g ON f.id = g.channel_id and g.term_id = d.id)
<if test="termid != null"> <if test="termid != null">
where y.id = #{termid} where d.id = #{termid}
</if> </if>
</select> </select>

@ -7,12 +7,12 @@
<result column="channel_id" jdbcType="INTEGER" property="channelId"/> <result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="hour" jdbcType="INTEGER" property="hour"/> <result column="hour" jdbcType="INTEGER" property="hour"/>
<result column="minute" jdbcType="INTEGER" property="minute"/> <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,term_id, channel_id, start_time, end_time, span, create_time, update_time id,term_id, channel_id, `hour`, `minute`, preset, 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
@ -20,6 +20,13 @@
from terminal_schedule_details from terminal_schedule_details
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="selectByTermidAndChannelid" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_schedule_details
where term_id = #{termid} and channel_id = #{channelid}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from terminal_schedule_details delete from terminal_schedule_details
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}

@ -59,6 +59,14 @@
delete from terminal_schedule_temp delete from terminal_schedule_temp
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</delete> </delete>
<delete id="deleteByTermidAndChannelid">
delete from terminal_schedule_temp
where
<foreach collection="list" item="item" index="index" separator="or" open="(" close=")">
term_id = #{item.termId} and channel_id = #{item.channelId}
</foreach>
</delete>
<insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp"> <insert id="insert" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
insert into terminal_schedule_temp (id, term_id, channel_id, insert into terminal_schedule_temp (id, term_id, channel_id,
schedule_id, create_time, update_time schedule_id, create_time, update_time
@ -71,10 +79,10 @@
<insert id="insertList" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp"> <insert id="insertList" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">
insert into terminal_schedule_temp insert into terminal_schedule_temp
(term_id, channel_id, (term_id, channel_id,
schedule_id, request_id,status,create_time, update_time) schedule_id, request_id,`hour`,`minute`,preset,`offset`,status,create_time, update_time)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{item.scheduleId},#{item.requestId},#{status},#{createat},#{updateat}) (#{item.termId},#{item.channelId},#{item.scheduleId},#{item.requestId},#{item.hour},#{item.minute},#{item.preset},#{item.offset},#{status},#{createat},#{updateat})
</foreach> </foreach>
</insert> </insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp"> <insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.TerminalSchedulesTemp">

@ -33,6 +33,7 @@
<result column="equip_name" jdbcType="VARCHAR" property="equipname"/> <result column="equip_name" jdbcType="VARCHAR" property="equipname"/>
<result column="display_name" jdbcType="VARCHAR" property="displayname"/> <result column="display_name" jdbcType="VARCHAR" property="displayname"/>
<result column="model" jdbcType="VARCHAR" property="model"/> <result column="model" jdbcType="VARCHAR" property="model"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/> <result column="last_heartbeat" jdbcType="BIGINT" property="lastheartbeat"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -55,6 +56,7 @@
b.equip_name as equip_name, b.equip_name as equip_name,
b.display_name as display_name, b.display_name as display_name,
b.model as model, b.model as model,
b.protocol as protocol,
a.last_heartbeat as last_heartbeat a.last_heartbeat as last_heartbeat
from terminal_status a, from terminal_status a,
terminals b terminals b

@ -7,6 +7,7 @@
<result column="tower_id" jdbcType="INTEGER" property="towerid"/> <result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/> <result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="org_id" jdbcType="SMALLINT" property="orgId"/> <result column="org_id" jdbcType="SMALLINT" property="orgId"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipName"/> <result column="equip_name" jdbcType="VARCHAR" property="equipName"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/> <result column="display_name" jdbcType="VARCHAR" property="displayName"/>
<result column="model" jdbcType="VARCHAR" property="model"/> <result column="model" jdbcType="VARCHAR" property="model"/>
@ -14,10 +15,13 @@
<result column="has_pan" jdbcType="TINYINT" property="hasPan"/> <result column="has_pan" jdbcType="TINYINT" property="hasPan"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/> <result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
<result column="bs_production_date" jdbcType="DATE" property="bsProductionDate"/> <result column="bs_production_date" jdbcType="DATE" property="bsProductionDate"/>
<result column="working_date" jdbcType="DATE" property="workingDate"/>
<result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/> <result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/>
<result column="sim" jdbcType="VARCHAR" property="sim"/>
<result column="latitude" jdbcType="DOUBLE" property="latitude"/> <result column="latitude" jdbcType="DOUBLE" property="latitude"/>
<result column="longitude" jdbcType="DOUBLE" property="longitude"/> <result column="longitude" jdbcType="DOUBLE" property="longitude"/>
<result column="status" jdbcType="INTEGER" property="status"/> <result column="status" jdbcType="INTEGER" property="status"/>
<result column="net_type" jdbcType="INTEGER" property="netType"/>
<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>
@ -32,18 +36,23 @@
<result column="display_name" jdbcType="VARCHAR" property="displayName"/> <result column="display_name" jdbcType="VARCHAR" property="displayName"/>
<result column="model" jdbcType="VARCHAR" property="model"/> <result column="model" jdbcType="VARCHAR" property="model"/>
<result column="essential_info_version" jdbcType="VARCHAR" property="essentialInfoVersion"/> <result column="essential_info_version" jdbcType="VARCHAR" property="essentialInfoVersion"/>
<result column="has_pan" jdbcType="TINYINT" property="hasPan"/> <result column="has_pan" jdbcType="INTEGER" property="hasPan"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/> <result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
<result column="bs_production_date" jdbcType="DATE" property="bsProductionDate"/> <result column="bs_production_date" jdbcType="DATE" property="bsProductionDate"/>
<result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/> <result column="bs_identifier" jdbcType="VARCHAR" property="bsIdentifier"/>
<result column="latitude" jdbcType="DOUBLE" property="latitude"/> <result column="latitude" jdbcType="DOUBLE" property="latitude"/>
<result column="longitude" jdbcType="DOUBLE" property="longitude"/> <result column="longitude" jdbcType="DOUBLE" property="longitude"/>
<result column="status" jdbcType="INTEGER" property="status"/> <result column="status" jdbcType="INTEGER" property="status"/>
<result column="protocol" jdbcType="INTEGER" property="protocol"/>
<result column="signal_strength_4g" jdbcType="TINYINT" property="signalStrength4g"/> <result column="signal_strength_4g" jdbcType="TINYINT" property="signalStrength4g"/>
<result column="boot_time" jdbcType="BIGINT" property="bootTime"/> <result column="boot_time" jdbcType="BIGINT" property="bootTime"/>
<result column="battery_capacity" jdbcType="REAL" property="batteryCapacity"/> <result column="battery_capacity" jdbcType="REAL" property="batteryCapacity"/>
<result column="battery_voltage" jdbcType="REAL" property="batteryVoltage"/> <result column="battery_voltage" jdbcType="REAL" property="batteryVoltage"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat"/> <result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat"/>
<result column="sim" jdbcType="VARCHAR" property="sim"/>
<result column="working_date" jdbcType="DATE" property="workingDate"/>
<result column="net_type" jdbcType="INTEGER" property="netType"/>
<result column="address" jdbcType="VARCHAR" property="address"/>
</resultMap> </resultMap>
<resultMap id="ChannelAndTerm" type="com.shxy.xymanager_common.dto.ChannelAndTermDto"> <resultMap id="ChannelAndTerm" type="com.shxy.xymanager_common.dto.ChannelAndTermDto">
@ -75,6 +84,9 @@
<result column="battery_capacity" jdbcType="REAL" property="batteryCapacity"/> <result column="battery_capacity" jdbcType="REAL" property="batteryCapacity"/>
<result column="battery_voltage" jdbcType="REAL" property="batteryVoltage"/> <result column="battery_voltage" jdbcType="REAL" property="batteryVoltage"/>
<result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat"/> <result column="last_heartbeat" jdbcType="BIGINT" property="lastHeartbeat"/>
<result column="latitude" jdbcType="DOUBLE" property="latitude"/>
<result column="longitude" jdbcType="DOUBLE" property="longitude"/>
<result column="radius" jdbcType="INTEGER" property="radius"/>
<collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.LastPicTimeDto"> <collection property="list" javaType="list" ofType="com.shxy.xymanager_common.dto.LastPicTimeDto">
<result column="photo_time" jdbcType="BIGINT" property="photoTime"/> <result column="photo_time" jdbcType="BIGINT" property="photoTime"/>
</collection> </collection>
@ -82,9 +94,10 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, line_id,tower_id,cmdid, org_id, equip_name, display_name, model, essential_info_version, has_pan, id
, line_id,tower_id,cmdid, org_id, equip_name, display_name, model, essential_info_version, has_pan,
bs_manufacturer, bs_production_date, bs_identifier, latitude, longitude, create_time, bs_manufacturer, bs_production_date, bs_identifier, latitude, longitude, create_time,
update_time update_time,sim,working_date,net_type
</sql> </sql>
<select id="selectAll" resultMap="BaseResultMap"> <select id="selectAll" resultMap="BaseResultMap">
@ -120,11 +133,8 @@
and and
<foreach collection="list" item="item" index="index" open="(" close=")" separator="or"> <foreach collection="list" item="item" index="index" open="(" close=")" separator="or">
a.id = #{item.termid} a.id = #{item.termid}
<if test="item.channelidlist != null and item.channelidlist.size>0"> <if test="item.channelid != null">
and c.id in and c.id = #{item.channelid}
<foreach collection="item.channelidlist" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if> </if>
</foreach> </foreach>
</if> </if>
@ -149,6 +159,10 @@
d.latitude as latitude, d.latitude as latitude,
d.longitude as longitude, d.longitude as longitude,
d.status as status, d.status as status,
d.protocol as protocol,
d.sim as sim,
d.working_date as working_date,
d.net_type as net_type,
e.last_heartbeat as last_heartbeat, e.last_heartbeat as last_heartbeat,
e.signal_strength_4g as signal_strength_4g, e.signal_strength_4g as signal_strength_4g,
e.boot_time as boot_time, e.boot_time as boot_time,
@ -175,6 +189,14 @@
<if test="search != null"> <if test="search != null">
and (b.name like "%"#{search}"%" or c.name like "%"#{search}"%" or d.cmdid like "%"#{search}"%") and (b.name like "%"#{search}"%" or c.name like "%"#{search}"%" or d.cmdid like "%"#{search}"%")
</if> </if>
<if test="isonline != null">
<if test="isonline == 0">
and e.last_heartbeat <![CDATA[<=]]> #{time}
</if>
<if test="isonline == 1">
and e.last_heartbeat <![CDATA[>=]]> #{time}
</if>
</if>
</where> </where>
order by d.create_time desc order by d.create_time desc
@ -218,6 +240,9 @@
a.tower_id as tower_id, a.tower_id as tower_id,
a.cmdid as cmdid, a.cmdid as cmdid,
a.display_name as display_name, a.display_name as display_name,
d.latitude as latitude,
d.longitude as longitude,
d.radius as radius,
a.status as status, a.status as status,
b.last_heartbeat as last_heartbeat, b.last_heartbeat as last_heartbeat,
b.signal_strength_4g as signal_strength_4g, b.signal_strength_4g as signal_strength_4g,
@ -225,7 +250,7 @@
b.battery_capacity as battery_capacity, b.battery_capacity as battery_capacity,
b.battery_voltage as battery_voltage, b.battery_voltage as battery_voltage,
c.photo_time as photo_time c.photo_time as photo_time
from ((terminals a left join terminal_status b on b.term_id = a.id) from (((terminals a left join terminal_status b on b.term_id = a.id)left join terminal_positions d on a.id = d.term_id)
left join terminal_channel_mapper c on a.id = c.term_id) left join terminal_channel_mapper c on a.id = c.term_id)
<where> <where>
true true
@ -429,6 +454,18 @@
<if test="#{status} != null"> <if test="#{status} != null">
status, status,
</if> </if>
<if test="#{item.sim} != null">
sim,
</if>
<if test="#{item.netType} != null">
net_type,
</if>
<if test="#{item.workingDate} != null">
working_date,
</if>
<if test="#{item.protocol} != null">
protocol,
</if>
<if test="#{createat} != null"> <if test="#{createat} != null">
create_time, create_time,
</if> </if>
@ -482,6 +519,18 @@
<if test="#{status} != null"> <if test="#{status} != null">
#{status}, #{status},
</if> </if>
<if test="#{item.sim} != null">
#{item.sim},
</if>
<if test="#{item.netType} != null">
#{item.netType},
</if>
<if test="#{item.workingDate} != null">
#{item.workingDate},
</if>
<if test="#{item.protocol} != null">
#{item.protocol},
</if>
<if test="#{createat} != null"> <if test="#{createat} != null">
#{createat}, #{createat},
</if> </if>
@ -549,6 +598,18 @@
<if test="updateat != null"> <if test="updateat != null">
update_time = #{updateat,jdbcType=TIMESTAMP}, update_time = #{updateat,jdbcType=TIMESTAMP},
</if> </if>
<if test="data.sim != null">
sim = #{data.sim},
</if>
<if test="data.netType != null">
net_type = #{data.netType},
</if>
<if test="data.workingDate != null">
working_date = #{data.workingDate},
</if>
<if test="data.protocol != null">
protocol = #{data.protocol},
</if>
</set> </set>
where id = #{data.id,jdbcType=INTEGER} where id = #{data.id,jdbcType=INTEGER}
</update> </update>
@ -571,16 +632,13 @@
</update> </update>
<select id="getCmdIdByTermId" resultType="java.lang.String"> <select id="getCmdIdByTermId" resultType="java.lang.String">
select select cmdid
cmdid
from terminals from terminals
where id = #{termId,jdbcType=INTEGER} where id = #{termId,jdbcType=INTEGER}
</select> </select>
<select id="getUpdateTime" resultType="java.math.BigInteger"> <select id="getUpdateTime" resultType="java.math.BigInteger">
select select ws_update_time wsUpdateTime
ws_update_time wsUpdateTime
from terminal_status from terminal_status
where term_id = #{termId,jdbcType=INTEGER} where term_id = #{termId,jdbcType=INTEGER}
</select> </select>

@ -34,7 +34,7 @@
<if test="search != null"> <if test="search != null">
and (t.name like "%"#{search}"%" or l.name like "%"#{search}"%" or t.address like "%"#{search}"%") and (t.name like "%"#{search}"%" or l.name like "%"#{search}"%" or t.address like "%"#{search}"%")
</if> </if>
order by t.`order` asc,l.id desc order by t.`order` asc, t.id desc
</select> </select>

@ -74,7 +74,6 @@ public class JwtInterceptor implements HandlerInterceptor {
Asserts.fail(401, "登录过期"); Asserts.fail(401, "登录过期");
} }
} }
return true; return true;
} }

@ -32,6 +32,7 @@ public class XyCache {
cacheService.updateGolobalMap(); cacheService.updateGolobalMap();
} }

@ -4,18 +4,14 @@ import com.shxy.xymanager_common.dto.LineAndDyNameDto;
import com.shxy.xymanager_common.dto.TermAndChannelDto; import com.shxy.xymanager_common.dto.TermAndChannelDto;
import com.shxy.xymanager_common.dto.TowerDto; import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.*; import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_dao.dao.*; import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.CacheService; import com.shxy.xymanager_service.service.CacheService;
import io.swagger.models.auth.In;
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.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -50,6 +46,7 @@ public class CacheServiceImpl implements CacheService {
@Autowired @Autowired
TerminalImgAlarmParamsDao terminalImgAlarmParamsDao; TerminalImgAlarmParamsDao terminalImgAlarmParamsDao;
// @Override // @Override
// @Cacheable(value = "globalParams", key = "#param") // @Cacheable(value = "globalParams", key = "#param")
// public GlobalParams getGlobalParams(String param) { // public GlobalParams getGlobalParams(String param) {

@ -27,6 +27,7 @@ import org.springframework.stereotype.Service;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -55,7 +56,7 @@ public class DyLevelServiceImpl implements DyLevelService {
* @return * @return
*/ */
@Override @Override
public ServiceBody<DyLineTreeListModel> getdyTreeList() { public ServiceBody<DyLineTreeListModel> getdyTreeList(Integer type) {
DyLineTreeListModel model = new DyLineTreeListModel(); DyLineTreeListModel model = new DyLineTreeListModel();
List<DyLineAndTerminalWithHeartDto> list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value()); List<DyLineAndTerminalWithHeartDto> list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
@ -64,27 +65,80 @@ public class DyLevelServiceImpl implements DyLevelService {
} else { } else {
int onlinenum = 0; int onlinenum = 0;
int totalnum = 0; int totalnum = 0;
List<DyLineTreeListModel.DyListBean> beans = BeanUtil.copyToList(list, DyLineTreeListModel.DyListBean.class, CopyOptions.create().ignoreCase()); ArrayList<DyLineTreeListModel.DyListBean> dyListBeans = new ArrayList<>();
for (int i = 0; i < beans.size(); i++) { for (int i = 0; i < list.size(); i++) {
for (int j = 0; j < beans.get(i).getList().size(); j++) { DyLineAndTerminalWithHeartDto dyDto = list.get(i);
for (int k = 0; k < beans.get(i).getList().get(j).getList().size(); k++) { List<LineAndTerminalWithHeartDto> linelist = dyDto.getList();
if (CollectionUtil.isEmpty(linelist)) {
continue;
}
DyLineTreeListModel.DyListBean dyModel = new DyLineTreeListModel.DyListBean();
dyModel.setId(dyDto.getId());
dyModel.setDyValue(dyDto.getDyValue());
dyModel.setName(dyDto.getName());
ArrayList<DyLineTreeListModel.LineBean> lineBeans = new ArrayList<>();
for (int j = 0; j < linelist.size(); j++) {
LineAndTerminalWithHeartDto lineDto = linelist.get(j);
List<TerminalsWithHeart> termlist = lineDto.getList();
if (CollectionUtil.isEmpty(termlist)) {
continue;
}
DyLineTreeListModel.LineBean lineBean = new DyLineTreeListModel.LineBean();
lineBean.setId(lineDto.getId());
lineBean.setName(lineDto.getName());
lineBean.setBsManufacturer(lineDto.getBsManufacturer());
ArrayList<DyLineTreeListModel.TerminalBean> beanlist = new ArrayList<>();
for (int k = 0; k < termlist.size(); k++){
totalnum++; totalnum++;
TerminalsWithHeart terminalsWithHeart = list.get(i).getList().get(j).getList().get(k); TerminalsWithHeart terminalsWithHeart = termlist.get(k);
DyLineTreeListModel.TerminalBean bean = new DyLineTreeListModel.TerminalBean();
bean.setId(terminalsWithHeart.getId());
bean.setAddress(terminalsWithHeart.getAddress());
bean.setCmdid(terminalsWithHeart.getCmdid());
bean.setDisplayname(terminalsWithHeart.getDisplayname());
bean.setEquipname(terminalsWithHeart.getEquipname());
bean.setModel(terminalsWithHeart.getModel());
bean.setName(terminalsWithHeart.getName());
bean.setTowerid(terminalsWithHeart.getTowerid());
BigInteger lastheartbeat = terminalsWithHeart.getLastheartbeat(); BigInteger lastheartbeat = terminalsWithHeart.getLastheartbeat();
boolean b = TerminalUtils.judgeTerminalStatus(lastheartbeat); boolean b = TerminalUtils.judgeTerminalStatus(lastheartbeat);
if (type == null || type.intValue() == -1) {//查询全部
if (b) {
bean.setOnlinestatus(CommonStatus.EFFECTIVE.value());
onlinenum++;
} else {
bean.setOnlinestatus(CommonStatus.DELETE.value());
}
beanlist.add(bean);
} else if (type.intValue() == 0) {
if (b) { if (b) {
beans.get(i).getList().get(j).getList().get(k).setOnlinestatus(CommonStatus.EFFECTIVE.value());
onlinenum++; onlinenum++;
bean.setOnlinestatus(CommonStatus.EFFECTIVE.value());
} else { } else {
beans.get(i).getList().get(j).getList().get(k).setOnlinestatus(CommonStatus.DELETE.value()); bean.setOnlinestatus(CommonStatus.DELETE.value());
beanlist.add(bean);
} }
} else if (type.intValue() == 1) {
if (b) {
onlinenum++;
bean.setOnlinestatus(CommonStatus.EFFECTIVE.value());
beanlist.add(bean);
} else {
bean.setOnlinestatus(CommonStatus.DELETE.value());
} }
} }
} }
lineBean.setList(beanlist);
lineBeans.add(lineBean);
}
dyModel.setList(lineBeans);
dyListBeans.add(dyModel);
}
model.setOnlineNum(onlinenum); model.setOnlineNum(onlinenum);
model.setTotalNum(totalnum); model.setTotalNum(totalnum);
model.setList(beans); model.setList(dyListBeans);
} }
return Asserts.success(model); return Asserts.success(model);
} }

@ -72,7 +72,8 @@ public class LineServiceImpl implements LineService {
int pageindex = vo.getPageindex(); int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize(); int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize); PageUtils.SetPage(pageindex, pagesize);
List<LineAndDyNameDto> list = linesDao.selectAll(CommonStatus.EFFECTIVE.value(),search);
List<LineAndDyNameDto> list = linesDao.selectAll(CommonStatus.EFFECTIVE.value(), search);
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
@ -147,6 +148,7 @@ public class LineServiceImpl implements LineService {
int i = linesDao.updateByPrimaryKeySelective(lines, new Date()); int i = linesDao.updateByPrimaryKeySelective(lines, new Date());
if (i != 0) { if (i != 0) {
cacheService.updateLineMap(); cacheService.updateLineMap();
cacheService.updateTowerMap();
return Asserts.success("修改成功"); return Asserts.success("修改成功");
} else { } else {
return Asserts.error("修改失败"); return Asserts.error("修改失败");
@ -188,7 +190,13 @@ public class LineServiceImpl implements LineService {
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());
String displayName = item.getDisplayName();
if (StrUtil.isEmpty(displayName)) {
bean.setName(item.getCmdid());
} else {
bean.setName(item.getDisplayName()); bean.setName(item.getDisplayName());
}
beans.add(bean); beans.add(bean);
} }
} }

@ -1,22 +1,37 @@
package com.shxy.xymanager_service.impl; package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
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.PhotoTimeResultDto;
import com.shxy.xymanager_common.entity.RequestResults;
import com.shxy.xymanager_common.entity.Resolution; import com.shxy.xymanager_common.entity.Resolution;
import com.shxy.xymanager_common.entity.Terminals;
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.ResolutionModel; import com.shxy.xymanager_common.model.ResolutionModel;
import com.shxy.xymanager_common.model.TerminalScheduleRuleTimeListModel;
import com.shxy.xymanager_common.util.CmaUtil; import com.shxy.xymanager_common.util.CmaUtil;
import com.shxy.xymanager_common.util.MyDateUtils;
import com.shxy.xymanager_common.util.StringUtils;
import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils; import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.vo.TerminalIdVo; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_common.vo.VoiceCtrlVo; import com.shxy.xymanager_dao.dao.RequestResultsDao;
import com.shxy.xymanager_dao.dao.TerminalResolutionDao; import com.shxy.xymanager_dao.dao.TerminalResolutionDao;
import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.TermSetService; import com.shxy.xymanager_service.service.TermSetService;
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.stereotype.Service; import org.springframework.stereotype.Service;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
@ -31,6 +46,12 @@ public class TermSetServiceImpl implements TermSetService {
@Autowired @Autowired
private TerminalResolutionDao terminalResolutionDao; private TerminalResolutionDao terminalResolutionDao;
@Autowired
private CacheService cacheService;
@Autowired
private RequestResultsDao requestResultsDao;
@Override @Override
public ServiceBody<String> alarmMark(VoiceCtrlVo vo) { public ServiceBody<String> alarmMark(VoiceCtrlVo vo) {
String cmd = CmaUtil.alarmMark(vo.getCmdId(), vo.getCtrl()); String cmd = CmaUtil.alarmMark(vo.getCmdId(), vo.getCtrl());

@ -6,10 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto; import com.shxy.xymanager_common.dto.*;
import com.shxy.xymanager_common.dto.LineAndDyNameDto;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.entity.TerminalStatus; import com.shxy.xymanager_common.entity.TerminalStatus;
import com.shxy.xymanager_common.entity.Terminals; import com.shxy.xymanager_common.entity.Terminals;
@ -21,6 +18,7 @@ import com.shxy.xymanager_common.model.TerminalChannelListModel;
import com.shxy.xymanager_common.model.TerminalChannelMapperListModel; import com.shxy.xymanager_common.model.TerminalChannelMapperListModel;
import com.shxy.xymanager_common.page.PageUtils; import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.DyLevelDao;
import com.shxy.xymanager_dao.dao.TerminalChannelsDao; import com.shxy.xymanager_dao.dao.TerminalChannelsDao;
import com.shxy.xymanager_dao.dao.TerminalPhotoDao; import com.shxy.xymanager_dao.dao.TerminalPhotoDao;
import com.shxy.xymanager_dao.dao.TerminalStatusDao; import com.shxy.xymanager_dao.dao.TerminalStatusDao;
@ -51,6 +49,9 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
@Autowired @Autowired
TerminalPhotoDao terminalPhotoDao; TerminalPhotoDao terminalPhotoDao;
@Autowired
DyLevelDao dyLevelDao;
@Autowired @Autowired
CacheService cacheService; CacheService cacheService;
@ -232,6 +233,7 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
*/ */
@Override @Override
public ServiceBody<DyLineTreeAndChannelListModel> getChannelTreeList(TerminalIdVo vo) { public ServiceBody<DyLineTreeAndChannelListModel> getChannelTreeList(TerminalIdVo vo) {
Integer termId = vo.getTermid();
DyLineTreeAndChannelListModel model = new DyLineTreeAndChannelListModel(); DyLineTreeAndChannelListModel model = new DyLineTreeAndChannelListModel();
List<TerminalChannels> channellist = terminalChannelsDao.selectChannelList(CommonStatus.EFFECTIVE.value()); List<TerminalChannels> channellist = terminalChannelsDao.selectChannelList(CommonStatus.EFFECTIVE.value());
ArrayList<DyLineTreeAndChannelListModel.ChannelChooseBean> channels = new ArrayList<>(); ArrayList<DyLineTreeAndChannelListModel.ChannelChooseBean> channels = new ArrayList<>();
@ -244,6 +246,60 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
channels.add(channelChooseBean); channels.add(channelChooseBean);
} }
model.setChannellist(channels); model.setChannellist(channels);
// Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
// Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
// Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
// List<DyAndLineAndTowerAndTermDto> dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(null, null, null, termId, null, CommonStatus.EFFECTIVE.value());
// ArrayList<DyLineTreeAndChannelListModel.DyListBean> dymodellist = new ArrayList<>();
// for (int i = 0; i < dtos.size(); i++) {
// DyAndLineAndTowerAndTermDto dyDto = dtos.get(i);
// List<LineAndTowerAndTermDto> linelist = dyDto.getList();
// DyLineTreeAndChannelListModel.DyListBean dyListBean = new DyLineTreeAndChannelListModel.DyListBean();
// dyListBean.setId(dyDto.getId());
// dyListBean.setName(dyDto.getName());
// dyListBean.setDyValue(dyDto.getDyValue());
//
// ArrayList<DyLineTreeAndChannelListModel.LineBean> linemodellist = new ArrayList<>();
// if (CollectionUtil.isEmpty(linelist)) {
// continue;
// }
// for (int j = 0; j < linelist.size(); j++) {
// LineAndTowerAndTermDto lineDto = linelist.get(j);
// List<TowerAndTermDto> termlist = lineDto.getList();
// DyLineTreeAndChannelListModel.LineBean linebean = new DyLineTreeAndChannelListModel.LineBean();
// linebean.setId(lineDto.getId());
// linebean.setName(lineDto.getName());
// linebean.setBsManufacturer(lineDto.getBsManufacturer());
// if (CollectionUtil.isEmpty(termlist)) {
// continue;
// }
// for (int k = 0; k < termlist.size(); k++) {
// TowerAndTermDto towerAndTermDto = termlist.get(k);
// List<Terminals> list = towerAndTermDto.getList();
// for (int l = 0; l < list.size(); l++) {
// Terminals terminals = list.get(l);
// DyLineTreeAndChannelListModel.TerminalBean termBean = new DyLineTreeAndChannelListModel.TerminalBean();
// termBean.setId(terminals.getId());
// termBean.setCmdid(terminals.getCmdid());
// termBean.setName(terminals.getName());
// termBean.setTowerid(terminals.getTowerid());
// }
//
// }
// linebean.setList();
// linemodellist.add(linebean);
// }
//
// dyListBean.setList(linemodellist);
//
// dymodellist.add(dyListBean);
// }
// model.setList(dymodellist);
List<DyLineAndTerminalAndChannelDto> list = terminalChannelsDao.selectAllAndChannelByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value()); List<DyLineAndTerminalAndChannelDto> list = terminalChannelsDao.selectAllAndChannelByTermid(vo.getTermid(), CommonStatus.EFFECTIVE.value());
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {

@ -123,7 +123,11 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
if (StringUtils.isNotBlank(thumbPhotoPath)) { if (StringUtils.isNotBlank(thumbPhotoPath)) {
photoBean.setThumb(thumbPhotoPath); photoBean.setThumb(thumbPhotoPath);
} }
if (termchannelMap != null) {
if (termchannelMap.get(channelId) != null) {
photoBean.setChannelName(termchannelMap.get(channelId).getChannelName()); photoBean.setChannelName(termchannelMap.get(channelId).getChannelName());
}
}
if (termchannelMapMap != null) { if (termchannelMapMap != null) {
TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termId + "#" + channelId); TerminalChannelMapper terminalChannelMapper = termchannelMapMap.get(termId + "#" + channelId);
if (terminalChannelMapper != null) { if (terminalChannelMapper != null) {
@ -165,7 +169,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Integer channelid = vo.getChannelid(); Integer channelid = vo.getChannelid();
int pageindex = vo.getPageindex(); int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize(); int pagesize = vo.getPagesize();
String search = vo.getSearch();
if (StrUtil.isEmpty(search)) {
search = null;
}
Date starttime = vo.getStarttime(); Date starttime = vo.getStarttime();
Date endtime = vo.getEndtime(); Date endtime = vo.getEndtime();
long start = MyDateUtils.TimeMillSecond2Second(DateTime.of(starttime)); long start = MyDateUtils.TimeMillSecond2Second(DateTime.of(starttime));
@ -178,22 +185,46 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
List<DyAndLineAndTowerAndTermDto> dtos = new ArrayList<>(); List<DyAndLineAndTowerAndTermDto> dtos = new ArrayList<>();
if (dyid == null || dyid.intValue() == -1) { if (dyid == null || dyid.intValue() == -1) {
if (StrUtil.isEmpty(search)) {
PageUtils.SetPage(pageindex, pagesize); PageUtils.SetPage(pageindex, pagesize);
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end)); list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
} else {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(null, null, null, null, search, CommonStatus.EFFECTIVE.value());
if (CollectionUtil.isEmpty(dtos)) {
list = new ArrayList<>();
} else {
for (DyAndLineAndTowerAndTermDto item1 : dtos) {
for (LineAndTowerAndTermDto item2 : item1.getList()) {
for (TowerAndTermDto item3 : item2.getList()) {
for (Terminals item4 : item3.getList()) {
termidlist.add(item4.getId());
}
}
}
}
PageUtils.SetPage(pageindex, pagesize);
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
}
}
} else { } else {
if (lineid == null || lineid.intValue() == -1) { if (lineid == null || lineid.intValue() == -1) {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, null, null, null, null, CommonStatus.EFFECTIVE.value()); dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, null, null, null, search, CommonStatus.EFFECTIVE.value());
} else { } else {
if (towerid == null || towerid.intValue() == -1) { if (towerid == null || towerid.intValue() == -1) {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, null, null, null, CommonStatus.EFFECTIVE.value()); dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, null, null, search, CommonStatus.EFFECTIVE.value());
} else { } else {
if (termid == null || termid.intValue() == -1) { if (termid == null || termid.intValue() == -1) {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, null, null, CommonStatus.EFFECTIVE.value()); dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, null, search, CommonStatus.EFFECTIVE.value());
} else { } else {
dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, termid, null, CommonStatus.EFFECTIVE.value()); dtos = dyLevelDao.selectDyAndLineAndTowerAnTermList(dyid, lineid, towerid, termid, search, CommonStatus.EFFECTIVE.value());
} }
} }
} }
if (CollectionUtil.isEmpty(dtos)) {
list = new ArrayList<>();
} else {
for (DyAndLineAndTowerAndTermDto item1 : dtos) { for (DyAndLineAndTowerAndTermDto item1 : dtos) {
for (LineAndTowerAndTermDto item2 : item1.getList()) { for (LineAndTowerAndTermDto item2 : item1.getList()) {
for (TowerAndTermDto item3 : item2.getList()) { for (TowerAndTermDto item3 : item2.getList()) {
@ -215,6 +246,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end)); list = terminalPhotoDao.selectPhotoListByTermList(termidlist, channelidlist, BigInteger.valueOf(start), BigInteger.valueOf(end));
} }
} }
}
boolean empty = CollectionUtil.isEmpty(list); boolean empty = CollectionUtil.isEmpty(list);
if (empty) { if (empty) {
@ -222,9 +254,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
} else { } else {
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap(); Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap(); Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap(); Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap();
Map<String, TerminalChannelMapper> termchannelMapMap = cacheService.getTermChannelMapMap(); Map<String, TerminalChannelMapper> termchannelMapMap = cacheService.getTermChannelMapMap();
beans = TerminalUtils.fdsa(requestIp, list, terminalMap, lineMap, termchannelMap, termchannelMapMap); beans = TerminalUtils.fdsa(requestIp, list, terminalMap, lineMap, towerMap, termchannelMap, termchannelMapMap);
model.setList(beans); model.setList(beans);
} }
} }
@ -441,9 +474,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
int pagesize = vo.getPagesize(); int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize); PageUtils.SetPage(pageindex, pagesize);
DateTime dateTime = MyDateUtils.offsetDay(new Date(), -1); // DateTime dateTime = MyDateUtils.offsetDay(new Date(), -1);
long l = MyDateUtils.TimeMillSecond2Second(dateTime); // long l = MyDateUtils.TimeMillSecond2Second(dateTime);
List<TerminalChannelMapper> list = terminalChannelMapperDao.selectAllByPhotoTime(BigInteger.valueOf(l)); // List<TerminalChannelMapper> list = terminalChannelMapperDao.selectAllByPhotoTime(BigInteger.valueOf(l));
List<TerminalChannelMapper> list = terminalChannelMapperDao.selectAllByPhotoTime(CommonStatus.EFFECTIVE.value());
ArrayList<BigInteger> photolist = new ArrayList<>(); ArrayList<BigInteger> photolist = new ArrayList<>();
List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>(); List<TerminalPhotosModel.PhotosBean> beans = new ArrayList<>();
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
@ -456,9 +490,7 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap(); Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap();
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap(); Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
List<TerminalPhoto> photoList = terminalPhotoDao.selectPhotosByIdList(photolist); List<TerminalPhoto> photoList = terminalPhotoDao.selectPhotosByIdList(photolist);
beans = TerminalUtils.setPhotoList(requestIp, list, lineMap, termchannelMapMap, terminalMap, termchannelMap, towerMap, photoList); beans = TerminalUtils.setPhotoList(requestIp, list, lineMap, termchannelMapMap, terminalMap, termchannelMap, towerMap, photoList);
} }
model.setList(beans); model.setList(beans);
PageInfo pageData = PageUtils.getPageData(list); PageInfo pageData = PageUtils.getPageData(list);
@ -517,39 +549,6 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
return Asserts.success(model); return Asserts.success(model);
} }
@Override
public ServiceBody<TerminalScheduleRuleTimeListModel> selectPhotoTime(TerminalReqPhotoTimeVo vo) {
String result = requestResultsDao.getRequestResult(vo.getRequestId());//待修改
TerminalScheduleRuleTimeListModel model = new TerminalScheduleRuleTimeListModel();
if (StringUtils.isNotBlank(result)) {
JSONObject resultObj = JSONObject.parseObject(result);
if (null != resultObj.get("groupData")) {
List<PhotoTimeResultDto> resultDtoList = JSONArray.parseArray(resultObj.get("groupData").toString(), PhotoTimeResultDto.class);
if (CollectionUtil.isNotEmpty(resultDtoList)) {
List<String> resultList = Lists.newArrayList();
String startTimeStr = resultDtoList.get(0).getHour() + ":" + resultDtoList.get(0).getMinute() + ":00";
String endTimeStr = resultDtoList.get(1).getHour() + ":" + resultDtoList.get(1).getMinute() + ":00";
Date startTime = DateUtil.parseTime(startTimeStr);
Date endTime = DateUtil.parseTime(endTimeStr);
Integer span = resultDtoList.get(2).getHour() * 60 + resultDtoList.get(2).getMinute();
List<DateTime> dateTimes = MyDateUtils.rangeToList(startTime, endTime, DateField.MINUTE, span);
for (DateTime data : dateTimes) {
String dateTime = DateUtil.formatTime(data);
resultList.add(dateTime);
}
model.setList(resultList);
model.setIsNew(true);
}
}
} else {
TerminalAndChannelIdVo idVo = new TerminalAndChannelIdVo();
BeanUtils.copyProperties(vo, idVo);
ServiceBody<TerminalScheduleRuleTimeListModel> listModel = terminalScheduleRuleService.getChannelSchelduleRule(idVo);
model = listModel.getData();
}
return Asserts.success(model);
}
@Override @Override
public ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) { public ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo) {
GetModel model = new GetModel(); GetModel model = new GetModel();
@ -583,9 +582,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
} else { } else {
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap(); Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap(); Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap(); Map<Integer, TerminalChannels> termchannelMap = cacheService.getTermChannelMap();
Map<String, TerminalChannelMapper> termchannelMapMap = cacheService.getTermChannelMapMap(); Map<String, TerminalChannelMapper> termchannelMapMap = cacheService.getTermChannelMapMap();
beans = TerminalUtils.fdsa(requestIp, list, terminalMap, lineMap, termchannelMap, termchannelMapMap); beans = TerminalUtils.fdsa(requestIp, list, terminalMap, lineMap, towerMap, termchannelMap, termchannelMapMap);
model.setList(beans); model.setList(beans);
} }
PageInfo pageData = PageUtils.getPageData(list); PageInfo pageData = PageUtils.getPageData(list);

@ -2,9 +2,7 @@ package com.shxy.xymanager_service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateField; import cn.hutool.core.util.StrUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
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;
@ -24,6 +22,7 @@ import com.shxy.xymanager_common.util.xinyin.ProcessExecUtils;
import com.shxy.xymanager_common.util.xinyin.ScheduleListUtils; import com.shxy.xymanager_common.util.xinyin.ScheduleListUtils;
import com.shxy.xymanager_common.vo.*; import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.*; import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.TerminalScheduleRuleService; import com.shxy.xymanager_service.service.TerminalScheduleRuleService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -31,9 +30,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import javax.validation.constraints.NotBlank;
import java.util.Date; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.*;
/** /**
* *
@ -63,13 +62,15 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
@Autowired @Autowired
TerminalScheduleDetailsDao terminalScheduleDetailsDao; TerminalScheduleDetailsDao terminalScheduleDetailsDao;
@Autowired
CacheService cacheService;
@Value("${cma.clientid}") @Value("${cma.clientid}")
public int clientid; public int clientid;
@Value("${cma.scheduletype}") @Value("${cma.scheduletype}")
public int scheduletype; public int scheduletype;
/** /**
* *
* *
@ -100,7 +101,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
} }
model.setList(beans); model.setList(beans);
} }
PageInfo pageData = PageUtils.getPageData(list); PageInfo pageData = PageUtils.getPageData(schedules);
int currentpage = pageData.getPageNum(); int currentpage = pageData.getPageNum();
model.setCurrentpage(currentpage); model.setCurrentpage(currentpage);
long total = pageData.getTotal(); long total = pageData.getTotal();
@ -182,6 +183,7 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
} }
Date date = new Date(); Date date = new Date();
Schedules schedule = new Schedules(); Schedules schedule = new Schedules();
schedule.setId(scheduleid);
schedule.setName(vo.getName()); schedule.setName(vo.getName());
schedule.setRemark(vo.getRemark()); schedule.setRemark(vo.getRemark());
schedule.setUpdateTime(date); schedule.setUpdateTime(date);
@ -236,54 +238,72 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
return Asserts.error("没有该装置"); return Asserts.error("没有该装置");
} }
ScheduleAndRuleDto dto = schedulesDao.selectSingleScheduleAndDetailsList(scheduleid, CommonStatus.EFFECTIVE.value()); // ScheduleAndRuleDto dto = schedulesDao.selectSingleScheduleAndDetailsList(scheduleid, CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(dto)) { // if (BeanUtil.isEmpty(dto)) {
return Asserts.error("没有该拍照时间规则"); // return Asserts.error("没有该拍照时间规则");
} // }
List<ScheduleDetailsDto> dtoList = dto.getList(); // List<ScheduleDetailsDto> dtoList = dto.getList();
if (CollectionUtil.isEmpty(dtoList)) { // if (CollectionUtil.isEmpty(dtoList)) {
return Asserts.error("没有该拍照时间规则"); // return Asserts.error("没有该拍照时间规则");
} // }
Map<Integer, Terminals> terminalMap = cacheService.getTerminalMap();
ArrayList<GetScheduleRequestIdListModel.RequestBean> requestIdList = new ArrayList<>(); ArrayList<GetScheduleRequestIdListModel.RequestBean> requestIdList = new ArrayList<>();
for (int x = 0; x < terminalsList.size(); x++) {
ChannelAndTermDto channelAndTermDto = terminalsList.get(x);
int requestId = Constants.REQUEST_ID.addAndGet(1);
int offset = 0;
for (int i = 0; i < termlist.size(); i++) { for (int i = 0; i < termlist.size(); i++) {
if (channelAndTermDto.getTermid().intValue() == termlist.get(i).getTermid().intValue()) { ArrayList<TerminalSchedulesTemp> templist = new ArrayList<>();
offset = termlist.get(i).getOffset(); String cmdid = null;
} RelateTerminalListRuleIdVo.Items items = termlist.get(i);
} Integer termid = items.getTermid();
String timestr = ScheduleListUtils.relateTime(dtoList, offset); Integer channelid = items.getChannelid();
Integer offset = items.getOffset();
String cmd = CmaUtil.relateSchelduleRule(dtoList, channelAndTermDto.getCmdid(), requestId, channelAndTermDto.getChannelid(), timestr); if (terminalMap != null && termid != null) {
ProcessExecUtils.exec(cmd); Terminals terminals = terminalMap.get(termid);
cmdid = terminals.getCmdid();
}
if (StrUtil.isEmpty(cmdid)) {
continue;
}
List<ScheduleRuleVo> timelist = items.getList();
if (CollectionUtil.isEmpty(timelist)) {
continue;
}
String timestr = ScheduleListUtils.relateTime(timelist);
int requestId = Constants.REQUEST_ID.addAndGet(1);
log.info("cma下发时间表命令", cmd);
GetScheduleRequestIdListModel.RequestBean requestBean = new GetScheduleRequestIdListModel.RequestBean(); GetScheduleRequestIdListModel.RequestBean requestBean = new GetScheduleRequestIdListModel.RequestBean();
requestBean.setTermid(channelAndTermDto.getTermid()); requestBean.setTermid(termid);
requestBean.setChannelid(channelAndTermDto.getChannelid()); requestBean.setChannelid(channelid);
requestBean.setRequestid(requestId); requestBean.setRequestid(requestId);
requestIdList.add(requestBean); requestIdList.add(requestBean);
for (int j = 0; j < timelist.size(); j++) {
Date date = new Date(); ScheduleRuleVo scheduleRuleVo = timelist.get(j);
Integer hour = scheduleRuleVo.getHour();
Integer minute = scheduleRuleVo.getMinute();
Integer preset = scheduleRuleVo.getPreset();
TerminalSchedulesTemp temp = new TerminalSchedulesTemp(); TerminalSchedulesTemp temp = new TerminalSchedulesTemp();
temp.setTermId(channelAndTermDto.getTermid()); temp.setTermId(termid);
temp.setChannelId(channelAndTermDto.getChannelid()); temp.setChannelId(channelid);
temp.setScheduleId(scheduleid); temp.setScheduleId(scheduleid);
temp.setRequestId(requestId); temp.setRequestId(requestId);
temp.setStatus(CommonStatus.DELETE.value()); temp.setHour(hour);
temp.setMinute(minute);
temp.setPreset(preset);
temp.setOffset(offset); temp.setOffset(offset);
temp.setCreateTime(date); templist.add(temp);
temp.setUpdateTime(date); }
terminalSchedulesTempDao.insertSelective(temp); if (CollectionUtil.isNotEmpty(templist)) {
terminalSchedulesTempDao.deleteByTermidAndChannelid(templist);
Date date = new Date();
terminalSchedulesTempDao.insertList(templist, CommonStatus.DELETE.value(), date, date);
String cmd = CmaUtil.relateSchelduleRule(timelist, cmdid, requestId, channelid, timestr);
ProcessExecUtils.exec(cmd);
log.info("cma下发时间表命令", cmd);
}
} }
model.setList(requestIdList); model.setList(requestIdList);
return Asserts.success(model); return Asserts.success(model);
} }
/** /**
* *
* *
@ -322,16 +342,19 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
model.setList(modellist); model.setList(modellist);
return Asserts.success(model); return Asserts.success(model);
} else { } else {
HashMap<Integer, Integer> map = new HashMap<>();
for (TerminalSchedulesTemp item : resultsList) {
map.put(item.getRequestId(), CommonStatus.EFFECTIVE.value());
}
for (RequestIdListVo.RequestBean it : list) { for (RequestIdListVo.RequestBean it : list) {
ScheduleRequestIdListModel.RequestStatusBean requestBean = new ScheduleRequestIdListModel.RequestStatusBean(); ScheduleRequestIdListModel.RequestStatusBean requestBean = new ScheduleRequestIdListModel.RequestStatusBean();
requestBean.setRequestid(it.getRequestid()); requestBean.setRequestid(it.getRequestid());
requestBean.setChannelid(it.getChannelid()); requestBean.setChannelid(it.getChannelid());
requestBean.setTermid(it.getTermid()); requestBean.setTermid(it.getTermid());
requestBean.setStatus(CommonStatus.DELETE.value()); if (map.get(it.getRequestid()) != null) {
for (int i = 0; i < resultsList.size(); i++) {
if (it.getRequestid().intValue() == requestidlist.get(i).intValue()) {
requestBean.setStatus(CommonStatus.EFFECTIVE.value()); requestBean.setStatus(CommonStatus.EFFECTIVE.value());
} } else {
requestBean.setStatus(CommonStatus.DELETE.value());
} }
modellist.add(requestBean); modellist.add(requestBean);
} }
@ -350,7 +373,9 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
@Override @Override
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()); Integer channelid = vo.getChannelid();
Integer terminalid = vo.getTerminalid();
TerminalSchedule mapper = terminalScheduleDao.selectByChannelId(channelid, terminalid);
if (BeanUtil.isEmpty(mapper)) { if (BeanUtil.isEmpty(mapper)) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
return Asserts.success(model); return Asserts.success(model);
@ -363,40 +388,24 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
if (mapper == null) { if (mapper == null) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
Integer scheduleId = mapper.getScheduleId(); List<TerminalScheduleDetails> list = terminalScheduleDetailsDao.selectByTermidAndChannelid(terminalid, channelid);
ScheduleAndRuleDto bean = schedulesDao.selectSingleScheduleAndDetailsList(scheduleId, CommonStatus.EFFECTIVE.value());
if (BeanUtil.isEmpty(bean)) {
model.setList(new ArrayList<>());
} else {
List<ScheduleDetailsDto> list = bean.getList();
if (CollectionUtil.isEmpty(list)) { if (CollectionUtil.isEmpty(list)) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
} else { } else {
ArrayList<TerminalScheduleRuleModel.ScheduleRuleBean> detailsBeans = ScheduleListUtils.getScheduleDetailsBeans(list); ArrayList<TerminalScheduleRuleTimeListModel.ScheduleRuleBean> timestrlist = new ArrayList<>();
ArrayList<String> timestrlist = new ArrayList<>(); for (TerminalScheduleDetails item : list) {
for (TerminalScheduleRuleModel.ScheduleRuleBean item : detailsBeans) { TerminalScheduleRuleTimeListModel.ScheduleRuleBean scheduleRuleBean = new TerminalScheduleRuleTimeListModel.ScheduleRuleBean();
DateTime startTime = MyDateUtils.offsetMinute(item.getStartTime(), offset); Integer hour = item.getHour();
if (startTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getStartTime()))) { Integer minute = item.getMinute();
startTime = MyDateUtils.endOfDay(item.getStartTime()); Integer preset = item.getPreset();
} scheduleRuleBean.setHour(hour);
DateTime endTime = MyDateUtils.offsetMinute(item.getEndTime(), offset); scheduleRuleBean.setMinute(minute);
if (endTime.isAfterOrEquals(MyDateUtils.endOfDay(item.getEndTime()))) { scheduleRuleBean.setPreset(preset);
endTime = MyDateUtils.endOfDay(item.getEndTime()); timestrlist.add(scheduleRuleBean);
}
// 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);
} }
@ -427,9 +436,19 @@ public class TerminalScheduleRuleServiceImpl implements TerminalScheduleRuleServ
if (StringUtils.isNotBlank(resultsData)) { if (StringUtils.isNotBlank(resultsData)) {
JSONObject resultObj = JSONObject.parseObject(resultsData); JSONObject resultObj = JSONObject.parseObject(resultsData);
if (null != resultObj.get("groupData")) { if (null != resultObj.get("groupData")) {
ArrayList<TerminalScheduleRuleTimeListModel.ScheduleRuleBean> list = new ArrayList<>();
List<PhotoTimeResultDto> resultDtoList = JSONArray.parseArray(resultObj.get("groupData").toString(), PhotoTimeResultDto.class); List<PhotoTimeResultDto> resultDtoList = JSONArray.parseArray(resultObj.get("groupData").toString(), PhotoTimeResultDto.class);
List<String> resultDetails = ScheduleListUtils.getResultDetails(resultDtoList); if (CollectionUtil.isNotEmpty(resultDtoList)) {
model.setList(resultDetails); for (int j = 0; j < resultDtoList.size(); j++) {
PhotoTimeResultDto item = resultDtoList.get(j);
TerminalScheduleRuleTimeListModel.ScheduleRuleBean bean = new TerminalScheduleRuleTimeListModel.ScheduleRuleBean();
bean.setHour(item.getHour());
bean.setMinute(item.getMinute());
bean.setPreset(item.getPreset());
list.add(bean);
}
}
model.setList(list);
model.setIsNew(true); model.setIsNew(true);
} }
} }

@ -10,9 +10,7 @@ import com.github.pagehelper.PageInfo;
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.TerminalChannelMapper; import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.entity.TerminalStatus;
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.enums.GloableParamsType; import com.shxy.xymanager_common.enums.GloableParamsType;
import com.shxy.xymanager_common.excelbean.TerminalAndLastPicListExcelModel; import com.shxy.xymanager_common.excelbean.TerminalAndLastPicListExcelModel;
@ -85,11 +83,15 @@ public class TerminalServiceImpl implements TerminalService {
@Override @Override
public ServiceBody<TerminalListModel> getTerminalList(TerminalSelectVo vo) { public ServiceBody<TerminalListModel> getTerminalList(TerminalSelectVo vo) {
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap(); Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
Map<Integer, LineAndDyNameDto> lineMap = cacheService.getLineMap();
Map<Integer, TermAndChannelDto> termAndChannelMap = cacheService.getTermAndChannelMap(); Map<Integer, TermAndChannelDto> termAndChannelMap = cacheService.getTermAndChannelMap();
// Map<Integer, Protocols> protocolMap = cacheService.getProtocolMap();
Integer dyid = vo.getDyId(); Integer dyid = vo.getDyId();
Integer lineid = vo.getLineId(); Integer lineid = vo.getLineId();
Integer tower = vo.getTowerId(); Integer tower = vo.getTowerId();
String search = vo.getSearch(); String search = vo.getSearch();
Integer isonline = vo.getIsonline();
BigInteger time = TerminalUtils.generateOnlineTime();
if (StrUtil.isEmpty(search)) { if (StrUtil.isEmpty(search)) {
search = null; search = null;
} }
@ -97,7 +99,7 @@ public class TerminalServiceImpl implements TerminalService {
int pageindex = vo.getPageindex(); int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize(); int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize); PageUtils.SetPage(pageindex, pagesize);
List<TerminalsAndStatusDto> list2 = terminalsDao.selectTermAndStatusList(null, dyid, lineid, tower, search); List<TerminalsAndStatusDto> list2 = terminalsDao.selectTermAndStatusList(null, dyid, lineid, tower, search, isonline, time);
boolean empty = CollectionUtil.isEmpty(list2); boolean empty = CollectionUtil.isEmpty(list2);
if (empty) { if (empty) {
model.setList(new ArrayList<>()); model.setList(new ArrayList<>());
@ -113,9 +115,37 @@ public class TerminalServiceImpl implements TerminalService {
TowerDto towerDto = towerMap.get(towerid); TowerDto towerDto = towerMap.get(towerid);
if (BeanUtil.isNotEmpty(towerDto)) { if (BeanUtil.isNotEmpty(towerDto)) {
terminalsBean.setTowerName(towerDto.getName()); terminalsBean.setTowerName(towerDto.getName());
terminalsBean.setLineId(towerDto.getLineId()); terminalsBean.setOrder(towerDto.getOrder());
terminalsBean.setLineName(towerDto.getLineName()); terminalsBean.setAddress(towerDto.getAddress());
} Integer lineId = towerDto.getLineId();
terminalsBean.setLineId(lineId);
// terminalsBean.setLineName(towerDto.getLineName());
// terminalsBean.setLineBsManufacturer(item.getLineBsManufacturer());
if (BeanUtil.isNotEmpty(lineMap)) {
LineAndDyNameDto lineAndDyNameDto = lineMap.get(lineId);
if (BeanUtil.isNotEmpty(lineAndDyNameDto)) {
terminalsBean.setLineName(lineAndDyNameDto.getName());
terminalsBean.setLineBsManufacturer(lineAndDyNameDto.getBsManufacturer());
terminalsBean.setDyId(lineAndDyNameDto.getDyLevelId());
terminalsBean.setDyName(lineAndDyNameDto.getDyLevelName());
}
}
}
// if (protocolMap != null) {
// Integer protocol = item.getProtocol();
// if (protocol != null) {
// terminalsBean.setProtocol(protocol);
// Protocols protocols = protocolMap.get(protocol);
// if (protocols != null) {
// terminalsBean.setProtocolName(protocols.getName());
// }
// }
// }
// terminalsBean.setSim(item.getSim());
// terminalsBean.setWorkingDate(item.getWorkingDate());
// terminalsBean.setNetType(item.getNetType());
terminalsBean.setCmdId(item.getCmdid()); terminalsBean.setCmdId(item.getCmdid());
terminalsBean.setOrgId(item.getOrgId()); terminalsBean.setOrgId(item.getOrgId());
terminalsBean.setEquipName(item.getEquipName()); terminalsBean.setEquipName(item.getEquipName());
@ -577,7 +607,7 @@ public class TerminalServiceImpl implements TerminalService {
* @return * @return
*/ */
@Override @Override
public ServiceBody<List<TerminalAndLastPicListExcelModel>> getOnlineTerminalList() { public ServiceBody<List<TerminalAndLastPicListExcelModel>> getOnlineTerminalList(Integer type) {
List<TerminalAndLastPicListExcelModel> modellist = new ArrayList<>(); List<TerminalAndLastPicListExcelModel> modellist = new ArrayList<>();
Map<Integer, TowerDto> towerMap = cacheService.getTowerMap(); Map<Integer, TowerDto> towerMap = cacheService.getTowerMap();
List<TerminalsAndStatusAndLastPicDto> list = terminalsDao.selectTermAndStatusAndLastPicList(CommonStatus.EFFECTIVE.value()); List<TerminalsAndStatusAndLastPicDto> list = terminalsDao.selectTermAndStatusAndLastPicList(CommonStatus.EFFECTIVE.value());
@ -603,6 +633,12 @@ public class TerminalServiceImpl implements TerminalService {
String s = MyDateUtils.TimeSecondToDate(lastheartbeat); String s = MyDateUtils.TimeSecondToDate(lastheartbeat);
model.setHearttime(s); model.setHearttime(s);
} }
Double latitude = item.getLatitude();
model.setLatitude(latitude);
Double longitude = item.getLongitude();
model.setLongitude(longitude);
Integer radius = item.getRadius();
model.setRadius(radius);
boolean b = TerminalUtils.judgeTerminalStatus(lastheartbeat); boolean b = TerminalUtils.judgeTerminalStatus(lastheartbeat);
if (b) { if (b) {
model.setIsonline("是"); model.setIsonline("是");
@ -627,10 +663,21 @@ public class TerminalServiceImpl implements TerminalService {
model.setPictime(s); model.setPictime(s);
} }
} }
if (type == null || type == -1) {
modellist.add(model);
} else if (type == 0) {
if (!b) {
modellist.add(model);
} }
} else if (type == 1) {
if (b) {
modellist.add(model); modellist.add(model);
} }
} }
}
}
}
return Asserts.success(modellist); return Asserts.success(modellist);
} }

@ -20,7 +20,7 @@ public interface DyLevelService {
* *
* @return * @return
*/ */
ServiceBody<DyLineTreeListModel> getdyTreeList(); ServiceBody<DyLineTreeListModel> getdyTreeList(Integer type);
/** /**

@ -75,7 +75,6 @@ public interface TerminalPhotoService {
ServiceBody<TerminalPhotosParamsModel> getLastedPhotoQueryParam(ReturnedPhotoParamsVo vo); ServiceBody<TerminalPhotosParamsModel> getLastedPhotoQueryParam(ReturnedPhotoParamsVo vo);
ServiceBody<TerminalScheduleRuleTimeListModel> selectPhotoTime(TerminalReqPhotoTimeVo vo);
ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo); ServiceBody<GetModel> selectPhotoTimeGet(TerminalPhotoTimeGetVo vo);

@ -128,6 +128,6 @@ public interface TerminalService {
* 线 * 线
* @return * @return
*/ */
ServiceBody<List<TerminalAndLastPicListExcelModel>> getOnlineTerminalList(); ServiceBody<List<TerminalAndLastPicListExcelModel>> getOnlineTerminalList(Integer type);
} }

Loading…
Cancel
Save