Browse Source

付款结算修改保存校验金额

pancy 3 years ago
parent
commit
1f8e2837c8

+ 120 - 0
zjcmp_cd/zjcmp_cd/src/client/nccloud/web/cdmc/cdm/ref/action/FinancepayGridRefAction.java

@@ -0,0 +1,120 @@
+package nccloud.web.cdmc.cdm.ref.action;
+
+import java.util.ArrayList;
+import java.util.List;
+import nc.vo.bd.currtype.CurrtypeVO;
+import nc.vo.cdmc.cdm.financepay.FinancepayVO;
+import nc.vo.fi.rateconfig.RateCodeVO;
+import nc.vo.ml.MultiLangUtil;
+import nc.vo.pf.pub.util.SQLUtil;
+import nc.vo.pub.lang.UFBoolean;
+import nc.vo.tmpub.util.StringUtil;
+import nccloud.framework.web.processor.refgrid.RefQueryInfo;
+import nccloud.framework.web.ui.meta.RefMeta;
+import nccloud.web.tmpub.pub.ref.TranslatableGridRefAction;
+
+public class FinancepayGridRefAction extends TranslatableGridRefAction {
+	public RefMeta getRefMeta(RefQueryInfo refQueryInfo) {
+		RefMeta ref = new RefMeta();
+		ref.setCodeField("vbillno");
+		ref.setNameField("vbillno");
+		ref.setPkField("pk_financepay");
+		ref.setTableName(FinancepayVO.getDefaultTableName());
+		ref.setExtraFields(new String[]{"vbillno", "loandate", "loanmny", "pk_currtype", "olcloanmny", "contenddate",
+				"pk_rate", "initflag", "accountinter"});
+		this.addTranslateFiled();
+		this.addDateField2Process();
+		this.addMnyField2Process();
+		return ref;
+	}
+
+	private void addTranslateFiled() {
+		int currentLangSeq = MultiLangUtil.getCurrentLangSeq();
+		if (currentLangSeq != 1) {
+			super.addPkTranslateTarget("pk_rate", "ratename" + currentLangSeq, RateCodeVO.class);
+			super.addPkTranslateTarget("pk_currtype", "name" + currentLangSeq, CurrtypeVO.class);
+		} else {
+			super.addPkTranslateTarget("pk_rate", "ratename", RateCodeVO.class);
+			super.addPkTranslateTarget("pk_currtype", "name", CurrtypeVO.class);
+		}
+
+	}
+
+	private void addDateField2Process() {
+		List<String> mnyFieldList = new ArrayList();
+		mnyFieldList.add("loandate");
+		mnyFieldList.add("contenddate");
+		super.addDateField(mnyFieldList);
+	}
+
+	private void addMnyField2Process() {
+		List<String> mnyFieldList = new ArrayList();
+		mnyFieldList.add("loanmny");
+		mnyFieldList.add("olcloanmny");
+		super.addMnyField(mnyFieldList);
+	}
+
+	public String getExtraSql(RefQueryInfo refQueryInfo, RefMeta refMeta) {
+		String pk_org = (String) refQueryInfo.getQueryCondition().get("pk_org");
+		String pk_currtype = (String) refQueryInfo.getQueryCondition().get("pk_currtype");
+		String begindate = (String) refQueryInfo.getQueryCondition().get("loandate");
+		String enddate = (String) refQueryInfo.getQueryCondition().get("contenddate");
+		StringBuffer wheresql = new StringBuffer(" and isnull(cdmc_financepay.dr, 0)=0 ");
+		String checksagafrozen = (String) refQueryInfo.getQueryCondition().get("checksagafrozen");
+		if (!"false".equals(checksagafrozen)) {
+			wheresql.append(" and isnull(cdmc_financepay.saga_frozen, 0)=0 ");
+		}
+
+		String repayType = (String) refQueryInfo.getQueryCondition().get("repaytype");
+		String isQuery = (String) refQueryInfo.getQueryCondition().get("isquery");
+		wheresql.append(" and  cdmc_financepay.vbillstatus = 1 ");
+		if (StringUtil.isNull(isQuery) && !UFBoolean.TRUE.equals(new UFBoolean(isQuery))) {
+			wheresql.append(" and cdmc_financepay.busistatus not in (0, 4) ");
+		}
+
+		if (!StringUtil.isNull(repayType)) {
+			if ("intst".equals(repayType)) {
+				wheresql.append(
+//						" and ((cdmc_financepay.accountinter = 'Y' and isnull(cdmc_financepay.unrepayintstmny,0) > 0) or isnull(cdmc_financepay.accountinter,'N') = 'N' ) ");
+						" and ((cdmc_financepay.accountinter = 'Y' ) or isnull(cdmc_financepay.accountinter,'N') = 'N' ) ");
+			}
+
+			if ("prcpl".equals(repayType)) {
+				wheresql.append(" and isnull(cdmc_financepay.unpaymny,0)>0 ");
+			}
+
+			wheresql.append(" and cdmc_financepay.busistatus not in (0, 4) ");
+		}
+
+		String[] pk_currtypes;
+		if (StringUtil.isNull(pk_org) && UFBoolean.TRUE.equals(new UFBoolean(isQuery))) {
+			wheresql.append(" and 1 = 0 ");
+		} else if (!StringUtil.isNull(pk_org)) {
+			pk_currtypes = pk_org.split(",");
+			if (pk_currtypes != null && pk_currtypes.length > 0) {
+				wheresql.append(" and ").append(SQLUtil.buildSqlForIn("cdmc_financepay.pk_org", pk_currtypes));
+			}
+		}
+
+		if (!StringUtil.isNull(pk_currtype)) {
+			pk_currtypes = pk_currtype.split(",");
+			if (pk_currtypes != null && pk_currtypes.length > 0) {
+				wheresql.append(" and ").append(SQLUtil.buildSqlForIn("cdmc_financepay.pk_currtype", pk_currtypes));
+			}
+		}
+
+		if (!StringUtil.isNull(begindate)) {
+			wheresql.append(" and cdmc_financepay.loandate >= '").append(enddate).append("' ");
+		}
+
+		if (!StringUtil.isNull(enddate)) {
+			wheresql.append(" and cdmc_financepay.contenddate <= '").append(enddate).append("' ");
+		}
+
+		return wheresql.toString();
+	}
+
+	public String getOrderSql(RefQueryInfo refQueryInfo, RefMeta refMeta) {
+		return "order by cdmc_financepay.vbillno";
+	}
+}

