|
@@ -29,7 +29,6 @@ import org.springframework.http.HttpHeaders;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import java.math.BigDecimal;
|
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.spec.InvalidKeySpecException;
|
|
import java.security.spec.InvalidKeySpecException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -1314,9 +1313,19 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
if (null != authVip.getId()) {
|
|
if (null != authVip.getId()) {
|
|
// 更新会员信息
|
|
// 更新会员信息
|
|
payOrderMapper.updateAuthVipInfo(authVip);
|
|
payOrderMapper.updateAuthVipInfo(authVip);
|
|
|
|
+ if (authVip.getBeginTime().compareTo(beginTime) >= 0) {
|
|
|
|
+ // 删除原有角色关联
|
|
|
|
+ payOrderMapper.deleteAuthVipRoleRelation(userId);
|
|
|
|
+ // 续费重新分配角色
|
|
|
|
+ saveRoleRelation(userId, "1,2");
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
// 新增会员信息
|
|
// 新增会员信息
|
|
payOrderMapper.insertAuthVipInfo(authVip);
|
|
payOrderMapper.insertAuthVipInfo(authVip);
|
|
|
|
+ // 删除原有角色关联
|
|
|
|
+ payOrderMapper.deleteAuthVipRoleRelation(userId);
|
|
|
|
+ // 分配角色
|
|
|
|
+ saveRoleRelation(userId, "1,2");
|
|
}
|
|
}
|
|
// 修改会员历史记录支付状态
|
|
// 修改会员历史记录支付状态
|
|
VipRecordBo record = payOrderMapper.getAuthVipRecord(recordId);
|
|
VipRecordBo record = payOrderMapper.getAuthVipRecord(recordId);
|
|
@@ -1413,4 +1422,33 @@ public class PayNonOrderServiceImpl implements PayNonOrderService {
|
|
log.info("【线上退款】成功>>>>>>>vipRecordId:" + payVipDto.getVipRecordId());
|
|
log.info("【线上退款】成功>>>>>>>vipRecordId:" + payVipDto.getVipRecordId());
|
|
return ResponseJson.success(result);
|
|
return ResponseJson.success(result);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ResponseJson<Map<String,Map<String,String>>> authVipCheck(Integer vipRecordId) {
|
|
|
|
+ // 获取会员套餐记录
|
|
|
|
+ VipRecordBo record = payOrderMapper.getAuthVipRecord(vipRecordId);
|
|
|
|
+ Map<String, Map<String,String>> map1 = new HashMap<>();
|
|
|
|
+ Map<String, String> map2 = new HashMap<>();
|
|
|
|
+ if (null != record.getPayStatus() && 1 == record.getPayStatus()) {
|
|
|
|
+ map2.put("status", "1");
|
|
|
|
+ map1.put("data", map2);
|
|
|
|
+ return ResponseJson.success("支付成功!", map1);
|
|
|
|
+ }
|
|
|
|
+ map2.put("status", "0");
|
|
|
|
+ map1.put("data", map2);
|
|
|
|
+ return ResponseJson.success("支付失败", map1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void saveRoleRelation(Integer userId, String roleIds) {
|
|
|
|
+ if (StringUtils.isNotEmpty(roleIds)) {
|
|
|
|
+ // 设置用户角色
|
|
|
|
+ String[] split = roleIds.split(",");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ if (org.springframework.util.StringUtils.hasLength(s)) {
|
|
|
|
+ // 保存用户角色关系
|
|
|
|
+ payOrderMapper.insertAuthVipRoleRelation(userId, Integer.valueOf(s));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|