Commit 7f474479 by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !5
parents bfb24242 349dc84e
...@@ -40,11 +40,11 @@ public interface ProblemOutApiService { ...@@ -40,11 +40,11 @@ public interface ProblemOutApiService {
* @Title: listProblem * @Title: listProblem
* @Description: * @Description:
* @author zhiwj * @author zhiwj
* @param ecuId * @param acuId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void> * @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws * @throws
*/ */
ServiceResponse<List<ProblemDTO>> listProblem(Long ecuId); ServiceResponse<List<ProblemDTO>> listProblem(Long acuId);
/** /**
* 投诉与建议 详情 * 投诉与建议 详情
...@@ -77,5 +77,5 @@ public interface ProblemOutApiService { ...@@ -77,5 +77,5 @@ public interface ProblemOutApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Boolean> * @return com.gic.api.base.commons.ServiceResponse<java.lang.Boolean>
* @throws * @throws
*/ */
ServiceResponse<Void> ensure(Integer enterpriseId, Long ecuId); ServiceResponse<Void> ensure(Integer enterpriseId, Long acuId);
} }
...@@ -62,13 +62,13 @@ public interface TabProblemMapper { ...@@ -62,13 +62,13 @@ public interface TabProblemMapper {
Integer countProblem(ProblemQO problemQO); Integer countProblem(ProblemQO problemQO);
List<ProblemDTO> listProblemByEcuId(@Param("ecuId") Long ecuId); List<ProblemDTO> listProblemByAcuId(@Param("acuId") Long acuId);
/** /**
* 查询会员在某个时间段之后 有没有恶意评价 * 查询会员在某个时间段之后 有没有恶意评价
* @param ecuId * @param acuId
* @param date * @param date
* @return * @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 { ...@@ -32,6 +32,11 @@ public class TabProblem {
private Long ecuId; private Long ecuId;
/** /**
* acuId
*/
private Long acuId;
/**
* 会员id * 会员id
*/ */
private Long memberId; private Long memberId;
...@@ -87,7 +92,7 @@ public class TabProblem { ...@@ -87,7 +92,7 @@ public class TabProblem {
private Integer showStatus; private Integer showStatus;
/** /**
* * 0删除 1正常 2结束
*/ */
private Integer status; private Integer status;
...@@ -141,6 +146,14 @@ public class TabProblem { ...@@ -141,6 +146,14 @@ public class TabProblem {
this.ecuId = ecuId; this.ecuId = ecuId;
} }
public Long getAcuId() {
return acuId;
}
public void setAcuId(Long acuId) {
this.acuId = acuId;
}
public Long getMemberId() { public Long getMemberId() {
return memberId; return memberId;
} }
......
...@@ -39,6 +39,11 @@ public class TabProblemReply { ...@@ -39,6 +39,11 @@ public class TabProblemReply {
/** /**
* *
*/ */
private Long acuId;
/**
*
*/
private Long memberId; private Long memberId;
/** /**
...@@ -124,6 +129,14 @@ public class TabProblemReply { ...@@ -124,6 +129,14 @@ public class TabProblemReply {
this.ecuId = ecuId; this.ecuId = ecuId;
} }
public Long getAcuId() {
return acuId;
}
public void setAcuId(Long acuId) {
this.acuId = acuId;
}
public Long getMemberId() { public Long getMemberId() {
return memberId; return memberId;
} }
......
...@@ -21,11 +21,11 @@ public interface ProblemService { ...@@ -21,11 +21,11 @@ public interface ProblemService {
Integer save(ProblemDTO problemDTO); Integer save(ProblemDTO problemDTO);
List<ProblemDTO> listProblem(Long ecuId); List<ProblemDTO> listProblem(Long acuId);
void endProblem(Integer problemId); void endProblem(Integer problemId);
Integer countProblem(ProblemQO problemQO); Integer countProblem(ProblemQO problemQO);
boolean hasMaliciousStatusByEcuIdBeforeHours(Long ecuId, Integer badSuggestionTagType); boolean hasMaliciousStatusByAcuIdBeforeHours(Long acuId, Integer badSuggestionTagType);
} }
...@@ -70,6 +70,7 @@ public class ProblemReplyServiceImpl implements ProblemReplyService { ...@@ -70,6 +70,7 @@ public class ProblemReplyServiceImpl implements ProblemReplyService {
problemReply.setReplyerType(ReplyerTypeEnum.MEMBER.getCode()); problemReply.setReplyerType(ReplyerTypeEnum.MEMBER.getCode());
problemReply.setReplyContent(problemMemberReplyDTO.getReplyContent()); problemReply.setReplyContent(problemMemberReplyDTO.getReplyContent());
problemReply.setEcuId(problemMemberReplyDTO.getEcuId()); problemReply.setEcuId(problemMemberReplyDTO.getEcuId());
problemReply.setAcuId(problemMemberReplyDTO.getAcuId());
problemReply.setMemberId(problemMemberReplyDTO.getMemberId()); problemReply.setMemberId(problemMemberReplyDTO.getMemberId());
problemReply.setMemberName(problemMemberReplyDTO.getMemberName()); problemReply.setMemberName(problemMemberReplyDTO.getMemberName());
problemReply.setMemberImgUrl(problemMemberReplyDTO.getMemberImgUrl()); problemReply.setMemberImgUrl(problemMemberReplyDTO.getMemberImgUrl());
......
...@@ -52,6 +52,7 @@ public class ProblemServiceImpl implements ProblemService { ...@@ -52,6 +52,7 @@ public class ProblemServiceImpl implements ProblemService {
problem.setStoreId(problemDTO.getStoreId()); problem.setStoreId(problemDTO.getStoreId());
problem.setStoreName(problemDTO.getStoreName()); problem.setStoreName(problemDTO.getStoreName());
problem.setEcuId(problemDTO.getEcuId()); problem.setEcuId(problemDTO.getEcuId());
problem.setAcuId(problemDTO.getAcuId());
problem.setMemberId(problemDTO.getMemberId()); problem.setMemberId(problemDTO.getMemberId());
problem.setMemberName(problemDTO.getMemberName()); problem.setMemberName(problemDTO.getMemberName());
problem.setMemberPhone(problemDTO.getMemberPhone()); problem.setMemberPhone(problemDTO.getMemberPhone());
...@@ -69,8 +70,8 @@ public class ProblemServiceImpl implements ProblemService { ...@@ -69,8 +70,8 @@ public class ProblemServiceImpl implements ProblemService {
} }
@Override @Override
public List<ProblemDTO> listProblem(Long ecuId) { public List<ProblemDTO> listProblem(Long acuId) {
return tabProblemMapper.listProblemByEcuId(ecuId); return tabProblemMapper.listProblemByAcuId(acuId);
} }
@Override @Override
...@@ -87,9 +88,9 @@ public class ProblemServiceImpl implements ProblemService { ...@@ -87,9 +88,9 @@ public class ProblemServiceImpl implements ProblemService {
} }
@Override @Override
public boolean hasMaliciousStatusByEcuIdBeforeHours(Long ecuId, Integer badSuggestionTagType) { public boolean hasMaliciousStatusByAcuIdBeforeHours(Long acuId, Integer badSuggestionTagType) {
Date date = DateUtil.addNumForHour(new Date(), -badSuggestionTagType); Date date = DateUtil.addNumForHour(new Date(), -badSuggestionTagType);
TabProblem problem = tabProblemMapper.getMaliciousStatusByEcuIdBeforeHours(ecuId, date); TabProblem problem = tabProblemMapper.getMaliciousStatusByAcuIdBeforeHours(acuId, date);
return problem != null; return problem != null;
} }
} }
...@@ -341,8 +341,6 @@ public class EvaluateOutApiServiceImpl implements EvaluateOutApiService { ...@@ -341,8 +341,6 @@ public class EvaluateOutApiServiceImpl implements EvaluateOutApiService {
} else { } else {
resultMap.put(statusQO.getOrderId(), OrderReplyEnum.EVALUATE_HAS_OVERDUE.getCode()); resultMap.put(statusQO.getOrderId(), OrderReplyEnum.EVALUATE_HAS_OVERDUE.getCode());
} }
} else if (overEvaluateTime(evaluateOrderConfig, orderListDetailDTO.getOrderDTO().getReceiptsTime())) {
resultMap.put(statusQO.getOrderId(), OrderReplyEnum.WAIT.getCode());
} else { } else {
// 没有超过评价时间 // 没有超过评价时间
if (evaluate != null) { if (evaluate != null) {
......
...@@ -19,6 +19,7 @@ import com.gic.evaluate.service.ProblemManageApiService; ...@@ -19,6 +19,7 @@ import com.gic.evaluate.service.ProblemManageApiService;
import com.gic.evaluate.service.ProblemReplyService; import com.gic.evaluate.service.ProblemReplyService;
import com.gic.evaluate.service.ProblemService; import com.gic.evaluate.service.ProblemService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.curator.shaded.com.google.common.collect.Lists; import org.apache.curator.shaded.com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -65,7 +66,7 @@ public class ProblemManageApiServiceImpl implements ProblemManageApiService { ...@@ -65,7 +66,7 @@ public class ProblemManageApiServiceImpl implements ProblemManageApiService {
List<TabProblemImg> tabImgList = problemImgService.listImageByProblemId(problemId); List<TabProblemImg> tabImgList = problemImgService.listImageByProblemId(problemId);
List<String> list = Optional.ofNullable(tabImgList).orElse(Collections.emptyList()).stream().map(TabProblemImg::getImgUrl).collect(Collectors.toList()); List<String> list = Optional.ofNullable(tabImgList).orElse(Collections.emptyList()).stream().map(TabProblemImg::getImgUrl).collect(Collectors.toList());
problemDTO.setImgList(list); problemDTO.setImgList(list);
} else { } else if (StringUtils.isNotBlank(problemDTO.getImageUrl())) {
problemDTO.setImgList(Lists.newArrayList(problemDTO.getImageUrl())); problemDTO.setImgList(Lists.newArrayList(problemDTO.getImageUrl()));
} }
List<ProblemReplyDTO> replyList = problemReplyService.listReply(problemId); List<ProblemReplyDTO> replyList = problemReplyService.listReply(problemId);
......
...@@ -153,8 +153,8 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService { ...@@ -153,8 +153,8 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
} }
@Override @Override
public ServiceResponse<List<ProblemDTO>> listProblem(Long ecuId) { public ServiceResponse<List<ProblemDTO>> listProblem(Long acuId) {
List<ProblemDTO> problemList = problemService.listProblem(ecuId); List<ProblemDTO> problemList = problemService.listProblem(acuId);
if (CollectionUtils.isNotEmpty(problemList)) { if (CollectionUtils.isNotEmpty(problemList)) {
TabEvaluateOrderConfig evaluateOrderConfig = evaluateOrderConfigService.getEvaluateOrderConfig(problemList.get(0).getEnterpriseId()); TabEvaluateOrderConfig evaluateOrderConfig = evaluateOrderConfigService.getEvaluateOrderConfig(problemList.get(0).getEnterpriseId());
List<Integer> problemIdList = problemList.stream().map(ProblemDTO::getProblemId).collect(Collectors.toList()); List<Integer> problemIdList = problemList.stream().map(ProblemDTO::getProblemId).collect(Collectors.toList());
...@@ -212,12 +212,12 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService { ...@@ -212,12 +212,12 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
} }
@Override @Override
public ServiceResponse<Void> ensure(Integer enterpriseId, Long ecuId) { public ServiceResponse<Void> ensure(Integer enterpriseId, Long acuId) {
TabEvaluateOrderConfig evaluateOrderConfig = evaluateOrderConfigService.getEvaluateOrderConfig(enterpriseId); TabEvaluateOrderConfig evaluateOrderConfig = evaluateOrderConfigService.getEvaluateOrderConfig(enterpriseId);
if (Constants.CLOSE.equals(evaluateOrderConfig.getBadSuggestionTag())) { if (Constants.CLOSE.equals(evaluateOrderConfig.getBadSuggestionTag())) {
return EnterpriseServiceResponse.success(); return EnterpriseServiceResponse.success();
} }
boolean b = problemService.hasMaliciousStatusByEcuIdBeforeHours(ecuId, evaluateOrderConfig.getBadSuggestionTagType()); boolean b = problemService.hasMaliciousStatusByAcuIdBeforeHours(acuId, evaluateOrderConfig.getBadSuggestionTagType());
if (b) { if (b) {
return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "已被标记为恶意投诉,暂不可投诉"); return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "已被标记为恶意投诉,暂不可投诉");
} }
......
...@@ -539,49 +539,32 @@ ...@@ -539,49 +539,32 @@
<if test="endTime != null and endTime != '' "> <if test="endTime != null and endTime != '' ">
and evaluate_time &lt;= #{endTime} and evaluate_time &lt;= #{endTime}
</if> </if>
<if test="badEvaluateStatus != null or goodEvaluateStatus != null or reviewStatus != null or topHotStatus != null or maliciousStatus != null or goodsCompute != null or storeCompute != null or serviceCompute != null "> <if test="badEvaluateStatus != null ">
and ( and bad_evaluate_status = #{badEvaluateStatus}
<if test="badEvaluateStatus != null or goodEvaluateStatus != null or reviewStatus != null or topHotStatus != null or maliciousStatus != null"> </if>
( 1=1 <if test="goodEvaluateStatus != null ">
<if test="badEvaluateStatus != null "> and good_evaluate_status = #{goodEvaluateStatus}
and bad_evaluate_status = #{badEvaluateStatus} </if>
</if> <if test="reviewStatus != null ">
<if test="goodEvaluateStatus != null "> and review_status = #{reviewStatus}
and good_evaluate_status = #{goodEvaluateStatus} </if>
</if> <if test="topHotStatus != null ">
<if test="reviewStatus != null "> and top_hot_status = #{topHotStatus}
and review_status = #{reviewStatus} </if>
</if> <if test="maliciousStatus != null ">
<if test="topHotStatus != null "> and malicious_status = #{maliciousStatus}
and top_hot_status = #{topHotStatus}
</if>
<if test="maliciousStatus != null ">
and malicious_status = #{maliciousStatus}
</if>
)
</if>
<if test="badEvaluateStatus == null and goodEvaluateStatus == null and reviewStatus == null and topHotStatus == null and maliciousStatus == null">
1=0
</if>
or (
<if test="goodsCompute == null and storeCompute == null and serviceCompute == null">
1=0
</if>
<if test="goodsCompute != null or storeCompute != null or serviceCompute != null">
1=1
<if test="goodsCompute != null and goodsCompute != '' and goodsScore != null ">
and goods_score ${goodsCompute} #{goodsScore}
</if>
<if test="storeCompute != null and storeCompute != '' and storeScore != null ">
and store_score ${storeCompute} #{storeScore}
</if>
<if test="serviceCompute != null and serviceCompute != '' and serviceScore != null ">
and service_score ${serviceCompute} #{serviceScore}
</if>
</if>
)
)
</if> </if>
<if test="goodsCompute != null and goodsCompute != '' and goodsScore != null ">
and goods_score ${goodsCompute} #{goodsScore}
</if>
<if test="storeCompute != null and storeCompute != '' and storeScore != null ">
and store_score ${storeCompute} #{storeScore}
</if>
<if test="serviceCompute != null and serviceCompute != '' and serviceScore != null ">
and service_score ${serviceCompute} #{serviceScore}
</if>
<if test="replyStatus != null "> <if test="replyStatus != null ">
and reply_status = #{replyStatus} and reply_status = #{replyStatus}
</if> </if>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<result column="store_id" jdbcType="INTEGER" property="storeId" /> <result column="store_id" jdbcType="INTEGER" property="storeId" />
<result column="store_name" jdbcType="VARCHAR" property="storeName" /> <result column="store_name" jdbcType="VARCHAR" property="storeName" />
<result column="ecu_id" jdbcType="BIGINT" property="ecuId" /> <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_id" jdbcType="BIGINT" property="memberId" />
<result column="member_name" jdbcType="VARCHAR" property="memberName" /> <result column="member_name" jdbcType="VARCHAR" property="memberName" />
<result column="member_phone" jdbcType="VARCHAR" property="memberPhone" /> <result column="member_phone" jdbcType="VARCHAR" property="memberPhone" />
...@@ -23,7 +24,7 @@ ...@@ -23,7 +24,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <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, 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 malicious_status, malicious_status_time, show_status, status, create_time, update_time
</sql> </sql>
...@@ -39,19 +40,19 @@ ...@@ -39,19 +40,19 @@
</delete> </delete>
<insert id="insert" parameterType="com.gic.evaluate.entity.TabProblem"> <insert id="insert" parameterType="com.gic.evaluate.entity.TabProblem">
insert into tab_problem (problem_id, enterprise_id, store_id, insert into tab_problem (problem_id, enterprise_id, store_id,
store_name, ecu_id, member_id, store_name, ecu_id, acu_id,
member_name, member_phone, member_img_url, member_id, member_name, member_phone,
problem_content, image_url, has_other_image, member_img_url, problem_content, image_url,
problem_status, malicious_status, malicious_status_time, has_other_image, problem_status, malicious_status,
show_status, status, create_time, malicious_status_time, show_status, status,
update_time) create_time, update_time)
values (#{problemId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{storeId,jdbcType=INTEGER}, values (#{problemId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{storeId,jdbcType=INTEGER},
#{storeName,jdbcType=VARCHAR}, #{ecuId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, #{ecuId,jdbcType=BIGINT}, #{acuId,jdbcType=BIGINT},
#{memberName,jdbcType=VARCHAR}, #{memberPhone,jdbcType=VARCHAR}, #{memberImgUrl,jdbcType=VARCHAR}, #{memberId,jdbcType=BIGINT}, #{memberName,jdbcType=VARCHAR}, #{memberPhone,jdbcType=VARCHAR},
#{problemContent,jdbcType=VARCHAR}, #{imageUrl,jdbcType=VARCHAR}, #{hasOtherImage,jdbcType=INTEGER}, #{memberImgUrl,jdbcType=VARCHAR}, #{problemContent,jdbcType=VARCHAR}, #{imageUrl,jdbcType=VARCHAR},
#{problemStatus,jdbcType=INTEGER}, #{maliciousStatus,jdbcType=INTEGER}, #{maliciousStatusTime,jdbcType=TIMESTAMP}, #{hasOtherImage,jdbcType=INTEGER}, #{problemStatus,jdbcType=INTEGER}, #{maliciousStatus,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{maliciousStatusTime,jdbcType=TIMESTAMP}, #{showStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{updateTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabProblem"> <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">
...@@ -74,6 +75,9 @@ ...@@ -74,6 +75,9 @@
<if test="ecuId != null"> <if test="ecuId != null">
ecu_id, ecu_id,
</if> </if>
<if test="acuId != null">
acu_id,
</if>
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
...@@ -133,6 +137,9 @@ ...@@ -133,6 +137,9 @@
<if test="ecuId != null"> <if test="ecuId != null">
#{ecuId,jdbcType=BIGINT}, #{ecuId,jdbcType=BIGINT},
</if> </if>
<if test="acuId != null">
#{acuId,jdbcType=BIGINT},
</if>
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
</if> </if>
...@@ -192,6 +199,9 @@ ...@@ -192,6 +199,9 @@
<if test="ecuId != null"> <if test="ecuId != null">
ecu_id = #{ecuId,jdbcType=BIGINT}, ecu_id = #{ecuId,jdbcType=BIGINT},
</if> </if>
<if test="acuId != null">
acu_id = #{acuId,jdbcType=BIGINT},
</if>
<if test="memberId != null"> <if test="memberId != null">
member_id = #{memberId,jdbcType=BIGINT}, member_id = #{memberId,jdbcType=BIGINT},
</if> </if>
...@@ -243,6 +253,7 @@ ...@@ -243,6 +253,7 @@
store_id = #{storeId,jdbcType=INTEGER}, store_id = #{storeId,jdbcType=INTEGER},
store_name = #{storeName,jdbcType=VARCHAR}, store_name = #{storeName,jdbcType=VARCHAR},
ecu_id = #{ecuId,jdbcType=BIGINT}, ecu_id = #{ecuId,jdbcType=BIGINT},
acu_id = #{acuId,jdbcType=BIGINT},
member_id = #{memberId,jdbcType=BIGINT}, member_id = #{memberId,jdbcType=BIGINT},
member_name = #{memberName,jdbcType=VARCHAR}, member_name = #{memberName,jdbcType=VARCHAR},
member_phone = #{memberPhone,jdbcType=VARCHAR}, member_phone = #{memberPhone,jdbcType=VARCHAR},
...@@ -334,7 +345,7 @@ ...@@ -334,7 +345,7 @@
</if> </if>
</where> </where>
</select> </select>
<select id="listProblemByEcuId" resultType="com.gic.evaluate.dto.ProblemDTO"> <select id="listProblemByAcuId" resultType="com.gic.evaluate.dto.ProblemDTO">
select select
t1.problem_id problemId, t1.problem_id problemId,
t1.enterprise_id enterpriseId, t1.enterprise_id enterpriseId,
...@@ -355,15 +366,15 @@ ...@@ -355,15 +366,15 @@
t3.problemCount t3.problemCount
from tab_problem t1 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 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 order by create_time desc
</select> </select>
<select id="getMaliciousStatusByEcuIdBeforeHours" resultMap="BaseResultMap"> <select id="getMaliciousStatusByAcuIdBeforeHours" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_problem from tab_problem
where status = 1 where status = 1
and ecu_id = #{ecuId} and acu_id = #{acuId}
and malicious_status = 1 and malicious_status = 1
and malicious_status_time &gt; #{date} and malicious_status_time &gt; #{date}
</select> </select>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<result column="replyer_type" jdbcType="INTEGER" property="replyerType" /> <result column="replyer_type" jdbcType="INTEGER" property="replyerType" />
<result column="reply_content" jdbcType="VARCHAR" property="replyContent" /> <result column="reply_content" jdbcType="VARCHAR" property="replyContent" />
<result column="ecu_id" jdbcType="BIGINT" property="ecuId" /> <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_id" jdbcType="BIGINT" property="memberId" />
<result column="member_name" jdbcType="VARCHAR" property="memberName" /> <result column="member_name" jdbcType="VARCHAR" property="memberName" />
<result column="member_img_url" jdbcType="VARCHAR" property="memberImgUrl" /> <result column="member_img_url" jdbcType="VARCHAR" property="memberImgUrl" />
...@@ -19,7 +20,7 @@ ...@@ -19,7 +20,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
problem_reply_id, enterprise_id, problem_id, replyer_type, reply_content, ecu_id, 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, acu_id, member_id, member_name, member_img_url, user_id, user_name, status, create_time,
update_time update_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
...@@ -35,14 +36,16 @@ ...@@ -35,14 +36,16 @@
<insert id="insert" parameterType="com.gic.evaluate.entity.TabProblemReply"> <insert id="insert" parameterType="com.gic.evaluate.entity.TabProblemReply">
insert into tab_problem_reply (problem_reply_id, enterprise_id, problem_id, insert into tab_problem_reply (problem_reply_id, enterprise_id, problem_id,
replyer_type, reply_content, ecu_id, replyer_type, reply_content, ecu_id,
member_id, member_name, member_img_url, acu_id, member_id, member_name,
user_id, user_name, status, member_img_url, user_id, user_name,
create_time, update_time) status, create_time, update_time
)
values (#{problemReplyId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{problemId,jdbcType=INTEGER}, values (#{problemReplyId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{problemId,jdbcType=INTEGER},
#{replyerType,jdbcType=INTEGER}, #{replyContent,jdbcType=VARCHAR}, #{ecuId,jdbcType=BIGINT}, #{replyerType,jdbcType=INTEGER}, #{replyContent,jdbcType=VARCHAR}, #{ecuId,jdbcType=BIGINT},
#{memberId,jdbcType=BIGINT}, #{memberName,jdbcType=VARCHAR}, #{memberImgUrl,jdbcType=VARCHAR}, #{acuId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{memberName,jdbcType=VARCHAR},
#{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{memberImgUrl,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabProblemReply"> <insert id="insertSelective" parameterType="com.gic.evaluate.entity.TabProblemReply">
<selectKey keyProperty="problemReplyId" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="problemReplyId" order="AFTER" resultType="java.lang.Integer">
...@@ -68,6 +71,9 @@ ...@@ -68,6 +71,9 @@
<if test="ecuId != null"> <if test="ecuId != null">
ecu_id, ecu_id,
</if> </if>
<if test="acuId != null">
acu_id,
</if>
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
...@@ -112,6 +118,9 @@ ...@@ -112,6 +118,9 @@
<if test="ecuId != null"> <if test="ecuId != null">
#{ecuId,jdbcType=BIGINT}, #{ecuId,jdbcType=BIGINT},
</if> </if>
<if test="acuId != null">
#{acuId,jdbcType=BIGINT},
</if>
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
</if> </if>
...@@ -156,6 +165,9 @@ ...@@ -156,6 +165,9 @@
<if test="ecuId != null"> <if test="ecuId != null">
ecu_id = #{ecuId,jdbcType=BIGINT}, ecu_id = #{ecuId,jdbcType=BIGINT},
</if> </if>
<if test="acuId != null">
acu_id = #{acuId,jdbcType=BIGINT},
</if>
<if test="memberId != null"> <if test="memberId != null">
member_id = #{memberId,jdbcType=BIGINT}, member_id = #{memberId,jdbcType=BIGINT},
</if> </if>
...@@ -190,6 +202,7 @@ ...@@ -190,6 +202,7 @@
replyer_type = #{replyerType,jdbcType=INTEGER}, replyer_type = #{replyerType,jdbcType=INTEGER},
reply_content = #{replyContent,jdbcType=VARCHAR}, reply_content = #{replyContent,jdbcType=VARCHAR},
ecu_id = #{ecuId,jdbcType=BIGINT}, ecu_id = #{ecuId,jdbcType=BIGINT},
acu_id = #{acuId,jdbcType=BIGINT},
member_id = #{memberId,jdbcType=BIGINT}, member_id = #{memberId,jdbcType=BIGINT},
member_name = #{memberName,jdbcType=VARCHAR}, member_name = #{memberName,jdbcType=VARCHAR},
member_img_url = #{memberImgUrl,jdbcType=VARCHAR}, member_img_url = #{memberImgUrl,jdbcType=VARCHAR},
......
...@@ -8,7 +8,6 @@ import com.gic.download.utils.DataDownloadUtils; ...@@ -8,7 +8,6 @@ import com.gic.download.utils.DataDownloadUtils;
import com.gic.download.utils.DownloadReport; import com.gic.download.utils.DownloadReport;
import com.gic.download.utils.DownloadUtils; import com.gic.download.utils.DownloadUtils;
import com.gic.download.utils.ExecutorPoolSingleton; import com.gic.download.utils.ExecutorPoolSingleton;
import com.gic.enterprise.context.RequestContext;
import com.gic.enterprise.utils.UserDetailUtils; import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.evaluate.constant.ReplyerTypeEnum; import com.gic.evaluate.constant.ReplyerTypeEnum;
import com.gic.evaluate.dto.EvaluateDTO; import com.gic.evaluate.dto.EvaluateDTO;
...@@ -140,7 +139,7 @@ public class EvaluateExportController extends DownloadUtils { ...@@ -140,7 +139,7 @@ public class EvaluateExportController extends DownloadUtils {
List<EvaluateReplyDTO> replyList = evaluateDTO.getReplyList(); List<EvaluateReplyDTO> replyList = evaluateDTO.getReplyList();
List<String> replyMemberContentList = Optional.ofNullable(replyList).orElse(Collections.emptyList()).stream() List<String> replyMemberContentList = Optional.ofNullable(replyList).orElse(Collections.emptyList()).stream()
.filter(e -> ReplyerTypeEnum.MEMBER.getCode().equals(e.getReplyerType())) .filter(e -> ReplyerTypeEnum.MEMBER.getCode().equals(e.getReplyerType()))
.map(e -> simpleDateFormat.format(e.getReplyContent())) .map(EvaluateReplyDTO::getReplyContent)
.collect(Collectors.toList()); .collect(Collectors.toList());
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < replyMemberContentList.size(); i++) { for (int i = 0; i < replyMemberContentList.size(); i++) {
...@@ -153,7 +152,7 @@ public class EvaluateExportController extends DownloadUtils { ...@@ -153,7 +152,7 @@ public class EvaluateExportController extends DownloadUtils {
List<EvaluateReplyDTO> replyList = evaluateDTO.getReplyList(); List<EvaluateReplyDTO> replyList = evaluateDTO.getReplyList();
List<String> replyUserContentList = Optional.ofNullable(replyList).orElse(Collections.emptyList()).stream() List<String> replyUserContentList = Optional.ofNullable(replyList).orElse(Collections.emptyList()).stream()
.filter(e -> ReplyerTypeEnum.USER.getCode().equals(e.getReplyerType())) .filter(e -> ReplyerTypeEnum.USER.getCode().equals(e.getReplyerType()))
.map(e -> simpleDateFormat.format(e.getReplyContent())) .map(EvaluateReplyDTO::getReplyContent)
.collect(Collectors.toList()); .collect(Collectors.toList());
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int i = 0; i < replyUserContentList.size(); i++) { for (int i = 0; i < replyUserContentList.size(); i++) {
......
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