|
@@ -1,5 +1,6 @@
|
|
package com.fjhx.service.logistics.impl;
|
|
package com.fjhx.service.logistics.impl;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.fjhx.constants.logistics.LogisticsConstant;
|
|
import com.fjhx.constants.logistics.LogisticsConstant;
|
|
@@ -8,8 +9,10 @@ import com.fjhx.mapper.logistics.LogisticsInfoMapper;
|
|
import com.fjhx.params.logistics.LogisticsInfoVo;
|
|
import com.fjhx.params.logistics.LogisticsInfoVo;
|
|
import com.fjhx.service.logistics.LogisticsDetailsService;
|
|
import com.fjhx.service.logistics.LogisticsDetailsService;
|
|
import com.fjhx.service.logistics.LogisticsInfoService;
|
|
import com.fjhx.service.logistics.LogisticsInfoService;
|
|
|
|
+import com.fjhx.uitl.kd100.KD100Util;
|
|
import com.fjhx.utils.FileClientUtil;
|
|
import com.fjhx.utils.FileClientUtil;
|
|
import com.fjhx.utils.wrapperUtil.IWrapper;
|
|
import com.fjhx.utils.wrapperUtil.IWrapper;
|
|
|
|
+import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -47,7 +50,15 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
@Override
|
|
@Override
|
|
public void add(LogisticsInfoVo logisticsInfoVo) {
|
|
public void add(LogisticsInfoVo logisticsInfoVo) {
|
|
- logisticsInfoVo.setStatus(LogisticsConstant.LogisticsStatus.status_0);
|
|
|
|
|
|
+ if (Func.isAnyBlank(logisticsInfoVo.getLogisticsCompanyCode(), logisticsInfoVo.getCode())) {
|
|
|
|
+ throw new ServiceException("物流信息不能为空");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //查询快递100的物流信息
|
|
|
|
+ JSONObject result = KD100Util.queryTrack(logisticsInfoVo.getLogisticsCompanyCode(), logisticsInfoVo.getCode());
|
|
|
|
+ logisticsInfoVo.setLogisticsStatus(result.getInteger("state"));
|
|
|
|
+
|
|
|
|
+ logisticsInfoVo.setStatus(LogisticsConstant.Status.STATUS_0);
|
|
save(logisticsInfoVo);
|
|
save(logisticsInfoVo);
|
|
|
|
|
|
logisticsInfoVo.getDetails().forEach(o -> {
|
|
logisticsInfoVo.getDetails().forEach(o -> {
|