Quellcode durchsuchen

新增报表跳转,直连Gbase同步数据

zhang_qk vor 2 Monaten
Ursprung
Commit
a98f7b63a7
17 geänderte Dateien mit 879 neuen und 40 gelöschten Zeilen
  1. 14 14
      Procedure/backend/project/src/main/java/com/sundata/config/DefaultDataSourceConfig.java
  2. 2 1
      Procedure/backend/project/src/main/java/com/sundata/example/mybatis/ExampleSysUserMapper.xml
  3. 5 1
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/calc/service/implement/units/GeneralLedgerGetterUnit.java
  4. 1 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/mapper/MultiDimensionalCreditRiskMapper.java
  5. 9 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/model/MultiDimensionalCreditRiskModel.java
  6. 15 1
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/mybatis/MultiDimensionalCreditRiskMapper.xml
  7. 10 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/service/MultiDimensionalCreditRiskService.java
  8. 8 1
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/reportformconfigreportcreater/action/ReportFileExportController.java
  9. 7 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwacalcconfigdataparam/action/RealEstateAction.java
  10. 9 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwacalcconfigdataparam/service/RealEstateService.java
  11. 28 12
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/util/html/ToHtml.java
  12. 1 1
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/util/html/ToMergeHtml.java
  13. 1 1
      Procedure/backend/project/src/main/java/com/sundata/product/tempFile/task/controller/ImportTaskBussinessController.java
  14. 753 7
      Procedure/frontend/projectb/src/pages/product/report_form_config_reportcreater/reportFileShow.tsx
  15. 3 1
      Procedure/frontend/projectb/src/pages/rwa_calc_config_dataparam/realestate.tsx
  16. 6 0
      Procedure/frontend/projectb/src/services/rwa/product/report_form_config_reportcreater/reportFile.ts
  17. 7 0
      Procedure/frontend/projectb/src/services/rwa/rwa_calc_config_dataparam/realestate.ts

+ 14 - 14
Procedure/backend/project/src/main/java/com/sundata/config/DefaultDataSourceConfig.java

