Commit 808489c4 by java-李谡

航线论证excel导出

parent 0a6f66e8
......@@ -193,6 +193,8 @@
where id = #{id,jdbcType=VARCHAR}
</update>
<delete id="deleteConditionByVerifyId">
delete from foc_verify_condition where verif_id=#{verifyId}
</delete>
</mapper>
\ No newline at end of file
......@@ -231,15 +231,15 @@ public class ExportExcel {
* @param title 表格标题,传“空值”,表示无标题
* @param headerList 表头列表
*/
public void initialize(String title, List<String> headerList,int colnum) {
public void initialize(String title, List<String> headerList,int column) {
rownum=0;
if (StringUtils.isNotBlank(title)){
Row titleRow = getRow(rownum++);
Cell titleCell = titleRow.createCell(colnum);
Cell titleCell = titleRow.createCell(column);
titleCell.setCellStyle(styles.get("title"));
titleCell.setCellValue(title);
sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(),
titleRow.getRowNum(), colnum, colnum+headerList.size()-1));
titleRow.getRowNum(), column, column+headerList.size()-1));
}
// Create header
if (headerList == null){
......@@ -247,7 +247,7 @@ public class ExportExcel {
}
Row headerRow = getRow(rownum++);
for (int i = 0; i < headerList.size(); i++) {
Cell cell = headerRow.createCell(i+colnum);
Cell cell = headerRow.createCell(i+column);
cell.setCellStyle(styles.get("header"));
String[] ss = StringUtils.split(headerList.get(i), "**", 2);
if (ss.length==2){
......@@ -262,8 +262,8 @@ public class ExportExcel {
// sheet.autoSizeColumn(i);
}
for (int i = 0; i < headerList.size(); i++) {
int colWidth = (int) (sheet.getColumnWidth(i+colnum)*1.2);
sheet.setColumnWidth(i+colnum, colWidth < 3000 ? 3000 : colWidth);
int colWidth = (int) (sheet.getColumnWidth(i+column)*1.2);
sheet.setColumnWidth(i+column, colWidth < 3000 ? 3000 : colWidth);
}
log.debug("Initialize success.");
}
......@@ -515,7 +515,7 @@ public class ExportExcel {
/**
* 输出到文件
* @param fileName 输出文件名
* @param name 输出文件名
*/
public ExportExcel writeFile(String name) throws FileNotFoundException, IOException{
FileOutputStream os = new FileOutputStream(name);
......@@ -530,8 +530,12 @@ public class ExportExcel {
wb.dispose();
return this;
}
// /**
public List<Object[]> getAnnotationList() {
return annotationList;
}
// /**
// * 导出测试
// */
// public static void main(String[] args) throws Throwable {
......
......@@ -15,6 +15,8 @@ public interface VerifyConditionDao extends BaseDao {
int updateByPrimaryKeySelective(FullVerifyConditionEntity record);
int updateByPrimaryKey(FullVerifyConditionEntity record);
void deleteConditionByVerifyId(String verifyId);
List<FullVerifyConditionEntity> fullList(FullVerifyConditionBean bean);
}
......@@ -14,6 +14,7 @@ import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.ejweb.modules.verify.dao.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -45,10 +46,6 @@ import com.ejweb.modules.verify.bean.AirlineVerifyDetailBean;
import com.ejweb.modules.verify.bean.AirlineVerifyUpdateStatusBean;
import com.ejweb.modules.verify.bean.RecordAddBean;
import com.ejweb.modules.verify.bean.VerifyFormBean;
import com.ejweb.modules.verify.dao.AirlineConclusionDao;
import com.ejweb.modules.verify.dao.AirlineVerifiedDao;
import com.ejweb.modules.verify.dao.AirlineVerifyDao;
import com.ejweb.modules.verify.dao.RecordDao;
import com.ejweb.modules.verify.entity.AirlineVerifyDetailEntity;
import com.ejweb.modules.verify.entity.AirlineVerifyEntity;
import com.ejweb.modules.verify.entity.ConnectionPlan;
......@@ -86,6 +83,8 @@ public class AirlineVerifyService extends BaseService<AirlineVerifyDao>{
AirlineVerifiedDao verifiedDao;
@Autowired
AssessmentDao riskDao;
@Autowired
VerifyConditionDao verifyConditionDao;
public PageEntity<AirlineVerifyEntity> getAirlineVerifyList(AirlineVerifyBean bean) {
PageInfo<AirlineVerifyEntity> pageInfo = null;
// 必须紧贴dao的查询方法
......@@ -450,6 +449,7 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen
dao.updateByStatus(bean);
if("00".equals(bean.getVerifStatus())){
verifiedDao.updateStatus(bean);//将
verifyConditionDao.deleteConditionByVerifyId(bean.getVerifId());
routeDao.deleteRouteByVerifId(bean);//删除各部门论证
}
// 论证终止时,将所有涉及到的系统消息置灰
......
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