Explorar el Código

1.安全信息文件管理

zhangym hace 2 años
padre
commit
41848d6d8f

+ 204 - 169
src/main/java/com/steerinfo/ems/emssafeinfo/controller/EmsSafeinfoController.java

@@ -3,40 +3,42 @@ package com.steerinfo.ems.emssafeinfo.controller;
 import com.steerinfo.auth.utils.JwtUtil;
 import com.steerinfo.ems.Utils.DateUtils;
 import com.steerinfo.ems.emssafeinfo.mapper.EmsSafeinfoMapper;
-import com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo;
-import com.steerinfo.ems.emssafeinfo.service.IEmsSafeinfoService;
 import com.steerinfo.framework.controller.BaseRESTfulController;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import com.steerinfo.framework.utils.collection.ListUtils;
-import com.steerinfo.framework.utils.text.Charsets;
+import com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo;
+import com.steerinfo.ems.emssafeinfo.service.IEmsSafeinfoService;
 import com.steerinfo.ftp.uploadfile.utils.IDutils;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.commons.io.Charsets;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.net.URLEncoder;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.math.BigDecimal;
 
 /**
  * EmsSafeinfo RESTful接口:
  * @author generator
- * @version 1.0-SNAPSHORT 2023-04-24 10:51
+ * @version 1.0-SNAPSHORT 2023-05-15 10:07
  * 类描述
  * 修订历史:
- * 日期:2023-04-24
+ * 日期:2023-05-15
  * 作者:generator
  * 参考:
  * 描述:EmsSafeinfo RESTful接口
@@ -52,7 +54,6 @@ public class EmsSafeinfoController extends BaseRESTfulController {
 
     @Autowired
     EmsSafeinfoMapper emsSafeinfoMapper;
-
     @ApiOperation(value="获取列表", notes="分页查询")
     @ApiImplicitParams({
         @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
@@ -61,7 +62,7 @@ public class EmsSafeinfoController extends BaseRESTfulController {
     //@RequiresPermissions("emssafeinfo:view")
     @GetMapping(value = "/")
     public RESTfulResult list(@RequestParam HashMap parmas,Integer pageNum, Integer pageSize){
-        HashMap<String,Object> hashMap = new HashMap<>();
+//        HashMap<String,Object> hashMap = new HashMap<>();
         String[] arr= null;
         String[] arr2= null;
         String dates=null;
@@ -70,13 +71,12 @@ public class EmsSafeinfoController extends BaseRESTfulController {
             arr =parmas.get("process").toString().split(",");
         }
 
-        if (parmas.get("type")!=null){
-            arr2 =parmas.get("type").toString().split(",");
-
-        }
         if (parmas.get("dates")!=null && parmas.get("dates2")!=null){
-             dates=parmas.get("dates").toString();
-             dates2 = parmas.get("dates2").toString();
+            dates=parmas.get("dates").toString();
+            dates2 = parmas.get("dates2").toString();
+        }
+        if (parmas.get("hazard")!=null ){
+            arr2=parmas.get("hazard").toString().split(",");
         }
         PageList<EmsSafeinfo> list = emsSafeinfoService.queryForPage2(dates,dates2,arr2,arr, pageNum, pageSize);
         return success(list);
@@ -102,7 +102,7 @@ public class EmsSafeinfoController extends BaseRESTfulController {
 
         String selectmaxid = emsSafeinfoMapper.selectmaxid();
         if(selectmaxid == null){
-            String qqq="AQ"+DateUtils.getCurrentTime("yyyyMMdd")+"0001";
+            String qqq="AQ"+ DateUtils.getCurrentTime("yyyyMMdd")+"0001";
             model.setId(qqq);
         }else {
             String id1 = selectmaxid.substring(10,14);
@@ -112,45 +112,42 @@ public class EmsSafeinfoController extends BaseRESTfulController {
             String  newmaxid ="AQ"+DateUtils.getCurrentTime("yyyyMMdd")+ String.format("%04d", maxid2);
             model.setId(newmaxid);
         }
-
-        model.setCreatetime(DateUtils.getCurrentTime("yyyy-MM-dd HH:mm:ss"));
-        model.setCreateman(JwtUtil.getUseridByToken());
+        model.setDates(DateUtils.getCurrentTime("yyyy-MM-dd"));
+//        model.setCreateman(JwtUtil.getUseridByToken());
         EmsSafeinfo emsSafeinfo = emsSafeinfoService.add(model);
         return success(emsSafeinfo);
     }
 
     @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
-    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("emssafeinfo:view")
     @GetMapping(value = "/{id}")
-    public RESTfulResult get(@PathVariable Short id){
+    public RESTfulResult get(@PathVariable String id){
         EmsSafeinfo emsSafeinfo = emsSafeinfoService.getById(id);
         return success(emsSafeinfo);
     }
 
     @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的emsSafeinfo信息来更新详细信息")
     @ApiImplicitParams({
-        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short"),
+        @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String"),
         @ApiImplicitParam(name = "emsSafeinfo", value = "详细实体emsSafeinfo", required = true, dataType = "EmsSafeinfo")
     })
     //@RequiresPermissions("emssafeinfo:update")
     @PutMapping(value = "/{id}", produces  = "application/json;charset=UTF-8")
     public RESTfulResult update(@PathVariable String id, @RequestBody EmsSafeinfo model){
         model.setId(id);
-        model.setUpdateman(DateUtils.getCurrentTime("yyyy-MM-dd HH:mm:ss"));
-        model.setUpdatetime(JwtUtil.getUseridByToken());
         EmsSafeinfo emsSafeinfo = emsSafeinfoService.modify(model);
         return success(emsSafeinfo);
     }
 
     @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
-    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
+    @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "String")
     //@RequiresPermissions("emssafeinfo:delete")
-    @DeleteMapping(value = "/{id}")//Short
+    @DeleteMapping(value = "/{id}")//String
     public RESTfulResult delete(@PathVariable String id){
     	List<String> list = Arrays.asList(id.split(","));
     	if(ListUtils.isNotEmpty(list)) {
-	    	List<Short> ids = ListUtils.convertList(list);
+	    	List<String> ids = ListUtils.convertList(list);
 			  emsSafeinfoService.delete(ids);
     	}
       return success();
@@ -160,143 +157,182 @@ public class EmsSafeinfoController extends BaseRESTfulController {
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
     @PostMapping("/insertExcel")
     public RESTfulResult insertExcel (String fileName, MultipartFile file) throws Exception {
-        RESTfulResult R = new RESTfulResult();
         List<EmsSafeinfo> list = emsSafeinfoService.batchImport(fileName, file);
         List<EmsSafeinfo> list2 = new ArrayList<>();
+        EmsSafeinfo res = null;
         for (EmsSafeinfo e: list
-             ) {
-             e.setId("AQ"+IDutils.getImageName());
-             e.setCreateman(JwtUtil.getUseridByToken());
-             e.setCreatetime(DateUtils.getCurrentTime("yyyy-MM-dd HH:mm:ss"));
-            list2.add(e);
+        ) {
+            String selectmaxid = emsSafeinfoMapper.selectmaxid();
+            if(selectmaxid == null){
+                String qqq="AQ"+ DateUtils.getCurrentTime("yyyyMMdd")+"0001";
+                e.setId(qqq);
+            }else {
+                String id1 = selectmaxid.substring(10,14);
+
+                int maxid = Integer.parseInt(id1);
+                int maxid2=maxid+1;
+                String  newmaxid ="AQ"+DateUtils.getCurrentTime("yyyyMMdd")+ String.format("%04d", maxid2);
+                e.setId(newmaxid);
+            }
+            res= emsSafeinfoService.add(e);
+
+//            e.setCreateman(JwtUtil.getUseridByToken());
+//            e.setCreatetime(DateUtils.getCurrentTime("yyyy-MM-dd HH:mm:ss"));
+
         }
-        int res = emsSafeinfoService.batchAdd(list2);
-        if (res>0){
-            R.setCode("200");
-            return  success(R);
+        if (res!=null){
+            return  success();
         }else {
             return failed();
         }
 
     }
     @GetMapping("/downloadExcel")
-    public void downloadExcel(HttpServletResponse response,@RequestParam HashMap parmas) throws IOException {
-        List<EmsSafeinfo> list = emsSafeinfoService.getList(parmas);
+    public void downloadExcel(HttpServletResponse response, @RequestParam HashMap parmas) throws IOException {
+        String[] arr= null;
+        String[] arr2= null;
+        String dates=null;
+        String dates2=null;
+        if (parmas.get("process")!=null){
+            arr =parmas.get("process").toString().split(",");
+        }
+
+        if (parmas.get("dates")!=null && parmas.get("dates2")!=null){
+            dates=parmas.get("dates").toString();
+            dates2 = parmas.get("dates2").toString();
+        }
+        if (parmas.get("hazard")!=null ){
+            arr2=parmas.get("hazard").toString().split(",");
+        }
+        List<EmsSafeinfo> list = emsSafeinfoMapper.selectByParameters2( dates, dates2, arr2,arr);
 
-                if (list.size()>0){
-                    OutputStream out = null;
-                    InputStream is = null;
-                    //创建Excel文件
-                    Workbook wb = new XSSFWorkbook();
-                    //生成sheet
-                    Sheet sheet = wb.createSheet("sheet1");
-                    //创建行
-                    Row row = null;
-                    //创建列
-                    Cell cell = null;
-                    //创建表头单元格样式
-                    CellStyle cs_header = wb.createCellStyle();
-                    //设置字体样式
-                    Font boldFont = wb.createFont();
-                    //设置文字类型
-                    boldFont.setFontName("宋体");
-                    //设置加粗
-                    boldFont.setBold(true);
-                    //设置文字大小
-                    boldFont.setFontHeightInPoints((short) 16);
-                    //应用设置的字体
-                    cs_header.setFont(boldFont);
-                    //设置边框下、左、右、上
-                    cs_header.setBorderBottom(BorderStyle.THIN);
-                    cs_header.setBorderLeft(BorderStyle.THIN);
-                    cs_header.setBorderRight(BorderStyle.THIN);
-                    cs_header.setBorderTop(BorderStyle.THIN);
-                    //水平居中
-                    cs_header.setAlignment(HorizontalAlignment.CENTER);
-                    //垂直居中
-                    cs_header.setVerticalAlignment(VerticalAlignment.CENTER);
-                    //前景填充色
-                    cs_header.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.index);
-                    //设置前景填充样式
-                    cs_header.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-                    //设置标题
-                    row = sheet.createRow(0);
-                    //设置单元格行高
-                    row.setHeightInPoints(24);
-                    //设置标题
-                    String[] headers=new String[]{
-                            "日期","类型","地点","ID","内容","创建时间","创建人","修改时间","修改人","备注"
-                    };
-                    //逐个设置标题样式
-                    for (int i = 0; i < headers.length; i++) {
-                        //创建单元格
-                        cell = row.createCell(i);
-                        //设置单元格内容
-                        cell.setCellValue(headers[i]);
-                        //设置单元格样式
-                        cell.setCellStyle(cs_header);
-                    }
-                    //创建文本单元格样式
-                    CellStyle cs_text = wb.createCellStyle();
-                    //创建文字设置
-                    Font textFont = wb.createFont();
-                    //设置文字类型
-                    textFont.setFontName("Consolas");
-                    //设置文字大小
-                    textFont.setFontHeightInPoints((short) 10);
-                    //应用设置
-                    cs_text.setFont(textFont);
-                    //设置边框
-                    cs_text.setBorderBottom(BorderStyle.THIN);
-                    cs_text.setBorderLeft(BorderStyle.THIN);
-                    cs_text.setBorderRight(BorderStyle.THIN);
-                    cs_text.setBorderTop(BorderStyle.THIN);
-                    //水平居中
-                    cs_text.setAlignment(HorizontalAlignment.CENTER);
-                    //垂直居中
-                    cs_text.setVerticalAlignment(VerticalAlignment.CENTER);
-                    //调取数据
+        if (list.size()>0){
+            OutputStream out = null;
+            InputStream is = null;
+            //创建Excel文件
+            Workbook wb = new XSSFWorkbook();
+            //生成sheet
+            Sheet sheet = wb.createSheet("sheet1");
+            //创建行
+            Row row = null;
+            //创建列
+            Cell cell = null;
+            //创建表头单元格样式
+            CellStyle cs_header = wb.createCellStyle();
+            //设置字体样式
+            Font boldFont = wb.createFont();
+            //设置文字类型
+            boldFont.setFontName("宋体");
+            //设置加粗
+            boldFont.setBold(true);
+            //设置文字大小
+            boldFont.setFontHeightInPoints((short) 16);
+            //应用设置的字体
+            cs_header.setFont(boldFont);
+            //设置边框下、左、右、上
+            cs_header.setBorderBottom(BorderStyle.THIN);
+            cs_header.setBorderLeft(BorderStyle.THIN);
+            cs_header.setBorderRight(BorderStyle.THIN);
+            cs_header.setBorderTop(BorderStyle.THIN);
+            //水平居中
+            cs_header.setAlignment(HorizontalAlignment.CENTER);
+            //垂直居中
+            cs_header.setVerticalAlignment(VerticalAlignment.CENTER);
+            //前景填充色
+            cs_header.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.index);
+            //设置前景填充样式
+            cs_header.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+            //设置标题
+            row = sheet.createRow(0);
+            //设置单元格行高
+            row.setHeightInPoints(24);
+            //设置标题
+            String[] headers=new String[]{
+                    "检查日期","被查单位","ID","隐患内容","检查人","整改措施","整改期限","整改责任人","整改结果","整改日期","验证人","资金","预案","隐患分级","备注"
+                    //"日期","类型","地点","ID","内容","创建时间","创建人","修改时间","修改人","备注"
+            };
+            //逐个设置标题样式
+            for (int i = 0; i < headers.length; i++) {
+                //创建单元格
+                cell = row.createCell(i);
+                //设置单元格内容
+                cell.setCellValue(headers[i]);
+                //设置单元格样式
+                cell.setCellStyle(cs_header);
+            }
+            //创建文本单元格样式
+            CellStyle cs_text = wb.createCellStyle();
+            //创建文字设置
+            Font textFont = wb.createFont();
+            //设置文字类型
+            textFont.setFontName("Consolas");
+            //设置文字大小
+            textFont.setFontHeightInPoints((short) 10);
+            //应用设置
+            cs_text.setFont(textFont);
+            //设置边框
+            cs_text.setBorderBottom(BorderStyle.THIN);
+            cs_text.setBorderLeft(BorderStyle.THIN);
+            cs_text.setBorderRight(BorderStyle.THIN);
+            cs_text.setBorderTop(BorderStyle.THIN);
+            //水平居中
+            cs_text.setAlignment(HorizontalAlignment.CENTER);
+            //垂直居中
+            cs_text.setVerticalAlignment(VerticalAlignment.CENTER);
+            //调取数据
 
-                    //记录总共多少列(由于接口查询出来的实体类集合,所以不好循环,使用)
-                    Integer cellSum = 10;
-                    //将数据写入表格
-                    for(int i=0; i<list.size(); i++){
-                        //将实体类集合转成string数组,通过‘,’,获取总共多少列
+            //记录总共多少列(由于接口查询出来的实体类集合,所以不好循环,使用)
+            Integer cellSum = 15;
+            //将数据写入表格
+            for(int i=0; i<list.size(); i++){
+                //将实体类集合转成string数组,通过‘,’,获取总共多少列
 //                        String[] split = list.get(i).toString().split(",");
 //                        cellSum=split.length;
-                        //创建行,由于0行是标题,所以+1
-                        row = sheet.createRow(i+1);
-                        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
-                        //实体类集合不太好循环,所以逐一设置,如果是其他则可使用for循环
-                        EmsSafeinfo wpa = (EmsSafeinfo) list.get(i);
-                        row.createCell(0).setCellValue(wpa.getDates()!=null?wpa.getDates():df.format(Calendar.getInstance().getTime()));
-                        row.createCell(1).setCellValue(wpa.getType()!=null?wpa.getType():"暂无");
-                        row.createCell(2).setCellValue(wpa.getProcess()!=null?wpa.getProcess():"暂无");
-                        row.createCell(3).setCellValue(wpa.getId()!=null?wpa.getId():"暂无");
-                        row.createCell(4).setCellValue(wpa.getContent()!=null?wpa.getContent():"暂无");
-                        row.createCell(5).setCellValue(wpa.getCreatetime()!=null?wpa.getCreatetime():"暂无");
-                        row.createCell(6).setCellValue(wpa.getCreateman()!=null?wpa.getCreateman():"暂无");
-                        row.createCell(7).setCellValue(wpa.getUpdatetime()!=null?wpa.getUpdatetime():"暂无");
-                        row.createCell(8).setCellValue(wpa.getUpdateman()!=null?wpa.getUpdateman():"暂无");
-                        row.createCell(9).setCellValue(wpa.getMemo()!=null?wpa.getMemo():"暂无");
-                        //为每一个单元格设置样式
-                        for (int j=0;j<cellSum;j++){
-                            row.getCell(j).setCellStyle(cs_text);
-                        }
-                    }
-                    //合并单元格,横向
-                    sheet.addMergedRegionUnsafe(new CellRangeAddress(0, 0, 11, 12));
-                    sheet.addMergedRegionUnsafe(new CellRangeAddress(1,1,3,4));
-                    //竖着合并
-                    sheet.addMergedRegionUnsafe(new CellRangeAddress(1,list.size(),4,4));
-                    //设置单元格宽度自适应
-                    for (int i = 0; i <= cellSum; i++)
-                    {
-                        sheet.autoSizeColumn((short)i,true); //自动调整列宽
-                    }
-                    //设置中文文件名称
-                    int year = Calendar.getInstance().get(Calendar.YEAR);
-                    String fileName = year+"";
+                //创建行,由于0行是标题,所以+1
+                row = sheet.createRow(i+1);
+                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
+                //实体类集合不太好循环,所以逐一设置,如果是其他则可使用for循环
+                EmsSafeinfo wpa = (EmsSafeinfo) list.get(i);
+                if (wpa.getMoney()== null ||wpa.getMoney().equals("")){
+                    wpa.setMoney(new BigDecimal(0));
+                }
+                row.createCell(0).setCellValue(wpa.getCreatetime()!=null?wpa.getCreatetime():"检查日期");
+                row.createCell(1).setCellValue(wpa.getProcess()!=null?wpa.getProcess():"被查单位");
+                row.createCell(2).setCellValue(wpa.getId()!=null?wpa.getId():"ID");
+                row.createCell(3).setCellValue(wpa.getContent()!=null?wpa.getContent():"隐患内容");
+                row.createCell(4).setCellValue(wpa.getCreateman()!=null?wpa.getCreateman():"检查人");
+                row.createCell(5).setCellValue(wpa.getMeasure()!=null?wpa.getMeasure():"整改措施");
+                row.createCell(6).setCellValue(wpa.getUpdatetime()!=null?wpa.getUpdatetime():"整改期限");
+                row.createCell(7).setCellValue(wpa.getUpdateman()!=null?wpa.getUpdateman():"整改责任人");
+                row.createCell(8).setCellValue(wpa.getFilename()!=null?wpa.getFilename():"整改结果");
+                row.createCell(9).setCellValue(wpa.getRectificationdate()!=null?wpa.getRectificationdate():"整改日期");
+                row.createCell(10).setCellValue(wpa.getVerify()!=null?wpa.getVerify():"验证人");
+                row.createCell(11).setCellValue(wpa.getMoney().toString()!=null?wpa.getMoney().toString():"资金");
+                row.createCell(12).setCellValue(wpa.getPlan()!=null?wpa.getPlan():"预案");
+                row.createCell(13).setCellValue(wpa.getHazard()!=null?wpa.getHazard():"隐患分级");
+                row.createCell(14).setCellValue(wpa.getMemo()!=null?wpa.getMemo():"备注");
+
+
+
+
+                //为每一个单元格设置样式
+                for (int j=0;j<cellSum;j++){
+                    row.getCell(j).setCellStyle(cs_text);
+                }
+            }
+            //合并单元格,横向
+          //  sheet.addMergedRegionUnsafe(new CellRangeAddress(0, 0, 11, 12));
+         //   sheet.addMergedRegionUnsafe(new CellRangeAddress(1,1,3,4));
+            //竖着合并
+            //sheet.addMergedRegionUnsafe(new CellRangeAddress(1,list.size(),4,4));
+            //设置单元格宽度自适应
+            for (int i = 0; i <= cellSum; i++)
+            {
+                sheet.autoSizeColumn((short)i,true); //自动调整列宽
+            }
+            //设置中文文件名称
+            int year = Calendar.getInstance().get(Calendar.YEAR);
+            String fileName = year+"";
 //                    response.reset();
 //                    //浏览器默认服务器传过去的是html,不是excel文件
 //                    //设置响应类型:传输内容是流,并支持中文
@@ -307,25 +343,24 @@ public class EmsSafeinfoController extends BaseRESTfulController {
 //                    //输出流对象
 //                    wb.write(out);
 //                    wb.close();
-                    String transferName = new String(fileName.getBytes(Charsets.UTF_8),Charsets.ISO_8859_1);
+            String transferName = new String(fileName.getBytes(Charsets.UTF_8),Charsets.ISO_8859_1);
 
-                    out = response.getOutputStream();
-                    response.setCharacterEncoding("UTF-8");
-                    response.setContentType("multipart/form-data;charset=UTF-8");
-                   // response.setContentType("application/vnd.ms-excel");
-                   // response.setHeader("Content-Disposition", "attachment; filename=\"" + transferName + "\"");
-                    response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
-                    response.setHeader("Content-Disposition", "attachment;filename="+new String(fileName.getBytes("gbk"), "iso8859-1")+".xlsx");
-                    wb.write(out);
-                    wb.close();
-                    out.flush();
-                    out.close();
+            out = response.getOutputStream();
+            response.setCharacterEncoding("UTF-8");
+            response.setContentType("multipart/form-data;charset=UTF-8");
+            // response.setContentType("application/vnd.ms-excel");
+            // response.setHeader("Content-Disposition", "attachment; filename=\"" + transferName + "\"");
+            response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
+            response.setHeader("Content-Disposition", "attachment;filename="+new String(fileName.getBytes("gbk"), "iso8859-1")+".xlsx");
+            wb.write(out);
+            wb.close();
+            out.flush();
+            out.close();
 
-            }else {
-                   //return failed();
-                }
-            //强制刷新
+        }else {
+            //return failed();
+        }
+        //强制刷新
     }
 
-
 }

+ 7 - 6
src/main/java/com/steerinfo/ems/emssafeinfo/mapper/EmsSafeinfoMapper.java

@@ -2,15 +2,16 @@ package com.steerinfo.ems.emssafeinfo.mapper;
 
 import com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo;
 import com.steerinfo.framework.mapper.IBaseMapper;
+import java.math.*;
+import java.util.List;
+
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-import java.util.Map;
-
 @Mapper
-public interface EmsSafeinfoMapper extends IBaseMapper<EmsSafeinfo, Short> {
+public interface EmsSafeinfoMapper extends IBaseMapper<EmsSafeinfo, String> {
     String selectmaxid();
 
-    List<EmsSafeinfo> selectByParameters2(@Param("dates") String dates, @Param("dates2") String dates2, @Param("type") String[] type, @Param("process") String[] process);
-}
+    List<EmsSafeinfo> selectByParameters2(@Param("dates") String dates, @Param("dates2") String dates2, @Param("hazard") String[] hazard, @Param("process") String[] process);
+
+}

+ 219 - 86
src/main/java/com/steerinfo/ems/emssafeinfo/mapper/EmsSafeinfoMapper.xml

@@ -13,14 +13,21 @@
     <result column="TYPE" jdbcType="VARCHAR" property="type" />
     <result column="MEMO" jdbcType="VARCHAR" property="memo" />
     <result column="DATES" jdbcType="VARCHAR" property="dates" />
+    <result column="RECTIFICATIONDATE" jdbcType="VARCHAR" property="rectificationdate" />
+    <result column="VERIFY" jdbcType="VARCHAR" property="verify" />
+    <result column="MONEY" jdbcType="DECIMAL" property="money" />
+    <result column="PLAN" jdbcType="VARCHAR" property="plan" />
+    <result column="HAZARD" jdbcType="VARCHAR" property="hazard" />
+    <result column="MEASURE" jdbcType="VARCHAR" property="measure" />
   </resultMap>
   <sql id="columns">
     ID, PROCESS, CREATEMAN, CREATETIME, UPDATEMAN, UPDATETIME, CONTENT, FILENAME, TYPE, 
-    MEMO,DATES
+    MEMO, DATES, RECTIFICATIONDATE, VERIFY, MONEY, PLAN, HAZARD, MEASURE
   </sql>
   <sql id="columns_alias">
     t.ID, t.PROCESS, t.CREATEMAN, t.CREATETIME, t.UPDATEMAN, t.UPDATETIME, t.CONTENT, 
-    t.FILENAME, t.TYPE, t.MEMO,t.DATES
+    t.FILENAME, t.TYPE, t.MEMO, t.DATES, t.RECTIFICATIONDATE, t.VERIFY, t.MONEY, t.PLAN, 
+    t.HAZARD, t.MEASURE
   </sql>
   <sql id="select">
     SELECT <include refid="columns"/> FROM EMS_SAFEINFO
@@ -30,7 +37,7 @@
   </sql>
   <sql id="where">
     <where> 
-      <if test="id != null">
+      <if test="id != null and id != ''">
         and ID = #{id}
       </if>
       <if test="process != null and process != ''">
@@ -61,14 +68,32 @@
         and MEMO = #{memo}
       </if>
       <if test="dates != null and dates != ''">
-        and DATES BETWEEN #{dates} and #{dates2}
+        and DATES = #{dates}
+      </if>
+      <if test="rectificationdate != null and rectificationdate != ''">
+        and RECTIFICATIONDATE = #{rectificationdate}
+      </if>
+      <if test="verify != null and verify != ''">
+        and VERIFY = #{verify}
+      </if>
+      <if test="money != null">
+        and MONEY = #{money}
+      </if>
+      <if test="plan != null and plan != ''">
+        and PLAN = #{plan}
+      </if>
+      <if test="hazard != null and hazard != ''">
+        and HAZARD = #{hazard}
+      </if>
+      <if test="measure != null and measure != ''">
+        and MEASURE = #{measure}
       </if>
     </where>
   </sql>
   <sql id="whereLike">
     <where> 
-      <if test="id != null">
-        and ID = #{id}
+      <if test="id != null and id != ''">
+        and ID LIKE '%${id}%'
       </if>
       <if test="process != null and process != ''">
         and PROCESS LIKE '%${process}%'
@@ -100,11 +125,29 @@
       <if test="dates != null and dates != ''">
         and DATES LIKE '%${dates}%'
       </if>
+      <if test="rectificationdate != null and rectificationdate != ''">
+        and RECTIFICATIONDATE LIKE '%${rectificationdate}%'
+      </if>
+      <if test="verify != null and verify != ''">
+        and VERIFY LIKE '%${verify}%'
+      </if>
+      <if test="money != null">
+        and MONEY = #{money}
+      </if>
+      <if test="plan != null and plan != ''">
+        and PLAN LIKE '%${plan}%'
+      </if>
+      <if test="hazard != null and hazard != ''">
+        and HAZARD LIKE '%${hazard}%'
+      </if>
+      <if test="measure != null and measure != ''">
+        and MEASURE LIKE '%${measure}%'
+      </if>
     </where>
   </sql>
-  <delete id="deleteByPrimaryKey" parameterType="string">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
     delete from EMS_SAFEINFO
-    where ID = #{id,jdbcType=DECIMAL}
+    where ID = #{id,jdbcType=VARCHAR}
   </delete>
   <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
     delete from EMS_SAFEINFO
@@ -136,19 +179,41 @@
       <if test="memo != null and memo != ''">
         or MEMO = #{memo}
       </if>
-    <if test="dates != null and dates != ''">
-      or DATES = #{dates}
-    </if>
+      <if test="dates != null and dates != ''">
+        or DATES = #{dates}
+      </if>
+      <if test="rectificationdate != null and rectificationdate != ''">
+        or RECTIFICATIONDATE = #{rectificationdate}
+      </if>
+      <if test="verify != null and verify != ''">
+        or VERIFY = #{verify}
+      </if>
+      <if test="money != null">
+        or MONEY = #{money}
+      </if>
+      <if test="plan != null and plan != ''">
+        or PLAN = #{plan}
+      </if>
+      <if test="hazard != null and hazard != ''">
+        or HAZARD = #{hazard}
+      </if>
+      <if test="measure != null and measure != ''">
+        or MEASURE = #{measure}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo">
     insert into EMS_SAFEINFO (ID, PROCESS, CREATEMAN, 
       CREATETIME, UPDATEMAN, UPDATETIME, 
       CONTENT, FILENAME, TYPE, 
-      MEMO,DATES)
-    values (#{id,jdbcType=DECIMAL}, #{process,jdbcType=VARCHAR}, #{createman,jdbcType=VARCHAR}, 
+      MEMO, DATES, RECTIFICATIONDATE, 
+      VERIFY, MONEY, PLAN, 
+      HAZARD, MEASURE)
+    values (#{id,jdbcType=VARCHAR}, #{process,jdbcType=VARCHAR}, #{createman,jdbcType=VARCHAR}, 
       #{createtime,jdbcType=VARCHAR}, #{updateman,jdbcType=VARCHAR}, #{updatetime,jdbcType=VARCHAR}, 
       #{content,jdbcType=VARCHAR}, #{filename,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, 
-      #{memo,jdbcType=VARCHAR},#{dates,jdbcType=VARCHAR})
+      #{memo,jdbcType=VARCHAR}, #{dates,jdbcType=VARCHAR}, #{rectificationdate,jdbcType=VARCHAR}, 
+      #{verify,jdbcType=VARCHAR}, #{money,jdbcType=DECIMAL}, #{plan,jdbcType=VARCHAR}, 
+      #{hazard,jdbcType=VARCHAR}, #{measure,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo">
     insert into EMS_SAFEINFO
@@ -186,10 +251,28 @@
       <if test="dates != null">
         DATES,
       </if>
+      <if test="rectificationdate != null">
+        RECTIFICATIONDATE,
+      </if>
+      <if test="verify != null">
+        VERIFY,
+      </if>
+      <if test="money != null">
+        MONEY,
+      </if>
+      <if test="plan != null">
+        PLAN,
+      </if>
+      <if test="hazard != null">
+        HAZARD,
+      </if>
+      <if test="measure != null">
+        MEASURE,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
-        #{id,jdbcType=DECIMAL},
+        #{id,jdbcType=VARCHAR},
       </if>
       <if test="process != null">
         #{process,jdbcType=VARCHAR},
@@ -218,8 +301,26 @@
       <if test="memo != null">
         #{memo,jdbcType=VARCHAR},
       </if>
-      <if test="memo != null">
-        #{dates,jdbcType=VARCHAR}
+      <if test="dates != null">
+        #{dates,jdbcType=VARCHAR},
+      </if>
+      <if test="rectificationdate != null">
+        #{rectificationdate,jdbcType=VARCHAR},
+      </if>
+      <if test="verify != null">
+        #{verify,jdbcType=VARCHAR},
+      </if>
+      <if test="money != null">
+        #{money,jdbcType=DECIMAL},
+      </if>
+      <if test="plan != null">
+        #{plan,jdbcType=VARCHAR},
+      </if>
+      <if test="hazard != null">
+        #{hazard,jdbcType=VARCHAR},
+      </if>
+      <if test="measure != null">
+        #{measure,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
@@ -234,8 +335,14 @@
       FILENAME = #{filename,jdbcType=VARCHAR},
       TYPE = #{type,jdbcType=VARCHAR},
       MEMO = #{memo,jdbcType=VARCHAR},
-        DATES = #{dates,jdbcType=VARCHAR}
-    where ID = #{id,jdbcType=DECIMAL}
+      DATES = #{dates,jdbcType=VARCHAR},
+      RECTIFICATIONDATE = #{rectificationdate,jdbcType=VARCHAR},
+      VERIFY = #{verify,jdbcType=VARCHAR},
+      MONEY = #{money,jdbcType=DECIMAL},
+      PLAN = #{plan,jdbcType=VARCHAR},
+      HAZARD = #{hazard,jdbcType=VARCHAR},
+      MEASURE = #{measure,jdbcType=VARCHAR}
+    where ID = #{id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo">
     update EMS_SAFEINFO
@@ -268,58 +375,36 @@
         MEMO = #{memo,jdbcType=VARCHAR},
       </if>
       <if test="dates != null">
-        DATES = #{dates,jdbcType=VARCHAR}
+        DATES = #{dates,jdbcType=VARCHAR},
       </if>
-    </set>
-    where ID = #{id,jdbcType=DECIMAL}
-  </update>
-  <select id="selectByPrimaryKey" parameterType="string" resultMap="BaseResultMap">
-    <include refid="select"/>
-    where ID = #{id,jdbcType=DECIMAL}
-  </select>
-  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-    <include refid="select"/>
-    <where>
-      <if test="id != null">
-        and ID = #{id}
+      <if test="rectificationdate != null">
+        RECTIFICATIONDATE = #{rectificationdate,jdbcType=VARCHAR},
       </if>
-      <if test="process != null and process != ''">
-        and PROCESS in
-        <foreach collection="array" index="index" item="process" open="(" separator="," close=")">
-          #{process}
-        </foreach>
+      <if test="verify != null">
+        VERIFY = #{verify,jdbcType=VARCHAR},
       </if>
-      <if test="type != null and type != ''">
-        and TYPE in
-        <foreach collection="array" index="index" item="type" open="(" separator="," close=")">
-          #{type}
-        </foreach>
+      <if test="money != null">
+        MONEY = #{money,jdbcType=DECIMAL},
       </if>
-      <if test="dates != null and dates != ''">
-        and DATES BETWEEN #{dates} and #{dates2}
+      <if test="plan != null">
+        PLAN = #{plan,jdbcType=VARCHAR},
       </if>
-    </where>
-  </select>
-
-  <select id="selectByParameters2"  resultMap="BaseResultMap">
-    <include refid="select"/>
-    <where>
-      <if test="process != null and process != ''">
-        and PROCESS in
-        <foreach collection="process" index="index" item="process" open="(" separator="," close=")">
-          #{process}
-        </foreach>
-      </if>
-      <if test="type != null and type != ''">
-        and TYPE in
-        <foreach collection="type" index="index" item="type" open="(" separator="," close=")">
-          #{type}
-        </foreach>
+      <if test="hazard != null">
+        HAZARD = #{hazard,jdbcType=VARCHAR},
       </if>
-      <if test="dates != null and dates != ''">
-        and DATES BETWEEN #{dates} and #{dates2}
+      <if test="measure != null">
+        MEASURE = #{measure,jdbcType=VARCHAR},
       </if>
-    </where>
+    </set>
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    <include refid="select"/>
+    where ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+    <include refid="select"/>
+    <include refid="where"/>
   </select>
   <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
     <include refid="select"/>
@@ -330,15 +415,19 @@
       (ID, 
       PROCESS, CREATEMAN, CREATETIME, 
       UPDATEMAN, UPDATETIME, CONTENT, 
-      FILENAME, TYPE, MEMO,DATES
-      )
+      FILENAME, TYPE, MEMO, 
+      DATES, RECTIFICATIONDATE, VERIFY, 
+      MONEY, PLAN, HAZARD, 
+      MEASURE)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
-      #{item.id,jdbcType=DECIMAL}, 
+      #{item.id,jdbcType=VARCHAR}, 
       #{item.process,jdbcType=VARCHAR}, #{item.createman,jdbcType=VARCHAR}, #{item.createtime,jdbcType=VARCHAR}, 
       #{item.updateman,jdbcType=VARCHAR}, #{item.updatetime,jdbcType=VARCHAR}, #{item.content,jdbcType=VARCHAR}, 
-      #{item.filename,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR,},#{item.dates,jdbcType=VARCHAR}
-       from dual  
+      #{item.filename,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.memo,jdbcType=VARCHAR}, 
+      #{item.dates,jdbcType=VARCHAR}, #{item.rectificationdate,jdbcType=VARCHAR}, #{item.verify,jdbcType=VARCHAR}, 
+      #{item.money,jdbcType=DECIMAL}, #{item.plan,jdbcType=VARCHAR}, #{item.hazard,jdbcType=VARCHAR}, 
+      #{item.measure,jdbcType=VARCHAR} from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -346,52 +435,75 @@
      set
        ID=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.id,jdbcType=DECIMAL}
+          when #{item.id,jdbcType=VARCHAR} then #{item.id,jdbcType=VARCHAR}
        </foreach>
        ,PROCESS=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.process,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.process,jdbcType=VARCHAR}
        </foreach>
        ,CREATEMAN=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.createman,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.createman,jdbcType=VARCHAR}
        </foreach>
        ,CREATETIME=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.createtime,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.createtime,jdbcType=VARCHAR}
        </foreach>
        ,UPDATEMAN=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.updateman,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.updateman,jdbcType=VARCHAR}
        </foreach>
        ,UPDATETIME=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.updatetime,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.updatetime,jdbcType=VARCHAR}
        </foreach>
        ,CONTENT=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.content,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.content,jdbcType=VARCHAR}
        </foreach>
        ,FILENAME=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.filename,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.filename,jdbcType=VARCHAR}
        </foreach>
        ,TYPE=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.type,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.type,jdbcType=VARCHAR}
        </foreach>
        ,MEMO=
        <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-          when #{item.id,jdbcType=DECIMAL} then #{item.memo,jdbcType=VARCHAR}
+          when #{item.id,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
+       </foreach>
+       ,DATES=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.dates,jdbcType=VARCHAR}
+       </foreach>
+       ,RECTIFICATIONDATE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.rectificationdate,jdbcType=VARCHAR}
+       </foreach>
+       ,VERIFY=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.verify,jdbcType=VARCHAR}
+       </foreach>
+       ,MONEY=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.money,jdbcType=DECIMAL}
+       </foreach>
+       ,PLAN=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.plan,jdbcType=VARCHAR}
+       </foreach>
+       ,HAZARD=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.hazard,jdbcType=VARCHAR}
+       </foreach>
+       ,MEASURE=
+       <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
+          when #{item.id,jdbcType=VARCHAR} then #{item.measure,jdbcType=VARCHAR}
        </foreach>
-    ,DATES=
-    <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
-      when #{item.id,jdbcType=DECIMAL} then #{item.dates,jdbcType=VARCHAR}
-    </foreach>
-
      where ID in 
      <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
-    #{item.id,jdbcType=DECIMAL}
+    #{item.id,jdbcType=VARCHAR}
      </foreach> 
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
@@ -404,6 +516,27 @@
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
   <select id="selectmaxid" resultType="string">
-     select max(t.id) as maxid from EMS_SAFEINFO t
+    select max(t.id) as maxid from EMS_SAFEINFO t
+  </select>
+  <select id="selectByParameters2"  resultMap="BaseResultMap">
+    <include refid="select"/>
+    <where>
+      <if test="process != null and process != ''">
+         PROCESS in
+        <foreach collection="process" index="index" item="process" open="(" separator="," close=")">
+          #{process}
+        </foreach>
+      </if>
+      <if test="hazard != null and hazard != ''">
+        and HAZARD in
+        <foreach collection="hazard" index="index" item="hazard" open="(" separator="," close=")">
+          #{hazard}
+        </foreach>
+      </if>
+
+      <if test="dates != null and dates != '' and dates2 != null and dates2 != ''">
+        and CREATETIME BETWEEN #{dates} and #{dates2}
+      </if>
+    </where>
   </select>
 </mapper>

+ 115 - 22
src/main/java/com/steerinfo/ems/emssafeinfo/model/EmsSafeinfo.java

@@ -4,39 +4,41 @@ import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
+
 @ApiModel(value="null")
 public class EmsSafeinfo implements IBasePO<String> {
     @ApiModelProperty(value="",required=true)
     private String id;
 
     /**
-     * 工序(PROCESS,VARCHAR,10)
+     * 被查单位(PROCESS,VARCHAR,20)
      */
-    @ApiModelProperty(value="工序",required=false)
+    @ApiModelProperty(value="被查单位",required=false)
     private String process;
 
     /**
-     * 创建人(CREATEMAN,VARCHAR,10)
+     * 检查人(CREATEMAN,VARCHAR,10)
      */
-    @ApiModelProperty(value="创建人",required=false)
+    @ApiModelProperty(value="检查人",required=false)
     private String createman;
 
     /**
-     * 创建时间(CREATETIME,VARCHAR,10)
+     * 检查时间(CREATETIME,VARCHAR,20)
      */
-    @ApiModelProperty(value="创建时间",required=false)
+    @ApiModelProperty(value="检查时间",required=false)
     private String createtime;
 
     /**
-     * 修改人(UPDATEMAN,VARCHAR,10)
+     * 整改责任人(UPDATEMAN,VARCHAR,20)
      */
-    @ApiModelProperty(value="修改人",required=false)
+    @ApiModelProperty(value="整改责任人",required=false)
     private String updateman;
 
     /**
-     * 修改时间(UPDATETIME,VARCHAR,10)
+     * 整改期限(UPDATETIME,VARCHAR,20)
      */
-    @ApiModelProperty(value="修改时间",required=false)
+    @ApiModelProperty(value="整改期限",required=false)
     private String updatetime;
 
     /**
@@ -46,9 +48,9 @@ public class EmsSafeinfo implements IBasePO<String> {
     private String content;
 
     /**
-     * 文件名(FILENAME,VARCHAR,50)
+     * 整改结果(FILENAME,VARCHAR,50)
      */
