| | |
| | | api: ['add', 'delete', 'update', 'info', 'list', 'page'], |
| | | entity: BasicdataWastetypeEntity, |
| | | service: BasicdataWastetypeService, |
| | | listQueryOp: { |
| | | addOrderBy: { |
| | | 'a.code': 'ASC', |
| | | }, |
| | | }, |
| | | pageQueryOp: { |
| | | keyWordLikeFields: ['a.name', 'a.code'], |
| | | fieldEq: ['a.isRecyclable', 'a.status'], |
| | | addOrderBy: { |
| | | 'a.code': 'ASC', |
| | | }, |
| | | }, |
| | | }) |
| | | export class AdminBasicdataWastetypeController extends BaseController {} |
| | |
| | | comment: '碳减因数', |
| | | type: 'decimal', |
| | | precision: 10, |
| | | scale: 5, |
| | | scale: 2, |
| | | default: 0.0, |
| | | }) |
| | | carbonFactor: number; |
| | |
| | | service: PushAuditlogService, |
| | | pageQueryOp: { |
| | | select: ['a.*'], |
| | | fieldEq: ['a.clientId', 'a.pushType'], |
| | | keyWordLikeFields: ['a.errorMessage'], |
| | | fieldEq: ['a.deviceNo', 'a.pushType'], |
| | | where: async ctx => { |
| | | const { startTime, endTime } = ctx.request.body; |
| | | const conditions = []; |
| | |
| | | 'a.*', |
| | | 'b.name AS departmentName', |
| | | 'c.name AS garbageName', // 垃圾名称 |
| | | 'd.businessName AS businessName', // 垃圾名称 |
| | | 'd.businessName AS businessName', 'd.siteType AS siteType', // 垃圾名称 |
| | | |
| | | ], |
| | | fieldEq: ['a.deviceNo'], |
| | | fieldEq: ['a.deviceNo','d.siteType'], |
| | | fieldLike: ['a.deviceNo'], |
| | | join: [ |
| | | { |
| | |
| | | import { PushOpenService } from '../../service/open'; |
| | | import { WeightUploadDto } from '../../dto/weight.dto'; |
| | | import * as crypto from 'crypto'; |
| | | import { BaseSysParamService } from '../../../base/service/sys/param'; |
| | | |
| | | const CLIENT_ID = '10001'; |
| | | const SECRET = '9001ac9676b8'; |
| | | |
| | | |
| | | /** |
| | | * 开放无需验证的上报数据接口 |
| | | */ |
| | | |
| | | |
| | | @CoolController({ |
| | | prefix: '/open/push', |
| | | }) |
| | |
| | | @Inject() |
| | | pushOpenService: PushOpenService; |
| | | |
| | | @Inject() |
| | | baseSysParamService: BaseSysParamService; |
| | | |
| | | |
| | | @Post('/weight', { summary: '原始称重上报接口' }) |
| | | async uploadWeight( |
| | | @Headers() headers: any, |
| | | @Body() data: WeightUploadDto, |
| | | ) { |
| | | |
| | | const CLIENT_ID = String(await this.baseSysParamService.dataByKey('YAOHUA.WEIGHT.CLIENTID')); //'10001'; |
| | | const SECRET = String(await this.baseSysParamService.dataByKey('YAOHUA.WEIGHT.SECRET')); '9001ac9676b8'; |
| | | |
| | | |
| | | const clientId = headers['clientid']; |
| | | const sign = headers['sign']; |
| | | |
| | | // 1. clientId 校验 |
| | | if (clientId !== CLIENT_ID) { |
| | | await this.pushOpenService.writePushAuditLog("weight",{ "deviceNo": clientId, "requestContent": data, "errorMessage": "非法 clientId" }); |
| | | await this.pushOpenService.writePushAuditLog("weight", { "deviceNo": clientId, "requestContent": data, "errorMessage": "非法 clientId" }); |
| | | return { |
| | | code: 1001, |
| | | msg: '非法 clientId', |
| | |
| | | .toLowerCase(); |
| | | |
| | | if (realSign !== sign?.toLowerCase()) { |
| | | await this.pushOpenService.writePushAuditLog("weight",{ "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "签名验证失败" }); |
| | | await this.pushOpenService.writePushAuditLog("weight", { "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "签名验证失败" }); |
| | | |
| | | return { |
| | | code: 1002, |
| | |
| | | data: 'success', |
| | | }; |
| | | } catch (err) { |
| | | await this.pushOpenService.writePushAuditLog("weight",{ "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "系统异常,写入失败." }); |
| | | await this.pushOpenService.writePushAuditLog("weight", { "deviceNo": data.deviceNo, "requestContent": data, "errorMessage": "系统异常,写入失败." }); |
| | | |
| | | return { |
| | | code: 500, |
| | |
| | | const result = await this.pushOpenService.receiveCameraGpsMessage(body); |
| | | //return this.ok(result); |
| | | |
| | | return {"messageId":result} |
| | | return { "messageId": result } |
| | | |
| | | } |
| | | } |
| | |
| | | @Column({ comment: '海拔高度', type: 'decimal', precision: 6, scale: 2, nullable: true }) |
| | | elevation: number; |
| | | |
| | | @Column({ comment: '定位状态', dict: ['有效定位', '无效定位'], default: 0 }) |
| | | status: number; |
| | | @Column({ comment: '定位精度' }) |
| | | status: string; |
| | | } |
| | |
| | | |
| | | businessName: string; |
| | | |
| | | siteType:string; |
| | | |
| | | @Index() |
| | | @Column({ comment: '归属单位' }) |
| | | departmentId: number; |
| | |
| | | @Column({ comment: '海拔高度', type: 'decimal', precision: 6, scale: 2, nullable: true }) |
| | | elevation: number; |
| | | |
| | | @Column({ comment: '定位状态', dict: ['有效定位', '无效定位'], default: 0 }) |
| | | status: number; |
| | | @Column({ comment: '定位精度' }) |
| | | status: string; |
| | | } |
| | |
| | | if (body.sn) { |
| | | |
| | | const gpsData = body.data || {}; |
| | | const statusVal = gpsData.status === 'A' ? 0 : 1; |
| | | const statusVal = gpsData.status === 'A' ? 'A' : 'B'; |
| | | |
| | | await this.pushCameraGpsEntity.save({ |
| | | sn: body.sn, |