|
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.skyversation.xjcy.bean.*;
|
|
import com.skyversation.xjcy.bean.*;
|
|
|
-import com.skyversation.xjcy.service.AuthService;
|
|
|
|
|
import com.skyversation.xjcy.util.HttpUtil;
|
|
import com.skyversation.xjcy.util.HttpUtil;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.core.io.Resource;
|
|
import org.springframework.core.io.Resource;
|
|
@@ -35,7 +34,7 @@ public class DMSService {
|
|
|
|
|
|
|
|
private final Map<DMSQuery, QueryResult> queryCache = new HashMap<>();
|
|
private final Map<DMSQuery, QueryResult> queryCache = new HashMap<>();
|
|
|
|
|
|
|
|
- private JSONObject sendQueryToDms(DMSRequest request) {
|
|
|
|
|
|
|
+ private JSONObject sendQueryToDms(DMSQueryRequest request) {
|
|
|
JSONObject jsonObject;
|
|
JSONObject jsonObject;
|
|
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
|
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
|
|
|
request.params.forEach(params::add);
|
|
request.params.forEach(params::add);
|
|
@@ -68,9 +67,9 @@ public class DMSService {
|
|
|
return jsonObject;
|
|
return jsonObject;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private List<JSONObject> queryDmsList(DMSRequest request, String token, String columnId) {
|
|
|
|
|
|
|
+ private List<JSONObject> queryDmsList(DMSQueryRequest request, String token, String columnId) {
|
|
|
request.token = token;
|
|
request.token = token;
|
|
|
- if (request.type == null) request.type = DMSRequest.DMSRequestType.List;
|
|
|
|
|
|
|
+ if (request.type == null) request.type = DMSQueryRequest.DMSRequestType.List;
|
|
|
request.setColumnId(columnId);
|
|
request.setColumnId(columnId);
|
|
|
request.setState();
|
|
request.setState();
|
|
|
int page = 0;
|
|
int page = 0;
|
|
@@ -102,7 +101,7 @@ public class DMSService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> simpleQuery(String token, String columId) {
|
|
public List<JSONObject> simpleQuery(String token, String columId) {
|
|
|
- return queryDmsList(new DMSRequest(), token, columId);
|
|
|
|
|
|
|
+ return queryDmsList(new DMSQueryRequest(), token, columId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> queryBeautified(String token, DMSColumn column) {
|
|
public List<JSONObject> queryBeautified(String token, DMSColumn column) {
|
|
@@ -124,7 +123,7 @@ public class DMSService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public int getLargestCode(String token, String columId, String codeColumn, String today) {
|
|
public int getLargestCode(String token, String columId, String codeColumn, String today) {
|
|
|
- DMSRequest request = new DMSRequest();
|
|
|
|
|
|
|
+ DMSQueryRequest request = new DMSQueryRequest();
|
|
|
request.addWhere(codeColumn, "2", "%" + today + "%");
|
|
request.addWhere(codeColumn, "2", "%" + today + "%");
|
|
|
List<JSONObject> list = null;
|
|
List<JSONObject> list = null;
|
|
|
try {
|
|
try {
|
|
@@ -228,8 +227,8 @@ public class DMSService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> queryBeautifiedClue(String token, String cClueName, String cEnterpriseName, String constructionMethod, String timeStart, String timeEnd) {
|
|
public List<JSONObject> queryBeautifiedClue(String token, String cClueName, String cEnterpriseName, String constructionMethod, String timeStart, String timeEnd) {
|
|
|
- DMSRequest request = new DMSRequest();
|
|
|
|
|
- request.type = DMSRequest.DMSRequestType.Beautified;
|
|
|
|
|
|
|
+ DMSQueryRequest request = new DMSQueryRequest();
|
|
|
|
|
+ request.type = DMSQueryRequest.DMSRequestType.Beautified;
|
|
|
if (cClueName != null) request.addWhere("c_clue_name", "2", cClueName);
|
|
if (cClueName != null) request.addWhere("c_clue_name", "2", cClueName);
|
|
|
if (cEnterpriseName != null) request.addWhere("c_enterprise_name", "2", cEnterpriseName);
|
|
if (cEnterpriseName != null) request.addWhere("c_enterprise_name", "2", cEnterpriseName);
|
|
|
if (constructionMethod != null) request.addWhere("construction_method", "2", constructionMethod);
|
|
if (constructionMethod != null) request.addWhere("construction_method", "2", constructionMethod);
|
|
@@ -238,8 +237,8 @@ public class DMSService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> getUserJSONByCode(String userCode,String token) {
|
|
public List<JSONObject> getUserJSONByCode(String userCode,String token) {
|
|
|
- DMSRequest request = new DMSRequest();
|
|
|
|
|
- request.type = DMSRequest.DMSRequestType.List;
|
|
|
|
|
|
|
+ DMSQueryRequest request = new DMSQueryRequest();
|
|
|
|
|
+ request.type = DMSQueryRequest.DMSRequestType.List;
|
|
|
request.addWhere("c_usercode", "1", userCode);
|
|
request.addWhere("c_usercode", "1", userCode);
|
|
|
List<JSONObject> result = queryDmsList(request, token, DMSColumn.USER.getId());
|
|
List<JSONObject> result = queryDmsList(request, token, DMSColumn.USER.getId());
|
|
|
return result;
|
|
return result;
|
|
@@ -248,33 +247,33 @@ public class DMSService {
|
|
|
|
|
|
|
|
//下面几个接口是重计算用的,有重新插入的需求,不能放进queryEnum,不能领域化
|
|
//下面几个接口是重计算用的,有重新插入的需求,不能放进queryEnum,不能领域化
|
|
|
public List<JSONObject> getAllParkByLy(String lyCode, String token) {
|
|
public List<JSONObject> getAllParkByLy(String lyCode, String token) {
|
|
|
- DMSRequest requestChildren = new DMSRequest();
|
|
|
|
|
|
|
+ DMSQueryRequest requestChildren = new DMSQueryRequest();
|
|
|
requestChildren.addWhere("parent_cyy_code", "1", lyCode);
|
|
requestChildren.addWhere("parent_cyy_code", "1", lyCode);
|
|
|
List<JSONObject> result = queryDmsList(requestChildren, token, DMSColumn.INDUSTRIAL_PARK.getId());
|
|
List<JSONObject> result = queryDmsList(requestChildren, token, DMSColumn.INDUSTRIAL_PARK.getId());
|
|
|
- DMSRequest requestFarther = new DMSRequest();
|
|
|
|
|
|
|
+ DMSQueryRequest requestFarther = new DMSQueryRequest();
|
|
|
requestFarther.addWhere("c_park_code", "1", lyCode);
|
|
requestFarther.addWhere("c_park_code", "1", lyCode);
|
|
|
result.addAll(queryDmsList(requestFarther, token, DMSColumn.INDUSTRIAL_PARK.getId()));
|
|
result.addAll(queryDmsList(requestFarther, token, DMSColumn.INDUSTRIAL_PARK.getId()));
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> getAllPark(String token) {
|
|
public List<JSONObject> getAllPark(String token) {
|
|
|
- DMSRequest request = new DMSRequest();
|
|
|
|
|
|
|
+ DMSQueryRequest request = new DMSQueryRequest();
|
|
|
return queryDmsList(request, token, DMSColumn.INDUSTRIAL_PARK.getId());
|
|
return queryDmsList(request, token, DMSColumn.INDUSTRIAL_PARK.getId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> getAllLeaseByRooms(Set<String> roomString, String token) {
|
|
public List<JSONObject> getAllLeaseByRooms(Set<String> roomString, String token) {
|
|
|
- DMSRequest request = new DMSRequest();
|
|
|
|
|
|
|
+ DMSQueryRequest request = new DMSQueryRequest();
|
|
|
request.addWhere("c_room_code", "5", roomString);
|
|
request.addWhere("c_room_code", "5", roomString);
|
|
|
return queryDmsList(request, token, DMSColumn.LEASE_DETAIL.getId());
|
|
return queryDmsList(request, token, DMSColumn.LEASE_DETAIL.getId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> getAllLease(String token) {
|
|
public List<JSONObject> getAllLease(String token) {
|
|
|
- DMSRequest request = new DMSRequest();
|
|
|
|
|
|
|
+ DMSQueryRequest request = new DMSQueryRequest();
|
|
|
return queryDmsList(request, token, DMSColumn.LEASE_DETAIL.getId());
|
|
return queryDmsList(request, token, DMSColumn.LEASE_DETAIL.getId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<JSONObject> getAllInvestmentTarget(String token) {
|
|
public List<JSONObject> getAllInvestmentTarget(String token) {
|
|
|
- DMSRequest request = new DMSRequest();
|
|
|
|
|
|
|
+ DMSQueryRequest request = new DMSQueryRequest();
|
|
|
return queryDmsList(request, token, DMSColumn.INVESTMENT_TARGET.getId());
|
|
return queryDmsList(request, token, DMSColumn.INVESTMENT_TARGET.getId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|