提交代码

new-dev
胡锐 1 year ago
parent fabb442e27
commit c07a4b655e
  1. 144
      hai-order/src/main/java/com/web/controller/OrderController.java
  2. 4
      hai-order/src/main/java/com/web/controller/OrderPayNotifyController.java
  3. 12
      hai-order/src/main/java/com/web/controller/notify/HuiPayNotifyController.java
  4. 87
      hai-service/src/main/java/com/hai/dao/HighOrderMapper.java
  5. 14
      hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java
  6. 40
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  7. 70
      hai-service/src/main/java/com/hai/entity/HighOrderExample.java
  8. 3
      hai-service/src/main/java/com/hai/order/service/OrderPaySuccessService.java
  9. 2
      hai-service/src/main/java/com/hai/order/service/OrderService.java
  10. 8
      hai-service/src/main/java/com/hai/order/service/impl/OrderPayServiceImpl.java
  11. 5
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  12. 19
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java

@ -280,139 +280,81 @@ public class OrderController {
@ResponseBody @ResponseBody
@ApiOperation(value = "根据订单号查询详情") @ApiOperation(value = "根据订单号查询详情")
public ResponseData getDetailByOrderNo(@RequestParam(name = "orderNo", required = false) String orderNo, public ResponseData getDetailByOrderNo(@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "paySerialNo", required = false) String paySerialNo) { @RequestParam(name = "paySerialNo", required = false) String paySerialNo,
@RequestParam(name = "payChannelOrderNo", required = false) String payChannelOrderNo
) {
try { try {
if (StringUtils.isBlank(orderNo) && StringUtils.isBlank(paySerialNo) && StringUtils.isBlank(payChannelOrderNo)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, "");
if (StringUtils.isBlank(orderNo) && StringUtils.isBlank(paySerialNo)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.USE_VISIT_ILLEGAL, "");
} }
HighOrder highOrder = null; HighOrder highOrder = null;
if (StringUtils.isNotBlank(orderNo)) { if (StringUtils.isNotBlank(orderNo)) {
highOrder = orderService.getOrderDetailByNo(orderNo); highOrder = orderService.getOrderDetailByNo(orderNo);
if (highOrder.getProductType() == 12) {
// todo 临时代码
for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) {
GoodsLogistics logistics = goodsLogisticsService.findGoodsLogistics(childOrder.getId());
if (logistics != null) {
childOrder.setExt6(logistics.getLogisticsStatusDesc());
childOrder.setExt4(logistics.getNumber());
}
}
GoodsOrder order = goodsOrderExtService.findGoodsOrder(highOrder.getOrderNo());
GoodsDeliveryAddress deliveryAddress = deliveryAddressService.findDeliveryAddressById(order.getDeliveryAddressId());
GoodsOrderModel goodsOrderModel = new GoodsOrderModel();
BeanUtils.copyProperties(highOrder , goodsOrderModel);
goodsOrderModel.setGoodsOrder(order);
goodsOrderModel.setGoodsDeliveryAddress(deliveryAddress);
return ResponseMsgUtil.success(goodsOrderModel);
} else if (highOrder.getProductType() == 17) {
GoodsOrderModel goodsOrderModel = new GoodsOrderModel();
BeanUtils.copyProperties(highOrder , goodsOrderModel);
HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo());
JSONObject object = groupService.getGroupContent(highGroupOrder.getGroupId());
if (object.getString("return_code").equals("000000")) {
goodsOrderModel.setGroupData(object.getJSONObject("return_data"));
}
JSONObject objectStore = groupService.getStoreMsg(highGroupOrder.getStoreId());
if (objectStore.getString("return_code").equals("000000")) {
goodsOrderModel.setStoreData(objectStore.getJSONObject("return_data"));
}
Map<String , Object> map = new HashMap<>(); } else if (StringUtils.isNotBlank(paySerialNo)) {
map.put("orderId" , highOrder.getId()); highOrder = orderService.getOrderDetailBySerialNo(paySerialNo);
HighGroupCode highGroupCode = groupCodeService.findGroupCode(map); } else if (StringUtils.isNotBlank(payChannelOrderNo)) {
goodsOrderModel.setHighGroupCode(highGroupCode); highOrder = orderService.getOrderDetailByChannelOrderNo(payChannelOrderNo);
return ResponseMsgUtil.success(goodsOrderModel);
} }
if (highOrder == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, "");
} }
if (StringUtils.isNotBlank(paySerialNo)) { if (highOrder.getProductType() == 12) {
highOrder = orderService.getOrderDetailBySerialNo(paySerialNo);
if (highOrder.getProductType() == 12) {
// todo 临时代码
for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { // todo 临时代码
GoodsLogistics logistics = goodsLogisticsService.findGoodsLogistics(childOrder.getId()); for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) {
if (logistics != null) {
childOrder.setExt6(logistics.getLogisticsStatusDesc());
childOrder.setExt4(logistics.getNumber());
}
GoodsLogistics logistics = goodsLogisticsService.findGoodsLogistics(childOrder.getId());
if (logistics != null) {
childOrder.setExt6(logistics.getLogisticsStatusDesc());
childOrder.setExt4(logistics.getNumber());
} }
}
GoodsOrder order = goodsOrderExtService.findGoodsOrder(highOrder.getOrderNo());
GoodsDeliveryAddress deliveryAddress = deliveryAddressService.findDeliveryAddressById(order.getDeliveryAddressId());
GoodsOrderModel goodsOrderModel = new GoodsOrderModel();
BeanUtils.copyProperties(highOrder , goodsOrderModel);
goodsOrderModel.setGoodsOrder(order);
goodsOrderModel.setGoodsDeliveryAddress(deliveryAddress);
return ResponseMsgUtil.success(goodsOrderModel); GoodsOrder order = goodsOrderExtService.findGoodsOrder(highOrder.getOrderNo());
GoodsDeliveryAddress deliveryAddress = deliveryAddressService.findDeliveryAddressById(order.getDeliveryAddressId());
} else if (highOrder.getProductType() == 17) { GoodsOrderModel goodsOrderModel = new GoodsOrderModel();
BeanUtils.copyProperties(highOrder , goodsOrderModel);
goodsOrderModel.setGoodsOrder(order);
goodsOrderModel.setGoodsDeliveryAddress(deliveryAddress);
GoodsOrderModel goodsOrderModel = new GoodsOrderModel();
BeanUtils.copyProperties(highOrder , goodsOrderModel);
HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo());
JSONObject object = groupService.getGroupContent(highGroupOrder.getGroupId()); return ResponseMsgUtil.success(goodsOrderModel);
if (object.getString("return_code").equals("000000")) { } else if (highOrder.getProductType() == 17) {
goodsOrderModel.setGroupData(object.getJSONObject("return_data"));
}
JSONObject objectStore = groupService.getStoreMsg(highGroupOrder.getStoreId()); GoodsOrderModel goodsOrderModel = new GoodsOrderModel();
BeanUtils.copyProperties(highOrder , goodsOrderModel);
if (objectStore.getString("return_code").equals("000000")) { HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo());
goodsOrderModel.setStoreData(objectStore.getJSONObject("return_data"));
}
JSONObject object = groupService.getGroupContent(highGroupOrder.getGroupId());
Map<String , Object> map = new HashMap<>(); if (object.getString("return_code").equals("000000")) {
map.put("orderId" , highOrder.getId()); goodsOrderModel.setGroupData(object.getJSONObject("return_data"));
HighGroupCode highGroupCode = groupCodeService.findGroupCode(map);
goodsOrderModel.setHighGroupCode(highGroupCode);
return ResponseMsgUtil.success(goodsOrderModel);
} }
JSONObject objectStore = groupService.getStoreMsg(highGroupOrder.getStoreId());
if (objectStore.getString("return_code").equals("000000")) {
goodsOrderModel.setStoreData(objectStore.getJSONObject("return_data"));
}
Map<String , Object> map = new HashMap<>();
map.put("orderId" , highOrder.getId());
HighGroupCode highGroupCode = groupCodeService.findGroupCode(map);
goodsOrderModel.setHighGroupCode(highGroupCode);
return ResponseMsgUtil.success(goodsOrderModel);
} }
return ResponseMsgUtil.success(highOrder); return ResponseMsgUtil.success(highOrder);

