提交 61b68f3e authored 作者: zgy's avatar zgy

完成商品评论、回复等功能

上级 0bcf3d29
package com.platform.controller;
import com.platform.entity.TbCfItemCommentEntity;
import com.platform.service.TbCfItemCommentService;
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 2019-11-18 14:31:39
*/
@Controller
@RequestMapping("tbcfitemcomment")
public class TbCfItemCommentController {
@Autowired
private TbCfItemCommentService tbCfItemCommentService;
/**
* 查看列表
*/
@RequestMapping("/list")
@RequiresPermissions("tbcfitemcomment:list")
@ResponseBody
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
Query query = new Query(params);
List<TbCfItemCommentEntity> tbCfItemCommentList = tbCfItemCommentService.queryList(query);
int total = tbCfItemCommentService.queryTotal(query);
PageUtils pageUtil = new PageUtils(tbCfItemCommentList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
/**
* 查看信息
*/
@RequestMapping("/info/{id}")
@RequiresPermissions("tbcfitemcomment:info")
@ResponseBody
public R info(@PathVariable("id") String id) {
TbCfItemCommentEntity tbCfItemComment = tbCfItemCommentService.queryObject(id);
return R.ok().put("tbCfItemComment", tbCfItemComment);
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("tbcfitemcomment:save")
@ResponseBody
public R save(@RequestBody TbCfItemCommentEntity tbCfItemComment) {
tbCfItemCommentService.save(tbCfItemComment);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequiresPermissions("tbcfitemcomment:update")
@ResponseBody
public R update(@RequestBody TbCfItemCommentEntity tbCfItemComment) {
tbCfItemCommentService.update(tbCfItemComment);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("tbcfitemcomment:delete")
@ResponseBody
public R delete(@RequestBody String[] ids) {
tbCfItemCommentService.deleteBatch(ids);
return R.ok();
}
/**
* 查看所有列表
*/
@RequestMapping("/queryAll")
@ResponseBody
public R queryAll(@RequestParam Map<String, Object> params) {
List<TbCfItemCommentEntity> list = tbCfItemCommentService.queryList(params);
return R.ok().put("list", list);
}
}
package com.platform.controller;
import com.platform.entity.TbCfReplyEntity;
import com.platform.service.TbCfReplyService;
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 2019-11-18 15:10:45
*/
@Controller
@RequestMapping("tbcfreply")
public class TbCfReplyController {
@Autowired
private TbCfReplyService tbCfReplyService;
/**
* 查看列表
*/
@RequestMapping("/list")
@RequiresPermissions("tbcfreply:list")
@ResponseBody
public R list(@RequestParam Map<String, Object> params) {
//查询列表数据
Query query = new Query(params);
List<TbCfReplyEntity> tbCfReplyList = tbCfReplyService.queryList(query);
int total = tbCfReplyService.queryTotal(query);
PageUtils pageUtil = new PageUtils(tbCfReplyList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
/**
* 查看信息
*/
@RequestMapping("/info/{id}")
@RequiresPermissions("tbcfreply:info")
@ResponseBody
public R info(@PathVariable("id") String id) {
TbCfReplyEntity tbCfReply = tbCfReplyService.queryObject(id);
return R.ok().put("tbCfReply", tbCfReply);
}
/**
* 保存
*/
@RequestMapping("/save")
@RequiresPermissions("tbcfreply:save")
@ResponseBody
public R save(@RequestBody TbCfReplyEntity tbCfReply) {
tbCfReplyService.save(tbCfReply);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@RequiresPermissions("tbcfreply:update")
@ResponseBody
public R update(@RequestBody TbCfReplyEntity tbCfReply) {
tbCfReplyService.update(tbCfReply);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
@RequiresPermissions("tbcfreply:delete")
@ResponseBody
public R delete(@RequestBody String[] ids) {
tbCfReplyService.deleteBatch(ids);
return R.ok();
}
/**
* 查看所有列表
*/
@RequestMapping("/queryAll")
@ResponseBody
public R queryAll(@RequestParam Map<String, Object> params) {
List<TbCfReplyEntity> list = tbCfReplyService.queryList(params);
return R.ok().put("list", list);
}
}
package com.platform.dao;
import com.platform.entity.TbCfItemCommentEntity;
/**
* Dao
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
public interface TbCfItemCommentDao extends BaseDao<TbCfItemCommentEntity> {
}
package com.platform.dao;
import com.platform.entity.TbCfReplyEntity;
/**
* Dao
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
public interface TbCfReplyDao extends BaseDao<TbCfReplyEntity> {
}
package com.platform.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 实体
* 表名 tb_cf_item_comment
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
public class TbCfItemCommentEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 商品评论ID
*/
private String id;
/**
* 评论人
*/
private String userId;
/**
* 订单ID
*/
private String orderId;
/**
* 商品ID
*/
private String itemId;
/**
* 商品评分
*/
private Integer itemScore;
/**
* 服务评分
*/
private Integer serviceScore;
/**
* 物流评分
*/
private Integer logisticsScore;
/**
* 价格评分
*/
private Integer priceScore;
/**
* 商品评论
*/
private String itemReview;
/**
* 点赞人数
*/
private Long likeNum;
/**
* 删除标志 0:正常 1:已删除
*/
private Integer delFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 回复时间
*/
private Date updateTime;
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
/**
* 设置:商品评论ID
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取:商品评论ID
*/
public String getId() {
return id;
}
/**
* 设置:评论人
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* 获取:评论人
*/
public String getUserId() {
return userId;
}
/**
* 设置:订单ID
*/
public void setOrderId(String orderId) {
this.orderId = orderId;
}
/**
* 获取:订单ID
*/
public String getOrderId() {
return orderId;
}
/**
* 设置:商品ID
*/
public void setItemId(String itemId) {
this.itemId = itemId;
}
/**
* 获取:商品ID
*/
public String getItemId() {
return itemId;
}
/**
* 设置:商品评分
*/
public void setItemScore(Integer itemScore) {
this.itemScore = itemScore;
}
/**
* 获取:商品评分
*/
public Integer getItemScore() {
return itemScore;
}
/**
* 设置:服务评分
*/
public void setServiceScore(Integer serviceScore) {
this.serviceScore = serviceScore;
}
/**
* 获取:服务评分
*/
public Integer getServiceScore() {
return serviceScore;
}
/**
* 设置:物流评分
*/
public void setLogisticsScore(Integer logisticsScore) {
this.logisticsScore = logisticsScore;
}
/**
* 获取:物流评分
*/
public Integer getLogisticsScore() {
return logisticsScore;
}
/**
* 设置:价格评分
*/
public void setPriceScore(Integer priceScore) {
this.priceScore = priceScore;
}
/**
* 获取:价格评分
*/
public Integer getPriceScore() {
return priceScore;
}
/**
* 设置:商品评论
*/
public void setItemReview(String itemReview) {
this.itemReview = itemReview;
}
/**
* 获取:商品评论
*/
public String getItemReview() {
return itemReview;
}
/**
* 设置:点赞人数
*/
public void setLikeNum(Long likeNum) {
this.likeNum = likeNum;
}
/**
* 获取:点赞人数
*/
public Long getLikeNum() {
return likeNum;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
/**
* 获取:删除标志 0:正常 1:已删除
*/
public Integer getDelFlag() {
return delFlag;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
package com.platform.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 实体
* 表名 tb_cf_reply
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
public class TbCfReplyEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 回复ID
*/
private String id;
/**
* 回复类型 0:商品 1:社区
*/
private Integer replyType;
/**
* 评论ID
*/
private String commentId;
/**
* 回复人
*/
private String userId;
/**
* 回复对象
*/
private String toUserId;
/**
* 回复内容
*/
private String replyMessage;
/**
* 删除标志 0:正常 1:已删除
*/
private Integer delFlag;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 设置:回复ID
*/
public void setId(String id) {
this.id = id;
}
/**
* 获取:回复ID
*/
public String getId() {
return id;
}
/**
* 设置:回复类型 0:商品 1:社区
*/
public void setReplyType(Integer replyType) {
this.replyType = replyType;
}
/**
* 获取:回复类型 0:商品 1:社区
*/
public Integer getReplyType() {
return replyType;
}
/**
* 设置:评论ID
*/
public void setCommentId(String commentId) {
this.commentId = commentId;
}
/**
* 获取:评论ID
*/
public String getCommentId() {
return commentId;
}
/**
* 设置:回复人
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* 获取:回复人
*/
public String getUserId() {
return userId;
}
/**
* 设置:回复对象
*/
public void setToUserId(String toUserId) {
this.toUserId = toUserId;
}
/**
* 获取:回复对象
*/
public String getToUserId() {
return toUserId;
}
/**
* 设置:回复内容
*/
public void setReplyMessage(String replyMessage) {
this.replyMessage = replyMessage;
}
/**
* 获取:回复内容
*/
public String getReplyMessage() {
return replyMessage;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
public void setDelFlag(Integer delFlag) {
this.delFlag = delFlag;
}
/**
* 获取:删除标志 0:正常 1:已删除
*/
public Integer getDelFlag() {
return delFlag;
}
/**
* 设置:创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 设置:更新时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* 获取:更新时间
*/
public Date getUpdateTime() {
return updateTime;
}
}
package com.platform.service;
import com.platform.entity.TbCfItemCommentEntity;
import java.util.List;
import java.util.Map;
/**
* Service接口
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
public interface TbCfItemCommentService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfItemCommentEntity queryObject(String id);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<TbCfItemCommentEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param tbCfItemComment 实体
* @return 保存条数
*/
int save(TbCfItemCommentEntity tbCfItemComment);
/**
* 根据主键更新实体
*
* @param tbCfItemComment 实体
* @return 更新条数
*/
int update(TbCfItemCommentEntity tbCfItemComment);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int delete(String id);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int deleteBatch(String[] ids);
}
package com.platform.service;
import com.platform.entity.TbCfReplyEntity;
import java.util.List;
import java.util.Map;
/**
* Service接口
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
public interface TbCfReplyService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfReplyEntity queryObject(String id);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<TbCfReplyEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param tbCfReply 实体
* @return 保存条数
*/
int save(TbCfReplyEntity tbCfReply);
/**
* 根据主键更新实体
*
* @param tbCfReply 实体
* @return 更新条数
*/
int update(TbCfReplyEntity tbCfReply);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int delete(String id);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int deleteBatch(String[] ids);
}
package com.platform.service.impl;
import com.platform.dao.TbCfItemCommentDao;
import com.platform.entity.TbCfItemCommentEntity;
import com.platform.service.TbCfItemCommentService;
import com.platform.utils.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Service实现类
*
* @author lipengjun
* @date 2019-11-18 14:31:39
*/
@Service("tbCfItemCommentService")
public class TbCfItemCommentServiceImpl implements TbCfItemCommentService {
@Autowired
private TbCfItemCommentDao tbCfItemCommentDao;
@Override
public TbCfItemCommentEntity queryObject(String id) {
return tbCfItemCommentDao.queryObject(id);
}
@Override
public List<TbCfItemCommentEntity> queryList(Map<String, Object> map) {
return tbCfItemCommentDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return tbCfItemCommentDao.queryTotal(map);
}
@Override
public int save(TbCfItemCommentEntity tbCfItemComment) {
tbCfItemComment.setId(IdUtil.createIdbyUUID());
return tbCfItemCommentDao.save(tbCfItemComment);
}
@Override
public int update(TbCfItemCommentEntity tbCfItemComment) {
return tbCfItemCommentDao.update(tbCfItemComment);
}
@Override
public int delete(String id) {
return tbCfItemCommentDao.delete(id);
}
@Override
public int deleteBatch(String[] ids) {
return tbCfItemCommentDao.deleteBatch(ids);
}
}
package com.platform.service.impl;
import com.platform.dao.TbCfReplyDao;
import com.platform.entity.TbCfReplyEntity;
import com.platform.service.TbCfReplyService;
import com.platform.utils.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Service实现类
*
* @author lipengjun
* @date 2019-11-18 15:10:45
*/
@Service("tbCfReplyService")
public class TbCfReplyServiceImpl implements TbCfReplyService {
@Autowired
private TbCfReplyDao tbCfReplyDao;
@Override
public TbCfReplyEntity queryObject(String id) {
return tbCfReplyDao.queryObject(id);
}
@Override
public List<TbCfReplyEntity> queryList(Map<String, Object> map) {
return tbCfReplyDao.queryList(map);
}
@Override
public int queryTotal(Map<String, Object> map) {
return tbCfReplyDao.queryTotal(map);
}
@Override
public int save(TbCfReplyEntity tbCfReply) {
tbCfReply.setId(IdUtil.createIdbyUUID());
return tbCfReplyDao.save(tbCfReply);
}
@Override
public int update(TbCfReplyEntity tbCfReply) {
return tbCfReplyDao.update(tbCfReply);
}
@Override
public int delete(String id) {
return tbCfReplyDao.delete(id);
}
@Override
public int deleteBatch(String[] ids) {
return tbCfReplyDao.deleteBatch(ids);
}
}
<?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.TbCfItemCommentDao">
<resultMap type="com.platform.entity.TbCfItemCommentEntity" id="tbCfItemCommentMap">
<result property="id" column="id"/>
<result property="userId" column="user_id"/>
<result property="orderId" column="order_id"/>
<result property="itemId" column="item_id"/>
<result property="itemScore" column="item_score"/>
<result property="serviceScore" column="service_score"/>
<result property="logisticsScore" column="logistics_score"/>
<result property="priceScore" column="price_score"/>
<result property="itemReview" column="item_review"/>
<result property="likeNum" column="like_num"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="username" column="nick"></result>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfItemCommentEntity">
select
`id`,
`user_id`,
`order_id`,
`item_id`,
`item_score`,
`service_score`,
`logistics_score`,
`price_score`,
`item_review`,
`like_num`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_item_comment
where id = #{id}
</select>
<select id="queryList" resultMap="tbCfItemCommentMap">
select
c.id,
c.user_id,
c.order_id,
c.item_id,
c.item_score,
c.service_score,
c.logistics_score,
c.price_score,
c.item_review,
c.like_num,
c.del_flag,
c.create_time,
c.update_time,
u.nick username
from tb_cf_item_comment c left join tb_cf_user_info u on c.user_id=u.user_id
where 1=1
<if test="name != null and name.trim() != ''">
AND u.nick LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by item_id desc,create_time desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_item_comment c left join tb_cf_user_info u on c.user_id=u.user_id
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND u.nick LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfItemCommentEntity">
insert into tb_cf_item_comment(
`id`,
`user_id`,
`order_id`,
`item_id`,
`item_score`,
`service_score`,
`logistics_score`,
`price_score`,
`item_review`,
`like_num`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{userId},
#{orderId},
#{itemId},
#{itemScore},
#{serviceScore},
#{logisticsScore},
#{priceScore},
#{itemReview},
#{likeNum},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfItemCommentEntity">
update tb_cf_item_comment
<set>
<if test="userId != null">`user_id` = #{userId},</if>
<if test="orderId != null">`order_id` = #{orderId},</if>
<if test="itemId != null">`item_id` = #{itemId},</if>
<if test="itemScore != null">`item_score` = #{itemScore},</if>
<if test="serviceScore != null">`service_score` = #{serviceScore},</if>
<if test="logisticsScore != null">`logistics_score` = #{logisticsScore},</if>
<if test="priceScore != null">`price_score` = #{priceScore},</if>
<if test="itemReview != null">`item_review` = #{itemReview},</if>
<if test="likeNum != null">`like_num` = #{likeNum},</if>
<if test="delFlag != null">`del_flag` = #{delFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from tb_cf_item_comment where id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_item_comment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.TbCfReplyDao">
<resultMap type="com.platform.entity.TbCfReplyEntity" id="tbCfReplyMap">
<result property="id" column="id"/>
<result property="replyType" column="reply_type"/>
<result property="commentId" column="comment_id"/>
<result property="userId" column="user_id"/>
<result property="toUserId" column="to_user_id"/>
<result property="replyMessage" column="reply_message"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfReplyEntity">
select
`id`,
`reply_type`,
`comment_id`,
`user_id`,
`to_user_id`,
`reply_message`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_reply
where id = #{id}
</select>
<select id="queryList" resultType="com.platform.entity.TbCfReplyEntity">
select
`id`,
`reply_type`,
`comment_id`,
`user_id`,
`to_user_id`,
`reply_message`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_reply
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 comment_id desc,create_time desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_reply
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfReplyEntity">
insert into tb_cf_reply(
`id`,
`reply_type`,
`comment_id`,
`user_id`,
`to_user_id`,
`reply_message`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{replyType},
#{commentId},
#{userId},
#{toUserId},
#{replyMessage},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfReplyEntity">
update tb_cf_reply
<set>
<if test="replyType != null">`reply_type` = #{replyType},</if>
<if test="commentId != null">`comment_id` = #{commentId},</if>
<if test="userId != null">`user_id` = #{userId},</if>
<if test="toUserId != null">`to_user_id` = #{toUserId},</if>
<if test="replyMessage != null">`reply_message` = #{replyMessage},</if>
<if test="delFlag != null">`del_flag` = #{delFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from tb_cf_reply where id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_reply where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;">
<Row :gutter="16">
<div class="search-group">
<i-col span="4">
<i-input v-model="q.name" @on-enter="query" placeholder="评论人"/>
</i-col>
<i-button @click="query">查询</i-button>
<i-button @click="reloadSearch">重置</i-button>
</div>
<div class="buttons-group">
#if($shiro.hasPermission("tbcfitemcomment:save"))
<i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
#end
#if($shiro.hasPermission("tbcfitemcomment:update"))
<i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
#end
#if($shiro.hasPermission("tbcfitemcomment:delete"))
<i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
#end
</div>
</Row>
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfItemComment" :rules="ruleValidate" :label-width="80">
<Form-item label="评论人" prop="userId">
<i-input v-model="tbCfItemComment.userId" placeholder="评论人"/>
</Form-item>
<Form-item label="订单ID" prop="orderId">
<i-input v-model="tbCfItemComment.orderId" placeholder="订单ID"/>
</Form-item>
<Form-item label="商品ID" prop="itemId">
<i-input v-model="tbCfItemComment.itemId" placeholder="商品ID"/>
</Form-item>
<Form-item label="商品评分" prop="itemScore">
<i-input v-model="tbCfItemComment.itemScore" placeholder="商品评分"/>
</Form-item>
<Form-item label="服务评分" prop="serviceScore">
<i-input v-model="tbCfItemComment.serviceScore" placeholder="服务评分"/>
</Form-item>
<Form-item label="物流评分" prop="logisticsScore">
<i-input v-model="tbCfItemComment.logisticsScore" placeholder="物流评分"/>
</Form-item>
<Form-item label="价格评分" prop="priceScore">
<i-input v-model="tbCfItemComment.priceScore" placeholder="价格评分"/>
</Form-item>
<Form-item label="商品评论" prop="itemReview">
<i-input v-model="tbCfItemComment.itemReview" placeholder="商品评论"/>
</Form-item>
<Form-item label="点赞人数" prop="likeNum">
<i-input v-model="tbCfItemComment.likeNum" placeholder="点赞人数"/>
</Form-item>
<Form-item label="删除标志 0:正常 1:已删除" prop="delFlag">
<i-input v-model="tbCfItemComment.delFlag" placeholder="删除标志 0:正常 1:已删除"/>
</Form-item>
<Form-item label="创建时间" prop="createTime">
<i-input v-model="tbCfItemComment.createTime" placeholder="创建时间"/>
</Form-item>
<Form-item label="回复时间" prop="replyTime">
<i-input v-model="tbCfItemComment.replyTime" placeholder="回复时间"/>
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>
返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script src="${rc.contextPath}/js/sys/tbcfitemcomment.js?_${date.systemTime}"></script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;">
<Row :gutter="16">
<div class="search-group">
<i-col span="4">
<i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
</i-col>
<i-button @click="query">查询</i-button>
<i-button @click="reloadSearch">重置</i-button>
</div>
<div class="buttons-group">
#if($shiro.hasPermission("tbcfreply:save"))
<i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
#end
#if($shiro.hasPermission("tbcfreply:update"))
<i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
#end
#if($shiro.hasPermission("tbcfreply:delete"))
<i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
#end
</div>
</Row>
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfReply" :rules="ruleValidate" :label-width="80">
<Form-item label="回复类型 0:商品 1:社区" prop="replyType">
<i-input v-model="tbCfReply.replyType" placeholder="回复类型 0:商品 1:社区"/>
</Form-item>
<Form-item label="评论ID" prop="commentId">
<i-input v-model="tbCfReply.commentId" placeholder="评论ID"/>
</Form-item>
<Form-item label="回复人" prop="userId">
<i-input v-model="tbCfReply.userId" placeholder="回复人"/>
</Form-item>
<Form-item label="回复对象" prop="toUserId">
<i-input v-model="tbCfReply.toUserId" placeholder="回复对象"/>
</Form-item>
<Form-item label="回复内容" prop="replyMessage">
<i-input v-model="tbCfReply.replyMessage" placeholder="回复内容"/>
</Form-item>
<Form-item label="删除标志 0:正常 1:已删除" prop="delFlag">
<i-input v-model="tbCfReply.delFlag" placeholder="删除标志 0:正常 1:已删除"/>
</Form-item>
<Form-item label="创建时间" prop="createTime">
<i-input v-model="tbCfReply.createTime" placeholder="创建时间"/>
</Form-item>
<Form-item label="更新时间" prop="updateTime">
<i-input v-model="tbCfReply.updateTime" placeholder="更新时间"/>
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script src="${rc.contextPath}/js/sys/tbcfreply.js?_${date.systemTime}"></script>
</body>
</html>
\ No newline at end of file
......@@ -475,14 +475,14 @@ imageFormat = function (cellvalue, options, rowObject) {
linkFormat = function (cellvalue, options, rowObject) {
if (!!cellvalue) {
cellvalue = "<a target='_blank' "+"href='"+cellvalue+"'>"+cellvalue+"</a>";
cellvalue = "<a target='_blank' " + "href='" + cellvalue + "'>" + cellvalue + "</a>";
}
return cellvalue;
};
/**
* 性别翻译
* 性别
* @param cellvalue
* @returns {string}
*/
......@@ -527,6 +527,15 @@ stateFormat = function (cellvalue) {
}
return returnStr;
};
/**
* 状态
* @param cellvalue
* @returns {string}
*/
statusFormat = function (cellvalue) {
return cellvalue == 0 ? '正常' : '已删除';
};
/**
* 订单状态翻译 (0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
* @param cellvalue
......
$(function () {
$("#jqGrid").Grid({
url: '../tbcfitemcomment/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '评论人', name: 'username', index: 'username', width: 80},
{label: '订单ID', name: 'orderId', index: 'order_id', width: 80},
{label: '商品ID', name: 'itemId', index: 'item_id', width: 80},
{label: '商品评分', name: 'itemScore', index: 'item_score', width: 80},
{label: '服务评分', name: 'serviceScore', index: 'service_score', width: 80},
{label: '物流评分', name: 'logisticsScore', index: 'logistics_score', width: 80},
{label: '价格评分', name: 'priceScore', index: 'price_score', width: 80},
{label: '商品评论', name: 'itemReview', index: 'item_review', width: 80},
{label: '点赞人数', name: 'likeNum', index: 'like_num', width: 80},
{label: '状态', name: 'delFlag', index: 'del_flag', width: 80, formatter: statusFormat},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}
]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfItemComment: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfItemComment = {};
},
update: function (event) {
let id = getSelectedRow("#jqGrid");
if (id == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(id);
},
saveOrUpdate: function (event) {
let url = vm.tbCfItemComment.id == null ? "../tbcfitemcomment/save" : "../tbcfitemcomment/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfItemComment),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let ids = getSelectedRows("#jqGrid");
if (ids == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfitemcomment/delete",
params: JSON.stringify(ids),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function (id) {
Ajax.request({
url: "../tbcfitemcomment/info/" + id,
async: true,
successCallback: function (r) {
vm.tbCfItemComment = r.tbCfItemComment;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function () {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
$(function () {
$("#jqGrid").Grid({
url: '../tbcfreply/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '评论ID', name: 'commentId', index: 'comment_id', width: 80},
{label: '回复人', name: 'userId', index: 'user_id', width: 80},
{label: '回复对象', name: 'toUserId', index: 'to_user_id', width: 80},
{label: '回复内容', name: 'replyMessage', index: 'reply_message', width: 80},
{label: '状态', name: 'delFlag', index: 'del_flag', width: 80, formatter: statusFormat},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}
]
});
});
let vm = new Vue({
el: '#rrapp',
data: {
showList: true,
title: null,
tbCfReply: {},
ruleValidate: {
name: [
{required: true, message: '名称不能为空', trigger: 'blur'}
]
},
q: {
name: ''
}
},
methods: {
query: function () {
vm.reload();
},
add: function () {
vm.showList = false;
vm.title = "新增";
vm.tbCfReply = {};
},
update: function (event) {
let id = getSelectedRow("#jqGrid");
if (id == null) {
return;
}
vm.showList = false;
vm.title = "修改";
vm.getInfo(id);
},
saveOrUpdate: function (event) {
let url = vm.tbCfReply.id == null ? "../tbcfreply/save" : "../tbcfreply/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfReply),
type: "POST",
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
del: function (event) {
let ids = getSelectedRows("#jqGrid");
if (ids == null) {
return;
}
confirm('确定要删除选中的记录?', function () {
Ajax.request({
url: "../tbcfreply/delete",
params: JSON.stringify(ids),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
});
},
getInfo: function (id) {
Ajax.request({
url: "../tbcfreply/info/" + id,
async: true,
successCallback: function (r) {
vm.tbCfReply = r.tbCfReply;
}
});
},
reload: function (event) {
vm.showList = true;
let page = $("#jqGrid").jqGrid('getGridParam', 'page');
$("#jqGrid").jqGrid('setGridParam', {
postData: {'name': vm.q.name},
page: page
}).trigger("reloadGrid");
vm.handleReset('formValidate');
},
reloadSearch: function () {
vm.q = {
name: ''
};
vm.reload();
},
handleSubmit: function (name) {
handleSubmitValidate(this, name, function () {
vm.saveOrUpdate()
});
},
handleReset: function (name) {
handleResetForm(this, name);
}
}
});
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论