|
|
@@ -15,9 +15,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
+import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.common.util.TokenUtils;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -83,6 +85,10 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
HttpServletRequest req) {
|
|
|
QueryWrapper<BusHotel> queryWrapper = QueryGenerator.initQueryWrapper(busHotel, req.getParameterMap());
|
|
|
+ LoginUser user = TokenUtils.getAuthUser();
|
|
|
+ if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
|
+ queryWrapper.eq("tenant_id",user.getRelTenantIds());
|
|
|
+ }
|
|
|
Page<BusHotel> page = new Page<BusHotel>(pageNo, pageSize);
|
|
|
IPage<BusHotel> pageList = busHotelService.page(page, queryWrapper);
|
|
|
// pageList.getRecords().forEach(item->{
|
|
|
@@ -95,8 +101,6 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
item.setTenantName(sysTenant.getName());
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
-
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
|
|
|
@@ -114,6 +118,14 @@ public class BusHotelController extends JeecgController<BusHotel, IBusHotelServi
|
|
|
busHotel.setStatus(1);
|
|
|
busHotel.setDelFlag(CommonConstant.DEL_FLAG_0);
|
|
|
busHotel.setCheckStatus(0);
|
|
|
+ if(busHotel.getTenantId() == null || busHotel.getTenantId().equals("")){
|
|
|
+ LoginUser user = TokenUtils.getAuthUser();
|
|
|
+ if(user.getRelTenantIds() != null && !user.getRelTenantIds().equals("")){
|
|
|
+ busHotel.setTenantId(user.getRelTenantIds());
|
|
|
+ } else {
|
|
|
+ throw new JeecgBootException("当前登录人租户信息错误");
|
|
|
+ }
|
|
|
+ }
|
|
|
busHotelService.save(busHotel);
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|