|
@@ -7,17 +7,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.miaxis.common.utils.DateUtils;
|
|
|
-import com.miaxis.newgzpt.domain.GzptSchActivation;
|
|
|
-import com.miaxis.newgzpt.domain.GzptSchPayConfig;
|
|
|
-import com.miaxis.newgzpt.domain.GzptSchPayLog;
|
|
|
-import com.miaxis.newgzpt.domain.GzptUserInfo;
|
|
|
-import com.miaxis.newgzpt.service.IGzptSchActivationService;
|
|
|
-import com.miaxis.newgzpt.service.IGzptSchPayConfigService;
|
|
|
-import com.miaxis.newgzpt.service.IGzptSchPayLogService;
|
|
|
-import com.miaxis.newgzpt.service.IGzptUserInfoService;
|
|
|
import com.miaxis.userInfo.domain.UserVip;
|
|
|
import com.miaxis.userInfo.service.IUserVipService;
|
|
|
-import com.miaxis.wx.domain.WxJsOrder;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -109,9 +100,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
gzptSchPayLog.setCrtime(new Date());
|
|
|
|
|
|
|
|
|
-
|
|
|
- } else if ("科一专项VIP".equals(orderInfo.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if ("科一专项VIP".equals(goodsName)) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(userId);
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
|
Date km1Date = userVip.getSubject1();
|
|
@@ -181,8 +171,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
userVipService.save(uv);
|
|
|
this.save(orderInfo);
|
|
|
}
|
|
|
- } else if ("科三专项VIP".equals(orderInfo.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ } else if ("科三专项VIP".equals(goodsName)) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(userId);
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
|
Date km3Date = userVip.getSubject3();
|
|
@@ -244,8 +234,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
} else {
|
|
|
//新增会员信息
|
|
|
UserVip uv = new UserVip();
|
|
|
- uv.setUserId(order.getUserId());
|
|
|
- uv.setUserName(order.getUserName());
|
|
|
+ uv.setUserId(userId);
|
|
|
+ uv.setUserName(userName);
|
|
|
long x = now.getTime() + oneYearLong;
|
|
|
Date km4oneYear = new Date(x);
|
|
|
uv.setSubject4(km4oneYear);
|
|
@@ -253,231 +243,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
this.save(orderInfo);
|
|
|
}
|
|
|
|
|
|
- } else if ("科目一二三四所有付费权益".equals(orderInfo.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
- if (userVip != null) {
|
|
|
- //修改会员信息
|
|
|
- Date km1Date = userVip.getSubject1();
|
|
|
- Date km2Date = userVip.getSubject2();
|
|
|
- Date km3Date = userVip.getSubject3();
|
|
|
- Date km4Date = userVip.getSubject4();
|
|
|
- if (km1Date != null) { //科目一处理
|
|
|
- long x = km1Date.getTime() + oneYearLong;
|
|
|
- Date km1oneYear = new Date(x);
|
|
|
- userVip.setSubject1(km1oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km1oneYear = new Date(x);
|
|
|
- userVip.setSubject1(km1oneYear);
|
|
|
- }
|
|
|
- if (km2Date != null) { //科目二处理
|
|
|
- long x = km2Date.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- }
|
|
|
- if (km3Date != null) { //科目三处理
|
|
|
- long x = km3Date.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- }
|
|
|
- if (km4Date != null) { //科目四处理
|
|
|
- long x = km4Date.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
- } else {
|
|
|
- //新增会员信息
|
|
|
- UserVip uv = new UserVip();
|
|
|
- uv.setUserId(order.getUserId());
|
|
|
- uv.setUserName(order.getUserName());
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date oneYear = new Date(x);
|
|
|
- uv.setSubject1(oneYear);
|
|
|
- uv.setSubject2(oneYear);
|
|
|
- uv.setSubject3(oneYear);
|
|
|
- uv.setSubject4(oneYear);
|
|
|
- userVipService.save(uv);
|
|
|
- this.save(orderInfo);
|
|
|
- }
|
|
|
- } else if ("科一+科四VIP".equals(orderInfo.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
- if (userVip != null) {
|
|
|
- //修改会员信息
|
|
|
- Date km1Date = userVip.getSubject1();
|
|
|
- Date km4Date = userVip.getSubject4();
|
|
|
- if (km1Date != null) { //科目一处理
|
|
|
- long x = km1Date.getTime() + oneYearLong;
|
|
|
- Date km1oneYear = new Date(x);
|
|
|
- userVip.setSubject1(km1oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km1oneYear = new Date(x);
|
|
|
- userVip.setSubject1(km1oneYear);
|
|
|
- }
|
|
|
- if (km4Date != null) { //科目四处理
|
|
|
- long x = km4Date.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
- } else {
|
|
|
- //新增会员信息
|
|
|
- UserVip uv = new UserVip();
|
|
|
- uv.setUserId(order.getUserId());
|
|
|
- uv.setUserName(order.getUserName());
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date oneYear = new Date(x);
|
|
|
- uv.setSubject1(oneYear);
|
|
|
- uv.setSubject4(oneYear);
|
|
|
- userVipService.save(uv);
|
|
|
- this.save(orderInfo);
|
|
|
- }
|
|
|
- } else if ("科二+科三VIP".equals(orderInfo.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
- if (userVip != null) {
|
|
|
- //修改会员信息
|
|
|
- Date km2Date = userVip.getSubject2();
|
|
|
- Date km3Date = userVip.getSubject3();
|
|
|
- if (km2Date != null) { //科目二处理
|
|
|
- long x = km2Date.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- }
|
|
|
- if (km3Date != null) { //科目三处理
|
|
|
- long x = km3Date.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
- } else {
|
|
|
- //新增会员信息
|
|
|
- UserVip uv = new UserVip();
|
|
|
- uv.setUserId(order.getUserId());
|
|
|
- uv.setUserName(order.getUserName());
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date oneYear = new Date(x);
|
|
|
- uv.setSubject2(oneYear);
|
|
|
- uv.setSubject3(oneYear);
|
|
|
- userVipService.save(uv);
|
|
|
- this.save(orderInfo);
|
|
|
- }
|
|
|
- } else if ("科二+科三+科四".equals(orderInfo.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
- if (userVip != null) {
|
|
|
- //修改会员信息
|
|
|
- Date km2Date = userVip.getSubject2();
|
|
|
- Date km3Date = userVip.getSubject3();
|
|
|
- Date km4Date = userVip.getSubject4();
|
|
|
- if (km2Date != null) { //科目二处理
|
|
|
- long x = km2Date.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- }
|
|
|
- if (km3Date != null) { //科目三处理
|
|
|
- long x = km3Date.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- }
|
|
|
- if (km4Date != null) { //科目四处理
|
|
|
- long x = km4Date.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
- } else {
|
|
|
- //新增会员信息
|
|
|
- UserVip uv = new UserVip();
|
|
|
- uv.setUserId(order.getUserId());
|
|
|
- uv.setUserName(order.getUserName());
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date oneYear = new Date(x);
|
|
|
- uv.setSubject2(oneYear);
|
|
|
- uv.setSubject3(oneYear);
|
|
|
- uv.setSubject4(oneYear);
|
|
|
- userVipService.save(uv);
|
|
|
- this.save(orderInfo);
|
|
|
- }
|
|
|
- } else if ("科三+科四VIP".equals(orderInfo.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(orderInfo.getUserId());
|
|
|
- if (userVip != null) {
|
|
|
- //修改会员信息
|
|
|
- Date km3Date = userVip.getSubject3();
|
|
|
- Date km4Date = userVip.getSubject4();
|
|
|
- if (km3Date != null) { //科目三处理
|
|
|
- long x = km3Date.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- }
|
|
|
- if (km4Date != null) { //科目四处理
|
|
|
- long x = km4Date.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- } else {
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
- } else {
|
|
|
- //新增会员信息
|
|
|
- UserVip uv = new UserVip();
|
|
|
- uv.setUserId(order.getUserId());
|
|
|
- uv.setUserName(order.getUserName());
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date oneYear = new Date(x);
|
|
|
- uv.setSubject3(oneYear);
|
|
|
- uv.setSubject4(oneYear);
|
|
|
- userVipService.save(uv);
|
|
|
- this.save(orderInfo);
|
|
|
- }
|
|
|
- } else if ("全科目超级VIP".equals(order.getGoodsName())) {
|
|
|
- UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ } else if ("科目一二三四所有付费权益".equals(goodsName)) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(userId);
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
|
Date km1Date = userVip.getSubject1();
|
|
@@ -525,8 +292,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
} else {
|
|
|
//新增会员信息
|
|
|
UserVip uv = new UserVip();
|
|
|
- uv.setUserId(order.getUserId());
|
|
|
- uv.setUserName(order.getUserName());
|
|
|
+ uv.setUserId(userId);
|
|
|
+ uv.setUserName(userName);
|
|
|
long x = now.getTime() + oneYearLong;
|
|
|
Date oneYear = new Date(x);
|
|
|
uv.setSubject1(oneYear);
|
|
@@ -540,13 +307,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void writeVipDataToDb(String goodsName, Long userId, String userName, String outTrandeNo, Integer total, Integer payType, String dqbh, String dqmc, int isStare, String school, String schoolName, int schoolCommission, int phoneType) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //原来套餐
|
|
|
@Override
|
|
|
public void writeVipDataToDb(String goodsName, Long userId, String userName, String outTrandeNo, Integer total, Integer payType) {
|
|
|
long oneYearLong = 1000 * 60 * 60 * 24 * 365l;
|