2aead5ac 康伟

kangwei: 修改危险废物台账年报、月报报表

1 个父辈 b557fda9
正在显示 20 个修改的文件 包含 310 行增加843 行删除
......@@ -361,9 +361,7 @@ public class AjhMeetingMinutesController {
}
//paramMap.put("startTime",meeting.getStartTime());// 会议通知 开始时间
//paramMap.put("endTime",meeting.getEndTime());//会议通知 结束时间
/**************会议记录内容****************/
if(meetingSend != null ){
paramMap.put("startTime",null);
if(meetingSend.getMeetStartTime() != null ){
......@@ -408,12 +406,10 @@ public class AjhMeetingMinutesController {
ajhMeetingAttend.setDuties("");
}
}
//补全签到表格集合
supplementList( meetingAttendList , index );
// //签到表集合
paramMap.put("attendList",meetingAttendList);
//添加图片
// 第三部分:图片
if(minutesimage != null ){
......
package com.skua.modules.ajh.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.query.QueryGenerator;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.skua.modules.ajh.service.IAjhWasteMonthReportService;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 危险废物台账月报报表
*/
@Slf4j
@Api(tags="危险废物台账月报报表")
@RestController
@RequestMapping("/ajh/ajhWasteMonthReport")
public class AjhWasteMonthReportController {
@Autowired
private IAjhWasteMonthReportService ajhWasteMonthReportService;
/**
* 分页列表查询
* @param ajhWasteMonthReport
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "危险废物台账月报报表-分页列表查询")
@ApiOperation(value="危险废物台账月报报表-分页列表查询", notes="危险废物台账月报报表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AjhWasteMonthReport>> queryPageList(AjhWasteMonthReport ajhWasteMonthReport,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<AjhWasteMonthReport>> result = new Result<IPage<AjhWasteMonthReport>>();
QueryWrapper<AjhWasteMonthReport> queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteMonthReport, req.getParameterMap());
Page<AjhWasteMonthReport> page = new Page<AjhWasteMonthReport>(pageNo, pageSize);
IPage<AjhWasteMonthReport> pageList = ajhWasteMonthReportService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "危险废物台账月报报表列表查询")
@ApiOperation(value="危险废物台账月报报表列表查询", notes="危险废物台账月报报表列表查询")
@GetMapping(value = "/getList")
public Result<List<AjhWasteMonthReport>> queryList(AjhWasteMonthReport ajhWasteMonthReport) {
Result<List<AjhWasteMonthReport>> result = new Result<List<AjhWasteMonthReport>>();
List<AjhWasteMonthReport> list = ajhWasteMonthReportService.getList(ajhWasteMonthReport);
result.setSuccess(true);
result.setResult(list);
return result;
}
/**
* 添加
* @param ajhWasteMonthReport
* @return
*/
@AutoLog(value = "危险废物台账月报报表-添加")
@ApiOperation(value="危险废物台账月报报表-添加", notes="危险废物台账月报报表-添加")
@PostMapping(value = "/add")
public Result<AjhWasteMonthReport> add(@RequestBody AjhWasteMonthReport ajhWasteMonthReport) {
Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
try {
ajhWasteMonthReportService.save(ajhWasteMonthReport);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
/**
* 编辑
* @param ajhWasteMonthReport
* @return
*/
@AutoLog(value = "危险废物台账月报报表-编辑")
@ApiOperation(value="危险废物台账月报报表-编辑", notes="危险废物台账月报报表-编辑")
@PutMapping(value = "/edit")
public Result<AjhWasteMonthReport> edit(@RequestBody AjhWasteMonthReport ajhWasteMonthReport) {
Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
AjhWasteMonthReport ajhWasteMonthReportEntity = ajhWasteMonthReportService.getById(ajhWasteMonthReport.getId());
if(ajhWasteMonthReportEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = ajhWasteMonthReportService.updateById(ajhWasteMonthReport);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
}
}
return result;
}
/**
* 通过id删除
* @param id
* @return
*/
@AutoLog(value = "危险废物台账月报报表-通过id删除")
@ApiOperation(value="危险废物台账月报报表-通过id删除", notes="危险废物台账月报报表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
ajhWasteMonthReportService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
}
return Result.ok("删除成功!");
}
/**
* 批量删除
* @param ids
* @return
*/
@AutoLog(value = "危险废物台账月报报表-批量删除")
@ApiOperation(value="危险废物台账月报报表-批量删除", notes="危险废物台账月报报表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<AjhWasteMonthReport> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
this.ajhWasteMonthReportService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询
* @param id
* @return
*/
@AutoLog(value = "危险废物台账月报报表-通过id查询")
@ApiOperation(value="危险废物台账月报报表-通过id查询", notes="危险废物台账月报报表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AjhWasteMonthReport> queryById(@RequestParam(name="id",required=true) String id) {
Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
AjhWasteMonthReport ajhWasteMonthReport = ajhWasteMonthReportService.getById(id);
if(ajhWasteMonthReport==null) {
result.error500("未找到对应实体");
}else {
result.setResult(ajhWasteMonthReport);
result.setSuccess(true);
}
return result;
}
/**
* 导出excel
*
* @param request
* @param response
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<AjhWasteMonthReport> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (StringUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
AjhWasteMonthReport ajhWasteMonthReport = JSON.parseObject(deString, AjhWasteMonthReport.class);
queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteMonthReport, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<AjhWasteMonthReport> pageList = ajhWasteMonthReportService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "危险废物台账月报报表列表");
mv.addObject(NormalExcelConstants.CLASS, AjhWasteMonthReport.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("危险废物台账月报报表列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<AjhWasteMonthReport> listAjhWasteMonthReports = ExcelImportUtil.importExcel(file.getInputStream(), AjhWasteMonthReport.class, params);
ajhWasteMonthReportService.saveBatch(listAjhWasteMonthReports);
return Result.ok("文件导入成功!数据行数:" + listAjhWasteMonthReports.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
}
package com.skua.modules.ajh.controller;
/**
* @auther kangwei
* @create 2025-01-09-11:08
*/
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.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
import com.skua.modules.ajh.service.IAjhWasteReportService;
import com.skua.modules.system.service.ISysDepartService;
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.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.time.Year;
import java.util.List;
/**
* 危险废物台账年报报表
*/
@Slf4j
@Api(tags="危险废物台账月报&年报报表")
@RestController
@RequestMapping("/ajh/ajhWasteReport")
public class AjhWasteReportController {
@Autowired
private IAjhWasteReportService wasteReportService;
@Autowired
private ISysDepartService departService;
/**
* 分页列表查询
* @param wasteMonthReport
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "危险废物台账月报报表-分页列表查询")
@ApiOperation(value="危险废物台账月报报表-分页列表查询", notes="危险废物台账月报报表-分页列表查询")
@GetMapping(value = "/queryMonthReport")
public Result<IPage<AjhWasteMonthReport>> queryPageList(AjhWasteMonthReport wasteMonthReport,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<AjhWasteMonthReport>> result = new Result<IPage<AjhWasteMonthReport>>();
Page<AjhWasteMonthReport> page = new Page<>(pageNo, pageSize);
String departId = null;
if (StringUtils.isBlank(wasteMonthReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
departId = BaseContextHandler.getDeparts();
}else{
departId = departService.getChildDepartId(wasteMonthReport.getDepartId());
}
String reportMonth = wasteMonthReport.getReportMonth();
IPage<AjhWasteMonthReport> pageList = wasteReportService.queryPageListByMonth(page, departId,reportMonth);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "危险废物台账年报报表-分页列表查询")
@ApiOperation(value="危险废物台账年报报表-分页列表查询", notes="危险废物台账年报报表-分页列表查询")
@GetMapping(value = "/queryYearReport")
public Result<IPage<AjhWasteYearReport>> queryPageListByYear(AjhWasteYearReport ajhWasteYearReport,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<AjhWasteYearReport>> result = new Result<IPage<AjhWasteYearReport>>();
Page<AjhWasteYearReport> page = new Page<AjhWasteYearReport>(pageNo, pageSize);
String departId = null;
if (StringUtils.isBlank(ajhWasteYearReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
departId = BaseContextHandler.getDeparts();
}else{
departId = departService.getChildDepartId(ajhWasteYearReport.getDepartId());
}
String reportYear = ajhWasteYearReport.getReportYear();
if(reportYear==null){
reportYear = String.valueOf(Year.now().getValue());
}
IPage<AjhWasteYearReport> pageList = wasteReportService.queryPageListByYear(page, departId,reportYear);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
}
package com.skua.modules.ajh.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.query.QueryGenerator;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
import com.skua.modules.ajh.service.IAjhWasteYearReportService;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 危险废物台账年报报表
*/
@Slf4j
@Api(tags="危险废物台账年报报表")
@RestController
@RequestMapping("/ajh/ajhWasteYearReport")
public class AjhWasteYearReportController {
@Autowired
private IAjhWasteYearReportService ajhWasteYearReportService;
/**
* 分页列表查询
* @param ajhWasteYearReport
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "危险废物台账年报报表-分页列表查询")
@ApiOperation(value="危险废物台账年报报表-分页列表查询", notes="危险废物台账年报报表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AjhWasteYearReport>> queryPageList(AjhWasteYearReport ajhWasteYearReport,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<AjhWasteYearReport>> result = new Result<IPage<AjhWasteYearReport>>();
QueryWrapper<AjhWasteYearReport> queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteYearReport, req.getParameterMap());
Page<AjhWasteYearReport> page = new Page<AjhWasteYearReport>(pageNo, pageSize);
IPage<AjhWasteYearReport> pageList = ajhWasteYearReportService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "危险废物台账年报报表-分页列表查询")
@ApiOperation(value="危险废物台账年报报表-分页列表查询", notes="危险废物台账年报报表-分页列表查询")
@GetMapping(value = "/queryList")
public Result<List<AjhWasteYearReport>> queryList(AjhWasteYearReport ajhWasteYearReport) {
Result<List<AjhWasteYearReport>> result = new Result<List<AjhWasteYearReport>>();
List<AjhWasteYearReport> list = ajhWasteYearReportService.queryList(ajhWasteYearReport);
result.setSuccess(true);
result.setResult(list);
return result;
}
/**
* 添加
* @param ajhWasteYearReport
* @return
*/
@AutoLog(value = "危险废物台账年报报表-添加")
@ApiOperation(value="危险废物台账年报报表-添加", notes="危险废物台账年报报表-添加")
@PostMapping(value = "/add")
public Result<AjhWasteYearReport> add(@RequestBody AjhWasteYearReport ajhWasteYearReport) {
Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
try {
ajhWasteYearReportService.save(ajhWasteYearReport);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
/**
* 编辑
* @param ajhWasteYearReport
* @return
*/
@AutoLog(value = "危险废物台账年报报表-编辑")
@ApiOperation(value="危险废物台账年报报表-编辑", notes="危险废物台账年报报表-编辑")
@PutMapping(value = "/edit")
public Result<AjhWasteYearReport> edit(@RequestBody AjhWasteYearReport ajhWasteYearReport) {
Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
AjhWasteYearReport ajhWasteYearReportEntity = ajhWasteYearReportService.getById(ajhWasteYearReport.getId());
if(ajhWasteYearReportEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = ajhWasteYearReportService.updateById(ajhWasteYearReport);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
}
}
return result;
}
/**
* 通过id删除
* @param id
* @return
*/
@AutoLog(value = "危险废物台账年报报表-通过id删除")
@ApiOperation(value="危险废物台账年报报表-通过id删除", notes="危险废物台账年报报表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
ajhWasteYearReportService.removeById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
}
return Result.ok("删除成功!");
}
/**
* 批量删除
* @param ids
* @return
*/
@AutoLog(value = "危险废物台账年报报表-批量删除")
@ApiOperation(value="危险废物台账年报报表-批量删除", notes="危险废物台账年报报表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<AjhWasteYearReport> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
if(ids==null || "".equals(ids.trim())) {
result.error500("参数不识别!");
}else {
this.ajhWasteYearReportService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询
* @param id
* @return
*/
@AutoLog(value = "危险废物台账年报报表-通过id查询")
@ApiOperation(value="危险废物台账年报报表-通过id查询", notes="危险废物台账年报报表-通过id查询")
@GetMapping(value = "/queryById")
public Result<AjhWasteYearReport> queryById(@RequestParam(name="id",required=true) String id) {
Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
AjhWasteYearReport ajhWasteYearReport = ajhWasteYearReportService.getById(id);
if(ajhWasteYearReport==null) {
result.error500("未找到对应实体");
}else {
result.setResult(ajhWasteYearReport);
result.setSuccess(true);
}
return result;
}
/**
* 导出excel
*
* @param request
* @param response
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
// Step.1 组装查询条件
QueryWrapper<AjhWasteYearReport> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (StringUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
AjhWasteYearReport ajhWasteYearReport = JSON.parseObject(deString, AjhWasteYearReport.class);
queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteYearReport, request.getParameterMap());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<AjhWasteYearReport> pageList = ajhWasteYearReportService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "危险废物台账年报报表列表");
mv.addObject(NormalExcelConstants.CLASS, AjhWasteYearReport.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("危险废物台账年报报表列表数据", "导出人:Jeecg", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<AjhWasteYearReport> listAjhWasteYearReports = ExcelImportUtil.importExcel(file.getInputStream(), AjhWasteYearReport.class, params);
ajhWasteYearReportService.saveBatch(listAjhWasteYearReports);
return Result.ok("文件导入成功!数据行数:" + listAjhWasteYearReports.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.ok("文件导入失败!");
}
}
package com.skua.modules.ajh.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import com.skua.core.util.ConvertUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 危险废物台账月报报表
*/
@Data
@TableName("ajh_waste_month_report")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ajh_waste_month_report对象", description="危险废物台账月报报表")
public class AjhWasteMonthReport {
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
/**所属厂区*/
......@@ -35,6 +24,9 @@ public class AjhWasteMonthReport {
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
@ApiModelProperty(value = "所属厂区")
private String departId;
@ApiModelProperty(value = "所属厂区")
private String departName;
/**月份*/
@Excel(name = "月份", width = 15)
@ApiModelProperty(value = "月份")
......@@ -64,51 +56,7 @@ public class AjhWasteMonthReport {
@Excel(name = "贮存量", width = 15)
@ApiModelProperty(value = "贮存量")
private String monthKeep;
/**单位名称*/
@Excel(name = "单位名称", width = 15)
@ApiModelProperty(value = "单位名称")
private String reportDept;
/**许可证编号*/
@Excel(name = "许可证编号", width = 15)
@ApiModelProperty(value = "许可证编号")
private String reportLicenceCode;
/**处置方式*/
@Excel(name = "处置方式", width = 15)
@ApiModelProperty(value = "处置方式")
private String reportDealMethod;
/**处置数量*/
@Excel(name = "处置数量", width = 15)
@ApiModelProperty(value = "处置数量")
private String reportDealNumber;
/**单位*/
@Excel(name = "单位", width = 15)
@ApiModelProperty(value = "单位")
private String reportDealUnit;
/**创建人员*/
@ApiModelProperty(value = "创建人员")
private String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**修改人员*/
@ApiModelProperty(value = "修改人员")
private String updateBy;
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private java.util.Date updateTime;
/**修改部门*/
@ApiModelProperty(value = "修改部门")
private String createDept;
/**修改集团*/
@ApiModelProperty(value = "修改集团")
private String createCmpy;
/**标识*/
@ApiModelProperty(value = "标识")
private Integer delFlag;
public String getStockOnHand() {
//数据之间应进行逻辑验算:期初量+入库量-出库量=在存量。
......
......@@ -2,6 +2,7 @@ package com.skua.modules.ajh.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.skua.core.aspect.annotation.Dict;
......@@ -18,14 +19,12 @@ import org.jeecgframework.poi.excel.annotation.Excel;
* 危险废物台账年报报表
*/
@Data
@TableName("ajh_waste_year_report")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="ajh_waste_year_report对象", description="危险废物台账年报报表")
public class AjhWasteYearReport {
/**主键*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "主键")
private String id;
/**所属厂区*/
......@@ -33,9 +32,12 @@ public class AjhWasteYearReport {
@ApiModelProperty(value = "所属厂区")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
@ApiModelProperty(value = "所属厂区")
private String departName;
/**月份*/
@Excel(name = "份", width = 15)
@ApiModelProperty(value = "份")
@Excel(name = "份", width = 15)
@ApiModelProperty(value = "份")
private String reportYear;
/**废物代码*/
@Excel(name = "废物代码", width = 15)
......@@ -53,45 +55,12 @@ public class AjhWasteYearReport {
@Excel(name = "年度贮存量", width = 15)
@ApiModelProperty(value = "年度贮存量")
private String yearKeep;
/**本单位利用量*/
@Excel(name = "本单位利用量", width = 15)
@ApiModelProperty(value = "本单位利用量")
private String reportInsideUse;
/**本单位储存量*/
@Excel(name = "本单位储存量", width = 15)
@ApiModelProperty(value = "本单位储存量")
private String reportInsideKeep;
/**外单位利用量*/
@Excel(name = "外单位利用量", width = 15)
@ApiModelProperty(value = "外单位利用量")
private String reportOutsideUse;
/**外单位储存量*/
@Excel(name = "外单位储存量", width = 15)
@ApiModelProperty(value = "外单位储存量")
private String reportOutsideKeep;
/**创建人员*/
@ApiModelProperty(value = "创建人员")
private String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**修改人员*/
@ApiModelProperty(value = "修改人员")
private String updateBy;
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**修改部门*/
@ApiModelProperty(value = "修改部门")
private String createDept;
/**修改集团*/
@ApiModelProperty(value = "修改集团")
private String createCmpy;
/**标识*/
@ApiModelProperty(value = "标识")
private Integer delFlag;
/**出库量*/
@TableField(exist=false)
@Excel(name = "出库量", width = 15)
@ApiModelProperty(value = "出库量")
private String yearOut;
}
......
package com.skua.modules.ajh.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 危险废物台账月报报表
*/
public interface AjhWasteMonthReportMapper extends BaseMapper<AjhWasteMonthReport> {
List<AjhWasteMonthReport> getList(String departId, String reportMonth);
}
......@@ -2,6 +2,10 @@ package com.skua.modules.ajh.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.ajh.entity.AjhWasteProduce;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -10,5 +14,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* 危废产生记录表
*/
public interface AjhWasteProduceMapper extends BaseMapper<AjhWasteProduce> {
/***
* 月报
* @param page
* @param
* @return
*/
IPage<AjhWasteMonthReport> queryPageListByMonth(Page<AjhWasteMonthReport> page,@Param("departId") String departId,@Param("reportMonth")String reportMonth);
/**
* 年报
* @param page
* @param
* @return
*/
IPage<AjhWasteYearReport> queryPageListByYear(Page<AjhWasteYearReport> page,@Param("departId") String departId,@Param("reportYear")String reportYear);
}
......
package com.skua.modules.ajh.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 危险废物台账年报报表
*/
public interface AjhWasteYearReportMapper extends BaseMapper<AjhWasteYearReport> {
List<AjhWasteYearReport> queryList(String departId, String reportYear);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.ajh.mapper.AjhWasteMonthReportMapper">
<select id="getList" resultType="com.skua.modules.ajh.entity.AjhWasteMonthReport">
SELECT
p.id,
p.waste_code,
p.waste_name,
LEFT ( p.pro_out_date, 7 ) AS report_month,
ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS month_produce,
ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS month_out,
ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS month_keep,
d.depart_name AS depart_id
FROM
ajh_waste_produce p
LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE 1=1
<if test="reportMonth!=null and reportMonth!=''">
and LEFT ( keep_in_date, 7 ) = #{reportMonth}
</if>
) k ON p.depart_id = k.depart_id
AND p.waste_code = k.waste_code
AND p.waste_name = k.waste_name
LEFT JOIN sys_depart d ON p.depart_id = d.id
WHERE
1=1
<if test="reportMonth!=null and reportMonth!=''">
and LEFT ( p.pro_out_date, 7 ) = #{reportMonth}
</if>
<if test="departId!=null and departId!=''">
and p.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
GROUP BY
p.depart_id,
p.waste_code,
p.waste_name
</select>
</mapper>
......@@ -2,4 +2,78 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.ajh.mapper.AjhWasteProduceMapper">
</mapper>
\ No newline at end of file
<!-- 月报-->
<select id="queryPageListByMonth" resultType="com.skua.modules.ajh.entity.AjhWasteMonthReport">
SELECT
p.id,
p.waste_code,
p.waste_name,
LEFT ( p.pro_out_date, 7 ) AS report_month,
ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS month_produce,
ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS month_out,
ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS month_keep,
d.depart_name AS depart_name,
d.id as depart_id
FROM
ajh_waste_produce p
LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE 1=1
<if test="reportMonth!=null and reportMonth!=''">
and LEFT ( keep_in_date, 7 ) = #{reportMonth}
</if>
) k ON p.depart_id = k.depart_id
AND p.waste_code = k.waste_code
AND p.waste_name = k.waste_name
LEFT JOIN sys_depart d ON p.depart_id = d.id
WHERE
1=1
<if test="reportMonth!=null and reportMonth!=''">
and LEFT ( p.pro_out_date, 7 ) = #{reportMonth}
</if>
<if test="departId!=null and departId!=''">
and p.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
GROUP BY
p.depart_id,
p.waste_code,
p.waste_name
</select>
<select id="queryPageListByYear" resultType="com.skua.modules.ajh.entity.AjhWasteYearReport">
SELECT
p.id,
p.waste_code,
p.waste_name,
LEFT ( p.pro_out_date, 4 ) AS report_year,
ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS year_produce,
ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS year_out,
ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS year_keep,
d.depart_name AS depart_name,
d.id as depart_id
FROM
ajh_waste_produce p
LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE LEFT ( keep_in_date, 4 ) = #{reportYear} ) k ON p.depart_id = k.depart_id
AND p.waste_code = k.waste_code
AND p.waste_name = k.waste_name
LEFT JOIN sys_depart d ON p.depart_id = d.id
WHERE
LEFT ( p.pro_out_date, 4 ) = #{reportYear}
<if test="departId!=null and departId!=''">
and p.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
GROUP BY
p.depart_id,
p.waste_code,
p.waste_name
</select>
</mapper>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.ajh.mapper.AjhWasteYearReportMapper">
<select id="queryList" resultType="com.skua.modules.ajh.entity.AjhWasteYearReport">
SELECT
p.id,
p.waste_code,
p.waste_name,
LEFT ( p.pro_out_date, 4 ) AS report_year,
ROUND( SUM( p.pro_come_count ), 2 ) AS year_produce,
ROUND( SUM( k.keep_in_count ), 2 ) AS year_keep,
d.depart_name AS depart_id
FROM
ajh_waste_produce p
LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE LEFT ( keep_in_date, 4 ) = #{reportYear} ) k ON p.depart_id = k.depart_id
AND p.waste_code = k.waste_code
AND p.waste_name = k.waste_name
LEFT JOIN sys_depart d ON p.depart_id = d.id
WHERE
LEFT ( p.pro_out_date, 4 ) = #{reportYear}
<if test="departId!=null and departId!=''">
and p.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
GROUP BY
p.depart_id,
p.waste_code,
p.waste_name
</select>
</mapper>
package com.skua.modules.ajh.service;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 危险废物台账月报报表
*/
public interface IAjhWasteMonthReportService extends IService<AjhWasteMonthReport> {
List<AjhWasteMonthReport> getList(AjhWasteMonthReport ajhWasteMonthReport);
}
package com.skua.modules.ajh.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
/**
* @auther kangwei
* @create 2025-01-09-11:10
*/
public interface IAjhWasteReportService {
/***
* 月报
* @param page
* @param
* @return
*/
IPage<AjhWasteMonthReport> queryPageListByMonth(Page<AjhWasteMonthReport> page,String departId,String reportMonth);
/***
* 年报
* @param page
* @param
* @return
*/
IPage<AjhWasteYearReport> queryPageListByYear(Page<AjhWasteYearReport> page,String departId,String reportMonth);
}
package com.skua.modules.ajh.service;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* 危险废物台账年报报表
*/
public interface IAjhWasteYearReportService extends IService<AjhWasteYearReport> {
List<AjhWasteYearReport> queryList(AjhWasteYearReport ajhWasteYearReport);
}
package com.skua.modules.ajh.service.impl;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.skua.modules.ajh.mapper.AjhWasteMonthReportMapper;
import com.skua.modules.ajh.service.IAjhWasteMonthReportService;
import com.skua.modules.system.service.ISysDepartService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 危险废物台账月报报表
*/
@Service
public class AjhWasteMonthReportServiceImpl extends ServiceImpl<AjhWasteMonthReportMapper, AjhWasteMonthReport> implements IAjhWasteMonthReportService {
@Autowired
private AjhWasteMonthReportMapper ajhWasteMonthReportMapper;
@Resource
private ISysDepartService departService;
@Override
public List<AjhWasteMonthReport> getList(AjhWasteMonthReport ajhWasteMonthReport) {
List<AjhWasteMonthReport> list = new ArrayList<>();
String departId = null;
if (StringUtils.isBlank(ajhWasteMonthReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
departId = BaseContextHandler.getDeparts();
}else{
departId = departService.getChildDepartId(ajhWasteMonthReport.getDepartId());
}
String reportMonth = ajhWasteMonthReport.getReportMonth();
// if(reportMonth == null){
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
// reportMonth = dateFormat.format(new Date());
// }
list = ajhWasteMonthReportMapper.getList(departId,reportMonth);
return list;
}
}
package com.skua.modules.ajh.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.ajh.entity.AjhWasteMonthReport;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
import com.skua.modules.ajh.mapper.AjhWasteProduceMapper;
import com.skua.modules.ajh.service.IAjhWasteReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @auther kangwei
* @create 2025-01-09-11:17
*/
@Service
public class AjhWasteReportServiceImpl implements IAjhWasteReportService {
@Autowired
private AjhWasteProduceMapper wasteProduceMapper;
/***
* 月报
* @param page
* @param
* @return
*/
public IPage<AjhWasteMonthReport> queryPageListByMonth(Page<AjhWasteMonthReport> page, String departId,String reportMonth){
return wasteProduceMapper.queryPageListByMonth(page,departId, reportMonth);
}
/***
* 年报
* @param page
* @param
* @return
*/
public IPage<AjhWasteYearReport> queryPageListByYear(Page<AjhWasteYearReport> page, String departId,String reportYear){
return wasteProduceMapper.queryPageListByYear(page,departId, reportYear);
}
}
package com.skua.modules.ajh.service.impl;
import com.skua.core.context.BaseContextHandler;
import com.skua.modules.ajh.entity.AjhWasteYearReport;
import com.skua.modules.ajh.mapper.AjhWasteYearReportMapper;
import com.skua.modules.ajh.service.IAjhWasteYearReportService;
import com.skua.modules.system.service.ISysDepartService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.annotation.Resource;
import java.time.Year;
import java.util.ArrayList;
import java.util.List;
/**
* 危险废物台账年报报表
*/
@Service
public class AjhWasteYearReportServiceImpl extends ServiceImpl<AjhWasteYearReportMapper, AjhWasteYearReport> implements IAjhWasteYearReportService {
@Autowired
private AjhWasteYearReportMapper ajhWasteYearReportMapper;
@Resource
private ISysDepartService departService;
@Override
public List<AjhWasteYearReport> queryList(AjhWasteYearReport ajhWasteYearReport) {
List<AjhWasteYearReport> list = new ArrayList<>();
String departId = null;
if (StringUtils.isBlank(ajhWasteYearReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
departId = BaseContextHandler.getDeparts();
}else{
departId = departService.getChildDepartId(ajhWasteYearReport.getDepartId());
}
String reportYear = ajhWasteYearReport.getReportYear();
if(reportYear==null){
reportYear = String.valueOf(Year.now().getValue());
}
list = ajhWasteYearReportMapper.queryList(departId,reportYear);
return list;
}
}
package com.skua.modules.ajh.vo;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @auther kangwei
* @create 2025-01-09-11:50
*/
@Data
public class AjhWasteReportSearchVO {
@Excel(name = "所属厂区", width = 15)
@ApiModelProperty(value = "所属厂区")
private String departId;
@Excel(name = "月份", width = 15)
@ApiModelProperty(value = "月份")
private String reportMonth;
/**月份*/
@Excel(name = "年份", width = 15)
@ApiModelProperty(value = "年份")
private String reportYear;
}
......@@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.edu.entity.QuestionDB;
import com.skua.tool.annotation.Anonymous;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.edu.entity.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -42,6 +43,7 @@ public interface QuestionMapper extends BaseMapper<Question> {
* @param eduQuestion 在线考试--试题
* @return 在线考试--试题集合
*/
@Anonymous
public List<Question> selectQuestionList(Question eduQuestion);
/**
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!