Merge remote-tracking branch 'origin/master'

version1
anthonywj 2 years ago
commit 66297c731e

@ -195,5 +195,21 @@ public class UdiwmsPostDirectController {
return baseResponse;
}
/**
* UDI
*
* @param postDownloadInfo
* @param bindingResult
* @return
*/
@PostMapping("/udisp/sync/downloadNow")
public BaseResponse postDownloadInfo(@RequestBody PostDownloadInfo postDownloadInfo, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
BaseResponse response = postSmpHttp.postDownloadInfo(postDownloadInfo);
return response;
}
}

@ -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, "同步失败!");
}
}

@ -0,0 +1,16 @@
package com.glxp.sale.admin.req.sync;
import lombok.Data;
/**
*
*/
@Data
public class PostDownloadInfo {
/**
*
*/
private Integer type;
}
Loading…
Cancel
Save