区块链调试

This commit is contained in:
zhangqinbin
2021-09-06 14:57:07 +08:00
parent b5b7c44c0e
commit 21568b7a4e
2 changed files with 7 additions and 3 deletions

View File

@ -16,6 +16,7 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class}) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})
@EnableFeignClients @EnableFeignClients
@ -23,6 +24,7 @@ import org.springframework.context.annotation.ComponentScan;
@MapperScan({"com.chinaunicom.mall.ebtp.extend.**.dao"}) @MapperScan({"com.chinaunicom.mall.ebtp.extend.**.dao"})
@ComponentScan("com.chinaunicom.mall.ebtp.*") @ComponentScan("com.chinaunicom.mall.ebtp.*")
@EnableApolloConfig @EnableApolloConfig
@EnableAsync
public class BizServiceEbtpExtendApplication { public class BizServiceEbtpExtendApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -28,6 +28,7 @@ import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.InputStream; import java.io.InputStream;
@ -70,6 +71,7 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
* @return * @return
*/ */
@Override @Override
@Async
public Boolean callUniInterface(CrypBean bean){ public Boolean callUniInterface(CrypBean bean){
log.info("区块链------callUniInterface---入参-----"+JSON.toJSONString(bean)); log.info("区块链------callUniInterface---入参-----"+JSON.toJSONString(bean));
BlockChainLog blockChainLog = new BlockChainLog(); BlockChainLog blockChainLog = new BlockChainLog();
@ -78,13 +80,13 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
blockChainLog.setInterfaceUrl(bean.getUrl()); blockChainLog.setInterfaceUrl(bean.getUrl());
try { try {
LinkedHashMap<String, Object> map = JSONArray.parseObject(JSONArray.toJSONString(bean.getObject(),SerializerFeature.WriteMapNullValue), LinkedHashMap.class); Map<String, Object> map = JSONArray.parseObject(JSONArray.toJSONString(bean.getObject(),SerializerFeature.WriteMapNullValue), Map.class);
Object signObject = new Object(); Object signObject = new Object();
if(map.get("BODY_LIST")!=null){ if(map.get("BODY_LIST")!=null){
signObject = map.get("BODY_LIST"); signObject = map.get("BODY_LIST");
}else{ }else{
signObject =map; signObject = map;
} }
//传入数据解密 //传入数据解密
String sign = getSignValue(signObject); String sign = getSignValue(signObject);
@ -169,7 +171,7 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
* @param map * @param map
* @return * @return
*/ */
private String getUniBss(String reqName, LinkedHashMap<String,Object> map){ private String getUniBss(String reqName, Map<String,Object> map){
//获取token //获取token
Date date = new Date(); Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");