|
@@ -12,6 +12,7 @@ import com.fdkankan.manage.httpClient.param.OpenApiAddParam;
|
|
|
import com.fdkankan.manage.httpClient.param.OpenApiPageParam;
|
|
|
import com.fdkankan.manage.httpClient.param.OpenApiUpdateParam;
|
|
|
import com.fdkankan.manage.httpClient.vo.FdkkResponse;
|
|
|
+import com.fdkankan.manage.httpClient.vo.OpenApiResponse;
|
|
|
import com.fdkankan.manage.service.ISysUserService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -36,30 +37,25 @@ public class OpenApiService {
|
|
|
HashMap<Long,SysUser> map = new HashMap<>();
|
|
|
sysUserList.forEach( e -> map.put(e.getId(),e));
|
|
|
|
|
|
- FdkkResponse response = openApiClient.page(param);
|
|
|
+ OpenApiResponse response = openApiClient.page(param);
|
|
|
if(response.getCode() == 0 && response.getData() != null){
|
|
|
JSONObject data = response.getData();
|
|
|
JSONArray list = data.getJSONArray("list");
|
|
|
for (Object object : list) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
Integer useType = jsonObject.getInteger("useType");
|
|
|
- if(useType != null){
|
|
|
- jsonObject.put("useTypeStr",DictUtil.toStringUseType(useType));
|
|
|
- }
|
|
|
+ jsonObject.put("useTypeStr",useType != null ?DictUtil.toStringUseType(useType):"");
|
|
|
+
|
|
|
Integer customerType = jsonObject.getInteger("customerType");
|
|
|
- if(customerType != null){
|
|
|
- jsonObject.put("customerTypeStr",DictUtil.toStringCustomerType(customerType));
|
|
|
- }
|
|
|
+ jsonObject.put("customerTypeStr",customerType != null ?DictUtil.toStringCustomerType(customerType):"");
|
|
|
+
|
|
|
Long createrId = jsonObject.getLong("createrId");
|
|
|
- if(createrId != null){
|
|
|
- SysUser sysUser = map.get(createrId);
|
|
|
- jsonObject.put("createrName",sysUser != null ?sysUser.getNickName():"");
|
|
|
- }
|
|
|
+ SysUser createUser =createrId != null? map.get(createrId) :null;
|
|
|
+ jsonObject.put("createrName",createUser != null ?createUser.getNickName():"");
|
|
|
+
|
|
|
Long updaterId = jsonObject.getLong("updaterId");
|
|
|
- if(updaterId != null){
|
|
|
- SysUser sysUser = map.get(updaterId);
|
|
|
- jsonObject.put("updaterName",sysUser != null ?sysUser.getNickName():"");
|
|
|
- }
|
|
|
+ SysUser updateUser = updaterId != null ?map.get(updaterId) :null;
|
|
|
+ jsonObject.put("updaterName",updateUser != null ?updateUser.getNickName():"");
|
|
|
}
|
|
|
}
|
|
|
return response;
|
|
@@ -73,7 +69,7 @@ public class OpenApiService {
|
|
|
try {
|
|
|
param.setUpdaterId(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
param.setCreaterId(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
- FdkkResponse response = openApiClient.add(param);
|
|
|
+ OpenApiResponse response = openApiClient.add(param);
|
|
|
return response;
|
|
|
}catch (Exception e){
|
|
|
log.info("访问openApi接口出错:{}",e);
|
|
@@ -84,7 +80,7 @@ public class OpenApiService {
|
|
|
public Object updateStatus(OpenApiUpdateParam param){
|
|
|
try {
|
|
|
param.setUpdaterId(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
- FdkkResponse response = openApiClient.updateStatus(param);
|
|
|
+ OpenApiResponse response = openApiClient.updateStatus(param);
|
|
|
return response;
|
|
|
}catch (Exception e){
|
|
|
log.info("访问openApi接口出错:{}",e);
|
|
@@ -95,7 +91,7 @@ public class OpenApiService {
|
|
|
public Object delete(OpenApiUpdateParam param){
|
|
|
try {
|
|
|
param.setUpdaterId(Long.valueOf(StpUtil.getLoginId().toString()));
|
|
|
- FdkkResponse response = openApiClient.delete(param);
|
|
|
+ OpenApiResponse response = openApiClient.delete(param);
|
|
|
return response;
|
|
|
}catch (Exception e){
|
|
|
log.info("访问openApi接口出错:{}",e);
|