提交 465775ae authored 作者: 吴德鹏's avatar 吴德鹏

举报管理

上级 ecfeb646
...@@ -6,6 +6,7 @@ import com.platform.service.ComplainService; ...@@ -6,6 +6,7 @@ import com.platform.service.ComplainService;
import com.platform.utils.PageUtils; import com.platform.utils.PageUtils;
import com.platform.utils.Query; import com.platform.utils.Query;
import com.platform.utils.R; import com.platform.utils.R;
import io.swagger.models.auth.In;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -107,4 +108,25 @@ public class ComplainController { ...@@ -107,4 +108,25 @@ public class ComplainController {
return R.ok().put("list", list); return R.ok().put("list", list);
} }
/**
* 修改状态
*
* @param id
* @param type
* @param archived
* @return 记录数
*/
@RequestMapping("/changeStatus")
@ResponseBody
public R changeStatus(@RequestParam("id") String id,
@RequestParam("type") Integer type,
@RequestParam("archived") Integer archived) {
int res = complainService.changeStatus(id, type, archived);
if (res > 0) {
return R.ok();
} else {
return R.error("操作失败");
}
}
} }
package com.platform.controller;
import com.platform.entity.DealEntity;
import com.platform.service.DealService;
import com.platform.utils.PageUtils;
import com.platform.utils.Query;
import com.platform.utils.R;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
import java.util.Map;
/**
* Controller
*
* @author lipengjun
* @date 2020-06-22 11:09:19
*/
@Controller
@RequestMapping("deal")
public class DealController {
@Autowired
private DealService dealService;
/**
* 查看列表
*/
@RequestMapping("/list")
@RequiresPermissions("deal:list")
@ResponseBody
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
Query query = new Query(params);
List<DealEntity> dealList = dealService.queryList(query);
int total = dealService.queryTotal(query);
PageUtils pageUtil = new PageUtils(dealList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
/**
* 查看信息
*/
@RequestMapping("/info/{id}")
@RequiresPermissions("deal:info")
@ResponseBody
public R info(@PathVariable("id") String id) {
DealEntity deal = dealService.queryObject(id);
return R.ok().put("deal", deal);
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("deal:save")
@ResponseBody
public R save(@RequestBody DealEntity deal) {
dealService.save(deal);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequiresPermissions("deal:update")
@ResponseBody
public R update(@RequestBody DealEntity deal) {
dealService.update(deal);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("deal:delete")
@ResponseBody
public R delete(@RequestBody String[] ids) {
dealService.deleteBatch(ids);
return R.ok();
}
/**
* 查看所有列表
*/
@RequestMapping("/queryAll")
@ResponseBody
public R queryAll(@RequestParam Map<String, Object> params) {
List<DealEntity> list = dealService.queryList(params);
return R.ok().put("list", list);
}
}
...@@ -2,6 +2,7 @@ package com.platform.dao; ...@@ -2,6 +2,7 @@ package com.platform.dao;
import com.platform.entity.ComplainEntity; import com.platform.entity.ComplainEntity;
import com.platform.entity.ComplainVo; import com.platform.entity.ComplainVo;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -16,4 +17,5 @@ public interface ComplainDao extends BaseDao<ComplainEntity> { ...@@ -16,4 +17,5 @@ public interface ComplainDao extends BaseDao<ComplainEntity> {
List<ComplainVo> queryComplainList(Map<String, Object> map); List<ComplainVo> queryComplainList(Map<String, Object> map);
int changeStatus(@Param("id") String id, @Param("archived") Integer archived);
} }
package com.platform.dao;
import com.platform.entity.DealEntity;
/**
* Dao
*
* @author lipengjun
* @date 2020-06-22 11:09:19
*/
public interface DealDao extends BaseDao<DealEntity> {
}
...@@ -5,132 +5,217 @@ import java.util.Date; ...@@ -5,132 +5,217 @@ import java.util.Date;
/** /**
* 实体 * 实体
* 表名 deal * 表名 comment
* *
* @author lipengjun * @author lipengjun
* @date 2020-06-22 11:09:19 * @date 2020-06-23 11:46:51
*/ */
public class DealEntity implements Serializable { public class CommentEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 处理ID *
*/ */
private String id; private String id;
/** /**
* 被处理人 *
*/ */
private String userId; private Integer archived;
/** /**
* 1:不处理 2:禁言 3:禁帖 4:禁言/禁帖 *
*/ */
private Integer result; private String archivedBy;
/** /**
* 处理人 *
*/ */
private String dealUserId; private Date archivedDate;
/** /**
* 处理原因 *
*/ */
private String reason; private Date createDate;
/** /**
* 创建时间 *
*/ */
private Date createTime; private String createdBy;
/** /**
* 更新时间 *
*/ */
private Date updateDate; private Date updateDate;
/**
*
*/
private String updatedBy;
/**
*
*/
private Integer version;
/**
*
*/
private String content;
/**
*
*/
private String postId;
/**
*
*/
private String userId;
/** /**
* 设置:处理ID * 设置:
*/ */
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
/** /**
* 获取:处理ID * 获取:
*/ */
public String getId() { public String getId() {
return id; return id;
} }
/** /**
* 设置:被处理人 * 设置:
*/ */
public void setUserId(String userId) { public void setArchived(Integer archived) {
this.userId = userId; this.archived = archived;
} }
/** /**
* 获取:被处理人 * 获取:
*/ */
public String getUserId() { public Integer getArchived() {
return userId; return archived;
} }
/** /**
* 设置:1:不处理 2:禁言 3:禁帖 4:禁言/禁帖 * 设置:
*/ */
public void setResult(Integer result) { public void setArchivedBy(String archivedBy) {
this.result = result; this.archivedBy = archivedBy;
} }
/** /**
* 获取:1:不处理 2:禁言 3:禁帖 4:禁言/禁帖 * 获取:
*/ */
public Integer getResult() { public String getArchivedBy() {
return result; return archivedBy;
} }
/** /**
* 设置:处理人 * 设置:
*/ */
public void setDealUserId(String dealUserId) { public void setArchivedDate(Date archivedDate) {
this.dealUserId = dealUserId; this.archivedDate = archivedDate;
} }
/** /**
* 获取:处理人 * 获取:
*/ */
public String getDealUserId() { public Date getArchivedDate() {
return dealUserId; return archivedDate;
} }
/** /**
* 设置:处理原因 * 设置:
*/ */
public void setReason(String reason) { public void setCreateDate(Date createDate) {
this.reason = reason; this.createDate = createDate;
} }
/** /**
* 获取:处理原因 * 获取:
*/ */
public String getReason() { public Date getCreateDate() {
return reason; return createDate;
} }
/** /**
* 设置:创建时间 * 设置:
*/ */
public void setCreateTime(Date createTime) { public void setCreatedBy(String createdBy) {
this.createTime = createTime; this.createdBy = createdBy;
} }
/** /**
* 获取:创建时间 * 获取:
*/ */
public Date getCreateTime() { public String getCreatedBy() {
return createTime; return createdBy;
} }
/** /**
* 设置:更新时间 * 设置:
*/ */
public void setUpdateDate(Date updateDate) { public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate; this.updateDate = updateDate;
} }
/** /**
* 获取:更新时间 * 获取:
*/ */
public Date getUpdateDate() { public Date getUpdateDate() {
return updateDate; return updateDate;
} }
/**
* 设置:
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* 获取:
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 设置:
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
* 获取:
*/
public Integer getVersion() {
return version;
}
/**
* 设置:
*/
public void setContent(String content) {
this.content = content;
}
/**
* 获取:
*/
public String getContent() {
return content;
}
/**
* 设置:
*/
public void setPostId(String postId) {
this.postId = postId;
}
/**
* 获取:
*/
public String getPostId() {
return postId;
}
/**
* 设置:
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* 获取:
*/
public String getUserId() {
return userId;
}
} }
...@@ -8,7 +8,7 @@ import java.util.Date; ...@@ -8,7 +8,7 @@ import java.util.Date;
* 表名 complain * 表名 complain
* *
* @author lipengjun * @author lipengjun
* @date 2020-06-19 16:57:10 * @date 2020-06-22 13:00:00
*/ */
public class ComplainEntity implements Serializable { public class ComplainEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -61,6 +61,10 @@ public class ComplainEntity implements Serializable { ...@@ -61,6 +61,10 @@ public class ComplainEntity implements Serializable {
* 帖子ID * 帖子ID
*/ */
private String postId; private String postId;
/**
* 状态 0:待审核 1:不处理 2:禁言 3:禁止发帖
*/
private Integer status;
/** /**
* 评论ID * 评论ID
*/ */
...@@ -70,35 +74,25 @@ public class ComplainEntity implements Serializable { ...@@ -70,35 +74,25 @@ public class ComplainEntity implements Serializable {
*/ */
private String replyId; private String replyId;
/** /**
* 举报 * 举报者ID
*/ */
private String userId; private String userId;
/** /**
* 状态 0:待审核 1:不处理 2:禁言 3:禁止发帖 * 被举报者ID
*/ */
private Integer status; private String complainUserId;
/** /**
* 被举报人 * 处理原因
*/ */
private String complainUserId; private String reason;
/**
public String getComplainUserId() { * 禁言时间
return complainUserId; */
} private Date speakTime;
/**
public void setComplainUserId(String complainUserId) { * 禁帖时间
this.complainUserId = complainUserId; */
} private Date postTime;
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
/** /**
* 设置:举报ID * 设置:举报ID
...@@ -113,7 +107,6 @@ public class ComplainEntity implements Serializable { ...@@ -113,7 +107,6 @@ public class ComplainEntity implements Serializable {
public String getId() { public String getId() {
return id; return id;
} }
/** /**
* 设置:举报类型 0:帖子 1:评论 2:回复 * 设置:举报类型 0:帖子 1:评论 2:回复
*/ */
...@@ -127,7 +120,6 @@ public class ComplainEntity implements Serializable { ...@@ -127,7 +120,6 @@ public class ComplainEntity implements Serializable {
public Integer getType() { public Integer getType() {
return type; return type;
} }
/** /**
* 设置:0:已删除 1:正常 * 设置:0:已删除 1:正常
*/ */
...@@ -141,7 +133,6 @@ public class ComplainEntity implements Serializable { ...@@ -141,7 +133,6 @@ public class ComplainEntity implements Serializable {
public Integer getArchived() { public Integer getArchived() {
return archived; return archived;
} }
/** /**
* 设置:删除人 * 设置:删除人
*/ */
...@@ -155,7 +146,6 @@ public class ComplainEntity implements Serializable { ...@@ -155,7 +146,6 @@ public class ComplainEntity implements Serializable {
public String getArchivedBy() { public String getArchivedBy() {
return archivedBy; return archivedBy;
} }
/** /**
* 设置:删除时间 * 设置:删除时间
*/ */
...@@ -169,7 +159,6 @@ public class ComplainEntity implements Serializable { ...@@ -169,7 +159,6 @@ public class ComplainEntity implements Serializable {
public Date getArchivedDate() { public Date getArchivedDate() {
return archivedDate; return archivedDate;
} }
/** /**
* 设置:创建时间 * 设置:创建时间
*/ */
...@@ -183,7 +172,6 @@ public class ComplainEntity implements Serializable { ...@@ -183,7 +172,6 @@ public class ComplainEntity implements Serializable {
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }
/** /**
* 设置:创建人 * 设置:创建人
*/ */
...@@ -197,7 +185,6 @@ public class ComplainEntity implements Serializable { ...@@ -197,7 +185,6 @@ public class ComplainEntity implements Serializable {
public String getCreatedBy() { public String getCreatedBy() {
return createdBy; return createdBy;
} }
/** /**
* 设置:更新时间 * 设置:更新时间
*/ */
...@@ -211,7 +198,6 @@ public class ComplainEntity implements Serializable { ...@@ -211,7 +198,6 @@ public class ComplainEntity implements Serializable {
public Date getUpdateDate() { public Date getUpdateDate() {
return updateDate; return updateDate;
} }
/** /**
* 设置:更新人 * 设置:更新人
*/ */
...@@ -225,7 +211,6 @@ public class ComplainEntity implements Serializable { ...@@ -225,7 +211,6 @@ public class ComplainEntity implements Serializable {
public String getUpdatedBy() { public String getUpdatedBy() {
return updatedBy; return updatedBy;
} }
/** /**
* 设置:版本 * 设置:版本
*/ */
...@@ -239,7 +224,6 @@ public class ComplainEntity implements Serializable { ...@@ -239,7 +224,6 @@ public class ComplainEntity implements Serializable {
public Integer getVersion() { public Integer getVersion() {
return version; return version;
} }
/** /**
* 设置:举报信息 * 设置:举报信息
*/ */
...@@ -253,7 +237,6 @@ public class ComplainEntity implements Serializable { ...@@ -253,7 +237,6 @@ public class ComplainEntity implements Serializable {
public String getDescription() { public String getDescription() {
return description; return description;
} }
/** /**
* 设置:帖子ID * 设置:帖子ID
*/ */
...@@ -267,7 +250,19 @@ public class ComplainEntity implements Serializable { ...@@ -267,7 +250,19 @@ public class ComplainEntity implements Serializable {
public String getPostId() { public String getPostId() {
return postId; return postId;
} }
/**
* 设置:状态 0:待审核 1:不处理 2:禁言 3:禁止发帖
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 获取:状态 0:待审核 1:不处理 2:禁言 3:禁止发帖
*/
public Integer getStatus() {
return status;
}
/** /**
* 设置:评论ID * 设置:评论ID
*/ */
...@@ -281,7 +276,6 @@ public class ComplainEntity implements Serializable { ...@@ -281,7 +276,6 @@ public class ComplainEntity implements Serializable {
public String getCommentId() { public String getCommentId() {
return commentId; return commentId;
} }
/** /**
* 设置:回复ID * 设置:回复ID
*/ */
...@@ -295,18 +289,69 @@ public class ComplainEntity implements Serializable { ...@@ -295,18 +289,69 @@ public class ComplainEntity implements Serializable {
public String getReplyId() { public String getReplyId() {
return replyId; return replyId;
} }
/** /**
* 设置:举报 * 设置:举报者ID
*/ */
public void setUserId(String userId) { public void setUserId(String userId) {
this.userId = userId; this.userId = userId;
} }
/** /**
* 获取:举报 * 获取:举报者ID
*/ */
public String getUserId() { public String getUserId() {
return userId; return userId;
} }
/**
* 设置:被举报者ID
*/
public void setComplainUserId(String complainUserId) {
this.complainUserId = complainUserId;
}
/**
* 获取:被举报者ID
*/
public String getComplainUserId() {
return complainUserId;
}
/**
* 设置:处理原因
*/
public void setReason(String reason) {
this.reason = reason;
}
/**
* 获取:处理原因
*/
public String getReason() {
return reason;
}
/**
* 设置:禁言时间
*/
public void setSpeakTime(Date speakTime) {
this.speakTime = speakTime;
}
/**
* 获取:禁言时间
*/
public Date getSpeakTime() {
return speakTime;
}
/**
* 设置:禁帖时间
*/
public void setPostTime(Date postTime) {
this.postTime = postTime;
}
/**
* 获取:禁帖时间
*/
public Date getPostTime() {
return postTime;
}
} }
...@@ -2,6 +2,8 @@ package com.platform.service; ...@@ -2,6 +2,8 @@ package com.platform.service;
import com.platform.entity.ComplainEntity; import com.platform.entity.ComplainEntity;
import com.platform.entity.ComplainVo; import com.platform.entity.ComplainVo;
import com.platform.utils.R;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -69,4 +71,14 @@ public interface ComplainService { ...@@ -69,4 +71,14 @@ public interface ComplainService {
* @return 删除条数 * @return 删除条数
*/ */
int deleteBatch(String[] ids); int deleteBatch(String[] ids);
/**
* 根据ID修改状态
*
* @param id
* @param type
* @param archived
* @return
*/
int changeStatus(String id, Integer type, Integer archived);
} }
package com.platform.service;
import com.platform.entity.DealEntity;
import java.util.List;
import java.util.Map;
/**
* Service接口
*
* @author lipengjun
* @date 2020-06-22 11:09:19
*/
public interface DealService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
DealEntity queryObject(String id);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<DealEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param deal 实体
* @return 保存条数
*/
int save(DealEntity deal);
/**
* 根据主键更新实体
*
* @param deal 实体
* @return 更新条数
*/
int update(DealEntity deal);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int delete(String id);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int deleteBatch(String[] ids);
}
...@@ -5,8 +5,6 @@ import com.platform.dao.PostDao; ...@@ -5,8 +5,6 @@ import com.platform.dao.PostDao;
import com.platform.dao.TbCfUserInfoDao; import com.platform.dao.TbCfUserInfoDao;
import com.platform.entity.ComplainEntity; import com.platform.entity.ComplainEntity;
import com.platform.entity.ComplainVo; import com.platform.entity.ComplainVo;
import com.platform.entity.PostEntity;
import com.platform.entity.TbCfUserInfoEntity;
import com.platform.service.ComplainService; import com.platform.service.ComplainService;
import com.platform.utils.IdUtil; import com.platform.utils.IdUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -14,7 +12,7 @@ import org.springframework.beans.BeanUtils; ...@@ -14,7 +12,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -37,7 +35,16 @@ public class ComplainServiceImpl implements ComplainService { ...@@ -37,7 +35,16 @@ public class ComplainServiceImpl implements ComplainService {
@Override @Override
public ComplainEntity queryObject(String id) { public ComplainEntity queryObject(String id) {
return complainDao.queryObject(id); ComplainEntity complainEntity = complainDao.queryObject(id);
ComplainVo complain = new ComplainVo();
BeanUtils.copyProperties(complainEntity, complain);
if ("1".equals(complain.getType())) {
//查询被举报的评论
} else if ("2".equals(complain.getType())) {
//查询被举报的回复信息
}
return complainEntity;
} }
@Override @Override
...@@ -66,7 +73,15 @@ public class ComplainServiceImpl implements ComplainService { ...@@ -66,7 +73,15 @@ public class ComplainServiceImpl implements ComplainService {
@Override @Override
public int update(ComplainEntity complain) { public int update(ComplainEntity complain) {
return complainDao.update(complain); ComplainEntity complainEntity = new ComplainEntity();
complainEntity.setId(complain.getId());
complainEntity.setStatus(complain.getStatus());
complainEntity.setVersion(complain.getVersion() + 1);
complainEntity.setReason(complain.getReason());
complainEntity.setSpeakTime(complain.getSpeakTime());
complainEntity.setPostTime(complain.getPostTime());
complainEntity.setUpdateDate(new Date());
return complainDao.update(complainEntity);
} }
@Override @Override
...@@ -78,4 +93,34 @@ public class ComplainServiceImpl implements ComplainService { ...@@ -78,4 +93,34 @@ public class ComplainServiceImpl implements ComplainService {
public int deleteBatch(String[] ids) { public int deleteBatch(String[] ids) {
return complainDao.deleteBatch(ids); return complainDao.deleteBatch(ids);
} }
/**
* ============================
* 类型(type)
* 0):帖子 1):评论 2):回复
* 状态(archived)
* 0):已删除 1):正常 2):下线
* ============================
*
* @param id
* @param type
* @param archived
* @return 修改记录数
*/
@Override
public int changeStatus(String id, Integer type, Integer archived) {
int res = 0;
//帖子
if ("0".equals(type.toString())) {
res = complainDao.changeStatus(id, archived);
} else if ("1".equals(type.toString())) {
//评论
res = complainDao.changeStatus(id, archived);
} else if ("2".equals(type.toString())) {
//回复
res = complainDao.changeStatus(id, archived);
}
return res;
}
} }
package com.platform.service.impl;
import com.platform.dao.DealDao;
import com.platform.entity.DealEntity;
import com.platform.service.DealService;
import com.platform.utils.IdUtil;
import com.platform.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Service实现类
*
* @author lipengjun
* @date 2020-06-22 11:09:19
*/
@Service("dealService")
public class DealServiceImpl implements DealService {
@Autowired
private DealDao dealDao;
@Override
public DealEntity queryObject(String id) {
return dealDao.queryObject(id);
}
@Override
public List<DealEntity> queryList(Map<String, Object> map) {
return dealDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return dealDao.queryTotal(map);
}
@Override
public int save(DealEntity deal) {
deal.setId(IdUtil.createIdbyUUID());
deal.setDealUserId(ShiroUtils.getUserId());
deal.setCreateTime(new Date());
deal.setUpdateDate(new Date());
return dealDao.save(deal);
}
@Override
public int update(DealEntity deal) {
deal.setUpdateDate(new Date());
return dealDao.update(deal);
}
@Override
public int delete(String id) {
return dealDao.delete(id);
}
@Override
public int deleteBatch(String[] ids) {
return dealDao.deleteBatch(ids);
}
}
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
<result property="userId" column="user_id"/> <result property="userId" column="user_id"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="complainUserId" column="complain_user_id"/> <result property="complainUserId" column="complain_user_id"/>
<result property="reason" column="reason"/>
<result property="speakTime" column="speak_time"/>
<result property="postTime" column="post_time"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="com.platform.entity.ComplainVo"> <select id="queryObject" resultType="com.platform.entity.ComplainVo">
...@@ -44,7 +47,10 @@ ...@@ -44,7 +47,10 @@
u1.nick complainByUser, u1.nick complainByUser,
p.caption caption, p.caption caption,
c.status, c.status,
complain_user_id c.complain_user_id,
c.reason,
c.`speak_time`,
c.`post_time`
from complain c from complain c
left join tb_cf_user_info u left join tb_cf_user_info u
on c.user_id=u.user_id on c.user_id=u.user_id
...@@ -117,7 +123,10 @@ ...@@ -117,7 +123,10 @@
u1.nick complainByUser, u1.nick complainByUser,
p.caption caption, p.caption caption,
c.status, c.status,
complain_user_id complain_user_id,
c.reason,
c.`speak_time`,
c.`post_time`
from complain c from complain c
left join tb_cf_user_info u left join tb_cf_user_info u
on c.user_id=u.user_id on c.user_id=u.user_id
...@@ -175,11 +184,14 @@ ...@@ -175,11 +184,14 @@
`version`, `version`,
`description`, `description`,
`post_id`, `post_id`,
`status`,
`comment_id`, `comment_id`,
`reply_id`, `reply_id`,
`user_id`, `user_id`,
status, `complain_user_id`,
complain_user_id) `reason`,
`speak_time`,
`post_time`)
values( values(
#{id}, #{id},
#{type}, #{type},
...@@ -193,11 +205,14 @@ ...@@ -193,11 +205,14 @@
#{version}, #{version},
#{description}, #{description},
#{postId}, #{postId},
#{status},
#{commentId}, #{commentId},
#{replyId}, #{replyId},
#{userId}, #{userId},
#{status}, #{complainUserId},
#{complainUserId}) #{reason},
#{speakTime},
#{postTime})
</insert> </insert>
<update id="update" parameterType="com.platform.entity.ComplainEntity"> <update id="update" parameterType="com.platform.entity.ComplainEntity">
...@@ -214,15 +229,24 @@ ...@@ -214,15 +229,24 @@
<if test="version != null">`version` = #{version},</if> <if test="version != null">`version` = #{version},</if>
<if test="description != null">`description` = #{description},</if> <if test="description != null">`description` = #{description},</if>
<if test="postId != null">`post_id` = #{postId},</if> <if test="postId != null">`post_id` = #{postId},</if>
<if test="status != null">`status` = #{status},</if>
<if test="commentId != null">`comment_id` = #{commentId},</if> <if test="commentId != null">`comment_id` = #{commentId},</if>
<if test="replyId != null">`reply_id` = #{replyId},</if> <if test="replyId != null">`reply_id` = #{replyId},</if>
<if test="userId != null">`user_id` = #{userId}</if> <if test="userId != null">`user_id` = #{userId},</if>
<if test="status != null">`status` = #{status}</if> <if test="complainUserId != null">`complain_user_id` = #{complainUserId},</if>
<if test="complainUserId != null">`complain_user_id` = #{complainUserId}</if> <if test="reason != null">`reason` = #{reason},</if>
<if test="speakTime != null">`speak_time` = #{speakTime},</if>
<if test="postTime != null">`post_time` = #{postTime}</if>
</set>
where id = #{id}
</update>
<update id="changeStatus" >
update complain
<set>
<if test="archived != null">`archived` = #{archived}</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
<delete id="delete"> <delete id="delete">
delete from complain where id = #{value} delete from complain where id = #{value}
</delete> </delete>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.DealDao">
<resultMap type="com.platform.entity.DealEntity" id="dealMap">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="result" column="result"/>
<result property="dealUserId" column="deal_user_id"/>
<result property="reason" column="reason"/>
<result property="createTime" column="create_time"/>
<result property="updateDate" column="update_date"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.DealEntity">
select
`id`,
`user_id`,
`result`,
`deal_user_id`,
`reason`,
`create_time`,
`update_date`
from deal
where id = #{id}
</select>
<select id="queryList" resultType="com.platform.entity.DealEntity">
select
`id`,
`user_id`,
`result`,
`deal_user_id`,
`reason`,
`create_time`,
`update_date`
from deal
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from deal
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.DealEntity">
insert into deal(
`id`,
`user_id`,
`result`,
`deal_user_id`,
`reason`,
`create_time`,
`update_date`)
values(
#{id},
#{userId},
#{result},
#{dealUserId},
#{reason},
#{createTime},
#{updateDate})
</insert>
<update id="update" parameterType="com.platform.entity.DealEntity">
update deal
<set>
<if test="userId != null">`user_id` = #{userId}, </if>
<if test="result != null">`result` = #{result}, </if>
<if test="dealUserId != null">`deal_user_id` = #{dealUserId}, </if>
<if test="reason != null">`reason` = #{reason}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="updateDate != null">`update_date` = #{updateDate}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from deal where id = #{value}
</delete>
<delete id="deleteBatch">
delete from deal where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -72,16 +72,18 @@ ...@@ -72,16 +72,18 @@
</Form-item> </Form-item>
<Form-item v-show="prohibitSpeak" label="禁言时间:"> <Form-item v-show="prohibitSpeak" label="禁言时间:">
<i-col span="12"> <i-col span="12">
<Date-picker type="datetime" placeholder="选择日期和时间" style="width: 200px"></Date-picker> <Date-picker type="datetime" v-model="complain.speakTime" placeholder="选择日期和时间"
style="width: 200px"></Date-picker>
</i-col> </i-col>
</Form-item> </Form-item>
<Form-item v-show="prohibitPost" label="禁帖时间:"> <Form-item v-show="prohibitPost" label="禁帖时间:">
<i-col span="12"> <i-col span="12">
<Date-picker type="datetime" placeholder="选择日期和时间" style="width: 200px"></Date-picker> <Date-picker type="datetime" v-model="complain.postTime" placeholder="选择日期和时间"
style="width: 200px"></Date-picker>
</i-col> </i-col>
</Form-item> </Form-item>
<Form-item label="处理原因:" prop="reason"> <Form-item label="处理原因:" prop="reason">
<textarea v-model="reason" style="width: 300px;height: 200px;"></textarea> <textarea v-model="complain.reason" style="width: 300px;height: 200px;"></textarea>
</Form-item> </Form-item>
</i-form> </i-form>
</Modal> </Modal>
......
...@@ -8,7 +8,16 @@ $(function () { ...@@ -8,7 +8,16 @@ $(function () {
{label: '举报信息', name: 'description', index: 'description', width: 80}, {label: '举报信息', name: 'description', index: 'description', width: 80},
{label: '举报人', name: 'complainUser', index: 'complainUser', width: 80}, {label: '举报人', name: 'complainUser', index: 'complainUser', width: 80},
{ {
label: '状态', name: 'status', index: 'status', width: 60, formatter: function (value, options, row) { label: '状态', name: 'archived', index: 'archived', width: 50, formatter: function (value, options, row) {
if (value === 1) {
return '<span class="label label-success">正常</span>'
} else if (value === 2) {
return '<span class="label label-warning">下线</span>'
}
}
},
{
label: '处理结果', name: 'status', index: 'status', width: 60, formatter: function (value, options, row) {
if (value === 0) { if (value === 0) {
return '<span class="label label-primary">待审核</span>' return '<span class="label label-primary">待审核</span>'
} else if (value === 1) { } else if (value === 1) {
...@@ -17,6 +26,8 @@ $(function () { ...@@ -17,6 +26,8 @@ $(function () {
return '<span class="label label-warning">禁止发言</span>' return '<span class="label label-warning">禁止发言</span>'
} else if (value === 3) { } else if (value === 3) {
return '<span class="label label-danger">禁止发帖</span>' return '<span class="label label-danger">禁止发帖</span>'
} else if (value === 4) {
return '<span class="label label-danger">禁止发言/发帖</span>'
} }
} }
...@@ -24,7 +35,9 @@ $(function () { ...@@ -24,7 +35,9 @@ $(function () {
{label: '创建时间', name: 'createDate', index: 'create_date', width: 80}, {label: '创建时间', name: 'createDate', index: 'create_date', width: 80},
{ {
label: '操作', index: 'operate', width: 80, formatter: function (value, grid, rows) { label: '操作', index: 'operate', width: 80, formatter: function (value, grid, rows) {
return '<span class="label label-info pointer" onclick="vm.audit(' + rows.id + ')">审核</span>'; return '<span class="label label-info pointer" onclick="vm.audit(' + rows.id + ')">审核</span>&nbsp;&nbsp;' +
'<span class="label label-warning pointer" onclick="vm.off(' + rows.id + ')" ">下线</span>&nbsp;&nbsp;' +
'<span class="label label-success pointer" onclick="vm.activate(' + rows.id + ')" ">激活</span>';
} }
}] }]
}); });
...@@ -34,6 +47,9 @@ $(function () { ...@@ -34,6 +47,9 @@ $(function () {
let vm = new Vue({ let vm = new Vue({
el: '#rrapp', el: '#rrapp',
data: { data: {
noSpeack: '',
noPost: '',
noDispose: '',
reason: '', reason: '',
prohibitSpeak: false, prohibitSpeak: false,
prohibitPost: false, prohibitPost: false,
...@@ -55,6 +71,28 @@ let vm = new Vue({ ...@@ -55,6 +71,28 @@ let vm = new Vue({
}, },
methods: { methods: {
off: function (id) {
let url = '../complain/changeStatus?id=' + id + '&type=0&archived=2';
Ajax.request({
url: url,
type: "POST",
contentType: "application/json",
successCallback: function (r) {
vm.reload();
}
});
},
activate: function (id) {
let url = '../complain/changeStatus?id=' + id + '&type=0&archived=1';
Ajax.request({
url: url,
type: "POST",
contentType: "application/json",
successCallback: function (r) {
vm.reload();
}
});
},
change: function () { change: function () {
let resArr = this.result; let resArr = this.result;
vm.prohibitSpeak = false; vm.prohibitSpeak = false;
...@@ -71,9 +109,33 @@ let vm = new Vue({ ...@@ -71,9 +109,33 @@ let vm = new Vue({
audit: function (id) { audit: function (id) {
vm.modal1 = true; vm.modal1 = true;
vm.getInfo(id); vm.getInfo(id);
}, },
deal: function () { deal: function () {
let url = "../complain/update";
let status = 1
if (vm.prohibitSpeak) {
status = 2
}
if (vm.prohibitPost) {
status = 3
}
if (vm.prohibitSpeak && vm.prohibitPost) {
status = 4
}
vm.complain.status = status;
console.log(123, vm.complain);
Ajax.request({
url: url,
params: JSON.stringify(vm.complain),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功')
vm.reload();
}
});
}, },
cancel: function () { cancel: function () {
...@@ -136,6 +198,23 @@ let vm = new Vue({ ...@@ -136,6 +198,23 @@ let vm = new Vue({
async: true, async: true,
successCallback: function (r) { successCallback: function (r) {
vm.complain = r.complain; vm.complain = r.complain;
let status = vm.complain.status;
vm.prohibitSpeak = false
vm.prohibitPost = false
vm.result = []
if (status === 1) {
vm.result = ['不处理']
} else if (status === 2) {
vm.result = ['禁止发言']
vm.prohibitSpeak = true;
} else if (status === 3) {
vm.result = ['禁止发帖']
vm.prohibitPost = true;
} else if (status === 4) {
vm.result = ['禁止发言', '禁止发帖']
vm.prohibitSpeak = true;
vm.prohibitPost = true;
}
} }
}); });
}, },
......
package com.platform.dao;
import com.platform.entity.ComplainEntity;
/**
* Dao
*
* @author lipengjun
* @date 2020-06-19 16:57:10
*/
public interface ComplainDao extends BaseDao<ComplainEntity> {
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论