@ -75,7 +75,7 @@ public class OrderPayNotifyController {
OrderPayType.PAY_TYPE2, OrderPayType.PAY_TYPE2,
map.get("transaction_id"), map.get("transaction_id"),
new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100")), new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100")),
null); null,null);
} }
log.info("处理业务完成"); log.info("处理业务完成");
@ -115,7 +115,7 @@ public class OrderPayNotifyController {
OrderPayType.PAY_TYPE5, OrderPayType.PAY_TYPE5,
body.getString("wtorderid"), body.getString("wtorderid"),
order.getPayPrice(), order.getPayPrice(),
null); null,null);
} }
log.info("处理业务完成"); log.info("处理业务完成");
} }

@ -20,6 +20,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@Controller @Controller
@RequestMapping(value = "/huiPayNotify") @RequestMapping(value = "/huiPayNotify")
@ -57,12 +59,18 @@ public class HuiPayNotifyController {
} else if (dataObject.getString("payMode").equals("UQRCODEPAY")) { } else if (dataObject.getString("payMode").equals("UQRCODEPAY")) {
orderPayType = OrderPayType.PAY_TYPE5; orderPayType = OrderPayType.PAY_TYPE5;
} }
Map<String,Object> other = new HashMap<>();
other.put("payChannelOrderNo", dataObject.getString("platformTradeNo"));
// 处理订单业务 // 处理订单业务
paySuccessService.orderPaySuccessHandle(dataObject.getString("outTradeNo"), paySuccessService.orderPaySuccessHandle(
dataObject.getString("outTradeNo"),
orderPayType, orderPayType,
dataObject.getString("accTradeNo"), dataObject.getString("accTradeNo"),
dataObject.getBigDecimal("tradeAmount"), dataObject.getBigDecimal("tradeAmount"),
null); null,
other);
} }
log.info("处理业务完成"); log.info("处理业务完成");
log.info("============回调任务End============="); log.info("============回调任务End=============");

