|
@@ -0,0 +1,145 @@
|
|
|
+package nccloud.web.ifm.investapply.action;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import nc.bs.framework.common.NCLocator;
|
|
|
+import nc.impl.pubapp.pattern.data.vo.VOQuery;
|
|
|
+import nc.itf.fi.rateconfig.IRateconfigQueryService;
|
|
|
+import nc.itf.uap.IUAPQueryBS;
|
|
|
+import nc.itf.uap.IVOPersistence;
|
|
|
+import nc.ui.bm.bmfile.view.dialog.SetClassInfoWizardStep;
|
|
|
+import nc.vo.cmp.informer.InformerVO;
|
|
|
+import nc.vo.ifm.apply.AggInvestApplyVO;
|
|
|
+import nc.vo.ifm.apply.InvestApplyVO;
|
|
|
+import nc.vo.ifm.constants.TMIFMConst;
|
|
|
+import nc.vo.imf.constants.TMIMFConst;
|
|
|
+import nc.vo.jcom.lang.StringUtil;
|
|
|
+import nc.vo.pub.BusinessException;
|
|
|
+import nc.vo.pub.lang.UFDate;
|
|
|
+import nccloud.framework.core.exception.ExceptionUtils;
|
|
|
+import nccloud.framework.service.ServiceLocator;
|
|
|
+import nccloud.framework.web.container.SessionContext;
|
|
|
+import nccloud.framework.web.convert.translate.Translator;
|
|
|
+import nccloud.framework.web.processor.template.ExtBillCardConvertProcessor;
|
|
|
+import nccloud.framework.web.ui.pattern.extbillcard.ExtBillCard;
|
|
|
+import nccloud.vo.tmpub.precison.PrecisionField;
|
|
|
+import nccloud.web.ifm.common.action.CommonSaveAction;
|
|
|
+import nccloud.web.ifm.investapply.util.ApplyPubUtil;
|
|
|
+import nccloud.web.tmpub.util.NCCFrontPrecisionUtil;
|
|
|
+
|
|
|
+public class ApplySaveAction extends CommonSaveAction<AggInvestApplyVO> {
|
|
|
+ protected AggInvestApplyVO doBusinessSave(AggInvestApplyVO operaVO) {
|
|
|
+ try {
|
|
|
+ InvestApplyVO headVO = (InvestApplyVO) operaVO.getParent();
|
|
|
+ InformerVO[] informerVO = new InformerVO[1];
|
|
|
+ //到账通知发布主键
|
|
|
+ String pk_informer = headVO.getVdef5();
|
|
|
+ if(pk_informer !=null) {
|
|
|
+ String[] pks = new String[] {pk_informer};
|
|
|
+ //到账通知发布主表
|
|
|
+ VOQuery<InformerVO> querysordr = new VOQuery<InformerVO>(InformerVO.class);
|
|
|
+ informerVO = querysordr.query(pks);
|
|
|
+ if(headVO.getMoney().compareTo(informerVO[0].getMoneyy())!=0) {
|
|
|
+ ExceptionUtils.wrapBusinessException("理财申购表头[理财金额]不等于到账通知的[金额]!");
|
|
|
+ }
|
|
|
+ //生成状态
|
|
|
+ informerVO[0].setGenerateflag("hasgenerate");
|
|
|
+ //领用金额
|
|
|
+ informerVO[0].setUsemoney(headVO.getMoney());
|
|
|
+ //认领人
|
|
|
+ informerVO[0].setPk_claimer(headVO.getBillmaker());
|
|
|
+ //认领日期
|
|
|
+ informerVO[0].setClaimdate(headVO.getBillmakedate());
|
|
|
+
|
|
|
+ informerVO[0].setLowerbilltype("3641");
|
|
|
+ informerVO[0].setDr(0);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ this.doBefore(operaVO);
|
|
|
+ AggInvestApplyVO[] result = (AggInvestApplyVO[]) ((AggInvestApplyVO[]) this.callActionScript(
|
|
|
+ TMIMFConst.CONST_ACTION_SAVEBASE, TMIMFConst.CONST_BILLTYPE_APPLY,
|
|
|
+ new AggInvestApplyVO[]{operaVO}));
|
|
|
+ if (result == null || result.length == 0) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if(pk_informer != null) {
|
|
|
+ //下游单据主键
|
|
|
+ informerVO[0].setPk_lower(result[0].getParent().getAttributeValue("pk_apply").toString());
|
|
|
+ IVOPersistence ivop = (IVOPersistence) NCLocator.getInstance().lookup(IVOPersistence.class.getName());
|
|
|
+ ivop.updateVO(informerVO[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ operaVO = result[0];
|
|
|
+
|
|
|
+ } catch (BusinessException var3) {
|
|
|
+ ExceptionUtils.wrapException(var3);
|
|
|
+ }
|
|
|
+
|
|
|
+ return operaVO;
|
|
|
+ }
|
|
|
+
|
|
|
+ protected ExtBillCard buildFontResult(AggInvestApplyVO resultVO) {
|
|
|
+ ExtBillCard billCard = new ExtBillCard();
|
|
|
+ if (resultVO == null) {
|
|
|
+ return billCard;
|
|
|
+ } else {
|
|
|
+ int ratedigit = this.getRateDigit();
|
|
|
+ InvestApplyVO parentVO = resultVO.getParentVO();
|
|
|
+ parentVO.setAttributeValue("expectedrate", parentVO.getExpectedrate().setScale(ratedigit, 4));
|
|
|
+ ExtBillCardConvertProcessor processor = new ExtBillCardConvertProcessor();
|
|
|
+ billCard = processor.convert(this.getPageCode(), resultVO);
|
|
|
+ Translator translator = new Translator();
|
|
|
+ translator.translate(billCard);
|
|
|
+
|
|
|
+ try {
|
|
|
+ NCCFrontPrecisionUtil.processExtBillCardPrecision(billCard, this.getHeadPrecisionFields(), (Map) null);
|
|
|
+ } catch (BusinessException var8) {
|
|
|
+ ExceptionUtils.wrapException(var8);
|
|
|
+ }
|
|
|
+
|
|
|
+ return billCard;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private int getRateDigit() {
|
|
|
+ IRateconfigQueryService service = (IRateconfigQueryService) ServiceLocator.find(IRateconfigQueryService.class);
|
|
|
+ int digits = 0;
|
|
|
+
|
|
|
+ try {
|
|
|
+ digits = service.queryRateSysParaInt();
|
|
|
+ } catch (BusinessException var4) {
|
|
|
+ ExceptionUtils.wrapException(var4);
|
|
|
+ }
|
|
|
+
|
|
|
+ return digits;
|
|
|
+ }
|
|
|
+
|
|
|
+ protected String getPageCode() {
|
|
|
+ return TMIMFConst.CONST_PAGECODE_ADJUST_CARD;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void doBefore(AggInvestApplyVO operaVO) throws BusinessException {
|
|
|
+ InvestApplyVO headVO = operaVO.getParentVO();
|
|
|
+ if (StringUtil.isEmptyWithTrim(headVO.getPrimaryKey())) {
|
|
|
+ headVO.setAttributeValue("creator", SessionContext.getInstance().getClientInfo().getUserid());
|
|
|
+ headVO.setAttributeValue("creationtime",
|
|
|
+ new UFDate(SessionContext.getInstance().getClientInfo().getBizDateTime()));
|
|
|
+ headVO.setAttributeValue("billmaker", SessionContext.getInstance().getClientInfo().getUserid());
|
|
|
+ headVO.setAttributeValue("billmakedate",
|
|
|
+ new UFDate(SessionContext.getInstance().getClientInfo().getBizDateTime()));
|
|
|
+ headVO.setPk_billtypecode(TMIFMConst.CONST_BILLTYPE_APPLY);
|
|
|
+ headVO.setAttributeValue("versiontime",
|
|
|
+ new UFDate(SessionContext.getInstance().getClientInfo().getBizDateTime()));
|
|
|
+ headVO.setAttributeValue("pk_billtypecode", TMIMFConst.CONST_BILLTYPE_APPLY);
|
|
|
+ headVO.setAttributeValue("redeemstatus", 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ headVO.setAttributeValue("holdmoney", headVO.getMoney());
|
|
|
+ }
|
|
|
+
|
|
|
+ protected List<PrecisionField> getHeadPrecisionFields() {
|
|
|
+ return ApplyPubUtil.getHeadPrecisionFields();
|
|
|
+ }
|
|
|
+}
|