Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
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
huluobin
bailuntec-cost
Commits
a7af8ba4
Commit
a7af8ba4
authored
Jul 05, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a283e65c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
43 deletions
+98
-43
UserCostFinansysMapper.xml
...vice/src/main/resources/mapper/UserCostFinansysMapper.xml
+3
-1
OtherApplicationTests.java
...ce/src/test/java/com/blt/other/OtherApplicationTests.java
+92
-42
CostFileUtilTest.java
...ava/com/blt/other/module/cost/utils/CostFileUtilTest.java
+3
-0
No files found.
cost-service/src/main/resources/mapper/UserCostFinansysMapper.xml
View file @
a7af8ba4
...
...
@@ -38,8 +38,10 @@
<select
id=
"selectAll"
resultType=
"com.blt.other.database.model.UserCostFinansysDomain"
>
SELECT *
FROM user_cost_finansys
where bank_card is not null
and bank_card_user is not null
<if
test=
"key!=null and key !='' "
>
where
(bank_card like concat('%',#{key},'%')
(bank_card like concat('%',#{key},'%')
or bank_name like concat('%',#{key},'%')
or bank_card_user like concat('%',#{key},'%')
or bank_company like concat('%',#{key},'%')
...
...
cost-service/src/test/java/com/blt/other/OtherApplicationTests.java
View file @
a7af8ba4
...
...
@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSON;
import
com.bailuntec.api.bailuntec.oa.OaApi
;
import
com.bailuntec.api.bailuntec.oa.response.OaDepartmentResp
;
import
com.bailuntec.api.bailuntec.oa.response.OaUserResp
;
import
com.bailuntec.common.JsonUtilByJackson
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
...
...
@@ -59,6 +60,7 @@ import org.thymeleaf.util.StringUtils;
import
javax.annotation.Resource
;
import
java.io.UnsupportedEncodingException
;
import
java.math.BigDecimal
;
import
java.net.URISyntaxException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
...
...
@@ -459,49 +461,97 @@ public class OtherApplicationTests {
@Test
@Rollback
(
value
=
false
)
public
void
test
()
{
CostDomain
costDomain
=
costDao
.
selectByCostNo
(
"F036461"
);
List
<
CostDetailDomain
>
costDetailDomainList
=
costDetailDao
.
selectListByCostNo
(
"F036461"
);
costDomain
.
setCostDetailDomainList
(
costDetailDomainList
);
CostCashiercallbackDomain
costCashiercallbackDomain
=
costCashiercallbackDao
.
selectByCostNo
(
"F036461"
);
CostTypeResult
costTypeResult
=
costTypeDao
.
queryDetail
(
costDomain
.
getTypeId
());
if
(
costDomain
.
getCompanyValue
()
!=
2
)
{
return
;
String
[]
costs
=
new
String
[]{
"F023173"
,
"F025275"
,
"F025276"
,
"F025849"
,
"F026224"
,
"F026229"
,
"F035840"
,
"F036998"
,
"F037056"
,
"F037145"
,
"F037207"
,
"F037253"
,
"F037353"
,
"F037361"
,
"F037451"
,
"F037452"
,
"F037453"
,
"F037456"
,
"F037540"
,
"F037715"
,
"F037768"
,
"F037847"
,
"F037859"
,
"F037888"
,
"F038035"
,
"F038092"
,
"F038095"
,
"F038097"
,
"F038113"
,
"F038114"
,
"F038118"
,
"F038201"
};
for
(
String
cost
:
costs
){
CostDomain
costDomain
=
costDao
.
selectByCostNo
(
cost
);
List
<
CostDetailDomain
>
costDetailDomainList
=
costDetailDao
.
selectListByCostNo
(
cost
);
costDomain
.
setCostDetailDomainList
(
costDetailDomainList
);
CostCashiercallbackDomain
costCashiercallbackDomain
=
costCashiercallbackDao
.
selectByCostNo
(
cost
);
CostTypeResult
costTypeResult
=
costTypeDao
.
queryDetail
(
costDomain
.
getTypeId
());
if
(
costDomain
.
getCompanyValue
()
!=
2
)
{
continue
;
}
//xgbl代表香港百伦
String
companyCode
=
"xgbl"
;
String
nsAccountingSubjectId
=
costCashiercallbackDomain
.
getErpAccountingType
();
if
(
costCashiercallbackDomain
.
getCashierbankcardname
().
equals
(
"Hang Seng Bank Limited"
)
&&
costCashiercallbackDomain
.
getCashierbankcard
().
equals
(
"774-515290-883"
)){
switch
(
costCashiercallbackDomain
.
getCashierunitcode
().
toUpperCase
()){
case
"HKD"
:
nsAccountingSubjectId
=
"10020201"
;
break
;
case
"EUR"
:
nsAccountingSubjectId
=
"10020202"
;
break
;
case
"USD"
:
nsAccountingSubjectId
=
"10020203"
;
break
;
case
"GBP"
:
nsAccountingSubjectId
=
"10020204"
;
break
;
case
"CNY"
:
nsAccountingSubjectId
=
"10020205"
;
break
;
case
"AUD"
:
nsAccountingSubjectId
=
"10020207"
;
break
;
}
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
);
NetsuiteDataDto
netsuiteDataDto
=
new
NetsuiteDataDto
();
netsuiteDataDto
.
setTranid
(
costDomain
.
getCostNo
());
netsuiteDataDto
.
setCurrency
(
"CNY"
);
netsuiteDataDto
.
setSubsidiary
(
companyCode
);
netsuiteDataDto
.
setTrandate
(
sdf
.
format
(
costDomain
.
getActualTime
()));
netsuiteDataDto
.
setCustbody_iofeetype
(
costDomain
.
getCostForm
().
toString
());
//费用详情
List
<
NetsuiCostinfoDto
>
netsuiCostInfoDtos
=
new
ArrayList
<>();
//费用系统信息
NetsuiCostinfoDto
feeSysInfo
=
new
NetsuiCostinfoDto
(
costTypeResult
.
getNsAccountingSubjectId
().
toString
(),
costDomain
.
getAmount
().
toString
(),
costDomain
.
getCostReason
()
);
netsuiCostInfoDtos
.
add
(
feeSysInfo
);
//财务系统信息
NetsuiCostinfoDto
cwSysInfo
=
new
NetsuiCostinfoDto
(
nsAccountingSubjectId
,
costCashiercallbackDomain
.
getPayamount
().
toString
(),
costCashiercallbackDomain
.
getPaynote
()
);
netsuiCostInfoDtos
.
add
(
cwSysInfo
);
netsuiteDataDto
.
setCostinfo
(
netsuiCostInfoDtos
);
NetsuiteLogDomain
netsuiteLogDomain
=
new
NetsuiteLogDomain
();
netsuiteLogDomain
.
setCostNo
(
costDomain
.
getCostNo
());
netsuiteLogDomain
.
setPublishStatus
(
NetsuiteLogDomain
.
UNPUBLISH
);
netsuiteLogDomain
.
setScript
(
NetsuiteLogDomain
.
SCRIPT_FEE
);
netsuiteLogDomain
.
setJsonStr
(
JSON
.
toJSONString
(
netsuiteDataDto
));
netsuiteLogDao
.
upsert
(
netsuiteLogDomain
);
}
String
companyCode
=
"xgbl"
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy/MM/dd"
);
NetsuiteDataDto
netsuiteDataDto
=
new
NetsuiteDataDto
();
netsuiteDataDto
.
setTranid
(
costDomain
.
getCostNo
());
netsuiteDataDto
.
setCurrency
(
"CNY"
);
netsuiteDataDto
.
setSubsidiary
(
companyCode
);
netsuiteDataDto
.
setTrandate
(
sdf
.
format
(
costDomain
.
getActualTime
()));
netsuiteDataDto
.
setCustbody_iofeetype
(
costDomain
.
getCostForm
().
toString
());
//费用详情
List
<
NetsuiCostinfoDto
>
netsuiCostInfoDtos
=
new
ArrayList
<>();
//费用系统信息
NetsuiCostinfoDto
feeSysInfo
=
new
NetsuiCostinfoDto
(
costTypeResult
.
getNsAccountingSubjectId
().
toString
(),
costDomain
.
getAmount
().
toString
(),
StringUtils
.
isEmpty
(
costDomain
.
getCostReason
())
?
costDomain
.
getCostRemark
()
:
costDomain
.
getCostReason
()
);
netsuiCostInfoDtos
.
add
(
feeSysInfo
);
//财务系统信息
NetsuiCostinfoDto
cwSysInfo
=
new
NetsuiCostinfoDto
(
"1002"
,
costCashiercallbackDomain
.
getPayamount
().
toString
(),
costCashiercallbackDomain
.
getPaynote
()
);
netsuiCostInfoDtos
.
add
(
cwSysInfo
);
netsuiteDataDto
.
setCostinfo
(
netsuiCostInfoDtos
);
NetsuiteLogDomain
netsuiteLogDomain
=
new
NetsuiteLogDomain
();
netsuiteLogDomain
.
setCostNo
(
costDomain
.
getCostNo
());
netsuiteLogDomain
.
setPublishStatus
(
NetsuiteLogDomain
.
UNPUBLISH
);
netsuiteLogDomain
.
setScript
(
NetsuiteLogDomain
.
SCRIPT_FEE
);
netsuiteLogDomain
.
setJsonStr
(
JSON
.
toJSONString
(
netsuiteDataDto
));
netsuiteLogDao
.
upsert
(
netsuiteLogDomain
);
}
public
void
nsLogModify
(){
List
<
NetsuiteLogDomain
>
list
=
netsuiteLogService
.
list
(
new
LambdaQueryWrapper
<
NetsuiteLogDomain
>().
eq
(
NetsuiteLogDomain:
:
getPublishStatus
,
NetsuiteLogDomain
.
FAILURE
));
list
.
forEach
(
x
->{
NetsuiteDataDto
netsuiteDataDto
=
JsonUtilByJackson
.
readValue
(
x
.
getJsonStr
(),
NetsuiteDataDto
.
class
);
});
}
@Test
public
void
testAny
(){
BigDecimal
val1
=
new
BigDecimal
(
"2000"
);
BigDecimal
val2
=
new
BigDecimal
(
"100"
);
boolean
compare1
=
!(
val1
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
&&
val2
.
compareTo
(
val1
)
<
0
);
System
.
out
.
println
(
compare1
);
}
@Rollback
(
value
=
false
)
...
...
cost-service/src/test/java/com/blt/other/module/cost/utils/CostFileUtilTest.java
View file @
a7af8ba4
package
com
.
blt
.
other
.
module
.
cost
.
utils
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
...
...
@@ -25,6 +26,8 @@ public class CostFileUtilTest {
@Rollback
@Test
public
void
upload
()
{
String
id
=
IdWorker
.
getIdStr
();
System
.
out
.
println
(
id
);
}
@Rollback
...
...
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