|
@@ -15,6 +15,7 @@ import com.caimei365.user.model.po.VipPayHistoryPo;
|
|
|
import com.caimei365.user.model.vo.*;
|
|
|
import com.caimei365.user.service.BaseService;
|
|
|
import com.caimei365.user.utils.*;
|
|
|
+import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -23,6 +24,8 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
@@ -467,11 +470,26 @@ public class BaseServiceImpl implements BaseService {
|
|
|
//1.封装vipDto看超级会员是否过期,0未开通,-1过期,1未过期
|
|
|
SuperVipDto vipEnd = findEnd(userId);
|
|
|
Map<String, Object> map = new HashMap(3);
|
|
|
+ try {
|
|
|
+ if(vipEnd.getVipFlag().equals(1)){
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String mat = format.format(vipEnd.getEndTime());
|
|
|
+ Date parse = format.parse(mat);
|
|
|
+ vipEnd.setEndTime(parse);
|
|
|
+ }
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
map.put("vip", vipEnd);
|
|
|
//2.查当月vip优惠卷
|
|
|
String nowMonth = DateUtil.getNowMonth();
|
|
|
List<CouponVo> vipCoupon = vipMapper.findVipCoupon(userId, nowMonth);
|
|
|
List<Integer> couponGet = vipMapper.findCouponGet(userId, nowMonth);
|
|
|
+ List<Integer> couponUse = vipMapper.findCouponUse(userId, nowMonth);
|
|
|
+ if (couponUse != null && couponUse.size() > 0) {
|
|
|
+ //couponuse有就给2,没有就给1,2使用1未用
|
|
|
+ vipCoupon.forEach(couponVo -> couponVo.setUseStatus(couponUse.contains(couponVo.getCouponId()) ? 2 : 1));
|
|
|
+ }
|
|
|
vipCoupon.forEach(couponVo -> couponVo.setGetFlag(couponGet.contains(couponVo.getCouponId()) ? 1 : 0));
|
|
|
map.put("coupon", vipCoupon);
|
|
|
return ResponseJson.success(map);
|