|
@@ -21,6 +21,7 @@ import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.vo.HzOMSErpResponseDetailVO;
|
|
|
import com.fs.his.vo.HzOMSErpResponseErrorItemVO;
|
|
|
import com.fs.his.vo.HzOMSErpResponseVO;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -31,6 +32,7 @@ import java.nio.charset.StandardCharsets;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class HzOMSErpApiServiceImpl implements ErpApiService {
|
|
|
|
|
@@ -113,7 +115,6 @@ public class HzOMSErpApiServiceImpl implements ErpApiService {
|
|
|
JSONObject dataObj = getDecodeDataJSON(param.getDatapakege());
|
|
|
res.setCode(CODE_SUCCESS);
|
|
|
res.setMessage("同步商品规格库存成功");
|
|
|
-
|
|
|
Long storeId = dataObj.getLong("cptshopcode");
|
|
|
JSONArray syncstocklist = dataObj.getJSONArray("syncstocklist");
|
|
|
List<HzOMSErpResponseErrorItemVO> errorlist = new ArrayList<>();
|
|
@@ -158,6 +159,7 @@ public class HzOMSErpApiServiceImpl implements ErpApiService {
|
|
|
//校验方法调用合法性
|
|
|
String v = legitimateVerification(param);
|
|
|
if (!"".equals(v)) {
|
|
|
+ log.error("调用物流同步失败,参数校验未通过:{},原因是:{}",param,v);
|
|
|
res.setSuccess(Boolean.FALSE);
|
|
|
res.setMessage(v);
|
|
|
return res;
|
|
@@ -165,21 +167,24 @@ public class HzOMSErpApiServiceImpl implements ErpApiService {
|
|
|
//对方传输的datapacage是base64编码的 先解码得到 json
|
|
|
JSONArray dataArr = getDecodeDataJSONArr(param.getDatapakege());
|
|
|
List<HzOMSErpResponseErrorItemVO> errorlist = new ArrayList<>();
|
|
|
+ log.info("平台订单物流信息回传开始同步:{}", dataArr.toJSONString());
|
|
|
dataArr.forEach(oItem -> {
|
|
|
JSONObject item = (JSONObject) oItem;
|
|
|
- //判断订单是否存在
|
|
|
- FsStoreOrder fsOrder = fsStoreOrderService.getOrderByOrderCodeAndStoreId(item.getString("cptordercode"), item.getLong("cptshopcode"));
|
|
|
+ //判断订单是否存在 , item.getLong("cptshopcode")
|
|
|
+ FsStoreOrder fsOrder = fsStoreOrderService.getOrderByOrderCodeAndStoreId(item.getString("cptordercode"));
|
|
|
if (null != fsOrder) {
|
|
|
fsOrder.setDeliveryCode(item.getString("cexpresscode"));
|
|
|
fsOrder.setDeliveryName(item.getString("cexpressname"));
|
|
|
fsOrder.setDeliverySn(item.getString("clogisticsno"));
|
|
|
fsStoreOrderService.updateStoreOrderDeliveryInfo(fsOrder);
|
|
|
+ log.info("平台订单物流信息回传成功:{}", item.toJSONString());
|
|
|
} else {
|
|
|
HzOMSErpResponseErrorItemVO addErrItem = new HzOMSErpResponseErrorItemVO();
|
|
|
addErrItem.setCptordercode(item.getString("cptordercode"));
|
|
|
addErrItem.setCptshopcode(item.getString("cptshopcode"));
|
|
|
addErrItem.setMsg("订单不存在");
|
|
|
errorlist.add(addErrItem);
|
|
|
+ log.error("平台订单物流信息回传失败:{}", item.toJSONString());
|
|
|
}
|
|
|
});
|
|
|
res.setCode(CODE_SUCCESS);
|