部分逻辑问题
This commit is contained in:
parent
106f174e13
commit
81a78b09d4
|
|
@ -173,7 +173,7 @@ public class OrderController extends BaseController {
|
|||
// 如果派单师傅的抽成金额>0 则为派单师傅生成子财务单
|
||||
if (BigDecimal.ZERO.compareTo(assignWorkerMoney) < 0) {
|
||||
FinancialDetail fd = new FinancialDetail(fm.getDeptId(), financialDetailService.createCode(), fm.getId(),
|
||||
fm.getCode(), od.getId(), od.getCode(), assignWorkerMoney, FinancialDetailType.WORKER_FEE.getCode(), assignWorker.getWorkerId(),
|
||||
fm.getCode(), null, null, assignWorkerMoney, FinancialDetailType.WORKER_FEE.getCode(), assignWorker.getWorkerId(),
|
||||
fm.getPayType(), fm.getPayStatus(), fm.getPayTime());
|
||||
financialDetailService.insertFinancialDetail(fd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public class OrderDetailController extends BaseController {
|
|||
Customer customer = customerService.selectByCustomerId(detail.getCustomerId());
|
||||
|
||||
// 商品规格及信息
|
||||
List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderMasterId(detail.getId());
|
||||
List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderDetailId(detail.getId());
|
||||
|
||||
// 商品信息
|
||||
GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.ghy.web.controller.pay;
|
||||
|
||||
import com.ghy.common.adapay.model.DivMember;
|
||||
import com.ghy.common.json.JSONObject;
|
||||
import com.ghy.payment.domain.FinancialMaster;
|
||||
import com.ghy.payment.service.AdapayService;
|
||||
import com.ghy.common.adapay.model.PayParam;
|
||||
import com.ghy.common.adapay.model.WxpayExpend;
|
||||
|
|
@ -9,15 +12,16 @@ import com.ghy.common.core.domain.AjaxResult;
|
|||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.order.domain.OrderMaster;
|
||||
import com.ghy.order.service.OrderMasterService;
|
||||
import com.ghy.payment.service.FinancialMasterService;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
|
|
@ -30,6 +34,26 @@ public class WxPayController extends BaseController {
|
|||
private AdapayService adapayService;
|
||||
@Resource
|
||||
private OrderMasterService orderMasterService;
|
||||
@Resource
|
||||
private FinancialMasterService financialMasterService;
|
||||
|
||||
@PostMapping("drawCash")
|
||||
@ResponseBody
|
||||
public AjaxResult drawCash(@RequestBody JSONObject object){
|
||||
try {
|
||||
// 101 123dasda D0 1.00 C7D101
|
||||
Long deptId = object.getLong("deptId");
|
||||
String orderNo = object.getStr("orderNo");
|
||||
String cashType = object.getStr("cashType");
|
||||
String cashAmt = object.getStr("cashAmt");
|
||||
String memberId = object.getStr("memberId");
|
||||
String remark = object.getStr("remark");
|
||||
adapayService.drawCash(deptId, orderNo, cashType, cashAmt, memberId, remark, null);
|
||||
return AjaxResult.success("操作成功");
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序支付
|
||||
|
|
@ -40,6 +64,8 @@ public class WxPayController extends BaseController {
|
|||
String openId = request.getHeader("code");
|
||||
String orderMasterCode = request.getHeader("orderMasterCode");
|
||||
OrderMaster orderMaster = orderMasterService.selectByCode(orderMasterCode);
|
||||
|
||||
FinancialMaster financialMaster = financialMasterService.selectByOrderMasterId(orderMaster.getId());
|
||||
if (orderMaster == null) {
|
||||
return AjaxResult.error("订单不存在");
|
||||
}
|
||||
|
|
@ -48,9 +74,11 @@ public class WxPayController extends BaseController {
|
|||
expend.setOpenId(openId);
|
||||
Map<String, Object> map;
|
||||
try {
|
||||
List<DivMember> divMembers = new ArrayList<>();
|
||||
divMembers.add(new DivMember("C7D101", String.valueOf(financialMaster.getPayMoney()), true));
|
||||
// TODO 订单里需要补充支付金额、tittle、简要描述、分账信息、description
|
||||
PayParam payParam = new PayParam(orderMaster.getCode(),
|
||||
"0.01", "工圈子测试", "工圈子测试描述");
|
||||
"0.01", "工圈子居家设备", "工圈子居家设备购买付费");
|
||||
map = adapayService.wxLitePay(orderMaster.getDeptId(), payParam, expend, null, null);
|
||||
} catch (BaseAdaPayException e) {
|
||||
logger.error("获取微信用户信息失败", e);
|
||||
|
|
|
|||
Loading…
Reference in New Issue