+ 48 - 0
zjcmp_cd/zjcmp_cd/src/client/nccloud/web/cmp/billmanagement/paybills/action/PaybillsUpdateAction.java

@@ -0,0 +1,48 @@
+package nccloud.web.cmp.billmanagement.paybills.action;
+
+import nc.vo.cmp.bill.BillAggVO;
+import nc.vo.cmp.bill.BillDetailVO;
+import nc.vo.cmp.bill.BillVO;
+import nc.vo.pub.lang.UFDouble;
+import nccloud.framework.core.exception.ExceptionUtils;
+import nccloud.framework.web.container.IRequest;
+import nccloud.framework.web.ui.pattern.billcard.BillCard;
+import nccloud.pubitf.cmp.paybill.PaybillSagaInfoAdapter;
+import nccloud.web.cmp.billmanagement.paybills.common.EnumFlowOperation;
+import nccloud.web.cmp.billmanagement.paybills.common.PaybillsCommonAction;
+import nccloud.web.cmp.billmanagement.paybills.common.PaybillsUtil;
+import nccloud.web.tmpub.pub.ms.util.SagasBizUtil;
+
+public class PaybillsUpdateAction extends PaybillsCommonAction {
+	public Object doAction(IRequest request) {
+		BillCard card = super.getCard(request);
+		BillAggVO vo = super.aggVOConvert(request);
+		BillVO headvo=(BillVO) vo.getParentVO();
+		BillDetailVO[] detailvos = (BillDetailVO[]) vo.getChildrenVO();
+		UFDouble summmoney = new UFDouble(0);
+		for(BillDetailVO detailvo:detailvos) {
+			UFDouble Pay_primal = detailvo.getPay_primal();
+			summmoney = summmoney.add(Pay_primal);
+		}
+		if(!headvo.getDef12().equals("")&&!headvo.getDef12().equals(null)) {
+    		UFDouble srcmoney = new UFDouble(headvo.getDef12());
+    		if(!srcmoney.equals(summmoney)) {
+    			ExceptionUtils.wrapBusinessException("付款金额和到账通知的金额不等,请检验。 ");
+    		}
+    	}
+		String pagecode = super.getPagecode(request);
+		BillAggVO[] result = null;
+		
+		try {
+			SagasBizUtil.setOperInfo("36070PBR_D5_card", "edit");
+			this.getISagasBizService().checkFrozen(new PaybillSagaInfoAdapter(), vo.getPrimaryKey());
+			PaybillsUtil.Paybills2BusiAgg(vo);
+			super.handleBankInfo((BillDetailVO[]) ((BillDetailVO[]) vo.getChildrenVO()));
+			result = super.cloudPFlowEvent(new BillAggVO[]{super.deleteRow(vo)}, EnumFlowOperation.EDIT.getCode());
+			return super.cardAfterHandler(pagecode, result[0], card);
+		} catch (Exception var7) {
+			ExceptionUtils.wrapException(var7);
+			return null;
+		}
+	}
+}