feat: 重构勘察业务为明细模式并新增定时任务人性化配置
- 重构勘察业务:移除SOP相关表,新增勘察明细表支持建筑/楼层/房间/照片管理 - 新增定时任务人性化频率配置,支持分钟/小时/天/周/月/自定义六种模式 - 新增频率预览接口,支持配置转换为cron表达式与执行时间预览 - 更新系统品牌名称为鑫潼智电,修改全局标题与登录页文案
This commit is contained in:
1 parent
f72644c24f
commit
22d27a940d
29 files changed
+1908
-576
No files matched your search
@@ -1,7 +1,9 @@
|
||||
import { Controller, Get, Post, Put, Del, Inject, Body, Param, Query } from "@midwayjs/core";
|
||||
import { Controller, Get, Post, Put, Del, Inject, Body, Param, Query, Files } from "@midwayjs/core";
|
||||
import { Context } from "@midwayjs/koa";
|
||||
import { UploadFileInfo } from "@midwayjs/upload";
|
||||
import { WorkerAppService } from "../service/worker_app.service";
|
||||
import { NoticeService } from "../service/notice.service";
|
||||
import { UploadService } from "../service/upload.service";
|
||||
import {
|
||||
WorkerRegisterDTO,
|
||||
WorkerLoginDTO,
|
||||
@@ -20,6 +22,24 @@ export class WorkerAppController {
|
||||
@Inject()
|
||||
noticeService!: NoticeService;
|
||||
|
||||
@Inject()
|
||||
uploadService!: UploadService;
|
||||
|
||||
// 勘察现场照片上传:电工 token 走 /api/worker-app/* 通道,复用对象存储上传能力
|
||||
@Post("/upload/image")
|
||||
async uploadImage(@Files() files: UploadFileInfo<string>[]) {
|
||||
const file = files && files[0];
|
||||
if (!file) {
|
||||
return { code: 400, message: "请选择要上传的图片", data: null };
|
||||
}
|
||||
try {
|
||||
const data = await this.uploadService.uploadFile(file);
|
||||
return { code: 200, message: "上传成功", data };
|
||||
} catch (err: any) {
|
||||
return { code: 500, message: `图片上传失败:${err?.message || "对象存储不可用"}`, data: null };
|
||||
}
|
||||
}
|
||||
|
||||
// 注册(匿名)
|
||||
@Post("/auth/register")
|
||||
async register(@Body() body: WorkerRegisterDTO) {
|
||||
@@ -130,6 +150,15 @@ export class WorkerAppController {
|
||||
return this.workerAppService.completeOrder(this.currentWorkerId(), source, Number(id));
|
||||
}
|
||||
|
||||
// 勘察明细维护(仅勘察单):全量替换,含建筑/楼层/房间与现场照片
|
||||
@Put("/orders/:source/:id/details")
|
||||
async saveDetails(@Param("source") source: string, @Param("id") id: string, @Body() body: any) {
|
||||
if (source !== "survey") {
|
||||
return { code: 400, message: "仅勘察订单支持维护明细" };
|
||||
}
|
||||
return this.workerAppService.saveSurveyDetails(this.currentWorkerId(), Number(id), body);
|
||||
}
|
||||
|
||||
// 收益汇总
|
||||
@Get("/earnings/summary")
|
||||
async earningsSummary() {
|
||||
|
||||
Reference in new issue
Block a user