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 931ae499
authored
Aug 06, 2018
by
谢明辉
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'develop' of
http://192.168.9.26/platform/finance_serv
into develop
2 parents
8c1f94c6
ac14a5eb
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
198 additions
and
164 deletions
code/finance_serv/resources/application.yml
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/controller/BaseController.java
code/finance_serv/src/main/java/com/vion/financial/controller/ProjectAcceptancController.java
code/finance_serv/src/main/java/com/vion/financial/mapping/ContractMapper.xml
code/finance_serv/src/main/java/com/vion/financial/mapping/DeliverGoodsMapper.xml
code/finance_serv/src/main/java/com/vion/financial/mapping/PaymentAgreeMapper.xml
code/finance_serv/src/main/java/com/vion/financial/mapping/ProjectAcceptancMapper.xml
code/finance_serv/src/main/java/com/vion/financial/mapping/ReceiptMapper.xml
code/finance_serv/src/main/java/com/vion/financial/mapping/ReturnInfoMapper.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/java/com/vion/financial/service/imp/ContractServiceImpl.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/DeliverGoodsServiceImpl.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/PaymentAgreeServiceImpl.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/ProjectAcceptancServiceImpl.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/ReceiptServiceImpl.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/ReturnInfoServiceImpl.java
code/finance_serv/src/main/java/com/vion/financial/vo/PaymentAgreeVo.java
code/finance_serv/src/main/java/com/vion/financial/vo/ReceiptVo.java
code/finance_serv/src/main/java/com/vion/financial/vo/ReturnInfoVo.java
code/finance_serv/src/main/resources/application.yml
deploy/application.yml.in
code/finance_serv/resources/application.yml
deleted
100644 → 0
View file @
8c1f94c
server
:
port
:
8080
spring
:
thymeleaf
:
prefix
:
classpath:/templates/thymeleaf/
suffix
:
.html
mode
:
HTML5
encoding
:
UTF-8
cache
:
false
datasource
:
url
:
jdbc:postgresql://192.168.9.162:5432/financial_serv
username
:
postgres
password
:
authpass
driver-class-name
:
org.postgresql.Driver
###################以下为druid增加的配置###########################
type
:
com.alibaba.druid.pool.DruidDataSource
# 下面为连接池的补充设置,应用到上面所有数据源中
# 初始化大小,最小,最大
initialSize
:
5
minIdle
:
5
maxActive
:
20
# 配置获取连接等待超时的时间
maxWait
:
60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis
:
60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis
:
300000
# hikari:
# maximum-pool-size:
http
:
multipart
:
max-file-size
:
20Mb
max-request-size
:
40Mb
mybatis
:
mapper-locations
:
com/vion/financial/mapping/*.xml
logging
:
level
:
root
:
INFO
pattern
:
level
:
INFO
console
:
"
[financial_serv]-[%d{yyyy-MM-dd
HH:mm:ss.SSS}]-%m%n"
path
:
F:\LOG\
#pagehelper:
# helperDialect: postgresql
# reasonable: true
# supportMethodsArguments: true
# params: count=countSql
\ No newline at end of file
code/finance_serv/src/main/java/com/vion/financial/config/FinanceConfig.java
View file @
931ae49
...
...
@@ -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 @
931ae49
...
...
@@ -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/controller/BaseController.java
View file @
931ae49
...
...
@@ -10,10 +10,12 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@RestController
@RequestMapping
(
value
=
"/api/v1/financial/contracts"
)
public
class
BaseController
extends
WebMvcConfigurerAdapter
{
public
void
assCoresMappings
(
CorsRegistry
corsRegistry
)
{
corsRegistry
.
addMapping
(
"/**"
)
@Override
public
void
addCorsMappings
(
CorsRegistry
corsRegistry
)
{
corsRegistry
.
addMapping
(
"/api/v1/financial/contracts/**"
)
.
allowedOrigins
(
"*"
)
.
allowedMethods
(
"GET"
,
"POST"
,
"PUT"
,
"OPTION"
,
"DELETE"
,
"PATCH"
)
.
allowCredentials
(
true
).
maxAge
(
3600
);
super
.
addCorsMappings
(
corsRegistry
);
}
}
code/finance_serv/src/main/java/com/vion/financial/controller/ProjectAcceptancController.java
View file @
931ae49
...
...
@@ -22,25 +22,25 @@ public class ProjectAcceptancController extends BaseController{
@Resource
ProjectAcceptancService
projectAcceptancService
;
@GetMapping
(
"/{contract_unid}/acceptancs"
)
@GetMapping
(
"/{contract_unid}/
project/
acceptancs"
)
@ResponseBody
public
Object
queryAcceptancInfo
(
@PathVariable
String
contract_unid
)
{
return
projectAcceptancService
.
queryProjectAcceptanc
(
contract_unid
);
}
@PostMapping
(
"/{contract_unid}/acceptancs"
)
@PostMapping
(
"/{contract_unid}/
project/
acceptancs"
)
@ResponseBody
public
Object
addAcceptancInfo
(
@RequestBody
ProjectAcceptancVo
projectAcceptancVo
,
@PathVariable
String
contract_unid
)
{
return
projectAcceptancService
.
addProjectAcceptanc
(
projectAcceptancVo
,
contract_unid
);
}
@PutMapping
(
"/{contract_unid}/acceptancs"
)
@PutMapping
(
"/{contract_unid}/
project/
acceptancs"
)
@ResponseBody
public
Object
updateAcceptancInfo
(
@RequestBody
ProjectAcceptancVo
projectAcceptancVo
,
@PathVariable
String
contract_unid
)
{
return
projectAcceptancService
.
updateProjectAcceptanc
(
projectAcceptancVo
,
contract_unid
);
}
@DeleteMapping
(
"/{contract_unid}/acceptancs"
)
@DeleteMapping
(
"/{contract_unid}/
project/
acceptancs"
)
@ResponseBody
public
Object
deleteAcceptancInfo
(
@RequestBody
ProjectAcceptancVo
projectAcceptancVo
,
@PathVariable
String
contract_unid
)
{
return
projectAcceptancService
.
deleteProjectAcceptanc
(
projectAcceptancVo
,
contract_unid
);
...
...
code/finance_serv/src/main/java/com/vion/financial/mapping/ContractMapper.xml
View file @
931ae49
...
...
@@ -67,10 +67,10 @@
<if
test=
"amount_state_unid != null and amount_state_unid != ''"
>
,amount_state_unid
</if>
<if
test=
"start_guarantee_date != null
and start_guarantee_date != ''
"
>
<if
test=
"start_guarantee_date != null "
>
,start_guarantee_date
</if>
<if
test=
"end_guarantee_date != null
and end_guarantee_date != ''
"
>
<if
test=
"end_guarantee_date != null "
>
,end_guarantee_date
</if>
<if
test=
"mainten_start_point != null and mainten_start_point != ''"
>
...
...
@@ -105,8 +105,8 @@
<if
test=
"guarantee_period != null and guarantee_period != ''"
>
,#{guarantee_period}
</if>
<if
test=
"sign_date != null
and sign_date != ''
"
>
,{sign_date}
<if
test=
"sign_date != null "
>
,{sign_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler
}
</if>
<if
test=
"product_line_type != null and product_line_type != ''"
>
,#{product_line_type}
...
...
@@ -153,11 +153,11 @@
<if
test=
"amount_state_unid != null and amount_state_unid != ''"
>
,#{amount_state_unid}
</if>
<if
test=
"start_guarantee_date != null
and start_guarantee_date != ''
"
>
,#{start_guarantee_date}
<if
test=
"start_guarantee_date != null "
>
,#{start_guarantee_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler
}
</if>
<if
test=
"end_guarantee_date != null
and end_guarantee_date != ''
"
>
,#{end_guarantee_date}
<if
test=
"end_guarantee_date != null "
>
,#{end_guarantee_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler
}
</if>
<if
test=
"mainten_start_point != null and mainten_start_point != ''"
>
,#{mainten_start_point}
...
...
@@ -190,91 +190,93 @@
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}
<if
test=
"sign_date != null "
>
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_amount_note=#{contract_amount_note},
</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
and start_guarantee_date != ''
"
>
,start_guarantee_date=#{start_guarantee_date}
<if
test=
"start_guarantee_date != null "
>
start_guarantee_date=#{start_guarantee_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if>
<if
test=
"end_guarantee_date != null
and end_guarantee_date != ''
"
>
,end_guarantee_date=#{end_guarantee_date}
<if
test=
"end_guarantee_date != null "
>
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"
>
...
...
@@ -381,7 +383,7 @@
</if>
<if
test=
"start_date != null and end_date !=null"
>
and
#{start_date
}
<![CDATA[<=]]>
sign_date and sign_date
<![CDATA[<=]]>
#{end_date
}
#{start_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler}
<![CDATA[<=]]>
sign_date and sign_date
<![CDATA[<=]]>
#{end_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler
}
</if>
<if
test=
"amount_start_point !=null and amount_start_point !=0.00"
>
and
...
...
code/finance_serv/src/main/java/com/vion/financial/mapping/DeliverGoodsMapper.xml
View file @
931ae49
...
...
@@ -3,13 +3,13 @@
<mapper
namespace=
"com.vion.financial.mapper.DeliverGoodsMapper"
>
<insert
id=
"addDeliverGoods"
parameterType=
"com.vion.financial.entity.DeliverGoods"
>
insert into tb_deliver_goods (contract_unid,deliver_goods_date,goods_acceptanc_date)
values(#{contract_unid},#{deliver_goods_date
},#{goods_acceptanc_date})
values(#{contract_unid},#{deliver_goods_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},#{goods_acceptanc_date,typeHandler=com.vion.financial.handler.MilliDateTypeHandler})
</insert>
<update
id=
"updateDeliverGoods"
parameterType=
"com.vion.financial.entity.DeliverGoods"
>
update tb_deliver_goods set
<if
test=
"deliver_goods_date !=null"
>
deliver_goods_date = #{deliver_goods_date
},
goods_acceptanc_date = #{goods_acceptanc_date
}
deliver_goods_date = #{deliver_goods_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
goods_acceptanc_date = #{goods_acceptanc_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler}
</if>
where deliver_unid = #{deliver_unid}
</update>
...
...
code/finance_serv/src/main/java/com/vion/financial/mapping/PaymentAgreeMapper.xml
View file @
931ae49
...
...
@@ -69,7 +69,7 @@
cast(payment_propority as decimal(18,2)),
payment_requirement
from tb_payment_agree
where contract_unid = #{contract_unid}
where contract_unid = #{contract_unid}
order by payment_progress asc
</select>
<delete
id=
"deletePaymentAgree"
parameterType=
"int"
>
delete from tb_payment_agree where payment_unid = #{payment_unid}
...
...
code/finance_serv/src/main/java/com/vion/financial/mapping/ProjectAcceptancMapper.xml
View file @
931ae49
...
...
@@ -6,7 +6,7 @@
values(#{contract_unid},#{acceptanc_type},#{acceptanc_date},#{acceptanc_note})
</insert>
<update
id=
"updateProjectAcceptanc"
parameterType=
"com.vion.financial.entity.ProjectAcceptanc"
>
update tb_project_acceptanc set contract_unid = #{contract_unid},acceptanc_type = #{acceptanc_type},acceptanc_date = #{acceptanc_date},acceptanc_note = #{acceptanc_note}
update tb_project_acceptanc set contract_unid = #{contract_unid},acceptanc_type = #{acceptanc_type},acceptanc_date = #{acceptanc_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler
},acceptanc_note = #{acceptanc_note}
where acceptanc_unid = #{acceptanc_unid}
</update>
<select
id=
"queryProjectAcceptanc"
parameterType=
"String"
resultType=
"com.vion.financial.entity.ProjectAcceptanc"
>
...
...
code/finance_serv/src/main/java/com/vion/financial/mapping/ReceiptMapper.xml
View file @
931ae49
...
...
@@ -33,7 +33,11 @@
where receipt_unid = #{receipt_unid}
</update>
<select
id=
"queryReceipt"
parameterType=
"String"
resultType=
"com.vion.financial.entity.Receipt"
>
select *from tb_receipt where contract_unid = #{contract_unid}
select receipt_unid, contract_unid,
receipt_progress,cast(receipt_amount as decimal(18,2)),
oa_flow_id,receipt_note,create_date from tb_receipt
where contract_unid = #{contract_unid}
order by receipt_progress asc
</select>
<delete
id=
"deleteReceipt"
parameterType=
"int"
>
delete from tb_receipt where receipt_unid = #{receipt_unid}
...
...
code/finance_serv/src/main/java/com/vion/financial/mapping/ReturnInfoMapper.xml
View file @
931ae49
...
...
@@ -23,7 +23,7 @@
#{reback_progress},
</if>
<if
test=
"reback_date !=null"
>
#{reback_date,
jdbcType=DATE},
#{reback_date,
typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if>
<if
test=
"actual_reback_amount !=null and actual_reback_amount !=''"
>
#{actual_reback_amount},
...
...
@@ -34,12 +34,13 @@
)
</insert>
<update
id=
"updateReturnInfo"
parameterType=
"com.vion.financial.entity.ReturnInfo"
>
update tb_return_info set (
update tb_return_info
<set>
<if
test=
"reback_progress !=null and reback_progress !=''"
>
reback_progress = #{reback_progress},
</if>
<if
test=
"reback_date !=null
and reback_date !=''"
>
reback_date = #{reback_date
},
<if
test=
"reback_date !=null
"
>
reback_date = #{reback_date
,typeHandler=com.vion.financial.handler.MilliDateTypeHandler},
</if>
<if
test=
"actual_reback_amount !=null and actual_reback_amount !=''"
>
actual_reback_amount = #{actual_reback_amount},
...
...
@@ -47,11 +48,15 @@
<if
test=
"reback_note !=null and reback_note !=''"
>
reback_note = #{reback_note}
</if>
)
</set>
where reback_unid = #{reback_unid}
</update>
<select
id=
"queryReturnInfo"
parameterType=
"String"
resultType=
"com.vion.financial.entity.ReturnInfo"
>
select *from tb_return_info where contract_unid = #{contract_unid}
select reback_unid, contract_unid ,
reback_progress ,reback_date,
cast(actual_reback_amount as decimal(18,2)),
reback_note from tb_return_info where contract_unid = #{contract_unid}
order by reback_progress asc
</select>
<delete
id=
"deleteReturnInfo"
parameterType=
"int"
>
delete from tb_return_info where reback_unid = #{reback_unid}
...
...
code/finance_serv/src/main/java/com/vion/financial/service/AppendixService.java
View file @
931ae49
...
...
@@ -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 @
931ae49
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
(
financeConfig
.
getAppendurl
()+
multipartFile
.
getOriginalFilename
());
addAppendix
(
appendix
);
list
.
add
(
appendix
);
InputStream
inputStream
=
multipartFile
.
getInputStream
();
File
file
=
new
File
(
financeConfig
.
getAppendsavepath
()+
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/java/com/vion/financial/service/imp/ContractServiceImpl.java
View file @
931ae49
...
...
@@ -58,14 +58,17 @@ public class ContractServiceImpl implements ContractService {
if
(
contractMapper
.
queryOne
(
contractVo
.
getContract_unid
())
!=
null
)
{
contractMapper
.
updateOne
(
contractVo
);
}
else
{
contractVo
.
setIs_delete
(
false
);
contractMapper
.
addOne
(
contractVo
);
}
appendix
.
setBusiness_table
(
"tb_contract"
);
appendix
.
setBusiness_unid
(
contractVo
.
getContract_unid
());
if
(
contractVo
.
getAppendix_unids
()!=
null
)
{
for
(
int
n
:
contractVo
.
getAppendix_unids
())
{
appendix
.
setAppendix_unid
(
n
);
appendixMapper
.
updateAppendix
(
appendix
);
}
}
return
successCode
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -113,10 +116,12 @@ public class ContractServiceImpl implements ContractService {
Appendix
appendix
=
new
Appendix
();
appendix
.
setBusiness_table
(
"tb_contract"
);
appendix
.
setBusiness_unid
(
vontractVo
.
getContract_unid
());
if
(
vontractVo
.
getAppendix_unids
()!=
null
)
{
for
(
int
n
:
vontractVo
.
getAppendix_unids
())
{
appendix
.
setAppendix_unid
(
n
);
appendixMapper
.
updateAppendix
(
appendix
);
}
}
return
successCode
;
}
catch
(
Exception
e
)
{
// TODO: handle exception
...
...
code/finance_serv/src/main/java/com/vion/financial/service/imp/DeliverGoodsServiceImpl.java
View file @
931ae49
...
...
@@ -44,6 +44,7 @@ public class DeliverGoodsServiceImpl implements DeliverGoodsService {
for
(
DeliverGoods
deliverGoods:
list
)
{
deliverGoods
.
setContract_unid
(
s
);
deliverGoodsMapper
.
addDeliverGoods
(
deliverGoods
);
if
(
deliverGoods
.
getAppendix_unids
()!=
null
)
{
for
(
int
appendixUnid:
deliverGoods
.
getAppendix_unids
())
{
appendix
.
setAppendix_unid
(
appendixUnid
);
appendix
.
setBusiness_table
(
"tb_deliver_goods"
);
...
...
@@ -51,6 +52,7 @@ public class DeliverGoodsServiceImpl implements DeliverGoodsService {
appendixService
.
updateAppendix
(
appendix
);
}
}
}
return
successCode
;
}
else
{
failCode
.
setEcode
(
"100"
);
...
...
@@ -75,6 +77,7 @@ public class DeliverGoodsServiceImpl implements DeliverGoodsService {
logger
.
info
(
"========================查询发货信息========================"
);
if
(!
contractService
.
isDelete
(
s
))
{
List
<
DeliverGoods
>
list
=
deliverGoodsMapper
.
queryDeliverGoods
(
s
);
if
(
list
!=
null
)
{
for
(
DeliverGoods
deliverGoods:
list
)
{
appendix
=
new
Appendix
();
appendix
.
setBusiness_table
(
"tb_deliver_goods"
);
...
...
@@ -84,6 +87,7 @@ public class DeliverGoodsServiceImpl implements DeliverGoodsService {
deliverGoodsVo
.
getList_deliver_data
().
add
(
deliverGoods
);
}
}
}
else
{
failCode
.
setEcode
(
"100"
);
failCode
.
setEnote
(
"合同已删除"
);
...
...
@@ -109,6 +113,7 @@ public class DeliverGoodsServiceImpl implements DeliverGoodsService {
List
<
DeliverGoods
>
list_deliver_data
=
deliverGoodsVo
.
getList_deliver_data
();
for
(
DeliverGoods
deliverGoods:
list_deliver_data
)
{
deliverGoodsMapper
.
updateDeliverGoods
(
deliverGoods
);
if
(
deliverGoods
.
getAppendix_unids
()
!=
null
)
{
for
(
int
n:
deliverGoods
.
getAppendix_unids
())
{
appendix
=
new
Appendix
();
appendix
.
setAppendix_unid
(
n
);
...
...
@@ -117,6 +122,7 @@ public class DeliverGoodsServiceImpl implements DeliverGoodsService {
appendixService
.
updateAppendix
(
appendix
);
}
}
}
return
successCode
;
}
else
{
failCode
.
setEcode
(
"100"
);
...
...
@@ -139,12 +145,14 @@ public class DeliverGoodsServiceImpl implements DeliverGoodsService {
logger
.
info
(
"=========================删除合同发货信息======================="
);
Appendix
appendix
=
null
;
if
(!
contractService
.
isDelete
(
s
))
{
if
(
deliverGoodsVo
.
getDeliver_unids
()!=
null
)
{
for
(
int
deliverUnid
:
deliverGoodsVo
.
getDeliver_unids
())
{
deliverGoodsMapper
.
deleteDeliverGoods
(
deliverUnid
);
appendix
=
new
Appendix
();
appendix
.
setBusiness_unid
(
String
.
valueOf
(
deliverUnid
));
appendixService
.
deleteAppendix
(
appendix
);
}
}
return
successCode
;
}
else
{
...
...
code/finance_serv/src/main/java/com/vion/financial/service/imp/PaymentAgreeServiceImpl.java
View file @
931ae49
...
...
@@ -104,10 +104,10 @@ public class PaymentAgreeServiceImpl implements PaymentAgreeService {
try
{
logger
.
info
(
"==============删除付款约定信息==================="
);
if
(!
contractServiceImpl
.
isDelete
(
s
))
{
List
<
PaymentAgree
>
list
=
paymentAgreeVo
.
getList_payment_data
();
for
(
PaymentAgree
paymentAgree
:
list
)
{
paymentAgree
.
setContract_unid
(
s
);
paymentAgreeMapper
.
deletePaymentAgree
(
paymentAgree
.
getPayment_unid
()
);
List
<
Integer
>
list
=
paymentAgreeVo
.
getPayment_unids
();
for
(
int
n
:
list
)
{
//
paymentAgree.setContract_unid(s);
paymentAgreeMapper
.
deletePaymentAgree
(
n
);
}
return
SuccessCode
;
}
else
{
...
...
code/finance_serv/src/main/java/com/vion/financial/service/imp/ProjectAcceptancServiceImpl.java
View file @
931ae49
...
...
@@ -44,6 +44,7 @@ public class ProjectAcceptancServiceImpl implements ProjectAcceptancService {
for
(
ProjectAcceptanc
projectAcceptanc:
list
)
{
projectAcceptanc
.
setContract_unid
(
s
);
projectAcceptancMapper
.
addProjectAcceptanc
(
projectAcceptanc
);
if
(
projectAcceptanc
.
getAppendix_unids
()!=
null
)
{
for
(
int
appendixUnid:
projectAcceptanc
.
getAppendix_unids
())
{
appendix
.
setAppendix_unid
(
appendixUnid
);
appendix
.
setBusiness_table
(
"tb_project_acceptanc"
);
...
...
@@ -51,6 +52,7 @@ public class ProjectAcceptancServiceImpl implements ProjectAcceptancService {
appendixService
.
updateAppendix
(
appendix
);
}
}
}
return
successCode
;
}
else
{
failCode
.
setEcode
(
"100"
);
...
...
@@ -111,6 +113,7 @@ public class ProjectAcceptancServiceImpl implements ProjectAcceptancService {
for
(
ProjectAcceptanc
projectAcceptanc:
list
)
{
projectAcceptanc
.
setContract_unid
(
s
);
projectAcceptancMapper
.
updateProjectAcceptanc
(
projectAcceptanc
);
if
(
projectAcceptanc
.
getAppendix_unids
()!=
null
)
{
for
(
int
n:
projectAcceptanc
.
getAppendix_unids
())
{
appendix
=
new
Appendix
();
appendix
.
setAppendix_unid
(
n
);
...
...
@@ -119,6 +122,7 @@ public class ProjectAcceptancServiceImpl implements ProjectAcceptancService {
appendixService
.
updateAppendix
(
appendix
);
}
}
}
return
successCode
;
}
else
{
failCode
.
setEcode
(
"100"
);
...
...
code/finance_serv/src/main/java/com/vion/financial/service/imp/ReceiptServiceImpl.java
View file @
931ae49
...
...
@@ -103,9 +103,9 @@ public class ReceiptServiceImpl implements ReceiptService {
try
{
logger
.
info
(
"=========================删除合同开票信息======================="
);
if
(!
contractServiceImpl
.
isDelete
(
s
))
{
List
<
Receipt
>
list
=
receiptVo
.
getReceipt_unids
();
for
(
Receipt
receiptUnid
:
list
)
{
receiptMapper
.
deleteReceipt
(
receiptUnid
.
getReceipt_unid
()
);
List
<
Integer
>
list
=
receiptVo
.
getReceipt_unids
();
for
(
int
n
:
list
)
{
receiptMapper
.
deleteReceipt
(
n
);
}
return
successCode
;
}
...
...
code/finance_serv/src/main/java/com/vion/financial/service/imp/ReturnInfoServiceImpl.java
View file @
931ae49
...
...
@@ -107,10 +107,10 @@ public class ReturnInfoServiceImpl implements ReturnInfoService {
try
{
logger
.
info
(
"==============删除回款信息==================="
);
if
(!
contractServiceImpl
.
isDelete
(
s
))
{
List
<
ReturnInfo
>
list
=
paymentAgreeVo
.
getReback_unids
();
for
(
ReturnInfo
returnInfo
:
list
)
{
returnInfo
.
setContract_unid
(
s
);
returnInfoMapper
.
deleteReturnInfo
(
returnInfo
.
getReback_unid
()
);
List
<
Integer
>
list
=
paymentAgreeVo
.
getReback_unids
();
for
(
int
n
:
list
)
{
//
returnInfo.setContract_unid(s);
returnInfoMapper
.
deleteReturnInfo
(
n
);
}
return
SuccessCode
;
}
else
{
...
...
code/finance_serv/src/main/java/com/vion/financial/vo/PaymentAgreeVo.java
View file @
931ae49
...
...
@@ -9,7 +9,7 @@ import com.vion.financial.entity.PaymentAgree;
@JsonInclude
(
value
=
Include
.
NON_NULL
)
public
class
PaymentAgreeVo
{
private
List
<
PaymentAgree
>
list_payment_data
;
private
List
<
Integer
>
payment_unids
;
public
List
<
PaymentAgree
>
getList_payment_data
()
{
return
list_payment_data
;
}
...
...
@@ -18,5 +18,13 @@ public class PaymentAgreeVo {
this
.
list_payment_data
=
list_payment_data
;
}
public
List
<
Integer
>
getPayment_unids
()
{
return
payment_unids
;
}
public
void
setPayment_unids
(
List
<
Integer
>
payment_unids
)
{
this
.
payment_unids
=
payment_unids
;
}
}
code/finance_serv/src/main/java/com/vion/financial/vo/ReceiptVo.java
View file @
931ae49
...
...
@@ -9,7 +9,7 @@ import com.vion.financial.entity.Receipt;
@JsonInclude
(
value
=
Include
.
NON_NULL
)
public
class
ReceiptVo
{
List
<
Receipt
>
list_receipt_data
;
List
<
Receipt
>
receipt_unids
;
List
<
Integer
>
receipt_unids
;
public
List
<
Receipt
>
getList_receipt_data
()
{
return
list_receipt_data
;
}
...
...
@@ -18,13 +18,15 @@ public class ReceiptVo {
this
.
list_receipt_data
=
list_receipt_data
;
}
public
List
<
Receipt
>
getReceipt_unids
()
{
public
List
<
Integer
>
getReceipt_unids
()
{
return
receipt_unids
;
}
public
void
setReceipt_unids
(
List
<
Receipt
>
receipt_unids
)
{
public
void
setReceipt_unids
(
List
<
Integer
>
receipt_unids
)
{
this
.
receipt_unids
=
receipt_unids
;
}
}
code/finance_serv/src/main/java/com/vion/financial/vo/ReturnInfoVo.java
View file @
931ae49
...
...
@@ -9,7 +9,7 @@ import com.vion.financial.entity.ReturnInfo;
@JsonInclude
(
value
=
Include
.
NON_NULL
)
public
class
ReturnInfoVo
{
List
<
ReturnInfo
>
list_reback_data
;
List
<
ReturnInfo
>
reback_unids
;
List
<
Integer
>
reback_unids
;
public
List
<
ReturnInfo
>
getList_reback_data
()
{
return
list_reback_data
;
}
...
...
@@ -18,13 +18,14 @@ public class ReturnInfoVo {
this
.
list_reback_data
=
list_reback_data
;
}
public
List
<
ReturnInfo
>
getReback_unids
()
{
public
List
<
Integer
>
getReback_unids
()
{
return
reback_unids
;
}
public
void
setReback_unids
(
List
<
ReturnInfo
>
reback_unids
)
{
public
void
setReback_unids
(
List
<
Integer
>
reback_unids
)
{
this
.
reback_unids
=
reback_unids
;
}
}
code/finance_serv/src/main/resources/application.yml
View file @
931ae49
...
...
@@ -45,8 +45,8 @@ logging:
finance
:
authurl
:
http://192.168.9.162:20080/api/v1/auth/users
appendsavepath
:
appendurl
:
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
...
...
deploy/application.yml.in
View file @
931ae49
...
...
@@ -27,8 +27,9 @@ spring:
# maximum-pool-size:
http:
multipart:
max-file-size: 20Mb
max-request-size: 40Mb
enabled: true
max-file-size: 100Mb
max-request-size: 100Mb
mybatis:
mapper-locations: com/vion/financial/mapping/*.xml
...
...
@@ -39,6 +40,11 @@ logging:
level: INFO
console: "[financial_serv]-[%d{yyyy-MM-dd HH:mm:ss.SSS}]-%m%n"
path: F:\LOG\
finance:
authurl: http://PH_AUTH_SERV_IP:20080/api/v1/auth/users
appendsavepath: /data/face-web/www/static/pics/cache/finance
appendurl: http://PH_AUTH_SERV_IP: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