Browse Source

功能优化

shengtang
747575620@qq.com 1 year ago
parent
commit
2e18e44f76
33 changed files with 2030 additions and 356 deletions
  1. +495
    -33
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  2. +11
    -4
      backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftStepsEntity.cs
  3. +33
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/DictDataEntity.cs
  4. +26
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/DictTypeEntity.cs
  5. +2
    -2
      backend/BPA.MES.Base.Application/MQTT/IMessage.cs
  6. +11
    -9
      backend/BPA.MES.Base.Application/MQTT/MQTTService.cs
  7. +7
    -13
      backend/BPA.MES.Base.Application/MQTT/MsgPackage.cs
  8. +15
    -14
      backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsStepsDto.cs
  9. +26
    -17
      backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsStepsService.cs
  10. +12
    -0
      backend/BPA.MES.Base.Application/Services/DeviceProduct/Dtos/DeviceProductFunctionDto.cs
  11. +5
    -1
      backend/BPA.MES.Base.Application/Services/DeviceProduct/Services/DeviceProductFunctionService.cs
  12. +98
    -0
      backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictDataDto.cs
  13. +90
    -0
      backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictTypeDto.cs
  14. +111
    -0
      backend/BPA.MES.Base.Application/Services/DictService/Services/DictDataService.cs
  15. +109
    -0
      backend/BPA.MES.Base.Application/Services/DictService/Services/DictTypeService.cs
  16. +43
    -0
      backend/BPA.MES.Base.Application/Services/DictService/Services/IDictDataService.cs
  17. +44
    -0
      backend/BPA.MES.Base.Application/Services/DictService/Services/IDictTypeService.cs
  18. +6
    -2
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs
  19. +3
    -4
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs
  20. +4
    -1
      frontend/config/config.ts
  21. +2
    -1
      frontend/config/routes.ts
  22. +2
    -1
      frontend/package.json
  23. +20
    -0
      frontend/src/api/craftsinfo.ts
  24. +3
    -0
      frontend/src/api/deviceInfo/dtos/deviceProduct.d.ts
  25. +2
    -0
      frontend/src/api/deviceInfo/dtos/deviceProductFunction.d.ts
  26. +139
    -0
      frontend/src/api/dictType/dto.d.ts
  27. +164
    -0
      frontend/src/api/dictType/service.ts
  28. +13
    -1
      frontend/src/pages/agvline/index.tsx
  29. +287
    -231
      frontend/src/pages/craftInfo/pot.tsx
  30. +3
    -0
      frontend/src/pages/deviceProductInfo/index.less
  31. +67
    -14
      frontend/src/pages/deviceProductInfo/index.tsx
  32. +169
    -0
      frontend/src/pages/dict/index.tsx
  33. +8
    -8
      frontend/src/types/Crafts.d.ts

+ 495
- 33
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml View File

@@ -286,14 +286,19 @@
步骤
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_CraftStepsEntity.Name">
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_CraftStepsEntity.Description">
<summary>
名称
功能描述
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_CraftStepsEntity.Describe">
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_CraftStepsEntity.DeviceProductFunctionId">
<summary>
功能描述
设备产品功能Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_CraftStepsEntity.Params">
<summary>
功能参数
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.Pztj_DevicesInfoEntity">
@@ -653,6 +658,62 @@
编码
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.DictDataEntity">
<summary>
名 称 :码表数据
创 建 人 :yangxiao
创建时间 : 2023/8/9 9:47:53
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictDataEntity.TypeId">
<summary>
类型id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictDataEntity.Value">
<summary>
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictDataEntity.Code">
<summary>
编码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictDataEntity.Sort">
<summary>
排序
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictDataEntity.CreateTime">
<summary>
添加时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.DictTypeEntity">
<summary>
名 称 :数据码表
创 建 人 :yangxiao
创建时间 : 2023/8/9 9:48:05
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictTypeEntity.Name">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictTypeEntity.Code">
<summary>
编码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.DictTypeEntity.Sort">
<summary>
排序
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.GroupInfoEntity">
<summary>
名 称 :分组信息
@@ -1151,7 +1212,7 @@
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.MQTTService.MqttPublish``1(``0,System.String,System.Int32)">
<member name="M:BPA.MES.Base.Application.MQTTService.MqttPublish(BPA.MES.Base.Application.IMessage,System.String,System.Int32)">
<summary>
Mqtt通用服务
</summary>
@@ -1161,26 +1222,16 @@
code
</summary>
</member>
<member name="P:BPA.MES.Base.Application.MsgPackage`1.MessageId">
<summary>
消息ID
</summary>
</member>
<member name="P:BPA.MES.Base.Application.MsgPackage`1.Message">
<member name="P:BPA.MES.Base.Application.MsgPackage.Message">
<summary>
消息内容
</summary>
</member>
<member name="P:BPA.MES.Base.Application.MsgPackage`1.MessageLen">
<member name="P:BPA.MES.Base.Application.MsgPackage.MessageLen">
<summary>
消息长度
</summary>
</member>
<member name="P:BPA.MES.Base.Application.MsgPackage`1.MsgVersion">
<summary>
消息版本
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Topics">
<summary>
名 称 :
@@ -2058,7 +2109,7 @@
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.CraftId">
<summary>
步骤Id
工艺Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Step">
@@ -2066,31 +2117,21 @@
步骤
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Name">
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Description">
<summary>
名称
功能描述
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Unit">
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.DeviceProductFunctionId">
<summary>
单位
设备产品功能Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Value">
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Params">
<summary>
功能参数
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Materials">
<summary>
功能值 物料信息
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsDto.Describe">
<summary>
功能描述
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.CraftsStepsAddInput">
<summary>
增加
@@ -2146,6 +2187,16 @@
主键
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsOutput.DeviceProductFunctionName">
<summary>
设备产品功能名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.CraftsStepsOutput.DeviceProductId">
<summary>
设备产品Id
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.CraftsInfoService">
<summary>
名 称 :工艺信息
@@ -2532,6 +2583,21 @@
主键
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DeviceProductFunctionQueryInput.DeviceProductId">
<summary>
设备产品Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DeviceProductFunctionQueryInput.Name">
<summary>
设备产品名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DeviceProductFunctionQueryInput.Code">
<summary>
设备产品编号
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DeviceProductFunctionQueryPageInput">
<summary>
分页查询条件
@@ -3381,6 +3447,402 @@
<param name="Id"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataDto">
<summary>
名 称 :码表数据
创 建 人 :yangxiao
创建时间 : 2023/8/9 9:56:11
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataDto.TypeId">
<summary>
类型id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataDto.Value">
<summary>
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataDto.Code">
<summary>
编码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataDto.Sort">
<summary>
排序
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataUpdateInput">
<summary>
修改
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataUpdateInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataDelInput">
<summary>
刪除
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataQueryInput">
<summary>
普通查询条件
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataQueryInput.TypeId">
<summary>
码表类型Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataQueryInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataQueryPageInput">
<summary>
分页查询条件
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataQueryPageInput.Value">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataQueryPageInput.Code">
<summary>
编码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataQueryPageInput.TypeId">
<summary>
码表类型Id
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataOutput">
<summary>
输出
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictDataOutput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeDto">
<summary>
名 称 :码表类型
创 建 人 :yangxiao
创建时间 : 2023/8/9 9:56:00
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeDto.Name">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeDto.Code">
<summary>
编码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeDto.Sort">
<summary>
排序
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeUpdateInput">
<summary>
修改
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeUpdateInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeDelInput">
<summary>
刪除
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeQueryInput">
<summary>
普通查询条件
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeQueryInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeQueryPageInput">
<summary>
分页查询条件
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeQueryPageInput.TypeId">
<summary>
类型Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeQueryPageInput.Name">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeQueryPageInput.Code">
<summary>
编码
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeOutput">
<summary>
输出
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.DictTypeOutput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictDataService">
<summary>
名 称 :码表管理
创 建 人 :yangxiao
创建时间 : 2023/8/9 10:01:19
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictDataService.Add(BPA.MES.Base.Application.Services.DictDataAddInput)">
<summary>
增加
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictDataService.Del(BPA.MES.Base.Application.Services.DictDataDelInput)">
<summary>
删除
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictDataService.Detail(System.String)">
<summary>
详情
</summary>
<param name="Id"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictDataService.List(BPA.MES.Base.Application.Services.DictDataQueryInput)">
<summary>
列表
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictDataService.PagedList(BPA.MES.Base.Application.Services.DictDataQueryPageInput)">
<summary>
分页
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictDataService.SelectList">
<summary>
下拉
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictDataService.Update(BPA.MES.Base.Application.Services.DictDataUpdateInput)">
<summary>
更新
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:BPA.MES.Base.Application.Services.DictTypeService">
<summary>
名 称 :码表类型管理
创 建 人 :yangxiao
创建时间 : 2023/8/9 10:01:35
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictTypeService.Add(BPA.MES.Base.Application.Services.DictTypeAddInput)">
<summary>
增加
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictTypeService.Del(BPA.MES.Base.Application.Services.DictTypeDelInput)">
<summary>
删除
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictTypeService.Detail(System.String)">
<summary>
详情
</summary>
<param name="Id"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictTypeService.List(BPA.MES.Base.Application.Services.DictTypeQueryInput)">
<summary>
列表
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictTypeService.PagedList(BPA.MES.Base.Application.Services.DictTypeQueryPageInput)">
<summary>
分页
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictTypeService.SelectList">
<summary>
下拉
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.DictTypeService.Update(BPA.MES.Base.Application.Services.DictTypeUpdateInput)">
<summary>
更新
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:BPA.MES.Base.Application.Services.IDictDataService">
<summary>
名 称 :码表数据
创 建 人 :yangxiao
创建时间 : 2023/8/9 10:00:06
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictDataService.Add(BPA.MES.Base.Application.Services.DictDataAddInput)">
<summary>
增加
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictDataService.Del(BPA.MES.Base.Application.Services.DictDataDelInput)">
<summary>
移除
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictDataService.Update(BPA.MES.Base.Application.Services.DictDataUpdateInput)">
<summary>
更新
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictDataService.List(BPA.MES.Base.Application.Services.DictDataQueryInput)">
<summary>
不分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictDataService.PagedList(BPA.MES.Base.Application.Services.DictDataQueryPageInput)">
<summary>
分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictDataService.Detail(System.String)">
<summary>
查询单条
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.IDictTypeService">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/8/9 10:00:23
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictTypeService.Add(BPA.MES.Base.Application.Services.DictTypeAddInput)">
<summary>
增加
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictTypeService.Del(BPA.MES.Base.Application.Services.DictTypeDelInput)">
<summary>
移除
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictTypeService.Update(BPA.MES.Base.Application.Services.DictTypeUpdateInput)">
<summary>
更新
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictTypeService.List(BPA.MES.Base.Application.Services.DictTypeQueryInput)">
<summary>
不分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictTypeService.PagedList(BPA.MES.Base.Application.Services.DictTypeQueryPageInput)">
<summary>
分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IDictTypeService.Detail(System.String)">
<summary>
查询单条
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.FinalsInfoDto">
<summary>
名 称 :成品管理


