Commit 5f87b00e authored by jichao's avatar jichao

模板按照项目分开,团队维护不显示的bug

parent b406d747
...@@ -32,9 +32,10 @@ public interface ReportRepository { ...@@ -32,9 +32,10 @@ public interface ReportRepository {
* @param params * @param params
* @return * @return
*/ */
@Select("<script>select t.DEV_NUM,t.TM,t.ORIGINAL_STR,s.SENSOR_JSON,m.ELEC,m.GAS from total_original t,total_sensor s," + @Select("<script>select t.DEV_NUM,t.TM,t.ORIGINAL_STR,s.SENSOR_JSON,m.ELEC,m.GAS from total_original t " +
"(select d.DEV_NUM,m.CREATE_TIME TM,m.ELEC,m.GAS from energy_count_m m,bus_device_meter d where m.PRO_ID=d.PRO_ID and m.MET_NUM=d.MET_NUM) m " + "left join (select d.DEV_NUM,m.CREATE_TIME TM,m.ELEC,m.GAS from energy_count_m m,bus_device_meter d where m.PRO_ID=d.PRO_ID and m.MET_NUM=d.MET_NUM) m on t.TM=m.TM and t.DEV_NUM=m.DEV_NUM " +
"where t.TM=s.TM and t.PRO_ID=s.PRO_ID and t.TM=m.TM and t.DEV_NUM=m.DEV_NUM and t.WATER_V is null and t.ELEC_V is null and t.GAS_V is null " + "left join total_sensor s on t.TM=s.TM and t.PRO_ID=s.PRO_ID " +
"where t.WATER_V is null and t.ELEC_V is null and t.GAS_V is null " +
"and t.PRO_ID=#{proId} and date_format(t.TM, '%Y-%c-%e')=#{time} " + "and t.PRO_ID=#{proId} and date_format(t.TM, '%Y-%c-%e')=#{time} " +
"order by t.DEV_NUM,t.TM</script>") "order by t.DEV_NUM,t.TM</script>")
@ResultMap(value = "original") @ResultMap(value = "original")
......
...@@ -34,8 +34,8 @@ public interface BusTeamRepository extends BaseMapper<BusTeam>{ ...@@ -34,8 +34,8 @@ public interface BusTeamRepository extends BaseMapper<BusTeam>{
* 分页查询 busTeam * 分页查询 busTeam
* *
*/ */
@Select("<script>select a.*,b.* from bus_team a,sys_principal b where a.pri_id =b.pri_id " + @Select("<script>select * from bus_team a left join sys_principal b on a.pri_id =b.pri_id " +
" and team_type = #{teamType} order by a.CREATE_DATE desc" "where a.team_type = #{teamType} order by a.CREATE_DATE desc"
+ "</script>") + "</script>")
List<Map<String,Object>> queryBusTeams(@Param("teamType") String teamType); List<Map<String,Object>> queryBusTeams(@Param("teamType") String teamType);
......
...@@ -104,11 +104,11 @@ public class BusEnergyPlanController extends PaginationController<BusEnergyPlan> ...@@ -104,11 +104,11 @@ public class BusEnergyPlanController extends PaginationController<BusEnergyPlan>
@ApiOperation(value="查询设备类型", notes="查询设备类型") @ApiOperation(value="查询设备类型", notes="查询设备类型")
@GetMapping(value = "/queryDeviceTp") @GetMapping(value = "/queryDeviceTp")
public Result queryDeviceTp(){ public Result queryDeviceTp(@RequestParam String proId){
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
busEnergyPlanServiceImpl.queryDeviceTp()); busEnergyPlanServiceImpl.queryDeviceTp(proId));
} }
@ApiOperation(value="根据设备类型查询设备", notes="根据设备类型查询设备") @ApiOperation(value="根据设备类型查询设备", notes="根据设备类型查询设备")
......
...@@ -56,9 +56,9 @@ public interface BusEnergyPlanRepository extends BaseMapper<BusEnergyPlan> { ...@@ -56,9 +56,9 @@ public interface BusEnergyPlanRepository extends BaseMapper<BusEnergyPlan> {
* 获取设备类型 * 获取设备类型
* @return * @return
*/ */
@Select("<script>select * from bus_device_tp " @Select("<script>select * from bus_device_tp where PRO_ID=#{proId}"
+ "</script>") + "</script>")
List<Map<String,Object>> queryDeviceTp(); List<Map<String,Object>> queryDeviceTp(@Param("proId") String proId);
/** /**
* 根据设备类型获取设备 * 根据设备类型获取设备
......
...@@ -56,7 +56,7 @@ public interface BusEnergyPlanService { ...@@ -56,7 +56,7 @@ public interface BusEnergyPlanService {
* 获取设备类型 * 获取设备类型
* @return * @return
*/ */
List<Map<String,Object>> queryDeviceTp(); List<Map<String,Object>> queryDeviceTp(String proId);
/** /**
* 根据设备类型获取设备 * 根据设备类型获取设备
......
...@@ -238,9 +238,9 @@ public class BusEnergyPlanServiceImpl implements BusEnergyPlanService { ...@@ -238,9 +238,9 @@ public class BusEnergyPlanServiceImpl implements BusEnergyPlanService {
} }
@Override @Override
public List<Map<String, Object>> queryDeviceTp() { public List<Map<String, Object>> queryDeviceTp(String proId) {
List<Map<String, Object>> list = busEnergyPlanRepository.queryDeviceTp(); List<Map<String, Object>> list = busEnergyPlanRepository.queryDeviceTp(proId);
for(Map<String, Object> m : list){ // for(Map<String, Object> m : list){
/*if(m.get("DEV_TP_IMG")!=null && !m.get("DEV_TP_IMG").toString().equals("") && !m.get("DEV_TP_IMG").toString().equals("null")){ /*if(m.get("DEV_TP_IMG")!=null && !m.get("DEV_TP_IMG").toString().equals("") && !m.get("DEV_TP_IMG").toString().equals("null")){
String type = ""; String type = "";
String img = UploadUtil.GetImageStr(m.get("DEV_TP_IMG").toString()); String img = UploadUtil.GetImageStr(m.get("DEV_TP_IMG").toString());
...@@ -248,7 +248,7 @@ public class BusEnergyPlanServiceImpl implements BusEnergyPlanService { ...@@ -248,7 +248,7 @@ public class BusEnergyPlanServiceImpl implements BusEnergyPlanService {
}else{ }else{
m.put("IMG",""); m.put("IMG","");
}*/ }*/
} // }
return list; return list;
} }
......
...@@ -26,8 +26,8 @@ public class TopologyNodeController extends PaginationController<TopologyNode> { ...@@ -26,8 +26,8 @@ public class TopologyNodeController extends PaginationController<TopologyNode> {
@ApiOperation(value="添加", notes="添加") @ApiOperation(value="添加", notes="添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result add(@RequestParam MultipartFile file) { public Result add(@RequestParam MultipartFile file, @RequestParam String proId) {
return Result.builder(topologyNodeServiceImpl.save(file), return Result.builder(topologyNodeServiceImpl.save(file, proId),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
null); null);
...@@ -41,10 +41,10 @@ public class TopologyNodeController extends PaginationController<TopologyNode> { ...@@ -41,10 +41,10 @@ public class TopologyNodeController extends PaginationController<TopologyNode> {
@ApiOperation(value="拓扑图节点图片列表", notes="拓扑图节点图片列表") @ApiOperation(value="拓扑图节点图片列表", notes="拓扑图节点图片列表")
@GetMapping("/query") @GetMapping("/query")
public Result query() { public Result query(@RequestParam String proId) {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
topologyNodeServiceImpl.queryTopologyNodes()); topologyNodeServiceImpl.queryTopologyNodes(proId));
} }
} }
package org.rcisoft.business.manage.dao; package org.rcisoft.business.manage.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.manage.entity.BusDeviceTp; import org.rcisoft.business.manage.entity.BusDeviceTp;
...@@ -19,9 +20,9 @@ public interface BusDeviceTpRepository extends BaseMapper<BusDeviceTp> { ...@@ -19,9 +20,9 @@ public interface BusDeviceTpRepository extends BaseMapper<BusDeviceTp> {
* 设备类型列表 * 设备类型列表
* *
*/ */
@Select("<script>select * from bus_device_tp where 1=1 " @Select("<script>select * from bus_device_tp where PRO_ID=#{proId} "
+ "</script>") + "</script>")
List<Map<String,Object>> queryBusDeviceTps(); List<Map<String,Object>> queryBusDeviceTps(@Param("proId") String proId);
/** /**
* 查看该设备类型是否配置模板 * 查看该设备类型是否配置模板
......
package org.rcisoft.business.manage.dao; package org.rcisoft.business.manage.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.manage.entity.TopologyNode; import org.rcisoft.business.manage.entity.TopologyNode;
import org.rcisoft.core.base.BaseMapper; import org.rcisoft.core.base.BaseMapper;
...@@ -14,7 +15,7 @@ import java.util.Map; ...@@ -14,7 +15,7 @@ import java.util.Map;
@Repository @Repository
public interface TopologyNodeRepository extends BaseMapper<TopologyNode> { public interface TopologyNodeRepository extends BaseMapper<TopologyNode> {
@Select("<script>select * from topology_node</script>") @Select("<script>select * from topology_node where PRO_ID=#{proId}</script>")
List<Map<String,Object>> queryTopologyNodes(); List<Map<String,Object>> queryTopologyNodes(@Param("proId") String proId);
} }
...@@ -26,6 +26,9 @@ public class BusDeviceTp{ ...@@ -26,6 +26,9 @@ public class BusDeviceTp{
private String devTpImg; private String devTpImg;
/** 新增加的参数,每个项目需要有独立的模板,互不影响 */
private String proId;
} }
...@@ -28,6 +28,9 @@ public class TopologyNode{ ...@@ -28,6 +28,9 @@ public class TopologyNode{
private String url; private String url;
/** 图片需要区分项目 */
private String proId;
} }
...@@ -15,7 +15,7 @@ public interface TopologyNodeService { ...@@ -15,7 +15,7 @@ public interface TopologyNodeService {
* 保存 * 保存
* @return * @return
*/ */
PersistModel save(MultipartFile file); PersistModel save(MultipartFile file, String proId);
/** /**
* 删除 * 删除
...@@ -23,7 +23,7 @@ public interface TopologyNodeService { ...@@ -23,7 +23,7 @@ public interface TopologyNodeService {
*/ */
PersistModel remove(String id); PersistModel remove(String id);
List<Map<String,Object>> queryTopologyNodes(); List<Map<String,Object>> queryTopologyNodes(String proId);
......
...@@ -107,7 +107,7 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService { ...@@ -107,7 +107,7 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService {
@Override @Override
public List<Map<String,Object>> queryBusDeviceTpList(String proId) { public List<Map<String,Object>> queryBusDeviceTpList(String proId) {
List<Map<String,Object>> list = busDeviceTpRepository.queryBusDeviceTps(); List<Map<String,Object>> list = busDeviceTpRepository.queryBusDeviceTps(proId);
for(Map<String,Object> tmap : list){ for(Map<String,Object> tmap : list){
BusDevicetpParam bdp = new BusDevicetpParam(); BusDevicetpParam bdp = new BusDevicetpParam();
bdp.setDevTpId(tmap.get("DEV_TP_ID").toString()); bdp.setDevTpId(tmap.get("DEV_TP_ID").toString());
......
...@@ -40,7 +40,7 @@ public class TopologyNodeServiceImpl implements TopologyNodeService { ...@@ -40,7 +40,7 @@ public class TopologyNodeServiceImpl implements TopologyNodeService {
*/ */
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) @Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override @Override
public PersistModel save(MultipartFile file){ public PersistModel save(MultipartFile file, String proId){
int line = 1; int line = 1;
String fileName = file.getOriginalFilename(); String fileName = file.getOriginalFilename();
String suffixName = fileName.substring(fileName.lastIndexOf(".")); String suffixName = fileName.substring(fileName.lastIndexOf("."));
...@@ -56,6 +56,7 @@ public class TopologyNodeServiceImpl implements TopologyNodeService { ...@@ -56,6 +56,7 @@ public class TopologyNodeServiceImpl implements TopologyNodeService {
TopologyNode tn = new TopologyNode(); TopologyNode tn = new TopologyNode();
tn.setId(id); tn.setId(id);
tn.setUrl(id + suffixName); tn.setUrl(id + suffixName);
tn.setProId(proId);
topologyNodeRepository.insertSelective(tn); topologyNodeRepository.insertSelective(tn);
line = 1; line = 1;
}catch(Exception e){ }catch(Exception e){
...@@ -86,8 +87,8 @@ public class TopologyNodeServiceImpl implements TopologyNodeService { ...@@ -86,8 +87,8 @@ public class TopologyNodeServiceImpl implements TopologyNodeService {
} }
@Override @Override
public List<Map<String, Object>> queryTopologyNodes() { public List<Map<String, Object>> queryTopologyNodes(String proId) {
return topologyNodeRepository.queryTopologyNodes(); return topologyNodeRepository.queryTopologyNodes(proId);
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<id column="DEV_TP_ID" jdbcType="VARCHAR" property="devTpId"/> <id column="DEV_TP_ID" jdbcType="VARCHAR" property="devTpId"/>
<result column="DEV_TP_NM" jdbcType="VARCHAR" property="devTpNm"/> <result column="DEV_TP_NM" jdbcType="VARCHAR" property="devTpNm"/>
<result column="DEV_TP_IMG" jdbcType="VARCHAR" property="devTpImg"/> <result column="DEV_TP_IMG" jdbcType="VARCHAR" property="devTpImg"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
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