展示区域+标签内容修改
This commit is contained in:
+8
-25
@@ -1,13 +1,9 @@
|
||||
package com.jero.modules.tag.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import com.jero.modules.tag.service.IOnlCgformAreaService;
|
||||
@@ -15,7 +11,6 @@ import com.jero.modules.tag.service.IOnlCgformTagService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -48,15 +43,16 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param onlCgformArea
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "区域管理表-分页列表查询")
|
||||
@ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@PostMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||
IPage<OnlCgformArea> pageList=onlCgformAreaService.queryPageList(params);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
/*@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestParam(name = "cut") String cut,
|
||||
OnlCgformArea onlCgformArea,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@@ -78,22 +74,9 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
|
||||
list.stream().forEach(f -> f.setIsModel(f.getEnName()));
|
||||
return Result.OK(list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 表头中英文切换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
/*@AutoLog(value = "区域管理表-表头中英文切换")
|
||||
@ApiOperation(value="区域管理表-表头中英文切换", notes="区域管理表-表头中英文切换")
|
||||
@GetMapping(value = "/getHeader")
|
||||
public Result<List<Map<String, Object>>> getHeader(@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
List<Map<String, Object>> list =onlCgformAreaService.getHeader(flag, cut);
|
||||
return Result.OK(list);
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
|
||||
+1
-28
@@ -1,6 +1,5 @@
|
||||
package com.jero.modules.tag.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
@@ -56,35 +55,9 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
@ApiOperation(value="标签管理-分页列表查询", notes="标签管理-分页列表查询")
|
||||
@PostMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||
QueryWrapper<OnlCgformTag> queryWrapper=new QueryWrapper<>();
|
||||
IPage<OnlCgformTag> pageList= onlCgformTagService.queryPageList(params);
|
||||
return Result.OK(pageList);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
/*public Result<?> queryPageList(@RequestParam(name = "cut") String cut,
|
||||
OnlCgformTag onlCgformTag,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
QueryWrapper<OnlCgformTag> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformTag, req.getParameterMap());
|
||||
Page<OnlCgformTag> page = new Page<OnlCgformTag>(pageNo, pageSize);
|
||||
if (StringUtils.isNotBlank("create_time")) {
|
||||
queryWrapper.orderByDesc("create_time")
|
||||
.eq("cgform_head_id", "48308196e7b04761b533dc31bc899707");//筛选文档库数据
|
||||
}
|
||||
//中英切换-属性类型列
|
||||
List<Map<String, Object>> pageList = onlCgformTagService.selectPageInfo(page, queryWrapper);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.addAll(pageList);
|
||||
List<OnlCgformTag> list = jsonArray.toJavaList(OnlCgformTag.class);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK(list);
|
||||
} else {
|
||||
list.stream().forEach(f -> f.setFieldShowType(f.getFieldShowTypeEnName()));
|
||||
list.stream().forEach(s->s.setShowArea(s.getShowAreaEnName()));
|
||||
return Result.OK(list);
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
|
||||
+1
-3
@@ -1,10 +1,8 @@
|
||||
package com.jero.modules.tag.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@@ -22,5 +20,5 @@ public interface OnlCgformAreaMapper extends BaseMapper<OnlCgformArea> {
|
||||
"from onl_cgform_area as a left join sys_dict_item as i \n" +
|
||||
"on a.is_model=i.item_value \n" +
|
||||
"where i.dict_id=1493096744092102657 order by a.create_time desc")
|
||||
IPage<Map<String,Object>> selectPageInfo(Page page, Wrapper<OnlCgformArea> queryWrapper);
|
||||
IPage<OnlCgformArea> querPageList(IPage<OnlCgformArea> page, Map<String, Object> params);
|
||||
}
|
||||
|
||||
+1
-2
@@ -29,5 +29,4 @@ public interface OnlCgformTagMapper extends BaseMapper<OnlCgformTag> {
|
||||
"and i.dict_id=1493098515761917954 \n" +
|
||||
"order by f.create_time desc ")
|
||||
IPage<OnlCgformTag> queryPageList(IPage page,@Param("params") Map<String,Object> params);
|
||||
//IPage<Map<String,Object>> selectPageInfo(Page page, Wrapper<OnlCgformTag> queryWrapper);
|
||||
}
|
||||
}
|
||||
+3
-8
@@ -1,7 +1,6 @@
|
||||
package com.jero.modules.tag.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
|
||||
@@ -78,11 +77,7 @@ public interface IOnlCgformAreaService extends IService<OnlCgformArea> {
|
||||
*/
|
||||
List<OnlCgformArea> selectShowAreaById(String id);
|
||||
|
||||
/**
|
||||
* 列表表头中英文切换
|
||||
* @return
|
||||
*/
|
||||
//public List<Map<String, Object>> getHeader(String flag, String cut);
|
||||
//List<Map<String, Object>> selectPageInfo(Page page, Wrapper<OnlCgformArea> queryWrapper);
|
||||
|
||||
List<Map<String, Object>> selectPageInfo(Page page, Wrapper<OnlCgformArea> queryWrapper);
|
||||
IPage<OnlCgformArea> queryPageList(Map<String, Object> params);
|
||||
}
|
||||
|
||||
+11
-38
@@ -1,6 +1,5 @@
|
||||
package com.jero.modules.tag.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -18,7 +17,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 区域管理表
|
||||
@@ -141,42 +139,17 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
|
||||
return list(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表表头中英文切换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
/*@Override
|
||||
public List<Map<String, Object>> getHeader(String flag, String cut) {
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(flag);
|
||||
if (fieldList.size() != 0) {
|
||||
fieldList = fieldList.stream().filter(
|
||||
e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowList()))
|
||||
&& (
|
||||
e.getDbFieldEnName().equals("display area")||e.getDbFieldEnName().equals("belonging module")
|
||||
||e.getDbFieldEnName().equals("sort number")||e.getDbFieldEnName().equals("state")
|
||||
)
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (OnlCgformField onlCgformField : fieldList) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
map.put("db_field_name", LineHumpUtil.lineToHump(onlCgformField.getDbFieldName()));//字段
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldTxt());//字段中文名
|
||||
} else {
|
||||
map.put("db_field_txt", onlCgformField.getDbFieldEnName());//字段英文名
|
||||
}
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectPageInfo(Page page, Wrapper<OnlCgformArea> queryWrapper) {
|
||||
IPage<Map<String, Object>> info=onlCgformAreaMapper.selectPageInfo(page, queryWrapper);
|
||||
List<Map<String, Object>> list = info.getRecords().stream().collect(Collectors.toList());
|
||||
return list;
|
||||
public IPage<OnlCgformArea> queryPageList(Map<String, Object> params) {
|
||||
Integer pageNo=Integer.parseInt(params.get("pageNo").toString());
|
||||
Integer pageSize=Integer.parseInt(params.get("pageSize").toString());
|
||||
IPage<OnlCgformArea> page=new Page(pageNo,pageSize);
|
||||
|
||||
//中英切换--所属模块
|
||||
if(CutEnum.EN.getValue().equals(params.get("cut").toString())) {
|
||||
params.put("isModel", params.get("enName"));
|
||||
}
|
||||
IPage<OnlCgformArea> result=onlCgformAreaMapper.querPageList(page,params);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+10
-25
@@ -95,7 +95,12 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
public OnlCgformTag queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<OnlCgformTag> queryPageList(Map<String,Object> params) {
|
||||
Integer pageNo = Integer.parseInt(params.get("pageNo").toString());
|
||||
@@ -103,16 +108,12 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
IPage<OnlCgformTag> page = new Page(pageNo, pageSize);
|
||||
|
||||
//中英切换-属性类型+展示区域列
|
||||
if (CutEnum.CN.getValue().equals(params.get("cut").toString())) {
|
||||
IPage<OnlCgformTag> result = onlCgformTagMapper.queryPageList(page,params);
|
||||
return result;
|
||||
} else {
|
||||
if (CutEnum.EN.getValue().equals(params.get("cut").toString())) {
|
||||
params.put("fieldShowType", params.get("fieldShowTypeEnName"));
|
||||
params.put("showArea",params.get("showAreaEnName"));
|
||||
params.put("showArea", params.get("showAreaEnName"));
|
||||
}
|
||||
IPage<OnlCgformTag> result = onlCgformTagMapper.queryPageList(page,params);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,25 +153,9 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
public Integer queryExitArea(OnlCgformArea onlCgformArea) {
|
||||
QueryWrapper<OnlCgformTag> queryWrapper = new QueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(onlCgformArea.getShowArea())) {
|
||||
queryWrapper.select("show_area").eq("show_area",onlCgformArea.getId());
|
||||
queryWrapper.select("show_area").eq("show_area", onlCgformArea.getId());
|
||||
}
|
||||
Integer count = onlCgformTagMapper.selectCount(queryWrapper);
|
||||
return count;
|
||||
|
||||
|
||||
|
||||
/*LambdaQueryWrapper<OnlCgformTag> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(onlCgformArea.getShowArea())) {
|
||||
queryWrapper.select("show_area",).eq(OnlCgformTag::getShowArea,onlCgformArea.getId());
|
||||
}
|
||||
Integer count = onlCgformTagMapper.selectCount(queryWrapper);
|
||||
return count;*/
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public List<Map<String, Object>> selectPageInfo(Page page, Wrapper<OnlCgformTag> queryWrapper) {
|
||||
IPage<Map<String, Object>> info= onlCgformTagMapper.selectPageInfo(page, queryWrapper);
|
||||
List<Map<String, Object>> list = info.getRecords().stream().collect(Collectors.toList());
|
||||
return list;
|
||||
}*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user