+ 11
- 4
backend/BPA.MES.Base.Application/Entitys/App/Pztj_CraftStepsEntity.cs View File

@@ -18,12 +18,19 @@
/// </summary>
public int Step { get; set; }
/// <summary>
/// 名称
/// 功能描述
/// </summary>
public string Name { get; set; }
[SugarColumn(IsNullable = true)]
public string Description { get; set; }
/// <summary>
/// 功能描述
/// 设备产品功能Id
/// </summary>
[SugarColumn(IsNullable = true)]
public string DeviceProductFunctionId { get; set; }
/// <summary>
/// 功能参数
/// </summary>
public string Describe { get; set; }
[SugarColumn(IsNullable = true)]
public string Params { get; set; }
}
}

+ 33
- 0
backend/BPA.MES.Base.Application/Entitys/Base/DictDataEntity.cs View File

@@ -0,0 +1,33 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :码表数据
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 9:47:53
/// 描 述 :
/// </summary>
[SugarTable("dict_data")]
public class DictDataEntity : DEntityBase
{
/// <summary>
/// 类型id
/// </summary>
public string TypeId { get; set; }
/// <summary>
/// 值
/// </summary>
public string Value { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 添加时间
/// </summary>
public DateTime CreateTime { get; set; }
}
}

+ 26
- 0
backend/BPA.MES.Base.Application/Entitys/Base/DictTypeEntity.cs View File

@@ -0,0 +1,26 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :数据码表
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 9:48:05
/// 描 述 :
/// </summary>
[SugarTable("dict_type")]
public class DictTypeEntity : DEntityBase
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
}

+ 2
- 2
backend/BPA.MES.Base.Application/MQTT/IMessage.cs View File

@@ -6,7 +6,7 @@
/// 创建时间 : 2023/7/21 10:24:24
/// 描 述 :
/// </summary>
public class IMessage
public interface IMessage
{
/// <summary>
/// 消息ID
@@ -16,6 +16,6 @@
/// <summary>
/// 消息版本
/// </summary>
public Version MsgVersion { get; set; } = new Version("1.0");
public Version MsgVersion { get; set; }
}
}

+ 11
- 9
backend/BPA.MES.Base.Application/MQTT/MQTTService.cs View File

@@ -1,5 +1,6 @@
using Furion.JsonSerialization;
using Furion.RemoteRequest.Extensions;
using Newtonsoft.Json;
using System.Text;

