Commit 426ed8ab by chongli

销售提交发票功能优化

parent abb9fb05
......@@ -44,8 +44,7 @@ public class InvoiceRquestDto {
private String expressNo;
//发票邮递时间
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date sendTime;
private String sendTime;
//未开票原因
private String refusedReason;
......@@ -141,11 +140,11 @@ public class InvoiceRquestDto {
this.expressNo = expressNo;
}
public Date getSendTime() {
public String getSendTime() {
return sendTime;
}
public void setSendTime(Date sendTime) {
public void setSendTime(String sendTime) {
this.sendTime = sendTime;
}
......
......@@ -5,9 +5,11 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFDataFormat;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
......@@ -55,7 +57,12 @@ public class InvoiceRequestExcelExportService extends AbstractExcelExportService
XSSFSheet sheet = workBook.createSheet();
ExportUtil exportUtil = new ExportUtil(workBook, sheet);
XSSFCellStyle headStyle = exportUtil.getHeadStyle();
//XSSFCellStyle bodyStyle = exportUtil.getBodyStyle();
XSSFCellStyle bodyStyle = workBook.createCellStyle();
XSSFDataFormat format = workBook.createDataFormat();
bodyStyle.setDataFormat(format.getFormat("@"));
XSSFRow headRow = sheet.createRow(0);
XSSFCell cell = null;
......@@ -77,8 +84,11 @@ public class InvoiceRequestExcelExportService extends AbstractExcelExportService
for(InvoiceOrderInfoBean invoiceOrderInfoBean:infoBeans){
XSSFRow row = sheet.createRow(count++);
XSSFCell cell_Id = row.createCell(0);
cell_Id.setCellStyle(bodyStyle);
cell_Id.setCellValue(item.getId()==null?"":item.getId()+"");
XSSFCell cell_CostOfDepart = row.createCell(1);
cell_CostOfDepart.setCellStyle(bodyStyle);
cell_CostOfDepart.setCellValue(item.getCostOfDepart()==null?"":item.getCostOfDepart());
XSSFCell cell_InvoiceTitle = row.createCell(2);
cell_InvoiceTitle.setCellValue(item.getInvoiceTitle()==null?"":item.getInvoiceTitle());
......@@ -95,10 +105,11 @@ public class InvoiceRequestExcelExportService extends AbstractExcelExportService
XSSFCell cell_RefusedReason = row.createCell(8);
cell_RefusedReason.setCellValue(item.getRefusedReason()==null?"":item.getRefusedReason());
XSSFCell cell_ExpressNo = row.createCell(9);
cell_ExpressNo.setCellStyle(bodyStyle);
cell_ExpressNo.setCellValue(item.getExpressNo()==null?"":item.getExpressNo());
XSSFCell cell_SendTime = row.createCell(10);
cell_SendTime.setCellType(cell_SendTime.CELL_TYPE_STRING);
cell_SendTime.setCellValue(item.getSendTime()==null?"":DateUtil.getDateStr(item.getSendTime()));
cell_SendTime.setCellStyle(bodyStyle);
cell_SendTime.setCellValue(item.getSendTime()==null?"":item.getSendTime());
XSSFCell cell_orderNo = row.createCell(11);
cell_orderNo.setCellValue(invoiceOrderInfoBean.getOrderNo()==null?"":invoiceOrderInfoBean.getOrderNo());
......
package com.ctrip.fun.admin.service.basic;
import java.io.InputStream;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
......@@ -11,8 +12,6 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.ctrip.fun.common.core.util.DateUtil;
import com.ctrip.fun.common.core.util.StringUtils;
import com.ctrip.fun.common.vo.basic.InvoiceRequestBean;
public class InvoiceRequestExcelImportService {
......@@ -43,12 +42,11 @@ public class InvoiceRequestExcelImportService {
Row row = sheet.getRow(i);
InvoiceRequestBean bean = new InvoiceRequestBean();
bean.setId(Integer.valueOf(getCellValue(row.getCell(0))));
bean.setRefusedReason(getCellValue(row.getCell(8)));
String aa = getCellValue(row.getCell(9));
bean.setExpressNo(getCellValue(row.getCell(9)));
String aa = getCellValue(row.getCell(10));
if(!StringUtils.isEmpty(getCellValue(row.getCell(10)))){
bean.setSendTime(DateUtil.parseDate(getCellValue(row.getCell(10))));
}
bean.setSendTime(getCellValue(row.getCell(10)));
if(isMergedRegion(sheet,i,0)){
int lastRow = getRowNum(cras,sheet.getRow(i).getCell(0),sheet);
i = lastRow;
......@@ -219,7 +217,11 @@ public class InvoiceRequestExcelImportService {
}else if(cell.getCellType() == Cell.CELL_TYPE_FORMULA){
return cell.getCellFormula() ;
}else if(cell.getCellType() == Cell.CELL_TYPE_NUMERIC){
return String.valueOf(cell.getNumericCellValue());
if(String.valueOf(cell.getNumericCellValue()).indexOf("E")==-1){
return String.valueOf(cell.getNumericCellValue());
}else {
return new DecimalFormat("#").format(cell.getNumericCellValue());
}
}
return "";
}
......
......@@ -164,8 +164,8 @@ $("#deleteOrder").click(function(){
</tr>
</tr>
<tr>
<td style="width:10%">请选择</td>
<td style="width:10%">订单号</td>
<td style="width:10%">删除勾选</td>
<td style="width:10%">订单号/赛事活动</td>
<td style="width:5%">开票金额</td>
<td style="width:16%">球场名称</td>
</tr>
......
......@@ -117,11 +117,13 @@ function financeUpdate(){
<#if item.status==1>
<td>待处理</td>
<#elseif item.status==2>
<td>已处理</td>
<td>已否决</td>
<#else>
<td>已开票</td>
</#if>
<td>${item.refusedReason!}</td>
<td>${item.expressNo!}</td>
<td>${(item.sendTime?string('yyyy-MM-dd'))!}</td>
<td>${item.sendTime!}</td>
<td> <a href="/invoiceRequest/edit?id=${item.id!}" >查看</a> </td>
<td> <a href='javascript:void(0);' onclick="changeMobilePhoneToEdit('${item.id!}')" >处理</a> </td>
......
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 sign in to comment