Authored by mingdan.ge

cps增加订单x倍返活动补偿接口

... ... @@ -109,6 +109,7 @@
<value>/UnionShareRest/toAddVirtual</value>
<value>/UnionShareRest/dealExtraActivityTask</value>
<value>/UnionShareRest/dealNewUserActivityTask</value>
<value>/UnionShareRest/reParticipateActivity</value>
<value>/UnionShareRest/clearActivity</value>
<value>/UnionShareRest/getStatisticsInfo</value>
<value>/UnionShareRest/queryUnionShareOrdersMonthList</value>
... ...
... ... @@ -421,6 +421,17 @@ public class UnionShareRest {
}
/**
* 手动判断参加订单x倍返活动
* */
@RequestMapping("/reParticipateActivity")
@ResponseBody
public UnionResponse reParticipateActivity(String ordercodes){
log.info("UnionShareRest.reParticipateActivity ordercodes is {}.",ordercodes);
unionShareService.reParticipateActivity(ordercodes);
return new UnionResponse(200, "reParticipateActivity success");
}
/**
* 清活动缓存
* */
@RequestMapping("/clearActivity")
... ...
... ... @@ -231,6 +231,11 @@ public interface IUnionShareService {
PageResponseBO<UnionShareOrdersMonth> queryUnionShareOrdersMonthList(UnionShareOrdersMonthReqBO req);
void clearActivityCache(int activityId);
/**
* 手动重新判断绑定订单x倍返
* */
void reParticipateActivity(String ordercodes);
/**
* 查询消息列表
... ...
... ... @@ -1900,6 +1900,32 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
return list;
}
@Override
@Database(ForceMaster = true)
public void reParticipateActivity(String ordercodes) {
logger.info("reParticipateActivity,ordercodes is {}.",ordercodes);
List<String> orderCodeList = Arrays.stream(ordercodes.split(",")).collect(Collectors.toList());
List<UnionShareOrders> orders = unionShareOrdersMapper.selectListByOrderCodesForActivity(orderCodeList);
orders.forEach(order->{
if (order.getActivityId() > 0) {
logger.info("reParticipateActivity,has participated,ordercode is {}.",order.getOrderCode());
return;
}
//活动返利
try {
List<UnionShareOrdersActivity> activityList = queryActivityByDate(order.getOrderTime());
for (UnionShareOrdersActivity a :activityList ) {
if(participateActivity(order,a)) {
//参加了活动,参加一个加返活动就可以了
break;
}
}
} catch (Exception e) {
logger.warn("reParticipateActivity warn,fail to handle some activities.order is {}",order);
}
});
}
/**
* 参加加倍返活动
* */
... ...