Commit ca498b15 by 章家宝

Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0

2 parents 65a90036 040e9bac
...@@ -57,4 +57,12 @@ public class EffectiveReferralReviewCommonDTO extends EffectiveReferralReview { ...@@ -57,4 +57,12 @@ public class EffectiveReferralReviewCommonDTO extends EffectiveReferralReview {
@ApiModelProperty(notes = "是否可编辑:0-不可编辑,1-可编辑") @ApiModelProperty(notes = "是否可编辑:0-不可编辑,1-可编辑")
private Integer updateFlag; private Integer updateFlag;
@ApiModelProperty(notes = "周期开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date cycleStartDate;
@ApiModelProperty(notes = "周期结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date cycleEndDate;
} }
\ No newline at end of file \ No newline at end of file
...@@ -65,7 +65,11 @@ public class EffectiveReferralReviewMiniProgramService { ...@@ -65,7 +65,11 @@ public class EffectiveReferralReviewMiniProgramService {
//特殊逻辑:根据商户门店id去重,根据门店首字母倒序。要根据门店的不同业务场景的数据判断是否已提交和未提交。 //特殊逻辑:根据商户门店id去重,根据门店首字母倒序。要根据门店的不同业务场景的数据判断是否已提交和未提交。
//不同业务场景`scene_type` '业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保 状态`status` '状态:0-未提交,1-草稿,2-已提交',全部为已提交时,总的提交状态submitStatus才是已提交。 //不同业务场景`scene_type` '业务场景:1-精品升级(轻改);2-会员权益(广联权益);3-单延保 状态`status` '状态:0-未提交,1-草稿,2-已提交',全部为已提交时,总的提交状态submitStatus才是已提交。
//注意:要跟服务商户表dj_car_life_service_merchant根据`merchant_id`关联,用于筛选项门店搜索,sal_effective_referral_review作为主表 //注意:要跟服务商户表dj_car_life_service_merchant根据`merchant_id`关联,用于筛选项门店搜索,sal_effective_referral_review作为主表
request.getMerchantIds().addAll(Lists.newArrayList(44211832,44209298,44209902,44209880)); // request.getMerchantIds().addAll(Lists.newArrayList(44211832,44209298,44209902,44209880));
if (CollectionUtils.isEmpty(request.getMerchantIds())) {
log.info("门店有效引荐数列表MerchantIds为空");
return Collections.emptyList();
}
log.info("门店有效引荐数列表MerchantIds:{}", JSON.toJSONString(request.getMerchantIds())); log.info("门店有效引荐数列表MerchantIds:{}", JSON.toJSONString(request.getMerchantIds()));
List<EffectiveReferralReviewCommonDTO> list = effectiveReferralReviewMapper.selectStoreList(request); List<EffectiveReferralReviewCommonDTO> list = effectiveReferralReviewMapper.selectStoreList(request);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
......
...@@ -100,16 +100,23 @@ public class EffectiveReferralReviewService { ...@@ -100,16 +100,23 @@ public class EffectiveReferralReviewService {
* @return 门店列表 * @return 门店列表
*/ */
public RpcPagination<EffectiveReferralReviewCommonDTO> effectiveReferralAuditPage(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) { public RpcPagination<EffectiveReferralReviewCommonDTO> effectiveReferralAuditPage(RpcPagination<EffectiveReferralReviewCommonDTO> pagination) {
//1、查询需要复核的有效引荐数列表 //1、查询T1时间配置
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
//2、查询需要复核的有效引荐数列表
Page<EffectiveReferralReviewCommonDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize()); Page<EffectiveReferralReviewCommonDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
if (Objects.nonNull(performanceTimeCycleDTO)
&& performanceTimeCycleDTO.getStartDate() != null
&& performanceTimeCycleDTO.getEndDate() != null) {
pagination.getCondition().setCycleStartDate(performanceTimeCycleDTO.getStartDate());
pagination.getCondition().setCycleEndDate(performanceTimeCycleDTO.getEndDate());
}
List<EffectiveReferralReviewCommonDTO> list = effectiveReferralReviewMapper.selectStoreEffectiveReferralList(pagination.getCondition()); List<EffectiveReferralReviewCommonDTO> list = effectiveReferralReviewMapper.selectStoreEffectiveReferralList(pagination.getCondition());
if(CollectionUtils.isEmpty(list)) { if(CollectionUtils.isEmpty(list)) {
return new RpcPagination<>(); return new RpcPagination<>();
} }
//2、查询T1时间配置
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
//3、当前时间年月是否比核查时间晚并超过1个月, 则不可编辑 //3、当前时间年月是否比核查时间晚并超过1个月, 则不可编辑
long monthDiff = getMonthDiff(list.get(0).getReviewMonth()); long monthDiff = getMonthDiff(list.get(0).getReviewMonth());
......
...@@ -103,28 +103,18 @@ ...@@ -103,28 +103,18 @@
WHERE serr.deleted_flag = 'N' WHERE serr.deleted_flag = 'N'
<if test="isReviewed != null and isReviewed == 0"> <if test="isReviewed != null and isReviewed == 0">
AND serr.is_reviewed = #{isReviewed} AND serr.is_reviewed = #{isReviewed}
AND now() BETWEEN <if test="cycleStartDate != null and cycleEndDate != null">
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'), AND now() &gt;= #{cycleStartDate} AND now() &lt;= #{cycleEndDate}
(SELECT start_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)), </if>
'%Y-%m-%d %H:%i:%s')
AND
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'),
(SELECT end_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)),
'%Y-%m-%d %H:%i:%s')
</if> </if>
<if test="isReviewed != null and isReviewed == 1"> <if test="isReviewed != null and isReviewed == 1">
AND serr.is_reviewed = #{isReviewed} AND serr.is_reviewed = #{isReviewed}
</if> </if>
<if test="isReviewed != null and isReviewed == 2"> <if test="isReviewed != null and isReviewed == 2 and cycleStartDate != null and cycleEndDate != null">
AND serr.is_reviewed = 0 AND (now() &lt; #{cycleStartDate} OR now() &gt; #{cycleEndDate})
</if>
<if test="isReviewed != null and isReviewed == 2 and cycleStartDate == null and cycleEndDate == null">
AND serr.is_reviewed = #{isReviewed} AND serr.is_reviewed = #{isReviewed}
AND now() NOT BETWEEN
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'),
(SELECT start_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)),
'%Y-%m-%d %H:%i:%s')
AND
STR_TO_DATE(CONCAT(DATE_FORMAT(now(), '%Y-%m-'),
(SELECT end_day_of_month FROM dj_car_life_performance_time_cycle ORDER BY id LIMIT 1)),
'%Y-%m-%d %H:%i:%s')
</if> </if>
<if test="merchantId != null"> <if test="merchantId != null">
AND serr.merchant_id = #{merchantId} AND serr.merchant_id = #{merchantId}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!