|
@@ -1,15 +1,15 @@
|
|
|
package com.persagy.proxy.object.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.util.NumberUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.persagy.proxy.object.model.AdmISpace;
|
|
|
+import com.persagy.dmp.common.utils.JsonHelper;
|
|
|
import com.persagy.proxy.adm.request.AdmCreateRequest;
|
|
|
import com.persagy.proxy.adm.request.AdmQueryCriteria;
|
|
|
import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
-import com.persagy.proxy.object.service.IAdmISpaceService;
|
|
|
import com.persagy.proxy.adm.utils.AdmContextUtil;
|
|
|
+import com.persagy.proxy.object.model.AdmISpace;
|
|
|
+import com.persagy.proxy.object.service.IAdmISpaceService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -105,13 +105,11 @@ public class AdmISpaceController {
|
|
|
*/
|
|
|
@PostMapping("/query")
|
|
|
public AdmResponse query(@RequestBody JSONObject param) throws Exception {
|
|
|
- AdmQueryCriteria request = new AdmQueryCriteria();
|
|
|
+ AdmQueryCriteria request = JsonHelper.toSingleEntity(param, AdmQueryCriteria.class);
|
|
|
request.setName(AdmISpace.OBJ_TYPE);
|
|
|
- request.setPageNumber(null==param.getInteger("pageNumber")?1:param.getInteger("pageNumber"));
|
|
|
- request.setPageSize(null==param.getInteger("pageSize")?1:param.getInteger("pageSize"));
|
|
|
if (StrUtil.isNotBlank(param.getString("floorId"))){
|
|
|
String filters = " floorId = '"+param.getString("floorId")+"' ";
|
|
|
- request.setFilters(filters);
|
|
|
+ request.addFilters(filters);
|
|
|
}
|
|
|
AdmResponse admResponse = service.doQuery(AdmContextUtil.toDmpContext(), request, AdmISpace.class);
|
|
|
admResponse.setMessage(param.getString("floorId"));
|