封装接口,erp定时任务,调用缓存map替换list
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.zt.plat.module.erp.api;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
|
||||
import com.zt.plat.module.erp.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - ERP")
|
||||
public interface ErpExternalApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/erp-external";
|
||||
|
||||
@PostMapping(PREFIX + "/submit")
|
||||
@Operation(summary = "erp数据提交")
|
||||
ResponseEntity<String> submitDataToErp(@Valid @RequestBody ErpSubmitReqDTO reqDTO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.zt.plat.module.erp.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "RPC 服务 - 提交 ERP DTO")
|
||||
@Data
|
||||
public class ErpSubmitReqDTO {
|
||||
/**
|
||||
* 调用ERP接口更新erp数据
|
||||
*
|
||||
* 请求参数说明:
|
||||
* "uuid": 请求uuid,必须
|
||||
* "sapsys": SAP系统ID, 必须
|
||||
* "srcsys": 源调用系统ID,必须
|
||||
* "funcnr": 接口编号,必须,参见RFC功能列表,可调用接口编号范围051-900
|
||||
* "bskey": 调用系统业务单据编号,必须,在外部系统唯一,用于关联
|
||||
* "usrid": 外部系统用户id
|
||||
* "usrnm": 外部系统用户名
|
||||
* "sign": 签名,uuid+srcsys+密码,MD5 32位小写签名,密码另行约定
|
||||
* "req": {具体参数,参见RFC功能列表}
|
||||
*/
|
||||
private String uuid;
|
||||
private String srcsys;
|
||||
private String funcnr;
|
||||
private String bskey;
|
||||
private String usrid;
|
||||
private String usrnm;
|
||||
private String sign;
|
||||
private Map<String, Object> req;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zt.plat.module.erp.enums;
|
||||
|
||||
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||
|
||||
/**
|
||||
* API 相关的枚举
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
public class ApiConstants {
|
||||
|
||||
/**
|
||||
* 服务名
|
||||
*
|
||||
* 注意,需要保证和 spring.application.name 保持一致
|
||||
*/
|
||||
public static final String NAME = "erp-server";
|
||||
|
||||
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/erp";
|
||||
|
||||
public static final String VERSION = "1.0.0";
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user