Commit 5c872431 authored by dahai's avatar dahai

添加查询未接收的妥投失败信息

parent 57a0f095
...@@ -4,12 +4,14 @@ import com.yxproject.start.entity.*; ...@@ -4,12 +4,14 @@ import com.yxproject.start.entity.*;
import com.yxproject.start.service.DeliveredService; import com.yxproject.start.service.DeliveredService;
import com.yxproject.start.service.DetailReceiptListService; import com.yxproject.start.service.DetailReceiptListService;
import com.yxproject.start.service.ReceiptService; import com.yxproject.start.service.ReceiptService;
import com.yxproject.start.utils.ExportExcel;
import com.yxproject.start.utils.ReadExcel; import com.yxproject.start.utils.ReadExcel;
import com.yxproject.start.utils.YXJSONResponse; import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.log4j.MDC; import org.apache.log4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -28,6 +30,8 @@ import javax.ws.rs.Consumes; ...@@ -28,6 +30,8 @@ import javax.ws.rs.Consumes;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
...@@ -248,20 +252,20 @@ public class DeliveredApi { ...@@ -248,20 +252,20 @@ public class DeliveredApi {
/** /**
* 查询登记妥投失败信息 * 查询登记妥投失败信息
* *
* @param date 登记时间 * @param startDate 登记时间
* @return 返回值 * @return 返回值
*/ */
@RequestMapping("queryDeliveredFailedByRegisterDate") @RequestMapping("queryDeliveredFailedByRegisterDate")
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public List<Map<String, Object>> queryDeliveredFailedByRegisterDate(@RequestParam("date") String date, HttpServletRequest requ) { public List<Map<String, Object>> queryDeliveredFailedByRegisterDate(@RequestParam("startDate") String startDate,@RequestParam("endDate") String endDate, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr(); String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr); MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
try { try {
mapList = deliveredService.selectDeliveredFailedByRegisterDate(replaceDate(date)); mapList = deliveredService.selectDeliveredFailedByRegisterDate(replaceDate(startDate),replaceDate(endDate));
} catch (Exception e) { } catch (Exception e) {
logger.error("登记妥投失败信息时间:" + date); logger.error("登记妥投失败信息时间:" + startDate+"---------"+endDate);
logger.error("Exception 查询登记妥投失败信息异常", e); logger.error("Exception 查询登记妥投失败信息异常", e);
} }
return mapList; return mapList;
...@@ -355,6 +359,50 @@ public class DeliveredApi { ...@@ -355,6 +359,50 @@ public class DeliveredApi {
return delivered; return delivered;
} }
/**
* 导出未妥投信息
*/
@RequestMapping("printDeliverData")
public byte[] printDeliverData(@RequestBody String list, HttpServletResponse response, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonArray = JSONArray.fromObject(list);
String str ="";
for (int i =0;i<jsonArray.size();i++){
if (i==jsonArray.size()-1){
str+=replaceDate(jsonArray.get(i)+"");
}else {
str+=replaceDate(jsonArray.get(i)+"")+",";
}
}
List<Map<String, Object>> mapList = deliveredService.selectDeliverData(str);
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyy-MM-dd");
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = null;
fout = ExportExcel.exportDeliverDate(mapList);
String outFile = dateTime + "未妥投信息表";
try {
FileInputStream fis = new FileInputStream(new File(fout));
byte[] b = new byte[fis.available()];
fis.read(b);
fis.close();
response.addHeader("Content-Disposition", "attachment;filename=" + outFile + ".xls");
return b;
} catch (FileNotFoundException e) {
e.printStackTrace();
logger.error("未妥投信息ID:" + jsonArray);
logger.error("FileNotFoundException 未妥投信息表未找到", e);
} catch (IOException e) {
e.printStackTrace();
logger.error("未妥投信息ID:" + jsonArray);
logger.error("IOException 未妥投信息表IO异常", e);
}
return null;
}
/** /**
* 查询登记妥投失败类型 * 查询登记妥投失败类型
* *
...@@ -374,6 +422,56 @@ public class DeliveredApi { ...@@ -374,6 +422,56 @@ public class DeliveredApi {
return list; return list;
} }
/**
* 二次确认登记投递失败信息
*/
@RequestMapping("queryDeliveredFailedInfo")
// @RequiresPermissions("userInfo.add")//权限管理;
@Transactional(rollbackFor = Exception.class)
public boolean queryDeliveredFailedInfo(@RequestBody String jsonStr, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
JSONArray jsonarray = new JSONArray();
try {
jsonarray = JSONArray.fromObject(jsonStr);
for (int i = 0; i < jsonarray.size(); i++) {
JSONObject jsonObject = (JSONObject) jsonarray.get(i);
String waybillNumber = jsonObject.getString("waybillNumber");
//todo 查询投递失败的信息 方便二次确认
List<Map<String, Object>> list = deliveredService.selectDeliverDataByWaybillNumber(waybillNumber);
if (list.size()>0){
return true;
}else {
return false;
}
}
}catch (Exception e){
logger.error("异常参数:" + jsonarray);
logger.error("Exception 登记投递失败信息异常", e);
}
return false;
}
/**
* 查询登记妥投失败未接收的信息
* @return 返回值
*/
@RequestMapping("queryDeliveredFailedNotReceive")
// @RequiresPermissions("userInfo.add")//权限管理;
@Transactional(rollbackFor = Exception.class)
public List<Map<String, Object>> queryDeliveredFailedNotReceive( HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
List<Map<String, Object>> mapList = new ArrayList <>();
try {
mapList = deliveredService.selectDeliveredFailedNotReceive();
}catch (Exception e){
logger.error("查询登记妥投失败未接收的信息:" );
logger.error("Exception 查询登记妥投失败未接收的信息", e);
}
return mapList;
}
/** /**
* 去除字符串中中线 * 去除字符串中中线
......
package com.yxproject.start.mapper; package com.yxproject.start.mapper;
import com.yxproject.start.entity.DeliveredFailedInfoEntity; import com.yxproject.start.entity.DeliveredFailedInfoEntity;
import org.apache.ibatis.annotations.Insert; import com.yxproject.start.entity.DeliveredFailedReasonEntity;
import org.apache.ibatis.annotations.Mapper; import com.yxproject.start.entity.DeliveredInfoEntity;
import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.*;
import java.util.List;
import java.util.Map;
/** /**
* @auther zhangyusheng * @auther zhangyusheng
...@@ -15,4 +18,65 @@ public interface DeliveredFailedInfoMapper { ...@@ -15,4 +18,65 @@ public interface DeliveredFailedInfoMapper {
"VALUES (#{waybillNumber},sysdate,#{backReason},#{note},#{registerName},#{cardId})") "VALUES (#{waybillNumber},sysdate,#{backReason},#{note},#{registerName},#{cardId})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID") @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "ID")
public boolean saveDeliveredFailedInfo(DeliveredFailedInfoEntity deliveredFailedInfoEntity); public boolean saveDeliveredFailedInfo(DeliveredFailedInfoEntity deliveredFailedInfoEntity);
@Update("update DELIVERED_INFO set DEAL_DATE =sysdate ,DEAL_STATE =#{dealState} \n" +
" where WAYBILL_NUMBER = #{waybillNumber}")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public boolean updateDeliveredInfo(DeliveredInfoEntity deliveredInfoEntity);
@Select("select * from DELIVERED_INFO where WAYBILL_NUMBER = #{waybillNumber}")
@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="ID")
public List<DeliveredInfoEntity> selectDeliveredInfoByWaybillNumber(String waybillNumber);
@Select("select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,count(PERSON_POST.WAYBILL_NUMBER) post_Count,\n" +
"sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count,\n" +
"sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count \n" +
"from PERSON_POST \n" +
"left join DELIVERED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER\n" +
"where 1=1\n" +
"and to_char(PRINT_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate} \n" +
"group by to_char(PRINT_DATE,'yyyyMMdd')" +
" UNION all\n" +
"select RECEIPT_DATE PRINT_DATE ,\n" +
"count(GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER) post_Count, sum(decode(DELIVERED_INFO.deal_state,1,1,0)) DELIVERED_count, \n" +
"sum(decode(DELIVERED_INFO.deal_state,0,1,0)) DELIVERED_FAILED_count \n" +
"from GREEN_PACKAGE_INFORMATION \n" +
"left join DELIVERED_INFO on GREEN_PACKAGE_INFORMATION.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER \n" +
"where 1=1 and to_char(RECEIPT_DATE,'yyyyMMdd') BETWEEN #{startDate} and #{endDate} group by RECEIPT_DATE" +
"")
public List<Map<String,Object>> selectReport(@Param("startDate")String startDate, @Param("endDate") String endDate);
@Select("select FILE_NAME,IMPORT_DATE,IMPORT_NAME,DELIVERED_INFO.FILE_ID,sum(decode(DELIVERED_INFO.DEAL_STATE,1,1,0)) delive,\n" +
"sum(decode(DELIVERED_INFO.DEAL_STATE,0,1,0)) undelice \n" +
"from DELIVERED_IMPORT_DIC \n" +
"left join DELIVERED_INFO on DELIVERED_INFO.FILE_ID = DELIVERED_IMPORT_DIC.ID " +
"where TO_CHAR(IMPORT_DATE,'yyyyMMdd') = #{date} " +
"group by FILE_NAME,IMPORT_DATE,IMPORT_NAME,DELIVERED_INFO.FILE_ID order by to_char(import_date,'yyyy-mm-dd')")
public List<Map<String,Object>> selectDeliveredByImportDate(@Param("date")String date);
@Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" +
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"where to_char(back_date,'yyyyMMdd') between #{startDate} and #{endDate}")
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(@Param("startDate")String startDate,@Param("endDate")String endDate);
@Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}")
public boolean deleteDeliveredByFileId(@Param("fileId")long fileId);
@Delete("delete from DELIVERED_IMPORT_DIC where id = #{fileId}")
public boolean deleteDeliveredImportDicByFileId(@Param("fileId")long fileId);
@Delete("delete from DELIVERED_FAILED_INFO where id = #{id}")
public boolean deleteDeliveredFailedById(@Param("id")long id);
@Select("select * from DELIVERED_FAILED_REASON ")
public List<DeliveredFailedReasonEntity> selectDeliveredFailedType();
@Select("select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,DELIVERED_INFO.WAYBILL_NUMBER\n" +
"from PERSON_POST \n" +
"left join DELIVERED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER\n" +
"where to_char(PRINT_DATE,'yyyyMMdd') in (${date}) and DELIVERED_INFO.DEAL_STATE =0")
public List<Map<String,Object>> selectDeliverData(@Param("date")String date);
@Select("select * from PERSON_POST where WAYBILL_NUMBER = #{waybillNumber}")
public List<Map<String, Object>> selectDeliverDataByWaybillNumber(@Param("waybillNumber")String waybillNumber);
} }
...@@ -35,8 +35,8 @@ public interface DeliveredInfoMapper { ...@@ -35,8 +35,8 @@ public interface DeliveredInfoMapper {
@Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" + @Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" +
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" + "left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"where to_char(back_date,'yyyyMMdd') = #{date}") "where to_char(back_date,'yyyyMMdd') between #{startDate} and #{endDate}")
public List<Map<String, Object>> selectDeliveredFailedByRegisterDate(@Param("date") String date); public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(@Param("startDate")String startDate,@Param("endDate")String endDate);
@Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}") @Delete("delete from DELIVERED_INFO where FILE_ID = #{fileId}")
public boolean deleteDeliveredByFileId(@Param("fileId") long fileId); public boolean deleteDeliveredByFileId(@Param("fileId") long fileId);
...@@ -49,4 +49,18 @@ public interface DeliveredInfoMapper { ...@@ -49,4 +49,18 @@ public interface DeliveredInfoMapper {
@Select("select * from DELIVERED_FAILED_REASON ") @Select("select * from DELIVERED_FAILED_REASON ")
public List<DeliveredFailedReasonEntity> selectDeliveredFailedType(); public List<DeliveredFailedReasonEntity> selectDeliveredFailedType();
@Select("select to_char(PRINT_DATE,'yyyyMMdd') PRINT_DATE ,DELIVERED_INFO.WAYBILL_NUMBER\n" +
"from PERSON_POST \n" +
"left join DELIVERED_INFO on PERSON_POST.WAYBILL_NUMBER = DELIVERED_INFO.WAYBILL_NUMBER\n" +
"where to_char(PRINT_DATE,'yyyyMMdd') in (${date}) and DELIVERED_INFO.DEAL_STATE =0")
public List<Map<String,Object>> selectDeliverData(@Param("date")String date);
@Select("select * from PERSON_POST where WAYBILL_NUMBER = #{waybillNumber}")
public List<Map<String, Object>> selectDeliverDataByWaybillNumber(@Param("waybillNumber")String waybillNumber);
@Select("select DELIVERED_FAILED_INFO.*,DELIVERED_FAILED_REASON.REASON from DELIVERED_FAILED_INFO\n" +
"left join DELIVERED_FAILED_REASON on DELIVERED_FAILED_REASON.ID = DELIVERED_FAILED_INFO.BACK_REASON\n" +
"where RECEIVE_DATE is null")
public List<Map<String,Object>> selectDeliveredFailedNotReceive();
} }
...@@ -18,8 +18,11 @@ public interface DeliveredService { ...@@ -18,8 +18,11 @@ public interface DeliveredService {
public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities); public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities);
public List<Map<String,Object>> selectDeliveredReport(String startDate,String endDate); public List<Map<String,Object>> selectDeliveredReport(String startDate,String endDate);
public List<DeliveredImportDicEntity> selectDeliveredByImportDate(String date); public List<DeliveredImportDicEntity> selectDeliveredByImportDate(String date);
public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(String date); public List<Map<String,Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate);
public boolean deleteDeliveredByFileId(long filedID); public boolean deleteDeliveredByFileId(long filedID);
public boolean deleteDeliveredFailedById(long id); public boolean deleteDeliveredFailedById(long id);
public List<DeliveredFailedReasonEntity> selectDeliveredFailedType(); public List<DeliveredFailedReasonEntity> selectDeliveredFailedType();
public List<Map<String,Object>> selectDeliverData(String stringList);
public List<Map<String,Object>> selectDeliverDataByWaybillNumber(String waybillNumber);
public List<Map<String,Object>> selectDeliveredFailedNotReceive();
} }
...@@ -36,15 +36,20 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -36,15 +36,20 @@ public class DeliveredServiceImpl implements DeliveredService {
@Override @Override
public boolean saveDeliveredInfoList(List<DeliveredInfoEntity> deliveredInfoEntityList) { public boolean saveDeliveredInfoList(List<DeliveredInfoEntity> deliveredInfoEntityList) {
for (DeliveredInfoEntity deliveredInfoEntity : deliveredInfoEntityList) { for (DeliveredInfoEntity deliveredInfoEntity: deliveredInfoEntityList) {
// List<DeliveredInfoEntity> deliveredInfoEntities = deliveredInfoMapper.selectDeliveredInfoByWaybillNumber(deliveredInfoEntity.getWaybillNumber());
// if (deliveredInfoEntities.size()>0){
// deliveredInfoMapper.updateDeliveredInfo(deliveredInfoEntity);
// }else {
deliveredInfoMapper.saveDeliveredInfo(deliveredInfoEntity); deliveredInfoMapper.saveDeliveredInfo(deliveredInfoEntity);
// }
} }
return true; return true;
} }
@Override @Override
public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities) { public boolean saveDeliveredFailedInfoList(List<DeliveredFailedInfoEntity> deliveredFailedInfoEntities) {
for (DeliveredFailedInfoEntity deliveredFailedInfoEntity : deliveredFailedInfoEntities) { for (DeliveredFailedInfoEntity deliveredFailedInfoEntity :deliveredFailedInfoEntities){
deliveredFailedInfoMapper.saveDeliveredFailedInfo(deliveredFailedInfoEntity); deliveredFailedInfoMapper.saveDeliveredFailedInfo(deliveredFailedInfoEntity);
} }
return false; return false;
...@@ -57,13 +62,13 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -57,13 +62,13 @@ public class DeliveredServiceImpl implements DeliveredService {
} }
@Override @Override
public List<DeliveredImportDicEntity> selectDeliveredByImportDate(String date) { public List<DeliveredImportDicEntity>selectDeliveredByImportDate(String date) {
return deliveredInfoMapper.selectDeliveredByImportDate(date); return deliveredInfoMapper.selectDeliveredByImportDate(date);
} }
@Override @Override
public List<Map<String, Object>> selectDeliveredFailedByRegisterDate(String date) { public List<Map<String, Object>> selectDeliveredFailedByRegisterDate(String startDate,String endDate) {
return deliveredInfoMapper.selectDeliveredFailedByRegisterDate(date); return deliveredInfoMapper.selectDeliveredFailedByRegisterDate(startDate, endDate);
} }
@Override @Override
...@@ -84,4 +89,20 @@ public class DeliveredServiceImpl implements DeliveredService { ...@@ -84,4 +89,20 @@ public class DeliveredServiceImpl implements DeliveredService {
public List<DeliveredFailedReasonEntity> selectDeliveredFailedType() { public List<DeliveredFailedReasonEntity> selectDeliveredFailedType() {
return deliveredInfoMapper.selectDeliveredFailedType(); return deliveredInfoMapper.selectDeliveredFailedType();
} }
@Override
public List<Map<String, Object>> selectDeliverData(String stringList) {
return deliveredInfoMapper.selectDeliverData(stringList);
}
@Override
public List<Map<String, Object>> selectDeliverDataByWaybillNumber(String waybillNumber) {
List<Map<String, Object>> list = deliveredInfoMapper.selectDeliverDataByWaybillNumber(waybillNumber);
return list;
}
@Override
public List<Map<String, Object>> selectDeliveredFailedNotReceive() {
return deliveredInfoMapper.selectDeliveredFailedNotReceive();
}
} }
...@@ -224,5 +224,59 @@ public class ExportExcel { ...@@ -224,5 +224,59 @@ public class ExportExcel {
return "D:\\Excel\\" + simpleDateFormat.format(new Date()) + "交接单" + ".xls"; return "D:\\Excel\\" + simpleDateFormat.format(new Date()) + "交接单" + ".xls";
} }
/**
* 导出未妥投信息
* @param mapList 未妥投信息
* @return
*/
public static String exportDeliverDate(List<Map<String,Object>> mapList){
//第一步创建workbook
HSSFWorkbook wb = new HSSFWorkbook();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
HSSFSheet sheet = wb.createSheet("未妥投信息表");
sheet.setColumnWidth(0, 30 * 110);
sheet.setColumnWidth(1, 30 * 110);
sheet.setColumnWidth(2, 30 * 110);
//第三步创建行row:添加表头0行
HSSFRow row = sheet.createRow(0);
HSSFCellStyle style = wb.createCellStyle();//样式
style.setWrapText(true);//设置自动换行
HSSFFont font = wb.createFont();
font.setFontHeightInPoints((short) 12);
style.setFont(font);
row = sheet.createRow(0); //创建下标为0的单元格
row.setHeightInPoints(Short.parseShort("20"));//设置行高
HSSFCell cell = row.createCell(0); //设定值
cell.setCellValue("打印时间");
cell = row.createCell(1); //设定值
cell.setCellValue("运单号");
cell = row.createCell(2); //设定值
cell.setCellValue("状态");
for (int i =0;i<mapList.size();i++){
row = sheet.createRow(i + 1);
cell = row.createCell(0); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("PRINT_DATE")+"")?"":mapList.get(i).get("PRINT_DATE ")+"");
cell = row.createCell(1); //设定值
cell.setCellValue("null".equals(mapList.get(i).get("WAYBILL_NUMBER")+"")?"":mapList.get(i).get("WAYBILL_NUMBER")+"");
cell = row.createCell(2); //设定值
cell.setCellValue("已打印未妥投");
}
//第六步将生成excel文件保存到指定路径下
FileOutputStream fout = null;
try {
// fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date()) + countyInfoList.get(0).get("COUNTYNAME") + ".xls");
fout = new FileOutputStream("D:\\Excel\\" + simpleDateFormat.format(new Date())+ "未妥投信息表" + ".xls");
wb.write(fout);
fout.close();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Excel文件生成成功..." + new Date());
// return "E:\\Excel\\" + simpleDateFormat.format(new Date()) +countyInfoList.get(0).get("COUNTYNAME") + ".xls";
return "D:\\Excel\\" + simpleDateFormat.format(new Date()) + "未妥投信息表" + ".xls";
}
} }
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