Просмотр исходного кода

前后端代码更新,新增字典查询,字典值和列表的查询联动

zhang_qk 4 месяцев назад
Родитель
Сommit
fe89150d7e
17 измененных файлов с 314 добавлено и 130 удалено
  1. 3 2
      DBScript/张奇凯/001-DDL.sql
  2. 5 0
      DBScript/张奇凯/002-DML.sql
  3. 7 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/action/DiffconfigListAction.java
  4. 1 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/mapper/DiffconfigListMapper.java
  5. 3 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/mybatis/DiffconfigListMapper.xml
  6. 8 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/mybatis/RuleListMapper.xml
  7. 4 0
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/service/DiffconfigListService.java
  8. 1 1
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwaCalcConfig002offbalanceprotype/mybatis/InfoListMapper.xml
  9. 2 2
      Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwacalcconfigdataparam/mybatis/ProductListMapper.xml
  10. 3 3
      Procedure/backend/project/src/main/resources/application.yml
  11. 1 0
      Procedure/frontend/projectb/src/pages/authMng/FuncMng/funMng.tsx
  12. 235 108
      Procedure/frontend/projectb/src/pages/rwa_calc_config_002offbalanceprotype/info_list.tsx
  13. 1 1
      Procedure/frontend/projectb/src/pages/rwa_calc_config_dataparam/product_list.tsx
  14. 25 7
      Procedure/frontend/projectb/src/pages/rwa_data_check/diffconfig_list.tsx
  15. 6 5
      Procedure/frontend/projectb/src/pages/rwa_data_check/rule_list.tsx
  16. 8 0
      Procedure/frontend/projectb/src/services/rwa/diffconfig_list.ts
  17. 1 1
      Procedure/frontend/projectb/src/services/rwa/info_list.ts

+ 3 - 2
DBScript/张奇凯/001-DDL.sql

@@ -12,7 +12,8 @@ SOVEREIGN_RATING VARCHAR(50) comment '
 CRM_FIRST_LEVEL VARCHAR(50) comment '缓释分类',
 QUALFIED_CREDIT_TOOL_TYPE_NAME VARCHAR(200) comment '合格信用风险缓释工具类型',
 BASE_WEIGHT DECIMAL(30,6) comment '基础缓释权重',
-EXEMPTION_WEIGHT DECIMAL(30,6) comment '豁免后缓释权重'
+EXEMPTION_WEIGHT DECIMAL(30,6) comment '豁免后缓释权重',
+state  VARCHAR(4)  comment '状态'
 ) COMMENT='主权清单';
 
 
@@ -61,7 +62,7 @@ RULE_ID VARCHAR(60) not null comment '
 RULE_NAME VARCHAR(60) not null comment '规则名称',
 GL_CODE VARCHAR(60) not null comment '总账科目号',
 SUBJECT_DESC VARCHAR(60) not null comment '科目名称',
-SUBJECT_NATURE VARCHAR(1) not null comment '科目性质',
+SUBJECT_NATURE VARCHAR(2) not null comment '科目性质',
 SUBJECT_STATE VARCHAR(60) not null comment '科目状态',
 ONOROFF VARCHAR(60) not null comment '表内外标识',
 ACCOUNTING_DIRECTION VARCHAR(60) not null comment '记账方向(A:实际,D:借方,C:贷方)',

+ 5 - 0
DBScript/张奇凯/002-DML.sql

