Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
dc-cost-system
Commits
f97cb452
Commit
f97cb452
authored
Sep 09, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
projectTypes 增加了这个参数
parent
0e62e1bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
44 deletions
+49
-44
UserCostFinansysServiceImpl.java
.../other_cost/service/impl/UserCostFinansysServiceImpl.java
+40
-37
CostListSearchKeysVo.java
...ava/com/blt/other/other_cost/vo/CostListSearchKeysVo.java
+9
-7
No files found.
cost-core/src/main/java/com/blt/other/other_cost/service/impl/UserCostFinansysServiceImpl.java
View file @
f97cb452
...
...
@@ -9,17 +9,17 @@ import com.blt.other.other_cost.dto.SubLogisticsFinansysDto;
import
com.blt.other.other_cost.service.UserCostFinansysService
;
import
com.blt.other.other_cost.vo.UserCostFinansysVo
;
import
com.blt.other.other_cost.vo.UserFinansysVo
;
import
com.blt.other.other_database.model.*
;
import
com.blt.other.other_purchasing.vo.CompanyVo
;
import
com.blt.other.other_database.model.CostDomain
;
import
com.blt.other.other_database.model.CostPlanDomain
;
import
com.blt.other.other_database.model.UserCostFinansysDomain
;
import
com.blt.other.other_database.model.UserDomain
;
import
com.fasterxml.jackson.databind.JavaType
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.
*
;
import
org.springframework.http.
ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.client.RestTemplate
;
import
java.io.IOException
;
...
...
@@ -48,7 +48,7 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
@Override
public
Integer
saveFinansysRecord
(
UserCostFinansysDomain
userCostFinansysDomain
)
{
UserCostFinansysDomain
byUserCostFinansysDetail
=
getByUserCostFinansysDetail
(
userCostFinansysDomain
);
if
(
null
!=
byUserCostFinansysDetail
&&
null
!=
byUserCostFinansysDetail
.
getUserCostFinansysNo
()){
if
(
null
!=
byUserCostFinansysDetail
&&
null
!=
byUserCostFinansysDetail
.
getUserCostFinansysNo
())
{
return
null
;
}
Integer
insert
=
userCostFinansysDao
.
insert
(
userCostFinansysDomain
);
...
...
@@ -58,7 +58,7 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
@Override
public
UserCostFinansysDomain
createFinansyRecordByCostPlanDomain
(
CostPlanDomain
planDomain
)
{
CostDomain
costDomain
=
new
CostDomain
();
BeanUtils
.
copyProperties
(
planDomain
,
costDomain
);
BeanUtils
.
copyProperties
(
planDomain
,
costDomain
);
return
setParams
(
costDomain
);
}
...
...
@@ -67,7 +67,7 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
return
setParams
(
costDomain
);
}
private
UserCostFinansysDomain
setParams
(
CostDomain
cost
){
private
UserCostFinansysDomain
setParams
(
CostDomain
cost
)
{
UserCostFinansysDomain
userCostFinansysDomain
=
new
UserCostFinansysDomain
();
UserDomain
user
=
userDao
.
select
(
cost
.
getCreateUsercode
());
userCostFinansysDomain
.
setUsercode
(
user
.
getUsercode
());
...
...
@@ -105,38 +105,40 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
/**
* 同步财务信息
*
* @return
*/
@Override
public
String
syncUserFinansys
()
{
// 1、获取 page=1 pagesize=25 ,并得到总条数
UserFinansysVo
userFinansysVo
=
getUserFinansysVo
(
1
,
25
);
UserFinansysVo
userFinansysVo
=
getUserFinansysVo
(
1
,
25
);
Integer
total
=
userFinansysVo
.
getTotal
();
// 2、 获取总页数
Integer
result
=
0
;
Integer
update
=
0
;
if
(
null
!=
total
&&
total
>=
1
){
if
(
null
!=
total
&&
total
>=
1
)
{
int
pageNum
=
1
;
for
(
pageNum
=
1
;
pageNum
<=((
total
/
25
)+
1
);
pageNum
++)
{
List
<
UserCostFinansysVo
>
vos
=
getUserCostFinansysList
(
pageNum
,
25
);
if
(
null
!=
vos
&&
vos
.
size
()
>=
1
){
for
(
UserCostFinansysVo
vo
:
vos
)
{
if
(
3
==
vo
.
getStatus
()
&&
13
==
vo
.
getCategoryid
()){
Integer
insert
=
insertUserFinansys
(
vo
);
if
(
null
!=
insert
&&
1
==
insert
)
result
+=
1
;
if
(
null
!=
insert
&&
0
==
insert
)
update
+=
1
;
for
(
pageNum
=
1
;
pageNum
<=
((
total
/
25
)
+
1
);
pageNum
++)
{
List
<
UserCostFinansysVo
>
vos
=
getUserCostFinansysList
(
pageNum
,
25
);
if
(
null
!=
vos
&&
vos
.
size
()
>=
1
)
{
for
(
UserCostFinansysVo
vo
:
vos
)
{
if
(
3
==
vo
.
getStatus
()
&&
13
==
vo
.
getCategoryid
())
{
Integer
insert
=
insertUserFinansys
(
vo
);
if
(
null
!=
insert
&&
1
==
insert
)
result
+=
1
;
if
(
null
!=
insert
&&
0
==
insert
)
update
+=
1
;
}
}
}
}
}
return
"新增 "
+
result
+
" 条记录,新增 "
+
update
+
" 条记录"
;
return
"新增 "
+
result
+
" 条记录,新增 "
+
update
+
" 条记录"
;
}
/**
* 根据 userid 获取财务信息
*
* @param
* @return
*/
...
...
@@ -147,6 +149,7 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
/**
* 保存/修改从财务系统获取的财务信息
*
* @param vo
* @return
*/
...
...
@@ -162,14 +165,14 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
domain
.
setBankCard
(
vo
.
getCardno
());
domain
.
setBankCompany
(
vo
.
getCardusername
());
domain
.
setUserCostFinansysNo
(
createNo
());
if
(
null
==
userCostFinansysDomain
){
if
(
null
==
userCostFinansysDomain
)
{
// 没有该记录,添加
Integer
insert
=
userCostFinansysDao
.
insert
(
domain
);
if
(
null
!=
insert
&&
1
==
insert
)
return
1
;
else
return
null
;
}
else
{
}
else
{
Integer
update
=
userCostFinansysDao
.
updateBySyncId
(
domain
);
if
(
null
!=
update
&&
1
==
update
)
return
0
;
...
...
@@ -180,16 +183,16 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
private
List
<
UserCostFinansysVo
>
getUserCostFinansysList
(
Integer
pageNum
,
Integer
pageSize
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
String
url
=
getSupplierPageListApi
+
"?page="
+
pageNum
+
"&pagesize="
+
pageSize
+
"&key"
;
ResponseEntity
<
String
>
response
=
restTemplate
.
getForEntity
(
url
,
String
.
class
);
String
url
=
getSupplierPageListApi
+
"?page="
+
pageNum
+
"&pagesize="
+
pageSize
+
"&key"
;
ResponseEntity
<
String
>
response
=
restTemplate
.
getForEntity
(
url
,
String
.
class
);
String
strBody
=
null
;
if
(
response
!=
null
&&
response
.
getStatusCodeValue
()
==
200
)
{
strBody
=
response
.
getBody
();
strBody
=
strBody
.
replace
(
"\\"
,
""
);
strBody
=
strBody
.
replace
(
"/"
,
""
);
strBody
=
strBody
.
replace
(
"\\"
,
""
);
strBody
=
strBody
.
replace
(
"/"
,
""
);
int
start
=
strBody
.
indexOf
(
"["
);
int
end
=
strBody
.
lastIndexOf
(
"]"
);
strBody
=
strBody
.
substring
(
start
,
end
+
1
);
strBody
=
strBody
.
substring
(
start
,
end
+
1
);
ObjectMapper
mapper
=
new
ObjectMapper
();
JavaType
javaType
=
mapper
.
getTypeFactory
().
constructParametricType
(
Collection
.
class
,
UserCostFinansysVo
.
class
);
List
<
UserCostFinansysVo
>
vos
=
null
;
...
...
@@ -204,28 +207,28 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
return
null
;
}
private
UserFinansysVo
getUserFinansysVo
(
Integer
pageNum
,
Integer
pageSize
)
{
private
UserFinansysVo
getUserFinansysVo
(
Integer
pageNum
,
Integer
pageSize
)
{
RestTemplate
restTemplate
=
new
RestTemplate
();
String
url
=
getSupplierPageListApi
+
"?page="
+
pageNum
+
"&pagesize="
+
pageSize
+
"&key"
;
ResponseEntity
<
String
>
response
=
restTemplate
.
getForEntity
(
url
,
String
.
class
);
String
url
=
getSupplierPageListApi
+
"?page="
+
pageNum
+
"&pagesize="
+
pageSize
+
"&key"
;
ResponseEntity
<
String
>
response
=
restTemplate
.
getForEntity
(
url
,
String
.
class
);
ObjectMapper
mapper
=
new
ObjectMapper
();
String
strBody
=
null
;
if
(
response
!=
null
&&
response
.
getStatusCodeValue
()
==
200
)
{
strBody
=
response
.
getBody
();
UserFinansysVo
object
=
(
UserFinansysVo
)
MyMapperUtil
.
getObject
(
strBody
,
UserFinansysVo
.
class
);
UserFinansysVo
object
=
(
UserFinansysVo
)
MyMapperUtil
.
getObject
(
strBody
,
UserFinansysVo
.
class
);
return
object
;
}
return
null
;
}
private
String
createNo
(){
private
String
createNo
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyMMddHHmmss"
);
String
no
=
"UCF"
+
sdf
.
format
(
new
Date
());
String
no
=
"UCF"
+
sdf
.
format
(
new
Date
());
UserCostFinansysDomain
userCostFinansysDomain
=
userCostFinansysDao
.
selectByNo
(
no
);
while
(
null
!=
userCostFinansysDomain
&&
null
!=
userCostFinansysDomain
.
getUserCostFinansysNo
()){
no
=
"UCF"
+
sdf
.
format
(
new
Date
());
while
(
null
!=
userCostFinansysDomain
&&
null
!=
userCostFinansysDomain
.
getUserCostFinansysNo
())
{
no
=
"UCF"
+
sdf
.
format
(
new
Date
());
userCostFinansysDomain
=
userCostFinansysDao
.
selectByNo
(
no
);
}
return
no
;
...
...
@@ -245,7 +248,7 @@ public class UserCostFinansysServiceImpl implements UserCostFinansysService {
}
@Override
public
List
<
SubLogisticsFinansysDto
>
getAllSubLogisticsFinansys
(){
public
List
<
SubLogisticsFinansysDto
>
getAllSubLogisticsFinansys
()
{
RestTemplate
restTemplate
=
new
RestTemplate
();
ResponseEntity
<
String
>
response
=
restTemplate
.
getForEntity
(
getAllSubLogisticsFinansysApi
,
String
.
class
);
String
strBody
=
null
;
...
...
cost-core/src/main/java/com/blt/other/other_cost/vo/CostListSearchKeysVo.java
View file @
f97cb452
...
...
@@ -8,11 +8,12 @@ import java.util.Date;
public
class
CostListSearchKeysVo
{
private
Params
params
;
public
class
Params
{
public
class
Params
{
private
Keys
keys
;
private
Integer
pageNum
;
private
Integer
pageSize
;
public
class
Keys
{
public
class
Keys
{
private
String
companyNo
;
private
Integer
costForm
;
private
String
createUsercode
;
...
...
@@ -21,16 +22,17 @@ public class CostListSearchKeysVo {
private
Integer
lendStatus
;
private
Integer
isTax
;
private
Integer
isLend
;
// @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
// @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
beginTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
beginPayTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
private
Date
endPayTime
;
private
String
linkCost
;
private
String
projectTypes
;
public
String
getCompanyNo
()
{
return
companyNo
;
...
...
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