Commit 14b549a0 by zhoujunpeng

FtToolComponent修改

parent bd202ced
package com.brilliance.isc.funds.basesel.common; package com.brilliance.isc.funds.common.component;
import com.brilliance.isc.bo.Cbb; import com.brilliance.isc.bo.Cbb;
import com.brilliance.isc.bo.Cnd; import com.brilliance.isc.bo.Cnd;
...@@ -6,11 +6,10 @@ import com.brilliance.isc.bo.Ftd; ...@@ -6,11 +6,10 @@ import com.brilliance.isc.bo.Ftd;
import com.brilliance.isc.bo.model.*; import com.brilliance.isc.bo.model.*;
import com.brilliance.isc.common.cbsmod.service.CbsmodService; import com.brilliance.isc.common.cbsmod.service.CbsmodService;
import com.brilliance.isc.common.component.PtsptaToolComponent; import com.brilliance.isc.common.component.PtsptaToolComponent;
import com.brilliance.isc.common.context.SettleContext;import com.brilliance.isc.common.exception.CommonServiceException; import com.brilliance.isc.common.exception.CommonServiceException;
import com.brilliance.isc.common.sysmod.SysmodService;import com.brilliance.isc.common.transaction.help.TransactionServiceSet; import com.brilliance.isc.common.sysmod.SysmodService;import com.brilliance.isc.common.transaction.help.TransactionServiceSet;
import com.brilliance.isc.common.trnmod.service.TrnmodService;import com.brilliance.isc.common.util.StringUtils; import com.brilliance.isc.common.trnmod.service.TrnmodService;import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.common.util.Utils; import com.brilliance.isc.common.util.Utils;
import com.brilliance.isc.common.vo.FremsgVo;
import com.brilliance.isc.common.vo.PtsptaVo; import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.isc.mda.dao.FtdselMapper; import com.brilliance.isc.mda.dao.FtdselMapper;
...@@ -51,7 +50,7 @@ public class FtToolComponent { ...@@ -51,7 +50,7 @@ public class FtToolComponent {
@Autowired @Autowired
private SysmodService sysmodService; private SysmodService sysmodService;
public Ftdgrp getCpdgrpByInr(String inr) { public Ftdgrp getFtdgrpByInr(String inr) {
Ftd ftd = new Ftd(); Ftd ftd = new Ftd();
ftd.setInr(inr); ftd.setInr(inr);
...@@ -68,33 +67,23 @@ public class FtToolComponent { ...@@ -68,33 +67,23 @@ public class FtToolComponent {
public void getref(Ftdgrp ftdgrp) { public void getref(Ftdgrp ftdgrp) {
//! Set reference number, if not already set (usually called in transaction`s MTABUT\\SAV Event) //! Set reference number, if not already set (usually called in transaction`s MTABUT\\SAV Event)
String tbl = NULLSTR; String tbl = NULLSTR;
int len = 0;
switch (ftdgrp.getRec().getFttyp()) { switch (ftdgrp.getRec().getFttyp()) {
case "LS": case "PT":
case "LB": tbl = "PT";
tbl = "FX";
len = 4;
break;
case "XS":
case "XB":
tbl = "DX";
len = 4;
break;
case "US":
tbl = "S" + Strings.mid(ftdgrp.getCbs().getMax().getCur(), 1, 1);
len = 4;
break; break;
case "UB": /**VP-同存调出
tbl = "B" + Strings.mid(ftdgrp.getCbs().getMax().getCur(), 1, 1); VN-同存户转
len = 4; **/
case "VP":
tbl = ftdgrp.getRec().getFttyp();
break; break;
default: default:
tbl = "J" + Strings.mid(ftdgrp.getCbs().getMax().getCur(), 1, 1); tbl = "FT";
len = 4;
} }
if (MdaUtils.isEmpty(ftdgrp.getRec().getOwnref())) { if (MdaUtils.isEmpty(ftdgrp.getRec().getOwnref())) {
ftdgrp.getRec().setOwnref(sysmodService.getRef(tbl, len)); ftdgrp.getRec().setOwnref(sysmodService.getRef(tbl, 5));
} }
} }
...@@ -136,14 +125,14 @@ public class FtToolComponent { ...@@ -136,14 +125,14 @@ public class FtToolComponent {
} }
public void collectPtsList(TransactionServiceSet set, Ftdgrp cpdgrp, String... ptsNames) { public void collectPtsList(TransactionServiceSet set, Ftdgrp ftdgrp, String... ptsNames) {
if (ptsNames == null) { if (ptsNames == null) {
//找所有的ptspta对象 //找所有的ptspta对象
Field[] fields = cpdgrp.getClass().getDeclaredFields(); Field[] fields = ftdgrp.getClass().getDeclaredFields();
for (Field field : fields) { for (Field field : fields) {
field.setAccessible(true); field.setAccessible(true);
if (PtsptaVo.class.equals(field.getType())) { if (PtsptaVo.class.equals(field.getType())) {
PtsptaVo ptspta = Utils.getFieldValue(cpdgrp, field.getName()); PtsptaVo ptspta = Utils.getFieldValue(ftdgrp, field.getName());
if (ptspta != null) { if (ptspta != null) {
set.addPtspta(transferFrom(ptspta)); set.addPtspta(transferFrom(ptspta));
} }
...@@ -151,7 +140,7 @@ public class FtToolComponent { ...@@ -151,7 +140,7 @@ public class FtToolComponent {
} }
} else { } else {
for (String name : ptsNames) { for (String name : ptsNames) {
PtsptaVo ptspta = Utils.getFieldValue(cpdgrp, name); PtsptaVo ptspta = Utils.getFieldValue(ftdgrp, name);
if (ptspta != null && ptspta.getPts() != null && StringUtils.isNotEmpty(ptspta.getPts().getRol())) { if (ptspta != null && ptspta.getPts() != null && StringUtils.isNotEmpty(ptspta.getPts().getRol())) {
set.addPtspta(transferFrom(ptspta)); set.addPtspta(transferFrom(ptspta));
} }
...@@ -160,29 +149,6 @@ public class FtToolComponent { ...@@ -160,29 +149,6 @@ public class FtToolComponent {
} }
public void collectPtsList(TransactionServiceSet set, FremsgVo fremsg, String... ptsNames) {
if (ptsNames == null) {
//找所有的ptspta对象
Field[] fields = fremsg.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
if (PtsptaVo.class.equals(field.getType())) {
PtsptaVo ptspta = Utils.getFieldValue(fremsg, field.getName());
if (ptspta != null) {
set.addPtspta(transferFrom(ptspta));
}
}
}
} else {
for (String name : ptsNames) {
PtsptaVo ptspta = Utils.getFieldValue(fremsg, name);
if (ptspta != null && ptspta.getPts() != null && StringUtils.isNotEmpty(ptspta.getPts().getRol())) {
set.addPtspta(transferFrom(ptspta));
}
}
}
}
/** /**
* 根据STL结构的ptspta转化成抽象组件的ptspta,结构不一样 * 根据STL结构的ptspta转化成抽象组件的ptspta,结构不一样
...@@ -288,18 +254,7 @@ public class FtToolComponent { ...@@ -288,18 +254,7 @@ public class FtToolComponent {
} }
} }
public void sav(Ftdgrp ftdgrp, BigDecimal zero) { public void sav(Ftdgrp ftdgrp) {
// saves contract including texts. CBS resp. of transaction
String frm = SettleContext.getTransName();
switch (frm) {
case "FXTSUS":
case "FXTSUB":
case "FXTSST":
case "FXTSCN":
//Datas.getContentNumeric(this, "\\LIAALL\\LIACCV\\CSHPCT")
ftdgrp.getRec().setRat(zero);
break;
}
trnmodService.trnStoreContract(ftdgrp); trnmodService.trnStoreContract(ftdgrp);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment