Commit ca7c917c authored by 王夏晖's avatar 王夏晖

项目回收站功能,拓扑图节点维护功能

parent 7cbda16e
......@@ -76,15 +76,12 @@ public class MaintenanceController {
}
@ApiOperation(value = "根据设备种类id查询该种类的设备", notes = "根据设备种类id查询该种类的设备")
@ApiImplicitParams({
@ApiImplicitParam(name = "tpId", value = "tpId", required = true, paramType = "query", dataType = "varchar"),
})
@GetMapping(value = "/listDeviceByTpId")
public Result listDeviceByTpId(@RequestParam String tpId) {
public Result listDeviceByTpId(@RequestParam String tpId,@RequestParam String proId) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
maintenanceService.listDeviceByTpId(tpId));
maintenanceService.listDeviceByTpId(tpId,proId));
}
......
......@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.device.maintenance.entity.BusDevService;
import org.springframework.security.access.method.P;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.BaseMapper;
......@@ -36,8 +37,8 @@ public interface MaintenanceRepository extends BaseMapper<BusDevService> {
* @param tpID the tp id
* @return the list
*/
@Select("SELECT * FROM bus_device WHERE DEV_TP_ID = #{tpID}")
List<Map<String,Object>> listDeviceByTpId(@Param("tpID") String tpID);
@Select("SELECT * FROM bus_device WHERE DEV_TP_ID = #{tpID} and pro_id = #{proId}")
List<Map<String,Object>> listDeviceByTpId(@Param("tpID") String tpID, @Param("proId") String proId);
/**
......
......@@ -55,7 +55,7 @@ public interface MaintenanceService {
* @param tpID the tp id
* @return the list
*/
List<Map<String,Object>> listDeviceByTpId(String tpID);
List<Map<String,Object>> listDeviceByTpId(String tpID,String proId);
/**
* List bus device service by date list.
......
......@@ -84,8 +84,8 @@ public class MaintenanceServiceImpl implements MaintenanceService {
* @return busDevices
*/
@Override
public List<Map<String,Object>> listDeviceByTpId(String tpID) {
List<Map<String,Object>> busDevices = maintenanceRepository.listDeviceByTpId(tpID);
public List<Map<String,Object>> listDeviceByTpId(String tpID,String proId) {
List<Map<String,Object>> busDevices = maintenanceRepository.listDeviceByTpId(tpID,proId);
return busDevices;
}
......
......@@ -30,7 +30,7 @@ public interface ProjectRepository extends BaseMapper<BusProject> {
* @return
*/
@Select("<script>select a.* from bus_project a left join sys_user_project b on a.PRO_ID = b.PRO_ID\n" +
"where b.USER_ID = #{user_id}" +
"where b.USER_ID = #{user_id} and a.online = '1' " +
"</script>")
List<Map<String,Object>> queryBusProjectByUser(Map<String,Object> map);
......@@ -53,6 +53,7 @@ public interface ProjectRepository extends BaseMapper<BusProject> {
"<if test =' proId != null '> and a.pro_id = #{proId}</if>" +
"<if test =' jwnum != null '> and a.jwnum = #{jwnum}</if>" +
"<if test =' saveFlag != null '> and a.SAVE_FLAG = #{saveFlag}</if>" +
"<if test =' online != null '> and a.ONLINE = #{online}</if>" +
"</script>")
List<Map<String,Object>> queryBusProjects(BusProject busProject);
}
......
......@@ -81,5 +81,7 @@ public class BusProject{
private String saveingEnergy;
private String sysNm;
private String online;
}
......@@ -59,6 +59,7 @@ public class BusProjectServiceImpl implements BusProjectService {
BusProject bus = new BusProject();
bus.setProId(busProject.getProId());
bus.setSysNm("暖通空调");
bus.setOnline("1");
if(findByParam(bus)!=null && findByParam(bus).size()>0){
line = 0;
message = "网关编号重复,项目新增失败";
......@@ -154,14 +155,15 @@ public class BusProjectServiceImpl implements BusProjectService {
map.put("pro_id",busProject.getProId());
if(busProject.getProId()!=null && !busProject.getProId().equals("")){
//项目下没有关联的设备,可以删除
if(projectRepository.queryDeivceByProject(map)==null || projectRepository.queryDeivceByProject(map).size()<1){
/*if(projectRepository.queryDeivceByProject(map)==null || projectRepository.queryDeivceByProject(map).size()<1){
}else{
message = "项目下有关联设备,无法删除";
}*/
Example example = new Example(BusProject.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("proId", busProject.getProId());
line = projectRepository.deleteByExample(example);
}else{
message = "项目下有关联设备,无法删除";
}
}else{
message = "ID为空,删除失败";
}
......
......@@ -101,6 +101,7 @@ filepath:
analysis: /home/zhny/filepath/analysis/
equipment: /home/zhny/filepath/equipment/
devicetp: /home/zhny/dist/devicetp/
topologynode: /home/zhny/dist/topologynode/
loginimg: /home/zhny/filepath/loginimg/
qrcode: /home/zhny/filepath/qrcode/
......
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