ソースを参照

Merge branch 'master' of http://210.51.45.41:3000/itcat_admin/aws_donenow

HULEI 2 ヶ月 前
コミット
cab1dc9930

+ 37 - 0
com.awspaas.user.apps.donenow_ctt/src/com/awspaas/user/apps/donenow_ctt/event/DeductionPayDWFormatSQLEvent.java

@@ -0,0 +1,37 @@
+package com.awspaas.user.apps.donenow_ctt.event;
+
+import com.actionsoft.bpms.dw.design.event.DataWindowFormatSQLEventInterface;
+import com.actionsoft.bpms.dw.exec.component.DataView;
+import com.actionsoft.bpms.server.UserContext;
+import com.actionsoft.sdk.local.SDK;
+import com.actionsoft.sdk.local.api.Logger;
+
+import java.util.Map;
+
+public class DeductionPayDWFormatSQLEvent implements DataWindowFormatSQLEventInterface {
+    private static final Logger LOGGER = SDK.getLogAPI().getLogger(DeductionPayDWFormatSQLEvent.class);//记录
+
+    /**
+     * 格式化sql
+     * @param userContext
+     * @param dataView
+     * @param sql
+     * @return
+     */
+    @Override
+    public String formatSQL(UserContext userContext, DataView dataView, String sql) {
+        LOGGER.info("初始sql:" + sql);
+        try {
+            Map<String, Object> sqlParam = dataView.getDatagrid().getSqlParams();
+            LOGGER.info("sqlParam:" + sqlParam.toString());
+            if (sqlParam.containsKey("ID") && sqlParam.get("ID") != null) {
+                sql = sql.replace("UPPER(d.ID) = :ID", "FIND_IN_SET(ID,:ID)>0");
+                sql = sql.replace("d.ID = :ID", "FIND_IN_SET(ID,:ID)>0");
+            }
+        } catch (Exception ex) {
+            LOGGER.error("格式化sql异常:" + ex.getMessage());
+        }
+        LOGGER.info("格式化后的sql:" + sql);
+        return sql;
+    }
+}

+ 1 - 1
com.awspaas.user.apps.donenow_ctt/src/com/awspaas/user/apps/donenow_ctt/service/InvoiceService.java

@@ -257,7 +257,7 @@ public class InvoiceService {
                 // 4.4 税务相关字段
                 detail.set("EFFECTIVE_TAX_RATE", ded.getDouble("EFFECTIVE_TAX_RATE") * 100);
                 detail.set("TAX_CATEGORY_NAME", ded.get("TAX_CATEGORY_NAME"));
-
+                detail.set("CONTRACT_ID", ded.get("CONTRACT_ID"));
                 // 4.5 保存明细
                 SDK.getBOAPI().createDataBO("BO_EU_DNCTT_INVOICE_DETAIL", detail, uc);
                 dn.recordFormChanges.record(uc, detail, "保存账单明细:" + detail.getId());