线上发货增加测试用mock

This commit is contained in:
liubozhi 2025-04-17 15:45:37 +08:00
parent db5b13c7ab
commit aece26a198
2 changed files with 21 additions and 55 deletions

View File

@ -2,11 +2,15 @@
package com.tmerclub.cloud.common.bean;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.ToString;
/**
* 快递鸟物流详情查询
* @author SJL
*/
@Data
@ToString
public class Quick100 extends SwitchBaseModel {
/**
@ -38,59 +42,10 @@ public class Quick100 extends SwitchBaseModel {
*/
private Boolean mock;
public String getCustomer() {
return customer;
}
/**
* C端下单接口
*
*/
private String cOrder;
public void setCustomer(String customer) {
this.customer = customer;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public String getReqUrl() {
return reqUrl;
}
public void setReqUrl(String reqUrl) {
this.reqUrl = reqUrl;
}
public Boolean getIsPrint() {
return isPrint;
}
public void setIsPrint(Boolean print) {
isPrint = print;
}
public String getPrintReqUrl() {
return printReqUrl;
}
public void setPrintReqUrl(String printReqUrl) {
this.printReqUrl = printReqUrl;
}
public Boolean getMock() {
return mock;
}
public void setMock(Boolean mock) {
this.mock = mock;
}
}

View File

@ -97,7 +97,18 @@ public class DeliveryPrintManager {
printReq.put("param", param);
String repJson = HttpUtil.post(quick100.getPrintReqUrl(), printReq);
logger.info("电子面单请求返回:" + repJson);
DeliveryPrintInfoBO deliveryPrintInfoBO = Json.parseObject(repJson, DeliveryPrintInfoBO.class);
DeliveryPrintInfoBO deliveryPrintInfoBO = new DeliveryPrintInfoBO();
// mock == true
if (quick100.getMock()) {
deliveryPrintInfoBO.setSuccess(true);
deliveryPrintInfoBO.setCode(SUCCESS_CODE);
DeliveryPrintDataInfoBO deliveryPrintDataInfoBO = new DeliveryPrintDataInfoBO();
deliveryPrintDataInfoBO.setKuaidinum("666");
deliveryPrintInfoBO.setData(deliveryPrintDataInfoBO);
}else {
deliveryPrintInfoBO = Json.parseObject(repJson, DeliveryPrintInfoBO.class);
}
if (Objects.isNull(deliveryPrintInfoBO)) {
DeliveryPrintInfoErrorBO deliveryPrintInfoErrorBO = Json.parseObject(repJson, DeliveryPrintInfoErrorBO.class);
if (Objects.isNull(deliveryPrintInfoErrorBO)) {