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 1a724108
authored
Aug 06, 2018
by
王军业
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[修改合同]
1 parent
0dd46a5a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
65 deletions
code/finance_serv/src/main/java/com/vion/financial/config/FinanceConfig.java
code/finance_serv/src/main/java/com/vion/financial/controller/AppendixController.java
code/finance_serv/src/main/java/com/vion/financial/mapping/ContractMapper.xml
code/finance_serv/src/main/java/com/vion/financial/service/AppendixService.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/AppendixServiceImpl.java
code/finance_serv/src/main/resources/application.yml
code/finance_serv/src/main/java/com/vion/financial/config/FinanceConfig.java
View file @
1a72410
...
...
@@ -8,6 +8,8 @@ import org.springframework.stereotype.Component;
public
class
FinanceConfig
{
private
String
authurl
;
private
String
appendsavepath
;
private
String
appendurl
;
public
String
getAuthurl
()
{
return
authurl
;
...
...
@@ -17,4 +19,21 @@ public class FinanceConfig {
this
.
authurl
=
authurl
;
}
public
String
getAppendsavepath
()
{
return
appendsavepath
;
}
public
void
setAppendsavepath
(
String
appendsavepath
)
{
this
.
appendsavepath
=
appendsavepath
;
}
public
String
getAppendurl
()
{
return
appendurl
;
}
public
void
setAppendurl
(
String
appendurl
)
{
this
.
appendurl
=
appendurl
;
}
}
code/finance_serv/src/main/java/com/vion/financial/controller/AppendixController.java
View file @
1a72410
...
...
@@ -36,39 +36,6 @@ public class AppendixController extends BaseController{
@PostMapping
(
value
=
"/{contract_unid}/upload/appendixes"
)
@ResponseBody
public
Object
upload
(
AppendixVo
appendixVo
)
{
try
{
Appendix
appendix
=
null
;
List
<
Appendix
>
list
=
new
ArrayList
<
Appendix
>
();
MultipartFile
[]
appendix_files
=
appendixVo
.
getAppendix_files
();
for
(
MultipartFile
multipartFile
:
appendix_files
)
{
appendix
=
new
Appendix
();
appendix
.
setAppendix_name
(
multipartFile
.
getOriginalFilename
());
appendix
.
setBusiness_table
(
appendixVo
.
getBusiness_table
());
String
suffix
=
appendix
.
getAppendix_name
().
substring
(
appendix
.
getAppendix_name
().
lastIndexOf
(
"."
)
+
1
);
appendix
.
setAppendix_type
(
suffix
);
appendix
.
setAppendix_url
(
"E:\\"
+
multipartFile
.
getOriginalFilename
());
AppendixService
.
addAppendix
(
appendix
);
list
.
add
(
appendix
);
InputStream
inputStream
=
multipartFile
.
getInputStream
();
File
file
=
new
File
(
"E:\\"
+
multipartFile
.
getOriginalFilename
());
OutputStream
os
=
new
FileOutputStream
(
file
);
byte
[]
read
=
new
byte
[
2048
];
int
off
=
0
;
while
((
off
=
inputStream
.
read
(
read
))
!=
-
1
)
{
os
.
write
(
read
);
}
os
.
flush
();
os
.
close
();
inputStream
.
close
();
}
return
list
;
}
catch
(
Exception
e
)
{
// TODO: handle exception
e
.
printStackTrace
();
failCode
.
setEcode
(
"500"
);
failCode
.
setEnote
(
"上传异常"
);
return
failCode
;
}
return
AppendixService
.
upload
(
appendixVo
);
}
}
code/finance_serv/src/main/java/com/vion/financial/mapping/ContractMapper.xml
View file @
1a72410
...
...
@@ -190,91 +190,94 @@
from tb_contract where contract_unid = #{contract_unid}
</select>
<update
id=
"updateOne"
parameterType=
"com.vion.financial.vo.ContractVo"
>
update tb_contract set
update tb_contract
<set>
<if
test=
"salesperson_unid != null and salesperson_unid != ''"
>
salesperson_unid=#{salesperson_unid}
salesperson_unid=#{salesperson_unid}
,
</if>
<if
test=
"province != null and province != ''"
>
,province=#{province}
province=#{province},
</if>
<if
test=
"city !=null and city != ''"
>
, city=#{city}
city=#{city},
</if>
<if
test=
"county != null and county != ''"
>
,county=#{county}
county=#{county},
</if>
<if
test=
"guarantee_period != null and guarantee_period != ''"
>
,guarantee_period=#{guarantee_period}
guarantee_period=#{guarantee_period},
</if>
<if
test=
"sign_date != null and sign_date != ''"
>
,sign_date=#{sign_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler}
sign_date=#{sign_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if>
<if
test=
"product_line_type != null and product_line_type != ''"
>
,product_line_type=#{product_line_type}
product_line_type=#{product_line_type},
</if>
<if
test=
"contract_state != null and contract_state != ''"
>
,contract_state=#{contract_state}
contract_state=#{contract_state},
</if>
<if
test=
"contract_type != null and contract_type != ''"
>
,contract_type=#{contract_type}
contract_type=#{contract_type},
</if>
<if
test=
"contract_amount != null and contract_amount != ''"
>
,contract_amount=#{contract_amount}
contract_amount=#{contract_amount},
</if>
<if
test=
"deduct_amount != null and deduct_amount != ''"
>
,deduct_amount=#{deduct_amount}
deduct_amount=#{deduct_amount},
</if>
<if
test=
"contract_amount_note != null and contract_amount_note != ''"
>
,contract_type=#{contract_type}
contract_type=#{contract_type},
</if>
<if
test=
"stop_amount != null and stop_amount != ''"
>
,stop_amount=#{stop_amount}
stop_amount=#{stop_amount},
</if>
<if
test=
"reback_note != null and reback_note != ''"
>
,reback_note=#{reback_note}
reback_note=#{reback_note},
</if>
<if
test=
"exemptions_amount != null and exemptions_amount != ''"
>
,exemptions_amount=#{exemptions_amount}
exemptions_amount=#{exemptions_amount},
</if>
<if
test=
"contract_remain_note != null and contract_remain_note != ''"
>
,contract_remain_note=#{contract_remain_note}
contract_remain_note=#{contract_remain_note},
</if>
<if
test=
"is_archive != null and is_archive != ''"
>
,is_archive=#{is_archive}
is_archive=#{is_archive},
</if>
<if
test=
"bad_amount != null and bad_amount != ''"
>
,bad_amount=#{bad_amount}
bad_amount=#{bad_amount},
</if>
<if
test=
"bad_amount_note != null and bad_amount_note != ''"
>
,bad_amount_note=#{bad_amount_note}
bad_amount_note=#{bad_amount_note},
</if>
<if
test=
"confirm_income_amount != null and confirm_income_amount != ''"
>
,confirm_income_amount=#{confirm_income_amount}
confirm_income_amount=#{confirm_income_amount},
</if>
<if
test=
"amount_state_unid != null and amount_state_unid != ''"
>
,amount_state_unid=#{amount_state_unid}
amount_state_unid=#{amount_state_unid},
</if>
<if
test=
"start_guarantee_date != null "
>
,start_guarantee_date=#{start_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler}
start_guarantee_date=#{start_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if>
<if
test=
"end_guarantee_date != null "
>
,end_guarantee_date=#{end_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler}
end_guarantee_date=#{end_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if>
<if
test=
"mainten_start_point != null and mainten_start_point != ''"
>
,mainten_start_point=#{mainten_start_point}
mainten_start_point=#{mainten_start_point},
</if>
<if
test=
"contract_note != null and contract_note != ''"
>
,contract_note=#{contract_note}
contract_note=#{contract_note},
</if>
<if
test=
"is_delete != null and is_delete != ''"
>
,is_delete=#{is_delete}
is_delete=#{is_delete},
</if>
<if
test=
"project_unid != null and project_unid != ''"
>
,project_unid=#{project_unid}
project_unid=#{project_unid},
</if>
<if
test=
"customer_unid != null and customer_unid != ''"
>
,
customer_unid=#{customer_unid}
customer_unid=#{customer_unid}
</if>
</set>
where contract_unid=#{contract_unid}
</update>
<delete
id=
"deleteOne"
parameterType=
"java.lang.String"
>
...
...
code/finance_serv/src/main/java/com/vion/financial/service/AppendixService.java
View file @
1a72410
...
...
@@ -3,10 +3,12 @@ package com.vion.financial.service;
import
java.util.List
;
import
com.vion.financial.entity.Appendix
;
import
com.vion.financial.vo.AppendixVo
;
public
interface
AppendixService
{
public
Object
queryAppendixList
(
Appendix
appendix
);
public
Object
addAppendix
(
Appendix
appendix
);
public
Object
updateAppendix
(
Appendix
appendix
);
public
Object
deleteAppendix
(
Appendix
appendix
);
public
Object
upload
(
AppendixVo
appendixVo
);
}
code/finance_serv/src/main/java/com/vion/financial/service/imp/AppendixServiceImpl.java
View file @
1a72410
package
com
.
vion
.
financial
.
service
.
imp
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.vion.financial.config.FinanceConfig
;
import
com.vion.financial.entity.Appendix
;
import
com.vion.financial.mapper.AppendixMapper
;
import
com.vion.financial.service.AppendixService
;
import
com.vion.financial.vo.AppendixVo
;
import
com.vion.financial.vo.FailCode
;
import
com.vion.financial.vo.SuccessCode
;
...
...
@@ -23,6 +31,8 @@ public class AppendixServiceImpl implements AppendixService {
FailCode
failCode
;
@Autowired
SuccessCode
successCode
;
@Autowired
FinanceConfig
financeConfig
;
@Override
public
Object
queryAppendixList
(
Appendix
appendix
)
{
// TODO Auto-generated method stub
...
...
@@ -89,4 +99,42 @@ public class AppendixServiceImpl implements AppendixService {
}
}
public
Object
upload
(
AppendixVo
appendixVo
)
{
try
{
Appendix
appendix
=
null
;
List
<
Appendix
>
list
=
new
ArrayList
<
Appendix
>
();
MultipartFile
[]
appendix_files
=
appendixVo
.
getAppendix_files
();
for
(
MultipartFile
multipartFile
:
appendix_files
)
{
appendix
=
new
Appendix
();
appendix
.
setAppendix_name
(
multipartFile
.
getOriginalFilename
());
appendix
.
setBusiness_table
(
appendixVo
.
getBusiness_table
());
String
suffix
=
appendix
.
getAppendix_name
().
substring
(
appendix
.
getAppendix_name
().
lastIndexOf
(
"."
)
+
1
);
appendix
.
setAppendix_type
(
suffix
);
appendix
.
setAppendix_url
(
"E:\\"
+
multipartFile
.
getOriginalFilename
());
addAppendix
(
appendix
);
list
.
add
(
appendix
);
InputStream
inputStream
=
multipartFile
.
getInputStream
();
File
file
=
new
File
(
"E:\\"
+
multipartFile
.
getOriginalFilename
());
OutputStream
os
=
new
FileOutputStream
(
file
);
byte
[]
read
=
new
byte
[
2048
];
int
off
=
0
;
while
((
off
=
inputStream
.
read
(
read
))
!=
-
1
)
{
os
.
write
(
read
);
}
os
.
flush
();
os
.
close
();
inputStream
.
close
();
}
return
list
;
}
catch
(
Exception
e
)
{
// TODO: handle exception
e
.
printStackTrace
();
failCode
.
setEcode
(
"500"
);
failCode
.
setEnote
(
"上传异常"
);
return
failCode
;
}
}
}
code/finance_serv/src/main/resources/application.yml
View file @
1a72410
...
...
@@ -45,8 +45,8 @@ logging:
finance
:
authurl
:
http://192.168.9.162:20080/api/v1/auth/users
appendsavepath
:
appendurl
:
http://192.168.9.162:20080/
appendsavepath
:
/data/face-web/www/static/pics/cache/finance
appendurl
:
http://192.168.9.162:20080/
static/pics/cache/finance/
#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