feat: 不符合项库支持标准编号排序
This commit is contained in:
+12
-6
@@ -48,10 +48,16 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
|
|||||||
@ApiOperation(value="不符合项-分页列表查询", notes="不符合项-分页列表查询")
|
@ApiOperation(value="不符合项-分页列表查询", notes="不符合项-分页列表查询")
|
||||||
@GetMapping(value = "/page")
|
@GetMapping(value = "/page")
|
||||||
@RequiresPermissions("lawsEvaluationNotMet:search")
|
@RequiresPermissions("lawsEvaluationNotMet:search")
|
||||||
public Result<IPage<LawsEvaluationNotMetLibrary>> queryPageList(LawsEvaluationNotMetLibrary lawsEvaluationNotMet,
|
public Result<IPage<LawsEvaluationNotMetLibrary>> queryPageList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
LawsEvaluationNotMetLibrary lawsEvaluationNotMet, HttpServletRequest req) {
|
||||||
IPage<LawsEvaluationNotMetLibrary> pageList = lawsEvaluationNotMetLibraryService.queryPage(lawsEvaluationNotMet, pageNo, pageSize);
|
if (pageNo == null) {
|
||||||
|
pageNo = 1;
|
||||||
|
}
|
||||||
|
if (pageSize == null) {
|
||||||
|
pageSize = 10;
|
||||||
|
}
|
||||||
|
IPage<LawsEvaluationNotMetLibrary> pageList = lawsEvaluationNotMetLibraryService.queryPage(lawsEvaluationNotMet, pageNo, pageSize, req);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +101,8 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
|
|||||||
@ApiOperation(value="不符合项-导出", notes="项目库-导出")
|
@ApiOperation(value="不符合项-导出", notes="项目库-导出")
|
||||||
@RequiresPermissions("lawsEvaluationNotMet:export")
|
@RequiresPermissions("lawsEvaluationNotMet:export")
|
||||||
@GetMapping(value = "/exportXls")
|
@GetMapping(value = "/exportXls")
|
||||||
public void exportXls(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet) {
|
public void exportXls(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet, HttpServletRequest req) {
|
||||||
lawsEvaluationNotMetLibraryService.export(response, lawsEvaluationNotMet, "不符合项", "不符合项");
|
lawsEvaluationNotMetLibraryService.export(response, lawsEvaluationNotMet, "不符合项", "不符合项", req);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.jero.modules.assessmentLibrary.entity.LawsEvaluationNotMetLibrary;
|
import com.jero.modules.assessmentLibrary.entity.LawsEvaluationNotMetLibrary;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ public interface ILawsEvaluationNotMetLibraryService extends IService<LawsEvalua
|
|||||||
* @param pageSize
|
* @param pageSize
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<LawsEvaluationNotMetLibrary> queryPage(LawsEvaluationNotMetLibrary lawsEvaluationNotMet, Integer pageNo, Integer pageSize);
|
IPage<LawsEvaluationNotMetLibrary> queryPage(LawsEvaluationNotMetLibrary lawsEvaluationNotMet, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量关闭
|
* 批量关闭
|
||||||
@@ -38,5 +39,5 @@ public interface ILawsEvaluationNotMetLibraryService extends IService<LawsEvalua
|
|||||||
* @param fileName
|
* @param fileName
|
||||||
* @param sheetName
|
* @param sheetName
|
||||||
*/
|
*/
|
||||||
void export(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet, String fileName, String sheetName);
|
void export(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet, String fileName, String sheetName, HttpServletRequest req);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-5
@@ -7,12 +7,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.modules.assessmentLibrary.entity.LawsEvaluationNotMetLibrary;
|
import com.jero.modules.assessmentLibrary.entity.LawsEvaluationNotMetLibrary;
|
||||||
import com.jero.modules.assessmentLibrary.mapper.LawsEvaluationNotMetLibraryMapper;
|
import com.jero.modules.assessmentLibrary.mapper.LawsEvaluationNotMetLibraryMapper;
|
||||||
import com.jero.modules.assessmentLibrary.service.ILawsEvaluationNotMetLibraryService;
|
import com.jero.modules.assessmentLibrary.service.ILawsEvaluationNotMetLibraryService;
|
||||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardPlanVo;
|
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardPlanVo;
|
||||||
import com.jero.modules.projectLibrary.common.AssessCommon;
|
import com.jero.modules.projectLibrary.common.AssessCommon;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.catalina.connector.Request;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||||
@@ -20,6 +22,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@@ -40,8 +43,8 @@ public class LawsEvaluationNotMetLibraryServiceImpl extends ServiceImpl<LawsEval
|
|||||||
private LawsEvaluationNotMetLibraryMapper notMetMapper;
|
private LawsEvaluationNotMetLibraryMapper notMetMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<LawsEvaluationNotMetLibrary> queryPage(LawsEvaluationNotMetLibrary lawsEvaluationNotMet, Integer pageNo, Integer pageSize) {
|
public IPage<LawsEvaluationNotMetLibrary> queryPage(LawsEvaluationNotMetLibrary lawsEvaluationNotMet, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||||
QueryWrapper<LawsEvaluationNotMetLibrary> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<LawsEvaluationNotMetLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsEvaluationNotMet, req.getParameterMap());
|
||||||
queryWrapper.like(StringUtils.isNotBlank(lawsEvaluationNotMet.getStandardNumber()),
|
queryWrapper.like(StringUtils.isNotBlank(lawsEvaluationNotMet.getStandardNumber()),
|
||||||
"d.standard_number", lawsEvaluationNotMet.getStandardNumber());
|
"d.standard_number", lawsEvaluationNotMet.getStandardNumber());
|
||||||
queryWrapper.like(StringUtils.isNotBlank(lawsEvaluationNotMet.getStandardName()),
|
queryWrapper.like(StringUtils.isNotBlank(lawsEvaluationNotMet.getStandardName()),
|
||||||
@@ -78,15 +81,15 @@ public class LawsEvaluationNotMetLibraryServiceImpl extends ServiceImpl<LawsEval
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void export(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet, String fileName, String sheetName) {
|
public void export(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet, String fileName, String sheetName, HttpServletRequest req) {
|
||||||
try {
|
try {
|
||||||
// 获取数据
|
// 获取数据
|
||||||
IPage<LawsEvaluationNotMetLibrary> lawsEvaluationNotMets = this.queryPage(lawsEvaluationNotMet, 1, Integer.MAX_VALUE);
|
IPage<LawsEvaluationNotMetLibrary> lawsEvaluationNotMets = this.queryPage(lawsEvaluationNotMet, 1, Integer.MAX_VALUE, req);
|
||||||
List<LawsEvaluationNotMetLibrary> records = lawsEvaluationNotMets.getRecords();
|
List<LawsEvaluationNotMetLibrary> records = lawsEvaluationNotMets.getRecords();
|
||||||
|
|
||||||
// 设置导出参数
|
// 设置导出参数
|
||||||
ExportParams exportParams = new ExportParams(null, sheetName); // 可以为标题添加更多的配置
|
ExportParams exportParams = new ExportParams(null, sheetName); // 可以为标题添加更多的配置
|
||||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, EnterpriseStandardPlanVo.class, records);
|
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, LawsEvaluationNotMetLibrary.class, records);
|
||||||
|
|
||||||
// 设置响应头和内容类型
|
// 设置响应头和内容类型
|
||||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8"); // 显式设置字符编码
|
response.setContentType("application/vnd.ms-excel;charset=UTF-8"); // 显式设置字符编码
|
||||||
|
|||||||
Reference in New Issue
Block a user