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
dede7794
Commit
dede7794
authored
Sep 15, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不知道改了什么
parent
997cec37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
CostApiServiceImpl.java
...blt/other/other_cost/service/impl/CostApiServiceImpl.java
+31
-27
No files found.
cost-core/src/main/java/com/blt/other/other_cost/service/impl/CostApiServiceImpl.java
View file @
dede7794
...
...
@@ -61,7 +61,7 @@ public class CostApiServiceImpl implements CostApiService {
@Override
@Transactional
public
String
generateLogisticsCost
(
int
costForm
,
LogisticsCostDto
logisticsCostDto
)
throws
Exception
{
public
String
generateLogisticsCost
(
int
costForm
,
LogisticsCostDto
logisticsCostDto
)
throws
Exception
{
CostDomain
costDomain
=
new
CostDomain
();
String
costNo
=
CostUtils
.
getIdNum
(
costService
);
costDomain
.
setCostNo
(
costNo
);
...
...
@@ -81,10 +81,10 @@ public class CostApiServiceImpl implements CostApiService {
costDomain
.
setDic
(
logisticsCostDto
.
getCurrency
());
costDomain
.
setSourceFrom
(
logisticsCostDto
.
getSourceFrom
());
BigDecimal
toRmbRate
=
null
;
if
(
"CNY"
.
equals
(
logisticsCostDto
.
getCurrency
())){
if
(
"CNY"
.
equals
(
logisticsCostDto
.
getCurrency
()))
{
toRmbRate
=
BigDecimal
.
ONE
;
costDomain
.
setAmountRmb
(
logisticsCostDto
.
getAmount
());
}
else
{
}
else
{
toRmbRate
=
CurUtils
.
getCur
(
logisticsCostDto
.
getCurrency
(),
"CNY"
,
getExchangeRateApi
);
costDomain
.
setAmountRmb
(
logisticsCostDto
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
}
...
...
@@ -92,11 +92,11 @@ public class CostApiServiceImpl implements CostApiService {
List
<
LogisticsFinansysDto
>
logisticsList
=
userCostFinansysService
.
getAllLogisticsFinansys
();
// 一级物流供应商
List
<
SubLogisticsFinansysDto
>
subLogisticsList
=
userCostFinansysService
.
getAllSubLogisticsFinansys
();
// 二级物流供应商
if
(
logisticsList
!=
null
&&
subLogisticsList
!=
null
)
{
if
(
logisticsCostDto
.
getSubLogisticsSupplierId
().
intValue
()
==
0
){
if
(
logisticsList
!=
null
&&
subLogisticsList
!=
null
)
{
if
(
logisticsCostDto
.
getSubLogisticsSupplierId
().
intValue
()
==
0
)
{
// 没有二级,只有一级
for
(
LogisticsFinansysDto
logistics
:
logisticsList
){
if
(
logistics
.
getId
().
intValue
()
==
logisticsCostDto
.
getLogisticsSupplierId
().
intValue
())
{
for
(
LogisticsFinansysDto
logistics
:
logisticsList
)
{
if
(
logistics
.
getId
().
intValue
()
==
logisticsCostDto
.
getLogisticsSupplierId
().
intValue
())
{
costDomain
.
setLogisticsSupplierId
(
logistics
.
getId
());
costDomain
.
setBankCompany
(
logistics
.
getName
());
costDomain
.
setBankCardUser
(
logistics
.
getBankuser
());
...
...
@@ -105,13 +105,13 @@ public class CostApiServiceImpl implements CostApiService {
break
;
}
}
}
else
{
}
else
{
// 根据二级找一级
for
(
SubLogisticsFinansysDto
subLogistics
:
subLogisticsList
){
if
(
subLogistics
.
getId
().
intValue
()
==
logisticsCostDto
.
getSubLogisticsSupplierId
().
intValue
())
{
for
(
SubLogisticsFinansysDto
subLogistics
:
subLogisticsList
)
{
if
(
subLogistics
.
getId
().
intValue
()
==
logisticsCostDto
.
getSubLogisticsSupplierId
().
intValue
())
{
costDomain
.
setSubLogisticsSupplierId
(
subLogistics
.
getId
());
for
(
LogisticsFinansysDto
logistics
:
logisticsList
){
if
(
logistics
.
getId
().
intValue
()
==
subLogistics
.
getParentid
().
intValue
())
{
for
(
LogisticsFinansysDto
logistics
:
logisticsList
)
{
if
(
logistics
.
getId
().
intValue
()
==
subLogistics
.
getParentid
().
intValue
())
{
costDomain
.
setLogisticsSupplierId
(
logistics
.
getId
());
costDomain
.
setBankCompany
(
logistics
.
getName
());
costDomain
.
setBankCardUser
(
logistics
.
getBankuser
());
...
...
@@ -125,19 +125,19 @@ public class CostApiServiceImpl implements CostApiService {
}
}
}
else
{
throw
new
Exception
(
"获取一二级物流供应商信息失败!"
);
throw
new
Exception
(
"获取一二级物流供应商信息失败!"
);
}
logisticsList
.
clear
();
subLogisticsList
.
clear
();
if
(
costDomain
.
getLogisticsSupplierId
()
==
null
){
if
(
costDomain
.
getLogisticsSupplierId
()
==
null
)
{
throw
new
Exception
(
"没有匹配到一级物流供应商信息!"
);
}
UserDomain
user
=
userDao
.
selectByuserid
(
logisticsCostDto
.
getUserId
());
if
(
user
==
null
){
if
(
user
==
null
)
{
throw
new
Exception
(
"费用系统中没有该用户信息,请先登录一次费用系统再进行推送!"
);
}
else
{
}
else
{
costDomain
.
setCreateUserid
(
user
.
getUserid
());
costDomain
.
setCreateUsercode
(
user
.
getUsercode
());
costDomain
.
setCreateUsername
(
user
.
getUsername
());
...
...
@@ -157,10 +157,10 @@ public class CostApiServiceImpl implements CostApiService {
public
List
<
ManageCostDto
>
getMangeCostList
(
String
startDateStr
,
String
endDateStr
,
String
feeSuperType
,
String
feeSubType
,
Integer
companyValue
,
String
companyName
,
String
departmentName
,
Integer
createUserId
,
Integer
payUserId
)
throws
Exception
{
Date
startDate
=
null
;
Date
endDate
=
null
;
if
(!
StringUtils
.
isEmpty
(
startDateStr
))
{
if
(!
StringUtils
.
isEmpty
(
startDateStr
))
{
startDate
=
DateTimeUtil
.
stringToDate
(
startDateStr
,
DateTimeUtil
.
DATE_FORMAT
);
}
if
(!
StringUtils
.
isEmpty
(
endDateStr
))
{
if
(!
StringUtils
.
isEmpty
(
endDateStr
))
{
endDate
=
DateTimeUtil
.
stringToDate
(
endDateStr
,
DateTimeUtil
.
DATE_FORMAT
);
}
ArrayList
<
Integer
>
companyValueList
=
new
ArrayList
<>(
6
);
...
...
@@ -172,6 +172,10 @@ public class CostApiServiceImpl implements CostApiService {
companyValueList
.
add
(
60
);
companyValueList
.
add
(
61
);
companyValueList
.
add
(
66
);
companyValueList
.
add
(
72
);
companyValueList
.
add
(
67
);
companyValueList
.
add
(
58
);
companyValueList
.
add
(
54
);
}
}
List
<
ManageCostDto
>
manageCostDtoList
=
costDao
.
selectManageCost
(
startDate
,
DateTimeUtil
.
addDays
(
endDate
,
1
),
feeSuperType
,
feeSubType
,
companyValueList
,
companyName
,
departmentName
,
createUserId
,
payUserId
);
...
...
@@ -185,13 +189,13 @@ public class CostApiServiceImpl implements CostApiService {
}
if
((
companyValue
==
null
||
companyValue
==
2
)
&&
((
feeSuperType
==
null
&&
departmentName
==
null
)
||
((
"耗材"
.
equals
(
feeSuperType
)
||
"耗材"
.
equals
(
feeSubType
))
&&
"采购部"
.
equals
(
departmentName
))
||
((
"耗材"
.
equals
(
feeSuperType
)
||
"耗材"
.
equals
(
feeSubType
))
&&
departmentName
==
null
))){
((
"耗材"
.
equals
(
feeSuperType
)
||
"耗材"
.
equals
(
feeSubType
))
&&
departmentName
==
null
)))
{
try
{
String
param
=
"?companymainvalue_from=40&isquestion=-1&orderType=-1&cashier_type=1&sourcecode=buy&order=asc&offset=0&limit=1000"
+
"&cashier_time_start="
+
startDateStr
+
"&cashier_time_end="
+
endDateStr
;
"&cashier_time_start="
+
startDateStr
+
"&cashier_time_end="
+
endDateStr
;
ConsumablesResultDto
consumablesResultDto
=
JSONObject
.
parseObject
(
HttpUtil
.
httpGet
(
getConsumablesApiUrl
+
param
),
ConsumablesResultDto
.
class
);
if
(
consumablesResultDto
.
getTotal
()
>
0
&&
consumablesResultDto
.
getRows
().
size
()
>
0
)
{
for
(
ManageCostDto
manageCostDto
:
consumablesResultDto
.
getRows
()){
if
(
consumablesResultDto
.
getTotal
()
>
0
&&
consumablesResultDto
.
getRows
().
size
()
>
0
)
{
for
(
ManageCostDto
manageCostDto
:
consumablesResultDto
.
getRows
())
{
manageCostDto
.
setReceiveUnit
(
"余江县酷乐电子用品店"
);
manageCostDto
.
setReason
(
"耗材"
);
manageCostDto
.
setManageCostType
(-
1
);
...
...
@@ -207,7 +211,7 @@ public class CostApiServiceImpl implements CostApiService {
manageCostDtoList
.
add
(
manageCostDto
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
">>>>>获取耗材信息失败"
);
}
...
...
@@ -219,10 +223,10 @@ public class CostApiServiceImpl implements CostApiService {
public
List
<
ManageCostDto
>
getLogisticsCostList
(
String
startDateStr
,
String
endDateStr
,
String
feeSuperType
,
String
feeSubType
,
Integer
companyValue
,
String
companyName
,
String
departmentName
,
Integer
createUserId
,
Integer
payUserId
)
throws
Exception
{
Date
startDate
=
null
;
Date
endDate
=
null
;
if
(!
StringUtils
.
isEmpty
(
startDateStr
))
{
if
(!
StringUtils
.
isEmpty
(
startDateStr
))
{
startDate
=
DateTimeUtil
.
stringToDate
(
startDateStr
,
DateTimeUtil
.
DATE_FORMAT
);
}
if
(!
StringUtils
.
isEmpty
(
endDateStr
))
{
if
(!
StringUtils
.
isEmpty
(
endDateStr
))
{
endDate
=
DateTimeUtil
.
stringToDate
(
endDateStr
,
DateTimeUtil
.
DATE_FORMAT
);
}
ArrayList
<
Integer
>
companyValueList
=
new
ArrayList
<>(
6
);
...
...
@@ -242,12 +246,12 @@ public class CostApiServiceImpl implements CostApiService {
}
@Override
public
List
<
CostDomain
>
getBalanceSheetCost
(
Date
startDate
,
Date
endDate
){
public
List
<
CostDomain
>
getBalanceSheetCost
(
Date
startDate
,
Date
endDate
)
{
return
costDao
.
selectBalanceSheetCost
(
startDate
,
endDate
);
}
@Override
public
List
<
CostDomain
>
getNoPayCost
(
List
<
String
>
costNoList
){
public
List
<
CostDomain
>
getNoPayCost
(
List
<
String
>
costNoList
)
{
return
costDao
.
selectNoPayCost
(
costNoList
);
}
...
...
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