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
074060e1
Commit
074060e1
authored
May 06, 2021
by
杨清松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账单相关接口
parent
1a1acb61
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
0 deletions
+113
-0
StatementAccountDao.java
.../java/com/xyst/dinas/finance/dao/StatementAccountDao.java
+2
-0
StatementAccountDaoImpl.java
...t/dinas/finance/internal/dao/StatementAccountDaoImpl.java
+26
-0
StatementAccountServiceImpl.java
...finance/internal/service/StatementAccountServiceImpl.java
+60
-0
StatementAccountService.java
...m/xyst/dinas/finance/service/StatementAccountService.java
+5
-0
StatementAccountController.java
...om/xyst/dinas/finance/web/StatementAccountController.java
+20
-0
No files found.
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/dao/StatementAccountDao.java
View file @
074060e1
...
@@ -11,4 +11,6 @@ public interface StatementAccountDao {
...
@@ -11,4 +11,6 @@ public interface StatementAccountDao {
List
<
KObject
>
queryStatementAccountByContractId
(
JSONObject
jsonObject
,
String
modelPath
);
List
<
KObject
>
queryStatementAccountByContractId
(
JSONObject
jsonObject
,
String
modelPath
);
List
<
KObject
>
queryAdvanceByContractId
(
UUID
contractId
,
String
fundType
,
String
entity
);
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/internal/dao/StatementAccountDaoImpl.java
View file @
074060e1
...
@@ -17,6 +17,7 @@ import org.springframework.orm.hibernate5.HibernateOperations;
...
@@ -17,6 +17,7 @@ import org.springframework.orm.hibernate5.HibernateOperations;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.bcp.type.KObject
;
import
com.xyst.dinas.finance.dao.StatementAccountDao
;
import
com.xyst.dinas.finance.dao.StatementAccountDao
;
import
com.xyst.dinas.finance.enumeration.FundTypeEnum
;
public
class
StatementAccountDaoImpl
implements
StatementAccountDao
{
public
class
StatementAccountDaoImpl
implements
StatementAccountDao
{
...
@@ -67,4 +68,29 @@ public class StatementAccountDaoImpl implements StatementAccountDao{
...
@@ -67,4 +68,29 @@ public class StatementAccountDaoImpl implements StatementAccountDao{
}
}
});
});
}
}
@Override
public
List
<
KObject
>
queryAdvanceByContractId
(
UUID
contractId
,
String
fundType
,
String
entity
)
{
return
(
List
<
KObject
>)
template
.
execute
(
new
HibernateCallback
<
List
<
KObject
>>()
{
StringBuilder
hql
=
new
StringBuilder
(
"from "
+
entity
+
" where contract.id=:contractId and fundType=:fundType"
);
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
KObject
>
doInHibernate
(
Session
session
)
throws
HibernateException
{
Query
<
KObject
>
query
=
session
.
createQuery
(
hql
.
toString
(),
KObject
.
class
);
query
.
setParameter
(
"contractId"
,
contractId
);
if
(
entity
.
equals
(
"com.xyst.dinas.finance.datamodel.FinanceRefund"
))
{
if
(
fundType
.
equals
(
FundTypeEnum
.
ADVANCE
.
name
()))
{
query
.
setParameter
(
"fundType"
,
0
);
}
if
(
fundType
.
equals
(
FundTypeEnum
.
DEPOSIT
.
name
()))
{
query
.
setParameter
(
"fundType"
,
1
);
}
}
else
{
query
.
setParameter
(
"fundType"
,
fundType
);
}
List
<
KObject
>
resultList
=
query
.
getResultList
();
return
resultList
;
}
});
}
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/internal/service/StatementAccountServiceImpl.java
View file @
074060e1
...
@@ -190,4 +190,64 @@ public class StatementAccountServiceImpl implements StatementAccountService{
...
@@ -190,4 +190,64 @@ public class StatementAccountServiceImpl implements StatementAccountService{
}
}
@Override
public
List
<
StatementAccount
>
queryAccountByContractId
(
JSONObject
jsonObject
)
{
UUID
contractId
=
UUID
.
fromString
(
jsonObject
.
getString
(
"contractId"
));
String
fundType
=
jsonObject
.
getString
(
"fundType"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
KObject
>
artificialRechargeAdvanceList
=
statementAccountDao
.
queryAdvanceByContractId
(
contractId
,
fundType
,
ArtificialRechargeConstant
.
ENTITY
);
List
<
StatementAccount
>
statementAccounts
=
new
ArrayList
<
StatementAccount
>();
//人工充值
if
(
artificialRechargeAdvanceList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
artificialRechargeAdvanceList
.
size
();
i
++)
{
KObject
kObject
=
artificialRechargeAdvanceList
.
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
.
queryAdvanceByContractId
(
contractId
,
fundType
,
FinanceRefundConstant
.
ENTITY
);
if
(
financeRefundList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
financeRefundList
.
size
();
i
++)
{
KObject
kObject
=
financeRefundList
.
get
(
i
);
StatementAccount
statementAccount
=
new
StatementAccount
();
if
(
fundType
.
equals
(
FundTypeEnum
.
ADVANCE
.
name
()))
{
//预付款
statementAccount
.
setDealType
(
"预付款退费"
);
}
else
if
(
fundType
.
equals
(
FundTypeEnum
.
DEPOSIT
.
name
())){
statementAccount
.
setDealType
(
"保证金退费"
);
}
statementAccount
.
setDealAmount
(
kObject
.
getBigDecimal
(
"actualRefundAmount"
));
statementAccount
.
setDealDate
(
kObject
.
getString
(
"createTime"
));
statementAccounts
.
add
(
statementAccount
);
}
}
//费用调整
List
<
KObject
>
expenseAdjustList
=
statementAccountDao
.
queryAdvanceByContractId
(
contractId
,
fundType
,
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
);
}
}
return
statementAccounts
;
}
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/service/StatementAccountService.java
View file @
074060e1
package
com
.
xyst
.
dinas
.
finance
.
service
;
package
com
.
xyst
.
dinas
.
finance
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -7,10 +8,14 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -7,10 +8,14 @@ import javax.servlet.http.HttpServletResponse;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
com.xyst.dinas.finance.entity.StatementAccount
;
public
interface
StatementAccountService
{
public
interface
StatementAccountService
{
Map
<
String
,
Object
>
queryStatementAccountByContractId
(
JSONObject
jsonObject
);
Map
<
String
,
Object
>
queryStatementAccountByContractId
(
JSONObject
jsonObject
);
void
exportStatementAccountDetails
(
HttpServletResponse
response
,
JSONObject
param
);
void
exportStatementAccountDetails
(
HttpServletResponse
response
,
JSONObject
param
);
List
<
StatementAccount
>
queryAccountByContractId
(
JSONObject
jsonObject
);
}
}
backend/xyst.dinas.finance/src/main/java/com/xyst/dinas/finance/web/StatementAccountController.java
View file @
074060e1
package
com
.
xyst
.
dinas
.
finance
.
web
;
package
com
.
xyst
.
dinas
.
finance
.
web
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.beecode.inz.basis.team.pojo.ResponseObj
;
import
com.xyst.dinas.finance.entity.StatementAccount
;
import
com.xyst.dinas.finance.service.StatementAccountService
;
import
com.xyst.dinas.finance.service.StatementAccountService
;
/**
/**
...
@@ -65,5 +67,23 @@ public class StatementAccountController {
...
@@ -65,5 +67,23 @@ public class StatementAccountController {
}
}
return
obj
.
toString
();
return
obj
.
toString
();
}
}
/**
* 预付款
* @param
* @return
*/
@ResponseBody
@RequestMapping
(
value
=
"/finance/statementAccount/queryAccountByContractId"
,
method
=
RequestMethod
.
POST
)
public
Object
queryAdvanceByContractId
(
@RequestBody
String
body
)
{
try
{
List
<
StatementAccount
>
advanceAmount
=
statementAccountService
.
queryAccountByContractId
(
new
JSONObject
(
body
));
return
ResponseObj
.
success
(
"查询成功"
,
advanceAmount
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseObj
.
error
();
}
}
}
}
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