Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
abb9fb05
authored
Jan 16, 2019
by
chongli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发票申请功能优化
parent
4d3ed639
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
14 deletions
src/main/java/com/ctrip/fun/admin/controller/basic/InvoiceRequestController.java
src/main/java/com/ctrip/fun/admin/service/basic/InvoiceRequestExcelExportService.java
src/main/java/com/ctrip/fun/admin/service/basic/InvoiceRequestExcelImportService.java
src/main/webapp/WEB-INF/templates/basic/invoiceRequest/invoiceRequestForm.ftl
src/main/webapp/WEB-INF/templates/basic/invoiceRequest/invoiceRequestList.ftl
src/main/java/com/ctrip/fun/admin/controller/basic/InvoiceRequestController.java
View file @
abb9fb05
...
...
@@ -119,13 +119,11 @@ public class InvoiceRequestController {
List
<
InvoiceRequestBean
>
responseBean
=
invoiceRequestExcelExportService
.
list
(
""
,
query
);
response
.
setContentType
(
"application/binary;charset=ISO8859-1"
);
//String filename = communeExcelExportService.createExcelName(form);
String
filename
=
null
;
String
filename
=
"发票申请"
;
try
{
ServletOutputStream
outputStream
=
response
.
getOutputStream
();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy
-MM-
dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy
MM
dd"
);
filename
+=
format
.
format
(
new
Date
());
filename
+=
" 公社会员订单 "
;
filename
=
filename
.
replaceAll
(
" "
,
"_"
);
response
.
setHeader
(
"Content-disposition"
,
"attachment;filename="
+
new
String
(
filename
.
getBytes
(
"gb2312"
),
"ISO8859-1"
)
+
".xlsx"
);
invoiceRequestExcelExportService
.
exportExcel
(
filename
,
responseBean
,
outputStream
);
}
catch
(
IOException
e
)
{
...
...
src/main/java/com/ctrip/fun/admin/service/basic/InvoiceRequestExcelExportService.java
View file @
abb9fb05
...
...
@@ -97,6 +97,7 @@ public class InvoiceRequestExcelExportService extends AbstractExcelExportService
XSSFCell
cell_ExpressNo
=
row
.
createCell
(
9
);
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
()));
XSSFCell
cell_orderNo
=
row
.
createCell
(
11
);
...
...
src/main/java/com/ctrip/fun/admin/service/basic/InvoiceRequestExcelImportService.java
View file @
abb9fb05
...
...
@@ -2,6 +2,7 @@ package com.ctrip.fun.admin.service.basic;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Row
;
...
...
@@ -11,6 +12,7 @@ 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,10 +45,13 @@ public class InvoiceRequestExcelImportService {
bean
.
setId
(
Integer
.
valueOf
(
getCellValue
(
row
.
getCell
(
0
))));
bean
.
setRefusedReason
(
getCellValue
(
row
.
getCell
(
8
)));
bean
.
setExpressNo
(
getCellValue
(
row
.
getCell
(
9
)));
bean
.
setSendTime
(
DateUtil
.
parseDate
(
getCellValue
(
row
.
getCell
(
10
))));
String
aa
=
getCellValue
(
row
.
getCell
(
10
));
if
(!
StringUtils
.
isEmpty
(
getCellValue
(
row
.
getCell
(
10
)))){
bean
.
setSendTime
(
DateUtil
.
parseDate
(
getCellValue
(
row
.
getCell
(
10
))));
}
if
(
isMergedRegion
(
sheet
,
i
,
0
)){
int
lastRow
=
getRowNum
(
cras
,
sheet
.
getRow
(
i
).
getCell
(
0
),
sheet
);
i
=
i
+
lastRow
-
1
;
i
=
lastRow
;
}
beans
.
add
(
bean
);
}
...
...
src/main/webapp/WEB-INF/templates/basic/invoiceRequest/invoiceRequestForm.ftl
View file @
abb9fb05
...
...
@@ -5,12 +5,89 @@
{{/each}}
</script>
<script>
$(function(){
var contactAddress = $("#contactAddress").val();
if(contactAddress!=""){
var contactAddressArray = contactAddress.split("_");
$("#province").val(contactAddressArray[0]);
$("#city").val(contactAddressArray[1]);
$("#county").val(contactAddressArray[2]);
$("#road").val(contactAddressArray[3]);
$("#room").val(contactAddressArray[4]);
}
});
var index = $("#rowsOfOrder").children().length;
$("#submitCheck").click(function(){
var costOfDepart = $("#costOfDepart").val();
var invoiceTitle = $("#invoiceTitle").val();
var taxIdNum = $("#taxIdNum").val();
var province = $("#province").val();
var city = $("#city").val();
var county = $("#county").val();
var road = $("#road").val();
var room = $("#room").val();
var contactName = $("#contactName").val();
var contactTel = $("#contactTel").val();
if(costOfDepart==""){
alert("请填入快递费用归属部门");
return;
}
if(invoiceTitle==""){
alert("请填入发票抬头");
return;
}
if(taxIdNum==""){
alert("请填入纳税识别号");
return;
}
if(province==""){
alert("请填入邮寄地址省份部分");
return;
}
if(city==""){
alert("请填入邮寄地址城市部分");
return;
}
if(county==""){
alert("请填入邮寄地址区县部分");
return;
}
if(road==""){
alert("请填入邮寄地址道路部分");
return;
}
if(room==""){
alert("请填入邮寄地址门牌号部分");
return;
}
if(contactName==""){
alert("请填入寄送联系人");
return;
}
if(contactTel==""){
alert("请填入联系方式");
return;
}
if(index==0){
alert("请填入订单信息");
return;
}
var contactAddress= province+"_"+city+"_"+county+"_"+road+"_"+room;
$("#contactAddress").val(contactAddress);
$("#telTaskForm").submit();
});
var index = $("#rowsOfOrder").children().length;
$("#addOrder").click(function(){
$("#rowsOfOrder").append("<tr> <td style='width:10%'><input type='checkbox'></td> <td style='width:10%'><input name='invoiceOrderInfoBeans["+index+"].orderNo'></td><td style='width:5%'><input name='invoiceOrderInfoBeans["+index+"].courseName'></td><td style='width:16%'><input name='invoiceOrderInfoBeans["+index+"].amount'></td></tr>");
index++;
...
...
@@ -26,6 +103,8 @@ $("#deleteOrder").click(function(){
</script>
</#assign>
...
...
@@ -54,7 +133,18 @@ $("#deleteOrder").click(function(){
<@form.textInput path="dto.costOfDepart" attributes="class=\"input-medium\"" label="快递费用归属部门" required = true />
<@form.textInput path="dto.invoiceTitle" attributes="class=\"input-medium\"" label="发票抬头" required = true />
<@form.textInput path="dto.taxIdNum" attributes="class=\"input-medium\"" label="纳税识别号" required = true />
<@form.textInput path="dto.contactAddress" attributes="class=\"input-medium\"" label="发票寄送地址" required = true />
<div class="long_content_div control-group ">
<label class="control-label" for="contactAddress">发票寄送地址</label>
<div class="controls">
<input type="text" id="province" placeholder="省" class="input-medium" " style='width:50px'>
<input type="text" id="city" placeholder="市" class="input-medium" " style='width:50px'>
<input type="text" id="county" placeholder="区/县" class="input-medium" " style='width:65px'>
<input type="text" id="road" placeholder="路" class="input-medium" " style='width:90px'>
<input type="text" id="room" placeholder="门牌号和房间号" class="input-medium" " style='width:120px'>
</div>
</div>
<@form.hidden "dto.contactAddress"/>
<@form.textInput path="dto.contactName" attributes="class=\"input-medium\"" label="寄送联系人" required = true />
<@form.textInput path="dto.contactTel" attributes="class=\"input-medium\"" label="联系方式" required = true />
<@form.textInput path="dto.invoiceRemark" attributes="class=\"input-medium\"" label="发票备注" required = true />
...
...
src/main/webapp/WEB-INF/templates/basic/invoiceRequest/invoiceRequestList.ftl
View file @
abb9fb05
...
...
@@ -2,11 +2,13 @@
<script>
function changeMobilePhoneToEdit(orderId){
$('#expressNoForFinanceUpdate').val("");
$('#idForFinanceUpdate').val("");
$('#refusedReasonForFinanceUpdate').val("");
$('#sendTimeForFinanceUpdate').val("");
var changeMobilePhoneToEdit = $("#changeMobilePhoneToEdit");
console.dir($("#changeMobilePhoneToEdit"));
changeMobilePhoneToEdit.modal('show');
console.log(changeMobilePhoneToEdit);
$("#idForFinanceUpdate").val(orderId);
...
...
@@ -23,10 +25,7 @@ $("#sendTimeForFinanceUpdate").iCalendar({
});
function financeUpdate(){
alert($('#expressNoForFinanceUpdate').val());
alert($('#idForFinanceUpdate').val());
alert($('#refusedReasonForFinanceUpdate').val());
alert($('#sendTimeForFinanceUpdate').val());
jQuery.ajax({
...
...
@@ -74,8 +73,10 @@ function financeUpdate(){
<form class="form-inline search-box" action="/invoiceRequest/list" method="get" autocomplete="off" style="float:left">
<@com.textInput "dto.contactTel" "style=\"margin-left: 5px;\"" "寄送联系方式"/>
<@com.textInput "dto.requestPerson" "style=\"margin-left: 5px;\"" "发票提交人"/>
<@com.textInput "dto.orderNo" "style=\"margin-left: 5px;\"" "订单号"/>
<@com.singleSelectQuery "dto.status" enums["com.ctrip.fun.common.vo.basic.InvoiceRequestStatusEnum"] "" "处理状态"/>
<@com.textInputTwoDate "dto.createTimeStart" "dto.createTimeEnd" "style=\"margin-left: 5px;\"" "发票提交时间"/>
...
...
@@ -88,6 +89,7 @@ function financeUpdate(){
<table class="table table-bordered table-striped widthShow">
<thead>
<tr>
<th style="width: 50px;">申请ID</th>
<th style="width: 50px;">寄送联系人</th>
<th style="width: 50px;">联系方式</th>
<th style="width: 60px;">提交人</th>
...
...
@@ -107,6 +109,7 @@ function financeUpdate(){
<tbody>
<#list list as item>
<tr>
<td>${item.id!}</td>
<td>${item.contactName!}</td>
<td>${item.contactTel!}</td>
<td>${item.requestPerson!}</td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment