|
@@ -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";
|
|
|
+ }
|
|
|
+}
|