Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
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
王衍超
cloud-fb
Commits
71852b7e
Commit
71852b7e
authored
Apr 25, 2021
by
杨清松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对账单明细接口
parent
07799ad6
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
252 additions
and
0 deletions
+252
-0
build.gradle
backend/xyst.dinas.finance/build.gradle
+1
-0
FinanceConfiguration.java
...a/com/xyst/dinas/finance/config/FinanceConfiguration.java
+20
-0
StatementAccountDao.java
.../java/com/xyst/dinas/finance/dao/StatementAccountDao.java
+12
-0
StatementAccount.java
.../java/com/xyst/dinas/finance/entity/StatementAccount.java
+32
-0
StatementAccountDaoImpl.java
...t/dinas/finance/internal/dao/StatementAccountDaoImpl.java
+36
-0
StatementAccountServiceImpl.java
...finance/internal/service/StatementAccountServiceImpl.java
+99
-0
StatementAccountService.java
...m/xyst/dinas/finance/service/StatementAccountService.java
+9
-0
StatementAccountController.java
...om/xyst/dinas/finance/web/StatementAccountController.java
+36
-0
SalesRecordConstant.java
...va/com/xyst/dinas/sales/constant/SalesRecordConstant.java
+7
-0
No files found.
backend/xyst.dinas.finance/build.gradle
View file @
71852b7e
...
...
@@ -22,6 +22,7 @@ dependencies {
compile
project
(
":xyst.dinas.biz"
)
compile
project
(
":xyst.dinas.project"
)
compile
project
(
":xyst.dinas.contract"
)
compile
project
(
":xyst.dinas.sales"
)
testCompile
lib
.
amino_boot_web
...
...
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/config/FinanceConfiguration.java
View file @
71852b7e
...
...
@@ -4,16 +4,21 @@ import org.springframework.context.annotation.Bean;
import
com.xyst.dinas.finance.dao.BankRechargeDetailDao
;
import
com.xyst.dinas.finance.dao.ExpenseAdjustDao
;
import
com.xyst.dinas.finance.dao.StatementAccountDao
;
import
com.xyst.dinas.finance.internal.dao.BankRechargeDetailDaoImpl
;
import
com.xyst.dinas.finance.internal.dao.ExpenseAdjustDaoImpl
;
import
com.xyst.dinas.finance.internal.dao.StatementAccountDaoImpl
;
import
com.xyst.dinas.finance.internal.service.BankRechargeDetailServiceImpl
;
import
com.xyst.dinas.finance.internal.service.ExpenseAdjustServiceImpl
;
import
com.xyst.dinas.finance.internal.service.StatementAccountServiceImpl
;
import
com.xyst.dinas.finance.processor.FinanceRefundProcessor
;
import
com.xyst.dinas.finance.service.BankRechargeDetailService
;
import
com.xyst.dinas.finance.service.ExpenseAdjustService
;
import
com.xyst.dinas.finance.service.StatementAccountService
;
import
com.xyst.dinas.finance.web.BankRechargeDetailController
;
import
com.xyst.dinas.finance.web.ExpenseAdjustController
;
import
com.xyst.dinas.finance.web.RefundController
;
import
com.xyst.dinas.finance.web.StatementAccountController
;
public
class
FinanceConfiguration
{
...
...
@@ -57,5 +62,20 @@ public class FinanceConfiguration {
return
new
BankRechargeDetailDaoImpl
();
}
@Bean
public
StatementAccountController
statementAccountController
()
{
return
new
StatementAccountController
();
}
@Bean
public
StatementAccountService
statementAccountService
()
{
return
new
StatementAccountServiceImpl
();
}
@Bean
public
StatementAccountDao
statementAccountDao
()
{
return
new
StatementAccountDaoImpl
();
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/dao/StatementAccountDao.java
0 → 100644
View file @
71852b7e
package
com
.
xyst
.
dinas
.
finance
.
dao
;
import
java.util.List
;
import
java.util.UUID
;
import
com.beecode.bcp.type.KObject
;
public
interface
StatementAccountDao
{
List
<
KObject
>
queryStatementAccountByContractId
(
UUID
contractId
,
String
modelPath
);
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/entity/StatementAccount.java
0 → 100644
View file @
71852b7e
package
com
.
xyst
.
dinas
.
finance
.
entity
;
import
java.math.BigDecimal
;
public
class
StatementAccount
{
private
String
dealDate
;
private
String
dealType
;
private
BigDecimal
dealAmount
;
public
String
getDealDate
()
{
return
dealDate
;
}
public
void
setDealDate
(
String
dealDate
)
{
this
.
dealDate
=
dealDate
;
}
public
String
getDealType
()
{
return
dealType
;
}
public
void
setDealType
(
String
dealType
)
{
this
.
dealType
=
dealType
;
}
public
BigDecimal
getDealAmount
()
{
return
dealAmount
;
}
public
void
setDealAmount
(
BigDecimal
dealAmount
)
{
this
.
dealAmount
=
dealAmount
;
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/internal/dao/StatementAccountDaoImpl.java
0 → 100644
View file @
71852b7e
package
com
.
xyst
.
dinas
.
finance
.
internal
.
dao
;
import
java.util.List
;
import
java.util.UUID
;
import
org.hibernate.HibernateException
;
import
org.hibernate.Session
;
import
org.hibernate.query.Query
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.orm.hibernate5.HibernateCallback
;
import
org.springframework.orm.hibernate5.HibernateOperations
;
import
com.beecode.bcp.type.KObject
;
import
com.mchange.v2.c3p0.stmt.StatementCache
;
import
com.xyst.dinas.finance.constant.ArtificialRechargeConstant
;
import
com.xyst.dinas.finance.dao.StatementAccountDao
;
public
class
StatementAccountDaoImpl
implements
StatementAccountDao
{
@Autowired
private
HibernateOperations
template
;
@Override
public
List
<
KObject
>
queryStatementAccountByContractId
(
UUID
contractId
,
String
modelPath
)
{
return
(
List
<
KObject
>)
template
.
execute
(
new
HibernateCallback
<
List
<
KObject
>>()
{
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
KObject
>
doInHibernate
(
Session
session
)
throws
HibernateException
{
Query
<
KObject
>
query
=
session
.
createQuery
(
"from "
+
modelPath
+
" where contract.id=:contractId"
,
KObject
.
class
);
query
.
setParameter
(
"contractId"
,
contractId
);
List
<
KObject
>
resultList
=
query
.
getResultList
();
return
resultList
;
}
});
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/internal/service/StatementAccountServiceImpl.java
0 → 100644
View file @
71852b7e
package
com
.
xyst
.
dinas
.
finance
.
internal
.
service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.UUID
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.xyst.dinas.finance.constant.ArtificialRechargeConstant
;
import
com.xyst.dinas.finance.constant.ExpenseAdjustConstant
;
import
com.xyst.dinas.finance.constant.FinanceRefundConstant
;
import
com.xyst.dinas.finance.dao.StatementAccountDao
;
import
com.xyst.dinas.finance.entity.StatementAccount
;
import
com.xyst.dinas.finance.enumeration.FundTypeEnum
;
import
com.xyst.dinas.finance.service.StatementAccountService
;
import
com.xyst.dinas.sales.constant.SalesRecordConstant
;
public
class
StatementAccountServiceImpl
implements
StatementAccountService
{
@Autowired
private
StatementAccountDao
statementAccountDao
;
@Override
public
Object
queryStatementAccountByContractId
(
UUID
contractId
)
{
try
{
List
<
KObject
>
artificialRechargeList
=
statementAccountDao
.
queryStatementAccountByContractId
(
contractId
,
ArtificialRechargeConstant
.
ENTITY
);
List
<
StatementAccount
>
statementAccounts
=
new
ArrayList
<
StatementAccount
>();
//人工充值
if
(
artificialRechargeList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
artificialRechargeList
.
size
();
i
++)
{
KObject
kObject
=
artificialRechargeList
.
get
(
i
);
StatementAccount
statementAccount
=
new
StatementAccount
();
if
(
kObject
.
getString
(
"fundType"
).
equals
(
FundTypeEnum
.
ADVANCE
.
name
()))
{
//预付款
statementAccount
.
setDealType
(
"预付款充值"
);
}
else
if
(
kObject
.
getString
(
"fundType"
).
equals
(
FundTypeEnum
.
DEPOSIT
.
name
())){
statementAccount
.
setDealType
(
"保证金充值"
);
}
statementAccount
.
setDealAmount
(
kObject
.
getBigDecimal
(
"rechargeAmount"
));
statementAccount
.
setDealDate
(
kObject
.
getString
(
"createTime"
));
statementAccounts
.
add
(
statementAccount
);
}
}
//退费
List
<
KObject
>
financeRefundList
=
statementAccountDao
.
queryStatementAccountByContractId
(
contractId
,
FinanceRefundConstant
.
ENTITY
);
if
(
financeRefundList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
financeRefundList
.
size
();
i
++)
{
KObject
kObject
=
financeRefundList
.
get
(
i
);
StatementAccount
statementAccount
=
new
StatementAccount
();
if
(
kObject
.
getString
(
"fundType"
).
equals
(
FundTypeEnum
.
ADVANCE
.
name
()))
{
//预付款
statementAccount
.
setDealType
(
"预付款退费"
);
}
else
if
(
kObject
.
getString
(
"fundType"
).
equals
(
FundTypeEnum
.
DEPOSIT
.
name
())){
statementAccount
.
setDealType
(
"保证金退费"
);
}
statementAccount
.
setDealAmount
(
kObject
.
getBigDecimal
(
"applyRefundAmount"
));
statementAccount
.
setDealDate
(
kObject
.
getString
(
"createTime"
));
statementAccounts
.
add
(
statementAccount
);
}
}
//费用调整
List
<
KObject
>
expenseAdjustList
=
statementAccountDao
.
queryStatementAccountByContractId
(
contractId
,
ExpenseAdjustConstant
.
ENTITY
);
if
(
expenseAdjustList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
expenseAdjustList
.
size
();
i
++)
{
KObject
kObject
=
expenseAdjustList
.
get
(
i
);
StatementAccount
statementAccount
=
new
StatementAccount
();
if
(
kObject
.
getString
(
"fundType"
).
equals
(
FundTypeEnum
.
ADVANCE
.
name
()))
{
//预付款
statementAccount
.
setDealType
(
"预付款费用调整"
);
}
else
if
(
kObject
.
getString
(
"fundType"
).
equals
(
FundTypeEnum
.
DEPOSIT
.
name
())){
statementAccount
.
setDealType
(
"保证金费用调整"
);
}
statementAccount
.
setDealAmount
(
kObject
.
getBigDecimal
(
"expenseAdjustAmount"
));
statementAccount
.
setDealDate
(
kObject
.
getString
(
"createTime"
));
statementAccounts
.
add
(
statementAccount
);
}
}
//销售
List
<
KObject
>
saleRecordList
=
statementAccountDao
.
queryStatementAccountByContractId
(
contractId
,
SalesRecordConstant
.
ENTITY
);
if
(
saleRecordList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
saleRecordList
.
size
();
i
++)
{
KObject
kObject
=
saleRecordList
.
get
(
i
);
StatementAccount
statementAccount
=
new
StatementAccount
();
statementAccount
.
setDealType
(
"销售"
);
statementAccount
.
setDealAmount
(
kObject
.
getBigDecimal
(
"amount"
));
statementAccount
.
setDealDate
(
kObject
.
getString
(
"createTime"
));
statementAccounts
.
add
(
statementAccount
);
}
}
return
ResponseObj
.
success
(
"查询成功"
,
statementAccounts
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseObj
.
error
();
}
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/service/StatementAccountService.java
0 → 100644
View file @
71852b7e
package
com
.
xyst
.
dinas
.
finance
.
service
;
import
java.util.UUID
;
public
interface
StatementAccountService
{
Object
queryStatementAccountByContractId
(
UUID
fromString
);
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/web/StatementAccountController.java
0 → 100644
View file @
71852b7e
package
com
.
xyst
.
dinas
.
finance
.
web
;
import
java.util.UUID
;
import
org.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.xyst.dinas.finance.service.StatementAccountService
;
/**
* 费用调整
*
* @author yangqingsong
* @date 2021年4月25日
*/
@RestController
public
class
StatementAccountController
{
@Autowired
private
StatementAccountService
statementAccountService
;
@ResponseBody
@RequestMapping
(
value
=
"/finance/statementAccount/queryStatementAccountByContractId"
,
method
=
RequestMethod
.
GET
)
public
Object
queryStatementAccountByContractId
(
@RequestParam
String
contractId
)
{
return
statementAccountService
.
queryStatementAccountByContractId
(
UUID
.
fromString
(
contractId
));
}
}
backend/xyst.dinas.sales/src/main/java/com/xyst/dinas/sales/constant/SalesRecordConstant.java
0 → 100644
View file @
71852b7e
package
com
.
xyst
.
dinas
.
sales
.
constant
;
public
interface
SalesRecordConstant
{
public
static
String
ENTITY
=
"com.xyst.dinas.sales.datamodel.SalesRecord"
;
}
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