|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.caimei.module.base.entity.bo.JsonModel;
|
|
import com.caimei.module.base.entity.bo.JsonModel;
|
|
import com.caimei.module.base.entity.bo.Payment;
|
|
import com.caimei.module.base.entity.bo.Payment;
|
|
import com.caimei.module.base.entity.po.SeconHandProduct;
|
|
import com.caimei.module.base.entity.po.SeconHandProduct;
|
|
|
|
+import com.caimei.module.base.entity.po.UserBeansHistoryPo;
|
|
import com.caimei.module.base.entity.vo.*;
|
|
import com.caimei.module.base.entity.vo.*;
|
|
import com.caimei.module.pay.dao.PayDao;
|
|
import com.caimei.module.pay.dao.PayDao;
|
|
import com.caimei.module.pay.service.PayService;
|
|
import com.caimei.module.pay.service.PayService;
|
|
@@ -490,7 +491,8 @@ public class PayServiceImpl implements PayService {
|
|
payDao.updateOrderPayLink(orderPayLink);
|
|
payDao.updateOrderPayLink(orderPayLink);
|
|
}
|
|
}
|
|
//保存收款记录
|
|
//保存收款记录
|
|
- String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date());
|
|
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
DiscernReceiptVo discernReceipt = new DiscernReceiptVo();
|
|
DiscernReceiptVo discernReceipt = new DiscernReceiptVo();
|
|
discernReceipt.setPayWay("1");
|
|
discernReceipt.setPayWay("1");
|
|
discernReceipt.setPayType(payType);
|
|
discernReceipt.setPayType(payType);
|
|
@@ -517,10 +519,53 @@ public class PayServiceImpl implements PayService {
|
|
relation.setSplitStatus("0");
|
|
relation.setSplitStatus("0");
|
|
payDao.insertOrderRelation(relation);
|
|
payDao.insertOrderRelation(relation);
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>保存付款金额到收款记录," + amount);
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>保存付款金额到收款记录," + amount);
|
|
- //修改分账付款状态
|
|
|
|
- //payDao.updateSplitAccountByPay(mbOrderId);
|
|
|
|
//判断是否是充值商品
|
|
//判断是否是充值商品
|
|
getRechargeGoods(order, amount);
|
|
getRechargeGoods(order, amount);
|
|
|
|
+ //线上支付与自主下单送豆
|
|
|
|
+ UserVo user = payDao.findUser(order.getUserID());
|
|
|
|
+ if (user != null && "3".equals(order.getReceiptStatus()) && "0".equals(order.getSecondHandOrderFlag())) {
|
|
|
|
+ int userBeans = user.getUserBeans() == null ? 0 : user.getUserBeans();
|
|
|
|
+ //线上支付送100采美豆
|
|
|
|
+ UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
|
|
+ beansHistory.setUserId(order.getUserID().intValue());
|
|
|
|
+ beansHistory.setOrderId(order.getOrderID().intValue());
|
|
|
|
+ beansHistory.setBeansType(6);
|
|
|
|
+ beansHistory.setType(1);
|
|
|
|
+ beansHistory.setNum(100);
|
|
|
|
+ beansHistory.setPushStatus(0);
|
|
|
|
+ beansHistory.setAddTime(date);
|
|
|
|
+ payDao.insertBeansHistory(beansHistory);
|
|
|
|
+ userBeans = userBeans + 100;
|
|
|
|
+
|
|
|
|
+ //自主下单且没有促销活动送豆
|
|
|
|
+ Integer id = payDao.findPromotionsOrder(order.getOrderID());
|
|
|
|
+ if (1 == order.getOrderType() && id == null) {
|
|
|
|
+ BigDecimal payTotalFee = order.getPayTotalFee();
|
|
|
|
+ int num = 0;
|
|
|
|
+ if (MathUtil.compare(1000, payTotalFee) > -1) {
|
|
|
|
+ num = 10;
|
|
|
|
+ } else if (MathUtil.compare(5000, payTotalFee) > -1) {
|
|
|
|
+ num = 20;
|
|
|
|
+ } else if (MathUtil.compare(10000, payTotalFee) > -1) {
|
|
|
|
+ num = 50;
|
|
|
|
+ } else if (MathUtil.compare(25000, payTotalFee) > -1) {
|
|
|
|
+ num = 100;
|
|
|
|
+ } else if (MathUtil.compare(100000, payTotalFee) > -1) {
|
|
|
|
+ num = 150;
|
|
|
|
+ } else if (MathUtil.compare(250000, payTotalFee) > -1) {
|
|
|
|
+ num = 200;
|
|
|
|
+ } else if (MathUtil.compare(500000, payTotalFee) > -1) {
|
|
|
|
+ num = 250;
|
|
|
|
+ } else {
|
|
|
|
+ num = 400;
|
|
|
|
+ }
|
|
|
|
+ beansHistory.setBeansType(5);
|
|
|
|
+ beansHistory.setNum(num);
|
|
|
|
+ payDao.insertBeansHistory(beansHistory);
|
|
|
|
+ userBeans = userBeans + num;
|
|
|
|
+ }
|
|
|
|
+ payDao.updateUserBeans(order.getUserID(), userBeans);
|
|
|
|
+ }
|
|
return "SUCCESS";
|
|
return "SUCCESS";
|
|
}
|
|
}
|
|
|
|
|