| private Long id; | private Long id; | ||||
| @ApiModelProperty(value = "外键id") | @ApiModelProperty(value = "外键id") | ||||
| private String foreignId; | |||||
| private Long infoId; | |||||
| @ApiModelProperty(value = "链接名称") | @ApiModelProperty(value = "链接名称") | ||||
| private String reason; | private String reason; |
| @ApiModelProperty(value = "排序") | @ApiModelProperty(value = "排序") | ||||
| private Integer sort; | private Integer sort; | ||||
| @ApiModelProperty(value = "保持類型 0 保存 1保持提交") | |||||
| private Integer saveType; | |||||
| /** | /** | ||||
| * 信息详情 | * 信息详情 |
| private String name; | private String name; | ||||
| @ApiModelProperty(value = "角色唯一编码") | @ApiModelProperty(value = "角色唯一编码") | ||||
| @NotBlank(message = "角色编码不能为空") | |||||
| private String code; | private String code; | ||||
| private Long id; | private Long id; | ||||
| @ApiModelProperty(value = "外键id") | @ApiModelProperty(value = "外键id") | ||||
| private String foreignId; | |||||
| private Long infoId; | |||||
| @ApiModelProperty(value = "链接名称") | @ApiModelProperty(value = "链接名称") | ||||
| private String reason; | private String reason; |
| import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.xdf.creative.base.params.QueryParam; | import com.xdf.creative.base.params.QueryParam; | ||||
| import com.xdf.creative.module.entity.InfoAttachment; | import com.xdf.creative.module.entity.InfoAttachment; | ||||
| import com.xdf.creative.module.entity.InfoBack; | |||||
| import com.xdf.creative.module.entity.InfoDetail; | import com.xdf.creative.module.entity.InfoDetail; | ||||
| import com.xdf.creative.module.entity.InfoUrl; | import com.xdf.creative.module.entity.InfoUrl; | ||||
| import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
| @ApiModelProperty(value = "初审人员") | @ApiModelProperty(value = "初审人员") | ||||
| private Long firstAuditUser; | private Long firstAuditUser; | ||||
| @ApiModelProperty(value = "初审人员姓名") | |||||
| private String firstAuditUserName; | |||||
| @ApiModelProperty(value = "初审时间") | @ApiModelProperty(value = "初审时间") | ||||
| private Date firstAuditTime; | private Date firstAuditTime; | ||||
| @ApiModelProperty(value = "终审人员") | @ApiModelProperty(value = "终审人员") | ||||
| private Long finalAuditUser; | private Long finalAuditUser; | ||||
| @ApiModelProperty(value = "终审人员姓名") | |||||
| private String finalAuditUserName; | |||||
| @ApiModelProperty(value = "终审时间") | @ApiModelProperty(value = "终审时间") | ||||
| private Date finalAuditTime; | private Date finalAuditTime; | ||||
| @ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除") | @ApiModelProperty(value = "逻辑删除,0:未删除,1:已删除") | ||||
| private Integer deleted; | private Integer deleted; | ||||
| /** | |||||
| * 类型名称 | |||||
| */ | |||||
| private List<String> typeNameArr; | |||||
| /** | /** | ||||
| * 信息详情 | * 信息详情 | ||||
| */ | */ | ||||
| private InfoDetail infoDetail; | private InfoDetail infoDetail; | ||||
| /** | |||||
| * 信息退回 | |||||
| */ | |||||
| private InfoBack infoBack; | |||||
| /** | /** | ||||
| * 附件列表 | * 附件列表 | ||||
| */ | */ | ||||
| * url列表 | * url列表 | ||||
| */ | */ | ||||
| private List<InfoUrl> urlList; | private List<InfoUrl> urlList; | ||||
| /** | |||||
| * 退回 | |||||
| */ | |||||
| } | } |
| @ApiModelProperty(value = "上下状态 0 下线 1上线") | @ApiModelProperty(value = "上下状态 0 下线 1上线") | ||||
| private Integer onlineType; | private Integer onlineType; | ||||
| /** | |||||
| * 退回内容 | |||||
| */ | |||||
| private String reason; | |||||
| /** | |||||
| * 退回时间 | |||||
| */ | |||||
| private String backTime; | |||||
| } | } |
| package com.xdf.creative.base.vo.creative; | package com.xdf.creative.base.vo.creative; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
| import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.experimental.Accessors; | import lombok.experimental.Accessors; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * <p> | * <p> | ||||
| @ApiModelProperty(value = "创建用户") | @ApiModelProperty(value = "创建用户") | ||||
| private Long createUserId; | private Long createUserId; | ||||
| /** | |||||
| * 用于构造树 | |||||
| */ | |||||
| @TableField(exist = false) | |||||
| protected List<InfoTypeQueryVo> children = new ArrayList<InfoTypeQueryVo>(); | |||||
| @TableField(exist = false) | |||||
| protected Boolean leaf; | |||||
| @TableField(exist = false) | |||||
| protected Boolean checked; | |||||
| } | } |
| package com.xdf.creative.config.xss; | package com.xdf.creative.config.xss; | ||||
| import com.xdf.creative.util.XssUtil; | |||||
| import org.apache.commons.io.IOUtils; | import org.apache.commons.io.IOUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.springframework.http.HttpHeaders; | import org.springframework.http.HttpHeaders; | ||||
| return super.getInputStream(); | return super.getInputStream(); | ||||
| } | } | ||||
| //xss过滤 | //xss过滤 | ||||
| json = xssEncode(json); | json = xssEncode(json); | ||||
| final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8")); | final ByteArrayInputStream bis = new ByteArrayInputStream(json.getBytes("utf-8")); | ||||
| } | } | ||||
| private String xssEncode(String input) { | private String xssEncode(String input) { | ||||
| return htmlFilter.filter(input); | |||||
| //return htmlFilter.filter(input); | |||||
| return XssUtil.stripSqlXss(input); | |||||
| } | } | ||||
| /** | /** |
| @JsonFormat(shape = JsonFormat.Shape.OBJECT) | @JsonFormat(shape = JsonFormat.Shape.OBJECT) | ||||
| public enum ServiceFileDirEnum { | public enum ServiceFileDirEnum { | ||||
| //0 banner 1 动态新闻 2活动 3专项资金 4政策导航 5 其他 | //0 banner 1 动态新闻 2活动 3专项资金 4政策导航 5 其他 | ||||
| SERVICE_FILE_DIR_PUBLIC_BANNER(0, "banner"), | |||||
| SERVICE_FILE_DIR_PUBLIC_BANNER(1, "banner"), | |||||
| //信息发布文件 | //信息发布文件 | ||||
| SERVICE_FILE_DIR_PUBLIC_DYNAMIC(1, "dynamic"), | |||||
| SERVICE_FILE_DIR_PUBLIC_NOTICE(2, "notice"), | |||||
| //信息发布文件 | |||||
| SERVICE_FILE_DIR_PUBLIC_DYNAMIC(3, "dynamic"), | |||||
| //区划信息 | |||||
| SERVICE_FILE_DIR_PUBLIC_DIVISION(7, "division"), | |||||
| //园区信息 | |||||
| SERVICE_FILE_DIR_PUBLIC_PARK(8, "park"), | |||||
| //活动发布图片 | //活动发布图片 | ||||
| SERVICE_FILE_DIR_PUBLIC_ACTIVITY(2, "activity"), | |||||
| //专项资金 | |||||
| SERVICE_FILE_DIR_SUPPORT(3, "support"), | |||||
| SERVICE_FILE_DIR_PUBLIC_ACTIVITY(9, "activity"), | |||||
| //文化速递 | |||||
| SERVICE_FILE_DIR_PUBLIC_EXPRESS(13, "express"), | |||||
| //政策导航 | //政策导航 | ||||
| SERVICE_FILE_DIR_POLICY(4, "policy "), | |||||
| SERVICE_FILE_DIR_POLICY(14, "policy "), | |||||
| //他山之石 | |||||
| SERVICE_FILE_DIR_STONE(19, "stone"), | |||||
| //专项资金 | |||||
| SERVICE_FILE_DIR_SUPPORT(22, "support"), | |||||
| //其他 | //其他 | ||||
| SERVICE_FILE_DIR_OTHER(5, "other"); | SERVICE_FILE_DIR_OTHER(5, "other"); | ||||
| package com.xdf.creative.module.controller; | package com.xdf.creative.module.controller; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.xdf.creative.base.controller.BaseController; | import com.xdf.creative.base.controller.BaseController; | ||||
| import com.xdf.creative.base.params.IdParam; | import com.xdf.creative.base.params.IdParam; | ||||
| import com.xdf.creative.base.params.creative.InfoBackQueryParam; | import com.xdf.creative.base.params.creative.InfoBackQueryParam; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import javax.validation.Valid; | import javax.validation.Valid; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * <p> | * <p> | ||||
| @Autowired | @Autowired | ||||
| private InfoBackService infoBackService; | private InfoBackService infoBackService; | ||||
| /** | |||||
| * 获取信息最新退回信息 | |||||
| */ | |||||
| @PostMapping("/getInfoBack") | |||||
| @ApiOperation(value = "获取InfoBack对象详情", notes = "查看信息退回", response = InfoBackQueryVo.class) | |||||
| public ApiResult getInfoBack(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
| List<InfoBack> infoBackList = infoBackService.list(new QueryWrapper<InfoBack>(). eq("info_id",idParam.getId()).orderByDesc("back_time")); | |||||
| if(infoBackList.size()>0){ | |||||
| return ApiResult.ok(infoBackList.get(0)); | |||||
| }else{ | |||||
| return ApiResult.ok(); | |||||
| } | |||||
| } | |||||
| /** | /** | ||||
| * 添加信息退回 | * 添加信息退回 | ||||
| */ | */ | ||||
| */ | */ | ||||
| @PostMapping("/info") | @PostMapping("/info") | ||||
| @ApiOperation(value = "获取InfoBack对象详情", notes = "查看信息退回", response = InfoBackQueryVo.class) | @ApiOperation(value = "获取InfoBack对象详情", notes = "查看信息退回", response = InfoBackQueryVo.class) | ||||
| public ApiResult<InfoBackQueryVo> getInfoBack(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
| public ApiResult<InfoBackQueryVo> info(@Valid @RequestBody IdParam idParam) throws Exception { | |||||
| InfoBackQueryVo infoBackQueryVo = infoBackService.getInfoBackById(idParam.getId()); | InfoBackQueryVo infoBackQueryVo = infoBackService.getInfoBackById(idParam.getId()); | ||||
| return ApiResult.ok(infoBackQueryVo); | return ApiResult.ok(infoBackQueryVo); | ||||
| } | } |
| import com.xdf.creative.support.aop.OperateLogger; | import com.xdf.creative.support.aop.OperateLogger; | ||||
| import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
| import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
| import com.xdf.creative.util.tree.TreeConfig; | |||||
| import com.xdf.creative.util.tree.Utils; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import javax.validation.Valid; | import javax.validation.Valid; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * <p> | * <p> | ||||
| /** | |||||
| * 栏目类型Tree列表 | |||||
| */ | |||||
| @PostMapping("/getInfoTypeTreeList") | |||||
| @ApiOperation(value = "获取栏目类型Tree列表", notes = "栏目类型Tree列表", response = InfoTypeQueryVo.class) | |||||
| public ApiResult getInfoTypeTreeList() throws Exception { | |||||
| List<Object> list =infoTypeService.getInfoTypeTreeList(); | |||||
| TreeConfig config = new TreeConfig("typeId", "typeParentId", "typeParentId", "0", ""); | |||||
| return ApiResult.ok(Utils.tree(list, config)); | |||||
| } | |||||
| /** | /** |
| import com.xdf.creative.base.params.creative.SysPermissionQueryParam; | import com.xdf.creative.base.params.creative.SysPermissionQueryParam; | ||||
| import com.xdf.creative.base.params.creative.SysRoleImpowerPermissionQueryParam; | import com.xdf.creative.base.params.creative.SysRoleImpowerPermissionQueryParam; | ||||
| import com.xdf.creative.base.vo.creative.SysPermissionQueryVo; | import com.xdf.creative.base.vo.creative.SysPermissionQueryVo; | ||||
| import com.xdf.creative.module.entity.InfoType; | |||||
| import com.xdf.creative.module.entity.SysPermission; | import com.xdf.creative.module.entity.SysPermission; | ||||
| import com.xdf.creative.module.service.SysPermissionService; | import com.xdf.creative.module.service.SysPermissionService; | ||||
| import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; |
| import com.xdf.creative.support.aop.AccountLogger; | import com.xdf.creative.support.aop.AccountLogger; | ||||
| import com.xdf.creative.support.aop.OperateLogger; | import com.xdf.creative.support.aop.OperateLogger; | ||||
| import com.xdf.creative.support.auth.LoginParam; | import com.xdf.creative.support.auth.LoginParam; | ||||
| import com.xdf.creative.support.auth.LoginRefreshParam; | |||||
| import com.xdf.creative.support.auth.LoginSysUserTokenVo; | import com.xdf.creative.support.auth.LoginSysUserTokenVo; | ||||
| import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
| import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
| return ApiResult.ok(loginSysUserTokenVo, "登陆成功"); | return ApiResult.ok(loginSysUserTokenVo, "登陆成功"); | ||||
| } | } | ||||
| @PostMapping("/refresh") | |||||
| @ApiOperation(value = "登陆", notes = "系统用户登陆", response = ApiResult.class) | |||||
| public ApiResult refresh(@Valid @RequestBody LoginRefreshParam loginRefreshParam, HttpServletResponse response) throws Exception { | |||||
| return sysUserService.refresh(loginRefreshParam); | |||||
| } | |||||
| /** | /** | ||||
| * 用户登出 | * 用户登出 | ||||
| * | * |
| private Long id; | private Long id; | ||||
| @ApiModelProperty(value = "外键id") | @ApiModelProperty(value = "外键id") | ||||
| private String foreignId; | |||||
| private Long infoId; | |||||
| @ApiModelProperty(value = "链接名称") | @ApiModelProperty(value = "链接名称") | ||||
| private String reason; | private String reason; |
| import org.springframework.stereotype.Repository; | import org.springframework.stereotype.Repository; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * <p> | * <p> | ||||
| */ | */ | ||||
| IPage<InfoTypeQueryVo> getInfoTypePageList(@Param("page") Page page, @Param("param") InfoTypeQueryParam infoTypeQueryParam); | IPage<InfoTypeQueryVo> getInfoTypePageList(@Param("page") Page page, @Param("param") InfoTypeQueryParam infoTypeQueryParam); | ||||
| /** | |||||
| * 获取类型资源树 | |||||
| * | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| List<Object> getInfoTypeTreeList() throws Exception; | |||||
| } | } |
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.xdf.creative.base.params.creative.SysPermissionQueryParam; | import com.xdf.creative.base.params.creative.SysPermissionQueryParam; | ||||
| import com.xdf.creative.base.vo.creative.SysPermissionQueryVo; | import com.xdf.creative.base.vo.creative.SysPermissionQueryVo; | ||||
| import com.xdf.creative.module.entity.InfoType; | |||||
| import com.xdf.creative.module.entity.SysPermission; | import com.xdf.creative.module.entity.SysPermission; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| import org.springframework.stereotype.Repository; | import org.springframework.stereotype.Repository; |
| import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * <p> | * <p> | ||||
| */ | */ | ||||
| InfoTypeQueryVo getInfoTypeById(Serializable id) throws Exception; | InfoTypeQueryVo getInfoTypeById(Serializable id) throws Exception; | ||||
| /** | |||||
| * 获取类型资源树 | |||||
| * | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| List<Object> getInfoTypeTreeList() throws Exception; | |||||
| /** | /** | ||||
| * 获取分页对象 | * 获取分页对象 | ||||
| * | * |
| import com.xdf.creative.base.params.creative.SysRoleImpowerPermissionQueryParam; | import com.xdf.creative.base.params.creative.SysRoleImpowerPermissionQueryParam; | ||||
| import com.xdf.creative.base.service.BaseService; | import com.xdf.creative.base.service.BaseService; | ||||
| import com.xdf.creative.base.vo.creative.SysPermissionQueryVo; | import com.xdf.creative.base.vo.creative.SysPermissionQueryVo; | ||||
| import com.xdf.creative.module.entity.InfoType; | |||||
| import com.xdf.creative.module.entity.SysPermission; | import com.xdf.creative.module.entity.SysPermission; | ||||
| import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
| import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; |
| import com.xdf.creative.base.vo.creative.SysUserQueryVo; | import com.xdf.creative.base.vo.creative.SysUserQueryVo; | ||||
| import com.xdf.creative.module.entity.SysUser; | import com.xdf.creative.module.entity.SysUser; | ||||
| import com.xdf.creative.support.auth.LoginParam; | import com.xdf.creative.support.auth.LoginParam; | ||||
| import com.xdf.creative.support.auth.LoginRefreshParam; | |||||
| import com.xdf.creative.support.auth.LoginSysUserTokenVo; | import com.xdf.creative.support.auth.LoginSysUserTokenVo; | ||||
| import com.xdf.creative.util.page.ApiResult; | import com.xdf.creative.util.page.ApiResult; | ||||
| import com.xdf.creative.util.page.PageTool; | import com.xdf.creative.util.page.PageTool; | ||||
| */ | */ | ||||
| LoginSysUserTokenVo login(LoginParam loginParam) throws Exception; | LoginSysUserTokenVo login(LoginParam loginParam) throws Exception; | ||||
| /** | |||||
| * 刷新token | |||||
| * @param loginRefreshParam | |||||
| * @return | |||||
| * @throws Exception | |||||
| */ | |||||
| ApiResult refresh(LoginRefreshParam loginRefreshParam) throws Exception; | |||||
| /** | /** | ||||
| * 添加用户 | * 添加用户 | ||||
| * @return | * @return |
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.stream.Collectors; | |||||
| /** | /** | ||||
| private InfoUrlService infoUrlService; | private InfoUrlService infoUrlService; | ||||
| @Autowired | @Autowired | ||||
| private InfoBackService infoBackService; | private InfoBackService infoBackService; | ||||
| @Autowired | |||||
| private InfoTypeService infoTypeService; | |||||
| @Autowired | |||||
| private SysUserService sysUserService; | |||||
| /** | /** | ||||
| * t添加信息内容 | * t添加信息内容 | ||||
| } | } | ||||
| infoContent.setCreateUser(getUserId()); | infoContent.setCreateUser(getUserId()); | ||||
| infoContent.setDeleted(StateEnum.DISABLE.getKey()); | infoContent.setDeleted(StateEnum.DISABLE.getKey()); | ||||
| infoContent.setState(InfoStateTypeEnum.INFO_STATE_TYPE_DRAFT.getCode()); | |||||
| if(InfoStateTypeEnum.INFO_STATE_TYPE_FIRST_AUDIT.getCode().equals(infoContentAddQueryParam.getSaveType())){ | |||||
| infoContent.setState(InfoStateTypeEnum.INFO_STATE_TYPE_FIRST_AUDIT.getCode()); | |||||
| infoContent.setSubmitTime(new Date()); | |||||
| }else if(InfoStateTypeEnum.INFO_STATE_TYPE_DRAFT.getCode().equals(infoContentAddQueryParam.getSaveType())){ | |||||
| infoContent.setState(InfoStateTypeEnum.INFO_STATE_TYPE_DRAFT.getCode()); | |||||
| } | |||||
| infoContent.setIstop(StateEnum.DISABLE.getKey()); | infoContent.setIstop(StateEnum.DISABLE.getKey()); | ||||
| infoContent.setOnlineType(StateEnum.ENABLE.getKey()); | infoContent.setOnlineType(StateEnum.ENABLE.getKey()); | ||||
| infoContent.setId((long) 0); | infoContent.setId((long) 0); | ||||
| } | } | ||||
| InfoContentAllQueryVo infoContentAllQueryVo = new InfoContentAllQueryVo(); | InfoContentAllQueryVo infoContentAllQueryVo = new InfoContentAllQueryVo(); | ||||
| BeanUtils.copyProperties(infoContent, infoContentAllQueryVo); | BeanUtils.copyProperties(infoContent, infoContentAllQueryVo); | ||||
| //获取初审人员姓名 | |||||
| if(null!=infoContent.getFirstAuditUser()) { | |||||
| SysUser userAudit = sysUserService.getById(infoContent.getFirstAuditUser()); | |||||
| infoContentAllQueryVo.setFirstAuditUserName(userAudit.getUsername()); | |||||
| } | |||||
| //获取终审人员姓名 | |||||
| if(null!=infoContent.getFinalAuditUser()){ | |||||
| SysUser userFinalAudit = sysUserService.getById(infoContent.getFinalAuditUser()); | |||||
| infoContentAllQueryVo.setFinalAuditUserName(userFinalAudit.getUsername()); | |||||
| } | |||||
| if (StringUtil.isNotEmpty(infoContent.getForeignId())) { | if (StringUtil.isNotEmpty(infoContent.getForeignId())) { | ||||
| InfoDetail infoDetail = infoDetailService.getOne(new QueryWrapper<InfoDetail>().eq("foreign_id", infoContent.getForeignId())); | InfoDetail infoDetail = infoDetailService.getOne(new QueryWrapper<InfoDetail>().eq("foreign_id", infoContent.getForeignId())); | ||||
| if (null != infoDetail) { | if (null != infoDetail) { | ||||
| infoContentAllQueryVo.setUrlList(infoUrlList); | infoContentAllQueryVo.setUrlList(infoUrlList); | ||||
| } | } | ||||
| } | } | ||||
| List<InfoBack> infoBackList = infoBackService.list(new QueryWrapper<InfoBack>(). | |||||
| eq("info_id",infoContent.getId()).orderByDesc("back_time")); | |||||
| if(infoBackList.size()>0){ | |||||
| infoContentAllQueryVo.setInfoBack(infoBackList.get(0)); | |||||
| } | |||||
| //获取类型 | |||||
| InfoType infoType = infoTypeService.getById(infoContent.getInfoTypeId()); | |||||
| if(null!=infoType){ | |||||
| List<String> selectTypeArray = new ArrayList<>(); | |||||
| int typeIdLength =infoType.getTypeId().length(); | |||||
| for(int i=0 ;i<typeIdLength/3;i++){ | |||||
| selectTypeArray.add(infoType.getTypeId().substring(0,3*(i+1))); | |||||
| } | |||||
| List<InfoType> infoTypeList = infoTypeService.list(new QueryWrapper<InfoType>().in("type_id",selectTypeArray).orderByAsc("type_id")); | |||||
| List<String> typeNameArr=infoTypeList.stream().map(InfoType::getInfoName).collect(Collectors.toList()); | |||||
| infoContentAllQueryVo.setTypeNameArr(typeNameArr); | |||||
| } | |||||
| return ApiResult.ok(infoContentAllQueryVo); | return ApiResult.ok(infoContentAllQueryVo); | ||||
| } | } | ||||
| return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | ||||
| } | } | ||||
| BeanUtils.copyProperties(infoContentAddQueryParam, infoContentNew); | BeanUtils.copyProperties(infoContentAddQueryParam, infoContentNew); | ||||
| infoContentNew.setUpdateTime(new Date()); | |||||
| InfoDetail infoDetail = infoContentAddQueryParam.getInfoDetail(); | InfoDetail infoDetail = infoContentAddQueryParam.getInfoDetail(); | ||||
| if (null != infoDetail) { | if (null != infoDetail) { | ||||
| if (StringUtil.isEmpty(infoContentNew.getForeignId())) { | if (StringUtil.isEmpty(infoContentNew.getForeignId())) { | ||||
| InfoBack infoBack = new InfoBack(); | InfoBack infoBack = new InfoBack(); | ||||
| infoBack.setBackTime(new Date()); | infoBack.setBackTime(new Date()); | ||||
| infoBack.setBackType(InfoBackTypeEnum.INFO_STATE_TYPE_AUDIT_BACK_FIRST.getCode()); | infoBack.setBackType(InfoBackTypeEnum.INFO_STATE_TYPE_AUDIT_BACK_FIRST.getCode()); | ||||
| infoBack.setForeignId(infoContent.getForeignId()); | |||||
| infoBack.setInfoId(infoContent.getId()); | |||||
| infoBack.setReason(infoContentAuditQueryParam.getBackIdea()); | infoBack.setReason(infoContentAuditQueryParam.getBackIdea()); | ||||
| infoBack.setCreateUser(getUserId()); | infoBack.setCreateUser(getUserId()); | ||||
| infoBackService.saveOrUpdate(infoBack); | infoBackService.saveOrUpdate(infoBack); | ||||
| InfoBack infoBack = new InfoBack(); | InfoBack infoBack = new InfoBack(); | ||||
| infoBack.setBackTime(new Date()); | infoBack.setBackTime(new Date()); | ||||
| infoBack.setBackType(InfoBackTypeEnum.INFO_STATE_TYPE_AUDIT_BACK_FINAL.getCode()); | infoBack.setBackType(InfoBackTypeEnum.INFO_STATE_TYPE_AUDIT_BACK_FINAL.getCode()); | ||||
| infoBack.setForeignId(infoContent.getForeignId()); | |||||
| infoBack.setInfoId(infoContent.getId()); | |||||
| infoBack.setReason(infoContentAuditQueryParam.getBackIdea()); | infoBack.setReason(infoContentAuditQueryParam.getBackIdea()); | ||||
| infoBack.setCreateUser(getUserId()); | infoBack.setCreateUser(getUserId()); | ||||
| infoBackService.saveOrUpdate(infoBack); | infoBackService.saveOrUpdate(infoBack); |
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| return infoTypeMapper.getInfoTypeById(id); | return infoTypeMapper.getInfoTypeById(id); | ||||
| } | } | ||||
| @Override | |||||
| public List<Object> getInfoTypeTreeList( ) throws Exception { | |||||
| return infoTypeMapper.getInfoTypeTreeList(); | |||||
| } | |||||
| @Override | @Override | ||||
| public PageTool<InfoTypeQueryVo> getInfoTypePageList(InfoTypeQueryParam infoTypeQueryParam) throws Exception { | public PageTool<InfoTypeQueryVo> getInfoTypePageList(InfoTypeQueryParam infoTypeQueryParam) throws Exception { | ||||
| Page page = setPageParam(infoTypeQueryParam); | Page page = setPageParam(infoTypeQueryParam); |
| } | } | ||||
| //删除角色下面用户的token | //删除角色下面用户的token | ||||
| List<SysUserRole> userRoleList = sysUserRoleService.list(new QueryWrapper<SysUserRole>().eq("role_id",sysRole.getId())); | List<SysUserRole> userRoleList = sysUserRoleService.list(new QueryWrapper<SysUserRole>().eq("role_id",sysRole.getId())); | ||||
| if(!oauthTokenService.removeTokenByUserList(userRoleList)){ | |||||
| log.error("角色变更授权,对应用户token未重置"); | |||||
| }; | |||||
| if(userRoleList.size()>0) { | |||||
| if (!oauthTokenService.removeTokenByUserList(userRoleList)) { | |||||
| log.error("角色变更授权,对应用户token未重置"); | |||||
| } | |||||
| } | |||||
| return ApiResult.ok(); | return ApiResult.ok(); | ||||
| } | } | ||||
| @Resource | @Resource | ||||
| private SysUserService sysUserService; | private SysUserService sysUserService; | ||||
| @Autowired | |||||
| @Resource | |||||
| private SysUserRoleService sysUserRoleService; | private SysUserRoleService sysUserRoleService; | ||||
| @Autowired | |||||
| private SysRoleService sysRoleService; | |||||
| /** | /** | ||||
| * 添加角色 | * 添加角色 | ||||
| * @param sysRoleQueryParam | * @param sysRoleQueryParam | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public ApiResult addSysRole(SysRoleQueryParam sysRoleQueryParam) { | public ApiResult addSysRole(SysRoleQueryParam sysRoleQueryParam) { | ||||
| List<SysRole> sysRoleManage =sysRoleService.list(new QueryWrapper<SysRole>().orderByDesc("id")); | |||||
| //取最大角色id | |||||
| SysRole sysRole = new SysRole(); | |||||
| BeanUtils.copyProperties(sysRoleQueryParam,sysRole); | |||||
| if (sysRoleManage.size() > 0) { | |||||
| sysRole.setCode("role"+sysRoleManage.get(0).getId()); | |||||
| }else{ | |||||
| sysRole.setCode("role1"); | |||||
| } | |||||
| try { | try { | ||||
| if (isExistsByCode(sysRoleQueryParam.getCode())) { | |||||
| if (isExistsByCode(sysRole.getCode())) { | |||||
| throw new BusinessException("角色编码已存在"); | throw new BusinessException("角色编码已存在"); | ||||
| } | } | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| return ApiResult.ok(StatusCode.SYS_USER_ROLE_EXIST); | |||||
| return ApiResult.error(StatusCode.SYS_USER_ROLE_EXIST); | |||||
| } | } | ||||
| SysRole sysRole = new SysRole(); | |||||
| BeanUtils.copyProperties(sysRoleQueryParam,sysRole); | |||||
| sysRole.setState(StateEnum.ENABLE.getKey()); | sysRole.setState(StateEnum.ENABLE.getKey()); | ||||
| sysRole.setType(StateEnum.ENABLE.getKey()); | sysRole.setType(StateEnum.ENABLE.getKey()); | ||||
| sysRole.setDeleted(StateEnum.DISABLE.getKey()); | sysRole.setDeleted(StateEnum.DISABLE.getKey()); | ||||
| } | } | ||||
| SysRole sysRole = this.getById(sysRoleQueryParam.getId()); | SysRole sysRole = this.getById(sysRoleQueryParam.getId()); | ||||
| if(null==sysRole){ | if(null==sysRole){ | ||||
| return ApiResult.ok(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
| return ApiResult.error(StatusCode.FORM_SUBMIT_UPDATE_VERIFY); | |||||
| } | } | ||||
| try { | |||||
| if (isExistsByCode(sysRoleQueryParam.getCode())) { | |||||
| return ApiResult.ok(StatusCode.SYS_USER_ROLE_EXIST); | |||||
| } | |||||
| } catch (Exception e) { | |||||
| return ApiResult.ok(StatusCode.SYS_USER_ROLE_EXIST); | |||||
| } | |||||
| BeanUtils.copyProperties(sysRoleQueryParam,sysRole); | |||||
| // try { | |||||
| // if (isExistsByCode(sysRoleQueryParam.getCode())) { | |||||
| // return ApiResult.ok(StatusCode.SYS_USER_ROLE_EXIST); | |||||
| // } | |||||
| // } catch (Exception e) { | |||||
| // return ApiResult.ok(StatusCode.SYS_USER_ROLE_EXIST); | |||||
| // } | |||||
| // BeanUtils.copyProperties(sysRoleQueryParam,sysRole); | |||||
| sysRole.setName(sysRoleQueryParam.getName()); | |||||
| sysRole.setRemark(sysRoleQueryParam.getRemark()); | |||||
| sysRole.setUpdateTime(new Date()); | sysRole.setUpdateTime(new Date()); | ||||
| this.saveOrUpdate(sysRole); | this.saveOrUpdate(sysRole); | ||||
| return ApiResult.ok(); | return ApiResult.ok(); |
| import com.xdf.creative.shiro.jwt.SaltUtil; | import com.xdf.creative.shiro.jwt.SaltUtil; | ||||
| import com.xdf.creative.support.aop.AccountLogger; | import com.xdf.creative.support.aop.AccountLogger; | ||||
| import com.xdf.creative.support.auth.LoginParam; | import com.xdf.creative.support.auth.LoginParam; | ||||
| import com.xdf.creative.support.auth.LoginRefreshParam; | |||||
| import com.xdf.creative.support.auth.LoginSysUserTokenVo; | import com.xdf.creative.support.auth.LoginSysUserTokenVo; | ||||
| import com.xdf.creative.support.auth.LoginSysUserVo; | import com.xdf.creative.support.auth.LoginSysUserVo; | ||||
| import com.xdf.creative.support.exception.BusinessException; | import com.xdf.creative.support.exception.BusinessException; | ||||
| return loginSysUserTokenVo; | return loginSysUserTokenVo; | ||||
| } | } | ||||
| @Override | |||||
| @Transactional | |||||
| public ApiResult refresh(LoginRefreshParam loginRefreshParam) throws Exception { | |||||
| SysUser sysUser = this.getById(loginRefreshParam.getUserId()); | |||||
| if(null==sysUser||StateEnum.DISABLE.getKey().equals(sysUser.getState())){ | |||||
| return ApiResult.fail("用户不存在或已被停用!"); | |||||
| } | |||||
| OauthTokenQueryVo oauthTokenOld =oauthTokenService.getOauthTokenByToken(loginRefreshParam.getToken()); | |||||
| if(null==oauthTokenOld||sysUser.getId().intValue()!=oauthTokenOld.getUserId().intValue()){ | |||||
| return ApiResult.fail("token验证失败!"); | |||||
| } | |||||
| // 获取数据库中保存的盐值 | |||||
| String newSalt = SaltUtil.getSalt(sysUser.getSalt(), jwtProperties); | |||||
| // 生成token字符串并返回 | |||||
| Long expireSecond = jwtProperties.getExpireSecond(); | |||||
| String token = JwtUtil.generateToken(sysUser.getId(), sysUser.getUsername(), sysUser.getOrganizeId(), sysUser.getUserType(), newSalt, Duration.ofSeconds(expireSecond)); | |||||
| oauthTokenService.removeTokenByUserId(sysUser.getId()); | |||||
| OauthToken oauthToken = new OauthToken(); | |||||
| oauthTokenService.removeTokenByUserId(sysUser.getId()); | |||||
| oauthToken.setAccessToken(token); | |||||
| //获取角色id、名称、code | |||||
| HashSet<Long> roleIdSet = new HashSet<>(); | |||||
| HashSet<String> roleNameSet = new HashSet<>(); | |||||
| HashSet<String> roleCodeSet = new HashSet<>(); | |||||
| List<SysRoleQueryVo> sysRoleQueryVoList = sysRoleService.getUserRoleByUserId(sysUser.getId()); | |||||
| if (CollectionUtil.isEmpty(sysRoleQueryVoList)) { | |||||
| log.error("角色不存在,用户id:"+sysUser.getId()); | |||||
| } | |||||
| sysRoleQueryVoList.stream().forEach(sysRoleQueryVo -> { | |||||
| roleIdSet.add(sysRoleQueryVo.getId()); | |||||
| roleNameSet.add(sysRoleQueryVo.getName()); | |||||
| roleCodeSet.add(sysRoleQueryVo.getCode()); | |||||
| }); | |||||
| if (!sysRoleQueryVoList.isEmpty()) { | |||||
| oauthToken.setRoles(roleCodeSet.toString()); | |||||
| } | |||||
| oauthToken.setRefreshToken(StateEnum.DISABLE.getKey()); | |||||
| oauthToken.setUserId(sysUser.getId()); | |||||
| oauthToken.setExpireTime(JwtUtil.getExpireDate(token)); | |||||
| oauthTokenService.save(oauthToken); | |||||
| return ApiResult.ok(token); | |||||
| } | |||||
| /** | /** | ||||
| * 添加用户 | * 添加用户 | ||||
| * @param sysUserAddQueryParam | * @param sysUserAddQueryParam | ||||
| } | } | ||||
| if(sysUser.getState().equals(StateEnum.ENABLE.getKey())){ | if(sysUser.getState().equals(StateEnum.ENABLE.getKey())){ | ||||
| sysUser.setState(StateEnum.DISABLE.getKey()); | sysUser.setState(StateEnum.DISABLE.getKey()); | ||||
| oauthTokenService.removeTokenByUserId(sysUser.getId()); | |||||
| }else{ | }else{ | ||||
| sysUser.setState(StateEnum.ENABLE.getKey()); | sysUser.setState(StateEnum.ENABLE.getKey()); | ||||
| } | } |
| @Override | @Override | ||||
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | ||||
| String token = request.getHeader("Authorization"); | String token = request.getHeader("Authorization"); | ||||
| if (null == token) { | |||||
| if (null == token||StringUtil.isEmpty(token)) { | |||||
| ApiResult result = new ApiResult(); | ApiResult result = new ApiResult(); | ||||
| result.setCode(ApiCode.TOKEN_INVALID.getCode()); | result.setCode(ApiCode.TOKEN_INVALID.getCode()); | ||||
| result.setMsg(ApiCode.TOKEN_INVALID.getMsg()); | result.setMsg(ApiCode.TOKEN_INVALID.getMsg()); |
| package com.xdf.creative.support.auth; | |||||
| import io.swagger.annotations.ApiModel; | |||||
| import io.swagger.annotations.ApiModelProperty; | |||||
| import lombok.Data; | |||||
| import javax.validation.constraints.NotBlank; | |||||
| import javax.validation.constraints.NotNull; | |||||
| /** | |||||
| * 登录参数 | |||||
| * | |||||
| * @author DeanYe | |||||
| * @date 2019-05-15 | |||||
| **/ | |||||
| @Data | |||||
| @ApiModel("登录参数") | |||||
| public class LoginRefreshParam { | |||||
| @ApiModelProperty("Token") | |||||
| @NotBlank(message = "token不能为空") | |||||
| private String token; | |||||
| @ApiModelProperty("userId") | |||||
| @NotNull(message = "userId不能为空") | |||||
| private Long userId; | |||||
| } |
| String uploadDir = ""; | String uploadDir = ""; | ||||
| switch (type) { | switch (type) { | ||||
| case 1: | case 1: | ||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_DYNAMIC.getName(); | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_BANNER.getName(); | |||||
| break; | break; | ||||
| case 2: | case 2: | ||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_ACTIVITY.getName(); | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_NOTICE.getName(); | |||||
| break; | break; | ||||
| case 3: | case 3: | ||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_SUPPORT.getName(); | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_DYNAMIC.getName(); | |||||
| break; | |||||
| case 7: | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_DIVISION.getName(); | |||||
| break; | break; | ||||
| case 4: | |||||
| case 8: | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_PARK.getName(); | |||||
| break; | |||||
| case 9: | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_ACTIVITY.getName(); | |||||
| break; | |||||
| case 13: | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_EXPRESS.getName(); | |||||
| break; | |||||
| case 14: | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_POLICY.getName(); | uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_POLICY.getName(); | ||||
| break; | break; | ||||
| case 19: | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_STONE.getName(); | |||||
| break; | |||||
| case 22: | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_SUPPORT.getName(); | |||||
| break; | |||||
| case 5: | case 5: | ||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | ||||
| break; | break; | ||||
| default: //可选 | default: //可选 | ||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_PUBLIC_BANNER.getName(); | |||||
| uploadDir = ServiceFileDirEnum.SERVICE_FILE_DIR_OTHER.getName(); | |||||
| } | } | ||||
| return uploadDir; | return uploadDir; | ||||
| } | } |
| package com.xdf.creative.util.tree; | package com.xdf.creative.util.tree; | ||||
| import com.xdf.creative.module.entity.InfoType; | |||||
| import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.StringUtils; | ||||
| import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.InvocationTargetException; |
| #upload_basePath=/mnt/dfzx/nfs01/dfzx_creative/ | |||||
| upload_basePath=D:/xdf_image/xdf/ | upload_basePath=D:/xdf_image/xdf/ | ||||
| tomcat: | tomcat: | ||||
| max-threads: 1000 | max-threads: 1000 | ||||
| min-spare-threads: 30 | min-spare-threads: 30 | ||||
| max-http-header-size: 8192 | |||||
| uri-encoding: utf-8 | uri-encoding: utf-8 | ||||
| platform: mysql | platform: mysql | ||||
| type: com.alibaba.druid.pool.DruidDataSource | type: com.alibaba.druid.pool.DruidDataSource | ||||
| url: jdbc:mysql://192.168.1.101:3306/creative_db?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true | url: jdbc:mysql://192.168.1.101:3306/creative_db?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true | ||||
| # url: jdbc:mysql://172.19.175.249:3306/creative_db?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true | |||||
| username: root | username: root | ||||
| password: 123456 | password: 123456 | ||||
| #password: SwNspCVZt7,S!6 | |||||
| druid: | druid: | ||||
| filter: | filter: | ||||
| slf4j: | slf4j: | ||||
| # 是否刷新token | # 是否刷新token | ||||
| refresh-token: true | refresh-token: true | ||||
| # 刷新token的时间间隔,默认10分钟,单位:秒 | # 刷新token的时间间隔,默认10分钟,单位:秒 | ||||
| refresh-token-countdown: 600 | |||||
| refresh-token-countdown: 3600 | |||||
| # redis校验jwt token是否存在,可选 | # redis校验jwt token是否存在,可选 | ||||
| redis-check: true | redis-check: true | ||||
| # true: 同一个账号只能是最后一次登陆token有效,false:同一个账号可多次登陆 | # true: 同一个账号只能是最后一次登陆token有效,false:同一个账号可多次登陆 |
| <!-- 通用查询结果列 --> | <!-- 通用查询结果列 --> | ||||
| <sql id="Base_Column_List"> | <sql id="Base_Column_List"> | ||||
| id, foreign_id, reason, back_type, create_user, back_time | |||||
| id, info_id, reason, back_type, create_user, back_time | |||||
| </sql> | </sql> | ||||
| <sql id="Base_If_Condition"> | <sql id="Base_If_Condition"> | ||||
| <if test="param.id !=null and param.id!=''"> | <if test="param.id !=null and param.id!=''"> | ||||
| and id=#{param.id} | and id=#{param.id} | ||||
| </if> | </if> | ||||
| <if test="param.foreignId !=null and param.foreignId!=''"> | |||||
| and foreign_id=#{param.foreignId} | |||||
| <if test="param.infoId !=null and param.infoId!=''"> | |||||
| and info_id=#{param.infoId} | |||||
| </if> | </if> | ||||
| <if test="param.reason !=null and param.reason!=''"> | <if test="param.reason !=null and param.reason!=''"> | ||||
| and reason=#{param.reason} | and reason=#{param.reason} |
| and ${alias}.id=#{param.id} | and ${alias}.id=#{param.id} | ||||
| </if> | </if> | ||||
| <if test="param.title !=null and param.title!=''"> | <if test="param.title !=null and param.title!=''"> | ||||
| and ${alias}.title like CONCAT('',#{param.title},'%') | |||||
| and ${alias}.title like CONCAT('%',#{param.title},'%') | |||||
| </if> | </if> | ||||
| <if test="param.state !=null and param.state!=''"> | <if test="param.state !=null and param.state!=''"> | ||||
| and ${alias}.state=#{param.state} | and ${alias}.state=#{param.state} | ||||
| <sql id="Base_User_If_Condition"> | <sql id="Base_User_If_Condition"> | ||||
| <if test="param.userName !=null and param.userName!=''"> | <if test="param.userName !=null and param.userName!=''"> | ||||
| and ${alias}.username like CONCAT('',#{param.userName},'%') | |||||
| and ${alias}.username like CONCAT('%',#{param.userName},'%') | |||||
| </if> | </if> | ||||
| <if test="param.nickName !=null and param.nickName!=''"> | <if test="param.nickName !=null and param.nickName!=''"> | ||||
| and ${alias}.nickname like CONCAT('',#{param.nickName},'%') | |||||
| and ${alias}.nickname like CONCAT('%',#{param.nickName},'%') | |||||
| </if> | </if> | ||||
| </sql> | </sql> | ||||
| <sql id="Base_Type_If_Condition"> | <sql id="Base_Type_If_Condition"> | ||||
| <if test="param.infoTypeId !=null and param.infoTypeId!=''"> | <if test="param.infoTypeId !=null and param.infoTypeId!=''"> | ||||
| and ${alias}.type_id =#{param.infoTypeId} | |||||
| and ${alias}.type_id like CONCAT('',#{param.infoTypeId},'%') | |||||
| </if> | </if> | ||||
| </sql> | </sql> | ||||
| select a.id,a.title,a.final_audit_time,a.sort,a.istop,a.istop_time,b.type_id,b.info_name from info_content a | select a.id,a.title,a.final_audit_time,a.sort,a.istop,a.istop_time,b.type_id,b.info_name from info_content a | ||||
| left join info_type b on a.info_type_id =b.id where a.deleted=0 and a.online_type=1 and a.state = 3 | left join info_type b on a.info_type_id =b.id where a.deleted=0 and a.online_type=1 and a.state = 3 | ||||
| <if test="param.typeId !=null and param.typeId!=''"> | <if test="param.typeId !=null and param.typeId!=''"> | ||||
| and b.type_id like CONCAT('%',#{param.typeId},'%') | |||||
| and b.type_id like CONCAT('',#{param.typeId},'%') | |||||
| </if> | </if> | ||||
| order by a.istop DESC,a.sort | order by a.istop DESC,a.sort | ||||
| DESC,a.final_audit_time ASC LIMIT #{param.contentSize} | DESC,a.final_audit_time ASC LIMIT #{param.contentSize} | ||||
| from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on a.info_type_id =b.id where | from info_content a left join info_detail c on a.foreign_id = c.foreign_id left join info_type b on a.info_type_id =b.id where | ||||
| a.deleted=0 and a.online_type=1 and a.state = 3 | a.deleted=0 and a.online_type=1 and a.state = 3 | ||||
| <if test="param.typeId !=null and param.typeId!=''"> | <if test="param.typeId !=null and param.typeId!=''"> | ||||
| and b.type_id like CONCAT('%',#{param.typeId},'%') | |||||
| and b.type_id like CONCAT('',#{param.typeId},'%') | |||||
| </if> | </if> | ||||
| <if test="param.title !=null and param.title!=''"> | <if test="param.title !=null and param.title!=''"> | ||||
| and ( a.title like CONCAT('%',#{param.title},'%') | and ( a.title like CONCAT('%',#{param.title},'%') | ||||
| </include>, | </include>, | ||||
| <include refid="Base_Type_Column_List"> | <include refid="Base_Type_Column_List"> | ||||
| <property name="alias" value="b"/> | <property name="alias" value="b"/> | ||||
| </include> | |||||
| </include>, | |||||
| d.reason,d.back_time | |||||
| from info_content a left join info_type b on a.info_type_id =b.id left join sys_user c on a.create_user = c.id | from info_content a left join info_type b on a.info_type_id =b.id left join sys_user c on a.create_user = c.id | ||||
| left join (select * from info_back order by back_time desc limit 1 )d on a.id =d.info_id | |||||
| <where> | <where> | ||||
| a.deleted = 0 | a.deleted = 0 | ||||
| <include refid="Base_If_Condition"> | <include refid="Base_If_Condition"> |
| from info_type where id = #{id} | from info_type where id = #{id} | ||||
| </select> | </select> | ||||
| <select id="getInfoTypeTreeList" resultType="com.xdf.creative.base.vo.creative.InfoTypeQueryVo"> | |||||
| select | |||||
| <include refid="Base_Column_List"/> | |||||
| from info_type order by type_id asc | |||||
| </select> | |||||
| <!--分页查询--> | <!--分页查询--> | ||||
| <select id="getInfoTypePageList" | <select id="getInfoTypePageList" | ||||
| resultType="com.xdf.creative.base.vo.creative.InfoTypeQueryVo" | resultType="com.xdf.creative.base.vo.creative.InfoTypeQueryVo" |
| and sr.deleted = 0 | and sr.deleted = 0 | ||||
| and sp.state = 1 | and sp.state = 1 | ||||
| and sp.deleted = 0 | and sp.deleted = 0 | ||||
| and sp.type =1 | |||||
| and sp.type =1 order by sp.resource_id asc | |||||
| </select> | </select> | ||||
| resultType="com.xdf.creative.module.entity.SysPermission"> | resultType="com.xdf.creative.module.entity.SysPermission"> | ||||
| select a.*,case when b.state =1 then 'true' else 'false' end as checked from sys_permission a | select a.*,case when b.state =1 then 'true' else 'false' end as checked from sys_permission a | ||||
| left join (select distinct permission_id,state from sys_role_permission where role_id = #{roleId})b | left join (select distinct permission_id,state from sys_role_permission where role_id = #{roleId})b | ||||
| on a.resource_id =b.permission_id where a.state = 1 and a.deleted = 0 and a.code <![CDATA[ <> ]]> "0" | |||||
| on a.resource_id =b.permission_id where a.state = 1 and a.deleted = 0 and a.code <![CDATA[ <> ]]> "0" order by a.resource_id asc | |||||
| </select> | </select> | ||||