更改为构造注入并完善方法注释
This commit is contained in:
@@ -20,6 +20,8 @@ import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* CAS过滤器
|
||||
@@ -29,6 +31,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
@SuppressWarnings("deprecation")
|
||||
public class CasFilter extends CasBaseFilter {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CasFilter.class);
|
||||
private BaseAuthorizingRealm authorizingRealm;
|
||||
|
||||
public CasFilter() {
|
||||
@@ -65,7 +68,7 @@ public class CasFilter extends CasBaseFilter {
|
||||
WebUtils.issueRedirect(request, response, getLoginUrl());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,10 +34,6 @@ public class PermissionsFilter extends org.apache.shiro.web.filter.authz.Permiss
|
||||
|
||||
/**
|
||||
* 无访问权限时,跳转到403页面
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public static boolean redirectTo403Page(ServletRequest request, ServletResponse response) throws IOException {
|
||||
|
||||
@@ -8,7 +8,7 @@ public class FileType {
|
||||
public static final String JPG = "JPG";
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static final Map<String, String> types = new HashMap<String, String>() {{
|
||||
private static final Map<String, String> types = new HashMap<>() {{
|
||||
put(FileType.JPG, ".jpg");
|
||||
}};
|
||||
|
||||
@@ -18,8 +18,6 @@ public class FileType {
|
||||
|
||||
/**
|
||||
* 根据给定的文件名,获取其后缀信息
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
public static String getSuffixByFilename(String filename) {
|
||||
return filename.substring(filename.lastIndexOf(".")).toLowerCase();
|
||||
|
||||
@@ -18,37 +18,35 @@ public interface BizCategoryService extends TreeServiceApi<BizCategory> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bpmCategory
|
||||
* @return
|
||||
* @param bpmCategory 主键
|
||||
*/
|
||||
@Override
|
||||
BizCategory get(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bpmCategory
|
||||
* @return
|
||||
* @param bpmCategory 查询条件
|
||||
*/
|
||||
@Override
|
||||
List<BizCategory> findList(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bpmCategory
|
||||
* @param bpmCategory 数据对象
|
||||
*/
|
||||
@Override
|
||||
void save(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param bpmCategory
|
||||
* @param bpmCategory 数据对象
|
||||
*/
|
||||
@Override
|
||||
void updateStatus(BizCategory bpmCategory);
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bpmCategory
|
||||
* @param bpmCategory 数据对象
|
||||
*/
|
||||
@Override
|
||||
void delete(BizCategory bpmCategory);
|
||||
|
||||
@@ -22,8 +22,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bizCategory
|
||||
* @return
|
||||
* @param bizCategory 主键编码
|
||||
*/
|
||||
@Override
|
||||
public BizCategory get(BizCategory bizCategory) {
|
||||
@@ -32,8 +31,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bizCategory
|
||||
* @return
|
||||
* @param bizCategory 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<BizCategory> findList(BizCategory bizCategory) {
|
||||
@@ -42,7 +40,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bizCategory
|
||||
* @param bizCategory 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -56,7 +54,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param bizCategory
|
||||
* @param bizCategory 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -66,7 +64,7 @@ public class BizCategoryServiceSupport extends TreeService<BizCategoryDao, BizCa
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bizCategory
|
||||
* @param bizCategory 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
|
||||
@@ -12,11 +12,9 @@ import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.biz.entity.BizCategory;
|
||||
import com.jeesite.modules.biz.service.BizCategoryService;
|
||||
import com.jeesite.modules.sys.entity.Office;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -38,9 +36,12 @@ import java.util.Map;
|
||||
@RequestMapping(value = "${adminPath}/biz/bizCategory")
|
||||
public class BizCategoryController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BizCategoryService bizCategoryService;
|
||||
|
||||
private final BizCategoryService bizCategoryService;
|
||||
|
||||
public BizCategoryController(BizCategoryService bizCategoryService) {
|
||||
this.bizCategoryService = bizCategoryService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@@ -192,7 +193,6 @@ public class BizCategoryController extends BaseController {
|
||||
* @param excludeCode 排除的Code
|
||||
* @param parentCode 设置父级编码返回一级
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("biz:bizCategory:view")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.jeesite.modules.file.service.FileUploadService;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -33,9 +32,12 @@ import java.util.Map;
|
||||
@ConditionalOnProperty(name={"file.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class FileUploadController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private FileUploadService fileUploadService;
|
||||
|
||||
private final FileUploadService fileUploadService;
|
||||
|
||||
public FileUploadController(FileUploadService fileUploadService) {
|
||||
this.fileUploadService = fileUploadService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件参数
|
||||
*/
|
||||
|
||||
@@ -21,8 +21,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param msgInner
|
||||
* @return
|
||||
* @param msgInner 主键
|
||||
*/
|
||||
@Override
|
||||
MsgInner get(MsgInner msgInner);
|
||||
@@ -30,7 +29,6 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param msgInner 查询条件; page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
Page<MsgInner> findPage(MsgInner msgInner);
|
||||
@@ -42,7 +40,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param msgInner
|
||||
* @param msgInner 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -56,7 +54,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param msgInner
|
||||
* @param msgInner 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -64,7 +62,7 @@ public interface MsgInnerService extends CrudServiceApi<MsgInner> {
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param msgInner
|
||||
* @param msgInner 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
|
||||
@@ -52,8 +52,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param msgInner
|
||||
* @return
|
||||
* @param msgInner 主键
|
||||
*/
|
||||
@Override
|
||||
public MsgInner get(MsgInner msgInner) {
|
||||
@@ -63,7 +62,6 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param msgInner 查询条件; page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<MsgInner> findPage(MsgInner msgInner) {
|
||||
@@ -82,7 +80,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param msgInner
|
||||
* @param msgInner 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -225,7 +223,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param msgInner
|
||||
* @param msgInner 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -235,7 +233,7 @@ public class MsgInnerServiceSupport extends CrudService<MsgInnerDao, MsgInner>
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param msgInner
|
||||
* @param msgInner 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
|
||||
@@ -4,20 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.msg.web;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
@@ -26,6 +12,17 @@ import com.jeesite.modules.msg.entity.MsgInner;
|
||||
import com.jeesite.modules.msg.entity.MsgInnerRecord;
|
||||
import com.jeesite.modules.msg.entity.MsgPush;
|
||||
import com.jeesite.modules.msg.service.MsgInnerService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* 内部消息Controller
|
||||
@@ -37,9 +34,12 @@ import com.jeesite.modules.msg.service.MsgInnerService;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class MsgInnerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MsgInnerService msgInnerService;
|
||||
|
||||
private final MsgInnerService msgInnerService;
|
||||
|
||||
public MsgInnerController(MsgInnerService msgInnerService) {
|
||||
this.msgInnerService = msgInnerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
|
||||
@@ -243,7 +243,6 @@ public class Log extends DataEntity<Log> {
|
||||
|
||||
/**
|
||||
* 设置请求参数
|
||||
* @param paramsMap
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void setRequestParams(Map paramsMap){
|
||||
@@ -278,8 +277,6 @@ public class Log extends DataEntity<Log> {
|
||||
|
||||
/**
|
||||
* 根据名称获取参数(只有先执行setParams(Map)后才有效)
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public String getRequestParam(String name) {
|
||||
if (paramsMap == null){
|
||||
|
||||
@@ -235,7 +235,6 @@ public class Office extends TreeEntity<Office> {
|
||||
* 2、例如当前机构类型为部门的子部门,你想获取部门所在省公司名称
|
||||
* 3、例如当前机构类型为小组,你想获取所在公司名称
|
||||
* @param type 机构类型
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public Office getParentByType(String type){
|
||||
|
||||
@@ -113,7 +113,6 @@ public class EmpUtils {
|
||||
|
||||
/**
|
||||
* 根据机构编码获取机构对象
|
||||
* @param officeCode
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public static Office getOffice(String officeCode){
|
||||
@@ -269,7 +268,6 @@ public class EmpUtils {
|
||||
|
||||
/**
|
||||
* 根据公司编码获取公司对象
|
||||
* @param companyCode
|
||||
* @author ThinkGem
|
||||
*/
|
||||
public static Company getCompany(String companyCode){
|
||||
@@ -354,7 +352,6 @@ public class EmpUtils {
|
||||
|
||||
/**
|
||||
* 获取当前员工岗位(返回岗位编码和名称)
|
||||
* @return
|
||||
*/
|
||||
public static List<EmployeePost> getEmployeePostList(){
|
||||
return UserUtils.computeIfAbsentCache(CACHE_EMPLOYEE_POST_LIST, k ->
|
||||
@@ -363,8 +360,6 @@ public class EmpUtils {
|
||||
|
||||
/**
|
||||
* 根据员工编号,获取员工岗位(返回岗位编码和名称)
|
||||
* @param empCode
|
||||
* @return
|
||||
*/
|
||||
public static List<EmployeePost> getEmployeePostList(String empCode){
|
||||
Employee employee = new Employee();
|
||||
@@ -386,7 +381,6 @@ public class EmpUtils {
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的部门代码
|
||||
* @return
|
||||
*/
|
||||
public static String getCurrentOfficeCode() {
|
||||
String officeCode = StringUtils.EMPTY;
|
||||
@@ -413,7 +407,6 @@ public class EmpUtils {
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的部门名称
|
||||
* @return
|
||||
*/
|
||||
public static String getCurrentOfficeName() {
|
||||
String officeName = StringUtils.EMPTY;
|
||||
|
||||
@@ -69,7 +69,6 @@ public class LogUtils {
|
||||
|
||||
/**
|
||||
* 保存日志
|
||||
* @param executeTime
|
||||
*/
|
||||
public static void saveLog(User user, HttpServletRequest request, Object handler, Exception ex, String logTitle, String logType, long executeTime){
|
||||
if (user == null || StringUtils.isBlank(user.getUserCode()) || request == null
|
||||
|
||||
@@ -60,8 +60,11 @@ import java.util.stream.Collectors;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class AccountController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
private final UserService userService;
|
||||
|
||||
public AccountController(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录短信或邮件验证码
|
||||
@@ -341,9 +344,6 @@ public class AccountController extends BaseController{
|
||||
|
||||
/**
|
||||
* 校验密保问题答案
|
||||
* @param user
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "savePwdByPwdQuestion")
|
||||
@ResponseBody
|
||||
|
||||
@@ -42,9 +42,12 @@ import java.util.Map;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class AreaController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private AreaService areaService;
|
||||
|
||||
private final AreaService areaService;
|
||||
|
||||
public AreaController(AreaService areaService) {
|
||||
this.areaService = areaService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取区域
|
||||
*/
|
||||
@@ -68,7 +71,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
/**
|
||||
* 区域列表
|
||||
* @param area
|
||||
*/
|
||||
@RequiresPermissions("sys:area:view")
|
||||
@RequestMapping(value = "list")
|
||||
@@ -79,7 +81,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询区域数据
|
||||
* @param area
|
||||
*/
|
||||
@RequiresPermissions("sys:area:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@@ -114,7 +115,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查看编辑区域
|
||||
* @param area
|
||||
*/
|
||||
@RequiresPermissions("sys:area:view")
|
||||
@RequestMapping(value = "form")
|
||||
@@ -156,7 +156,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
/**
|
||||
* 保存区域
|
||||
* @param area
|
||||
*/
|
||||
@RequiresPermissions("sys:area:edit")
|
||||
@PostMapping(value = "save")
|
||||
@@ -168,7 +167,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用区域
|
||||
* @param area
|
||||
*/
|
||||
@RequiresPermissions("sys:area:edit")
|
||||
@RequestMapping(value = "disable")
|
||||
@@ -188,7 +186,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用区域
|
||||
* @param area
|
||||
*/
|
||||
@RequiresPermissions("sys:area:edit")
|
||||
@RequestMapping(value = "enable")
|
||||
@@ -201,7 +198,6 @@ public class AreaController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除区域
|
||||
* @param area
|
||||
*/
|
||||
@RequiresPermissions("sys:area:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@@ -215,7 +211,6 @@ public class AreaController extends BaseController {
|
||||
* 获取区域树结构数据
|
||||
* @param excludeCode 排除的Code
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -40,8 +40,11 @@ import java.util.Map;
|
||||
@Hidden
|
||||
public class AuditController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private AuditService auditService;
|
||||
private final AuditService auditService;
|
||||
|
||||
public AuditController(AuditService auditService) {
|
||||
this.auditService = auditService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全审计列表
|
||||
|
||||
@@ -28,7 +28,6 @@ public class CacheController extends BaseController {
|
||||
|
||||
/**
|
||||
* 清理全部缓存,可清理属性文件里的缓存
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions(value={"sys:config:edit", "sys:state:cache"}, logical=Logical.OR)
|
||||
@RequestMapping(value = "clearAll")
|
||||
|
||||
@@ -43,12 +43,15 @@ import java.util.Map;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class CompanyController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CompanyService companyService;
|
||||
@Autowired
|
||||
private OfficeService officeService;
|
||||
@Autowired
|
||||
private EmpUserService empUserService;
|
||||
private final CompanyService companyService;
|
||||
private final OfficeService officeService;
|
||||
private final EmpUserService empUserService;
|
||||
|
||||
public CompanyController(CompanyService companyService, OfficeService officeService, EmpUserService empUserService) {
|
||||
this.companyService = companyService;
|
||||
this.officeService = officeService;
|
||||
this.empUserService = empUserService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公司
|
||||
@@ -74,7 +77,6 @@ public class CompanyController extends BaseController {
|
||||
|
||||
/**
|
||||
* 公司列表
|
||||
* @param company
|
||||
*/
|
||||
@RequiresPermissions("sys:company:view")
|
||||
@RequestMapping(value = "list")
|
||||
@@ -86,7 +88,6 @@ public class CompanyController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询公司数据
|
||||
* @param company
|
||||
*/
|
||||
@RequiresPermissions("sys:company:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@@ -109,7 +110,6 @@ public class CompanyController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查看编辑公司
|
||||
* @param company
|
||||
*/
|
||||
@RequiresPermissions("sys:company:view")
|
||||
@RequestMapping(value = "form")
|
||||
@@ -165,7 +165,6 @@ public class CompanyController extends BaseController {
|
||||
|
||||
/**
|
||||
* 保存公司
|
||||
* @param company
|
||||
*/
|
||||
@RequiresPermissions("sys:company:edit")
|
||||
@PostMapping(value = "save")
|
||||
@@ -177,7 +176,6 @@ public class CompanyController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用公司
|
||||
* @param company
|
||||
*/
|
||||
@RequiresPermissions("sys:company:edit")
|
||||
@RequestMapping(value = "disable")
|
||||
@@ -197,7 +195,6 @@ public class CompanyController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用公司
|
||||
* @param company
|
||||
*/
|
||||
@RequiresPermissions("sys:company:edit")
|
||||
@RequestMapping(value = "enable")
|
||||
@@ -210,7 +207,6 @@ public class CompanyController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除公司
|
||||
* @param company
|
||||
*/
|
||||
@RequiresPermissions("sys:company:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@@ -235,7 +231,6 @@ public class CompanyController extends BaseController {
|
||||
* @param isAll 是否显示所有机构(true:不进行权限过滤)
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @param isShowFullName 是否显示全公司名称
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -4,10 +4,15 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.web;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.Config;
|
||||
import com.jeesite.modules.sys.service.ConfigService;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -19,13 +24,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.Config;
|
||||
import com.jeesite.modules.sys.service.ConfigService;
|
||||
|
||||
|
||||
/**
|
||||
* 参数设置Controller
|
||||
@@ -38,13 +36,14 @@ import com.jeesite.modules.sys.service.ConfigService;
|
||||
@Hidden
|
||||
public class ConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
private final ConfigService configService;
|
||||
|
||||
public ConfigController(ConfigService configService) {
|
||||
this.configService = configService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ModelAttribute
|
||||
public Config get(String id, boolean isNewRecord) {
|
||||
@@ -53,9 +52,6 @@ public class ConfigController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param config
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:config:view")
|
||||
@RequestMapping(value = "list")
|
||||
@@ -66,10 +62,6 @@ public class ConfigController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param config
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:config:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@@ -82,9 +74,6 @@ public class ConfigController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
* @param config
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:config:view")
|
||||
@RequestMapping(value = "form")
|
||||
@@ -95,8 +84,6 @@ public class ConfigController extends BaseController {
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
* @param config
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:config:edit")
|
||||
@PostMapping(value = "save")
|
||||
@@ -136,8 +123,6 @@ public class ConfigController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param config
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:config:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
|
||||
@@ -43,11 +43,14 @@ import java.util.Map;
|
||||
@Hidden
|
||||
public class DictDataController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DictDataService dictDataService;
|
||||
@Autowired
|
||||
private DictTypeService dictTypeService;
|
||||
|
||||
private final DictDataService dictDataService;
|
||||
private final DictTypeService dictTypeService;
|
||||
|
||||
public DictDataController(DictDataService dictDataService, DictTypeService dictTypeService) {
|
||||
this.dictDataService = dictDataService;
|
||||
this.dictTypeService = dictTypeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@@ -176,7 +179,6 @@ public class DictDataController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用字典
|
||||
* @param dictData
|
||||
*/
|
||||
@RequiresPermissions("sys:dictData:edit")
|
||||
@RequestMapping(value = "disable")
|
||||
@@ -201,7 +203,6 @@ public class DictDataController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用字典
|
||||
* @param dictData
|
||||
*/
|
||||
@RequiresPermissions("sys:dictData:edit")
|
||||
@RequestMapping(value = "enable")
|
||||
@@ -283,7 +284,6 @@ public class DictDataController extends BaseController {
|
||||
|
||||
/**
|
||||
* 树结构数据修复
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dictData:edit")
|
||||
@RequestMapping(value = "fixTreeData")
|
||||
|
||||
@@ -37,9 +37,12 @@ import java.util.Map;
|
||||
@Hidden
|
||||
public class DictTypeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private DictTypeService dictTypeService;
|
||||
|
||||
private final DictTypeService dictTypeService;
|
||||
|
||||
public DictTypeController(DictTypeService dictTypeService) {
|
||||
this.dictTypeService = dictTypeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@@ -104,7 +107,6 @@ public class DictTypeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 验证字段类型是否有效
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dictType:edit")
|
||||
@RequestMapping(value = "checkDictType")
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.web;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.Log;
|
||||
import com.jeesite.modules.sys.service.LogService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -17,11 +19,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.Log;
|
||||
import com.jeesite.modules.sys.service.LogService;
|
||||
|
||||
/**
|
||||
* 日志Controller
|
||||
* @author ThinkGem
|
||||
@@ -33,9 +30,12 @@ import com.jeesite.modules.sys.service.LogService;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class LogController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
private final LogService logService;
|
||||
|
||||
public LogController(LogService logService) {
|
||||
this.logService = logService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,6 @@ import io.swagger.v3.oas.annotations.Hidden;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -42,10 +41,13 @@ import java.util.Map;
|
||||
@Hidden
|
||||
public class MenuController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
@Autowired
|
||||
private ModuleService moduleService;
|
||||
private final MenuService menuService;
|
||||
private final ModuleService moduleService;
|
||||
|
||||
public MenuController(MenuService menuService, ModuleService moduleService) {
|
||||
this.menuService = menuService;
|
||||
this.moduleService = moduleService;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
public Menu get(String menuCode, boolean isNewRecord, HttpServletRequest request) {
|
||||
@@ -202,7 +204,6 @@ public class MenuController extends BaseController {
|
||||
* 返回树结构数据
|
||||
* @param excludeCode 排除的编码
|
||||
* @param isShowRawName 是否显示原文(默认false)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:menu:view")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -18,7 +18,6 @@ import io.swagger.v3.oas.annotations.Hidden;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -44,13 +43,14 @@ import java.util.stream.Collectors;
|
||||
@Hidden
|
||||
public class ModuleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ModuleService moduleService;
|
||||
|
||||
private final ModuleService moduleService;
|
||||
|
||||
public ModuleController(ModuleService moduleService) {
|
||||
this.moduleService = moduleService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
* @param moduleCode
|
||||
* @return
|
||||
*/
|
||||
@ModelAttribute
|
||||
public Module get(String moduleCode, boolean isNewRecord) {
|
||||
@@ -59,9 +59,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param module
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:view")
|
||||
@RequestMapping(value = "list")
|
||||
@@ -73,10 +70,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param module
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@@ -104,9 +97,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
* @param module
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:view")
|
||||
@RequestMapping(value = "form")
|
||||
@@ -132,8 +122,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
* @param module
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:edit")
|
||||
@PostMapping(value = "save")
|
||||
@@ -159,7 +147,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 验证编码是否有效
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:edit")
|
||||
@RequestMapping(value = "checkModuleCode")
|
||||
@@ -177,8 +164,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用数据
|
||||
* @param module
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:edit")
|
||||
@RequestMapping(value = "disable")
|
||||
@@ -197,8 +182,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用数据
|
||||
* @param module
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:edit")
|
||||
@RequestMapping(value = "enable")
|
||||
@@ -214,8 +197,6 @@ public class ModuleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param module
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:module:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
|
||||
@@ -22,7 +22,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -47,12 +46,15 @@ import java.util.Map;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class OfficeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private OfficeService officeService;
|
||||
@Autowired
|
||||
private EmpUserService empUserService;
|
||||
@Autowired
|
||||
private EmpUserController empUserController;
|
||||
private final OfficeService officeService;
|
||||
private final EmpUserService empUserService;
|
||||
private final EmpUserController empUserController;
|
||||
|
||||
public OfficeController(OfficeService officeService, EmpUserService empUserService, EmpUserController empUserController) {
|
||||
this.officeService = officeService;
|
||||
this.empUserService = empUserService;
|
||||
this.empUserController = empUserController;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取机构
|
||||
@@ -78,7 +80,6 @@ public class OfficeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 机构列表
|
||||
* @param office
|
||||
*/
|
||||
@RequiresPermissions("sys:office:view")
|
||||
@RequestMapping(value = "list")
|
||||
@@ -90,7 +91,6 @@ public class OfficeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询机构数据
|
||||
* @param office
|
||||
*/
|
||||
@RequiresPermissions("sys:office:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@@ -115,7 +115,6 @@ public class OfficeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查看编辑机构
|
||||
* @param office
|
||||
*/
|
||||
@RequiresPermissions("sys:office:view")
|
||||
@RequestMapping(value = "form")
|
||||
@@ -173,7 +172,6 @@ public class OfficeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 保存机构
|
||||
* @param office
|
||||
*/
|
||||
@RequiresPermissions("sys:office:edit")
|
||||
@PostMapping(value = "save")
|
||||
@@ -232,7 +230,6 @@ public class OfficeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用机构
|
||||
* @param office
|
||||
*/
|
||||
@RequiresPermissions("sys:office:edit")
|
||||
@RequestMapping(value = "disable")
|
||||
@@ -252,7 +249,6 @@ public class OfficeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用机构
|
||||
* @param office
|
||||
*/
|
||||
@RequiresPermissions("sys:office:edit")
|
||||
@RequestMapping(value = "enable")
|
||||
@@ -265,7 +261,6 @@ public class OfficeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除机构
|
||||
* @param office
|
||||
*/
|
||||
@RequiresPermissions("sys:office:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@@ -295,7 +290,6 @@ public class OfficeController extends BaseController {
|
||||
* @param isLoadUser 是否加载机构下的用户(true 一次性加载;lazy 懒加载,点击再加载)
|
||||
* @param postCode 机构下的用户过滤岗位
|
||||
* @param roleCode 机构下的用户过滤角色
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.apache.shiro.subject.PrincipalCollection;
|
||||
import org.apache.shiro.subject.support.DefaultSubjectContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -44,13 +43,15 @@ import java.util.Map;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class OnlineController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private SessionDAO sessionDAO;
|
||||
private final SessionDAO sessionDAO;
|
||||
|
||||
@SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
|
||||
public OnlineController(SessionDAO sessionDAO) {
|
||||
this.sessionDAO = sessionDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线用户数
|
||||
* @param request
|
||||
* @param response
|
||||
* @author ThinkGem
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@@ -63,7 +64,6 @@ public class OnlineController extends BaseController{
|
||||
|
||||
/**
|
||||
* 在线用户列表
|
||||
* @param model
|
||||
*/
|
||||
@RequiresPermissions("sys:online:view")
|
||||
@RequestMapping(value = "list")
|
||||
|
||||
@@ -17,7 +17,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -41,8 +40,11 @@ import java.util.Map;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class PostController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private PostService postService;
|
||||
private final PostService postService;
|
||||
|
||||
public PostController(PostService postService) {
|
||||
this.postService = postService;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
public Post get(String postCode, boolean isNewRecord) {
|
||||
@@ -131,9 +133,6 @@ public class PostController extends BaseController {
|
||||
|
||||
/**
|
||||
* 验证岗位名是否有效
|
||||
* @param oldPostName
|
||||
* @param postName
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "checkPostName")
|
||||
@@ -152,7 +151,6 @@ public class PostController extends BaseController {
|
||||
/**
|
||||
* 获取岗位树结构数据
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -19,8 +19,9 @@ import com.jeesite.modules.sys.utils.DictUtils;
|
||||
import com.jeesite.modules.sys.utils.ModuleUtils;
|
||||
import com.jeesite.modules.sys.utils.RoleUtils;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -30,8 +31,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -46,11 +45,13 @@ import java.util.Map;
|
||||
@Hidden
|
||||
public class RoleController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
private final RoleService roleService;
|
||||
private final MenuService menuService;
|
||||
|
||||
public RoleController(RoleService roleService, MenuService menuService) {
|
||||
this.roleService = roleService;
|
||||
this.menuService = menuService;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
public Role get(String roleCode, boolean isNewRecord) {
|
||||
@@ -120,9 +121,6 @@ public class RoleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 验证角色名是否有效
|
||||
* @param oldRoleName
|
||||
* @param roleName
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "checkRoleName")
|
||||
@@ -140,8 +138,6 @@ public class RoleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用角色
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:role:edit")
|
||||
@RequestMapping(value = "disable")
|
||||
@@ -159,8 +155,6 @@ public class RoleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用角色
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:role:edit")
|
||||
@RequestMapping(value = "enable")
|
||||
@@ -178,8 +172,6 @@ public class RoleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
* @param role
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:role:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@@ -202,9 +194,6 @@ public class RoleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 判断某用户是包含某角色
|
||||
* @param userCode
|
||||
* @param roleCode
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "hasUserRole")
|
||||
@@ -219,7 +208,6 @@ public class RoleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询菜单的树结构数据
|
||||
* @param role
|
||||
*/
|
||||
@RequiresPermissions("sys:role:view")
|
||||
@RequestMapping(value = "menuTreeData")
|
||||
@@ -265,8 +253,6 @@ public class RoleController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查询角色的菜单树结构数据
|
||||
* @param roleCode
|
||||
* @param sysCode
|
||||
*/
|
||||
@RequiresPermissions("sys:role:view")
|
||||
@RequestMapping(value = "menuTreeDataByRoleCode")
|
||||
@@ -351,7 +337,6 @@ public class RoleController extends BaseController {
|
||||
* 获取角色树结构数据
|
||||
* @param isAll 是否显示所有机构(true:不进行权限过滤)
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -20,7 +20,6 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -40,8 +39,11 @@ import java.util.Set;
|
||||
@ConditionalOnProperty(name="user.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class SwitchController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private PostService postService;
|
||||
private final PostService postService;
|
||||
|
||||
public SwitchController(PostService postService) {
|
||||
this.postService = postService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换系统菜单(菜单归属子系统)
|
||||
|
||||
@@ -43,10 +43,13 @@ import java.util.Map;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class CorpAdminController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
private final UserService userService;
|
||||
private final RoleService roleService;
|
||||
|
||||
public CorpAdminController(UserService userService, RoleService roleService) {
|
||||
this.userService = userService;
|
||||
this.roleService = roleService;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
public User get(String userCode, boolean isNewRecord) {
|
||||
@@ -156,8 +159,6 @@ public class CorpAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用用户
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:corpAdmin:edit")
|
||||
@ResponseBody
|
||||
@@ -176,8 +177,6 @@ public class CorpAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用用户
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:corpAdmin:edit")
|
||||
@ResponseBody
|
||||
@@ -193,8 +192,6 @@ public class CorpAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 密码重置
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:corpAdmin:edit")
|
||||
@RequestMapping(value = "resetpwd")
|
||||
@@ -209,8 +206,6 @@ public class CorpAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:corpAdmin:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@@ -238,7 +233,6 @@ public class CorpAdminController extends BaseController {
|
||||
* 查询租户数据树格式
|
||||
* @param pId 父级编码,默认 -1
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
//@RequiresPermissions("user") // 注释掉,允许配置URI控制权限
|
||||
@RequestMapping(value = "treeData")
|
||||
@@ -260,8 +254,6 @@ public class CorpAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 切换租户
|
||||
* @param corpCode
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:corpAdmin:edit")
|
||||
@RequestMapping(value = "switch/{corpCode}")
|
||||
|
||||
@@ -58,16 +58,20 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class EmpUserController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private EmpUserService empUserService;
|
||||
@Autowired
|
||||
private EmployeeService employeeService;
|
||||
@Autowired
|
||||
private PostService postService;
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
private final EmpUserService empUserService;
|
||||
private final EmployeeService employeeService;
|
||||
private final PostService postService;
|
||||
private final UserService userService;
|
||||
private final RoleService roleService;
|
||||
|
||||
public EmpUserController(EmpUserService empUserService, EmployeeService employeeService,
|
||||
PostService postService, UserService userService, RoleService roleService) {
|
||||
this.empUserService = empUserService;
|
||||
this.employeeService = employeeService;
|
||||
this.postService = postService;
|
||||
this.userService = userService;
|
||||
this.roleService = roleService;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
public EmpUser get(String userCode, boolean isNewRecord, Boolean isAll, String ctrlPermi) {
|
||||
@@ -209,9 +213,6 @@ public class EmpUserController extends BaseController {
|
||||
|
||||
/**
|
||||
* 验证工号是否有效
|
||||
* @param oldEmpNo
|
||||
* @param empNo
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "checkEmpNo")
|
||||
@@ -284,8 +285,6 @@ public class EmpUserController extends BaseController {
|
||||
|
||||
/**
|
||||
* 停用用户
|
||||
* @param empUser
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:empUser:updateStatus")
|
||||
@ResponseBody
|
||||
@@ -308,8 +307,6 @@ public class EmpUserController extends BaseController {
|
||||
|
||||
/**
|
||||
* 启用用户
|
||||
* @param empUser
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:empUser:updateStatus")
|
||||
@ResponseBody
|
||||
@@ -330,8 +327,6 @@ public class EmpUserController extends BaseController {
|
||||
|
||||
/**
|
||||
* 密码重置
|
||||
* @param empUser
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:empUser:resetpwd")
|
||||
@RequestMapping(value = "resetpwd")
|
||||
@@ -350,8 +345,6 @@ public class EmpUserController extends BaseController {
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param empUser
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:empUser:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@@ -412,7 +405,6 @@ public class EmpUserController extends BaseController {
|
||||
* @param roleCode 角色Code
|
||||
* @param isAll 是否显示所有用户(true:不进行权限过滤)
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -4,12 +4,17 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.web.user;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.mapper.JsonMapper;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.entity.UserDataScope;
|
||||
import com.jeesite.modules.sys.service.UserService;
|
||||
import com.jeesite.modules.sys.utils.ModuleUtils;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -21,14 +26,7 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.mapper.JsonMapper;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.entity.UserDataScope;
|
||||
import com.jeesite.modules.sys.service.UserService;
|
||||
import com.jeesite.modules.sys.utils.ModuleUtils;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 二级管理员Controller
|
||||
@@ -41,8 +39,11 @@ import com.jeesite.modules.sys.utils.ModuleUtils;
|
||||
@ConditionalOnProperty(name={"user.enabled","web.core.enabled"}, havingValue="true", matchIfMissing=true)
|
||||
public class SecAdminController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
private final UserService userService;
|
||||
|
||||
public SecAdminController(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@ModelAttribute
|
||||
public User get(String userCode, boolean isNewRecord) {
|
||||
@@ -84,8 +85,6 @@ public class SecAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 设置为二级管理员身份
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:secAdmin:edit")
|
||||
@PostMapping(value = "save")
|
||||
@@ -104,8 +103,6 @@ public class SecAdminController extends BaseController {
|
||||
|
||||
/**
|
||||
* 取消二级管理员身份
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:secAdmin:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
|
||||
@@ -40,8 +40,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
@Hidden
|
||||
public class UserController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
private final UserService userService;
|
||||
|
||||
public UserController(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
|
||||
@@ -20,7 +20,6 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
<% } %>
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -66,8 +65,11 @@ import ${packageName}.${moduleName}.service${subModuleNameDot}.${ClassName}Servi
|
||||
@RequestMapping(value = "\${adminPath}/${urlPrefix}")
|
||||
public class ${ClassName}Controller extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ${ClassName}Service ${className}Service;
|
||||
private final ${ClassName}Service ${className}Service;
|
||||
|
||||
public ${ClassName}Controller(${ClassName}Service ${className}Service) {
|
||||
this.${className}Service = ${className}Service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
@@ -327,7 +329,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
* @param excludeCode 排除的Code
|
||||
* @param parentCode 设置父级编码返回一级
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
package ${packageName}.${moduleName}.service${subModuleNameDot};
|
||||
|
||||
import java.util.List;
|
||||
<% if (table.childList.~size > 0){ %>
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
<% } %>
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -53,14 +50,16 @@ import jakarta.validation.ConstraintViolationException;
|
||||
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Service<${ClassName}Dao, ${ClassName}> {
|
||||
<% for (child in table.childList){ %>
|
||||
|
||||
@Autowired
|
||||
private ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
|
||||
private final ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
|
||||
|
||||
public ${ClassName}Service(${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao) {
|
||||
this.${@StringUtils.uncap(child.className)}Dao = ${@StringUtils.uncap(child.className)}Dao;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param ${className}
|
||||
* @return
|
||||
* @param ${className} 主键
|
||||
*/
|
||||
@Override
|
||||
public ${ClassName} get(${ClassName} ${className}) {
|
||||
@@ -83,7 +82,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
* 查询分页数据
|
||||
* @param ${className} 查询条件
|
||||
* @param ${className} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<${ClassName}> findPage(${ClassName} ${className}) {
|
||||
@@ -92,8 +90,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param ${className}
|
||||
* @return
|
||||
* @param ${className} 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<${ClassName}> findList(${ClassName} ${className}) {
|
||||
@@ -105,7 +102,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
* 查询子表分页数据
|
||||
* @param ${@StringUtils.uncap(child.className)}
|
||||
* @param ${@StringUtils.uncap(child.className)} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
public Page<${@StringUtils.cap(child.className)}> findSubPage(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}) {
|
||||
Page<${@StringUtils.cap(child.className)}> page = ${@StringUtils.uncap(child.className)}.getPage();
|
||||
@@ -116,7 +112,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param ${className}
|
||||
* @param ${className} 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -264,7 +260,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param ${className}
|
||||
* @param ${className} 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@@ -274,7 +270,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param ${className}
|
||||
* @param ${className} 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
|
||||
@@ -20,7 +20,6 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
<% } %>
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -68,8 +67,11 @@ import org.apache.seata.spring.annotation.GlobalTransactional;
|
||||
@RequestMapping(value = "\${adminPath}/${urlPrefix}")
|
||||
public class ${ClassName}Controller extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ${ClassName}Service ${className}Service;
|
||||
private final ${ClassName}Service ${className}Service;
|
||||
|
||||
public ${ClassName}Controller(${ClassName}Service ${className}Service) {
|
||||
this.${className}Service = ${className}Service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
@@ -334,7 +336,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
* @param excludeCode 排除的Code
|
||||
* @param parentCode 设置父级编码返回一级
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
package ${packageName}.${moduleName}.service${subModuleNameDot};
|
||||
|
||||
import java.util.List;
|
||||
<% if (table.childList.~size > 0){ %>
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
<% } %>
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -59,14 +56,16 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
implements ${ClassName}ServiceApi {
|
||||
<% for (child in table.childList){ %>
|
||||
|
||||
@Autowired
|
||||
private ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
|
||||
private final ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
|
||||
|
||||
public ${ClassName}Service(${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao) {
|
||||
this.${@StringUtils.uncap(child.className)}Dao = ${@StringUtils.uncap(child.className)}Dao;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param ${className}
|
||||
* @return
|
||||
* @param ${className} 主键
|
||||
*/
|
||||
@Override
|
||||
public ${ClassName} get(${ClassName} ${className}) {
|
||||
@@ -89,7 +88,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
* 查询分页数据
|
||||
* @param ${className} 查询条件
|
||||
* @param ${className} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<${ClassName}> findPage(${ClassName} ${className}) {
|
||||
@@ -98,8 +96,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param ${className}
|
||||
* @return
|
||||
* @param ${className} 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<${ClassName}> findList(${ClassName} ${className}) {
|
||||
@@ -111,7 +108,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
* 查询子表分页数据
|
||||
* @param ${@StringUtils.uncap(child.className)}
|
||||
* @param ${@StringUtils.uncap(child.className)} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
public Page<${@StringUtils.cap(child.className)}> findSubPage(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}) {
|
||||
Page<${@StringUtils.cap(child.className)}> page = ${@StringUtils.uncap(child.className)}.getPage();
|
||||
@@ -122,7 +118,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param ${className}
|
||||
* @param ${className} 数据对象
|
||||
*/
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
@@ -252,7 +248,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param ${className}
|
||||
* @param ${className} 数据对象
|
||||
*/
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
@@ -263,7 +259,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Crud'}Serv
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param ${className}
|
||||
* @param ${className} 数据对象
|
||||
*/
|
||||
@Override
|
||||
@GlobalTransactional
|
||||
|
||||
@@ -18,7 +18,6 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
<% } %>
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -51,8 +50,11 @@ import ${packageName}.${moduleName}.service${subModuleNameDot}.${ClassName}Servi
|
||||
@RequestMapping(value = "\${adminPath}/${urlPrefix}")
|
||||
public class ${ClassName}Controller extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ${ClassName}Service ${className}Service;
|
||||
private final ${ClassName}Service ${className}Service;
|
||||
|
||||
public ${ClassName}Controller(${ClassName}Service ${className}Service) {
|
||||
this.${className}Service = ${className}Service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
@@ -167,7 +169,6 @@ public class ${ClassName}Controller extends BaseController {
|
||||
* @param excludeCode 排除的Code
|
||||
* @param parentCode 设置父级编码返回一级
|
||||
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("${permissionPrefix}:view")
|
||||
@RequestMapping(value = "treeData")
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
package ${packageName}.${moduleName}.service${subModuleNameDot};
|
||||
|
||||
import java.util.List;
|
||||
<% if (table.childList.~size > 0){ %>
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
<% } %>
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
@@ -32,14 +29,16 @@ import ${packageName}.${moduleName}.dao${subModuleNameDot}.${@StringUtils.cap(ch
|
||||
public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Service<${ClassName}Dao, ${ClassName}> {
|
||||
<% for (child in table.childList){ %>
|
||||
|
||||
@Autowired
|
||||
private ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
|
||||
private final ${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao;
|
||||
|
||||
public ${ClassName}Service(${@StringUtils.cap(child.className)}Dao ${@StringUtils.uncap(child.className)}Dao) {
|
||||
this.${@StringUtils.uncap(child.className)}Dao = ${@StringUtils.uncap(child.className)}Dao;
|
||||
}
|
||||
<% } %>
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param ${className}
|
||||
* @return
|
||||
* @param ${className} 主键
|
||||
*/
|
||||
@Override
|
||||
public ${ClassName} get(${ClassName} ${className}) {
|
||||
@@ -62,7 +61,6 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
|
||||
* 查询分页数据
|
||||
* @param ${className} 查询条件
|
||||
* @param ${className} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<${ClassName}> findPage(${ClassName} ${className}) {
|
||||
@@ -71,8 +69,7 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param ${className}
|
||||
* @return
|
||||
* @param ${className} 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<${ClassName}> findList(${ClassName} ${className}) {
|
||||
@@ -82,9 +79,8 @@ public class ${ClassName}Service extends ${table.isTreeEntity?'Tree':'Query'}Ser
|
||||
|
||||
/**
|
||||
* 查询子表分页数据
|
||||
* @param ${@StringUtils.uncap(child.className)}
|
||||
* @param ${@StringUtils.uncap(child.className)} 查询条件
|
||||
* @param ${@StringUtils.uncap(child.className)} page 分页对象
|
||||
* @return
|
||||
*/
|
||||
public Page<${@StringUtils.cap(child.className)}> findSubPage(${@StringUtils.cap(child.className)} ${@StringUtils.uncap(child.className)}) {
|
||||
Page<${@StringUtils.cap(child.className)}> page = ${@StringUtils.uncap(child.className)}.getPage();
|
||||
|
||||
Reference in New Issue
Block a user