Browse Source

角色关联酒店

WIN-B904R0U0NNS\Administrator 2 years ago
parent
commit
9b34c96651

+ 11 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java

@@ -24,6 +24,8 @@ import org.jeecg.common.util.PmsUtil;
 import org.jeecg.common.util.TokenUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.base.service.BaseCommonService;
+import org.jeecg.modules.business.entity.BusHotel;
+import org.jeecg.modules.business.service.IBusHotelService;
 import org.jeecg.modules.system.entity.*;
 import org.jeecg.modules.system.model.TreeModel;
 import org.jeecg.modules.system.service.*;
@@ -86,6 +88,9 @@ public class SysRoleController {
 	@Autowired
 	private BaseCommonService baseCommonService;
 
+	@Autowired
+	private IBusHotelService busHotelService;
+
 	/**
 	  * 分页列表查询
 	 * @param role
@@ -112,6 +117,12 @@ public class SysRoleController {
 			queryWrapper.isNull("tenant_id");
 		}
 		IPage<SysRole> pageList = sysRoleService.page(page, queryWrapper);
+		pageList.getRecords().forEach(item->{
+			BusHotel hotle = busHotelService.getById(item.getHotelId());
+			if (hotle != null) {
+				item.setHotelName(hotle.getName());
+			}
+		});
 		result.setSuccess(true);
 		result.setResult(pageList);
 		return result;

+ 10 - 3
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysRole.java

@@ -4,6 +4,7 @@ import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.util.Date;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -35,19 +36,19 @@ public class SysRole implements Serializable {
      */
     @TableId(type = IdType.ASSIGN_ID)
     private String id;
-    
+
     /**
      * 角色名称
      */
     @Excel(name="角色名",width=15)
     private String roleName;
-    
+
     /**
      * 角色编码
      */
     @Excel(name="角色编码",width=15)
     private String roleCode;
-    
+
     /**
           * 描述
      */
@@ -83,5 +84,11 @@ public class SysRole implements Serializable {
      */
     private Integer tenantId;
 
+    /**关联酒店*/
+    @Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
 
+    /**酒店名称*/
+    private transient String hotelName;
 }