发布日期:2021-02-23

  • 新增功能

    • GusenScript 语言增加 #try,#catch,#finally指令

      #try
        $vs.log.info('try---->');
        $vs.exception.throwException('asdfasdl')
      #catch($e)
        $vs.log.info('catch---->');
        $vs.log.info($e.message);
        $e.printLog()
      #finally
        $vs.log.info('finally===>');
      #end
    • 表格控件增加排序API

      • table.setSort(fieldId,order): 设置表格开始排序
      • table.andSort(fieldId,order): 追加排序字段
      • table.clearSort(): 清除排序功能
    • $vs.file增加文件服务器访问方法

      • putFile($localFilePath:string,$removeFilePath:string):string
      • putWebFile($localFilePath:string,$removeFilePath:string):string
      • putWebImage($localFilePath:string,$removeFilePath:string):string
      • delWebFile($filePath:string):int
      • delFile($filePath:string):int
      • removeLocalTempFile($filePath:string):int
      • removeLocalTempDir($filePath:string):boolean
      • getFileDownloadURL($filePath:string,$disName:string):string
      • getFileServiceURL()
      • getServerRunPath():string
      • getRandTempPath():string
      • getTempPath():string
      • mkdirs($path:string):boolean
    • 新增$vs.report处理报表输出文件方法

      • exportToPDF($reportId:string,$params:Map):string
      • exportToExcel($reportId:string,$params:Map):string
    • 新增OCR文字识别功能(目前支持华为和百度识别)

      • $vs.ocr.generalText($filePath): 通用文字识别

      • $vs.ocr.bankCard($filePath): 银行卡识别

      • $vs.ocr.idCardFront($filePath): 身份证(正面)识别

      • $vs.ocr.idCardBack($filePath): 身份证(背面)识别

      • $vs.ocr.handWriting($filePath): 手写文字识别

      • $vs.ocr.vatInvoice($filePath): 增值税发票识别

      • $vs.ocr.carPlate($filePath): 车牌号识别

        注意:打包时需要配OCR参数;开发环境也需要配置额外参数才可以运行。

    • 新增邮件发送功能

      • $vs.mail.createMailService() : 创建高级邮件发送服务

      • $vs.mail.sendSimpleMail(): 发送普通邮件

      • $vs.mail.sendTemplateMail(): 发送模版邮件

        高级邮件发送功能示例
          #set($mail=$vs.mail.createMailService()) // <-- 创建高级邮件发送服务
        
          // 以模版的方式来发送邮件
          #set($bill=$vs.util.newMap())
          #set($bill.USER_NAME = '李思思')
          #set($bill.BILL_NO = 'HT2021001012')
          $mail.setContext('com.golden.mail.demo1',$bill) // <-- 以消息模版的方式来填充消息体
        
          // $mail.setTitle("这是谷神发送的邮3") // 设置邮件标题(若您打算发送模版邮件,则此项省略)
          // $mail.setContext("<div>你好<font size='20' color='#f40'>谷神</font>!</div>") // <-- 邮件内容(支持HTML)(若您打算发送模版邮件,则此项省略)
        
          $mail.addReceivor("917xxx6@qq.com","915xxx6@qq.com") // 接收者(可多个参数)
          $mail.addCarbon("914xxx6@qq.com","913xxx6@qq.com") // 抄送者(可多个参数)
          $mail.addBlindCarbon("912xxx6@qq.com","911xxx6@qq.com") // 密送者(可多个参数)
        
          // 也可以直接设置list(注意设置list会覆盖add**添加的接收者)
          // $mail.setReceivor(list) // <-- 设置接收者列表
          // $mail.setCarbon(list) // <-- 设置抄送者列表
          // $mail.setBlindCarbon(list) // <-- 设置密送者列表
        
          $mail.addAttachmentFile("/temp/export/9d2982e72e9d4bdf8b1416dd7f1b878f.pdf","增值税发票")
          $mail.addAttachmentFile("/certificateFilingImport.xlsx","下载模版文件")
          $mail.addAttachmentFile("/upload/90/08/A2/737EB50F83954BC4F27E8B5573.jpg","公有演示图片")
          $mail.addAttachmentFile("/upload/2D/63/96/91959650FD50D3920C451561E1.jpg","私有演示图片")
        
          $mail.setBillNo("HT2001021021") // <-- 填写业务单据(可以在发送日志中查询到)
        
          #set($status = $mail.send()) // <-- 开始发送邮件,$status : 0 - 成功 other 失败
          // 邮件发送结束,具体发送结果可以查看日志

        注意:打包时需要配邮件smtp服务参数;开发环境也需要配置额外参数才可以运行。

    • 主数据系统系统脚本增加用户登录初始化脚本,用户登录后,项目可以在此脚本中做初始化用户session的动作,也可以阻止用户登录

    • 表格控件增加列分组功能

    • 表格控件增加onTableBeforeInit表格初始化之前(可在此修改表格定义属性)事件

文档更新时间: 2021-03-22 10:45   作者:姜一维