|
@@ -5,6 +5,7 @@ import com.miaxis.newgzpt.domain.GzptSchActivation;
|
|
|
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.order.domain.OrderInfo;
|
|
@@ -44,6 +45,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
@Autowired
|
|
|
private IGzptSchPayLogService schPayLogService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IGzptSchPayConfigService schPayConfigService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询订单信息列表
|
|
|
*
|
|
@@ -66,7 +70,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
long oneYearLong = 1000 * 60 * 60 * 24 * 365l;
|
|
|
Date now = new Date();
|
|
|
|
|
|
- GzptUserInfo gzptUserInfo = userInfoService.getInfoById(order.getUserId());
|
|
|
OrderInfo orderInfo = new OrderInfo();
|
|
|
orderInfo.setGoodsName(order.getGoodsName());
|
|
|
orderInfo.setUserId(order.getUserId());
|
|
@@ -75,158 +78,767 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
orderInfo.setTradeType(1);
|
|
|
orderInfo.setSuccessTime(now);
|
|
|
orderInfo.setPayType(payType);
|
|
|
+ orderInfo.setDqbh(order.getDqbh());
|
|
|
+ orderInfo.setDqmc(order.getDqmc());
|
|
|
+ orderInfo.setSchool(order.getSchool());
|
|
|
+ orderInfo.setSchoolName(order.getSchoolName());
|
|
|
+ orderInfo.setSchoolCommission(order.getSchoolCommission());
|
|
|
+ orderInfo.setPhoneType(order.getPhoneType());
|
|
|
|
|
|
|
|
|
+ GzptUserInfo userInfo = userInfoService.getInfoById(order.getUserId());
|
|
|
|
|
|
- if("理论计时".equals(order.getGoodsName())) {
|
|
|
+ if ("理论计时".equals(order.getGoodsName())) {
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科一专项VIP(含计时)".equals(order.getGoodsName())) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if (userVip != null) {
|
|
|
+ //修改会员信息
|
|
|
+ Date km1Date = userVip.getSubject1();
|
|
|
+ if (km1Date != null) { //存在会员时间
|
|
|
+ if (km1Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km1oneYear = new Date(x);
|
|
|
+ userVip.setSubject1(km1oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km1Date.getTime() + oneYearLong;
|
|
|
+ Date km1oneYear = new Date(x);
|
|
|
+ userVip.setSubject1(km1oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } else {
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km1oneYear = new Date(x);
|
|
|
+ userVip.setSubject1(km1oneYear);
|
|
|
+ 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 km1oneYear = new Date(x);
|
|
|
+ uv.setSubject1(km1oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
//激活操作
|
|
|
- saveActiva(order, gzptUserInfo);
|
|
|
- //插入日志表
|
|
|
- savePayLog(order, gzptUserInfo);
|
|
|
+ saveActiva(order, userInfo);
|
|
|
} else if ("科一专项VIP".equals(order.getGoodsName())) {
|
|
|
UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
|
- Date km1Date = userVip.getSubject1();
|
|
|
- if (km1Date != null) { //存在会员时间
|
|
|
- if (km1Date.compareTo(now) < 0) { //会员已过期
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km1oneYear = new Date(x);
|
|
|
- userVip.setSubject1(km1oneYear);
|
|
|
- } else { //会员时间延长
|
|
|
- long x = km1Date.getTime() + oneYearLong;
|
|
|
- Date km1oneYear = new Date(x);
|
|
|
- userVip.setSubject1(km1oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
+ Date km1Date = userVip.getSubject1();
|
|
|
+ if (km1Date != null) { //存在会员时间
|
|
|
+ if (km1Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km1oneYear = new Date(x);
|
|
|
+ userVip.setSubject1(km1oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km1Date.getTime() + oneYearLong;
|
|
|
+ Date km1oneYear = new Date(x);
|
|
|
+ userVip.setSubject1(km1oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } else {
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km1oneYear = new Date(x);
|
|
|
+ userVip.setSubject1(km1oneYear);
|
|
|
+ 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 km1oneYear = new Date(x);
|
|
|
+ uv.setSubject1(km1oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if ("科二专项VIP(含计时)".equals(order.getGoodsName())) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if (userVip != null) {
|
|
|
+ //修改会员信息
|
|
|
+ Date km2Date = userVip.getSubject2();
|
|
|
+ if (km2Date != null) { //存在会员时间
|
|
|
+ if (km2Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km2oneYear = new Date(x);
|
|
|
+ userVip.setSubject2(km2oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km2Date.getTime() + oneYearLong;
|
|
|
+ Date km2oneYear = new Date(x);
|
|
|
+ userVip.setSubject2(km2oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } else {
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km2oneYear = new Date(x);
|
|
|
+ userVip.setSubject2(km2oneYear);
|
|
|
+ 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 km2oneYear = new Date(x);
|
|
|
+ uv.setSubject2(km2oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科二专项VIP".equals(order.getGoodsName())) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if (userVip != null) {
|
|
|
+ //修改会员信息
|
|
|
+ Date km2Date = userVip.getSubject2();
|
|
|
+ if (km2Date != null) { //存在会员时间
|
|
|
+ if (km2Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km2oneYear = new Date(x);
|
|
|
+ userVip.setSubject2(km2oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km2Date.getTime() + oneYearLong;
|
|
|
+ Date km2oneYear = new Date(x);
|
|
|
+ userVip.setSubject2(km2oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } else {
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km2oneYear = new Date(x);
|
|
|
+ userVip.setSubject2(km2oneYear);
|
|
|
+ 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 km2oneYear = new Date(x);
|
|
|
+ uv.setSubject2(km2oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
+ } else if ("科三专项VIP(含计时)".equals(order.getGoodsName())) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if (userVip != null) {
|
|
|
+ //修改会员信息
|
|
|
+ Date km3Date = userVip.getSubject3();
|
|
|
+ if (km3Date != null) { //存在会员时间
|
|
|
+ if (km3Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km3oneYear = new Date(x);
|
|
|
+ userVip.setSubject3(km3oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km3Date.getTime() + oneYearLong;
|
|
|
+ Date km3oneYear = new Date(x);
|
|
|
+ userVip.setSubject3(km3oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } 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 km3oneYear = new Date(x);
|
|
|
+ uv.setSubject3(km3oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科三专项VIP".equals(order.getGoodsName())) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if (userVip != null) {
|
|
|
+ //修改会员信息
|
|
|
+ Date km3Date = userVip.getSubject3();
|
|
|
+ if (km3Date != null) { //存在会员时间
|
|
|
+ if (km3Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km3oneYear = new Date(x);
|
|
|
+ userVip.setSubject3(km3oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km3Date.getTime() + oneYearLong;
|
|
|
+ Date km3oneYear = new Date(x);
|
|
|
+ userVip.setSubject3(km3oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } 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 km3oneYear = new Date(x);
|
|
|
+ uv.setSubject3(km3oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if ("科四专项VIP(含计时)".equals(order.getGoodsName())) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if (userVip != null) {
|
|
|
+ //修改会员信息
|
|
|
+ Date km4Date = userVip.getSubject4();
|
|
|
+ if (km4Date != null) { //存在会员时间
|
|
|
+ if (km4Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km4oneYear = new Date(x);
|
|
|
+ userVip.setSubject4(km4oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km4Date.getTime() + oneYearLong;
|
|
|
+ Date km4oneYear = new Date(x);
|
|
|
+ userVip.setSubject4(km4oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } 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 km4oneYear = new Date(x);
|
|
|
+ uv.setSubject4(km4oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科四专项VIP".equals(order.getGoodsName())) {
|
|
|
+ UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
+ if (userVip != null) {
|
|
|
+ //修改会员信息
|
|
|
+ Date km4Date = userVip.getSubject4();
|
|
|
+ if (km4Date != null) { //存在会员时间
|
|
|
+ if (km4Date.compareTo(now) < 0) { //会员已过期
|
|
|
+ long x = now.getTime() + oneYearLong;
|
|
|
+ Date km4oneYear = new Date(x);
|
|
|
+ userVip.setSubject4(km4oneYear);
|
|
|
+ } else { //会员时间延长
|
|
|
+ long x = km4Date.getTime() + oneYearLong;
|
|
|
+ Date km4oneYear = new Date(x);
|
|
|
+ userVip.setSubject4(km4oneYear);
|
|
|
+ }
|
|
|
+ userVipService.updateById(userVip);
|
|
|
+ this.save(orderInfo);
|
|
|
+ } 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 km4oneYear = new Date(x);
|
|
|
+ uv.setSubject4(km4oneYear);
|
|
|
+ userVipService.save(uv);
|
|
|
+ this.save(orderInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if ("科目一二三四所有付费权益".equals(order.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(order.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);
|
|
|
+ }
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科一+科四VIP".equals(order.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(order.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);
|
|
|
+ }
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科二+科三VIP".equals(order.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(order.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 km1oneYear = new Date(x);
|
|
|
- userVip.setSubject1(km1oneYear);
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
+ 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 km1oneYear = new Date(x);
|
|
|
- uv.setSubject1(km1oneYear);
|
|
|
+ Date oneYear = new Date(x);
|
|
|
+ uv.setSubject2(oneYear);
|
|
|
+ uv.setSubject3(oneYear);
|
|
|
+ uv.setSubject4(oneYear);
|
|
|
userVipService.save(uv);
|
|
|
this.save(orderInfo);
|
|
|
}
|
|
|
-
|
|
|
- } else if ("科二专项VIP".equals(order.getGoodsName())) {
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科二+科三+科四".equals(order.getGoodsName())) {
|
|
|
UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
|
Date km2Date = userVip.getSubject2();
|
|
|
- if (km2Date != null) { //存在会员时间
|
|
|
- if (km2Date.compareTo(now) < 0) { //会员已过期
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- } else { //会员时间延长
|
|
|
- long x = km2Date.getTime() + oneYearLong;
|
|
|
- Date km2oneYear = new Date(x);
|
|
|
- userVip.setSubject2(km2oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
+ 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);
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
}
|
|
|
+ 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 km2oneYear = new Date(x);
|
|
|
- uv.setSubject2(km2oneYear);
|
|
|
+ Date oneYear = new Date(x);
|
|
|
+ uv.setSubject2(oneYear);
|
|
|
+ uv.setSubject3(oneYear);
|
|
|
+ uv.setSubject4(oneYear);
|
|
|
userVipService.save(uv);
|
|
|
this.save(orderInfo);
|
|
|
}
|
|
|
- } else if ("科三专项VIP".equals(order.getGoodsName())) {
|
|
|
+ } else if ("科三+科四VIP(含计时)".equals(order.getGoodsName())) {
|
|
|
UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
|
Date km3Date = userVip.getSubject3();
|
|
|
- if (km3Date != null) { //存在会员时间
|
|
|
- if (km3Date.compareTo(now) < 0) { //会员已过期
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- } else { //会员时间延长
|
|
|
- long x = km3Date.getTime() + oneYearLong;
|
|
|
- Date km3oneYear = new Date(x);
|
|
|
- userVip.setSubject3(km3oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
+ 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);
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
}
|
|
|
+ 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 km3oneYear = new Date(x);
|
|
|
- uv.setSubject3(km3oneYear);
|
|
|
+ Date oneYear = new Date(x);
|
|
|
+ uv.setSubject3(oneYear);
|
|
|
+ uv.setSubject4(oneYear);
|
|
|
userVipService.save(uv);
|
|
|
this.save(orderInfo);
|
|
|
}
|
|
|
-
|
|
|
- } else if ("科四专项VIP".equals(order.getGoodsName())) {
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("科三+科四VIP".equals(order.getGoodsName())) {
|
|
|
UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
|
+ Date km3Date = userVip.getSubject3();
|
|
|
Date km4Date = userVip.getSubject4();
|
|
|
- if (km4Date != null) { //存在会员时间
|
|
|
- if (km4Date.compareTo(now) < 0) { //会员已过期
|
|
|
- long x = now.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- } else { //会员时间延长
|
|
|
- long x = km4Date.getTime() + oneYearLong;
|
|
|
- Date km4oneYear = new Date(x);
|
|
|
- userVip.setSubject4(km4oneYear);
|
|
|
- }
|
|
|
- userVipService.updateById(userVip);
|
|
|
- this.save(orderInfo);
|
|
|
+ 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);
|
|
|
}
|
|
|
+ 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 km4oneYear = new Date(x);
|
|
|
- uv.setSubject4(km4oneYear);
|
|
|
+ Date oneYear = new Date(x);
|
|
|
+ uv.setSubject3(oneYear);
|
|
|
+ uv.setSubject4(oneYear);
|
|
|
userVipService.save(uv);
|
|
|
this.save(orderInfo);
|
|
|
}
|
|
|
-
|
|
|
- } else if ("科目一二三四所有付费权益".equals(order.getGoodsName())) {
|
|
|
+ } else if ("全科目超级VIP(含计时)".equals(order.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);
|
|
|
+ }
|
|
|
+ //激活操作
|
|
|
+ saveActiva(order, userInfo);
|
|
|
+ } else if ("全科目超级VIP".equals(order.getGoodsName())) {
|
|
|
UserVip userVip = userVipService.getUserVipByUserId(order.getUserId());
|
|
|
if (userVip != null) {
|
|
|
//修改会员信息
|
|
@@ -287,7 +899,11 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
this.save(orderInfo);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ int isShare = schPayConfigService.isSchPayConfigByJxbh(userInfo.getCity());
|
|
|
+ if (isShare == 1) {
|
|
|
+ //如果是合作驾校插入消费记录表
|
|
|
+ savePayLog(order, userInfo);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -742,10 +1358,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @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) {
|
|
|
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 插入支付记录
|