|
@@ -111,28 +111,36 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
PageHelper.startPage(page.getPageNum(), page.getPageSize());
|
|
|
List<GoodsVO> list = new ArrayList<>();
|
|
|
- if(tagId==-1){
|
|
|
- //机柜列表
|
|
|
- list = goodsMapper.getRackListBycondition(keyName, tagId, uid);
|
|
|
- PageInfo<GoodsVO> info = new PageInfo<>(list);
|
|
|
- msg.data = info;
|
|
|
- return msg;
|
|
|
- }else if(tagId==-2){
|
|
|
- //设备列表
|
|
|
- QueryWrapper<GoodsNo> qw = new QueryWrapper();
|
|
|
- if(keyName!=null && !"".equals(keyName)){
|
|
|
- qw.eq("device_name",keyName);
|
|
|
+ if(tagId != null){
|
|
|
+ if(tagId==-1){
|
|
|
+ //机柜列表
|
|
|
+ list = goodsMapper.getRackListBycondition(keyName, tagId, uid);
|
|
|
+ PageInfo<GoodsVO> info = new PageInfo<>(list);
|
|
|
+ msg.data = info;
|
|
|
+ return msg;
|
|
|
+ }else if(tagId==-2){
|
|
|
+ //设备列表
|
|
|
+ QueryWrapper<GoodsNo> qw = new QueryWrapper();
|
|
|
+ if(keyName!=null && !"".equals(keyName)){
|
|
|
+ qw.eq("device_name",keyName);
|
|
|
+ }
|
|
|
+ List <GoodsNo> equipmentList = goodsNoMapper.selectList(qw.eq("type",1).select("id", "model_no", "state","indate", "goods_id"
|
|
|
+ ,"user_id", "update_indate", "is_maintain", "type", " device_name", "device_model", "good_sn_no",
|
|
|
+ "label_id", "rack_id", "model_id", "u_bit_num","current_state","alarm_level").orderByDesc("id"));
|
|
|
+ PageInfo<GoodsNo> info = new PageInfo<>(equipmentList);
|
|
|
+ msg.data = info;
|
|
|
+ return msg;
|
|
|
+ }else{
|
|
|
+ list = goodsMapper.getListBycondition(keyName, tagId, uid);
|
|
|
+ PageInfo<GoodsVO> info = new PageInfo<>(list);
|
|
|
+ msg.data = info;
|
|
|
+ return msg;
|
|
|
}
|
|
|
- List <GoodsNo> equipmentList = goodsNoMapper.selectList(qw.eq("type",1).select("id", "model_no", "state","indate", "goods_id"
|
|
|
- ,"user_id", "update_indate", "is_maintain", "type", " device_name", "device_model", "good_sn_no",
|
|
|
- "label_id", "rack_id", "model_id", "u_bit_num","current_state","alarm_level").orderByDesc("id"));
|
|
|
- PageInfo<GoodsNo> info = new PageInfo<>(equipmentList);
|
|
|
+ }else{
|
|
|
+ list = goodsMapper.getListBycondition(keyName, tagId, uid);
|
|
|
+ PageInfo<GoodsVO> info = new PageInfo<>(list);
|
|
|
msg.data = info;
|
|
|
- return msg;
|
|
|
}
|
|
|
- list = goodsMapper.getListBycondition(keyName, tagId, uid);
|
|
|
- PageInfo<GoodsVO> info = new PageInfo<>(list);
|
|
|
- msg.data = info;
|
|
|
return msg;
|
|
|
}
|
|
|
|