|
@@ -42,15 +42,15 @@ public class ChannelPortServiceImpl implements ChannelPortService {
|
|
String sqlStr=data.getFilterString();
|
|
String sqlStr=data.getFilterString();
|
|
Integer totalCount=this.portMapper.queryExternalCount(sqlStr);
|
|
Integer totalCount=this.portMapper.queryExternalCount(sqlStr);
|
|
|
|
|
|
- List<ChannelPort> list = new ArrayList<>();
|
|
|
|
|
|
+ List<Map<String,Object>> listMap = new ArrayList<>();
|
|
if(totalCount != null && totalCount > 0){
|
|
if(totalCount != null && totalCount > 0){
|
|
- list = this.portMapper.queryExternalList(sqlStr,start,end);
|
|
|
|
- for (ChannelPort p: list) {
|
|
|
|
- p.setHeadImg(webUrl + p.getHeadImg());
|
|
|
|
|
|
+ listMap = this.portMapper.queryExternalList(sqlStr,start,end);
|
|
|
|
+ for (Map m: listMap) {
|
|
|
|
+ m.put("headImg",webUrl + m.get("headImg"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ResultInfo result = new ResultInfo(ResultInfo.TYPE_RESULT_SUCCESS,100,"操作成功!");
|
|
ResultInfo result = new ResultInfo(ResultInfo.TYPE_RESULT_SUCCESS,100,"操作成功!");
|
|
- result.setItems(list);
|
|
|
|
|
|
+ result.setItems(listMap);
|
|
result.setTotalCount(totalCount);
|
|
result.setTotalCount(totalCount);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -72,6 +72,16 @@ public class ChannelPortServiceImpl implements ChannelPortService {
|
|
port.setHeadImg(newPath);
|
|
port.setHeadImg(newPath);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //重名检测
|
|
|
|
+ Map<String,Object> paramMap = new HashMap<String,Object>();
|
|
|
|
+ paramMap.put("id",port.getId());
|
|
|
|
+ paramMap.put("portName",port.getPortName());
|
|
|
|
+ paramMap.put("type",port.getType());
|
|
|
|
+ int count = portMapper.selectByPortName(paramMap);
|
|
|
|
+ if(count > 0){
|
|
|
|
+ return new ResultInfo(ResultInfo.TYPE_RESULT_INFO,200,"端口名称重复,请重新输入!");
|
|
|
|
+ }
|
|
|
|
+
|
|
if(port.getId() == null){
|
|
if(port.getId() == null){
|
|
//新增
|
|
//新增
|
|
port.setCreateTime(DateUtil.getNowDateTimeStr());
|
|
port.setCreateTime(DateUtil.getNowDateTimeStr());
|