Commit 044fdab5 by chongli

不同的过期会员续费发送不同券功能开发

parent ddc5f75f
......@@ -9,10 +9,14 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ctrip.fun.common.core.exceptions.service.ServiceException;
import com.ctrip.fun.common.core.util.BeanConverter;
......@@ -1056,6 +1060,36 @@ public class VoucherService {
String commune_voucher = clientConfig.getMessage();
this.sendVoucherForPlaceOrderByConfig(uid, orderId, myselfOrder, commune_voucher);
}
/**
*
* @param uid
* @return
* @throws Exception
*/
public void sendVoucherFor360PlaceOrder(String uid,String orderId) throws Exception{
UserExt userExt = this.userExtDao.getByUid(uid);
Date communeEnd = DateUtil.addDateField(userExt.getCommuneAgainTime(),Calendar.YEAR, 1);
String rule_String = null;
JSONObject jsobj = JSONObject.parseObject(clientConfigDao.getByType("chongzhiren_voucher_send_360").getMessage());
JSONArray config_360 = jsobj.getJSONArray("rules");
for(int i=0;i<config_360.size();i++){
rule_String = config_360.get(i).toString();
JSONObject json_rule = JSONObject.parseObject(rule_String);
Date communeEnd_start = DateUtil.parseDateTime(json_rule.getString("communeEnd_start"));
Date communeEnd_end = DateUtil.parseDateTime(json_rule.getString("communeEnd_end"));
if(communeEnd_start.getTime()<communeEnd.getTime()&&communeEnd.getTime()<communeEnd_end.getTime()){
break;
}
}
if(rule_String!=null){
this.sendVoucherForPlaceOrderByConfig(uid,orderId,true,rule_String);
}
}
/**
* 用于执行下单送券
* @param uid 得券人uid
......
......@@ -361,7 +361,11 @@ public class CommuneOrderService extends AbstractOrderService<CommuneOrderBean,
}else{
getUserExtDao().setUserExtVipGradeRenewCommune(order.getUid());
operationMessageService.executeSendMessageOfVipCommune(order, 110);
try {
this.getVoucherService().sendVoucherFor360PlaceOrder(order.getUid(), order.getOrderId()+"");
} catch (Exception e) {
e.printStackTrace();
}
}
}
......
......@@ -8,6 +8,7 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import com.ctrip.fun.common.core.util.DateUtil;
import com.ctrip.fun.common.vo.order.OrderCategoryEnum;
import com.ctrip.fun.golf.dao.market.CommuneInviteActivityDao;
import com.ctrip.fun.golf.dao.order.CommuneOrderItemDao;
......@@ -68,7 +69,7 @@ public class CommuneNotifyService extends AbstractNotifyService {
}
}else if(order.getAmount().intValue()==360){
//1:执行续费人的小程序送券
voucherService.sendVoucherForPlaceOrder(uid, order.getOrderId()+"", true, "chongzhiren_voucher_send_360");
voucherService.sendVoucherFor360PlaceOrder(order.getUid(), order.getOrderId()+"");
}
}
}
......@@ -113,6 +114,13 @@ public class CommuneNotifyService extends AbstractNotifyService {
}else{
getUserExtDao().setUserExtVipGradeRenewCommune(order.getUid());
sendMessage(order, 110);
//1:执行续费送券逻辑
try {
voucherService.sendVoucherFor360PlaceOrder(order.getUid(), order.getOrderId()+"");
} catch (Exception e) {
e.printStackTrace();
}
}
}
......
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 sign in to comment