Browse Source

0元核销异常修复;bir_act脏数据修复;

v1.0
Yen 2 years ago
parent
commit
9c66ddc3ce
  1. 3
      src/main/java/com/qs/serve/modules/bir/service/impl/BirActivityCenterGoodsServiceImpl.java
  2. 18
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java
  3. 26
      src/main/resources/mapper/bir/BirActivityCenterGoodsMapper.xml
  4. 3
      src/main/resources/mapper/bms/BmsChannelPointMapper.xml

3
src/main/java/com/qs/serve/modules/bir/service/impl/BirActivityCenterGoodsServiceImpl.java

@ -88,6 +88,9 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe
if(activityCenterGoodsAllList.size()<1){ if(activityCenterGoodsAllList.size()<1){
return; return;
} }
//添加支持:活动明细删除了,在bir_activity_center_goods还存在
// 删除历史数据 // 删除历史数据
List<Long> activityIds = activityCenterGoodsAllList.stream().filter(a->a.getId()!=null) List<Long> activityIds = activityCenterGoodsAllList.stream().filter(a->a.getId()!=null)
.map(TbsActivityCenterGoods::getActivityId).collect(Collectors.toList()); .map(TbsActivityCenterGoods::getActivityId).collect(Collectors.toList());

18
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java

@ -957,8 +957,9 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
List<VtbVerificationSubjectBo> subjectBoList = verificationBo.getSubjectList(); List<VtbVerificationSubjectBo> subjectBoList = verificationBo.getSubjectList();
int countCode = 1; int countCode = 1;
for (VtbVerificationSubjectBo subjectBo : subjectBoList) { for (VtbVerificationSubjectBo subjectBo : subjectBoList) {
boolean isCheckZero = subjectBo.getAmount().compareTo(BigDecimal.ZERO)==0;
//忽略金额为0的数据 //忽略金额为0的数据
if (subjectBo.getAmount() == null || subjectBo.getAmount().compareTo(BigDecimal.ZERO) < 1) { if (subjectBo.getAmount() != null && subjectBo.getAmount().compareTo(BigDecimal.ZERO) < 1) {
continue; continue;
} }
BmsSubject subject = subjectService.getById(subjectBo.getSubjectId()); BmsSubject subject = subjectService.getById(subjectBo.getSubjectId());
@ -970,6 +971,8 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
break; break;
} }
} }
//兼容支持非0元核销
if(!isCheckZero){
List<VtbFundFlow> subjectFundFlowItems = funFlowListMap.get(subject.getId()); List<VtbFundFlow> subjectFundFlowItems = funFlowListMap.get(subject.getId());
BigDecimal totalSubjectUsedAmount = BigDecimal.ZERO; BigDecimal totalSubjectUsedAmount = BigDecimal.ZERO;
if (CollectionUtil.isNotEmpty(subjectFundFlowItems)) { if (CollectionUtil.isNotEmpty(subjectFundFlowItems)) {
@ -981,6 +984,8 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
if (totalSubjectUsedAmount.compareTo(currentActivitySubject.getAmount()) > 0) { if (totalSubjectUsedAmount.compareTo(currentActivitySubject.getAmount()) > 0) {
Assert.throwEx("费用类型[" + subject.getSubjectName() + "]超额"); Assert.throwEx("费用类型[" + subject.getSubjectName() + "]超额");
} }
}
//保存费用结果 //保存费用结果
VtbVerificationSubject verificationSubject = new VtbVerificationSubject(); VtbVerificationSubject verificationSubject = new VtbVerificationSubject();
verificationSubject.setVerificationSubCode(verificationCode+"_"+countCode); verificationSubject.setVerificationSubCode(verificationCode+"_"+countCode);
@ -1013,6 +1018,17 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
public void successCommit(Long verificationId) { public void successCommit(Long verificationId) {
log.info("活动核销提交成功。verificationId:{}",verificationId); log.info("活动核销提交成功。verificationId:{}",verificationId);
VtbVerification verification = this.getById(verificationId); VtbVerification verification = this.getById(verificationId);
boolean checkZero = verification.getAmount().compareTo(BigDecimal.ZERO)==0;
//0元核销只改变状态
if(checkZero){
fundFlowService.flushActivityAmount(verification.getActivityId());
verification = new VtbVerification();
verification.setId(verificationId);
verification.setVerificationState(VtbVerificationState.Finished.getCode());
verification.setFinishedTime(LocalDateTime.now());
super.updateById(verification);
return;
}
TbsActivity activity = activityService.getById(verification.getActivityId()); TbsActivity activity = activityService.getById(verification.getActivityId());
TbsCostApply costApply = costApplyService.getById(activity.getCostApplyId()); TbsCostApply costApply = costApplyService.getById(activity.getCostApplyId());
//移除历史数据 //移除历史数据

26
src/main/resources/mapper/bir/BirActivityCenterGoodsMapper.xml

@ -134,24 +134,16 @@
</select> </select>
<select id="selectNoExistCenterGoods" resultType="com.qs.serve.modules.bir.entity.BirActivityCenterGoods"> <select id="selectNoExistCenterGoods" resultType="com.qs.serve.modules.bir.entity.BirActivityCenterGoods">
select SELECT
bir_activity_center_goods.* *
from bir_activity_center_goods FROM
left join tbs_activity_center_goods bir_activity_center_goods
on tbs_activity_center_goods.id = bir_activity_center_goods.activity_center_goods_id left join tbs_activity ON bir_activity_center_goods.activity_id = tbs_activity.id
left join `tbs_cost_apply` left join `tbs_cost_apply` on `bir_activity_center_goods`.cost_apply_id = `tbs_cost_apply`.id
on `bir_activity_center_goods`.cost_apply_id = `tbs_cost_apply`.id
where where
( tbs_cost_apply.del_flag = 1 or tbs_cost_apply.id is null
tbs_cost_apply.id is null and tbs_activity.id is null or tbs_activity.del_flag = 1
and tbs_activity_center_goods.id is null
)
or (
tbs_activity_center_goods.del_flag = 1
and tbs_cost_apply.del_flag = 1
and tbs_cost_apply.cancel_flag = 1
and tbs_cost_apply.charge_state not in (2,3)
)
</select> </select>
<select id="listMonthCusCenterVo" <select id="listMonthCusCenterVo"

3
src/main/resources/mapper/bms/BmsChannelPointMapper.xml

@ -111,7 +111,7 @@
<if test="query.updateBy != null and query.updateBy != ''"> and `bms_channel_point`.`update_by` = #{query.updateBy}</if> <if test="query.updateBy != null and query.updateBy != ''"> and `bms_channel_point`.`update_by` = #{query.updateBy}</if>
<if test="query.costFlag != null and query.costFlag != ''"> and `bms_channel_point`.`cost_flag` = #{query.costFlag}</if> <if test="query.costFlag != null and query.costFlag != ''"> and `bms_channel_point`.`cost_flag` = #{query.costFlag}</if>
</where> </where>
ORDER BY `bms_channel_point`.`create_time` DESC ORDER BY `bms_channel_point`.`id` DESC
</select> </select>
@ -351,6 +351,7 @@
<if test="query.id != null"> and `bms_channel_point`.`id` = #{query.id}</if> <if test="query.id != null"> and `bms_channel_point`.`id` = #{query.id}</if>
<if test="query.channelId != null"> and `bms_channel_point`.`channel_id` = #{query.channelId}</if> <if test="query.channelId != null"> and `bms_channel_point`.`channel_id` = #{query.channelId}</if>
<if test="query.channelName != null and query.channelName != ''"> and `bms_channel_point`.`channel_name` like concat('%',#{query.channelName},'%') </if> <if test="query.channelName != null and query.channelName != ''"> and `bms_channel_point`.`channel_name` like concat('%',#{query.channelName},'%') </if>
<if test="query.channelCode != null and query.channelCode != ''"> and `bms_channel_point`.`channel_code` like concat('%',#{query.channelCode},'%') </if>
<if test="query.pointCode != null and query.pointCode != ''"> and `bms_channel_point`.`point_code` like concat('%',#{query.pointCode},'%') </if> <if test="query.pointCode != null and query.pointCode != ''"> and `bms_channel_point`.`point_code` like concat('%',#{query.pointCode},'%') </if>
<if test="query.pointName != null and query.pointName != ''"> and `bms_channel_point`.`point_name` like concat('%',#{query.pointName},'%') </if> <if test="query.pointName != null and query.pointName != ''"> and `bms_channel_point`.`point_name` like concat('%',#{query.pointName},'%') </if>
<if test="query.shopArea != null and query.shopArea != ''"> and `bms_channel_point`.`shop_area` = #{query.shopArea}</if> <if test="query.shopArea != null and query.shopArea != ''"> and `bms_channel_point`.`shop_area` = #{query.shopArea}</if>

Loading…
Cancel
Save