@ -45,50 +45,52 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"mem_id, mem_name, mem_phone, ", "mem_id, mem_name, mem_phone, ",
"combine_order_no, order_no, ", "combine_order_no, order_no, ",
"pay_serial_no, pay_channel, ", "pay_serial_no, pay_channel, ",
"pay_type, mem_card_id, ", "pay_channel_order_no, pay_type, ",
"mem_card_type, mem_card_no, ", "mem_card_id, mem_card_type, ",
"freight_price, goods_total_price, ", "mem_card_no, freight_price, ",
"total_price, payable_price, ", "goods_total_price, total_price, ",
"pay_price, pay_real_price, ", "payable_price, pay_price, ",
"order_status, remarks, ", "pay_real_price, order_status, ",
"create_time, total_deduction_price, ", "remarks, create_time, ",
"deduction_coupon_price, deduction_product_price, ", "total_deduction_price, deduction_coupon_price, ",
"pay_gold, surplus_refund_price, ", "deduction_product_price, pay_gold, ",
"surplus_refund_integral, pay_time, ", "surplus_refund_price, surplus_refund_integral, ",
"finish_time, cancel_time, ", "pay_time, finish_time, ",
"cancel_remarks, refund_time, ", "cancel_time, cancel_remarks, ",
"account_merchant_num, profit_sharing_status, ", "refund_time, account_merchant_num, ",
"profit_sharing_record_id, whether_check, ", "profit_sharing_status, profit_sharing_record_id, ",
"whether_rebate, exception_status, ", "whether_check, whether_rebate, ",
"exception_content, company_name, ", "exception_status, exception_content, ",
"promote_code, sec_user_id, ", "company_name, promote_code, ",
"ext_1, ext_2, ext_3, ", "sec_user_id, ext_1, ",
"ext_4, ext_5, ext_6)", "ext_2, ext_3, ext_4, ",
"ext_5, ext_6)",
"values (#{title,jdbcType=VARCHAR}, #{searchTitle,jdbcType=VARCHAR}, ", "values (#{title,jdbcType=VARCHAR}, #{searchTitle,jdbcType=VARCHAR}, ",
"#{productType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ", "#{productType,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
"#{memDiscountId,jdbcType=BIGINT}, #{memDiscountName,jdbcType=VARCHAR}, ", "#{memDiscountId,jdbcType=BIGINT}, #{memDiscountName,jdbcType=VARCHAR}, ",
"#{memId,jdbcType=BIGINT}, #{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ", "#{memId,jdbcType=BIGINT}, #{memName,jdbcType=VARCHAR}, #{memPhone,jdbcType=VARCHAR}, ",
"#{combineOrderNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ", "#{combineOrderNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ",
"#{paySerialNo,jdbcType=VARCHAR}, #{payChannel,jdbcType=INTEGER}, ", "#{paySerialNo,jdbcType=VARCHAR}, #{payChannel,jdbcType=INTEGER}, ",
"#{payType,jdbcType=INTEGER}, #{memCardId,jdbcType=BIGINT}, ", "#{payChannelOrderNo,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER}, ",
"#{memCardType,jdbcType=INTEGER}, #{memCardNo,jdbcType=VARCHAR}, ", "#{memCardId,jdbcType=BIGINT}, #{memCardType,jdbcType=INTEGER}, ",
"#{freightPrice,jdbcType=DECIMAL}, #{goodsTotalPrice,jdbcType=DECIMAL}, ", "#{memCardNo,jdbcType=VARCHAR}, #{freightPrice,jdbcType=DECIMAL}, ",
"#{totalPrice,jdbcType=DECIMAL}, #{payablePrice,jdbcType=DECIMAL}, ", "#{goodsTotalPrice,jdbcType=DECIMAL}, #{totalPrice,jdbcType=DECIMAL}, ",
"#{payPrice,jdbcType=DECIMAL}, #{payRealPrice,jdbcType=DECIMAL}, ", "#{payablePrice,jdbcType=DECIMAL}, #{payPrice,jdbcType=DECIMAL}, ",
"#{orderStatus,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, ", "#{payRealPrice,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{totalDeductionPrice,jdbcType=DECIMAL}, ", "#{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{deductionCouponPrice,jdbcType=DECIMAL}, #{deductionProductPrice,jdbcType=DECIMAL}, ", "#{totalDeductionPrice,jdbcType=DECIMAL}, #{deductionCouponPrice,jdbcType=DECIMAL}, ",
"#{payGold,jdbcType=INTEGER}, #{surplusRefundPrice,jdbcType=DECIMAL}, ", "#{deductionProductPrice,jdbcType=DECIMAL}, #{payGold,jdbcType=INTEGER}, ",
"#{surplusRefundIntegral,jdbcType=INTEGER}, #{payTime,jdbcType=TIMESTAMP}, ", "#{surplusRefundPrice,jdbcType=DECIMAL}, #{surplusRefundIntegral,jdbcType=INTEGER}, ",
"#{finishTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ", "#{payTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ",
"#{cancelRemarks,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, ", "#{cancelTime,jdbcType=TIMESTAMP}, #{cancelRemarks,jdbcType=VARCHAR}, ",
"#{accountMerchantNum,jdbcType=VARCHAR}, #{profitSharingStatus,jdbcType=BIT}, ", "#{refundTime,jdbcType=TIMESTAMP}, #{accountMerchantNum,jdbcType=VARCHAR}, ",
"#{profitSharingRecordId,jdbcType=BIGINT}, #{whetherCheck,jdbcType=BIT}, ", "#{profitSharingStatus,jdbcType=BIT}, #{profitSharingRecordId,jdbcType=BIGINT}, ",
"#{whetherRebate,jdbcType=BIT}, #{exceptionStatus,jdbcType=BIT}, ", "#{whetherCheck,jdbcType=BIT}, #{whetherRebate,jdbcType=BIT}, ",
"#{exceptionContent,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, ", "#{exceptionStatus,jdbcType=BIT}, #{exceptionContent,jdbcType=VARCHAR}, ",
"#{promoteCode,jdbcType=VARCHAR}, #{secUserId,jdbcType=BIGINT}, ", "#{companyName,jdbcType=VARCHAR}, #{promoteCode,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ", "#{secUserId,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext4,jdbcType=VARCHAR}, #{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})" "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, #{ext4,jdbcType=VARCHAR}, ",
"#{ext5,jdbcType=VARCHAR}, #{ext6,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighOrder record); int insert(HighOrder record);
@ -113,6 +115,7 @@ public interface HighOrderMapper extends HighOrderMapperExt {
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER), @Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER),
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="mem_card_id", property="memCardId", jdbcType=JdbcType.BIGINT), @Result(column="mem_card_id", property="memCardId", jdbcType=JdbcType.BIGINT),
@Result(column="mem_card_type", property="memCardType", jdbcType=JdbcType.INTEGER), @Result(column="mem_card_type", property="memCardType", jdbcType=JdbcType.INTEGER),
@ -160,9 +163,9 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"select", "select",
"id, title, search_title, product_type, company_id, mem_discount_id, mem_discount_name, ", "id, title, search_title, product_type, company_id, mem_discount_id, mem_discount_name, ",
"mem_id, mem_name, mem_phone, combine_order_no, order_no, pay_serial_no, pay_channel, ", "mem_id, mem_name, mem_phone, combine_order_no, order_no, pay_serial_no, pay_channel, ",
"pay_type, mem_card_id, mem_card_type, mem_card_no, freight_price, goods_total_price, ", "pay_channel_order_no, pay_type, mem_card_id, mem_card_type, mem_card_no, freight_price, ",
"total_price, payable_price, pay_price, pay_real_price, order_status, remarks, ", "goods_total_price, total_price, payable_price, pay_price, pay_real_price, order_status, ",
"create_time, total_deduction_price, deduction_coupon_price, deduction_product_price, ", "remarks, create_time, total_deduction_price, deduction_coupon_price, deduction_product_price, ",
"pay_gold, surplus_refund_price, surplus_refund_integral, pay_time, finish_time, ", "pay_gold, surplus_refund_price, surplus_refund_integral, pay_time, finish_time, ",
"cancel_time, cancel_remarks, refund_time, account_merchant_num, profit_sharing_status, ", "cancel_time, cancel_remarks, refund_time, account_merchant_num, profit_sharing_status, ",
"profit_sharing_record_id, whether_check, whether_rebate, exception_status, exception_content, ", "profit_sharing_record_id, whether_check, whether_rebate, exception_status, exception_content, ",
@ -186,6 +189,7 @@ public interface HighOrderMapper extends HighOrderMapperExt {
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER), @Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER),
@Result(column="pay_channel_order_no", property="payChannelOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
@Result(column="mem_card_id", property="memCardId", jdbcType=JdbcType.BIGINT), @Result(column="mem_card_id", property="memCardId", jdbcType=JdbcType.BIGINT),
@Result(column="mem_card_type", property="memCardType", jdbcType=JdbcType.INTEGER), @Result(column="mem_card_type", property="memCardType", jdbcType=JdbcType.INTEGER),
@ -253,6 +257,7 @@ public interface HighOrderMapper extends HighOrderMapperExt {
"order_no = #{orderNo,jdbcType=VARCHAR},", "order_no = #{orderNo,jdbcType=VARCHAR},",
"pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},", "pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
"pay_channel = #{payChannel,jdbcType=INTEGER},", "pay_channel = #{payChannel,jdbcType=INTEGER},",
"pay_channel_order_no = #{payChannelOrderNo,jdbcType=VARCHAR},",
"pay_type = #{payType,jdbcType=INTEGER},", "pay_type = #{payType,jdbcType=INTEGER},",
"mem_card_id = #{memCardId,jdbcType=BIGINT},", "mem_card_id = #{memCardId,jdbcType=BIGINT},",
"mem_card_type = #{memCardType,jdbcType=INTEGER},", "mem_card_type = #{memCardType,jdbcType=INTEGER},",

@ -80,6 +80,10 @@ public class HighOrderSqlProvider {
sql.VALUES("pay_channel", "#{payChannel,jdbcType=INTEGER}"); sql.VALUES("pay_channel", "#{payChannel,jdbcType=INTEGER}");
} }
if (record.getPayChannelOrderNo() != null) {
sql.VALUES("pay_channel_order_no", "#{payChannelOrderNo,jdbcType=VARCHAR}");
}
if (record.getPayType() != null) { if (record.getPayType() != null) {
sql.VALUES("pay_type", "#{payType,jdbcType=INTEGER}"); sql.VALUES("pay_type", "#{payType,jdbcType=INTEGER}");
} }
@ -263,6 +267,7 @@ public class HighOrderSqlProvider {
sql.SELECT("order_no"); sql.SELECT("order_no");
sql.SELECT("pay_serial_no"); sql.SELECT("pay_serial_no");
sql.SELECT("pay_channel"); sql.SELECT("pay_channel");
sql.SELECT("pay_channel_order_no");
sql.SELECT("pay_type"); sql.SELECT("pay_type");
sql.SELECT("mem_card_id"); sql.SELECT("mem_card_id");
sql.SELECT("mem_card_type"); sql.SELECT("mem_card_type");
@ -376,6 +381,10 @@ public class HighOrderSqlProvider {
sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}"); sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}");
} }
if (record.getPayChannelOrderNo() != null) {
sql.SET("pay_channel_order_no = #{record.payChannelOrderNo,jdbcType=VARCHAR}");
}
if (record.getPayType() != null) { if (record.getPayType() != null) {
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}");
} }
@ -558,6 +567,7 @@ public class HighOrderSqlProvider {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}");
sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}"); sql.SET("pay_channel = #{record.payChannel,jdbcType=INTEGER}");
sql.SET("pay_channel_order_no = #{record.payChannelOrderNo,jdbcType=VARCHAR}");
sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}"); sql.SET("pay_type = #{record.payType,jdbcType=INTEGER}");
sql.SET("mem_card_id = #{record.memCardId,jdbcType=BIGINT}"); sql.SET("mem_card_id = #{record.memCardId,jdbcType=BIGINT}");
sql.SET("mem_card_type = #{record.memCardType,jdbcType=INTEGER}"); sql.SET("mem_card_type = #{record.memCardType,jdbcType=INTEGER}");
@ -660,6 +670,10 @@ public class HighOrderSqlProvider {
sql.SET("pay_channel = #{payChannel,jdbcType=INTEGER}"); sql.SET("pay_channel = #{payChannel,jdbcType=INTEGER}");
} }
if (record.getPayChannelOrderNo() != null) {
sql.SET("pay_channel_order_no = #{payChannelOrderNo,jdbcType=VARCHAR}");
}
if (record.getPayType() != null) { if (record.getPayType() != null) {
sql.SET("pay_type = #{payType,jdbcType=INTEGER}"); sql.SET("pay_type = #{payType,jdbcType=INTEGER}");
} }

