e0db16e6 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 4cb9519b 2aead5ac
正在显示 34 个修改的文件 包含 479 行增加864 行删除
......@@ -432,6 +432,20 @@ public class JSUtils {
System.out.println(quoteEach(str,",") );
}
/***
* 获取当前日期
* @return
*/
public static String getCurrentDate() {
// 创建一个Calendar实例,并设置为当前日期和时间
Calendar calendar = Calendar.getInstance();
// 设置日期格式
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期
String currentDate = dateFormat.format(calendar.getTime());
return currentDate;
}
/* ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript");
Object eval = null;
try {
......
......@@ -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);
/**
......
......@@ -56,7 +56,7 @@ public class MaterialAcceptanceForm {
@Excel(name = "收货人员签字", width = 15)
@ApiModelProperty(value = "收货人员签字")
private String receiverSign;
@Excel(name = "确认状态 0 未确认、1 部分确认、2全部确认", width = 15)
@Excel(name = "确认状态 0 未确认、1 收货签字、2 送货方签字 、9 全部确认", width = 15)
@ApiModelProperty(value = "确认状态 0 未确认、1 收货签字、2 送货方签字 、9 全部确认")
@Dict( dicCode="purchase_confirm_status")
private String confirmStatus;
......
......@@ -2,6 +2,63 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.erp.mapper.MaterialINMapper">
<!--查询 入库单 -->
<select id="queryArrivalRecordByList" resultType="com.skua.modules.erp.vo.ArrivalRecordExcelExportVO">
select d.depart_name, pc.contract_code 'purchaseContractCode', dc.contract_code 'distributContractCode' ,ss.sparepart_name,mi.*
from erp_material_in mi
left join sys_depart d on d.id = mi.depart_id
left join erp_purchase_contract pc on pc.id = mi.purchase_contract_id
left join erp_distribut_contract dc on dc.id = mi.distribut_contract_id
left join equipment_sparepart_supplies ss on ss.id = mi.supplier_id
<where>
mi.audit_status =3
<if test="startTime != null and startTime !=''">
and mi.arrive_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and mi.arrive_time &lt;= #{endTime}
</if>
<if test="goodCode != null and goodCode !=''">
and mi.good_code like CONCAT('',#{goodCode},'%')
</if>
<if test="sparepartName != null and sparepartName !=''">
and mi.sparepart_name like CONCAT('%',#{sparepartName},'%')
</if>
<if test="departId != null and departId !=''">
and mi.depart_id = #{departId}
</if>
<if test="supplierId != null and supplierId !=''">
and mi.supplier_id = #{supplierId}
</if>
</where>
order by arrive_time desc
</select>
<!--获取入库审批列表:根据部门、采购合同、供应商、药剂分组搜索 -->
<select id="selectAuditMaterialINByPage" resultType="com.skua.modules.erp.vo.ArrivalRecordExcelExportVO">
select sparepart_id , purchase_contract_id,depart_id ,supplier_id,
sum(purchase_num) 'purchase_num',measuring_unit,specification,sparepart_name,tax_amount,
purchase_price,distribut_price,sum(purchase_total_price) 'purchase_total_price',sum(distribut_total_price) 'distribut_total_price',sum(total_price_tax) 'total_price_tax'
from erp_material_in
<where>
audit_status =3
<if test="materialIN.startTime != null and materialIN.startTime !=''">
and arrive_time &gt;= #{materialIN.startTime}
</if>
<if test="materialIN.endTime != null and materialIN.endTime !=''">
and arrive_time &lt;= #{materialIN.endTime}
</if>
<if test="materialIN.departId != null and materialIN.departId !=''">
and depart_id = #{materialIN.departId}
</if>
<if test="materialIN.supplierId != null and materialIN.supplierId !=''">
and supplier_id = #{materialIN.supplierId}
</if>
<if test="materialIN.purchaseContractId != null and materialIN.purchaseContractId !=''">
and purchase_contract_id = #{materialIN.purchaseContractId}
</if>
</where>
group by sparepart_id,purchase_contract_id,depart_id,supplier_id
</select>
<select id="queryById" resultType="com.skua.modules.erp.entity.MaterialIN">
select d.depart_name 'departName', st.item_text 'sparepartTypeName', sm.supp_name 'supplierName', t.* from erp_material_in t
......
package com.skua.modules.safe.controller;
import java.io.File;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
......@@ -12,6 +14,7 @@ import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.query.QueryGenerator;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.safe.entity.DangerLevelManage;
import com.skua.modules.safe.entity.DangerLevelManageShare;
import com.skua.modules.safe.service.IDangerLevelManageService;
......@@ -23,8 +26,10 @@ import com.skua.modules.system.datestandard.entity.SysStructDict;
import com.skua.modules.system.entity.SysDepart;
import com.skua.modules.system.service.ISysConfigService;
import com.skua.modules.system.service.ISysDepartService;
import com.skua.tool.util.JSUtils;
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;
......@@ -81,7 +86,16 @@ public class DangerLevelManageController {
Result<IPage<DangerLevelManage>> result = new Result<IPage<DangerLevelManage>>();
QueryWrapper<DangerLevelManage> queryWrapper = QueryGenerator.initQueryWrapper(dangerLevelManage, req.getParameterMap());
Page<DangerLevelManage> page = new Page<DangerLevelManage>(pageNo, pageSize);
IPage<DangerLevelManage> pageList = dangerLevelManageService.queryPage(page, queryWrapper);
String startTime = req.getParameter("startTime");
String endTime = req.getParameter("endTime");
if(StringUtils.isEmpty(startTime)){
LocalDate firstDayOfYear = LocalDate.now().withDayOfYear(1);//获取几年第一天
startTime = firstDayOfYear.toString();
}
if(StringUtils.isEmpty(endTime)){
endTime = JSUtils.getCurrentDate();
}
IPage<DangerLevelManage> pageList = dangerLevelManageService.queryPage(page, queryWrapper,startTime,endTime);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -99,10 +99,9 @@ public class SafetyStandardOptimizeController {
@AutoLog(value = "安全标准化优化-统计数量")
@ApiOperation(value="安全标准化优化-统计数量", notes="安全标准化优化-统计数量")
@GetMapping(value = "/statisticsCount")
public Result<Map<String,String>> statisticsCount( StatisticsSearchVO statisticsSearchVO) {
Result<Map<String,String>> result = new Result<>();
public Result<Map<String,Object>> statisticsCount( StatisticsSearchVO statisticsSearchVO) {
Result<Map<String,Object>> result = new Result<>();
Map<String,String> dataMap = new HashMap<>();
String departIds = null;
if(StringUtils.isNotEmpty(statisticsSearchVO.getDepartId())){
departIds = departService.getChildDepartId(statisticsSearchVO.getDepartId());
......@@ -110,8 +109,8 @@ public class SafetyStandardOptimizeController {
departIds = BaseContextHandler.getDeparts();
}
statisticsSearchVO.setDepartIds( JSUtils.quoteEach(departIds,","));
List<StatisticsSearchVO> dataList = safetyStandardOptimizeService.statistics(statisticsSearchVO);
Integer wantNum = 0 ;
Map<String,Object> dataMap = safetyStandardOptimizeService.statisticsCount(statisticsSearchVO);
/*Integer wantNum = 0 ;
String finishNum = "0";
String finishNumExpression = "0";
if(dataList != null && !dataList.isEmpty()) {
......@@ -122,7 +121,7 @@ public class SafetyStandardOptimizeController {
finishNum = JSUtils.executeExpression(finishNumExpression,"0");
}
dataMap.put("wantNum",wantNum+"");
dataMap.put("finishNum",finishNum);
dataMap.put("finishNum",finishNum);*/
result.setSuccess(true);
result.setResult(dataMap);
......
......@@ -24,7 +24,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@Accessors(chain = true)
@ApiModel(value="danger_inspect_item对象", description="风险检查项")
public class DangerInspectItem implements Serializable{
/**id*/
@TableId(type = IdType.ID_WORKER_STR)
@ApiModelProperty(value = "id")
......@@ -47,6 +47,12 @@ public class DangerInspectItem implements Serializable{
@Excel(name = "选项类型(0:选择,1 是否 2 文本)", width = 15)
@ApiModelProperty(value = "选项类型(0:选择,1 是否 2 文本)")
private String itemType;
/**选项状态(0:异常,1正常)*/
@Excel(name = "隐患后果", width = 15)
@ApiModelProperty(value = "隐患后果")
private String dangerResult;
/**选项状态(0:异常,1正常)*/
@Excel(name = "选项状态(0:异常,1正常)", width = 15)
@ApiModelProperty(value = "选项状态(0:异常,1正常)")
......
......@@ -25,7 +25,11 @@ public interface DangerLevelManageMapper extends BaseMapper<DangerLevelManage> {
@Select("SELECT t.*,ifnull(aaa.inspect_content,'') inspect_content, ifnull(bbb.inspection_num,0) inspection_num, ifnull(ccc.rectification_num,0) 'rectification_num' " +
" FROM danger_level_manage t" +
" left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id " +
" left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record group by danger_id)bbb on bbb.danger_id = t.id " +
" left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info group by danger_id)ccc on ccc.danger_id = t.id ${ew.customSqlSegment}")
List<DangerLevelManage> getListByWrapper(Page page,@Param("ew") QueryWrapper<DangerLevelManage> queryWrapper);
" left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record " +
" where DATE_FORMAT(report_date,'%Y-%m-%d') >= #{startTime} and DATE_FORMAT(report_date,'%Y-%m-%d') <= #{endTime} "+
" group by danger_id)bbb on bbb.danger_id = t.id " +
" left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info" +
" where DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') >= #{startTime} and DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') <= #{endTime} "+
" group by danger_id)ccc on ccc.danger_id = t.id ${ew.customSqlSegment}")
List<DangerLevelManage> getListByWrapper(Page page,@Param("ew") QueryWrapper<DangerLevelManage> queryWrapper,@Param("startTime") String startTime,@Param("endTime") String endTime);
}
......
......@@ -14,8 +14,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface SafetyStandardOptimizeMapper extends BaseMapper<SafetyStandardOptimize> {
/***
* 统计
* 统计列表
* @return
*/
List<StatisticsSearchVO> statistics(StatisticsSearchVO statisticsSearchVO);
/***
* 统计数量
* @param statisticsSearchVO
* @return
*/
Map<String,Object> statisticsCount(StatisticsSearchVO statisticsSearchVO);
}
......
......@@ -17,8 +17,24 @@
<select id="queryByList" resultType="com.skua.modules.safe.entity.DangerLevelManage">
select ifnull(aaa.inspect_content,'') inspect_content, ifnull(bbb.inspection_num,0) inspection_num, ifnull(ccc.rectification_num,0) 'rectification_num', t.* from danger_level_manage t
left join (select danger_id ,GROUP_CONCAT(inspect_name SEPARATOR '@') 'inspect_content' from danger_inspect_info group by danger_id)aaa on aaa.danger_id = t.id
left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record group by danger_id)bbb on bbb.danger_id = t.id
left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info group by danger_id)ccc on ccc.danger_id = t.id
left join (select danger_id, count(id) 'inspection_num' from danger_inspection_record
where 1=1
<if test="startTime != null and startTime !=''">
and DATE_FORMAT(report_date,'%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and DATE_FORMAT(report_date,'%Y-%m-%d') &lt;= #{endTime}
</if>
group by danger_id)bbb on bbb.danger_id = t.id
left join (select danger_id, count(id) 'rectification_num' from ajh_rectification_info
where 1=1
<if test="startTime != null and startTime !=''">
and DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and DATE_FORMAT(rec_ord_report_date,'%Y-%m-%d') &lt;= #{endTime}
</if>
group by danger_id)ccc on ccc.danger_id = t.id
<where>
<if test="param.departId != null and param.departId != ''"> and t.depart_id = #{param.departId}</if>
<if test="param.dangerType != null and param.dangerType != ''"> and t.danger_type = #{param.dangerType}</if>
......
......@@ -3,7 +3,7 @@
<mapper namespace="com.skua.modules.safe.mapper.SafetyStandardOptimizeMapper">
<select id="statistics" resultType="com.skua.modules.safe.vo.StatisticsSearchVO" >
select d.id depart_id, d.depart_name,#{wantNum} 'wantNum', ifnull(aaa.report_num , 0 )finishNum
select d.id depart_id, d.depart_name, ifnull(aaa.report_num , 0 )finishNum
from sys_depart d
left join (select so.depart_id , count(so.id) report_num from safety_standard_optimize so
where DATE_FORMAT( so.create_time, '%Y-%m-%d' ) &gt;= #{startDate} AND DATE_FORMAT( so.create_time, '%Y-%m-%d' ) &lt;= #{endDate}
......@@ -14,4 +14,20 @@
</if>
and d.depart_type = 1
</select>
<select id="statisticsCount" resultType="java.util.Map" >
select (count(aaa.depart_id) * aaa.wantNum ) 'wantNum', sum(aaa.finishNum) 'finishNum' from (
select d.id depart_id, d.depart_name,#{wantNum} 'wantNum', ifnull(aaa.report_num , 0 )finishNum
from sys_depart d
left join (select so.depart_id , count(so.id) report_num from safety_standard_optimize so
where DATE_FORMAT( so.create_time, '%Y-%m-%d' ) &gt;= #{startDate} AND DATE_FORMAT( so.create_time, '%Y-%m-%d' ) &lt;= #{endDate}
GROUP BY so.depart_id ) aaa on aaa.depart_id = d.id
where d.id in(${departIds})
<if test="departName != null ">
and d.depart_name like CONCAT('%',#{departName},'%')
</if>
and d.depart_type = 1
)aaa
</select>
</mapper>
......
......@@ -25,5 +25,5 @@ public interface IDangerLevelManageService extends IService<DangerLevelManage> {
* @param queryWrapper
* @return
*/
public IPage<DangerLevelManage> queryPage(Page<DangerLevelManage> page, QueryWrapper<DangerLevelManage> queryWrapper) ;
public IPage<DangerLevelManage> queryPage(Page<DangerLevelManage> page, QueryWrapper<DangerLevelManage> queryWrapper ,String startTime,String endTime) ;
}
......
......@@ -13,8 +13,15 @@ import java.util.Map;
public interface ISafetyStandardOptimizeService extends IService<SafetyStandardOptimize> {
/***
* 统计
* 统计列表
* @return
*/
List<StatisticsSearchVO > statistics(StatisticsSearchVO statisticsSearchVO);
/***
* 统计数量
* @param statisticsSearchVO
* @return
*/
Map<String,Object> statisticsCount(StatisticsSearchVO statisticsSearchVO);
}
......
......@@ -35,8 +35,8 @@ public class DangerLevelManageServiceImpl extends ServiceImpl<DangerLevelManageM
* @param queryWrapper
* @return
*/
public IPage<DangerLevelManage> queryPage(Page<DangerLevelManage> page, QueryWrapper<DangerLevelManage> queryWrapper) {
List<DangerLevelManage> list = this.baseMapper.getListByWrapper(page, queryWrapper);
public IPage<DangerLevelManage> queryPage(Page<DangerLevelManage> page, QueryWrapper<DangerLevelManage> queryWrapper ,String startTime,String endTime) {
List<DangerLevelManage> list = this.baseMapper.getListByWrapper(page, queryWrapper,startTime, endTime);
page.setRecords(list);
return page;
}
......
......@@ -23,6 +23,14 @@ public class SafetyStandardOptimizeServiceImpl extends ServiceImpl<SafetyStandar
* @return
*/
public List<StatisticsSearchVO> statistics(StatisticsSearchVO statisticsSearchVO){
return this.baseMapper.statistics(statisticsSearchVO);
}
/***
* 统计数量
* @param statisticsSearchVO
* @return
*/
public Map<String,Object> statisticsCount(StatisticsSearchVO statisticsSearchVO){
//计算两个时间相间的季度 = 应填写数量
List<String> monthList = DateUtils.getMonthsBetween(statisticsSearchVO.getStartDate(), statisticsSearchVO.getEndDate());
double d = monthList.size() / 3d;
......@@ -33,6 +41,6 @@ public class SafetyStandardOptimizeServiceImpl extends ServiceImpl<SafetyStandar
wantNum = (int)d +1;
}
statisticsSearchVO.setWantNum(wantNum );
return this.baseMapper.statistics(statisticsSearchVO);
return this.baseMapper.statisticsCount(statisticsSearchVO);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!