Commit 00b763b3 by tang

去除部分无效引用等

parent cfc158f6
......@@ -8,7 +8,6 @@ import com.thinkgem.jeesite.modules.pay.bean.OrderRequest;
import com.thinkgem.jeesite.modules.pay.entity.BalanceEntity;
import com.thinkgem.jeesite.modules.pay.entity.BenefitEntity;
import com.thinkgem.jeesite.modules.pay.service.BenefitSevice;
import com.thinkgem.jeesite.modules.user.bean.UserRequest;
import com.thinkgem.jeesite.modules.user.entity.UserEntity;
import com.thinkgem.jeesite.modules.user.service.UserApiService;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -8,6 +8,8 @@ import com.thinkgem.jeesite.modules.pay.entity.OrderEntity;
import com.thinkgem.jeesite.modules.pay.service.OrderService;
import com.thinkgem.jeesite.modules.sys.entity.Dict;
import com.thinkgem.jeesite.modules.sys.service.DictService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.method.P;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -24,6 +26,8 @@ import java.util.List;
@RestController
@RequestMapping("/api/order")
public class OrderApiController {
/** log */
private static Logger logger = LoggerFactory.getLogger(OrderApiController.class);
@Autowired
private OrderService orderService;
......@@ -46,8 +50,7 @@ public class OrderApiController {
}
try {
System.out.println("开始时间:" + request.getStartDate());
System.out.println("结束时间:" + request.getEndDate());
logger.debug("获取订单列表的开始时间: {} , 结束时间: {}",request.getStartDate(), request.getEndDate());
List<OrderEntity> list = orderService.getOrderList(request);
res.setData(list);
......@@ -78,9 +81,7 @@ public class OrderApiController {
}
try {
System.out.println("开始时间:" + request.getStartDate());
System.out.println("结束时间:" + request.getEndDate());
logger.debug("获取订单列表的开始时间: {} , 结束时间: {}",request.getStartDate(), request.getEndDate());
res.setData(orderService.getOrderPage(request));
res.setStatus(ComCode.STATUS_CODE_2000);
res.setMessage(ComCode.STATUS_CODE_2000_DESC);
......
......@@ -759,7 +759,7 @@ public class PayApiService {
dto.put("timestamp", System.currentTimeMillis());
int amountInt = (int) (Double.valueOf(request.getAmount()) * 100);
//减去每笔手续费
int amount2 = amountInt- amountHL2;
int amount2 = amountInt - amountHL2;
dto.put("amount", amount2);
dto.put("idNo", userDetailEntity.getIdCard());
dto.put("accountName", userDetailEntity.getRealName());
......@@ -849,7 +849,7 @@ public class PayApiService {
//获取用户对应等级费率以及每笔需要的手续费
RateEntity gradeRate = getGradeRate(userEntity.getLevel(), request.getPayChannel());
logger.debug("用户等级请求结果,费率: {}, 单笔价格: {}",gradeRate.getRate(), gradeRate.getSiglePrice());
logger.debug("用户等级请求结果,费率: {}, 单笔价格: {}", gradeRate.getRate(), gradeRate.getSiglePrice());
//获取扣除手续费后的金额,已经转换为分
// BigDecimal amount = calculationAmount(gradeRate, request.getAmount());
// int amountFen = amount.multiply(BigDecimal.valueOf(100.0)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue();
......@@ -890,7 +890,7 @@ public class PayApiService {
"cardNo: {}, settleBankName: {}, settleBankNo: {}, settleBankPhone:{}, " +
"name:{}, certificateCode:{}, userFee:{}", request.getExpireDate(), request.getCvn2(),
cardEntity.getCardMobile(), cardEntity.getCardNo(), cardEntityDebit.getBankName(), cardEntityDebit.getCardNo(),
cardEntityDebit.getCardMobile(), userDetail.getRealName(), userDetail.getIdCard(),amount);
cardEntityDebit.getCardMobile(), userDetail.getRealName(), userDetail.getIdCard(), amount);
JSONObject jsonObject = juHeZhongPayService.quickPay(dto);
logger.debug("HL4支付返回结果信息:{}" + jsonObject.toJSONString());
......@@ -983,7 +983,7 @@ public class PayApiService {
if (list != null && list.size() > 0) {
amount = list.get(0).getValue();
}
logger.debug("支付宝支付金额: {}",amount);
logger.debug("支付宝支付金额: {}", amount);
// 创建订单保存
if ("D".equals(request.getLevel())) {
request.setSubject("升级成白银会员");
......@@ -1350,6 +1350,37 @@ public class PayApiService {
return balanceEntity;
}
public BalanceEntity getPutForwardNumHighLevel(JuHeZhongPayRequest request) {
BalanceEntity balanceEntity = new BalanceEntity();
BenefitEntity entity = new BenefitEntity();
entity.setUserCode(request.getSubMerchantCode());
UserEntity userInfo = userService.getUserInfo(request);
//高级别用户
//是否已经有推荐的用户
UserEntity recomUserEntity = benefitSevice.checkRecommend(userInfo.getMobile());
//升级前用户
UserEntity upgradeUserInfo = userDao.getUpgradeUserInfo(userInfo.getMobile());
if (recomUserEntity == null) {
balanceEntity.setBalance("0.00");
return balanceEntity;
}
String levelRate = benefitSevice.getRateByLevel(userInfo.getLevel());
// 总收益
entity.setUserCode(request.getSubMerchantCode());
entity.setBenefitType(levelRate);
entity.setCreateDate(userInfo.getCreated());
entity.setCardCode(upgradeUserInfo.getMobile());
BenefitEntity benefitEntityA = payDao.getBenefitSumHighLevel(entity);
// 总提现
BenefitEntity benefitEntityM = payDao.getBenefitSumHighLevelM(entity);
// 余额 = 总收益-总提现
balanceEntity = benefitSevice.getLastBalance(benefitEntityA, benefitEntityM);
return balanceEntity;
}
private void orderFail(OrderEntity orderEntity) {
orderEntity.setPayStatus("4");
payDao.updateOrderStatus(orderEntity);
......@@ -1432,7 +1463,7 @@ public class PayApiService {
Double amountDouble = Double.valueOf(amount);
//总共所需手续费
int result = BigDecimal.valueOf(amountDouble * rate).add(BigDecimal.valueOf(siglePrice).subtract(BigDecimal.ONE)).multiply(BigDecimal.valueOf(100)).intValue();
logger.debug("计算出来的费率:"+ result);
logger.debug("计算出来的费率:" + result);
//扣除费率及手续费后的金额
// BigDecimal result = BigDecimal.valueOf(amountDouble).subtract(BigDecimal.valueOf(siglePrice))
// .subtract(BigDecimal.valueOf(amountDouble * rate));
......@@ -1448,7 +1479,7 @@ public class PayApiService {
public int calculationAmountHL2(RateEntity gradeRate) {
Double siglePrice = Double.valueOf(gradeRate.getSiglePrice());
//总共所需手续费,只算每笔的手续费,单位是分
int result = BigDecimal.valueOf(siglePrice*100).intValue();
int result = BigDecimal.valueOf(siglePrice * 100).intValue();
return result;
}
}
package com.thinkgem.jeesite.modules.pay.service;
import com.alibaba.fastjson.JSONObject;
import com.thinkgem.jeesite.common.constant.ComCode;
import com.thinkgem.jeesite.modules.pay.dao.PayApiDao;
import com.thinkgem.jeesite.modules.pay.entity.BenefitEntity;
import com.thinkgem.jeesite.modules.pay.entity.OrderEntity;
import com.thinkgem.jeesite.modules.pay.juhezhong.dto.QuickDto;
import com.thinkgem.jeesite.modules.pay.juhezhong.service.JuHeZhongPayIntegralService;
import com.thinkgem.jeesite.modules.pay.juhezhong.service.JuHeZhongPayService;
import com.thinkgem.jeesite.modules.user.service.UserApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
......@@ -26,12 +15,6 @@ public class TimingService {
private PayApiService payApiService;
@Autowired
private JuHeZhongPayService juHeZhongPayService;
@Autowired
private JuHeZhongPayIntegralService juHeZhongPayIntegralService;
@Autowired
private UserApiService userApiService;
......
......@@ -5,10 +5,7 @@ import com.thinkgem.jeesite.common.baseBean.Response;
import com.thinkgem.jeesite.common.constant.ComCode;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.commonError.MyException;
import com.thinkgem.jeesite.modules.img.bean.ImgRequest;
import com.thinkgem.jeesite.modules.pay.entity.BalanceEntity;
import com.thinkgem.jeesite.modules.pay.entity.RateEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.user.bean.IdentityCodeRequest;
import com.thinkgem.jeesite.modules.user.bean.JuHeZhongPayRequest;
import com.thinkgem.jeesite.modules.user.bean.UserRequest;
......@@ -456,7 +453,6 @@ public class UserApiController {
|| StringUtils.isBlank(request.getCardBank())
) {
logger.debug("业务参数就异常了");
logger.debug(request.toString());
// || StringUtils.isBlank(request.getIdCardPlace())|| StringUtils.isBlank(request.getIdCardFront())|| StringUtils.isBlank(request.getIdCardBack())|| StringUtils.isBlank(request.getIdCardBack())
// || StringUtils.isBlank(request.getIdCardHold())|| StringUtils.isBlank(request.getDebitCard())|| StringUtils.isBlank(request.getCardSrc())|| StringUtils.isBlank(request.getCardPlace())
resp.setStatus(ComCode.STATUS_CODE_4001);
......
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 to comment