此博客已作废,欢迎光临我的新博客 http://www.keepsimply.org

此博客已作废,欢迎光临我的新博客 http://www.keepsimply.org

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
我有一个js类,如何写对应的index.d.ts:import { Inject, Injectable } from '@nestjs/common'; import { Cron } from '@nestjs/schedule'; import * as moment from 'moment'; import { SsrDbService } from '../db/service/ssr.db.service'; import { MipmsDbService } from '../db/service/mipms.db.service'; @Injectable() export class SampleService { constructor(@Inject(SsrDbService) private readonly ssr: SsrDbService, @Inject(MipmsDbService) private readonly mipms: MipmsDbService) { } /** * <pre> * 每分钟执行一次样品信息同步,同步逻辑如下: * 1、需要在检验项目管理系统增加一个数据变动记录表 * 2、在样品表和样品表上增加一个触发器,将表中样品信息修改记录到数据变动记录表中 * 3、本服务会自动查询检验系统的数据变动记录表内容,若存在变动记录则将对应数据查询出来更到ssr3系统的样品表中 * 4、同步后向ssr3系统的通知表中写入信息变动记录,由系统向用户发送提示 * * 同步的样品信息包括: * 1、样品作废信息:样品表中增加触发器 * 2、样品修改信息:样品表中增加触发器 * 3、删除样品:样品表中增加触发器 * 4、增样品:在用户领取任务后,将自动同步样品信息到ssr3系统中,所以需要在领取任务表中增加触发器 * </pre> */ @Cron('5 * * * * *') async cron() { const time = moment().format('YYYY年MM月DD日HH时mm分'); console.log(`${time}==>Called every minute`); const sample = await this.ssr.ssr_sample.findFirst({ where: { sam_name: { contains: 'BH71' }, } }) console.log(`ssr_sample=>`, sample); const sample2 = await this.mipms.mipms_sample.findFirst({ where: { sam_name: '郑单958', } }) console.log(`mipms_sample=>`, sample2); } }
05-26

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值