From 2f52450964665480f13c94c865bcac9027490380 Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期二, 29 九月 2026 22:49:41 +0800
Subject: [PATCH] fix-home-logo and repair the index overview
---
src/modules/operation/entity/wastesale.ts | 2 +-
src/modules/push/service/open.ts | 29 +++++++++++++++++++++++++++--
src/modules/shop/entity/recycleorderitem.ts | 2 +-
src/modules/market/entity/coupon/info.ts | 2 +-
src/modules/report/service/screen.ts | 6 +++++-
src/modules/report/controller/admin/dailysorter.ts | 16 +---------------
src/modules/order/entity/goods.ts | 2 +-
7 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/src/modules/market/entity/coupon/info.ts b/src/modules/market/entity/coupon/info.ts
index 96adc00..38f0a32 100644
--- a/src/modules/market/entity/coupon/info.ts
+++ b/src/modules/market/entity/coupon/info.ts
@@ -18,7 +18,7 @@
@Column({ comment: '閲戦', type: 'decimal', precision: 12, scale: 2 })
amount: number;
- @Column({ comment: '鏁伴噺' })
+ @Column({ comment: '璁℃暟(娆�)' })
num: number;
@Column({ comment: '宸查鍙�' })
diff --git a/src/modules/operation/entity/wastesale.ts b/src/modules/operation/entity/wastesale.ts
index ca1c7bd..febd2db 100644
--- a/src/modules/operation/entity/wastesale.ts
+++ b/src/modules/operation/entity/wastesale.ts
@@ -27,7 +27,7 @@
@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 })
diff --git a/src/modules/order/entity/goods.ts b/src/modules/order/entity/goods.ts
index 0aa1212..b45ba86 100644
--- a/src/modules/order/entity/goods.ts
+++ b/src/modules/order/entity/goods.ts
@@ -33,7 +33,7 @@
})
discountPrice: number;
- @Column({ comment: '鏁伴噺' })
+ @Column({ comment: '璁℃暟(娆�)' })
count: number;
@Column({ comment: '鍏朵粬淇℃伅', nullable: true })
diff --git a/src/modules/push/service/open.ts b/src/modules/push/service/open.ts
index e165739..6aa7215 100644
--- a/src/modules/push/service/open.ts
+++ b/src/modules/push/service/open.ts
@@ -58,11 +58,13 @@
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)
@@ -87,7 +89,6 @@
siteWeight.businessId = iotDevices[0].businessId;
siteWeight.departmentId = iotDevices[0].departmentId;
await this.pushSiteweightEntity.save(siteWeight);
-
} else {
siteWeight.businessId = 'UNKNOWN';
siteWeight.departmentId = -1;
@@ -582,4 +583,28 @@
}
}
+ /**
+ * 璁$畻澶勭悊鍚庣殑閲嶉噺
+ * 瑙勫垯锛�
+ * 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);
+ }
+
}
\ No newline at end of file
diff --git a/src/modules/report/controller/admin/dailysorter.ts b/src/modules/report/controller/admin/dailysorter.ts
index bf25856..eee9564 100644
--- a/src/modules/report/controller/admin/dailysorter.ts
+++ b/src/modules/report/controller/admin/dailysorter.ts
@@ -15,21 +15,7 @@
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' })));
diff --git a/src/modules/report/service/screen.ts b/src/modules/report/service/screen.ts
index 02518ae..ac1c6d2 100644
--- a/src/modules/report/service/screen.ts
+++ b/src/modules/report/service/screen.ts
@@ -679,7 +679,11 @@
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);
diff --git a/src/modules/shop/entity/recycleorderitem.ts b/src/modules/shop/entity/recycleorderitem.ts
index e149dad..0bde228 100644
--- a/src/modules/shop/entity/recycleorderitem.ts
+++ b/src/modules/shop/entity/recycleorderitem.ts
@@ -20,7 +20,7 @@
@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, })
--
Gitblit v1.9.1