@@ -57,20 +57,20 @@ public class DefaultDataSourceConfig {
     @Bean
     public DataSources initOtherDatasource() {
         DataSources dataSources = new DataSources();
-//        Setting setting = new Setting("OtherDBConfig.setting");
-////		String group = "GBaseDB";
-//        setting.getGroups().forEach(group -> {
-//            HikariConfig config = new HikariConfig();
-//            config.setDriverClassName(setting.getByGroup("driver", group));
-//            config.setJdbcUrl(setting.getByGroup("url", group));
-//            config.setUsername(setting.getByGroup("user", group));
-//            config.setPassword(setting.getByGroup("pass", group));
-//            config.setMaximumPoolSize(5);
-//            config.setMinimumIdle(1);
-//            config.setAutoCommit(true);//自动提交
-//            HikariDataSource ds = new HikariDataSource(config);
-//            dataSources.setDataSource(group, ds);
-//        });
+        Setting setting = new Setting("OtherDBConfig.setting");
+//		String group = "GBaseDB";
+        setting.getGroups().forEach(group -> {
+            HikariConfig config = new HikariConfig();
+            config.setDriverClassName(setting.getByGroup("driver", group));
+            config.setJdbcUrl(setting.getByGroup("url", group));
+            config.setUsername(setting.getByGroup("user", group));
+            config.setPassword(setting.getByGroup("pass", group));
+            config.setMaximumPoolSize(5);
+            config.setMinimumIdle(1);
+            config.setAutoCommit(true);//自动提交
+            HikariDataSource ds = new HikariDataSource(config);
+            dataSources.setDataSource(group, ds);
+        });
 
         return dataSources;
     }

+ 2 - 1
Procedure/backend/project/src/main/java/com/sundata/example/mybatis/ExampleSysUserMapper.xml

@@ -163,7 +163,8 @@
 				listagg(account,',') within  group(order by loginname) as account,listagg(u.orgcode,',')  within group(order by loginname) as orgcode
 			</if>
 			<if test="dbtype == 'mysql' ">
-				group_concat(account) as account,group_concat(u.orgcode) as orgcode
+
+				(account) as account,group_concat(u.orgcode) as orgcode
 			</if>
 			<if test="dbtype == 'db2' ">
 				listagg(account,',') as account,listagg(u.orgcode,',') as orgcode

+ 5 - 1
Procedure/backend/project/src/main/java/com/sundata/product/rwa/calc/service/implement/units/GeneralLedgerGetterUnit.java

@@ -201,11 +201,15 @@ public class GeneralLedgerGetterUnit extends CalcUnit {
             getterSql = getterSql.replace("#{","${"); // 处理所有的配置转为 可被替换的 $
             String LEDGER_GETDATA_RULE_SQL = sub.replace(getterSql);
             String BALANCE_Str = DBExecutor.doQuery(LEDGER_GETDATA_RULE_SQL);
+            if(BALANCE_Str == null || "".equals(BALANCE_Str)){
+                BALANCE_Str = "0";
+            }
             String LOAN_REFERENCE_NO = "ZZQS" + DataUtil.getDataDefault(map.get("SUBJECT_CODES"), String.class);
             String ONOROFF = (String) DataUtil.getDataDefault(map.get("ONOROFF"), String.class);
             String SUBJECT_CODES = (String) DataUtil.getDataDefault(map.get("SUBJECT_CODES"), String.class);
             String SUBJECT_NAMES = (String) DataUtil.getDataDefault(map.get("SUBJECT_NAMES"), String.class);
-            BigDecimal BALANCE = (BigDecimal) DataUtil.getDataDefault(BALANCE_Str, BigDecimal.class);
+            BigDecimal BALANCE = (BigDecimal) DataUtil.getDataDefault(new BigDecimal (BALANCE_Str), BigDecimal.class);
+           // BigDecimal BALANCE = new BigDecimal(BALANCE_Str) ;
             String CURRENCY = "CNY";
             String LEDGER_OFFOBJECT_NO = (String) DataUtil.getDataDefault(map.get("LEDGER_OFFOBJECT_NO"), String.class);
             String LEDGER_OFFOBJECT_NAME;

+ 1 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/mapper/MultiDimensionalCreditRiskMapper.java

@@ -12,5 +12,6 @@ public interface MultiDimensionalCreditRiskMapper {
     boolean delete(@Param("model") MultiDimensionalCreditRiskModel model);
     boolean insert(@Param("model") MultiDimensionalCreditRiskModel model,@Param("workDate") String workDate,@Param("account") String  account);
     boolean update(@Param("model") MultiDimensionalCreditRiskModel model);
+    boolean update1(@Param("model") MultiDimensionalCreditRiskModel model);
 
 }

+ 9 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/model/MultiDimensionalCreditRiskModel.java

@@ -69,6 +69,15 @@ public class MultiDimensionalCreditRiskModel {
     private String  riskExposureCodeArtificial;   //风险暴露分类(人工认定)
     private BigDecimal  loanWeightArtificial;   //风险权重%(人工认定)
     private BigDecimal  rwa;   //风险加权资产
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
 
     public String getTerm() {
         return term;

+ 15 - 1
Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/mybatis/MultiDimensionalCreditRiskMapper.xml

@@ -102,6 +102,9 @@
             <if test="model.loanReferenceNo != null and '' != model.loanReferenceNo">
                 and LOAN_REFERENCE_NO like concat(concat('%',#{model.loanReferenceNo}),'%')
             </if>
+            <if test="model.riskExposeClassRecognizedResult != null and '' != model.riskExposeClassRecognizedResult">
+                and RISK_EXPOSE_CLASS_RECOGNIZED_RESULT = #{model.riskExposeClassRecognizedResult}
+            </if>
         </where>
         -- order by t.RULE_NO,t.SUBJECT_CODES,t.LEDGER_RISKEXPOSURE_NO,t.LEDGER_OFFOBJECT_NO
     </select>
@@ -140,8 +143,19 @@
 </insert>
 
     <update id="update" parameterType="com.sundata.product.rwa.internal.model.MultiDimensionalCreditRiskModel">
-        update RWA_REPORT_RS_MULTI_DIMENSIONAL_CREDIT_RISK set RISK_EXPOSURE_CODE_ARTIFICIAL =#{model.riskExposureCodeArtificial},LOAN_WEIGHT_ARTIFICIAL = #{model.loanWeightArtificial}
+        update RWA_REPORT_RS_MULTI_DIMENSIONAL_CREDIT_RISK set RISK_EXPOSURE_CODE_ARTIFICIAL =#{model.riskExposureCodeArtificial},LOAN_WEIGHT_ARTIFICIAL = #{model.loanWeightArtificial} ,RWA = #{model.unfinishEad}*nvl(#{model.loanWeightArtificial},0) - #{model.unfinishEad}*nvl(#{model.debtitemRiskWeight},0) + #{model.rwa}
         where term = #{model.term} and LOAN_REFERENCE_NO = #{model.loanReferenceNo}
     </update>
 
+   <update id="update1" parameterType="com.sundata.product.rwa.internal.model.MultiDimensionalCreditRiskModel"  >
+       UPDATE
+       <if test=' model.type != null   and model.type == "1"'>
+             RWA_APM_BUS_RS_ONBUSINESSRWA
+       </if>
+       <if test=' model.type != null   and model.type == "0"'>
+             RWA_APM_BUS_RS_OFFBUSINESSRWA
+       </if>
+       SET loan_weight = #{model.loanWeightArtificial}  WHERE loan_reference_no = #{model.loanReferenceNo} AND term = #{model.term}
+   </update>
+
 </mapper>

+ 10 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/internal/service/MultiDimensionalCreditRiskService.java

@@ -22,6 +22,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static org.openjdk.nashorn.internal.objects.NativeString.substr;
+
 @Service
 public class MultiDimensionalCreditRiskService extends BaseService<RptDefineModel> {
 
@@ -49,6 +51,14 @@ public class MultiDimensionalCreditRiskService extends BaseService<RptDefineMode
     public Object update(MultiDimensionalCreditRiskModel model,String account,String workDate) {
         multiDimensionalCreditRiskMapper.delete(model);
         multiDimensionalCreditRiskMapper.update(model);
+        String RiskExposureCodeArtificial = model.getRiskExposureCodeArtificial().substring(0,1);
+        if(RiskExposureCodeArtificial.equals("R")){
+            model.setType("1");  // 表内风险
+        }else{
+            model.setType("0"); // 表外风险
+        }
+        System.out.println(model.getType());
+        multiDimensionalCreditRiskMapper.update1(model);
         return multiDimensionalCreditRiskMapper.insert(model,account,workDate);
     }
 

+ 8 - 1
Procedure/backend/project/src/main/java/com/sundata/product/rwa/reportformconfigreportcreater/action/ReportFileExportController.java

@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.io.File;
 import java.io.IOException;
@@ -69,6 +70,7 @@ public class ReportFileExportController extends BaseAction {
     public void getReportFileHtml(@RequestBody ReportFileExportModel model, HttpServletResponse response) {
 
         try {
+            String ReportNo=model.getReportNo();
             String templatePath = DBExecutor.doQuery("select NOUNVALUE from sys_noun where NOUNITEM = 'ATTACHPATH'");
             File reportResultDirPath = new File(templatePath + File.separator + "reportResult" + File.separator + model.getTerm() + File.separator + model.getReportNo() + File.separator + "default");
             Map<String, Object> rsp = new HashMap<>();
@@ -92,7 +94,7 @@ public class ReportFileExportController extends BaseAction {
             }
 
             toHtml.setCompleteHTML(false);
-            toHtml.printPage();
+            toHtml.printPage(ReportNo);
             rsp.put("flag", true);
             rsp.put("htmlString", writer.toString());
 //            rsp.put("htmlString", ToMergeHtml.mergeExcelHtml(report));
@@ -102,4 +104,9 @@ public class ReportFileExportController extends BaseAction {
             log.error(e.getMessage(), e);
         }
     }
+    @RequestMapping("getLoanReferenceNo")
+    public void getLoanReferenceNo(@RequestParam String reportno,@RequestParam String rowno ,@RequestParam String colno , HttpServletResponse response) {
+        String rno=DBExecutor.doQuery("SELECT riskexp_tpcode  FROM rwa_detail_conf_riskexposure WHERE reportno='"+reportno+"' AND rowno='"+rowno+"' AND colno='"+colno+"'");
+        sendData(response, rno);
+    }
 }

+ 7 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwacalcconfigdataparam/action/RealEstateAction.java

@@ -36,6 +36,13 @@ public class RealEstateAction extends BaseAction {
         sendData(response, realEstateService.updateExistData(model));
     }
 
+    @RequestMapping("/kingBase2GBase")
+    public void kingBase2GBase(HttpServletRequest request, HttpServletResponse response,
+                                @RequestParam String typeOrId,@RequestParam String tableName){
+        // 改
+        realEstateService.kingBase2GBase(typeOrId,tableName);
+    }
+
     @RequestMapping("/selectDataList")
     public void selectDataList (HttpServletRequest request, HttpServletResponse response,
                                 @RequestBody RealEstateModel model) {

+ 9 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwacalcconfigdataparam/service/RealEstateService.java

@@ -11,6 +11,7 @@ import com.sundata.common.util.DBExecutor;
 import com.sundata.product.rwa.businessconfig.utils.FilesValueCheckUtils;
 import com.sundata.product.rwa.rwacalcconfigdataparam.mapper.RealEstateMapper;
 import com.sundata.product.rwa.rwacalcconfigdataparam.model.RealEstateModel;
+import com.sundata.product.taskExecute.service.KingBase2GBaseService;
 import jakarta.servlet.http.HttpServletResponse;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.slf4j.Logger;
@@ -32,6 +33,9 @@ public class RealEstateService extends BaseService<RptDefineModel> {
 
     @Autowired
     private RptDefineMapper<RptDefineModel> rptDefineMapper;
+
+    @Autowired
+    KingBase2GBaseService kingBase2GBaseService;
     
     @Autowired
     RealEstateMapper realEstateMapper;
@@ -40,6 +44,10 @@ public class RealEstateService extends BaseService<RptDefineModel> {
         return realEstateMapper.updateExistData(model);
     }
 
+    public void kingBase2GBase(String typeOrId,String tableName) {
+        kingBase2GBaseService.doExecute(typeOrId,tableName);
+    }
+
     public List<RealEstateModel> selectDataList(RealEstateModel model) {
         return realEstateMapper.selectDataList(model);
     }
@@ -157,6 +165,7 @@ public class RealEstateService extends BaseService<RptDefineModel> {
             log.error(err,e);
             throw new BusinessException(err,e);
         }
+        kingBase2GBaseService.doExecute("GBaseDB","RWA_BDM_BUS_ITM_FC_REALTY_LOAN");
     }
 
     public void templateUploadModel(HttpServletResponse response, String fileNameCode,List<RealEstateModel> modelList) throws IOException {

+ 28 - 12
Procedure/backend/project/src/main/java/com/sundata/product/rwa/util/html/ToHtml.java

@@ -27,6 +27,8 @@ import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
+import com.sundata.common.util.DBExecutor;
+
 import java.io.*;
 import java.nio.charset.Charset;
 import java.util.*;
@@ -156,7 +158,7 @@ public final class ToHtml {
         try (PrintWriter pw = new PrintWriter(args[1], Charset.defaultCharset())) {
             ToHtml toHtml = create(args[0], writer);
             toHtml.setCompleteHTML(true);
-            toHtml.printPage();
+            toHtml.printPage("G4B-1");
         }
     }
 
@@ -183,7 +185,7 @@ public final class ToHtml {
         this.completeHTML = completeHTML;
     }
 
-    public void printPage() throws IOException {
+    public void printPage(String ReportNo) throws IOException {
         try {
             ensureOut();
             if (completeHTML) {
@@ -195,7 +197,7 @@ public final class ToHtml {
                 out.format("<body>%n");
             }
 
-            print();
+            print(ReportNo);
 
             if (completeHTML) {
                 out.format("</body>%n");
@@ -209,9 +211,9 @@ public final class ToHtml {
         }
     }
 
-    public void print() {
+    public void print(String ReportNo) {
         printInlineStyle();
-        printSheets();
+        printSheets(ReportNo);
     }
 
     private void printInlineStyle() {
@@ -318,19 +320,19 @@ public final class ToHtml {
         }
     }
 
-    private void printSheets() {
+    private void printSheets(String ReportNo) {
         ensureOut();
         Sheet sheet = wb.getSheetAt(0);
-        printSheet(sheet);
+        printSheet(sheet,ReportNo);
     }
 
-    public void printSheet(Sheet sheet) {
+    public void printSheet(Sheet sheet,String ReportNo) {
         ensureOut();
         Map<Integer, Integer> widths = computeWidths(sheet);
         int tableWidth = widths.get(IDX_TABLE_WIDTH);
         out.format("<table class=%s style=\"width:%dpx;\">%n", DEFAULTS_CLASS, tableWidth);
         printCols(widths);
-        printSheetContent(sheet);
+        printSheetContent(sheet,ReportNo);
         out.format("</table>%n");
     }
 
@@ -423,8 +425,15 @@ public final class ToHtml {
         out.format("</thead>%n");
     }
 
-    private void printSheetContent(Sheet sheet) {
+    private void printSheetContent(Sheet sheet,String ReportNo) {
         printColumnHeads();
+        List<String> rlist=new ArrayList<String>();
+        List<Map<String, Object>> rmap=DBExecutor.doQueryMapList("SELECT rowno  FROM rwa_detail_conf_riskexposure WHERE reportno='"+ReportNo+"' AND colno='3' AND isyz='1'");
+        if(rmap.size()>0) {
+            for(int i=0;i<rmap.size();i++) {
+                rlist.add(rmap.get(i).get("ROWNO").toString());
+            }
+        }
 
         out.format("<tbody>%n");
         Iterator<Row> rows = sheet.rowIterator();
@@ -468,13 +477,20 @@ public final class ToHtml {
 
                 if (thisCellRange.isEmpty()) {
                     int rowNum = row.getRowNum();
+                    int rowint=rowNum+1;
                     int colNum = i;
                     List<CellRangeAddress> mergeList = mergedRegions.stream().filter(
                             e -> rowNum >= e.getFirstRow() && rowNum <= e.getLastRow() && colNum >= e.getFirstColumn() && colNum <= e.getLastColumn()
                     ).toList();
                     if (mergeList.isEmpty()) {
-                        out.format("    <td class=%s %s>%s</td>%n", styleName(style),
-                            attrs, content);
+                        if(rlist.contains(String.valueOf(rowint))&&colNum==2) {
+                            out.format("    <td class=%s %s> <a href=\"#\" data-action=\"showview\" data-reportno=\""+ReportNo+"\" data-rownum=\""+rowint+"\">%s</a></td>%n", styleName(style),
+                                    attrs, content);
+                        }else {
+                            out.format("    <td class=%s %s>%s</td>%n", styleName(style),
+                                    attrs, content);
+                        }
+
                     }
                 } else {
                     CellRangeAddress addresses = thisCellRange.get(0);

+ 1 - 1
Procedure/backend/project/src/main/java/com/sundata/product/rwa/util/html/ToMergeHtml.java

@@ -21,7 +21,7 @@ public class ToMergeHtml {
         StringWriter writer = new StringWriter();
         ToHtml toHtml = ToHtml.create(Files.newInputStream(report.toPath()), writer);
         toHtml.setCompleteHTML(false);
-        toHtml.printPage();
+        toHtml.printPage(null);
         String html = writer.toString();
         return mergeTableCells(html, WorkbookFactory.create(report).getSheetAt(0).getMergedRegions());
     }

+ 1 - 1
Procedure/backend/project/src/main/java/com/sundata/product/tempFile/task/controller/ImportTaskBussinessController.java

@@ -411,7 +411,7 @@ public class ImportTaskBussinessController extends BaseAction {
             StringWriter writer = new StringWriter();
             ToHtml toHtml = ToHtml.create(Files.newInputStream(report.toPath()), writer);
             toHtml.setCompleteHTML(false);
-            toHtml.printPage();
+            toHtml.printPage(null);
             rsp.put("flag", true);
             rsp.put("htmlString", writer.toString());
             sendData(response, rsp);

+ 753 - 7
Procedure/frontend/projectb/src/pages/product/report_form_config_reportcreater/reportFileShow.tsx

@@ -1,15 +1,25 @@
 import {
   getReportFileHtml,
   ReportFileExportModel,
+  getLoanReferenceNo,
 } from '@/services/rwa/product/report_form_config_reportcreater/reportFile';
-import { SDPage } from '@sundata/ui-frame';
 import { Layout } from 'antd';
 import { Content } from 'antd/lib/layout/layout';
-import { useEffect, useState } from 'react';
-
+import React, { useEffect, useRef, useState } from "react";
+import { type ProColumns, type ActionType, type ProFormInstance, ProTable, EditableProTable } from '@ant-design/pro-components';
+import type {FormInstance} from 'antd'
+import  {Table, Upload} from 'antd'
+import { SDPage,SDFormText,SDModalForm,SDTable,SDFormItem,SDButton,SDSubmitButton,EditType,
+    SDAreaTtile, SDOperate, baseFun,SDModal, validateFun, SDLayout, } from "@sundata/ui-frame";
+import { PlusSquareTwoTone, WomanOutlined } from "@ant-design/icons";
+import { ProductProps } from "@/sundataImport";
+import { useModel } from '@umijs/max';
+import { exportExcelModel, getDataList, getselect, MultiDimensionalCreditRiskModel, selectname, update } from "@/services/rwa/product/internal/multidimensionalcreditrisk";
 const ReportFileShow = (model: ReportFileExportModel) => {
-  const [htmlStr, setHtmlStr] = useState();
 
+  const [htmlStr, setHtmlStr] = useState();
+  const [lrfno,setLrfno] = useState<string>();
+  const [term1,setTerm1] = useState<string>();
   useEffect(() => {
     getReportFileHtml(model).then((body) => {
       console.log(body);
@@ -17,14 +27,629 @@ const ReportFileShow = (model: ReportFileExportModel) => {
         return;
       }
       setHtmlStr(body.htmlString);
+      setTerm1(model.term);
     });
-  }, []);
+  }, [model.term]);
 
   const showHtml = (htmlContent: String) => {
     return <div dangerouslySetInnerHTML={{ __html: htmlContent }} />;
   };
-
-
+  const handleClick = (e: React.MouseEvent<HTMLElement>) => {
+    const target = e.target as HTMLElement; // 添加类型断言
+    if (target.dataset.action === 'showview') {
+      console.log("报表编号============"+target.dataset.reportno);
+      console.log("行号============"+target.dataset.rownum);
+      const reportNo = target.dataset.reportno;
+     const rowNum = target.dataset.rownum;
+     if (!reportNo || !rowNum) return; // 防止 undefined 传入
+     getLoanReferenceNo(reportNo, rowNum, '3').then((body) => {
+      console.log(body);
+      setLrfno(body);
+      setZxmx(true);
+      });
+     
+    } 
+  };
+     const fillInActionRef = useRef<ActionType>();
+      const [fieldRelationData, setFieldRelationData] = useState<MultiDimensionalCreditRiskModel[]>([]);
+      const [formDetailData, setFormDetailData] = useState<MultiDimensionalCreditRiskModel>();
+      var paramIndex = 0;
+      const editorFormRef = useRef<any>();
+      const { fetchDict } = useModel('dict');  
+      const [oldRowKeys, setOldRowKeys] = useState<React.Key[]>();
+      const [selectRowData,setSelectRowData] = useState<any>();
+      const [sjhs,setSjhs] = useState<any>();
+      const [sjhs1,setSjhs1] = useState<any>();
+      const [zxmx,setZxmx] = useState<any>();
+      
+      var formDataList = new Array<MultiDimensionalCreditRiskModel>;
+      const actionRef = useRef<ActionType>();
+      const formRef = useRef<FormInstance<any>>();
+      var formDataList1 = new Array<MultiDimensionalCreditRiskModel>;
+  
+   const select = async(formdata : MultiDimensionalCreditRiskModel)=>{
+    if (lrfno !== undefined) {
+        console.log(lrfno);
+        console.log(model.term);
+        formdata.riskExposeClassRecognizedResult = lrfno;
+        formdata.term = term1; 
+      } else {
+        // 可以设置一个默认值,或者跳过赋值
+        formdata.loanReferenceNo = ''; // 默认空字符串
+      }
+      console.log("formdata.loanReferenceNo===="+formdata.loanReferenceNo)
+    const data = await getDataList(formdata);
+    // 解构数组(导出用)
+    setFieldRelationData(data);
+    formDataList=[...data]; 
+    return {data :data}
+  ;
+  
+   }
+  // 页面展示元素
+  const columns: ProColumns<MultiDimensionalCreditRiskModel>[] = [
+  
+      {
+          title: '报表日期                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ',
+          dataIndex: 'term',
+          order:-1,
+          width:100,
+          editable:false,
+         ellipsis:true
+      },
+  
+  
+      {
+          title: '债项编号',
+          dataIndex: 'loanReferenceNo',
+          order:-9,
+          width:150,
+          editable:false,
+      },
+      {
+          title: '合同编号',
+          dataIndex: 'contractNo',
+          search: false,
+          width:150,
+          editable:false,
+      },
+      {
+          title: '经营机构',
+          dataIndex: 'manageOrgnNo',
+          order:-2,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '客户编号',
+          dataIndex: 'clientNo',
+          order:-8,
+          width:150,
+          editable:false,
+      },
+      {
+          title: '客户名称',
+          dataIndex: 'clientName',
+          search: false,
+          width:200,
+          editable:false,
+      },
+      {
+          title: '交易对手大类',
+          dataIndex: 'tradeCntrptyDivision',
+          order:-4,
+          valueType: 'treeSelect',
+          width:150,
+          request: () => fetchDict('CUST_TYPE_LV02'),
+          fieldProps: {
+            treeDefaultExpandAll: true,
+          },
+          editable:false,
+      },
+      {
+          title: '是否小微企业',
+          dataIndex: 'smallandmicro',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '是否中小企业',
+          dataIndex: 'smallandmedium',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '是否监管零售',
+          dataIndex: 'regulatedretail',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '产品大类',
+          dataIndex: 'prodType',
+          order:-6,
+          valueType: 'treeSelect',
+          width:100,
+          request: () => fetchDict('PRODUCT_TYPE'),
+          fieldProps: {
+            treeDefaultExpandAll: true,
+          },
+          editable:false,
+      },
+      {
+          title: '产品名称',
+          dataIndex: 'prodName',
+          order:-7,
+          width:150,
+          editable:false,
+      },
+      {
+          title: '表内外标识',
+          dataIndex: 'onbalshOffbalshFlag',
+          order:-5,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '贴现类型',
+          dataIndex: 'discountingType',
+          search: false,
+          width:150,
+          editable:false,
+      },
+      {
+          title: '票据类型',
+          dataIndex: 'billType',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '是否我行承兑',
+          dataIndex: 'ifSelfbankAcceptance',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '承兑人',
+          dataIndex: 'acceptorClientNo',
+          search: false,
+          width:200,
+          editable:false,
+      },
+      {
+          title: '承兑人客户名',
+          dataIndex: 'acceptorClientName',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '证券类型',
+          dataIndex: 'securityType',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '一般专项标志',
+          dataIndex: 'generalSpecialFlag',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '币种',
+          dataIndex: 'ccy',
+          search: false,
+          width:50,
+          editable:false,
+      },
+      {
+          title: '生效日',
+          dataIndex: 'effectDate',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '到期日',
+          dataIndex: 'expiryDate',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '原始期限(月)',
+          dataIndex: 'origTerm',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '剩余期限(月)',
+          dataIndex: 'residualTerm',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '五级分类',
+          dataIndex: 'fiveClass',
+          search: false,
+          width:200,
+          editable:false,
+      },
+      {
+          title: '逾期天数(天)',
+          dataIndex: 'overdueDays',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '投向行业',
+          dataIndex: 'industryInvestClass',
+          search: false,
+          width:150,
+          editable:false,
+      },
+      {
+          title: '质押买断类型',
+          dataIndex: 'pledgeBuyoutType',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '回购类型',
+          dataIndex: 'repoType',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '回购期限(天)',
+          dataIndex: 'repoTerm',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '债券代码',
+          dataIndex: 'bondCode',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '核心市场参与者标识',
+          dataIndex: 'coreMarketParticipantFlag',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '资产余额',
+          dataIndex: 'assetBal',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '本金科目号',
+          dataIndex: 'prinAccountNo',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '应收利息',
+          dataIndex: 'receivableInt',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '应收利息科目号',
+          dataIndex: 'receivableIntAccountNo',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '应计利息',
+          dataIndex: 'accrInt',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '应计利息科目号',
+          dataIndex: 'accrIntAccountNo',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '利息调整',
+          dataIndex: 'intAdj',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '利息调整科目号',
+          dataIndex: 'intAdjAccountNo',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '公允价值变动',
+          dataIndex: 'fairValueChange',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '公允价值变动科目号',
+          dataIndex: 'fairValueChangeAccountNo',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '手续费',
+          dataIndex: 'charge',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '手续费科目号',
+          dataIndex: 'chargeAccountNo',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '所属条线',
+          dataIndex: 'belongLine',
+          order:-3,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '承诺类型',
+          dataIndex: 'commitmentType',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      // {
+      //     title: '未使用额度',
+      //     dataIndex: '',
+      //     search: false,
+      // },
+      // {
+      //     title: '表外承诺科目号',
+      //     dataIndex: '',
+      //     search: false,
+      // },
+      {
+          title: '计提准备金',
+          dataIndex: 'provisionReserve',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '准备金科目号',
+          dataIndex: 'reserveAccountNo',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '本期余额',
+          dataIndex: 'thisBalance',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '缓释覆盖部分的风险暴露-现金类资产(0%)',
+          dataIndex: 'coverageRisk0',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '缓释覆盖部分的风险暴露-我国中央政府(0%)',
+          dataIndex: 'coverageRisk1',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '缓释覆盖部分的风险暴露-我国开发性金融机构和政策性银行(0%)',
+          dataIndex: 'coverageRisk2',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '缓释覆盖部分的风险暴露-境内外商业银行(短期)(20%)',
+          dataIndex: 'coverageRisk3',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '缓释覆盖部分的风险暴露-境内商业银行(0%)',
+          dataIndex: 'coverageRisk4',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '缓释覆盖部分的风险暴露-其他缓释类型',
+          dataIndex: 'coverageRisk5',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '未缓释风险暴露',
+          dataIndex: 'unfinishEad',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '表外项目分类',
+          dataIndex: 'offbalshProjectName',
+          search: false,
+          width:150,
+          editable:false,
+      },
+      {
+          title: '信用转换系数%',
+          dataIndex: 'ccf',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '风险暴露分类(系统认定)',
+          dataIndex: 'riskExposeClassRecognizedResult',
+          search: false,
+          width:300,
+          editable:false,
+      },
+      {
+          title: '风险权重%(系统认定)',
+          dataIndex: 'debtitemRiskWeight',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '风险暴露分类(人工认定)',
+          dataIndex: 'riskExposureCodeArtificial',
+          search: false,
+          width:300,
+          valueType:'treeSelect',
+          request:()=>fetchDict('@positiveRiskType'),
+          
+          fieldProps: {
+              treeDefaultExpandAll: true,
+              popupMatchSelectWidth:300,
+          },
+      },
+      {
+          title: '风险权重%(人工认定)',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '风险加权资产',
+          dataIndex: 'rwa',
+          search: false,
+          width:100,
+          editable:false,
+      },
+      {
+          title: '操作',
+          dataIndex: 'operate',
+          valueType: 'option',
+          render: (_, record) => [
+            <SDOperate
+              key="roleCfg"
+              icon={<WomanOutlined />}
+              successMessage=""
+              onClick={
+                ()=>{ 
+                  fillInActionRef.current?.startEditable(record.loanReferenceNo);
+               } }
+            >
+              编辑
+            </SDOperate>,
+            ] },
+  
+  ]
+  
+  
+  const  columns1: ProColumns<MultiDimensionalCreditRiskModel>[] = [ 
+      {
+          title: '缓释覆盖的风险加权资产',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '未缓释的风险加权资产',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '缓释覆盖部分的风险暴露',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '豁免后缓释权重',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '未缓释风险暴露',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '债项风险权重',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '信用转换系数CCF',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '本期余额',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+      {
+          title: '计提准备金',
+          dataIndex: 'loanWeightArtificial',
+          search: false,
+          width:100,
+      },
+  
+  ]
+  const selectlist =async(selectRowData:MultiDimensionalCreditRiskModel)=>{
+      console.log(selectRowData);
+  const select1 = await getselect(selectRowData.loanReferenceNo,selectRowData.term);
+  setSjhs1(select1);
+  return {data :sjhs1};
+      
+  }
   // @ts-ignore
   return (
     <SDPage>
@@ -40,10 +665,131 @@ const ReportFileShow = (model: ReportFileExportModel) => {
               minHeight: '200px', // 保证纵向有固定高度
               overflowY: 'auto',
             }}
+            onClick={handleClick}
             dangerouslySetInnerHTML={{ __html: htmlStr }}
           />
         </Content>
+       
       </Layout>
+           <SDModal title={"债项明细"} visible={zxmx}           
+            onCancel={() => {
+              setZxmx(false);
+              }}>
+   <EditableProTable
+                 rowKey="loanReferenceNo"
+                 columns={columns}
+                 recordCreatorProps={false}
+                 actionRef={fillInActionRef}
+                 value={fieldRelationData}
+                 dataSource={fieldRelationData}
+                 request={select}
+                 scroll={{ x: 1500 }}
+                 editableFormRef={editorFormRef} 
+                 editable={{
+                   actionRender: (_row,_config,defaultDoms)=>{
+                       return [defaultDoms.save,defaultDoms.cancel]
+                     },
+                     onValuesChange:async (changedValues, Values) => {
+                       if(changedValues!=undefined && changedValues.riskExposureCodeArtificial !=undefined){
+                           const name= await selectname(changedValues.riskExposureCodeArtificial)
+                           const {loanReferenceNo,...res} = changedValues
+                           if ('loanWeightArtificial' in res){
+                           editorFormRef.current.setRowData(selectRowData.loanReferenceNo,{loanWeightArtificial:name})
+                           selectRowData.loanWeightArtificial = name;
+                           selectRowData.riskExposureCodeArtificial =changedValues.riskExposureCodeArtificial;
+                           }
+                       }
+                       
+                     },
+                     onSave:async (key,record)=>{  console.log(record); await update(record) 
+                   }
+              
+                 }}
+                 rowSelection={{
+                   type:'radio',
+                   selectedRowKeys:oldRowKeys,
+                   onSelect:(selectedRowKeys, _selectedRows) => {
+                     setSelectRowData(selectedRowKeys);
+                   }
+                 }}
+                 toolBarRender={(_, { selectedRowKeys,selectedRows }) =>  [
+                   <SDButton
+                   key="export"
+                   icon={<PlusSquareTwoTone/>}
+                   successMessage=''
+                   onClick={() => {
+                       baseFun.confirm('确认导出数据?',async() => {  exportExcelModel(fieldRelationData,"multidimensionalcredit")});
+                   }}
+                 >
+                     导出文件
+                   </SDButton>,
+                   <SDButton
+                   key="export"
+                   successMessage=''
+                   onClick={() => {
+                     setSjhs(true);
+                     console.log(fieldRelationData);
+                    selectlist(selectRowData);
+                   }}
+                 >
+                   审计回溯
+                 </SDButton>,
+                   <SDButton
+                   key="loanReferenceNo"
+                   successMessage=''
+                   onClick={() => {
+                       fillInActionRef.current?.startEditable(selectRowData.loanReferenceNo);
+                   }}
+                 >
+                   风险暴露分类人工认定
+                 </SDButton>,              
+                    <SDButton
+                    key="l"
+                    successMessage=''
+                    onClick={() => {
+                       
+                    }}
+                  >
+                    确定
+                  </SDButton>,                    
+                 ]}
+                 onChange={ (value: readonly MultiDimensionalCreditRiskModel[]) => {
+                   setFieldRelationData([...value]);
+                 } }
+              />
+              {sjhs&&(
+               <SDModal title={"RWA回溯页面"} visible={sjhs}           
+               onCancel={() => {
+                   setSjhs(false);
+                 }}>
+               <ProTable
+               rowKey="orgCode"
+          //  request={selectlist}
+            columns={columns1}
+            dataSource={sjhs1} 
+            pagination={false}
+           //  toolBarRender={(_, { selectedRows }) => [
+           //   <SDButton
+           //     key="export"
+           //     icon={<PlusSquareTwoTone/>}
+           //     successMessage=''
+           //     onClick={() => {
+           //         baseFun.confirm('确认导出数据?',async() => {  exportExcelModel(formDetailData2,"capitaloccupymonitor")});
+           //     }}
+           //   >
+           //     导出
+           //   </SDButton>,
+           // ]}
+            actionRef={actionRef}
+            formRef={formRef}
+               />
+    </SDModal>
+              )
+   
+              }
+             
+   
+          </SDModal>   
     </SDPage>
   );
 };

+ 3 - 1
Procedure/frontend/projectb/src/pages/rwa_calc_config_dataparam/realestate.tsx

@@ -3,7 +3,7 @@ import type { ProColumns, ActionType, ProFormInstance } from '@ant-design/pro-co
 import type {FormInstance} from 'antd'
 import  {Upload} from 'antd'
 import { SDPage,SDFormText,SDModalForm,SDTable,SDFormItem,SDButton,SDSubmitButton,EditType, SDAreaTtile, SDOperate, baseFun,SDModal, validateFun, SDFormDict, } from "@sundata/ui-frame";
-import { getDataList1, SysListModel } from '@/services/rwa/rwa_calc_config_dataparam/realestate';
+import { getDataList1, kingBase2GBase, SysListModel } from '@/services/rwa/rwa_calc_config_dataparam/realestate';
 import {getDataList,selectDetailData,fetchDetailData,
   updateExistData,exportExcelModel,uploadAction,templateUpload,seleDictCodeName} from '@/services/rwa/rwa_calc_config_dataparam/realestate';
 import { WomanOutlined } from "@ant-design/icons";
@@ -62,8 +62,10 @@ const realestate : React.FC<widowRush> = (prop:widowRush) => {
     if (editType == 'update' ) {
       if (currentRow?.loanReferenceNo) {
         await updateExistData(data,currentRow?.loanReferenceNo);
+        await kingBase2GBase("GBaseDB","RWA_BDM_BUS_ITM_FC_REALTY_LOAN")
         closeAndRefresh();
       } 
+     
     
     }
     // else if (editType == 'create' ) {

+ 6 - 0
Procedure/frontend/projectb/src/services/rwa/product/report_form_config_reportcreater/reportFile.ts

@@ -18,6 +18,12 @@ export async function getReportFileHtml(body: ReportFileExportModel) {
   });
 }
 
+export async function getLoanReferenceNo(reportno: string,rowno: string,colno: string) {
+  return baseFun.request<any>('/api/report/file/getLoanReferenceNo.do', {
+    params:{reportno,rowno,colno},
+  });
+}
+
 
 /** 下载文件 */
 export async function downloadReportFile(body: ReportFileExportModel) {

+ 7 - 0
Procedure/frontend/projectb/src/services/rwa/rwa_calc_config_dataparam/realestate.ts

@@ -65,6 +65,13 @@ export async function updateExistData(body: SysListModel,loanReferenceNo: string
       });
   }
 
+    /** 更新数据 POST*/
+export async function kingBase2GBase(typeOrId: string,tableName: string) {
+  return baseFun.request<TableData<SysListModel>>('/api/product/rwa/rwacalcconfigdataparam/RealEstateAction/kingBase2GBase.do',
+    { params:{typeOrId,tableName}
+    });
+}
+
   /** 查询当前行详细数据 POST*/
 export async function selectDetailData(body: any) {
     return baseFun.request<SysListModel>('/api/product/rwa/rwacalcconfigdataparam/RealEstateAction/selectRowData.do',{data: body});