Commit d02c9bfd by zhiwj

添加acuId

parent 69c16b3d
......@@ -40,11 +40,11 @@ public interface ProblemOutApiService {
* @Title: listProblem
* @Description:
* @author zhiwj
* @param ecuId
* @param acuId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<List<ProblemDTO>> listProblem(Long ecuId);
ServiceResponse<List<ProblemDTO>> listProblem(Long acuId);
/**
* 投诉与建议 详情
......@@ -77,5 +77,5 @@ public interface ProblemOutApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Boolean>
* @throws
*/
ServiceResponse<Void> ensure(Integer enterpriseId, Long ecuId);
ServiceResponse<Void> ensure(Integer enterpriseId, Long acuId);
}
......@@ -62,13 +62,13 @@ public interface TabProblemMapper {
Integer countProblem(ProblemQO problemQO);
List<ProblemDTO> listProblemByEcuId(@Param("ecuId") Long ecuId);
List<ProblemDTO> listProblemByAcuId(@Param("acuId") Long acuId);
/**
* 查询会员在某个时间段之后 有没有恶意评价
* @param ecuId
* @param acuId
* @param date
* @return
*/
TabProblem getMaliciousStatusByEcuIdBeforeHours(@Param("ecuId") Long ecuId, @Param("date") Date date);
TabProblem getMaliciousStatusByAcuIdBeforeHours(@Param("acuId") Long acuId, @Param("date") Date date);
}
\ No newline at end of file
......@@ -32,6 +32,11 @@ public class TabProblem {
private Long ecuId;
/**
* acuId
*/
private Long acuId;
/**
* 会员id
*/
private Long memberId;
......@@ -87,7 +92,7 @@ public class TabProblem {
private Integer showStatus;
/**
*
* 0删除 1正常 2结束
*/
private Integer status;
......@@ -141,6 +146,14 @@ public class TabProblem {
this.ecuId = ecuId;
}
public Long getAcuId() {
return acuId;
}
public void setAcuId(Long acuId) {
this.acuId = acuId;
}
public Long getMemberId() {
return memberId;
}
......
......@@ -21,11 +21,11 @@ public interface ProblemService {
Integer save(ProblemDTO problemDTO);
List<ProblemDTO> listProblem(Long ecuId);
List<ProblemDTO> listProblem(Long acuId);
void endProblem(Integer problemId);
Integer countProblem(ProblemQO problemQO);
boolean hasMaliciousStatusByEcuIdBeforeHours(Long ecuId, Integer badSuggestionTagType);
boolean hasMaliciousStatusByAcuIdBeforeHours(Long acuId, Integer badSuggestionTagType);
}
......@@ -69,8 +69,8 @@ public class ProblemServiceImpl implements ProblemService {
}
@Override
public List<ProblemDTO> listProblem(Long ecuId) {
return tabProblemMapper.listProblemByEcuId(ecuId);
public List<ProblemDTO> listProblem(Long acuId) {
return tabProblemMapper.listProblemByAcuId(acuId);
}
@Override
......@@ -87,9 +87,9 @@ public class ProblemServiceImpl implements ProblemService {
}
@Override
public boolean hasMaliciousStatusByEcuIdBeforeHours(Long ecuId, Integer badSuggestionTagType) {
public boolean hasMaliciousStatusByAcuIdBeforeHours(Long acuId, Integer badSuggestionTagType) {
Date date = DateUtil.addNumForHour(new Date(), -badSuggestionTagType);
TabProblem problem = tabProblemMapper.getMaliciousStatusByEcuIdBeforeHours(ecuId, date);
TabProblem problem = tabProblemMapper.getMaliciousStatusByAcuIdBeforeHours(acuId, date);
return problem != null;
}
}
......@@ -153,8 +153,8 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
}
@Override
public ServiceResponse<List<ProblemDTO>> listProblem(Long ecuId) {
List<ProblemDTO> problemList = problemService.listProblem(ecuId);
public ServiceResponse<List<ProblemDTO>> listProblem(Long acuId) {
List<ProblemDTO> problemList = problemService.listProblem(acuId);
if (CollectionUtils.isNotEmpty(problemList)) {
TabEvaluateOrderConfig evaluateOrderConfig = evaluateOrderConfigService.getEvaluateOrderConfig(problemList.get(0).getEnterpriseId());
List<Integer> problemIdList = problemList.stream().map(ProblemDTO::getProblemId).collect(Collectors.toList());
......@@ -212,12 +212,12 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
}
@Override
public ServiceResponse<Void> ensure(Integer enterpriseId, Long ecuId) {
public ServiceResponse<Void> ensure(Integer enterpriseId, Long acuId) {
TabEvaluateOrderConfig evaluateOrderConfig = evaluateOrderConfigService.getEvaluateOrderConfig(enterpriseId);
if (Constants.CLOSE.equals(evaluateOrderConfig.getBadSuggestionTag())) {
return EnterpriseServiceResponse.success();
}
boolean b = problemService.hasMaliciousStatusByEcuIdBeforeHours(ecuId, evaluateOrderConfig.getBadSuggestionTagType());
boolean b = problemService.hasMaliciousStatusByAcuIdBeforeHours(acuId, evaluateOrderConfig.getBadSuggestionTagType());
if (b) {
return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "已被标记为恶意投诉,暂不可投诉");
}
......
......@@ -7,6 +7,7 @@
<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="acu_id" jdbcType="BIGINT" property="acuId" />
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="member_name" jdbcType="VARCHAR" property="memberName" />
<result column="member_phone" jdbcType="VARCHAR" property="memberPhone" />
......@@ -23,7 +24,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
problem_id, enterprise_id, store_id, store_name, ecu_id, member_id, member_name,
problem_id, enterprise_id, store_id, store_name, ecu_id, acu_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>
......@@ -39,19 +40,19 @@
</delete>
<insert id="insert" parameterType="com.gic.evaluate.entity.TabProblem">
insert into tab_problem (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)
store_name, ecu_id, acu_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}, #{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})
#{storeName,jdbcType=VARCHAR}, #{ecuId,jdbcType=BIGINT}, #{acuId,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>
<insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabProblem">
<selectKey keyProperty="problemId" order="AFTER" resultType="java.lang.Integer">
......@@ -74,6 +75,9 @@
<if test="ecuId != null">
ecu_id,
</if>
<if test="acuId != null">
acu_id,
</if>
<if test="memberId != null">
member_id,
</if>
......@@ -133,6 +137,9 @@
<if test="ecuId != null">
#{ecuId,jdbcType=BIGINT},
</if>
<if test="acuId != null">
#{acuId,jdbcType=BIGINT},
</if>
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
......@@ -192,6 +199,9 @@
<if test="ecuId != null">
ecu_id = #{ecuId,jdbcType=BIGINT},
</if>
<if test="acuId != null">
acu_id = #{acuId,jdbcType=BIGINT},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=BIGINT},
</if>
......@@ -243,6 +253,7 @@
store_id = #{storeId,jdbcType=INTEGER},
store_name = #{storeName,jdbcType=VARCHAR},
ecu_id = #{ecuId,jdbcType=BIGINT},
acu_id = #{acuId,jdbcType=BIGINT},
member_id = #{memberId,jdbcType=BIGINT},
member_name = #{memberName,jdbcType=VARCHAR},
member_phone = #{memberPhone,jdbcType=VARCHAR},
......@@ -334,7 +345,7 @@
</if>
</where>
</select>
<select id="listProblemByEcuId" resultType="com.gic.evaluate.dto.ProblemDTO">
<select id="listProblemByAcuId" resultType="com.gic.evaluate.dto.ProblemDTO">
select
t1.problem_id problemId,
t1.enterprise_id enterpriseId,
......@@ -355,15 +366,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.ecu_id = #{ecuId}
where t1.acu_id = #{acuId}
order by create_time desc
</select>
<select id="getMaliciousStatusByEcuIdBeforeHours" resultMap="BaseResultMap">
<select id="getMaliciousStatusByAcuIdBeforeHours" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_problem
where status = 1
and ecu_id = #{ecuId}
and acu_id = #{acuId}
and malicious_status = 1
and malicious_status_time &gt; #{date}
</select>
......
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