@@ -2254,6 +2254,7 @@ INSERT INTO SYS_NOUN (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNO
 
 
 -- 模板类型
+delete from SYS_NOUN where nounitem = 'TEMPLATE_TYPE';
 INSERT INTO rwa_test.sys_noun
 (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
 VALUES('TEMPLATE_TYPE', 'FIXED_COLUMN', '固定列', 'TEMPLATE_TYPE', 3.000000000000000000000000000000, 3.000000000000000000000000000000, 'common', '1', '0', NULL, NULL, '1', '0');
@@ -2270,6 +2271,7 @@ VALUES('TEMPLATE_TYPE', 'TEMPLATE_TYPE', '模
 
 
 -- 行列类型
+delete from SYS_NOUN where nounitem = 'ROW_COLUMN_TYPE';
 INSERT INTO rwa_test.sys_noun
 (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
 VALUES('ROW_COLUMN_TYPE', 'ANYCOL', '任意列', 'ROW_COLUMN_TYPE', 3.000000000000000000000000000000, 3.000000000000000000000000000000, 'common', '1', '0', NULL, NULL, '1', '0');
@@ -2291,6 +2293,7 @@ VALUES('ROW_COLUMN_TYPE', 'TITLEROW', '
 
 
 -- 模板验证时点
+delete from SYS_NOUN where nounitem = 'TEMPLATE_VERIFY_TIME';
 INSERT INTO rwa_test.sys_noun
 (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
 VALUES('TEMPLATE_VERIFY_TIME', 'AFTER_IMPORT', '导入后', 'TEMPLATE_VERIFY_TIME', 3.000000000000000000000000000000, 2.000000000000000000000000000000, 'common', '1', '0', NULL, NULL, '1', '0');
@@ -2307,6 +2310,7 @@ VALUES('TEMPLATE_VERIFY_TIME', 'TEMPLATE_VERIFY_TIME', '模
 
 
 -- 约束方式
+delete from SYS_NOUN where nounitem = 'CONSTRAINT_METHOD';
 INSERT INTO rwa_test.sys_noun
 (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
 VALUES('CONSTRAINT_METHOD', 'COMBINATION_VERIFY', '组合验证', 'CONSTRAINT_METHOD', 3.000000000000000000000000000000, 4.000000000000000000000000000000, 'common', '1', '0', NULL, NULL, '1', '0');
@@ -2326,6 +2330,7 @@ VALUES('CONSTRAINT_METHOD', 'SQL_STATEMENT', 'SQL
 
 
 -- 越界处理方式
+delete from SYS_NOUN where nounitem = 'CROSS_BORDER_DISPOSAL';
 INSERT INTO rwa_test.sys_noun
 (NOUNITEM, NOUNVALUE, NOUNNAME, NOUNSUPER, NOUNLEVEL, NOUNORDER, NOUNMODULE, NOUNVALIDITY, READONLY, NOUNPROP, NOUNREMARKS, NOUNRELATION, ORGFLAG)
 VALUES('CROSS_BORDER_DISPOSAL', 'CROSS_BORDER_DISPOSAL', '越界处理方式', 'BUSDICT', 2.000000000000000000000000000000, 0.000000000000000000000000000000, 'common', '0', '0', NULL, NULL, '1', '0');

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

@@ -57,6 +57,13 @@ public class DiffconfigListAction extends BaseAction {
         sendData(response,diffconfigListservice.rule_queryone(ruleNo));
     }
 
+    @RequestMapping("/rule_queryoruleAreaType")
+    @SysLog(funcName="总分勾稽规则选择覆盖范围自动赋值规则")
+    public void rule_queryoruleAreaType(HttpServletRequest request, HttpServletResponse response,@RequestParam String ruleAreaType){
+
+        sendData(response,diffconfigListservice.rule_queryoruleAreaType(ruleAreaType));
+    }
+
 
     @RequestMapping("/diffconfig_addone")
     @SysLog(funcName="总分勾稽规则的选择")

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

@@ -16,4 +16,5 @@ public interface DiffconfigListMapper {
     void  diffconfig_deleteone(@Param("ruleNo") String ruleNo);
     public List<Object> rule_querylist1 (@Param("ruleNo") String ruleNo);
     public List<Object> rule_querylist2 (@Param("ruleNo") String ruleNo);
+    public List<Object> rule_queryoruleAreaType (@Param("ruleAreaType") String ruleAreaType);
 }

+ 3 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/mybatis/DiffconfigListMapper.xml

@@ -92,6 +92,9 @@
         VALUES(#{calcindex},#{sdate},#{edate},#{term},#{dataDate},#{ruleNo},#{ruleName},#{upperLimit},#{lowerLimit},#{intervalType},#{ruleAreaType})
     </insert>
 
+    <select id="rule_queryoruleAreaType" resultType="com.sundata.product.rwa.resultList.model.RuleListModel">
+        select RULE_ID as ruleId ,GL_CODE as glCode ,SUBJECT_DESC as subjectDesc  from RWA_OBJ_CONF_GL_RECONCILIATION where SUBJECT_NATURE = #{ruleAreaType}
+    </select>
     <delete id="diffconfig_deleteone" parameterType="com.sundata.product.rwa.resultList.model.RuleListModel">
         delete from RWA_CALC_CONF_DIFFTOLERANCERANGE where RULE_NO =#{ruleNo}
     </delete>

+ 8 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/mybatis/RuleListMapper.xml

@@ -87,6 +87,14 @@
         INSERT INTO RWA_OBJ_CONF_GL_RECONCILIATION(CALCINDEX,SDATE,EDATE,TERM,DATA_DATE,RULE_ID,RULE_NAME,GL_CODE,SUBJECT_DESC,SUBJECT_NATURE,SUBJECT_STATE,ONOROFF,ACCOUNTING_DIRECTION,CALC_METHOD,POSITIVE_RISK_TYPE,NEGATIVE_RISK_TYPE,POSITIVE_OFF_PROJECT_TYPE,NEGATIVE_OFF_PROJECT_TYPE,STAGEIN_ID,SUBJECT_SQL,PRODUCT_SQL,YESORNO)
         VALUES(#{calcindex},#{sdate},#{edate},#{term},#{dataDate},#{ruleId},#{ruleName},#{glCode},#{subjectDesc},#{subjectNature},#{subjectState},#{onoroff},#{accountingDirection},#{calcMethod},#{positiveRiskType},#{negativeRiskType},#{positiveOffProjectType},#{negativeOffProjectType},#{stageinId},#{subjectSql},#{productSql},1)
     </insert>
+    
+    <select id="positiveRiskType" resultType="com.sundata.admin.nounmanage.model.DictContent">
+        select RISKEXPOSURE_NO as id , RISKEXPOSURE_NAME as text,RISKEXPOSURE_SUPER as PARENTID from RWA_CALC_CONF_RISKEXPOSURE
+    </select>
+
+    <select id="positiveOffProjectType" resultType="com.sundata.admin.nounmanage.model.DictContent">
+        select OFFOBJECT_NO as id , OFFOBJECT_NAME as text,OFFOBJECT_SUPER as PARENTID from RWA_CALC_CONF_OFFBALANCEPROTYPE
+    </select>
 
 
 </mapper>

+ 4 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/resultList/service/DiffconfigListService.java

@@ -55,6 +55,10 @@ public class DiffconfigListService {
         return diffconfigListMapper.rule_querylist1(ruleNo);
     }
 
+    public List<Object> rule_queryoruleAreaType(String ruleAreaType){
+        return diffconfigListMapper.rule_queryoruleAreaType(ruleAreaType);
+    }
+
 
     public String diffconfig_addone(DiffconfigListModel diffconfigListModel){
         diffconfigListMapper.diffconfig_deleteone1(diffconfigListModel.getRuleNo());

+ 1 - 1
Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwaCalcConfig002offbalanceprotype/mybatis/InfoListMapper.xml

@@ -114,7 +114,7 @@
 </select>
 
     <select id="ruleProductNo" resultType="com.sundata.admin.nounmanage.model.DictContent">
-        select PRODUCT_NAME as id ,PRODUCT_NAME as text from RWA_CALC_CONF_PRODUCT where 1=1 and PRODUCT_NAME is not null
+        select PRODUCT_NO  as id ,PRODUCT_NAME as text from RWA_CALC_CONF_PRODUCT where 1=1 and PRODUCT_NAME is not null
     </select>
 
     <update id="deleteFunc">

+ 2 - 2
Procedure/backend/project/src/main/java/com/sundata/product/rwa/rwacalcconfigdataparam/mybatis/ProductListMapper.xml

@@ -29,7 +29,7 @@
         LEFT JOIN SYS_NOUN T2
         ON T2.NOUNVALUE = T1.ID
         AND T2.NOUNITEM ='PRODUCTFROMSYSTEM'
-        GROUP BY T1.PRODUCT_NO) T2
+        GROUP BY T1.PRODUCT_NO) T2  -- dual需要换成RIM_TDM_BS_FF_REPO_LINK_SEQ_NO 表字段使用SEQ_NO
         ON T1.PRODUCT_NO=T2.PRODUCT_NO
         where 1=1
         <if test="productNo !='' and productNo!=null">
@@ -38,7 +38,7 @@
         <if test="productName !='' and productName!=null">
             and T1.PRODUCT_NAME like  concat('%',#{productName},'%')
         </if>
-        <if test="productBussinessCode !='' and productBussinessCode!=null">
+        <if test="productType !='' and productType!=null">
             and T1.PRODUCT_TYPE =#{productType}
         </if>
     </select>

+ 3 - 3
Procedure/backend/project/src/main/resources/application.yml

@@ -27,9 +27,9 @@ spring:
   #  username: testdb
   #  password: testdb
   datasource:
-    jdbcUrl: jdbc:mysql://localhost:3306/rwa_dev
-    username: rwa_dev
-    password: rwa_dev
+    jdbcUrl: jdbc:mysql://192.168.51.220:3306/rwa_test
+    username: test
+    password: test
 
     encrypted: false # 是否使用加密后的数据库密码
     #hikari 链接池配置

+ 1 - 0
Procedure/frontend/projectb/src/pages/authMng/FuncMng/funMng.tsx

@@ -48,6 +48,7 @@ const FuncMng: React.FC = () => {
   const refreshTree = async () => {
     const newTree = await getFunTree();
     setTreeData(newTree);
+    console.log(treeData);
     return newTree;
   };
 

+ 235 - 108
Procedure/frontend/projectb/src/pages/rwa_calc_config_002offbalanceprotype/info_list.tsx

@@ -1,38 +1,43 @@
 import React, { useEffect, useRef, useState } from 'react';
-import { Button, Form, FormInstance, Input, Space, Tooltip, Upload } from 'antd';
+import { Button, Checkbox, Dropdown, Form, FormInstance, Input, Menu, Space, Tooltip, Tree, TreeProps, Upload } from 'antd';
 import { ActionType, EditableFormInstance, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components';
 import { baseFun, ContextMenu, DictTree, EditType, SDAreaTtile, SDButton, SDForm, SDFormDict, SDFormText, SDLayout, SDModalForm, SDOperate, SDPage, SDSubmitButton, SDTree } from '@sundata/ui-frame';
 import { SysFunButtonInfoModel } from '@/services/authMng/funcMng';
-import {  getDetail1, getFunTree1,save, rules_addone, rules_list, rwaCalcConfOffbalanceprotypeModel, rwaCalcConfOffbalanceprotyperuleModel, shunxu, save2, rules_modifyone, rules_deleteone, info_deleteone, jiaoyan } from '@/services/rwa/info_list';
+import {  getDetail1, getFunTree1,save, rules_addone, rules_list, rwaCalcConfOffbalanceprotypeModel, rwaCalcConfOffbalanceprotyperuleModel, shunxu, save2, rules_modifyone, rules_deleteone, info_deleteone, jiaoyan, deleteFunc } from '@/services/rwa/info_list';
 import { DataNode } from 'antd/lib/tree';
 import { MenuInfo } from 'rc-menu/lib/interface';
-import { WomanOutlined } from '@ant-design/icons';
-import { conforms, isNull } from 'lodash';
-import { number } from 'echarts';
+import { CheckSquareOutlined, CloseSquareTwoTone, DownOutlined, WomanOutlined } from '@ant-design/icons';
+import { conforms, isNull, toNumber } from 'lodash';
+import { JSX } from 'react/jsx-runtime';
+import DirectoryTree from 'antd/es/tree/DirectoryTree';
+import { UniversalModel } from '@/services/rdpMng/Template/common';
 import { countChineseChars } from '@/services/rwa/product/rwacheckutils';
+
 //const tableRef = useRef<EditableFormInstance>();
 
 type aaa ={
   ismini ?:any;
   offobjectNo ?:any;
+  offobjectSuper ?:any;
 }
-
 const infolist: React.FC<aaa> = (prop :aaa) => {
-
+  const [selectedNode, setSelectedNode] = useState(null);
       /** 编辑方式,查看、修改、新增按钮时设置,详细信息表单中使用 */
   const [editType, setEditType] = useState<EditType>('update');
   const formRef = useRef<FormInstance<any>>();
-  const [treeData, setTreeData] = useState<DictTree[]>();
+  const [treeData1, setTreeData1] = useState<DictTree[]>();
+
+  const [selectTreeKeys, setSelectTreeKeys] = useState<any[]>([]);
+  //var dataRe :DictTree[]; 
   
   const formRef1 = useRef<FormInstance<any>>();
-  const formRef3 = useRef<FormInstance<any>>();
   const [visible1,setVisible1] = useState<boolean>(false);//弹窗是否显示
   const [visible2,setVisible2] = useState<boolean>(false);//弹窗是否显示
 
   const [editType1, setEditType1] = useState<EditType>('update');
   const [ismini1,setIsmini1] =useState<boolean>(false);
 
-  const [count1,setCount1] = useState<string>();
+  const [editRuleNo, setEditRuleNo] = useState<any>();
 
 //   const leaf = useRef('1');
 //   const levelcode = useRef(0);
@@ -43,55 +48,90 @@ const formRef2 = useRef<FormInstance<any>>();
 const [state1,setState1] = useState<String>();
 
 const [dataSource, setDataSource] = useState<any>() ;
+
+const [offobjec,setOffobjec]=useState<boolean>(false);
+
+
   const [mockData, setMockData] = useState<rwaCalcConfOffbalanceprotyperuleModel[]>([]);
-  let runtimeEditType: EditType;
 
-  const [count,setCount] = useState<number>(0);
   useEffect(() => {
-    refreshTree().then((data) => {
-        console.log(data);
+
+ refreshTree().then((data) => {
+  setTreeData1(data =>{
+    console.log(treeData1);
+return data;
+  });
       formInit(data[0].value);
     });
     // eslint-disable-next-line react-hooks/exhaustive-deps
   }, []);
 
 
+  const [selectedKeys, setSelectedKeys] = useState([]);
+ 
+  // const handleTreeCheck = (event:any, nodeIds:any) => {
+  //   setSelectedKeys(nodeIds);
+  // };
+
   const closeAndRefresh1 = ()=>{
     setVisible1(false);
     actionRef1.current?.reloadAndRest?.();
   }
 
-  const formInit = async (offobjectNo?: string) => {
-    const data = await getDetail1({offobjectNo});
-    if (!data.buttonList) data.buttonList = [];
+  const formInit = async (offobjectNo : any) => {
+    const data1 = await getDetail1(offobjectNo);
+    if (!data1.buttonList) data1.buttonList = [];
     let i = 0;
-    data.buttonList = data.buttonList.map((item) => {
+    data1.buttonList = data1.buttonList.map((item:any) => {
       i += 1;
       return { ...item, id: i };
     });
-    setMockData(data.buttonList);
-    setState1(data.offobjectNo);
-  formRef.current?.setFieldsValue(data);
-    if(data.ismini=='0'){
+    setMockData(data1.buttonList);
+    setState1(data1.offobjectNo);
+  formRef.current?.setFieldsValue(data1);
+    if(data1.ismini=='0'){
       setIsmini1(false);
       setVisible2(false);
     }else{
       setIsmini1(true);
       setVisible2(true);}
-    //leaf.current = data.leaf || '1';
-   // levelcode.current = data.levelcode || 0;
+      if(data1.offobjectSuper!='' && data1.offobjectSuper!=undefined){
+        setOffobjec(false);
+      }else{
+        setOffobjec(true);
+      }
   };
 
-  const fontColor = { color: '#ff0000' };  // 红色
+
   const refreshTree = async () => {
-    const newTree = await getFunTree1();
-   setTreeData(newTree);
-   return newTree;
+    const  dataRe= await getFunTree1();
+    formatArray(dataRe);
+    setTreeData1(dataRe);
+    return dataRe;
   };
-  
 
-  const inst2 = async(formDate:rwaCalcConfOffbalanceprotyperuleModel)=>{
-    const res =await rules_addone(formDate);
+  // 复选框选中key值
+  const checkedSelectTreeKeys = (checkedKeys:any, e:any) => {
+    setSelectTreeKeys(checkedKeys);
+  }
+
+
+// 树结构图标初始化(新增和废除)
+function formatArray (arr:DictTree[]) {
+  arr.forEach((item) => {
+   if(Array.isArray(item.children)==false){
+    if (item.attribute == '0') {
+      item.icon=<CloseSquareTwoTone/>;
+    } else {
+      item.icon= <CheckSquareOutlined style={{color:'blue'}}/>;
+    }
+   };
+   Array.isArray(item.children) ? formatArray(item.children) : item;
+  });
+}
+
+  const inst2 = async(formData:rwaCalcConfOffbalanceprotyperuleModel)=>{
+    await rules_addone(formData)
     actionRef1.current?.reloadAndRest?.();
     const res1 =await rules_list(state1);
     setMockData(res1)
@@ -108,7 +148,7 @@ const [dataSource, setDataSource] = useState<any>() ;
   const deldata1 =async(record:any)=>{
 baseFun.confirm("请确认是否继续操作",async()=>{
   const sd = await rules_deleteone(record.ruleNo)
-  setEditType1('update');
+    setEditType1('update');
 //   refreshTree().then((data) => {
   const sd1=await rules_list(state1);
   setMockData(sd1);
@@ -117,57 +157,95 @@ baseFun.confirm("请确认是否继续操作",async()=>{
   }
 
 
-const menu: ContextMenu[] = [
-    {
-      key: 'create',
-      label: '新建',
-      method: async (node) => {
-        const offobjectNo = node.key as string;
-        console.log('-----')
-       // const data = await getDetail1({ offobjectNo });
-     //   levelcode.current = data.levelcode || 0;
-       // 点击右键菜单后,会先执行 onRightClick 获取所选菜单信息,这里直接使用即可
-      setEditType('create');
-      runtimeEditType = 'create';
-      // 设置新增初始值
-      formRef.current?.setFieldsValue({
-        offobjectNo: '',
-        offobjectName: '',
-        offobjectSuper: offobjectNo,
-        offobjectSuperName: node.title?.toString(),
-        offobjectStageId:'',
-        offobjectIndex:'',
-        defaultOut:'',
-        ismini:'' ,
-        ccf: '',
-        yesorno:'1'
-      });
-      if(editType =='create'){
-        setMockData([]);
-      }
-    //   leaf.current = '1';
-    //   levelcode.current = levelcode.current + 1;
-      },
-    },
-    {
-      key: 'delete',
-      label: '删除',
-      method: async (node) => {
-        const funccode = node.key as string;
-        if (node.children) {
-          baseFun.warning('请先删除所有下级节点');
-          return;
-        }
-        if (treeData?.length === 1 && !treeData[0].children) {
-          baseFun.warning('不能删除根节点');
-          return;
-        }
-        await info_deleteone(funccode);
+  // 新建节点
+  const createNode = (node: DictTree) => {
+    const offobjectNo = node.key as any;
+
+    console.log('-----')
+   // const data = await getDetail1({ offobjectNo });
+ //   levelcode.current = data.levelcode || 0;
+   // 点击右键菜单后,会先执行 onRightClick 获取所选菜单信息,这里直接使用即可
+  setEditType('create');
+  // 设置新增初始值
+  formRef.current?.setFieldsValue({
+    offobjectNo: '',
+    offobjectName: '',
+    offobjectSuper: offobjectNo,
+    offobjectSuperName: node.title?.toString(),
+    offobjectStageId:'',
+    offobjectIndex:'',
+    defaultOut:'',
+    ismini:'' ,
+    ccf: '',
+    yesorno:'生效'
+  });
+ 
+
+    setMockData([]);
+
+  }
+
+  // // 废除节点
+  // const deleteNode = (node: DictTree) => {
+  //   const funccode = node.key;
+  //   if (node.children) {
+  //     baseFun.warning('请先作废所有下级节点');
+  //     return;
+  //   }
+  //   if (treeData1?.length === 1 && !treeData1[0].children) {
+  //     baseFun.warning('不能作废根节点');
+  //     return;
+  //   }
+  //   baseFun.confirm("请确认是否继续操作", ()=>{  deleteFunc(funccode).then(()=>{
+  //   baseFun.info("作废成功");
+  //   refreshTree();
+  //   });
+  // });
+
+  // }
+
+  // 废除节点
+  const deleteNode = (node: DictTree) => {
+    if (selectTreeKeys.length > 0) {
+      baseFun.confirm("请确认是否继续操作", ()=>{  deleteFunc(selectTreeKeys).then(()=>{
+        baseFun.info("作废成功");
         refreshTree();
-      },
-    },
-  
-  ];
+        });
+        });
+    } else {
+      const funccode = node.key;
+      selectTreeKeys.push(funccode);
+      setSelectTreeKeys(selectTreeKeys);
+      if (node.children) {
+        baseFun.warning('请先作废所有下级节点');
+        return;
+      }
+      if (treeData1?.length === 1 && !treeData1[0].children) {
+        baseFun.warning('不能作废根节点');
+        return;
+      }
+      baseFun.confirm("请确认是否继续操作", ()=>{  deleteFunc(selectTreeKeys).then(()=>{
+      baseFun.info("作废成功");
+      refreshTree();
+      });
+      });
+    }
+  }
+
+const items: any[] = [
+  {
+    label: <a>新建</a>,
+    key: 'create',
+  },
+  {
+    label: <a>作废</a>,
+    key: 'delete',
+  },
+  {
+    type: 'divider',
+  },
+];
+
 
   const btnColumns: ProColumns<rwaCalcConfOffbalanceprotyperuleModel>[] = [
     { title : '计算实例号',
@@ -309,30 +387,41 @@ const menu: ContextMenu[] = [
       await save2(mockData,formData)  
     }
 
-    const xuhao = async(state1:any) => {
-      const sd = state1;
-      let aa = await shunxu(sd);
-      console.log(aa);
-      formRef2.current?.setFieldValue('ruleNo',aa)
-     // return setCount1(aa);
-      
+// 编辑规则编号
+const setRuleNoAdd = () => {
+  let lastEditRuleNo ="";
+  if (mockData !== null || mockData !== undefined) {
+    if (mockData?.length == 0) {
+      lastEditRuleNo = "BWXM" + state1 + String('001');
+    } else {
+      let lastNo = mockData?.filter((item)=>{
+        return item.ruleNo == mockData[mockData.length-1].ruleNo;
+      })[0].ruleNo;
+      let numberNo = lastNo?.substring(lastNo.length-3,lastNo.length);
+      let castnumber = toNumber(numberNo);
+      castnumber = castnumber+1;
+      lastEditRuleNo = "BWXM" + state1 + castnumber.toString().padStart(3,'0');
     }
-
+  } else {
+    lastEditRuleNo = "BWXM" + state1 + String('001');
+  }
+  setEditRuleNo(lastEditRuleNo);
+ // formRef2.current?.setFieldValue('ruleNo',lastEditRuleNo)
+}
     
-
-
-    const handleSelect =async(node: DataNode)=>{
-      // const editingRows = tableRef.current?.getRowsData?.();
-      // if (editingRows && editingRows.length > 0) {
-      //   baseFun.warning('参数列表中有正在编辑的参数,请确认或取消修改后再切换');
-      //   return;
-      // }
-      const funccode = node.key as string;
+    const onNodeClick = async(node:any) => {
+      setSelectedNode(node); // 设置选中的节点
+      const funccode = node[0] as string;
       // 右键菜单点击新增按钮后,再点击树节点时,需要重置editType
       setEditType('update');
       // formRef.current?.resetFields(); TODO 尝试配合request解决表单内容不刷新问题
       formRef.current?.setFieldsValue(await  formInit(funccode));
-    }
+     
+    };
+
+
+
+
     return(
         <SDPage footer={[<SDSubmitButton successMessage='' editType={editType}   formRef={formRef} doSubmit={handleSave} >保存</SDSubmitButton>]}> 
         <SDLayout subLayout='horizontal' >
@@ -341,7 +430,41 @@ const menu: ContextMenu[] = [
          colSpan='25%'
          fixHeight
        >
-         <SDTree treeData={treeData} handleSelect={handleSelect} contextMenus={menu}  />
+          <DirectoryTree treeData={treeData1} onSelect={onNodeClick} checkable showLine={true} onCheck={checkedSelectTreeKeys} autoExpandParent={true}  
+    //  onCheck={handleTreeCheck}
+      //checkedKeys={selectedKeys}
+
+// MenuProps={{
+//   selectedKeys: selectedKeys,
+// }}
+         titleRender={(nodeData) => {
+          console.log(selectTreeKeys);
+          return (
+            <Dropdown menu={{ items, onClick: (e) => {
+              console.log(e.key,selectTreeKeys)
+              if (e.key == 'create') {
+                   createNode(nodeData);
+                   e.domEvent.stopPropagation();
+              } else if (e.key == 'delete') {
+                   deleteNode(nodeData);
+                   e.domEvent.stopPropagation();
+              }
+            }}} trigger={['contextMenu']}
+            >
+              <span>{nodeData.title}</span>
+            </Dropdown>
+          )
+      
+         }}
+        
+
+        
+         onRightClick={({event, node}: any) => {
+          event.preventDefault();
+         }}
+         />
+ 
+
         </SDLayout>
         <SDLayout
          title='表外项目分类信息维护'
@@ -373,7 +496,7 @@ const menu: ContextMenu[] = [
 <SDFormDict name="ismini" label="是否最细一级" required  dictKey='YESORNO'/>
 {ismini1&&(<SDFormText name="ccf" label="转换系数(%)" required={ismini1} />)}
 <SDFormText name="defaultOut" label="默认输出数据源" required />
-<SDFormText name="offobjectStageId" label="所属阶段" required />
+{offobjec &&<SDFormText name="offobjectStageId" label="所属阶段" required ={offobjec}/>}
 <SDFormText name="offobjectIndex" label="认定顺序号" required />
 <SDFormText name="yesorno" label="状态"  readonlyCond='both'/>
   </SDForm>
@@ -384,9 +507,9 @@ const menu: ContextMenu[] = [
                     search={false} 
                     columns={btnColumns}
                     actionRef={actionRef1}
-                    dataSource={mockData}    
+                    dataSource={mockData || []}    
                     onChange={setDataSource}
-                    request={(async (state1:any)=>{
+                    request={(async ()=>{
                       // if(editType!='create' ){
                       //   const res1 =await rules_list(state1);
                       //   setMockData(res1)
@@ -395,7 +518,7 @@ const menu: ContextMenu[] = [
                         return {data:mockData};
                       // }
                     })}
-                    toolBarRender={(_, { selectedRowKeys }) => {
+                    toolBarRender={(_) => {
                       return[ 
                         <span style={editType=='display'?{display:'none'}:{}}>   
                         <SDButton
@@ -403,9 +526,10 @@ const menu: ContextMenu[] = [
                         successMessage=''
                         icon={<WomanOutlined />}
                         onClick={async() => {
-                           xuhao(state1)
+                         //  xuhao(state1)
                           setVisible1(true);
                           setEditType1('create');
+                          setRuleNoAdd()
                          // formRef2.current?.setFieldValue("ruleNo",count1)
                         }}
                         >
@@ -426,7 +550,7 @@ const menu: ContextMenu[] = [
  <SDButton successMessage="" onClick={() => closeAndRefresh1()}>关闭</SDButton>]} onVisibleChange={()=>{setVisible1(false); }  } 
  >
 <SDLayout>
-<SDForm editType={editType1} formRef={formRef2}    >
+<SDForm editType={editType1} formRef={formRef2}   initialValues={{ruleNo:editRuleNo,offobjectNo:state1}} >
   <span style={{display:'none'}}>
 <SDFormText name="calcindex"   label="计算实例号"  />
 <SDFormText name="sdate"   label="起始数据日期"  />
@@ -463,4 +587,7 @@ const menu: ContextMenu[] = [
   
 
 }
-export default infolist;
+export default infolist;
+
+
+

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

@@ -669,7 +669,7 @@ const setRuleNoAdd = () => {
               <SDButton successMessage="" onClick={() => closeAndRefresh1()}>关闭</SDButton>]} onVisibleChange={()=>{setVisible1(false); }  } 
               >
         <SDLayout>
-<SDForm editType={editType1} formRef={formRef2}  initialValues={{ruleCode:editRuleNo}}  >
+<SDForm editType={editType1} formRef={formRef2}  initialValues={{ruleCode:editRuleNo,productNo:state1}}  >
          <span style={{display:'none'}}>
           <SDFormText name="calcindex"   label="计算实例号"  />
           <SDFormText name="sdate"   label="起始数据日期"  />

+ 25 - 7
Procedure/frontend/projectb/src/pages/rwa_data_check/diffconfig_list.tsx

@@ -2,7 +2,7 @@ import React, { Key, useEffect, useRef, useState } from 'react';
 import { Button, Form, FormInstance, Input, Radio, Space, Table, Tooltip, Upload } from 'antd';
 import { ActionType, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components';
 import { baseFun, EditType, SDAreaTtile, SDButton, SDForm, SDFormDict, SDFormSearch, SDFormText, SDLayout, SDModal, SDModalForm, SDOperate, SDPage, SDSubmitButton, SDTable, validateFun } from '@sundata/ui-frame';
-import { diffconfig_addone, diffconfig_addone1, diffconfig_deleteone, difftoleranceModel, jiaoyan, most, resultListModel, rule_list, rule_list1, rule_querylist, rule_queryone } from '@/services/rwa/diffconfig_list';
+import { diffconfig_addone, diffconfig_addone1, diffconfig_deleteone, difftoleranceModel, jiaoyan, most, resultListModel, rule_list, rule_list1, rule_querylist, rule_queryone, rule_queryoruleAreaType } from '@/services/rwa/diffconfig_list';
 import { useModel } from '@umijs/max';
 import { WomanOutlined } from '@ant-design/icons';
 import { RuleObject } from 'antd/lib/form';
@@ -254,8 +254,8 @@ const diffconfig_list: React.FC<aaa>= (prop : aaa) => {
   const removeRow = (key: any) => {
     let removeSelectedRowKeys = new Array<Key>;
     let removeArray = new Array<resultListModel>;
-   const String =`${key.join(' ')}`;
-    setMockData(mockData .filter((item) => item.ruleId !== String));
+   const String =`${key}`;
+    setMockData(mockData.filter((item) => item.ruleId !== String));
     mockData.forEach(function(item){
       if (item.ruleId !== String) {
         removeSelectedRowKeys.push(item.ruleId);
@@ -315,10 +315,10 @@ const diffconfig_list: React.FC<aaa>= (prop : aaa) => {
      
       <SDForm editType={editType} formRef={parentformRef} 
       initialValues={{intervalType:'close-close',lowerLimit:prop.lowerLimit,upperLimit:prop.upperLimit,ruleAreaType:prop.ruleAreaType }}
-      onValuesChange={(changedValues,Values)=>{
+      onValuesChange={async (changedValues,Values)=>{
           if(Values.upperLimit!="" && Values.lowerLimit!="" && Values.upperLimit!=undefined && Values.lowerLimit!=undefined){
-            const  upperLimit =Values.upperLimit;
-            const  lowerLimit =Values.lowerLimit;
+            const  upperLimit =Number(Values.upperLimit);
+            const  lowerLimit =Number(Values.lowerLimit);
             if(lowerLimit<upperLimit){
               if(Object.keys(changedValues).toString()=="lowerLimit"){
                   baseFun.warning("忍度上限要大于等于容忍度下限")
@@ -334,6 +334,24 @@ const diffconfig_list: React.FC<aaa>= (prop : aaa) => {
           }else{
               setVisible2(false)
           }
+          const  ruleAreaType = changedValues.ruleAreaType;
+          if(ruleAreaType=='01'){
+            parentformRef.current?.setFieldValue('upperLimit',0);
+            parentformRef.current?.setFieldValue('lowerLimit',0.1);
+            const sd = await rule_queryoruleAreaType(ruleAreaType);
+          setMockData(sd);
+          }else if(ruleAreaType=='02' || ruleAreaType=='03'){
+            parentformRef.current?.setFieldValue('upperLimit',-0.2);
+            parentformRef.current?.setFieldValue('lowerLimit',0.2);
+            const sd = await rule_queryoruleAreaType(ruleAreaType);
+            setMockData(sd);
+          }else if(ruleAreaType=='04'){
+            parentformRef.current?.setFieldValue('upperLimit',-0.5);
+            parentformRef.current?.setFieldValue('lowerLimit',0.5);
+            const sd = await rule_queryoruleAreaType(ruleAreaType);
+            setMockData(sd);
+          }
+          
       }
   }
       >
@@ -411,7 +429,7 @@ const diffconfig_list: React.FC<aaa>= (prop : aaa) => {
           {
 selections:[Table.SELECTION_ALL, Table.SELECTION_INVERT],
 
-type:'checkbox'
+type:'radio'
 }
 }
       />

+ 6 - 5
Procedure/frontend/projectb/src/pages/rwa_data_check/rule_list.tsx

@@ -321,7 +321,7 @@ width : 150
           }else{
             setPositiveOffProjectType(false);
           }
-
+// required={positiveOffProjectType}
         }
       }
        >
@@ -333,15 +333,16 @@ width : 150
 <SDFormDict name="onoroff"   label="表内外标识"  required={onoroff1} dictKey='ONOROFF'/>
 <SDFormDict name="accountingDirection"   label="记账方向"   dictKey='ACCOUNTING_DIRECTION'  />
 <SDFormDict name="calcMethod"   label="计算方式"  dictKey='CALC_METHOD'/>
-<SDFormDict name="positiveRiskType"   label="正差异风险暴露分类"  />
-<SDFormDict name="negativeRiskType"   label="负差异风险暴露分类"  />
-<SDFormDict name="positiveOffProjectType"   label="正差异表外项目分类"  required={positiveOffProjectType} />
-<SDFormDict name="negativeOffProjectType"   label="负差异表外项目分类" required={positiveOffProjectType} key='@' />
+<SDFormDict name="positiveRiskType"   label="正差异风险暴露分类"  dictKey='@positiveRiskType'/>
+<SDFormDict name="negativeRiskType"   label="负差异风险暴露分类"  dictKey='@positiveRiskType'/>
+<SDFormDict name="positiveOffProjectType"   label="正差异表外项目分类"  dictKey='@positiveOffProjectType' required={positiveOffProjectType}/>
+<SDFormDict name="negativeOffProjectType"   label="负差异表外项目分类" dictKey='@positiveOffProjectType'   required={positiveOffProjectType}/>
 <SDFormDict name="stageinId"   label="所属阶段"  />
 <SDFormText name="subjectSql"   label="总账取数规则" type='textarea' />
 <SDFormText name="productSql"   label="勾稽明细取数规则"  type='textarea' />
 <div style={{display:"none"}}>
 <SDFormText name="yesorno"   label="状态"  />
+
 </div>
       </SDModalForm>
      )

+ 8 - 0
Procedure/frontend/projectb/src/services/rwa/diffconfig_list.ts

@@ -142,6 +142,14 @@ export async function rule_queryone(ruleNo :String){
     ;
 }
 
+//
+export async function rule_queryoruleAreaType(ruleAreaType :String){
+    return baseFun.request<any>('/api/product/rwa/resultList/DiffconfigListAction/rule_queryoruleAreaType',{
+        params:{ruleAreaType}
+    })
+    ;
+}
+
 //删除
 export async function diffconfig_deleteone(ruleNo :String){
     return baseFun.request<string>('/api/product/rwa/resultList/DiffconfigListAction/diffconfig_deleteone',{

+ 1 - 1
Procedure/frontend/projectb/src/services/rwa/info_list.ts

@@ -73,7 +73,7 @@ yesorno :string;
 
 
 /** 获取菜单及按钮详情 POST /api/admin/funmanage/getDetail.do */
-export function getDetail1(offobjectNo: string) {
+export function getDetail1(offobjectNo: any) {
     return baseFun.request<rwaCalcConfOffbalanceprotypeModel>('/api/product/rwa/rwaCalcConfig002offbalanceprotype/InfoListAction/getDetail1', {
       params:{offobjectNo},
     });