Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
finance_serv
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 65c61c3d
authored
Aug 07, 2018
by
王军业
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
3325
1 parent
ba431633
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
3 deletions
code/finance_serv/src/main/java/com/vion/financial/config/FinanceConfig.java
code/finance_serv/src/main/java/com/vion/financial/excel/ExportModel.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/ContractServiceImpl.java
code/finance_serv/src/main/resources/application.yml
code/finance_serv/src/main/java/com/vion/financial/config/FinanceConfig.java
View file @
65c61c3
...
...
@@ -10,6 +10,10 @@ public class FinanceConfig {
private
String
authurl
;
private
String
appendsavepath
;
private
String
appendurl
;
private
String
provinceurl
;
private
String
cityurl
;
private
String
countyurl
;
public
String
getAuthurl
()
{
return
authurl
;
...
...
@@ -35,5 +39,29 @@ public class FinanceConfig {
this
.
appendurl
=
appendurl
;
}
public
String
getProvinceurl
()
{
return
provinceurl
;
}
public
void
setProvinceurl
(
String
provinceurl
)
{
this
.
provinceurl
=
provinceurl
;
}
public
String
getCityurl
()
{
return
cityurl
;
}
public
void
setCityurl
(
String
cityurl
)
{
this
.
cityurl
=
cityurl
;
}
public
String
getCountyurl
()
{
return
countyurl
;
}
public
void
setCountyurl
(
String
countyurl
)
{
this
.
countyurl
=
countyurl
;
}
}
code/finance_serv/src/main/java/com/vion/financial/excel/ExportModel.java
View file @
65c61c3
...
...
@@ -3,6 +3,7 @@ package com.vion.financial.excel;
import
java.util.Date
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
cn.afterturn.easypoi.excel.annotation.ExcelIgnore
;
public
class
ExportModel
{
@Excel
(
name
=
"合同编号"
,
orderNum
=
"0"
)
...
...
@@ -18,11 +19,17 @@ public class ExportModel {
@Excel
(
name
=
"销售员"
)
private
String
salesperson_name
=
"-"
;
//销售员名称
@Excel
(
name
=
"省"
)
private
String
province
=
"-"
;
//省份
private
String
province_name
=
"-"
;
//省份
@ExcelIgnore
()
private
String
province
;
@Excel
(
name
=
"市"
)
private
String
city
=
"-"
;
//城市
private
String
city_name
=
"-"
;
//城市
@ExcelIgnore
()
private
String
city
;
@Excel
(
name
=
"县"
)
private
String
county
=
"-"
;
//县
private
String
county_name
=
"-"
;
//县
@ExcelIgnore
()
private
String
county
;
@Excel
(
name
=
"客户名称"
)
private
String
customer_name
=
"-"
;
//顾客名称
@Excel
(
name
=
"项目名称"
)
...
...
@@ -270,6 +277,24 @@ public class ExportModel {
public
void
setSalesperson_unid
(
String
salesperson_unid
)
{
this
.
salesperson_unid
=
salesperson_unid
;
}
public
String
getProvince_name
()
{
return
province_name
;
}
public
void
setProvince_name
(
String
province_name
)
{
this
.
province_name
=
province_name
;
}
public
String
getCity_name
()
{
return
city_name
;
}
public
void
setCity_name
(
String
city_name
)
{
this
.
city_name
=
city_name
;
}
public
String
getCounty_name
()
{
return
county_name
;
}
public
void
setCounty_name
(
String
county_name
)
{
this
.
county_name
=
county_name
;
}
...
...
code/finance_serv/src/main/java/com/vion/financial/service/imp/ContractServiceImpl.java
View file @
65c61c3
...
...
@@ -234,11 +234,29 @@ public class ContractServiceImpl implements ContractService {
public
void
exportExcel
(
SelectVo
selectVo
,
HttpServletResponse
response
)
{
logger
.
info
(
"========================导出合同Excel表格==========================="
);
List
<
Map
>
list_data
=
null
;
List
<
Map
>
list_province
=
null
;
List
<
Map
>
list_city
=
null
;
List
<
Map
>
list_county
=
null
;
String
url
=
financeConfig
.
getAuthurl
();
String
result
=
HttpNetClient
.
doGet
(
url
,
null
);
Map
map
=
JavaBean2Json
.
Json2JavaBean
(
result
,
Map
.
class
);
list_data
=
(
List
<
Map
>)
map
.
get
(
"list_data"
);
String
provinceurl
=
financeConfig
.
getProvinceurl
();
String
province_results
=
HttpNetClient
.
doGet
(
provinceurl
,
null
);
Map
map_provinces
=
JavaBean2Json
.
Json2JavaBean
(
province_results
,
Map
.
class
);
list_province
=(
List
<
Map
>)
map_provinces
.
get
(
"list_data"
);
/* String cityurl=financeConfig.getCityurl();
String city_results=HttpNetClient.doGet(cityurl, null);
Map map_cities=JavaBean2Json.Json2JavaBean(city_results, Map.class);
list_city=(List<Map>) map_cities.get("list_data");
String countyurl=financeConfig.getCountyurl();
String county_results=HttpNetClient.doGet(countyurl, null);
Map map_ciunties=JavaBean2Json.Json2JavaBean(county_results, Map.class);
list_county=(List<Map>) map_ciunties.get("list_data");
*/
if
(
StringUtils
.
isNotBlank
(
selectVo
.
getSalesperson_name__like
()))
{
if
(
list_data
!=
null
&&
list_data
.
size
()
>
0
)
{
List
<
String
>
salesperson_unids
=
new
ArrayList
<
String
>(
list_data
.
size
());
...
...
@@ -261,6 +279,38 @@ public class ContractServiceImpl implements ContractService {
}
}
}
if
(
list_province
!=
null
&&
list_province
.
size
()
>
0
)
{
for
(
Map
_map:
list_province
)
{
if
(
exportModel
.
getProvince
().
equals
(
_map
.
get
(
"province_unid"
)))
{
exportModel
.
setProvince_name
((
String
)
_map
.
get
(
"name"
));
}
}
financeConfig
.
setCityurl
(
"http://192.168.9.162:20080/api/v1/codes/countries/0E229CD043/provinces/"
+
exportModel
.
getProvince
()+
"/cities"
);
String
cityurl
=
financeConfig
.
getCityurl
();
String
city_results
=
HttpNetClient
.
doGet
(
cityurl
,
null
);
Map
map_cities
=
JavaBean2Json
.
Json2JavaBean
(
city_results
,
Map
.
class
);
list_city
=(
List
<
Map
>)
map_cities
.
get
(
"list_data"
);
if
(
list_city
!=
null
&&
list_city
.
size
()
>
0
)
{
for
(
Map
_map:
list_city
)
{
if
(
exportModel
.
getCity
().
equals
(
_map
.
get
(
"city_unid"
)))
{
exportModel
.
setCity_name
((
String
)
_map
.
get
(
"name"
));
}
}
financeConfig
.
setCountyurl
(
"http://192.168.9.162:20080/api/v1/codes/countries/0E229CD043/provinces/"
+
exportModel
.
getProvince
()+
"/cities/"
+
exportModel
.
getCity
()+
"/counties"
);
String
countyurl
=
financeConfig
.
getCountyurl
();
String
county_results
=
HttpNetClient
.
doGet
(
countyurl
,
null
);
Map
map_ciunties
=
JavaBean2Json
.
Json2JavaBean
(
county_results
,
Map
.
class
);
list_county
=(
List
<
Map
>)
map_ciunties
.
get
(
"list_data"
);
if
(
list_county
!=
null
&&
list_county
.
size
()
>
0
)
{
for
(
Map
_map:
list_county
)
{
if
(
exportModel
.
getCounty
().
equals
(
_map
.
get
(
"county_unid"
)))
{
exportModel
.
setCounty_name
((
String
)
_map
.
get
(
"name"
));
}
}
}
}
}
}
try
{
DownLoad
downLoad
=
new
DownLoad
();
...
...
code/finance_serv/src/main/resources/application.yml
View file @
65c61c3
...
...
@@ -47,6 +47,9 @@ finance:
authurl
:
http://192.168.9.162:20080/api/v1/auth/users
appendsavepath
:
/data/face-web/www/static/pics/cache/finance
appendurl
:
http://192.168.9.162:20080/static/pics/cache/finance/
provinceurl
:
http://192.168.9.162:20080/api/v1/codes/countries/0E229CD043/provinces
cityurl
:
http://192.168.9.162:20080/api/v1/codes/countries/0E229CD043/provinces/{$province_unid}/cities
countyurl
:
http://192.168.9.162:20080/api/v1/codes/countries/0E229CD043/provinces/{$province_unid}/cities/{$city_unid}/counties
#pagehelper:
# helperDialect: postgresql
# reasonable: true
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment