|
@ -10,6 +10,7 @@ import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
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.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@ -38,6 +39,8 @@ public class CreditLogService {
|
|
private HttpClientUtil httpClientUtil;
|
|
private HttpClientUtil httpClientUtil;
|
|
@Autowired
|
|
@Autowired
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
@Autowired
|
|
|
|
private StringRedisTemplate redisTemplate;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 调用第三方积分排名接口
|
|
* 调用第三方积分排名接口
|
|
@ -80,8 +83,11 @@ public class CreditLogService {
|
|
* @param object
|
|
* @param object
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public String insert(JSONObject object){
|
|
|
|
|
|
public JSONObject insert(JSONObject object){
|
|
|
|
init();
|
|
String response = null;
|
|
String response = null;
|
|
|
|
String integrate = getIntegrate("health:blank:integrate:"+object.getString("flag"));
|
|
|
|
object.put("integrate",integrate);
|
|
String url =baseUrl + "createCreditsDetail";
|
|
String url =baseUrl + "createCreditsDetail";
|
|
Map<String,String> params = new HashMap<>();
|
|
Map<String,String> params = new HashMap<>();
|
|
params.put("creditsDetail",object.toJSONString());
|
|
params.put("creditsDetail",object.toJSONString());
|
|
@ -91,7 +97,7 @@ public class CreditLogService {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
logger.error(e.getMessage());
|
|
logger.error(e.getMessage());
|
|
}
|
|
}
|
|
return response;
|
|
|
|
|
|
return JSONObject.parseObject(response);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -167,4 +173,38 @@ public class CreditLogService {
|
|
}
|
|
}
|
|
return JSONObject.parseObject(response);
|
|
return JSONObject.parseObject(response);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询银行账户信息
|
|
|
|
*
|
|
|
|
* @param object 账户对象
|
|
|
|
* @param page 页码
|
|
|
|
* @param size 每页大小
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public JSONObject selectByAccount(JSONObject object,Integer page,Integer size){
|
|
|
|
String response = null;
|
|
|
|
String url =baseUrl + "findAccount";
|
|
|
|
Map<String,String> params = new HashMap<>();
|
|
|
|
params.put("account",object.toJSONString());
|
|
|
|
params.put("page",page.toString());
|
|
|
|
params.put("size",size.toString());
|
|
|
|
try {
|
|
|
|
response = httpClientUtil.httpPost(url,params);
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
logger.error(e.getMessage());
|
|
|
|
}
|
|
|
|
return JSONObject.parseObject(response);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void init(){
|
|
|
|
redisTemplate.opsForValue().set("health:blank:integrate:BIND","20");
|
|
|
|
redisTemplate.opsForValue().set("health:blank:integrate:MEASURE","20");
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getIntegrate(String key){
|
|
|
|
return redisTemplate.opsForValue().get(key);
|
|
|
|
}
|
|
}
|
|
}
|