|
@@ -4,6 +4,8 @@ import cn.hutool.core.map.MapUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.google.common.collect.Lists;
|
|
@@ -554,6 +556,7 @@ public class ActBusinessController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/getActBusinessList")
|
|
|
public Result getActBusinessList(ActBusiness param, HttpServletRequest request){
|
|
|
+
|
|
|
QueryWrapper<ActBusiness> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.lambda().orderByDesc(ActBusiness::getCreateTime);
|
|
|
if (StrUtil.isNotBlank(param.getTitle())) queryWrapper.lambda().like(ActBusiness::getTitle,param.getTitle());
|
|
@@ -572,6 +575,7 @@ public class ActBusinessController {
|
|
|
map.put("userId",loginUser.getUsername());
|
|
|
map.put("pkOrg",loginUser.getOrgCode());
|
|
|
map.put("tableName",param.getTableName());
|
|
|
+ map.put("ortherParam",getPar(param));
|
|
|
|
|
|
|
|
|
|
|
@@ -625,4 +629,105 @@ public class ActBusinessController {
|
|
|
list.add(map);
|
|
|
return Result.ok(list);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ * 获取高级查询列表
|
|
|
+ * @param tableName
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/getQueryColumnList", method = RequestMethod.GET)
|
|
|
+ public Result getQueryColumnList(String tableName){
|
|
|
+ List<Map<String,Object>> list = tbTableInfoMapper.getQueryColumnList(tableName);
|
|
|
+
|
|
|
+ for(Map<String,Object> o:list){
|
|
|
+ List<Map<String,String>> list2 = new ArrayList<>();
|
|
|
+ if(o.get("field_show_type") == null || o.get("dict_table") == null || o.get("dict_field") == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String field_show_type = o.get("field_show_type").toString();
|
|
|
+ String dict_table = o.get("dict_table").toString();
|
|
|
+ String dict_field = o.get("dict_field").toString();
|
|
|
+
|
|
|
+ if(StringUtils.isBlank(field_show_type) || !field_show_type.equals("list") || StringUtils.isBlank(dict_table) || StringUtils.isBlank(dict_field)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ map.put("value","字典配置错误,请联系管理员");
|
|
|
+ try {
|
|
|
+ if(!dict_table.equals("sys_dict")){
|
|
|
+ if(o.get("dict_text") == null || StringUtils.isBlank(o.get("dict_text").toString())){
|
|
|
+ list2.add(map);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ list2 = tbTableInfoMapper.getTableDictColumnList(o.get("dict_text").toString(),dict_field,dict_table);
|
|
|
+ }else{
|
|
|
+ list2 = tbTableInfoMapper.getDictColumnList(dict_field);
|
|
|
+ }
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ list2.add(map);
|
|
|
+ }
|
|
|
+ if(list2.size() > 0){
|
|
|
+ o.put("list",list2);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return Result.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 数据整理
|
|
|
+ * @param param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String getPar(ActBusiness param){
|
|
|
+ StringBuffer sb2 = new StringBuffer();
|
|
|
+ if(StringUtils.isNotBlank(param.getOrtherParam())){
|
|
|
+
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray("["+param.getOrtherParam()+"]");
|
|
|
+ for(int i=0;i<jsonArray.size();i++){
|
|
|
+
|
|
|
+ JSONObject job = jsonArray.getJSONObject(i);
|
|
|
+ String name = "";
|
|
|
+ String val1 = "";
|
|
|
+ String val2 = "";
|
|
|
+ String type = "";
|
|
|
+
|
|
|
+ if(job.get("name") != null){
|
|
|
+ name = job.get("name").toString();
|
|
|
+ }
|
|
|
+ if(job.get("type") != null){
|
|
|
+ type = job.get("type").toString();
|
|
|
+ }
|
|
|
+ if(job.get("value") != null){
|
|
|
+ val1 = job.get("value").toString();
|
|
|
+ }
|
|
|
+ if(job.get("value2") != null){
|
|
|
+ val2 = job.get("value2").toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isBlank(type) || StringUtils.isBlank(name) || (StringUtils.isBlank(val1) && StringUtils.isBlank(val2))){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (type.equals("text")){
|
|
|
+ sb2.append(" and cl.").append(name).append(" like '%").append(val1).append("%' ");
|
|
|
+ }
|
|
|
+ if (type.equals("list")){
|
|
|
+ sb2.append(" and cl.").append(name).append(" = '").append(val1).append("' ");
|
|
|
+ }
|
|
|
+ if (type.equals("date")){
|
|
|
+ if(StringUtils.isNotBlank(val1)){
|
|
|
+ sb2.append(" and cl.").append(name).append(" >= '").append(val1).append("' ");
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(val2)){
|
|
|
+ sb2.append(" and cl.").append(name).append(" <= '").append(val2).append(" 23:59:59' ");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return sb2.toString();
|
|
|
+ }
|
|
|
}
|