namespace BPA.MES.Base.Application
@@ -30,27 +31,28 @@ namespace BPA.MES.Base.Application
/// <summary>
/// Mqtt通用服务
/// </summary>
public async Task<bool> MqttPublish<T>(T payload, string topic,int messageId)
public async Task<bool> MqttPublish(IMessage payload, string topic,int messageId)
{
bool result = false;
var mqttentity = await _dbContext.Queryable<MQTTInfoEntity>().FirstAsync();
string mqttAddress = mqttentity.Address;
try
{
payload.MessageId = messageId;
payload.MessageId = MessageID.WorkOrderIssued;
payload.MsgVersion = new Version(1, 0, 0, 0);
MsgPackage mp = new MsgPackage();
mp.Message = payload;
mp.MessageLen = JSON.Serialize(payload).Length;
//组装MQTT消息
var entity = new MsgPackage<T>()
{
MessageId = messageId,
Message = payload,
MessageLen = JSON.Serialize(payload).Length
};
string ss = JsonConvert.SerializeObject(mp);
var tem = await $"http://{mqttAddress}/api/v4/mqtt/publish".SetHeaders(new
{
Authorization = "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{mqttentity.Account}:{mqttentity.Pwd}"))
}).SetBody(new
{
topic,
payload = JSON.Serialize(entity),
payload = JSON.Serialize(mp),
qos = 2,
retain = false,
clientid = "pztj_service"
@@ -79,7 +81,7 @@ namespace BPA.MES.Base.Application

public interface IMQTTService
{
Task<bool> MqttPublish<T>(T payload, string topic, int messageId);
Task<bool> MqttPublish(IMessage payload, string topic, int messageId);

Task GetMQTTConfig();
}


+ 7
- 13
backend/BPA.MES.Base.Application/MQTT/MsgPackage.cs View File

@@ -1,24 +1,18 @@
namespace BPA.MES.Base.Application
using Newtonsoft.Json;

namespace BPA.MES.Base.Application
{
public class MsgPackage<T>
public class MsgPackage
{
/// <summary>
/// 消息ID
/// </summary>
public int MessageId { get; set; }

/// <summary>
/// 消息内容
/// </summary>
//[JsonProperty(TypeNameHandling = TypeNameHandling.Auto)]
public T Message { get; set; }
[JsonProperty(TypeNameHandling = TypeNameHandling.Auto)]
public IMessage Message { get; set; }
/// <summary>
/// 消息长度
/// </summary>
public int MessageLen { get; set; }
/// <summary>
/// 消息版本
/// </summary>
public Version MsgVersion { get; set; } = new Version(1, 0, 0, 0);
}
}

+ 15
- 14
backend/BPA.MES.Base.Application/Services/CraftsInfoService/Dtos/CraftsStepsDto.cs View File

@@ -9,7 +9,7 @@
public class CraftsStepsDto
{
/// <summary>
/// 步骤Id
/// 工艺Id
/// </summary>
public string CraftId { get; set; }
/// <summary>
@@ -17,25 +17,18 @@
/// </summary>
public int Step { get; set; }
/// <summary>
/// 名称
/// 功能描述
/// </summary>
public string Name { get; set; }
public string Description { get; set; }
/// <summary>
/// 单位
/// 设备产品功能Id
/// </summary>
public string Unit { get; set; }
public string DeviceProductFunctionId { get; set; }
/// <summary>
/// 功能参数
/// </summary>
public string Value { get; set; }
/// <summary>
/// 功能值 物料信息
/// </summary>
public string Materials { get; set; }
/// <summary>
/// 功能描述
/// </summary>
public string Describe { get; set; }
public string Params { get; set; }
}
/// <summary>
/// 增加
@@ -91,5 +84,13 @@
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 设备产品功能名称
/// </summary>
public string DeviceProductFunctionName { get; set; }
/// <summary>
/// 设备产品Id
/// </summary>
public string DeviceProductId { get; set; }
}
}

+ 26
- 17
backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsStepsService.cs View File

@@ -22,11 +22,7 @@
[HttpPost]
public async Task<bool> Add(CraftsStepsAddInput input)
{
var r_entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>().FirstAsync(x => x.Name == input.Name);
if (r_entity != null)
{
throw Oops.Bah("名称已存在!");
}
var step = await _dbContext.Queryable<Pztj_CraftStepsEntity>().Where(x=>x.CraftId==input.CraftId).MaxAsync(x => x.Step);
Pztj_CraftStepsEntity entity = input.Adapt<Pztj_CraftStepsEntity>();
entity.Step = step+1;
@@ -41,7 +37,19 @@
[HttpPost]
public async Task<bool> Del(CraftsStepsDelInput input)
{
var stepItem = await _dbContext.Queryable<Pztj_CraftStepsEntity>().Where(x => x.Id == input.Id).FirstAsync();
string craftsId = stepItem.CraftId;
int step = stepItem.Step;
var res = await _dbContext.Deleteable<Pztj_CraftStepsEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
if (res)
{
var stepList = await _dbContext.Queryable<Pztj_CraftStepsEntity>().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;
}
/// <summary>
@@ -77,12 +85,18 @@
[HttpPost]
public async Task<SqlSugarPagedList<CraftsStepsOutput>> PagedList(CraftsStepsQueryPageInput input)
{
var entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>()
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name))
.WhereIF(!string.IsNullOrEmpty(input.CraftId), x => x.CraftId == input.CraftId)
.OrderBy(x=>x.Step)
var output = await _dbContext.Queryable<Pztj_CraftStepsEntity>()
.LeftJoin<DeviceProductFunctionEntity>((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);
SqlSugarPagedList<CraftsStepsOutput> output = entity.Adapt<SqlSugarPagedList<CraftsStepsOutput>>();
return output;
}
/// <summary>
@@ -96,7 +110,7 @@
var entity = await _dbContext.Queryable<Pztj_CraftStepsEntity>().Select(x => new
{
key = x.Id,
value = x.Name
value = x.Description
}).ToListAsync();
return entity;
}
@@ -109,13 +123,8 @@
[HttpPost]
public async Task<bool> Update(CraftsStepsUpdateInput input)
{
var isExit =await _dbContext.Queryable<Pztj_CraftStepsEntity>().Where(x => x.Id != input.Id && x.Name == input.Name).FirstAsync();
if (isExit != null)
{
throw Oops.Bah("名称或编码已存在!");
}
Pztj_CraftStepsEntity entity = input.Adapt<Pztj_CraftStepsEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
var res = await _dbContext.Updateable(entity).IgnoreColumns(it => it.Step).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>


+ 12
- 0
backend/BPA.MES.Base.Application/Services/DeviceProduct/Dtos/DeviceProductFunctionDto.cs View File

@@ -65,6 +65,18 @@
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 设备产品Id
/// </summary>
public string DeviceProductId { get; set; }
/// <summary>
/// 设备产品名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 设备产品编号
/// </summary>
public string Code { get; set; }
}
/// <summary>
/// 分页查询条件


+ 5
- 1
backend/BPA.MES.Base.Application/Services/DeviceProduct/Services/DeviceProductFunctionService.cs View File

@@ -63,7 +63,11 @@
[HttpPost]
public async Task<List<DeviceProductFunctionOutput>> List(DeviceProductFunctionQueryInput input)
{
var entity = await _dbContext.Queryable<DeviceProductFunctionEntity>().ToListAsync();
var entity = await _dbContext.Queryable<DeviceProductFunctionEntity>()
.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<DeviceProductFunctionOutput> output = entity.Adapt<List<DeviceProductFunctionOutput>>();
return output;
}


+ 98
- 0
backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictDataDto.cs View File

