Commit c53145cc by zhiwj

bug

parent 9e430ae5
......@@ -40,11 +40,11 @@ public interface ProblemOutApiService {
* @Title: listProblem
* @Description:
* @author zhiwj
* @param memberId
* @param ecuId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<List<ProblemDTO>> listProblem(Long memberId);
ServiceResponse<List<ProblemDTO>> listProblem(Long ecuId);
/**
* 投诉与建议 详情
......
......@@ -62,13 +62,13 @@ public interface TabProblemMapper {
Integer countProblem(ProblemQO problemQO);
List<ProblemDTO> listProblemByMemberId(@Param("memberId") Long memberId);
List<ProblemDTO> listProblemByEcuId(@Param("ecuId") Long ecuId);
/**
* 查询会员在某个时间段之后 有没有恶意评价
* @param memberId
* @param ecuId
* @param date
* @return
*/
TabProblem getMaliciousStatusByMemberIdBeforeHours(@Param("memberId") Long memberId, @Param("date") Date date);
TabProblem getMaliciousStatusByEcuIdBeforeHours(@Param("ecuId") Long ecuId, @Param("date") Date date);
}
\ No newline at end of file
......@@ -27,6 +27,11 @@ public class TabProblem {
private String storeName;
/**
*
*/
private Long ecuId;
/**
* 会员id
*/
private Long memberId;
......@@ -128,6 +133,14 @@ public class TabProblem {
this.storeName = storeName;
}
public Long getEcuId() {
return ecuId;
}
public void setEcuId(Long ecuId) {
this.ecuId = ecuId;
}
public Long getMemberId() {
return memberId;
}
......
......@@ -34,6 +34,11 @@ public class TabProblemReply {
/**
*
*/
private Long ecuId;
/**
*
*/
private Long memberId;
/**
......@@ -111,6 +116,14 @@ public class TabProblemReply {
this.replyContent = replyContent;
}
public Long getEcuId() {
return ecuId;
}
public void setEcuId(Long ecuId) {
this.ecuId = ecuId;
}
public Long getMemberId() {
return memberId;
}
......
......@@ -21,11 +21,11 @@ public interface ProblemService {
Integer save(ProblemDTO problemDTO);
List<ProblemDTO> listProblem(Long memberId);
List<ProblemDTO> listProblem(Long ecuId);
void endProblem(Integer problemId);
Integer countProblem(ProblemQO problemQO);
boolean hasMaliciousStatusByMemberIdBeforeHours(Long memberId, Integer badSuggestionTagType);
boolean hasMaliciousStatusByEcuIdBeforeHours(Long ecuId, Integer badSuggestionTagType);
}
......@@ -69,6 +69,7 @@ public class ProblemReplyServiceImpl implements ProblemReplyService {
problemReply.setProblemId(problemMemberReplyDTO.getProblemId());
problemReply.setReplyerType(ReplyerTypeEnum.MEMBER.getCode());
problemReply.setReplyContent(problemMemberReplyDTO.getReplyContent());
problemReply.setEcuId(problemMemberReplyDTO.getEcuId());
problemReply.setMemberId(problemMemberReplyDTO.getMemberId());
problemReply.setMemberName(problemMemberReplyDTO.getMemberName());
problemReply.setMemberImgUrl(problemMemberReplyDTO.getMemberImgUrl());
......
......@@ -51,6 +51,7 @@ public class ProblemServiceImpl implements ProblemService {
problem.setEnterpriseId(problemDTO.getEnterpriseId());
problem.setStoreId(problemDTO.getStoreId());
problem.setStoreName(problemDTO.getStoreName());
problem.setEcuId(problemDTO.getEcuId());
problem.setMemberId(problemDTO.getMemberId());
problem.setMemberName(problemDTO.getMemberName());
problem.setMemberPhone(problemDTO.getMemberPhone());
......@@ -68,8 +69,8 @@ public class ProblemServiceImpl implements ProblemService {
}
@Override
public List<ProblemDTO> listProblem(Long memberId) {
return tabProblemMapper.listProblemByMemberId(memberId);
public List<ProblemDTO> listProblem(Long ecuId) {
return tabProblemMapper.listProblemByEcuId(ecuId);
}
@Override
......@@ -86,9 +87,9 @@ public class ProblemServiceImpl implements ProblemService {
}
@Override
public boolean hasMaliciousStatusByMemberIdBeforeHours(Long memberId, Integer badSuggestionTagType) {
public boolean hasMaliciousStatusByEcuIdBeforeHours(Long ecuId, Integer badSuggestionTagType) {
Date date = DateUtil.addNumForHour(new Date(), -badSuggestionTagType);
TabProblem problem = tabProblemMapper.getMaliciousStatusByMemberIdBeforeHours(memberId, date);
TabProblem problem = tabProblemMapper.getMaliciousStatusByEcuIdBeforeHours(ecuId, date);
return problem != null;
}
}
......@@ -101,7 +101,7 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
TabEvaluateOrderConfig evaluateOrderConfig = evaluateOrderConfigService.getEvaluateOrderConfig(problemMemberReplyDTO.getEnterpriseId());
if (Constants.OPEN.equals(evaluateOrderConfig.getBadSuggestionTag())) {
if (this.problemService.hasMaliciousStatusByMemberIdBeforeHours(problemMemberReplyDTO.getMemberId(), evaluateOrderConfig.getBadSuggestionTagType())) {
if (this.problemService.hasMaliciousStatusByEcuIdBeforeHours(problemMemberReplyDTO.getEcuId(), evaluateOrderConfig.getBadSuggestionTagType())) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不能评论");
}
}
......@@ -134,8 +134,8 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
}
@Override
public ServiceResponse<List<ProblemDTO>> listProblem(Long memberId) {
List<ProblemDTO> problemList = problemService.listProblem(memberId);
public ServiceResponse<List<ProblemDTO>> listProblem(Long ecuId) {
List<ProblemDTO> problemList = problemService.listProblem(ecuId);
if (CollectionUtils.isNotEmpty(problemList)) {
List<Integer> problemIdList = problemList.stream().map(ProblemDTO::getProblemId).collect(Collectors.toList());
Map<Integer, String> firstReply = problemReplyService.firstReplyByProblemId(problemIdList);
......
......@@ -6,6 +6,7 @@
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="store_id" jdbcType="INTEGER" property="storeId" />
<result column="store_name" jdbcType="VARCHAR" property="storeName" />
<result column="ecu_id" jdbcType="BIGINT" property="ecuId" />
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="member_name" jdbcType="VARCHAR" property="memberName" />
<result column="member_phone" jdbcType="VARCHAR" property="memberPhone" />
......@@ -22,9 +23,9 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<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,
malicious_status_time, show_status, status, create_time, update_time
problem_id, enterprise_id, store_id, store_name, ecu_id, member_id, member_name,
member_phone, member_img_url, problem_content, image_url, has_other_image, problem_status,
malicious_status, malicious_status_time, show_status, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -38,17 +39,17 @@
</delete>
<insert id="insert" parameterType="com.gic.evaluate.entity.TabProblem">
insert into tab_problem (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, malicious_status_time,
store_name, ecu_id, member_id,
member_name, member_phone, member_img_url,
problem_content, image_url, has_other_image,
problem_status, 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}, #{maliciousStatusTime,jdbcType=TIMESTAMP},
#{storeName,jdbcType=VARCHAR}, #{ecuId,jdbcType=BIGINT}, #{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}, #{maliciousStatusTime,jdbcType=TIMESTAMP},
#{showStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
......@@ -70,6 +71,9 @@
<if test="storeName != null">
store_name,
</if>
<if test="ecuId != null">
ecu_id,
</if>
<if test="memberId != null">
member_id,
</if>
......@@ -126,6 +130,9 @@
<if test="storeName != null">
#{storeName,jdbcType=VARCHAR},
</if>
<if test="ecuId != null">
#{ecuId,jdbcType=BIGINT},
</if>
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
......@@ -182,6 +189,9 @@
<if test="storeName != null">
store_name = #{storeName,jdbcType=VARCHAR},
</if>
<if test="ecuId != null">
ecu_id = #{ecuId,jdbcType=BIGINT},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=BIGINT},
</if>
......@@ -232,6 +242,7 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
store_id = #{storeId,jdbcType=INTEGER},
store_name = #{storeName,jdbcType=VARCHAR},
ecu_id = #{ecuId,jdbcType=BIGINT},
member_id = #{memberId,jdbcType=BIGINT},
member_name = #{memberName,jdbcType=VARCHAR},
member_phone = #{memberPhone,jdbcType=VARCHAR},
......@@ -323,7 +334,7 @@
</if>
</where>
</select>
<select id="listProblemByMemberId" resultType="com.gic.evaluate.dto.ProblemDTO">
<select id="listProblemByEcuId" resultType="com.gic.evaluate.dto.ProblemDTO">
select
t1.problem_id problemId,
t1.enterprise_id enterpriseId,
......@@ -343,15 +354,15 @@
t3.problemCount
from tab_problem t1
left join ( select problem_id, count(*) problemCount from tab_problem_reply where status &lt;&gt; 0 GROUP BY problem_id ) t3 on t1.problem_id = t3.problem_id
where t1.member_id = #{memberId}
where t1.ecu_id = #{ecuId}
order by create_time desc
</select>
<select id="getMaliciousStatusByMemberIdBeforeHours" resultMap="BaseResultMap">
<select id="getMaliciousStatusByEcuIdBeforeHours" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_problem
where status = 1
and member_id = #{memberId}
and ecu_id = #{ecuId}
and malicious_status_time &gt; #{date}
</select>
</mapper>
\ No newline at end of file
......@@ -7,6 +7,7 @@
<result column="problem_id" jdbcType="INTEGER" property="problemId" />
<result column="replyer_type" jdbcType="INTEGER" property="replyerType" />
<result column="reply_content" jdbcType="VARCHAR" property="replyContent" />
<result column="ecu_id" jdbcType="BIGINT" property="ecuId" />
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="member_name" jdbcType="VARCHAR" property="memberName" />
<result column="member_img_url" jdbcType="VARCHAR" property="memberImgUrl" />
......@@ -17,8 +18,9 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
problem_reply_id, enterprise_id, problem_id, replyer_type, reply_content, member_id,
member_name, member_img_url, user_id, user_name, status, create_time, update_time
problem_reply_id, enterprise_id, problem_id, replyer_type, reply_content, ecu_id,
member_id, member_name, member_img_url, user_id, user_name, status, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -32,15 +34,15 @@
</delete>
<insert id="insert" parameterType="com.gic.evaluate.entity.TabProblemReply">
insert into tab_problem_reply (problem_reply_id, enterprise_id, problem_id,
replyer_type, reply_content, member_id,
member_name, member_img_url, user_id,
user_name, status, create_time,
update_time)
replyer_type, reply_content, ecu_id,
member_id, member_name, member_img_url,
user_id, user_name, status,
create_time, update_time)
values (#{problemReplyId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{problemId,jdbcType=INTEGER},
#{replyerType,jdbcType=INTEGER}, #{replyContent,jdbcType=VARCHAR}, #{memberId,jdbcType=BIGINT},
#{memberName,jdbcType=VARCHAR}, #{memberImgUrl,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},
#{userName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{replyerType,jdbcType=INTEGER}, #{replyContent,jdbcType=VARCHAR}, #{ecuId,jdbcType=BIGINT},
#{memberId,jdbcType=BIGINT}, #{memberName,jdbcType=VARCHAR}, #{memberImgUrl,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabProblemReply">
<selectKey keyProperty="problemReplyId" order="AFTER" resultType="java.lang.Integer">
......@@ -63,6 +65,9 @@
<if test="replyContent != null">
reply_content,
</if>
<if test="ecuId != null">
ecu_id,
</if>
<if test="memberId != null">
member_id,
</if>
......@@ -104,6 +109,9 @@
<if test="replyContent != null">
#{replyContent,jdbcType=VARCHAR},
</if>
<if test="ecuId != null">
#{ecuId,jdbcType=BIGINT},
</if>
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
......@@ -145,6 +153,9 @@
<if test="replyContent != null">
reply_content = #{replyContent,jdbcType=VARCHAR},
</if>
<if test="ecuId != null">
ecu_id = #{ecuId,jdbcType=BIGINT},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=BIGINT},
</if>
......@@ -178,6 +189,7 @@
problem_id = #{problemId,jdbcType=INTEGER},
replyer_type = #{replyerType,jdbcType=INTEGER},
reply_content = #{replyContent,jdbcType=VARCHAR},
ecu_id = #{ecuId,jdbcType=BIGINT},
member_id = #{memberId,jdbcType=BIGINT},
member_name = #{memberName,jdbcType=VARCHAR},
member_img_url = #{memberImgUrl,jdbcType=VARCHAR},
......
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