|
@ -35,6 +35,8 @@ import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; |
|
|
import org.jeecg.modules.logisticsTrajectory.entity.LogisticsTrajectory; |
|
|
import org.jeecg.modules.logisticsTrajectory.entity.LogisticsTrajectory; |
|
|
import org.jeecg.modules.logisticsTrajectory.service.ILogisticsTrajectoryService; |
|
|
import org.jeecg.modules.logisticsTrajectory.service.ILogisticsTrajectoryService; |
|
|
import org.jeecg.common.dblogistics.dto.LogisticsTrackStatusConstants; |
|
|
import org.jeecg.common.dblogistics.dto.LogisticsTrackStatusConstants; |
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
@ -49,6 +51,8 @@ import java.util.List; |
|
|
@Service |
|
|
@Service |
|
|
public class AppletOrderServiceImpl implements AppletOrderService { |
|
|
public class AppletOrderServiceImpl implements AppletOrderService { |
|
|
|
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(AppletOrderServiceImpl.class); |
|
|
|
|
|
|
|
|
//权限 |
|
|
//权限 |
|
|
@Resource |
|
|
@Resource |
|
|
private ShiroRealm shiroRealm; |
|
|
private ShiroRealm shiroRealm; |
|
@ -489,6 +493,9 @@ public class AppletOrderServiceImpl implements AppletOrderService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Object wuliuStatus(String params) { |
|
|
public Object wuliuStatus(String params) { |
|
|
|
|
|
log.info("=== 物流状态推送开始 ==="); |
|
|
|
|
|
log.info("接收到的原始参数: {}", params); |
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
map.put("success", true); |
|
|
map.put("success", true); |
|
|
map.put("result", "true"); |
|
|
map.put("result", "true"); |
|
@ -496,26 +503,51 @@ public class AppletOrderServiceImpl implements AppletOrderService { |
|
|
map.put("error_code", null); |
|
|
map.put("error_code", null); |
|
|
map.put("logisticCompanyID", "DEPPON"); |
|
|
map.put("logisticCompanyID", "DEPPON"); |
|
|
|
|
|
|
|
|
OrderStatusPushRequest request = JSON.parseObject(params, OrderStatusPushRequest.class); |
|
|
|
|
|
map.put("logisticID", request.getLogisticID()); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
OrderStatusPushRequest request = JSON.parseObject(params, OrderStatusPushRequest.class); |
|
|
|
|
|
log.info("解析后的请求对象: {}", JSON.toJSONString(request)); |
|
|
|
|
|
log.info("物流ID: {}", request.getLogisticID()); |
|
|
|
|
|
log.info("状态类型: {}", request.getStatusType()); |
|
|
|
|
|
log.info("备注信息: {}", request.getComments()); |
|
|
|
|
|
|
|
|
|
|
|
map.put("logisticID", request.getLogisticID()); |
|
|
|
|
|
|
|
|
CommonOrder one = commonOrderService.lambdaQuery() |
|
|
|
|
|
.eq(CommonOrder::getLogisticId, request.getLogisticID()) |
|
|
|
|
|
.one(); |
|
|
|
|
|
|
|
|
CommonOrder one = commonOrderService.lambdaQuery() |
|
|
|
|
|
.eq(CommonOrder::getLogisticId, request.getLogisticID()) |
|
|
|
|
|
.one(); |
|
|
|
|
|
|
|
|
if (one == null){ |
|
|
|
|
|
return map; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (one == null){ |
|
|
|
|
|
log.warn("未找到对应的订单,物流ID: {}", request.getLogisticID()); |
|
|
|
|
|
return map; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ("RECEIPTING".equals(request.getStatusType())){//送货中 |
|
|
|
|
|
//拿到快递员手机号 |
|
|
|
|
|
String phoneNumber = extractPhoneNumber(request.getComments()); |
|
|
|
|
|
if (StringUtils.isNotBlank(phoneNumber)){ |
|
|
|
|
|
one.setDeliveryPhone(phoneNumber); |
|
|
|
|
|
commonOrderService.updateById(one); |
|
|
|
|
|
|
|
|
log.info("找到订单,订单ID: {}, 订单状态: {}", one.getId(), one.getState()); |
|
|
|
|
|
|
|
|
|
|
|
if ("RECEIPTING".equals(request.getStatusType())){//送货中 |
|
|
|
|
|
log.info("处理送货中状态..."); |
|
|
|
|
|
//拿到快递员手机号 |
|
|
|
|
|
String phoneNumber = extractPhoneNumber(request.getComments()); |
|
|
|
|
|
log.info("提取到的手机号: {}", phoneNumber); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(phoneNumber)){ |
|
|
|
|
|
log.info("设置快递员手机号: {}", phoneNumber); |
|
|
|
|
|
one.setDeliveryPhone(phoneNumber); |
|
|
|
|
|
commonOrderService.updateById(one); |
|
|
|
|
|
log.info("订单更新成功"); |
|
|
|
|
|
} else { |
|
|
|
|
|
log.warn("未从备注中提取到有效手机号"); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
log.info("其他状态类型: {}, 暂不处理", request.getStatusType()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("处理物流状态推送时发生异常: {}", e.getMessage(), e); |
|
|
|
|
|
map.put("success", false); |
|
|
|
|
|
map.put("error_msg", "处理失败: " + e.getMessage()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.info("=== 物流状态推送结束 ==="); |
|
|
return map; |
|
|
return map; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|