@ -98,6 +98,11 @@ public class HighOrder implements Serializable {
*/ */
private Integer payChannel; private Integer payChannel;
/**
* 支付渠道订单号
*/
private String payChannelOrderNo;
/** /**
* 支付方式 1支付宝 2微信 3金币 4汇联通工会卡 5银联 * 支付方式 1支付宝 2微信 3金币 4汇联通工会卡 5银联
*/ */
@ -287,14 +292,18 @@ public class HighOrder implements Serializable {
private String goodsTypeName; private String goodsTypeName;
public String getGoodsTypeName() { private List<HighChildOrder> highChildOrderList;
return goodsTypeName;
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
} }
public void setGoodsTypeName(String goodsTypeName) { public void setHighChildOrderList(List<HighChildOrder> highChildOrderList) {
this.goodsTypeName = goodsTypeName; this.highChildOrderList = highChildOrderList;
} }
private static final long serialVersionUID = 1L;
public String getTime() { public String getTime() {
return time; return time;
} }
@ -303,16 +312,12 @@ public class HighOrder implements Serializable {
this.time = time; this.time = time;
} }
private static final long serialVersionUID = 1L; public String getGoodsTypeName() {
return goodsTypeName;
private List<HighChildOrder> highChildOrderList;
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
} }
public void setHighChildOrderList(List<HighChildOrder> highChildOrderList) { public void setGoodsTypeName(String goodsTypeName) {
this.highChildOrderList = highChildOrderList; this.goodsTypeName = goodsTypeName;
} }
public Long getId() { public Long getId() {
@ -427,6 +432,14 @@ public class HighOrder implements Serializable {
this.payChannel = payChannel; this.payChannel = payChannel;
} }
public String getPayChannelOrderNo() {
return payChannelOrderNo;
}
public void setPayChannelOrderNo(String payChannelOrderNo) {
this.payChannelOrderNo = payChannelOrderNo;
}
public Integer getPayType() { public Integer getPayType() {
return payType; return payType;
} }
@ -773,6 +786,7 @@ public class HighOrder implements Serializable {
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo())) && (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo()))
&& (this.getPayChannel() == null ? other.getPayChannel() == null : this.getPayChannel().equals(other.getPayChannel())) && (this.getPayChannel() == null ? other.getPayChannel() == null : this.getPayChannel().equals(other.getPayChannel()))
&& (this.getPayChannelOrderNo() == null ? other.getPayChannelOrderNo() == null : this.getPayChannelOrderNo().equals(other.getPayChannelOrderNo()))
&& (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType())) && (this.getPayType() == null ? other.getPayType() == null : this.getPayType().equals(other.getPayType()))
&& (this.getMemCardId() == null ? other.getMemCardId() == null : this.getMemCardId().equals(other.getMemCardId())) && (this.getMemCardId() == null ? other.getMemCardId() == null : this.getMemCardId().equals(other.getMemCardId()))
&& (this.getMemCardType() == null ? other.getMemCardType() == null : this.getMemCardType().equals(other.getMemCardType())) && (this.getMemCardType() == null ? other.getMemCardType() == null : this.getMemCardType().equals(other.getMemCardType()))
@ -833,6 +847,7 @@ public class HighOrder implements Serializable {
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode()); result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode());
result = prime * result + ((getPayChannel() == null) ? 0 : getPayChannel().hashCode()); result = prime * result + ((getPayChannel() == null) ? 0 : getPayChannel().hashCode());
result = prime * result + ((getPayChannelOrderNo() == null) ? 0 : getPayChannelOrderNo().hashCode());
result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode()); result = prime * result + ((getPayType() == null) ? 0 : getPayType().hashCode());
result = prime * result + ((getMemCardId() == null) ? 0 : getMemCardId().hashCode()); result = prime * result + ((getMemCardId() == null) ? 0 : getMemCardId().hashCode());
result = prime * result + ((getMemCardType() == null) ? 0 : getMemCardType().hashCode()); result = prime * result + ((getMemCardType() == null) ? 0 : getMemCardType().hashCode());
@ -896,6 +911,7 @@ public class HighOrder implements Serializable {
sb.append(", orderNo=").append(orderNo); sb.append(", orderNo=").append(orderNo);
sb.append(", paySerialNo=").append(paySerialNo); sb.append(", paySerialNo=").append(paySerialNo);
sb.append(", payChannel=").append(payChannel); sb.append(", payChannel=").append(payChannel);
sb.append(", payChannelOrderNo=").append(payChannelOrderNo);
sb.append(", payType=").append(payType); sb.append(", payType=").append(payType);
sb.append(", memCardId=").append(memCardId); sb.append(", memCardId=").append(memCardId);
sb.append(", memCardType=").append(memCardType); sb.append(", memCardType=").append(memCardType);

@ -1046,6 +1046,76 @@ public class HighOrderExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPayChannelOrderNoIsNull() {
addCriterion("pay_channel_order_no is null");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoIsNotNull() {
addCriterion("pay_channel_order_no is not null");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoEqualTo(String value) {
addCriterion("pay_channel_order_no =", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoNotEqualTo(String value) {
addCriterion("pay_channel_order_no <>", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoGreaterThan(String value) {
addCriterion("pay_channel_order_no >", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoGreaterThanOrEqualTo(String value) {
addCriterion("pay_channel_order_no >=", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoLessThan(String value) {
addCriterion("pay_channel_order_no <", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoLessThanOrEqualTo(String value) {
addCriterion("pay_channel_order_no <=", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoLike(String value) {
addCriterion("pay_channel_order_no like", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoNotLike(String value) {
addCriterion("pay_channel_order_no not like", value, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoIn(List<String> values) {
addCriterion("pay_channel_order_no in", values, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoNotIn(List<String> values) {
addCriterion("pay_channel_order_no not in", values, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoBetween(String value1, String value2) {
addCriterion("pay_channel_order_no between", value1, value2, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayChannelOrderNoNotBetween(String value1, String value2) {
addCriterion("pay_channel_order_no not between", value1, value2, "payChannelOrderNo");
return (Criteria) this;
}
public Criteria andPayTypeIsNull() { public Criteria andPayTypeIsNull() {
addCriterion("pay_type is null"); addCriterion("pay_type is null");
return (Criteria) this; return (Criteria) this;

@ -6,6 +6,7 @@ import com.hai.entity.HighUserCard;
import com.hai.order.type.OrderPayType; import com.hai.order.type.OrderPayType;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Map;
/** /**
* 订单支付成功业务 * 订单支付成功业务
@ -23,6 +24,6 @@ public interface OrderPaySuccessService {
* @param userCard 用户卡 * @param userCard 用户卡
* @return * @return
*/ */
HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard); HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard, Map<String,Object> other);
} }

@ -80,6 +80,8 @@ public interface OrderService {
*/ */
HighOrder getOrderDetailBySerialNo(String paySerialNo); HighOrder getOrderDetailBySerialNo(String paySerialNo);
HighOrder getOrderDetailByChannelOrderNo(String payChannelOrderNo);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @Name getOrderDetail * @Name getOrderDetail

@ -113,7 +113,7 @@ public class OrderPayServiceImpl implements OrderPayService {
OrderPayType.PAY_TYPE4, OrderPayType.PAY_TYPE4,
consumptionResult.getString("orderId"), consumptionResult.getString("orderId"),
order.getPayPrice(), order.getPayPrice(),
userCard); userCard,null);
} }
@ -133,7 +133,7 @@ public class OrderPayServiceImpl implements OrderPayService {
OrderPayType.PAY_TYPE7, OrderPayType.PAY_TYPE7,
null, null,
order.getPayPrice(), order.getPayPrice(),
userCard); userCard,null);
} }
@Override @Override
@ -169,7 +169,7 @@ public class OrderPayServiceImpl implements OrderPayService {
OrderPayType.PAY_TYPE8, OrderPayType.PAY_TYPE8,
null, null,
order.getPayPrice(), order.getPayPrice(),
userCard); userCard,null);
} }
@Override @Override
@ -199,7 +199,7 @@ public class OrderPayServiceImpl implements OrderPayService {
OrderPayType.PAY_TYPE9, OrderPayType.PAY_TYPE9,
null, null,
order.getPayPrice(), order.getPayPrice(),
null); null,null);
} else { } else {
// 加锁失败,重试 // 加锁失败,重试
Thread.sleep(100); Thread.sleep(100);

@ -20,6 +20,8 @@ import com.hai.order.service.OrderService;
import com.hai.order.topic.OrderTopic; import com.hai.order.topic.OrderTopic;
import com.hai.order.type.*; import com.hai.order.type.*;
import com.hai.service.*; import com.hai.service.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.producer.SendCallback; import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult; import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.apache.rocketmq.spring.core.RocketMQTemplate;
@ -131,12 +133,13 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
@Override @Override
public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard) { public HighOrder orderPaySuccessHandle(String orderNo, OrderPayType payType, String paySerialNo, BigDecimal payRealPrice, HighUserCard userCard, Map<String,Object> other) {
HighOrder order = orderService.getOrderDetailByNo(orderNo); HighOrder order = orderService.getOrderDetailByNo(orderNo);
try { try {
if (order != null) { if (order != null) {
order.setPaySerialNo(paySerialNo); order.setPaySerialNo(paySerialNo);
order.setPayRealPrice(payRealPrice); order.setPayRealPrice(payRealPrice);
order.setPayChannelOrderNo(other!=null&& StringUtils.isNotBlank(MapUtils.getString(other, "payChannelOrderNo"))?MapUtils.getString(other, "payChannelOrderNo"):null);
order.setPayTime(new Date()); order.setPayTime(new Date());
order.setPayType(payType != null?payType.getNumber():null); order.setPayType(payType != null?payType.getNumber():null);

@ -609,7 +609,7 @@ public class OrderServiceImpl implements OrderService {
// 支付校验 // 支付校验
orderPayBeforeService.payOrderCheck(order); orderPayBeforeService.payOrderCheck(order);
// 处理业务 // 处理业务
return paySuccessService.orderPaySuccessHandle(orderData.getOrderNo(), OrderPayType.PAY_TYPE3, null, new BigDecimal("0"), null); return paySuccessService.orderPaySuccessHandle(orderData.getOrderNo(), OrderPayType.PAY_TYPE3, null, new BigDecimal("0"), null, null);
} }
return orderData; return orderData;
} }
@ -848,6 +848,23 @@ public class OrderServiceImpl implements OrderService {
return order; return order;
} }
@Override
public HighOrder getOrderDetailByChannelOrderNo(String paySerialNo) {
HighOrderExample orderExample = new HighOrderExample();
orderExample.createCriteria().andPayChannelOrderNoEqualTo(paySerialNo);
List<HighOrder> orderList = orderMapper.selectByExample(orderExample);
if (orderList.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");
}
HighOrder order = orderList.get(0);
// 子订单
HighChildOrderExample childOrderExample = new HighChildOrderExample();
childOrderExample.createCriteria().andOrderIdEqualTo(order.getId());
order.setHighChildOrderList(childOrderMapper.selectByExample(childOrderExample));
return order;
}
@Override @Override
public HighOrder getOrderDetail(String orderNo) { public HighOrder getOrderDetail(String orderNo) {
HighOrderExample orderExample = new HighOrderExample(); HighOrderExample orderExample = new HighOrderExample();

Loading…
Cancel
Save