Commit 630fa234 by Huang Linyu

IWAN-160 社员身份识别-赛事分组导出的社员和嘉宾不一致

parent 962488df
......@@ -5,6 +5,7 @@ package com.ctrip.fun.golf.service.order;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.UUID;
......@@ -25,6 +26,7 @@ import com.ctrip.fun.common.vo.ResponseStatusEnum;
import com.ctrip.fun.common.vo.basic.AbstractRuleConditionBean;
import com.ctrip.fun.common.vo.basic.CourseRuleConditionBaseBean;
import com.ctrip.fun.common.vo.basic.MultipleCourseConditionBean;
import com.ctrip.fun.common.vo.basic.VipGradeEnum;
import com.ctrip.fun.common.vo.order.AbstractOrderBean;
import com.ctrip.fun.common.vo.order.AbstractOrderListItemBean;
import com.ctrip.fun.common.vo.order.CourseOrderResourceBean;
......@@ -1134,7 +1136,21 @@ public abstract class AbstractOrderService<H extends AbstractOrderBean<T>, T> ex
customerInfo.setGender(customerInfoBean.getGender() == null ? "" : customerInfoBean.getGender());
customerInfo.setMobileNo(customerInfoBean.getMobileNo() == null ? "" : customerInfoBean.getMobileNo());
customerInfo.setBaby(customerInfoBean.getBaby() == null ? false : customerInfoBean.getBaby());
customerInfo.setCommuneFlag(customerInfoBean.getCommuneFlag() == null ? false : customerInfoBean.getCommuneFlag());
//TODO 社员标记应
//customerInfo.setCommuneFlag(customerInfoBean.getCommuneFlag() == null ? false : customerInfoBean.getCommuneFlag());
UserExt user = this.getUserExtDao().GetUserExtInfoByPhone(customerInfoBean.getMobileNo());
if(user!=null){
if(checkIfCommuneUser(user)){
customerInfo.setCommuneFlag(true);
}else{
customerInfo.setCommuneFlag(false);
}
}else{
customerInfo.setCommuneFlag(false);
}
customerInfo.setHandicap(customerInfoBean.getHandicap());
customerInfo.setOneselfFlag(customerInfoBean.getOneselfFlag() == null ? true : customerInfoBean.getOneselfFlag());
Integer customerId = customerInfoDao.save(customerInfo);
......@@ -1142,6 +1158,26 @@ public abstract class AbstractOrderService<H extends AbstractOrderBean<T>, T> ex
}
}
private boolean checkIfCommuneUser(UserExt userExt) {
boolean isCommuneUser = (userExt.getVipGrade() & VipGradeEnum.VIP2.getKey()) == VipGradeEnum.VIP2
.getKey();
//社员续费 add by caosy
Date startTime = (userExt.getCommuneAgainTime() == null? userExt.getCommuneTime():userExt.getCommuneAgainTime());
if(startTime != null){
Date outDate = DateUtil.addDateField(startTime,Calendar.YEAR, 1);
long dayFromOutDate = DateUtil.getDistinceDay(new Date(), outDate);
long a = dayFromOutDate;
if (dayFromOutDate < 0) {
// 代表已经过期
isCommuneUser = false;
}
}else{
logger.error("get commune time fail:"+userExt.getUid());
}
return isCommuneUser;
}
private void saveInsuranceInfo(H abstractOrderBean, Integer orderId, Long orderNo) {
if (!CollectionUtils.isEmpty(abstractOrderBean.getInsuranceInfoVoList())) {
insuranceInfoDao.save(orderId, abstractOrderBean.getInsuranceInfoVoList());
......
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