覆冰增加

dev
liuguijing 1 year ago
parent d956e983fb
commit b204cd1102

@ -10,6 +10,7 @@ import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.util.xinyin.HeaderUtil;
import com.shxy.xymanager_common.vo.DyListVo;
import com.shxy.xymanager_common.vo.DyTreeListVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_service.service.DyLevelService;
import io.swagger.annotations.Api;
@ -27,8 +28,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(value = "电压等级接口", tags = "电压等级接口描述")
@RestController
@Slf4j
@ -41,8 +40,8 @@ public class DyLevelController extends BaseController {
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getdyTreeList")
@Log(title = "获取电压等级树状列表接口", type = "查询")
public ResponseReult<DyLineTreeListModel> getdyTreeList(@Param("type") Integer type) {
ServiceBody<DyLineTreeListModel> serviceBody = dyLevelService.getdyTreeList(type);
public ResponseReult<DyLineTreeListModel> getdyTreeList(@RequestBody @Validated DyTreeListVo vo) {
ServiceBody<DyLineTreeListModel> serviceBody = dyLevelService.getdyTreeList(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {

@ -0,0 +1,17 @@
package com.shxy.xymanager_common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "查询装置树列表对象", description = "查询装置树列表对象")
public class DyTreeListVo {
private Integer type;
private List<Integer> devtype;
}

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

@ -11,11 +11,10 @@ import java.util.List;
public interface DyLevelDao {
List<DyLevel> selectTreeList(@Param("status") Integer status, @Param("dyid") List<Integer> dyplist, @Param("lineid") List<Integer> lineplist, @Param("towerid") List<Integer> towplist, @Param("termid") List<Integer> termid,@Param("isSuper") Integer isSuper);
List<DyLevel> selectTreeList(@Param("status") Integer status, @Param("dyid") List<Integer> dyplist, @Param("lineid") List<Integer> lineplist, @Param("towerid") List<Integer> towplist, @Param("termid") List<Integer> termid, @Param("devtype") List<Integer> devtype, @Param("isSuper") Integer isSuper);
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);
long countByExample(DyLevelExample example);
List<DyLevel> selectByExample(DyLevelExample example);

@ -200,6 +200,12 @@
</if>
)
</if>
<if test="devtype != null and devtype.size &gt; 0">
and d.dev_type in
<foreach close=")" collection="devtype" index="index" item="id" open="(" separator=",">
#{id}
</foreach>
</if>
</select>
<select id="selectDyAndLineAndTowerAnTermList" resultMap="DyAndLineAndTowerAnTermMap">
select

@ -12,6 +12,7 @@ import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.util.xinyin.TerminalUtils;
import com.shxy.xymanager_common.vo.DyTreeListVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.CacheService;
@ -26,7 +27,6 @@ import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
*
@ -82,7 +82,9 @@ public class DyLevelServiceImpl implements DyLevelService {
* @return
*/
@Override
public ServiceBody<DyLineTreeListModel> getdyTreeList(Integer type) {
public ServiceBody<DyLineTreeListModel> getdyTreeList(DyTreeListVo vo) {
Integer type = vo.getType();
List<Integer> devtype = vo.getDevtype();
PermissionDetail permissionDetail = new PermissionDetail();
DyLineTreeListModel model = new DyLineTreeListModel();
try {
@ -110,7 +112,7 @@ public class DyLevelServiceImpl implements DyLevelService {
}
if ((CollectionUtil.isNotEmpty(dypList) || CollectionUtil.isNotEmpty(linepList) || CollectionUtil.isNotEmpty(towerpList) || CollectionUtil.isNotEmpty(termpList)) || CommonStatus.EFFECTIVE.value().equals(aSuper)) {
list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value(), dypList, linepList, towerpList, termpList, aSuper);
list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value(), dypList, linepList, towerpList, termpList, devtype, aSuper);
}
boolean empty = CollectionUtil.isEmpty(list);
if (empty) {
@ -144,21 +146,22 @@ public class DyLevelServiceImpl implements DyLevelService {
towers.setIsfavor(CommonStatus.DELETE.value());
}
Integer onlinestatus = towers.getOnlinestatus();
if (type == null || type.intValue() == -1) {//查询全部
if (CommonStatus.EFFECTIVE.value().equals(onlinestatus)) {
if (onlinestatus != null && CommonStatus.EFFECTIVE.value().equals(onlinestatus)) {
onlinenum++;
line_onlinenum++;
}
tt.add(towers);
} else if (type.intValue() == 0) {
if (CommonStatus.EFFECTIVE.value().equals(onlinestatus)) {
if (onlinestatus != null && CommonStatus.EFFECTIVE.value().equals(onlinestatus)) {
onlinenum++;
line_onlinenum++;
} else {
tt.add(towers);
}
} else if (type.intValue() == 1) {
if (CommonStatus.EFFECTIVE.value().equals(onlinestatus)) {
if (onlinestatus != null && CommonStatus.EFFECTIVE.value().equals(onlinestatus)) {
onlinenum++;
line_onlinenum++;
tt.add(towers);

@ -122,16 +122,15 @@ public class TerminalServiceImpl implements TerminalService {
Integer tower = vo.getTowerId();
String search = vo.getSearch();
Integer isonline = vo.getIsonline();
Integer protocolsearch = vo.getProtocol();
BigInteger time = TerminalUtils.generateOnlineTime();
PermissionDetail permissionListOver = userService.getPermissionList();
List<Integer> dypList = permissionListOver.getDypList();
List<Integer> linepList = permissionListOver.getLinepList();
List<Integer> towerpList = permissionListOver.getTowerpList();
List<Integer> termpList = permissionListOver.getTermpList();
TerminalStatisticsModel model = new TerminalStatisticsModel();
View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
example.setGroupByClause("id");
example.setOrderByClause("id desc");
@ -175,13 +174,17 @@ public class TerminalServiceImpl implements TerminalService {
or2.andTowerIdEqualTo(tower);
}
if (BeanUtil.isNotEmpty(isonline)) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2= example.or();
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
if (CommonStatus.EFFECTIVE.value().equals(isonline)) {
or2.andLastHeartbeatGreaterThanOrEqualTo(time.longValue());
} else {
or2.andLastHeartbeatLessThanOrEqualTo(time.longValue());
}
}
if (BeanUtil.isNotEmpty(protocolsearch) && protocolsearch.intValue() != -1) {
View_Dy_Line_Tower_TerminalsExample.Criteria or2 = example.or();
or2.andProtocolEqualTo(protocolsearch);
}
int pageindex = vo.getPageindex();
int pagesize = vo.getPagesize();
PageUtils.SetPage(pageindex, pagesize);

@ -4,6 +4,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.DyLevel;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.TerminalPhotosModel;
import com.shxy.xymanager_common.vo.DyTreeListVo;
import com.shxy.xymanager_common.vo.LastTowerVo;
import java.util.List;
@ -19,9 +20,9 @@ public interface DyLevelService {
*
* @return
*/
ServiceBody<DyLineTreeListModel> getdyTreeList(Integer integer);
ServiceBody<DyLineTreeListModel> getdyTreeList(DyTreeListVo vo);
/**
/**
* 线
*
* @return

Loading…
Cancel
Save