update 快递100查询订单信息-添加手机号参数

This commit is contained in:
liao
2023-04-24 12:44:27 +08:00
parent ac84854a9c
commit c3e7c50660
2 changed files with 10 additions and 15 deletions
@@ -20,4 +20,6 @@ public class PostInfoQuery {
@ApiModelProperty("查询的快递单号")
@NotBlank(message = "查询的快递单号不能为空")
private String num;
@ApiModelProperty("收、寄件人的电话号码(只能填写一个,顺丰速运必填)")
private String phone;
}
@@ -51,20 +51,20 @@ public class PostInfoServiceImpl implements IPostInfoService {
@Override
public Result<QueryInfoParam> queryInfo(PostInfoQuery postInfoQuery) {
// 1.判断是否是邮寄管理中的数据
String phone = checkIsMySystem(postInfoQuery);
checkIsMySystem(postInfoQuery);
// 2.调用api
Result<QueryInfoParam> result = sendReq(postInfoQuery, phone);
Result<QueryInfoParam> result = sendReq(postInfoQuery);
return result;
}
private Result<QueryInfoParam> sendReq(PostInfoQuery postInfoQuery, String phone) {
private Result<QueryInfoParam> sendReq(PostInfoQuery postInfoQuery) {
QueryTrackReq queryTrackReq = new QueryTrackReq();
QueryTrackParam queryTrackParam = new QueryTrackParam();
setCom(postInfoQuery);
queryTrackParam.setCom(postInfoQuery.getCom());
queryTrackParam.setNum(postInfoQuery.getNum());
queryTrackParam.setPhone(phone);
queryTrackParam.setPhone(postInfoQuery.getPhone());
queryTrackParam.setResultv2("4");
String param = new Gson().toJson(queryTrackParam);
@@ -92,6 +92,9 @@ public class PostInfoServiceImpl implements IPostInfoService {
private void setCom(PostInfoQuery postInfoQuery) {
if ("1".equals(postInfoQuery.getCom())) {
postInfoQuery.setCom(SF);
if (StringUtils.isBlank(postInfoQuery.getPhone())) {
throw new JeroBootException("顺丰速递必须填写手机号!");
}
} else if ("2".equals(postInfoQuery.getCom())) {
postInfoQuery.setCom(EMS);
} else {
@@ -104,7 +107,7 @@ public class PostInfoServiceImpl implements IPostInfoService {
* @Date: 2023/4/23 15:18
* @Remarks: 判断是否是邮寄管理中的数据
*/
private String checkIsMySystem(PostInfoQuery postInfoQuery) {
private void checkIsMySystem(PostInfoQuery postInfoQuery) {
Page<PayMailContracrList> page1 = new Page<>(1, 1);
PayMailContracrList payMailContracrList = new PayMailContracrList();
payMailContracrList.setPostNo(postInfoQuery.getNum());
@@ -115,18 +118,8 @@ public class PostInfoServiceImpl implements IPostInfoService {
Page<PayMailBill> page2 = new Page<>(1, 1);
IPage<PayMailBill> pageList2 = payMailBillService.pageList(page2, queryWrapper);
int size2 = pageList2.getRecords().size();
String phone;
if (size1 < 1 && size2 < 1) {
throw new JeroBootException("只能查询“票据邮寄”和“合同邮寄”中的快递单号信息!");
} else if (size2 < 1) {
phone = pageList1.getRecords().get(0).getPrincipalPhone();
} else {
phone = pageList2.getRecords().get(0).getPrincipalPhone();
}
if (StringUtils.isBlank(phone)) {
throw new JeroBootException("该邮寄信息没有填写邮寄人电话!");
}
phone = PasswordUtil.decrypt(phone);
return phone;
}
}