Commit 8d660bb0 authored by co_dengxiongwen's avatar co_dengxiongwen

系统管理的功能接口调整

parent 94020985
......@@ -3,9 +3,11 @@ package com.devplatform.admin.modules.liresource.bean;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
......@@ -16,9 +18,6 @@ import java.io.Serializable;
@TableName("li_resource")
@Data
public class LiResource implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID", name = "id")
......@@ -34,9 +33,38 @@ public class LiResource implements Serializable {
/** 资源点编码*/
private java.lang.String code;
@ApiModelProperty(value = "资源点类型(1枪机,2球机)", name = "type")
/** 资源点类型(1枪机,2球机)*/
@ApiModelProperty(value = "资源点类型(数据字典id)", name = "type")
/** 资源点类型(数据字典id)*/
private java.lang.String type;
@ApiModelProperty(value = "所属区域(1候车大厅,2办公区域,3屋顶)", name = "region")
/** 所属区域(1候车大厅,2办公区域,3屋顶)*/
private Integer region;
@ApiModelProperty(value = "品牌", name = "brand")
/** 品牌*/
private java.lang.String brand;
@ApiModelProperty(value = "资源点型号", name = "equipmentModel")
/** 资源点型号*/
private java.lang.String equipmentModel;
@ApiModelProperty(value = "最大功率", name = "maxPower")
/** 最大功率*/
private java.lang.String maxPower;
@ApiModelProperty(value = "安装日期", name = "installDate")
/** 安装日期*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private java.util.Date installDate;
@ApiModelProperty(value = "维保日期", name = "maintenanceDate")
/** 维保日期*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private java.util.Date maintenanceDate;
@ApiModelProperty(value = "站点ID", name = "stationId")
/** 站点ID*/
private java.lang.String stationId;
......@@ -49,14 +77,6 @@ public class LiResource implements Serializable {
/** 站层id(li_station_map表id)*/
private java.lang.String tierId;
@ApiModelProperty(value = "子系统", name = "subSystem")
/** 子系统*/
private java.lang.String subSystem;
@ApiModelProperty(value = "子系统资源编码", name = "subCode")
/** 子系统资源编码*/
private java.lang.String subCode;
@ApiModelProperty(value = "地址码", name = "addressCode")
/** 地址码*/
private java.lang.String addressCode;
......@@ -65,10 +85,6 @@ public class LiResource implements Serializable {
/** 端口号*/
private java.lang.String port;
@ApiModelProperty(value = "输送带端口号", name = "ajjPort")
/** 输送带端口号*/
private java.lang.String ajjPort;
@ApiModelProperty(value = "用户名", name = "username")
/** 用户名*/
private java.lang.String username;
......@@ -117,16 +133,8 @@ public class LiResource implements Serializable {
/** 图标*/
private java.lang.String icon;
@ApiModelProperty(value = "父节点id", name = "parentName")
/** 父节点id*/
private java.lang.String parentName;
@ApiModelProperty(value = "系统标识", name = "sysSign")
/** 系统标识*/
private java.lang.String sysSign;
@ApiModelProperty(value = "资源点状态(1正常,0不可用)", name = "status")
/** 资源点状态(1正常,0不可用)*/
@ApiModelProperty(value = "资源点状态(1在线,2离线,3故障)", name = "status")
/** 资源点状态(1在线,2离线,3故障)*/
private Integer status;
@ApiModelProperty(value = "是否已删除(0未删除,1已删除)", name = "deleted")
......@@ -161,10 +169,6 @@ public class LiResource implements Serializable {
/** 备用项3*/
private java.lang.String byx3;
@ApiModelProperty(value = "品牌", name = "brand")
/** 品牌*/
private java.lang.String brand;
@ApiModelProperty(value = "经度", name = "xlongit")
/** 经度*/
private java.lang.String xlongit;
......@@ -186,17 +190,13 @@ public class LiResource implements Serializable {
private String iconPath;
@TableField(exist = false)
/** 资源点名称*/
/** 资源点类型名称*/
private String resourceName;
@TableField(exist = false)
/** 品牌名称*/
private String brandName;
@TableField(exist = false)
/** 父节点名称*/
private String pName;
@TableField(exist = false)
/** 资源点编码的前缀*/
private String codeType;
......
......@@ -12,7 +12,6 @@ import com.devplatform.admin.modules.liresource.bean.LiStation;
import com.devplatform.admin.modules.liresource.bean.LiStationMap;
import com.devplatform.admin.modules.liresource.model.LiResourceModel;
import com.devplatform.admin.modules.liresource.model.LiStationMapModel;
import com.devplatform.admin.modules.liresource.model.LiStationModel;
import com.devplatform.admin.modules.liresource.service.LiResourceService;
import com.devplatform.admin.modules.liresource.service.LiStationMapService;
import com.devplatform.admin.modules.liresource.service.LiStationService;
......@@ -40,7 +39,6 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/liResource")
public class LiResourceController extends AbstractController {
@Autowired
private LiResourceService liResourceService;
@Autowired
......@@ -50,7 +48,6 @@ public class LiResourceController extends AbstractController {
@Autowired
private SysDictionaryService sysDictionaryService;
/**
* 列表页面列表数据获取
*
......@@ -89,11 +86,6 @@ public class LiResourceController extends AbstractController {
bean.setCreateTime(new Date());
bean.setOperatorId(getUserId());
bean.setOperatorName(getUser().getUsername());
bean.setSysSign(getUser().getSysSystem().getCode());
/** 资源点状态(0=离线-默认,1=在线)*/
bean.setByx2("0");
/** 布防状态(0=撤防,1=布防-默认)*/
bean.setByx3("1");
liResourceService.save(bean);
return R.ok().put("bean", bean);
}
......@@ -124,16 +116,12 @@ public class LiResourceController extends AbstractController {
@PostMapping("/update")
public R update(@RequestBody @ApiParam(value = "资源点管理表实体对象", required = true) LiResource bean) {
ValidatorUtils.validateEntity(bean);
bean.setUpdateUserId(getUserId());
bean.setUpdateTime(new Date());
bean.setSysSign(getUser().getSysSystem().getCode());
// 判断父节点是否为空,为空则把数据库中的也清空
liResourceService.update(
bean,
new UpdateWrapper<LiResource>()
.set(!StringUtil.checkNotNull(bean.getParentName()), "parent_name", null)
.eq(StringUtil.checkNotNull(bean.getId()), "id", bean.getId()));
return R.ok().put("bean", bean);
}
......@@ -151,7 +139,6 @@ public class LiResourceController extends AbstractController {
public R updateList(@RequestBody @ApiParam(value = "资源点管理表实体对象", required = true) List<LiResource> list) {
if (list != null && list.size() > 0) {
List<LiResource> updateList = new ArrayList<LiResource>();
List<String> delCameraList = new ArrayList<>();
Date now = new Date();
list = list.parallelStream().distinct().collect(Collectors.toList());
Set<String> tips = new HashSet<>(32);
......@@ -168,47 +155,23 @@ public class LiResourceController extends AbstractController {
resource.setId(null);
resource.setCreateUserId(getUserId());
resource.setCreateTime(now);
resource.setSysSign(getUser().getSysSystem().getCode());
if (StringUtils.isNotBlank(resource.getType()) && StringUtils.isNotBlank(resource.getCodeType())) {
resource.setCode(generateCode(resource.getCodeType(), resource.getType()));
}
Boolean f = liResourceService.save(resource);
if (f) {
sendMessage(resource.getId(), resource.getStationId(), Constants.INT_1);
}
// if (StringUtils.isNotBlank(resource.getType()) && StringUtils.isNotBlank(resource.getCodeType())) {
// resource.setCode(generateCode(resource.getCodeType(), resource.getType()));
// }
liResourceService.save(resource);
} else {
resource.setUpdateUserId(getUserId());
resource.setUpdateTime(now);
resource.setSysSign(getUser().getSysSystem().getCode());
updateList.add(resource);
}
}
if (updateList != null && updateList.size() > 0) {
Boolean f = liResourceService.updateBatchById(updateList);
if (f) {
for (LiResource resource : updateList) {
if (resource.getDeleted() == 0) {
sendMessage(resource.getId(), resource.getStationId(), Constants.INT_2);
} else {
sendMessage(resource.getId(), resource.getStationId(), Constants.INT_3);
}
}
}
liResourceService.updateBatchById(updateList);
}
}
return R.ok();
}
private void sendMessage(String resourceId, String stationId, Integer type) {
Map<String, Object> map = new HashMap<String, Object>(4);
map.put("resourceId", resourceId);
//type:1:新增;2:修改;3:删除
map.put("type", type);
String message = JSONObject.toJSONString(map);
liResourceService.initMq(message, stationId);
}
/**
* 添加去重信息
*
......@@ -329,101 +292,39 @@ public class LiResourceController extends AbstractController {
@ApiImplicitParam(name = "ids", value = "主键数组", required = true, dataType = "String[]")
@PostMapping("/delete")
public R delete(@RequestBody String[] ids) {
liResourceService.deleteByIds(Arrays.asList(ids), getUser().getSysSystem().getCode());
//用来暂存所有要删除的对象
List<LiResource> beans = new ArrayList<LiResource>();
//遍历ids数组
for(String id: ids){
LiResource temp = new LiResource();
temp.setId(id);
//将数据标记为删除
temp.setDeleted(1);
temp.setUpdateUserId(getUserId());
temp.setUpdateTime(new Date());
//将要删除的对象存放在list中
beans.add(temp);
}
//调用批量更新操作
liResourceService.updateBatchById(beans);
return R.ok();
}
/**
* 获取线路-站点-资源点树
*
* 获取站点-资源点树
* @param model 承接对象
* @return
*/
@ApiOperation(value = "获取线路-站点-资源点树", notes = "获取线路-站点-资源点树")
@ApiOperation(value = "获取站点-资源点树", notes = "获取站点-资源点树")
@ApiImplicitParam(name = "model", value = "参数", required = true, dataType = "LiResourceModel")
@PostMapping("/getTreeList")
public R getTreeList(@RequestBody LiResourceModel model) {
// 默认只查询一个站点
List<Map<String, Object>> tree = new ArrayList<>();
if (StringUtil.checkNotNull(model.getStationId())) {
tree = getStationTreeList(model);
} else {
tree = getAllTreeList(model);
}
tree = getStationTreeList(model);
return R.ok().put("tree", tree);
}
private List<Map<String, Object>> getAllTreeList(LiResourceModel model) {
List<Map<String, Object>> tree = new ArrayList<>();
Map<String, Object> root = new HashMap<>(5);
root.put("name", "资源点列表");
root.put("id", "0");
root.put("level", 1);
LiStationModel stationModel = new LiStationModel();
List<LiStation> stationList = liStationService.getTreeList(stationModel);
// 查询所有站层地图
LiStationMapModel mapModel = new LiStationMapModel();
List<LiStationMap> mapList = liStationMapService.getTreeList(mapModel);
// 查询子系统字典项
List<SysDictionary> dicList = sysDictionaryService.queryByPid(Constants.SUB_SYSTEM_ID, model.getStationId());
// 查询所有资源点
List<LiResource> resourceList = liResourceService.getTreeList(model);
List<Map<String, Object>> childrenRoot = new ArrayList<>();
stationList.forEach((liStation) -> {
Map<String, Object> mapStation = JSONObject.parseObject(JSONObject.toJSONString(liStation), Map.class);
mapStation.put("name", liStation.getStationName());
mapStation.put("level", 3);
List<Map<String, Object>> nodes = new ArrayList<>();
for (LiStationMap liStationMap : mapList) {
Map<String, Object> mapStationMap = JSONObject.parseObject(JSONObject.toJSONString(liStationMap), Map.class);
mapStationMap.put("key", UUID.randomUUID());
mapStationMap.put("level", 4);
List<Map<String, Object>> childrenStationMap = new ArrayList<>();
for (SysDictionary dic : dicList) {
Map<String, Object> mapDic = JSONObject.parseObject(JSONObject.toJSONString(dic), Map.class);
// 两个id拼接保证id的唯一性
mapDic.put("id", liStationMap.getId() + dic.getId());
mapDic.put("code", dic.getValue());
mapDic.put("stationId", liStationMap.getStationId());
mapDic.put("tierId", liStationMap.getId());
mapDic.put("key", UUID.randomUUID());
mapDic.put("level", 5);
List<Map<String, Object>> childrenDic = new ArrayList<>();
resourceList.forEach((resource) -> {
Map<String, Object> mapResource = JSONObject.parseObject(JSONObject.toJSONString(resource), Map.class);
mapResource.put("level", 6);
mapResource.put("active", false);
// 拖拽的唯一标识
mapResource.put("key", UUID.randomUUID());
if (dic.getValue().equals(resource.getSubCode()) && liStationMap.getId().equals(resource.getTierId())) {
childrenDic.add(mapResource);
}
});
mapDic.put("children", childrenDic);
/** 如果该子系统下无资源点,不展示*/
if (childrenDic != null && childrenDic.size() > 0) {
childrenStationMap.add(mapDic);
}
}
mapStationMap.put("children", childrenStationMap);
if (liStationMap.getStationId().equals(liStation.getId())) {
nodes.add(mapStationMap);
}
}
mapStation.put("children", nodes);
childrenRoot.add(mapStation);
});
root.put("children", childrenRoot);
tree.add(root);
return tree;
}
private List<Map<String, Object>> getStationTreeList(LiResourceModel model) {
List<Map<String, Object>> tree = new ArrayList<>();
LiStation station = liStationService.getById(model.getStationId());
......@@ -431,35 +332,28 @@ public class LiResourceController extends AbstractController {
root.put("name", station.getStationName());
root.put("key", UUID.randomUUID());
root.put("level", 3);
if (StringUtils.isNotBlank(model.getQueryInfo())) {
root.put("disabled", true);
}
// 查询该站点下站层地图
LiStationMapModel mapModel = new LiStationMapModel();
mapModel.setStationId(model.getStationId());
List<LiStationMap> list = liStationMapService.getTreeList(mapModel);
// 查询子系统字典项
// 查询资源点类型典项
List<SysDictionary> dicList = new ArrayList<>();
dicList = sysDictionaryService.queryByPid(Constants.SUB_SYSTEM_ID, model.getStationId());
dicList = sysDictionaryService.queryByPid(Constants.RESOURCE_TYPE, model.getStationId());
// 查询该站点下所有资源点
List<LiResource> resourceList = liResourceService.getTreeList(model);
List<Map<String, Object>> nodes = new ArrayList<>();
for (LiStationMap liStationMap : list) {
Map<String, Object> mapStationMap =
JSONObject.parseObject(JSONObject.toJSONString(liStationMap), Map.class);
Map<String, Object> mapStationMap = JSONObject.parseObject(JSONObject.toJSONString(liStationMap), Map.class);
mapStationMap.put("key", UUID.randomUUID());
mapStationMap.put("level", 4);
if (StringUtils.isNotBlank(model.getQueryInfo())) {
mapStationMap.put("disabled", true);
}
List<Map<String, Object>> childrenStationMap = new ArrayList<>();
for (SysDictionary dic : dicList) {
Map<String, Object> mapDic =
JSONObject.parseObject(JSONObject.toJSONString(dic), Map.class);
Map<String, Object> mapDic = JSONObject.parseObject(JSONObject.toJSONString(dic), Map.class);
// 两个id拼接保证id的唯一性
mapDic.put("id", liStationMap.getId() + dic.getId());
mapDic.put("code", dic.getValue());
......@@ -467,33 +361,23 @@ public class LiResourceController extends AbstractController {
mapDic.put("tierId", liStationMap.getId());
mapDic.put("key", UUID.randomUUID());
mapDic.put("level", 5);
if (StringUtils.isNotBlank(model.getQueryInfo())) {
mapDic.put("disabled", true);
}
List<Map<String, Object>> childrenDic = new ArrayList<>();
resourceList.forEach(
(resource) -> {
if (dic.getValue().equals(resource.getSubCode())
&& liStationMap.getId().equals(resource.getTierId())) {
Map<String, Object> mapResource =
JSONObject.parseObject(JSONObject.toJSONString(resource), Map.class);
if (dic.getId().equals(resource.getType()) && liStationMap.getId().equals(resource.getTierId())) {
Map<String, Object> mapResource = JSONObject.parseObject(JSONObject.toJSONString(resource), Map.class);
mapResource.put("level", 6);
mapResource.put("active", false);
// 拖拽的唯一标识
mapResource.put("key", resource.getId());
//预案关联的新建修改不只读,查看只读
if (StringUtils.isNotBlank(model.getQueryInfo())) {
if (StringUtils.isNoneBlank(model.getGlType()) && Constants.STRING_2.equals(model.getGlType())) {
mapResource.put("disabled", true);
}
}
mapResource.put("installDate",resource.getInstallDate());
mapResource.put("maintenanceDate",resource.getMaintenanceDate());
childrenDic.add(mapResource);
}
});
mapDic.put("children", childrenDic);
/** 如果该子系统下无资源点,不展示*/
/** 如果该设备类型下无资源点,不展示*/
if (childrenDic != null && childrenDic.size() > 0) {
childrenStationMap.add(mapDic);
}
......@@ -506,79 +390,6 @@ public class LiResourceController extends AbstractController {
return tree;
}
/**
* 根据站点id查询站点地图
*
* @param model 承接对象
* @return
*/
@ApiOperation(value = "根据站点id查询站点地图", notes = "根据站点id查询站点地图")
@ApiImplicitParam(name = "model", value = "参数", required = true, dataType = "LiStationMapModel")
@PostMapping("/getStationMapTreeList")
public R getStationMapTreeList(@RequestBody LiStationMapModel model) {
if (StringUtils.isBlank(model.getStationId())) {
return R.error("站点id不能为空!");
}
String stationId = model.getStationId();
List<LiStationMap> list = liStationMapService.getTreeList(model);
List<SysDictionary> dicList = new ArrayList<>();
if (StringUtil.checkNotNull(model.getSubSystemDicId())) {
SysDictionary dictionary = sysDictionaryService.getById(model.getSubSystemDicId());
dicList.add(dictionary);
} else {
dicList = sysDictionaryService.queryByPid(Constants.SUB_SYSTEM_ID, stationId);
}
LiResourceModel resourceModel = new LiResourceModel();
resourceModel.setSubCode(model.getSubCode());
resourceModel.setType(model.getResourceType());
resourceModel.setName(model.getResourceName());
resourceModel.setStationId(model.getStationId());
List<LiResource> resourceList = liResourceService.getTreeList(resourceModel);
List<Map<String, Object>> nodes = new ArrayList<>();
for (LiStationMap liStationMap : list) {
Map<String, Object> mapStationMap =
JSONObject.parseObject(JSONObject.toJSONString(liStationMap), Map.class);
mapStationMap.put("key", UUID.randomUUID());
mapStationMap.put("level", 4);
List<Map<String, Object>> childrenStationMap = new ArrayList<>();
for (SysDictionary dic : dicList) {
Map<String, Object> mapDic =
JSONObject.parseObject(JSONObject.toJSONString(dic), Map.class);
// 两个id拼接保证id的唯一性
mapDic.put("id", liStationMap.getId() + dic.getId());
mapDic.put("code", dic.getValue());
mapDic.put("stationId", liStationMap.getStationId());
mapDic.put("tierId", liStationMap.getId());
mapDic.put("key", UUID.randomUUID());
mapDic.put("level", 5);
List<Map<String, Object>> childrenDic = new ArrayList<>();
resourceList.forEach(
(resource) -> {
if (dic.getValue().equals(resource.getSubCode())
&& liStationMap.getId().equals(resource.getTierId())) {
Map<String, Object> mapResource =
JSONObject.parseObject(JSONObject.toJSONString(resource), Map.class);
mapResource.put("level", 6);
mapResource.put("active", false);
// 拖拽的唯一标识
mapResource.put("key", UUID.randomUUID());
childrenDic.add(mapResource);
}
});
mapDic.put("children", childrenDic);
/** 如果该子系统下无资源点,不展示*/
if (childrenDic != null && childrenDic.size() > 0) {
childrenStationMap.add(mapDic);
}
}
mapStationMap.put("children", childrenStationMap);
nodes.add(mapStationMap);
}
return R.ok().put("nodes", nodes);
}
/**
* 根据站点id查询站点地图
*
......@@ -598,12 +409,9 @@ public class LiResourceController extends AbstractController {
map.put("id", list.get(i).getId());
/** 站层名称*/
map.put("name", list.get(i).getName());
LiResourceModel resourceModel = new LiResourceModel();
/** 当前站点id*/
resourceModel.setStationId(model.getStationId());
/** 子系统编码*/
resourceModel.setSubCode(model.getSubCode());
/** 站层id*/
resourceModel.setTierId(list.get(i).getId());
// 查询当前站层下,所有的资源点
......@@ -640,95 +448,4 @@ public class LiResourceController extends AbstractController {
}
return R.ok().put("nodes", nodes);
}
/**
* 查询当前站层下,所有的摄像头
*
* @param model 承接对象 stationId 当前站点id subCode 子系统编码
* @return
*/
@ApiOperation(value = "查询当前站层下,所有的摄像头", notes = "查询当前站层下,所有的摄像头")
@ApiImplicitParam(name = "model", value = "参数", required = true, dataType = "LiStationMapModel")
@PostMapping("/getStationMapCameraList")
public R getStationMapCameraList(@RequestBody LiResourceModel model) {
List<String> list = new ArrayList<String>();
/** 枪机*/
list.add("b6af764f2a6e454490a6b1b3c9057e57");
/** 球机*/
list.add("ece0b8b2db27411886254e81134988a3");
model.setList(list);
// 查询当前站层下,所有的摄像头
List<LiResource> resourceList = liResourceService.getTreeList(model);
return R.ok().put("resourceList", resourceList);
}
/**
* 根据站点地图id子系统编码查询站点地图
*
* @param model 承接对象
* @return
*/
@ApiOperation(value = "根据站点地图id子系统编码查询站点地图", notes = "根据站点地图id子系统编码查询站点地图")
@ApiImplicitParam(name = "model", value = "参数", required = true, dataType = "LiResourceModel")
@PostMapping("/getResourceTreeList")
public R getResourceTreeList(@RequestBody LiResourceModel model) {
List<LiResource> list = liResourceService.getTreeList(model);
List<Map<String, Object>> nodes = new ArrayList<>();
list.forEach(
(resource) -> {
Map<String, Object> mapResource =
JSONObject.parseObject(JSONObject.toJSONString(resource), Map.class);
mapResource.put("key", UUID.randomUUID());
mapResource.put("level", 6);
nodes.add(mapResource);
});
return R.ok().put("nodes", nodes);
}
@ApiOperation(value = "根据子系统类型和地图id查询资源点信息", notes = "根据子系统类型和地图id查询资源点信息")
@ApiImplicitParam(name = "params", value = "参数", required = true, dataType = "Map<String,Object>")
@GetMapping("/queryResourceNode")
public R queryResourceNode(@RequestParam Map<String, Object> params) {
params.remove("t");
List<LiResource> liResourceList =
liResourceService.list(new QueryWrapper<LiResource>().allEq(params));
List<Map<String, Object>> nodes = new ArrayList<>();
liResourceList.forEach(
(resource) -> {
Map<String, Object> mapResource = new HashMap<>(10);
mapResource.put("value", resource.getId());
mapResource.put("label", resource.getName());
mapResource.put("level", "3");
mapResource.put("stationId", resource.getStationId());
mapResource.put("subCode", resource.getSubCode());
mapResource.put("tierId", resource.getTierId());
nodes.add(mapResource);
});
return R.ok().put("nodes", nodes);
}
/**
* 根据站点id查询资源点类型为安检机的所有资源点
*
* @param model 承接对象
* @return
*/
@ApiOperation(value = "根据站点地图id子系统编码查询站点地图", notes = "根据站点地图id子系统编码查询站点地图")
@ApiImplicitParam(name = "model", value = "参数", required = true, dataType = "LiResourceModel")
@PostMapping("/getResourceList")
public R getResourceList(@RequestBody LiResourceModel model) {
/** 资源点类型为安检机*/
model.setType("303310efddb34a2e9bf269bdff8a7dc5");
List<LiResource> list = liResourceService.getTreeList(model);
return R.ok().put("list", list);
}
@ApiOperation(value = "根据子系统类型查询资源类型", notes = "根据子系统类型查询资源类型")
@ApiImplicitParam(name = "params", value = "参数", required = true, dataType = "Map<String,Object>")
@PostMapping("/queryResourceType")
public R queryResourceType(@RequestBody LiResourceModel model) {
List<Map<String, Object>> list = new ArrayList<>();
list = liResourceService.queryResourceType(model);
return R.ok().put("list", list);
}
}
......@@ -3,12 +3,12 @@ package com.devplatform.admin.modules.liresource.dao;
import com.devplatform.admin.modules.liresource.bean.LiResource;
import com.devplatform.admin.modules.liresource.model.LiResourceModel;
import com.devplatform.common.dao.MyBaseMapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* LiResource Mapper 用于资源点管理表的数据库操作
*
......@@ -32,13 +32,6 @@ public interface LiResourceDao extends MyBaseMapper<LiResource> {
*/
List<LiResource> queryPageByList(LiResourceModel model);
/**
* 批量删除资源点
* @param list
* @param sysSign
*/
void deleteByIds(@Param("list") List<String> list, @Param("sysSign") String sysSign);
/**
* 查询资源点树信息
* @param model
......@@ -54,13 +47,6 @@ public interface LiResourceDao extends MyBaseMapper<LiResource> {
*/
LiResource getBeanById(@Param("id") String id, @Param("stationId") String stationId);
/**
* 根据类型查询资源点
* @param model
* @return
*/
List<Map<String, Object>> queryResourceType(LiResourceModel model);
/**
* 查询图层中资源点的数量
* @param tierId
......
......@@ -12,80 +12,144 @@ import java.util.List;
*/
@Data
public class LiResourceModel extends BaseModel {
/**
* 主键id
*/
private java.lang.String id;
/**
* 资源点名称
*/
private java.lang.String name;
/**
* 资源点编码
*/
private java.lang.String code;
/**
* 资源点类型(数据字典id)
*/
private java.lang.String type;
/** 所属区域(1候车大厅,2办公区域,3屋顶)*/
private Integer region;
/**
* 品牌
*/
private java.lang.String brand;
/**
* 资源点型号
*/
private java.lang.String equipmentModel;
/**
* 最大功率
*/
private java.lang.String maxPower;
/**
* 安装日期
*/
private java.util.Date installDate;
/**
* 维保日期
*/
private java.util.Date maintenanceDate;
/**
* 站点ID
*/
private java.lang.String stationId;
/**
* 站点名称
*/
private java.lang.String stationName;
/**
* 站层id(li_station_map表id)
*/
private java.lang.String tierId;
/**
* 地址码
*/
private java.lang.String addressCode;
/**
* 端口号
*/
private java.lang.String port;
/**
* 用户名
*/
private java.lang.String username;
/**
* 密码
*/
private java.lang.String password;
/**
* x轴坐标
*/
private java.lang.String xpoint;
/**
* y轴坐标
*/
private java.lang.String ypoint;
/**
* 部署位置
*/
private java.lang.String deployLocation;
/**
* 当前操作员id
*/
private java.lang.String operatorId;
/**
* 当前操作员姓名
*/
private java.lang.String operatorName;
/**
* 附属信息
*/
private java.lang.String attachedInfo;
/**
* 资源点简介
*/
private java.lang.String remark;
/**
* 资源点图标
*/
private java.lang.String icon;
/**
* 资源点状态(1在线,2离线,3故障)
*/
private Integer status;
/**
* 是否已删除(0未删除,1已删除)
*/
private Integer deleted;
/**
* 创建人
*/
private java.lang.String createUserId;
/**
* 创建时间
*/
private java.util.Date createTime;
/**
* 修改人
*/
private java.lang.String updateUserId;
/**
* 修改时间
*/
private java.util.Date updateTime;
/**
* 备用项1
*/
private java.lang.String byx1;
/**
* 备用项2
*/
private java.lang.String byx2;
/**
* 备用项3
*/
private java.lang.String byx3;
/**
* 多种资源点类型
*/
private List<String> list;
/** 主键id*/
private java.lang.String id;
/** 资源点名称*/
private java.lang.String name;
/** 资源点编码*/
private java.lang.String code;
/** 资源点类型(1枪机,2球机)*/
private java.lang.String type;
/** 站点ID*/
private java.lang.String stationId;
/** 站点名称*/
private java.lang.String stationName;
/** 站层id(li_station_map表id)*/
private java.lang.String tierId;
/** 子系统*/
private java.lang.String subSystem;
/** 子系统资源编码*/
private java.lang.String subCode;
/** 地址码*/
private java.lang.String addressCode;
/** 端口号*/
private java.lang.String port;
/** 输送带端口号*/
private java.lang.String ajjPort;
/** 用户名*/
private java.lang.String username;
/** 密码*/
private java.lang.String password;
/** x轴坐标*/
private java.lang.String xpoint;
/** y轴坐标*/
private java.lang.String ypoint;
/** 部署位置*/
private java.lang.String deployLocation;
/** 当前操作员id*/
private java.lang.String operatorId;
/** 当前操作员姓名*/
private java.lang.String operatorName;
/** 附属信息*/
private java.lang.String attachedInfo;
/** 资源点简介*/
private java.lang.String remark;
/** 资源点图标*/
private java.lang.String icon;
/** 父节点名称*/
private java.lang.String parentName;
/** 系统标识*/
private java.lang.String sysSign;
/** 资源点状态(1正常,0不可用)*/
private Integer status;
/** 是否已删除(0未删除,1已删除)*/
private Integer deleted;
/** 创建人*/
private java.lang.String createUserId;
/** 创建时间*/
private java.util.Date createTime;
/** 修改人*/
private java.lang.String updateUserId;
/** 修改时间*/
private java.util.Date updateTime;
/** 备用项1*/
private java.lang.String byx1;
/** 备用项2*/
private java.lang.String byx2;
/** 备用项3*/
private java.lang.String byx3;
/** 品牌*/
private java.lang.String brand;
/** 多种资源点类型*/
private List<String> list;
private java.lang.String myId;
/** 预案关联 */
private java.lang.String queryInfo;
/** 预案关联 (1:新建/编辑;2:查看) */
private java.lang.String glType;
}
......@@ -3,8 +3,8 @@ package com.devplatform.admin.modules.liresource.service;
import com.devplatform.admin.modules.liresource.bean.LiResource;
import com.devplatform.admin.modules.liresource.model.LiResourceModel;
import com.devplatform.common.service.MyBaseService;
import java.util.List;
import java.util.Map;
/**
* 资源点管理表的service接口 <br>
......@@ -22,13 +22,6 @@ public interface LiResourceService extends MyBaseService<LiResource> {
*/
List<LiResource> queryPageByList(LiResourceModel model);
/**
* 逻辑删除
* @param list
* @param sysSign
*/
void deleteByIds(List<String> list, String sysSign);
/**
* 获取线路-站点-资源点树
*
......@@ -45,14 +38,6 @@ public interface LiResourceService extends MyBaseService<LiResource> {
*/
LiResource getBeanById(String id, String stationId);
/**
* 根据子系统查询下面的资源类型
*
* @param model
* @return
*/
List<Map<String, Object>> queryResourceType(LiResourceModel model);
/**
* 根据站层id查询资源点数量
*
......@@ -68,11 +53,4 @@ public interface LiResourceService extends MyBaseService<LiResource> {
* @return 资源点详情
*/
LiResource queryByCode(String code);
/**
* 发送MQ信息
* @param message
* @param stationId
*/
void initMq(String message,String stationId);
}
package com.devplatform.admin.modules.liresource.service.impl;
import com.devplatform.admin.common.utils.RabbitMqProvider;
import com.devplatform.admin.modules.liresource.bean.LiResource;
import com.devplatform.admin.modules.liresource.dao.LiResourceDao;
import com.devplatform.admin.modules.liresource.model.LiResourceModel;
......@@ -9,7 +8,6 @@ import com.devplatform.common.service.impl.MyBaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 资源点管理表的service接口实现类 <br>
......@@ -21,18 +19,6 @@ import java.util.Map;
public class LiResourceServiceImpl extends MyBaseServiceImpl<LiResourceDao, LiResource>
implements LiResourceService {
// @Value("${spring.rabbitmq.host}")
// private String host;
// @Value("${spring.rabbitmq.username}")
// private String username;
// @Value("${spring.rabbitmq.password}")
// private String password;
// @Value("${spring.rabbitmq.port}")
// private int port;
// @Value("${spring.rabbitmq.virtual-host}")
// private String virtualHost;
@Override
public List<LiResource> queryPageByList(LiResourceModel model) {
Integer rowCount = baseMapper.queryPageByCount(model);
......@@ -40,13 +26,6 @@ public class LiResourceServiceImpl extends MyBaseServiceImpl<LiResourceDao, LiRe
return baseMapper.queryPageByList(model);
}
@Override
public void deleteByIds(List<String> list, String sysSign) {
if (list != null && list.size() > 0) {
baseMapper.deleteByIds(list, sysSign);
}
}
@Override
public List<LiResource> getTreeList(LiResourceModel model) {
return baseMapper.getTreeList(model);
......@@ -57,11 +36,6 @@ public class LiResourceServiceImpl extends MyBaseServiceImpl<LiResourceDao, LiRe
return baseMapper.getBeanById(id, stationId);
}
@Override
public List<Map<String, Object>> queryResourceType(LiResourceModel model) {
return baseMapper.queryResourceType(model);
}
@Override
public Integer queryCountByTierId(String tierId) {
return baseMapper.queryCountByTierId(tierId);
......@@ -72,9 +46,4 @@ public class LiResourceServiceImpl extends MyBaseServiceImpl<LiResourceDao, LiRe
return baseMapper.queryByCode(code);
}
@Override
public void initMq(String message, String stationId) {
RabbitMqProvider mqProvider = new RabbitMqProvider();
// mqProvider.sendMsg(message,host,username,password,port,virtualHost,stationId);
}
}
......@@ -29,6 +29,7 @@ import org.apache.shiro.crypto.hash.Sha256Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -326,4 +327,12 @@ public class SysUserController extends AbstractController {
sysUserService.updatePw(split, pd, salt, getUserId(), getUser().getSysSystem().getCode());
return R.ok();
}
/** 获取民族 */
@ApiOperation(value = "获取民族列表", notes = "获取民族列表")
@GetMapping("/getAllNation")
public R getAllNation() {
List<HashMap<String, Object>> result = sysUserService.getAllNation();
return R.ok().put("result", result);
}
}
......@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.devplatform.admin.modules.sys.bean.SysUserEntity;
import com.devplatform.admin.modules.sys.model.SysUserModel;
import com.devplatform.common.dao.MyBaseMapper;
import java.util.HashMap;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.HashMap;
import java.util.List;
/**
* 系统用户
......@@ -113,4 +115,11 @@ public interface SysUserDao extends MyBaseMapper<SysUserEntity> {
@Param("salt") String salt,
@Param("userId") String userId,
@Param("sysSign") String sysSign);
/**
* 查询所有民族
* @return
*/
@Select("select * from sys_nation")
List<HashMap<String, Object>> getAllNation();
}
......@@ -5,9 +5,10 @@ import com.devplatform.admin.modules.sys.bean.SysUserEntity;
import com.devplatform.admin.modules.sys.model.SysUserModel;
import com.devplatform.common.service.MyBaseService;
import com.devplatform.common.util.R;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import org.apache.ibatis.annotations.Param;
/**
* 系统用户
......@@ -149,4 +150,10 @@ public interface SysUserService extends MyBaseService<SysUserEntity> {
* @param sysSign
*/
void updatePw(String[] split, String password, String salt, String userId, String sysSign);
/**
* 查询所有民族
* @return
*/
List<HashMap<String, Object>> getAllNation();
}
......@@ -214,4 +214,9 @@ public class SysUserServiceImpl extends MyBaseServiceImpl<SysUserDao, SysUserEnt
String[] split, String password, String salt, String userId, String sysSign) {
baseMapper.updatePw(split, password, salt, userId, sysSign);
}
@Override
public List<HashMap<String, Object>> getAllNation() {
return baseMapper.getAllNation();
}
}
......@@ -16,14 +16,10 @@ public class SysDictionary implements Serializable {
/** */
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID", name = "keyId")
@TableId
/** 主键id*/
private java.lang.String keyId;
@ApiModelProperty(value = "下拉框id", name = "id")
@TableId
/** 下拉框id*/
private java.lang.String id;
private java.lang.String id;
@ApiModelProperty(value = "字典项名称", name = "name")
/** 字典项名称*/
......@@ -92,14 +88,6 @@ public class SysDictionary implements Serializable {
@TableField(exist = false)
private List<SysDictionary> children;
public String getKeyId() {
return keyId;
}
public void setKeyId(String keyId) {
this.keyId = keyId;
}
/** 主键id的getter方法 */
public java.lang.String getId() {
return id;
......
......@@ -17,19 +17,10 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* @author Administrator
*/
......@@ -103,9 +94,8 @@ public class SysDictionaryController extends AbstractController {
return R.error("字典项名称已存在!");
}
}
String uuid = UUID.randomUUID().toString().replace("-", "");
bean.setId(uuid);
bean.setKeyId(uuid);
// String uuid = UUID.randomUUID().toString().replace("-", "");
// bean.setId(uuid);
bean.setCreateUserId(getUserId());
bean.setCreateTime(new Date());
bean.setSysSign(getUser().getSysSystem().getCode());
......
......@@ -8,9 +8,6 @@ import com.devplatform.admin.common.model.BaseModel;
* @author 代码生成器产生
*/
public class SysDictionaryModel extends BaseModel {
/** 主键id*/
private java.lang.String keyId;
/** 主键id*/
private java.lang.String id;
/** 字典项名称*/
......@@ -54,14 +51,6 @@ public class SysDictionaryModel extends BaseModel {
this.stationId = stationId;
}
public String getKeyId() {
return keyId;
}
public void setKeyId(String keyId) {
this.keyId = keyId;
}
/** 主键id的getter方法 */
public java.lang.String getId() {
return id;
......
......@@ -7,14 +7,16 @@
<result column="name" property="name"/>
<result column="code" property="code"/>
<result column="type" property="type"/>
<result column="region" property="region"/>
<result column="equipment_model" property="equipmentModel"/>
<result column="max_power" property="maxPower"/>
<result column="install_date" property="installDate"/>
<result column="maintenance_date" property="maintenanceDate"/>
<result column="station_id" property="stationId"/>
<result column="station_name" property="stationName"/>
<result column="tier_id" property="tierId"/>
<result column="sub_system" property="subSystem"/>
<result column="sub_code" property="subCode"/>
<result column="address_code" property="addressCode"/>
<result column="port" property="port"/>
<result column="ajj_port" property="ajjPort"/>
<result column="username" property="username"/>
<result column="password" property="password"/>
<result column="xpoint" property="xpoint"/>
......@@ -27,8 +29,6 @@
<result column="attached_info" property="attachedInfo"/>
<result column="remark" property="remark"/>
<result column="icon" property="icon"/>
<result column="parent_name" property="parentName"/>
<result column="sys_sign" property="sysSign"/>
<result column="status" property="status"/>
<result column="deleted" property="deleted"/>
<result column="create_user_id" property="createUserId"/>
......@@ -46,24 +46,29 @@
<!-- li_resource table all fields -->
<sql id="Base_Column_List">
id,name,code,type,station_id,station_name,tier_id,sub_system,sub_code,address_code,port,ajj_port,username,password,xpoint,ypoint,width,rotate,deploy_location,operator_id,operator_name,attached_info,remark,icon,parent_name,sys_sign,status,deleted,create_user_id,create_time,update_user_id,update_time,byx1,byx2,byx3,brand,xlongit,ylat,image_src
id,name,code,type,station_id,station_name,tier_id,address_code,port,
username,password,xpoint,ypoint,width,rotate,deploy_location,operator_id,operator_name,
attached_info,remark,icon,status,deleted,create_user_id,create_time,update_user_id,update_time,
byx1,byx2,byx3,brand,xlongit,ylat,image_src,equipment_model,max_power,install_date,maintenance_date,region
</sql>
<!-- 公共查询条件 -->
<sql id="Example_Where_Clause">
where deleted=0
<if test="id!=null and id!=''">and id = #{id}</if>
<if test="name!=null and name!=''">and name = #{name}</if>
<if test="name!=null and name!=''">and INSTR(name, #{name})</if>
<if test="code!=null and code!=''">and code = #{code}</if>
<if test="type!=null and type!=''">and type = #{type}</if>
<if test="equipmentModel!=null and equipmentModel!=''">and equipment_model = #{equipmentModel}</if>
<if test="maxPower!=null and maxPower!=''">and max_power = #{maxPower}</if>
<if test="installDate!=null ">and install_date = #{installDate}</if>
<if test="maintenanceDate!=null ">and maintenance_date = #{maintenanceDate}</if>
<if test="region!=null ">and region = #{region}</if>
<if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
<if test="stationName!=null and stationName!=''">and station_name = #{stationName}</if>
<if test="tierId!=null and tierId!=''">and tier_id = #{tierId}</if>
<if test="subSystem!=null and subSystem!=''">and sub_system = #{subSystem}</if>
<if test="subCode!=null and subCode!=''">and sub_code = #{subCode}</if>
<if test="addressCode!=null and addressCode!=''">and address_code = #{addressCode}</if>
<if test="port!=null and port!=''">and port = #{port}</if>
<if test="ajjPort!=null and ajjPort!=''">and ajj_port = #{ajjPort}</if>
<if test="username!=null and username!=''">and username = #{username}</if>
<if test="password!=null and password!=''">and password = #{password}</if>
<if test="xpoint!=null and xpoint!=''">and xpoint = #{xpoint}</if>
......@@ -74,8 +79,6 @@
<if test="attachedInfo!=null and attachedInfo!=''">and attached_info = #{attachedInfo}</if>
<if test="remark!=null and remark!=''">and remark = #{remark}</if>
<if test="icon!=null and icon!=''">and icon = #{icon}</if>
<if test="parentName!=null and parentName!=''">and parent_name = #{parentName}</if>
<if test="sysSign!=null and sysSign!=''">and sys_sign = #{sysSign}</if>
<if test="status!=null ">and status = #{status}</if>
<if test="deleted!=null ">and deleted = #{deleted}</if>
<if test="createUserId!=null and createUserId!=''">and create_user_id = #{createUserId}</if>
......@@ -111,14 +114,16 @@
<if test="name!=null and name!=''">and INSTR(name, #{name})</if>
<if test="code!=null and code!=''">and code = #{code}</if>
<if test="type!=null and type!=''">and type = #{type}</if>
<if test="equipmentModel!=null and equipmentModel!=''">and equipment_model = #{equipmentModel}</if>
<if test="maxPower!=null and maxPower!=''">and max_power = #{maxPower}</if>
<if test="installDate!=null ">and install_date = #{installDate}</if>
<if test="maintenanceDate!=null ">and maintenance_date = #{maintenanceDate}</if>
<if test="region!=null ">and region = #{region}</if>
<if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
<if test="stationName!=null and stationName!=''">and station_name = #{stationName}</if>
<if test="tierId!=null and tierId!=''">and tier_id = #{tierId}</if>
<if test="subSystem!=null and subSystem!=''">and sub_system = #{subSystem}</if>
<if test="subCode!=null and subCode!=''">and sub_code = #{subCode}</if>
<if test="addressCode!=null and addressCode!=''">and address_code = #{addressCode}</if>
<if test="port!=null and port!=''">and port = #{port}</if>
<if test="ajjPort!=null and ajjPort!=''">and ajj_port = #{ajjPort}</if>
<if test="username!=null and username!=''">and username = #{username}</if>
<if test="password!=null and password!=''">and password = #{password}</if>
<if test="xpoint!=null and xpoint!=''">and xpoint = #{xpoint}</if>
......@@ -129,8 +134,6 @@
<if test="attachedInfo!=null and attachedInfo!=''">and attached_info = #{attachedInfo}</if>
<if test="remark!=null and remark!=''">and remark = #{remark}</if>
<if test="icon!=null and icon!=''">and icon = #{icon}</if>
<if test="parentName!=null and parentName!=''">and parent_name = #{parentName}</if>
<if test="sysSign!=null and sysSign!=''">and sys_sign = #{sysSign}</if>
<if test="status!=null ">and status = #{status}</if>
<if test="deleted!=null ">and deleted = #{deleted}</if>
<if test="createUserId!=null and createUserId!=''">and create_user_id = #{createUserId}</if>
......@@ -147,7 +150,6 @@
#{item}
</foreach>
</if>
<if test="myId!=null and myId!=''">or id = #{myId}</if>
</sql>
<sql id="queryPageByListClause2">
......@@ -156,14 +158,16 @@
<if test="name!=null and name!=''">and INSTR(li.name, #{name})</if>
<if test="code!=null and code!=''">and li.code = #{code}</if>
<if test="type!=null and type!=''">and li.type = #{type}</if>
<if test="equipmentModel!=null and equipmentModel!=''">and li.equipment_model = #{equipmentModel}</if>
<if test="maxPower!=null and maxPower!=''">and li.max_power = #{maxPower}</if>
<if test="installDate!=null ">and li.install_date = #{installDate}</if>
<if test="maintenanceDate!=null ">and li.maintenance_date = #{maintenanceDate}</if>
<if test="region!=null ">and li.region = #{region}</if>
<if test="stationId!=null and stationId!=''">and li.station_id = #{stationId}</if>
<if test="stationName!=null and stationName!=''">and li.station_name = #{stationName}</if>
<if test="tierId!=null and tierId!=''">and li.tier_id = #{tierId}</if>
<if test="subSystem!=null and subSystem!=''">and li.sub_system = #{subSystem}</if>
<if test="subCode!=null and subCode!=''">and li.sub_code = #{subCode}</if>
<if test="addressCode!=null and addressCode!=''">and li.address_code = #{addressCode}</if>
<if test="port!=null and port!=''">and li.port = #{port}</if>
<if test="ajjPort!=null and ajjPort!=''">and li.ajj_port = #{ajjPort}</if>
<if test="username!=null and username!=''">and li.username = #{username}</if>
<if test="password!=null and password!=''">and li.password = #{password}</if>
<if test="xpoint!=null and xpoint!=''">and li.xpoint = #{xpoint}</if>
......@@ -174,8 +178,6 @@
<if test="attachedInfo!=null and attachedInfo!=''">and li.attached_info = #{attachedInfo}</if>
<if test="remark!=null and remark!=''">and li.remark = #{remark}</if>
<if test="icon!=null and icon!=''">and li.icon = #{icon}</if>
<if test="parentName!=null and parentName!=''">and li.parent_name = #{parentName}</if>
<if test="sysSign!=null and sysSign!=''">and li.sys_sign = #{sysSign}</if>
<if test="status!=null ">and li.status = #{status}</if>
<if test="deleted!=null ">and li.deleted = #{deleted}</if>
<if test="createUserId!=null and createUserId!=''">and li.create_user_id = #{createUserId}</if>
......@@ -192,19 +194,8 @@
#{item}
</foreach>
</if>
<if test="myId!=null and myId!=''">or li.id = #{myId}</if>
</sql>
<update id="deleteByIds">
UPDATE li_resource
SET deleted =1,sys_sign=#{sysSign}
WHERE id IN (
<foreach collection="list" item="id" separator=",">
#{id}
</foreach>
) AND deleted = 0
</update>
<select id="getTreeList" parameterType="Object" resultMap="BaseResultMap">
SELECT
li.*,
......@@ -213,7 +204,6 @@
li_resource li
LEFT JOIN li_station_map lis ON lis.id = li.tier_id
<include refid="queryPageByListClause2"></include>
GROUP BY li.id
ORDER BY li.create_time DESC
</select>
......@@ -222,41 +212,22 @@
lr.*,
lsm.name as tierName,
sdt.name as resourceName,
sdb.name as brandName,
plr.name as pName
sdb.name as brandName
from li_resource lr
left join sys_dictionary sdt on sdt.id = lr.type
<if test="stationId!=null and stationId!=''">and sdt.station_id = #{stationId}</if>
left join sys_dictionary sdb on sdb.id = lr.brand
<if test="stationId!=null and stationId!=''">and sdb.station_id = #{stationId}</if>
left join li_station_map lsm on lsm.id = lr.tier_id
left join li_resource plr on plr.id = lr.parent_name
where lr.id = #{id}
<if test="stationId!=null and stationId!=''">and lr.station_id = #{stationId}</if>
</select>
<select id="queryResourceType" resultType="java.util.Map">
select
lr.type as id,
sd.name as name
from li_resource lr
left join sys_dictionary sd on sd.id = lr.type
where lr.deleted = 0
<if test="subCode != null and subCode != ''">and lr.sub_code = #{subCode}</if>
group by lr.type,sd.name
</select>
<select id="queryCountByTierId" resultType="java.lang.Integer">
select count(1) from li_resource
where deleted = 0 and tier_id = #{tierId}
</select>
<select id="queryByCode" resultType="com.devplatform.admin.modules.liresource.bean.LiResource">
select lr.id,lr.name,lr.code,sd.name as 'type',lr.address_code,lr.port,lr.ajj_port,lr.username,lr.password,lr.deploy_location,lr.line_name,lr.station_name,lr.sub_system,
sd2.name as brandName,
CASE lr.byx2
WHEN 0 THEN '离线'
WHEN 1 THEN '在线'
ELSE lr.byx2 END AS statusName
select lr.id,lr.name,lr.code,sd.name as 'type',lr.address_code,lr.port,lr.username,lr.password,lr.deploy_location,lr.line_name,lr.station_name
sd2.name as brandName
from li_resource lr
left join sys_dictionary sd on lr.`type` = sd.id and lr.station_id = sd.station_id
left join sys_dictionary sd2 on lr.brand = sd2.id and lr.station_id = sd2.station_id
......
......@@ -104,7 +104,8 @@
</select>
<select id="getAllUserByOrgIdPage" resultType="java.util.HashMap">
SELECT u.*,sd.name AS jobName ,sn.name AS nationName
SELECT u.*,sd.name AS jobName ,sn.name AS nationName,
(SELECT GROUP_CONCAT(sr.role_name) from sys_role sr where sr.role_id in (select sur.role_id from sys_user_role sur where sur.user_id = u.user_id)) AS roleNames
FROM sys_user u
LEFT JOIN sys_dictionary sd ON u.job = sd.id AND sd.deleted = 0 AND sd.station_id = u.station_id
LEFT JOIN sys_nation sn ON u.nation = sn.id
......
......@@ -3,7 +3,6 @@
<mapper namespace="com.devplatform.admin.modules.sysdictionary.dao.SysDictionaryDao">
<!-- Result Map -->
<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.sysdictionary.bean.SysDictionary">
<result column="key_id" property="keyId"/>
<result column="id" property="id"/>
<result column="name" property="name"/>
<result column="value" property="value"/>
......@@ -25,7 +24,7 @@
<!-- sys_dictionary table all fields -->
<sql id="Base_Column_List">
key_id,id,name,value,parent_id,remark,status,deleted,create_user_id,create_time,update_user_id,update_time,byx1,byx2,byx3,sys_sign,sort_value,station_id
id,name,value,parent_id,remark,status,deleted,create_user_id,create_time,update_user_id,update_time,byx1,byx2,byx3,sys_sign,sort_value,station_id
</sql>
<!-- 公共查询条件 -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment