fn-devs-insurance-documents.js

var fnDataCamcel = require('../../Plugins/fn-common-data-camcel.js');
var fnBusiness = require('./ Plugins/fn-devs-insurance-documents-business.js');
var fnAppCrypto = require('../../ Plugins/app_crypto.js');
module.exports = function (callback, result, params, rmt, args) {
    let argResult = JSON.parse(result);


    let paramsTemp = JSON.parse(params);

    fnDataCamcel.toLowerCamcelByObject(argResult, paramsTemp["_null"] !== "true");
    if (argResult.children) {
        fnDataCamcel.mergeBsObject(argResult.data, argResult.children);
        delete argResult.children;
    }
    if (argResult.dimension) {
        delete argResult.dimension;
    }
    if (argResult.schema) {
        delete argResult.schema;
    }

    //自定义业务数据特殊处理,通过  params={_rmt,_mkey,_resField}l
    argResult = fnBusiness.doBusiness(argResult, paramsTemp);

    // #region 加密处理
    var dataCrypto = fnAppCrypto.encryptData(argResult.data, paramsTemp.transmissionSecurityKey, paramsTemp.transmissionSecurityVI);
    if (dataCrypto) {
        delete argResult.data;
        argResult.dataCrypto = dataCrypto;
        argResult.remark = fnAppCrypto.encryptRemark();
    }
    // #endregion 加密处理

    callback(null, argResult);
};

fn-devs-insurance-documents-business.js


/**
 * 自定义业务数据特殊处理,通过  params={_rmt,_mkey,_resField}
 * @param {结果} result
 * @param {参数} params
 */
function doBusiness(result, params) {
    if (params._showResult) {
        // 显示结果,便于排查和调试
        return result;
    } else if (params._showParams) {
        // 显示参数,便于排查和调试
        return params;
    } else {

        return result;
    }
}
//业务特殊处理
exports.doBusiness = doBusiness;

~/AppNodeJs/{ownerId}/devs/fn-devs-{dictionaryUrl[“_nodemkey”]}.js



        <bs-upload-ocr :query="{_nodemkey:'insurance-documents',_nodejs:'common-data'}" @open-uploading="onOpenUploading" ocr-type="insurance-documents" @change="onChangeOcr">
          </bs-upload-ocr>


    // 通过nodes处理数据结果
            if (dictionaryUrl.ContainsKey("_nodemkey")&& dictionaryUrl.ContainsKey("_nodejs"))
            {
                #region 数据安全加密 start
                var configurationAppAuthSecurity = _configurationBuilderService.GetConfigurationAppAuthSecurity(ownerId, sysId);
                var resultSecurityVI = configurationAppAuthSecurity.GetValue<string>("transmission:securityVI");
                var resultSecurityMethod = configurationAppAuthSecurity.GetValue<string>("transmission:securityMethod");
                var resultSecurityKey = configurationAppAuthSecurity.GetValue<string>("transmission:securityKey");
                dictionaryUrl["transmissionSecurityVI"] = resultSecurityVI;
                dictionaryUrl["transmissionSecurityMethod"] = resultSecurityMethod;
                dictionaryUrl["transmissionSecurityKey"] = resultSecurityKey;
                #endregion 数据安全加密 end
                dictionaryUrl["_provider"] = provider;

                string dictionaryUrlStr = JsonUtil.Serialize(dictionaryUrl, false, false, false);
                result = JsonUtil.Serialize(_nodeServices.InvokeAsync<dynamic>(PhyPathUtil.ConvertVirToPhyPath($"~/AppNodeJs/{ownerId}/devs/fn-devs-{dictionaryUrl["_nodemkey"]}.js"), result, dictionaryUrlStr, RequestModuleType.Ocr.ToString().ToLower()).Result, false, false, false);
            }

文档更新时间: 2022-07-27 20:55   作者:admin