|
@@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.constants.logistics.LogisticsConstant;
|
|
|
+import com.fjhx.entity.apply.ApplyPurchase;
|
|
|
import com.fjhx.entity.logistics.LogisticsInfo;
|
|
|
import com.fjhx.mapper.logistics.LogisticsInfoMapper;
|
|
|
import com.fjhx.params.logistics.LogisticsInfoVo;
|
|
|
+import com.fjhx.service.apply.ApplyPurchaseService;
|
|
|
import com.fjhx.service.logistics.LogisticsDetailsService;
|
|
|
import com.fjhx.service.logistics.LogisticsInfoService;
|
|
|
import com.fjhx.uitl.kd100.KD100Util;
|
|
@@ -39,6 +41,9 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
@Autowired
|
|
|
private LogisticsDetailsService logisticsDetailsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ApplyPurchaseService applyPurchaseService;
|
|
|
+
|
|
|
@Override
|
|
|
public Page<LogisticsInfo> getPage(Map<String, Object> condition) {
|
|
|
|
|
@@ -54,6 +59,12 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
throw new ServiceException("物流信息不能为空");
|
|
|
}
|
|
|
|
|
|
+ //查询采购明细信息
|
|
|
+ List<ApplyPurchase> purchases = applyPurchaseService.lambdaQuery().eq(ApplyPurchase::getPurchaseId, logisticsInfoVo.getBusinessId()).list();
|
|
|
+ if (Func.isEmpty(purchases)) {
|
|
|
+ throw new ServiceException("操作异常,暂无采购信息,请联系管理员!");
|
|
|
+ }
|
|
|
+
|
|
|
//查询快递100的物流信息
|
|
|
JSONObject result = KD100Util.queryTrack(logisticsInfoVo.getLogisticsCompanyCode(), logisticsInfoVo.getCode());
|
|
|
Integer state = result.getInteger("state");
|
|
@@ -64,6 +75,10 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
logisticsInfoVo.setLogisticsStatus(state);
|
|
|
|
|
|
logisticsInfoVo.setStatus(LogisticsConstant.Status.STATUS_0);
|
|
|
+ logisticsInfoVo.setInStockStatus(LogisticsConstant.InStockStatus.STATUS_10);
|
|
|
+
|
|
|
+ //采购总数量
|
|
|
+
|
|
|
save(logisticsInfoVo);
|
|
|
|
|
|
logisticsInfoVo.getDetails().forEach(o -> {
|