认证清单-修改历史-处理展示数据。

This commit is contained in:
wangzhijiang
2023-03-13 16:16:40 +08:00
parent c0f48f4e28
commit acd8ea5d80
3 changed files with 27 additions and 2 deletions
@@ -55,7 +55,8 @@ public class ProjectCertificationInventoryLogEOController extends JeroController
QueryWrapper<ProjectCertificationInventoryLogEO> queryWrapper = QueryGenerator.initQueryWrapper(projectCertificationInventoryLogEO, req.getParameterMap());
Page<ProjectCertificationInventoryLogEO> page = new Page<ProjectCertificationInventoryLogEO>(pageNo, pageSize);
queryWrapper.orderByDesc("create_time");
IPage<ProjectCertificationInventoryLogEO> pageList = projectCertificationInventoryLogEOService.page(page, queryWrapper);
IPage<ProjectCertificationInventoryLogEO> pageList = this.projectCertificationInventoryLogEOService.page(page, queryWrapper);
this.projectCertificationInventoryLogEOService.disposeData(pageList.getRecords(),projectCertificationInventoryLogEO.getCut());
return Result.OK(pageList);
}
@@ -68,7 +69,7 @@ public class ProjectCertificationInventoryLogEOController extends JeroController
@ApiOperation(value="项目库-认证清单-修改历史表-列表查询", notes="项目库-认证清单-修改历史表-列表查询")
@GetMapping(value = "/list")
public Result<List<ProjectCertificationInventoryLogEO>> queryList(ProjectCertificationInventoryLogEO projectCertificationInventoryLogEO,HttpServletRequest req) {
List<ProjectCertificationInventoryLogEO> list = projectCertificationInventoryLogEOService.queryList(projectCertificationInventoryLogEO,req);
List<ProjectCertificationInventoryLogEO> list = this.projectCertificationInventoryLogEOService.queryList(projectCertificationInventoryLogEO,req);
return Result.OK(list);
}
@@ -66,4 +66,11 @@ public interface IProjectCertificationInventoryLogEOService extends IService<Pro
* @param projectCertificationInventoryLogEOList
*/
void insertBatch(List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList);
/**
* 处理数据
* @param datas
* @param cut
*/
void disposeData(List<ProjectCertificationInventoryLogEO> datas, String cut);
}
@@ -1,10 +1,13 @@
package com.jero.modules.project.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.project.entity.ProjectCertificationInventoryLogEO;
import com.jero.modules.project.mapper.ProjectCertificationInventoryLogEOMapper;
import com.jero.modules.project.service.IProjectCertificationInventoryLogEOService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
@@ -91,6 +94,7 @@ public class ProjectCertificationInventoryLogEOServiceImpl extends ServiceImpl<P
QueryWrapper<ProjectCertificationInventoryLogEO> queryWrapper = QueryGenerator.initQueryWrapper(projectCertificationInventoryLogEO, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList = this.list(queryWrapper);
this.disposeData(projectCertificationInventoryLogEOList,projectCertificationInventoryLogEO.getCut());
return projectCertificationInventoryLogEOList;
}
@@ -98,4 +102,17 @@ public class ProjectCertificationInventoryLogEOServiceImpl extends ServiceImpl<P
public void insertBatch(List<ProjectCertificationInventoryLogEO> projectCertificationInventoryLogEOList) {
this.saveBatch(projectCertificationInventoryLogEOList);
}
@Override
public void disposeData(List<ProjectCertificationInventoryLogEO> datas, String cut) {
if(CollectionUtils.isNotEmpty(datas)){
for (ProjectCertificationInventoryLogEO data : datas) {
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
data.setContent(data.getContentCn());
}else {
data.setContent(data.getContentEn());
}
}
}
}
}