|
|
|
@ -10,6 +10,7 @@ import com.glxp.sale.admin.res.sync.UdiRelevanceResponse;
|
|
|
|
|
import com.glxp.sale.admin.service.param.SystemParamConfigService;
|
|
|
|
|
import com.glxp.sale.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.sale.common.util.ResultVOUtils;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -18,6 +19,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Service
|
|
|
|
|
public class PostSmpHttp {
|
|
|
|
|
|
|
|
|
@ -92,7 +94,7 @@ public class PostSmpHttp {
|
|
|
|
|
return udiDlDeviceResponse;
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return ResultVOUtils.error(500, "下载失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -108,12 +110,31 @@ public class PostSmpHttp {
|
|
|
|
|
paramMap.put("orderId", postThirdSysUploadInfo.getOrderId());
|
|
|
|
|
paramMap.put("wzUploadStatus", postThirdSysUploadInfo.getWzUploadStatus());
|
|
|
|
|
paramMap.put("wzUploadResult", postThirdSysUploadInfo.getWzUploadResult());
|
|
|
|
|
String response = UHttpClient.postJson(getSpmsUrl() + "/udiwms/", paramMap, getHeaders());
|
|
|
|
|
String response = UHttpClient.postJson(getSpmsUrl() + "/sps/sync/order/syncOrderUploadInfo", paramMap, getHeaders());
|
|
|
|
|
try {
|
|
|
|
|
BaseResponse baseResponse = JSONUtil.toBean(response, BaseResponse.class);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return ResultVOUtils.error(500, "同步失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* UDI管理系统发送下载请求到自助平台
|
|
|
|
|
*
|
|
|
|
|
* @param postDownloadInfo
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public BaseResponse postDownloadInfo(PostDownloadInfo postDownloadInfo) {
|
|
|
|
|
Map<String, Integer> paramMap = new HashMap<>(1);
|
|
|
|
|
paramMap.put("type", postDownloadInfo.getType());
|
|
|
|
|
String response = UHttpClient.postJson(getSpmsUrl() + "/sps/sync/data/downloadNow", paramMap, getHeaders());
|
|
|
|
|
try {
|
|
|
|
|
BaseResponse baseResponse = JSONUtil.toBean(response, BaseResponse.class);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
return ResultVOUtils.error(500, "同步失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|