提交 5c8bf8fc authored 作者: jiangwujie's avatar jiangwujie

feat(sdk):测试lms-manage weight-sig sdk

上级 c849f2b1
......@@ -4,9 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
public enum AppEnum {
;
......@@ -17,6 +15,7 @@ public enum AppEnum {
SMART_WEIGHT(1, "场站-smart-weight"),
PURCHASE_MANAGE(2, "供应链-purchase-manage"),
LMS_SMART_WEIGHT(3, "LMS-smart-weight")
;
......
......@@ -109,6 +109,11 @@
<artifactId>purchase-manage-sdk</artifactId>
</dependency>
<dependency>
<groupId>com.scm</groupId>
<artifactId>lms-manage-sdk</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
......
......@@ -22,6 +22,8 @@ public class LoadAppConfig {
private App smartWeightApp;
private App lmsSmartWeightApp;
public App getPurchaseManageApp() {
if (purchaseManageApp == null) {
......@@ -38,5 +40,12 @@ public class LoadAppConfig {
}
return smartWeightApp;
}
public App getLmsSmartWeightApp() {
if (lmsSmartWeightApp == null) {
lmsSmartWeightApp = appDao.getOneByField(App::getUniqueIdentifier, AppEnum.UniqueIdentifier.LMS_SMART_WEIGHT.getCode()).orElseThrow(
PerformanceResultEnum.DATA_NOT_FIND);
}
return lmsSmartWeightApp;
}
}
package com.clx.performance.controller.temp;
import com.clx.performance.config.LoadAppConfig;
import com.clx.performance.config.PerformanceSmartCompanyNoConfig;
import com.clx.performance.model.App;
import com.msl.common.open.OpenClient;
import com.msl.common.open.RequestConfig;
import com.msl.common.result.Result;
import com.scm.lms.manage.action.WeighingSignatureAction;
import com.scm.lms.manage.dto.WeighingSignatureDTO;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 测试sdk
*
* @Author: jwj
* @Description: 临时接口
* @Date: 2024-08-27
*/
@Slf4j
@RestController
@RequestMapping(value = "/temp/sdk")
public class TempSdkController {
@Autowired
private LoadAppConfig loadAppConfig;
@Autowired
private PerformanceSmartCompanyNoConfig companyNoConfig;
@ApiOperation(value = "weighingSignature", notes = "<br>By:jwj")
@PostMapping("/weighingSignature")
public Result weighingSignature(@RequestParam(value = "childNo") String childNo,
@RequestParam(value = "type", defaultValue = "1") Integer type) {
App app = loadAppConfig.getSmartWeightApp();//对接场站配置信息
//组装配置信息
RequestConfig config = new RequestConfig()
.setAppId(app.getAppNo())
.setAppKey(app.getAppKey())
.setGatewayUrl(app.getCallback());
//通过运单号码查询电子磅单图片
WeighingSignatureAction action = new WeighingSignatureAction();
action.setCustomerRelationNo(String.valueOf(companyNoConfig.getCompanyNo()));
action.setChildNo(childNo);
action.setType(type);
log.info("接口请求电子磅单参数,{}", action);
Result<List<WeighingSignatureDTO>> weighSignature = OpenClient.doAction(config, action);
log.info("接口请求电子磅单返回结果,{}", weighSignature);
return weighSignature;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论