commit e8459e755e963c0ec5796c397898ecdc1192fff5 Author: Yanko <747575620@qq.com> Date: Thu Aug 15 09:39:45 2024 +0800 初始化MES diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a8ec6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.vs +obj +bin +Properties diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..4a6ca4d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,154 @@ + +pipeline{ + agent any + parameters { + choice( + description: 'pztjwebi:开发环境1', + name: 'environment', + choices: ['pztj'] + ) + + choice( + description: '前端or后端', + name: 'projectqh', + choices: ['backend','frontend'] + ) + + choice( + description: '执行操作(发布|回滚)', + name: 'operation', + choices: ['develop', 'rollback'] + ) + + choice( + description: '分支名', + name: 'branchName', + choices: ['master'] + ) + + string( + name: 'tag', + defaultValue: '', + description: '版本tag' + ) + + } + + stages + { + stage('Prepare') { + steps { + script{ + echo "1.Prepare Stage" + echo "当前环境${params.environment}" + if(params.operation=='develop') + { + checkout scm + script { + build_tag = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim() + if (env.BRANCH_NAME != 'master') { + build_tag = "${env.BRANCH_NAME}-${build_tag}" + } + } + } + else{ + script { + if(params.branchName!= 'master') + { + build_tag = "${params.branchName}-${params.tag}" + } + else + { + build_tag="${params.tag}" + } + } + } + } + } + } + stage('Test') { + steps { + script{ + echo "2.Test Stage" + } + } + + } + stage('Build') { + steps { + script{ + echo "3.Build Docker Image Stage" + if(params.operation=='develop') + { + if(params.projectqh=='backend') + { + sh "cp -r backend/* ./" + sh "docker build -f backend/dockerfile -t 10.2.1.24:10242/bpa/pztjapi:${build_tag} ." + } + else if(params.projectqh=='frontend') + { + sh "docker build -f frontend/dockerfile -t 10.2.1.24:10242/bpa/pztjweb:${build_tag} ." + } + + } + } + } + } + + + stage('Push') { + steps { + script{ + echo "4.Push Docker Image Stage" + withCredentials([usernamePassword(credentialsId: 'harbor', passwordVariable: 'harborPassword', usernameVariable: 'harborUser')]) { + sh "docker login -u ${harborUser} -p ${harborPassword} 10.2.1.24:10242" + if(params.operation=='develop') + { + if(params.projectqh=='backend') + { + sh "docker push 10.2.1.24:10242/bpa/pztjapi:${build_tag}" + + } + else if(params.projectqh=='frontend') + { + sh "docker push 10.2.1.24:10242/bpa/pztjweb:${build_tag}" + } + + } + } + } + } + + + + } + stage('Deploy') { + + steps { + script{ + echo "5. Deploy Stage" + // if(params.environment=='test') + // { + // input "确认要部署线上环境吗?" + // } + if(params.projectqh=='backend') + { + + sh "sed -i 's//${build_tag}/' k8s_pztjapi.yaml" + sh "sed -i 's//${env.BRANCH_NAME}/' k8s_pztjapi.yaml" + sh "sed -i 's//${params.environment}/' k8s_pztjapi.yaml" + sh "kubectl apply -f k8s_pztjapi.yaml --record" + } + else if(params.projectqh=='frontend') + { + sh "sed -i 's//${build_tag}/' k8s_pztjweb.yaml" + sh "sed -i 's//${env.BRANCH_NAME}/' k8s_pztjweb.yaml" + sh "sed -i 's//${params.environment}/' k8s_pztjweb.yaml" + sh "kubectl apply -f k8s_pztjweb.yaml --record" + } + + } + } + } + } +} diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 0000000..b149801 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000..3729ff0 --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.csproj b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.csproj new file mode 100644 index 0000000..ee853ef --- /dev/null +++ b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.csproj @@ -0,0 +1,40 @@ + + + + + net6.0 + 1701;1702;1591 + BPA.MES.Base.Application.xml + enable + + + + + + + + + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml new file mode 100644 index 0000000..27a7288 --- /dev/null +++ b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml @@ -0,0 +1,9376 @@ + + + + BPA.MES.Base.Application + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/3/4 10:15:54 + 描 述 : + + + + + 用户Id + + + + + 账号 + + + + + 名称 + + + + + 头像 + + + + + 电话 + + + + + 性别 + + + + + 是否授权 + + + + + 角色Id + + + + + 微信session_key + + + + + 是否超级管理 + + + + + 租户Id + + + + + 用户组织机构Id + + + + + 用户组织机构名称 + + + + + 是否是管理员 + + + + + 所有缓存关键字集合 + + + + + 地址 + + + + + 密码 + + + + + 账号 + + + + + 名 称 :产线设备类型 + 创 建 人 :yangxiao + 创建时间 : 2023/7/24 16:56:13 + 描 述 : + + + + + 锅 + + + + + 釜 + + + + + 配料状态 + + + + + 工艺状态 + + + + + 未开始 + + + + + 进行中 + + + + + 完成 + + + + + 名 称 :工单枚举 + 创 建 人 :yangxiao + 创建时间 :2023/7/21 15:04:24 + 描 述 : + + + + + 未知 + + + + + 草稿 + + + + + 已下发 + + + + + 已接受 + + + + + 已启动 + + + + + 已完成 + + + + + 废弃 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/27 9:35:27 + 描 述 : + + + + + 自定义编码 + + + + + 线路名称 + + + + + 开始点位 + + + + + 结束点位 + + + + + 描述 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/27 9:36:07 + 描 述 : + + + + + 点位名称 + + + + + 点位编码 + + + + + 名 称 :胖子天骄桶管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/14 11:33:10 + 描 述 : + + + + + 桶名称 + + + + + 桶编号 + + + + + 名 称 :桶原料记录 + 创 建 人 :yangxiao + 创建时间 : 2023/7/14 11:47:33 + 描 述 : + + + + + 桶Id + + + + + 物料Id + + + + + 添加时间 + + + + + 重量 + + + + + 工单Id + + + + + 名 称 :胖子天骄工艺基础信息 + 创 建 人 :yangxiao + 创建时间 : 2023/7/14 14:43:37 + 描 述 : + + + + + 工艺名称 + + + + + 设备产品Id + + + + + 工艺描述 + + + + + 名 称 :工艺路线 + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 17:01:26 + 描 述 : + + + + + 工艺Id + + + + + 步骤 + + + + + 功能描述 + + + + + 设备产品功能Id + + + + + 功能参数 + + + + + 名 称 :胖子天骄设备基础表 + 创 建 人 :yangxiao + 创建时间 : 2023/7/14 11:26:34 + 描 述 : + + + + + 名称 + + + + + 编码 + + + + + 设备类型 + + + + + 设备描述 + + + + + 设备维保时间 + + + + + 设备创建时间 + + + + + 名 称 :胖子天骄成品基础信息管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/14 14:07:56 + 描 述 : + + + + + 成品编号 + + + + + 成品名称 + + + + + 配方Id + + + + + 工艺Id + + + + + 添加时间 + + + + + 名 称 :产线设备 + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 16:45:05 + 描 述 : + + + + + 产线Id + + + + + 产线设备 + + + + + 名 称 :产线料仓 + 创 建 人 :yangxiao + 创建时间 :2023/7/20 16:45:40 + 描 述 : + + + + + 产线Id + + + + + 产线料仓 + + + + + 名 称 :胖子天骄原料管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/14 11:32:06 + 描 述 : + + + + + 原料名称 + + + + + 原料编号 + + + + + 原料单位 + + + + + 原料分组 + + + + + 每升重量 + + + + + 名 称 :胖子天骄料仓管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/14 11:31:34 + 描 述 : + + + + + 料仓编码 + + + + + 料仓名称 + + + + + 物料Id + + + + + 料仓容积 + + + + + 名 称 :工单基础信息 + 创 建 人 :yangxiao + 创建时间 : 2023/7/18 17:54:43 + 描 述 : + + + + + 工单名称 + + + + + 产线Id + + + + + 成品Id + + + + + 指定设备Id + + + + + 产量 + + + + + 批次号 + + + + + 工单当前状态 + + + + + 创建时间 + + + + + 名 称 :工单拆分 + 创 建 人 :yangxiao + 创建时间 : 2023/7/18 18:12:55 + 描 述 : + + + + + 工单名称 + + + + + 产量 + + + + + 名 称 :工单状态 + 创 建 人 :yangxiao + 创建时间 :2023/7/18 18:07:21 + 描 述 : + + + + + 工单Id + + + + + 工单状态 + + + + + 创建时间 + + + + + 备注 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 18:22:42 + 描 述 : + + + + + 批次名词 + + + + + 创建时间 + + + + + 状态 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/10 10:03:15 + 描 述 : + + + + + 工单Id + + + + + 工艺Id + + + + + 工艺名称 + + + + + 工艺步骤Id + + + + + 步骤 + + + + + 工艺步骤名称 + + + + + 工艺参数 + + + + + 设备类型功能Id + + + + + 设备类型功能名称 + + + + + 执行状态 + + + + + 更新时间 + + + + + 第几锅 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 18:22:42 + 描 述 : + + + + + 物料名称 + + + + + 物料id + + + + + 工单id + + + + + 重量 + + + + + 第几锅 + + + + + 配方Id + + + + + 配方名称 + + + + + 物料状态 + + + + + 更新时间 + + + + + 误差 + + + + + 名 称 :设备产品 + 创 建 人 :yangxiao + 创建时间 : 2023/8/1 16:34:53 + 描 述 : + + + + + 设备产品名称 + + + + + 设备产品编码 + + + + + 设备产品描述 + + + + + 名 称 :设备功能 + 创 建 人 :yangxiao + 创建时间 : 2023/8/2 16:03:10 + 描 述 : + + + + + 设备产品Id + + + + + 功能名称 + + + + + 功能编码 + + + + + 描述 + + + + + 方法参数 + + + + + 名 称 :设备属性 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 15:06:00 + 描 述 : + + + + + 设备产品Id + + + + + 名称 + + + + + 编码 + + + + + 描述 + + + + + 名 称 :设备配方表 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 13:57:00 + 描 述 : + + + + + 设备Id + + + + + 配方Id + + + + + 名 称 :码表数据 + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 9:47:53 + 描 述 : + + + + + 类型id + + + + + 值 + + + + + 编码 + + + + + 排序 + + + + + 添加时间 + + + + + 名 称 :数据码表 + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 9:48:05 + 描 述 : + + + + + 名称 + + + + + 编码 + + + + + 排序 + + + + + 名 称 :分组信息 + 创 建 人 :yangxiao + 创建时间 : 2023/3/10 14:01:15 + 描 述 : + + + + + 名称 + + + + + 介绍 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/24 17:28:56 + 描 述 : + + + + + 地址 + + + + + 密码 + + + + + 账号 + + + + + 消息发布路由 4.0和5.0不一样 + + + + + 名 称 :操作日志 + 创 建 人 :yangxiao + 创建时间 :2023/7/20 15:10:59 + 描 述 : + + + + + 操作标题 + + + + + 内容 + + + + + 返回值 + + + + + 创建时间 + + + + + 名 称 :订单服务 + 创 建 人 :yangxiao + 创建时间 : 2023/7/18 18:11:48 + 描 述 : + + + + + 名 称 :产线管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/18 10:42:35 + 描 述 : + + + + + 产线名称 + + + + + 产线编码 + + + + + 产线描述 + + + + + 名 称 :配方物料信息 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 13:58:19 + 描 述 : + + + + + 物料Id + + + + + 配方Id + + + + + 重量 + + + + + 描述 + + + + + 误差 + + + + + 名 称 :配方分组 + 创 建 人 :yangxiao + 创建时间 : 2023/3/10 14:56:03 + 描 述 : + + + + + 组Id + + + + + 产品Id + + + + + 名 称 :配方信息 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 13:57:15 + 描 述 : + + + + + 名称 + + + + + 自定义编码 + + + + + 名 称 :店铺信息 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 13:52:13 + 描 述 : + + + + + 名称 + + + + + 地址 + + + + + 联系电话 + + + + + 负责人 + + + + + 当前值 + + + + + 报警信息 + + + + + 大屏报警限制 + + + + + 限制名称 + + + + + 最小限制值 + + + + + 最大限制值 + + + + + 名 称 :报警日志 + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:17:57 + 描 述 : + + + + + 报警信息 + + + + + 报警值 + + + + + 报警等级 + + + + + 设备名称 + + + + + 日期 + + + + + 时间 + + + + + 创建时间 + + + + + 类型 + + + + + 名 称 :程序日志 + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:18:13 + 描 述 : + + + + + 日志类型 + + + + + 日志消息 + + + + + 日期 + + + + + 时间 + + + + + 日志消息 + + + + + 名 称 :运行日志 + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:18:34 + 描 述 : + + + + + 日志类别 + + + + + 日志消息 + + + + + 日期 + + + + + 时间 + + + + + 日志消息 + + + + + 更新时间 + + + + + 名 称 :用户日志 + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:18:50 + 描 述 : + + + + + 权限 + + + + + 用户名 + + + + + 日志消息 + + + + + 日志时间 + + + + + 状态 + + + + + 订单ID + + + + + 成品Id + + + + + 数量 + + + + + 订单关联工单 + + + + + 名 称 :账户信息 + 创 建 人 :yangxiao + 创建时间 : 2023/1/3 10:18:43 + 描 述 : + + + + + 账号 + + + + + 密码 + + + + + 员工表Id + + + + + 名 称 :员工信息 + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 17:44:31 + 描 述 : + + + + + 员工姓名 + + + + + 1男2女 + + + + + 1启用 2禁用 + + + + + 超管 + + + + + 角色Id + + + + + 名 称 :模块菜单表 + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 17:32:15 + 描 述 : + + + + + 类别 1:菜单,2:视图,3:功能 + + + + + 菜单打开方式 0:框架内嵌,1:新开页面 + + + + + 父级编号 + + + + + 名称 + + + + + 图标 + + + + + 地址 + + + + + 状态 + + + + + 名 称 :角色信息 + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 17:32:32 + 描 述 : + + + + + 角色名称 + + + + + 角色类型 1超级管理员,2其他 + + + + + 角色描述 + + + + + 是否删除 + + + + + 名 称 :角色权限表 + 创 建 人 :yangxiao + 创建时间 : 2023/8/31 15:56:02 + 描 述 : + + + + + 角色Id + + + + + 模块Id + + + + + 父级模块 + + + + + 执行操作前后 + + + + + + + + 名 称 :接口AOP + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 15:04:06 + 描 述 : + + + + + 执行操作前后 + + + + + + + + 名 称 :MQTT消息基类 + 创 建 人 :yangxiao + 创建时间 : 2023/7/21 10:24:24 + 描 述 : + + + + + 消息ID + + + + + 消息版本 + + + + + 名 称 :MQTT通信库 + 创 建 人 :yangxiao + 创建时间 : 2022/11/18 15:38:40 + 描 述 : + + + + + Mqtt通用服务 + + + + + code + + + + + reason_code + + + + + + + + + + 消息内容 + + + + + 消息长度 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2022/11/18 15:37:07 + 描 述 : + + + + + 设备控制主题,前端通过消息控制设备动作(客户端/前端 --> 设备) + + + + + 工单推送主题,中控将创建的工单推送到对应的产线 (中控系统 --> 产线) + + + + + 前端展示数据推送,数据服务将设备数据推送到前端界面展示 (数据中心服务 --> 客户端/前端) + + + + + 工单状态(信息系统 --> 中控系统) + + + + + 任务下发成功 回调 + + + + + 上下料回调 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 9:59:47 + 描 述 : + + + + + 自定义编码 + + + + + 线路名称 + + + + + 开始点位 + + + + + 结束点位 + + + + + 描述 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:00:01 + 描 述 : + + + + + 点位名称 + + + + + 点位编码 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 任务完成回报Dto + + + + + 上游系统任务号,全局唯一 + + + + + 仓库编号 + + + + + 任务快仓系统编号 + + + + + 任务状态 + + + + + 内部任务类型 + + + + + 数据字段 + + + + + 上下料交互请求DTO + + + + + AGV编号 + + + + + 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔 + + + + + 上游设备ID + + + + + 上游设备ID,多个用英文逗号分隔 + + + + + 快仓任务编号 + + + + + 消息ID + + + + + 交互阶段LOAD:上料阶段 UNLOAD:下料阶段 + + + + + 上游任务号 + + + + + 货到货 + + + + + AGV编号 + + + + + 容器编号 + + + + + 上料点位 + + + + + 上料货位编号 + + + + + 下料点位 + + + + + 下料货位编号 + + + + + 是否需要上料交互 + + + + + 点到点 + + + + + AGV编号 + + + + + 容器编号 + + + + + 上料点位 + + + + + 下料点位 + + + + + 是否需要上料交互 + + + + + 顶升完成 + + + + + 开始移动 + + + + + 放下完成 + + + + + 任务完成 + + + + + 任务取消 + + + + + 任务异常取消 + + + + + 任务异常完成 + + + + + 1) 辊筒货位到货位搬运 + + + + + 是否成功 + + + + + 状态码 + + + + + 消息 + + + + + 返回数据数组 + + + + + 状态码 + + + + + 消息体 + + + + + 任务编号 + + + + + AGV请求 + + + + + 快仓api地址 + + + + + 任务编码 + + + + + 仓库编码 默认值1 + + + + + 优先级 0-99 越高越先执行 + + + + + 任务下发起止点信息 + + + + + 用户自定义信息编号 + + + + + 起点点位 + + + + + 终点点位 + + + + + 上料方式 自动/人工 + + + + + 上料交互方式 //接口对接 false + + + + + 下料方式 true自动/false人工 + + + + + 接口对接 false + + + + + 起点设备ID + + + + + 目标设备ID + + + + + 名 称 :AGV线路管理 + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:03:21 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :AGV点位管理 + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:03:37 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + AGV第三方api + + + + + 下发任务 + + + + + + + 取消任务 + + + + + + + 上下料反馈给AGV接口 + + + + + + + 任务反馈(暴露给AGV厂商) + + + + + + + AGV上下料交互请求 (暴露给AGV厂商) + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:02:54 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 :AVG点位 + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:03:06 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 下发任务 + + + + + + + 取消任务 + + + + + + + 任务回调 + + + + + + + AGV上下料交互请求 + + + + + + + 上下料反馈给AGV接口 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 16:13:10 + 描 述 : + + + + + 初始化数据库 + + + + + + 测试 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 15:43:00 + 描 述 : + + + + + 桶名称 + + + + + 桶编号 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 当前原料名称 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 17:29:52 + 描 述 : + + + + + 桶Id + + + + + 物料Id + + + + + 添加时间 + + + + + 物料重量 + + + + + 工单Id + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 工单Id + + + + + 桶Id + + + + + 桶编号 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 桶Id + + + + + 清空桶 + + + + + 输出 + + + + + 主键 + + + + + 原料名称 + + + + + 桶名称 + + + + + 工单名称 + + + + + 桶编码 + + + + + 计划重量 + + + + + 第几锅 + + + + + 名 称 :桶服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :基础数据管理 + + + + + 增加 + + + + + + + 新增并返回 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :桶记录 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :基础数据管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 更新 + + + + + + + + 清空桶 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 15:43:10 + 描 述 : + + + + + 增加 + + + + + + 增加并返回数据 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :桶记录 + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 17:37:03 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 清空桶 + + + + + + + 名 称 :产品分组 + 创 建 人 :yangxiao + 创建时间 : 2023/3/10 13:59:43 + 描 述 : + + + + + 工艺名称 + + + + + 设备类型 0:炒锅 1:反应釜 + + + + + 工艺描述 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 设备类型 0:炒锅 1:反应釜 + + + + + 不分页 + + + + + 输出 + + + + + 主键 + + + + + + 名 称 :产线管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/18 14:03:27 + 描 述 : + + + + + 工艺Id + + + + + 步骤 + + + + + 功能描述 + + + + + 设备产品功能Id + + + + + 功能参数 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 工艺Id + + + + + 输出 + + + + + 主键 + + + + + 工艺名称 + + + + + 设备产品功能名称 + + + + + 设备产品Id + + + + + 名 称 :工艺信息 + 创 建 人 :yangxiao + 创建时间 :2023/3/10 14:03:06 + 描 述 :配方工艺管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + 更新 + + + + + + + + 名 称 :工艺路线服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :CraftsInfo 工艺管理 CraftsSteps工艺步骤管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 批量更新 + + + + + + + 名 称 :工艺信息 + 创 建 人 :yangxiao + 创建时间 :2023/3/10 14:03:21 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :产线管理 + 创 建 人 :yangxiao + 创建时间 :2023/7/18 14:05:16 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 批量更新 + + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :设备产品信息 + 创 建 人 :yangxiao + 创建时间 : 2023/8/2 16:19:15 + 描 述 : + + + + + 设备产品名称 + + + + + 设备产品编码 + + + + + 设备产品描述 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 :设备产品模型功能 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 18:04:53 + 描 述 : + + + + + 设备产品Id + + + + + 功能名称 + + + + + 功能编码 + + + + + 描述 + + + + + 方法参数 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 设备产品Id + + + + + 设备产品名称 + + + + + 设备产品编号 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 设备产品Id + + + + + 输出 + + + + + 主键 + + + + + 名 称 :设备产品参数 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 18:04:53 + 描 述 : + + + + + 设备产品Id + + + + + 名称 + + + + + 编码 + + + + + 描述 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 :设备产品功能服务 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 18:03:25 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :设备参数 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 18:03:25 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :设备产品 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 18:03:25 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :设备产品功能 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 18:02:57 + 描 述 : + + + + + 增加 + + + + + + 删除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :设备产品参数 + 创 建 人 :yangxiao + 创建时间 : 2023/7/31 18:02:57 + 描 述 : + + + + + 增加 + + + + + + 删除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :设备产品基础信息 + 创 建 人 :yangxiao + 创建时间 : 2023/8/2 16:19:35 + 描 述 : + + + + + 增加 + + + + + + 删除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :设备Dto类 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 16:12:06 + 描 述 : + + + + + 增加 + + + + + 更新 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 设备Id + + + + + 分页 + + + + + 设备Id + + + + + 配方数组 + + + + + 输出 + + + + + 设备名称 + + + + + 配方名称 + + + + + 配方代码 + + + + + 分组Id + + + + + 分组名称 + + + + + 配方图片地址 + + + + + 名 称 :设备Dto类 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 16:12:06 + 描 述 : + + + + + 名称 + + 设备名称 + + + + 编码 + + + + + 设备类型 + + + + + 设备描述 + + 设备描述 + + + + 设备维保时间 + + 2023-7-17 + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 :设备服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :基础信息管理 + + + + + 增加 + + + + + + + 批量下发配方 + + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 更新 + + + + + + + + 名 称 :设备服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :基础数据管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :设备配方服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 18:30:58 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 批量下发配方 + + + + + + + 名 称 :设备服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 18:30:58 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :码表数据 + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 9:56:11 + 描 述 : + + + + + 类型id + + + + + 值 + + + + + 编码 + + + + + 排序 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 码表类型Id + + + + + 码表类型编码 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 码表类型Id + + + + + 输出 + + + + + 主键 + + + + + 名 称 :码表类型 + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 9:56:00 + 描 述 : + + + + + 名称 + + + + + 编码 + + + + + 排序 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 :码表管理 + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 10:01:19 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :码表类型管理 + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 10:01:35 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :码表数据 + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 10:00:06 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/9 10:00:23 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 :成品管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 15:59:39 + 描 述 : + + + + + 成品编号 + + + + + 成品名称 + + + + + 配方Id + + + + + 工艺Id + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 配方名称 + + + + + 工艺名称 + + + + + 名 称 :成品管理服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :基础数据管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :成品信息管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 16:02:25 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:59:30 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 添加报警限制 + + + + + + + 修改报警限制 + + + + + + + 获取报警限制 + + + + + + 删除报警限制 + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 :2023/8/21 10:20:37 + 描 述 : + + + + + 报警信息 + + + + + 报警值 + + + + + 报警等级 + + + + + 类型 + + + + + 设备名称 + + + + + 日期 + + + + + 时间 + + + + + 日志消息 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 分页 + + + + + 报警信息 + + + + + 报警值 + + + + + 报警等级 + + + + + 设备名称 + + + + + 开始时间 + + + + + 结束时间 + + + + + 输出 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:20:55 + 描 述 : + + + + + 日志类型 + + + + + 日志消息 + + + + + 日期 + + + + + 时间 + + + + + 日志消息 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 分页 + + + + + 日志类型 + + + + + 日志消息 + + + + + 开始时间 + + + + + 结束时间 + + + + + 输出 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:21:11 + 描 述 : + + + + + 日志类别 + + + + + 日志消息 + + + + + 日期 + + + + + 时间 + + + + + 日志消息 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 分页 + + + + + 日志类别 + + + + + 日志消息 + + + + + 开始时间 + + + + + 结束时间 + + + + + 输出 + + + + + 主键 + + + + + 名 称 :用户权限 + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:21:40 + 描 述 : + + + + + 权限 + + + + + 用户名 + + + + + 日志消息 + + + + + 日志时间 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 分页 + + + + + 用户名 + + + + + 日志消息 + + + + + 输出 + + + + + 主键 + + + + + 名 称 :报警日志 + 创 建 人 :yangxiao + 创建时间 :2023/8/21 11:02:36 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 更新 + + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:30:26 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:30:39 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:30:53 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/21 10:31:05 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 :系统日志 + 创 建 人 :yangxiao + 创建时间 :2023/8/21 11:16:20 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 更新 + + + + + + + + 名 称 :运行日志 + 创 建 人 :yangxiao + 创建时间 :2023/8/21 11:16:32 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 更新 + + + + + + + + 名 称 :用户操作日志 + 创 建 人 :yangxiao + 创建时间 :2023/8/21 11:16:44 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 更新 + + + + + + + + 名 称 :设备Dto类 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 16:12:06 + 描 述 : + + + + + 原料名称 + + + + + + 原料编号 + + + + + + 原料单位 + + + + + + 原料分组 + + + + + + 每升重量 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + + 删除 + + + + + 主键 + + + + + + 分页 + + + + + 名称 + + + + + + 编码 + + + + + + 输出 + + + + + 主键 + + + + + + 类型名称 + + + + + 名 称 :物料服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 18:31:53 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :原料服务 + 创 建 人 :yangxiao + 创建时间 :2023年7月17日15:41:09 + 描 述 :基础数据管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 15:15:48 + 描 述 : + + + + + 操作标题 + + + + + 内容 + + + + + 创建时间 + + + + + 增加 + + + + + 名 称 :日志服务 + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 15:17:58 + 描 述 : + + + + + 增加 + + + + + + 名 称 :操作日志 + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 15:17:24 + 描 述 : + + + + + 状态 + + + + + 分配进度 + + + + + 生产进度 + + + + + 成品 + + + + + 产线 + + + + + 数量 + + + + + 成品数量限制 + + + + + 成品 + + + + + 分页列表 + + + + + + 新增 + + + + + + + 修改 + + + + + + + 获取订单的商品 + + + + + + + 添加工单 并绑定订单 + + + + + + + 获取成品剩余制作数量 + + + + + + + 分页列表 + + + + + + 新增 + + + + + + + 修改 + + + + + + + 删除 + + + + + + + 获取订单的商品 + + + + + + + 添加工单 并绑定订单 + + + + + + + 生成工单时验证成品数量 + + + + + + 获取成品剩余制作数量 + + + + + + + 名 称 :产品分组 + 创 建 人 :yangxiao + 创建时间 : 2023/3/10 13:59:43 + 描 述 : + + + + + 名称 + + + + + 介绍 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 输出 + + + + + 主键 + + + + + + 名 称 :产线设备 + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 17:00:32 + 描 述 : + + + + + 产线Id + + + + + 产线设备 + + + + + 产线设备不分页 + + + + + 名称 + + + + + 产线Id + + + + + 产线设备分页 + + + + + 名称 + + + + + 产线Id + + + + + 删除产线设备 + + + + + 主键 + + + + + 产线设备关联信息 + + + + + 主键 + + + + + 名称 + + 设备名称 + + + + 编码 + + + + + 设备类型 + + + + + 设备描述 + + 设备描述 + + + + 名 称 :产线管理 + 创 建 人 :yangxiao + 创建时间 : 2023/7/18 14:03:27 + 描 述 : + + + + + 产线名称 + + + + + 产线编码 + + + + + 产线描述 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 18:25:18 + 描 述 : + + + + + 产线Id + + + + + 产线设备 + + + + + 产线设备不分页 + + + + + 名称 + + + + + 产线Id + + + + + 物料Id + + + + + 产线设备分页 + + + + + 名称 + + + + + 产线Id + + + + + 删除产线设备 + + + + + 主键 + + + + + 产线设备关联信息 + + + + + 主键 + + + + + 产线名称 + + + + + 名称 + + 设备名称 + + + + 编码 + + + + + 物料信息 + + + + + 物料名称 + + + + + 名 称 :分组信息 + 创 建 人 :yangxiao + 创建时间 :2023/3/10 14:03:06 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + 更新 + + + + + + + + 名 称 :分组信息 + 创 建 人 :yangxiao + 创建时间 :2023/3/10 14:03:21 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 下拉列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 :产线管理 + 创 建 人 :yangxiao + 创建时间 :2023/7/18 14:05:16 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 产线添加设备 + + + + + + 产线删除设备 + + + + + + 产线设备不分页 + + + + + + 产线设备分页 + + + + + + 产线添加料仓 + + + + + + 产线删除料仓 + + + + + + 产线料仓不分页 + + + + + + 产线料仓分页 + + + + + + 名 称 :产线服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :基础数据管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 产线添加设备 + + + + + + 产线删除设备 + + + + + + 产线设备不分页 + + + + + + 产线设备分页 + + + + + + 产线添加料仓 + + + + + + 产线删除料仓 + + + + + + 产线料仓不分页 + + + + + + 产线料仓分页 + + + + + + 名 称 :配方物料Dto类 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:12:06 + 描 述 : + + + + + 物料Id + + + + + 配方Id + + + + + 重量 + + + + + 描述 + + + + + 误差 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 配方Id + + + + + 分页 + + + + + 输出 + + + + + 主键 + + + + + 配方名称 + + + + + 物料名称 + + + + + 物料编码 + + + + + 名 称 :配方Dto类 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:12:06 + 描 述 : + + + + + 名称 + + + + + 自定义编码 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 分组id + + + + + 输出 + + + + + 主键 + + + + + 分组Id + + + + + 主键 + + + + + + 名 称 :配方物料服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 18:33:18 + 描 述 : + + + + + 增加 + + + + + + 批量增加 + + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 :配方服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 18:33:18 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 更改物料分组 + + + + + + + 名 称 :配方物料服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :配方物料数据维护 + + + + + 增加 + + + + + + + 批量增加 + + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 更新 + + + + + + + + 名 称 :配方管理 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :店铺数据维护 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 获取产品生产统计 + + + + + + + 获取物料统计 + + + + + + + 获取成品生产统计 + + + + + + + 获取物料统计 + + + + + + + 名 称 : 料仓服务 + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 15:27:20 + 描 述 : + + + + + 料仓编码 + + + + + 料仓名称 + + + + + 物料Id + + + + + 料仓容积 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 物料Name + + + + + 名 称 :料仓服务 + 创 建 人 :yangxiao + 创建时间 : 2023/7/17 15:32:17 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 名 称 :料仓服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :基础数据管理 + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2024/4/8 15:46:52 + 描 述 : + + + + + 批次名词 + + + + + 创建时间 + + + + + 状态 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页 + + + + + 分页 + + + + + 创建时间 + + + + + 起始时间 + + + + + 结束时间 + + + + + 输出 + + + + + 主键 + + + + + 个数 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/10 14:19:47 + 描 述 : + + + + + 工艺Id + + + + + 工艺名称 + + + + + 工艺步骤 + + + + + 工艺步骤名称 + + + + + 执行状态 + + + + + 更新状态 + + + + + 增加 + + + + + 更新 + + + + + 工单工艺步骤Id + + + + + 工单Id + + + + + 锅数 + + + + + 状态 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 输出 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 14:29:09 + 描 述 : + + + + + 工单名称 + + + + + 产线Id + + + + + 成品Id + + + + + 产量 + + + + + 批次号 + + + + + 设备id + + + + + 创建时间 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 不分页查询条件 + + + + + 名称 + + + + + 主键 + + + + + 工单状态 + + + + + 起始时间 + + + + + 结束时间 + + + + + 批次计划Id + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 工单状态 + + + + + 批次计划Id + + + + + 起始时间 + + + + + 结束时间 + + + + + 工单下发 + + + + + 输出 + + + + + 主键 + + + + + 产品名称 + + + + + 线名称 + + + + + 设备编码 + + + + + 设备名称 + + + + + 工单状态 + + + + + 详情输出 + + + + + 工艺状态 + + + + + 配方状态 + + + + + 工艺步骤 + + + + + 物料信息 + + + + + 名 称 :工单产量 + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 14:29:25 + 描 述 : + + + + + 工单名称 + + + + + 产量 + + + + + 增加 + + + + + 更新 + + + + + 主键 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/10 9:48:30 + 描 述 : + + + + + 物料名称 + + + + + 物料id + + + + + 工单id + + + + + 重量 + + + + + 第几锅 + + + + + 配方Id + + + + + 配方名称 + + + + + 物料状态 + + + + + 更新时间 + + + + + 误差重量 + + + + + 增加 + + + + + 更新 + + + + + 工单物料Id + + + + + 状态 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 输出 + + + + + 主键 + + + + + 物料类型 + + + + + 物料类型名称 + + + + + 每升重量 + + + + + 名 称 :工单状态 + 创 建 人 :yangxiao + 创建时间 :2023/7/20 14:29:39 + 描 述 : + + + + + 工单Id + + + + + 工单状态 + + + + + 创建时间 + + + + + 备注 + + + + + 增加 + + + + + 更新 + + + + + 工单Id + + + + + 状态 + + + + + 备注 + + + + + 删除 + + + + + 主键 + + + + + 分页 + + + + + 批次下发 + + + + + 下发 + + + + + 工单ID + + + + + 设备ID + + + + + 输出 + + + + + 主键 + + + + + 状态名称 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2024/4/8 15:41:42 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 名 称 :工单服务 + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 14:39:28 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 下拉列表 + + + + + + 查询单条 + + + + + + + 更改状态 + + + + + + 工单下发 + + 工单Id + + + + + 批次工单下发 + + + + + + + 强制结束 + + 工单Id + + + + + 工单状态记录 + + + + + + + 修改工单步骤状态 + + + + + + + 修改工单物料状态 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/21 14:54:31 + 描 述 : + + + + + 名 称 :工单服务 + 创 建 人 :yangxiao + 创建时间 :2023/7/20 14:39:41 + 描 述 : + + + + + 名 称 :工单服务 + 创 建 人 :yangxiao + 创建时间 :2023/7/20 14:39:41 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 分页 + + + + + + + 工单下发 + + 工单id + + + + + + 工单下发 + + 工单id + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 修改工单状态 + + + + + + + + 修改工单物料状态 + + + + + + + 修改工单步骤状态 + + + + + + + 强制结束工单 + + + + + + + 工单状态变更记录 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/21 14:54:42 + 描 述 : + + + + + 系统缓存服务 + + + + + 获取所有缓存关键字 + + + + + + 删除指定关键字缓存 + + + + + + + 删除某特征关键字缓存 + + + + + + + 设置缓存 + + + + + + + + 设置缓存 + + + + + + + + 获取缓存 + + + + + + + 获取缓存 + + + + + + + + 检查给定 key 是否存在 + + 键 + + + + + 增加缓存Key + + + + + + + + + + + + + + [账号信息]入参基础 + + + + + 账号 + + admin + + + + 密码 + + e10adc3949ba59abbe56e057f20f883e + + + + [账号信息]添加入参 + + + + + 员工编号 + + + + + [账号信息]修改入参 + + + + + 主键 + + + + + 员工编号 + + + + + [账号信息]修改密码 + + + + + 旧密码 + + + + + 新密码 + + + + + [账号信息]删除入参 + + + + + 主键 + + + + + [账号信息]普通查询入参 + + + + + 主键 + + + + + [账号信息]分页查询入参 + + + + + 主键 + + + + + 账号名称 + + + + + 名 称 :[账号信息]输出实体 + 创 建 人 :yangxiao + 创建时间 : 2023/1/3 10:22:37 + 描 述 : + + + + + 主键 + + + + + 账号 + + + + + 密码 + + + + + 员工id + + + + + [授权信息]入参基础 + + + + + 关键字 + + + + + 模板Id + + + + + 授权类型 1:用户,2:角色 + + + + + 授权对象 + + + + + [授权信息]添加入参 + + + + + [授权信息]角色授权入参 + + + + + 模板编号 + + + + + 授权类型 1用户 2角色 + + + + + 授权对象 + + + + + [授权信息]修改入参 + + + + + 主键 + + + + + [授权信息]删除入参 + + + + + 主键 + + + + + [授权信息]普通查询入参 + + + + + 主键 + + + + + [授权信息]分页查询入参 + + + + + 主键 + + + + + 名 称 :授权信息输出 + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 17:24:21 + 描 述 : + + + + + 编号 + + + + + 名称 + + + + + 已授权 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/1/5 15:15:50 + 描 述 : + + + + + 员工姓名 + + + + + 0男1女 + + + + + 0启用 1禁用 + + + + + 角色Id + + + + + 是否存在账号 + + + + + 账号 + + + + + [授权信息]添加入参 + + + + + [授权信息]修改入参 + + + + + 主键 + + + + + [授权信息]删除入参 + + + + + 主键 + + + + + [授权信息]普通查询入参 + + + + + 主键 + + + + + [授权信息]分页查询入参 + + + + + 主键 + + + + + 关键字 + + + + + 状态 + + + + + 性别 + + + + + 入职时间 + + + + + 名 称 :[员工信息] + 创 建 人 :yangxiao + 创建时间 : 2023/1/5 15:18:02 + 描 述 : + + + + + 主键 + + + + + 排序 + + + + + 员工姓名 + + + + + 0男1女 + + + + + 0启用 1禁用 + + + + + 角色Id + + + + + 是否存在账号 + + + + + 账号 + + + + + [模块信息]入参基础 + + + + + 类别 1:菜单,2:视图,3:功能 + + + + + 菜单打开方式 0:框架内嵌,1:新开页面 + + + + + 父级编号 + + + + + 名称 + + + + + 图标 + + + + + 地址 + + + + + 排序码 + + + + + 启用禁用 + + + + + [模块信息]添加入参 + + + + + [模块信息]修改入参 + + + + + 主键 + + + + + [模块信息]删除入参 + + + + + 主键 + + + + + [模块信息]普通查询入参 + + + + + 主键 + + + + + [模块信息]分页查询入参 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 9:48:24 + 描 述 : + + + + + 主键 + + + + + 类别 1:菜单,2:视图,3:功能 + + + + + 菜单打开方式 0:框架内嵌,1:新开页面 + + + + + 父级编号 + + + + + 名称 + + + + + 图标 + + + + + 地址 + + + + + 排序码 + + + + + 启用禁用 + + + + + [菜单模块树]入参基础 + + + + + 类别 1:菜单,2:视图,3:功能 + + + + + 菜单打开方式 0:框架内嵌,1:新开页面 + + + + + 父级编号 + + + + + 名称 + + + + + 图标 + + + + + 地址 + + + + + 排序码 + + + + + 启用禁用 + + + + + 子集 + + + + + [菜单模块树]添加入参 + + + + + [菜单模块树]修改入参 + + + + + 主键 + + + + + [菜单模块树]删除入参 + + + + + 主键 + + + + + [菜单模块树]普通查询入参 + + + + + 主键 + + + + + 名称 + + + + + [菜单模块树]分页查询入参 + + + + + 主键 + + + + + 名 称 :[菜单模块树]输出 + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 16:14:43 + 描 述 : + + + + + 模块编号 + + + + + 类别 1:菜单,2:视图,3:功能 + + + + + 菜单打开方式 0:框架内嵌,1:新开页面 + + + + + 父级编号 + + + + + 名称 + + + + + 图标 + + + + + 地址 + + + + + 排序码 + + + + + 启用禁用 + + + + + 子集 + + + + + 名 称 :[角色信息] + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 9:43:25 + 描 述 : + + + + + 角色名称 + + + + + 角色描述 + + + + + [角色信息]添加入参 + + + + + [角色信息]修改入参 + + + + + 主键 + + + + + [角色信息]删除入参 + + + + + 主键 + + + + + [角色信息]普通查询入参 + + + + + 主键 + + + + + [角色信息]分页查询入参 + + + + + 主键 + + + + + 关键字 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/31 15:58:31 + 描 述 : + + + + + 角色Id + + + + + 模块Id + + + + + 父级Id + + + + + 角色Id + + + + + 角色Id + + + + + 模块Id + + + + + 角色Id + + + + + 名 称 :角色信息 + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 9:43:42 + 描 述 : + + + + + 主键 + + + + + 角色名称 + + + + + 角色描述 + + + + + 名 称 :个人角色信息 + 创 建 人 :yangxiao + 创建时间 : 2023/1/4 17:46:47 + 描 述 : + + + + + 个人菜单信息 + + + + + 主键 + + + + + 菜单名称 + + + + + 菜单地址 + + + + + 菜单图标 + + + + + 菜单子项 + + + + + 父级Id + + + + + 分页信息 + + + + + 打开类型 + + + + + 类别 + + + + + 名 称 :授权服务 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 16:11:04 + 描 述 :授权服务数据维护 + + + + + 登录 + + + + + + + 获取个人信息 + + + + + + 获取用户权限 + + + + + + 获取账户信息 + + + + + + + 添加账户 + + + + + + + 修改账户信息 + + + + + + + 删除账户 + + + + + + + 编辑员工 + + + + + + + 查询员工 + + + + + + + 删除员工 + + + + + + + 分配角色权限 + + + + + + + 根据角色获取权限模块 + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/7/20 15:09:49 + 描 述 : + + + + diff --git a/backend/BPA.MES.Base.Application/Const/ClaimConst.cs b/backend/BPA.MES.Base.Application/Const/ClaimConst.cs new file mode 100644 index 0000000..67d1454 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Const/ClaimConst.cs @@ -0,0 +1,88 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/4 10:15:54 + /// 描 述 : + /// + public class ClaimConst + { + /// + /// 用户Id + /// + public const string CLAINM_USERID = "UserId"; + /// + /// 账号 + /// + public const string CLAINM_ACCOUNT = "Account"; + /// + /// 名称 + /// + public const string CLAINM_NAME = "Name"; + /// + /// 头像 + /// + public const string CLAINM_AVATARURL = "AvatarUrl"; + /// + /// 电话 + /// + public const string CLAINM_PHONE = "Phone"; + /// + /// 性别 + /// + public const string CLAINM_SEX = "0"; + /// + /// 是否授权 + /// + public const string CLAINM_ISAUTH = "0"; + /// + /// 角色Id + /// + public const string CLAINM_ROLEID = ""; + /// + /// 微信session_key + /// + public const string SESSION_KEY = "session_key"; + /// + /// 是否超级管理 + /// + public const string CLAINM_SUPERADMIN = "SuperAdmin"; + /// + /// 租户Id + /// + public const string TENANT_ID = "TenantId"; + /// + /// 用户组织机构Id + /// + public const string CLAINM_ORGID = "OrgId"; + /// + /// 用户组织机构名称 + /// + public const string CLAINM_ORGNAME = "OrgName"; + /// + /// 是否是管理员 + /// + public const bool ISADMIN = false; + /// + /// 所有缓存关键字集合 + /// + public const string CACHE_KEY_ALL = "allkey"; + } + + public class MQTTConfig + { + /// + /// 地址 + /// + public static string Address { get; set; } + /// + /// 密码 + /// + public static string Pwd { get; set; } + /// + /// 账号 + /// + public static string Account { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Const/DeviceTypeEnum.cs b/backend/BPA.MES.Base.Application/Const/DeviceTypeEnum.cs new file mode 100644 index 0000000..e30fa7c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Const/DeviceTypeEnum.cs @@ -0,0 +1,40 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :产线设备类型 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/24 16:56:13 + /// 描 述 : + /// + public enum DeviceTypeEnum + { + /// + /// 锅 + /// + Pot, + /// + /// 釜 + /// + Kettle + } + /// + /// 配料状态 + /// + public enum EBatchingStatus + { + None = 0, + 等待配料 = 1, + 正在配料 = 2, + 配料完成 = 3 + } + /// + /// 工艺状态 + /// + public enum RecipeStatus + { + None = 0, + 等待执行 = 1, + 正在执行 = 2, + 执行完成 = 3 + } +} diff --git a/backend/BPA.MES.Base.Application/Const/ELogType.cs b/backend/BPA.MES.Base.Application/Const/ELogType.cs new file mode 100644 index 0000000..c1f6e52 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Const/ELogType.cs @@ -0,0 +1,10 @@ +namespace BPA.MES.Base.Application +{ + public enum ELogType + { + Error, + Info, + Warn, + + } +} diff --git a/backend/BPA.MES.Base.Application/Const/OrderStatusEnum.cs b/backend/BPA.MES.Base.Application/Const/OrderStatusEnum.cs new file mode 100644 index 0000000..16d256a --- /dev/null +++ b/backend/BPA.MES.Base.Application/Const/OrderStatusEnum.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Const +{ + public enum OrderStatusEnum + { + /// + /// 未开始 + /// + NotStarted = 0, + /// + /// 进行中 + /// + Ongoing = 1, + /// + /// 完成 + /// + Completed = 2, + + + } +} diff --git a/backend/BPA.MES.Base.Application/Const/WorkOrderStatusEnum.cs b/backend/BPA.MES.Base.Application/Const/WorkOrderStatusEnum.cs new file mode 100644 index 0000000..83fc83e --- /dev/null +++ b/backend/BPA.MES.Base.Application/Const/WorkOrderStatusEnum.cs @@ -0,0 +1,40 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :工单枚举 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/21 15:04:24 + /// 描 述 : + /// + public enum WorkOrderStatusEnum + { + /// + /// 未知 + /// + Unkown = -1, + /// + /// 草稿 + /// + Draft = 0, + /// + /// 已下发 + /// + Issued = 1, + /// + /// 已接受 + /// + Receive = 2, + /// + /// 已启动 + /// + Started = 3, + /// + /// 已完成 + /// + Completed = 4, + /// + /// 废弃 + /// + Obsolete = 5, + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Agv/AgvLineEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Agv/AgvLineEntity.cs new file mode 100644 index 0000000..711f75a --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Agv/AgvLineEntity.cs @@ -0,0 +1,33 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/27 9:35:27 + /// 描 述 : + /// + [SugarTable("agv_line")] + public class AgvLineEntity : DEntityBase + { + /// + /// 自定义编码 + /// + public string Code { get; set; } + /// + /// 线路名称 + /// + public string Name { get; set; } + /// + /// 开始点位 + /// + public string StartPointId { get; set; } + /// + /// 结束点位 + /// + public string EndPointId { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Agv/AgvPointEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Agv/AgvPointEntity.cs new file mode 100644 index 0000000..03551ef --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Agv/AgvPointEntity.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/27 9:36:07 + /// 描 述 : + /// + [SugarTable("agv_point")] + public class AgvPointEntity : DEntityBase + { + /// + /// 点位名称 + /// + public string Name { get; set; } + /// + /// 点位编码 + /// + public string Code { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_BucketInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_BucketInfoEntity.cs new file mode 100644 index 0000000..79ade8f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_BucketInfoEntity.cs @@ -0,0 +1,22 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :胖子天骄桶管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/14 11:33:10 + /// 描 述 : + /// + [SugarTable("bucket_info")] + public class Pztj_BucketInfoEntity : DEntityBase + { + /// + /// 桶名称 + /// + public string Name { get; set; } + /// + /// 桶编号 + /// + public string Code { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_BucketMaterialsRecordEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_BucketMaterialsRecordEntity.cs new file mode 100644 index 0000000..3332257 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_BucketMaterialsRecordEntity.cs @@ -0,0 +1,38 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :桶原料记录 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/14 11:47:33 + /// 描 述 : + /// + [SugarTable("bucket_material_record")] + public class Pztj_BucketMaterialsRecordEntity : DEntityBase + { + /// + /// 桶Id + /// + [SugarColumn(IsNullable = true)] + public string BucketId { get; set; } + /// + /// 物料Id + /// + [SugarColumn(IsNullable = true)] + public string MaterialId { get; set; } + /// + /// 添加时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime? CreateTime { get; set; } + /// + /// 重量 + /// + [SugarColumn(IsNullable = true)] + public string Weight { get; set; } + /// + /// 工单Id + /// + [SugarColumn(IsNullable = true)] + public string WorkId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftStepsEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftStepsEntity.cs new file mode 100644 index 0000000..b91e35e --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftStepsEntity.cs @@ -0,0 +1,36 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :工艺路线 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 17:01:26 + /// 描 述 : + /// + [SugarTable("craft_Steps")] + public class Pztj_CraftStepsEntity : DEntityBase + { + /// + /// 工艺Id + /// + public string CraftId { get; set; } + /// + /// 步骤 + /// + public int Step { get; set; } + /// + /// 功能描述 + /// + [SugarColumn(IsNullable = true)] + public string Description { get; set; } + /// + /// 设备产品功能Id + /// + [SugarColumn(IsNullable = true)] + public string DeviceProductFunctionId { get; set; } + /// + /// 功能参数 + /// + [SugarColumn(IsNullable = true, ColumnDataType= "longtext")] + public string Params { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftsInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftsInfoEntity.cs new file mode 100644 index 0000000..9c7df8b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftsInfoEntity.cs @@ -0,0 +1,25 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :胖子天骄工艺基础信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/14 14:43:37 + /// 描 述 : + /// + [SugarTable("craft_info")] + public class Pztj_CraftsInfoEntity : DEntityBase + { + /// + /// 工艺名称 + /// + public string Name { get; set; } + /// + /// 设备产品Id + /// + public string DeviceProductId { get; set; } + /// + /// 工艺描述 + /// + public string Description { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_DevicesInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_DevicesInfoEntity.cs new file mode 100644 index 0000000..d80f4a1 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_DevicesInfoEntity.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :胖子天骄设备基础表 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/14 11:26:34 + /// 描 述 : + /// + [SugarTable("device_info")] + public class Pztj_DevicesInfoEntity: DEntityBase + { + /// + /// 名称 + /// + [Required(ErrorMessage = "名称不能为空")] + public string Name { get; set; } + /// + /// 编码 + /// + [Required(ErrorMessage = "编码不能为空")] + public string Code { get; set; } + /// + /// 设备类型 + /// + [SugarColumn(IsNullable = true)] + public string DeviceType { get; set; } + /// + /// 设备描述 + /// + [SugarColumn(IsNullable = true)] + public string Describe { get; set; } + /// + /// 设备维保时间 + /// + [SugarColumn(IsNullable = true)] + public string RepairDate { get; set; } + /// + /// 设备创建时间 + /// + [SugarColumn(IsNullable = true)] + public string CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_FinalsInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_FinalsInfoEntity.cs new file mode 100644 index 0000000..bfbc782 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_FinalsInfoEntity.cs @@ -0,0 +1,33 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :胖子天骄成品基础信息管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/14 14:07:56 + /// 描 述 : + /// + [SugarTable("final_info")] + public class Pztj_FinalsInfoEntity : DEntityBase + { + /// + /// 成品编号 + /// + public string Code { get; set; } + /// + /// 成品名称 + /// + public string Name { get; set; } + /// + /// 配方Id + /// + public string RecipeId { get; set; } + /// + /// 工艺Id + /// + public string CraftId { get; set; } + /// + /// 添加时间 + /// + public DateTime? CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineDevicesEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineDevicesEntity.cs new file mode 100644 index 0000000..d93c88b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineDevicesEntity.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :产线设备 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 16:45:05 + /// 描 述 : + /// + [SugarTable("productline_devices")] + public class Pztj_LineDevicesEntity : DEntityBase + { + /// + /// 产线Id + /// + public string LineId { get; set; } + /// + /// 产线设备 + /// + public string DeviceId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineStocksEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineStocksEntity.cs new file mode 100644 index 0000000..ed6f78b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineStocksEntity.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :产线料仓 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/20 16:45:40 + /// 描 述 : + /// + [SugarTable("productline_stocks")] + public class Pztj_LineStocksEntity : DEntityBase + { + /// + /// 产线Id + /// + public string LineId { get; set; } + /// + /// 产线料仓 + /// + public string StockId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_MaterialsInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_MaterialsInfoEntity.cs new file mode 100644 index 0000000..c80edb4 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_MaterialsInfoEntity.cs @@ -0,0 +1,34 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :胖子天骄原料管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/14 11:32:06 + /// 描 述 : + /// + [SugarTable("material_Info")] + public class Pztj_MaterialsInfoEntity : DEntityBase + { + /// + /// 原料名称 + /// + public string Name { get; set; } + /// + /// 原料编号 + /// + public string Code { get; set; } + /// + /// 原料单位 + /// + public string Unit { get; set; } + /// + /// 原料分组 + /// + public string Type { get; set; } + /// + /// 每升重量 + /// + [SugarColumn(IsNullable = true)] + public string WeightPerLiter { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_StockInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_StockInfoEntity.cs new file mode 100644 index 0000000..60338a1 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_StockInfoEntity.cs @@ -0,0 +1,30 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :胖子天骄料仓管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/14 11:31:34 + /// 描 述 : + /// + [SugarTable("stock_info")] + public class Pztj_StockInfoEntity : DEntityBase + { + /// + /// 料仓编码 + /// + public string Code { get; set; } + /// + /// 料仓名称 + /// + public string Name { get; set; } + /// + /// 物料Id + /// + public string MaterialId { get; set; } + /// + /// 料仓容积 + /// + public string Volume { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoEntity.cs new file mode 100644 index 0000000..d43dbd6 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoEntity.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :工单基础信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/18 17:54:43 + /// 描 述 : + /// + [SugarTable("work_info")] + public class Pztj_WorkInfoEntity : DEntityBase + { + /// + /// 工单名称 + /// + [SugarColumn(IsNullable = true)] + public string Name { get; set; } + /// + /// 产线Id + /// + public string LineId { get; set; } + /// + /// 成品Id + /// + public string FinalId { get; set; } + /// + /// 指定设备Id + /// + [SugarColumn(IsNullable = true)] + public string DeviceId { get; set; } + /// + /// 产量 + /// + public string Number { get;set; } + /// + /// 批次号 + /// + public string BatchId { get; set; } + /// + /// 工单当前状态 + /// + [SugarColumn(IsNullable = true)] + public WorkOrderStatusEnum? Status { get; set; } + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoItemEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoItemEntity.cs new file mode 100644 index 0000000..eceb6c2 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoItemEntity.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :工单拆分 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/18 18:12:55 + /// 描 述 : + /// + [SugarTable("work_info_item")] + public class Pztj_WorkInfoItemEntity : DEntityBase + { + /// + /// 工单名称 + /// + public string Name { get; set; } + /// + /// 产量 + /// + public string Number { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoStatusEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoStatusEntity.cs new file mode 100644 index 0000000..ab8d0ff --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoStatusEntity.cs @@ -0,0 +1,33 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :工单状态 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/18 18:07:21 + /// 描 述 : + /// + [SugarTable("work_info_status")] + public class Pztj_WorkInfoStatusEntity : DEntityBase + { + /// + /// 工单Id + /// + [SugarColumn(IsNullable = true)] + public string WorkId { get; set; } + /// + /// 工单状态 + /// + [SugarColumn(IsNullable = true)] + public WorkOrderStatusEnum? Status { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime CreateTime { get; set; } + /// + /// 备注 + /// + [SugarColumn(IsNullable = true)] + public string Remark { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/WorkBatchEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/WorkBatchEntity.cs new file mode 100644 index 0000000..7e31bd5 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/WorkBatchEntity.cs @@ -0,0 +1,26 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 18:22:42 + /// 描 述 : + /// + [SugarTable("work_batch")] + public class WorkBatchEntity : DEntityBase + { + /// + /// 批次名词 + /// + public string Name { get; set; } + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + /// + /// 状态 + /// + public WorkOrderStatusEnum? Status { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/WorkInfoCraftstepRecordEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/WorkInfoCraftstepRecordEntity.cs new file mode 100644 index 0000000..41b2192 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/WorkInfoCraftstepRecordEntity.cs @@ -0,0 +1,67 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/10 10:03:15 + /// 描 述 : + /// + [SugarTable("work_info_craftstep_record")] + public class WorkInfoCraftstepRecordEntity : DEntityBase + { + /// + /// 工单Id + /// + public string WorkId { get; set; } + /// + /// 工艺Id + /// + public string CraftId { get; set; } + /// + /// 工艺名称 + /// + public string CraftName { get; set; } + /// + /// 工艺步骤Id + /// + public string CraftstepId { get; set; } + /// + /// 步骤 + /// + public int Step { get; set; } + /// + /// 工艺步骤名称 + /// + [SugarColumn(IsNullable = true)] + public string CraftstepName { get; set; } + /// + /// 工艺参数 + /// + [SugarColumn(IsNullable = true)] + public string CraftstepParms { get; set; } + /// + /// 设备类型功能Id + /// + [SugarColumn(IsNullable = true)] + public string DeviceProductFunctionId { get; set; } + /// + /// 设备类型功能名称 + /// + [SugarColumn(IsNullable = true)] + public string DeviceProductFunctionName { get; set; } + /// + /// 执行状态 + /// + [SugarColumn(IsNullable = true)] + public RecipeStatus Status { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime? UpdateTime{ get;set;} + /// + /// 第几锅 + /// + public string PotNum { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/App/WorkInfoMaterialsRecordEntity.cs b/backend/BPA.MES.Base.Application/Entitys/App/WorkInfoMaterialsRecordEntity.cs new file mode 100644 index 0000000..b94c2a0 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/App/WorkInfoMaterialsRecordEntity.cs @@ -0,0 +1,63 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 18:22:42 + /// 描 述 : + /// + [SugarTable("work_info_materials_record")] + public class WorkInfoMaterialsRecordEntity : DEntityBase + { + /// + /// 物料名称 + /// + [SugarColumn(IsNullable = true)] + public string MaterialName { get; set; } + /// + /// 物料id + /// + [SugarColumn(IsNullable = true)] + public string MaterialId { get; set; } + /// + /// 工单id + /// + [SugarColumn(IsNullable = true)] + public string WorkId { get; set; } + /// + /// 重量 + /// + [SugarColumn(IsNullable = true)] + public string Weight { get; set; } + /// + /// 第几锅 + /// + [SugarColumn(IsNullable = true)] + public string PotNum { get; set; } + /// + /// 配方Id + /// + [SugarColumn(IsNullable = true)] + public string RecipeId { get; set; } + /// + /// 配方名称 + /// + [SugarColumn(IsNullable = true)] + public string RecipeName { get; set; } + /// + /// 物料状态 + /// + [SugarColumn(IsNullable = true)] + public EBatchingStatus MaterialStatus { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime? UpdateTime { get; set; } + /// + /// 误差 + /// + [SugarColumn(IsNullable = true)] + public string ErrorWeight { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductEntity.cs new file mode 100644 index 0000000..62ce072 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductEntity.cs @@ -0,0 +1,26 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :设备产品 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/1 16:34:53 + /// 描 述 : + /// + [SugarTable("devices_product")] + public class DeviceProductEntity : DEntityBase + { + /// + /// 设备产品名称 + /// + public string Name { get; set; } + /// + /// 设备产品编码 + /// + public string Code { get; set; } + /// + /// 设备产品描述 + /// + [SugarColumn(IsNullable = true)] + public string Description { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductFunctionEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductFunctionEntity.cs new file mode 100644 index 0000000..aaa58d6 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductFunctionEntity.cs @@ -0,0 +1,38 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :设备功能 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/2 16:03:10 + /// 描 述 : + /// + [SugarTable("devices_product_function")] + public class DeviceProductFunctionEntity : DEntityBase + { + /// + /// 设备产品Id + /// + [SugarColumn(IsNullable = true)] + public string DeviceProductId { get; set; } + /// + /// 功能名称 + /// + [SugarColumn(IsNullable = true)] + public string Name { get; set; } + /// + /// 功能编码 + /// + [SugarColumn(IsNullable = true)] + public string Code { get; set; } + /// + /// 描述 + /// + [SugarColumn(IsNullable = true)] + public string Description { get; set; } + /// + /// 方法参数 + /// + [SugarColumn(IsNullable = true, ColumnDataType = "longtext")] + public string Params { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductParmEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductParmEntity.cs new file mode 100644 index 0000000..dd527fd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceProductParmEntity.cs @@ -0,0 +1,30 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :设备属性 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 15:06:00 + /// 描 述 : + /// + [SugarTable("devices_product_parm")] + public class DeviceProductParmEntity : DEntityBase + { + /// + /// 设备产品Id + /// + public string DeviceProductId { get; set; } + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 描述 + /// + [SugarColumn(IsNullable = true)] + public string Description { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/DeviceRecipeEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceRecipeEntity.cs new file mode 100644 index 0000000..a7d7750 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/DeviceRecipeEntity.cs @@ -0,0 +1,22 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :设备配方表 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 13:57:00 + /// 描 述 : + /// + [SugarTable("devices_recipes")] + public class DeviceRecipeEntity : DEntityBase + { + /// + /// 设备Id + /// + public string DeviceId { get; set; } + /// + /// 配方Id + /// + public string RecipesId { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/DictDataEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/DictDataEntity.cs new file mode 100644 index 0000000..0c2a890 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/DictDataEntity.cs @@ -0,0 +1,33 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :码表数据 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 9:47:53 + /// 描 述 : + /// + [SugarTable("dict_data")] + public class DictDataEntity : DEntityBase + { + /// + /// 类型id + /// + public string TypeId { get; set; } + /// + /// 值 + /// + public string Value { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } + /// + /// 添加时间 + /// + public DateTime CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/DictTypeEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/DictTypeEntity.cs new file mode 100644 index 0000000..7feed45 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/DictTypeEntity.cs @@ -0,0 +1,26 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :数据码表 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 9:48:05 + /// 描 述 : + /// + [SugarTable("dict_type")] + public class DictTypeEntity : DEntityBase + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/GroupInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/GroupInfoEntity.cs new file mode 100644 index 0000000..2bbf3b3 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/GroupInfoEntity.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :分组信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/10 14:01:15 + /// 描 述 : + /// + [SugarTable("group_info")] + public class GroupInfoEntity: DEntityBase + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 介绍 + /// + public string Des { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/MQTTInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/MQTTInfoEntity.cs new file mode 100644 index 0000000..c7ed338 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/MQTTInfoEntity.cs @@ -0,0 +1,29 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/24 17:28:56 + /// 描 述 : + /// + [SugarTable("mqtt")] + public class MQTTInfoEntity + { + /// + /// 地址 + /// + public string Address { get; set; } + /// + /// 密码 + /// + public string Pwd { get; set; } + /// + /// 账号 + /// + public string Account { get; set; } + /// + /// 消息发布路由 4.0和5.0不一样 + /// + public string MsgPublishRoute { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/OperLogEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/OperLogEntity.cs new file mode 100644 index 0000000..0eca510 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/OperLogEntity.cs @@ -0,0 +1,31 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :操作日志 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/20 15:10:59 + /// 描 述 : + /// + [SugarTable("oper_log")] + public class OperLogEntity : DEntityBase + { + /// + /// 操作标题 + /// + public string Name { get; set; } + /// + /// 内容 + /// + public string Context { get; set; } + /// + /// 返回值 + /// + [SugarColumn(IsNullable = true)] + public string Result { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime? CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/OrderInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/OrderInfoEntity.cs new file mode 100644 index 0000000..20e31fa --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/OrderInfoEntity.cs @@ -0,0 +1,13 @@ +namespace BPA.MES.Base.Application.Entitys.Base +{ + /// + /// 名 称 :订单服务 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/18 18:11:48 + /// 描 述 : + /// + public class OrderInfoEntity + { + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/ProductLineEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/ProductLineEntity.cs new file mode 100644 index 0000000..366b19f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/ProductLineEntity.cs @@ -0,0 +1,25 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :产线管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/18 10:42:35 + /// 描 述 : + /// + [SugarTable("product_line")] + public class ProductLineEntity : DEntityBase + { + /// + /// 产线名称 + /// + public string Name { get; set; } + /// + /// 产线编码 + /// + public string Code { get; set; } + /// + /// 产线描述 + /// + public string Describe { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/RecipeMaterialEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/RecipeMaterialEntity.cs new file mode 100644 index 0000000..9f1512c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/RecipeMaterialEntity.cs @@ -0,0 +1,36 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :配方物料信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 13:58:19 + /// 描 述 : + /// + [SugarTable("recipes_material")] + public class RecipeMaterialEntity : DEntityBase + { + /// + /// 物料Id + /// + public string MaterialId { get; set; } + /// + /// 配方Id + /// + public string RecipesId { get; set; } + /// + /// 重量 + /// + [SugarColumn(IsNullable = true)] + public string Weight { get; set; } + /// + /// 描述 + /// + [SugarColumn(IsNullable = true)] + public string Describe { get; set; } + /// + /// 误差 + /// + [SugarColumn(IsNullable = true)] + public string ErrorWeight { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/RecipesGroupEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/RecipesGroupEntity.cs new file mode 100644 index 0000000..1518fdd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/RecipesGroupEntity.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :配方分组 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/10 14:56:03 + /// 描 述 : + /// + [SugarTable("recipes_group")] + public class RecipesGroupEntity + { + /// + /// 组Id + /// + public string GroupId { get; set; } + /// + /// 产品Id + /// + public string RecipesId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/RecipesInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/RecipesInfoEntity.cs new file mode 100644 index 0000000..b9b63f6 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/RecipesInfoEntity.cs @@ -0,0 +1,22 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :配方信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 13:57:15 + /// 描 述 : + /// + [SugarTable("recipes_info")] + public class RecipesInfoEntity : DEntityBase + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 自定义编码 + /// + public string Code { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Base/StoreInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Base/StoreInfoEntity.cs new file mode 100644 index 0000000..6a5c6ef --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Base/StoreInfoEntity.cs @@ -0,0 +1,30 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :店铺信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 13:52:13 + /// 描 述 : + /// + [SugarTable("store_info")] + public class StoreInfoEntity : DEntityBase + { + /// + /// 名称 + /// + [Required(ErrorMessage = "名称不能为空")] + public string Name { get; set; } + /// + /// 地址 + /// + public string Address { get; set; } + /// + /// 联系电话 + /// + public string Phone { get; set; } + /// + /// 负责人 + /// + public string Directors { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/KepData/AlarmLog.cs b/backend/BPA.MES.Base.Application/Entitys/KepData/AlarmLog.cs new file mode 100644 index 0000000..a8da614 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/KepData/AlarmLog.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Entitys.KepData +{ + [SugarTable("DataVAlarmLog")] + public class AlarmLog: DEntityBase + { + public string Name { get; set; } + + /// + /// 当前值 + /// + public string Value { get; set; } + + /// + /// 报警信息 + /// + public string ValueStr{ get; set; } + + + public DateTime CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/KepData/DataVAlarmLimit.cs b/backend/BPA.MES.Base.Application/Entitys/KepData/DataVAlarmLimit.cs new file mode 100644 index 0000000..97ce0cd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/KepData/DataVAlarmLimit.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Entitys.KepData +{ + /// + /// 大屏报警限制 + /// + [SugarTable("DataVAlarmLimit")] + public class DataVAlarmLimit: DEntityBase + { + /// + /// 限制名称 + /// + public string Name { get; set; } + + public string Code { get; set; } + + /// + /// 最小限制值 + /// + public decimal MinLimitValue { get; set; } + + /// + /// 最大限制值 + /// + public decimal MaxLimitValue { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/KepData/ch1_device1.cs b/backend/BPA.MES.Base.Application/Entitys/KepData/ch1_device1.cs new file mode 100644 index 0000000..7459fe0 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/KepData/ch1_device1.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Entitys.KepData +{ + // [SugarTable("ch1_device1")] + public class ch1_device1 + { + [SugarColumn(IsPrimaryKey = true)] + public int id { get; set; } + public string _NAME { get; set; } + public int _NUMERICID { get; set; } + public string _VALUE { get; set; } + public DateTime _TIMESTAMP { get; set; } + public int _QUALITY { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Logs/AlarmLogEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Logs/AlarmLogEntity.cs new file mode 100644 index 0000000..eb9a200 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Logs/AlarmLogEntity.cs @@ -0,0 +1,54 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :报警日志 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:17:57 + /// 描 述 : + /// + [SugarTable("alarm")] + public class AlarmLogEntity : DEntityBase + { + /// + /// 报警信息 + /// + [SugarColumn(IsNullable = true)] + public string MsgInfo { get; set; } + /// + /// 报警值 + /// + [SugarColumn(IsNullable = true)] + public string Value { get; set; } + /// + /// 报警等级 + /// + [SugarColumn(IsNullable = true)] + public string Grade { get; set; } + /// + /// 设备名称 + /// + [SugarColumn(IsNullable = true)] + public string DeviceName { get; set; } + /// + /// 日期 + /// + [SugarColumn(IsNullable = true)] + public string Date { get; set; } + /// + /// 时间 + /// + [SugarColumn(IsNullable = true)] + public string Time { get; set; } + /// + /// 创建时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime CreateDate { get; set; } + /// + /// 类型 + /// + [SugarColumn(IsNullable = true)] + public string LogType { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Logs/ProgramLogEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Logs/ProgramLogEntity.cs new file mode 100644 index 0000000..c117ec6 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Logs/ProgramLogEntity.cs @@ -0,0 +1,39 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :程序日志 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:18:13 + /// 描 述 : + /// + [SugarTable("programlog")] + public class ProgramLogEntity : DEntityBase + { + /// + /// 日志类型 + /// + [SugarColumn(IsNullable = true, ColumnDataType = "varchar",Length = 200)] + public string LogType { get; set; } + /// + /// 日志消息 + /// + [SugarColumn(IsNullable = true, ColumnDataType = "longtext")] + public string MsgInfo { get; set; } + /// + /// 日期 + /// + [SugarColumn(IsNullable = true)] + public string Date { get; set; } + /// + /// 时间 + /// + [SugarColumn(IsNullable = true)] + public string Time { get; set; } + /// + /// 日志消息 + /// + [SugarColumn(IsNullable = true)] + public DateTime CreateDate { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Logs/RunLogEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Logs/RunLogEntity.cs new file mode 100644 index 0000000..9317b17 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Logs/RunLogEntity.cs @@ -0,0 +1,45 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :运行日志 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:18:34 + /// 描 述 : + /// + [SplitTable(SplitType.Month)] + //[SugarTable("runlog_{year}{month}{day}")] + [SugarTable("runlog")] + public class RunLogEntity : DEntityBase + { + /// + /// 日志类别 + /// + [SugarColumn(IsNullable = true)] + public string LogType { get; set; } + /// + /// 日志消息 + /// + [SugarColumn(IsNullable = true, ColumnDataType = "longtext")] + public string MsgInfo { get; set; } + /// + /// 日期 + /// + [SugarColumn(IsNullable = true)] + public string Date { get; set; } + /// + /// 时间 + /// + [SugarColumn(IsNullable = true)] + public string Time { get; set; } + /// + /// 日志消息 + /// + [SugarColumn(IsNullable = true),SplitField] + public DateTime CreateDate { get; set; } + /// + /// 更新时间 + /// + [SugarColumn(IsNullable = true)]//设置为可空字段 + public DateTime UpdateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Logs/UserLogEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Logs/UserLogEntity.cs new file mode 100644 index 0000000..06f9db3 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Logs/UserLogEntity.cs @@ -0,0 +1,36 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :用户日志 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:18:50 + /// 描 述 : + /// + [SugarTable("user_log")] + public class UserLogEntity : DEntityBase + { + /// + /// 权限 + /// + [SugarColumn(IsNullable = true)] + public string Permission { get; set; } + + /// + /// 用户名 + /// + [SugarColumn(IsNullable = true)] + public string UserName { get; set; } + + /// + /// 日志消息 + /// + [SugarColumn(IsNullable = true)] + public string MsgInfo { get; set; } + + /// + /// 日志时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime CreateDate { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Order/OrderEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Order/OrderEntity.cs new file mode 100644 index 0000000..4fee717 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Order/OrderEntity.cs @@ -0,0 +1,24 @@ +using BPA.MES.Base.Application.Const; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Entitys.Order +{ + + [SugarTable("order")] + public class OrderEntity: DEntityBase + { + + /// + /// 状态 + /// + public OrderStatusEnum Status { get; set; } + + + + public DateTime CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Order/OrderInfoEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Order/OrderInfoEntity.cs new file mode 100644 index 0000000..a3b0f39 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Order/OrderInfoEntity.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Entitys.Order +{ + + [SugarTable("order_info")] + public class OrderInfoEntity : DEntityBase + { + /// + /// 订单ID + /// + public string OrderId { get; set; } + + /// + /// 成品Id + /// + public string FinalslId { get; set; } + + /// + /// 数量 + /// + public decimal Number { get; set; } + + public DateTime CreateTime { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Order/OrderWorkEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Order/OrderWorkEntity.cs new file mode 100644 index 0000000..c4e0537 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Order/OrderWorkEntity.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Entitys.Order +{ + /// + /// 订单关联工单 + /// + [SugarTable("order_work")] + public class OrderWorkEntity: DEntityBase + { + public string OrderId { get; set; } + public string WorkId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Sys/AccountEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Sys/AccountEntity.cs new file mode 100644 index 0000000..8c0955b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Sys/AccountEntity.cs @@ -0,0 +1,29 @@ + +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :账户信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/3 10:18:43 + /// 描 述 : + /// + [SugarTable("sys_account")] + public class AccountEntity : DEntityBase + { + /// + /// 账号 + /// + [SugarColumn(IsNullable = false)] + public string Account { get; set; } + /// + /// 密码 + /// + [SugarColumn(IsNullable = false)] + public string Pwd { get; set; } + /// + /// 员工表Id + /// + [SugarColumn(IsNullable = false)] + public string EmployeeId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Sys/EmployeeEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Sys/EmployeeEntity.cs new file mode 100644 index 0000000..66b70f5 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Sys/EmployeeEntity.cs @@ -0,0 +1,38 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :员工信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 17:44:31 + /// 描 述 : + /// + [SugarTable("sys_employee")] + public class EmployeeEntity : DEntityBase + { + /// + /// 员工姓名 + /// + [SugarColumn(IsNullable = false)] + public string Name { get; set; } + /// + /// 1男2女 + /// + [SugarColumn(IsNullable = true)] + public int Gender { get; set; } + /// + /// 1启用 2禁用 + /// + [SugarColumn(IsNullable = false)] + public int Status { get; set; } + /// + /// 超管 + /// + [SugarColumn(IsNullable = false)] + public bool IsAdmin { get; set; } + /// + /// 角色Id + /// + public string RoleId { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Sys/ModuleEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Sys/ModuleEntity.cs new file mode 100644 index 0000000..b9ef298 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Sys/ModuleEntity.cs @@ -0,0 +1,46 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :模块菜单表 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 17:32:15 + /// 描 述 : + /// + [SugarTable("sys_module")] + public class ModuleEntity : DEntityBase + { + /// + /// 类别 1:菜单,2:视图,3:功能 + /// + public int Category { get; set; } + + /// + /// 菜单打开方式 0:框架内嵌,1:新开页面 + /// + public int OpenType { get; set; } + + /// + /// 父级编号 + /// + public string ParentId { get; set; } + + /// + /// 名称 + /// + public string Name { set; get; } + + /// + /// 图标 + /// + public string Icon { set; get; } + + /// + /// 地址 + /// + public string Url { set; get; } + /// + /// 状态 + /// + public bool IsDisabled { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Sys/RoleEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Sys/RoleEntity.cs new file mode 100644 index 0000000..43522ff --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Sys/RoleEntity.cs @@ -0,0 +1,32 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :角色信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 17:32:32 + /// 描 述 : + /// + [SugarTable("sys_role")] + public class RoleEntity : DEntityBase + { + /// + /// 角色名称 + /// + public string Name { get; set; } + + /// + /// 角色类型 1超级管理员,2其他 + /// + public int? RoleType { get; set; } + + /// + /// 角色描述 + /// + public string Description { get; set; } + + /// + /// 是否删除 + /// + public bool IsDeleted { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Entitys/Sys/RoleModuleEntity.cs b/backend/BPA.MES.Base.Application/Entitys/Sys/RoleModuleEntity.cs new file mode 100644 index 0000000..bec361f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Entitys/Sys/RoleModuleEntity.cs @@ -0,0 +1,26 @@ +namespace BPA.MES.Base.Application.Entitys +{ + /// + /// 名 称 :角色权限表 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/31 15:56:02 + /// 描 述 : + /// + [SugarTable("sys_role_module")] + public class RoleModuleEntity : DEntityBase + { + /// + /// 角色Id + /// + public string RoleId { get; set; } + /// + /// 模块Id + /// + public string ModuleId { get; set; } + /// + /// 父级模块 + /// + [SugarColumn(IsNullable =true)] + public string ParentId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Filters/AGVAttribute.cs b/backend/BPA.MES.Base.Application/Filters/AGVAttribute.cs new file mode 100644 index 0000000..dfdff3e --- /dev/null +++ b/backend/BPA.MES.Base.Application/Filters/AGVAttribute.cs @@ -0,0 +1,39 @@ +using BPA.MES.Base.Application.Services; +using BPA.MES.Base.Application.Services.AGVService.Dtos; +using Furion.JsonSerialization; +using Microsoft.AspNetCore.Mvc.Filters; +using System.Diagnostics; + +namespace BPA.MES.Base.Application +{ + public class AGVAttribute : ActionFilterAttribute + { + /// + /// 执行操作前后 + /// + /// + /// + /// + public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) + { + // 获取 HttpContext 和 HttpRequest 对象 + var httpContext = context.HttpContext; + var httpRequest = httpContext.Request; + var sw = new Stopwatch(); + sw.Start(); + var actionContext = await next(); + sw.Stop(); + var server = App.GetService(); + var contentstring = JSON.Serialize(context.ActionArguments["input"]); + AGVLoadAndUnloadRequest input = JSON.Deserialize(contentstring); + Roller_JobRequest roller_Job = new() + { + AgvCode = input.Body.Event.agvCode, + Complete = true, + JobId = input.Body.Event.jobId, + MsgId = input.Body.Event.msgId + }; + await server.RollerJobExecute(roller_Job); + } + } +} diff --git a/backend/BPA.MES.Base.Application/Filters/OperLogAttribute.cs b/backend/BPA.MES.Base.Application/Filters/OperLogAttribute.cs new file mode 100644 index 0000000..779615b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Filters/OperLogAttribute.cs @@ -0,0 +1,46 @@ +using Furion.EventBus; +using Furion.JsonSerialization; +using Microsoft.AspNetCore.Mvc.Filters; +using System.Diagnostics; +using System.Security.Claims; + +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :接口AOP + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 15:04:06 + /// 描 述 : + /// + public class OperLogAttribute : ActionFilterAttribute + { + public string _name; + public OperLogAttribute(string name) + { + _name = name; + } + /// + /// 执行操作前后 + /// + /// + /// + /// + public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) + { + // 获取 HttpContext 和 HttpRequest 对象 + var httpContext = context.HttpContext; + var httpRequest = httpContext.Request; + var sw = new Stopwatch(); + sw.Start(); + var actionContext = await next(); + sw.Stop(); + var userName = httpContext.User?.FindFirstValue(ClaimConst.CLAINM_NAME); + await MessageCenter.PublishAsync("ToDo:OperLog", new OperLogEntity() + { + Context = context.ActionArguments.Count < 1 ? string.Empty : JSON.Serialize(context.ActionArguments), + Name = $"[{userName}]{_name}", + Result = actionContext.Exception == null? "true" : EnhancedStackTrace.Current().ToString() + }); + } + } +} diff --git a/backend/BPA.MES.Base.Application/GlobalUsings.cs b/backend/BPA.MES.Base.Application/GlobalUsings.cs new file mode 100644 index 0000000..d3511cb --- /dev/null +++ b/backend/BPA.MES.Base.Application/GlobalUsings.cs @@ -0,0 +1,19 @@ +global using Furion; +global using Furion.DataEncryption; +global using Furion.DataValidation; +global using Furion.DependencyInjection; +global using Furion.DynamicApiController; +global using Furion.Extensions; +global using Furion.FriendlyException; +global using Furion.Logging; +global using Mapster; +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; +global using Microsoft.CodeAnalysis; +global using BPA.MES.Base.Core; +global using static BPA.MES.Base.Core.TreeExtensions; +global using System.ComponentModel.DataAnnotations; +global using BPA.MES.Base.Application.Entitys; +global using Furion.DataEncryption.Extensions; +global using SqlSugar; \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/MQTT/IMessage.cs b/backend/BPA.MES.Base.Application/MQTT/IMessage.cs new file mode 100644 index 0000000..f8f5d28 --- /dev/null +++ b/backend/BPA.MES.Base.Application/MQTT/IMessage.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :MQTT消息基类 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/21 10:24:24 + /// 描 述 : + /// + public interface IMessage + { + /// + /// 消息ID + /// + public int MessageId { get; set; } + + /// + /// 消息版本 + /// + public Version MsgVersion { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/MQTT/MQTTService.cs b/backend/BPA.MES.Base.Application/MQTT/MQTTService.cs new file mode 100644 index 0000000..0f8776b --- /dev/null +++ b/backend/BPA.MES.Base.Application/MQTT/MQTTService.cs @@ -0,0 +1,145 @@ +using Furion.JsonSerialization; +using Furion.RemoteRequest.Extensions; +using Newtonsoft.Json; +using System.Text; + +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :MQTT通信库 + /// 创 建 人 :yangxiao + /// 创建时间 : 2022/11/18 15:38:40 + /// 描 述 : + /// + public class MQTTService : IMQTTService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + ISysCacheService _sysCacheService; + public MQTTService(ISqlSugarClient db, ISysCacheService sysCacheService) + { + _dbContext = db; + _sysCacheService = sysCacheService; + } + public async Task GetMQTTConfig() + { + var entity = await _dbContext.Queryable().FirstAsync(); + if (entity != null) + { + MQTTConfig.Address = entity.Address; + MQTTConfig.Account = entity.Account; + MQTTConfig.Pwd = entity.Pwd; + await _sysCacheService.SetAsync("mqtt", entity); + } + } + /// + /// Mqtt通用服务 + /// + public async Task MqttPublish(MqttPublishDto input) + { + bool result = false; + MQTTInfoEntity mqttentity = new(); + mqttentity = await _sysCacheService.GetAsync("mqtt"); + if (mqttentity==null) + { + mqttentity = await _dbContext.Queryable().FirstAsync(); + await _sysCacheService.SetAsync("mqtt", mqttentity); + } + try + { + input.Payload.MessageId = input.MessageId; + input.Payload.MsgVersion = new Version(1, 0, 0, 0); + MsgPackage mp = new() + { + Message = input.Payload, + MessageLen = JSON.Serialize(input.Payload).Length + }; + //组装MQTT消息 + var tem = await $"http://{mqttentity.Address}{mqttentity.MsgPublishRoute}".SetHeaders(new + { + Authorization = "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{mqttentity.Account}:{mqttentity.Pwd}")) + }).SetBody(new + { + input.Topic, + payload = JsonConvert.SerializeObject(mp), + qos = 2, + retain = false, + clientid = "pztj_service" + }).PostAsStringAsync(); + var res = JSON.Deserialize(tem); + if (res.Code == 0 || res.Reason_code<100 || !string.IsNullOrEmpty(res.Id)) + { + result = true; + } + Console.WriteLine($"_____________________MQTT发消息:{JsonConvert.SerializeObject(mp)}"); + } + catch + { + + } + + return result; + } + [AllowAnonymous] + public async Task MqttTestPublish(string topic, string msg) + { + bool result = false; + var mqttentity = await _dbContext.Queryable().FirstAsync(); + string mqttAddress = mqttentity.Address; + try + { + //组装MQTT消息 + var tem = await $"http://{mqttAddress}/api/v5/publish".SetHeaders(new + { + Authorization = "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{mqttentity.Account}:{mqttentity.Pwd}")) + }).SetBody(new + { + topic, + payload = msg, + qos = 2, + retain = false, + clientid = "pztj_service" + }).PostAsStringAsync(); + var res = JSON.Deserialize(tem); + if (res.Code == 0 || res.Reason_code < 100 || !string.IsNullOrEmpty(res.Id)) + { + result = true; + } + } + catch + { + + } + return result; + } + + } + + public class MqttResult + { + /// + /// code + /// + public int Code { get; set; } + /// + /// reason_code + /// + public int Reason_code { get; set; } + /// + /// + /// + public string Id { get; set; } + } + + public class MqttPublishDto + { + public IMessage Payload { get; set; } + public string Topic { get; set; } + public int MessageId { get; set; } + } + public interface IMQTTService + { + Task MqttPublish(MqttPublishDto input); + + Task GetMQTTConfig(); + } +} diff --git a/backend/BPA.MES.Base.Application/MQTT/MessageID.cs b/backend/BPA.MES.Base.Application/MQTT/MessageID.cs new file mode 100644 index 0000000..e96980f --- /dev/null +++ b/backend/BPA.MES.Base.Application/MQTT/MessageID.cs @@ -0,0 +1,14 @@ +namespace BPA.MES.Base.Application +{ + public class MessageID + { + public const int DevcieControl = 1;//设备控制ID + public const int WorkOrderIssued = 2;//工单下发ID + public const int DeviceData = 3;//设备上报数据 + public const int TaskState = 4;//AGV任务状态上报 + public const int LoadAndUnload = 8;//AGV上下料上报 + public const int PowerId = 12;// 权限验证 + public const int StateChange = 13;//状态改变 + } +} + diff --git a/backend/BPA.MES.Base.Application/MQTT/MsgPackage.cs b/backend/BPA.MES.Base.Application/MQTT/MsgPackage.cs new file mode 100644 index 0000000..ed8e173 --- /dev/null +++ b/backend/BPA.MES.Base.Application/MQTT/MsgPackage.cs @@ -0,0 +1,18 @@ +using Newtonsoft.Json; + +namespace BPA.MES.Base.Application +{ + public class MsgPackage + { + /// + /// 消息内容 + /// + [JsonProperty(TypeNameHandling = TypeNameHandling.Auto)] + public IMessage Message { get; set; } + /// + /// 消息长度 + /// + public int MessageLen { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/MQTT/Topics.cs b/backend/BPA.MES.Base.Application/MQTT/Topics.cs new file mode 100644 index 0000000..5144bdc --- /dev/null +++ b/backend/BPA.MES.Base.Application/MQTT/Topics.cs @@ -0,0 +1,42 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2022/11/18 15:37:07 + /// 描 述 : + /// + public class Topics + { + /// + /// 设备控制主题,前端通过消息控制设备动作(客户端/前端 --> 设备) + /// + public const string DeviceControl = "BPAProline/Client/Device/Control"; + + /// + /// 工单推送主题,中控将创建的工单推送到对应的产线 (中控系统 --> 产线) + /// + public const string WorkOrderPush = "BPAPROLINE/MES/SERVER/WORKORDER/DOWN"; + + /// + /// 前端展示数据推送,数据服务将设备数据推送到前端界面展示 (数据中心服务 --> 客户端/前端) + /// + public const string DeviceDataPush = "BPAProline/DataServer/Client/Data"; + /// + /// 工单状态(信息系统 --> 中控系统) + /// + public const string STWorkState = "BPAProline/CentralControl/Proline/WorkState"; + + /// + /// 任务下发成功 回调 + /// + public const string ExecuteReplyTopic = "robotjob.report"; + + /// + /// 上下料回调 + /// + public const string LoadAndUnloadTopic = "rollerjob.upstreamrequest"; + + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AGVThirdPartyDto.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AGVThirdPartyDto.cs new file mode 100644 index 0000000..3ed7710 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AGVThirdPartyDto.cs @@ -0,0 +1,473 @@ +using BPA.AGV; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.AGVService.Dtos +{ + + public class Roller_JobRequest + { + public string Url { get; set; } + + [Required(ErrorMessage = "[{0}]不能为空")] + [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")] + public string AgvCode { get; set; } + + [Required(ErrorMessage = "[{0}]不能为空")] + [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")] + public string JobId { get; set; } + + [Required(ErrorMessage = "[{0}]不能为空")] + [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")] + public string MsgId { get; set; } + + public bool? Complete { get; set; } + } + + public class AGVExecuteReplyRequest + { + public AgvHeader Header { get; set; } + public AgvReplyBody Body { get; set; } + } + + public class AgvReplyBody + { + public AGVExecuteReplyDto Event { get; set; } + } + + + public class AGVExecuteReplyMQTT: IMessage + { + public AGVExecuteReplyDto Event { get; set; } + public int MessageId { get; set; } + public Version MsgVersion { get; set; } + } + + public class AGVLoadAndUnloadRequest + { + public AgvHeader Header { get; set; } + public AGVLoadAndUnloadBody Body { get; set; } + } + + public class AGVLoadAndUnloadBody + { + public AGVLoadAndUnloadDto Event { get; set; } + } + + public class AGVLoadAndUnloadMQTT : IMessage + { + public AGVLoadAndUnloadDto Event { get; set; } + public int MessageId { get; set; } + public Version MsgVersion { get; set; } + } + + public class AgvBody + { + public AgvHeader Header { get; set; } + public AgvRetrun Body { get; set; } + } + public class AgvHeader + { + public string RequestId { get; set; } + public string Timestamp { get; set; } + public string Version { get; set; } + } + public class AgvRetrun + { + public string Code { get; set; } + + public bool Success { get; set; } + + public string Message { get; set; } + + public object? Data { get; set; } + } + + /// + /// 任务完成回报Dto + /// + public class AGVExecuteReplyDto + { + /// + /// 上游系统任务号,全局唯一 + /// + public string robotJobId { get; set; } + + /// + /// 仓库编号 + /// + public long warehouseId { get; set; } + + /// + /// 任务快仓系统编号 + /// + public string jobId { get; set; } + + /// + /// 任务状态 + /// + public string state { get; set; } + + /// + /// 内部任务类型 + /// + public string jobType { get; set; } + + /// + /// 数据字段 + /// + public PointToPoint jobData { get; set; } + + } + + /// + /// 上下料交互请求DTO + /// + public class AGVLoadAndUnloadDto + { + /// + /// AGV编号 + /// + public string agvCode { get; set; } + + /// + /// 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔 + /// + public string containerCode { get; set; } + + /// + /// 上游设备ID + /// + public long equipmentId { get; set; } + + /// + /// 上游设备ID,多个用英文逗号分隔 + /// + public string equipmentIds { get; set; } + + /// + /// 快仓任务编号 + /// + public string jobId { get; set; } + + /// + /// 消息ID + /// + public string msgId { get; set; } + + /// + /// 交互阶段LOAD:上料阶段 UNLOAD:下料阶段 + /// + public string command { get; set; } + + /// + /// 上游任务号 + /// + public string robotJobId { get; set; } + + } + + + /// + /// 货到货 + /// + public class GoodsToGoods + { + /// + /// AGV编号 + /// + public string agvCode { get; set; } + + /// + /// 容器编号 + /// + public string containerCode { get; set; } + + /// + /// 上料点位 + /// + public string startPointCode { get; set; } + + /// + /// 上料货位编号 + /// + public string startSlotCode { get; set; } + + /// + /// 下料点位 + /// + public string targetPointCode { get; set; } + + /// + /// 下料货位编号 + /// + public string targetSlotCode { get; set; } + + /// + /// 是否需要上料交互 + /// + public bool loadInteractive { get; set; } + } + + /// + /// 点到点 + /// + public class PointToPoint + { + /// + /// AGV编号 + /// + public string agvCode { get; set; } + + /// + /// 容器编号 + /// + public string containerCode { get; set; } + + /// + /// 上料点位 + /// + public string startPointCode { get; set; } + + /// + /// 下料点位 + /// + public string targetPointCode { get; set; } + + /// + /// 是否需要上料交互 + /// + public bool loadInteractive { get; set; } + } + + public enum AGVState + { + + //任务状态: + //1)货架/货位/点到点货架搬运任务枚举: + //LIFT_UP_DONE:顶升完成 + //MOVE_BEGIN:开始移动 + //PUT_DOWN_DONE:放下完成 + //DONE:任务完成 + //CANCEL:任务取消 + //ABNORMAL_CANCEL:任务异常取消 + //ABNORMAL_COMPLETED:任务异常完成 + //2)货位到货位/点到点辊筒料箱搬运任务枚举: + //ROLLER_LOAD_DOING:正在上料 + //ROLLER_LOAD_FINISH:上料完成 + //ROLLER_UNLOAD_DOING:正在下料 + //DONE:下料完成 + //ABNORMAL_CANCEL:任务异常取消 + //ABNORMAL_COMPLETED:任务异常完成 + //3)AGV移动任务枚举: + //DONE:任务完成 + //CANCEL:任务取消 + //ABNORMAL_CANCEL:任务异常取消 + //ABNORMAL_COMPLETED:任务异常完成 + //4) 纯料箱任务枚举: + //MOVE_BEGIN:开始移动(仅单插臂或单夹报,2.8.1后) + //ENTER_STATION:到站 + //DONE:任务完成 + //LOAD_COMPLETED:取料完成 + //UNLOAD_COMPLETED:放料完成 + //ABNORMAL_CANCEL:任务异常取消ABNORMAL_COMPLETED:任务异常完成 + //5) 小皮带任务枚举: + //DONE:任务完成 + //6) QuickPick任务枚举: + //ENTER_STATION:到站 + //DONE:任务完成 + //CANCEL:任务取消 + //LEAVE_STATION离站 + //ROLLBACK 回滚(有其他任务,当前任务可不执行) + + + /// + /// 顶升完成 + /// + LIFT_UP_DONE = 1, + + /// + /// 开始移动 + /// + MOVE_BEGIN = 2, + + /// + /// 放下完成 + /// + PUT_DOWN_DONE = 3, + + /// + /// 任务完成 + /// + DONE = 4, + + + /// + /// 任务取消 + /// + CANCEL = 5, + + /// + /// 任务异常取消 + /// + ABNORMAL_CANCEL = 6, + + /// + /// 任务异常完成 + /// + ABNORMAL_COMPLETED = 7 + + } + + public enum jobType + { + /// + /// 1) 辊筒货位到货位搬运 + /// + SLOT_ROLLER_MOVE = 1, + POINT_ROLLER_MOVE=2 + } + + public class KC_Response + { + public KC_Response() + { + Data = new(); + } + /// + /// 是否成功 + /// + public bool Success { get; set; } + /// + /// 状态码 + /// + public string Code { get; set; } + /// + /// 消息 + /// + public string Message { get; set; } + /// + /// 返回数据数组 + /// + public List Data { get; set; } + } + public class KC_Response_Data + { + /// + /// 状态码 + /// + public string Code { get; set; } + /// + /// 消息体 + /// + public string Message { get; set; } + /// + /// 任务编号 + /// + public string RobotJobId { get; set; } + } + /// + /// AGV请求 + /// + public class KC_ExecuteRequest + { + /// + /// 快仓api地址 + /// + public string Url { get; set; } + /// + /// 任务编码 + /// + public string RobotJobId { get; set; } + /// + /// 仓库编码 默认值1 + /// + public long WarehouseId { get; set; } = 1; + + public string RobotJobGroupId { get; set; } + + public int? Sequence { get; set; } + + public string RobotJobGroupNum { get; set; } + /// + /// 优先级 0-99 越高越先执行 + /// + public int? JobPriority { get; set; } + + public int? JobPriorityType { get; set; } + + public string Deadline { get; set; } + + public string AgvType { get; set; } + + public string AgvEndPoint { get; set; } + + public bool NeedOperation { get; set; } + + public string AgvCode { get; set; } + + public int? TaskCountDown { get; set; } = 0; + public string BusinessType { get; set; } + [Required(ErrorMessage = "[{0}]不能为空")] + [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")] + //任务类型 用来滚筒点对点 POINT_ROLLER_MOVE n8H7jX + public string JobType { get; set; } = "POINT_ROLLER_MOVE"; + [Required(ErrorMessage = "[{0}]不能为空")] + public KC_JobDataRequest? JobData { get; set; } + } + /// + /// 任务下发起止点信息 + /// + public class KC_JobDataRequest + { + /// + /// 用户自定义信息编号 + /// + public string ContainerCode { get; set; } + /// + /// 起点点位 + /// + [Required(ErrorMessage = "[{0}]不能为空")] + [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")] + public string StartPoint { get; set; } + /// + /// 终点点位 + /// + [Required(ErrorMessage = "[{0}]不能为空")] + [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")] + public string EndPoint { get; set; } + /// + /// 上料方式 自动/人工 + /// + public bool? AutoLoad { get; set; } + /// + /// 上料交互方式 //接口对接 false + /// + public bool? EnableIOLoad { get; set; } = false; + /// + /// 下料方式 true自动/false人工 + /// + public bool? AutoUnload { get; set; } + /// + /// 接口对接 false + /// + public bool? EnableIOUnload { get; set; } = false; + /// + /// 起点设备ID + /// + public long LoadEquipmentId { get; set; } + /// + /// 目标设备ID + /// + public long UnloadEquipmentId { get; set; } + + public long LoadInteractive { get; set; } + + public long LoadHeight { get; set; } + + public long UnloadHeight { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvLineDto.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvLineDto.cs new file mode 100644 index 0000000..2539232 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvLineDto.cs @@ -0,0 +1,95 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 9:59:47 + /// 描 述 : + /// + public class AgvLineDto + { + /// + /// 自定义编码 + /// + public string Code { get; set; } + /// + /// 线路名称 + /// + public string Name { get; set; } + /// + /// 开始点位 + /// + public string StartPointId { get; set; } + /// + /// 结束点位 + /// + public string EndPointId { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + } + /// + /// 增加 + /// + public class AgvLineAddInput : AgvLineDto + { + + } + /// + /// 修改 + /// + public class AgvLineUpdateInput : AgvLineDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class AgvLineDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class AgvLineQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class AgvLineQueryPageInput : RequestPage + { + + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class AgvLineOutput : AgvLineDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvPointDto.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvPointDto.cs new file mode 100644 index 0000000..1d3299d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvPointDto.cs @@ -0,0 +1,83 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:00:01 + /// 描 述 : + /// + public class AgvPointDto + { + /// + /// 点位名称 + /// + public string Name { get; set; } + /// + /// 点位编码 + /// + public string Code { get; set; } + } + /// + /// 增加 + /// + public class AgvPointAddInput : AgvPointDto + { + + } + /// + /// 修改 + /// + public class AgvPointUpdateInput : AgvPointDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class AgvPointDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class AgvPointQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class AgvPointQueryPageInput : RequestPage + { + + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class AgvPointOutput : AgvPointDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/AGVThirdPartyService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AGVThirdPartyService.cs new file mode 100644 index 0000000..7777e04 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AGVThirdPartyService.cs @@ -0,0 +1,170 @@ +using BPA.AGV; +using BPA.MES.Base.Application.Services.AGVService.Dtos; +using Furion.EventBus; +using Furion.JsonSerialization; +using Furion.RemoteRequest.Extensions; + +namespace BPA.MES.Base.Application.Services +{ + /// + /// AGV第三方api + /// + [AllowAnonymous, NonUnify] + [ApiDescriptionSettings("AGV管理", Name = "AgvThirdParty", Tag = "AGV第三方api", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class AGVThirdPartyService : IAGVThirdPartyService, ITransient, IDynamicApiController + { + private readonly AGVHandler _aGVHandler; + private readonly IMQTTService _MQTTService; + public AGVThirdPartyService(AGVHandler aGVHandler, IMQTTService MQTTService) + { + _aGVHandler = aGVHandler; + _MQTTService = MQTTService; + } + + /// + /// 下发任务 + /// + /// + /// + [HttpPost] + public async Task Execute(KC_ExecuteRequest input) + { + List cExecuteRequests = new(); + if (string.IsNullOrEmpty(input.RobotJobId)) + { + throw Oops.Bah("任务编号不能为空"); + } + if (input.JobData != null) + input = new KC_ExecuteRequest + { + Url = string.IsNullOrEmpty(input.Url) ? App.GetConfig("AGVUrl")+"/api/quicktron/wcs/standardized.robot.job.submit": input.Url + "/api/quicktron/wcs/standardized.robot.job.submit", + RobotJobId = input.RobotJobId,//任务号 + WarehouseId = input.WarehouseId,//仓库编码 默认值1 + JobPriority = input.JobPriority, //优先级 0-99 越高越先执行 + JobPriorityType = input.JobPriorityType, //优先级类型 0 普通和1 强制. + JobType = input.JobType,//任务类型 用来滚筒点对点 POINT_ROLLER_MOVE n8H7jX + JobData = new KC_JobDataRequest + { + StartPoint = input.JobData.StartPoint, //起点 + EndPoint = input.JobData.EndPoint,//终点 + ContainerCode = input.JobData.ContainerCode,//桶号 + AutoLoad = input.JobData.AutoLoad,//上料方式 自动/人工 + EnableIOLoad = input.JobData.EnableIOLoad,//上料交互方式 //接口对接 false + AutoUnload = input.JobData.AutoUnload,//下料方式 true自动/false人工 + EnableIOUnload = input.JobData.EnableIOUnload,//接口对接 false + LoadEquipmentId = input.JobData.LoadEquipmentId,//起点设备ID + UnloadEquipmentId = input.JobData.UnloadEquipmentId,//目标设备ID + } + }; + cExecuteRequests.Add(input); + try + { + Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:{input.RobotJobId}接收到下发任务!"); + var res = await input.Url.SetBody(cExecuteRequests).PostAsStringAsync(); + return JSON.Deserialize(res); + } + catch (Exception ex) + { + throw Oops.Bah(ex.Message); + } + } + /// + /// 取消任务 + /// + /// + /// + [HttpPost] + public async Task Cancel(KCCancelRequest kCCancelRequest) + { + kCCancelRequest.Url = string.IsNullOrEmpty(kCCancelRequest.Url) ? App.GetConfig("AGVUrl") + "/api/quicktron/wcs/standardized.robot.job.cancel" : kCCancelRequest.Url + "/api/quicktron/wcs/standardized.robot.job.cancel"; + return await _aGVHandler.CancelAsync(kCCancelRequest); + } + /// + /// 上下料反馈给AGV接口 + /// + /// + /// + public async Task RollerJobExecute(Roller_JobRequest input) + { + //http://[IP:Port]/api/quicktron/wcs/standardized.roller.job.upstream.response + input.Url = string.IsNullOrEmpty(input.Url) ? App.GetConfig("AGVUrl") + "/api/quicktron/wcs/standardized.roller.job.upstream.response": input.Url+ "/api/quicktron/wcs/standardized.roller.job.upstream.response"; + try + { + var res = await input.Url.SetBody(input).PostAsStringAsync(); + Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:{input.JobId}上下料反馈给AGV接口!{res}"); + return JSON.Deserialize(res); + } + catch (Exception ex) + { + return new RollerJobResponse() { Success = false }; + } + } + /// + /// 任务反馈(暴露给AGV厂商) + /// + /// + /// + [HttpPost] + public async Task ExecuteReply(AGVExecuteReplyRequest input) + { + try + { + var data = new AGVExecuteReplyMQTT() + { + Event = input.Body.Event, + }; + bool res = await _MQTTService.MqttPublish(new MqttPublishDto(){ Payload= data, Topic = Topics.ExecuteReplyTopic, MessageId = MessageID.TaskState }); + Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:接收到AGV反馈请求!", res.ToString()); + AgvBody agvBody = new() + { + Header = input.Header, + Body = new AgvRetrun { Code = "SUCCESS", Success = res, Message = "SUCCESS", Data = null } + }; + Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:AGV反馈消息!{JSON.Serialize(agvBody)}"); + return agvBody; + } + catch (Exception ex) + { + AgvBody agvBody = new() + { + Header = input.Header, + Body = new AgvRetrun { Code = "SUCCESS", Success = false, Message = ex.Message, Data = null } + }; + return agvBody; + } + } + /// + /// AGV上下料交互请求 (暴露给AGV厂商) + /// + /// + /// + [HttpPost, AGV] + public async Task LoadAndUnload(AGVLoadAndUnloadRequest input) + { + try + { + var data = new AGVLoadAndUnloadMQTT() + { + Event = input.Body.Event, + }; + bool res = await _MQTTService.MqttPublish(new MqttPublishDto() { Payload= data, Topic = Topics.LoadAndUnloadTopic, MessageId = MessageID.LoadAndUnload }); + Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}:接收到AGV上下料交互请求!{res.ToString()}"); + AgvBody agvBody = new() + { + Header = input.Header, + Body = new AgvRetrun { Code = "SUCCESS", Success = res, Message = "SUCCESS", Data = null } + }; + return agvBody; + } + catch (Exception ex) + { + AgvBody agvBody = new() + { + Header = input.Header, + Body = new AgvRetrun { Code = "SUCCESS", Success = false, Message = ex.Message, Data = null } + }; + return agvBody; + } + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvLineService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvLineService.cs new file mode 100644 index 0000000..7a53431 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvLineService.cs @@ -0,0 +1,115 @@ +namespace BPA.MES.Base.Application.Services.AGVService.Services +{ + /// + /// 名 称 :AGV线路管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:03:21 + /// 描 述 : + /// + [ApiDescriptionSettings("AGV管理", Name = "AgvLine", Tag = "AGV线路", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class AgvLineService : IAgvLineService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public AgvLineService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(AgvLineAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + AgvLineEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(AgvLineDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + AgvLineOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(AgvLineQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(AgvLineQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(AgvLineUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvPointService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvPointService.cs new file mode 100644 index 0000000..5975935 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvPointService.cs @@ -0,0 +1,115 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :AGV点位管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:03:37 + /// 描 述 : + /// + [ApiDescriptionSettings("AGV管理", Name = "AgvPoint", Tag = "AGV点位", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class AgvPointService : IAgvPointService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public AgvPointService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(AgvPointAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + AgvPointEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(AgvPointDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + AgvPointOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(AgvPointQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(AgvPointQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(AgvPointUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAGVThirdPartyService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAGVThirdPartyService.cs new file mode 100644 index 0000000..4849af8 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAGVThirdPartyService.cs @@ -0,0 +1,40 @@ +using BPA.AGV; +using BPA.MES.Base.Application.Services.AGVService.Dtos; + +namespace BPA.MES.Base.Application.Services +{ + public interface IAGVThirdPartyService + { + + /// + /// 下发任务 + /// + /// + /// + Task Execute(KC_ExecuteRequest input); + /// + /// 取消任务 + /// + /// + /// + Task Cancel(KCCancelRequest kCCancelRequest); + /// + /// 任务回调 + /// + /// + /// + Task ExecuteReply(AGVExecuteReplyRequest input); + /// + /// AGV上下料交互请求 + /// + /// + /// + Task LoadAndUnload(AGVLoadAndUnloadRequest input); + /// + /// 上下料反馈给AGV接口 + /// + /// + /// + Task RollerJobExecute(Roller_JobRequest input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvLineService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvLineService.cs new file mode 100644 index 0000000..1065d50 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvLineService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:02:54 + /// 描 述 : + /// + public interface IAgvLineService + { + /// + /// 增加 + /// + /// + Task Add(AgvLineAddInput input); + /// + /// 移除 + /// + /// + Task Del(AgvLineDelInput input); + /// + /// 更新 + /// + /// + Task Update(AgvLineUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(AgvLineQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(AgvLineQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvPointService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvPointService.cs new file mode 100644 index 0000000..353cbeb --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvPointService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :AVG点位 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:03:06 + /// 描 述 : + /// + public interface IAgvPointService + { + /// + /// 增加 + /// + /// + Task Add(AgvPointAddInput input); + /// + /// 移除 + /// + /// + Task Del(AgvPointDelInput input); + /// + /// 更新 + /// + /// + Task Update(AgvPointUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(AgvPointQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(AgvPointQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/BaseService.cs b/backend/BPA.MES.Base.Application/Services/BaseService.cs new file mode 100644 index 0000000..7f8fc14 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/BaseService.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 16:13:10 + /// 描 述 : + /// + public class BaseService: ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public BaseService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 初始化数据库 + /// + /// + public string CreateDB() + { + var types = Assembly.Load("BPA.MES.Base.Application").GetTypes() + .Where(x => x.GetCustomAttribute() != null + && x.Namespace == "BPA.MES.Base.Application.Entitys").ToArray(); + _dbContext.CodeFirst.InitTables(types); + return "成功"; + } + /// + /// 测试 + /// + [AllowAnonymous] + public void Test() + { + //Type personType = Type.GetType("BPA.MES.Base.Application, DictDataAddInput"); + //object person = Activator.CreateInstance(personType); + Type type = Type.GetType("BPA.MES.Base.Application.Services.DictService.Dtos"); + string fullName = "BPA.MES.Base.Application.Services.DictDataAddInput"; + Type? instanceClass = Assembly.Load("BPA.MES.Base.Application").GetType(fullName); + var myInstance = instanceClass?.Assembly.CreateInstance(fullName); + + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/BucketInfoService/Dtos/BucketInfoDto.cs b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Dtos/BucketInfoDto.cs new file mode 100644 index 0000000..c3da2f5 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Dtos/BucketInfoDto.cs @@ -0,0 +1,75 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 15:43:00 + /// 描 述 : + /// + public class BucketInfoDto + { + /// + /// 桶名称 + /// + public string Name { get; set; } + /// + /// 桶编号 + /// + public string Code { get; set; } + } + /// + /// 增加 + /// + public class BucketInfoAddInput : BucketInfoDto + { + + } + /// + /// 更新 + /// + public class BucketInfoUpdateInput : BucketInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class BucketInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class BucketInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class BucketInfoOutput : BucketInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 当前原料名称 + /// + public string MaterialName { get; set; } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/BucketInfoService/Dtos/BucketMaterialsRecordDto.cs b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Dtos/BucketMaterialsRecordDto.cs new file mode 100644 index 0000000..7482a75 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Dtos/BucketMaterialsRecordDto.cs @@ -0,0 +1,135 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 17:29:52 + /// 描 述 : + /// + public class BucketMaterialsRecordDto + { + /// + /// 桶Id + /// + public string BucketId { get; set; } + /// + /// 物料Id + /// + public string MaterialId { get; set; } + /// + /// 添加时间 + /// + public DateTime? CreateTime { get; set; } + /// + /// 物料重量 + /// + public string Weight { get; set; } + /// + /// 工单Id + /// + public string WorkId { get; set; } + } + public class BucketMaterialsRecordAddInput : BucketMaterialsRecordDto + { + + } + /// + /// 更新 + /// + public class BucketMaterialsRecordUpdateInput : BucketMaterialsRecordDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class BucketMaterialsRecordDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class BucketMaterialsRecordQueryInput + { + /// + /// 工单Id + /// + public string WorkId { get; set; } + /// + /// 桶Id + /// + public string BucketId { get; set; } + /// + /// 桶编号 + /// + public string BucketCode { get; set; } + } + /// + /// 分页 + /// + public class BucketMaterialsRecordQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 桶Id + /// + public string BucketId { get; set; } + } + + /// + /// 清空桶 + /// + public class BucketClearInput + { + public string BucketId { get; set; } + } + + /// + /// 输出 + /// + public class BucketMaterialsRecordOutput : BucketMaterialsRecordDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 原料名称 + /// + public string MaterialName { get; set; } + /// + /// 桶名称 + /// + public string BucketName { get; set; } + /// + /// 工单名称 + /// + public string WorkName { get; set; } + /// + /// 桶编码 + /// + public string BucketCode { get; set; } + /// + /// 计划重量 + /// + public string SchemeWeight { get; set; } + /// + /// 第几锅 + /// + public string PotNum { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/BucketInfoService.cs b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/BucketInfoService.cs new file mode 100644 index 0000000..b75c69b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/BucketInfoService.cs @@ -0,0 +1,168 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :桶服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :基础数据管理 + /// + [ApiDescriptionSettings("基础数据管理", Order = 3, Tag = "桶服务", Name = "BucketInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class BucketInfoService : IBucketInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public BucketInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(BucketInfoAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name || x.Code == input.Code); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + Pztj_BucketInfoEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 新增并返回 + /// + /// + /// + [HttpPost] + public async Task AddRetrun(BucketInfoAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name || x.Code == input.Code); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + Pztj_BucketInfoEntity entity = input.Adapt(); + var res = await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + if (!res) + { + throw Oops.Bah("新增桶失败!"); + } + return entity; + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(BucketInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + BucketInfoOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(BucketInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.Id==b.BucketId && b.Id == SqlFunc.Subqueryable().Where(s => s.BucketId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) + .LeftJoin((a,b,c)=>b.MaterialId==c.Id) + .Select((a,b,c)=>new BucketInfoOutput + { + Id = a.Id.SelectAll(), + MaterialName = c.Name + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + + + + + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(BucketInfoUpdateInput input) + { + var isExit =await _dbContext.Queryable().Where(x => x.Id != input.Id && (x.Name == input.Name || x.Code == input.Code)).FirstAsync(); + if (isExit != null) + { + throw Oops.Bah("名称或编码已存在!"); + } + Pztj_BucketInfoEntity entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + ///// + ///// 根据桶Id查询记录 + ///// + ///// + ///// + //public async Task RecordList(string bucketId) + //{ + // var entity = await _dbContext.Queryable() + // .LeftJoin((a, b) => a.MaterialId == b.Id) + // .Select((a, b) => new BucketMaterialsRecordOutput + // { + // Id = a.Id.SelectAll(), + // MaterialName = b.Name + // }) + // .ToListAsync(); + // SqlSugarPagedList output = entity.Adapt>(); + // return output; + //} + } +} + diff --git a/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/BucketMaterialsRecordServcie.cs b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/BucketMaterialsRecordServcie.cs new file mode 100644 index 0000000..ed1ce37 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/BucketMaterialsRecordServcie.cs @@ -0,0 +1,140 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :桶记录 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :基础数据管理 + /// + [ApiDescriptionSettings("基础数据管理", Order = 3, Tag = "桶服务", Name = "BucketMaterialsRecord", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class BucketMaterialsRecordServcie : IBucketMaterialsRecordService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public BucketMaterialsRecordServcie(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(BucketMaterialsRecordAddInput input) + { + Pztj_BucketMaterialsRecordEntity entity = input.Adapt(); + var work_entity =await _dbContext.Queryable().FirstAsync(x => x.Id == input.MaterialId); + if (work_entity==null) + { + throw Oops.Bah("没有找到此物料信息!"); + } + entity.WorkId = work_entity.WorkId; + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(BucketMaterialsRecordDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + BucketMaterialsRecordOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(BucketMaterialsRecordQueryInput input) + { + var output = await _dbContext.Queryable() + .LeftJoin((a, b) => a.MaterialId == b.Id) + .LeftJoin((a, b, c) => a.BucketId == c.Id) + .LeftJoin((a,b,c,d)=>b.WorkId==d.Id) + .WhereIF(!string.IsNullOrEmpty(input.BucketId), (a, b, c) => a.BucketId == input.BucketId) + .WhereIF(!string.IsNullOrEmpty(input.WorkId), (a, b, c) => b.WorkId == b.WorkId) + .WhereIF(!string.IsNullOrEmpty(input.BucketCode),(a,b,c)=>c.Code==input.BucketCode) + .Select((a, b, c, d) => new BucketMaterialsRecordOutput + { + Id = a.Id, + MaterialId = a.MaterialId, + BucketId = a.BucketId, + Weight = a.Weight, + CreateTime = a.CreateTime, + SchemeWeight = b.Weight, + WorkId = d.Id, + MaterialName = b.MaterialName, + BucketName = c.Name, + WorkName = b.RecipeName, + PotNum = b.PotNum, + BucketCode = c.Code + }) + .ToListAsync(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(BucketMaterialsRecordQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.BucketId==b.Id) + .LeftJoin((a,b,c)=>a.MaterialId==c.Id) + .WhereIF(!string.IsNullOrEmpty(input.BucketId),(a,b,c)=>a.BucketId==input.BucketId) + .OrderByDescending((a,b,c)=>a.CreateTime) + .Select((a,b,c)=>new BucketMaterialsRecordOutput + { + Id = a.Id.SelectAll(), + MaterialName = c.Name, + BucketName = b.Name + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(BucketMaterialsRecordUpdateInput input) + { + Pztj_BucketMaterialsRecordEntity entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 清空桶 + /// + /// + /// + [HttpPost] + public async Task Clear(BucketClearInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.BucketId == input.BucketId).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/IBucketInfoService.cs b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/IBucketInfoService.cs new file mode 100644 index 0000000..3d54bd1 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/IBucketInfoService.cs @@ -0,0 +1,53 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 15:43:10 + /// 描 述 : + /// + public interface IBucketInfoService + { + /// + /// 增加 + /// + /// + Task Add(BucketInfoAddInput input); + /// + /// 增加并返回数据 + /// + /// + Task AddRetrun(BucketInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(BucketInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(BucketInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(BucketInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/IBucketMaterialsRecordService.cs b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/IBucketMaterialsRecordService.cs new file mode 100644 index 0000000..2bfe66d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/BucketInfoService/Services/IBucketMaterialsRecordService.cs @@ -0,0 +1,49 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :桶记录 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 17:37:03 + /// 描 述 : + /// + public interface IBucketMaterialsRecordService + { + /// + /// 增加 + /// + /// + Task Add(BucketMaterialsRecordAddInput input); + /// + /// 移除 + /// + /// + Task Del(BucketMaterialsRecordDelInput input); + /// + /// 更新 + /// + /// + Task Update(BucketMaterialsRecordUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(BucketMaterialsRecordQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(BucketMaterialsRecordQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + /// + /// 清空桶 + /// + /// + /// + Task Clear(BucketClearInput input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsInfoDto.cs b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsInfoDto.cs new file mode 100644 index 0000000..794556c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsInfoDto.cs @@ -0,0 +1,83 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产品分组 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/10 13:59:43 + /// 描 述 : + /// + public class CraftsInfoDto + { + /// + /// 工艺名称 + /// + public string Name { get; set; } + /// + /// 设备类型 0:炒锅 1:反应釜 + /// + public string DeviceProductId { get; set; } + /// + /// 工艺描述 + /// + public string Description { get; set; } + } + /// + /// 增加 + /// + public class CraftsInfoAddInput : CraftsInfoDto + { + + } + /// + /// 更新 + /// + public class CraftsInfoUpdateInput : CraftsInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class CraftsInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class CraftsInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 设备类型 0:炒锅 1:反应釜 + /// + public string DeviceProductId { get; set; } + } + /// + /// 不分页 + /// + public class CraftsInfoQueryInput + { + + } + /// + /// 输出 + /// + public class CraftsInfoOutput : CraftsInfoDto + { + /// + /// 主键 + /// + /// + public string Id { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsStepsDto.cs b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsStepsDto.cs new file mode 100644 index 0000000..4364319 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsStepsDto.cs @@ -0,0 +1,100 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产线管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/18 14:03:27 + /// 描 述 : + /// + public class CraftsStepsDto + { + /// + /// 工艺Id + /// + public string CraftId { get; set; } + /// + /// 步骤 + /// + public int Step { get; set; } + /// + /// 功能描述 + /// + public string Description { get; set; } + /// + /// 设备产品功能Id + /// + public string DeviceProductFunctionId { get; set; } + + /// + /// 功能参数 + /// + public string Params { get; set; } + } + /// + /// 增加 + /// + public class CraftsStepsAddInput : CraftsStepsDto + { + + } + /// + /// 更新 + /// + public class CraftsStepsUpdateInput : CraftsStepsDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class CraftsStepsDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class CraftsStepsQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 工艺Id + /// + public string CraftId { get; set; } + } + /// + /// 输出 + /// + public class CraftsStepsOutput : CraftsStepsDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 工艺名称 + /// + public string CraftName { get; set; } + /// + /// 设备产品功能名称 + /// + public string DeviceProductFunctionName { get; set; } + /// + /// 设备产品Id + /// + public string DeviceProductId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsInfoService.cs b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsInfoService.cs new file mode 100644 index 0000000..1e8301f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsInfoService.cs @@ -0,0 +1,130 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :工艺信息 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/10 14:03:06 + /// 描 述 :配方工艺管理 + /// + [ApiDescriptionSettings("配方工艺管理", Order = 0, Tag = "工艺服务", Name = "CraftsInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class CraftsInfoService : ICraftsInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public CraftsInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(CraftsInfoAddInput input) + { + Pztj_CraftsInfoEntity entity = await _dbContext.Queryable().FirstAsync(x => x.Name ==input.Name); + if (entity != null) + { + throw Oops.Bah("名称已存在!"); + } + entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(CraftsInfoDelInput input) + { + //事务,删除所有子表 + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandAsync(); + await _dbContext.Deleteable().Where(x => x.CraftId == input.Id).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + throw Oops.Bah("删除失败!"); + } + return true; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(); + CraftsInfoOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost, AllowAnonymous] + public async Task> List(CraftsInfoQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(CraftsInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.DeviceProductId), x => x.DeviceProductId == input.DeviceProductId) + .WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Name.Contains(input.Name)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(CraftsInfoUpdateInput input) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id != input.Id && x.Name == input.Name); + if (entity != null) + { + throw Oops.Bah("名称已存在!"); + } + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsStepsService.cs b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsStepsService.cs new file mode 100644 index 0000000..a3d908b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsStepsService.cs @@ -0,0 +1,144 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :工艺路线服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :CraftsInfo 工艺管理 CraftsSteps工艺步骤管理 + /// + [ApiDescriptionSettings("配方工艺管理", Order = 0, Tag = "工艺服务", Name = "CraftsSteps", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class CraftsStepsService : ICraftsStepsService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public CraftsStepsService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(CraftsStepsAddInput input) + { + + var step = await _dbContext.Queryable().Where(x=>x.CraftId==input.CraftId).MaxAsync(x => x.Step); + Pztj_CraftStepsEntity entity = input.Adapt(); + entity.Step = step+1; + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(CraftsStepsDelInput input) + { + var stepItem = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + string craftsId = stepItem.CraftId; + int step = stepItem.Step; + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + if (res) + { + var stepList = await _dbContext.Queryable().Where(x => x.CraftId == craftsId).OrderBy(x=>x.Step).ToListAsync(); + for (int i = 0; i < stepList.Count; i++) + { + stepList[i].Step = i + 1; + } + await _dbContext.Updateable(stepList).ExecuteCommandAsync(); + } + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + CraftsStepsOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(CraftsStepsQueryPageInput input) + { + var output = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.DeviceProductFunctionId==b.Id) + .WhereIF(!string.IsNullOrEmpty(input.CraftId), (a, b) => a.CraftId == input.CraftId) + .OrderBy((a, b) => a.Step) + .Select((a,b)=>new CraftsStepsOutput + { + Id = a.Id.SelectAll(), + DeviceProductFunctionName = b.Name, + DeviceProductFunctionId = a.DeviceProductFunctionId, + DeviceProductId = b.DeviceProductId + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Description + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(CraftsStepsUpdateInput input) + { + Pztj_CraftStepsEntity entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(it => it.Step).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 批量更新 + /// + /// + /// + [HttpPost] + public async Task BatchUpdate(List inputs) + { + List entity = inputs.Adapt>(); + var res = await _dbContext.Updateable(entity).ExecuteCommandHasChangeAsync(); + return res; + } + } +} + diff --git a/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/ICraftsInfoService.cs b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/ICraftsInfoService.cs new file mode 100644 index 0000000..130be32 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/ICraftsInfoService.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :工艺信息 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/10 14:03:21 + /// 描 述 : + /// + public interface ICraftsInfoService + { + /// + /// 增加 + /// + /// + Task Add(CraftsInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(CraftsInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(CraftsInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(CraftsInfoQueryInput Input); + /// + /// 分页列表 + /// + /// + Task> PagedList(CraftsInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/ICraftsStepsService.cs b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/ICraftsStepsService.cs new file mode 100644 index 0000000..880101a --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/ICraftsStepsService.cs @@ -0,0 +1,54 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产线管理 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/18 14:05:16 + /// 描 述 : + /// + public interface ICraftsStepsService + { + /// + /// 增加 + /// + /// + Task Add(CraftsStepsAddInput input); + /// + /// 移除 + /// + /// + Task Del(CraftsStepsDelInput input); + /// + /// 更新 + /// + /// + Task Update(CraftsStepsUpdateInput input); + /// + /// 批量更新 + /// + /// + /// + Task BatchUpdate(List inputs); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(CraftsStepsQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductDto.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductDto.cs new file mode 100644 index 0000000..30ae841 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductDto.cs @@ -0,0 +1,87 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/2 16:19:15 + /// 描 述 : + /// + public class DeviceProductDto + { + /// + /// 设备产品名称 + /// + public string Name { get; set; } + /// + /// 设备产品编码 + /// + public string Code { get; set; } + /// + /// 设备产品描述 + /// + public string Description { get; set; } + } + /// + /// 增加 + /// + public class DeviceProductAddInput : DeviceProductDto + { + + } + /// + /// 修改 + /// + public class DeviceProductUpdateInput : DeviceProductDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class DeviceProductDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class DeviceProductQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class DeviceProductQueryPageInput : RequestPage + { + + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class DeviceProductOutput : DeviceProductDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductFunctionDto.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductFunctionDto.cs new file mode 100644 index 0000000..ecd4b0c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductFunctionDto.cs @@ -0,0 +1,111 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品模型功能 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 18:04:53 + /// 描 述 : + /// + public class DeviceProductFunctionDto + { + /// + /// 设备产品Id + /// + public string DeviceProductId { get; set; } + /// + /// 功能名称 + /// + public string Name { get; set; } + /// + /// 功能编码 + /// + public string Code { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + /// + /// 方法参数 + /// + public string Params { get; set; } + } + /// + /// 增加 + /// + public class DeviceProductFunctionAddInput : DeviceProductFunctionDto + { + + } + /// + /// 修改 + /// + public class DeviceProductFunctionUpdateInput : DeviceProductFunctionDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class DeviceProductFunctionDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class DeviceProductFunctionQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 设备产品Id + /// + public string DeviceProductId { get; set; } + /// + /// 设备产品名称 + /// + public string Name { get; set; } + /// + /// 设备产品编号 + /// + public string Code { get; set; } + } + /// + /// 分页查询条件 + /// + public class DeviceProductFunctionQueryPageInput : RequestPage + { + + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 设备产品Id + /// + public string DeviceProductId { get; set; } + } + /// + /// 输出 + /// + public class DeviceProductFunctionOutput : DeviceProductFunctionDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductParmDto.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductParmDto.cs new file mode 100644 index 0000000..1ba3d1f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Dtos/DeviceProductParmDto.cs @@ -0,0 +1,91 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品参数 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 18:04:53 + /// 描 述 : + /// + public class DeviceProductParmDto + { + /// + /// 设备产品Id + /// + public string DeviceProductId { get; set; } + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + } + /// + /// 增加 + /// + public class DeviceProductParmAddInput : DeviceProductParmDto + { + + } + /// + /// 修改 + /// + public class DeviceProductParmUpdateInput : DeviceProductParmDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class DeviceProductParmDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class DeviceProductParmQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class DeviceProductParmQueryPageInput : RequestPage + { + + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class DeviceProductParmOutput : DeviceProductParmDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductFunctionService.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductFunctionService.cs new file mode 100644 index 0000000..a95ba3e --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductFunctionService.cs @@ -0,0 +1,128 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品功能服务 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 18:03:25 + /// 描 述 : + /// + [ApiDescriptionSettings("设备产品模型", Name = "DeviceProductFunction", Tag = "设备产品功能", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class DeviceProductFunctionService : IDeviceProductFunctionService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public DeviceProductFunctionService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(DeviceProductFunctionAddInput input) + { + var r_entity = await _dbContext.Queryable().Where(x=>x.DeviceProductId==input.DeviceProductId && x.Name == input.Name).FirstAsync(); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + DeviceProductFunctionEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(DeviceProductFunctionDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + DeviceProductFunctionOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(DeviceProductFunctionQueryInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.DeviceProductId), x => x.DeviceProductId==input.DeviceProductId) + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(DeviceProductFunctionQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .WhereIF(!string.IsNullOrEmpty(input.DeviceProductId),x=>x.DeviceProductId==input.DeviceProductId) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(DeviceProductFunctionUpdateInput input) + { + + var isEntity = await _dbContext.Queryable() + .Where(x =>x.Id != input.Id && x.DeviceProductId == input.DeviceProductId && x.Name == input.Name).FirstAsync(); + if (isEntity != null) + { + throw Oops.Bah("名称已存在!"); + } + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductParmService.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductParmService.cs new file mode 100644 index 0000000..1c0499b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductParmService.cs @@ -0,0 +1,115 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备参数 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 18:03:25 + /// 描 述 : + /// + [ApiDescriptionSettings("设备产品模型", Name = "DeviceProductParm", Tag = "设备产品参数", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class DeviceProductParmService : IDeviceProductParmService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public DeviceProductParmService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(DeviceProductParmAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + DeviceProductParmEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(DeviceProductParmDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + DeviceProductParmOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(DeviceProductParmQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(DeviceProductParmQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(DeviceProductParmUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductService.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductService.cs new file mode 100644 index 0000000..fcbc849 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/DeviceProductService.cs @@ -0,0 +1,127 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 18:03:25 + /// 描 述 : + /// + [ApiDescriptionSettings("设备产品模型", Name = "DeviceProduct", Tag = "设备产品管理", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class DeviceProductService : IDeviceProductService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public DeviceProductService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(DeviceProductAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + DeviceProductEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(DeviceProductDelInput input) + { + //事务,删除所有子表 + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandAsync(); + await _dbContext.Deleteable().Where(x => x.DeviceProductId == input.Id).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + throw Oops.Bah("删除失败!"); + } + return true; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + DeviceProductOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(DeviceProductQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(DeviceProductQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(DeviceProductUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductFunctionService.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductFunctionService.cs new file mode 100644 index 0000000..6d26ba2 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductFunctionService.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品功能 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 18:02:57 + /// 描 述 : + /// + public interface IDeviceProductFunctionService + { + /// + /// 增加 + /// + /// + Task Add(DeviceProductFunctionAddInput input); + /// + /// 删除 + /// + /// + Task Del(DeviceProductFunctionDelInput input); + /// + /// 更新 + /// + /// + Task Update(DeviceProductFunctionUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(DeviceProductFunctionQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(DeviceProductFunctionQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductParmService.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductParmService.cs new file mode 100644 index 0000000..6a2866e --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductParmService.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品参数 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/31 18:02:57 + /// 描 述 : + /// + public interface IDeviceProductParmService + { + /// + /// 增加 + /// + /// + Task Add(DeviceProductParmAddInput input); + /// + /// 删除 + /// + /// + Task Del(DeviceProductParmDelInput input); + /// + /// 更新 + /// + /// + Task Update(DeviceProductParmUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(DeviceProductParmQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(DeviceProductParmQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductService.cs b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductService.cs new file mode 100644 index 0000000..b759a85 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceProductService/Services/IDeviceProductService.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备产品基础信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/2 16:19:35 + /// 描 述 : + /// + public interface IDeviceProductService + { + /// + /// 增加 + /// + /// + Task Add(DeviceProductAddInput input); + /// + /// 删除 + /// + /// + Task Del(DeviceProductDelInput input); + /// + /// 更新 + /// + /// + Task Update(DeviceProductUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(DeviceProductQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(DeviceProductQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DeviceRecipeDto.cs b/backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DeviceRecipeDto.cs new file mode 100644 index 0000000..167f13b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DeviceRecipeDto.cs @@ -0,0 +1,99 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备Dto类 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 16:12:06 + /// 描 述 : + /// + public class DeviceRecipeDto : DeviceRecipeEntity + { + + } + /// + /// 增加 + /// + public class DeviceRecipeAddInput : DeviceRecipeDto + { + + } + /// + /// 更新 + /// + public class DeviceRecipeUpdateInput : DeviceRecipeDto + { + + } + /// + /// 删除 + /// + public class DeviceRecipeDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class DeviceRecipeQueryInput + { + /// + /// 设备Id + /// + public string DeviceId { get; set; } + + } + /// + /// 分页 + /// + public class DeviceRecipeQueryPageInput : RequestPage + { + + } + + public class DeviceRecipeBatchAddInput + { + /// + /// 设备Id + /// + public string DeviceId { get; set; } + /// + /// 配方数组 + /// + public List RecipesIds { get; set; } = new(); + } + + + /// + /// 输出 + /// + public class DeviceRecipeOutput : DeviceRecipeDto + { + /// + /// 设备名称 + /// + public string DeviceName { get; set; } + /// + /// 配方名称 + /// + public string RecipeName { get; set; } + /// + /// 配方代码 + /// + public string RecipeCode { get; set; } + /// + /// 分组Id + /// + public string GroupId { get; set; } + /// + /// 分组名称 + /// + public string GroupName { get; set; } + /// + /// 配方图片地址 + /// + public string RecipesPic { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DevicesInfoDto.cs b/backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DevicesInfoDto.cs new file mode 100644 index 0000000..c95b597 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DevicesInfoDto.cs @@ -0,0 +1,88 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备Dto类 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 16:12:06 + /// 描 述 : + /// + public class DevicesInfoDto + { + /// + /// 名称 + /// + /// 设备名称 + [Required(ErrorMessage = "名称不能为空")] + public string Name { get; set; } + /// + /// 编码 + /// + [Required(ErrorMessage = "编码不能为空")] + public string Code { get; set; } + /// + /// 设备类型 + /// + public string DeviceType { get; set; } + /// + /// 设备描述 + /// + /// 设备描述 + public string Describe { get; set; } + /// + /// 设备维保时间 + /// + /// 2023-7-17 + public string RepairDate { get; set; } + } + /// + /// 增加 + /// + public class DevicesInfoAddInput : DevicesInfoDto + { + + } + /// + /// 更新 + /// + public class DevicesInfoUpdateInput : DevicesInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class DevicesInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class DevicesInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class DevicesInfoOutput : DevicesInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceService/Services/DeviceRecipeService.cs b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/DeviceRecipeService.cs new file mode 100644 index 0000000..26c0f83 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/DeviceRecipeService.cs @@ -0,0 +1,144 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :基础信息管理 + /// + [ApiDescriptionSettings("基础数据管理", Name = "DeviceRecipe", Tag = "设备服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class DeviceRecipeService : IDeviceRecipeService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public DeviceRecipeService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(DeviceRecipeAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.DeviceId == input.DeviceId && x.RecipesId==input.RecipesId); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + DeviceRecipeEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 批量下发配方 + /// + /// + /// + /// + + public async Task BatchUpdate(DeviceRecipeBatchAddInput input) + { + bool result = false; + List dr_entitys = new(); + foreach (var item in input.RecipesIds) + { + DeviceRecipeEntity entity = new(); + entity.RecipesId = item; + entity.DeviceId = input.DeviceId; + dr_entitys.Add(entity); + } + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.DeviceId == input.DeviceId).ExecuteCommandAsync(); + if (input.RecipesIds.Any()) + { + await _dbContext.Insertable(dr_entitys).ExecuteCommandAsync(); + } + _dbContext.Ado.CommitTran(); + result = true; + } + catch (Exception ex) + { + throw Oops.Bah("更新失败!"); + } + return result; + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(DeviceRecipeDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + DeviceRecipeOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost,AllowAnonymous] + public async Task> List(DeviceRecipeQueryInput input) + { + var output = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.RecipesId==b.Id) + .LeftJoin((a,b,c)=>a.RecipesId==c.RecipesId) + .LeftJoin((a, b, c,d)=>c.GroupId==d.Id) + .WhereIF(!string.IsNullOrEmpty(input.DeviceId),a=>a.DeviceId==input.DeviceId) + .Select((a, b, c,d) => new DeviceRecipeOutput + { + DeviceId = a.DeviceId, + RecipeName = b.Name, + RecipeCode = b.Code, + RecipesId = a.RecipesId, + GroupId = c.GroupId, + GroupName = d.Name + }) + .ToListAsync(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(DeviceRecipeQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(DeviceRecipeUpdateInput input) + { + var res = await _dbContext.Updateable().ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceService/Services/DevicesInfoService.cs b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/DevicesInfoService.cs new file mode 100644 index 0000000..77b066d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/DevicesInfoService.cs @@ -0,0 +1,119 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :基础数据管理 + /// + [ApiDescriptionSettings("基础数据管理",Order = 0, Tag = "设备服务", Name = "DevicesInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class DevicesInfoService : IDevicesInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public DevicesInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(DevicesInfoAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name || x.Code == input.Code); + if (r_entity != null) + { + throw Oops.Bah("名称或编码已存在!"); + } + Pztj_DevicesInfoEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(DevicesInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + DevicesInfoOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(DevicesInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Name.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(DevicesInfoUpdateInput input) + { + var isExit =await _dbContext.Queryable().Where(x => x.Id != input.Id && (x.Name == input.Name || x.Code == input.Code)).FirstAsync(); + if (isExit != null) + { + throw Oops.Bah("名称或编码已存在!"); + } + Pztj_DevicesInfoEntity entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDeviceRecipeService.cs b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDeviceRecipeService.cs new file mode 100644 index 0000000..3c74b75 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDeviceRecipeService.cs @@ -0,0 +1,49 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备配方服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 18:30:58 + /// 描 述 : + /// + public interface IDeviceRecipeService + { + /// + /// 增加 + /// + /// + Task Add(DeviceRecipeAddInput input); + /// + /// 移除 + /// + /// + Task Del(DeviceRecipeDelInput input); + /// + /// 更新 + /// + /// + Task Update(DeviceRecipeUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(DeviceRecipeQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(DeviceRecipeQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + /// + /// 批量下发配方 + /// + /// + /// + Task BatchUpdate(DeviceRecipeBatchAddInput input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDevicesInfoService.cs b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDevicesInfoService.cs new file mode 100644 index 0000000..31386c0 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDevicesInfoService.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 18:30:58 + /// 描 述 : + /// + public interface IDevicesInfoService + { + /// + /// 增加 + /// + /// + Task Add(DevicesInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(DevicesInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(DevicesInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(DevicesInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictDataDto.cs b/backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictDataDto.cs new file mode 100644 index 0000000..6bd555e --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictDataDto.cs @@ -0,0 +1,102 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :码表数据 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 9:56:11 + /// 描 述 : + /// + public class DictDataDto + { + /// + /// 类型id + /// + public string TypeId { get; set; } + /// + /// 值 + /// + public string Value { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } + } + /// + /// 增加 + /// + public class DictDataAddInput : DictDataDto + { + + } + /// + /// 修改 + /// + public class DictDataUpdateInput : DictDataDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class DictDataDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class DictDataQueryInput + { + /// + /// 码表类型Id + /// + public string TypeId { get; set; } + /// + /// 码表类型编码 + /// + public string TypeCode { get; set; } + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class DictDataQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Value { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 码表类型Id + /// + public string TypeId { get; set; } + } + /// + /// 输出 + /// + public class DictDataOutput : DictDataDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictTypeDto.cs b/backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictTypeDto.cs new file mode 100644 index 0000000..dd9ebb4 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictTypeDto.cs @@ -0,0 +1,86 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :码表类型 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 9:56:00 + /// 描 述 : + /// + public class DictTypeDto + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } + } + /// + /// 增加 + /// + public class DictTypeAddInput : DictTypeDto + { + + } + /// + /// 修改 + /// + public class DictTypeUpdateInput : DictTypeDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class DictTypeDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class DictTypeQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class DictTypeQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class DictTypeOutput : DictTypeDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DictService/Services/DictDataService.cs b/backend/BPA.MES.Base.Application/Services/DictService/Services/DictDataService.cs new file mode 100644 index 0000000..3830f83 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DictService/Services/DictDataService.cs @@ -0,0 +1,123 @@ +using System.Reflection; + +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :码表管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 10:01:19 + /// 描 述 : + /// + [ApiDescriptionSettings("数据字典", Name = "DictData", Tag = "字典数据", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class DictDataService: IDictDataService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public DictDataService(ISqlSugarClient db) + { + _dbContext = db; + + + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(DictDataAddInput input) + { + DictDataEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(DictDataDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + DictDataOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(DictDataQueryInput input) + { + if (!string.IsNullOrEmpty(input.TypeCode)) + { + var typeentity = await _dbContext.Queryable().Where(x => x.Code == input.TypeCode).FirstAsync(); + if (typeentity != null) + { + input.TypeId = typeentity.Id; + } + } + var entity = await _dbContext.Queryable().WhereIF(!string.IsNullOrEmpty(input.TypeId), x => x.TypeId == input.TypeId).ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(DictDataQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Value), x => x.Value.Contains(input.Value)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .WhereIF(!string.IsNullOrEmpty(input.TypeId),x=>x.TypeId==input.TypeId) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Value + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(DictDataUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DictService/Services/DictTypeService.cs b/backend/BPA.MES.Base.Application/Services/DictService/Services/DictTypeService.cs new file mode 100644 index 0000000..9179b73 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DictService/Services/DictTypeService.cs @@ -0,0 +1,110 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :码表类型管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 10:01:35 + /// 描 述 : + /// + [ApiDescriptionSettings("数据字典", Name = "DictType", Tag = "字典类型", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class DictTypeService : IDictTypeService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public DictTypeService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(DictTypeAddInput input) + { + DictTypeEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(DictTypeDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + DictTypeOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(DictTypeQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(DictTypeQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(DictTypeUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } + } \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/DictService/Services/IDictDataService.cs b/backend/BPA.MES.Base.Application/Services/DictService/Services/IDictDataService.cs new file mode 100644 index 0000000..fc989fd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DictService/Services/IDictDataService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :码表数据 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 10:00:06 + /// 描 述 : + /// + public interface IDictDataService + { + /// + /// 增加 + /// + /// + Task Add(DictDataAddInput input); + /// + /// 移除 + /// + /// + Task Del(DictDataDelInput input); + /// + /// 更新 + /// + /// + Task Update(DictDataUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(DictDataQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(DictDataQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/DictService/Services/IDictTypeService.cs b/backend/BPA.MES.Base.Application/Services/DictService/Services/IDictTypeService.cs new file mode 100644 index 0000000..be8b79d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/DictService/Services/IDictTypeService.cs @@ -0,0 +1,44 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/9 10:00:23 + /// 描 述 : + /// + public interface IDictTypeService + { + /// + /// 增加 + /// + /// + Task Add(DictTypeAddInput input); + /// + /// 移除 + /// + /// + Task Del(DictTypeDelInput input); + /// + /// 更新 + /// + /// + Task Update(DictTypeUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(DictTypeQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(DictTypeQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} + diff --git a/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Dtos/FinalsInfoDto.cs b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Dtos/FinalsInfoDto.cs new file mode 100644 index 0000000..055da75 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Dtos/FinalsInfoDto.cs @@ -0,0 +1,87 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :成品管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 15:59:39 + /// 描 述 : + /// + public class FinalsInfoDto + { + /// + /// 成品编号 + /// + public string Code { get; set; } + /// + /// 成品名称 + /// + public string Name { get; set; } + /// + /// 配方Id + /// + public string RecipeId { get; set; } + /// + /// 工艺Id + /// + public string CraftId { get; set; } + } + /// + /// 增加 + /// + public class FinalsInfoAddInput : FinalsInfoDto + { + + } + /// + /// 更新 + /// + public class FinalsInfoUpdateInput : FinalsInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class FinalsInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class FinalsInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class FinalsInfoOutput : FinalsInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 配方名称 + /// + public string RecipeName { get; set; } + /// + /// 工艺名称 + /// + public string CraftName { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/FinalsInfoService.cs b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/FinalsInfoService.cs new file mode 100644 index 0000000..b258d0c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/FinalsInfoService.cs @@ -0,0 +1,123 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :成品管理服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :基础数据管理 + /// + [ApiDescriptionSettings("基础数据管理", Order = 4, Name = "FinalsInfo", Tag = "成品管理服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class FinalsInfoService : IFinalsInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public FinalsInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(FinalsInfoAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + Pztj_FinalsInfoEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(FinalsInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + FinalsInfoOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(FinalsInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.CraftId==b.Id) + .LeftJoin((a, b, c) => a.RecipeId == c.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name),a=>a.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), a => a.Name.Contains(input.Code)) + .Select((a,b,c)=> new FinalsInfoOutput + { + Id = a.Id.SelectAll(), + RecipeName = c.Name, + CraftName = b.Name + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(FinalsInfoUpdateInput input) + { + Pztj_FinalsInfoEntity entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} + diff --git a/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/IFinalsInfoService.cs b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/IFinalsInfoService.cs new file mode 100644 index 0000000..2830188 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/FinalsInfoService/Services/IFinalsInfoService.cs @@ -0,0 +1,49 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :成品信息管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 16:02:25 + /// 描 述 : + /// + public interface IFinalsInfoService + { + /// + /// 增加 + /// + /// + Task Add(FinalsInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(FinalsInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(FinalsInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(FinalsInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} + diff --git a/backend/BPA.MES.Base.Application/Services/ICRUDService.cs b/backend/BPA.MES.Base.Application/Services/ICRUDService.cs new file mode 100644 index 0000000..5413cda --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ICRUDService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:59:30 + /// 描 述 : + /// + public interface ICRUDService + { + /// + /// 增加 + /// + /// + Task Add(T input); + /// + /// 移除 + /// + /// + Task Del(T input); + /// + /// 更新 + /// + /// + Task Update(T input); + /// + /// 不分页列表 + /// + /// + Task> List(T input); + /// + /// 分页列表 + /// + /// + Task> PagedList(T input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/KepServerDataService/Dto/DataVDataDto.cs b/backend/BPA.MES.Base.Application/Services/KepServerDataService/Dto/DataVDataDto.cs new file mode 100644 index 0000000..faf4fe2 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/KepServerDataService/Dto/DataVDataDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.KepServerDataService.Dto +{ + public class DataVDataDto + { + public string Key { get; set; } + + public string Value { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/KepServerDataService/Services/IKepDataService.cs b/backend/BPA.MES.Base.Application/Services/KepServerDataService/Services/IKepDataService.cs new file mode 100644 index 0000000..6971bf4 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/KepServerDataService/Services/IKepDataService.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.KepServerDataService.Services +{ + + public interface IKepDataService + { + Task> GetList(); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/KepServerDataService/Services/KepDataService.cs b/backend/BPA.MES.Base.Application/Services/KepServerDataService/Services/KepDataService.cs new file mode 100644 index 0000000..51e2e59 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/KepServerDataService/Services/KepDataService.cs @@ -0,0 +1,224 @@ +using BPA.MES.Base.Application.Entitys.KepData; +using FreeRedis; +using Furion.ClayObject.Extensions; +using Furion.RemoteRequest; +using Newtonsoft.Json; +//using ServiceStack.Redis; +using SqlSugar; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Yitter.IdGenerator; +using static ServiceStack.Diagnostics.Events; + +namespace BPA.MES.Base.Application.Services.KepServerDataService.Services +{ + [AllowAnonymous] + [ApiDescriptionSettings("大屏数据", Order = 4, Name = "KepData", Tag = "大屏数据", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class KepDataService: KepServerSqlsugar, IKepDataService,ITransient, IDynamicApiController + { + public KepDataService() + { + + } + [HttpPost] + public async Task> GetList() + { + //to_days(now()) - to_days(o._TIMESTAMP) = 1 + // to_days(o._TIMESTAMP) = to_days(now()) + var list = KepDb.Queryable().AS("ch01_device1", "o").Where(" to_days(o._TIMESTAMP) = to_days(now())").ToList(); + //var data =await KepDb.Queryable().Where(x=> SqlFunc.DateIsSame(x._TIMESTAMP, DateTime.Now)).Take(1000).ToListAsync(); + //var dicdatass = KepDb.Queryable().GroupBy(x => x._NAME).Where(x => SqlFunc.DateIsSame(x._TIMESTAMP, DateTime.Now)).Select(x => x._NAME).ToArray(); + //var dicdata = KepDb.Queryable().GroupBy(x => x._NAME).Where(x => SqlFunc.DateIsSame(x._TIMESTAMP, DateTime.Now)).Select(x=>x._NAME).ToDictionary(); + Dictionary dic = new Dictionary(); + //DataTable table = new DataTable(); + //foreach (var item in dicdatass) + //{ + // var key = item.ToString(); + // var values = data.Where(x => x._NAME == key).Select(x=>x._VALUE).ToList(); + // dic.Add(key, values); + //} + //var JsonString = JsonConvert.SerializeObject(dic); + return list; + } + [HttpGet] + [AllowAnonymous] + public async Task DeleteKep() + { + var sql = "delete from ch01_device1 where 1=1 order by id limit 1000;"; + var list = KepDb.Ado.ExecuteCommand(sql); + return true; + } + + public async Task GetA1() + { + //await using (RedisClient client = new RedisClient("10.2.1.21", 6379, "1178661552398188544", 0)) + //{ + // if (client == null) return string.Empty; + // string configData = client.Get("ns=2;s=CH1.Device1.A1"); + // return configData; + + //} + return ""; + } + + + [HttpGet] + [AllowAnonymous] + public Task CodeFirst() + { + var types = Assembly.Load("BPA.MES.Base.Application").GetTypes() + .Where(x => x.GetCustomAttribute() != null + && x.Namespace == "BPA.MES.Base.Application.Entitys.KepData").ToArray(); + KepDb.CodeFirst.InitTables(types); + return Task.FromResult(true); + } + + + /// + /// 添加报警限制 + /// + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task AddDataVAlarmLimit(DataVAlarmLimit inputDto) + { + inputDto.Id = YitIdHelper.NextId().ToString(); + var res = await KepDb.Insertable(inputDto).ExecuteCommandAsync(); + return res > 0; + } + + /// + /// 修改报警限制 + /// + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task UpdateDataVAlarmLimit(DataVAlarmLimit inputDto) + { + var res = await KepDb.Updateable(inputDto).ExecuteCommandAsync(); + return res > 0; + } + + /// + /// 获取报警限制 + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task> GetDataVAlarmLimitList(RequestPage input) + { + var entity = await KepDb.Queryable() + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + + /// + /// 删除报警限制 + /// + /// + [HttpPost] + [AllowAnonymous] + public async Task DelDataVAlarmLimitList(string id) + { + var res = await KepDb.Deleteable().Where(x=>x.Id==id).ExecuteCommandAsync(); + return res>0; + } + + [HttpGet] + [AllowAnonymous] + public Dictionary GetDataVList() + { + + // var client = new ServiceStack.Redis.RedisClient("10.2.1.21", 6379, "1178661552398188544"); + + //var client = new RedisClient("10.2.1.21:6379,password=1178661552398188544,defaultDatabase=13"); + + + try + { + var client = new FreeRedis.RedisClient("10.2.1.21:6379,password=1178661552398188544,defaultDatabase=0"); + var res = new Dictionary(); + + for (int i = 1; i <= 28; i++) + { + var str = "ns=2;WFZ.Device1.A" + i; + var value = client.Get(str); + if (!string.IsNullOrEmpty(value)&&i!=4) + { + if (value.Length>=4) + { + value = value.Substring(0, 2); + } + } + res.Add("Device1.A" + i, value); + } + for (int i = 1; i <=31; i++) + { + var str = "ns=2;WFZ.Device2.A" + i; + var value = client.Get(str); + if (!string.IsNullOrEmpty(value) ) + { + if (value.Length >= 4) + { + value = value.Substring(0, 2); + } + } + res.Add("Device2.A" + i, value); + } + for (int i = 1; i <=7; i++) + { + var str = "ns=2;WFZ.Device3.A" + i; + var value = client.Get(str); + res.Add("Device3.A" + i, value); + } + for (int i = 1; i <= 1; i++) + { + var str = "ns=2;WFZ.Device4.A" + i; + var value = client.Get(str); + res.Add("Device4.A" + i, value); + } + return res; + } + catch (Exception e) + { + var res = new Dictionary(); + return res; + + } + + } + + [HttpGet] + [AllowAnonymous] + public async Task>> GetLogsAsync() + { + var result = new List>(); + var entity = await KepDb.Queryable().Where(x=>x.CreateTime.Date==DateTime.Now.Date).ToListAsync(); + + foreach (var item in entity) + { + var data = new List(); + var thisData = new object(); + + thisData = item.GetType().GetProperty("Name").GetValue(item, null); + data.Add(thisData == null ? "" : thisData.ToString()); + thisData = item.GetType().GetProperty("ValueStr").GetValue(item, null); + data.Add(thisData == null ? "" : thisData.ToString()); + thisData = item.GetType().GetProperty("CreateTime").GetValue(item, null); + data.Add(thisData == null ? "" : thisData.ToString()); + + result.Add(data); + } + return result; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Dtos/AlarmLogDto.cs b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/AlarmLogDto.cs new file mode 100644 index 0000000..66420fd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/AlarmLogDto.cs @@ -0,0 +1,123 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 :2023/8/21 10:20:37 + /// 描 述 : + /// + public class AlarmLogDto + { + /// + /// 报警信息 + /// + public string MsgInfo { get; set; } + /// + /// 报警值 + /// + public string Value { get; set; } + /// + /// 报警等级 + /// + public string Grade { get; set; } + /// + /// 类型 + /// + public string LogType { get; set; } + /// + /// 设备名称 + /// + public string DeviceName { get; set; } + /// + /// 日期 + /// + public string Date { get; set; } + /// + /// 时间 + /// + public string Time { get; set; } + /// + /// 日志消息 + /// + public DateTime CreateDate { get; set; } + + } + /// + /// 增加 + /// + public class AlarmLogAddInput : AlarmLogDto + { + + } + /// + /// 更新 + /// + public class AlarmLogUpdateInput : AlarmLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class AlarmLogDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class AlarmLogQueryInput + { + + } + /// + /// 分页 + /// + public class AlarmLogQueryPageInput : RequestPage + { + /// + /// 报警信息 + /// + public string MsgInfo { get; set; } + + /// + /// 报警值 + /// + public string Value { get; set; } + + /// + /// 报警等级 + /// + public string Grade { get; set; } + + /// + /// 设备名称 + /// + public string DeviceName { get; set; } + /// + /// 开始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + } + /// + /// 输出 + /// + public class AlarmLogOutput : AlarmLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Dtos/ProgramLogDto.cs b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/ProgramLogDto.cs new file mode 100644 index 0000000..b39966a --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/ProgramLogDto.cs @@ -0,0 +1,101 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:20:55 + /// 描 述 : + /// + public class ProgramLogDto + { + /// + /// 日志类型 + /// + public string LogType { get; set; } + + /// + /// 日志消息 + /// + public string MsgInfo { get; set; } + /// + /// 日期 + /// + public string Date { get; set; } + /// + /// 时间 + /// + public string Time { get; set; } + /// + /// 日志消息 + /// + public DateTime CreateDate { get; set; } + } + /// + /// 增加 + /// + public class ProgramLogAddInput : ProgramLogDto + { + + } + /// + /// 更新 + /// + public class ProgramLogUpdateInput : ProgramLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class ProgramLogDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class ProgramLogQueryInput + { + + } + /// + /// 分页 + /// + public class ProgramLogQueryPageInput : RequestPage + { + /// + /// 日志类型 + /// + public string LogType { get; set; } + + /// + /// 日志消息 + /// + public string MsgInfo { get; set; } + /// + /// 开始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + } + /// + /// 输出 + /// + public class ProgramLogOutput : ProgramLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Dtos/RunLogDto.cs b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/RunLogDto.cs new file mode 100644 index 0000000..da4598b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/RunLogDto.cs @@ -0,0 +1,99 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:21:11 + /// 描 述 : + /// + public class RunLogDto + { + /// + /// 日志类别 + /// + public string LogType { get; set; } + /// + /// 日志消息 + /// + public string MsgInfo { get; set; } + /// + /// 日期 + /// + public string Date { get; set; } + /// + /// 时间 + /// + public string Time { get; set; } + /// + /// 日志消息 + /// + public DateTime CreateDate { get; set; } + } + /// + /// 增加 + /// + public class RunLogAddInput : RunLogDto + { + + } + /// + /// 更新 + /// + public class RunLogUpdateInput : RunLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class RunLogDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class RunLogQueryInput + { + + } + /// + /// 分页 + /// + public class RunLogQueryPageInput : RequestPage + { + /// + /// 日志类别 + /// + public string LogType { get; set; } + /// + /// 日志消息 + /// + public string MsgInfo { get; set; } + /// + /// 开始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + } + /// + /// 输出 + /// + public class RunLogOutput : RunLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Dtos/UserLogDto.cs b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/UserLogDto.cs new file mode 100644 index 0000000..7216d5b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Dtos/UserLogDto.cs @@ -0,0 +1,91 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :用户权限 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:21:40 + /// 描 述 : + /// + public class UserLogDto + { + /// + /// 权限 + /// + public string Permission { get; set; } + + /// + /// 用户名 + /// + public string UserName { get; set; } + + /// + /// 日志消息 + /// + public string MsgInfo { get; set; } + /// + /// 日志时间 + /// + public DateTime CreateDate { get; set; } + } + /// + /// 增加 + /// + public class UserLogAddInput : UserLogDto + { + + } + /// + /// 更新 + /// + public class UserLogUpdateInput : UserLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class UserLogDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class UserLogQueryInput + { + + } + /// + /// 分页 + /// + public class UserLogQueryPageInput : RequestPage + { + + /// + /// 用户名 + /// + public string UserName { get; set; } + + /// + /// 日志消息 + /// + public string MsgInfo { get; set; } + } + /// + /// 输出 + /// + public class UserLogOutput : UserLogDto + { + /// + /// 主键 + /// + public string Id { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/AlarmLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/AlarmLogService.cs new file mode 100644 index 0000000..4b27e13 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/AlarmLogService.cs @@ -0,0 +1,100 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :报警日志 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/8/21 11:02:36 + /// 描 述 : + /// + [ApiDescriptionSettings("数据日志", Name = "AlarmLog", Tag = "报警日志", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class AlarmLogService : IAlarmLogService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public AlarmLogService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(AlarmLogAddInput input) + { + AlarmLogEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(AlarmLogDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + AlarmLogOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(AlarmLogQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(AlarmLogQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.DeviceName), x => x.DeviceName.Contains(input.DeviceName)) + .WhereIF(!string.IsNullOrEmpty(input.Grade), x => x.Grade.Contains(input.Grade)) + .WhereIF(!string.IsNullOrEmpty(input.MsgInfo), x => x.MsgInfo.Contains(input.MsgInfo)) + .WhereIF(!string.IsNullOrEmpty(input.Value), x => x.Value.Contains(input.Value)) + .WhereIF(input.StartTime.HasVal(), x => x.CreateDate >= input.StartTime.Value) + .WhereIF(input.EndTime.HasVal(), x => x.CreateDate <= input.EndTime.Value) + .OrderByDescending(x=>x.CreateDate) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(AlarmLogUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/IAlarmLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/IAlarmLogService.cs new file mode 100644 index 0000000..a6c9d1b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/IAlarmLogService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:30:26 + /// 描 述 : + /// + public interface IAlarmLogService + { + /// + /// 增加 + /// + /// + Task Add(AlarmLogAddInput input); + /// + /// 移除 + /// + /// + Task Del(AlarmLogDelInput input); + /// + /// 更新 + /// + /// + Task Update(AlarmLogUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(AlarmLogQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(AlarmLogQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/IProgramLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/IProgramLogService.cs new file mode 100644 index 0000000..b8e5ae3 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/IProgramLogService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:30:39 + /// 描 述 : + /// + public interface IProgramLogService + { + /// + /// 增加 + /// + /// + Task Add(ProgramLogAddInput input); + /// + /// 移除 + /// + /// + Task Del(ProgramLogDelInput input); + /// + /// 更新 + /// + /// + Task Update(ProgramLogUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(ProgramLogQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(ProgramLogQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/IRunLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/IRunLogService.cs new file mode 100644 index 0000000..13687cd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/IRunLogService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:30:53 + /// 描 述 : + /// + public interface IRunLogService + { + /// + /// 增加 + /// + /// + Task Add(RunLogAddInput input); + /// + /// 移除 + /// + /// + Task Del(RunLogDelInput input); + /// + /// 更新 + /// + /// + Task Update(RunLogUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(RunLogQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(RunLogQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/IUserLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/IUserLogService.cs new file mode 100644 index 0000000..e53ad63 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/IUserLogService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/21 10:31:05 + /// 描 述 : + /// + public interface IUserLogService + { + /// + /// 增加 + /// + /// + Task Add(UserLogAddInput input); + /// + /// 移除 + /// + /// + Task Del(UserLogDelInput input); + /// + /// 更新 + /// + /// + Task Update(UserLogUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(UserLogQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(UserLogQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/ProgramLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/ProgramLogService.cs new file mode 100644 index 0000000..c169424 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/ProgramLogService.cs @@ -0,0 +1,98 @@ +namespace BPA.MES.Base.Application.Services.LogService.Services +{ + /// + /// 名 称 :系统日志 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/8/21 11:16:20 + /// 描 述 : + /// + [ApiDescriptionSettings("数据日志", Name = "ProgramLog", Tag = "系统日志", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class ProgramLogService : IProgramLogService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public ProgramLogService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(ProgramLogAddInput input) + { + ProgramLogEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(ProgramLogDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + ProgramLogOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(ProgramLogQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(ProgramLogQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(input.LogType != null, x => x.LogType == input.LogType) + .WhereIF(!string.IsNullOrEmpty(input.MsgInfo), x => x.MsgInfo.Contains(input.MsgInfo)) + .WhereIF(input.StartTime.HasVal(), x => x.CreateDate >= input.StartTime.Value) + .WhereIF(input.EndTime.HasVal(), x => x.CreateDate <= input.EndTime.Value) + .OrderByDescending(x => x.CreateDate) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(ProgramLogUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/RunLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/RunLogService.cs new file mode 100644 index 0000000..759ef34 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/RunLogService.cs @@ -0,0 +1,99 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :运行日志 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/8/21 11:16:32 + /// 描 述 : + /// + [ApiDescriptionSettings("数据日志", Name = "RunLog", Tag = "运行日志", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class RunLogService : IRunLogService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public RunLogService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(RunLogAddInput input) + { + RunLogEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(RunLogDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + RunLogOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(RunLogQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(RunLogQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.LogType), x => x.LogType.Contains(input.LogType)) + .WhereIF(!string.IsNullOrEmpty(input.MsgInfo), x => x.MsgInfo.Contains(input.MsgInfo)) + .WhereIF(input.StartTime.HasVal(), x => x.CreateDate >= input.StartTime.Value) + .WhereIF(input.EndTime.HasVal(), x => x.CreateDate <= input.EndTime.Value) + //.SplitTable(input.StartTime.Value, input.EndTime.Value) + .OrderByDescending(x => x.CreateDate) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(RunLogUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/LogService/Services/UserLogService.cs b/backend/BPA.MES.Base.Application/Services/LogService/Services/UserLogService.cs new file mode 100644 index 0000000..af24f2a --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/LogService/Services/UserLogService.cs @@ -0,0 +1,95 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :用户操作日志 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/8/21 11:16:44 + /// 描 述 : + /// + [ApiDescriptionSettings("数据日志", Name = "UserLog", Tag = "用户操作日志", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class UserLogService : IUserLogService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public UserLogService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(UserLogAddInput input) + { + UserLogEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(UserLogDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + UserLogOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(UserLogQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(UserLogQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.UserName), x => x.UserName.Contains(input.UserName)) + .WhereIF(!string.IsNullOrEmpty(input.MsgInfo), x => x.MsgInfo.Contains(input.MsgInfo)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(UserLogUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/MaterialService/Dtos/MaterialsInfoDto.cs b/backend/BPA.MES.Base.Application/Services/MaterialService/Dtos/MaterialsInfoDto.cs new file mode 100644 index 0000000..1404191 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/MaterialService/Dtos/MaterialsInfoDto.cs @@ -0,0 +1,97 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :设备Dto类 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 16:12:06 + /// 描 述 : + /// + public class MaterialsInfoDto + { + /// + /// 原料名称 + /// + /// + public string Name { get; set; } + /// + /// 原料编号 + /// + /// + public string Code { get; set; } + /// + /// 原料单位 + /// + /// + public string Unit { get; set; } + /// + /// 原料分组 + /// + /// + public string Type { get; set; } + /// + /// 每升重量 + /// + + public string WeightPerLiter { get; set; } + } + /// + /// 增加 + /// + public class MaterialsInfoAddInput : MaterialsInfoDto + { + + } + /// + /// 更新 + /// + public class MaterialsInfoUpdateInput : MaterialsInfoDto + { + /// + /// 主键 + /// + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class MaterialsInfoDelInput + { + /// + /// 主键 + /// + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class MaterialsInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + /// + public string Name { get; set; } + /// + /// 编码 + /// + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class MaterialsInfoOutput : MaterialsInfoDto + { + /// + /// 主键 + /// + /// + public string Id { get; set; } + /// + /// 类型名称 + /// + public string TypeName { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/MaterialService/Services/IMaterialsInfoService.cs b/backend/BPA.MES.Base.Application/Services/MaterialService/Services/IMaterialsInfoService.cs new file mode 100644 index 0000000..d38613d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/MaterialService/Services/IMaterialsInfoService.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :物料服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 18:31:53 + /// 描 述 : + /// + public interface IMaterialsInfoService + { + /// + /// 增加 + /// + /// + Task Add(MaterialsInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(MaterialsInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(MaterialsInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(MaterialsInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/MaterialService/Services/MaterialsInfoService.cs b/backend/BPA.MES.Base.Application/Services/MaterialService/Services/MaterialsInfoService.cs new file mode 100644 index 0000000..269dfae --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/MaterialService/Services/MaterialsInfoService.cs @@ -0,0 +1,133 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :原料服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023年7月17日15:41:09 + /// 描 述 :基础数据管理 + /// + [ApiDescriptionSettings("基础数据管理", Order = 2, Name = "MaterialsInfo", Tag = "原料服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class MaterialsInfoService : IMaterialsInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public MaterialsInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(MaterialsInfoAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + Pztj_MaterialsInfoEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(MaterialsInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var output = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.Type==b.Id) + .Where((a,b)=> a.Id == Id) + .Select((a,b)=>new MaterialsInfoOutput + { + Id=a.Id.SelectAll(), + TypeName = b.Value + }) + .FirstAsync(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var output = await _dbContext.Queryable() + .LeftJoin((a, b) => a.Type == b.Id) + .Select((a, b) => new MaterialsInfoOutput + { + Id = a.Id.SelectAll(), + TypeName = b.Value + }) + .ToListAsync(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(MaterialsInfoQueryPageInput input) + { + var output = await _dbContext.Queryable() + .LeftJoin((a, b) => a.Type == b.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => a.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), (a, b) => a.Code.Contains(input.Code)) + .Select((a, b) => new MaterialsInfoOutput + { + Id = a.Id.SelectAll(), + TypeName = b.Value + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(MaterialsInfoUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/OperLogService/Dtos/OperLogDto.cs b/backend/BPA.MES.Base.Application/Services/OperLogService/Dtos/OperLogDto.cs new file mode 100644 index 0000000..2c61f9f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/OperLogService/Dtos/OperLogDto.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 15:15:48 + /// 描 述 : + /// + public class OperLogDto + { + /// + /// 操作标题 + /// + public string Name { get; set; } + /// + /// 内容 + /// + public string Context { get; set; } + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + } + /// + /// 增加 + /// + public class OperLogAddInput: OperLogDto + { + } + +} diff --git a/backend/BPA.MES.Base.Application/Services/OperLogService/Services/IOperLogService.cs b/backend/BPA.MES.Base.Application/Services/OperLogService/Services/IOperLogService.cs new file mode 100644 index 0000000..5156141 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/OperLogService/Services/IOperLogService.cs @@ -0,0 +1,17 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :日志服务 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 15:17:58 + /// 描 述 : + /// + public interface IOperLogService + { + /// + /// 增加 + /// + /// + Task Add(WorkInfoAddInput input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/OperLogService/Services/OperLogService.cs b/backend/BPA.MES.Base.Application/Services/OperLogService/Services/OperLogService.cs new file mode 100644 index 0000000..7f2e3c0 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/OperLogService/Services/OperLogService.cs @@ -0,0 +1,12 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :操作日志 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 15:17:24 + /// 描 述 : + /// + public class OperLogService + { + } +} diff --git a/backend/BPA.MES.Base.Application/Services/OrderService/Dtos/OrderBaseDto.cs b/backend/BPA.MES.Base.Application/Services/OrderService/Dtos/OrderBaseDto.cs new file mode 100644 index 0000000..6724fbe --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/OrderService/Dtos/OrderBaseDto.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.OrderService.Dtos +{ + public class OrderBaseDto + { + public string Id { get; set; } + + + /// + /// 状态 + /// + public int Status { get; set; } + + /// + /// 分配进度 + /// + public decimal AllocationRate { get; set; } + + /// + /// 生产进度 + /// + public decimal ProduceRate { get; set; } + + public decimal ProduceSum { get; set; } + + public DateTime CreateTime { get; set; } + + public List OrderInfos { get; set; } + } + + public class OrderInfoBaseDto + { + public string Id { get; set; } + + public string OrderId { get; set; } + + /// + /// 成品 + /// + public string FinalslId { get; set; } + + public string FinalslName { get; set; } + + /// + /// 产线 + /// + public string ProductionLineId { get; set; } + + public string ProductionLineName { get; set; } + + public string CreateTime { get; set; } + + /// + /// 数量 + /// + public decimal Number { get; set; } + public WorkOrderStatusEnum? Status { get; set; } + } + + /// + /// 成品数量限制 + /// + public class OrderWorkLimit + { + /// + /// 成品 + /// + public string FinalslId { get; set; } + + public decimal Limit { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/OrderService/Dtos/OrderQueryPageInput.cs b/backend/BPA.MES.Base.Application/Services/OrderService/Dtos/OrderQueryPageInput.cs new file mode 100644 index 0000000..fda408d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/OrderService/Dtos/OrderQueryPageInput.cs @@ -0,0 +1,16 @@ +using BPA.MES.Base.Application.Const; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.OrderService.Dtos +{ + public class OrderQueryPageInput: RequestPage + { + public string Id { get; set; } + + public string Status { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/OrderService/Service/IOrderService.cs b/backend/BPA.MES.Base.Application/Services/OrderService/Service/IOrderService.cs new file mode 100644 index 0000000..c06f8ca --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/OrderService/Service/IOrderService.cs @@ -0,0 +1,57 @@ +using BPA.MES.Base.Application.Services.OrderService.Dtos; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.OrderService.Service +{ + public interface IOrderService + { + /// + /// 分页列表 + /// + /// + Task> PagedList(OrderQueryPageInput input); + + /// + /// 新增 + /// + /// + /// + Task Add(List inputDto); + + /// + /// 修改 + /// + /// + /// + + Task Update(List inputDto); + + /// + /// 获取订单的商品 + /// + /// + /// + Task> GetOrderMaterial(string OrderId); + + + /// + /// 添加工单 并绑定订单 + /// + /// + /// + Task OrderAssociationWork(List inputDto); + + /// + /// 获取成品剩余制作数量 + /// + /// + /// + Task> GetFinalslLImit(string OrderId); + + Task CodeFirst(); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/OrderService/Service/OrderService.cs b/backend/BPA.MES.Base.Application/Services/OrderService/Service/OrderService.cs new file mode 100644 index 0000000..a3c725d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/OrderService/Service/OrderService.cs @@ -0,0 +1,374 @@ +using BPA.MES.Base.Application.Const; +using BPA.MES.Base.Application.Entitys.Order; +using BPA.MES.Base.Application.Services.OrderService.Dtos; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Yitter.IdGenerator; + +namespace BPA.MES.Base.Application.Services.OrderService.Service +{ + [ApiDescriptionSettings("订单管理", Order = 2, Name = "Order", Tag = "订单信息", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class OrderService : IOrderService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public OrderService(ISqlSugarClient db) + { + _dbContext = db; + } + + /// + /// 分页列表 + /// + /// + [HttpPost] + public async Task> PagedList(OrderQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Id), a => a.Id.Contains(input.Id)) + .WhereIF(!string.IsNullOrEmpty(input.Status), a => ((int)a.Status).ToString()==input.Status) + .Select((x) => new OrderBaseDto + { + Id = x.Id.SelectAll(), + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + + + var orderIds= entity.Items.Select(x => x.Id); + + var itemList = await _dbContext.Queryable() + .Where(x => orderIds.Contains(x.OrderId)) + .ToListAsync(); + + var list = await _dbContext.Queryable() + .LeftJoin((a, b) => a.FinalId == b.Id) + .LeftJoin((a, b, c) => a.LineId == c.Id) + .LeftJoin((a, b, c, d) => d.Id == SqlFunc.Subqueryable().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) + .LeftJoin((a, b, c, d,e) =>a.Id==e.WorkId ) + .Where((a, b, c, d, e)=> orderIds.Contains(e.OrderId)) + .Select((a, b, c, d,e) => new OrderInfoBaseDto + { + FinalslId=a.FinalId, + FinalslName=b.Name, + Number=string.IsNullOrEmpty(a.Number)?0:Convert.ToInt32(a.Number), + OrderId=e.OrderId, + ProductionLineId=a.LineId, + ProductionLineName=c.Name, + Id = a.Id, + CreateTime=a.CreateTime.ToString(), + Status = d.Status == null ? WorkOrderStatusEnum.Draft : d.Status + }).ToListAsync(); + + SqlSugarPagedList output = entity.Adapt>(); + foreach (var item in output.Items) + { + item.OrderInfos= list.Where(x=>x.OrderId==item.Id).ToList(); + item.ProduceRate= list.Where(x => x.OrderId == item.Id&&x.Status== WorkOrderStatusEnum.Completed).Count(); + item.ProduceSum = itemList.Where(x => x.OrderId == item.Id).Sum(x => x.Number); + } + return output; + } + + /// + /// 新增 + /// + /// + /// + [HttpPost] + public async Task Add(List inputDto) + { + + try + { + + _dbContext.Ado.BeginTran(); + OrderEntity order = new OrderEntity(); + var res = await _dbContext.Insertable(order) + .IgnoreColumns(ignoreNullColumn: true) + .ExecuteCommandIdentityIntoEntityAsync(); + if (res) + { + List orderInfo = inputDto.Adapt>(); + orderInfo = orderInfo.GroupBy(x => x.FinalslId).Select(x => new OrderInfoEntity() + { + CreateTime = DateTime.Now, + FinalslId = x.Key, + Number = x.Sum(y => y.Number), + }).ToList(); + foreach (var item in orderInfo) + { + item.Id = YitIdHelper.NextId().ToString(); + item.OrderId = order.Id; + } + res = await _dbContext.Insertable(orderInfo) + .ExecuteCommandIdentityIntoEntityAsync(); + } + + _dbContext.Ado.CommitTran(); + return res; + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + return false; + } + } + + /// + /// 修改 + /// + /// + /// + [HttpPost] + public async Task Update(List inputDto) + { + try + { + + _dbContext.Ado.BeginTran(); + var orderId = inputDto.Select(x => x.OrderId).First(); + + //删除原来的所有 + var res = await _dbContext.Deleteable(x => x.OrderId == orderId).ExecuteCommandHasChangeAsync(); + + List orderInfo = inputDto.Adapt>(); + orderInfo = orderInfo.GroupBy(x => x.FinalslId).Select(x => new OrderInfoEntity() + { + CreateTime = DateTime.Now, + FinalslId = x.Key, + Number = x.Sum(y => y.Number), + }).ToList(); + foreach (var item in orderInfo) + { + item.Id = YitIdHelper.NextId().ToString(); + item.OrderId = orderId; + } + res = await _dbContext.Insertable(orderInfo) + .ExecuteCommandIdentityIntoEntityAsync(); + + + _dbContext.Ado.CommitTran(); + return res; + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + return false; + } + } + + /// + /// 删除 + /// + /// + /// + [HttpPost] + public async Task Del(string Id) + { + + try + { + _dbContext.Ado.BeginTran(); + + var res = await _dbContext.Deleteable().Where(x => x.Id == Id).ExecuteCommandHasChangeAsync(); + if (res) + { + res = await _dbContext.Deleteable().Where(x => x.OrderId == Id).ExecuteCommandHasChangeAsync(); + } + _dbContext.Ado.CommitTran(); + return res; + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + return false; + } + } + + /// + /// 获取订单的商品 + /// + /// + /// + [HttpGet] + public async Task> GetOrderMaterial(string OrderId) + { + + var res = await _dbContext.Queryable().Where(x => x.OrderId == OrderId) + .Select(x => new OrderInfoBaseDto() + { + + Id = x.Id, + FinalslId = x.FinalslId, + Number = x.Number, + OrderId = x.OrderId, + }) + .ToListAsync(); + return res; + } + + + /// + /// 添加工单 并绑定订单 + /// + /// + /// + public async Task OrderAssociationWork(List inputDto) + { + var result = false; + var orderId = inputDto.Select(x => x.OrderId).First(); + //验证 + VerifyOrderProduct(inputDto); + _dbContext.Ado.BeginTran(); + + try + { + foreach (var item in inputDto) + { + Pztj_WorkInfoEntity entity = new Pztj_WorkInfoEntity() + { + CreateTime = DateTime.Now, + FinalId = item.FinalslId, + LineId = item.ProductionLineId, + Name = "", + Number = item.Number.ToString(), + + }; + var res= await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); + Pztj_WorkInfoStatusEntity pztj_WorkInfoStatusEntity = new() + { + Status = WorkOrderStatusEnum.Draft, + WorkId = entity.Id + }; + if (res >0) + { + res= await _dbContext.Insertable(pztj_WorkInfoStatusEntity).IgnoreColumns(true).ExecuteCommandAsync(); + if (res>0) + { + res = await _dbContext.Insertable(new OrderWorkEntity() + { + OrderId = orderId, + WorkId=entity.Id + }).IgnoreColumns(true).ExecuteCommandAsync(); + if (res>0) + { + var order=_dbContext.Queryable< OrderEntity >().First(x=>x.Id==orderId); + order.Status = OrderStatusEnum.Ongoing; + //修改订单状态 + res =await _dbContext.Updateable(order).ExecuteCommandAsync(); + if (res<=0) + { + _dbContext.Ado.RollbackTran(); + return false; + } + + } + else + { + _dbContext.Ado.RollbackTran(); + return false; + } + } + else + { + _dbContext.Ado.RollbackTran(); + return false; + } + } + else + { + _dbContext.Ado.RollbackTran(); + return false; + } + } + } + catch + { + _dbContext.Ado.RollbackTran(); + throw Oops.Bah("添加失败!"); + } + _dbContext.Ado.CommitTran(); + return true; + } + + /// + /// 生成工单时验证成品数量 + /// + /// + private void VerifyOrderProduct(List inputDto) + { + var orderId = inputDto.Select(x => x.OrderId).First(); + var data=_dbContext.Queryable((a,b)=>new JoinQueryInfos( + JoinType.Left,a.FinalslId==b.Id + )).Where((a,b)=>a.OrderId==orderId). + Select((a,b)=>new + { + orderId = a.OrderId, + ProductId = a.FinalslId, + productName = b.Name, + a.Number + }).ToList(); + foreach (var item in data) + { + var productCount = inputDto.Where(x => x.FinalslId == item.ProductId).Sum(x => x.Number); + var count= item.Number - productCount; + if (count<0) + { + throw Oops.Bah($"{item.productName}成品生成工单数量大于订单数量,多【{System.Math.Abs(count)}】"); + } + + if (count>0) + { + throw Oops.Bah($"{item.productName}成品生成工单数量小于订单数量,差【{count}】"); + } + + } + } + + /// + /// 获取成品剩余制作数量 + /// + /// + /// + public async Task> GetFinalslLImit(string OrderId) + { + var result = new List(); + var orderInfo=_dbContext.Queryable().Where(x=>x.OrderId==OrderId).ToList(); + + var list=_dbContext.Queryable((a,b)=>new JoinQueryInfos( + JoinType.Left,a.WorkId==b.Id)) + .Where((a, b) => a.OrderId==OrderId) + .Select((a,b)=>new OrderWorkLimit() + { + FinalslId=b.FinalId, + Limit=0 + }).ToList(); + + foreach (var item in orderInfo) + { + var data=list.Where(x=>x.FinalslId==item.FinalslId).ToList(); + + result.Add(new OrderWorkLimit() + { + FinalslId=item.FinalslId, + Limit=item.Number-data.Sum(x=>x.Limit), + }); + } + return result; + + } + + [HttpGet] + public Task CodeFirst() + { + var types = Assembly.Load("BPA.MES.Base.Application").GetTypes() + .Where(x => x.GetCustomAttribute() != null + && x.Namespace == "BPA.MES.Base.Application.Entitys.Order").ToArray(); + _dbContext.CodeFirst.InitTables(types); + return Task.FromResult(true); + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/GroupInfoDto.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/GroupInfoDto.cs new file mode 100644 index 0000000..408f415 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/GroupInfoDto.cs @@ -0,0 +1,68 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产品分组 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/10 13:59:43 + /// 描 述 : + /// + public class GroupInfoDto + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 介绍 + /// + public string Des { get; set; } + } + /// + /// 增加 + /// + public class GroupInfoAddInput : GroupInfoDto + { + + } + /// + /// 更新 + /// + public class GroupInfoUpdateInput : GroupInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class GroupInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class GroupInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + } + /// + /// 输出 + /// + public class GroupInfoOutput : GroupInfoDto + { + /// + /// 主键 + /// + /// + public string Id { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDeviceDto.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDeviceDto.cs new file mode 100644 index 0000000..e8e6c26 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDeviceDto.cs @@ -0,0 +1,90 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产线设备 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 17:00:32 + /// 描 述 : + /// + public class ProductLineDeviceDto + { + /// + /// 产线Id + /// + public string LineId { get; set; } + /// + /// 产线设备 + /// + public string DeviceId { get; set; } + } + public class ProductLineDeviceAddInput: ProductLineDeviceDto { + + + } + /// + /// 产线设备不分页 + /// + public class ProductLineDeviceQueryInput + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 产线Id + /// + public string LineId { get; set; } + } + /// + /// 产线设备分页 + /// + public class ProductLineDeviceQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 产线Id + /// + public string LineId { get; set; } + } + /// + /// 删除产线设备 + /// + public class ProductLineDeviceDelInput: ProductLineDeviceDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 产线设备关联信息 + /// + public class ProductLineDeviceOutput: ProductLineDeviceDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 名称 + /// + /// 设备名称 + public string DeviceName { get; set; } + /// + /// 编码 + /// + public string DeviceCode { get; set; } + /// + /// 设备类型 + /// + public string DeviceType { get; set; } + /// + /// 设备描述 + /// + /// 设备描述 + public string Describe { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDto.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDto.cs new file mode 100644 index 0000000..f7215bf --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDto.cs @@ -0,0 +1,76 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产线管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/18 14:03:27 + /// 描 述 : + /// + public class ProductLineDto + { + /// + /// 产线名称 + /// + public string Name { get; set; } + /// + /// 产线编码 + /// + public string Code { get; set; } + /// + /// 产线描述 + /// + public string Describe { get; set; } + } + /// + /// 增加 + /// + public class ProductLineAddInput : ProductLineDto + { + + } + /// + /// 更新 + /// + public class ProductLineUpdateInput : ProductLineDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class ProductLineDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class ProductLineQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class ProductLineOutput : ProductLineDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + +} diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineStockDto.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineStockDto.cs new file mode 100644 index 0000000..6876119 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineStockDto.cs @@ -0,0 +1,99 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 18:25:18 + /// 描 述 : + /// + public class ProductLineStockDto + { + /// + /// 产线Id + /// + public string LineId { get; set; } + /// + /// 产线设备 + /// + public string StockId { get; set; } + } + public class ProductLineStockAddInput : ProductLineStockDto + { + + + } + /// + /// 产线设备不分页 + /// + public class ProductLineStockQueryInput + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 产线Id + /// + public string LineId { get; set; } + /// + /// 物料Id + /// + public string MaterialId { get; set; } + } + /// + /// 产线设备分页 + /// + public class ProductLineStockQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 产线Id + /// + public string LineId { get; set; } + } + /// + /// 删除产线设备 + /// + public class ProductLineStockDelInput : ProductLineStockDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 产线设备关联信息 + /// + public class ProductLineStockOutput : ProductLineStockDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 产线名称 + /// + public string LineName { get; set; } + /// + /// 名称 + /// + /// 设备名称 + public string StockName { get; set; } + /// + /// 编码 + /// + public string StockCode { get; set; } + /// + /// 物料信息 + /// + public string MaterialId { get; set; } + /// + /// 物料名称 + /// + public string MateriaName { get; set; } + } +} + diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/GroupInfoService.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/GroupInfoService.cs new file mode 100644 index 0000000..fcbcc6c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/GroupInfoService.cs @@ -0,0 +1,116 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :分组信息 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/10 14:03:06 + /// 描 述 : + /// + [ApiDescriptionSettings("产线管理", Order = 0, Name = "GroupInfo", Tag = "分组服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class GroupInfoService : IGroupInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public GroupInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(GroupInfoAddInput input) + { + GroupInfoEntity entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (entity != null) + { + throw Oops.Bah("名称已存在!"); + } + entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(GroupInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x=>x.Id==input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(); + GroupInfoOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost, AllowAnonymous] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(GroupInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(GroupInfoUpdateInput input) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id != input.Id && x.Name == input.Name); + if (entity != null) + { + throw Oops.Bah("名称已存在!"); + } + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IGroupInfoService.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IGroupInfoService.cs new file mode 100644 index 0000000..ed44933 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IGroupInfoService.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :分组信息 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/10 14:03:21 + /// 描 述 : + /// + public interface IGroupInfoService + { + /// + /// 增加 + /// + /// + Task Add(GroupInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(GroupInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(GroupInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 分页列表 + /// + /// + Task> PagedList(GroupInfoQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IProductLineService.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IProductLineService.cs new file mode 100644 index 0000000..e352cc8 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IProductLineService.cs @@ -0,0 +1,100 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产线管理 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/18 14:05:16 + /// 描 述 : + /// + public interface IProductLineService + { + /// + /// 增加 + /// + /// + Task Add(ProductLineAddInput input); + /// + /// 移除 + /// + /// + Task Del(ProductLineDelInput input); + /// + /// 更新 + /// + /// + Task Update(ProductLineUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(ProductLineQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + /// + /// 产线添加设备 + /// + /// + Task AddDevice(ProductLineDeviceAddInput input); + /// + /// 产线删除设备 + /// + /// + Task DeleteDevice(ProductLineDeviceDelInput input); + ///// + ///// 产线更新设备 + ///// + ///// + //Task UpdateDevice(string DeviceId); + /// + /// 产线设备不分页 + /// + /// + Task> DeviceList(ProductLineDeviceQueryInput input); + /// + /// 产线设备分页 + /// + /// + Task> DevicePageList(ProductLineDeviceQueryPageInput input); + + + /// + /// 产线添加料仓 + /// + /// + Task AddStock(ProductLineStockAddInput input); + /// + /// 产线删除料仓 + /// + /// + Task DeleteStock(ProductLineStockDelInput input); + ///// + ///// 产线更新料仓 + ///// + ///// + //Task UpdateStock(string StockId); + /// + /// 产线料仓不分页 + /// + /// + Task> StockList(ProductLineStockQueryInput input); + /// + /// 产线料仓分页 + /// + /// + Task> StockPageList(ProductLineStockQueryPageInput input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs new file mode 100644 index 0000000..2a64b93 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs @@ -0,0 +1,268 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :产线服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :基础数据管理 + /// + [ApiDescriptionSettings("产线管理", Order = 0, Name = "ProductLine", Tag = "产线服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class ProductLineService : IProductLineService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public ProductLineService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(ProductLineAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + ProductLineEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(ProductLineDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + ProductLineOutput output = entity.Adapt(); + return output; + } + + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(ProductLineQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Name.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(ProductLineUpdateInput input) + { + var isExit =await _dbContext.Queryable().Where(x => x.Id != input.Id && (x.Name == input.Name || x.Code == input.Code)).FirstAsync(); + if (isExit != null) + { + throw Oops.Bah("名称或编码已存在!"); + } + ProductLineEntity entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 产线添加设备 + /// + /// + [HttpPost] + public async Task AddDevice(ProductLineDeviceAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.DeviceId == input.DeviceId); + if (r_entity != null) + { + throw Oops.Bah("设备已存在!"); + } + Pztj_LineDevicesEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 产线删除设备 + /// + /// + [HttpPost] + public async Task DeleteDevice(ProductLineDeviceDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 产线设备不分页 + /// + /// + [HttpPost] + public async Task> DeviceList(ProductLineDeviceQueryInput input) + { + var output = await _dbContext.Queryable() + .LeftJoin((a, b) => a.DeviceId == b.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => b.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.LineId), (a, b) => a.LineId == input.LineId) + .Select((a, b) => new ProductLineDeviceOutput + { + DeviceId = a.DeviceId, + DeviceCode = b.Code, + DeviceName = b.Name, + Describe = b.Describe, + DeviceType = b.DeviceType, + Id = a.Id, + LineId = a.LineId + }). + ToListAsync(); + return output; + } + /// + /// 产线设备分页 + /// + /// + [HttpPost] + public async Task> DevicePageList(ProductLineDeviceQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.DeviceId==b.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => b.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.LineId), (a, b) => a.LineId == input.LineId) + .Select((a,b)=>new ProductLineDeviceOutput + { + DeviceId = a.DeviceId, + DeviceCode = b.Code, + DeviceName = b.Name, + Describe = b.Describe, + DeviceType = b.DeviceType, + Id = a.Id, + LineId = a.LineId + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return entity; + } + + + /// + /// 产线添加料仓 + /// + /// + [HttpPost] + public async Task AddStock(ProductLineStockAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.StockId == input.StockId); + if (r_entity != null) + { + throw Oops.Bah("设备已存在!"); + } + Pztj_LineStocksEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 产线删除料仓 + /// + /// + [HttpPost] + public async Task DeleteStock(ProductLineStockDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 产线料仓不分页 + /// + /// + [HttpPost] + public async Task> StockList(ProductLineStockQueryInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.StockId == b.Id) + .LeftJoin((a, b,c) => b.MaterialId == c.Id) + .WhereIF(!string.IsNullOrEmpty(input.MaterialId), (a, b) => b.MaterialId == input.MaterialId) + .WhereIF(!string.IsNullOrEmpty(input.LineId), (a, b) => a.LineId == input.LineId) + .Select((a, b,c) => new ProductLineStockOutput + { + Id = a.Id, + LineId = a.LineId, + StockCode = b.Code, + StockId = b.Id, + StockName = b.Name, + MaterialId = b.MaterialId, + MateriaName = c.Name + }) + .ToListAsync(); + return entity; + } + /// + /// 产线料仓分页 + /// + /// + [HttpPost] + public async Task> StockPageList(ProductLineStockQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.StockId == b.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => b.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.LineId), (a, b) => a.LineId == input.LineId) + .Select((a, b) => new ProductLineStockOutput + { + StockId = a.StockId, + StockCode = b.Code, + StockName = b.Name, + Id = a.Id, + LineId = a.LineId + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return entity; + } + } +} + diff --git a/backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipeMaterialDto.cs b/backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipeMaterialDto.cs new file mode 100644 index 0000000..f9a0713 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipeMaterialDto.cs @@ -0,0 +1,98 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :配方物料Dto类 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:12:06 + /// 描 述 : + /// + public class RecipeMaterialDto + { + /// + /// 物料Id + /// + public string MaterialId { get; set; } + /// + /// 配方Id + /// + public string RecipesId { get; set; } + /// + /// 重量 + /// + public string Weight { get; set; } + /// + /// 描述 + /// + public string Describe { get; set; } + /// + /// 误差 + /// + public string ErrorWeight { get; set; } + } + /// + /// 增加 + /// + public class RecipeMaterialAddInput: RecipeMaterialDto + { + + } + /// + /// 更新 + /// + public class RecipeMaterialUpdateInput : RecipeMaterialDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class RecipeMaterialDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class RecipeMaterialQueryInput + { + /// + /// 配方Id + /// + public string RecipesId { get; set; } + } + /// + /// 分页 + /// + public class RecipeMaterialQueryPageInput : RequestPage + { + + } + /// + /// 输出 + /// + public class RecipeMaterialOutput : RecipeMaterialDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 配方名称 + /// + public string RecipesName { get; set; } + /// + /// 物料名称 + /// + public string MaterialName { get; set; } + /// + /// 物料编码 + /// + public string MaterialCode { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipesInfoDto.cs b/backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipesInfoDto.cs new file mode 100644 index 0000000..83adee8 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipesInfoDto.cs @@ -0,0 +1,84 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :配方Dto类 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:12:06 + /// 描 述 : + /// + public class RecipesInfoDto + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 自定义编码 + /// + public string Code { get; set; } + } + /// + /// 增加 + /// + public class RecipesInfoAddInput : RecipesInfoDto + { + + } + /// + /// 更新 + /// + public class RecipesInfoUpdateInput : RecipesInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class RecipesInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class RecipesInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 分组id + /// + public string GroupId { get; set; } + } + /// + /// 输出 + /// + public class RecipesInfoOutput : RecipesInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 分组Id + /// + public string GroupId { get; set; } + } + + public class RecipesGroupInput : RecipesGroupEntity + { + /// + /// 主键 + /// + /// + public string Id { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipeMaterialService.cs b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipeMaterialService.cs new file mode 100644 index 0000000..ad1ee62 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipeMaterialService.cs @@ -0,0 +1,49 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :配方物料服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 18:33:18 + /// 描 述 : + /// + public interface IRecipeMaterialService + { + /// + /// 增加 + /// + /// + Task Add(RecipeMaterialAddInput input); + /// + /// 批量增加 + /// + /// + /// + Task BatchAdd(List inputs); + /// + /// 移除 + /// + /// + Task Del(RecipeMaterialDelInput input); + /// + /// 更新 + /// + /// + Task Update(RecipeMaterialUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(RecipeMaterialQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(RecipeMaterialQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipesInfoService.cs b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipesInfoService.cs new file mode 100644 index 0000000..d1f07bb --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipesInfoService.cs @@ -0,0 +1,54 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :配方服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 18:33:18 + /// 描 述 : + /// + public interface IRecipesInfoService + { + /// + /// 增加 + /// + /// + Task Add(RecipesInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(RecipesInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(RecipesInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(RecipesInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + /// + /// 更改物料分组 + /// + /// + /// + Task ChangeGroup(RecipesGroupInput input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipeMaterialService.cs b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipeMaterialService.cs new file mode 100644 index 0000000..f20b767 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipeMaterialService.cs @@ -0,0 +1,130 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :配方物料服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :配方物料数据维护 + /// + [ApiDescriptionSettings("配方工艺管理", Name = "RecipeMaterial", Tag = "配方物料服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class RecipeMaterialService : IRecipeMaterialService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public RecipeMaterialService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(RecipeMaterialAddInput input) + { + RecipeMaterialEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 批量增加 + /// + /// + /// + /// + public async Task BatchAdd(List inputs) + { + bool result = false; + List entitys = inputs.Adapt>(); + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.RecipesId == inputs[0].RecipesId).ExecuteCommandAsync(); + await _dbContext.Insertable(entitys).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + result = true; + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + throw Oops.Bah("保存失败!"); + } + return result; + } + + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(RecipeMaterialDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + RecipeMaterialOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost,AllowAnonymous] + public async Task> List(RecipeMaterialQueryInput input) + { + var output = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.RecipesId==b.Id) + .LeftJoin((a,b,c)=>a.MaterialId==c.Id) + .WhereIF(!string.IsNullOrEmpty(input.RecipesId),(a,b,c)=>a.RecipesId==input.RecipesId) + .Select((a,b,c)=>new RecipeMaterialOutput + { + Id = a.Id, + MaterialName = c.Name, + MaterialCode = c.Code, + MaterialId = c.Id, + RecipesId = a.RecipesId, + RecipesName = b.Name, + Weight = a.Weight + }) + .ToListAsync(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(RecipeMaterialQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(RecipeMaterialUpdateInput input) + { + var res = await _dbContext.Updateable().ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipesInfoService.cs b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipesInfoService.cs new file mode 100644 index 0000000..b535ab2 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipesInfoService.cs @@ -0,0 +1,136 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :配方管理 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :店铺数据维护 + /// + [ApiDescriptionSettings("配方工艺管理", Name = "RecipesInfo", Tag = "配方服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class RecipesInfoService : IRecipesInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public RecipesInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(RecipesInfoAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name || x.Code==input.Code); + if (r_entity != null) + { + throw Oops.Bah("名称或者编码已存在!"); + } + RecipesInfoEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(RecipesInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + RecipesInfoOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(RecipesInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.Id==b.RecipesId) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => a.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.GroupId), (a, b) => b.GroupId==input.GroupId) + .Select() + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(RecipesInfoUpdateInput input) + { + RecipesInfoEntity entity = await _dbContext.Queryable().FirstAsync(x => x.Id != input.Id && (x.Name == input.Name || x.Code == input.Code)); + if (entity != null) + { + throw Oops.Bah("名称或者编码已存在!"); + } + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + [HttpPost] + public async Task ChangeGroup(RecipesGroupInput input) + { + var isExit =await _dbContext.Queryable().FirstAsync(x=>x.RecipesId==input.RecipesId); + var entity = input.Adapt(); + if (isExit==null) + { + return await _dbContext.Insertable(entity).ExecuteCommandIdentityIntoEntityAsync(); + } + else + { + return await _dbContext.Updateable(entity).IgnoreColumns(true).Where(x => x.RecipesId == input.RecipesId).ExecuteCommandHasChangeAsync(); + } + + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/MaterialsInputDto.cs b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/MaterialsInputDto.cs new file mode 100644 index 0000000..23067f6 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/MaterialsInputDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.ReportService.Dtos +{ + public class MaterialsInputDto: RequestPage + { + public DateTime? StartTime { get; set; } + public DateTime? EndTime { get; set; } + public string MaterialName { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/MaterialsOutDto.cs b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/MaterialsOutDto.cs new file mode 100644 index 0000000..bc12347 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/MaterialsOutDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.ReportService.Dtos +{ + public class MaterialsOutDto + { + public string MaterialId { get; set; } + public string MaterialName { get; set; } + public decimal Count { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/ProductInputDto.cs b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/ProductInputDto.cs new file mode 100644 index 0000000..b5b26bf --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/ProductInputDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.ReportService.Dtos +{ + public class ProductInputDto : RequestPage + { + public DateTime? StartTime { get; set; } + public DateTime? EndTime { get; set; } + public string ProductName { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/ProductOutDto.cs b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/ProductOutDto.cs new file mode 100644 index 0000000..fdaf4bd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ReportService/Dtos/ProductOutDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.ReportService.Dtos +{ + public class ProductOutDto + { + public string ProductId { get; set; } + public string ProductName { get; set; } + public decimal Count { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ReportService/IReportService.cs b/backend/BPA.MES.Base.Application/Services/ReportService/IReportService.cs new file mode 100644 index 0000000..18816d6 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ReportService/IReportService.cs @@ -0,0 +1,26 @@ +using BPA.MES.Base.Application.Services.ReportService.Dtos; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.ReportService +{ + public interface IReportService + { + /// + /// 获取产品生产统计 + /// + /// + /// + Task> GetProductReport(ProductInputDto input); + + /// + /// 获取物料统计 + /// + /// + /// + Task> GetMaterialsReport(MaterialsInputDto inputDto); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/ReportService/ReportService.cs b/backend/BPA.MES.Base.Application/Services/ReportService/ReportService.cs new file mode 100644 index 0000000..7fb128b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/ReportService/ReportService.cs @@ -0,0 +1,69 @@ +using BPA.MES.Base.Application.Services.ReportService.Dtos; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services.ReportService +{ + + [ApiDescriptionSettings("统计报表管理", Order = 2, Name = "Report", Tag = "报表信息", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class ReportService : IReportService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public ReportService(ISqlSugarClient db) + { + _dbContext = db; + } + + /// + /// 获取成品生产统计 + /// + /// + /// + [HttpPost] + public async Task> GetProductReport(ProductInputDto input) + { + var res = await _dbContext.Queryable().LeftJoin((a, b) => a.FinalId == b.Id) + .WhereIF(!string.IsNullOrEmpty(input.ProductName), (a, b) => b.Name.Contains(input.ProductName)) + .WhereIF(input.StartTime.HasVal(), (a, b) => a.CreateTime >= input.StartTime.Value) + .WhereIF(input.EndTime.HasVal(), (a, b) => a.CreateTime <= input.EndTime.Value) + .Where((a, b) => a.Status == WorkOrderStatusEnum.Completed) + .GroupBy((a, b) => b.Name) + .Select((a, b) => new ProductOutDto + { + ProductName = b.Name, + Count = SqlFunc.AggregateSum(Convert.ToDecimal(a.Number)), + + }).ToPagedListAsync(input.PageIndex, input.PageSize); + + return res; + } + + + /// + /// 获取物料统计 + /// + /// + /// + [HttpPost] + public async Task> GetMaterialsReport(MaterialsInputDto input) + { + var result = await _dbContext.Queryable() + .LeftJoin((a, b) => a.WorkId == b.Id) + .Where((a, b) => b.Status == WorkOrderStatusEnum.Completed) + .WhereIF(!string.IsNullOrEmpty(input.MaterialName), (a, b) => a.MaterialName.Contains(input.MaterialName)) + .WhereIF(input.StartTime.HasVal(), (a, b) => b.CreateTime >= input.StartTime.Value) + .WhereIF(input.EndTime.HasVal(), (a, b) => b.CreateTime <= input.EndTime.Value) + .GroupBy((a, b) => a.MaterialName) + .Select((a, b) => new MaterialsOutDto + { + Count = SqlFunc.AggregateSumNoNull(Convert.ToDecimal(a.Weight)), + MaterialName = a.MaterialName, + }).ToPagedListAsync(input.PageIndex, input.PageSize); + + return result; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/StockInfoService/Dtos/StockInfoDto.cs b/backend/BPA.MES.Base.Application/Services/StockInfoService/Dtos/StockInfoDto.cs new file mode 100644 index 0000000..35c5b20 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/StockInfoService/Dtos/StockInfoDto.cs @@ -0,0 +1,83 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : 料仓服务 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 15:27:20 + /// 描 述 : + /// + public class StockInfoDto + { + /// + /// 料仓编码 + /// + public string Code { get; set; } + /// + /// 料仓名称 + /// + public string Name { get; set; } + /// + /// 物料Id + /// + public string MaterialId { get; set; } + /// + /// 料仓容积 + /// + public string Volume { get; set; } + } + /// + /// 增加 + /// + public class StockInfoAddInput : StockInfoDto + { + + } + /// + /// 更新 + /// + public class StockInfoUpdateInput : StockInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class StockInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class StockInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class StockInfoOutput : StockInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 物料Name + /// + public string MaterialName { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/StockInfoService/Services/IStockInfoService.cs b/backend/BPA.MES.Base.Application/Services/StockInfoService/Services/IStockInfoService.cs new file mode 100644 index 0000000..46e5196 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/StockInfoService/Services/IStockInfoService.cs @@ -0,0 +1,49 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :料仓服务 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/17 15:32:17 + /// 描 述 : + /// + public interface IStockInfoService + { + /// + /// 增加 + /// + /// + Task Add(StockInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(StockInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(StockInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(); + /// + /// 分页列表 + /// + /// + Task> PagedList(StockInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/StockInfoService/Services/StockInfoService.cs b/backend/BPA.MES.Base.Application/Services/StockInfoService/Services/StockInfoService.cs new file mode 100644 index 0000000..26ec87c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/StockInfoService/Services/StockInfoService.cs @@ -0,0 +1,123 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :料仓服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :基础数据管理 + /// + [ApiDescriptionSettings("基础数据管理", Order = 1, Name = "StockInfo", Tag = "料仓服务", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class StockInfoService : IStockInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public StockInfoService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(StockInfoAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name || x.Code==input.Code); + if (r_entity != null) + { + throw Oops.Bah("名称或编码已存在!"); + } + Pztj_StockInfoEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(StockInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + StockInfoOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpGet] + public async Task> List() + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(StockInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.MaterialId==b.Id) + .Select((a,b)=>new StockInfoOutput + { + Id=a.Id.SelectAll(), + MaterialName= b.Name + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(StockInfoUpdateInput input) + { + var isExit =await _dbContext.Queryable().Where(x => x.Id != input.Id && (x.Name==input.Name || x.Code==input.Code)).FirstAsync(); + if (isExit != null) + { + throw Oops.Bah("名称或编码已存在!"); + } + Pztj_StockInfoEntity entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SysCacheService/ISysCacheService.cs b/backend/BPA.MES.Base.Application/Services/SysCacheService/ISysCacheService.cs new file mode 100644 index 0000000..f070ad9 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SysCacheService/ISysCacheService.cs @@ -0,0 +1,15 @@ +namespace BPA.MES.Base.Application +{ + public interface ISysCacheService + { + Task AddCacheKey(string cacheKey); + Task DelCacheKey(string cacheKey); + bool Exists(string cacheKey); + Task> GetAllCacheKeys(); + Task GetAsync(string cacheKey); + Task GetStringAsync(string cacheKey); + Task RemoveAsync(string key); + Task SetAsync(string cacheKey, object value); + Task SetStringAsync(string cacheKey, string value); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SysCacheService/SysCacheService.cs b/backend/BPA.MES.Base.Application/Services/SysCacheService/SysCacheService.cs new file mode 100644 index 0000000..bc6de78 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SysCacheService/SysCacheService.cs @@ -0,0 +1,163 @@ +using Furion.JsonSerialization; +using Microsoft.Extensions.Caching.Distributed; +using System.Text; + +namespace BPA.MES.Base.Application +{ + /// + /// 系统缓存服务 + /// + [ApiDescriptionSettings(Name = "Cache", Order = 100)] + public class SysCacheService : ISysCacheService, IDynamicApiController, ISingleton + { + private readonly IDistributedCache _cache; + + public SysCacheService(IDistributedCache cache) + { + _cache = cache; + } + + /// + /// 获取所有缓存关键字 + /// + /// + [HttpGet("sysCache/keyList")] + public async Task> GetAllCacheKeys() + { + var res = await _cache.GetStringAsync(ClaimConst.CACHE_KEY_ALL); + return string.IsNullOrWhiteSpace(res) ? null : JSON.Deserialize>(res); + } + + /// + /// 删除指定关键字缓存 + /// + /// + /// + [HttpGet("sysCache/remove")] + public async Task RemoveAsync(string key) + { + await _cache.RemoveAsync(key); + + await DelCacheKey(key); + } + + /// + /// 删除某特征关键字缓存 + /// + /// + /// + [NonAction] + public async Task DelByPatternAsync(string key) + { + var allkeys = await GetAllCacheKeys(); + var delAllkeys = allkeys.Where(u => u.Contains(key)).ToList(); + + // 删除相应的缓存 + delAllkeys.ForEach(u => + { + _cache.Remove(u); + }); + + // 更新所有缓存键 + allkeys = allkeys.Where(u => !u.Contains(key)).ToList(); + await _cache.SetStringAsync(ClaimConst.CACHE_KEY_ALL, JSON.Serialize(allkeys)); + } + + /// + /// 设置缓存 + /// + /// + /// + /// + [NonAction] + public async Task SetAsync(string cacheKey, object value) + { + await _cache.SetAsync(cacheKey, Encoding.UTF8.GetBytes(JSON.Serialize(value))); + + await AddCacheKey(cacheKey); + } + + /// + /// 设置缓存 + /// + /// + /// + /// + [NonAction] + public async Task SetStringAsync(string cacheKey, string value) + { + await _cache.SetStringAsync(cacheKey, value); + + await AddCacheKey(cacheKey); + } + + /// + /// 获取缓存 + /// + /// + /// + [HttpGet("sysCache/detail")] + public async Task GetStringAsync(string cacheKey) + { + return await _cache.GetStringAsync(cacheKey); + } + + /// + /// 获取缓存 + /// + /// + /// + /// + [NonAction] + public async Task GetAsync(string cacheKey) + { + var res = await _cache.GetAsync(cacheKey); + return res == null ? default : JSON.Deserialize(Encoding.UTF8.GetString(res)); + } + + /// + /// 检查给定 key 是否存在 + /// + /// 键 + /// + [NonAction] + public bool Exists(string cacheKey) + { + return _cache.Equals(cacheKey); + } + + /// + /// 增加缓存Key + /// + /// + /// + [NonAction] + public async Task AddCacheKey(string cacheKey) + { + var res = await _cache.GetStringAsync(ClaimConst.CACHE_KEY_ALL); + var allkeys = string.IsNullOrWhiteSpace(res) ? new List() : JSON.Deserialize>(res); + if (!allkeys.Any(m => m == cacheKey)) + { + allkeys.Add(cacheKey); + await _cache.SetStringAsync(ClaimConst.CACHE_KEY_ALL, JSON.Serialize(allkeys)); + } + } + + /// + /// + /// + /// + /// + [NonAction] + public async Task DelCacheKey(string cacheKey) + { + var res = await _cache.GetStringAsync(ClaimConst.CACHE_KEY_ALL); + var allkeys = string.IsNullOrWhiteSpace(res) ? new List() : JSON.Deserialize>(res); + if (allkeys.Any(m => m == cacheKey)) + { + allkeys.Remove(cacheKey); + await _cache.SetStringAsync(ClaimConst.CACHE_KEY_ALL, JSON.Serialize(allkeys)); + } + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs new file mode 100644 index 0000000..5f26c29 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs @@ -0,0 +1,98 @@ +/// +/// 名 称 :[账号信息]实体基础 +/// 创 建 人 :yangxiao +/// 创建时间 : 2023/1/3 10:21:42 +/// 描 述 : +/// +namespace BPA.MES.Base.Application +{ + /// + /// [账号信息]入参基础 + /// + public class AccountInput + { + /// + /// 账号 + /// + /// admin + public string Account { get; set; } + /// + /// 密码 + /// + /// e10adc3949ba59abbe56e057f20f883e + public string Pwd { get; set; } + + } + /// + /// [账号信息]添加入参 + /// + public class AccountAddInput : AccountInput + { + /// + /// 员工编号 + /// + public string TB_Employee_Id { get; set; } + } + /// + /// [账号信息]修改入参 + /// + public class AccountUpdateInput : AccountInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + /// + /// 员工编号 + /// + public string TB_Employee_Id { get; set; } + } + /// + /// [账号信息]修改密码 + /// + public class AccountUpdatePwdInput + { + /// + /// 旧密码 + /// + public string OldPwd { get; set; } + /// + /// 新密码 + /// + public string NewPwd { get; set; } + } + /// + /// [账号信息]删除入参 + /// + public class AccountDelInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [账号信息]普通查询入参 + /// + public class AccountQueryInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [账号信息]分页查询入参 + /// + public class AccountQueryPageInput : RequestPage + { + /// + /// 主键 + /// + public string? Id { get; set; } + /// + /// 账号名称 + /// + public string Account { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountOutput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountOutput.cs new file mode 100644 index 0000000..ea06298 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountOutput.cs @@ -0,0 +1,29 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :[账号信息]输出实体 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/3 10:22:37 + /// 描 述 : + /// + public class AccountOutput + { + /// + /// 主键 + /// + public string Id { get;set; } + /// + /// 账号 + /// + public string Account { get; set; } + /// + /// 密码 + /// + public string Pwd { get; set; } + /// + /// 员工id + /// + public string TB_Employee_Id { get; set; } + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeInput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeInput.cs new file mode 100644 index 0000000..4562531 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeInput.cs @@ -0,0 +1,97 @@ +/// +/// 名 称 :[授权信息]实体基础 +/// 创 建 人 :yangxiao +/// 创建时间 : 2023/1/3 10:21:42 +/// 描 述 +/// +namespace BPA.MES.Base.Application +{ + /// + /// [授权信息]入参基础 + /// + public class AuthorizeInput + { + /// + /// 关键字 + /// + public string Keyword { get; set; } + /// + /// 模板Id + /// + public string TemplateId { get; set; } + /// + /// 授权类型 1:用户,2:角色 + /// + public int Type { get; set; } + /// + /// 授权对象 + /// + public List? ObjectIds { get; set; } + } + /// + /// [授权信息]添加入参 + /// + public class AuthorizeAddInput : AuthorizeInput + { + + } + /// + /// [授权信息]角色授权入参 + /// + public class AuthorMapAddInput + { + /// + /// 模板编号 + /// + public List TemplateIds { get; set; } + /// + /// 授权类型 1用户 2角色 + /// + + public int AuthorizeType { get; set; } + /// + /// 授权对象 + /// + public string ObjectId { get; set; } + } + /// + /// [授权信息]修改入参 + /// + public class AuthorizeUpdateInput : AuthorizeInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [授权信息]删除入参 + /// + public class AuthorizeDelInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [授权信息]普通查询入参 + /// + public class AuthorizeQueryInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [授权信息]分页查询入参 + /// + public class AuthorizeQueryPageInput : RequestPage + { + /// + /// 主键 + /// + public string? Id { get; set; } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeOutput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeOutput.cs new file mode 100644 index 0000000..7ef3dc9 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeOutput.cs @@ -0,0 +1,27 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :授权信息输出 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 17:24:21 + /// 描 述 : + /// + public class AuthorizeOutput + { + /// + /// 编号 + /// + public string Id { get; set; } + + /// + /// 名称 + /// + public string Name { get; set; } + + /// + /// 已授权 + /// + public bool IsAuthorized { get; set; } + } + +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeInput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeInput.cs new file mode 100644 index 0000000..baaa41f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeInput.cs @@ -0,0 +1,101 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/5 15:15:50 + /// 描 述 : + /// + public class EmployeeInput + { + /// + /// 员工姓名 + /// + + public string Name { get; set; } + /// + /// 0男1女 + /// + public int Gender { get; set; } + /// + /// 0启用 1禁用 + /// + public int Status { get; set; } + /// + /// 角色Id + /// + public string RoleId { get; set; } + /// + /// 是否存在账号 + /// + public bool IsAccount { get; set; } + /// + /// 账号 + /// + public string Account { get; set; } + } + + /// + /// [授权信息]添加入参 + /// + public class EmployeeAddInput : EmployeeInput + { + + } + /// + /// [授权信息]修改入参 + /// + public class EmployeeUpdateInput : EmployeeInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [授权信息]删除入参 + /// + public class EmployeeDelInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [授权信息]普通查询入参 + /// + public class EmployeeQueryInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [授权信息]分页查询入参 + /// + public class EmployeeQueryPageInput : RequestPage + { + /// + /// 主键 + /// + public string? Id { get; set; } + /// + /// 关键字 + /// + public string name { get; set; } + /// + /// 状态 + /// + public int Status { get; set; } + /// + /// 性别 + /// + public int Gender { get; set; } + /// + /// 入职时间 + /// + public DateTime? JoinDate { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeOutput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeOutput.cs new file mode 100644 index 0000000..3373c3a --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeOutput.cs @@ -0,0 +1,45 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :[员工信息] + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/5 15:18:02 + /// 描 述 : + /// + public class EmployeeOutput + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 排序 + /// + public int Sort { get; set; } + /// + /// 员工姓名 + /// + public string Name { get; set; } + /// + /// 0男1女 + /// + + public int Gender { get; set; } + /// + /// 0启用 1禁用 + /// + public int Status { get; set; } + /// + /// 角色Id + /// + public string RoleId { get; set; } + /// + /// 是否存在账号 + /// + public bool IsAccount { get; set; } + /// + /// 账号 + /// + public string Account { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/Mapper.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/Mapper.cs new file mode 100644 index 0000000..8487bf4 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/Mapper.cs @@ -0,0 +1,8 @@ +namespace BPA.MES.Base.Application; + +public class Mapper : IRegister +{ + public void Register(TypeAdapterConfig config) + { + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleInput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleInput.cs new file mode 100644 index 0000000..102ed2b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleInput.cs @@ -0,0 +1,94 @@ +/// +/// 名 称 :[模块信息]实体基础 +/// 创 建 人 :yangxiao +/// 创建时间 : 2023/1/3 10:21:42 +/// 描 述 +/// +namespace BPA.MES.Base.Application +{ + /// + /// [模块信息]入参基础 + /// + public class ModuleInput + { + /// + /// 类别 1:菜单,2:视图,3:功能 + /// + public int Category { get; set; } + /// + /// 菜单打开方式 0:框架内嵌,1:新开页面 + /// + public int OpenType { get; set; } + /// + /// 父级编号 + /// + public string ParentId { get; set; } + /// + /// 名称 + /// + public string Name { set; get; } + /// + /// 图标 + /// + public string Icon { set; get; } + /// + /// 地址 + /// + public string Url { set; get; } + /// + /// 排序码 + /// + public int Sort { set; get; } + /// + /// 启用禁用 + /// + public bool IsDisabled { get; set; } + } + /// + /// [模块信息]添加入参 + /// + public class ModuleAddInput : ModuleInput + { + + } + /// + /// [模块信息]修改入参 + /// + public class ModuleUpdateInput : ModuleInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [模块信息]删除入参 + /// + public class ModuleDelInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [模块信息]普通查询入参 + /// + public class ModuleQueryInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [模块信息]分页查询入参 + /// + public class ModuleQueryPageInput : RequestPage + { + /// + /// 主键 + /// + public string? Id { get; set; } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleOutput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleOutput.cs new file mode 100644 index 0000000..ae5b46b --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleOutput.cs @@ -0,0 +1,48 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 9:48:24 + /// 描 述 : + /// + public class ModuleOutput + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 类别 1:菜单,2:视图,3:功能 + /// + public int Category { get; set; } + /// + /// 菜单打开方式 0:框架内嵌,1:新开页面 + /// + public int OpenType { get; set; } + /// + /// 父级编号 + /// + public string ParentId { get; set; } + /// + /// 名称 + /// + public string Name { set; get; } + /// + /// 图标 + /// + public string Icon { set; get; } + /// + /// 地址 + /// + public string Url { set; get; } + /// + /// 排序码 + /// + public int Sort { set; get; } + /// + /// 启用禁用 + /// + public bool IsDisabled { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeInput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeInput.cs new file mode 100644 index 0000000..9113544 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeInput.cs @@ -0,0 +1,108 @@ +/// +/// 名 称 :[菜单模块树]实体基础 +/// 创 建 人 :yangxiao +/// 创建时间 : 2023/1/3 10:21:42 +/// 描 述 +/// +namespace BPA.MES.Base.Application +{ + /// + /// [菜单模块树]入参基础 + /// + public class ModuleTreeInput + { + /// + /// 类别 1:菜单,2:视图,3:功能 + /// + public int Category { get; set; } + + /// + /// 菜单打开方式 0:框架内嵌,1:新开页面 + /// + public int OpenType { get; set; } + + /// + /// 父级编号 + /// + public string ParentId { get; set; } + + /// + /// 名称 + /// + public string Name { set; get; } + + /// + /// 图标 + /// + public string Icon { set; get; } + + /// + /// 地址 + /// + public string Url { set; get; } + /// + /// 排序码 + /// + public int Sort { set; get; } + /// + /// 启用禁用 + /// + public bool IsDisabled { get; set; } + + /// + /// 子集 + /// + public List Children { get; set; } + } + /// + /// [菜单模块树]添加入参 + /// + public class ModuleTreeAddInput : ModuleTreeInput + { + + } + /// + /// [菜单模块树]修改入参 + /// + public class ModuleTreeUpdateInput : ModuleTreeInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [菜单模块树]删除入参 + /// + public class ModuleTreeDelInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [菜单模块树]普通查询入参 + /// + public class ModuleTreeQueryInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + /// + /// 名称 + /// + public string Name { get; set; } + } + /// + /// [菜单模块树]分页查询入参 + /// + public class ModuleTreeQueryPageInput : RequestPage + { + /// + /// 主键 + /// + public string? Id { get; set; } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeOutput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeOutput.cs new file mode 100644 index 0000000..a8771bd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeOutput.cs @@ -0,0 +1,59 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :[菜单模块树]输出 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 16:14:43 + /// 描 述 : + /// + public class ModuleTreeOutput + { + /// + /// 模块编号 + /// + public string Id { get; set; } + + /// + /// 类别 1:菜单,2:视图,3:功能 + /// + public int Category { get; set; } + + /// + /// 菜单打开方式 0:框架内嵌,1:新开页面 + /// + public int OpenType { get; set; } + + /// + /// 父级编号 + /// + public string ParentId { get; set; } + + /// + /// 名称 + /// + public string Name { set; get; } + + /// + /// 图标 + /// + public string Icon { set; get; } + + /// + /// 地址 + /// + public string Url { set; get; } + /// + /// 排序码 + /// + public int Sort { set; get; } + /// + /// 启用禁用 + /// + public bool IsDisabled { get; set; } + + /// + /// 子集 + /// + public List Children { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleInput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleInput.cs new file mode 100644 index 0000000..69e5a12 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleInput.cs @@ -0,0 +1,71 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :[角色信息] + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 9:43:25 + /// 描 述 : + /// + public class RoleInput + { + /// + /// 角色名称 + /// + public string Name { get; set; } + /// + /// 角色描述 + /// + public string Description { get; set; } + } + /// + /// [角色信息]添加入参 + /// + public class RoleAddInput : RoleInput + { + + } + /// + /// [角色信息]修改入参 + /// + public class RoleUpdateInput : RoleInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [角色信息]删除入参 + /// + public class RoleDelInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [角色信息]普通查询入参 + /// + public class RoleQueryInput + { + /// + /// 主键 + /// + public string? Id { get; set; } + } + /// + /// [角色信息]分页查询入参 + /// + public class RoleQueryPageInput : RequestPage + { + /// + /// 主键 + /// + public string? Id { get; set; } + /// + /// 关键字 + /// + public string Keyword { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleModuleDto.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleModuleDto.cs new file mode 100644 index 0000000..dbb6a2c --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleModuleDto.cs @@ -0,0 +1,50 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/31 15:58:31 + /// 描 述 : + /// + public class RoleModuleDto + { + /// + /// 角色Id + /// + public string RoleId { get; set; } + /// + /// 模块Id + /// + public string ModuleId { get; set; } + /// + /// 父级Id + /// + public string ParentId { get; set; } + } + public class RoleModuleAddInput + { + public List ModuleIds { get; set; } + /// + /// 角色Id + /// + public string RoleId { get; set; } + } + public class RoleModuleOutput + { + /// + /// 角色Id + /// + public string RoleId { get; set; } + /// + /// 模块Id + /// + public string ModuleId { get; set; } + } + public class RoleModuleQuery + { + /// + /// 角色Id + /// + public string RoleId { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleOutput.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleOutput.cs new file mode 100644 index 0000000..423080d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleOutput.cs @@ -0,0 +1,24 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :角色信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 9:43:42 + /// 描 述 : + /// + public class RoleOutput + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 角色名称 + /// + public string Name { get; set; } + /// + /// 角色描述 + /// + public string Description { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/UserRoleCacheDto.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/UserRoleCacheDto.cs new file mode 100644 index 0000000..112a260 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Dtos/UserRoleCacheDto.cs @@ -0,0 +1,62 @@ + + + + + +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :个人角色信息 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/1/4 17:46:47 + /// 描 述 : + /// + public class UserRoleCacheDto + { + public List AuthorizationCodes { get; set; } + public List Menus { get; set; } + } + +/// +/// 个人菜单信息 +/// +public class UserMenu : ITree + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 菜单名称 + /// + public string Name { get; set; } + /// + /// 菜单地址 + /// + public string Url { get; set; } + /// + /// 菜单图标 + /// + public string Icon { get; set; } + /// + /// 菜单子项 + /// + public List Children { get; set; } + /// + /// 父级Id + /// + public string ParentId { get; set; } + /// + /// 分页信息 + /// + public string Sort { get; set; } + /// + /// 打开类型 + /// + public int OpenType { get; set; } + /// + /// 类别 + /// + public int Category { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs new file mode 100644 index 0000000..8359ee2 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs @@ -0,0 +1,467 @@ +namespace BPA.MES.Base.Application +{ + /// + /// 名 称 :授权服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 16:11:04 + /// 描 述 :授权服务数据维护 + /// + [ApiDescriptionSettings(Name = "Authorize", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class AuthorizeService : IAuthorizeService, ITransient, IDynamicApiController + { + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly ISqlSugarClient db; + private readonly ISqlSugarClient _dbContext; + public AuthorizeService(ISqlSugarClient db, IHttpContextAccessor httpContextAccessor) + { + this.db = db; + _dbContext = db; + _httpContextAccessor = httpContextAccessor; + } + #region 当前用户 + /// + /// 登录 + /// + /// + /// + + [AllowAnonymous] + public async Task Login(AccountInput input) + { + var Info = await db.Queryable().FirstAsync(t => t.Account == input.Account && t.Pwd == input.Pwd); + if (Info == null) + throw Oops.Bah("请输入正确的账号和密码"); + var User = await db.Queryable().FirstAsync(t => t.Id == Info.EmployeeId); + if (User == null) + { + throw Oops.Bah("账号没有权限"); + } + //return ResolveService().CreateAccessToken(new UserIdentity + //{ + // Id = User.Id, + // UserName = User.Name, + // IsAdmin = User.IsAdmin, + //}); + + // 生成Token令牌 + //var accessToken = await _jwtBearerManager.CreateTokenAdmin(user); + var accessToken = JWTEncryption.Encrypt(new Dictionary + { + {ClaimConst.CLAINM_USERID, User.Id}, + {ClaimConst.CLAINM_NAME,User.Name}, + {ClaimConst.CLAINM_ACCOUNT,Info.Account }, + {ClaimConst.CLAINM_ISAUTH,User.IsAdmin}, + {ClaimConst.CLAINM_ROLEID,User.RoleId } + }, 43200); + // 设置Swagger自动登录 + _httpContextAccessor.HttpContext.SigninToSwagger(accessToken); + // 生成刷新Token令牌 + var refreshToken = + JWTEncryption.GenerateRefreshToken(accessToken, int.MaxValue); + + _httpContextAccessor.HttpContext.Response.Headers["access-token"] = accessToken; + // 设置刷新Token令牌 + _httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken; + return true; + } + /// + /// 获取个人信息 + /// + /// + public async Task GetUserInfo() + { + string userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; + var user = await db.Queryable().LeftJoin((t, x) => t.RoleId == x.Id) + .Where((t, x) => t.Id == userId).Select((t, x) => new + { + RoleName = x.Name, + RoleType = x.RoleType, + Id = t.Id, + UserName = t.Name + }).FirstAsync(); + + + var menus = (await GetJurisdictionItemsAsync())?.Menus; + return new + { + Menus = menus, + UserInfo = new + { + UserId = user?.Id, + user?.RoleName, + user?.UserName + } + }; + } + [HttpGet] + public async Task> MultipleModuleAuthorityAsync() + { + return (await GetJurisdictionItemsAsync())?.AuthorizationCodes; + } + /// + /// 获取用户权限 + /// + /// + [HttpGet] + async Task GetJurisdictionItemsAsync() + { + + string userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; + string roleId = App.User?.FindFirst(ClaimConst.CLAINM_ROLEID)?.Value; + var result = new UserRoleCacheDto(); + //根据角色获取权限Id + var rolemodules = await db.Queryable().Where(x => x.RoleId == roleId).ToListAsync(); + result.AuthorizationCodes = rolemodules.Select(t => t.ModuleId).ToList(); + if (result.AuthorizationCodes.HasVal()) + { + var temp = await db.Queryable().Where(t => result.AuthorizationCodes.Contains(t.Id) && !t.IsDisabled).OrderBy(t => t.ParentId) + .ToListAsync(); + + result.Menus = temp.Adapt>().BuildTree(); + } + result.Menus ??= new List(); + + return result; + } + /// + /// 获取账户信息 + /// + /// + /// + [HttpPost] + public async Task> AccountPageList(AccountQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Account),x=>x.Account==input.Account) + .ToPagedListAsync(input.PageIndex,input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + + /// + /// 添加账户 + /// + /// + /// + public async Task AddAccount(AccountAddInput input) + { + var entity = input.Adapt(); + return await _dbContext.Insertable(entity).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 修改账户信息 + /// + /// + /// + public async Task UpdateAccount(AccountUpdateInput input) { + var entity = input.Adapt(); + return await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + } + /// + /// 删除账户 + /// + /// + /// + public async Task DelAccount(AccountDelInput input) { + var entity = input.Adapt(); + return await _dbContext.Deleteable(entity).Where(x=>x.Id==input.Id).ExecuteCommandHasChangeAsync(); + } + #endregion + #region 角色 + [HttpPost] + public async Task AddRole(RoleAddInput input) + { + var check = await db.Queryable().FirstAsync(t => t.Name == input.Name); + if (check != null) throw Oops.Bah ("角色名称不能重复"); + var model = input.Adapt(); + model.RoleType = 2; + return await db.Insertable(model).ExecuteCommandAsync() > 0; + } + [HttpPost] + public async Task EditRole(RoleUpdateInput input) + { + if (!await db.Queryable().Where(it => it.Id == input.Id).AnyAsync()) + throw Oops.Bah("角色不存在或已被删除"); + if (await _dbContext.Queryable().Where(it => it.Id != input.Id && it.Name == input.Name).AnyAsync()) + throw Oops.Bah("角色名称已经存在"); + return await _dbContext.Updateable(input).Where(a => a.Id == input.Id).ExecuteCommandHasChangeAsync(); + } + [HttpGet] + public async Task RemoveRole(string input) + { + return await db.Deleteable().Where(t => t.Id == input).ExecuteCommandHasChangeAsync(); + } + [HttpGet] + public async Task GetRole(string input) + { + var entity = await db.Queryable().FirstAsync(t => t.Id == input); + return entity.Adapt(); + } + [HttpGet] + public async Task> GetRoleList() + { + var entity = await db.Queryable().Where(t => t.RoleType != 1).ToListAsync(); + return entity.Adapt>(); + } + [HttpPost] + public async Task> QueryRole(RoleQueryPageInput input) + { + var eneity = await db.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Keyword), t => t.Name.Contains(input.Keyword)) + .Select() + .ToPagedListAsync(input.PageIndex, input.PageSize); + return eneity; + } + #endregion + + #region 模块 + [HttpPost] + public async Task AddModule(ModuleAddInput input) + { + input.ParentId = input.ParentId ?? string.Empty; + var entity = input.Adapt(); + await db.Insertable(entity).IgnoreColumns(true).ExecuteCommandAsync(); + return true; + } + [HttpPost] + + public async Task EditModule(ModuleUpdateInput input) + { + if (!await db.Queryable().Where(it => it.Id == input.Id ).AnyAsync()) + { + throw Oops.Bah("模块不存在或已被删除"); + } + input.ParentId = input.ParentId ?? string.Empty; + return await db.Updateable(input).Where(a => a.Id == input.Id).ExecuteCommandHasChangeAsync(); + } + [HttpGet] + + public async Task RemoveModule(string input) + { + var list = await db.Queryable().Where(it => it.ParentId == input).ToListAsync(); + if (list.HasVal()) + { + foreach (var item in list) + { + await RemoveModule(item.Id); + } + } + await _dbContext.Deleteable().Where(it => it.Id == input).ExecuteCommandAsync(); + } + [HttpPost] + public async Task> GetTreeGrid(ModuleTreeQueryInput input) + { + var list = new List(); + + var datas = await db.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), t => t.Name.Contains(input.Name)) + .OrderBy(it => it.ParentId) + .OrderBy(it => it.Name) + .ToListAsync(); + + var modules = datas.Adapt>(); + + if (modules.HasVal()) + { + foreach (var item in modules.Where(it=>it.ParentId=="").ToList()) + { + item.Children = modules.Where(it => it.ParentId == item.Id ).OrderBy(it => it.Sort).ToList(); + foreach (var view in item.Children) + { + view.Children = modules.Where(it => it.ParentId == view.Id ).OrderBy(it => it.Sort).ToList(); + } + + list.Add(item); + } + } + return list; + } + #endregion + + #region 授权模板详情 + [HttpGet] + public async Task RestoreAccountByUser(string input) + { + var Demo = "123456".ToMD5Encrypt(); + return await db.Updateable().SetColumns(t => t.Pwd == Demo) + .Where(t => t.EmployeeId == input).ExecuteCommandHasChangeAsync(); + } + [HttpPost] + public async Task AddAccountByUser(AccountAddInput input) + { + var temp = await db.Queryable().FirstAsync(t => t.EmployeeId == input.TB_Employee_Id); + if (temp != null) + { + //throw new BusinessException("该员工已绑定账户,请勿重复绑定"); + temp.Account = input.Account; + return await db.Updateable(temp).ExecuteCommandAsync() > 0; + } + else + { + var model = input.Adapt(); + //默认123456 + model.Pwd = "123456".ToMD5Encrypt(); + model.EmployeeId = input.TB_Employee_Id; + return await db.Insertable(model).ExecuteCommandAsync() > 0; + } + } + [HttpPost] + public async Task EditAccountPwd(AccountUpdatePwdInput input) + { + var Account = App.User?.FindFirst(ClaimConst.CLAINM_ACCOUNT)?.Value; + var model = db.Queryable().First(t => t.Account == Account && t.Pwd == input.OldPwd); + if (model == null) throw Oops.Bah("原密码不正确"); + model.Pwd = input.NewPwd; + return await db.Updateable(model).ExecuteCommandAsync() > 0; + } + [HttpGet] + public async Task GetAccountByUser(string input) + { + var data = await db.Queryable().FirstAsync(t => t.EmployeeId == input); + return data.Adapt(); + } + + [HttpPost] + public async Task AddEmployee(EmployeeAddInput input) + { + var model = input.Adapt(); + model.IsAdmin = false; + return await db.Insertable(model).IgnoreColumns(true).ExecuteCommandAsync() > 0; + } + /// + /// 编辑员工 + /// + /// + /// + [HttpPost] + public async Task EditEmployee(EmployeeUpdateInput input) + { + var temp = await db.Queryable().FirstAsync(t => t.Id == input.Id); + temp.Name = input.Name; + temp.Status = input.Status; + return await db.Updateable(temp).ExecuteCommandHasChangeAsync(); + } + /// + /// 查询员工 + /// + /// + /// + [HttpPost] + public async Task> QueryEmployee(EmployeeQueryPageInput input) + { + + var entity = await db.Queryable() + + .WhereIF(!string.IsNullOrEmpty(input.name), t => t.Name.Contains(input.name)) + .WhereIF(input.Status > 0, t => t.Status == input.Status). + WhereIF(input.Gender > 0, t => t.Gender == input.Gender) + .Where(t => t.IsAdmin == false) + + .Select(t => new EmployeeOutput() + { + Id = t.Id.SelectAll(), + IsAccount = SqlFunc.Subqueryable().Where(s => s.EmployeeId == t.Id).Any(), + Account = SqlFunc.Subqueryable().Where(s => s.EmployeeId == t.Id).Select(s => s.Account) + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return entity; + } + /// + /// 删除员工 + /// + /// + /// + [HttpGet] + public async Task RemoveEmployee([FromQuery] string employeeId) + { + try + { + db.Ado.BeginTran(); + await db.Deleteable().Where(t => t.Id == employeeId).ExecuteCommandAsync(); + await db.Deleteable().Where(t => t.EmployeeId == employeeId).ExecuteCommandAsync(); + db.Ado.CommitTran(); + return true; + } + catch (Exception ex) + { + db.Ado.RollbackTran(); + throw Oops.Bah("删除失败!"); + } + } + [HttpGet] + public async Task> EmployeeList() + { + var data = await db.Queryable().Where(t => t.IsAdmin == false).ToListAsync(); + return data.Adapt>(); + } + /// + /// 分配角色权限 + /// + /// + /// + [HttpPost] + public async Task AddRoleModule(RoleModuleAddInput input) + { + List entitys = new(); + var moduleList =await _dbContext.Queryable().ToListAsync(); + var parentId = input.ModuleIds.Where(x=>x.ParentId!="").GroupBy(x => x.ParentId).ToList(); + foreach (var item in parentId) + { + if (input.ModuleIds.FirstOrDefault(x=>x.ModuleId==item.Key && x.ParentId=="")==null) + { + input.ModuleIds.Add(new RoleModuleDto { ModuleId = item.Key, ParentId = "", RoleId = input.RoleId }); + } + } + foreach (var item in input.ModuleIds) + { + + RoleModuleEntity entity = new() + { + ModuleId = item.ModuleId, + ParentId = item.ParentId, + RoleId = input.RoleId + }; + entitys.Add(entity); + } + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.RoleId == input.RoleId).ExecuteCommandAsync(); + await _dbContext.Insertable(entitys).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + return true; + } + catch (Exception ex) + { + throw Oops.Bah(ex.Message); + } + } + /// + /// 根据角色获取权限模块 + /// + /// + /// + [HttpGet] + public async Task> RoleModuleList(string RoleId) + { + var entitys = await _dbContext.Queryable().Where(x => x.RoleId == RoleId).ToListAsync(); + var tementity = entitys.Where(x => x.ParentId == "").ToList();//查询出主菜单 + var delentity = new List(); + foreach (var item in tementity)//查询出主菜单是否有多个 + { + var v = entitys.Where(x=>x.ParentId==item.ModuleId).ToList(); + if (v.Count>0)//如果只有一个,就不删除 + { + delentity.Add(item); + } + } + foreach (var item in delentity) + { + entitys.Remove(item); + } + var output = entitys.Adapt>(); + return output; + } + #endregion + } +} diff --git a/backend/BPA.MES.Base.Application/Services/SystemService/Services/IAuthorizeService.cs b/backend/BPA.MES.Base.Application/Services/SystemService/Services/IAuthorizeService.cs new file mode 100644 index 0000000..2cd96d5 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/SystemService/Services/IAuthorizeService.cs @@ -0,0 +1,50 @@ +namespace BPA.MES.Base.Application; + +public interface IAuthorizeService +{ + + #region 账户 + Task RestoreAccountByUser(string input); + Task AddAccountByUser(AccountAddInput input); + Task EditAccountPwd(AccountUpdatePwdInput input); + Task GetAccountByUser(string input); + Task> AccountPageList(AccountQueryPageInput input); + Task AddAccount(AccountAddInput input); + Task UpdateAccount(AccountUpdateInput input); + Task DelAccount(AccountDelInput input); + Task Login(AccountInput input); + + #endregion + + #region 员工 + Task AddEmployee(EmployeeAddInput input); + Task EditEmployee(EmployeeUpdateInput input); + Task> QueryEmployee(EmployeeQueryPageInput input); + Task RemoveEmployee(string input); + Task> EmployeeList(); + #endregion + + + Task GetUserInfo(); + Task> MultipleModuleAuthorityAsync(); + + #region 角色 + Task AddRole(RoleAddInput input); + Task EditRole(RoleUpdateInput input); + Task RemoveRole(string input); + Task GetRole(string input); + Task> GetRoleList(); + Task> QueryRole(RoleQueryPageInput input); + + Task AddRoleModule(RoleModuleAddInput input); + #endregion + + #region 模块 + Task AddModule(ModuleAddInput input); + Task EditModule(ModuleUpdateInput input); + Task RemoveModule(string input); + Task> GetTreeGrid(ModuleTreeQueryInput input); + #endregion + + +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs new file mode 100644 index 0000000..5a4e905 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs @@ -0,0 +1,98 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2024/4/8 15:46:52 + /// 描 述 : + /// + public class WorkBatchDto + { + /// + /// 批次名词 + /// + public string Name { get; set; } + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + /// + /// 状态 + /// + public WorkOrderStatusEnum? Status { get; set; } + + } + + /// + /// 增加 + /// + public class WorkBatchAddInput : WorkBatchDto + { + + } + /// + /// 更新 + /// + public class WorkBatchUpdateInput : WorkBatchDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class WorkBatchDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 不分页 + /// + public class WorkBatchQueryInput + { + + } + /// + /// 分页 + /// + public class WorkBatchQueryPageInput : RequestPage + { + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + public string Id { get; set; } + + /// + /// 起始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + } + /// + /// 输出 + /// + public class WorkBatchOutput : WorkBatchDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 个数 + /// + public int Count { get; set; } + + public List WorkList { get; set; } = new(); + + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoCraftstepRecordDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoCraftstepRecordDto.cs new file mode 100644 index 0000000..710c7f1 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoCraftstepRecordDto.cs @@ -0,0 +1,91 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/10 14:19:47 + /// 描 述 : + /// + public class WorkInfoCraftstepRecordDto + { + /// + /// 工艺Id + /// + public string CraftsId { get; set; } + /// + /// 工艺名称 + /// + public string CraftsName { get; set; } + /// + /// 工艺步骤 + /// + public string CraftstepId { get; set; } + /// + /// 工艺步骤名称 + /// + public string CraftstepName { get; set; } + /// + /// 执行状态 + /// + public RecipeStatus Status { get; set; } + /// + /// 更新状态 + /// + public DateTime UpdateTime { get; set; } + } /// + /// 增加 + /// + public class WorkInfoCraftstepRecordAddInput : WorkInfoCraftstepRecordDto + { + + } + /// + /// 更新 + /// + public class WorkInfoCraftstepRecordUpdateInput + { + /// + /// 工单工艺步骤Id + /// + public string WorkCraftstepId { get; set; } + /// + /// 工单Id + /// + public string WorkId { get; set; } + /// + /// 锅数 + /// + public string PotNum { get; set; } + /// + /// 状态 + /// + public RecipeStatus Status { get; set; } + } + /// + /// 删除 + /// + public class WorkInfoCraftstepRecordDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class WorkInfoCraftstepRecordQueryPageInput : RequestPage + { + + } + /// + /// 输出 + /// + public class WorkInfoCraftstepRecordOutput : WorkInfoCraftstepRecordDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs new file mode 100644 index 0000000..8504f49 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs @@ -0,0 +1,203 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 14:29:09 + /// 描 述 : + /// + public class WorkInfoDto : IMessage + { + /// + /// 工单名称 + /// + public string Name { get; set; } + /// + /// 产线Id + /// + public string LineId { get; set; } + /// + /// 成品Id + /// + public string FinalId { get; set; } + /// + /// 产量 + /// + public string Number { get; set; } + /// + /// 批次号 + /// + public string BatchId { get; set; } + /// + /// 设备id + /// + public string DeviceId { get; set; } + /// + /// 创建时间 + /// + public string CreateTime { get; set; } + public int MessageId { get; set; } + + public Version MsgVersion { get; set; } + } + /// + /// 增加 + /// + public class WorkInfoAddInput : WorkInfoDto + { + + } + /// + /// 更新 + /// + public class WorkInfoUpdateInput : WorkInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class WorkInfoDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + + /// + /// 不分页查询条件 + /// + public class WorkInfoQueryInput + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 工单状态 + /// + public WorkOrderStatusEnum?[] Status { get; set; } + /// + /// 起始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + /// + /// 批次计划Id + /// + public string BatchId { get; set; } + } + /// + /// 分页 + /// + public class WorkInfoQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Id { get; set; } + /// + /// 工单状态 + /// + public WorkOrderStatusEnum?[] Status { get; set; } + /// + /// 批次计划Id + /// + + public string BatchId { get; set; } + /// + /// 起始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + } + /// + /// 工单下发 + /// + public class WorkPublishInput + { + + } + /// + /// 输出 + /// + public class WorkInfoOutput : WorkInfoDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 产品名称 + /// + public string FinalName { get; set; } + /// + /// 线名称 + /// + public string LineName { get; set; } + /// + /// 设备编码 + /// + public string DeviceCode { get; set; } + /// + /// 设备名称 + /// + public string DeviceName { get; set; } + /// + /// 工单状态 + /// + public WorkOrderStatusEnum? Status { get; set; } + + + + } + /// + /// 详情输出 + /// + public class WorkInfoDetailOutput : WorkInfoOutput + { + public WorkInfoDetailOutput() + { + + CraftList = new(); + MaterialList = new(); + } + /// + /// 工艺状态 + /// + public RecipeStatus? CraftStatus { get; set; } + /// + /// 配方状态 + /// + public EBatchingStatus? MaterialStatus { get; set; } + /// + /// 工艺步骤 + /// + public List CraftList { get; set; } + /// + /// 物料信息 + /// + public List MaterialList { get; set; } + } + + + +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoItemDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoItemDto.cs new file mode 100644 index 0000000..516d1a8 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoItemDto.cs @@ -0,0 +1,71 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :工单产量 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 14:29:25 + /// 描 述 : + /// + public class WorkInfoItemDto + { + /// + /// 工单名称 + /// + public string Name { get; set; } + /// + /// 产量 + /// + public string Number { get; set; } + } + /// + /// 增加 + /// + public class WorkInfoItemAddInput : WorkInfoItemDto + { + + } + /// + /// 更新 + /// + public class WorkInfoItemUpdateInput : WorkInfoItemDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 删除 + /// + public class WorkInfoItemDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class WorkInfoItemQueryPageInput : RequestPage + { + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class WorkInfoItemOutput : WorkInfoItemDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoMaterialsRecordDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoMaterialsRecordDto.cs new file mode 100644 index 0000000..6147858 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoMaterialsRecordDto.cs @@ -0,0 +1,112 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/10 9:48:30 + /// 描 述 : + /// + public class WorkInfoMaterialsRecordDto + { + /// + /// 物料名称 + /// + public string MaterialName { get; set; } + /// + /// 物料id + /// + public string MaterialId { get; set; } + /// + /// 工单id + /// + public string WorkId { get; set; } + /// + /// 重量 + /// + public string Weight { get; set; } + /// + /// 第几锅 + /// + public string PotNum { get; set; } + /// + /// 配方Id + /// + public string RecipeId { get; set; } + /// + /// 配方名称 + /// + public string RecipeName { get; set; } + /// + /// 物料状态 + /// + public EBatchingStatus MaterialStatus { get; set; } + /// + /// 更新时间 + /// + public DateTime? UpdateTime { get; set; } + /// + /// 误差重量 + /// + public string ErrorWeight { get; set; } + } + /// + /// 增加 + /// + public class WorkInfoMaterialsRecordAddInput : WorkInfoMaterialsRecordDto + { + + } + /// + /// 更新 + /// + public class WorkInfoMaterialsRecordUpdateInput + { + /// + /// 工单物料Id + /// + public string WorkMaterialId { get; set; } + /// + /// 状态 + /// + public EBatchingStatus Status { get; set; } + } + /// + /// 删除 + /// + public class WorkInfoMaterialsRecordDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class WorkInfoMaterialsRecordQueryPageInput : RequestPage + { + + } + /// + /// 输出 + /// + public class WorkInfoMaterialsRecordOutput : WorkInfoMaterialsRecordDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 物料类型 + /// + public string MaterialType { get; set; } + /// + /// 物料类型名称 + /// + public string MaterialTypeName { get; set; } + /// + /// 每升重量 + /// + public string WeightPerLiter { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoStatusDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoStatusDto.cs new file mode 100644 index 0000000..9c6a5a4 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoStatusDto.cs @@ -0,0 +1,130 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :工单状态 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/20 14:29:39 + /// 描 述 : + /// + public class WorkInfoStatusDto + { + /// + /// 工单Id + /// + public string WorkId { get; set; } + /// + /// 工单状态 + /// + public WorkOrderStatusEnum Status { get; set; } + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + /// + /// 备注 + /// + + public string Remark { get; set; } + } + /// + /// 增加 + /// + public class WorkInfoStatusAddInput : WorkInfoStatusDto + { + + } + /// + /// 更新 + /// + public class WorkInfoStatusUpdateInput + { + /// + /// 工单Id + /// + public string WorkId { get; set; } + /// + /// 状态 + /// + public WorkOrderStatusEnum Status { get; set; } + /// + /// 备注 + /// + + public string Remark { get; set; } + } + /// + /// 删除 + /// + public class WorkInfoStatusDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页 + /// + public class WorkInfoStatusQueryPageInput : RequestPage + { + + } + + /// + /// 批次下发 + /// + public class BatchInput + { + public string BatchId { get; set; } + } + + /// + /// 下发 + /// + public class PublishInput + { + /// + /// 工单ID + /// + public string WorkId { get; set; } + /// + /// 设备ID + /// + public string? DeviceId { get; set; } + } + /// + /// 输出 + /// + public class WorkInfoStatusOutput : WorkInfoStatusDto + { + /// + /// 主键 + /// + public string Id { get; set; } + /// + /// 状态名称 + /// + public string StatusName { get { + + switch (Status) + { + case WorkOrderStatusEnum.Unkown: + return "未知"; + case WorkOrderStatusEnum.Draft: + return "草稿"; + case WorkOrderStatusEnum.Issued: + return "已下发"; + case WorkOrderStatusEnum.Receive: + return "已接受"; + case WorkOrderStatusEnum.Started: + return "已启动"; + case WorkOrderStatusEnum.Completed: + return "已完成"; + case WorkOrderStatusEnum.Obsolete: + return "废弃"; + default: + return "错误"; + } + } } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkBatchService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkBatchService.cs new file mode 100644 index 0000000..0933a6d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkBatchService.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2024/4/8 15:41:42 + /// 描 述 : + /// + public interface IWorkBatchService + { + /// + /// 增加 + /// + /// + Task Add(WorkBatchAddInput input); + /// + /// 移除 + /// + /// + Task Del(WorkBatchDelInput input); + /// + /// 更新 + /// + /// + Task Update(WorkBatchUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(WorkBatchQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(WorkBatchQueryPageInput input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoService.cs new file mode 100644 index 0000000..4fbedd3 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoService.cs @@ -0,0 +1,90 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :工单服务 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 14:39:28 + /// 描 述 : + /// + public interface IWorkInfoService + { + /// + /// 增加 + /// + /// + Task Add(WorkInfoAddInput input); + /// + /// 移除 + /// + /// + Task Del(WorkInfoDelInput input); + /// + /// 更新 + /// + /// + Task Update(WorkInfoUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(WorkInfoQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(WorkInfoQueryPageInput input); + /// + /// 下拉列表 + /// + /// + Task SelectList(); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + /// + /// 更改状态 + /// + /// + Task UpdateStatus(WorkInfoStatusUpdateInput input); + + /// + /// 工单下发 + /// + /// 工单Id + /// + Task Publish(PublishInput input); + /// + /// 批次工单下发 + /// + /// + /// + Task Publishs(BatchInput input); + /// + /// 强制结束 + /// + /// 工单Id + /// + Task ForcedEnd(string workId); + /// + /// 工单状态记录 + /// + /// + /// + Task> StatusList(string workId); + /// + /// 修改工单步骤状态 + /// + /// + /// + Task UpdateWorkCraftStepsStatus(WorkInfoCraftstepRecordUpdateInput input); + /// + /// 修改工单物料状态 + /// + /// + /// + Task UpdateWorkMaterialStatus(WorkInfoMaterialsRecordUpdateInput input); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoStatusService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoStatusService.cs new file mode 100644 index 0000000..4eb624f --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoStatusService.cs @@ -0,0 +1,13 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/21 14:54:31 + /// 描 述 : + /// + public class IWorkInfoStatusService + { + + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs new file mode 100644 index 0000000..cfec498 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs @@ -0,0 +1,81 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :工单服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/20 14:39:41 + /// 描 述 : + /// + [ApiDescriptionSettings("工单批次服务", Order = 0, Tag = "工单服务", Name = "WorkBatch", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class WorkBatchService : IWorkBatchService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + private readonly IMQTTService _MQTTService; + private readonly IWorkInfoService _workInfoService; + public WorkBatchService(ISqlSugarClient db, IMQTTService MQTTService, IWorkInfoService WorkInfoService) + { + _dbContext = db; + _MQTTService = MQTTService; + _workInfoService = WorkInfoService; + } + public async Task Add(WorkBatchAddInput input) + { + WorkBatchEntity entity = input.Adapt(); + entity.Status = WorkOrderStatusEnum.Draft; + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + + public async Task Del(WorkBatchDelInput input) + { + var res = false; + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + await _dbContext.Deleteable().Where(x => x.BatchId == input.Id).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + res = true; + } + catch (Exception) + { + _dbContext.Ado.RollbackTran(); + } + return res; + } + + public async Task> List(WorkBatchQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + + public async Task> PagedList(WorkBatchQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Id),x=>x.Id.Contains(input.Id)) + .WhereIF(input.StartTime != null, x => input.StartTime <= Convert.ToDateTime(x.CreateTime)) + .WhereIF(input.EndTime != null, x => input.EndTime.Value.AddHours(23).AddMinutes(59).AddSeconds(59) >= Convert.ToDateTime(x.CreateTime)) + .OrderByDescending(x => x.CreateTime) + .Select((x)=>new WorkBatchOutput + { + Id = x.Id.SelectAll(), + Count = SqlFunc.Subqueryable().Where(d=>d.BatchId==x.Id).Count() + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + foreach (var item in entity.Items) + { + item.WorkList = await _workInfoService.List(new WorkInfoQueryInput { BatchId = item.Id }); + } + return entity; + } + + public async Task Update(WorkBatchUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs new file mode 100644 index 0000000..da77b4e --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs @@ -0,0 +1,670 @@ +using Furion.EventBus; +using Yitter.IdGenerator; + +namespace BPA.MES.Base.Application.Services.WorkInfoService.Services +{ + /// + /// 名 称 :工单服务 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/7/20 14:39:41 + /// 描 述 : + /// + [ApiDescriptionSettings("工单服务", Order = 0, Tag = "工单服务", Name = "WorkInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class WorkInfoService : IWorkInfoService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + private readonly IMQTTService _MQTTService; + public WorkInfoService(ISqlSugarClient db, IEventPublisher eventPublisher, IMQTTService MQTTService) + { + _dbContext = db; + _MQTTService = MQTTService; + } + /// + /// 增加 + /// + /// + /// + [HttpPost, OperLog("增加工单")] + public async Task Add(WorkInfoAddInput input) + { + bool result = false; + Pztj_WorkInfoEntity entity = input.Adapt(); + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); + Pztj_WorkInfoStatusEntity pztj_WorkInfoStatusEntity = new() + { + Status = WorkOrderStatusEnum.Draft, + WorkId = entity.Id + }; + await _dbContext.Insertable(pztj_WorkInfoStatusEntity).IgnoreColumns(true).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + result = true; + } + catch + { + _dbContext.Ado.RollbackTran(); + throw Oops.Bah("添加失败!"); + } + return result; + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(WorkInfoDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.FinalId == b.Id) + .LeftJoin((a, b, c) => a.LineId == c.Id) + .LeftJoin((a, b, c, d) => d.Id == SqlFunc.Subqueryable().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) + .LeftJoin((a,b,c,d,e)=>a.DeviceId==e.Id) + .Where((a, b, c, d) => a.Id == Id) + .Select((a, b, c, d, e) => new WorkInfoDetailOutput + { + Id = a.Id.SelectAll(), + DeviceCode = e.Code, + DeviceName=e.Name, + DeviceId = e.Id, + FinalName = b.Name, + LineName = c.Name, + Status = d.Status == null ? WorkOrderStatusEnum.Draft : d.Status + }).FirstAsync(); + if (entity == null) + { + throw Oops.Bah("没有找到工单信息!"); + } + //获取成品信息 + var finainfo = await _dbContext.Queryable().FirstAsync(x => x.Id == entity.FinalId); + if (finainfo == null) + { + throw Oops.Bah("没有找到成品信息!"); + } + //获取工艺步骤 + var craftlist = await _dbContext.Queryable().Where(x => x.WorkId == Id).ToListAsync(); + //获取物料信息 + var materiallist = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.MaterialId==b.Id) + .LeftJoin((a,b,c) => b.Type == c.Id) + .Where((a, b) => a.WorkId == Id) + .Select((a, b,c) => + new WorkInfoMaterialsRecordOutput + { + Id = a.Id.SelectAll(), + MaterialType = c.Id, + MaterialTypeName = c.Value, + WeightPerLiter = b.WeightPerLiter + }) + .ToListAsync(); + entity.CraftList = craftlist; + entity.MaterialList = materiallist; + if (craftlist.Max(x => x.Status) == RecipeStatus.执行完成 && craftlist.Max(x => x.Status) == craftlist.Min(x => x.Status)) + { + entity.CraftStatus = RecipeStatus.执行完成; + } + else + if (craftlist.Max(x => x.Status) == RecipeStatus.等待执行 && craftlist.Max(x => x.Status) == craftlist.Min(x => x.Status)) + { + entity.CraftStatus = RecipeStatus.等待执行; + } + else + { + entity.CraftStatus = RecipeStatus.正在执行; + } + + if (materiallist.Max(x => x.MaterialStatus) == EBatchingStatus.配料完成 && materiallist.Max(x => x.MaterialStatus) == materiallist.Min(x => x.MaterialStatus)) + { + entity.MaterialStatus = EBatchingStatus.配料完成; + } + else + if (materiallist.Max(x => x.MaterialStatus) == EBatchingStatus.等待配料 && materiallist.Max(x => x.MaterialStatus) == materiallist.Min(x => x.MaterialStatus)) + { + entity.MaterialStatus = EBatchingStatus.等待配料; + } + else + { + entity.MaterialStatus = EBatchingStatus.正在配料; + } + return entity; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(WorkInfoQueryInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.FinalId == b.Id) + .LeftJoin((a, b, c) => a.LineId == c.Id) + .LeftJoin((a, b, c, d) =>a.DeviceId==d.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b, c, d) => b.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Id), (a, b, c, d) => a.Id.Contains(input.Id)) + .WhereIF(!string.IsNullOrEmpty(input.BatchId), (a, b, c, d) => a.BatchId == input.BatchId) + .WhereIF(input.Status != null, (a, b, c, d) => input.Status.Contains(a.Status)) + .WhereIF(input.StartTime != null, (a, b, c, d) => input.StartTime <= Convert.ToDateTime(a.CreateTime)) + .WhereIF(input.EndTime != null, (a, b, c, d) => input.EndTime.Value.AddHours(23).AddMinutes(59).AddSeconds(59) >= Convert.ToDateTime(a.CreateTime)) + .OrderByDescending((a, b, c, d) => a.CreateTime) + .Select((a, b, c, d) => new WorkInfoOutput + { + Id = a.Id, + FinalName = b.Name, + LineName = c.Name, + DeviceId = a.DeviceId == null ? "" : a.DeviceId, + DeviceName =d.Name, + Status = a.Status == null ? WorkOrderStatusEnum.Draft : a.Status, + BatchId = a.BatchId, + Number = a.Number, + FinalId = a.FinalId, + LineId = a.LineId, + DeviceCode = a.DeviceId + }).ToListAsync(); + return entity; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(WorkInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.FinalId == b.Id) + .LeftJoin((a, b, c) => a.LineId == c.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b, c) => b.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Id), (a, b, c) => a.Id.Contains(input.Id)) + .WhereIF(!string.IsNullOrEmpty(input.BatchId), (a, b, c) => a.BatchId==input.BatchId) + .WhereIF(input.Status != null, (a, b, c) => input.Status.Contains(a.Status)) + .WhereIF(input.StartTime != null, (a, b, c) => input.StartTime <= Convert.ToDateTime(a.CreateTime)) + .WhereIF(input.EndTime != null, (a, b, c) => input.EndTime.Value.AddHours(23).AddMinutes(59).AddSeconds(59) >= Convert.ToDateTime(a.CreateTime)) + .OrderByDescending((a, b, c) => a.CreateTime) + .Select((a, b, c) => new WorkInfoOutput + { + Id = a.Id.SelectAll(), + FinalName = b.Name, + LineName = c.Name, + DeviceId = a.DeviceId ?? "", + Status = a.Status == null ? WorkOrderStatusEnum.Draft : a.Status + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return entity; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> BatchPagedList(WorkInfoQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.FinalId == b.Id) + .LeftJoin((a, b, c) => a.LineId == c.Id) + .WhereIF(!string.IsNullOrEmpty(input.Name), (a, b, c) => b.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Id), (a, b, c) => a.Id.Contains(input.Id)) + .WhereIF(input.Status != null, (a, b, c) => input.Status.Contains(a.Status)) + .WhereIF(input.StartTime != null, (a, b, c) => input.StartTime <= Convert.ToDateTime(a.CreateTime)) + .WhereIF(input.EndTime != null, (a, b, c) => input.EndTime.Value.AddHours(23).AddMinutes(59).AddSeconds(59) >= Convert.ToDateTime(a.CreateTime)) + .OrderByDescending((a, b, c) => a.CreateTime) + .Select((a, b, c) => new WorkInfoOutput + { + Id = a.Id.SelectAll(), + FinalName = b.Name, + LineName = c.Name, + Status = a.Status == null ? WorkOrderStatusEnum.Draft : a.Status + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return entity; + } + + /// + /// 工单下发 + /// + /// 工单id + /// + /// + [HttpPost] + public async Task Publishs(BatchInput input) + { + string userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; + string userName = App.User?.FindFirst(ClaimConst.CLAINM_NAME)?.Value; + var workentitys = await _dbContext.Queryable().Where(x => x.BatchId == input.BatchId).ToListAsync(); + + foreach (var item in workentitys) + { + var res = await UpdateStatus( + new WorkInfoStatusUpdateInput + { + WorkId = item.Id, + Status = WorkOrderStatusEnum.Issued, + Remark = $"[{userId}]{userName}" + }); + var workentity = await _dbContext.Queryable() + .LeftJoin((a, b) => a.DeviceId == b.Id) + .Where((a, b) => a.Id == item.Id) + .Select((a, b) => new WorkInfoOutput + { + Id = a.Id.SelectAll(), + DeviceCode = b.Code, + DeviceName = b.Name + }) + .FirstAsync(); + if (res) + { + WorkInfoMaterialsRecordEntity workInfoMaterialsRecordEntity = new() + { + MaterialId = item.Id, + }; + //获取成品信息 + var finainfo = await _dbContext.Queryable().FirstAsync(x => x.Id == workentity.FinalId); + if (finainfo == null) + { + throw Oops.Bah("没有找到成品信息!"); + } + + var materiallist = await _dbContext.Queryable() + .LeftJoin((a, b) => a.MaterialId == b.Id) + .LeftJoin((a, b, c) => a.RecipesId == c.Id) + .Where((a, b, c) => a.RecipesId == finainfo.RecipeId) + .Select((a, b, c) => new WorkInfoMaterialsRecordEntity + { + MaterialId = a.MaterialId, + MaterialName = b.Name, + MaterialStatus = EBatchingStatus.等待配料, + WorkId = item.Id, + Weight = a.Weight, + RecipeId = a.RecipesId, + RecipeName = c.Name + }) + .ToListAsync(); + + //获取物料信息 + + var craftsteplist = await _dbContext.Queryable() + .LeftJoin((a, b) => a.CraftId == b.Id) + .LeftJoin((a, b, c) => a.DeviceProductFunctionId == c.Id) + .Where((a, b) => a.CraftId == finainfo.CraftId) + .Select((a, b, c) => new WorkInfoCraftstepRecordEntity + { + CraftId = a.CraftId, + CraftName = b.Name, + CraftstepId = a.Id, + DeviceProductFunctionId = c.Id, + DeviceProductFunctionName = c.Name, + CraftstepParms = a.Params, + Status = RecipeStatus.等待执行, + Step = a.Step, + WorkId = item.Id + }) + .ToListAsync(); + List newmateriallist = new(); + List newcraftslist = new(); + for (int i = 1; i <= Convert.ToInt32(workentity.Number); i++) + { + foreach (var materiaItem in materiallist) + { + WorkInfoMaterialsRecordEntity itementity = new() + { + PotNum = i.ToString(), + MaterialId = materiaItem.MaterialId, + MaterialName = materiaItem.MaterialName, + MaterialStatus = materiaItem.MaterialStatus, + WorkId = materiaItem.WorkId, + Weight = materiaItem.Weight, + RecipeId = materiaItem.RecipeId, + RecipeName = materiaItem.RecipeName, + }; + newmateriallist.Add(itementity); + } + foreach (var craftstepitem in craftsteplist) + { + WorkInfoCraftstepRecordEntity itementity = new() + { + CraftId = craftstepitem.CraftId, + CraftName = craftstepitem.CraftName, + CraftstepId = craftstepitem.CraftstepId, + DeviceProductFunctionId = craftstepitem.DeviceProductFunctionId, + DeviceProductFunctionName = craftstepitem.DeviceProductFunctionName, + CraftstepParms = craftstepitem.CraftstepParms, + Status = craftstepitem.Status, + Step = craftstepitem.Step, + WorkId = craftstepitem.WorkId, + PotNum = i.ToString(), + }; + newcraftslist.Add(itementity); + } + } + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.WorkId == item.Id).ExecuteCommandAsync(); + await _dbContext.Deleteable().Where(x => x.WorkId == item.Id).ExecuteCommandAsync(); + + await _dbContext.Insertable(newcraftslist).ExecuteCommandAsync(); + await _dbContext.Insertable(newmateriallist).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + throw Oops.Oh("下发失败!"); + } + await _MQTTService.MqttPublish(new MqttPublishDto() { Payload = workentity, Topic = Topics.WorkOrderPush, MessageId = MessageID.WorkOrderIssued }); + } + } + await _dbContext.Updateable().SetColumns(x => x.Status == WorkOrderStatusEnum.Issued).Where(x => x.Id == input.BatchId).ExecuteCommandAsync(); + return true; + } + + /// + /// 工单下发 + /// + /// 工单id + /// + /// + [HttpPost] + public async Task Publish(PublishInput input) + { + string userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; + string userName = App.User?.FindFirst(ClaimConst.CLAINM_NAME)?.Value; + if (!string.IsNullOrEmpty(input.DeviceId)) + { + await _dbContext.Updateable().SetColumns(x => x.DeviceId == input.DeviceId).Where(x => x.Id == input.WorkId).ExecuteCommandAsync(); + } + var res = await UpdateStatus( + new WorkInfoStatusUpdateInput + { + WorkId = input.WorkId, + Status = WorkOrderStatusEnum.Issued, + Remark = $"[{userId}]{userName}" + }); + var workentity = await _dbContext.Queryable() + .LeftJoin((a,b)=>a.DeviceId==b.Id) + .Where((a, b) => a.Id == input.WorkId) + .Select((a,b)=>new WorkInfoOutput + { + Id=a.Id.SelectAll(), + DeviceCode = b.Code, + DeviceName = b.Name + }) + .FirstAsync(); + if (res) + { + WorkInfoMaterialsRecordEntity workInfoMaterialsRecordEntity = new() + { + MaterialId = input.WorkId, + }; + //获取成品信息 + var finainfo = await _dbContext.Queryable().FirstAsync(x => x.Id == workentity.FinalId); + if (finainfo == null) + { + throw Oops.Bah("没有找到成品信息!"); + } + + var materiallist = await _dbContext.Queryable() + .LeftJoin((a, b) => a.MaterialId == b.Id) + .LeftJoin((a,b,c)=>a.RecipesId==c.Id) + .Where((a, b, c) => a.RecipesId == finainfo.RecipeId) + .Select((a, b, c) => new WorkInfoMaterialsRecordEntity + { + MaterialId = a.MaterialId, + MaterialName = b.Name, + MaterialStatus = EBatchingStatus.等待配料, + WorkId = input.WorkId, + Weight = a.Weight, + RecipeId = a.RecipesId, + RecipeName = c.Name, + ErrorWeight = a.ErrorWeight, + }) + .ToListAsync(); + + //获取物料信息 + + var craftsteplist = await _dbContext.Queryable() + .LeftJoin((a, b) => a.CraftId == b.Id) + .LeftJoin((a, b, c) => a.DeviceProductFunctionId == c.Id) + .Where((a, b) => a.CraftId == finainfo.CraftId) + .Select((a, b, c) => new WorkInfoCraftstepRecordEntity + { + CraftId = a.CraftId, + CraftName = b.Name, + CraftstepId = a.Id, + DeviceProductFunctionId = c.Id, + DeviceProductFunctionName = c.Name, + CraftstepParms = a.Params, + Status = RecipeStatus.等待执行, + Step = a.Step, + WorkId = input.WorkId + }) + .ToListAsync(); + List newmateriallist = new(); + List newcraftslist = new(); + for (int i = 1; i <= Convert.ToInt32(workentity.Number); i++) + { + foreach (var item in materiallist) + { + WorkInfoMaterialsRecordEntity itementity = new() + { + PotNum = i.ToString(), + MaterialId = item.MaterialId, + MaterialName = item.MaterialName, + MaterialStatus = item.MaterialStatus, + WorkId = item.WorkId, + Weight = item.Weight, + RecipeId = item.RecipeId, + RecipeName = item.RecipeName, + ErrorWeight = item.ErrorWeight + }; + newmateriallist.Add(itementity); + } + foreach (var item in craftsteplist) + { + WorkInfoCraftstepRecordEntity itementity = new() + { + CraftId = item.CraftId, + CraftName = item.CraftName, + CraftstepId = item.CraftstepId, + DeviceProductFunctionId = item.DeviceProductFunctionId, + DeviceProductFunctionName = item.DeviceProductFunctionName, + CraftstepParms = item.CraftstepParms, + Status = item.Status, + Step = item.Step, + WorkId = item.WorkId, + PotNum = i.ToString(), + }; + newcraftslist.Add(itementity); + } + } + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Deleteable().Where(x => x.WorkId == input.WorkId).ExecuteCommandAsync(); + await _dbContext.Deleteable().Where(x => x.WorkId == input.WorkId).ExecuteCommandAsync(); + + await _dbContext.Insertable(newcraftslist).ExecuteCommandAsync(); + await _dbContext.Insertable(newmateriallist).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + throw Oops.Oh("下发失败!"); + } + await _MQTTService.MqttPublish(new MqttPublishDto() { Payload = workentity, Topic = Topics.WorkOrderPush, MessageId = MessageID.WorkOrderIssued }); + } + return true; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(WorkInfoUpdateInput input) + { + Pztj_WorkInfoEntity entity = input.Adapt(); + entity.CreateTime = DateTime.Now; + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 修改工单状态 + /// + /// + /// + /// + [HttpPost] + public async Task UpdateStatus(WorkInfoStatusUpdateInput input) + { + var entitys = await _dbContext.Queryable().Where(x => x.Id == input.WorkId) + .FirstAsync(); + Pztj_WorkInfoStatusEntity entity = input.Adapt(); + try + { + _dbContext.Ado.BeginTran(); + await _dbContext.Insertable(entity).IgnoreColumns(true).ExecuteCommandIdentityIntoEntityAsync(); + await _dbContext.Updateable().SetColumns(x => x.Status == input.Status).Where(x => x.Id == input.WorkId).ExecuteCommandAsync(); + _dbContext.Ado.CommitTran(); + } + catch (Exception ex) + { + _dbContext.Ado.RollbackTran(); + throw Oops.Bah("更新失败"); + } + var workItems = await _dbContext.Queryable().LeftJoin((a, b) => a.Id == b.WorkId).Where(a => a.BatchId == entitys.BatchId) + .Select((a, b) => new WorkInfoOutput + { + Id = a.Id.SelectAll(), + Status = b.Status, + }) + .ToListAsync(); + if (workItems.Max(x => x.Status) == WorkOrderStatusEnum.Completed && workItems.Min(x => x.Status) == WorkOrderStatusEnum.Completed) + { + await _dbContext.Updateable().SetColumns(x => x.Status == WorkOrderStatusEnum.Completed).Where(x => x.Id == entitys.BatchId).ExecuteCommandAsync(); + } + else + { + await _dbContext.Updateable().SetColumns(x => x.Status == workItems.Max(x => x.Status)).Where(x => x.Id == entitys.BatchId).ExecuteCommandAsync(); + } + return true; + } + /// + /// 修改工单物料状态 + /// + /// + /// + [HttpPost] + public async Task UpdateWorkMaterialStatus(WorkInfoMaterialsRecordUpdateInput input) + { + WorkInfoMaterialsRecordEntity entity = new() + { + Id = input.WorkMaterialId, + MaterialStatus = input.Status, + UpdateTime = DateTime.Now + }; + bool res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 修改工单步骤状态 + /// + /// + /// + [HttpPost] + public async Task UpdateWorkCraftStepsStatus(WorkInfoCraftstepRecordUpdateInput input) + { + + + var entityFrist = await _dbContext.Queryable().Where(x => x.Id == input.WorkCraftstepId).FirstAsync(); + if (entityFrist==null) + { + throw Oops.Bah("未查询到工单信息!"); + } + if (!string.IsNullOrEmpty(input.WorkId)) + { + bool res = await _dbContext.Updateable() + .SetColumns(x => x.Status == input.Status) + .SetColumns(x => x.UpdateTime == DateTime.Now).IgnoreColumns(true).Where(x => x.WorkId == input.WorkId && x.PotNum == input.PotNum).ExecuteCommandHasChangeAsync(); + return res; + } + else + { + WorkInfoCraftstepRecordEntity entity = new() + { + Id = input.WorkCraftstepId, + Status = input.Status, + UpdateTime = DateTime.Now, + Step = entityFrist.Step + }; + bool res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } + + /// + /// 强制结束工单 + /// + /// + /// + [HttpPost] + public async Task ForcedEnd(string workId) + { + string userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value; + string userName = App.User?.FindFirst(ClaimConst.CLAINM_NAME)?.Value; + await UpdateStatus(new WorkInfoStatusUpdateInput + { + WorkId = workId, + Status = WorkOrderStatusEnum.Completed, + Remark = $"{userName}[{userId}]点击了强制结束" + }); + return true; + } + /// + /// 工单状态变更记录 + /// + /// + /// + [HttpGet] + public async Task> StatusList(string workId) + { + var entitys = await _dbContext.Queryable().Where(x => x.WorkId == workId).OrderByDescending(x=>x.CreateTime).ToListAsync(); + List list = entitys.Adapt>(); + + return list; + } + } +} diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoStatusService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoStatusService.cs new file mode 100644 index 0000000..4178e27 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoStatusService.cs @@ -0,0 +1,12 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/21 14:54:42 + /// 描 述 : + /// + public class WorkInfoStatusService + { + } +} diff --git a/backend/BPA.MES.Base.Application/Subscriber/ToDoEventSubscriber.cs b/backend/BPA.MES.Base.Application/Subscriber/ToDoEventSubscriber.cs new file mode 100644 index 0000000..4b4d8fd --- /dev/null +++ b/backend/BPA.MES.Base.Application/Subscriber/ToDoEventSubscriber.cs @@ -0,0 +1,28 @@ +using Furion.EventBus; + +namespace BPA.MES.Base.Application.Subscriber +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/7/20 15:09:49 + /// 描 述 : + /// + public class ToDoEventSubscriber : IEventSubscriber + { + private readonly ISqlSugarClient _dbContext; + public ToDoEventSubscriber(ISqlSugarClient db) + { + _dbContext = db; + } + + [EventSubscribe("ToDo:OperLog")] + public async Task CreateToDo(EventHandlerExecutingContext context) + { + var todo = context.Source; + OperLogEntity entity =(OperLogEntity)todo.Payload; + await _dbContext.Insertable(entity).ExecuteCommandAsync(); + await Task.CompletedTask; + } + } +} diff --git a/backend/BPA.MES.Base.Application/applicationsettings.json b/backend/BPA.MES.Base.Application/applicationsettings.json new file mode 100644 index 0000000..56080bc --- /dev/null +++ b/backend/BPA.MES.Base.Application/applicationsettings.json @@ -0,0 +1,12 @@ +{ + "SpecificationDocumentSettings": { + "DocumentTitle": "MES数据接口" + }, + "CorsAccessorSettings": { + "WithExposedHeaders": [ + "access-token", + "x-access-token", + "environment" + ] + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Core/BPA.MES.Base.Core.csproj b/backend/BPA.MES.Base.Core/BPA.MES.Base.Core.csproj new file mode 100644 index 0000000..c91d436 --- /dev/null +++ b/backend/BPA.MES.Base.Core/BPA.MES.Base.Core.csproj @@ -0,0 +1,26 @@ + + + + + net6.0 + 1701;1702;1591 + BPA.MES.Base.Core.xml + + + + + + + + + + + + + + + + + + + diff --git a/backend/BPA.MES.Base.Core/BPA.MES.Base.Core.xml b/backend/BPA.MES.Base.Core/BPA.MES.Base.Core.xml new file mode 100644 index 0000000..5776893 --- /dev/null +++ b/backend/BPA.MES.Base.Core/BPA.MES.Base.Core.xml @@ -0,0 +1,136 @@ + + + + BPA.MES.Base.Core + + + + + 名 称 :主键 + 创 建 人 :yangxiao + 创建时间 :2023/3/2 13:59:33 + 描 述 : + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/3/4 9:51:33 + 描 述 : + + + + + 获基础信息库对象 (用IOC这块代码不能写到IOC里面) + + + + + 名 称 :分页基础类 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 16:15:41 + 描 述 : + + + + + 页码 + + 1 + + + + 页大小 + + 10 + + + + 名 称 :分页泛型集合 + 创 建 人 :yangxiao + 创建时间 : 2023/3/2 16:21:27 + 描 述 : + + + + + 页码 + + + + + 页容量 + + + + + 总条数 + + + + + 总页数 + + + + + 当前页集合 + + + + + 是否有上一页 + + + + + 是否有下一页 + + + + + 分页拓展类 + + + + + 分页拓展 + + + + + + + + + 分页拓展 + + + + + + + + + 名 称 :数据库启动类 + 创 建 人 :yangxiao + 创建时间 : 2023/3/23 14:09:30 + 描 述 : + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/3/4 9:50:52 + 描 述 : + + + + diff --git a/backend/BPA.MES.Base.Core/DEntityBase.cs b/backend/BPA.MES.Base.Core/DEntityBase.cs new file mode 100644 index 0000000..39a7fb6 --- /dev/null +++ b/backend/BPA.MES.Base.Core/DEntityBase.cs @@ -0,0 +1,27 @@ +using SqlSugar; +using System.ComponentModel; +using Yitter.IdGenerator; + +namespace BPA.MES.Base.Core +{ + /// + /// 名 称 :主键 + /// 创 建 人 :yangxiao + /// 创建时间 :2023/3/2 13:59:33 + /// 描 述 : + /// + public class DEntityBase + { + /// + /// 主键 + /// + [Description("主键")] + [SugarColumn(IsPrimaryKey = true)] + public string Id { get; set; } + public DEntityBase() + { + var b = YitIdHelper.NextId(); + Id = b.ToString(); + } + } +} diff --git a/backend/BPA.MES.Base.Core/EmptyExtensions.cs b/backend/BPA.MES.Base.Core/EmptyExtensions.cs new file mode 100644 index 0000000..fe0750a --- /dev/null +++ b/backend/BPA.MES.Base.Core/EmptyExtensions.cs @@ -0,0 +1,21 @@ +namespace BPA.MES.Base.Core +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/4 9:51:33 + /// 描 述 : + /// + public static class EmptyExtensions + { + public static bool HasVal(this T obj) + { + if (obj != null) + { + return !obj.Equals(default(T)); + } + + return false; + } + } +} diff --git a/backend/BPA.MES.Base.Core/KepServerSqlsugar.cs b/backend/BPA.MES.Base.Core/KepServerSqlsugar.cs new file mode 100644 index 0000000..e71d119 --- /dev/null +++ b/backend/BPA.MES.Base.Core/KepServerSqlsugar.cs @@ -0,0 +1,64 @@ +using Furion; +using Microsoft.Extensions.Caching.Distributed; +using Newtonsoft.Json; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Core +{ + public class KepServerSqlsugar + { + /// + /// 获基础信息库对象 (用IOC这块代码不能写到IOC里面) + /// + public static ISqlSugarClient KepDb + { + get + { + //如果是跨服务器分库,也需要动态配置的,因为库的IP会变 + //参考业务库用法 + string configId = "configId"; + var dbs = App.GetConfig>("ConnectionConfigs")[0]; + if (!Db.IsAnyConnection(configId)) + { //用非默认ConfigId进行测试 + //添加业务库只在当前上下文有效(原理:SqlSugarScope模式入门文档去看) + Db.AddConnection(new ConnectionConfig() + { + ConfigId = configId, + ConnectionString = dbs.ConnectionString, + DbType = DbType.MySql, + IsAutoCloseConnection = true, + InitKeyType = InitKeyType.Attribute + }); + } + //原理说明 + //IsAnyConnection、AddConnection和GetConnection 都是Scope周期不同请求不会有影响 + + var result = Db.GetConnection(configId); + + //可以给业务库result设置AOP和过滤滤器 + + return result; + } + } + + + //通过IOC获取注入的Db对象 + public static SqlSugarScope Db + { + get + { + //如果用Furion就是 App.GetService(); + //IOC不会可以看文档: https://www.donet5.com/Doc/27/2563 + //var ihttp=你存储的Services.BuildServiceProvider().GetService(); + var obj = App.GetService(); + return (SqlSugarScope)obj; + } + } + + } +} diff --git a/backend/BPA.MES.Base.Core/RequestPage.cs b/backend/BPA.MES.Base.Core/RequestPage.cs new file mode 100644 index 0000000..15ea1e6 --- /dev/null +++ b/backend/BPA.MES.Base.Core/RequestPage.cs @@ -0,0 +1,22 @@ +namespace BPA.MES.Base.Core +{ + /// + /// 名 称 :分页基础类 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 16:15:41 + /// 描 述 : + /// + public class RequestPage + { + /// + /// 页码 + /// + /// 1 + public int PageIndex { get; set; } + /// + /// 页大小 + /// + /// 10 + public int PageSize { get; set; } + } +} diff --git a/backend/BPA.MES.Base.Core/SqlSugarPagedList.cs b/backend/BPA.MES.Base.Core/SqlSugarPagedList.cs new file mode 100644 index 0000000..2f67754 --- /dev/null +++ b/backend/BPA.MES.Base.Core/SqlSugarPagedList.cs @@ -0,0 +1,109 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Core +{ + /// + /// 名 称 :分页泛型集合 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/2 16:21:27 + /// 描 述 : + /// + public class SqlSugarPagedList + where TEntity : new() + { + /// + /// 页码 + /// + public int Page { get; set; } + + /// + /// 页容量 + /// + public int PageSize { get; set; } + + /// + /// 总条数 + /// + public int Total { get; set; } + + /// + /// 总页数 + /// + public int TotalPages { get; set; } + + /// + /// 当前页集合 + /// + public IEnumerable Items { get; set; } + + /// + /// 是否有上一页 + /// + public bool HasPrevPage { get; set; } + + /// + /// 是否有下一页 + /// + public bool HasNextPage { get; set; } + } + + /// + /// 分页拓展类 + /// + public static class SqlSugarPagedExtensions + { + /// + /// 分页拓展 + /// + /// + /// + /// + /// + public static SqlSugarPagedList ToPagedList(this ISugarQueryable entity, int pageIndex, int pageSize) + where TEntity : new() + { + var total = 0; + var items = entity.ToPageList(pageIndex, pageSize, ref total); + var totalPages = (int)Math.Ceiling(total / (double)pageSize); + return new SqlSugarPagedList + { + Page = pageIndex, + PageSize = pageSize, + Items = items, + Total = total, + TotalPages = totalPages, + HasNextPage = pageIndex < totalPages, + HasPrevPage = pageIndex - 1 > 0 + }; + } + + /// + /// 分页拓展 + /// + /// + /// + /// + /// + public static async Task> ToPagedListAsync(this ISugarQueryable entity, int pageIndex, int pageSize) + where TEntity : new() + { + RefAsync total = 0; + var items = await entity.ToPageListAsync(pageIndex, pageSize, total); + var totalPages = (int)Math.Ceiling(total / (double)pageSize); + return new SqlSugarPagedList + { + Page = pageIndex, + PageSize = pageSize, + Items = items, + Total = total, + TotalPages = totalPages, + HasNextPage = pageIndex < totalPages, + HasPrevPage = pageIndex - 1 > 0 + }; + } + + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Core/SqlsugarSetup.cs b/backend/BPA.MES.Base.Core/SqlsugarSetup.cs new file mode 100644 index 0000000..35195bd --- /dev/null +++ b/backend/BPA.MES.Base.Core/SqlsugarSetup.cs @@ -0,0 +1,52 @@ +using Furion; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using System; +using System.Collections.Generic; + +namespace BPA.MES.Base.Core +{ + /// + /// 名 称 :数据库启动类 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/23 14:09:30 + /// 描 述 : + /// + public static class SqlsugarSetup + { + public static void AddSqlsugarSetup(this IServiceCollection services, IConfiguration configuration, string dbName = "ConnectionString") + { + //如果多个数数据库传 List + var dbs = App.GetConfig>("ConnectionConfigs")[0]; + var configConnection = new ConnectionConfig() + { + DbType = dbs.DbType, + ConnectionString = dbs.ConnectionString, + IsAutoCloseConnection = dbs.IsAutoCloseConnection, + }; + SqlSugarScope sqlSugar = new SqlSugarScope(configConnection, + db => + { + //单例参数配置,所有上下文生效 + db.Aop.OnLogExecuting = (sql, pars) => + { + Console.WriteLine(sql);//输出sql + }; + db.Aop.DataExecuting = (oldValue, entityInfo) => + { + if (entityInfo.PropertyName == "CreateTime" && entityInfo.OperationType == DataFilterType.InsertByObject) + { + entityInfo.SetValue(DateTime.Now); + }; + if (entityInfo.PropertyName == "CreateDate" && entityInfo.OperationType == DataFilterType.InsertByObject) + { + entityInfo.SetValue(DateTime.Now); + }; + }; + } + ); + services.AddSingleton(sqlSugar);//这边是SqlSugarScope用AddSingleton + } + } +} diff --git a/backend/BPA.MES.Base.Core/TreeExtensions.cs b/backend/BPA.MES.Base.Core/TreeExtensions.cs new file mode 100644 index 0000000..1659049 --- /dev/null +++ b/backend/BPA.MES.Base.Core/TreeExtensions.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace BPA.MES.Base.Core +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/3/4 9:50:52 + /// 描 述 : + /// + public static class TreeExtensions + { + public static List BuildTree(this List list, string rootId = "") where T : class, ITree + { + string rootId2 = rootId; + List list2 = list; + List resul = null; + if (list2.HasVal()) + { + List list3 = list2.Where((T e) => e.ParentId == rootId2).ToList(); + if (list3.HasVal()) + { + resul = new List(); + list3.ForEach(delegate (T it) + { + it.Children = list2.BuildTree(it.Id); + resul.Add(it); + }); + } + } + + return resul; + } + public interface ITree where T : class + { + string Id { get; set; } + + string ParentId { get; set; } + + List Children { get; set; } + } + public static List DeleteTreeNodes(this List list, Func condition) where T : class, ITree + { + if (list.HasVal()) + { + for (int i = 0; i < list.Count; i++) + { + T val = list[i]; + if (condition(val)) + { + list.Remove(val); + } + else if (val.Children.HasVal()) + { + val.Children.DeleteTreeNodes(condition); + } + } + } + + return list; + } + } +} diff --git a/backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj b/backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj new file mode 100644 index 0000000..56a5220 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj @@ -0,0 +1,19 @@ + + + + + net6.0 + 1701;1702;1591 + BPA.MES.Base.Web.Core.xml + + + + + + + + + + + + diff --git a/backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.xml b/backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.xml new file mode 100644 index 0000000..0956092 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.xml @@ -0,0 +1,22 @@ + + + + BPA.MES.Base.Web.Core + + + + + 重写 Handler 添加自动刷新收取逻辑 + + + + + + + 检查权限 + + + + + + diff --git a/backend/BPA.MES.Base.Web.Core/Handlers/JwtHandler.cs b/backend/BPA.MES.Base.Web.Core/Handlers/JwtHandler.cs new file mode 100644 index 0000000..7d69122 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Core/Handlers/JwtHandler.cs @@ -0,0 +1,72 @@ +using Furion; +using Furion.Authorization; +using Furion.DataEncryption; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using System.Threading.Tasks; + +namespace BPA.MES.Base.Web.Core; + +public class JwtHandler : AppAuthorizeHandler +{ + /// + /// 重写 Handler 添加自动刷新收取逻辑 + /// + /// + /// + public override async Task HandleAsync(AuthorizationHandlerContext context) + { + var IsClient = App.HttpContext.Request.Headers["IsClient"].ToString(); + if (IsClient == "true") + { + //获取所有未成功验证的需求 + var pendingRequirements = context.PendingRequirements; + // 通过授权验证 + foreach (var requirement in pendingRequirements) + { + context.Succeed(requirement); + } + } + else + { + // 自动刷新 token + if (JWTEncryption.AutoRefreshToken(context, context.GetCurrentHttpContext(), expiredTime: 43200, refreshTokenExpiredTime: 43225)) + { + await AuthorizeHandleAsync(context); + } + else + { + context.Fail(); // 授权失败 + } + } + } + public override Task PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext) + { + // 这里写您的授权判断逻辑,授权通过返回 true,否则返回 false + + return Task.FromResult(CheckAuthorzie(httpContext)); + } + /// + /// 检查权限 + /// + /// + /// + private static bool CheckAuthorzie(DefaultHttpContext httpContext) + { + // 获取权限特性 + var IsClient = App.HttpContext.Request.Headers["IsClient"].ToString(); + if (IsClient == "true") + { + return true; + } + var securityDefineAttribute = httpContext.GetMetadata(); + if (securityDefineAttribute == null) + { + return true; + } + else + { + return false; + } + } +} diff --git a/backend/BPA.MES.Base.Web.Core/Startup.cs b/backend/BPA.MES.Base.Web.Core/Startup.cs new file mode 100644 index 0000000..cbfc3b5 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Core/Startup.cs @@ -0,0 +1,87 @@ +using System; +using System.Threading.Tasks; +using BPA.AGV; +using BPA.ApiClient; +using BPA.MES.Base.Application; +using BPA.MES.Base.Application.Subscriber; +using BPA.MES.Base.Core; +using BPA.MQTTClient; +using Furion; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using MQTTnet.Client; +using MQTTnet.Client.Connecting; +using MQTTnet.Client.Disconnecting; +using MQTTnet.Client.Options; +using Newtonsoft.Json.Linq; +using Yitter.IdGenerator; + +namespace BPA.MES.Base.Web.Core; + +public class Startup : AppStartup +{ + public void ConfigureServices(IServiceCollection services) + { + + services.AddConsoleFormatter(); + services.AddJwt(enableGlobalAuthorize: true); + services.AddCorsAccessor(); + services.AddSqlsugarSetup(App.Configuration); + // 配置雪花Id算法机器码 + YitIdHelper.SetIdGenerator(new IdGeneratorOptions + { + WorkerId = 5 + }); + // 注册 EventBus 服务 + services.AddEventBus(builder => + { + // 通过类型注册 + builder.AddSubscriber(typeof(ToDoEventSubscriber)); + }); + services.AddRemoteRequest(); + + services.AddWebApiClient(); + services.AddAGV(op => + { + op.Header = new KCOption() + { + AppKey = "43", + AppSecret = "12", + RequestId = "43", + Timestamp = "2234234324", + Version = "2.9" + }; + op.Sign = "123456"; + }); + + services.AddControllers() + .AddInjectWithUnifyResult(); + + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseHttpsRedirection(); + app.UseStaticFiles(); + app.UseRouting(); + + app.UseCorsAccessor(); + + app.UseAuthentication(); + app.UseAuthorization(); + + app.UseInject("swagger"); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } +} diff --git a/backend/BPA.MES.Base.Web.Entry/.config/dotnet-tools.json b/backend/BPA.MES.Base.Web.Entry/.config/dotnet-tools.json new file mode 100644 index 0000000..b0e38ab --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/.config/dotnet-tools.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "isRoot": true, + "tools": {} +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj b/backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj new file mode 100644 index 0000000..4f228e6 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj @@ -0,0 +1,33 @@ + + + + + net6.0 + enable + en-US + true + 2cf25418-ba37-42f6-94c4-df8b11a33318 + Linux + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj.user b/backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj.user new file mode 100644 index 0000000..ace091a --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj.user @@ -0,0 +1,10 @@ + + + + ProjectDebugger + + + BPA.MES.Base.Web.Entry + E:\PZTJ.MES\backend\BPA.MES.Base.Web.Entry\Properties\PublishProfiles\FolderProfile.pubxml + + \ No newline at end of file diff --git a/backend/BPA.MES.Base.Web.Entry/Dockerfile b/backend/BPA.MES.Base.Web.Entry/Dockerfile new file mode 100644 index 0000000..122e207 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/Dockerfile @@ -0,0 +1,25 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj", "BPA.MES.Base.Web.Entry/"] +COPY ["BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj", "BPA.MES.Base.Web.Core/"] +COPY ["BPA.MES.Base.Application/BPA.MES.Base.Application.csproj", "BPA.MES.Base.Application/"] +COPY ["BPA.MES.Base.Core/BPA.MES.Base.Core.csproj", "BPA.MES.Base.Core/"] +RUN dotnet restore "BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj" +COPY . . +WORKDIR "/src/BPA.MES.Base.Web.Entry" +RUN dotnet build "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "BPA.MES.Base.Web.Entry.dll"] \ No newline at end of file diff --git a/backend/BPA.MES.Base.Web.Entry/Program.cs b/backend/BPA.MES.Base.Web.Entry/Program.cs new file mode 100644 index 0000000..65ae485 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/Program.cs @@ -0,0 +1 @@ +Serve.Run(RunOptions.Default.WithArgs(args)); diff --git a/backend/BPA.MES.Base.Web.Entry/SingleFilePublish.cs b/backend/BPA.MES.Base.Web.Entry/SingleFilePublish.cs new file mode 100644 index 0000000..8f9d8ec --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/SingleFilePublish.cs @@ -0,0 +1,22 @@ +using Furion; +using System.Reflection; + +namespace BPA.MES.Base.Web.Entry; + +public class SingleFilePublish : ISingleFilePublish +{ + public Assembly[] IncludeAssemblies() + { + return Array.Empty(); + } + + public string[] IncludeAssemblyNames() + { + return new[] + { + "BPA.MES.Base.Application", + "BPA.MES.Base.Core", + "BPA.MES.Base.Web.Core" + }; + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Web.Entry/appsettings.Development.json b/backend/BPA.MES.Base.Web.Entry/appsettings.Development.json new file mode 100644 index 0000000..5f187ae --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/appsettings.Development.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Information" + } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Web.Entry/appsettings.json b/backend/BPA.MES.Base.Web.Entry/appsettings.json new file mode 100644 index 0000000..c8ad527 --- /dev/null +++ b/backend/BPA.MES.Base.Web.Entry/appsettings.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json", + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Microsoft.EntityFrameworkCore": "Information" + } + }, + "AllowedHosts": "*", + "ConnectionConfigs": [ + { + "ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=BapAdmin123456.;", + //"ConnectionString": "server=192.168.1.231;Port=3306;Database=bpa_pztj_mes;Uid=root;Pwd=pztj8127;", + "DbType": "MySql", + "IsAutoCloseConnection": true + } + ], + "AGVUrl": "http://172.16.12.206:10080" +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.sln b/backend/BPA.MES.Base.sln new file mode 100644 index 0000000..4571ecc --- /dev/null +++ b/backend/BPA.MES.Base.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32519.111 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Application", "BPA.MES.Base.Application\BPA.MES.Base.Application.csproj", "{AB699EE9-43A8-46F2-A855-04A26DE63372}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Web.Core", "BPA.MES.Base.Web.Core\BPA.MES.Base.Web.Core.csproj", "{9D14BB78-DA2A-4040-B9DB-5A515B599181}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Core", "BPA.MES.Base.Core\BPA.MES.Base.Core.csproj", "{4FB30091-15C7-4FD9-AB7D-266814F360F5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Web.Entry", "BPA.MES.Base.Web.Entry\BPA.MES.Base.Web.Entry.csproj", "{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.Build.0 = Release|Any CPU + {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.Build.0 = Release|Any CPU + {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.Build.0 = Release|Any CPU + {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B2073C2C-0FD3-452B-8047-8134D68E12CE} + EndGlobalSection +EndGlobal diff --git a/backend/NuGet.config b/backend/NuGet.config new file mode 100644 index 0000000..b149801 --- /dev/null +++ b/backend/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/backend/dockerfile b/backend/dockerfile new file mode 100644 index 0000000..3076cfe --- /dev/null +++ b/backend/dockerfile @@ -0,0 +1,30 @@ +#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["NuGet.config", "."] +COPY ["BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj", "BPA.MES.Base.Web.Entry/"] +COPY ["BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj", "BPA.MES.Base.Web.Core/"] +COPY ["BPA.MES.Base.Application/BPA.MES.Base.Application.csproj", "BPA.MES.Base.Application/"] +COPY ["BPA.MES.Base.Core/BPA.MES.Base.Core.csproj", "BPA.MES.Base.Core/"] + + + +RUN dotnet restore "BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj" --configfile "NuGet.config" + +COPY . . +WORKDIR "/src/BPA.MES.Base.Web.Entry" +RUN dotnet build "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "BPA.MES.Base.Web.Entry.dll"] \ No newline at end of file diff --git a/frontend/.editorconfig b/frontend/.editorconfig new file mode 100644 index 0000000..7e3649a --- /dev/null +++ b/frontend/.editorconfig @@ -0,0 +1,16 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/frontend/.eslintignore b/frontend/.eslintignore new file mode 100644 index 0000000..8336e93 --- /dev/null +++ b/frontend/.eslintignore @@ -0,0 +1,8 @@ +/lambda/ +/scripts +/config +.history +public +dist +.umi +mock \ No newline at end of file diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js new file mode 100644 index 0000000..3ac39ef --- /dev/null +++ b/frontend/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: [require.resolve('@umijs/lint/dist/config/eslint')], + globals: { + page: true, + REACT_APP_ENV: true, + }, +}; diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..0fb3670 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,41 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +**/node_modules +# roadhog-api-doc ignore +/src/utils/request-temp.js +_roadhog-api-doc + +# production +/dist + +# misc +.DS_Store +npm-debug.log* +yarn-error.log + +/coverage +.idea +yarn.lock +package-lock.json +*bak +.vscode + + +# visual studio code +.history +*.log +functions/* +.temp/** + +# umi +.umi +.umi-production +.umi-test + +# screenshot +screenshot +.firebase +.eslintcache + +build diff --git a/frontend/.prettierignore b/frontend/.prettierignore new file mode 100644 index 0000000..7999ccd --- /dev/null +++ b/frontend/.prettierignore @@ -0,0 +1,22 @@ +**/*.svg +.umi +.umi-production +/dist +.dockerignore +.DS_Store +.eslintignore +*.png +*.toml +docker +.editorconfig +Dockerfile* +.gitignore +.prettierignore +LICENSE +.eslintcache +*.lock +yarn-error.log +.history +CNAME +/build +/public diff --git a/frontend/.prettierrc.js b/frontend/.prettierrc.js new file mode 100644 index 0000000..3447a1a --- /dev/null +++ b/frontend/.prettierrc.js @@ -0,0 +1,21 @@ +module.exports = { + singleQuote: true, + trailingComma: 'all', + printWidth: 100, + proseWrap: 'never', + endOfLine: 'lf', + overrides: [ + { + files: '.prettierrc', + options: { + parser: 'json', + }, + }, + { + files: 'document.ejs', + options: { + parser: 'html', + }, + }, + ], +}; diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..4c89a72 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,57 @@ +# Ant Design Pro + +This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use. + +## Environment Prepare + +Install `node_modules`: + +```bash +npm install +``` + +or + +```bash +yarn +``` + +## Provided Scripts + +Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test. + +Scripts provided in `package.json`. It's safe to modify or add additional script: + +### Start project + +```bash +npm start +``` + +### Build project + +```bash +npm run build +``` + +### Check code style + +```bash +npm run lint +``` + +You can also use script to auto fix some lint error: + +```bash +npm run lint:fix +``` + +### Test code + +```bash +npm test +``` + +## More + +You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro). diff --git a/frontend/config/config.ts b/frontend/config/config.ts new file mode 100644 index 0000000..f4cdc2e --- /dev/null +++ b/frontend/config/config.ts @@ -0,0 +1,132 @@ +// https://umijs.org/config/ +import { defineConfig } from '@umijs/max'; +import { join } from 'path'; +import defaultSettings from './defaultSettings'; +import proxy from './proxy'; +import routes from './routes'; + +const { REACT_APP_ENV = 'dev' } = process.env; + +export default defineConfig({ + /** + * @name 开启 hash 模式 + * @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。 + * @doc https://umijs.org/docs/api/config#hash + */ + history: { type: 'hash' }, + + // 更改为history模式 + // history:{type:'browser'} + hash: true, + esbuildMinifyIIFE: true, + /** + * @name 兼容性设置 + * @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖 + * @doc https://umijs.org/docs/api/config#targets + */ + // targets: { + // ie: 11, + // }, + /** + * @name 路由的配置,不在路由中引入的文件不会编译 + * @description 只支持 path,component,routes,redirect,wrappers,title 的配置 + * @doc https://umijs.org/docs/guides/routes + */ + // umi routes: https://umijs.org/docs/routing + routes, + /** + * @name 主题的配置 + * @description 虽然叫主题,但是其实只是 less 的变量设置 + * @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn + * @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme + */ + theme: { + // 如果不想要 configProvide 动态设置主题需要把这个设置为 default + // 只有设置为 variable, 才能使用 configProvide 动态设置主色调 + 'root-entry-name': 'variable', + }, + /** + * @name moment 的国际化配置 + * @description 如果对国际化没有要求,打开之后能减少js的包大小 + * @doc https://umijs.org/docs/api/config#ignoremomentlocale + */ + ignoreMomentLocale: false, + /** + * @name 代理配置 + * @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了 + * @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。 + * @doc 代理介绍 https://umijs.org/docs/guides/proxy + * @doc 代理配置 https://umijs.org/docs/api/config#proxy + */ + proxy: proxy[REACT_APP_ENV as keyof typeof proxy], + /** + * @name 快速热更新配置 + * @description 一个不错的热更新组件,更新时可以保留 state + */ + fastRefresh: true, + //============== 以下都是max的插件配置 =============== + /** + * @name 数据流插件 + * @@doc https://umijs.org/docs/max/data-flow + */ + model: {}, + /** + * 一个全局的初始数据流,可以用它在插件之间共享数据 + * @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。 + * @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81 + */ + initialState: {}, + /** + * @name layout 插件 + * @doc https://umijs.org/docs/max/layout-menu + */ + layout: { + locale: false, + ...defaultSettings, + }, + // /** + // * @name 国际化插件 + // * @doc https://umijs.org/docs/max/i18n + // */ + // locale: { + // default: '' + // }, + /** + * @name antd 插件 + * @description 内置了 babel import 插件 + * @doc https://umijs.org/docs/max/antd#antd + */ + antd: { + configProvider: {}, + appConfig: {}, + }, + /** + * @name moment2dayjs 插件 + * @description 将项目中的 moment 替换为 dayjs + * @doc https://umijs.org/docs/max/moment2dayjs + */ + moment2dayjs: { + preset: 'antd', + plugins: ['duration'], + }, + /** + * @name 网络请求配置 + * @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。 + * @doc https://umijs.org/docs/max/request + */ + request: {}, + /** + * @name 权限插件 + * @description 基于 initialState 的权限插件,必须先打开 initialState + * @doc https://umijs.org/docs/max/access + */ + access: {}, + //================ pro 插件配置 ================= + presets: ['umi-presets-pro'], + keepalive: [/./], + tabsLayout: { hasFixedHeader: false }, + mfsu: { + strategy: 'normal', + }, + requestRecord: {}, +}); diff --git a/frontend/config/defaultSettings.ts b/frontend/config/defaultSettings.ts new file mode 100644 index 0000000..2f6f1a4 --- /dev/null +++ b/frontend/config/defaultSettings.ts @@ -0,0 +1,28 @@ +import { Settings as LayoutSettings } from '@ant-design/pro-components'; + +/** + * @name + */ +const Settings: LayoutSettings & { + pwa?: boolean; + logo?: string; + title?:any +} = { + navTheme: 'light', + colorPrimary: '#13C2C2', + layout: 'mix', + contentWidth: 'Fluid', + fixedHeader: false, + fixSiderbar: true, + colorWeak: false, + title: "中控管理系统", + menu: { + locale: false, // 禁用多语言功能 + }, + pwa: false, + splitMenus:false, + + iconfontUrl: '', +}; + +export default Settings; diff --git a/frontend/config/proxy.ts b/frontend/config/proxy.ts new file mode 100644 index 0000000..ff1230b --- /dev/null +++ b/frontend/config/proxy.ts @@ -0,0 +1,26 @@ +/** + * @name 代理的配置 + * @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置 + * @doc https://umijs.org/docs/guides/proxy + */ +export default { + dev: { + '/api/': { + target: 'http://localhost:5502', + pathRewrite: { + '/api': '/api' + }, + changeOrigin: true, + } + }, + pre: { + '/api/': { + target: 'http://localhost:5000', + changeOrigin: true, + secure: false, + pathRewrite: { + '/api': '' + }, + }, + }, +}; diff --git a/frontend/config/routes.ts b/frontend/config/routes.ts new file mode 100644 index 0000000..bea4387 --- /dev/null +++ b/frontend/config/routes.ts @@ -0,0 +1,75 @@ +export default [ + { path: '/user', layout: false, routes: [{ path: '/user/login', component: './user/login' }] }, + { path: '/', icon: 'SmileOutlined', component: './welcome', name: '欢迎页' }, + { + icon: 'SettingOutlined', + path: '/system', + name: '系统管理', + routes: [ + { path: '/system/user', name: '人员管理', component: './system/user' }, + { path: '/system/role', name: '角色管理', component: './system/role' }, + { path: '/system/module', name: '模块管理', component: './system/module' }, + ], + }, + { + path: '/wmx', icon: 'SettingOutlined', name: '设备模型管理', + routes: [{ + name: '设备建模', + path: '/wmx/deviceProduct', + component: './deviceProductInfo/index', + }, + { path: '/wmx/deviceinfo', name: '设备管理', component: './deviceInfo/index' }, + ] + }, + { + path: '/base', icon: 'SettingOutlined', name: '工厂数据管理', + routes: [ + // { path: '/base/stock', name: '料仓管理', component: './stock/index' }, + { path: '/base/materials', name: '原料管理', component: './materials/index' }, + { path: '/base/final', name: '成品管理', component: './final/index' }, + { path: '/base/manufacturing', name: '产线管理', component: './manufacturing/index' }, + // { path: '/base/dict', name: '数据字典', component: './dict/index' }, + ] + }, + + // { + // path: '/line', icon: 'SettingOutlined', name: '产线管理', + // routes: [ + // { path: '/line/manufacturing', name: '产线设备管理', component: './manufacturing/index' }, + // ] + // }, + { + path: '/recipeCraft', icon: 'SettingOutlined', name: '配方工艺管理', + routes: [ + { path: '/recipeCraft/recipe', name: '配方管理', component: './recipe/index' }, + { path: '/recipeCraft/pot', name: '设备工艺', component: './craftInfo/pot' } + ] + }, + { path: '/work', icon: 'SettingOutlined', name: '工单管理', component: './workInfo/index' }, + // { + // path: '/data', icon: 'SettingOutlined', name: '数据服务', + // routes: [ + // { path: '/data/userlog', name: '操作日志', component: './logs/userlog' }, + // { path: '/data/runlog', name: '运行日志', component: './logs/runlog' }, + // { path: '/data/alarmlog', name: '报警日志', component: './logs/alarmlog' }, + // { path: '/data/programlog', name: '系统日志', component: './logs/programlog' } + // ] + // }, + // { + // path: '/agv', icon: 'SettingOutlined', name: 'agv管理', + // routes: [ + // { path: '/agv/agvbasic', name: 'agv基础数据', component: './agvbasic/index' }, + // { path: '/agv/agvline', name: 'agv线路管理', component: './agvline/index' } + // ] + // }, + // { + // path: '/report', icon: 'SettingOutlined', name: '统计报表', + // routes: [ + // { path: '/report/product', name: '成品统计', component: './report/product' }, + // { path: '/report/material', name: '原料统计', component: './report/material' }, + // ] + // }, + + { path: '*', layout: false, component: './404' }, + +]; diff --git a/frontend/default.conf b/frontend/default.conf new file mode 100644 index 0000000..ad50602 --- /dev/null +++ b/frontend/default.conf @@ -0,0 +1,13 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } +} + + + diff --git a/frontend/dockerfile b/frontend/dockerfile new file mode 100644 index 0000000..dfe1554 --- /dev/null +++ b/frontend/dockerfile @@ -0,0 +1,4 @@ +FROM nginx:latest +COPY ./frontend/dist /usr/share/nginx/html/ +COPY ./frontend/default.conf /etc/nginx/conf.d/ +EXPOSE 80 diff --git a/frontend/jest.config.ts b/frontend/jest.config.ts new file mode 100644 index 0000000..1de2a1a --- /dev/null +++ b/frontend/jest.config.ts @@ -0,0 +1,23 @@ +import { configUmiAlias, createConfig } from '@umijs/max/test'; + +export default async () => { + const config = await configUmiAlias({ + ...createConfig({ + target: 'browser', + }), + }); + + console.log(); + return { + ...config, + testEnvironmentOptions: { + ...(config?.testEnvironmentOptions || {}), + url: 'http://localhost:8000', + }, + setupFiles: [...(config.setupFiles || []), './tests/setupTests.jsx'], + globals: { + ...config.globals, + localStorage: null, + }, + }; +}; diff --git a/frontend/jsconfig.json b/frontend/jsconfig.json new file mode 100644 index 0000000..197bee5 --- /dev/null +++ b/frontend/jsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..e9834e6 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,106 @@ +{ + "name": "ant-design-pro", + "version": "6.0.0", + "license": "ISC", + "private": true, + "description": "An out-of-box UI solution for enterprise applications", + "scripts": { + "analyze": "cross-env ANALYZE=1 max build", + "build": "max build", + "deploy": "npm run build && npm run gh-pages", + "dev": "npm run start:dev", + "gh-pages": "gh-pages -d dist", + "i18n-remove": "pro i18n-remove --write", + "postinstall": "max setup", + "jest": "jest", + "lint": "npm run lint:js && npm run lint:prettier && npm run tsc", + "lint-staged": "lint-staged", + "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", + "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ", + "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", + "lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto", + "openapi": "max openapi", + "prepare": "cd ../.. && husky install frontend/.husky", + "prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"", + "preview": "npm run build && max preview --port 8000", + "record": "cross-env NODE_ENV=development REACT_APP_ENV=test max record --scene=login", + "serve": "umi-serve", + "start:mock": "cross-env UMI_ENV=dev max dev", + "start": "cross-env UMI_ENV=dev max dev", + "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev", + "start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev", + "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev", + "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev", + "test": "jest", + "test:coverage": "npm run jest -- --coverage", + "test:update": "npm run jest -- -u", + "tsc": "tsc --noEmit" + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js", + "**/*.{js,jsx,tsx,ts,less,md,json}": [ + "prettier --write" + ] + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 10" + ], + "dependencies": { + "@ant-design/charts": "^1.4.2", + "@ant-design/icons": "^4.8.0", + "@ant-design/pro-components": "^2.3.44", + "@ant-design/pro-layout": "^7.8.3", + "@ant-design/use-emotion-css": "1.0.4", + "@jiaminghi/data-view-react": "^1.2.5", + "@umijs/route-utils": "^2.2.2", + "antd": "^5.2.3", + "classnames": "^2.3.2", + "eslint-config-prettier": "^8.6.0", + "eslint-plugin-unicorn": "^46.0.0", + "js-md5": "^0.7.3", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "omit.js": "^2.0.2", + "rc-menu": "^9.8.1", + "rc-util": "^5.25.2", + "react": "^18.2.0", + "react-dev-inspector": "^1.8.3", + "react-dom": "^18.2.0", + "react-helmet-async": "^1.3.0", + "uuid": "^9.0.0" + }, + "devDependencies": { + "@ant-design/pro-cli": "^2.1.5", + "@testing-library/react": "^13.4.0", + "@types/classnames": "^2.3.1", + "@types/express": "^4.17.14", + "@types/history": "^4.7.11", + "@types/jest": "^29.2.4", + "@types/js-md5": "^0.7.0", + "@types/lodash": "^4.14.191", + "@types/react": "^17.0.52", + "@types/react-dom": "^17.0.18", + "@types/react-helmet": "^6.1.6", + "@umijs/lint": "^4.0.35", + "@umijs/max": "^4.0.55", + "cross-env": "^7.0.3", + "eslint": "^8.29.0", + "express": "^4.18.2", + "gh-pages": "^3.2.3", + "husky": "^7.0.4", + "jest": "^29.3.1", + "jest-environment-jsdom": "^29.3.1", + "lint-staged": "^10.5.4", + "mockjs": "^1.1.0", + "prettier": "^2.8.1", + "swagger-ui-dist": "^4.15.5", + "ts-node": "^10.9.1", + "typescript": "^4.9.4", + "umi-presets-pro": "^2.0.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts new file mode 100644 index 0000000..ec1b31d --- /dev/null +++ b/frontend/playwright.config.ts @@ -0,0 +1,22 @@ +// playwright.config.ts +import type { PlaywrightTestConfig } from '@playwright/test'; +import { devices } from '@playwright/test'; + +const config: PlaywrightTestConfig = { + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + use: { + trace: 'on-first-retry', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + { + name: 'firefox', + use: { ...devices['Desktop Firefox'] }, + }, + ], +}; +export default config; diff --git a/frontend/public/CNAME b/frontend/public/CNAME new file mode 100644 index 0000000..30c2d4d --- /dev/null +++ b/frontend/public/CNAME @@ -0,0 +1 @@ +preview.pro.ant.design \ No newline at end of file diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico new file mode 100644 index 0000000..e2e9325 Binary files /dev/null and b/frontend/public/favicon.ico differ diff --git a/frontend/public/icons/icon-128x128.png b/frontend/public/icons/icon-128x128.png new file mode 100644 index 0000000..48d0e23 Binary files /dev/null and b/frontend/public/icons/icon-128x128.png differ diff --git a/frontend/public/icons/icon-192x192.png b/frontend/public/icons/icon-192x192.png new file mode 100644 index 0000000..938e9b5 Binary files /dev/null and b/frontend/public/icons/icon-192x192.png differ diff --git a/frontend/public/icons/icon-512x512.png b/frontend/public/icons/icon-512x512.png new file mode 100644 index 0000000..21fc108 Binary files /dev/null and b/frontend/public/icons/icon-512x512.png differ diff --git a/frontend/public/logo.png b/frontend/public/logo.png new file mode 100644 index 0000000..e3d7365 Binary files /dev/null and b/frontend/public/logo.png differ diff --git a/frontend/public/logo.svg b/frontend/public/logo.svg new file mode 100644 index 0000000..239bf69 --- /dev/null +++ b/frontend/public/logo.svg @@ -0,0 +1 @@ +Group 28 Copy 5Created with Sketch. \ No newline at end of file diff --git a/frontend/public/nc.png b/frontend/public/nc.png new file mode 100644 index 0000000..2dcd410 Binary files /dev/null and b/frontend/public/nc.png differ diff --git a/frontend/public/pro_icon.svg b/frontend/public/pro_icon.svg new file mode 100644 index 0000000..e075b78 --- /dev/null +++ b/frontend/public/pro_icon.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/api/AuthTemplate.ts b/frontend/src/api/AuthTemplate.ts new file mode 100644 index 0000000..d27449d --- /dev/null +++ b/frontend/src/api/AuthTemplate.ts @@ -0,0 +1,119 @@ +import { request } from '@umijs/max'; + +/** + * 授权模板 + */ +export default { + /** + * 创建授权模板 + * @param params + * @returns + */ + SaveCreateAuthTemp(params: AuthTemplateTypes.AuthTemplateType) { + return request('/api/authorize/AddAuthorTemp', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 删除授权模板 + * @param params + * @returns + */ + DeleteAuthTemp(id: string) { + return request(`/api/authorize/RemoveAuthorTemp/${id}`, { + method: 'GET' + }); + }, + + /** + * 修改授权模板 + * @param params + * @returns + */ + SaveModifyAuthTemp(params: AuthTemplateTypes.AuthTemplateType) { + return request('/api/authorize/EditAuthorTemp', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 授权模板分页查询 + * @param params + * @returns + */ + GetPagedListAuthTemp(params: AuthTemplateTypes.PageParams) { + return request('/api/authorize/QueryAuthorTemp', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 模板 授权模块 + */ + SaveUpdateItems(params: AuthTemplateTypes.TempAuthModule) { + return request('/api/authorize/EditTemplateItem', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 根据模板ID 查询已授权用户|角色 + * @param params + * @returns + */ + GetauthorizeObjects(params: AuthTemplateTypes.AuthObjectParams) { + return request('/api/authorize/GetauthorizeObjects', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 添加授权 + */ + Addauthorize(params: AuthTemplateTypes.AddAuthParams) { + return request('/api/authorize/Addauthorize', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 移除授权 + */ + Removeauthorize(params: AuthTemplateTypes.RemoveAuthParams) { + return request('/api/authorize/Removeauthorize', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 获取授权模板列表 + * @param templateId + */ + GetModules(templateId: string) { + return request(`/api/authorize/getmodulebytemplateid/${templateId}`, { + method: 'GET' + }); + } +} \ No newline at end of file diff --git a/frontend/src/api/Bucket.ts b/frontend/src/api/Bucket.ts new file mode 100644 index 0000000..fb86198 --- /dev/null +++ b/frontend/src/api/Bucket.ts @@ -0,0 +1,132 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: BucketTypes.Info) { + return request('/api/bucketinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: BucketTypes.BucketInfoDelInput) { + return request(`/api/bucketinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: BucketTypes.Info) { + return request('/api/bucketinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + + + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/bucketinfo/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List() { + return request('/api/bucketinfo/list', { + method: 'POST' + }); + }, + /** + * 未绑定的设备列表 + * @param parms + * @returns + */ + UnBindList() { + return request('/api/bucketinfo/UnBindList', { + method: 'GET' + }); + + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: BucketTypes.Page) { + return request('/api/bucketinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 批量更新 + * @param parms + * @returns + */ + BatchUpdate(parms: BucketTypes.BatchAdd) { + return request('/api/bucketrecipe/batchupdate', { + method: 'POST', + data: parms + }); + }, + /** + * 根据设备Id查询配方信息 + * @param parms + * @returns + */ + RecipeList(id: string){ + return request('api/bucketrecipe/list', { + method: 'POST', + data: { + bucketId: id + } + }); + }, + // 根据桶id查询桶的物料记录 + + materialtrecored(parms: BucketTypes.BucketMaterialsRecordQueryPageInput){ + return request('/api/bucketmaterialsrecord/pagedlist',{ + method: 'POST', + data:{...parms} + }) + }, + // materialtrecored(){ + // return request('/api/bucketmaterialsrecord/list',{ + // method: 'GET', + + // }) + // } + +} + diff --git a/frontend/src/api/DeviceInfo.ts b/frontend/src/api/DeviceInfo.ts new file mode 100644 index 0000000..e300905 --- /dev/null +++ b/frontend/src/api/DeviceInfo.ts @@ -0,0 +1,119 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: DeviceTypes.Info) { + return request('/api/devicesinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: DeviceTypes.DeviceInfoDelInput) { + return request(`/api/devicesinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: DeviceTypes.Info) { + return request('/api/devicesinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/devicesinfo/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List() { + return request('/api/devicesinfo/list', { + method: 'POST' + }); + }, + /** + * 未绑定的设备列表 + * @param parms + * @returns + */ + UnBindList() { + return request('/api/devicesinfo/UnBindList', { + method: 'GET' + }); + + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: DeviceTypes.Page) { + return request('/api/devicesinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 批量更新 + * @param parms + * @returns + */ + BatchUpdate(parms: DeviceTypes.BatchAdd) { + return request('/api/devicerecipe/batchupdate', { + method: 'POST', + data: parms + }); + }, + /** + * 根据设备Id查询配方信息 + * @param parms + * @returns + */ + RecipeList(id: string){ + return request(' api/devicerecipe/list', { + method: 'POST', + data: { + deviceId: id + } + }); + }, + // 设备下拉 + selectlist(){ + return request('/api/devicesinfo/selectlist',{ + method:'GET' + }) + } +} \ No newline at end of file diff --git a/frontend/src/api/Material.ts b/frontend/src/api/Material.ts new file mode 100644 index 0000000..8853278 --- /dev/null +++ b/frontend/src/api/Material.ts @@ -0,0 +1,334 @@ +import { request } from '@umijs/max'; + +export default { + /** + * 物料列表 + * @param params + * @returns + */ + MaterialList(params: MaterialTypes.MaterialPageListParams) { + return request('/erp/material/Material/GetMaterialPage', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 根据Id获取物料信息 + * @param id + */ + GetMaterialById(id: string) { + return request(`/erp/material/Material/GetMaterialById?id=${id}`, { + method: 'GET' + }); + }, + + /** + * 新增物料 + * @param params + * @returns + */ + AddMaterial(params: MaterialTypes.MaterialItemEA) { + return request('/erp/material/Material/AddMaterial', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 修改物料 + * @param params + * @returns + */ + UpdateMaterial(params: MaterialTypes.MaterialItemEA) { + return request('/erp/material/Material/UpdateMaterial', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 修改物料价格 + * @param params + * @returns + */ + UpdateMateriaPrice(params: MaterialTypes.MaterialPriceParams) { + return request('/erp/material/Material/UpdateMateriaPrice', { + method: 'POST', + data: { + ...params + } + }); + }, + + + /** + * 扩展属性分页列表 + * @param params + * @returns + */ + GetExtendAttributePage(params: MaterialTypes.ExtendAttributePageParams) { + return request('/erp/material/ExtendAttribute/GetExtendAttributePage', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 添加扩展属性 + * @param params + * @returns + */ + AddExtendAttribute(params: MaterialTypes.ExtendAttributeItem) { + return request('/erp/material/ExtendAttribute/AddExtendAttribute', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 修改扩展属性 + * @param params + */ + UpdateExtendAttribute(params: MaterialTypes.ExtendAttributeItem) { + return request('/erp/material/ExtendAttribute/UpdateExtendAttribute', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 根据获取扩展属性id获取扩展属性 + * @param id + * @returns + */ + GetExtendAttributeById(id: string) { + return request(`/erp/material/ExtendAttribute/GetExtendAttributeById?id=${id}`, { + method: 'GET' + }); + }, + + /** + * 根据物料ID查询物料扩展属性列表 + * @param materialId + * @returns + */ + GetMaterialExtendAttributeById(materialId: string) { + return request(`/erp/material/MaterialExtend/GetMaterialExtendAttributeById/${materialId}`, { + method: 'GET' + }); + }, + + /** + * 新增物料的扩展属性信息 + * @param params + * @returns + */ + AddMaterialExtendAttribute(params: MaterialTypes.MaterialExtendAttributeItem) { + return request('/erp/material/MaterialExtend/AddMaterialExtendAttribute', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 编辑物料的扩展属性信息 + * @param params + */ + UpdateMaterialExtendAttribute(params: MaterialTypes.MaterialExtendAttributeItem) { + return request('/erp/material/MaterialExtend/UpdateMaterialExtendAttribute', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 获取物料类型分页列表 + * @param params + */ + GetMaterialTypePage(params: MaterialTypes.MaterialTypeParams) { + return request('/erp/material/MaterialType/GetMaterialTypePage', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 新增物料类型 + * @param params + * @returns + */ + AddMaterialType(params: MaterialTypes.MaterialType) { + return request('/erp/material/MaterialType/AddMaterialType', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 更新物料类型 + * @param params + * @returns + */ + UpdateMaterialType(params: MaterialTypes.MaterialType) { + return request('/erp/material/MaterialType/UpdateMaterialType', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 根据物料类型Id获取物料的拓展信息 + * @param id + */ + GetMaterialTypeExtendAttributeById(id: string) { + return request(`/erp/material/MaterialType/GetMaterialTypeExtendAttributeById?Id=${id}`, { + method: 'GET' + }); + }, + + /** + * 新增物料类型的拓展信息 + * @param params + * @returns + */ + AddMaterialTypeExtendAttribute(params: MaterialTypes.MaterialTypeExtend) { + return request('/erp/material/MaterialTypeExtend/AddMaterialTypeExtendAttribute', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 更新物料类型扩展信息 + * @param params + * @returns + */ + UpdateMaterialTypeExtendAttribute(params: MaterialTypes.MaterialTypeExtend) { + return request('/erp/material/MaterialTypeExtend/UpdateMaterialTypeExtendAttribute', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 根据物料Id查询物料的修改记录 + * @param params + * @returns + */ + MeterialModifyPage(params: MaterialTypes.MaterialModifyPageParams) { + return request(`/erp/material/MeterialModify/MeterialModifyPage`, { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 新增物料修改记录 + * @param params + * @returns + */ + AddMeterialModify(params: MaterialTypes.MaterialModify) { + return request('/erp/material/MeterialModify/AddMeterialModify', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 根据物料Id获取物料单位的换算列表 + * @param id + * @returns + */ + GetUnitTransformationsById(id: string) { + return request(`/erp/material/UnitTransformation/GetUnitTransformationsById?Id=${id}`, { + method: 'GET' + }); + }, + + /** + * 添加物料换算 + * @param params + * @returns + */ + AddUnitTransformation(params: MaterialTypes.MaterialUnitTransform) { + return request('/erp/material/UnitTransformation/AddUnitTransformation', { + method: 'POST', + data: { + ...params + } + }); + }, + + /** + * 编辑物料换算 + * @param params + * @returns + */ + UpdateUnitTransformation(params: MaterialTypes.MaterialUnitTransform) { + return request('/erp/material/UnitTransformation/UpdateUnitTransformation', { + method: 'POST', + data: { + ...params + } + }); + }, + + + /** + * 导出物料模板 + * @param materialTypeId + * @returns + */ + MaterialTemplateExport(materialTypeId: string) { + return request(`/erp/material/Material/MaterialTemplateExport?materialTypeId=${materialTypeId}`, { + method: 'GET', + responseType: 'blob' + }); + }, + + /** + * 导出物料数据 + * @param params + * @returns + */ + MaterialDataExport(params: MaterialTypes.ExportMaterialParams) { + return request('/erp/material/Material/MaterialDataExport', { + method: 'POST', + responseType: 'blob', + data: { + ...params + } + }); + } +} \ No newline at end of file diff --git a/frontend/src/api/StockService.ts b/frontend/src/api/StockService.ts new file mode 100644 index 0000000..5c44644 --- /dev/null +++ b/frontend/src/api/StockService.ts @@ -0,0 +1,119 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增料仓 + * @param parms + * @returns + */ + Add(parms: StockTypes.Info) { + return request('/api/stockinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: StockTypes.StockInfoDelInput) { + return request(`/api/stockinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: StockTypes.Info) { + return request('/api/stockinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/stockinfo/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List() { + return request('/api/stockinfo/list', { + method: 'POST' + }); + }, + /** + * 未绑定的设备列表 + * @param parms + * @returns + */ + UnBindList() { + return request('/api/stockinfo/UnBindList', { + method: 'GET' + }); + + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: StockTypes.Page) { + return request('/api/stockinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + // /** + // * 批量更新 + // * @param parms + // * @returns + // */ + // BatchUpdate(parms: StockTypes.BatchAdd) { + // return request('/api/Stockrecipe/batchupdate', { + // method: 'POST', + // data: parms + // }); + // }, + /** + * 根据设备Id查询配方信息 + * @param parms + * @returns + */ + RecipeList(id: string){ + return request(' api/stockrecipe/list', { + method: 'POST', + data: { + StockId: id + } + }); + }, + // 料仓下拉列表 + selectlist(){ + return request('/api/stockinfo/selectlist',{ + method :'GET' + }) + } +} \ No newline at end of file diff --git a/frontend/src/api/agvbasicService.ts b/frontend/src/api/agvbasicService.ts new file mode 100644 index 0000000..6ea776c --- /dev/null +++ b/frontend/src/api/agvbasicService.ts @@ -0,0 +1,60 @@ +import { request } from '@umijs/max'; + +// agv点位基础数据 +export default { + //创建分组 + Add(parms: AgvbasicInfoTypes.Info) { + return request('/api/agvpoint/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //删除 + Del(parms: AgvbasicInfoTypes.Info) { + return request(`/api/agvpoint/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //修改 + Update(parms: AgvbasicInfoTypes.Info) { + return request('/api/agvpoint/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //列表 + List() { + return request('/api/agvpoint/list', { + method: 'POST', + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: AgvbasicInfoTypes.Page) { + return request('/api/agvpoint/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + // 下拉 + selectlist() { + return request('/api/agvpoint/selectlist', { + method: 'GET' + } + + ) + } +} + diff --git a/frontend/src/api/agvlineService.ts b/frontend/src/api/agvlineService.ts new file mode 100644 index 0000000..5e1d7f4 --- /dev/null +++ b/frontend/src/api/agvlineService.ts @@ -0,0 +1,60 @@ +import { request } from '@umijs/max'; + +// +export default { + //创建分组 + Add(parms: AgvlineInfoTypes.Info) { + return request('/api/agvline/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //删除 + Del(parms: AgvlineInfoTypes.Info) { + return request(`/api/agvline/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //修改 + Update(parms: AgvlineInfoTypes.Info) { + return request('/api/agvline/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //列表 + List() { + return request('/api/agvline/list', { + method: 'POST', + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: AgvlineInfoTypes.Page) { + return request('/api/agvline/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + // 下拉 + selectlist() { + return request('/api/agvline/selectlist', { + method: 'GET' + } + + ) + } +} + diff --git a/frontend/src/api/craftsinfo.ts b/frontend/src/api/craftsinfo.ts new file mode 100644 index 0000000..c365305 --- /dev/null +++ b/frontend/src/api/craftsinfo.ts @@ -0,0 +1,159 @@ +import { Pztj_CraftStepsAddInput } from './../types/Crafts.d'; + +import { request } from '@umijs/max'; + +// 工艺 +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: CraftsTypes.Info) { + return request('/api/craftsinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: CraftsTypes.craftsInfoDelInput) { + return request(`/api/craftsinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: CraftsTypes.Info) { + return request('/api/craftsinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + + + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/craftsinfo/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List() { + return request('/api/craftsinfo/list', { + method: 'POST' + }); + }, + /** + * 未绑定的设备列表 + * @param parms + * @returns + */ + UnBindList() { + return request('/api/craftsinfo/UnBindList', { + method: 'GET' + }); + + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: CraftsTypes.Page) { + return request('/api/craftsinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 批量更新 + * @param parms + * @returns + */ + BatchUpdate(parms: CraftsTypes.BatchAdd) { + return request('/api/craftsrecipe/batchupdate', { + method: 'POST', + data: parms + }); + }, + // 下拉 + selectlist() { + return request('/api/craftsinfo/selectlist', { + method: 'GET', + + }) + }, + BatchAdd(parms :CraftsTypes.Pztj_CraftStepsAddInput[]){ + return request('',{ + method: 'POST', + data:{...parms} + }) + }, + //根据工艺查询步骤 + craftsStepPage(parms: CraftsTypes.Pztj_CraftStepsPageInput){ + return request(`/api/craftssteps/pagedlist`, { + method: 'POST', + data:{...parms} + }) + }, + //根据批量更新步骤 + BatchUpdateStep(parms :CraftsTypes.craftsInfoUpdateInput[]){ + return request('/api/craftssteps/batchupdate',{ + method: 'POST', + data: parms + }) + }, + //更新步骤 + UpdateStep(parms:CraftsTypes.craftsInfoUpdateInput){ + return request('/api/craftssteps/update',{ + method: 'POST', + data: parms + }) + }, + /** + * 删除 + * @param parms + * @returns + */ + DelStep(parms: CraftsTypes.craftsInfoDelInput) { + return request(`/api/craftssteps/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //增加步骤 + StepAdd(parms : CraftsTypes.Pztj_CraftStepsAddInput){ + return request('/api/craftssteps/add',{ + method: 'POST', + data: parms + }) + } +} + diff --git a/frontend/src/api/deviceInfo/dtos/deviceProduct.d.ts b/frontend/src/api/deviceInfo/dtos/deviceProduct.d.ts new file mode 100644 index 0000000..fcdf087 --- /dev/null +++ b/frontend/src/api/deviceInfo/dtos/deviceProduct.d.ts @@ -0,0 +1,72 @@ +declare namespace deviceProduct { + /** + * 基类 + */ + type base_dto = { + /** + * 编码 + */ + code: string; + /** + * 描述 + */ + description?: null | string; + /** + * 名称 + */ + name: string; + + params:string; + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + deviceProductId? : null | string; + code? : null | string; + + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + name:string + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} \ No newline at end of file diff --git a/frontend/src/api/deviceInfo/dtos/deviceProductFunction.d.ts b/frontend/src/api/deviceInfo/dtos/deviceProductFunction.d.ts new file mode 100644 index 0000000..29798bf --- /dev/null +++ b/frontend/src/api/deviceInfo/dtos/deviceProductFunction.d.ts @@ -0,0 +1,77 @@ +declare namespace deviceProductFunction { + /** + * 基类 + */ + type base_dto = { + + /** + * 设备产品Id + */ + deviceProductId:string; + /** + * 编码 + */ + code: string; + /** + * 描述 + */ + description?: null | string; + /** + * 名称 + */ + name: string; + params:string; + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + deviceProductId?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + /** + * 设备产品Id + */ + deviceProductId?: null | string; + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} \ No newline at end of file diff --git a/frontend/src/api/deviceInfo/dtos/deviceProductParm.d.ts b/frontend/src/api/deviceInfo/dtos/deviceProductParm.d.ts new file mode 100644 index 0000000..91e626a --- /dev/null +++ b/frontend/src/api/deviceInfo/dtos/deviceProductParm.d.ts @@ -0,0 +1,74 @@ +declare namespace deviceProductParm { + /** + * 基类 + */ + type base_dto = { + /** + * 设备产品Id + */ + deviceProductId:string; + /** + * 编码 + */ + code: string; + /** + * 描述 + */ + description?: null | string; + /** + * 名称 + */ + name: string; + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + /** + * 设备产品Id + */ + deviceProductId:string; + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} \ No newline at end of file diff --git a/frontend/src/api/deviceInfo/services/deviceProduct.ts b/frontend/src/api/deviceInfo/services/deviceProduct.ts new file mode 100644 index 0000000..bd0a203 --- /dev/null +++ b/frontend/src/api/deviceInfo/services/deviceProduct.ts @@ -0,0 +1,88 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: deviceProduct.addInput) { + return request('/api/deviceProduct/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: deviceProduct.delInput) { + return request(`/api/deviceProduct/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: deviceProduct.updateInput) { + return request('/api/deviceProduct/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/deviceProduct/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: deviceProduct.queryParms) { + return request('/api/deviceProduct/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: deviceProduct.queryPage) { + return request('/api/deviceProduct/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + SelectList(){ + return request('/api/deviceProduct/selectlist', { + method: 'GET', + }); + } + +} + diff --git a/frontend/src/api/deviceInfo/services/deviceProductFunction.ts b/frontend/src/api/deviceInfo/services/deviceProductFunction.ts new file mode 100644 index 0000000..07e9e93 --- /dev/null +++ b/frontend/src/api/deviceInfo/services/deviceProductFunction.ts @@ -0,0 +1,83 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: deviceProductFunction.addInput) { + return request('/api/deviceproductfunction/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: deviceProductFunction.delInput) { + return request(`/api/deviceproductfunction/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: deviceProductFunction.updateInput) { + return request('/api/deviceproductfunction/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/deviceproductfunction/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: deviceProductFunction.queryParms) { + return request('/api/deviceproductfunction/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: deviceProductFunction.queryPage) { + return request('/api/deviceproductfunction/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} + diff --git a/frontend/src/api/deviceInfo/services/deviceProductParm.ts b/frontend/src/api/deviceInfo/services/deviceProductParm.ts new file mode 100644 index 0000000..aeb348a --- /dev/null +++ b/frontend/src/api/deviceInfo/services/deviceProductParm.ts @@ -0,0 +1,83 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: deviceProductParm.addInput) { + return request('/api/deviceProductParm/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: deviceProductParm.delInput) { + return request(`/api/deviceProductParm/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: deviceProductParm.updateInput) { + return request('/api/deviceProductParm/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/deviceProductParm/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: deviceProductParm.queryParms) { + return request('/api/deviceProductParm/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: deviceProductParm.queryPage) { + return request('/api/deviceProductParm/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} + diff --git a/frontend/src/api/dictType/dto.d.ts b/frontend/src/api/dictType/dto.d.ts new file mode 100644 index 0000000..d12b187 --- /dev/null +++ b/frontend/src/api/dictType/dto.d.ts @@ -0,0 +1,145 @@ +declare namespace dictType { + /** + * 基类 + */ + type base_dto = { + /** + * 编码 + */ + code?: null | string; + /** + * 描述 + */ + sort?: null | string; + /** + * 名称 + */ + name?: null | string; + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + name:string, + code:string + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} +declare namespace dictData { + /** + * 基类 + */ + type base_dto = { + /** + * 编码 + */ + code?: null | string; + /** + * 描述 + */ + sort?: null | string; + /** + * 名称 + */ + value?: null | string; + /** + * 类型id + */ + typeId?: null |string; + + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + typeId:string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + typeId?: null|string, + typeCode?: null | string , + id?: null | string + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number , + pageSize: number, + name:string, + typeId:string + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} \ No newline at end of file diff --git a/frontend/src/api/dictType/service.ts b/frontend/src/api/dictType/service.ts new file mode 100644 index 0000000..c598468 --- /dev/null +++ b/frontend/src/api/dictType/service.ts @@ -0,0 +1,164 @@ + +import { request } from '@umijs/max'; + + +const dictTypeApi= { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: dictType.addInput) { + return request('/api/dictType/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: dictType.delInput) { + return request(`/api/dictType/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: dictType.updateInput) { + return request('/api/dictType/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/dictType/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: dictType.queryParms) { + return request('/api/dictType/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: dictType.queryPage) { + return request('/api/dictType/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} + +const dictDataApi= { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: dictData.addInput) { + return request('/api/dictData/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: dictData.delInput) { + return request(`/api/dictData/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: dictData.updateInput) { + return request('/api/dictData/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/dictData/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: dictData.queryParms) { + return request('/api/dictData/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: dictData.queryPage) { + return request('/api/dictData/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} + +export {dictTypeApi,dictDataApi} + diff --git a/frontend/src/api/finalService.ts b/frontend/src/api/finalService.ts new file mode 100644 index 0000000..3f0f9cf --- /dev/null +++ b/frontend/src/api/finalService.ts @@ -0,0 +1,123 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: FinalTypes.Info) { + return request('/api/finalsinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: FinalTypes.FinalInfoDelInput) { + return request(`/api/finalsinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: FinalTypes.Info) { + return request('/api/finalsinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/finalsinfo/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List() { + return request('/api/finalsinfo/list', { + method: 'POST' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + SelectList() { + return request('/api/finalsinfo/selectlist', { + method: 'GET' + }); + }, + /** + * 未绑定的设备列表 + * @param parms + * @returns + */ + UnBindList() { + return request('/api/finalsinfo/UnBindList', { + method: 'GET' + }); + + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: FinalTypes.Page) { + return request('/api/finalsinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 批量更新 + * @param parms + * @returns + */ + BatchUpdate(parms: FinalTypes.BatchAdd) { + return request('/api/finalsinfo/batchupdate', { + method: 'POST', + data: parms + }); + }, + /** + * 根据设备Id查询配方信息 + * @param parms + * @returns + */ + RecipeList(id: string){ + return request(' api/finalsinfo/list', { + method: 'POST', + data: { + deviceId: id + } + }); + } +} \ No newline at end of file diff --git a/frontend/src/api/groupService.ts b/frontend/src/api/groupService.ts new file mode 100644 index 0000000..0edc4af --- /dev/null +++ b/frontend/src/api/groupService.ts @@ -0,0 +1,60 @@ +import { request } from '@umijs/max'; + + +export default { + //创建分组 + Add(parms: GroupInfoTypes.Info) { + return request('/api/groupinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //删除 + Del(parms: GroupInfoTypes.Info) { + return request(`/api/groupinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //修改 + Update(parms: GroupInfoTypes.Info) { + return request('/api/groupinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //列表 + List() { + return request('/api/groupinfo/list', { + method: 'POST', + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: GroupInfoTypes.Page) { + return request('/api/groupinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + // 下拉 + selectlist() { + return request('/api/groupinfo/selectlist', { + method: 'GET' + } + + ) + } +} + diff --git a/frontend/src/api/kepService.ts b/frontend/src/api/kepService.ts new file mode 100644 index 0000000..5af41c2 --- /dev/null +++ b/frontend/src/api/kepService.ts @@ -0,0 +1,48 @@ +import { request } from '@umijs/max'; + + +export default { + + + Getdatavalarmlimitpage(params) { + return request('/api/kepdata/getdatavalarmlimitlist', { + method: 'POST', + data: { + ...params + } + }); + }, + Adddatavalarmlimit(params) { + return request('/api/kepdata/adddatavalarmlimit', { + method: 'POST', + data: { + ...params + } + }); + }, + Updatedatavalarmlimit(params) { + return request('/api/kepdata/updatedatavalarmlimit', { + method: 'POST', + data: { + ...params + } + }); + }, + Del(parms) { + return request(`/api/kepdata/deldatavalarmlimitlist/`+parms, { + method: 'POST', + }); + }, + getdatavData() { + return request(`/api/kepdata/getdatavlist`, { + method: 'GET', + }); + }, + getlogs() { + return request(`/api/kepdata/getlogs`, { + method: 'GET', + }); + } + +} + diff --git a/frontend/src/api/logs/dto.d.ts b/frontend/src/api/logs/dto.d.ts new file mode 100644 index 0000000..b014fad --- /dev/null +++ b/frontend/src/api/logs/dto.d.ts @@ -0,0 +1,316 @@ +declare namespace alarmlog { + /** + * 基类 + */ + type base_dto = { + /** + * 报警信息 + */ + msgInfo?: null | string; + /** + * 报警值 + */ + value?: null | string; + /** + * 报警等级 + */ + grade?: null | string; + /** + * 设备名称 + */ + deviceName?: null | string; + createDate: string + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + /** + * 报警信息 + */ + msgInfo?: null | string; + /** + * 报警值 + */ + value?: null | string; + /** + * 报警等级 + */ + grade?: null | string; + /** + * 设备名称 + */ + deviceName?: null | string; + startTime?: Date | null + endTime?: Date | null, + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} +declare namespace programlog { + /** + * 基类 + */ + type base_dto = { + /** + * 类型 + */ + logType?: null | number; + /** + * 日志消息 + */ + msgInfo?: null | string; + createDate: string; + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 日志消息 + */ + msgInfo?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + /** + * 编码 + */ + logType?: null | number; + /** + * 日志消息 + */ + msgInfo?: null | string; + + startTime?: Date | null; + endTime?: Date | null + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} +declare namespace userlog { + /** + * 基类 + */ + type base_dto = { + /** + * 权限 + */ + permission?: null | string; + /** + * 用户名 + */ + userName?: null | string; + /** + * 日志消息 + */ + msgInfo?: null | string; + + createDate: string; + + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + typeId: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + /** + * 用户名 + */ + userName?: null | string; + /** + * 日志消息 + */ + msgInfo?: null | string; + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} +declare namespace runlog { + /** + * 基类 + */ + type base_dto = { + /** + * 日志类别 + */ + logType?: null | string; + /** + * 日志消息 + */ + msgInfo?: null | string; + createDate: string + + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + typeId: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + /** + * 日志类别 + */ + logType?: null | string; + /** + * 日志消息 + */ + msgInfo?: null | string; + startTime?: Date | null; + endTime?: Date | null + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} \ No newline at end of file diff --git a/frontend/src/api/logs/service.ts b/frontend/src/api/logs/service.ts new file mode 100644 index 0000000..572af08 --- /dev/null +++ b/frontend/src/api/logs/service.ts @@ -0,0 +1,338 @@ +import { request } from '@umijs/max'; + +/** + * 告警日志 + * @param parms + * @returns + */ +const alarmlogApi = { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: alarmlog.addInput) { + return request('/api/alarmlog/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: alarmlog.delInput) { + return request(`/api/alarmlog/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: alarmlog.updateInput) { + return request('/api/alarmlog/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/alarmlog/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: alarmlog.queryParms) { + return request('/api/alarmlog/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: alarmlog.queryPage) { + return request('/api/alarmlog/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} +/** + * 系统日志 + * @param parms + * @returns + */ +const programlogApi = { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: programlog.addInput) { + return request('/api/programlog/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: programlog.delInput) { + return request(`/api/programlog/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: programlog.updateInput) { + return request('/api/programlog/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/programlog/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: programlog.queryParms) { + return request('/api/programlog/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: programlog.queryPage) { + return request('/api/programlog/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} + +/** + * 操作日志 + * @param parms + * @returns + */ +const userlogApi = { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: userlog.addInput) { + return request('/api/userlog/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: userlog.delInput) { + return request(`/api/userlog/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: userlog.updateInput) { + return request('/api/userlog/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/userlog/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: userlog.queryParms) { + return request('/api/userlog/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: userlog.queryPage) { + return request('/api/userlog/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} +/** + * 运行日志 + * @param parms + * @returns + */ +const runlogApi = { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: runlog.addInput) { + return request('/api/runlog/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: runlog.delInput) { + return request(`/api/runlog/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: runlog.updateInput) { + return request('/api/runlog/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/runlog/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: runlog.queryParms) { + return request('/api/runlog/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: runlog.queryPage) { + return request('/api/runlog/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} + + +export { alarmlogApi, programlogApi, runlogApi, userlogApi } \ No newline at end of file diff --git a/frontend/src/api/materialService.ts b/frontend/src/api/materialService.ts new file mode 100644 index 0000000..efaa10f --- /dev/null +++ b/frontend/src/api/materialService.ts @@ -0,0 +1,70 @@ + + +import { request } from '@umijs/max'; + + + +export default { + //创建 + Add(parms: MaterialsTypes.Info) { + return request('/api/materialsinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + //删除 + + Del(parms: MaterialsTypes.MaterialsInfoDelInput) { + return request(`/api/materialsinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + //修改 + Update(parms: MaterialsTypes.Info) { + return request('/api/materialsinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + + //获取列表 + List() { + return request('/api/materialsinfo/list', { + method: 'GET', + }); + }, + + // 下拉列表 + selectlist(){ + return request ('/api/materialsinfo/selectlist' ,{ + method:'GET' + }) + }, + + + + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: MaterialsTypes.Page) { + return request('/api/materialsinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + } +} + diff --git a/frontend/src/api/orderService.ts b/frontend/src/api/orderService.ts new file mode 100644 index 0000000..0d17f47 --- /dev/null +++ b/frontend/src/api/orderService.ts @@ -0,0 +1,95 @@ +import { request } from '@umijs/max'; +import { List } from 'lodash'; + +export default { + + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: OrderType.Page) { + return request('/api/order/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + /** + * 添加 + * @param parms + * @returns + */ + Add(parms: OrderType.orderFinalsl[]) { + return request('/api/order/add', { + method: 'POST', + data: parms, + }); + }, + + /** + * 修改 + * @param parms + * @returns + */ + update(parms: OrderType.orderFinalsl[]) { + return request('/api/order/update', { + method: 'POST', + data: parms, + }); + }, + + /** + * 删除 + * @param parms + * @returns + */ + del(parms: string) { + return request('/api/order/del/'+parms, { + method: 'POST', + }); + }, + + + /** + * 獲取訂單的產品信息 + * @param parms + * @returns + */ + GetorderMaterial(parms: string) { + return request('/api/order/getordermaterial/' + parms, { + method: 'get', + }); + }, + + /** + * 生成工单 + * @param parms + * @returns + */ + orderassociationwork(parms: OrderType.orderFinalsl[]) { + return request('/api/order/orderassociationwork', { + method: 'POST', + data: parms, + }); + }, + + /** + * 获取成品可制造数量 + * @param parms + * @returns + */ + getFinalslLImit(parms:string) { + return request('/api/order/getfinalsllimit/'+parms, { + method: 'get', + }); + }, + +} + + + + + diff --git a/frontend/src/api/productlineService.ts b/frontend/src/api/productlineService.ts new file mode 100644 index 0000000..e197d5a --- /dev/null +++ b/frontend/src/api/productlineService.ts @@ -0,0 +1,124 @@ +import { request } from '@umijs/max'; + + +export default { + //创建产线 + Add(parms: ProductlineTypes.Info) { + return request('/api/productline/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //删除 + Del(parms: ProductlineTypes.Info) { + return request(`/api/productline/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //修改 + Update(parms: ProductlineTypes.Info) { + return request('/api/productline/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //列表 + List() { + return request('/api/productline/list', { + method: 'GET', + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: ProductlineTypes.Page) { + return request('/api/productline/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + // 下拉列表 + selectlist() { + return request('/api/productline/selectlist', { + method: 'GET', + + }); + }, + // 产线添加设备 + adddevice(parms: ProductlineTypes.Productlinedevice) { + return request('/api/productline/adddevice', { + method: 'POST', + data: { + ...parms, + } + }) + }, + // 产线添加料仓 + addstock(parms: ProductlineTypes.Productlinestock) { + return request('/api/productline/addstock', { + method: 'POST', + data: { + ...parms, + } + }) + }, + // 产线设备分页 + devicepagelist(parms: ProductlineTypes.Productionlinepaging) { + return request('/api/productline/devicepagelist', { + method: 'POST', + data: { + ...parms + } + }) + }, + // 产线设备列表 + devicelist(parms: ProductlineTypes.ProductionlineQuery) { + return request('/api/productline/devicelist', { + method: 'POST', + data: { + ...parms + } + }) + }, + // 产线料仓分页 + stockpagelist(parms: ProductlineTypes.Productionlinestockpaging) { + return request('/api/productline/stockpagelist', { + method: 'POST', + data: { + ...parms + } + }) + }, + // 产线删除设备 + + deletedevice(parms: ProductlineTypes.Productionlinedeletiondevice) { + return request('/api/productline/deletedevice', { + method: 'POST', + data: { + ...parms + } + }) + }, + // 产线删除料仓 + deletestock(parms: ProductlineTypes.Productionlinedeletstock) { + return request('/api/productline/deletestock', { + method: 'POST', + data: { + ...parms + } + }) + } +} + + diff --git a/frontend/src/api/recipeService.ts b/frontend/src/api/recipeService.ts new file mode 100644 index 0000000..570af4d --- /dev/null +++ b/frontend/src/api/recipeService.ts @@ -0,0 +1,90 @@ +import { request } from '@umijs/max'; + + +export default { + //创建配方 + Add(parms: RecipeTypes.Info) { + return request('/api/recipesinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //删除 + Del(parms: RecipeTypes.Info) { + return request(`/api/recipesinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + //修改角色 + Update(parms: RecipeTypes.Info) { + return request('/api/recipesinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + + //获取角色列表 + List() { + return request('/api/recipesinfo/list', { + method: 'GET', + }); + }, + + /** + * 角色分页查询 + * @param parms + * @returns + */ + PagedList(parms: RecipeTypes.Page) { + return request('/api/recipesinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 获取配方物料列表 + * @param parms + * @returns + */ + MaterialList(parms:RecipeMaterialTypes.Info ){ + return request('/api/recipematerial/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //批量创建物料信息 + BatchAdd(parms: RecipeMaterialTypes.Info[]){ + return request('/api/recipematerial/batchadd', { + method: 'POST', + data: parms + }); + }, + //更改分组 + ChangeGroup(parms: RecipeTypes.RecipesGroupInput){ + return request('/api/recipesinfo/changegroup', { + method: 'POST', + data: parms + }); + }, + // 下拉 + selectlist() { + return request('/api/recipesinfo/selectlist', { + method: 'GET', + + }) + } +} + diff --git a/frontend/src/api/reportService.ts b/frontend/src/api/reportService.ts new file mode 100644 index 0000000..f77ab36 --- /dev/null +++ b/frontend/src/api/reportService.ts @@ -0,0 +1,34 @@ +import { request } from '@umijs/max'; +import { List } from 'lodash'; + +export default { + + /** + * 获取产品统计 + * @param parms + * @returns + */ + PagedList(parms: ReportType.ReportInput) { + return request('/api/report/getproductreport', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + /** + * 获取原料统计 + * @param parms + * @returns + */ + PagedMaterialList(parms: ReportType.ReportInput) { + return request('/api/report/getmaterialsreport', { + method: 'POST', + data: { + ...parms, + }, + }); + } + +} diff --git a/frontend/src/api/storeService.ts b/frontend/src/api/storeService.ts new file mode 100644 index 0000000..f3d1d1a --- /dev/null +++ b/frontend/src/api/storeService.ts @@ -0,0 +1,59 @@ + + +import { request } from '@umijs/max'; + + +export default { + //创建 + Add(parms: StoreTypes.StoreInfo) { + return request('/api/storeinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + //删除 + Del(parms: StoreTypes.StoreInfo) { + return request(`/api/storeinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + //修改角色 + Update(parms: StoreTypes.StoreInfo) { + return request('/api/storeinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + + //获取角色列表 + List() { + return request('/api/storeinfo/list', { + method: 'GET', + }); + }, + + /** + * 角色分页查询 + * @param parms + * @returns + */ + PagedList(parms: StoreTypes.StoreInfo) { + return request('/api/storeinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + } +} + diff --git a/frontend/src/api/sys/dto.d.ts b/frontend/src/api/sys/dto.d.ts new file mode 100644 index 0000000..80631bb --- /dev/null +++ b/frontend/src/api/sys/dto.d.ts @@ -0,0 +1,146 @@ + + + // 账号 +declare namespace account { + type base_dto = { + id?: string | null | undefined; + /** + * + * @type {string} + * @memberof Account + */ + account?: string | null; + /** + * + * @type {string} + * @memberof Account + */ + pwd: string + /** + * + * @type {string} + * @memberof Account + */ + tB_Employee_Id?: string | null; + } + type updatePwdInput = { + /** + * + * @type {string} + * @memberof Account + */ + tB_Employee_Id: string; + /** + * + * @type {string} + * @memberof Account + */ + oldPwd: string; + /** + * + * @type {string} + * @memberof Account + */ + newPwd: string; + } + interface queryPage { + pageIndex:number, + pageSize:number + account:string + } +} + // 模块类型 +declare namespace moduleTypes { + + type ModuleType = { + category: number, + openType: number, + parentId: string, + name: string, + icon: string, + url: string, + sort: number, + isDisabled: boolean, + id: string, + children: ModuleType[] + } + +} + // 角色类型 +declare namespace RolelTypes { + + type RoleType = { + id?: string, + name: string, + description: string + } + + type RolePageParams = { + keyword: string, + sortName: string, + sortByAsc: boolean, + pageIndex: number, + pageSize: number + } +} +//人员 +declare namespace UserTypes { + // 登录参数类型 + type LoginParams = { + account: string, + pwd: string + } + + //人员数据类型 + type PersonnelType = { + account?:string|null + /** + * + * @type {string} + * @memberof TBEmployeeDTO + */ + id?: string | null; + /** + * 排序 + * @type {number} + * @memberof TBEmployeeDTO + */ + sort?: number; + /** + * 员工姓名 + * @type {string} + * @memberof TBEmployeeDTO + */ + name?: string | null; + /** + * 1男2女 + * @type {number} + * @memberof TBEmployeeDTO + */ + gender?: number; + + /** + * 1在职2出差3离职 + * @type {number} + * @memberof TBEmployeeDTO + */ + status?: number; + /** + * 角色Id + * @type {string} + * @memberof TBEmployeeDTO + */ + roleId?: string | null; + + isAccount?: null | boolean ; + } + + //人员分页查询参数 + type UserPageParams = { + name: string, + status: number?, + pageIndex: number, + pageSize: number, + gender: number?, + } +} \ No newline at end of file diff --git a/frontend/src/api/sys/service.ts b/frontend/src/api/sys/service.ts new file mode 100644 index 0000000..076f8d6 --- /dev/null +++ b/frontend/src/api/sys/service.ts @@ -0,0 +1,294 @@ +import { request } from '@umijs/max'; + +/* +* +*账号 +* +*/ +const accountApi={ + //创建 + Add(parms: account.base_dto) { + return request('/api/authorize/addaccount', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //删除 + Del(parms: account.base_dto) { + return request(`/api/authorize/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //修改 + Update(parms: account.base_dto) { + return request('/api/authorize/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //列表 + List() { + return request('/api/authorize/list', { + method: 'POST', + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: account.queryPage) { + return request('/api/authorize/accountpagelist', { + method: 'POST', + data: { + ...parms, + }, + }); + } +} + +/* +* +*模块 +* +*/ + +const moduleApi={ + //创建模块 + SaveCreateModule(params: moduleTypes.ModuleType) { + return request('/api/authorize/addmodule', { + method: 'POST', + data: { + ...params + } + }); + }, + + //获取模块视图 + GetTreeGridModule(params?: moduleTypes.ModuleType) { + return request(`/api/authorize/gettreegrid`, { + method: 'POST', + data:{ + ...params + } + }); + }, + + //修改模块 + SaveModifyModule(params: moduleTypes.ModuleType) { + return request('/api/authorize/editmodule', { + method: 'POST', + data: { + ...params + } + }); + }, + + //删除模块 + DeleteModule(id: string) { + return request(`/api/authorize/removemodule/${id}`, { + method: 'GET' + }); + }, +} + +/* +* +*角色 +* +*/ +const roleApi={ + //创建角色 + CreateRole(parms: RolelTypes.RoleType) { + return request('/api/authorize/addrole', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + //删除角色 + DeleteRole(id: string) { + return request(`/api/authorize/removerole/${id}`, { + method: 'GET' + }); + }, + + //修改角色 + ModifyRole(parms: RolelTypes.RoleType) { + return request('/api/authorize/editrole', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + + + //获取角色列表 + GetRoleList() { + return request('/api/authorize/getroleList', { + method: 'GET', + }); + }, + + /** + * 角色分页查询 + * @param parms + * @returns + */ + GetRolePagedList(parms: RolelTypes.RolePageParams) { + return request('/api/authorize/queryrole', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /* + * + * 获取角色模块 + * + */ + GetRoleModuleList(roleId:string){ + return request(`/api/authorize/rolemodulelist/${roleId}`, { + method: 'GET', + }); + }, + /* + * + * 分配角色模块 + * + */ + AddRoleModule(parms:any){ + return request(`/api/authorize/addrolemodule`, { + method: 'POST', + data: { + ...parms, + }, + }); + } +} +/* +* +*人员 +* +*/ +const userApi={ + //登录 + Login(parms: UserTypes.LoginParams) { + return request('/api/authorize/login', { + method: 'POST', + data: { + ...parms + } + }); +}, + +//新增人员 +CreateUser(params: UserTypes.PersonnelType) { + return request('/api/authorize/addemployee', { + method: 'POST', + data: { + ...params, + }, + }); +}, + +//修改人员信息 +ModifyUser(params: UserTypes.PersonnelType) { + return request('/api/authorize/editemployee', { + method: 'POST', + data: { + ...params, + }, + }); +}, + + +//根据用户ID查询用户信息 +GetUserById(id: string) { + return request(`/api/base/user/getuserbyid?id=${id}`, { + method: 'GET', + }); +}, + +//人员分页查询 +GetUserPagedList(params: UserTypes.UserPageParams) { + return request('/api/authorize/queryemployee', { + method: 'POST', + data: { + ...params, + }, + }); +}, + +/** + * 获取用户已授权菜单 + */ +GetUserAuthInfo() { + return request('/api/base/authorize/getuserinfo', { + method: 'POST', + }); +}, + +GetUserInfo() { + return request('/api/authorize/getuserinfo', { + method: 'GET', + }); +}, +/** + * 删除用户 + * @param params + */ +RemoveUser(employeeId:string){ + return request(`/api/authorize/removeemployee?employeeId=${employeeId}`, { + method: 'GET' + }); +}, +/** + * 绑定账户 + * @param params + */ +BindAccount(params: account.base_dto) { + return request('/api/authorize/addaccountbyuser', { + method: 'POST', + data: { + ...params, + }, + }); +}, +/** + * 重置账户 + * @param params + * @returns + */ +RestoreAccount(params: string) { + return request(`/api/authorize/restoreaccountbyuser/${params}`, { + method: 'GET', + }); +}, +/** + * 编辑密码 + * @param params + * @returns + */ +EditPwd(params: account.updatePwdInput) { + return request(`/api/authorize/editaccountpwd`, { + method: 'POST', + data: { + ...params, + }, + }); +} +} + +export { accountApi,moduleApi,roleApi,userApi } \ No newline at end of file diff --git a/frontend/src/api/template/dto.d.ts b/frontend/src/api/template/dto.d.ts new file mode 100644 index 0000000..850b776 --- /dev/null +++ b/frontend/src/api/template/dto.d.ts @@ -0,0 +1,67 @@ +declare namespace template { + /** + * 基类 + */ + type base_dto = { + /** + * 编码 + */ + code?: null | string; + /** + * 描述 + */ + des?: null | string; + /** + * 名称 + */ + name?: null | string; + } + /** + * 增加输入参数 + */ + type addInput = base_dto + /** + * 更新输入参数 + */ + interface updateInput extends base_dto { + /** + * 主键 + */ + id: string + } + /** + * 删除输入参数 + */ + interface delInput { + /** + * 主键 + */ + id: string + } + /** + * 查询输入参数 + */ + interface queryParms { + /** + * 名称 + */ + name?: null | string; + } + /** + * 查询分页输入参数 + */ + interface queryPage { + pageIndex: number, + pageSize: number, + name:string + } + /** + * 查询输出参数 + */ + interface output extends base_dto { + /** + * 主键 + */ + id: string + } +} \ No newline at end of file diff --git a/frontend/src/api/template/service.ts b/frontend/src/api/template/service.ts new file mode 100644 index 0000000..3906b66 --- /dev/null +++ b/frontend/src/api/template/service.ts @@ -0,0 +1,83 @@ + +import { request } from '@umijs/max'; + + +export default { + /** + * 新增 + * @param parms + * @returns + */ + Add(parms: template.addInput) { + return request('/api/template/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 删除 + * @param parms + * @returns + */ + Del(parms: template.delInput) { + return request(`/api/template/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 修改 + * @param parms + * @returns + */ + Update(parms: template.updateInput) { + return request('/api/template/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 详情 + * @param parms + * @returns + */ + Detail(id: string) { + return request(`/api/template/detail?id=${id}`, { + method: 'GET' + }); + }, + /** + * 获取列表 + * @param parms + * @returns + */ + List(parms: template.queryParms) { + return request('/api/template/list', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: template.queryPage) { + return request('/api/template/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + +} + diff --git a/frontend/src/api/workService.ts b/frontend/src/api/workService.ts new file mode 100644 index 0000000..6ed4a28 --- /dev/null +++ b/frontend/src/api/workService.ts @@ -0,0 +1,121 @@ +import { request } from '@umijs/max'; + + +export default { + //创建分组 + Add(parms: WorkInfoTypes.WorkInfoAddInput) { + return request('/api/workinfo/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + AddBatch(parms:any){ + return request('/api/workbatch/add', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + UpdateBatch(parms:any){ + return request('/api/workbatch/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + DelBatch(parms:any){ + return request(`/api/workbatch/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //删除 + Del(parms: WorkInfoTypes.WorkInfoDelInput) { + return request(`/api/workinfo/del`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //修改 + Update(parms: WorkInfoTypes.WorkInfoUpdateInput) { + return request('/api/workinfo/update', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + //列表 + List(parms: WorkInfoTypes.Query) { + return request('/api/workinfo/list', { + method: 'POST', + data: { + ...parms, + } + }); + }, + /** + * 分页查询 + * @param parms + * @returns + */ + PagedList(parms: WorkInfoTypes.Page) { + return request('/api/workinfo/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + WorkBatchPagedList(parms: WorkInfoTypes.Page) { + return request('/api/workbatch/pagedlist', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + Publish(parms: any) { + return request(`/api/workinfo/publish`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + publishs(parms:any){ + return request(`/api/workinfo/publishs`, { + method: 'POST', + data: { + ...parms, + }, + }); + }, + UpdateStatus(parms: WorkInfoTypes.WorkInfoStatusUpdateInput) { + return request('/api/workinfo/ForcedEnd', { + method: 'POST', + data: { + ...parms, + }, + }); + }, + ForcedEnd(workId: string) { + return request(`/api/workinfo/forcedend/${workId}`, { + method: 'POST' + }); + }, + UpdateStatusList(workId: string) { + return request(`/api/workinfo/statuslist/${workId}`, { + method: 'GET' + }); + } +} + diff --git a/frontend/src/app.tsx b/frontend/src/app.tsx new file mode 100644 index 0000000..aa9ba5e --- /dev/null +++ b/frontend/src/app.tsx @@ -0,0 +1,145 @@ +import Footer from '@/components/Footer'; +import type { MenuDataItem, Settings as LayoutSettings } from '@ant-design/pro-components'; +import type { RunTimeLayoutConfig } from '@umijs/max'; +import defaultSettings from '../config/defaultSettings'; +import { errorConfig } from './requestErrorConfig'; +import HeaderRight from './components/HeaderRight'; +import { history } from '@umijs/max'; +import { userApi } from '@/api/sys/service'; +import React from 'react'; +import * as Icon from '@ant-design/icons'; +const isDev = process.env.NODE_ENV === 'development'; + +const loopMenuItem = (menus: MenuDataItem[]): MenuDataItem[] => { + return menus?.map(({ icon, routes, ...item }) => ({ + ...item, + icon: icon && React.createElement(Icon && (Icon as any)[item.icon]), + routes: routes && loopMenuItem(routes), + })); +}; + +const formartRoutes = (menuTree: any[]) => { + menuTree.forEach((item) => { + item.path = item.url; + if (item.children && item.children.length > 0 && item.category < 2) { + formartRoutes(item.children); + } else { + delete item.children; + } + }); + return menuTree; +}; + +/** + * @see https://umijs.org/zh-CN/plugins/plugin-initial-state + * */ +export async function getInitialState(): Promise<{ + settings?: Partial; + fetchUserInfo: () => any; + menuData: any[]; + currentUser: any; +}> { + const fetchUserInfo = async () => { + const response:MyResponse.Content = await userApi.GetUserInfo(); + if (response.statusCode===200) { + console.log('response',response); + + return response.data; + } + return null; + }; + const response = await fetchUserInfo(); + if (response) { + localStorage.setItem('USER_INFO', JSON.stringify(response.userInfo)); + localStorage.setItem('USER_MENU', JSON.stringify(response.menus)); + return { + menuData: formartRoutes(response.menus), + currentUser: response.userInfo, + fetchUserInfo, + settings: defaultSettings, + }; + } + return { + menuData: [], + currentUser: null, + fetchUserInfo, + settings: defaultSettings, + }; +} +// ProLayout 支持的api https://procomponents.ant.design/components/layout +export const layout: RunTimeLayoutConfig = ({ initialState }) => { + const config: any = { + rightContentRender: () => , + waterMarkProps: { + content: '黑菠萝科技研发部', + }, + token: { + colorBgAppListIconHover: 'rgba(0,0,0,0.06)', + colorTextAppListIconHover: 'rgba(255,255,255,0.95)', + colorTextAppListIcon: 'rgba(255,255,255,0.85)', + sider: { + colorBgCollapsedButton: '#13C2C2', + colorTextCollapsedButtonHover: 'rgba(0,0,0,0.65)', + colorTextCollapsedButton: 'rgba(0,0,0,0.45)', + colorMenuBackground: '#000', + colorBgMenuItemCollapsedHover: 'rgba(0,0,0,0.06)', + colorBgMenuItemCollapsedSelected: '#13C2C2', + colorMenuItemDivider: 'rgba(255,255,255,0.15)', + colorBgMenuItemHover: '#F5222D', + colorBgMenuItemSelected: '#13C2C2', + colorTextMenuSelected: '#fff', + colorTextMenuItemHover: 'rgba(255,255,255,0.75)', + colorTextMenu: 'rgba(255,255,255,0.75)', + colorTextMenuSecondary: 'rgba(255,255,255,0.65)', + colorTextMenuTitle: 'rgba(255,255,255,0.95)', + colorTextMenuActive: 'rgba(255,255,255,0.95)', + colorTextSubMenuSelected: '#fff', + }, + header: { + colorBgHeader: '#000', + colorMenuBackground: '#000', + colorHeaderTitle: '#ffffff', + }, + pageContainer:{ + paddingInlinePageContainerContent: 20, + paddingBlockPageContainerContent:10 + } + }, + footerRender: () =>