Commit 05675619 by 罗胜

2024-7-4

1.油量分析导出
2.论证终止
parent 357bdcec
Manifest-Version: 1.0
Main-Class:
Class-Path: javax.ejb.jar javax.jms.jar javax.servlet.jar javax.resource
.jar javax.annotation.jar javax.persistence.jar javax.servlet.jsp.jar j
avax.transaction.jar javax.annotation.jar javax.transaction.jar javax.j
ms.jar javax.ejb.jar javax.resource.jar javax.servlet.jar javax.servlet
.jsp.jar javax.persistence.jar mail.jar asm-4.2.jar jstl-1.2.jar cglib-
3.1.jar poi-4.1.2.jar castor-1.2.jar gson-2.3.1.jar guava-17.0.jar jtds
-1.3.1.jar mail-1.4.5.jar dom4j-1.6.1.jar itext-2.1.7.jar jedis-2.9.0.j
ar c3p0-0.9.1.1.jar druid-1.0.29.jar fronts-1.0.0.jar geoip2-2.1.0.jar
log4j-1.2.17.jar quartz-2.2.2.jar jdtcore-3.1.0.jar mybatis-3.3.0.jar h
ttpcore-4.4.4.jar httpmime-4.5.2.jar jcommon-1.0.15.jar pinyin4j-2.5.0.
jar xmlbeans-2.3.0.jar aopalliance-1.0.jar aspectjrt-1.7.4.jar classmat
e-1.0.0.jar fastjson-1.2.83.jar fluent-hc-4.5.2.jar poi-ooxml-4.1.2.jar
xml-apis-1.3.02.jar commons-io-2.0.1.jar groovy-all-2.2.2.jar httpclie
nt-4.5.2.jar jsqlparser-0.9.1.jar maxmind-db-1.0.0.jar pagehelper-4.0.3
.jar slf4j-api-1.7.13.jar SparseBitSet-1.2.jar bcprov-jdk16-1.45.jar co
mmons-codec-1.9.jar easypoi-web-4.2.0.jar ehcache-web-2.0.4.jar freemar
ker-2.3.20.jar hutool-all-5.8.11.jar jfreechart-1.0.12.jar lucene-core-
4.5.1.jar quartz-jobs-2.2.2.jar subethasmtp-3.1.7.jar easypoi-base-4.2.
0.jar ehcache-core-2.4.6.jar jackson-core-2.2.3.jar jakarta-regexp-1.4.
jar aspectjweaver-1.7.4.jar commons-email-1.3.2.jar commons-lang3-3.3.2
.jar commons-logging-1.2.jar commons-math3-3.6.1.jar commons-pool2-2.5.
0.jar jasperreports-5.6.0.jar jul-to-slf4j-1.7.13.jar thumbnailator-0.4
.8.jar UserAgentUtils-1.13.jar commons-digester-2.1.jar lucene-queries-
4.5.1.jar lucene-sandbox-4.5.1.jar mybatis-spring-1.2.3.jar npl-tire-sp
lit-1.0.0.jar slf4j-log4j12-1.7.13.jar jcl-over-slf4j-1.7.13.jar olap4j
-0.9.7.309-JS-3.jar bbdtek-geo-split-1.0.1.jar jackson-databind-2.2.3.j
ar jboss-logging-3.1.3.GA.jar poi-ooxml-schemas-4.1.2.jar spring-tx-4.2
.2.RELEASE.jar commons-collections4-4.1.jar commons-fileupload-1.2.2.ja
r easypoi-annotation-4.2.0.jar lucene-queryparser-4.5.1.jar spring-aop-
4.2.2.RELEASE.jar spring-orm-4.2.2.RELEASE.jar spring-oxm-4.2.2.RELEASE
.jar spring-web-4.2.2.RELEASE.jar commons-collections-3.2.1.jar jackson
-annotations-2.2.3.jar spring-core-4.2.2.RELEASE.jar spring-jdbc-4.2.2.
RELEASE.jar spring-beans-4.2.2.RELEASE.jar validation-api-1.1.0.Final.j
ar mysql-connector-java-5.1.38.jar spring-webmvc-4.2.2.RELEASE.jar spri
ng-context-4.2.2.RELEASE.jar lucene-analyzers-common-4.5.1.jar hibernat
e-validator-5.1.1.Final.jar spring-data-redis-2.0.0.RELEASE.jar spring-
expression-4.2.2.RELEASE.jar esdk_ec_native_professional_java.jar sprin
g-context-support-4.2.2.RELEASE.jar com.springsource.org.apache.commons
.beanutils-1.7.0.jar
......@@ -42,7 +42,8 @@ file.image.thumb.is.allow=true
file.image.thumb.width=640
file.image.thumb.height=640
# The Prefix Url
file.prefix.url=http://123.56.146.7/foc/static/
#file.prefix.url=http://123.56.146.7/foc/static/
file.prefix.url=https://ewatch.okayapps.com/foc/static/
# The Common API List Page Size(default 10)
page.size=20
......
......@@ -2,7 +2,7 @@
db.table.prefix=foc_
jdbc.type=mysql
jdbc.driver.class=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://81.69.44.115:5508/jd_foc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
jdbc.url=jdbc:mysql://81.69.44.115:5508/jd_foc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
jdbc.username=sms_develop
jdbc.password=Develop2018!@#
#\u521d\u59cb\u5316\u8fde\u63a5
......
......@@ -15,4 +15,5 @@ log4j.appender.R.MaxFileSize=10485760
log4j.appender.R.MaxBackupIndex=3
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%-5p] %-d{yyyy-MM-dd HH:mm:ss.SSS} %c%l%n%m%n
log4j.appender.encoder.charset=UTF-8
......@@ -130,9 +130,20 @@
</select>
<resultMap id="oilAnalysisEntity" type="com.ejweb.modules.airport.entity.OilAnalysisEntity">
<collection property="records" ofType="com.ejweb.modules.airport.entity.SoundRecordEntity">
<result column="start_time" property="startTime" />
<result column="end_time" property="endTime" />
<result column="create_name" property="caller" />
<result column="create_phone" property="callerPhone" />
<result column="username" property="called" />
<result column="phone" property="calledPhone" />
</collection>
</resultMap>
<select id="getExcelOilAnalysisData" resultType="com.ejweb.modules.airport.entity.OilAnalysisEntity">
select DATE_FORMAT(sta.std, '%Y/%m/%d %H:%i')as std,
DATE_FORMAT(sta.std, '%Y/%m/%d %H:%i:%s')as stdExcel,
DATE_FORMAT(sta.std, '%Y-%m-%d %H:%i:%s')as stdTime,
sta.flight_no,
sta.ac_no,
sta.dispatcher_name,
......@@ -593,6 +604,27 @@
order by a.update_time desc
</select>
<select id="getSoundRecordList" resultType="com.ejweb.modules.airport.entity.SoundRecordEntity">
select sr.*
from foc_ods b
join sys_user su on b.staff_id = su.id
join (select DATE_FORMAT(r.start_time, '%Y/%m/%d %H:%i:%s') as start_time,
DATE_FORMAT(r.end_time, '%Y/%m/%d %H:%i:%s') as end_time,
r.create_name as caller,
r.create_phone as callerPhone,
p.phone as calledPhone,
p.username as called,
r.create_by
from foc_sound_records r
left join foc_sound_phones p on r.id = p.record_id
where start_time) sr
on DATE_FORMAT(sr.start_time, '%Y-%m-%d %H:%i:%s') between #{entity.stdTime} and date_add(#{entity.stdTime}, interval 150 minute) and
(su.id = sr.create_by or su.mobile = sr.calledPhone)
where b.flight_date = DATE_FORMAT(#{entity.stdTime}, '%Y-%m*%d')
and b.flight_no = #{entity.flightNo}
and b.ac_no = #{entity.acNo}
</select>
<!--已不用-->
<!--
......
......@@ -2,25 +2,44 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ejweb.modules.change.dao.ChangeDao">
<select id="getChangeList" resultType="com.ejweb.modules.change.entity.ChangeListEntity">
<resultMap id="changeListEntity" type="com.ejweb.modules.change.entity.ChangeListEntity">
<result column="updateDate" property="updateDate"></result>
<result column="fieldName" property="fieldName"></result>
<result column="editFrom" property="editFrom"></result>
<result column="editTo" property="editTo"></result>
<result column="fileFrom" property="fileFrom"></result>
<result column="fileTo" property="fileTo"></result>
<result column="userCode" property="userCode"></result>
<result column="departName" property="departName"></result>
<result column="userName" property="userName"></result>
<collection property="files" ofType="com.ejweb.modules.change.entity.RecordFileEntity">
<result property="name" column="name"></result>
<result property="path" column="path"></result>
</collection>
</resultMap>
<select id="getChangeList" resultMap="changeListEntity">
SELECT
c.create_date AS updateDate,
'申请单' AS fieldName,
NULL AS editFrom,
CASE WHEN c.record_type ='04' THEN '新增了申请单'
WHEN c.record_type ='06' THEN '论证终止'
WHEN c.record_type ='06' THEN concat('论证终止原因:',c.remarks)
WHEN c.record_type ='07' THEN '重开了申请单'
END editTo,
NULL AS fileFrom,
NULL AS fileTo,
c.create_by AS userCode,
d.depart_name AS departName,
u.name AS userName
u.name AS userName,
vcf.name,
vcf.path
FROM
foc_verify_record c
LEFT JOIN sys_user_profiles p ON c.create_by = p.user_id
LEFT JOIN foc_user_depart d ON p.depart_id = d.id
LEFT JOIN sys_user u ON c.create_by=u.id
left join foc_verify_record_file vcf on vcf.record_id=c.id
WHERE c.del_flag = '0'
<if test="delFlag != null and delFlag != ''">
AND #{delFlag}='2'
......@@ -40,7 +59,9 @@
c.file_to AS fileTo,
c.update_by AS userCode,
d.depart_name AS departName,
u.name AS userName
u.name AS userName,
null as name,
null as path
FROM foc_verify_change c
LEFT JOIN sys_user_profiles p ON c.update_by = p.user_id
LEFT JOIN foc_user_depart d ON p.depart_id = d.id
......
......@@ -59,7 +59,15 @@
#{userCode}
)
</insert>
<select id="GetLastRecord" resultType="com.ejweb.modules.verify.entity.RecordEntity">
<insert id="addRecordFile">
insert into foc_verify_record_file (record_id,name,path)
values
<foreach collection="files" item="file" separator="," >
(#{recordId},#{file.name},concat(#{prefixUrl},#{file.path}))
</foreach>
</insert>
<select id="GetLastRecord" resultType="com.ejweb.modules.verify.entity.RecordEntity">
SELECT
a.verif_id AS verifId,
a.remarks,
......
......@@ -18,19 +18,13 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.ejweb.modules.airport.entity.StatisticalEntity;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Comment;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
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.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -51,12 +45,14 @@ public class ExportExcel {
* 工作薄对象
*/
private SXSSFWorkbook wb;
// private XSSFWorkbook wb;
/**
* 工作表对象
*/
private Sheet sheet;
// private Sheet sheet;
private SXSSFSheet sheet;
/**
* 样式列表
*/
......@@ -187,7 +183,8 @@ public class ExportExcel {
*/
private void initialize(String title, List<String> headerList) {
this.wb = new SXSSFWorkbook(500);
this.sheet = wb.createSheet("Export");
// this.wb = new XSSFWorkbook();
this.sheet = wb.createSheet();
this.styles = createStyles(wb);
// Create title
if (StringUtils.isNotBlank(title)){
......@@ -205,6 +202,7 @@ public class ExportExcel {
}
Row headerRow = sheet.createRow(rownum++);
headerRow.setHeightInPoints(16);
sheet.trackAllColumnsForAutoSizing();
for (int i = 0; i < headerList.size(); i++) {
Cell cell = headerRow.createCell(i);
cell.setCellStyle(styles.get("header"));
......@@ -247,6 +245,7 @@ public class ExportExcel {
throw new RuntimeException("headerList not null!");
}
Row headerRow = getRow(rownum++);
sheet.trackAllColumnsForAutoSizing();
for (int i = 0; i < headerList.size(); i++) {
Cell cell = headerRow.createCell(i+column);
cell.setCellStyle(styles.get("header"));
......@@ -260,7 +259,7 @@ public class ExportExcel {
}else{
cell.setCellValue(headerList.get(i));
}
// sheet.autoSizeColumn(i);
sheet.autoSizeColumn(i);
}
for (int i = 0; i < headerList.size(); i++) {
int colWidth = (int) (sheet.getColumnWidth(i+column)*1.2);
......@@ -273,28 +272,28 @@ public class ExportExcel {
* @param wb 工作薄对象
* @return 样式列表
*/
private Map<String, CellStyle> createStyles(Workbook wb) {
public static Map<String, CellStyle> createStyles(Workbook wb) {
Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
CellStyle style = wb.createCellStyle();
style.setAlignment(CellStyle.ALIGN_CENTER);
style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
Font titleFont = wb.createFont();
titleFont.setFontName("Arial");
titleFont.setFontHeightInPoints((short) 16);
titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
titleFont.setBold(true);
style.setFont(titleFont);
styles.put("title", style);
style = wb.createCellStyle();
style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);
style.setBorderRight(CellStyle.BORDER_THIN);
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setBorderRight(BorderStyle.THIN);
style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
style.setBorderLeft(CellStyle.BORDER_THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
style.setBorderTop(CellStyle.BORDER_THIN);
style.setBorderTop(BorderStyle.THIN);
style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
style.setBorderBottom(CellStyle.BORDER_THIN);
style.setBorderBottom(BorderStyle.THIN);
style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
Font dataFont = wb.createFont();
dataFont.setFontName("Arial");
......@@ -304,29 +303,29 @@ public class ExportExcel {
style = wb.createCellStyle();
style.cloneStyleFrom(styles.get("data"));
style.setAlignment(CellStyle.ALIGN_LEFT);
style.setAlignment(HorizontalAlignment.LEFT);
styles.put("data1", style);
style = wb.createCellStyle();
style.cloneStyleFrom(styles.get("data"));
style.setAlignment(CellStyle.ALIGN_CENTER);
style.setAlignment(HorizontalAlignment.CENTER);
styles.put("data2", style);
style = wb.createCellStyle();
style.cloneStyleFrom(styles.get("data"));
style.setAlignment(CellStyle.ALIGN_RIGHT);
style.setAlignment(HorizontalAlignment.RIGHT);
styles.put("data3", style);
style = wb.createCellStyle();
style.cloneStyleFrom(styles.get("data"));
// style.setWrapText(true);
style.setAlignment(CellStyle.ALIGN_CENTER);
style.setAlignment(HorizontalAlignment.CENTER);
style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
Font headerFont = wb.createFont();
headerFont.setFontName("Arial");
headerFont.setFontHeightInPoints((short) 10);
headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
titleFont.setBold(true);
headerFont.setColor(IndexedColors.WHITE.getIndex());
style.setFont(headerFont);
styles.put("header", style);
......
......@@ -170,7 +170,7 @@ public class ImportExcel {
try {
Cell cell = row.getCell(column);
if (cell != null) {
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
if (cell.getCellType() == CellType.NUMERIC) {
// 处理日期格式、时间格式
if (HSSFDateUtil.isCellDateFormatted(cell)) {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
......@@ -179,17 +179,17 @@ public class ImportExcel {
} else {
val = cell.getNumericCellValue();
}
} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
} else if (cell.getCellType() == CellType.STRING) {
val = cell.getStringCellValue();
} else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
} else if (cell.getCellType() == CellType.FORMULA) {
try {
val = String.valueOf(cell.getStringCellValue());
} catch (IllegalStateException e) {
val = String.valueOf(cell.getNumericCellValue());
}
} else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
} else if (cell.getCellType() == CellType.BOOLEAN) {
val = cell.getBooleanCellValue();
} else if (cell.getCellType() == Cell.CELL_TYPE_ERROR) {
} else if (cell.getCellType() == CellType.ERROR) {
val = cell.getErrorCellValue();
}
}
......
package com.ejweb.modules.airport.api;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.util.ObjUtil;
import com.ejweb.core.api.RequestBean;
import com.ejweb.core.api.ResponseBean;
import com.ejweb.core.base.PageEntity;
import com.ejweb.core.conf.ErrorCode;
import com.ejweb.core.conf.GConstants;
import com.ejweb.core.util.Encodes;
import com.ejweb.core.utils.excel.ExportExcel;
import com.ejweb.modules.airport.bean.*;
import com.ejweb.modules.airport.entity.ExtraOilRuleEntity;
import com.ejweb.modules.airport.entity.OilAnalysisEntity;
import com.ejweb.modules.airport.entity.OilTargetEntity;
import com.ejweb.modules.airport.entity.ResidualOilSummaryEntity;
import com.ejweb.modules.airport.entity.*;
import com.ejweb.modules.airport.service.OilAnalysisService;
import com.ejweb.modules.airport.utils.ExcelStyleUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping(value = "/api/oil")
......@@ -64,18 +69,31 @@ public class OilAnalysisController {
list = page.getList();
}
//自定义导出序号
String fileName = "油量分析统计(油量单位:KGS).xlsx";
try {
new ExportExcel("油量分析统计(油量单位:KGS)", OilAnalysisEntity.class).setDataList(list).write(response, fileName).dispose();
// new ExportExcel("油量分析统计(油量单位:KGS)", OilAnalysisEntity.class).setDataList(list).writeFile("D:\\"+fileName).dispose();
// 设置URLEncoder.encode 防止中文乱码
// String fileName = URLEncoder.encode("油量分析统计(油量单位:KGS).xlsx" , "UTF-8");
// new ExportExcel("油量分析统计(油量单位:KGS)", OilAnalysisEntity.class).setDataList(list).write(response, fileName).dispose();
response.setContentType("application/octet-stream; charset=utf-8");
response.setHeader("Content-Disposition", "attachment; filename="+ Encodes.urlEncode("油量分析统计(油量单位:KGS).xlsx"));
ExportParams params = new ExportParams();
params.setTitle("油量分析统计(油量单位:KGS)");
params.setStyle(ExcelStyleUtil.class);
Workbook workbook = ExcelExportUtil.exportExcel(params, OilAnalysisEntity.class, list);
workbook.write(response.getOutputStream());
} catch (IOException e) {
responseBean.setMessage("导出数据失败" + e.getMessage());
return responseBean;
// return responseBean;
}
return responseBean;
}
@RequestMapping(value = "/selectAnalysisIolById")
public ResponseBean selectAnalysisIolById(RequestBean requestBean) {
ResponseBean responseBean = new ResponseBean();
......
......@@ -2,10 +2,7 @@ package com.ejweb.modules.airport.dao;
import com.ejweb.core.base.BaseDao;
import com.ejweb.modules.airport.bean.*;
import com.ejweb.modules.airport.entity.ExtraOilRuleEntity;
import com.ejweb.modules.airport.entity.OilAnalysisEntity;
import com.ejweb.modules.airport.entity.OilTargetEntity;
import com.ejweb.modules.airport.entity.ResidualOilSummaryEntity;
import com.ejweb.modules.airport.entity.*;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -43,4 +40,5 @@ public interface OilAnalysisDao extends BaseDao {
void deleteRuleById(@Param("id") Integer id);
List<SoundRecordEntity> getSoundRecordList(@Param("entity") OilAnalysisEntity oilAnalysisEntity);
}
package com.ejweb.modules.airport.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.ejweb.core.utils.excel.annotation.ExcelField;
public class SoundRecordEntity {
@ExcelField(title = "开始时间", type = 0, align = 1, sort = 1)
@Excel(name = "开始时间",width = 20)
private String startTime;
@ExcelField(title = "结束时间", type = 0, align = 1, sort = 2)
@Excel(name = "结束时间",width = 20)
private String endTime;
@ExcelField(title = "呼叫人", type = 0, align = 1, sort = 1)
@Excel(name = "呼叫人",width = 20)
private String caller;
@ExcelField(title = "呼叫人电话", type = 0, align = 1, sort = 1)
@Excel(name = "呼叫人电话",width = 20)
private String callerPhone;
@ExcelField(title = "被叫人", type = 0, align = 1, sort = 1)
@Excel(name = "被叫人",width = 20)
private String called;
@ExcelField(title = "被叫人电话", type = 0, align = 1, sort = 1)
@Excel(name = "被叫人电话",width = 20)
private String calledPhone;
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getCaller() {
return caller;
}
public void setCaller(String caller) {
this.caller = caller;
}
public String getCallerPhone() {
return callerPhone;
}
public void setCallerPhone(String callerPhone) {
this.callerPhone = callerPhone;
}
public String getCalled() {
return called;
}
public void setCalled(String called) {
this.called = called;
}
public String getCalledPhone() {
return calledPhone;
}
public void setCalledPhone(String calledPhone) {
this.calledPhone = calledPhone;
}
}
package com.ejweb.modules.airport.service;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.ejweb.core.base.BaseService;
import com.ejweb.core.base.PageEntity;
import com.ejweb.modules.airport.bean.*;
import com.ejweb.modules.airport.dao.LeftOverOilDao;
import com.ejweb.modules.airport.dao.OilAnalysisDao;
import com.ejweb.modules.airport.entity.ExtraOilRuleEntity;
import com.ejweb.modules.airport.entity.OilAnalysisEntity;
import com.ejweb.modules.airport.entity.OilTargetEntity;
import com.ejweb.modules.airport.entity.ResidualOilSummaryEntity;
import com.ejweb.modules.airport.entity.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.ObjectUtils;
......@@ -57,6 +55,7 @@ public class OilAnalysisService extends BaseService<OilAnalysisDao> {
oilAnalysisEntityList = oilAnalysisDao.getExcelOilAnalysisData(bean);
}
for (OilAnalysisEntity oilAnalysisEntity : oilAnalysisEntityList) {
int index = oilAnalysisEntityList.indexOf(oilAnalysisEntity);
oilAnalysisEntity.setNo(index + 1);
oilAnalysisEntity.setRate(oilAnalysisEntity.getRate() + "%");
......@@ -92,7 +91,10 @@ public class OilAnalysisService extends BaseService<OilAnalysisDao> {
oilAnalysisEntity.setExtraOil("");
oilAnalysisEntity.setExtraOilReason("");
}
if(!isPage&& StrUtil.equals("机组要求",oilAnalysisEntity.getExtraOilReason())){
List<SoundRecordEntity> soundRecordList = oilAnalysisDao.getSoundRecordList(oilAnalysisEntity);
oilAnalysisEntity.setRecords(soundRecordList);
}
if (ObjectUtils.notEqual(oilAnalysisEntity.getPlanLeftOver(), null)) {
String planLeftOver = String.valueOf(oilAnalysisEntity.getPlanLeftOver());
//0下标为年,1位月,2位日
......@@ -182,7 +184,7 @@ public class OilAnalysisService extends BaseService<OilAnalysisDao> {
}
pageInfo = new PageInfo<OilAnalysisEntity>(oilAnalysisEntityList);
if (pageInfo.getPages() < bean.getPageNo()) {// 页码大于总页数,则返回NULL
if (isPage&&pageInfo.getPages() < bean.getPageNo()) {// 页码大于总页数,则返回NULL
return null;
}
......
package com.ejweb.modules.airport.utils;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;
import cn.afterturn.easypoi.excel.export.styler.ExcelExportStylerDefaultImpl;
import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
import org.apache.poi.ss.usermodel.*;
public class ExcelStyleUtil implements IExcelExportStyler {
/**
* 大标题样式
*/
private CellStyle headerStyle;
/**
* 每列标题样式
*/
private CellStyle titleStyle;
/**
* 数据行样式
*/
private CellStyle styles;
public ExcelStyleUtil(Workbook workbook) {
this.init(workbook);
}
/**
* 初始化样式
*
* @param workbook
*/
private void init(Workbook workbook) {
this.headerStyle = initHeaderStyle(workbook);
this.titleStyle = initTitleStyle(workbook);
this.styles = initStyles(workbook);
}
@Override
public CellStyle getHeaderStyle(short i) {
return headerStyle;
}
@Override
public CellStyle getTitleStyle(short i) {
return titleStyle;
}
@Override
public CellStyle getStyles(boolean b, ExcelExportEntity excelExportEntity) {
return styles;
}
@Override
public CellStyle getStyles(Cell cell, int i, ExcelExportEntity excelExportEntity, Object o, Object o1) {
return styles;
}
@Override
public CellStyle getTemplateStyles(boolean b, ExcelForEachParams excelForEachParams) {
return styles;
}
/**
* 初始化--大标题样式
*
* @param workbook
* @return
*/
private CellStyle initHeaderStyle(Workbook workbook) {
CellStyle cellStyle = workbook.createCellStyle();
// Sheet sheet = workbook.getSheetAt(0);
// sheet.setColumnWidth(0,30*256);
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
Font titleFont = workbook.createFont();
titleFont.setFontName("Arial");
titleFont.setFontHeightInPoints((short) 16);
titleFont.setBold(true);
cellStyle.setFont(titleFont);
return cellStyle;
}
/**
* 初始化--每列标题样式
*
* @param workbook
* @return
*/
private CellStyle initTitleStyle(Workbook workbook) {
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
// Sheet sheet = workbook.getSheetAt(0);
// sheet.setColumnWidth(0,30*256);
// sheet.setDefaultRowHeightInPoints((short)10);
Font dataFont = workbook.createFont();
dataFont.setFontName("Arial");
dataFont.setFontHeightInPoints((short) 10);
dataFont.setBold(true);
dataFont.setColor(IndexedColors.WHITE.getIndex());
cellStyle.setFont(dataFont);
return cellStyle;
}
/**
* 初始化--数据行样式
*
* @param workbook
* @return
*/
private CellStyle initStyles(Workbook workbook) {
CellStyle cellStyle = workbook.createCellStyle();
// Sheet sheet = workbook.getSheetAt(0);
//// sheet.setColumnWidth(0,30*256);
// sheet.setDefaultRowHeightInPoints((short) 10);
// sheet.setDefaultRowHeight((short) 10);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
Font dataFont = workbook.createFont();
// dataFont.setFontName("Arial");
dataFont.setFontName("宋体");
dataFont.setFontHeightInPoints((short) 10);
cellStyle.setFont(dataFont);
return cellStyle;
}
/**
* 基础样式
*
* @return
*/
private CellStyle getBaseCellStyle(Workbook workbook) {
CellStyle cellStyle = workbook.createCellStyle();
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
// Sheet sheet = workbook.getSheetAt(0);
// sheet.setColumnWidth(0,30*256);
// sheet.setDefaultRowHeightInPoints((short)10);
Font dataFont = workbook.createFont();
dataFont.setFontName("Arial");
dataFont.setFontHeightInPoints((short) 10);
dataFont.setBold(true);
dataFont.setColor(IndexedColors.WHITE.getIndex());
cellStyle.setFont(dataFont);
return cellStyle;
}
/**
* 字体样式
*
* @param size 字体大小
* @param isBold 是否加粗
* @return
*/
private Font getFont(Workbook workbook, short size, boolean isBold) {
Font font = workbook.createFont();
//字体样式
font.setFontName("宋体");
//是否加粗
font.setBold(isBold);
//字体大小
font.setFontHeightInPoints(size);
return font;
}
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.annotation.JSONField;
import com.ejweb.core.base.BaseEntity;
import java.util.Date;
import java.util.List;
/**
* @author yuxg
......@@ -25,6 +26,17 @@ public class ChangeListEntity extends BaseEntity {
private String departName; // userCode所属部门名称
private String fileFrom; // 修改前
private String fileTo; // 修改后
private List<RecordFileEntity> files;
public List<RecordFileEntity> getFiles() {
return files;
}
public void setFiles(List<RecordFileEntity> files) {
this.files = files;
}
public Date getUpdateDate() {
return updateDate;
}
......@@ -96,5 +108,6 @@ public class ChangeListEntity extends BaseEntity {
public void setFileTo(String fileTo) {
this.fileTo = fileTo;
}
}
package com.ejweb.modules.change.entity;
public class RecordFileEntity {
private String name;
private String path;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
......@@ -15,7 +15,7 @@ public class UploadFileBean {
private String name;
private String inputName;
private String extesion;
@JSONField(deserialize=false)
// @JSONField(deserialize=false)
private String path;
private String thumbs;
private String md5;
......
package com.ejweb.modules.verify.bean;
import com.ejweb.modules.upload.bean.UploadFileBean;
import org.hibernate.validator.constraints.NotEmpty;
import com.ejweb.core.base.GenericBean;
import java.util.List;
/**
* 获取论证详情参数
* @author lyw
......@@ -17,7 +21,28 @@ public class AirlineVerifyUpdateStatusBean extends GenericBean {
private String verifStatus;
@NotEmpty(message="userCode不能为空")
private String userCode;
@NotEmpty(message="终止原因不能为空")
private String remarks;
private List<UploadFileBean> files;
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public List<UploadFileBean> getFiles() {
return files;
}
public void setFiles(List<UploadFileBean> files) {
this.files = files;
}
public String getVerifId() {
return verifId;
}
......
......@@ -4,9 +4,11 @@ package com.ejweb.modules.verify.dao;
import java.util.List;
import com.ejweb.core.base.BaseDao;
import com.ejweb.modules.upload.bean.UploadFileBean;
import com.ejweb.modules.verify.bean.RecordAddBean;
import com.ejweb.modules.verify.bean.RecordBean;
import com.ejweb.modules.verify.entity.RecordEntity;
import org.apache.ibatis.annotations.Param;
/**
*
......@@ -20,4 +22,6 @@ public interface RecordDao extends BaseDao{
List<RecordEntity> findList(RecordBean bean);
void insert(RecordAddBean bean);
RecordEntity GetLastRecord(String verifid);
void addRecordFile(@Param("recordId") String recordId,@Param("files") List<UploadFileBean> files,@Param("prefixUrl") String filePrefixUrl);
}
package com.ejweb.modules.verify.service;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.ejweb.core.base.BaseService;
import com.ejweb.core.base.PageEntity;
......@@ -16,6 +17,7 @@ import com.ejweb.modules.route.dao.RouteVerifyDao;
import com.ejweb.modules.sailing.bean.SailingCmDetailBean;
import com.ejweb.modules.sailing.dao.SailingCommandDao;
import com.ejweb.modules.sailing.dao.SailingConclusionDao;
import com.ejweb.modules.upload.bean.UploadFileBean;
import com.ejweb.modules.verify.bean.*;
import com.ejweb.modules.verify.bean.AirlineVerifyAddBean.Connect;
import com.ejweb.modules.verify.dao.*;
......@@ -268,7 +270,8 @@ public class AirlineVerifyService extends BaseService<AirlineVerifyDao> {
airlineVerifyDetailEntity.setConnectionPlan(lst);
}
RecordEntity recordEntity = recordDao.GetLastRecord(bean.getVerifId());
if (recordEntity != null && "02".equals(recordEntity.getRecordStatus())) {
// if (recordEntity != null && "02".equals(recordEntity.getRecordStatus())) {
if (recordEntity != null ) {
airlineVerifyDetailEntity.setRecordReason(recordEntity.getRemarks());
}
airlineVerifyDetailEntity.setVerify2type(dao.getVerify2typeList(bean));
......@@ -436,6 +439,7 @@ public class AirlineVerifyService extends BaseService<AirlineVerifyDao> {
addbean1.setId(IdWorker.getNextId());
addbean1.setUserCode(bean.getUserCode());
addbean1.setVerifId(bean.getVerifId());
addbean1.setRemarks(bean.getRemarks());
dao.updateByStatus(bean);
if ("00".equals(bean.getVerifStatus())) {
verifiedDao.updateStatus(bean);//将
......@@ -454,6 +458,12 @@ public class AirlineVerifyService extends BaseService<AirlineVerifyDao> {
addbean1.setRecordType("06");
recordDao.insert(addbean1);
List<UploadFileBean> files = bean.getFiles();
if (CollUtil.isNotEmpty(files)) {
String filePrefixUrl = GConstants.FILE_PREFIX_URL;
recordDao.addRecordFile(addbean1.getId(),files,filePrefixUrl);
}
} else if ("00".equals(bean.getVerifStatus())) {
// 增加论证重开操作履历
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment