Commit de8e059b by zhiwj

恶意评价

parent 6c90d49f
......@@ -86,6 +86,11 @@ public class ProblemDTO implements Serializable {
private Integer maliciousStatus;
/**
* 标记被恶意评价的时间
*/
private Date maliciousStatusTime;
/**
* 是否展示
*/
private Integer showStatus;
......@@ -307,4 +312,12 @@ public class ProblemDTO implements Serializable {
public void setReplyUserContent(String replyUserContent) {
this.replyUserContent = replyUserContent;
}
public Date getMaliciousStatusTime() {
return maliciousStatusTime;
}
public void setMaliciousStatusTime(Date maliciousStatusTime) {
this.maliciousStatusTime = maliciousStatusTime;
}
}
\ No newline at end of file
......@@ -71,7 +71,7 @@ public interface EvaluateOutApiService {
ServiceResponse<EvaluateDTO> listEvaluateByOrderId(EvaluateOutQO evaluateOutQO);
/**
* 查询订单号对应的回复状态 key是订单号, value是状态(-1:未评价 0管理员没有回复过 1管理员回复了 2有新的追评管理员没回复 3逾期不可评价 4不支持追评 5超过评价期限 6超过最大追评次数 )
* 查询订单号对应的回复状态 key是订单号, value是状态(-1:未评价 0管理员没有回复过 1管理员回复了 2有新的追评管理员没回复 3逾期不可评价 4不支持追评 6超过最大追评次数 )
* @Title: queryRelayStatusByOrderId
* @Description:
* @author zhiwj
......@@ -80,5 +80,19 @@ public interface EvaluateOutApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.Map<java.lang.Long,java.lang.Integer>>
* @throws
*/
ServiceResponse<Map<Long, Integer>> queryRelayStatusByOrderId(Integer enterpriseId, List<Long> orderIdList);
ServiceResponse<Map<Long, Integer>> queryRelayStatusByOrderId(Integer enterpriseId, List<Long> orderIdList, Long memberId);
/**
* 用户隐藏追评
* @Title: updateShowStatus
* @Description:
* @author zhiwj
* @param enterpriseId
* @param evaluateReplyId
* @param memberId
* @param showStatus
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> updateShowStatus(Integer enterpriseId, Integer evaluateReplyId, Long memberId, Integer showStatus);
}
......@@ -162,6 +162,11 @@ public class TabEvaluate {
private Integer maliciousStatus;
/**
* 恶意评价时间
*/
private Date maliciousStatusTime;
/**
* 是否展示
*/
private Integer showStatus;
......@@ -172,7 +177,7 @@ public class TabEvaluate {
private Integer visitStatus;
/**
* 评论状态 0未回复 1有回复
* 0:待处理 1:已回复 2:有更新
*/
private Integer replyStatus;
......@@ -439,6 +444,14 @@ public class TabEvaluate {
this.maliciousStatus = maliciousStatus;
}
public Date getMaliciousStatusTime() {
return maliciousStatusTime;
}
public void setMaliciousStatusTime(Date maliciousStatusTime) {
this.maliciousStatusTime = maliciousStatusTime;
}
public Integer getShowStatus() {
return showStatus;
}
......
......@@ -72,6 +72,11 @@ public class TabProblem {
private Integer maliciousStatus;
/**
* 恶意评价时间
*/
private Date maliciousStatusTime;
/**
* 是否展示
*/
private Integer showStatus;
......@@ -195,6 +200,14 @@ public class TabProblem {
this.maliciousStatus = maliciousStatus;
}
public Date getMaliciousStatusTime() {
return maliciousStatusTime;
}
public void setMaliciousStatusTime(Date maliciousStatusTime) {
this.maliciousStatusTime = maliciousStatusTime;
}
public Integer getShowStatus() {
return showStatus;
}
......
......@@ -72,4 +72,6 @@ public interface EvaluateService {
Set<Integer> getStoreIdHasTopHot(Integer enterpriseId, List<Integer> storeIdList);
Integer countEvaluateTrend(Integer enterpriseId, Date startTime, Date endTime , List<Integer> storeIdList, Integer quickReplyTypeEnumCode);
boolean hasMaliciousStatusBeforeHours(Integer evaluateId, Integer badEvaluateTagType);
}
......@@ -58,6 +58,7 @@ public class EvaluateReplyServiceImpl implements EvaluateReplyService {
tabEvaluateReply.setMemberName(memberReplyDTO.getMemberName());
tabEvaluateReply.setMemberImgUrl(memberReplyDTO.getMemberImgUrl());
tabEvaluateReply.setStatus(Constants.NORMAL_STATUS);
tabEvaluateReply.setShowStatus(Constants.NORMAL_STATUS);
tabEvaluateReply.setCreateTime(new Date());
tabEvaluateReplyMapper.insertSelective(tabEvaluateReply);
return tabEvaluateReply.getEvaluateReplyId();
......
......@@ -98,7 +98,14 @@ public class EvaluateServiceImpl implements EvaluateService {
@Override
public void updateMaliciousStatus(Integer enterpriseId, Integer evaluateId, Integer maliciousStatus) {
tabEvaluateMapper.updateMaliciousStatus(enterpriseId, evaluateId, maliciousStatus);
TabEvaluate tabEvaluate = new TabEvaluate();
tabEvaluate.setEvaluateId(evaluateId);
tabEvaluate.setMaliciousStatus(maliciousStatus);
if (Constants.NORMAL_STATUS.equals(maliciousStatus)) {
tabEvaluate.setMaliciousStatusTime(new Date());
}
tabEvaluateMapper.updateByPrimaryKeySelective(tabEvaluate);
// tabEvaluateMapper.updateMaliciousStatus(enterpriseId, evaluateId, maliciousStatus);
}
@Override
......@@ -257,6 +264,27 @@ public class EvaluateServiceImpl implements EvaluateService {
return tabEvaluateMapper.countEvaluateTrend(enterpriseId, startTime, endTime, storeIdList, quickReplyType);
}
@Override
public boolean hasMaliciousStatusBeforeHours(Integer evaluateId, Integer badEvaluateTagType) {
TabEvaluate tabEvaluate = this.tabEvaluateMapper.selectByPrimaryKey(evaluateId);
if (tabEvaluate != null && Constants.NORMAL_STATUS.equals(tabEvaluate.getMaliciousStatus())) {
if (badEvaluateTagType == 1) {
// 永久禁止
return true;
} else {
// 72小时禁止
Date maliciousStatusTime = tabEvaluate.getMaliciousStatusTime();
if (maliciousStatusTime != null) {
return DateUtil.compareDate(DateUtil.addNumForDay(maliciousStatusTime, 3), new Date());
} else {
return false;
}
}
} else {
return false;
}
}
private List<String> getYear() {
List<String> list = new ArrayList<>();
int year = DateUtil.getYear(new Date());
......
......@@ -22,10 +22,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -122,6 +119,7 @@ public class ProblemManageApiServiceImpl implements ProblemManageApiService {
problemDTO.setMaliciousStatus(maliciousStatus);
if (Constants.OPEN.equals(maliciousStatus)) {
problemDTO.setShowStatus(Constants.CLOSE);
problemDTO.setMaliciousStatusTime(new Date());
} else if (Constants.CLOSE.equals(maliciousStatus)) {
problemDTO.setShowStatus(Constants.OPEN);
}
......
......@@ -33,6 +33,7 @@
<result column="review_status" jdbcType="INTEGER" property="reviewStatus" />
<result column="top_hot_status" jdbcType="INTEGER" property="topHotStatus" />
<result column="malicious_status" jdbcType="INTEGER" property="maliciousStatus" />
<result column="malicious_status_time" jdbcType="TIMESTAMP" property="maliciousStatusTime" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
<result column="visit_status" jdbcType="INTEGER" property="visitStatus" />
<result column="reply_status" jdbcType="INTEGER" property="replyStatus" />
......@@ -45,23 +46,23 @@
store_score, service_score, evaluate_time, member_name, member_phone, member_img_url,
goods_id, goods_info, store_name, store_code, store_phone, store_group_id, store_group_name,
area_name, order_number, receipts_date, order_mount, clerk_id, clerk_name, bad_evaluate_status,
good_evaluate_status, review_status, top_hot_status, malicious_status, show_status,
visit_status, reply_status, status, create_time, update_time
good_evaluate_status, review_status, top_hot_status, malicious_status, malicious_status_time,
show_status, visit_status, reply_status, status, create_time, update_time
</sql>
<sql id="querySql">
<where>
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
<if test="null != storeIdList and storeIdList.size > 0">
<if test="null != storeIdList and storeIdList.size &gt; 0">
and store_id in
<foreach collection="storeIdList" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="storeIdList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="null != evaluateIds and evaluateIds.length > 0">
<if test="null != evaluateIds and evaluateIds.length &gt; 0">
and evaluate_id in
<foreach collection="evaluateIds" index="index" item="item" open="(" separator="," close=")">
<foreach close=")" collection="evaluateIds" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
......@@ -142,9 +143,10 @@
order_number, receipts_date, order_mount,
clerk_id, clerk_name, bad_evaluate_status,
good_evaluate_status, review_status, top_hot_status,
malicious_status, show_status, visit_status,
reply_status, status, create_time,
update_time)
malicious_status, malicious_status_time,
show_status, visit_status, reply_status,
status, create_time, update_time
)
values (#{evaluateId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{storeId,jdbcType=INTEGER},
#{memberId,jdbcType=BIGINT}, #{orderId,jdbcType=BIGINT}, #{evaluateContent,jdbcType=VARCHAR},
#{goodsScore,jdbcType=INTEGER}, #{storeScore,jdbcType=INTEGER}, #{serviceScore,jdbcType=INTEGER},
......@@ -155,9 +157,10 @@
#{orderNumber,jdbcType=VARCHAR}, #{receiptsDate,jdbcType=TIMESTAMP}, #{orderMount,jdbcType=DOUBLE},
#{clerkId,jdbcType=INTEGER}, #{clerkName,jdbcType=VARCHAR}, #{badEvaluateStatus,jdbcType=INTEGER},
#{goodEvaluateStatus,jdbcType=INTEGER}, #{reviewStatus,jdbcType=INTEGER}, #{topHotStatus,jdbcType=INTEGER},
#{maliciousStatus,jdbcType=INTEGER}, #{showStatus,jdbcType=INTEGER}, #{visitStatus,jdbcType=INTEGER},
#{replyStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{maliciousStatus,jdbcType=INTEGER}, #{maliciousStatusTime,jdbcType=TIMESTAMP},
#{showStatus,jdbcType=INTEGER}, #{visitStatus,jdbcType=INTEGER}, #{replyStatus,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabEvaluate">
<selectKey keyProperty="evaluateId" order="AFTER" resultType="java.lang.Integer">
......@@ -258,6 +261,9 @@
<if test="maliciousStatus != null">
malicious_status,
</if>
<if test="maliciousStatusTime != null">
malicious_status_time,
</if>
<if test="showStatus != null">
show_status,
</if>
......@@ -371,6 +377,9 @@
<if test="maliciousStatus != null">
#{maliciousStatus,jdbcType=INTEGER},
</if>
<if test="maliciousStatusTime != null">
#{maliciousStatusTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
......@@ -484,6 +493,9 @@
<if test="maliciousStatus != null">
malicious_status = #{maliciousStatus,jdbcType=INTEGER},
</if>
<if test="maliciousStatusTime != null">
malicious_status_time = #{maliciousStatusTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
......@@ -537,6 +549,7 @@
review_status = #{reviewStatus,jdbcType=INTEGER},
top_hot_status = #{topHotStatus,jdbcType=INTEGER},
malicious_status = #{maliciousStatus,jdbcType=INTEGER},
malicious_status_time = #{maliciousStatusTime,jdbcType=TIMESTAMP},
show_status = #{showStatus,jdbcType=INTEGER},
visit_status = #{visitStatus,jdbcType=INTEGER},
reply_status = #{replyStatus,jdbcType=INTEGER},
......@@ -624,6 +637,7 @@
tab_evaluate
where enterprise_id = #{enterpriseId}
and status = 1
and goods_score &gt; 0
<if test="startTime != null and startTime != '' ">
and evaluate_time &gt;= #{startTime}
</if>
......@@ -650,6 +664,7 @@
tab_evaluate
where enterprise_id = #{enterpriseId}
and status = 1
and store_score &gt; 0
<if test="startTime != null and startTime != '' ">
and evaluate_time &gt;= #{startTime}
</if>
......@@ -676,6 +691,7 @@
tab_evaluate
where enterprise_id = #{enterpriseId}
and status = 1
and service_score &gt; 0
<if test="startTime != null and startTime != '' ">
and evaluate_time &gt;= #{startTime}
</if>
......
......@@ -15,6 +15,7 @@
<result column="has_other_image" jdbcType="INTEGER" property="hasOtherImage" />
<result column="problem_status" jdbcType="INTEGER" property="problemStatus" />
<result column="malicious_status" jdbcType="INTEGER" property="maliciousStatus" />
<result column="malicious_status_time" jdbcType="TIMESTAMP" property="maliciousStatusTime" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -23,7 +24,7 @@
<sql id="Base_Column_List">
problem_id, enterprise_id, store_id, store_name, member_id, member_name, member_phone,
member_img_url, problem_content, image_url, has_other_image, problem_status, malicious_status,
show_status, status, create_time, update_time
malicious_status_time, show_status, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -40,19 +41,21 @@
store_name, member_id, member_name,
member_phone, member_img_url, problem_content,
image_url, has_other_image, problem_status,
malicious_status, show_status, status,
create_time, update_time)
malicious_status, malicious_status_time,
show_status, status, create_time,
update_time)
values (#{problemId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{storeId,jdbcType=INTEGER},
#{storeName,jdbcType=VARCHAR}, #{memberId,jdbcType=BIGINT}, #{memberName,jdbcType=VARCHAR},
#{memberPhone,jdbcType=VARCHAR}, #{memberImgUrl,jdbcType=VARCHAR}, #{problemContent,jdbcType=VARCHAR},
#{imageUrl,jdbcType=VARCHAR}, #{hasOtherImage,jdbcType=INTEGER}, #{problemStatus,jdbcType=INTEGER},
#{maliciousStatus,jdbcType=INTEGER}, #{showStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{maliciousStatus,jdbcType=INTEGER}, #{maliciousStatusTime,jdbcType=TIMESTAMP},
#{showStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabProblem">
<selectKey keyProperty="problemId" order="AFTER" resultType="java.lang.Integer">
<selectKey keyProperty="problemId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
</selectKey>
insert into tab_problem
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="problemId != null">
......@@ -94,6 +97,9 @@
<if test="maliciousStatus != null">
malicious_status,
</if>
<if test="maliciousStatusTime != null">
malicious_status_time,
</if>
<if test="showStatus != null">
show_status,
</if>
......@@ -147,6 +153,9 @@
<if test="maliciousStatus != null">
#{maliciousStatus,jdbcType=INTEGER},
</if>
<if test="maliciousStatusTime != null">
#{maliciousStatusTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
......@@ -200,6 +209,9 @@
<if test="maliciousStatus != null">
malicious_status = #{maliciousStatus,jdbcType=INTEGER},
</if>
<if test="maliciousStatusTime != null">
malicious_status_time = #{maliciousStatusTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
......@@ -229,6 +241,7 @@
has_other_image = #{hasOtherImage,jdbcType=INTEGER},
problem_status = #{problemStatus,jdbcType=INTEGER},
malicious_status = #{maliciousStatus,jdbcType=INTEGER},
malicious_status_time = #{maliciousStatusTime,jdbcType=TIMESTAMP},
show_status = #{showStatus,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -338,6 +351,6 @@
from tab_problem
where status = 1
and member_id = #{memberId}
and update_time &gt; #{date}
and malicious_status_time &gt; #{date}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment