Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
| File was renamed from pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/excel/ReportExportCellWriteHandler.java | 
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author ZhuBaoMin | 
|---|
|  |  |  | * @date 2024-08-26 14:18 | 
|---|
|  |  |  | * @LastEditTime 2024-08-26 14:18 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | * @date 2024-10-12 11:40 | 
|---|
|  |  |  | * @LastEditTime 2024-10-12 11:40 | 
|---|
|  |  |  | * @Description 总账表格设置 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public class ReportExportCellWriteHandler extends AbstractVerticalCellStyleStrategy  { | 
|---|
|  |  |  | public class CellWriteHandler extends AbstractVerticalCellStyleStrategy { | 
|---|
|  |  |  | private String title; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper("${", "}"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public ReportExportCellWriteHandler(String title) { | 
|---|
|  |  |  | public CellWriteHandler(String title) { | 
|---|
|  |  |  | this.title = title; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (cell.getRowIndex() >= 2){ | 
|---|
|  |  |  | ((XSSFCellStyle) originCellStyle).setFillForegroundColor(new XSSFColor(new java.awt.Color(237, 237, 237), new DefaultIndexedColorMap())); | 
|---|
|  |  |  | // 票面总价 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //if (cell.getColumnIndex() == 10){ | 
|---|
|  |  |  | //    int actualCellRowNum =  context.getCell().getRowIndex() + 1; | 
|---|
|  |  |  | //    context.getCell().setCellFormula("I" + actualCellRowNum +"+J" + actualCellRowNum); | 
|---|
|  |  |  | //    System.out.println("第" +   context.getCell().getRowIndex() + "行,第" +  context.getCell().getColumnIndex() + "票面总价写入公式完成"); | 
|---|
|  |  |  | //}else if (cell.getColumnIndex() == 12){ | 
|---|
|  |  |  | //    // 支付票款 | 
|---|
|  |  |  | //    int actualCellRowNum =  context.getCell().getRowIndex() + 1; | 
|---|
|  |  |  | //    context.getCell().setCellFormula("K" + actualCellRowNum +"-L" + actualCellRowNum); | 
|---|
|  |  |  | //    System.out.println("第" +   context.getCell().getRowIndex() + "行,第" +  context.getCell().getColumnIndex() + "支付票款写入公式完成"); | 
|---|
|  |  |  | //}else if (cell.getColumnIndex() == 15){ | 
|---|
|  |  |  | //    // 支付总额 | 
|---|
|  |  |  | //    int actualCellRowNum =  context.getCell().getRowIndex() + 1; | 
|---|
|  |  |  | //    context.getCell().setCellFormula("M" + actualCellRowNum +"+N" + actualCellRowNum +"+O" + actualCellRowNum); | 
|---|
|  |  |  | //    System.out.println("第" +   context.getCell().getRowIndex() + "行,第" +  context.getCell().getColumnIndex() + "支付总额写入公式完成"); | 
|---|
|  |  |  | //}else if (cell.getColumnIndex() == 17){ | 
|---|
|  |  |  | //    // 实际利润 | 
|---|
|  |  |  | //    int actualCellRowNum =  context.getCell().getRowIndex() + 1; | 
|---|
|  |  |  | //    context.getCell().setCellFormula("L" + actualCellRowNum +"+Q" + actualCellRowNum); | 
|---|
|  |  |  | //    System.out.println("第" +   context.getCell().getRowIndex() + "行,第" +  context.getCell().getColumnIndex() + "实际利润写入公式完成"); | 
|---|
|  |  |  | //}else if (cell.getColumnIndex() == 18){ | 
|---|
|  |  |  | //    // 应收款 | 
|---|
|  |  |  | //    int actualCellRowNum =  context.getCell().getRowIndex() + 1; | 
|---|
|  |  |  | //    context.getCell().setCellFormula("P" + actualCellRowNum +"+R" + actualCellRowNum); | 
|---|
|  |  |  | //    System.out.println("第" +   context.getCell().getRowIndex() + "行,第" +  context.getCell().getColumnIndex() + "应收款写入公式完成"); | 
|---|
|  |  |  | //}else if (cell.getColumnIndex() == 20){ | 
|---|
|  |  |  | //    // 未收款 | 
|---|
|  |  |  | //    int actualCellRowNum =  context.getCell().getRowIndex() + 1; | 
|---|
|  |  |  | //    context.getCell().setCellFormula("S" + actualCellRowNum +"-T" + actualCellRowNum); | 
|---|
|  |  |  | //    System.out.println("第" +   context.getCell().getRowIndex() + "行,第" +  context.getCell().getColumnIndex() + "未收款写入公式完成"); | 
|---|
|  |  |  | //}else if (cell.getColumnIndex() >= 2){ | 
|---|
|  |  |  | //    ((XSSFCellStyle) originCellStyle).setFillForegroundColor(new XSSFColor(new java.awt.Color(189, 215, 238), new DefaultIndexedColorMap())); | 
|---|
|  |  |  | //}else if (cell.getColumnIndex() < 2){ | 
|---|
|  |  |  | //    ((XSSFCellStyle) originCellStyle).setFillForegroundColor(new XSSFColor(new java.awt.Color(255, 192, 0), new DefaultIndexedColorMap())); | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | cellData.getWriteCellStyle().setWriteFont(headWriteFont); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrGlobal.voPr; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.excel.annotation.ExcelIgnore; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.ExcelProperty; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.write.style.ColumnWidth; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.write.style.ContentRowHeight; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.write.style.HeadRowHeight; | 
|---|
|  |  |  | import com.dy.common.po.BaseEntity; | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonPropertyOrder; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
|---|
|  |  |  | import jakarta.validation.constraints.Max; | 
|---|
|  |  |  | import jakarta.validation.constraints.Min; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * @author ZhuBaoMin | 
|---|
|  |  |  | * @date 2023-12-29 10:27 | 
|---|
|  |  |  | * @LastEditTime 2023-12-29 10:27 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | * @Description 控制器视图对象 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | @Schema(title = "控制器视图对象") | 
|---|
|  |  |  | @JsonPropertyOrder({ "id", "rtuAddr", "intakeName", "bindNumber", "findDt", "isOnLine", "protocol", "remarks"}) | 
|---|
|  |  |  | @HeadRowHeight(30) | 
|---|
|  |  |  | @ContentRowHeight(20) | 
|---|
|  |  |  | public class VoController implements BaseEntity { | 
|---|
|  |  |  | private static final long serialVersionUID = 202401241704003L; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "ID") | 
|---|
|  |  |  | @ExcelProperty("ID") | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String id; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "控制器地址") | 
|---|
|  |  |  | @ExcelProperty("控制器地址") | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "阀控器地址"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String rtuAddr; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "绑定取水口") | 
|---|
|  |  |  | @ExcelProperty("绑定取水口") | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "取水口编号"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String intakeName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "绑定次数") | 
|---|
|  |  |  | @ExcelProperty("绑定次数") | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "绑定次数"}) | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | private Integer bindNumber; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | 
|---|
|  |  |  | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 
|---|
|  |  |  | @Schema(title = "发现日期时间") | 
|---|
|  |  |  | @ExcelProperty("发现日期时间") | 
|---|
|  |  |  | @ColumnWidth(30) | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "发现时间"}) | 
|---|
|  |  |  | @ColumnWidth(20) | 
|---|
|  |  |  | private Date findDt; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    @Schema(title = "在线状态") | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 是否在线 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private Boolean isOnLine; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "通讯协议") | 
|---|
|  |  |  | @ExcelProperty("通讯协议") | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String protocol; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "备注") | 
|---|
|  |  |  | @ExcelProperty("备注") | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String remarks; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.alibaba.excel.annotation.ExcelIgnore; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.ExcelProperty; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.write.style.ColumnWidth; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.write.style.ContentRowHeight; | 
|---|
|  |  |  | import com.alibaba.excel.annotation.write.style.HeadRowHeight; | 
|---|
|  |  |  | import com.dy.common.po.BaseEntity; | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonPropertyOrder; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | @Schema(title = "取水口视图对象") | 
|---|
|  |  |  | @JsonPropertyOrder({ "intakeId", "intakeName", "divideId", "divideName", "blockId", "blockName", "isBind", "address", "lng", "lat", "operator", "operateDt", "remarks", "controllerId", "rtuAddr"}) | 
|---|
|  |  |  | @HeadRowHeight(30) | 
|---|
|  |  |  | @ContentRowHeight(20) | 
|---|
|  |  |  | public class VoIntake implements BaseEntity { | 
|---|
|  |  |  | private static final long serialVersionUID = 202312261049001L; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "取水口ID") | 
|---|
|  |  |  | @ExcelProperty("取水口ID") | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String intakeId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "取水口名称") | 
|---|
|  |  |  | @ExcelProperty("取水口名称") | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "取水口编号"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String intakeName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "分水房ID") | 
|---|
|  |  |  | @ExcelProperty("分水房ID") | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String divideId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "所属分水房") | 
|---|
|  |  |  | @ExcelProperty("所属分水房") | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "所属分水房"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String divideName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "片区ID") | 
|---|
|  |  |  | @ExcelProperty("片区ID") | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String blockId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "所属片区") | 
|---|
|  |  |  | @ExcelProperty("所属片区") | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "所属片区"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String blockName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "绑定设备") | 
|---|
|  |  |  | @ExcelProperty("绑定设备") | 
|---|
|  |  |  | @ColumnWidth(6) | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "绑定设备"}) | 
|---|
|  |  |  | @ColumnWidth(10) | 
|---|
|  |  |  | private String isBind; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "地址") | 
|---|
|  |  |  | @ExcelProperty("地址") | 
|---|
|  |  |  | @ColumnWidth(25) | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "地址"}) | 
|---|
|  |  |  | @ColumnWidth(30) | 
|---|
|  |  |  | private String address; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "经度") | 
|---|
|  |  |  | @ExcelProperty("经度") | 
|---|
|  |  |  | @ColumnWidth(25) | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "经度"}) | 
|---|
|  |  |  | @ColumnWidth(20) | 
|---|
|  |  |  | private String lng; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "纬度") | 
|---|
|  |  |  | @ExcelProperty("纬度") | 
|---|
|  |  |  | @ColumnWidth(25) | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "纬度"}) | 
|---|
|  |  |  | @ColumnWidth(20) | 
|---|
|  |  |  | private String lat; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "操作人") | 
|---|
|  |  |  | @ExcelProperty("操作人") | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | @ColumnWidth(25) | 
|---|
|  |  |  | private String operator; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | private Date operateDt; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "备注") | 
|---|
|  |  |  | @ExcelProperty("备注") | 
|---|
|  |  |  | @ColumnWidth(250) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String remarks; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "控制器ID") | 
|---|
|  |  |  | @ExcelProperty("控制器ID") | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | @ExcelIgnore | 
|---|
|  |  |  | private String controllerId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Schema(title = "控制器地址") | 
|---|
|  |  |  | @ExcelProperty("控制器地址") | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "控制器地址"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String rtuAddr; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "订单号"}) | 
|---|
|  |  |  | @ColumnWidth(25) | 
|---|
|  |  |  | private String orderNumber; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * 水卡编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @JSONField(serializeUsing= ObjectWriterImplToString.class) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private Long cardNum; | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "水卡编号"}) | 
|---|
|  |  |  | @ColumnWidth(20) | 
|---|
|  |  |  | private String cardNum; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 身份证号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "身份证号"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String idCard; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 农户编号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | //@ExcelIgnore | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "农户编号"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String clientNum; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 余额 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "余额"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private Double money; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 收银员姓名 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "收银员姓名"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String cashierName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 卡片状态 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "卡片状态"}) | 
|---|
|  |  |  | @ColumnWidth(15) | 
|---|
|  |  |  | private String cardState; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | * 村庄名称 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ExcelProperty(value = {"${title}", "村庄名称"}) | 
|---|
|  |  |  | @ColumnWidth(20) | 
|---|
|  |  |  | @ColumnWidth(35) | 
|---|
|  |  |  | private String districtTitle; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | con.protocol, | 
|---|
|  |  |  | inta.remarks, | 
|---|
|  |  |  | rtus.isOnLine, | 
|---|
|  |  |  | (SELECT COUNT(*) FROM pr_intake_controller WHERE controllerId = con.id AND intakeId = inta.id AND operateType = 1) AS bindNumber, | 
|---|
|  |  |  | (SELECT COUNT(*) FROM pr_intake_controller WHERE controllerId = con.id AND operateType = 1) AS bindNumber, | 
|---|
|  |  |  | con.findDt AS findDt | 
|---|
|  |  |  | FROM pr_controller con | 
|---|
|  |  |  | LEFT JOIN pr_intake_controller ic ON ic.controllerId = con.id | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="timeStart != null and timeStart != '' "> | 
|---|
|  |  |  | OR rohrl.rtu_dt  < #{timeStart} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStop != null and timeStop != '' "> | 
|---|
|  |  |  | OR rohrl.rtu_dt > #{timeStop} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <!--        <if test="timeStop != null and timeStop != '' ">--> | 
|---|
|  |  |  | <!--            OR rohrl.rtu_dt > #{timeStop}--> | 
|---|
|  |  |  | <!--        </if>--> | 
|---|
|  |  |  | ORDER BY rtu_dt ASC | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | <!--获取最近未报数的取水口--> | 
|---|
|  |  |  | 
|---|
|  |  |  | <if test="timeStart != null"> | 
|---|
|  |  |  | OR rohrl.rtu_dt  < #{timeStart} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="timeStop != null"> | 
|---|
|  |  |  | OR rohrl.rtu_dt > #{timeStop} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <!--        <if test="timeStop != null">--> | 
|---|
|  |  |  | <!--            OR rohrl.rtu_dt > #{timeStop}--> | 
|---|
|  |  |  | <!--        </if>--> | 
|---|
|  |  |  | ORDER BY rtu_dt ASC | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|
|  |  |  | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> changePassword(String id, String oldPassword, String newPassword) throws Exception { | 
|---|
|  |  |  | if (id == null) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("id不能为空"); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("id不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (StringUtils.isNullOrEmpty(oldPassword)) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("旧密码不能为空"); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("旧密码不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (StringUtils.isNullOrEmpty(newPassword)) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("新密码不能为空"); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("新密码不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | 如果前端进行了base64加密 | 
|---|
|  |  |  | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | BaUser po = this.sv.selectById(idLg); | 
|---|
|  |  |  | if (Objects.isNull(po)) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("未得到用户,请求失败"); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("未得到用户,请求失败"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | if (!po.password.equalsIgnoreCase(oldPassword)) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("旧密码不正确,请求失败"); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("旧密码不正确,请求失败"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | count = this.sv.changePassword(idLg, newPassword); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (count <= 0) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail("数据库存储失败"); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("数据库存储失败"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrProject.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson2.JSONArray; | 
|---|
|  |  |  | import com.alibaba.excel.EasyExcel; | 
|---|
|  |  |  | import com.alibaba.excel.support.ExcelTypeEnum; | 
|---|
|  |  |  | import com.alibaba.fastjson2.JSONArray; | 
|---|
|  |  |  | import com.dy.common.aop.SsoAop; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponse; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.common.webUtil.ResultCodeMsg; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.excel.CellWriteHandler; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.excel.ExcelUtil; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoBa.BaClient; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoPr.PrController; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voPr.VoController; | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.io.UnsupportedEncodingException; | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.time.LocalDate; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @SneakyThrows(IOException.class) | 
|---|
|  |  |  | @RequestMapping(value = "/export", method = RequestMethod.GET) | 
|---|
|  |  |  | public void export(HttpServletResponse response, QueryVo vo) { | 
|---|
|  |  |  | setExcelRespProp(response, "控制器列表"); | 
|---|
|  |  |  | //List<VoDivide> memberList = LocalJsonUtil.getListFromJson("json/members.json", VoDivide.class); | 
|---|
|  |  |  | List<VoController> memberList = controllerSv.export(vo); | 
|---|
|  |  |  | //setExcelRespProp(response, "控制器列表"); | 
|---|
|  |  |  | List<VoController> controllerList = controllerSv.export(vo); | 
|---|
|  |  |  | ExcelUtil.setExcelRespProp(response, "控制器列表" + LocalDate.now()); | 
|---|
|  |  |  | EasyExcel.write(response.getOutputStream(), VoController.class) | 
|---|
|  |  |  | .registerWriteHandler(new CellWriteHandler("控制器列表")) | 
|---|
|  |  |  | .sheet("控制器") | 
|---|
|  |  |  | .doWrite(controllerList); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | EasyExcel.write(response.getOutputStream()) | 
|---|
|  |  |  | .head(VoController.class) | 
|---|
|  |  |  | .excelType(ExcelTypeEnum.XLSX) | 
|---|
|  |  |  | .sheet("控制器列表") | 
|---|
|  |  |  | .doWrite(memberList); | 
|---|
|  |  |  | //EasyExcel.write(response.getOutputStream()) | 
|---|
|  |  |  | //        .head(VoController.class) | 
|---|
|  |  |  | //        .excelType(ExcelTypeEnum.XLSX) | 
|---|
|  |  |  | //        .sheet("控制器列表") | 
|---|
|  |  |  | //        .doWrite(memberList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrProject.intake; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.excel.EasyExcel; | 
|---|
|  |  |  | import com.alibaba.excel.support.ExcelTypeEnum; | 
|---|
|  |  |  | import com.dy.common.aop.SsoAop; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponse; | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.common.webUtil.ResultCodeMsg; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.excel.CellWriteHandler; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.excel.ExcelUtil; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoPr.PrIntake; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voPr.VoIntake; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voPr.VoOnLineIntake; | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.io.UnsupportedEncodingException; | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.time.LocalDate; | 
|---|
|  |  |  | import java.time.format.DateTimeFormatter; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("保存分水口异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @SneakyThrows(IOException.class) | 
|---|
|  |  |  | @GetMapping(value = "exportIntakes") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public void exportIntakes(HttpServletResponse response, QueryVo vo) { | 
|---|
|  |  |  | setExcelRespProp(response, "取水口列表"); | 
|---|
|  |  |  | //List<VoDivide> memberList = LocalJsonUtil.getListFromJson("json/members.json", VoDivide.class); | 
|---|
|  |  |  | List<VoIntake> memberList = intakeSv.exportIntakes(vo); | 
|---|
|  |  |  | List<VoIntake> intakeList = intakeSv.exportIntakes(vo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | EasyExcel.write(response.getOutputStream()) | 
|---|
|  |  |  | .head(VoIntake.class) | 
|---|
|  |  |  | .excelType(ExcelTypeEnum.XLSX) | 
|---|
|  |  |  | .sheet("取水口列表") | 
|---|
|  |  |  | .doWrite(memberList); | 
|---|
|  |  |  | ExcelUtil.setExcelRespProp(response, "取水口列表" + LocalDate.now()); | 
|---|
|  |  |  | EasyExcel.write(response.getOutputStream(), VoIntake.class) | 
|---|
|  |  |  | .registerWriteHandler(new CellWriteHandler("取水口列表")) | 
|---|
|  |  |  | .sheet("取水口") | 
|---|
|  |  |  | .doWrite(intakeList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.common.webUtil.ResultCodeMsg; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.excel.CellWriteHandler; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.excel.ExcelUtil; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.excel.ReportExportCellWriteHandler; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoBa.BaClient; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoSe.SeAudits; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoSe.SeGeneral; | 
|---|
|  |  |  | 
|---|
|  |  |  | List<VoGeneral> generalList = generalSv.exportGenerals(vo).getObj(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | EasyExcel.write(response.getOutputStream(), VoGeneral.class) | 
|---|
|  |  |  | .registerWriteHandler(new ReportExportCellWriteHandler("财务对账-总账")) | 
|---|
|  |  |  | .registerWriteHandler(new CellWriteHandler("财务对账-总账")) | 
|---|
|  |  |  | .sheet("总账") | 
|---|
|  |  |  | .doWrite(generalList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | list.add(po); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | EasyExcel.write(response.getOutputStream(), VoTradeDetails.class) | 
|---|
|  |  |  | .registerWriteHandler(new ReportExportCellWriteHandler("财务对账-交易明细")) | 
|---|
|  |  |  | .registerWriteHandler(new CellWriteHandler("财务对账-交易明细")) | 
|---|
|  |  |  | .sheet("交易明细") | 
|---|
|  |  |  | .doWrite(list); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|