记得上下班打卡 | git大法好,push需谨慎

Commit 41cf7326 authored by 姜秀龙's avatar 姜秀龙

离线支付-迈之回调之后的处理

parent 0a57e25c
......@@ -69,8 +69,8 @@ public class MaiZhiAllVo {
private String operationNo;
private String out_trade_no;
private String dgoid;
private String receipt_amount;
private BigDecimal total;
private BigDecimal receipt_amount;
private Integer total;
private String payTime;
private List<User> userList;
......@@ -80,6 +80,26 @@ public class MaiZhiAllVo {
private String phone;
private String idcard;
private BigDecimal money;
private static final User obj = new User();
public static User getNew() {
try {
return (User) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new User();
}
}
private static final OrderParam obj = new OrderParam();
public static OrderParam getNew() {
try {
return (OrderParam) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new OrderParam();
}
}
......@@ -91,6 +111,16 @@ public class MaiZhiAllVo {
@Data
public static class OrderInfoParam {
private List<String> orderList;
private static final OrderInfoParam obj = new OrderInfoParam();
public static OrderInfoParam getNew() {
try {
return (OrderInfoParam) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new OrderInfoParam();
}
}
@Data
......
......@@ -19,9 +19,9 @@ public interface IGoblinRechargeWristbandService extends IService<GoblinRecharge
CheckIdcardResponse auth(IdCardParam param);
OrderResponse createOrder(OrderParam param);
OrderResponse createOrder(OrderParam param, String orderId);
OrderInfoResponse getOrder(OrderInfoParam param);
OrderInfoResponse getOrder(OrderInfoParam param, String orderId);
GenerateDeviceCodeResponse getQrcode(String outno);
......
......@@ -5,10 +5,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.dto.vo.GoblinBraceletOrderVo;
import com.liquidnet.service.goblin.dto.vo.GoblinBraceletPayResultVo;
import com.liquidnet.service.goblin.dto.vo.GoblinRechargeAmountVo;
import com.liquidnet.service.goblin.dto.vo.GoblinRechargeWristbandVo;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.GoblinBraceletOrder;
import com.liquidnet.service.goblin.enums.OrderStatus;
import com.liquidnet.service.goblin.enums.PayStatus;
......@@ -44,6 +41,8 @@ public class GoblinBraceletOrderServiceImpl extends ServiceImpl<GoblinBraceletOr
private IGoblinRechargeWristbandService rechargeWristbandService;
@Autowired
private IGoblinDougongPayService dougongPayService;
@Autowired
private IGoblinRechargeWristbandService iGoblinRechargeWristbandService;
@Override
......@@ -260,6 +259,23 @@ public class GoblinBraceletOrderServiceImpl extends ServiceImpl<GoblinBraceletOr
orderVo.setStatus(OrderStatus.PAID.getCode());
orderVo.setPayStatus(PayStatus.PAID.getCode());
// 去迈之下单
MaiZhiAllVo.OrderParam orderParam = MaiZhiAllVo.OrderParam.getNew();
orderParam.setOperationNo("2");
orderParam.setOut_trade_no(orderVo.getPartyOrderId());
orderParam.setDgoid(orderVo.getOutTransId());
orderParam.setReceipt_amount(orderVo.getPriceTotal());
orderParam.setTotal(1);
orderParam.setPayTime(orderVo.getEndTime());
List<MaiZhiAllVo.OrderParam.User> userList = new ArrayList<>();
MaiZhiAllVo.OrderParam.User user = MaiZhiAllVo.OrderParam.User.getNew();
user.setIdcard(orderVo.getBindIdcard());
user.setName(orderVo.getBindName());
user.setPhone(orderVo.getBindMobile());
user.setMoney(orderVo.getPrice());
userList.add(user);
orderParam.setUserList(userList);
iGoblinRechargeWristbandService.createOrder(orderParam, orderId);
} else {
// 斗拱返回失败
// orderVo.setStatus(OrderStatus.PAID.getCode());
......
......@@ -101,19 +101,51 @@ public class GoblinRechargeWristbandServiceImpl extends ServiceImpl<GoblinRechar
}
@Override
public OrderResponse createOrder(OrderParam param) {
public OrderResponse createOrder(OrderParam param, String orderId) {
String accessToken = this.getAccessToken();
if (null != accessToken) {
return thirdMaiZhiUtils.addOrder(accessToken, param);
OrderResponse addOrder = thirdMaiZhiUtils.addOrder(accessToken, param);
if (addOrder != null && addOrder.getErrcode() == 200) {
OrderInfoParam orderInfoParam = OrderInfoParam.getNew();
List<String> orderList = new ArrayList<>();
orderList.add(param.getDgoid());
orderInfoParam.setOrderList(orderList);
OrderInfoResponse order = this.getOrder(orderInfoParam, orderId);
return addOrder;
}
}
return null;
}
@Override
public OrderInfoResponse getOrder(OrderInfoParam param) {
public OrderInfoResponse getOrder(OrderInfoParam param, String orderId) {
String accessToken = this.getAccessToken();
if (null != accessToken) {
return thirdMaiZhiUtils.getOrder(accessToken, param);
OrderInfoResponse order = thirdMaiZhiUtils.getOrder(accessToken, param);
if (order != null && order.getErrcode() == 200) {
List<OrderInfoResponse.OrderList> outlist = order.getOutlist();
OrderInfoResponse.OrderList orderList = outlist.get(0);
List<OrderInfoResponse.OrderList.UserOrder> userOrder = orderList.getUser_order();
String foutTradeNo = userOrder.get(0).getFout_trade_no();
GoblinBraceletOrderVo orderVo = goblinRedisUtils.getBraceletOrderVo(orderId);
orderVo.setFoutTradeNo(foutTradeNo);
goblinRedisUtils.setBraceletOrderVo(orderVo);
LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("goblin_bracelet_order_update_fout_trade_no"));
LinkedList<Object[]> sqlDataOrder = CollectionUtil.linkedListObjectArr();
sqlDataOrder.add(new Object[]{
foutTradeNo, LocalDateTime.now(), orderId
});
queueUtils.sendMsgByRedis(
MQConst.GoblinQueue.GOBLIN_NFT_ORDER.getKey(),
SqlMapping.gets(sqls, sqlDataOrder)
);
}
}
return null;
}
......
......@@ -199,4 +199,5 @@ candy_user_coupon.update_apply_refund=UPDATE candy_user_coupon SET state=?,opera
goblin_bracelet_order_insert = INSERT INTO `goblin_bracelet_order`(`order_id`, `user_id`, `bind_name`, `bind_mobile`, `bind_idcard`, `req_date`, `goods_desc`, `wristband_id`, `wristband_price`, `amount_id`, `amount_price`, `req_seq_id`, `hf_seq_id`, `trade_type`, `party_order_id`, `price`, `price_total`, `price_refund`, `refund_price_charges`, `refund_number`, `status`, `pay_status`, `created_at`, `updated_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
gpblin_bracelet_order_update= update goblin_bracelet_order set out_trans_id=?, end_time=?, acct_date=?, price_actual=?, time_pay=?, updated_at=? where order_id=?
goblin_bracelet_order_update_cardno=UPDATE goblin_bracelet_order SET cardno=?,updated_at=? WHERE order_id=?
goblin_bracelet_order_update_fout_trade_no=UPDATE goblin_bracelet_order SET fout_trade_no=?,updated_at=? WHERE order_id=?
goblin_bracelet_order_update_refund=UPDATE goblin_bracelet_order SET status=?,refund_status=?,refund_status_note=?,updated_at=? WHERE order_id=?
\ No newline at end of file
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