|
@@ -26,6 +26,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -58,14 +60,34 @@ public class ApiMobilePageDesignDataController extends BaseController {
|
|
|
*/
|
|
|
@GetMapping(value = "/muti/tableLimitInfo")
|
|
|
@ApiOperation(value = "获取表格页面的数据")
|
|
|
- public TableDataInfo getMutiInfoLimit(Long pageId){
|
|
|
+ public TableDataInfo getMutiInfoLimit(@RequestParam Map<String,String> queryMap){
|
|
|
+ Long pageId = 0l;
|
|
|
+ if (queryMap != null && queryMap.get("pageId")!= null ){
|
|
|
+ pageId = Long.parseLong(queryMap.get("pageId").toString());
|
|
|
+ queryMap.remove("pageId");
|
|
|
+ }
|
|
|
if (pageId == 0l){
|
|
|
return new TableDataInfo();
|
|
|
}
|
|
|
MobilePageDesignData mobilePageDesignData = mobilePageDesignDataService.selectMobilePageDesignDataById(pageId);
|
|
|
startPage();
|
|
|
- String sql = mobilePageDesignDataService.mapToQuerySql(mobilePageDesignData.getPageJson());
|
|
|
- List<Map<String,Object>> list = mobilePageDesignDataService.executeQuerySql(sql);
|
|
|
+ queryMap.remove("pageSize");
|
|
|
+ queryMap.remove("pageNum");
|
|
|
+ StringBuilder sqlBuilder = new StringBuilder(mobilePageDesignDataService.mapToQuerySql(mobilePageDesignData.getPageJson()));
|
|
|
+ // 循环将请求参数解码
|
|
|
+ for (Map.Entry<String, String> entry : queryMap.entrySet()) {
|
|
|
+ String key = entry.getKey();
|
|
|
+ String value = entry.getValue();
|
|
|
+ try {
|
|
|
+ sqlBuilder.append(" and ")
|
|
|
+ .append(URLDecoder.decode(key, "UTF-8").replaceFirst("@", "."))
|
|
|
+ .append(" = ")
|
|
|
+ .append(URLDecoder.decode(value, "UTF-8"));
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> list = mobilePageDesignDataService.executeQuerySql(sqlBuilder.toString());
|
|
|
List<Map<String, Object>> underlineList = CollectionUtil.copyListMapWithCamelToUnderline(list);
|
|
|
int total = new Long(new PageInfo(list).getTotal()).intValue();
|
|
|
return new TableDataInfo(underlineList,total,200,"获取成功");
|