Commit a6592c59 authored by xiachenqi's avatar xiachenqi

添加邮局导出excel中 特安标识 字段

parent 8e6994ce
...@@ -523,7 +523,7 @@ public class PersonPostApi { ...@@ -523,7 +523,7 @@ public class PersonPostApi {
HSSFRow firstRow = sheet.createRow(0); HSSFRow firstRow = sheet.createRow(0);
String[] rowTitle = {"订单号", "寄件人姓名", "寄件人电话2", "寄件人详细地址", "收件人姓名", "收件人手机号", String[] rowTitle = {"订单号", "寄件人姓名", "寄件人电话2", "寄件人详细地址", "收件人姓名", "收件人手机号",
"收件人邮编", "邮件号", "内件性质", "重量", "长", "宽", "高", "收件人城市", "收件人区县", "收件人详细地址", "收件人邮编", "邮件号", "内件性质", "重量", "长", "宽", "高", "收件人城市", "收件人区县", "收件人详细地址",
"回单标识", "回单运单号", "商品名称", "内件号", "内件名称"}; "回单标识", "回单运单号", "商品名称", "内件号", "内件名称", "特安标识"};
for (int i = 0; i < rowTitle.length; i++) { for (int i = 0; i < rowTitle.length; i++) {
HSSFCell cell = firstRow.createCell(i); HSSFCell cell = firstRow.createCell(i);
cell.setCellValue(rowTitle[i]); cell.setCellValue(rowTitle[i]);
...@@ -550,6 +550,7 @@ public class PersonPostApi { ...@@ -550,6 +550,7 @@ public class PersonPostApi {
sheet.setColumnWidth(18, (int) ((8.55 + 0.72) * 256)); sheet.setColumnWidth(18, (int) ((8.55 + 0.72) * 256));
sheet.setColumnWidth(19, (int) ((6.64 + 0.72) * 256)); sheet.setColumnWidth(19, (int) ((6.64 + 0.72) * 256));
sheet.setColumnWidth(20, (int) ((19.55 + 0.72) * 256)); sheet.setColumnWidth(20, (int) ((19.55 + 0.72) * 256));
sheet.setColumnWidth(21, (int) ((19.55 + 0.72) * 256));
for (int i = 0; i < records.size(); i++) { for (int i = 0; i < records.size(); i++) {
HSSFRow row = sheet.createRow(i + 1); HSSFRow row = sheet.createRow(i + 1);
PersonPostEntity personPostEntity = records.get(i); PersonPostEntity personPostEntity = records.get(i);
...@@ -585,6 +586,8 @@ public class PersonPostApi { ...@@ -585,6 +586,8 @@ public class PersonPostApi {
// cell.setCellValue(personPostEntity.getBackWaybillNumber()); // cell.setCellValue(personPostEntity.getBackWaybillNumber());
cell = row.createCell(20); cell = row.createCell(20);
cell.setCellValue(personPostEntity.getLatticeMouthInformation()); cell.setCellValue(personPostEntity.getLatticeMouthInformation());
cell = row.createCell(21);
cell.setCellValue(1);
} }
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日生产导出"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日生产导出");
String fileName = simpleDateFormat.format(new Date()) + ".xls"; String fileName = simpleDateFormat.format(new Date()) + ".xls";
......
...@@ -7,6 +7,7 @@ import com.yxproject.start.entity.PersonPostEntity; ...@@ -7,6 +7,7 @@ import com.yxproject.start.entity.PersonPostEntity;
import com.yxproject.start.mapper.FileNameDicMapper; import com.yxproject.start.mapper.FileNameDicMapper;
import com.yxproject.start.mapper.PersonPostMapper; import com.yxproject.start.mapper.PersonPostMapper;
import com.yxproject.start.service.PersonPostService; import com.yxproject.start.service.PersonPostService;
import lombok.extern.java.Log;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,6 +24,7 @@ import java.util.Map; ...@@ -23,6 +24,7 @@ import java.util.Map;
* @auther zhangyusheng * @auther zhangyusheng
* 2019/2/19 15:01 * 2019/2/19 15:01
*/ */
@Log
@Service @Service
public class PersonPostServiceImpl implements PersonPostService { public class PersonPostServiceImpl implements PersonPostService {
@Autowired @Autowired
...@@ -138,6 +140,7 @@ public class PersonPostServiceImpl implements PersonPostService { ...@@ -138,6 +140,7 @@ public class PersonPostServiceImpl implements PersonPostService {
@Override @Override
public boolean addNote(String uploadNo, String note) { public boolean addNote(String uploadNo, String note) {
personPostMapper.addNote(uploadNo, note); personPostMapper.addNote(uploadNo, note);
log.info("取消订单成功。受理号:" +uploadNo + " 备注信息:" +note);
return true; return true;
} }
...@@ -147,9 +150,12 @@ public class PersonPostServiceImpl implements PersonPostService { ...@@ -147,9 +150,12 @@ public class PersonPostServiceImpl implements PersonPostService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean cancelPostByAcceptNo(String uploadNo, String remarks, String name) { public boolean cancelPostByAcceptNo(String uploadNo, String remarks, String name) {
personPostMapper.cancelPostByAcceptNo(uploadNo, remarks, name); // personPostMapper.cancelPostByAcceptNo(uploadNo, remarks, name);
personPostMapper.addNote(uploadNo, remarks); // personPostMapper.addNote(uploadNo, remarks);
System.out.println("cancelPostByAcceptNo: " + uploadNo + " | " + remarks + " | " + name);
System.out.println("addNote: " + uploadNo + " | " + remarks);
return true; return true;
} }
......
package com.yxproject.start.utils; package com.yxproject.start.utils;
import jxl.Cell;
import jxl.Sheet; import jxl.Sheet;
import jxl.Workbook; import jxl.Workbook;
import jxl.read.biff.BiffException; import jxl.read.biff.BiffException;
...@@ -113,6 +114,14 @@ public class ReadExcel { ...@@ -113,6 +114,14 @@ public class ReadExcel {
String columns8 = sheet.getCell(8,i).getContents(); String columns8 = sheet.getCell(8,i).getContents();
String columns9 = sheet.getCell(9,i).getContents(); String columns9 = sheet.getCell(9,i).getContents();
String columns10 = sheet.getCell(10,i).getContents(); String columns10 = sheet.getCell(10,i).getContents();
if (sheet.getColumns() == 11) {
if (columns0.equals("")&&columns1.equals("")&&columns2.equals("")&&columns3.equals("")&&
columns4.equals("")&&columns5.equals("")&&columns6.equals("")&&columns7.equals("")&&
columns8.equals("")&&columns9.equals("")&&columns10.equals("")){
continue;
}
}
if (sheet.getColumns() != 11) {
String columns11 = sheet.getCell(11,i).getContents(); String columns11 = sheet.getCell(11,i).getContents();
String columns12 = sheet.getCell(12,i).getContents(); String columns12 = sheet.getCell(12,i).getContents();
String columns13 = sheet.getCell(13,i).getContents(); String columns13 = sheet.getCell(13,i).getContents();
...@@ -124,6 +133,7 @@ public class ReadExcel { ...@@ -124,6 +133,7 @@ public class ReadExcel {
columns13.equals("")&&columns14.equals("")&&columns15.equals("")){ columns13.equals("")&&columns14.equals("")&&columns15.equals("")){
continue; continue;
} }
}
// sheet.getColumns()返回该页的总列数 // sheet.getColumns()返回该页的总列数
for (int j = 0; j < sheet.getColumns(); j++) { for (int j = 0; j < sheet.getColumns(); j++) {
String cellinfo = sheet.getCell(j, i).getContents(); String cellinfo = sheet.getCell(j, i).getContents();
...@@ -136,11 +146,7 @@ public class ReadExcel { ...@@ -136,11 +146,7 @@ public class ReadExcel {
} }
return outerList; return outerList;
} }
} catch (FileNotFoundException e) { } catch (BiffException | IOException e) {
e.printStackTrace();
} catch (BiffException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
......
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