@@ -0,0 +1,98 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :码表数据
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 9:56:11
/// 描 述 :
/// </summary>
public class DictDataDto
{
/// <summary>
/// 类型id
/// </summary>
public string TypeId { get; set; }
/// <summary>
/// 值
/// </summary>
public string Value { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
/// <summary>
/// 增加
/// </summary>
public class DictDataAddInput : DictDataDto
{

}
/// <summary>
/// 修改
/// </summary>
public class DictDataUpdateInput : DictDataDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 刪除
/// </summary>
public class DictDataDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 普通查询条件
/// </summary>
public class DictDataQueryInput
{
/// <summary>
/// 码表类型Id
/// </summary>
public string TypeId { get; set; }
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页查询条件
/// </summary>
public class DictDataQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Value { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 码表类型Id
/// </summary>
public string TypeId { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class DictDataOutput : DictDataDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
//下面增加多的数据
}
}

+ 90
- 0
backend/BPA.MES.Base.Application/Services/DictService/Dtos/DictTypeDto.cs View File

@@ -0,0 +1,90 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :码表类型
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 9:56:00
/// 描 述 :
/// </summary>
public class DictTypeDto
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
}
/// <summary>
/// 增加
/// </summary>
public class DictTypeAddInput : DictTypeDto
{

}
/// <summary>
/// 修改
/// </summary>
public class DictTypeUpdateInput : DictTypeDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 刪除
/// </summary>
public class DictTypeDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 普通查询条件
/// </summary>
public class DictTypeQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页查询条件
/// </summary>
public class DictTypeQueryPageInput : RequestPage
{
/// <summary>
/// 类型Id
/// </summary>
public string TypeId { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class DictTypeOutput : DictTypeDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
//下面增加多的数据
}
}

+ 111
- 0
backend/BPA.MES.Base.Application/Services/DictService/Services/DictDataService.cs View File

@@ -0,0 +1,111 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :码表管理
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 10:01:19
/// 描 述 :
/// </summary>
[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;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(DictDataAddInput input)
{
DictDataEntity entity = input.Adapt<DictDataEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(DictDataDelInput input)
{
var res = await _dbContext.Deleteable<DictDataEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<DictDataOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<DictDataEntity>().FirstAsync(x => x.Id == Id);
DictDataOutput output = entity.Adapt<DictDataOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<List<DictDataOutput>> List(DictDataQueryInput input)
{
var entity = await _dbContext.Queryable<DictDataEntity>().WhereIF(!string.IsNullOrEmpty(input.TypeId), x => x.TypeId == input.TypeId).ToListAsync();
List<DictDataOutput> output = entity.Adapt<List<DictDataOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<DictDataOutput>> PagedList(DictDataQueryPageInput input)
{
var entity = await _dbContext.Queryable<DictDataEntity>()
.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<DictDataOutput> output = entity.Adapt<SqlSugarPagedList<DictDataOutput>>();
return output;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<DictDataEntity>().Select(x => new
{
key = x.Id,
value = x.Value
}).ToListAsync();
return entity;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(DictDataUpdateInput input)
{
var entity = await _dbContext.Queryable<DictDataEntity>().Where(x => x.Id == input.Id).FirstAsync();
entity = input.Adapt<DictDataEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 109
- 0
backend/BPA.MES.Base.Application/Services/DictService/Services/DictTypeService.cs View File

@@ -0,0 +1,109 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :码表类型管理
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 10:01:35
/// 描 述 :
/// </summary>
[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;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(DictTypeAddInput input)
{
DictTypeEntity entity = input.Adapt<DictTypeEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(DictTypeDelInput input)
{
var res = await _dbContext.Deleteable<DictTypeEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<DictTypeOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<DictTypeEntity>().FirstAsync(x => x.Id == Id);
DictTypeOutput output = entity.Adapt<DictTypeOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<List<DictTypeOutput>> List(DictTypeQueryInput input)
{
var entity = await _dbContext.Queryable<DictTypeEntity>().ToListAsync();
List<DictTypeOutput> output = entity.Adapt<List<DictTypeOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<DictTypeOutput>> PagedList(DictTypeQueryPageInput input)
{
var entity = await _dbContext.Queryable<DictTypeEntity>()
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code))
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<DictTypeOutput> output = entity.Adapt<SqlSugarPagedList<DictTypeOutput>>();
return output;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<DictTypeEntity>().Select(x => new
{
key = x.Id,
value = x.Name
}).ToListAsync();
return entity;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(DictTypeUpdateInput input)
{
var entity = await _dbContext.Queryable<DictTypeEntity>().Where(x => x.Id == input.Id).FirstAsync();
entity = input.Adapt<DictTypeEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 43
- 0
backend/BPA.MES.Base.Application/Services/DictService/Services/IDictDataService.cs View File

@@ -0,0 +1,43 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :码表数据
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 10:00:06
/// 描 述 :
/// </summary>
public interface IDictDataService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(DictDataAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(DictDataDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(DictDataUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<DictDataOutput>> List(DictDataQueryInput input);
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<DictDataOutput>> PagedList(DictDataQueryPageInput input);
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<DictDataOutput> Detail(string Id);
}
}

+ 44
- 0
backend/BPA.MES.Base.Application/Services/DictService/Services/IDictTypeService.cs View File

@@ -0,0 +1,44 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/8/9 10:00:23
/// 描 述 :
/// </summary>
public interface IDictTypeService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(DictTypeAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(DictTypeDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(DictTypeUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<DictTypeOutput>> List(DictTypeQueryInput input);
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<DictTypeOutput>> PagedList(DictTypeQueryPageInput input);
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<DictTypeOutput> Detail(string Id);
}
}


+ 6
- 2
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs View File

@@ -28,6 +28,9 @@
/// 创建时间
/// </summary>
public string CreateTime { get; set; }
public int MessageId { get; set; }

public Version MsgVersion { get; set; }
}
/// <summary>
/// 增加
@@ -113,8 +116,9 @@
/// 工单状态
/// </summary>
public WorkOrderStatusEnum? Status { get; set; }


}
/// <summary>
/// 详情输出


+ 3
- 4
backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs View File

@@ -104,7 +104,7 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
[HttpPost]
public async Task<List<WorkInfoOutput>> List(WorkInfoQueryInput input)
{
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>()
@@ -163,11 +163,10 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services
Status = WorkOrderStatusEnum.Issued
});
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>().FirstAsync(x => x.Id == workId);

WorkInfoOutput workInfo = entity.Adapt<WorkInfoOutput>();
if (res)
{
await _MQTTService.MqttPublish(entity, Topics.WorkOrderPush, MessageID.WorkOrderIssued);
await _MQTTService.MqttPublish(workInfo, Topics.WorkOrderPush, MessageID.WorkOrderIssued);
}
return true;
}


+ 4
- 1
frontend/config/config.ts View File

@@ -96,7 +96,10 @@ export default defineConfig({
* @description 内置了 babel import 插件
* @doc https://umijs.org/docs/max/antd#antd
*/
antd: {},
antd: {
configProvider: {},
appConfig: {},
},
/**
* @name moment2dayjs 插件
* @description 将项目中的 moment 替换为 dayjs


+ 2
- 1
frontend/config/routes.ts View File

@@ -31,6 +31,7 @@
{ path: '/base/materials', name: '原料管理', component: './materials/index' },
{ path: '/base/bucket', name: '桶管理', component: './bucket/index' },
{ path: '/base/final', name: '成品管理', component: './final/index' },
{ path: '/base/dict',name:'数据字典',component:'./dict/index'}
]
},
{
@@ -59,7 +60,7 @@
]
},
{
path:'/agv',icon:'SettingOutlined',name:'agv点位',
path:'/agv',icon:'SettingOutlined',name:'agv管理',
routes:[
{path:'/agv/agvbasic',name:'agv基础数据',component:'./agvbasic/index'},
{path:'/agv/agvline',name:'agv线路管理',component:'./agvline/index'}


+ 2
- 1
frontend/package.json View File

@@ -66,7 +66,8 @@
"react": "^18.2.0",
"react-dev-inspector": "^1.8.3",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0"
"react-helmet-async": "^1.3.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@ant-design/pro-cli": "^2.1.5",


+ 20
- 0
frontend/src/api/craftsinfo.ts View File

@@ -128,6 +128,26 @@ export default {
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',{


+ 3
- 0
frontend/src/api/deviceInfo/dtos/deviceProduct.d.ts View File

@@ -48,6 +48,9 @@ declare namespace deviceProduct {
* 名称
*/
name?: null | string;
deviceProductId? : null | string;
code? : null | string;

}
/**
* 查询分页输入参数


+ 2
- 0
frontend/src/api/deviceInfo/dtos/deviceProductFunction.d.ts View File

@@ -20,6 +20,7 @@ declare namespace deviceProductFunction {
* 名称
*/
name: string;
params:string;
}
/**
* 增加输入参数
@@ -51,6 +52,7 @@ declare namespace deviceProductFunction {
* 名称
*/
name?: null | string;
deviceProductId?: null | string;
}
/**
* 查询分页输入参数


+ 139
- 0
frontend/src/api/dictType/dto.d.ts View File

@@ -0,0 +1,139 @@
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
}
/**
* 查询输出参数
*/
interface output extends base_dto {
/**
* 主键
*/
id: string
}
}
declare namespace dictData {
/**
* 基类
*/
type base_dto = {
/**
* 编码
*/
code?: null | string;
/**
* 描述
*/
sort?: null | string;
/**
* 名称
*/
value?: null | string;
/**
* 类型id
*/
typeId: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
}
}

+ 164
- 0
frontend/src/api/dictType/service.ts View File

@@ -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}


+ 13
- 1
frontend/src/pages/agvline/index.tsx View File

@@ -43,7 +43,12 @@ const Agvline = () => {
ellipsis: true,
align: 'center'
},

{
title: '线路编码',
dataIndex: 'code',
ellipsis: true,
align: 'center'
},
{
title: '起始点位',
dataIndex: 'startPointId',
@@ -279,6 +284,13 @@ const Agvline = () => {
>
<Input />
</Form.Item>
<Form.Item
label="线路编码"
name="code"
rules={[{ required: true, message: '此项为必填项!' }]}
>
<Input />
</Form.Item>
<Form.Item label="起始点位" name="startPointId" rules={[{ required: true, message: '此项为必填项!' }]} >
<Select placeholder='请选择起始点位' style={{ width: 375 }}>
{


+ 287
- 231
frontend/src/pages/craftInfo/pot.tsx View File

@@ -8,12 +8,19 @@ import { ActionType, BetaSchemaForm, DragSortTable, EditableFormInstance, Editab
import { ProTable } from '@ant-design/pro-components';
import { Button, Modal, Form, Input, message, Popconfirm, Spin, Tag, Space, Select, Card, Col, Row } from 'antd';
import { useEffect, useRef, useState } from 'react';
import { v4 as uuid } from 'uuid'
import CraftsInfoAPI from '@/api/craftsinfo'
import MaterialsInfoAPI from '@/api/materialService'
import DeviceInfoAPI from '@/api/DeviceInfo'
import DeviceProductAPI from '@/api/deviceInfo/services/deviceProduct';
import DeviceProductFunctionAPI from '@/api/deviceInfo/services/deviceProductFunction';
import './index.less'

interface paramsType {

paramName: string;
paramUnit: string;
paramCode:string;
}

const Index = () => {
//表单
@@ -26,17 +33,18 @@ const Index = () => {
const [devices, setDevices] = useState<any>([]);
const [deviceProducts, setDevicesProducts] = useState<any>([]);
const [stepparams, setStepparams] = useState<any>();

const [stepTitle, setStepTitle] = useState<any>('步骤列表');
const [rowIndex, setRowIndex] = useState<any>();
const [selectRowItem, setSelectRowItem] = useState<any>();
const [materiallist, setMateriallist] = useState<RecipeMaterialTypes.Info[]>([]);
const [selectMateriallist, setSelectMateriallist] = useState<RecipeMaterialTypes.Info[]>([]);
const [selectRowItem, setSelectRowItem] = useState<CraftsTypes.craftsInfoOutput>();
const [deviceFun, setDeviceFun] = useState<deviceProductFunction.output[]>([]);

const [deviceParm, setDeviceParm] = useState<any>([]);


const actionRef = useRef<ActionType>();
const [formRef] = Form.useForm();
const [dongtaiformRef] = Form.useForm();
const sortActionRef = useRef<ActionType>();
const editactionRef = useRef<ActionType>();

@@ -49,73 +57,45 @@ const Index = () => {
}
})

DeviceProductAPI.SelectList().then((res:MyResponse.Content)=>{
if (res.statusCode===200) {
DeviceProductAPI.SelectList().then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
setDevicesProducts(res.data)
}
})
}, [])





//方法
const OnSubmit = async (values: CraftsTypes.Info) => {
values.deviceType = 0;
if (values.id) {
const response = await CraftsInfoAPI.Update(values);
if (response.statusCode === 200) {
message.success('修改成功');
actionRef.current?.reload();
setIsModalOpen(false);
} else {
message.error(response.errors || '修改失败');
}
} else {
const response = await CraftsInfoAPI.Add(values);
if (response.statusCode === 200) {
message.success('添加成功');
actionRef.current?.reload();
setIsModalOpen(false);
} else {
message.error(response.errors || '添加失败');
}
}
}
}, [])

//表单名
const columns: ProColumns<CraftsTypes.Info>[] = [
{
dataIndex: 'id',
align: 'center',
hideInTable:true,
// columns: () => {
// return []
// },
readonly:true,
search:false
hideInTable: true,
hideInForm: true,
readonly: true,
search: false,
},
{
title: '设备产品',
dataIndex: 'deviceProductId',
align: 'center',
valueType:'select',
request:async ()=>{
const data:MyResponse.Content =await DeviceProductAPI.SelectList()
const chan:any[] = data.data;
chan.map(item=>(
item.label = item.value,
item.value = item.key
))
return chan;
valueType: 'select',
request: async () => {
const data: MyResponse.Content = await DeviceProductAPI.SelectList()
const chan: any[] = data.data;
chan.map((item) => (
item.label = item.value,
item.value = item.key
))
return chan;
},
},
{
title: '工艺名称',
dataIndex: 'name',
align: 'center',
search:false
search: false
},
{
title: '工艺描述',
@@ -126,106 +106,47 @@ const Index = () => {
{
title: '操作',
align: 'center',

valueType: 'option',

key: 'option',
render: (_, record) => [
<Space key={+new Date() + Math.random()} size="middle">
<Button
key={+new Date() + Math.random()}
type='primary' ghost
onClick={async () => {
setIsModalOpen(true)
const copyFormData = JSON.parse(JSON.stringify(record));
typeForm.setFieldsValue(copyFormData);
}}
>
编辑
</Button>
<Popconfirm
key={+new Date() + Math.random()}
title="确定要删除此条数据吗?"
onConfirm={() => {
const delData: CraftsTypes.Info = {
id: record.id,
name: '',
};
CraftsInfoAPI.Del(delData).then((r) => {
if (r.statusCode === 200) {
message.success(r.statusCode === 200 ? '删除成功' : r.message);
actionRef.current?.reload();
}
});
}}
onCancel={() => {
message.info('已取消删除');
}}
okText="确认"
cancelText="关闭"
>
<Button type='primary' danger ghost>删除</Button>
</Popconfirm>
</Space>
],
},
];
const editcolumns: ProColumns<RecipeMaterialTypes.Info>[] = [
{
title: '步骤名称',
dataIndex: 'materialId',
valueType: 'select',
ellipsis: true,
request: async () => {
const res: MyResponse.Content = await MaterialsInfoAPI.List();
const myData: any[] = [];
if (res.statusCode === 200) {
setSelectMateriallist(res.data)
res.data.map((item: MaterialsTypes.Info) => (
myData.push({
label: `${item.name}${item.unit}`,
value: item.id,
})
))
}
return myData;
},
formItemProps: () => {
return {
rules: [{ required: true, message: '此项为必填项' }]
};
},
},
{
title: '功能参数',
dataIndex: 'materialId',
},
{
title: '',
dataIndex: 'weight',
valueType: 'text',
ellipsis: true,
formItemProps: () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: '操作',
valueType: 'option',
render: (_, row) => [
<Button
key={uuid()}
type='primary' ghost
key={+new Date() + Math.random()}
onClick={() => {
console.log(row);
editactionRef.current?.startEditable(row.id);
onClick={async () => {
setIsModalOpen(true)
console.log('record', record);

const copyFormData = JSON.parse(JSON.stringify(record));
setSelectRowItem(record)
typeForm.setFieldsValue(copyFormData);
}}
>
编辑原料
编辑
</Button>,

<Popconfirm
key='craftinfoDel'
title="确定要删除此条数据吗?"
onConfirm={() => {
const delData: CraftsTypes.Info = {
id: record.id,
step: 0,
craftId: '',
deviceProductId: ''
};
CraftsInfoAPI.Del(delData).then((r) => {
if (r.statusCode === 200) {
message.success(r.statusCode === 200 ? '删除成功' : r.message);
actionRef.current?.reload();
}
});
}}
onCancel={() => {
message.info('已取消删除');
}}
okText="确认"
cancelText="关闭"
>
<Button type='primary' danger ghost>删除</Button>
</Popconfirm>
],
},
];
@@ -236,7 +157,7 @@ const Index = () => {
* 工艺信息
*/}
<Row wrap={false} gutter={[10, 10]}>
<Col flex={0.1}>
<Col flex={0.1} >
<ProTable<CraftsTypes.Info>
columns={columns}
actionRef={actionRef}
@@ -250,6 +171,7 @@ const Index = () => {
onClick: () => {
if (record.id) {
setRowIndex(index)
setSelectRowItem(record)
setStepparams({ craftId: record.id })
setStepTitle(`[${record.name}]步骤列表`)
}
@@ -257,8 +179,6 @@ const Index = () => {
};
}}
request={async (params = {}) => {


const jsonData: CraftsTypes.Page = {
pageIndex: params.current || 1,
pageSize: params.pageSize || 10,
@@ -287,11 +207,18 @@ const Index = () => {

toolBarRender={() => [
<Button
key={+new Date() + Math.random()}
key={uuid()}
type="primary"
onClick={() => {
typeForm.resetFields();
setIsModalOpen(true);
setSelectRowItem({
id: '',
name: '',
step: 0,
craftId: '',
deviceType: 0
})
}}
>
添加工艺
@@ -299,13 +226,14 @@ const Index = () => {
]}
/>
</Col>
<Col flex={4}>
<Col flex={4} >
<DragSortTable<CraftsTypes.Info>
toolBarRender={() => [
toolBarRender={() => [
<Button
key={+new Date() + Math.random()}
key={uuid()}
type="primary"
onClick={() => {
typeForm.resetFields();
setIsSetpModalOpen(true);
}}
>
@@ -313,7 +241,7 @@ const Index = () => {
</Button>,
]}
actionRef={sortActionRef}
headerTitle="步骤"
headerTitle={stepTitle}
columns={[
{
title: '步骤',
@@ -322,16 +250,22 @@ const Index = () => {
hideInSearch: true,
render: (dom, rowData, index) => {
return (
<span className="customRender">{`${index+1}`}</span>
<span className="customRender">{`${index + 1}`}</span>
);
},
},
{
title: '步骤描述',
dataIndex: 'describe',
dataIndex: 'description',
align: 'center',
hideInSearch: true
},
{
title: '功能',
dataIndex: 'deviceProductFunctionName',
align: 'center',
hideInSearch: true,
},
{
title: '操作',
align: 'center',
@@ -339,42 +273,98 @@ const Index = () => {
valueType: 'option',

key: 'option',
render: (_, record) => [
<Space key={+new Date() + Math.random()} size="middle">
render: (_, record, index, action) => [
<Space key={uuid()} size="middle">
<Button
key={+new Date() + Math.random()}
key={uuid()}
type='primary' ghost
onClick={async () => {
setIsModalOpen(true)
// setIsModalOpen(true)
const copyFormData = JSON.parse(JSON.stringify(record));
console.log('copyFormData', copyFormData);

typeForm.setFieldsValue(copyFormData);
setIsSetpModalOpen(true);
}}
>
编辑
编辑1
</Button>
<Button
key={+new Date() + Math.random()}
key={uuid()}
type='primary' ghost
onClick={async () => {
setIsSchemaModalOpen(true)
setDeviceParm([]);
const copyFormData = JSON.parse(JSON.stringify(record));
typeForm.setFieldsValue(copyFormData);
formRef.setFieldsValue(copyFormData);
console.log('record', record);

const jsonData: deviceProductFunction.queryParms = {
deviceProductId: selectRowItem?.deviceProductId
};
DeviceProductFunctionAPI.List(jsonData).then((res: MyResponse.Content) => {
console.log('我来了吗?1');
if (res.succeeded) {
setDeviceFun(res.data);
}
})
setTimeout(() => {
console.log('我来了吗?',deviceFun);
const out = deviceFun.find(x => x.id === record.deviceProductFunctionId);
console.log(out);
if (out?.params) {
const b = JSON.parse(out?.params);
console.log(b);
const c: any[] = [];
b.map((paramsItem: paramsType) => {
const element = {
title: paramsItem.paramName,
dataIndex: paramsItem.paramCode,
width: 'md',
renderFormItem: (dom, rowData, index) => {
return (
<Input addonAfter={paramsItem.paramUnit} />
);
},
colProps: {
xs: 24,
md: 12,
},
}
c.push(element)
})
setDeviceParm(c);
}
if (dongtaiformRef) {
const element =JSON.parse(record.params!)
console.log('element',element);
dongtaiformRef.setFieldsValue(element)
}
}, 1000);
// const element =JSON.parse(record.params!)
// setDeviceParm(element);
}}
>
配置设备参数
</Button>
<Popconfirm
key={+new Date() + Math.random()}
key={uuid()}
title="确定要删除此条数据吗?"
onConfirm={() => {
const delData: CraftsTypes.Info = {
id: record.id,
name: '',
step: 0,
craftId: '',
deviceProductId: ''
};
CraftsInfoAPI.Del(delData).then((r) => {
CraftsInfoAPI.DelStep(delData).then((r) => {
if (r.statusCode === 200) {
message.success(r.statusCode === 200 ? '删除成功' : r.message);
actionRef.current?.reload();
action?.reload();
}
});
}}
@@ -393,8 +383,15 @@ const Index = () => {
rowKey="step"
search={false}
pagination={false}
params ={stepparams}
params={stepparams}
request={async (params = {}) => {
if (!params.craftId) {
return {
data: [],
success: false,
total: 0,
};
}
const jsonData: CraftsTypes.Pztj_CraftStepsPageInput = {
pageIndex: params.current || 1,
pageSize: params.pageSize || 10,
@@ -417,21 +414,21 @@ const Index = () => {
}}
dragSortKey="step"
onDragSortEnd={(newDataSource: any[]) => {
// 模拟将排序后数据发送到服务器的场景
// remoteData = newDataSource;
// 请求成功之后刷新列表
newDataSource.map((item,index)=>{
item.step = index+1;
newDataSource.map((item, index) => {
item.step = index + 1;
})
console.log('排序后的数据', newDataSource);
CraftsInfoAPI.BatchUpdateStep(newDataSource).then((res:MyResponse.Content)=>{
CraftsInfoAPI.BatchUpdateStep(newDataSource).then((res: MyResponse.Content) => {
if (res.data) {
sortActionRef.current?.reload();
message.success('修改列表排序成功');
}
});
}}
/>
</Col>
@@ -441,10 +438,10 @@ const Index = () => {
* 新增工艺信息
*/}
<Modal
key={+new Date() + Math.random()}
key={uuid()}
width={800}
title={<Tag color="#cd201f">新增信息</Tag>}
title={<Tag color="#cd201f">工艺信息</Tag>}
open={isModalOpen}
onCancel={() => {
setIsModalOpen(false);
@@ -452,48 +449,79 @@ const Index = () => {
footer={false}
>
<BetaSchemaForm<CraftsTypes.craftsInfoOutput>
onFinish={async (values) => {
console.log(values);
}}
form={typeForm}
columns={columns}
/>

onFinish={async (values) => {
if (selectRowItem?.id) {
values.id = selectRowItem.id
CraftsInfoAPI.Update(values).then((res: MyResponse.Content) => {
if (res.data) {
message.success("修改成功!");
setIsModalOpen(false)
actionRef.current?.reload();
} else {
message.success(res.errors);
}
});
} else {
CraftsInfoAPI.Add(values).then((res: MyResponse.Content) => {
if (res.data) {
message.success("添加成功!");
setIsModalOpen(false)
actionRef.current?.reload();
} else {
message.success(res.errors);
}
});
}
}}
form={typeForm}
columns={columns}
/>

</Modal>
<Modal
destroyOnClose
key={+new Date() + Math.random()}
width={800}
open={isSetpModalOpen}
onCancel={() => {
setIsSetpModalOpen(false);
}}
footer={false}
destroyOnClose
width={800}
open={isSetpModalOpen}
onCancel={() => {
setIsSetpModalOpen(false);
}}
footer={false}
title={<Tag color="#cd201f"> 添加步骤 </Tag>}
>
<ProForm onFinish={async (value:CraftsTypes.Pztj_CraftStepsAddInput) => {
<ProForm form={typeForm} onFinish={async (value: CraftsTypes.Pztj_CraftStepsAddInput) => {
value.craftId = stepparams.craftId;
console.log(value);
CraftsInfoAPI.StepAdd(value).then((res: MyResponse.Content)=>{
if (value.id) {
CraftsInfoAPI.UpdateStep(value).then((res: MyResponse.Content) => {
if (res.data) {
message.success('提交成功');
setIsSetpModalOpen(false);
sortActionRef.current?.reload()
}else{
} else {
message.success(res.errors);
}
})
}}>
<Form.Item label="步骤Id" name="id" hidden>
<Input></Input>
})
} else {
CraftsInfoAPI.StepAdd(value).then((res: MyResponse.Content) => {
if (res.data) {
message.success('提交成功');
setIsSetpModalOpen(false);
sortActionRef.current?.reload()
} else {
message.success(res.errors);
}
})
}
}}>
<Form.Item label="步骤Id" name="id" hidden>
<Input></Input>
</Form.Item>
<Form.Item>
<div>将自动生成步骤序号</div>
<div>将自动生成步骤序号</div>
</Form.Item>
<Form.Item label="步骤说明" name="describe">
<Input></Input>
<Form.Item label="步骤说明" name="description">
<Input></Input>
</Form.Item>
</ProForm>
</Modal>
@@ -504,69 +532,75 @@ const Index = () => {
* 配置设备参数弹框
*/}
<Modal
key={+new Date() + Math.random()}
destroyOnClose
width={800}
title={<Tag color="#cd201f"> 配置设备参数信息</Tag>}
open={isSchemaModalOpen}
onCancel={() => {
setIsSchemaModalOpen(false);
dongtaiformRef.resetFields()
setDeviceParm([]);
}}
footer={false}
>
<Form
form={formRef}
name="basic1"
id="myForm1111"
labelCol={{ span: 4 }}
wrapperCol={{ span: 12 }}
onFinish={OnSubmit}
autoComplete="off"
>
<Form.Item label="id" name="id" hidden>
<Input />
</Form.Item>
<Form.Item
label="设备信息"
name="name"
label="设备功能信息"
name="deviceProductFunctionId"
rules={[{ required: true, message: '此项必填!' }]}
>
<Select onChange={(value, index) => {
const b = [];
let num = Math.floor(Math.random() * 10);
for (let i = 0; i < num + 1; i++) {
const element = {
title: '属性' + { i },
dataIndex: 'state1' + { i },
valueType: 'text',
width: 'md',
colProps: {
xs: 24,
md: 12,
},
}
b.push(element)
<Select onChange={(value: string, index) => {

const out = deviceFun.find(x => x.id === value);
if (out?.params) {
const b = JSON.parse(out?.params);
console.log(b);
const c: any[] = [];
b.map((paramsItem: paramsType) => {
const element = {
title: paramsItem.paramName,
dataIndex: paramsItem.paramCode,
width: 'md',
renderFormItem: (dom, rowData, index) => {
return (
<Input addonAfter={paramsItem.paramUnit} />
);
},
colProps: {
xs: 24,
md: 12,
},
}
c.push(element)
})
setDeviceParm(c);
} else {
setDeviceParm([]);
}

setDeviceParm(b);

}} placeholder="下拉选择设备">
}} placeholder="下拉选择功能">
{
devices.map((item: MySelectType.Select) => {
return <Select.Option value={item.key} key={item.key}>
<span>{item.value}</span>
deviceFun.map((item: deviceProductFunction.output) => {
return <Select.Option value={item.id} key={item.id}>
<span>{item.name}</span>
</Select.Option>
})
}
</Select>
</Form.Item>


</Form>
<Card>
<BetaSchemaForm<any>
trigger={<a>点击我</a>}


rowProps={{
gutter: [16, 16],
}}
@@ -575,9 +609,31 @@ const Index = () => {
}}
grid={true}
onFinish={async (values) => {
console.log(values);
console.log(formRef.getFieldsValue());

const froms: CraftsTypes.craftsInfoOutput = formRef.getFieldsValue()
if (!froms.deviceProductFunctionId) {
message.error("请选择设备产品功能");
return;
}
console.log(froms.deviceProductFunctionId);

const jsonData: CraftsTypes.craftsInfoUpdateInput = {
id: froms.id,
deviceProductFunctionId: froms.deviceProductFunctionId,
params: JSON.stringify(values),
deviceProductId: ''
}
CraftsInfoAPI.UpdateStep(jsonData).then((res: MyResponse.Content) => {
if (res.data) {
sortActionRef.current?.reload();
message.success("成功!");
setIsSchemaModalOpen(false)
}
});
}}
columns={deviceParm}
form = {dongtaiformRef}
/>
</Card>
</Modal>


+ 3
- 0
frontend/src/pages/deviceProductInfo/index.less View File

@@ -0,0 +1,3 @@
.sss{
color: red;
}

+ 67
- 14
frontend/src/pages/deviceProductInfo/index.tsx View File

@@ -1,25 +1,44 @@
import { ArrowLeftOutlined, LeftCircleOutlined, LeftSquareTwoTone, PlusOutlined } from '@ant-design/icons';
import type {
import {
ActionType,
ProColumns,
ProForm,
ProFormInstance,
} from '@ant-design/pro-components';
import {
ProCard,
ProTable,
} from '@ant-design/pro-components';
import { Button, Card, Col, Divider, Form, FormInstance, Input, message, Modal, Popconfirm, Row, Space } from 'antd';
import {v4 as uuid} from 'uuid'
import { Button, Card, Col, Divider, Form, FormInstance, Input, message, Modal, Popconfirm, Row, Select, Space } from 'antd';
import { useState, useRef, useEffect } from 'react';
import { history } from '@umijs/max';
//引入接口
import deviceProductApi from '@/api/deviceInfo/services/deviceProduct'
import deviceProducFunctiontApi from '@/api/deviceInfo/services/deviceProductFunction'
import { uniqueId, values } from 'lodash';
import './index.less'

interface ParmForm {
paramName: string,
paramUnit: string
paramCode: string,
paramType:number,
paramUnit: string,
id:string,
}


const ParmsTypeList = [{

label:'数据',
value:0
},
{
label:'数组',
value:1
}
]

export default () => {
const [fromType, setFromType] = useState<any>('table')
const ref = useRef<ProFormInstance>();
@@ -34,7 +53,7 @@ export default () => {

// useEffect(()=>{
// console.log("funcParams");
const[isParamsUnit,setIsParamsUnit] = useState<boolean>();

// },[funcParams])
const [paramsModelOpen, setParamsModelOpen] = useState<boolean>(false);
@@ -89,6 +108,7 @@ export default () => {
<a onClick={() => {
setIsfunc(true)
setSelectRow(row)
setFuncParams([])
}}>

设置功能
@@ -228,7 +248,7 @@ export default () => {
search={false}
columns={[
{
title: '功能Id',
title: '功能主键',
dataIndex: 'id',
search: false,
readonly: true,
@@ -258,13 +278,13 @@ export default () => {
<Row key={+new Date() + Math.random()} style={{ borderBottom: "0.5px solid #f3e0e0", margin: "10px" }}>
<Space split={<Divider type="vertical" />}>
<div>参数名称:{res.paramName}</div>
<div>参数单位:{res.paramUnit}</div>
<div>参数代码:{res.paramCode}</div>
<Button type='link' onClick={() => {
setParamsModelOpen(true)
setTimeout(() => {
paramsForm.setFieldsValue(funcParams[index]);
}, 100);
}}>编辑</Button>
}}>设置</Button>
<Button type='link' onClick={() => {
const newData = [...funcParams];
newData.splice(index, 1);
@@ -280,22 +300,54 @@ export default () => {
paramsForm.resetFields();
setParamsModelOpen(true)
}}>+增加参数</Button>
<Modal destroyOnClose title="添加参数" onOk={() => {
<Modal destroyOnClose title="设置参数" footer={false} onCancel={()=>setParamsModelOpen(false)} open={paramsModelOpen}>
<ProForm form={paramsForm} id="paramsForm"
onFinish={async (values) => {
console.log(values);
const b = paramsForm.getFieldsValue();
funcParams.push(b);
if (b.id) {
funcParams.forEach((res) => {
if (res.id===b.id) {
res.paramCode = b.paramCode;
res.paramName = b.paramName;
res.paramType = b.paramType;
res.paramUnit = b.paramUnit;
}
})
setFuncParams(funcParams);
}else{
b.id = uuid()
funcParams.push(b);
}
setFuncParams(funcParams);
console.log(b);
setParamsModelOpen(false)

}} onCancel={() => { setParamsModelOpen(false) }} open={paramsModelOpen}>
<Form form={paramsForm}>
<Form.Item label="参数名称" name="paramName">
}}>
<Form.Item label="主键" hidden name="id">
<Input></Input>
</Form.Item>
<Form.Item label="参数名称" name="paramName" rules={[{ required: true, message: '此项为必填项!' }]}>
<Input></Input>
</Form.Item>
<Form.Item label="参数单位" name="paramUnit">
<Form.Item label="参数代码" name="paramCode" rules={[{ required: true, message: '此项为必填项!' }]}>
<Input></Input>
</Form.Item>
<Form.Item label="参数类型" name="paramType" rules={[{ required: true, message: '此项为必填项!' }]}>
<Select onChange={(value)=>{
if (value===0) {
setIsParamsUnit(false)
}else{
setIsParamsUnit(true)
}
}} placeholder="选择数据类型" options={ParmsTypeList}>
</Select>
</Form.Item>
<Form.Item label="参数单位" hidden={isParamsUnit} name="paramUnit" rules={[{ required: !isParamsUnit, message: '此项为必填项!' }]}>
<Input></Input>
</Form.Item>
</Form>
</ProForm>
</Modal>
</div>
)
@@ -361,6 +413,7 @@ export default () => {
onSubmit={(params: any) => {
console.log(params, funcParams);
params.params = JSON.stringify(funcParams);
params.deviceProductId = selectRow?.id
if (funcfromType === 'form') {
if (params.id) {
deviceProducFunctiontApi.Update(params).then((res: MyResponse.Content) => {


+ 169
- 0
frontend/src/pages/dict/index.tsx View File

@@ -0,0 +1,169 @@
import { PlusOutlined } from '@ant-design/icons';
import type {
ActionType,
ProColumns,
ProFormInstance,
} from '@ant-design/pro-components';
import {
ProCard,
ProTable,
} from '@ant-design/pro-components';
import { Button, message, Popconfirm, Space } from 'antd';
import { useState, useRef } from 'react';
//引入接口
import {dictTypeApi,dictDataApi} from '@/api/dictType/service'

export default () => {
const [fromType, setFromType] = useState<any>('table')
const ref = useRef<ProFormInstance>();
const actionRef = useRef<ActionType>();

const Reolod = () =>{
ref.current?.resetFields()
actionRef.current?.reload()
}
const columns: ProColumns<dictType.output>[] = [
{
title: '主键',
dataIndex: 'id',
hideInTable:true,
hideInForm: true,
search: false,
},
{
title: '名称',
dataIndex: 'name',
copyable: true,
ellipsis: true,
},
{
title: '编码',
hideInTable: true,
hideInDescriptions: true,
dataIndex: 'code',
},
{
title: '描述',
dataIndex: 'des',
width: 120,
search: false,
},
{
title: '操作',
valueType: 'option',
dataIndex: 'id',
render: (text, row) => [
<Space key={+new Date() + Math.random()}>
<a onClick={() => {
setFromType('form')
ref.current?.setFieldsValue(row)
}} key={+new Date() + Math.random()} target="_blank" rel="noopener noreferrer">
编辑
</a>
<Popconfirm
key="del"
title="确定要删除此条数据吗?"
onConfirm={() => {
dictTypeApi.Del(row).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
message.info("删除成功!");
Reolod()
} else {
message.error(res.errors);
}
})
}}
onCancel={() => {
message.info('已取消删除');
}}
okText="确认"
cancelText="关闭"
>
<a>
删除
</a>
</Popconfirm>
</Space>
],
},
];

return (
<>
<ProCard>
{fromType === 'form' ? <Button type='link' onClick={() =>{
ref.current?.resetFields();
setFromType("table")}}>⬅返回</Button> : ""}
<ProTable<dictType.output>
columns={columns}
type={fromType as 'table'}
formRef={ref}
actionRef={actionRef}
onSubmit={(params: any) => {
console.log(params);
if (fromType === 'form') {
if (params.id) {
dictTypeApi.Update(params).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
message.info("更新成功!");
setFromType('table')
Reolod()
} else {
message.error(res.errors);
}
})
} else {
dictTypeApi.Add(params).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
message.info("新增成功!");
setFromType('table')
Reolod()
} else {
message.error(res.errors);
}
})
}
}
}}
request={async (params = {}) => {
const jsonData: dictType.queryPage = {
pageIndex: params.current || 1,
pageSize: params.pageSize || 10,
name: params.name || '',
};
const response = await dictTypeApi.PagedList(jsonData);
if (response.statusCode === 200) {
return {
data: response.data.items,
success: true,
total: response.data.total,
};
} else {
return {
data: [],
success: false,
total: 0,
};
}
}}
pagination={{
pageSize: 5,
}}
rowKey="id"
dateFormatter="string"
headerTitle="列表"
toolBarRender={() => [
<Button key="3" type="primary" onClick={() => {
setFromType('form');
}}>
<PlusOutlined />
新建
</Button>,
]}
/>
</ProCard>
</>
);
};

+ 8
- 8
frontend/src/types/Crafts.d.ts View File

@@ -20,14 +20,13 @@ declare enum CraftsDeviceType{
}
declare namespace CraftsTypes {
interface Info{
id: any;
name: string,
step: number,
craftId:string,
deviceType:number
// craftsType:string,
// describe:string,
// repairDate: any
id:string,
step?:null | number,
craftId?: null |string,
deviceProductId:string,
description?:null | string,
deviceProductFunctionId?:null | string,
params?:null | string
}

interface Page {
@@ -147,6 +146,7 @@ declare namespace CraftsTypes {
id?: string | null;
}
export interface Pztj_CraftStepsAddInput{
id?:null|string,
craftId:string,
step:string,
name:string,


Loading…
Cancel
Save