2aead5ac 康伟

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

1 个父辈 b557fda9
正在显示 20 个修改的文件 包含 310 行增加843 行删除
...@@ -361,9 +361,7 @@ public class AjhMeetingMinutesController { ...@@ -361,9 +361,7 @@ public class AjhMeetingMinutesController {
361 } 361 }
362 //paramMap.put("startTime",meeting.getStartTime());// 会议通知 开始时间 362 //paramMap.put("startTime",meeting.getStartTime());// 会议通知 开始时间
363 //paramMap.put("endTime",meeting.getEndTime());//会议通知 结束时间 363 //paramMap.put("endTime",meeting.getEndTime());//会议通知 结束时间
364
365 /**************会议记录内容****************/ 364 /**************会议记录内容****************/
366
367 if(meetingSend != null ){ 365 if(meetingSend != null ){
368 paramMap.put("startTime",null); 366 paramMap.put("startTime",null);
369 if(meetingSend.getMeetStartTime() != null ){ 367 if(meetingSend.getMeetStartTime() != null ){
...@@ -408,12 +406,10 @@ public class AjhMeetingMinutesController { ...@@ -408,12 +406,10 @@ public class AjhMeetingMinutesController {
408 ajhMeetingAttend.setDuties(""); 406 ajhMeetingAttend.setDuties("");
409 } 407 }
410 } 408 }
411
412 //补全签到表格集合 409 //补全签到表格集合
413 supplementList( meetingAttendList , index ); 410 supplementList( meetingAttendList , index );
414 // //签到表集合 411 // //签到表集合
415 paramMap.put("attendList",meetingAttendList); 412 paramMap.put("attendList",meetingAttendList);
416
417 //添加图片 413 //添加图片
418 // 第三部分:图片 414 // 第三部分:图片
419 if(minutesimage != null ){ 415 if(minutesimage != null ){
......
1 package com.skua.modules.ajh.controller;
2
3 import java.util.Arrays;
4 import java.util.List;
5 import java.util.Map;
6 import java.io.IOException;
7 import java.io.UnsupportedEncodingException;
8 import java.net.URLDecoder;
9 import javax.servlet.http.HttpServletRequest;
10 import javax.servlet.http.HttpServletResponse;
11
12 import com.skua.core.api.vo.Result;
13 import com.skua.core.aspect.annotation.AutoLog;
14 import com.skua.core.query.QueryGenerator;
15 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
16 import com.skua.modules.ajh.service.IAjhWasteMonthReportService;
17 import java.util.Date;
18 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
19 import com.baomidou.mybatisplus.core.metadata.IPage;
20 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
21 import lombok.extern.slf4j.Slf4j;
22
23 import org.apache.commons.lang3.StringUtils;
24 import org.jeecgframework.poi.excel.ExcelImportUtil;
25 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
26 import org.jeecgframework.poi.excel.entity.ExportParams;
27 import org.jeecgframework.poi.excel.entity.ImportParams;
28 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
29
30 import org.springframework.beans.factory.annotation.Autowired;
31 import org.springframework.web.bind.annotation.*;
32 import org.springframework.web.multipart.MultipartFile;
33 import org.springframework.web.multipart.MultipartHttpServletRequest;
34 import org.springframework.web.servlet.ModelAndView;
35 import com.alibaba.fastjson.JSON;
36 import io.swagger.annotations.Api;
37 import io.swagger.annotations.ApiOperation;
38
39 /**
40 * 危险废物台账月报报表
41 */
42 @Slf4j
43 @Api(tags="危险废物台账月报报表")
44 @RestController
45 @RequestMapping("/ajh/ajhWasteMonthReport")
46 public class AjhWasteMonthReportController {
47 @Autowired
48 private IAjhWasteMonthReportService ajhWasteMonthReportService;
49
50 /**
51 * 分页列表查询
52 * @param ajhWasteMonthReport
53 * @param pageNo
54 * @param pageSize
55 * @param req
56 * @return
57 */
58 @AutoLog(value = "危险废物台账月报报表-分页列表查询")
59 @ApiOperation(value="危险废物台账月报报表-分页列表查询", notes="危险废物台账月报报表-分页列表查询")
60 @GetMapping(value = "/list")
61 public Result<IPage<AjhWasteMonthReport>> queryPageList(AjhWasteMonthReport ajhWasteMonthReport,
62 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
63 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
64 HttpServletRequest req) {
65 Result<IPage<AjhWasteMonthReport>> result = new Result<IPage<AjhWasteMonthReport>>();
66 QueryWrapper<AjhWasteMonthReport> queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteMonthReport, req.getParameterMap());
67 Page<AjhWasteMonthReport> page = new Page<AjhWasteMonthReport>(pageNo, pageSize);
68 IPage<AjhWasteMonthReport> pageList = ajhWasteMonthReportService.page(page, queryWrapper);
69 result.setSuccess(true);
70 result.setResult(pageList);
71 return result;
72 }
73
74 @AutoLog(value = "危险废物台账月报报表列表查询")
75 @ApiOperation(value="危险废物台账月报报表列表查询", notes="危险废物台账月报报表列表查询")
76 @GetMapping(value = "/getList")
77 public Result<List<AjhWasteMonthReport>> queryList(AjhWasteMonthReport ajhWasteMonthReport) {
78 Result<List<AjhWasteMonthReport>> result = new Result<List<AjhWasteMonthReport>>();
79 List<AjhWasteMonthReport> list = ajhWasteMonthReportService.getList(ajhWasteMonthReport);
80 result.setSuccess(true);
81 result.setResult(list);
82 return result;
83 }
84
85 /**
86 * 添加
87 * @param ajhWasteMonthReport
88 * @return
89 */
90 @AutoLog(value = "危险废物台账月报报表-添加")
91 @ApiOperation(value="危险废物台账月报报表-添加", notes="危险废物台账月报报表-添加")
92 @PostMapping(value = "/add")
93 public Result<AjhWasteMonthReport> add(@RequestBody AjhWasteMonthReport ajhWasteMonthReport) {
94 Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
95 try {
96 ajhWasteMonthReportService.save(ajhWasteMonthReport);
97 result.success("添加成功!");
98 } catch (Exception e) {
99 log.error(e.getMessage(),e);
100 result.error500("操作失败");
101 }
102 return result;
103 }
104
105 /**
106 * 编辑
107 * @param ajhWasteMonthReport
108 * @return
109 */
110 @AutoLog(value = "危险废物台账月报报表-编辑")
111 @ApiOperation(value="危险废物台账月报报表-编辑", notes="危险废物台账月报报表-编辑")
112 @PutMapping(value = "/edit")
113 public Result<AjhWasteMonthReport> edit(@RequestBody AjhWasteMonthReport ajhWasteMonthReport) {
114 Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
115 AjhWasteMonthReport ajhWasteMonthReportEntity = ajhWasteMonthReportService.getById(ajhWasteMonthReport.getId());
116 if(ajhWasteMonthReportEntity==null) {
117 result.error500("未找到对应实体");
118 }else {
119 boolean ok = ajhWasteMonthReportService.updateById(ajhWasteMonthReport);
120 //TODO 返回false说明什么?
121 if(ok) {
122 result.success("修改成功!");
123 }
124 }
125
126 return result;
127 }
128
129 /**
130 * 通过id删除
131 * @param id
132 * @return
133 */
134 @AutoLog(value = "危险废物台账月报报表-通过id删除")
135 @ApiOperation(value="危险废物台账月报报表-通过id删除", notes="危险废物台账月报报表-通过id删除")
136 @DeleteMapping(value = "/delete")
137 public Result<?> delete(@RequestParam(name="id",required=true) String id) {
138 try {
139 ajhWasteMonthReportService.removeById(id);
140 } catch (Exception e) {
141 log.error("删除失败",e.getMessage());
142 return Result.error("删除失败!");
143 }
144 return Result.ok("删除成功!");
145 }
146
147 /**
148 * 批量删除
149 * @param ids
150 * @return
151 */
152 @AutoLog(value = "危险废物台账月报报表-批量删除")
153 @ApiOperation(value="危险废物台账月报报表-批量删除", notes="危险废物台账月报报表-批量删除")
154 @DeleteMapping(value = "/deleteBatch")
155 public Result<AjhWasteMonthReport> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
156 Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
157 if(ids==null || "".equals(ids.trim())) {
158 result.error500("参数不识别!");
159 }else {
160 this.ajhWasteMonthReportService.removeByIds(Arrays.asList(ids.split(",")));
161 result.success("删除成功!");
162 }
163 return result;
164 }
165
166 /**
167 * 通过id查询
168 * @param id
169 * @return
170 */
171 @AutoLog(value = "危险废物台账月报报表-通过id查询")
172 @ApiOperation(value="危险废物台账月报报表-通过id查询", notes="危险废物台账月报报表-通过id查询")
173 @GetMapping(value = "/queryById")
174 public Result<AjhWasteMonthReport> queryById(@RequestParam(name="id",required=true) String id) {
175 Result<AjhWasteMonthReport> result = new Result<AjhWasteMonthReport>();
176 AjhWasteMonthReport ajhWasteMonthReport = ajhWasteMonthReportService.getById(id);
177 if(ajhWasteMonthReport==null) {
178 result.error500("未找到对应实体");
179 }else {
180 result.setResult(ajhWasteMonthReport);
181 result.setSuccess(true);
182 }
183 return result;
184 }
185
186 /**
187 * 导出excel
188 *
189 * @param request
190 * @param response
191 */
192 @RequestMapping(value = "/exportXls")
193 public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
194 // Step.1 组装查询条件
195 QueryWrapper<AjhWasteMonthReport> queryWrapper = null;
196 try {
197 String paramsStr = request.getParameter("paramsStr");
198 if (StringUtils.isNotEmpty(paramsStr)) {
199 String deString = URLDecoder.decode(paramsStr, "UTF-8");
200 AjhWasteMonthReport ajhWasteMonthReport = JSON.parseObject(deString, AjhWasteMonthReport.class);
201 queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteMonthReport, request.getParameterMap());
202 }
203 } catch (UnsupportedEncodingException e) {
204 e.printStackTrace();
205 }
206
207 //Step.2 AutoPoi 导出Excel
208 ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
209 List<AjhWasteMonthReport> pageList = ajhWasteMonthReportService.list(queryWrapper);
210 //导出文件名称
211 mv.addObject(NormalExcelConstants.FILE_NAME, "危险废物台账月报报表列表");
212 mv.addObject(NormalExcelConstants.CLASS, AjhWasteMonthReport.class);
213 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("危险废物台账月报报表列表数据", "导出人:Jeecg", "导出信息"));
214 mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
215 return mv;
216 }
217
218 /**
219 * 通过excel导入数据
220 *
221 * @param request
222 * @param response
223 * @return
224 */
225 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
226 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
227 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
228 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
229 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
230 MultipartFile file = entity.getValue();// 获取上传文件对象
231 ImportParams params = new ImportParams();
232 params.setTitleRows(2);
233 params.setHeadRows(1);
234 params.setNeedSave(true);
235 try {
236 List<AjhWasteMonthReport> listAjhWasteMonthReports = ExcelImportUtil.importExcel(file.getInputStream(), AjhWasteMonthReport.class, params);
237 ajhWasteMonthReportService.saveBatch(listAjhWasteMonthReports);
238 return Result.ok("文件导入成功!数据行数:" + listAjhWasteMonthReports.size());
239 } catch (Exception e) {
240 log.error(e.getMessage(),e);
241 return Result.error("文件导入失败:"+e.getMessage());
242 } finally {
243 try {
244 file.getInputStream().close();
245 } catch (IOException e) {
246 e.printStackTrace();
247 }
248 }
249 }
250 return Result.ok("文件导入失败!");
251 }
252
253 }
1 package com.skua.modules.ajh.controller;
2
3 /**
4 * @auther kangwei
5 * @create 2025-01-09-11:08
6 */
7
8 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
9 import com.baomidou.mybatisplus.core.metadata.IPage;
10 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
11 import com.skua.core.api.vo.Result;
12 import com.skua.core.aspect.annotation.AutoLog;
13 import com.skua.core.context.BaseContextHandler;
14 import com.skua.core.query.QueryGenerator;
15 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
16 import com.skua.modules.ajh.entity.AjhWasteYearReport;
17 import com.skua.modules.ajh.service.IAjhWasteReportService;
18 import com.skua.modules.system.service.ISysDepartService;
19 import io.swagger.annotations.Api;
20 import io.swagger.annotations.ApiOperation;
21 import lombok.extern.slf4j.Slf4j;
22 import org.apache.commons.lang3.StringUtils;
23 import org.springframework.beans.factory.annotation.Autowired;
24 import org.springframework.web.bind.annotation.GetMapping;
25 import org.springframework.web.bind.annotation.RequestMapping;
26 import org.springframework.web.bind.annotation.RequestParam;
27 import org.springframework.web.bind.annotation.RestController;
28
29 import javax.servlet.http.HttpServletRequest;
30 import java.time.Year;
31 import java.util.List;
32
33 /**
34 * 危险废物台账年报报表
35 */
36 @Slf4j
37 @Api(tags="危险废物台账月报&年报报表")
38 @RestController
39 @RequestMapping("/ajh/ajhWasteReport")
40 public class AjhWasteReportController {
41
42 @Autowired
43 private IAjhWasteReportService wasteReportService;
44 @Autowired
45 private ISysDepartService departService;
46 /**
47 * 分页列表查询
48 * @param wasteMonthReport
49 * @param pageNo
50 * @param pageSize
51 * @param req
52 * @return
53 */
54 @AutoLog(value = "危险废物台账月报报表-分页列表查询")
55 @ApiOperation(value="危险废物台账月报报表-分页列表查询", notes="危险废物台账月报报表-分页列表查询")
56 @GetMapping(value = "/queryMonthReport")
57 public Result<IPage<AjhWasteMonthReport>> queryPageList(AjhWasteMonthReport wasteMonthReport,
58 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
59 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
60 HttpServletRequest req) {
61 Result<IPage<AjhWasteMonthReport>> result = new Result<IPage<AjhWasteMonthReport>>();
62 Page<AjhWasteMonthReport> page = new Page<>(pageNo, pageSize);
63 String departId = null;
64 if (StringUtils.isBlank(wasteMonthReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
65 departId = BaseContextHandler.getDeparts();
66 }else{
67 departId = departService.getChildDepartId(wasteMonthReport.getDepartId());
68 }
69 String reportMonth = wasteMonthReport.getReportMonth();
70 IPage<AjhWasteMonthReport> pageList = wasteReportService.queryPageListByMonth(page, departId,reportMonth);
71 result.setSuccess(true);
72 result.setResult(pageList);
73 return result;
74 }
75
76 @AutoLog(value = "危险废物台账年报报表-分页列表查询")
77 @ApiOperation(value="危险废物台账年报报表-分页列表查询", notes="危险废物台账年报报表-分页列表查询")
78 @GetMapping(value = "/queryYearReport")
79 public Result<IPage<AjhWasteYearReport>> queryPageListByYear(AjhWasteYearReport ajhWasteYearReport,
80 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
81 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
82 HttpServletRequest req) {
83 Result<IPage<AjhWasteYearReport>> result = new Result<IPage<AjhWasteYearReport>>();
84 Page<AjhWasteYearReport> page = new Page<AjhWasteYearReport>(pageNo, pageSize);
85
86 String departId = null;
87 if (StringUtils.isBlank(ajhWasteYearReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
88 departId = BaseContextHandler.getDeparts();
89 }else{
90 departId = departService.getChildDepartId(ajhWasteYearReport.getDepartId());
91 }
92 String reportYear = ajhWasteYearReport.getReportYear();
93 if(reportYear==null){
94 reportYear = String.valueOf(Year.now().getValue());
95 }
96 IPage<AjhWasteYearReport> pageList = wasteReportService.queryPageListByYear(page, departId,reportYear);
97 result.setSuccess(true);
98 result.setResult(pageList);
99 return result;
100 }
101 }
1 package com.skua.modules.ajh.controller;
2
3 import java.util.Arrays;
4 import java.util.List;
5 import java.util.Map;
6 import java.io.IOException;
7 import java.io.UnsupportedEncodingException;
8 import java.net.URLDecoder;
9 import javax.servlet.http.HttpServletRequest;
10 import javax.servlet.http.HttpServletResponse;
11
12 import com.skua.core.api.vo.Result;
13 import com.skua.core.aspect.annotation.AutoLog;
14 import com.skua.core.query.QueryGenerator;
15 import com.skua.modules.ajh.entity.AjhWasteYearReport;
16 import com.skua.modules.ajh.service.IAjhWasteYearReportService;
17 import java.util.Date;
18 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
19 import com.baomidou.mybatisplus.core.metadata.IPage;
20 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
21 import lombok.extern.slf4j.Slf4j;
22
23 import org.apache.commons.lang3.StringUtils;
24 import org.jeecgframework.poi.excel.ExcelImportUtil;
25 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
26 import org.jeecgframework.poi.excel.entity.ExportParams;
27 import org.jeecgframework.poi.excel.entity.ImportParams;
28 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
29
30 import org.springframework.beans.factory.annotation.Autowired;
31 import org.springframework.web.bind.annotation.*;
32 import org.springframework.web.multipart.MultipartFile;
33 import org.springframework.web.multipart.MultipartHttpServletRequest;
34 import org.springframework.web.servlet.ModelAndView;
35 import com.alibaba.fastjson.JSON;
36 import io.swagger.annotations.Api;
37 import io.swagger.annotations.ApiOperation;
38
39 /**
40 * 危险废物台账年报报表
41 */
42 @Slf4j
43 @Api(tags="危险废物台账年报报表")
44 @RestController
45 @RequestMapping("/ajh/ajhWasteYearReport")
46 public class AjhWasteYearReportController {
47 @Autowired
48 private IAjhWasteYearReportService ajhWasteYearReportService;
49
50 /**
51 * 分页列表查询
52 * @param ajhWasteYearReport
53 * @param pageNo
54 * @param pageSize
55 * @param req
56 * @return
57 */
58 @AutoLog(value = "危险废物台账年报报表-分页列表查询")
59 @ApiOperation(value="危险废物台账年报报表-分页列表查询", notes="危险废物台账年报报表-分页列表查询")
60 @GetMapping(value = "/list")
61 public Result<IPage<AjhWasteYearReport>> queryPageList(AjhWasteYearReport ajhWasteYearReport,
62 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
63 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
64 HttpServletRequest req) {
65 Result<IPage<AjhWasteYearReport>> result = new Result<IPage<AjhWasteYearReport>>();
66 QueryWrapper<AjhWasteYearReport> queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteYearReport, req.getParameterMap());
67 Page<AjhWasteYearReport> page = new Page<AjhWasteYearReport>(pageNo, pageSize);
68 IPage<AjhWasteYearReport> pageList = ajhWasteYearReportService.page(page, queryWrapper);
69 result.setSuccess(true);
70 result.setResult(pageList);
71 return result;
72 }
73
74 @AutoLog(value = "危险废物台账年报报表-分页列表查询")
75 @ApiOperation(value="危险废物台账年报报表-分页列表查询", notes="危险废物台账年报报表-分页列表查询")
76 @GetMapping(value = "/queryList")
77 public Result<List<AjhWasteYearReport>> queryList(AjhWasteYearReport ajhWasteYearReport) {
78 Result<List<AjhWasteYearReport>> result = new Result<List<AjhWasteYearReport>>();
79 List<AjhWasteYearReport> list = ajhWasteYearReportService.queryList(ajhWasteYearReport);
80 result.setSuccess(true);
81 result.setResult(list);
82 return result;
83 }
84
85 /**
86 * 添加
87 * @param ajhWasteYearReport
88 * @return
89 */
90 @AutoLog(value = "危险废物台账年报报表-添加")
91 @ApiOperation(value="危险废物台账年报报表-添加", notes="危险废物台账年报报表-添加")
92 @PostMapping(value = "/add")
93 public Result<AjhWasteYearReport> add(@RequestBody AjhWasteYearReport ajhWasteYearReport) {
94 Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
95 try {
96 ajhWasteYearReportService.save(ajhWasteYearReport);
97 result.success("添加成功!");
98 } catch (Exception e) {
99 log.error(e.getMessage(),e);
100 result.error500("操作失败");
101 }
102 return result;
103 }
104
105 /**
106 * 编辑
107 * @param ajhWasteYearReport
108 * @return
109 */
110 @AutoLog(value = "危险废物台账年报报表-编辑")
111 @ApiOperation(value="危险废物台账年报报表-编辑", notes="危险废物台账年报报表-编辑")
112 @PutMapping(value = "/edit")
113 public Result<AjhWasteYearReport> edit(@RequestBody AjhWasteYearReport ajhWasteYearReport) {
114 Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
115 AjhWasteYearReport ajhWasteYearReportEntity = ajhWasteYearReportService.getById(ajhWasteYearReport.getId());
116 if(ajhWasteYearReportEntity==null) {
117 result.error500("未找到对应实体");
118 }else {
119 boolean ok = ajhWasteYearReportService.updateById(ajhWasteYearReport);
120 //TODO 返回false说明什么?
121 if(ok) {
122 result.success("修改成功!");
123 }
124 }
125
126 return result;
127 }
128
129 /**
130 * 通过id删除
131 * @param id
132 * @return
133 */
134 @AutoLog(value = "危险废物台账年报报表-通过id删除")
135 @ApiOperation(value="危险废物台账年报报表-通过id删除", notes="危险废物台账年报报表-通过id删除")
136 @DeleteMapping(value = "/delete")
137 public Result<?> delete(@RequestParam(name="id",required=true) String id) {
138 try {
139 ajhWasteYearReportService.removeById(id);
140 } catch (Exception e) {
141 log.error("删除失败",e.getMessage());
142 return Result.error("删除失败!");
143 }
144 return Result.ok("删除成功!");
145 }
146
147 /**
148 * 批量删除
149 * @param ids
150 * @return
151 */
152 @AutoLog(value = "危险废物台账年报报表-批量删除")
153 @ApiOperation(value="危险废物台账年报报表-批量删除", notes="危险废物台账年报报表-批量删除")
154 @DeleteMapping(value = "/deleteBatch")
155 public Result<AjhWasteYearReport> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
156 Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
157 if(ids==null || "".equals(ids.trim())) {
158 result.error500("参数不识别!");
159 }else {
160 this.ajhWasteYearReportService.removeByIds(Arrays.asList(ids.split(",")));
161 result.success("删除成功!");
162 }
163 return result;
164 }
165
166 /**
167 * 通过id查询
168 * @param id
169 * @return
170 */
171 @AutoLog(value = "危险废物台账年报报表-通过id查询")
172 @ApiOperation(value="危险废物台账年报报表-通过id查询", notes="危险废物台账年报报表-通过id查询")
173 @GetMapping(value = "/queryById")
174 public Result<AjhWasteYearReport> queryById(@RequestParam(name="id",required=true) String id) {
175 Result<AjhWasteYearReport> result = new Result<AjhWasteYearReport>();
176 AjhWasteYearReport ajhWasteYearReport = ajhWasteYearReportService.getById(id);
177 if(ajhWasteYearReport==null) {
178 result.error500("未找到对应实体");
179 }else {
180 result.setResult(ajhWasteYearReport);
181 result.setSuccess(true);
182 }
183 return result;
184 }
185
186 /**
187 * 导出excel
188 *
189 * @param request
190 * @param response
191 */
192 @RequestMapping(value = "/exportXls")
193 public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
194 // Step.1 组装查询条件
195 QueryWrapper<AjhWasteYearReport> queryWrapper = null;
196 try {
197 String paramsStr = request.getParameter("paramsStr");
198 if (StringUtils.isNotEmpty(paramsStr)) {
199 String deString = URLDecoder.decode(paramsStr, "UTF-8");
200 AjhWasteYearReport ajhWasteYearReport = JSON.parseObject(deString, AjhWasteYearReport.class);
201 queryWrapper = QueryGenerator.initQueryWrapper(ajhWasteYearReport, request.getParameterMap());
202 }
203 } catch (UnsupportedEncodingException e) {
204 e.printStackTrace();
205 }
206
207 //Step.2 AutoPoi 导出Excel
208 ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
209 List<AjhWasteYearReport> pageList = ajhWasteYearReportService.list(queryWrapper);
210 //导出文件名称
211 mv.addObject(NormalExcelConstants.FILE_NAME, "危险废物台账年报报表列表");
212 mv.addObject(NormalExcelConstants.CLASS, AjhWasteYearReport.class);
213 mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("危险废物台账年报报表列表数据", "导出人:Jeecg", "导出信息"));
214 mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
215 return mv;
216 }
217
218 /**
219 * 通过excel导入数据
220 *
221 * @param request
222 * @param response
223 * @return
224 */
225 @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
226 public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
227 MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
228 Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
229 for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
230 MultipartFile file = entity.getValue();// 获取上传文件对象
231 ImportParams params = new ImportParams();
232 params.setTitleRows(2);
233 params.setHeadRows(1);
234 params.setNeedSave(true);
235 try {
236 List<AjhWasteYearReport> listAjhWasteYearReports = ExcelImportUtil.importExcel(file.getInputStream(), AjhWasteYearReport.class, params);
237 ajhWasteYearReportService.saveBatch(listAjhWasteYearReports);
238 return Result.ok("文件导入成功!数据行数:" + listAjhWasteYearReports.size());
239 } catch (Exception e) {
240 log.error(e.getMessage(),e);
241 return Result.error("文件导入失败:"+e.getMessage());
242 } finally {
243 try {
244 file.getInputStream().close();
245 } catch (IOException e) {
246 e.printStackTrace();
247 }
248 }
249 }
250 return Result.ok("文件导入失败!");
251 }
252
253 }
1 package com.skua.modules.ajh.entity; 1 package com.skua.modules.ajh.entity;
2 2
3 import com.baomidou.mybatisplus.annotation.IdType;
4 import com.baomidou.mybatisplus.annotation.TableId;
5 import com.baomidou.mybatisplus.annotation.TableName;
6 import com.baomidou.mybatisplus.annotation.TableField; 3 import com.baomidou.mybatisplus.annotation.TableField;
7 import com.skua.core.aspect.annotation.Dict; 4 import com.skua.core.aspect.annotation.Dict;
8 import com.skua.core.util.ConvertUtils; 5 import com.skua.core.util.ConvertUtils;
9 import io.swagger.annotations.ApiModel; 6 import io.swagger.annotations.ApiModel;
10 import io.swagger.annotations.ApiModelProperty; 7 import io.swagger.annotations.ApiModelProperty;
11 import lombok.Data; 8 import lombok.Data;
12 import lombok.EqualsAndHashCode;
13 import lombok.experimental.Accessors;
14 import com.fasterxml.jackson.annotation.JsonFormat;
15 import org.apache.commons.lang3.StringUtils; 9 import org.apache.commons.lang3.StringUtils;
16 import org.springframework.format.annotation.DateTimeFormat;
17 import org.jeecgframework.poi.excel.annotation.Excel; 10 import org.jeecgframework.poi.excel.annotation.Excel;
18 11
19 /** 12 /**
20 * 危险废物台账月报报表 13 * 危险废物台账月报报表
21 */ 14 */
22 @Data 15 @Data
23 @TableName("ajh_waste_month_report")
24 @EqualsAndHashCode(callSuper = false)
25 @Accessors(chain = true)
26 @ApiModel(value="ajh_waste_month_report对象", description="危险废物台账月报报表") 16 @ApiModel(value="ajh_waste_month_report对象", description="危险废物台账月报报表")
27 public class AjhWasteMonthReport { 17 public class AjhWasteMonthReport {
28 18
29 /**主键*/ 19 /**主键*/
30 @TableId(type = IdType.ID_WORKER_STR)
31 @ApiModelProperty(value = "主键") 20 @ApiModelProperty(value = "主键")
32 private String id; 21 private String id;
33 /**所属厂区*/ 22 /**所属厂区*/
...@@ -35,6 +24,9 @@ public class AjhWasteMonthReport { ...@@ -35,6 +24,9 @@ public class AjhWasteMonthReport {
35 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") 24 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
36 @ApiModelProperty(value = "所属厂区") 25 @ApiModelProperty(value = "所属厂区")
37 private String departId; 26 private String departId;
27
28 @ApiModelProperty(value = "所属厂区")
29 private String departName;
38 /**月份*/ 30 /**月份*/
39 @Excel(name = "月份", width = 15) 31 @Excel(name = "月份", width = 15)
40 @ApiModelProperty(value = "月份") 32 @ApiModelProperty(value = "月份")
...@@ -64,51 +56,7 @@ public class AjhWasteMonthReport { ...@@ -64,51 +56,7 @@ public class AjhWasteMonthReport {
64 @Excel(name = "贮存量", width = 15) 56 @Excel(name = "贮存量", width = 15)
65 @ApiModelProperty(value = "贮存量") 57 @ApiModelProperty(value = "贮存量")
66 private String monthKeep; 58 private String monthKeep;
67 /**单位名称*/ 59
68 @Excel(name = "单位名称", width = 15)
69 @ApiModelProperty(value = "单位名称")
70 private String reportDept;
71 /**许可证编号*/
72 @Excel(name = "许可证编号", width = 15)
73 @ApiModelProperty(value = "许可证编号")
74 private String reportLicenceCode;
75 /**处置方式*/
76 @Excel(name = "处置方式", width = 15)
77 @ApiModelProperty(value = "处置方式")
78 private String reportDealMethod;
79 /**处置数量*/
80 @Excel(name = "处置数量", width = 15)
81 @ApiModelProperty(value = "处置数量")
82 private String reportDealNumber;
83 /**单位*/
84 @Excel(name = "单位", width = 15)
85 @ApiModelProperty(value = "单位")
86 private String reportDealUnit;
87 /**创建人员*/
88 @ApiModelProperty(value = "创建人员")
89 private String createBy;
90 /**创建时间*/
91 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
92 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
93 @ApiModelProperty(value = "创建时间")
94 private java.util.Date createTime;
95 /**修改人员*/
96 @ApiModelProperty(value = "修改人员")
97 private String updateBy;
98 /**修改时间*/
99 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
100 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
101 @ApiModelProperty(value = "修改时间")
102 private java.util.Date updateTime;
103 /**修改部门*/
104 @ApiModelProperty(value = "修改部门")
105 private String createDept;
106 /**修改集团*/
107 @ApiModelProperty(value = "修改集团")
108 private String createCmpy;
109 /**标识*/
110 @ApiModelProperty(value = "标识")
111 private Integer delFlag;
112 60
113 public String getStockOnHand() { 61 public String getStockOnHand() {
114 //数据之间应进行逻辑验算:期初量+入库量-出库量=在存量。 62 //数据之间应进行逻辑验算:期初量+入库量-出库量=在存量。
......
...@@ -2,6 +2,7 @@ package com.skua.modules.ajh.entity; ...@@ -2,6 +2,7 @@ package com.skua.modules.ajh.entity;
2 2
3 import java.util.Date; 3 import java.util.Date;
4 import com.baomidou.mybatisplus.annotation.IdType; 4 import com.baomidou.mybatisplus.annotation.IdType;
5 import com.baomidou.mybatisplus.annotation.TableField;
5 import com.baomidou.mybatisplus.annotation.TableId; 6 import com.baomidou.mybatisplus.annotation.TableId;
6 import com.baomidou.mybatisplus.annotation.TableName; 7 import com.baomidou.mybatisplus.annotation.TableName;
7 import com.skua.core.aspect.annotation.Dict; 8 import com.skua.core.aspect.annotation.Dict;
...@@ -18,14 +19,12 @@ import org.jeecgframework.poi.excel.annotation.Excel; ...@@ -18,14 +19,12 @@ import org.jeecgframework.poi.excel.annotation.Excel;
18 * 危险废物台账年报报表 19 * 危险废物台账年报报表
19 */ 20 */
20 @Data 21 @Data
21 @TableName("ajh_waste_year_report")
22 @EqualsAndHashCode(callSuper = false) 22 @EqualsAndHashCode(callSuper = false)
23 @Accessors(chain = true) 23 @Accessors(chain = true)
24 @ApiModel(value="ajh_waste_year_report对象", description="危险废物台账年报报表") 24 @ApiModel(value="ajh_waste_year_report对象", description="危险废物台账年报报表")
25 public class AjhWasteYearReport { 25 public class AjhWasteYearReport {
26 26
27 /**主键*/ 27 /**主键*/
28 @TableId(type = IdType.ID_WORKER_STR)
29 @ApiModelProperty(value = "主键") 28 @ApiModelProperty(value = "主键")
30 private String id; 29 private String id;
31 /**所属厂区*/ 30 /**所属厂区*/
...@@ -33,9 +32,12 @@ public class AjhWasteYearReport { ...@@ -33,9 +32,12 @@ public class AjhWasteYearReport {
33 @ApiModelProperty(value = "所属厂区") 32 @ApiModelProperty(value = "所属厂区")
34 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") 33 @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
35 private String departId; 34 private String departId;
35
36 @ApiModelProperty(value = "所属厂区")
37 private String departName;
36 /**月份*/ 38 /**月份*/
37 @Excel(name = "份", width = 15) 39 @Excel(name = "份", width = 15)
38 @ApiModelProperty(value = "份") 40 @ApiModelProperty(value = "份")
39 private String reportYear; 41 private String reportYear;
40 /**废物代码*/ 42 /**废物代码*/
41 @Excel(name = "废物代码", width = 15) 43 @Excel(name = "废物代码", width = 15)
...@@ -53,45 +55,12 @@ public class AjhWasteYearReport { ...@@ -53,45 +55,12 @@ public class AjhWasteYearReport {
53 @Excel(name = "年度贮存量", width = 15) 55 @Excel(name = "年度贮存量", width = 15)
54 @ApiModelProperty(value = "年度贮存量") 56 @ApiModelProperty(value = "年度贮存量")
55 private String yearKeep; 57 private String yearKeep;
56 /**本单位利用量*/ 58
57 @Excel(name = "本单位利用量", width = 15) 59 /**出库量*/
58 @ApiModelProperty(value = "本单位利用量") 60 @TableField(exist=false)
59 private String reportInsideUse; 61 @Excel(name = "出库量", width = 15)
60 /**本单位储存量*/ 62 @ApiModelProperty(value = "出库量")
61 @Excel(name = "本单位储存量", width = 15) 63 private String yearOut;
62 @ApiModelProperty(value = "本单位储存量") 64
63 private String reportInsideKeep; 65
64 /**外单位利用量*/
65 @Excel(name = "外单位利用量", width = 15)
66 @ApiModelProperty(value = "外单位利用量")
67 private String reportOutsideUse;
68 /**外单位储存量*/
69 @Excel(name = "外单位储存量", width = 15)
70 @ApiModelProperty(value = "外单位储存量")
71 private String reportOutsideKeep;
72 /**创建人员*/
73 @ApiModelProperty(value = "创建人员")
74 private String createBy;
75 /**创建时间*/
76 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
77 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
78 @ApiModelProperty(value = "创建时间")
79 private Date createTime;
80 /**修改人员*/
81 @ApiModelProperty(value = "修改人员")
82 private String updateBy;
83 /**修改时间*/
84 @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
85 @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
86 @ApiModelProperty(value = "修改时间")
87 private Date updateTime;
88 /**修改部门*/
89 @ApiModelProperty(value = "修改部门")
90 private String createDept;
91 /**修改集团*/
92 @ApiModelProperty(value = "修改集团")
93 private String createCmpy;
94 /**标识*/
95 @ApiModelProperty(value = "标识")
96 private Integer delFlag;
97 } 66 }
......
1 package com.skua.modules.ajh.mapper;
2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
8
9 /**
10 * 危险废物台账月报报表
11 */
12 public interface AjhWasteMonthReportMapper extends BaseMapper<AjhWasteMonthReport> {
13
14 List<AjhWasteMonthReport> getList(String departId, String reportMonth);
15 }
...@@ -2,6 +2,10 @@ package com.skua.modules.ajh.mapper; ...@@ -2,6 +2,10 @@ package com.skua.modules.ajh.mapper;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
5 import com.baomidou.mybatisplus.core.metadata.IPage;
6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
8 import com.skua.modules.ajh.entity.AjhWasteYearReport;
5 import org.apache.ibatis.annotations.Param; 9 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.ajh.entity.AjhWasteProduce; 10 import com.skua.modules.ajh.entity.AjhWasteProduce;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 11 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -10,5 +14,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -10,5 +14,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
10 * 危废产生记录表 14 * 危废产生记录表
11 */ 15 */
12 public interface AjhWasteProduceMapper extends BaseMapper<AjhWasteProduce> { 16 public interface AjhWasteProduceMapper extends BaseMapper<AjhWasteProduce> {
17 /***
18 * 月报
19 * @param page
20 * @param
21 * @return
22 */
23 IPage<AjhWasteMonthReport> queryPageListByMonth(Page<AjhWasteMonthReport> page,@Param("departId") String departId,@Param("reportMonth")String reportMonth);
13 24
25 /**
26 * 年报
27 * @param page
28 * @param
29 * @return
30 */
31 IPage<AjhWasteYearReport> queryPageListByYear(Page<AjhWasteYearReport> page,@Param("departId") String departId,@Param("reportYear")String reportYear);
14 } 32 }
......
1 package com.skua.modules.ajh.mapper;
2
3 import java.util.List;
4
5 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.ajh.entity.AjhWasteYearReport;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
8
9 /**
10 * 危险废物台账年报报表
11 */
12 public interface AjhWasteYearReportMapper extends BaseMapper<AjhWasteYearReport> {
13
14 List<AjhWasteYearReport> queryList(String departId, String reportYear);
15 }
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.ajh.mapper.AjhWasteMonthReportMapper">
4
5 <select id="getList" resultType="com.skua.modules.ajh.entity.AjhWasteMonthReport">
6 SELECT
7 p.id,
8 p.waste_code,
9 p.waste_name,
10 LEFT ( p.pro_out_date, 7 ) AS report_month,
11 ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS month_produce,
12 ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS month_out,
13 ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS month_keep,
14
15 d.depart_name AS depart_id
16 FROM
17 ajh_waste_produce p
18 LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE 1=1
19
20 <if test="reportMonth!=null and reportMonth!=''">
21 and LEFT ( keep_in_date, 7 ) = #{reportMonth}
22 </if>
23
24 ) k ON p.depart_id = k.depart_id
25 AND p.waste_code = k.waste_code
26 AND p.waste_name = k.waste_name
27 LEFT JOIN sys_depart d ON p.depart_id = d.id
28 WHERE
29 1=1
30 <if test="reportMonth!=null and reportMonth!=''">
31 and LEFT ( p.pro_out_date, 7 ) = #{reportMonth}
32 </if>
33 <if test="departId!=null and departId!=''">
34 and p.depart_id in
35 <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
36 '${item}'
37 </foreach>
38 </if>
39 GROUP BY
40 p.depart_id,
41 p.waste_code,
42 p.waste_name
43 </select>
44
45 </mapper>
...@@ -2,4 +2,78 @@ ...@@ -2,4 +2,78 @@
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.ajh.mapper.AjhWasteProduceMapper"> 3 <mapper namespace="com.skua.modules.ajh.mapper.AjhWasteProduceMapper">
4 4
5 </mapper>
...\ No newline at end of file ...\ No newline at end of file
5
6 <!-- 月报-->
7 <select id="queryPageListByMonth" resultType="com.skua.modules.ajh.entity.AjhWasteMonthReport">
8 SELECT
9 p.id,
10 p.waste_code,
11 p.waste_name,
12 LEFT ( p.pro_out_date, 7 ) AS report_month,
13 ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS month_produce,
14 ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS month_out,
15 ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS month_keep,
16 d.depart_name AS depart_name,
17 d.id as depart_id
18 FROM
19 ajh_waste_produce p
20 LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE 1=1
21
22 <if test="reportMonth!=null and reportMonth!=''">
23 and LEFT ( keep_in_date, 7 ) = #{reportMonth}
24 </if>
25
26 ) k ON p.depart_id = k.depart_id
27 AND p.waste_code = k.waste_code
28 AND p.waste_name = k.waste_name
29 LEFT JOIN sys_depart d ON p.depart_id = d.id
30 WHERE
31 1=1
32 <if test="reportMonth!=null and reportMonth!=''">
33 and LEFT ( p.pro_out_date, 7 ) = #{reportMonth}
34 </if>
35 <if test="departId!=null and departId!=''">
36 and p.depart_id in
37 <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
38 '${item}'
39 </foreach>
40 </if>
41 GROUP BY
42 p.depart_id,
43 p.waste_code,
44 p.waste_name
45 </select>
46
47
48
49 <select id="queryPageListByYear" resultType="com.skua.modules.ajh.entity.AjhWasteYearReport">
50 SELECT
51 p.id,
52 p.waste_code,
53 p.waste_name,
54 LEFT ( p.pro_out_date, 4 ) AS report_year,
55 ROUND(ifnull(SUM( p.pro_come_count ),0) , 2) AS year_produce,
56 ROUND(ifnull(SUM( p.pro_out_count ),0) , 2) AS year_out,
57 ROUND(ifnull(SUM( k.keep_in_count ),0) , 2) AS year_keep,
58 d.depart_name AS depart_name,
59 d.id as depart_id
60 FROM
61 ajh_waste_produce p
62 LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE LEFT ( keep_in_date, 4 ) = #{reportYear} ) k ON p.depart_id = k.depart_id
63 AND p.waste_code = k.waste_code
64 AND p.waste_name = k.waste_name
65 LEFT JOIN sys_depart d ON p.depart_id = d.id
66 WHERE
67 LEFT ( p.pro_out_date, 4 ) = #{reportYear}
68 <if test="departId!=null and departId!=''">
69 and p.depart_id in
70 <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
71 '${item}'
72 </foreach>
73 </if>
74 GROUP BY
75 p.depart_id,
76 p.waste_code,
77 p.waste_name
78 </select>
79 </mapper>
......
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.ajh.mapper.AjhWasteYearReportMapper">
4
5 <select id="queryList" resultType="com.skua.modules.ajh.entity.AjhWasteYearReport">
6 SELECT
7 p.id,
8 p.waste_code,
9 p.waste_name,
10 LEFT ( p.pro_out_date, 4 ) AS report_year,
11 ROUND( SUM( p.pro_come_count ), 2 ) AS year_produce,
12 ROUND( SUM( k.keep_in_count ), 2 ) AS year_keep,
13 d.depart_name AS depart_id
14 FROM
15 ajh_waste_produce p
16 LEFT JOIN ( SELECT * FROM ajh_waste_keep WHERE LEFT ( keep_in_date, 4 ) = #{reportYear} ) k ON p.depart_id = k.depart_id
17 AND p.waste_code = k.waste_code
18 AND p.waste_name = k.waste_name
19 LEFT JOIN sys_depart d ON p.depart_id = d.id
20 WHERE
21 LEFT ( p.pro_out_date, 4 ) = #{reportYear}
22 <if test="departId!=null and departId!=''">
23 and p.depart_id in
24 <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
25 '${item}'
26 </foreach>
27 </if>
28 GROUP BY
29 p.depart_id,
30 p.waste_code,
31 p.waste_name
32 </select>
33
34 </mapper>
1 package com.skua.modules.ajh.service;
2
3 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
4 import com.baomidou.mybatisplus.extension.service.IService;
5
6 import java.util.List;
7
8 /**
9 * 危险废物台账月报报表
10 */
11 public interface IAjhWasteMonthReportService extends IService<AjhWasteMonthReport> {
12
13 List<AjhWasteMonthReport> getList(AjhWasteMonthReport ajhWasteMonthReport);
14 }
1 package com.skua.modules.ajh.service;
2
3 import com.baomidou.mybatisplus.core.metadata.IPage;
4 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
6 import com.skua.modules.ajh.entity.AjhWasteYearReport;
7 /**
8 * @auther kangwei
9 * @create 2025-01-09-11:10
10 */
11 public interface IAjhWasteReportService {
12
13 /***
14 * 月报
15 * @param page
16 * @param
17 * @return
18 */
19 IPage<AjhWasteMonthReport> queryPageListByMonth(Page<AjhWasteMonthReport> page,String departId,String reportMonth);
20
21 /***
22 * 年报
23 * @param page
24 * @param
25 * @return
26 */
27 IPage<AjhWasteYearReport> queryPageListByYear(Page<AjhWasteYearReport> page,String departId,String reportMonth);
28 }
1 package com.skua.modules.ajh.service;
2
3 import com.skua.modules.ajh.entity.AjhWasteYearReport;
4 import com.baomidou.mybatisplus.extension.service.IService;
5
6 import java.util.List;
7
8 /**
9 * 危险废物台账年报报表
10 */
11 public interface IAjhWasteYearReportService extends IService<AjhWasteYearReport> {
12
13 List<AjhWasteYearReport> queryList(AjhWasteYearReport ajhWasteYearReport);
14 }
1 package com.skua.modules.ajh.service.impl;
2
3 import com.skua.core.context.BaseContextHandler;
4 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
5 import com.skua.modules.ajh.mapper.AjhWasteMonthReportMapper;
6 import com.skua.modules.ajh.service.IAjhWasteMonthReportService;
7 import com.skua.modules.system.service.ISysDepartService;
8 import org.apache.commons.lang3.StringUtils;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
13
14 import javax.annotation.Resource;
15 import java.text.SimpleDateFormat;
16 import java.util.ArrayList;
17 import java.util.Date;
18 import java.util.List;
19
20 /**
21 * 危险废物台账月报报表
22 */
23 @Service
24 public class AjhWasteMonthReportServiceImpl extends ServiceImpl<AjhWasteMonthReportMapper, AjhWasteMonthReport> implements IAjhWasteMonthReportService {
25
26 @Autowired
27 private AjhWasteMonthReportMapper ajhWasteMonthReportMapper;
28 @Resource
29 private ISysDepartService departService;
30
31 @Override
32 public List<AjhWasteMonthReport> getList(AjhWasteMonthReport ajhWasteMonthReport) {
33 List<AjhWasteMonthReport> list = new ArrayList<>();
34 String departId = null;
35 if (StringUtils.isBlank(ajhWasteMonthReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
36 departId = BaseContextHandler.getDeparts();
37 }else{
38 departId = departService.getChildDepartId(ajhWasteMonthReport.getDepartId());
39 }
40 String reportMonth = ajhWasteMonthReport.getReportMonth();
41 // if(reportMonth == null){
42 // SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
43 // reportMonth = dateFormat.format(new Date());
44 // }
45 list = ajhWasteMonthReportMapper.getList(departId,reportMonth);
46 return list;
47 }
48 }
1 package com.skua.modules.ajh.service.impl;
2
3 import com.baomidou.mybatisplus.core.metadata.IPage;
4 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 import com.skua.modules.ajh.entity.AjhWasteMonthReport;
6 import com.skua.modules.ajh.entity.AjhWasteYearReport;
7 import com.skua.modules.ajh.mapper.AjhWasteProduceMapper;
8 import com.skua.modules.ajh.service.IAjhWasteReportService;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 /**
13 * @auther kangwei
14 * @create 2025-01-09-11:17
15 */
16 @Service
17 public class AjhWasteReportServiceImpl implements IAjhWasteReportService {
18
19 @Autowired
20 private AjhWasteProduceMapper wasteProduceMapper;
21 /***
22 * 月报
23 * @param page
24 * @param
25 * @return
26 */
27 public IPage<AjhWasteMonthReport> queryPageListByMonth(Page<AjhWasteMonthReport> page, String departId,String reportMonth){
28 return wasteProduceMapper.queryPageListByMonth(page,departId, reportMonth);
29 }
30
31 /***
32 * 年报
33 * @param page
34 * @param
35 * @return
36 */
37 public IPage<AjhWasteYearReport> queryPageListByYear(Page<AjhWasteYearReport> page, String departId,String reportYear){
38 return wasteProduceMapper.queryPageListByYear(page,departId, reportYear);
39 }
40 }
1 package com.skua.modules.ajh.service.impl;
2
3 import com.skua.core.context.BaseContextHandler;
4 import com.skua.modules.ajh.entity.AjhWasteYearReport;
5 import com.skua.modules.ajh.mapper.AjhWasteYearReportMapper;
6 import com.skua.modules.ajh.service.IAjhWasteYearReportService;
7 import com.skua.modules.system.service.ISysDepartService;
8 import org.apache.commons.lang3.StringUtils;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service;
11
12 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
13
14 import javax.annotation.Resource;
15 import java.time.Year;
16 import java.util.ArrayList;
17 import java.util.List;
18
19 /**
20 * 危险废物台账年报报表
21 */
22 @Service
23 public class AjhWasteYearReportServiceImpl extends ServiceImpl<AjhWasteYearReportMapper, AjhWasteYearReport> implements IAjhWasteYearReportService {
24
25 @Autowired
26 private AjhWasteYearReportMapper ajhWasteYearReportMapper;
27 @Resource
28 private ISysDepartService departService;
29
30 @Override
31 public List<AjhWasteYearReport> queryList(AjhWasteYearReport ajhWasteYearReport) {
32 List<AjhWasteYearReport> list = new ArrayList<>();
33 String departId = null;
34 if (StringUtils.isBlank(ajhWasteYearReport.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
35 departId = BaseContextHandler.getDeparts();
36 }else{
37 departId = departService.getChildDepartId(ajhWasteYearReport.getDepartId());
38 }
39 String reportYear = ajhWasteYearReport.getReportYear();
40 if(reportYear==null){
41 reportYear = String.valueOf(Year.now().getValue());
42 }
43 list = ajhWasteYearReportMapper.queryList(departId,reportYear);
44 return list;
45 }
46 }
1 package com.skua.modules.ajh.vo;
2
3 import com.skua.core.aspect.annotation.Dict;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6 import lombok.EqualsAndHashCode;
7 import org.jeecgframework.poi.excel.annotation.Excel;
8
9 /**
10 * @auther kangwei
11 * @create 2025-01-09-11:50
12 */
13 @Data
14 public class AjhWasteReportSearchVO {
15 @Excel(name = "所属厂区", width = 15)
16 @ApiModelProperty(value = "所属厂区")
17 private String departId;
18
19 @Excel(name = "月份", width = 15)
20 @ApiModelProperty(value = "月份")
21 private String reportMonth;
22 /**月份*/
23 @Excel(name = "年份", width = 15)
24 @ApiModelProperty(value = "年份")
25 private String reportYear;
26
27
28 }
...@@ -5,6 +5,7 @@ import java.util.List; ...@@ -5,6 +5,7 @@ import java.util.List;
5 import com.baomidou.mybatisplus.core.metadata.IPage; 5 import com.baomidou.mybatisplus.core.metadata.IPage;
6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7 import com.skua.modules.edu.entity.QuestionDB; 7 import com.skua.modules.edu.entity.QuestionDB;
8 import com.skua.tool.annotation.Anonymous;
8 import org.apache.ibatis.annotations.Param; 9 import org.apache.ibatis.annotations.Param;
9 import com.skua.modules.edu.entity.Question; 10 import com.skua.modules.edu.entity.Question;
10 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 11 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -42,6 +43,7 @@ public interface QuestionMapper extends BaseMapper<Question> { ...@@ -42,6 +43,7 @@ public interface QuestionMapper extends BaseMapper<Question> {
42 * @param eduQuestion 在线考试--试题 43 * @param eduQuestion 在线考试--试题
43 * @return 在线考试--试题集合 44 * @return 在线考试--试题集合
44 */ 45 */
46 @Anonymous
45 public List<Question> selectQuestionList(Question eduQuestion); 47 public List<Question> selectQuestionList(Question eduQuestion);
46 48
47 /** 49 /**
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!