输入参数

extend:field 和 extend:uniqueField 值必须传递,才会调用方法进行入口

columns里面配置(expand为组合md5加密列,两个列,前端必须传递)

  "bdTbrId": {
      "fieldSort": 9999,
      "extendAlias": "input_basis",
      "tableId": 1,
      "dataType": "varchar",
      "title": "投保人",
      "guidMethod": "None",
      "isRequired": false,
      "isData": true,
      "filter": {
        "isMust": false
      },
      "extend": {
        "uniqueMd5": true,
        "field": "bdTbr",
        "alias": "bd_tbr",
        "name": "bd_tbr",
        "uniqueField": "familyId",
        "uniqueAlias": "family_id",
        "uniqueName": "family_id"
      },
      "field": "bdTbrId",
      "name": "bd_tbr_id",
      "alias": "bd_tbr_id",
      "isDate": false,
      "isPrimary": false,
      "isIdentity": false,
      "maxLength": 255
    },

实现代码(组合主键,加密和时间)

\Config\Mapper\basis\hrm\mapper_hrm-sb-payment_sql__primarys.json

{
  "rules": {},
  "responseField": {},
  "columns": {
    "primaryUid": {
      "extend": {
        "fieldTitle": "【身份证号】必须填写",
        "uniqueTitle": " 【费款所属期】必须填写",
        "fieldDes": true,
        "uniqueMd5": true,
        "field": "idCard",
        "alias": "id_card",
        "name": "id_card",
        "uniqueField": "fkssqDate",
        "uniqueAlias": "fkssq_date",
        "uniqueName": "fkssq_date"
      }
    }
  },
  "dimDatas": {}
}

mapper_hrm-sb-payment_sql__rules.json



{
  "coulmns": {
    "idCardU": {
      "isRequired": false
    }
    //"socialSecurityNo": {
    //  "isRequired": false
    //}
  },
  "rules": {
    "idCardU": [
      {
        "type": "required",
        "required": false,
        "isAdd": false,
        "isEdit": false,
        "message": "【{id_card_u}】值必须填写。"
      },
      {
        "type": "maxlength",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "max": 150,
        "message": "【{id_card_u}】值最大长度为150。"
      }
    ],
    "socialSecurityNo": [
      {
        "type": "required",
        "required": false,
        "isAdd": false,
        "isEdit": false,
        "message": "【{social_security_no}】值必须填写。"
      },
      {
        "type": "maxlength",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "max": 150,
        "message": "【{social_security_no}】值最大长度为150。"
      }
    ],
    "primaryUid": [
      {
        "type": "required",
        "required": true,
        "isAdd": true,
        "isEdit": false,
        "message": "【身份证号和费款所属期】值必须填写。"
      },
      {
        "type": "maxlength",
        "required": false,
        "isAdd": true,
        "isEdit": true,
        "max": 150,
        "message": "【身份证号和费款所属期】值最大长度为150。"
      },
      {
        "type": "db",
        "sql": "select count(primary_uid) from hrm_sb_payment where primary_uid=@primaryUid",
        "isAdd": true,
        "isEdit": false,
        "message": "【身份证号和费款所属期】已存在。"
      }
    ]
  }
}

responseField里面配置 md5唯一加密生成(未实现,不使用)

{
    "responseField":{
        "demo":{
         "uniqueMd5": {
            "bdBbrId": {
              "field": "bdBbrId",
              "name": "bd_bbr_id",
              "alias": "bd_bbr_id",
              "children": [
                {
                  "field": "familyId",
                  "name": "family_id",
                  "alias": "family_id",
                  "sortId": 1
                },
                {
                  "field": "bdBbr",
                  "name": "bd_bbr",
                  "alias": "bd_bbr",
                  "sortId": 5
                }
              ]
            }
          }
        }
    }
}
文档更新时间: 2024-05-04 22:04   作者:admin