fix-home-logo and repair the index overview
| | |
| | | @Column({ comment: '金额', type: 'decimal', precision: 12, scale: 2 }) |
| | | amount: number; |
| | | |
| | | @Column({ comment: '数量' }) |
| | | @Column({ comment: '计数(次)' }) |
| | | num: number; |
| | | |
| | | @Column({ comment: '已领取' }) |
| | |
| | | @Column({ comment: '日期时间', type: 'datetime' }) |
| | | dateTime: Date; |
| | | |
| | | @Column({ comment: '重量', type: 'decimal', precision: 10, scale: 2 }) |
| | | @Column({ comment: '重量(kg)', type: 'decimal', precision: 10, scale: 2 }) |
| | | weight: number; |
| | | |
| | | @Column({ comment: '单价', type: 'decimal', precision: 10, scale: 2 }) |
| | |
| | | }) |
| | | discountPrice: number; |
| | | |
| | | @Column({ comment: '数量' }) |
| | | @Column({ comment: '计数(次)' }) |
| | | count: number; |
| | | |
| | | @Column({ comment: '其他信息', nullable: true }) |
| | |
| | | try { |
| | | // 1. 保存原始称重数据 |
| | | const rawWeight = new PushWeightEntity(); |
| | | const rawWeightValue = data.garbageWeight || 0; |
| | | const processedWeight = this.calcProcessedWeight(data.garbageType, rawWeightValue); |
| | | rawWeight.deviceNo = data.deviceNo; |
| | | // rawWeight.uploadTime = data.uploadTime ? new Date(data.uploadTime) : new Date(); |
| | | rawWeight.uploadTime = new Date(); |
| | | rawWeight.garbageType = data.garbageType; |
| | | rawWeight.weight = data.garbageWeight || 0; |
| | | rawWeight.weight = processedWeight; |
| | | rawWeight.extraData = |
| | | typeof data.extraData === 'object' |
| | | ? JSON.stringify(data.extraData) |
| | |
| | | siteWeight.businessId = iotDevices[0].businessId; |
| | | siteWeight.departmentId = iotDevices[0].departmentId; |
| | | await this.pushSiteweightEntity.save(siteWeight); |
| | | |
| | | } else { |
| | | siteWeight.businessId = 'UNKNOWN'; |
| | | siteWeight.departmentId = -1; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计算处理后的重量 |
| | | * 规则: |
| | | * 1. 去皮重:干垃圾/可回收物 -1kg,湿垃圾 -10kg,其它类型同干垃圾(-1kg) |
| | | * 2. 去皮后重量 × 1/10 |
| | | * 3. 结果不小于 0 |
| | | * SW60 有毒有害 |
| | | * SW61 湿垃圾 |
| | | * SW62001 可回收-废纸张 |
| | | * SW62002 可回收-废塑料 |
| | | * SW62003 可回收-废金属 |
| | | * SW62004 可回收-废玻璃 |
| | | * SW62005 可回收-废织物 |
| | | * SW62006 可回收-废旧电子产品 |
| | | * SW62007 可回收-废旧电源电池 |
| | | * SW63 大件垃圾 |
| | | * SW64 干垃圾 |
| | | */ |
| | | private calcProcessedWeight(garbageType: string, weight: number): number { |
| | | const TARE_MAP: Record<string, number> = { SW61: 10 }; |
| | | const tareWeight = TARE_MAP[garbageType] ?? 1; |
| | | return Math.max((weight - tareWeight) / 10, 0); |
| | | } |
| | | |
| | | } |
| | |
| | | pageQueryOp: { |
| | | keyWordLikeFields: ['a.businessName', 'a.businessId'], |
| | | fieldEq: ['a.date', 'a.businessId', 'a.attendanceStatus'], |
| | | select: ['a.*', 'b.name AS departmentName', 'c.businessName AS workSiteName'], |
| | | join: [ |
| | | { |
| | | entity: BaseSysDepartmentEntity, |
| | | alias: 'b', |
| | | condition: 'a.departmentId = b.id', |
| | | type: 'leftJoin', |
| | | }, |
| | | { |
| | | entity: BasicdataSiteEntity, |
| | | alias: 'c', |
| | | condition: 'a.workSiteId = c.businessId', |
| | | type: 'leftJoin', |
| | | }, |
| | | ], |
| | | select: ['a.*'], |
| | | where: async ctx => { |
| | | const conditions: any[][] = []; |
| | | conditions.push(...(await WithDeptFilterWhere(ctx, { alias: 'a', field: 'departmentId' }))); |
| | |
| | | const actQb = this.orderRepo |
| | | .createQueryBuilder('o') |
| | | .select('COUNT(o.id)', 'c') |
| | | .where('o.status = :status', { status: '已完成' }); |
| | | .where('o.status = :status', { status: '已完成' }) |
| | | .andWhere('o.finishTime BETWEEN :start AND :end', { |
| | | start: dates.startTime, |
| | | end: dates.endTime, |
| | | }); |
| | | this.applyDept(actQb, 'o'); |
| | | result.greenActions = n((await actQb.getRawOne())?.c); |
| | | |
| | |
| | | @Column({ comment: '固废国标分类' }) |
| | | category: string; |
| | | |
| | | @Column({ comment: '重量', type: 'decimal', precision: 10, scale: 2, default: 0, }) |
| | | @Column({ comment: '重量(kg)', type: 'decimal', precision: 10, scale: 2, default: 0, }) |
| | | weight: number; |
| | | |
| | | @Column({ comment: '单价', type: 'decimal', precision: 10, scale: 2, default: 0, }) |