2024.5.14 纪念馆新后台
This commit is contained in:
parent
d4df1bd230
commit
bdc336f8f9
|
@ -89,7 +89,7 @@ public class DoorController extends BaseController {
|
||||||
@ApiOperation("照片查询")
|
@ApiOperation("照片查询")
|
||||||
@PostMapping("/MaterialList")
|
@PostMapping("/MaterialList")
|
||||||
public TableDataInfo list() {
|
public TableDataInfo list() {
|
||||||
startPage();
|
// startPage();
|
||||||
List<CmsMaterial> list = materialMapper.selectCmsMaterialList(new CmsMaterial());
|
List<CmsMaterial> list = materialMapper.selectCmsMaterialList(new CmsMaterial());
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,9 +111,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
||||||
// 过滤请求
|
// 过滤请求
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||||
.antMatchers("/login", "/register", "/captchaImage").permitAll()
|
.antMatchers("/login", "/register", "/captchaImage","/door/**").permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**","/door/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||||
// 除上面外的所有请求全部需要鉴权认证
|
// 除上面外的所有请求全部需要鉴权认证
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.TreeEntity;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
@ -13,7 +14,7 @@ import java.util.List;
|
||||||
* @author libao
|
* @author libao
|
||||||
* @date 2024-05-09
|
* @date 2024-05-09
|
||||||
*/
|
*/
|
||||||
public class CmsCategory extends BaseEntity
|
public class CmsCategory extends TreeEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,17 @@ public class CmsMaterial extends BaseEntity
|
||||||
@Excel(name = "分组id")
|
@Excel(name = "分组id")
|
||||||
private String groupId;
|
private String groupId;
|
||||||
|
|
||||||
|
public String getGroupName() {
|
||||||
|
return groupName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupName(String groupName) {
|
||||||
|
this.groupName = groupName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 分组名称 */
|
||||||
|
private String groupName;//扩展
|
||||||
|
|
||||||
/** 素材名称 */
|
/** 素材名称 */
|
||||||
@Excel(name = "素材名称")
|
@Excel(name = "素材名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
|
@ -197,12 +197,12 @@ public class CmsArticleServiceImpl implements ICmsArticleService
|
||||||
newAticle.setTitle(cmsArticle.getTitle());
|
newAticle.setTitle(cmsArticle.getTitle());
|
||||||
newAticle.setAuthor(cmsArticle.getAuthor());
|
newAticle.setAuthor(cmsArticle.getAuthor());
|
||||||
newAticle.setDescription(cmsArticle.getDescription());
|
newAticle.setDescription(cmsArticle.getDescription());
|
||||||
cmsArticle.setYhid(user.getUserId().toString());
|
newAticle.setYhid(user.getUserId().toString());
|
||||||
cmsArticle.setDeleted(0);
|
newAticle.setDeleted(0);
|
||||||
cmsArticle.setTopFlag(1);
|
newAticle.setTopFlag(1);
|
||||||
cmsArticle.setAvailable(1);
|
newAticle.setAvailable(1);
|
||||||
cmsArticle.setPublishTime(DateUtils.getTime());
|
newAticle.setPublishTime(DateUtils.getTime());
|
||||||
cmsArticle.setCreateTime(DateUtils.getNowDate());
|
newAticle.setCreateTime(DateUtils.getNowDate());
|
||||||
newAticle.setCoverImage(cmsArticle.getCoverImage());
|
newAticle.setCoverImage(cmsArticle.getCoverImage());
|
||||||
cmsArticleMapper.insertCmsArticle(newAticle);
|
cmsArticleMapper.insertCmsArticle(newAticle);
|
||||||
CmsArticleContent cmsArticleContent = new CmsArticleContent();
|
CmsArticleContent cmsArticleContent = new CmsArticleContent();
|
||||||
|
@ -227,8 +227,10 @@ public class CmsArticleServiceImpl implements ICmsArticleService
|
||||||
public int updateCmsArticle(CmsArticle cmsArticle)
|
public int updateCmsArticle(CmsArticle cmsArticle)
|
||||||
{
|
{
|
||||||
cmsArticle.setUpdateTime(DateUtils.getNowDate());
|
cmsArticle.setUpdateTime(DateUtils.getNowDate());
|
||||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
if(SecurityUtils.getLoginUser().getUser() != null){
|
||||||
cmsArticle.setYhid(user.getUserId().toString());
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||||
|
cmsArticle.setYhid(user.getUserId().toString());
|
||||||
|
}
|
||||||
cmsArticle.setDeleted(0);
|
cmsArticle.setDeleted(0);
|
||||||
cmsArticle.setTopFlag(1);
|
cmsArticle.setTopFlag(1);
|
||||||
cmsArticle.setAvailable(1);
|
cmsArticle.setAvailable(1);
|
||||||
|
|
|
@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
|
<result property="parentName" column="parent_name" />
|
||||||
<result property="categoryTags" column="category_tags" />
|
<result property="categoryTags" column="category_tags" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
@ -35,11 +36,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="status != null "> and status = #{status}</if>
|
<if test="status != null "> and status = #{status}</if>
|
||||||
<if test="categoryTags != null and categoryTags != ''"> and category_tags = #{categoryTags}</if>
|
<if test="categoryTags != null and categoryTags != ''"> and category_tags = #{categoryTags}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by sort
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCmsCategoryByCategoryId" parameterType="Long" resultMap="CmsCategoryResult">
|
<!-- <select id="selectCmsCategoryByCategoryId" parameterType="Long" resultMap="CmsCategoryResult">-->
|
||||||
<include refid="selectCmsCategoryVo"/>
|
<!-- <include refid="selectCmsCategoryVo"/>-->
|
||||||
where category_id = #{categoryId}
|
<!-- where category_id = #{categoryId}-->
|
||||||
|
<!-- </select>-->
|
||||||
|
<select id="selectCmsCategoryByCategoryId" resultMap="CmsCategoryResult">
|
||||||
|
select t.category_id, t.category_name, t.parent_id, t.ancestors, t.sort, t.description, t.create_time, t.update_time, t.create_by, t.update_by, t.status, t.del_flag, p.category_name as parent_name
|
||||||
|
from cms_category t
|
||||||
|
left join cms_category p on p.category_id = t.parent_id
|
||||||
|
where t.category_id = #{categoryId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertCmsCategory" parameterType="CmsCategory" useGeneratedKeys="true" keyProperty="categoryId">
|
<insert id="insertCmsCategory" parameterType="CmsCategory" useGeneratedKeys="true" keyProperty="categoryId">
|
||||||
|
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<resultMap type="CmsMaterial" id="CmsMaterialResult">
|
<resultMap type="CmsMaterial" id="CmsMaterialResult">
|
||||||
<result property="materialId" column="material_id" />
|
<result property="materialId" column="material_id" />
|
||||||
<result property="groupId" column="group_id" />
|
<result property="groupId" column="group_id" />
|
||||||
|
<result property="groupName" column="group_name" />
|
||||||
<result property="materialName" column="material_name" />
|
<result property="materialName" column="material_name" />
|
||||||
<result property="materialType" column="material_type" />
|
<result property="materialType" column="material_type" />
|
||||||
<result property="description" column="description" />
|
<result property="description" column="description" />
|
||||||
|
@ -24,26 +25,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectCmsMaterialVo">
|
<sql id="selectCmsMaterialVo">
|
||||||
select material_id, group_id, material_name, material_type, description, material_size, save_path, thumbnail, audit_state, audit_reason, use_state, width, height, uploader_id, upload_time, remark from cms_material
|
select a.material_id,
|
||||||
|
a.group_id,
|
||||||
|
b.group_name,
|
||||||
|
a.material_name,
|
||||||
|
a.material_type,
|
||||||
|
a.description,
|
||||||
|
a.material_size,
|
||||||
|
a.save_path,
|
||||||
|
a.thumbnail,
|
||||||
|
a.audit_state,
|
||||||
|
a.audit_reason,
|
||||||
|
a.use_state,
|
||||||
|
a.width,
|
||||||
|
a.height,
|
||||||
|
a.uploader_id,
|
||||||
|
a.upload_time,
|
||||||
|
a.remark
|
||||||
|
from cms_material a
|
||||||
|
inner join cms_material_group b on a.group_id = b.group_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectCmsMaterialList" parameterType="CmsMaterial" resultMap="CmsMaterialResult">
|
<select id="selectCmsMaterialList" parameterType="CmsMaterial" resultMap="CmsMaterialResult">
|
||||||
<include refid="selectCmsMaterialVo"/>
|
<include refid="selectCmsMaterialVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="groupId != null and groupId != ''"> and group_id = #{groupId}</if>
|
<if test="groupId != null and groupId != ''"> and a.group_id = #{groupId}</if>
|
||||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
<if test="materialName != null and materialName != ''"> and a.material_name like concat('%', #{materialName}, '%')</if>
|
||||||
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
|
<if test="materialType != null and materialType != ''"> and a.material_type = #{materialType}</if>
|
||||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
<if test="auditState != null and auditState != ''"> and a.audit_state = #{auditState}</if>
|
||||||
<if test="materialSize != null and materialSize != ''"> and material_size = #{materialSize}</if>
|
<if test="useState != null and useState != ''"> and a.use_state = #{useState}</if>
|
||||||
<if test="savePath != null and savePath != ''"> and save_path = #{savePath}</if>
|
<!-- 数据范围过滤 -->
|
||||||
<if test="thumbnail != null and thumbnail != ''"> and thumbnail = #{thumbnail}</if>
|
${params.dataScope}
|
||||||
<if test="auditState != null and auditState != ''"> and audit_state = #{auditState}</if>
|
|
||||||
<if test="auditReason != null and auditReason != ''"> and audit_reason = #{auditReason}</if>
|
|
||||||
<if test="useState != null and useState != ''"> and use_state = #{useState}</if>
|
|
||||||
<if test="width != null and width != ''"> and width = #{width}</if>
|
|
||||||
<if test="height != null and height != ''"> and height = #{height}</if>
|
|
||||||
<if test="uploaderId != null and uploaderId != ''"> and uploader_id = #{uploaderId}</if>
|
|
||||||
<if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue