Commit aa6dd11c by 吴一龙

fix StudioAxfOrder add merchantNo

parent 218b0cdb
......@@ -32,6 +32,9 @@ public class PageStudioAxfOrderRequest {
@ApiModelProperty(value = "学员名称")
private String studentName;
@ApiModelProperty(value = "支付宝pid")
private String merchantNo;
@ApiModelProperty(value = "订单号")
private String voucherBusinessNo;
......
......@@ -67,6 +67,13 @@ public class StudioAxfOrder implements Serializable {
*/
private Long merchantId;
/**
* 备注: 支付宝pid/userid
* 是否允许为null: No
*/
private String merchantNo;
/**
* 备注: 商品ID
* 是否允许为null: YES
......@@ -214,6 +221,8 @@ public class StudioAxfOrder implements Serializable {
public static final String MERCHANT_ID = "merchant_id";
public static final String MERCHANT_NO = "merchant_no";
public static final String COMMODITY_ID = "commodity_id";
public static final String STUDENT_ID = "student_id";
......
......@@ -47,7 +47,7 @@ public class StudioAxfOrderRpService extends MapperRepoService<Long, StudioAxfOr
}
public org.springframework.data.domain.Page<StudioAxfOrder> page(List<Long> studioIds, Long studentId,
String studentName,
String studentName, String merchantNo,
String voucherBusinessNo, String thirdOrderNo, Date signTimeStart, Date signTimeEnd,
Date cancelTimeStart, Date cancelTimeEnd, AxfOrderSignStateEnums state, Integer current, Integer size) {
QueryWrapper<StudioAxfOrder> wrapper = new QueryWrapper<>();
......@@ -60,6 +60,9 @@ public class StudioAxfOrderRpService extends MapperRepoService<Long, StudioAxfOr
if (StringUtils.isNotEmpty(studentName)) {
wrapper.eq(StudioAxfOrder.STUDENT_NAME, studentName);
}
if (StringUtils.isNotEmpty(merchantNo)){
wrapper.eq(StudioAxfOrder.MERCHANT_NO, merchantNo);
}
if (StringUtils.isNotEmpty(voucherBusinessNo)) {
wrapper.eq(StudioAxfOrder.VOUCHER_BUSINESS_NO, voucherBusinessNo);
}
......
......@@ -319,7 +319,7 @@ public class AxfConvert {
.build();
}
public static StudioAxfOrder toEntity(CommodityOrderEvent event, CommodityVO commodity,
public static StudioAxfOrder toEntity(CommodityOrderEvent event, String merchantNo, CommodityVO commodity,
VoucherVO voucher, MemberDetailVO student) {
AlipayCommerceMerchantcardOrderNotifyModel model = JSON.parseObject(event.getAttr(),
AlipayCommerceMerchantcardOrderNotifyModel.class);
......@@ -328,6 +328,7 @@ public class AxfConvert {
.channelNo(event.getChannelNo())
.studioId(voucher.getSupplierId())
.merchantId(event.getMerchantId())
.merchantNo(merchantNo)
.commodityId(commodity.getId())
.studentId(student.getId())
.studentName(student.getName())
......
......@@ -53,6 +53,7 @@ import com.jiejing.fitness.finance.service.axf.constans.AxfConst;
import com.jiejing.fitness.finance.service.axf.convert.AxfConvert;
import com.jiejing.fitness.finance.service.axf.model.AlipayCommerceMerchantcardDeductionOrderNotifyModel;
import com.jiejing.fitness.finance.service.enums.FinanceErrorEnums;
import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
import com.jiejing.fitness.finance.service.rpc.ResourceRpcService;
import com.jiejing.fitness.finance.service.rpc.StudioRpcService;
import com.jiejing.fitness.finance.service.utils.DingUtil;
......@@ -100,6 +101,7 @@ import com.jiejing.paycenter.common.model.vo.CancelCommodityOrderVO;
import com.jiejing.paycenter.common.model.vo.CommodityVO;
import com.jiejing.paycenter.common.model.vo.CreateCommodityTemplateVO;
import com.jiejing.paycenter.common.model.vo.CreateCommodityVO;
import com.jiejing.paycenter.common.model.vo.MerchantVO;
import com.jiejing.paycenter.common.model.vo.OpenStoreVO;
import com.jiejing.paycenter.common.model.vo.StoreVO;
import com.jiejing.paycenter.common.model.vo.SubChannelVO;
......@@ -130,6 +132,7 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.tuple.Pair;
......@@ -199,6 +202,9 @@ public class AxfServiceImpl implements AxfService {
@Resource
private MemberApi memberApi;
@Resource
private MerchantRpcService merchantRpcService;
@Value("${spring.profiles.active}")
private String env;
......@@ -585,7 +591,8 @@ public class AxfServiceImpl implements AxfService {
}
Page<StudioAxfOrder> page = studioAxfOrderRpService.page(Lists.newArrayList(studioIds),
request.getStudentId(), request.getStudentName(), request.getVoucherBusinessNo(),
request.getStudentId(), request.getStudentName(), request.getMerchantNo(),
request.getVoucherBusinessNo(),
request.getThirdOrderNo(), request.getSignTimeStart(), request.getSignTimeEnd(),
request.getCancelTimeStart(), request.getCancelTimeEnd(), request.getState(), request.getCurrent(),
request.getSize());
......@@ -1056,7 +1063,15 @@ public class AxfServiceImpl implements AxfService {
VoucherVO voucher = this.getVoucher(commodity.getBizId());
MemberDetailVO student = this.getStudent(voucher.getReceiver().getId());
StudioAxfOrder order = AxfConvert.toEntity(event, commodity, voucher, student);
String merchantNo = null;
if (event.getMerchantId()!=null){
MerchantVO merchantVO = merchantRpcService.getByMerchantId(event.getMerchantId());
if (merchantVO!=null){
merchantNo = merchantVO.getMerchantNo();
}
}
StudioAxfOrder order = AxfConvert.toEntity(event, merchantNo, commodity, voucher, student);
studioAxfOrderRpService.insert(order);
}
......
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