|
@@ -1,20 +1,16 @@
|
|
|
package com.minpay.shouhuo.orderaction;
|
|
package com.minpay.shouhuo.orderaction;
|
|
|
|
|
|
|
|
import com.min.util.DateUtil;
|
|
import com.min.util.DateUtil;
|
|
|
-import com.min.util.OffSetUtil;
|
|
|
|
|
import com.minpay.common.bean.User;
|
|
import com.minpay.common.bean.User;
|
|
|
import com.minpay.common.exception.BusinessCodeException;
|
|
import com.minpay.common.exception.BusinessCodeException;
|
|
|
-import com.minpay.common.service.IAccountService;
|
|
|
|
|
|
|
+import com.minpay.common.pay.bean.Huilianpay;
|
|
|
|
|
+import com.minpay.common.service.IHuilianPayService;
|
|
|
import com.minpay.common.service.IOrderService;
|
|
import com.minpay.common.service.IOrderService;
|
|
|
import com.minpay.common.service.IPublicService;
|
|
import com.minpay.common.service.IPublicService;
|
|
|
|
|
+import com.minpay.common.service.impl.HuilianPayServiceImpl;
|
|
|
import com.minpay.common.util.CommonUtil;
|
|
import com.minpay.common.util.CommonUtil;
|
|
|
-import com.minpay.db.table.mapper.VmOrderInfMapper;
|
|
|
|
|
-import com.minpay.db.table.mapper.VmPaymentInfMapper;
|
|
|
|
|
-import com.minpay.db.table.mapper.VmRechargeRuleMapper;
|
|
|
|
|
-import com.minpay.db.table.model.VmOrderInf;
|
|
|
|
|
-import com.minpay.db.table.model.VmPaymentInf;
|
|
|
|
|
-import com.minpay.db.table.model.VmRechargeRule;
|
|
|
|
|
-import com.minpay.db.table.model.VmRechargeRuleExample;
|
|
|
|
|
|
|
+import com.minpay.db.table.mapper.*;
|
|
|
|
|
+import com.minpay.db.table.model.*;
|
|
|
import com.minpay.shouhuo.paymentaction.PaymentAction;
|
|
import com.minpay.shouhuo.paymentaction.PaymentAction;
|
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
|
import com.startup.minpay.frame.business.MINHttpServletRequestContext;
|
|
import com.startup.minpay.frame.business.MINHttpServletRequestContext;
|
|
@@ -29,6 +25,7 @@ import com.startup.minpay.frame.target.MINComponent;
|
|
|
import com.startup.minpay.frame.target.MINParam;
|
|
import com.startup.minpay.frame.target.MINParam;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 订单管理
|
|
* 订单管理
|
|
@@ -101,9 +98,9 @@ public class PayManageAction implements IMINAction {
|
|
|
ordInf.setId(ordId); //订单编号
|
|
ordInf.setId(ordId); //订单编号
|
|
|
ordInf.setChannel(user.getChannel()); //渠道:V01售货机
|
|
ordInf.setChannel(user.getChannel()); //渠道:V01售货机
|
|
|
ordInf.setPersonId(user.getId()); //下单人编号
|
|
ordInf.setPersonId(user.getId()); //下单人编号
|
|
|
- ordInf.setEquipmentId(OffSetUtil.deScanCode(equipmentId)); //虚拟售货机号
|
|
|
|
|
|
|
+ ordInf.setEquipmentId(equipmentId); //虚拟售货机号
|
|
|
ordInf.setState("91"); //91未支付
|
|
ordInf.setState("91"); //91未支付
|
|
|
- ordInf.setRemarks("会员充值:" + rechargeAmt); //备注
|
|
|
|
|
|
|
+ ordInf.setRemarks("会员充值(加赠送金额):" + rechargeAmt); //备注
|
|
|
ordInf.setIsDraw("00"); //是否中奖:00未中奖01中奖
|
|
ordInf.setIsDraw("00"); //是否中奖:00未中奖01中奖
|
|
|
ordInf.setIsUsed("00"); //是否使用:00已使用01未使用
|
|
ordInf.setIsUsed("00"); //是否使用:00已使用01未使用
|
|
|
ordInf.setProType("02"); //00正常商品,01抽奖商品,02:充值
|
|
ordInf.setProType("02"); //00正常商品,01抽奖商品,02:充值
|
|
@@ -112,7 +109,8 @@ public class PayManageAction implements IMINAction {
|
|
|
ordInf.setCreateTime(DateUtil.getCurrentDateTimeString()); //创建时间
|
|
ordInf.setCreateTime(DateUtil.getCurrentDateTimeString()); //创建时间
|
|
|
ordInf.setModifyUser(user.getId()); //修改人
|
|
ordInf.setModifyUser(user.getId()); //修改人
|
|
|
ordInf.setModifyTime(DateUtil.getCurrentDateTimeString()); //修改时间
|
|
ordInf.setModifyTime(DateUtil.getCurrentDateTimeString()); //修改时间
|
|
|
- ordInf.setOrderAmt(allAmt); //订单总金额
|
|
|
|
|
|
|
+ ordInf.setOrderAmt(rechargeAmt); //订单总金额
|
|
|
|
|
+ ordInf.setPickupStt("00");
|
|
|
// 执行新增订单数据
|
|
// 执行新增订单数据
|
|
|
Service.lookup(IMINDataBaseService.class)
|
|
Service.lookup(IMINDataBaseService.class)
|
|
|
.getMybatisMapper(VmOrderInfMapper.class).insert(ordInf);
|
|
.getMybatisMapper(VmOrderInfMapper.class).insert(ordInf);
|
|
@@ -132,9 +130,68 @@ public class PayManageAction implements IMINAction {
|
|
|
Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmPaymentInfMapper.class).insert(payMentInf);
|
|
Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmPaymentInfMapper.class).insert(payMentInf);
|
|
|
|
|
|
|
|
//动账
|
|
//动账
|
|
|
- IAccountService service = Service.lookup(IAccountService.class);
|
|
|
|
|
- service.modfiyAccount(user.getChannel(), user.getId(), "01", rechargeAmt, "00", payMentInf.getFlowno(), "充值","");
|
|
|
|
|
-
|
|
|
|
|
|
|
+// IAccountService service = Service.lookup(IAccountService.class);
|
|
|
|
|
+// service.modfiyAccount(user.getChannel(), user.getId(), "01", rechargeAmt, "00", payMentInf.getFlowno(), "充值","");
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, Object> resMap = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ VmPaymentInf paymentInf = new VmPaymentInf();
|
|
|
|
|
+ // 支付通道
|
|
|
|
|
+ String payChannel = Service.lookup(IPublicService.class).getSysParValue(user.getChannel() +"_PERSONALPAY_PAY_CHANNEL");
|
|
|
|
|
+
|
|
|
|
|
+ //汇联
|
|
|
|
|
+ if("HLZF".equals(payChannel)) {
|
|
|
|
|
+ VmEquipmentInf equipmentInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmEquipmentInfMapper.class).selectByPrimaryKey(ordInf.getEquipmentId());
|
|
|
|
|
+ if(equipmentInf == null) {
|
|
|
|
|
+ throw new MINBusinessException("没有找到此售货机");
|
|
|
|
|
+ }
|
|
|
|
|
+ String branchid = equipmentInf.getBranchid();
|
|
|
|
|
+ //查询商户开通了那个支付渠道
|
|
|
|
|
+ String pay_channel = Service.lookup(IPublicService.class).getSysParValue( "PAY_CHANNEL");
|
|
|
|
|
+ //查询机器所属机构
|
|
|
|
|
+ VmAccountExample accExp = new VmAccountExample();
|
|
|
|
|
+ accExp.createCriteria().andChannelEqualTo(user.getChannel()).andUsridEqualTo(branchid).andTypeEqualTo(pay_channel);
|
|
|
|
|
+ List<VmAccount> accList = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmAccountMapper.class).selectByExample(accExp);
|
|
|
|
|
+ if(accList.size() != 1 ){
|
|
|
|
|
+ throw new MINBusinessException("商户收款账户异常");
|
|
|
|
|
+ }
|
|
|
|
|
+ String accNo = accList.get(0).getNumber();
|
|
|
|
|
+
|
|
|
|
|
+ //支付后台回调地址
|
|
|
|
|
+ String notify_url = Service.lookup(IPublicService.class).getSysParValue(user.getChannel() + "_SHOUHUO_NOTIFY_URL");
|
|
|
|
|
+ //notify_url = "http://xubing2.minpay.cc/services";
|
|
|
|
|
+
|
|
|
|
|
+ notify_url = notify_url + "/ShouhuoPay/personalPayCallBack";
|
|
|
|
|
+ if("05".equals(pay_channel)){
|
|
|
|
|
+ pay_channel = "09";
|
|
|
|
|
+ }
|
|
|
|
|
+ String turntablePage = Service.lookup(IPublicService.class).getSysParValue(user.getChannel() + "_SHOUHUO_TURNTABLE_PAGE");
|
|
|
|
|
+ turntablePage = turntablePage.concat("orderId="+ordId);
|
|
|
|
|
+ Huilianpay prePay = new Huilianpay();
|
|
|
|
|
+ IHuilianPayService huilianPayService = new HuilianPayServiceImpl();
|
|
|
|
|
+ if("91".equals(payType)){
|
|
|
|
|
+ payType = "WX";
|
|
|
|
|
+ }
|
|
|
|
|
+ if("92".equals(payType)){
|
|
|
|
|
+ payType = "ALI";
|
|
|
|
|
+ }
|
|
|
|
|
+ prePay.setChannel(payType);
|
|
|
|
|
+ prePay.setNotifyUrl(notify_url);
|
|
|
|
|
+ prePay.setOpenId(user.getOpenid());
|
|
|
|
|
+ prePay.setOutTradeNo(ordId);
|
|
|
|
|
+ prePay.setProviderType(pay_channel);
|
|
|
|
|
+ prePay.setTotalAmount(rechargeAmt);
|
|
|
|
|
+ prePay.setHlMerchantId(accNo);
|
|
|
|
|
+ prePay.setGoodName(ordId);
|
|
|
|
|
+ prePay.setSucUrl(turntablePage);
|
|
|
|
|
+ resMap = huilianPayService.prePay(prePay);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new MINBusinessException("调用支付失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ res.set("payMap",resMap);
|
|
|
return res;
|
|
return res;
|
|
|
}
|
|
}
|
|
|
|
|
|