|
|
@ -10,6 +10,7 @@ import org.jeecg.api.bean.PageBean; |
|
|
|
import org.jeecg.api.service.AppletOrderService; |
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
import org.jeecg.common.dblogistics.dto.LogisticsTrackPushRequest; |
|
|
|
import org.jeecg.common.dblogistics.dto.OrderStatusPushRequest; |
|
|
|
import org.jeecg.config.shiro.ShiroRealm; |
|
|
|
import org.jeecg.modules.commonAddress.entity.CommonAddress; |
|
|
|
import org.jeecg.modules.commonAddress.service.ICommonAddressService; |
|
|
@ -110,13 +111,9 @@ public class AppletOrderServiceImpl implements AppletOrderService { |
|
|
|
|
|
|
|
//得到集合数据 |
|
|
|
for (CommonOrder commonOrder : pageList.getRecords()) { |
|
|
|
//查询下级 |
|
|
|
List<CommonOrder> children = commonOrderService |
|
|
|
.lambdaQuery() |
|
|
|
.eq(CommonOrder::getPid,commonOrder.getId()) |
|
|
|
.list(); |
|
|
|
commonOrder.setCommonOrderList(children); |
|
|
|
|
|
|
|
commonOrder.setCommonOrderList(getCommonOrderList(commonOrder.getId(), 0)); |
|
|
|
|
|
|
|
|
|
|
|
// 设置物流轨迹状态 |
|
|
|
setLogisticsTrajectoryStatus(commonOrder); |
|
|
|
} |
|
|
@ -490,6 +487,38 @@ public class AppletOrderServiceImpl implements AppletOrderService { |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object wuliuStatus(String params) { |
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
|
map.put("success", true); |
|
|
|
map.put("result", "true"); |
|
|
|
map.put("error_msg", null); |
|
|
|
map.put("error_code", null); |
|
|
|
map.put("logisticCompanyID", "DEPPON"); |
|
|
|
|
|
|
|
OrderStatusPushRequest request = JSON.parseObject(params, OrderStatusPushRequest.class); |
|
|
|
map.put("logisticID", request.getLogisticID()); |
|
|
|
|
|
|
|
CommonOrder one = commonOrderService.lambdaQuery() |
|
|
|
.eq(CommonOrder::getLogisticId, request.getLogisticID()) |
|
|
|
.one(); |
|
|
|
|
|
|
|
if (one == null){ |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
if ("RECEIPTING".equals(request.getStatusType())){//送货中 |
|
|
|
//拿到快递员手机号 |
|
|
|
String phoneNumber = extractPhoneNumber(request.getComments()); |
|
|
|
if (StringUtils.isNotBlank(phoneNumber)){ |
|
|
|
one.setDeliveryPhone(phoneNumber); |
|
|
|
commonOrderService.updateById(one); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 计算地址是否包邮 |
|
|
|
* @param address 收货地址对象 |
|
|
@ -546,6 +575,27 @@ public class AppletOrderServiceImpl implements AppletOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 使用正则表达式提取手机号 |
|
|
|
* @param text 包含手机号的文本 |
|
|
|
* @return 提取到的手机号,如果没有找到则返回空字符串 |
|
|
|
*/ |
|
|
|
private String extractPhoneNumber(String text) { |
|
|
|
if (StringUtils.isBlank(text)) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
// 匹配11位手机号的正则表达式 |
|
|
|
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("1[3-9]\\d{9}"); |
|
|
|
java.util.regex.Matcher matcher = pattern.matcher(text); |
|
|
|
|
|
|
|
if (matcher.find()) { |
|
|
|
return matcher.group(); |
|
|
|
} |
|
|
|
|
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据运单号更新订单状态 |
|
|
|
* @param trackingNumber 运单号 |
|
|
|