提交代码

dev-discount
胡锐 4 years ago
parent 9930e9d779
commit 43796a6072
  1. 14
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  2. 14
      hai-cweb/src/main/java/com/cweb/controller/OutRechargeOrderController.java
  3. 1
      hai-service/src/main/java/com/hai/dao/CmsContentMapperExt.java
  4. 4
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java

@ -268,6 +268,20 @@ public class HighTestController {
}
}
@RequestMapping(value = "/wxSplitAccount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "微信分账")
public ResponseData wxSplitAccount() {
try {
HighOrder orderNo = highOrderService.getOrderByOrderNo("HF2021101812025050304");
wxProfitsharing(orderNo.getOrderNo(),orderNo.getPaySerialNo(),orderNo.getPayRealPrice());
return ResponseMsgUtil.success("分账成功");
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
public void wxProfitsharing(String transaction_id,String out_order_no, BigDecimal amount) {
try {

@ -354,10 +354,7 @@ public class OutRechargeOrderController {
@ApiOperation(value = "分账")
public ResponseData wxProfitsharing() {
try {
List<HighOrder> orderList = highOrderService.getTest();
for (HighOrder highOrder : orderList) {
HighOrder order = highOrderService.getOrderById(highOrder.getId());
HighOrder order = highOrderService.getOrderByOrderNo("20211019173044475879505");
BigDecimal rake = new BigDecimal("0.01");
// 计算微信收取的手续费 支付金额 * 0.002 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。
BigDecimal wxHandlingFee = order.getPayPrice().multiply(new BigDecimal("0.002")).setScale(2,BigDecimal.ROUND_HALF_DOWN);
@ -367,7 +364,7 @@ public class OutRechargeOrderController {
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1609882817"); // 个体户黎杨珍
param.put("transaction_id" , highOrder.getPaySerialNo());
param.put("transaction_id" , order.getPaySerialNo());
param.put("out_order_no" , order.getOrderNo());
param.put("nonce_str" , WxUtils.makeNonStr());
@ -398,7 +395,6 @@ public class OutRechargeOrderController {
sharingRecord.setCreateTime(new Date());
sharingRecord.setContent(resultXmL);
highProfitSharingRecordService.insert(sharingRecord);
}
return ResponseMsgUtil.success("操作成功");
@ -413,13 +409,15 @@ public class OutRechargeOrderController {
@ApiOperation(value = "完结分账")
public ResponseData wxEndProfitsharing(String transaction_id,String out_order_no, BigDecimal amount) {
try {
HighOrder orderNo = highOrderService.getOrderByOrderNo("HF2021101812025050304");
Map<String,String> param = new LinkedHashMap<>();
param.put("appid", "wx637bd6f7314daa46");
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , "1609882817"); // 个体户黎杨珍
param.put("nonce_str" , WxUtils.makeNonStr());
param.put("transaction_id" , "4200001158202108094442626740");
param.put("out_order_no" , "30000408682021080916082519929");
param.put("transaction_id" , orderNo.getPaySerialNo());
param.put("out_order_no" , orderNo.getOrderNo());
param.put("description" , "系统自动完结分账");
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign" , signStr);

@ -60,6 +60,7 @@ public interface CmsContentMapperExt {
@Result(column="tag", property="tag", jdbcType= JdbcType.VARCHAR),
@Result(column="img_source", property="imgSource", jdbcType= JdbcType.TINYINT),
@Result(column="img_data", property="imgData", jdbcType= JdbcType.VARCHAR),
@Result(column="jump_type", property="jumpType", jdbcType= JdbcType.INTEGER),
@Result(column="jump_name", property="jumpName", jdbcType= JdbcType.VARCHAR),
@Result(column="jump_url", property="jumpUrl", jdbcType= JdbcType.VARCHAR),
@Result(column="sort_id", property="sortId", jdbcType= JdbcType.INTEGER),

@ -315,8 +315,8 @@ public class GoodsOrderServiceImpl implements PayService {
ResultProfitSharing resultProfitSharing = XmlUtil.getObjectFromXML(resultXmL, ResultProfitSharing.class);
HighProfitSharingRecord sharingRecord = new HighProfitSharingRecord();
sharingRecord.setOutOrderNo(resultProfitSharing.getOut_order_no());
sharingRecord.setTransactionId(resultProfitSharing.getTransaction_id());
sharingRecord.setOutOrderNo(out_order_no);
sharingRecord.setTransactionId(transaction_id);
sharingRecord.setOrderId(resultProfitSharing.getOrder_id());
sharingRecord.setStatus(resultProfitSharing.getResult_code());
sharingRecord.setPrice(amount);

Loading…
Cancel
Save