Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
isc-funds
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
isc-v3.1-tmp
isc-funds
Commits
4bfc0473
Commit
4bfc0473
authored
Oct 12, 2024
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FXTLOP后端逻辑调整
parent
e0df9afc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
274 additions
and
57 deletions
+274
-57
FxtlopSettleRegister.java
...sc/funds/fxtlop/register/settle/FxtlopSettleRegister.java
+38
-22
FxtlopResource.java
.../brilliance/isc/funds/fxtlop/resource/FxtlopResource.java
+44
-0
FxtlopService.java
...om/brilliance/isc/funds/fxtlop/service/FxtlopService.java
+0
-2
FxtlopServiceImpl.java
...ance/isc/funds/fxtlop/service/impl/FxtlopServiceImpl.java
+10
-24
FxtlopTransactionServiceImpl.java
...nds/fxtlop/service/impl/FxtlopTransactionServiceImpl.java
+182
-9
No files found.
isc-funds-business/src/main/java/com/brilliance/isc/funds/fxtlop/register/settle/FxtlopSettleRegister.java
View file @
4bfc0473
...
...
@@ -4,6 +4,7 @@ import com.brilliance.isc.common.glemod.service.GlemodService;
import
com.brilliance.isc.common.register.settle.DefaultSettleRegister
;
import
com.brilliance.isc.common.register.settle.ISettleRegister
;
import
com.brilliance.isc.common.setglg.service.SetglgService
;
import
com.brilliance.isc.common.setglg.vo.SetglgVo
;
import
com.brilliance.isc.common.setmod.service.SetmodService
;
import
com.brilliance.isc.common.setmod.vo.SetmodVo
;
import
com.brilliance.isc.vo.funds.FxdBizInfoVo
;
...
...
@@ -12,6 +13,10 @@ import com.brilliance.mda.runtime.mda.util.Strings;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
static
com
.
brilliance
.
mda
.
runtime
.
mda
.
Constants
.
NULLSTR
;
@Component
(
"fxtlop.settleRegister"
)
public
class
FxtlopSettleRegister
implements
ISettleRegister
{
...
...
@@ -33,8 +38,19 @@ public class FxtlopSettleRegister implements ISettleRegister {
private
void
transRegister
(
SetmodVo
setmodVo
)
{
FxdBizInfoVo
rec
=
(
FxdBizInfoVo
)
setmodVo
.
getRec
();
//this.getSetmod().setDocAmt ( this.getFxdgrp().getCbs().getMax().getCur(), this.getFxdgrp().getCbs().getMax().getAmt(), "Disable" );
//this.getSetmod().setOpnAmt ( this.getFxdgrp().getCbs().getMax().getAmt() );
BigDecimal
maxAmt
=
BigDecimal
.
ZERO
;
BigDecimal
nom1Amt
=
BigDecimal
.
ZERO
;
if
(
setmodVo
.
getCbsMap
().
get
(
"MAX"
)
!=
null
)
{
maxAmt
=
setmodVo
.
getCbsMap
().
get
(
"MAX"
).
getAmt
();
}
String
nom1Cur
=
NULLSTR
;
if
(
setmodVo
.
getCbsMap
().
get
(
"NOM1"
)
!=
null
)
{
nom1Amt
=
setmodVo
.
getCbsMap
().
get
(
"NOM1"
).
getAmt
();
nom1Cur
=
setmodVo
.
getCbsMap
().
get
(
"NOM1"
).
getCur
();
}
setmodVo
.
setDocamt
(
maxAmt
);
setmodVo
.
setOpnamt
(
maxAmt
);
SetglgVo
setglg
=
setmodVo
.
getSetglg
();
setglgService
.
setglgClrAmount
(
setmodVo
.
getSetglg
(),
"TRN"
);
setglgService
.
setglgClrAmount
(
setmodVo
.
getSetglg
(),
"SET"
);
//平盘登记交易不产生分录
...
...
@@ -58,26 +74,26 @@ public class FxtlopSettleRegister implements ISettleRegister {
String
cbtKey
=
null
;
if
(
!
MdaUtils
.
isEmpty
(
rec
.
getFxtyp
())
)
{
//买入登记
if
(
MdaUtils
.
compareTo
(
Strings
.
mid
(
rec
.
getFxtyp
(),
2
,
1
),
"B"
)
==
0
)
{
//D 281110
act1
=
glemodService
.
getAvailAcc
(
"FX-SLQ"
,
setmodVo
.
getDoccur
(),
""
,
setmodVo
.
getSet
amt
()
);
ddtKey
=
setglgService
.
setglgAddAmount
(
setmodVo
.
getSetglg
(),
"TRN"
,
"OWN"
,
setmodVo
.
getDoccur
(),
setmodVo
.
getSet
amt
(),
""
,
"FXD"
,
"C"
,
act1
,
""
);
//C:281106
act4
=
glemodService
.
getAvailAcc
(
"FX-UTL"
,
setmodVo
.
getDoccur
(),
""
,
setmodVo
.
getSet
amt
()
);
cbtKey
=
setglgService
.
setglgAddAmount
(
setmodVo
.
getSetglg
(),
"SET"
,
"OWN"
,
setmodVo
.
getDoccur
(),
setmodVo
.
getSet
amt
().
negate
(),
"SET"
,
"FXC"
,
"F"
,
act4
,
"SET"
);
}
else
{
//卖出登记
//D:281106
act4
=
glemodService
.
getAvailAcc
(
"FX-UTL"
,
setmodVo
.
getDoccur
(),
""
,
setmodVo
.
getSet
amt
()
);
ddtKey
=
setglgService
.
setglgAddAmount
(
setmodVo
.
getSetglg
(),
"SET"
,
"OWN"
,
setmodVo
.
getDoccur
(),
setmodVo
.
getSet
amt
(),
"SET"
,
"FXD"
,
"F"
,
act4
,
"SET"
);
//C 281110
act1
=
glemodService
.
getAvailAcc
(
"FX-SLQ"
,
setmodVo
.
getDoccur
(),
""
,
setmodVo
.
getSetamt
()
);
cbtKey
=
setglgService
.
setglgAddAmount
(
setmodVo
.
getSetglg
(),
"TRN"
,
"OWN"
,
setmodVo
.
getDoccur
(),
setmodVo
.
getSet
amt
().
negate
(),
""
,
"FXC"
,
"C"
,
act1
,
""
);
}
//
//买入登记
//
if( MdaUtils.compareTo(Strings.mid(rec.getFxtyp(),2,1),"B") == 0 )
//
{
//
//D 281110
// act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getDoc
amt() );
// ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDoc
amt(), "", "FXD", "C", act1, "" );
//
//C:281106
// act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDoc
amt() );
// cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDoc
amt().negate(), "SET", "FXC", "F", act4, "SET" );
//
}
//
else
//
{
//
//卖出登记
//
//D:281106
// act4 = glemodService.getAvailAcc ( "FX-UTL", setmodVo.getDoccur(), "", setmodVo.getDoc
amt() );
// ddtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"SET", "OWN", setmodVo.getDoccur(), setmodVo.getDoc
amt(), "SET", "FXD", "F", act4, "SET" );
//
//C 281110
//
act1 = glemodService.getAvailAcc ( "FX-SLQ", setmodVo.getDoccur(), "", setmodVo.getSetamt() );
// cbtKey = setglgService.setglgAddAmount ( setmodVo.getSetglg(),"TRN", "OWN", setmodVo.getDoccur(), setmodVo.getDoc
amt().negate(), "", "FXC", "C", act1, "" );
//
}
}
}
...
...
isc-funds-business/src/main/java/com/brilliance/isc/funds/fxtlop/resource/FxtlopResource.java
View file @
4bfc0473
package
com
.
brilliance
.
isc
.
funds
.
fxtlop
.
resource
;
import
com.brilliance.isc.common.context.SettleContext
;
import
com.brilliance.isc.common.transaction.controller.AbstractTransactionController
;
import
com.brilliance.isc.funds.fxtlop.service.impl.FxtlopTransactionServiceImpl
;
import
com.brilliance.isc.funds.transfer.transaction.FxtlopStructMapper
;
import
com.brilliance.isc.funds.vo.funds.FxtlopStoreVo
;
import
com.brilliance.isc.funds.vo.funds.FxtssbStoreVo
;
import
com.brilliance.isc.transfer.IStructMapper
;
import
com.brilliance.isc.vo.ResponseSet
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -29,7 +36,44 @@ public class FxtlopResource extends AbstractTransactionController<FxtlopStoreVo>
return
fxtlopStructMapper
;
}
@Resource
(
name
=
"fxtlop.transaction"
)
FxtlopTransactionServiceImpl
fxtlopTransactionService
;
@Autowired
private
SettleContext
settleContext
;
@PostMapping
(
"/getRef"
)
public
ResponseSet
<
String
>
getRef
(
@RequestBody
FxtlopStoreVo
fxtlopStoreVo
)
{
String
ref
=
fxtlopTransactionService
.
getRef
(
fxtlopStoreVo
);
return
ResponseSet
.
simpleSuccess
(
ref
);
}
@PostMapping
(
"/defaultRateN1000"
)
public
ResponseSet
defaultRateN1000
(
@RequestBody
FxtlopStoreVo
fxtlopStoreVo
)
{
try
{
settleContext
.
loadSettleSession
(
"FXTLOP"
,
""
,
""
);
fxtlopTransactionService
.
defaultRateN1000
(
fxtlopStoreVo
);
return
ResponseSet
.
simpleSuccess
(
fxtlopStoreVo
);
}
catch
(
Exception
e
)
{
throw
e
;
}
finally
{
SettleContext
.
removeUserSession
();
}
}
@PostMapping
(
"/defaultCalculateN1100"
)
public
ResponseSet
defaultCalculateN1100
(
@RequestBody
FxtlopStoreVo
fxtlopStoreVo
)
{
try
{
settleContext
.
loadSettleSession
(
"FXTLOP"
,
""
,
""
);
fxtlopTransactionService
.
defaultCalculateN1100
(
fxtlopStoreVo
);
return
ResponseSet
.
simpleSuccess
(
fxtlopStoreVo
);
}
catch
(
Exception
e
)
{
throw
e
;
}
finally
{
SettleContext
.
removeUserSession
();
}
}
}
isc-funds-business/src/main/java/com/brilliance/isc/funds/fxtlop/service/FxtlopService.java
View file @
4bfc0473
...
...
@@ -4,6 +4,4 @@ import com.brilliance.isc.funds.bo.funds.FxtlopStoreBo;
public
interface
FxtlopService
{
void
initFxtlop
(
FxtlopStoreBo
fxtlopStoreBo
);
void
defaultFxtlop
(
FxtlopStoreBo
fxtlopStoreBo
);
}
isc-funds-business/src/main/java/com/brilliance/isc/funds/fxtlop/service/impl/FxtlopServiceImpl.java
View file @
4bfc0473
package
com
.
brilliance
.
isc
.
funds
.
fxtlop
.
service
.
impl
;
import
com.brilliance.isc.common.cbsmod.service.XrtmodService
;
import
com.brilliance.isc.common.context.SettleContext
;
import
com.brilliance.isc.funds.bo.funds.FxtlopStoreBo
;
import
com.brilliance.isc.funds.fxtlop.service.FxtlopService
;
import
com.brilliance.mda.runtime.mda.util.Dates
;
import
com.brilliance.mda.runtime.mda.util.MdaUtils
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.slf4j.Logger
;
@Service
public
class
FxtlopServiceImpl
implements
FxtlopService
{
@Autowired
XrtmodService
xrtmodService
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FxtlopServiceImpl
.
class
);
@Override
...
...
@@ -19,30 +26,10 @@ public class FxtlopServiceImpl implements FxtlopService {
}
private
void
initFxtlop950
(
FxtlopStoreBo
fxtlopStoreBo
)
{
//this.getTrnmod().troLockExistingOrNewContract ( this.getFxdgrp());
// if DISSEL is empty, a contract can be copied
// if( Dynamic.troIsObjTypLoaded( this.getFxdgrp()) )
// {
// this.getFxtp().getRecget().setDissel( "X");
// }
// else
// {
// this.getFxtp().getRecget().setDissel( "");
// }
}
private
void
initFxtlop1000
(
FxtlopStoreBo
fxtlopStoreBo
)
{
// this.getFxtp().setPansta( PanStaEdit);
// this.getFxtp().getAplp().setPansta( PanStaEdit);
// Systems.resetVisible(this.getFxtp(),"ovwp");
// Systems.setActivePanel(this.getRegp());
// this.getFxdgrp().getCbs().getNom1().setCur( Dynamic.sysiso());
// Systems.resetEnabled(this.getFxdgrp().getCbs().getNom1(),"cur");
// Systems.setValues(this.getFxdgrp().getRec(),"fxtyp","LB" + CR + "LS");
}
@Override
public
void
defaultFxtlop
(
FxtlopStoreBo
fxtlopStoreBo
)
{
fxtlopStoreBo
.
getFxdgrp
().
getCbs
().
getNom1
().
setCur
(
xrtmodService
.
sysiso
());
// 成交日
if
(
MdaUtils
.
isEmpty
(
fxtlopStoreBo
.
getFxdgrp
().
getRec
().
getOpndat
())
||
(!
fxtlopStoreBo
.
getFxdgrp
().
getRec
().
isModified
(
"opndat"
))
)
{
...
...
@@ -54,8 +41,7 @@ public class FxtlopServiceImpl implements FxtlopService {
{
fxtlopStoreBo
.
getFxdgrp
().
getRec
().
setValdat
(
fxtlopStoreBo
.
getFxdgrp
().
getRec
().
getOpndat
());
}
String
extkey
=
SettleContext
.
getUserSession
().
getUsr
().
getExtkey
();
fxtlopStoreBo
.
getFxdgrp
().
getRec
().
setUsr
(
extkey
);
}
}
isc-funds-business/src/main/java/com/brilliance/isc/funds/fxtlop/service/impl/FxtlopTransactionServiceImpl.java
View file @
4bfc0473
package
com
.
brilliance
.
isc
.
funds
.
fxtlop
.
service
.
impl
;
import
com.brilliance.isc.bo.*
;
import
com.brilliance.isc.bo.model.Fxacbs
;
import
com.brilliance.isc.bo.model.Fxdgrp
;
import
com.brilliance.isc.common.api.bch.service.BchService
;
import
com.brilliance.isc.common.cache.pta.PtaCacheService
;
import
com.brilliance.isc.common.cbsmod.service.CbsmodService
;
import
com.brilliance.isc.common.cbsmod.service.XrtmodService
;
import
com.brilliance.isc.common.contants.CommonContants
;
import
com.brilliance.isc.common.context.SettleContext
;
import
com.brilliance.isc.common.liaall.service.LiaallService
;
import
com.brilliance.isc.common.setmod.service.SetmodService
;
import
com.brilliance.isc.common.setmod.vo.SetmodVo
;
import
com.brilliance.isc.common.transaction.AbstractTransactionService
;
import
com.brilliance.isc.common.transaction.help.TransactionHelpService
;
import
com.brilliance.isc.common.transaction.help.TransactionServiceSet
;
import
com.brilliance.isc.common.trnmod.service.TrnmodService
;
import
com.brilliance.isc.common.trnmod.vo.TrnmodVo
;
import
com.brilliance.isc.common.util.I18nUtil
;
import
com.brilliance.isc.common.util.StringUtils
;
import
com.brilliance.isc.common.vo.BizAmdInfoVo
;
import
com.brilliance.isc.common.vo.BizInfoVo
;
import
com.brilliance.isc.common.vo.PtsptaVo
;
import
com.brilliance.isc.funds.bo.funds.FxtlopStoreBo
;
import
com.brilliance.isc.funds.bo.funds.FxtssbStoreBo
;
import
com.brilliance.isc.funds.common.component.FxToolComponent
;
import
com.brilliance.isc.funds.fxtlop.check.FxtlopValidator
;
import
com.brilliance.isc.funds.fxtlop.service.FxtlopService
;
import
com.brilliance.isc.funds.fxtlop.service.FxtpService
;
import
com.brilliance.isc.funds.vo.funds.FxtlopStoreVo
;
import
com.brilliance.isc.funds.vo.funds.FxtssbStoreVo
;
import
com.brilliance.isc.mda.dao.PtyratMapper
;
import
com.brilliance.isc.vo.funds.FxdBizInfoVo
;
import
com.brilliance.mda.runtime.mda.
util.Dates
;
import
com.brilliance.mda.runtime.mda.util.
MdaUtils
;
import
com.brilliance.mda.runtime.mda.
impl.Argument
;
import
com.brilliance.mda.runtime.mda.util.
*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.Map
;
import
java.util.*
;
import
static
com
.
brilliance
.
mda
.
runtime
.
mda
.
Constants
.
NULLSTR
;
/**
* @program: isc-funds
...
...
@@ -56,6 +70,18 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
private
LiaallService
liaallService
;
@Resource
private
SettleContext
settleContext
;
@Autowired
private
PtaCacheService
ptaCacheService
;
@Resource
private
BchService
bchService
;
@Resource
private
XrtmodService
xrtmodService
;
@Resource
private
SetmodService
setmodService
;
@Resource
private
FxtpService
fxtpService
;
@Autowired
private
PtyratMapper
ptyratMapper
;
...
...
@@ -67,7 +93,7 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
serviceRegisterMaps
.
put
(
CommonContants
.
TRNDIA_SERVICE
,
"Y"
);
serviceRegisterMaps
.
put
(
CommonContants
.
TRNMOD_SERVICE
,
"Y"
);
serviceRegisterMaps
.
put
(
CommonContants
.
UMDMOD_SERVICE
,
"N"
);
serviceRegisterMaps
.
put
(
CommonContants
.
LIMMOD_SERVICE
,
"
Y
"
);
serviceRegisterMaps
.
put
(
CommonContants
.
LIMMOD_SERVICE
,
"
N
"
);
serviceRegisterMaps
.
put
(
CommonContants
.
BOPSET_RMB_SERVICE
,
"Y"
);
serviceRegisterMaps
.
put
(
CommonContants
.
BOPSET_SZSB_BOPREM_SERVICE
,
"Y"
);
serviceRegisterMaps
.
put
(
CommonContants
.
BOPSET_CFABOP_SERVICE
,
"Y"
);
...
...
@@ -89,6 +115,18 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
protected
BizInfoVo
buildBizInfo
(
FxtlopStoreBo
transactionVo
)
{
FxdBizInfoVo
bizInfoVo
=
new
FxdBizInfoVo
();
bizInfoVo
.
setObjtyp
(
"FXD"
);
Fxd
rec
=
transactionVo
.
getFxdgrp
().
getRec
();
bizInfoVo
.
setObjinr
(
rec
.
getInr
());
bizInfoVo
.
setOwnref
(
rec
.
getOwnref
());
bizInfoVo
.
setFxtyp
(
rec
.
getFxtyp
());
bizInfoVo
.
setAcc
(
rec
.
getAcc
());
bizInfoVo
.
setAcc2
(
rec
.
getAcc2
());
bizInfoVo
.
setDsp
(
rec
.
getDsp
());
bizInfoVo
.
setDsp2
(
rec
.
getDsp2
());
bizInfoVo
.
setTrdint
(
rec
.
getTrdint
());
bizInfoVo
.
setTrdout
(
rec
.
getTrdout
());
bizInfoVo
.
setTrnman
(
rec
.
getTrnman
());
bizInfoVo
.
setRat
(
rec
.
getRat
());
return
bizInfoVo
;
}
...
...
@@ -101,7 +139,7 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
public
FxtlopStoreBo
init
(
FxtlopStoreBo
fxtlopStoreBo
)
{
fxtlopStoreBo
.
reset
();
fxtlopService
.
initFxtlop
(
fxtlopStoreBo
);
fxtlopService
.
defaultFxtlop
(
fxtlopStoreBo
);
//
fxtlopService.defaultFxtlop(fxtlopStoreBo);
return
fxtlopStoreBo
;
}
...
...
@@ -141,8 +179,8 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
//平盘登记后产生4条CBB,MAX,NOM,OPN,OPN2
//后续两个交易分别消OPN和OPN2
String
trninr
=
transactionHelpService
.
getTrninr
();
trnmodService
.
cbsTrnStore
(
"MAXAMT"
,
"AMT1"
,
Dates
.
today
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getCur
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getAmt
(),
MdaUtils
.
getI18NString
(
"fxtlop"
,
"CT000000"
),
transactionVo
.
getFxdgrp
(),
trninr
);
trnmodService
.
cbsTrnStore
(
"NOMAMT"
,
"AMT1"
,
Dates
.
today
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getNom1
().
getCur
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getNom1
().
getAmt
(),
MdaUtils
.
getI18NString
(
"fxtlop"
,
"CT000001"
),
transactionVo
.
getFxdgrp
(),
trninr
);
trnmodService
.
cbsTrnStore
(
"MAXAMT"
,
"AMT1"
,
Dates
.
today
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getCur
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getAmt
(),
MdaUtils
.
getI18NString
(
"fxtlop"
,
"CT000000"
),
transactionVo
.
getFxdgrp
()
.
getRec
()
,
trninr
);
trnmodService
.
cbsTrnStore
(
"NOMAMT"
,
"AMT1"
,
Dates
.
today
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getNom1
().
getCur
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getNom1
().
getAmt
(),
MdaUtils
.
getI18NString
(
"fxtlop"
,
"CT000001"
),
transactionVo
.
getFxdgrp
()
.
getRec
()
,
trninr
);
/**
if FXDGRP\\REC\\FXTYP.is ( "LB" ) or FXDGRP\\REC\\FXTYP.is ( "LS" ) then
...
...
@@ -153,9 +191,144 @@ public class FxtlopTransactionServiceImpl extends AbstractTransactionService<Fxt
**/
if
(
MdaUtils
.
compareTo
(
transactionVo
.
getFxdgrp
().
getRec
().
getFxtyp
(),
"LB"
)==
0
||
MdaUtils
.
compareTo
(
transactionVo
.
getFxdgrp
().
getRec
().
getFxtyp
(),
"LS"
)==
0
)
{
trnmodService
.
cbsTrnStore
(
"OPNAMT"
,
"AMT1"
,
Dates
.
today
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getCur
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getAmt
(),
MdaUtils
.
getI18NString
(
"fxtlop"
,
"CT000002"
),
transactionVo
.
getFxdgrp
(),
trninr
);
trnmodService
.
cbsTrnStore
(
"OPNAMT"
,
"AMT1"
,
Dates
.
today
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getCur
(),
transactionVo
.
getFxdgrp
().
getCbs
().
getMax
().
getAmt
(),
MdaUtils
.
getI18NString
(
"fxtlop"
,
"CT000002"
),
transactionVo
.
getFxdgrp
().
getRec
(),
trninr
);
}
if
(
!
MdaUtils
.
isEmpty
(
transactionHelpService
.
getTransactionStoreSet
().
getLiaall
()))
{
liaallService
.
storeAll
(
transactionHelpService
.
getTransactionStoreSet
().
getLiaall
());
}
liaallService
.
storeAll
(
transactionHelpService
.
getTransactionStoreSet
().
getLiaall
());
//Platform.cbsTrnCommit();
}
public
String
getRef
(
FxtlopStoreVo
fxtlopStoreVo
)
{
fxtlopStoreVo
.
reset
();
PtsptaVo
ptsptaVo
=
fxtlopStoreVo
.
getFxdgrp
().
getApl
();
if
(
ptsptaVo
==
null
||
StringUtils
.
isEmpty
(
ptsptaVo
.
getPtainr
()))
{
return
NULLSTR
;
}
Pta
pta
=
ptaCacheService
.
getPtaByInr
(
ptsptaVo
.
getPtainr
());
Bch
wrkbch
=
new
Bch
();
wrkbch
.
setInr
(
pta
.
getBranchinr
());
wrkbch
=
bchService
.
selectByPrimaryKey
(
wrkbch
);
if
(
Objects
.
isNull
(
wrkbch
))
{
return
NULLSTR
;
}
SettleContext
.
getUserSession
().
setWrkbch
(
wrkbch
);
Fxdgrp
fxdgrp
=
fxtlopStoreVo
.
getFxdgrp
();
fxToolComponent
.
getref
(
fxdgrp
);
return
fxdgrp
.
getRec
().
getOwnref
();
}
public
void
defaultRateN1000
(
FxtlopStoreVo
vo
)
{
vo
.
reset
();
String
rmbRat
=
NULLSTR
;
BigDecimal
buyRat
=
null
;
BigDecimal
selRat
=
null
;
BigDecimal
midRat
=
null
;
BigDecimal
buy1Rat
=
null
;
String
selTyp
=
NULLSTR
;
BigDecimal
selPreRat
=
null
;
String
buyTyp
=
NULLSTR
;
BigDecimal
buyPreRat
=
null
;
String
setCur
=
NULLSTR
;
BigDecimal
setAmt
=
BigDecimal
.
ZERO
;
BigDecimal
favRat
=
BigDecimal
.
ZERO
;
Cbb
max
=
vo
.
getFxdgrp
().
getCbs
().
getMax
();
Fxd
rec
=
vo
.
getFxdgrp
().
getRec
();
Pts
pts
=
vo
.
getFxdgrp
().
getApl
().
getPts
();
if
(
MdaUtils
.
isEmpty
(
vo
.
getFxtp
().
getQuoflg
())
&&
!
MdaUtils
.
isEmpty
(
rec
.
getFxtyp
())
&&
!
MdaUtils
.
isEmpty
(
pts
.
getPtyinr
()))
{
// Systems.setEnabled(vo.getFxdgrp().getRec(), "rat");
Argument
<
String
>
rmbRatBox
=
new
Argument
<
String
>();
Argument
<
BigDecimal
>
buyRatBox
=
new
Argument
<
BigDecimal
>();
Argument
<
BigDecimal
>
selRatBox
=
new
Argument
<
BigDecimal
>();
Argument
<
BigDecimal
>
midRatBox
=
new
Argument
<
BigDecimal
>();
Argument
<
BigDecimal
>
buy1RatBox
=
new
Argument
<
BigDecimal
>();
xrtmodService
.
getratCebTim
(
max
.
getCur
(),
xrtmodService
.
sysiso
(),
Dates
.
today
(),
rmbRatBox
,
buyRatBox
,
selRatBox
,
midRatBox
,
buy1RatBox
);
rmbRat
=
rmbRatBox
.
value
;
buyRat
=
buyRatBox
.
value
;
selRat
=
selRatBox
.
value
;
midRat
=
midRatBox
.
value
;
buy1Rat
=
buy1RatBox
.
value
;
Ptyrat
ptyrat
=
ptyratMapper
.
getPtyratByPtyinrAndCur
(
pts
.
getPtyinr
(),
max
.
getCur
());
if
(
Objects
.
nonNull
(
ptyrat
))
{
selTyp
=
ptyrat
.
getSeltyp
();
selPreRat
=
ptyrat
.
getBuyrat
();
buyTyp
=
ptyrat
.
getBuytyp
();
buyPreRat
=
ptyrat
.
getBuyrat
();
}
// 如果没有优惠,则根据配置文件来进行优惠
setCur
=
max
.
getCur
();
SetmodVo
setmodVo
=
buildSetmodVo
(
vo
);
setAmt
=
setmodService
.
getSettlementAmount
(
setmodVo
,
setCur
);
// 默认都是按照点数优惠
if
(
MdaUtils
.
compareTo
(
setAmt
,
0
)
>
0
)
{
buyTyp
=
"1"
;
selTyp
=
"1"
;
/* TODO setusd.ini 未提供 暂时注释
favRat = vo.getFxtp().getFavorRatePoint(setCur, setAmt);
if (MdaUtils.compareTo(favRat, buyPreRat) > 0) {
buyPreRat = favRat;
}
if (MdaUtils.compareTo(favRat, selPreRat) > 0) {
selPreRat = favRat;
}*/
}
if
(!
rec
.
isModified
(
"rat"
))
{
if
(
MdaUtils
.
compareTo
(
Strings
.
mid
(
rec
.
getFxtyp
(),
2
,
1
),
"B"
)
==
0
)
{
if
(
MdaUtils
.
compareTo
(
vo
.
getFxtp
().
getCshflg
(),
"2"
)
==
0
)
{
rec
.
setRat
(
buy1Rat
);
}
else
{
switch
(
buyTyp
)
{
case
"1"
:
rec
.
setRat
(
Decimals
.
add
(
buyRat
,
Decimals
.
div
(
buyPreRat
,
10000
)));
break
;
case
"2"
:
rec
.
setRat
(
Decimals
.
add
(
buyRat
,
Decimals
.
div
(
Decimals
.
mul
(
buyRat
,
buyPreRat
),
100
)));
break
;
default
:
rec
.
setRat
(
buyRat
);
}
}
}
else
{
switch
(
Strings
.
trim
(
selTyp
))
{
case
"1"
:
rec
.
setRat
(
Decimals
.
sub
(
selRat
,
Decimals
.
div
(
selPreRat
,
10000
)));
break
;
case
"2"
:
rec
.
setRat
(
Decimals
.
sub
(
selRat
,
Decimals
.
div
(
Decimals
.
mul
(
selRat
,
selPreRat
),
100
)));
break
;
default
:
rec
.
setRat
(
selRat
);
}
}
}
rec
.
setRat
(
Numerics
.
round
(
rec
.
getRat
(),
4
));
rec
.
setMidrat
(
Numerics
.
round
(
midRat
,
4
));
}
else
{
// Systems.resetEnabled(rec, "rat");
rec
.
setRat
(
BigDecimal
.
ZERO
);
rec
.
setMidrat
(
BigDecimal
.
ZERO
);
}
}
private
SetmodVo
buildSetmodVo
(
FxtlopStoreVo
vo
)
{
SetmodVo
setmodVo
=
new
SetmodVo
();
Map
cbsMap
=
new
HashMap
();
Cbb
max
=
vo
.
getFxdgrp
().
getCbs
().
getMax
();
cbsMap
.
put
(
"MAX"
,
max
);
setmodVo
.
setCbsMap
(
cbsMap
);
List
<
PtsptaVo
>
ptsList
=
new
ArrayList
();
PtsptaVo
apl
=
vo
.
getFxdgrp
().
getApl
();
ptsList
.
add
(
apl
);
setmodVo
.
setPtsList
(
ptsList
);
FxdBizInfoVo
bizInfoVo
=
new
FxdBizInfoVo
();
bizInfoVo
.
setObjtyp
(
"FXD"
);
setmodVo
.
setRec
(
bizInfoVo
);
return
setmodVo
;
}
public
void
defaultCalculateN1100
(
FxtlopStoreVo
fxtlopStoreVo
)
{
fxtlopStoreVo
.
reset
();
fxtpService
.
defaultCalculateN1100
(
fxtlopStoreVo
.
getFxdgrp
(),
fxtlopStoreVo
.
getFxtp
());
}
}
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