feat: 稽查报告自动生成
This commit is contained in:
+176
@@ -0,0 +1,176 @@
|
||||
package com.jero.modules.laws.enterprise.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectReport;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectReportService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 企标稽查报告
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-11-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="企标稽查报告")
|
||||
@RestController
|
||||
@RequestMapping("/laws.enterprise/EnterpriseStandardInspectReport")
|
||||
@Slf4j
|
||||
public class EnterpriseStandardInspectReportController extends JeroController<EnterpriseStandardInspectReport, EnterpriseStandardInspectReportService> {
|
||||
@Autowired
|
||||
private EnterpriseStandardInspectReportService EnterpriseStandardInspectReportService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查报告-分页列表查询")
|
||||
@ApiOperation(value="企标稽查报告-分页列表查询", notes="企标稽查报告-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<EnterpriseStandardInspectReport>> queryPageList(EnterpriseStandardInspectReport EnterpriseStandardInspectReport,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<EnterpriseStandardInspectReport> pageList = EnterpriseStandardInspectReportService.queryPage(EnterpriseStandardInspectReport, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查报告-列表查询")
|
||||
@ApiOperation(value="企标稽查报告-列表查询", notes="企标稽查报告-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<EnterpriseStandardInspectReport>> queryList(EnterpriseStandardInspectReport EnterpriseStandardInspectReport, HttpServletRequest req) {
|
||||
List<EnterpriseStandardInspectReport> list = EnterpriseStandardInspectReportService.queryList(EnterpriseStandardInspectReport, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查报告-添加")
|
||||
@ApiOperation(value="企标稽查报告-添加", notes="企标稽查报告-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody EnterpriseStandardInspectReport EnterpriseStandardInspectReport) {
|
||||
EnterpriseStandardInspectReportService.add(EnterpriseStandardInspectReport);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查报告-编辑")
|
||||
@ApiOperation(value="企标稽查报告-编辑", notes="企标稽查报告-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<T> edit(@Validated @RequestBody EnterpriseStandardInspectReport EnterpriseStandardInspectReport) {
|
||||
EnterpriseStandardInspectReportService.editById(EnterpriseStandardInspectReport);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查报告-通过id删除")
|
||||
@ApiOperation(value="企标稽查报告-通过id删除", notes="企标稽查报告-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
EnterpriseStandardInspectReportService.deleteById(map.get("id"));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查报告-批量删除")
|
||||
@ApiOperation(value="企标稽查报告-批量删除", notes="企标稽查报告-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
this.EnterpriseStandardInspectReportService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查报告-通过id查询")
|
||||
@ApiOperation(value="企标稽查报告-通过id查询", notes="企标稽查报告-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<EnterpriseStandardInspectReport> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
EnterpriseStandardInspectReport EnterpriseStandardInspectReport = EnterpriseStandardInspectReportService.queryById(id);
|
||||
if(EnterpriseStandardInspectReport==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(EnterpriseStandardInspectReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param EnterpriseStandardInspectReport
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, EnterpriseStandardInspectReport EnterpriseStandardInspectReport) {
|
||||
return super.exportXls(request, EnterpriseStandardInspectReport, EnterpriseStandardInspectReport.class, "企标稽查报告");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<EnterpriseStandardInspectReport> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, EnterpriseStandardInspectReport.class);
|
||||
}
|
||||
|
||||
}
|
||||
+63
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectReport;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_enterprise_standard_inspect_report】的数据库操作Service
|
||||
@@ -20,4 +23,64 @@ public interface EnterpriseStandardInspectReportService extends IService<Enterpr
|
||||
* @return
|
||||
*/
|
||||
IPage<EnterpriseStandardInspectReport> getInspectReport(String inspectId, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<EnterpriseStandardInspectReport> queryPage(EnterpriseStandardInspectReport EnterpriseStandardInspectReport, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseStandardInspectReport> queryList(EnterpriseStandardInspectReport EnterpriseStandardInspectReport, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @return
|
||||
*/
|
||||
void add(EnterpriseStandardInspectReport EnterpriseStandardInspectReport);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @return
|
||||
*/
|
||||
void editById(EnterpriseStandardInspectReport EnterpriseStandardInspectReport);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
EnterpriseStandardInspectReport queryById(String id);
|
||||
}
|
||||
|
||||
+94
@@ -1,9 +1,11 @@
|
||||
package com.jero.modules.laws.enterprise.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectReport;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.EnterpriseStandardInspectVo;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectReportService;
|
||||
@@ -13,6 +15,9 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
@@ -34,6 +39,95 @@ public class EnterpriseStandardInspectReportServiceImpl extends ServiceImpl<Ente
|
||||
esInspectReportMapper.page(page, inspectId);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<EnterpriseStandardInspectReport> queryPage(EnterpriseStandardInspectReport EnterpriseStandardInspectReport, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<EnterpriseStandardInspectReport> queryWrapper = QueryGenerator.initQueryWrapper(EnterpriseStandardInspectReport, req.getParameterMap());
|
||||
Page<EnterpriseStandardInspectReport> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<EnterpriseStandardInspectReport> queryList(EnterpriseStandardInspectReport EnterpriseStandardInspectReport, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(EnterpriseStandardInspectReport, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(EnterpriseStandardInspectReport EnterpriseStandardInspectReport) {
|
||||
Date now = new Date();
|
||||
EnterpriseStandardInspectReport.setCreateTime(now);
|
||||
EnterpriseStandardInspectReport.setUpdateTime(now);
|
||||
save(EnterpriseStandardInspectReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param EnterpriseStandardInspectReport
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(EnterpriseStandardInspectReport EnterpriseStandardInspectReport) {
|
||||
Date now = new Date();
|
||||
EnterpriseStandardInspectReport.setUpdateTime(now);
|
||||
saveOrUpdate(EnterpriseStandardInspectReport);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public EnterpriseStandardInspectReport queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user