-    @ApiModelProperty(value="文件名",required=false)
+    @ApiModelProperty(value="整改结果",required=false)
     private String filename;
 
     /**
@@ -63,20 +65,48 @@ public class EmsSafeinfo implements IBasePO<String> {
     @ApiModelProperty(value="备注",required=false)
     private String memo;
 
-    public String getDates() {
-        return dates;
-    }
-
-    public void setDates(String dates) {
-        this.dates = dates;
-    }
-
     /**
-     * 备注(MEMO,VARCHAR,100)
+     * 日期(DATES,VARCHAR,20)
      */
     @ApiModelProperty(value="日期",required=false)
     private String dates;
 
+    /**
+     * 整改日期(RECTIFICATIONDATE,VARCHAR,20)
+     */
+    @ApiModelProperty(value="整改日期",required=false)
+    private String rectificationdate;
+
+    /**
+     * 验证人(VERIFY,VARCHAR,20)
+     */
+    @ApiModelProperty(value="验证人",required=false)
+    private String verify;
+
+    /**
+     * 资金(MONEY,DECIMAL,0)
+     */
+    @ApiModelProperty(value="资金",required=false)
+    private BigDecimal money;
+
+    /**
+     * 预案(PLAN,VARCHAR,200)
+     */
+    @ApiModelProperty(value="预案",required=false)
+    private String plan;
+
+    /**
+     * 隐患分级(HAZARD,VARCHAR,10)
+     */
+    @ApiModelProperty(value="隐患分级",required=false)
+    private String hazard;
+
+    /**
+     * 整改措施(MEASURE,VARCHAR,200)
+     */
+    @ApiModelProperty(value="整改措施",required=false)
+    private String measure;
+
     private static final long serialVersionUID = 1L;
 
     public String getId() {
@@ -84,7 +114,7 @@ public class EmsSafeinfo implements IBasePO<String> {
     }
 
     public void setId(String id) {
-        this.id = id;
+        this.id = id == null ? null : id.trim();
     }
 
     public String getProcess() {
@@ -159,6 +189,62 @@ public class EmsSafeinfo implements IBasePO<String> {
         this.memo = memo == null ? null : memo.trim();
     }
 
+    public String getDates() {
+        return dates;
+    }
+
+    public void setDates(String dates) {
+        this.dates = dates == null ? null : dates.trim();
+    }
+
+    public String getRectificationdate() {
+        return rectificationdate;
+    }
+
+    public void setRectificationdate(String rectificationdate) {
+        this.rectificationdate = rectificationdate == null ? null : rectificationdate.trim();
+    }
+
+    public String getVerify() {
+        return verify;
+    }
+
+    public void setVerify(String verify) {
+        this.verify = verify == null ? null : verify.trim();
+    }
+
+    public BigDecimal getMoney() {
+        return money;
+    }
+
+    public void setMoney(BigDecimal money) {
+        this.money = money;
+    }
+
+    public String getPlan() {
+        return plan;
+    }
+
+    public void setPlan(String plan) {
+        this.plan = plan == null ? null : plan.trim();
+    }
+
+    public String getHazard() {
+        return hazard;
+    }
+
+    public void setHazard(String hazard) {
+        this.hazard = hazard == null ? null : hazard.trim();
+    }
+
+    public String getMeasure() {
+        return measure;
+    }
+
+    public void setMeasure(String measure) {
+        this.measure = measure == null ? null : measure.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -175,6 +261,13 @@ public class EmsSafeinfo implements IBasePO<String> {
         sb.append(", filename=").append(filename);
         sb.append(", type=").append(type);
         sb.append(", memo=").append(memo);
+        sb.append(", dates=").append(dates);
+        sb.append(", rectificationdate=").append(rectificationdate);
+        sb.append(", verify=").append(verify);
+        sb.append(", money=").append(money);
+        sb.append(", plan=").append(plan);
+        sb.append(", hazard=").append(hazard);
+        sb.append(", measure=").append(measure);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 9 - 6
src/main/java/com/steerinfo/ems/emssafeinfo/service/IEmsSafeinfoService.java

@@ -1,30 +1,33 @@
 package com.steerinfo.ems.emssafeinfo.service;
 
-import com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo;
 import com.steerinfo.framework.service.IBaseService;
+import com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo;
 import com.steerinfo.framework.service.pagehelper.PageList;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.util.Date;
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
 /**
  * EmsSafeinfo服务接口:
  * @author generator
- * @version 1.0-SNAPSHORT 2023-04-24 10:51
+ * @version 1.0-SNAPSHORT 2023-05-15 10:07
  * 类描述
  * 修订历史:
- * 日期:2023-04-24
+ * 日期:2023-05-15
  * 作者:generator
  * 参考:
  * 描述:EmsSafeinfo服务接口
  * @see null
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  */
-public interface IEmsSafeinfoService extends IBaseService<EmsSafeinfo, Short>{
+public interface IEmsSafeinfoService extends IBaseService<EmsSafeinfo, String>{
     List<EmsSafeinfo> batchImport(String fileName, MultipartFile file) throws Exception;
 
     List<EmsSafeinfo> getList(Map<String, Object> parameters);
-    PageList<EmsSafeinfo> queryForPage2(String dates, String dates2, String[] type, String[] process, Integer pageNum, Integer pageSize);
 
-}
+    PageList<EmsSafeinfo> queryForPage2(String dates, String dates2, String[] hazard, String[] process, Integer pageNum, Integer pageSize);
+
+}

+ 44 - 40
src/main/java/com/steerinfo/ems/emssafeinfo/service/impl/EmsSafeinfoServiceImpl.java

@@ -1,29 +1,18 @@
 package com.steerinfo.ems.emssafeinfo.service.impl;
 
+import com.github.pagehelper.PageHelper;
 import com.steerinfo.ems.Utils.ExcelToolUtils;
-import com.steerinfo.ems.emssafeinfo.mapper.EmsSafeinfoMapper;
-import com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo;
-import com.steerinfo.ems.emssafeinfo.service.IEmsSafeinfoService;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
-
-import com.steerinfo.framework.service.pagehelper.PageHelper;
+import com.steerinfo.ems.emssafeinfo.model.EmsSafeinfo;
+import com.steerinfo.ems.emssafeinfo.mapper.EmsSafeinfoMapper;
+import com.steerinfo.ems.emssafeinfo.service.IEmsSafeinfoService;
 import com.steerinfo.framework.service.pagehelper.PageList;
-import org.apache.ibatis.annotations.Param;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.apache.commons.lang.math.NumberUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
-
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Date;
@@ -34,10 +23,10 @@ import java.util.Map;
 /**
  * EmsSafeinfo服务实现:
  * @author generator
- * @version 1.0-SNAPSHORT 2023-04-24 10:51
+ * @version 1.0-SNAPSHORT 2023-05-15 10:07
  * 类描述
  * 修订历史:
- * 日期:2023-04-24
+ * 日期:2023-05-15
  * 作者:generator
  * 参考:
  * 描述:EmsSafeinfo服务实现
@@ -45,14 +34,12 @@ import java.util.Map;
  * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  */
 @Service(value = "emsSafeinfoService")
-@Transactional(rollbackFor=Exception.class)
-public class EmsSafeinfoServiceImpl extends BaseServiceImpl<EmsSafeinfo, Short> implements IEmsSafeinfoService {
-
+public class EmsSafeinfoServiceImpl extends BaseServiceImpl<EmsSafeinfo, String> implements IEmsSafeinfoService {
     @Autowired
     private EmsSafeinfoMapper emsSafeinfoMapper;
 
     @Override
-    protected IBaseMapper<EmsSafeinfo, Short> getMapper() {
+    protected IBaseMapper<EmsSafeinfo, String> getMapper() {
         return emsSafeinfoMapper;
     }
 
@@ -69,30 +56,47 @@ public class EmsSafeinfoServiceImpl extends BaseServiceImpl<EmsSafeinfo, Short>
                 EmsSafeinfo emsSafeinfo= new EmsSafeinfo();
                 String[] arr = list.get(i).get(j);
                 String[] arr1 = list.get(i).get(0);
-                for (int k = 1; k < arr1.length; k++) {
+                for (int k = 0; k < arr1.length; k++) {
 
                     if (arr1[k].trim().indexOf("序号")!=-1){
 
-                    }
-                    else if (arr1[k].trim().indexOf("日期")!=-1){
-                         emsSafeinfo.setDates(arr[k].trim());
-                     }else  if (arr1[k].trim().indexOf("工序")!=-1) {
-                            emsSafeinfo.setProcess(arr[k].trim());
-
-                        }else  if(arr1[k].trim().indexOf("地点")!=-1) {
+                    }else if (arr1[k].trim().indexOf("检查日期")!=-1){
+                        emsSafeinfo.setCreatetime(arr[k].trim());
+                    }else  if (arr1[k].trim().indexOf("被查单位")!=-1) {
                         emsSafeinfo.setProcess(arr[k].trim());
-
+                    }else  if(arr1[k].trim().indexOf("ID")!=-1) {
+                        emsSafeinfo.setId(arr[k].trim());
+                    } else if(arr1[k].trim().indexOf("隐患内容")!=-1){
+                        emsSafeinfo.setContent(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("检查人")!=-1){
+                        emsSafeinfo.setCreateman(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("整改措施")!=-1){
+                        emsSafeinfo.setMeasure(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("整改期限")!=-1){
+                        emsSafeinfo.setUpdatetime(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("整改责任人")!=-1){
+                        emsSafeinfo.setUpdateman(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("整改结果")!=-1){
+                        emsSafeinfo.setFilename(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("整改日期")!=-1){
+                        emsSafeinfo.setRectificationdate(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("验证人")!=-1){
+                        emsSafeinfo.setVerify(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("资金")!=-1){
+//                        emsSafeinfo.setMoney(arr[k].trim());
+                        emsSafeinfo.setMoney(NumberUtils.createBigDecimal(arr[k].trim()));
+                    }else if(arr1[k].trim().indexOf("预案")!=-1){
+                        emsSafeinfo.setPlan(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("隐患分级")!=-1){
+                        emsSafeinfo.setHazard(arr[k].trim());
+                    }else if(arr1[k].trim().indexOf("备注")!=-1){
+                        emsSafeinfo.setMemo(arr[k].trim());
                     }
-                    else if(arr1[k].trim().indexOf("内容")!=-1){
-                         emsSafeinfo.setContent(arr[k].trim());
-
-                     }else if(arr1[k].trim().indexOf("备注")!=-1){
-                         emsSafeinfo.setMemo(arr[k].trim());
-
-                     }
                 }
                 emsSafeinfoList.add(emsSafeinfo);
             }
+
+
         }
         if (emsSafeinfoList.size()>0){
 
@@ -109,9 +113,9 @@ public class EmsSafeinfoServiceImpl extends BaseServiceImpl<EmsSafeinfo, Short>
     }
 
     @Override
-    public PageList<EmsSafeinfo> queryForPage2(String dates,String dates2,String[] type,String[] process, Integer pageNum, Integer pageSize) {
+    public PageList<EmsSafeinfo> queryForPage2(String dates, String dates2, String[] hazard, String[] process, Integer pageNum, Integer pageSize) {
         PageHelper.startPage(pageNum, pageSize);
-        List<EmsSafeinfo> rows = emsSafeinfoMapper.selectByParameters2( dates, dates2, type,process);
+        List<EmsSafeinfo> rows = emsSafeinfoMapper.selectByParameters2( dates, dates2, hazard,process);
         PageList pageInfo = new PageList(rows);
         return pageInfo;
     }