diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseCustomController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseCustomController.cs
new file mode 100644
index 0000000..f793d29
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseCustomController.cs
@@ -0,0 +1,109 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 客户信息
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseCustom")]
+ public class BaseCustomController : BaseController
+ {
+ ///
+ /// 客户信息接口
+ ///
+ private readonly IBaseCustomService _BaseCustomService;
+
+ public BaseCustomController(IBaseCustomService BaseCustomService)
+ {
+ _BaseCustomService = BaseCustomService;
+ }
+
+ ///
+ /// 查询客户信息列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:basecustom:list")]
+ public IActionResult QueryBaseCustom([FromQuery] BaseCustomQueryDto parm)
+ {
+ var response = _BaseCustomService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询客户信息详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basecustom:query")]
+ public IActionResult GetBaseCustom(int Id)
+ {
+ var response = _BaseCustomService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加客户信息
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:basecustom:add")]
+ [Log(Title = "客户信息", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseCustom([FromBody] BaseCustomDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseCustomService.AddBaseCustom(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新客户信息
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:basecustom:edit")]
+ [Log(Title = "客户信息", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseCustom([FromBody] BaseCustomDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseCustomService.UpdateBaseCustom(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除客户信息
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basecustom:delete")]
+ [Log(Title = "客户信息", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseCustom(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseCustomService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseDeviceController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseDeviceController.cs
new file mode 100644
index 0000000..35af8bc
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseDeviceController.cs
@@ -0,0 +1,121 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 设备信息
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseDevice")]
+ public class BaseDeviceController : BaseController
+ {
+ ///
+ /// 设备信息接口
+ ///
+ private readonly IBaseDeviceService _BaseDeviceService;
+
+ public BaseDeviceController(IBaseDeviceService BaseDeviceService)
+ {
+ _BaseDeviceService = BaseDeviceService;
+ }
+
+ ///
+ /// 查询设备信息列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:basedevice:list")]
+ public IActionResult QueryBaseDevice([FromQuery] BaseDeviceQueryDto parm)
+ {
+ var response = _BaseDeviceService.GetList(parm);
+ return SUCCESS(response);
+ }
+ ///
+ /// 查询设备信息列表 未绑定工位的设备和已经绑定的
+ ///
+ ///
+ ///
+ [HttpGet("list_no_bind")]
+ [ActionPermissionFilter(Permission = "baseManagement:basedevice:list")]
+ public IActionResult QueryBaseDevice_nobind(int id )
+ {
+ var response = _BaseDeviceService.GetList_nobind(id);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询设备信息详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basedevice:query")]
+ public IActionResult GetBaseDevice(int Id)
+ {
+ var response = _BaseDeviceService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加设备信息
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:basedevice:add")]
+ [Log(Title = "设备信息", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseDevice([FromBody] BaseDeviceDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseDeviceService.AddBaseDevice(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新设备信息
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:basedevice:edit")]
+ [Log(Title = "设备信息", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseDevice([FromBody] BaseDeviceDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseDeviceService.UpdateBaseDevice(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除设备信息
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basedevice:delete")]
+ [Log(Title = "设备信息", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseDevice(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseDeviceService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseGroupController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseGroupController.cs
new file mode 100644
index 0000000..236ad70
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseGroupController.cs
@@ -0,0 +1,108 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 组
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseGroup2")]
+ public class BaseGroupController : BaseController
+ {
+ ///
+ /// 组接口
+ ///
+ private readonly IBaseGroupService _BaseGroupService;
+
+ public BaseGroupController(IBaseGroupService BaseGroupService)
+ {
+ _BaseGroupService = BaseGroupService;
+ }
+
+ ///
+ /// 查询组列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:basegroup:list")]
+ public IActionResult QueryBaseGroup([FromQuery] BaseGroupQueryDto parm)
+ {
+ var response = _BaseGroupService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询组详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basegroup:query")]
+ public IActionResult GetBaseGroup(int Id)
+ {
+ var response = _BaseGroupService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加组
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:basegroup:add")]
+ [Log(Title = "组", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseGroup([FromBody] BaseGroupDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseGroupService.AddBaseGroup(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新组
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:basegroup:edit")]
+ [Log(Title = "组", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseGroup([FromBody] BaseGroupDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseGroupService.UpdateBaseGroup(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除组
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basegroup:delete")]
+ [Log(Title = "组", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseGroup(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseGroupService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseSupplierController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseSupplierController.cs
new file mode 100644
index 0000000..b52cc18
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseSupplierController.cs
@@ -0,0 +1,108 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 供应商信息
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseSupplier")]
+ public class BaseSupplierController : BaseController
+ {
+ ///
+ /// 供应商信息接口
+ ///
+ private readonly IBaseSupplierService _BaseSupplierService;
+
+ public BaseSupplierController(IBaseSupplierService BaseSupplierService)
+ {
+ _BaseSupplierService = BaseSupplierService;
+ }
+
+ ///
+ /// 查询供应商信息列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:basesupplier:list")]
+ public IActionResult QueryBaseSupplier([FromQuery] BaseSupplierQueryDto parm)
+ {
+ var response = _BaseSupplierService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询供应商信息详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basesupplier:query")]
+ public IActionResult GetBaseSupplier(int Id)
+ {
+ var response = _BaseSupplierService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加供应商信息
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:basesupplier:add")]
+ [Log(Title = "供应商信息", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseSupplier([FromBody] BaseSupplierDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseSupplierService.AddBaseSupplier(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新供应商信息
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:basesupplier:edit")]
+ [Log(Title = "供应商信息", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseSupplier([FromBody] BaseSupplierDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseSupplierService.UpdateBaseSupplier(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除供应商信息
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "business:basesupplier:delete")]
+ [Log(Title = "供应商信息", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseSupplier(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseSupplierService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseUnitController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseUnitController.cs
new file mode 100644
index 0000000..1d5abde
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseUnitController.cs
@@ -0,0 +1,109 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+using DOAN.Service.MES.base_;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 单位信息
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseUnit")]
+ public class BaseUnitController : BaseController
+ {
+ ///
+ /// 单位信息接口
+ ///
+ private readonly IBaseUnitService _BaseUnitService;
+
+ public BaseUnitController(IBaseUnitService BaseUnitService)
+ {
+ _BaseUnitService = BaseUnitService;
+ }
+
+ ///
+ /// 查询单位信息列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseunit:list")]
+ public IActionResult QueryBaseUnit([FromQuery] BaseUnitQueryDto parm)
+ {
+ var response = _BaseUnitService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询单位信息详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseunit:query")]
+ public IActionResult GetBaseUnit(int Id)
+ {
+ var response = _BaseUnitService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加单位信息
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:baseunit:add")]
+ [Log(Title = "单位信息", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseUnit([FromBody] BaseUnitDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseUnitService.AddBaseUnit(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新单位信息
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:baseunit:edit")]
+ [Log(Title = "单位信息", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseUnit([FromBody] BaseUnitDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseUnitService.UpdateBaseUnit(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除单位信息
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseunit:delete")]
+ [Log(Title = "单位信息", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseUnit(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseUnitService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkProcessesController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkProcessesController.cs
new file mode 100644
index 0000000..d6244fa
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkProcessesController.cs
@@ -0,0 +1,120 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+using DOAN.Service.MES.base_;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 生产工序
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseWorkProcesses")]
+ public class BaseWorkProcessesController : BaseController
+ {
+ ///
+ /// 生产工序接口
+ ///
+ private readonly IBaseWorkProcessesService _BaseWorkProcessesService;
+
+ public BaseWorkProcessesController(IBaseWorkProcessesService BaseWorkProcessesService)
+ {
+ _BaseWorkProcessesService = BaseWorkProcessesService;
+ }
+
+ ///
+ /// 查询生产工序列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkprocesses:list")]
+ public IActionResult QueryBaseWorkProcesses([FromQuery] BaseWorkProcessesQueryDto parm)
+ {
+ var response = _BaseWorkProcessesService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 获取未绑定的工工序
+ ///
+ ///
+ ///
+ [HttpPost("list_no_bind")]
+ public IActionResult QueryBaseWorkRoute_No_bind([FromBody] BaseWorkProcessesQueryDto2 parm)
+ {
+ var response = _BaseWorkProcessesService.GetList_No_bind(parm);
+ return SUCCESS(response);
+ }
+ ///
+ /// 查询生产工序详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkprocesses:query")]
+ public IActionResult GetBaseWorkProcesses(int Id)
+ {
+ var response = _BaseWorkProcessesService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加生产工序
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkprocesses:add")]
+ [Log(Title = "生产工序", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseWorkProcesses([FromBody] BaseWorkProcessesDto2 parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseWorkProcessesService.AddBaseWorkProcesses(modal, parm.BindedWorkStationArray);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新生产工序
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkprocesses:edit")]
+ [Log(Title = "生产工序", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseWorkProcesses([FromBody] BaseWorkProcessesDto2 parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseWorkProcessesService.UpdateBaseWorkProcesses(modal, parm.BindedWorkStationArray);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除生产工序
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkprocesses:delete")]
+ [Log(Title = "生产工序", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseWorkProcesses(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseWorkProcessesService.Delete(idsArr);
+ _BaseWorkProcessesService.DeleteHandle(idsArr);// 删除绑定关系
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkRouteController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkRouteController.cs
new file mode 100644
index 0000000..7dc6d74
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkRouteController.cs
@@ -0,0 +1,119 @@
+using DOAN.Admin.WebApi.Filters;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Service.MES.base_.IService;
+using Microsoft.AspNetCore.Mvc;
+
+//创建时间:2024-07-09
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 工艺路线
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseWorkRoute")]
+ public class BaseWorkRouteController : BaseController
+ {
+ ///
+ /// 工艺路线接口
+ ///
+ private readonly IBaseWorkRouteService _BaseWorkRouteService;
+
+ public BaseWorkRouteController(IBaseWorkRouteService BaseWorkRouteService)
+ {
+ _BaseWorkRouteService = BaseWorkRouteService;
+ }
+
+ ///
+ /// 查询工艺路线列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkroute:list")]
+ public IActionResult QueryBaseWorkRoute([FromQuery] BaseWorkRouteQueryDto parm)
+ {
+ var response = _BaseWorkRouteService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询工艺路线详情s
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkroute:query")]
+ public IActionResult GetBaseWorkRoute(int Id)
+ {
+ var response = _BaseWorkRouteService.GetInfo(Id);
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加工艺路线
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkroute:add")]
+ [Log(Title = "工艺路线", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseWorkRoute([FromBody] BaseWorkRouteDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseWorkRouteService.AddBaseWorkRoute(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新工艺路线
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkroute:edit")]
+ [Log(Title = "工艺路线", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseWorkRoute([FromBody] BaseWorkRouteDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseWorkRouteService.UpdateBaseWorkRoute(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除工艺路线
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkroute:delete")]
+ [Log(Title = "工艺路线", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseWorkRoute(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0)
+ {
+ return ToResponse(ApiResult.Error($"删除失败Id 不能为空"));
+ }
+
+ var response = _BaseWorkRouteService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 工艺路线解析后绑定工序
+ ///
+ ///
+ ///
+ [HttpPost("route_bind_proccess")]
+ public IActionResult ParseRouteBindProccess([FromBody] BaseParseNodeDto baseParseNodeDto)
+ {
+ var response = _BaseWorkRouteService.ParseRouteBindProccess(baseParseNodeDto);
+
+ return ToResponse(response);
+ }
+ }
+}
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkStationController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkStationController.cs
new file mode 100644
index 0000000..4bdb5c4
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/BaseWorkStationController.cs
@@ -0,0 +1,123 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 工位
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseWorkStation")]
+ public class BaseWorkStationController : BaseController
+ {
+ ///
+ /// 工位接口
+ ///
+ private readonly IBaseWorkStationService _BaseWorkStationService;
+
+ public BaseWorkStationController(IBaseWorkStationService BaseWorkStationService)
+ {
+ _BaseWorkStationService = BaseWorkStationService;
+ }
+
+ ///
+ /// 查询工位列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkstation:list")]
+ public IActionResult QueryBaseWorkStation([FromQuery] BaseWorkStationQueryDto parm)
+ {
+ var response = _BaseWorkStationService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询工位列表 未绑定的工位和已经绑定的
+ ///
+ ///
+ ///
+ [HttpGet("drop_down_list")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkstation:list")]
+ public IActionResult QueryBaseWorkStation_Drop_down(int id)
+ {
+ var response = _BaseWorkStationService.GetList_Drop_down(id);
+ return SUCCESS(response);
+ }
+
+
+
+ ///
+ /// 查询工位详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkstation:query")]
+ public IActionResult GetBaseWorkStation(int Id)
+ {
+ var response = _BaseWorkStationService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加工位
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkstation:add")]
+ [Log(Title = "工位", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseWorkStation([FromBody] BaseWorkStationDto2 parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseWorkStationService.AddBaseWorkStation(modal,parm.BindedDeviceArray);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新工位
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkstation:edit")]
+ [Log(Title = "工位", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseWorkStation([FromBody] BaseWorkStationDto2 parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseWorkStationService.UpdateBaseWorkStation(modal, parm.BindedDeviceArray);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除工位
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:baseworkstation:delete")]
+ [Log(Title = "工位", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseWorkStation(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseWorkStationService.Delete(idsArr);
+ _BaseWorkStationService.DeleteHandle(idsArr);// 删除绑定关系
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialBOM_oldController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialBOM_oldController.cs
new file mode 100644
index 0000000..3089dad
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialBOM_oldController.cs
@@ -0,0 +1,188 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+//创建时间:2024-07-15
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 物料清单
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseMaterialBOM_old")]
+ public class BaseMaterialBOM_oldController : BaseController
+ {
+ ///
+ /// 物料清单接口
+ ///
+ private readonly IBaseMaterialBOM_oldService _BaseMaterialBOMService;
+
+ public BaseMaterialBOM_oldController(IBaseMaterialBOM_oldService BaseMaterialBOMService)
+ {
+ _BaseMaterialBOMService = BaseMaterialBOMService;
+ }
+
+ ///
+ /// 查询物料清单列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:BaseMaterialBOM:list")]
+ public IActionResult QueryBaseMaterialBOMList([FromQuery] BaseMaterialListQueryDto2 parm)
+ {
+ var response = _BaseMaterialBOMService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询物料清单详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:BaseMaterialBOM:query")]
+ public IActionResult GetBaseMaterialBOMDetail(string Id)
+ {
+ var response = _BaseMaterialBOMService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加物料清单
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:BaseMaterialBOM:add")]
+ [Log(Title = "物料清单", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseMaterialBOM([FromBody] BaseMaterialListDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseMaterialBOMService.AddBaseMaterialList(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新物料清单
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:BaseMaterialBOM:edit")]
+ [Log(Title = "物料清单", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseMaterialBOM([FromBody] BaseMaterialListDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseMaterialBOMService.UpdateBaseMaterialList(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除物料清单
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:BaseMaterialBOM:delete")]
+ [Log(Title = "物料清单", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseMaterialBOM(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseMaterialBOMService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 获取BOM结构
+ ///
+ ///
+ ///
+ [HttpGet("getBOM")]
+ public IActionResult Achieve_BOM(string id)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ return SUCCESS(null);
+ }
+ var response = _BaseMaterialBOMService.Achieve_BOM(id);
+ return SUCCESS(response);
+
+ }
+
+
+ ///
+ /// 删除绑定关系
+ ///
+ ///
+ [HttpGet("delete_BOM_bind")]
+ public IActionResult DeleteBOMBind(string id, string parent_id)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ return SUCCESS(null);
+ }
+ var response = _BaseMaterialBOMService.DeleteBOMBind(id, parent_id);
+ return SUCCESS(response);
+ }
+ ///
+ /// 获取此产品未绑定的原材料及其半成品
+ ///
+ ///
+ ///
+ [HttpPost("get_no_bind_bom")]
+ public IActionResult Achieve_BOM_no_bind([FromBody] BaseMaterialListQueryDto3 query)
+ {
+ if (query == null)
+ {
+ return SUCCESS(null);
+ }
+ var response = _BaseMaterialBOMService.Achieve_BOM_no_bind(query);
+ return SUCCESS(response);
+
+ }
+
+
+ ///
+ /// 增加绑定关系
+ ///
+ ///
+ ///
+ ///
+ [HttpGet("tobind")]
+ public IActionResult ADDBOMBind(string id, string parent_id)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ return SUCCESS(null);
+ }
+ var response = _BaseMaterialBOMService.ADDBOMBind(id, parent_id);
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 显示BOM视图
+ ///
+ /// 成品或者半成品id
+ ///
+ [HttpGet("BOM_View")]
+ public IActionResult ShowBOMView(string id)
+ {
+ if (string.IsNullOrEmpty(id))
+ {
+ return SUCCESS(null);
+ }
+ var response = _BaseMaterialBOMService.ShowBOMView(id);
+ return SUCCESS(response);
+
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialBomController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialBomController.cs
new file mode 100644
index 0000000..ff90c86
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialBomController.cs
@@ -0,0 +1,123 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+//创建时间:2024-07-15
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ ///
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseMaterialBOM")]
+ public class BaseMaterialBomController : BaseController
+ {
+ ///
+ /// 接口
+ ///
+ private readonly IBaseMaterialBomService _BaseMaterialBomService;
+
+ public BaseMaterialBomController(IBaseMaterialBomService BaseMaterialBomService)
+ {
+ _BaseMaterialBomService = BaseMaterialBomService;
+ }
+
+ ///
+ /// 查询列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialbom:list")]
+ public IActionResult QueryBaseMaterialBom([FromQuery] BaseMaterialBomQueryDto parm)
+ {
+ var response = _BaseMaterialBomService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+ //TODO 获取母件
+ [HttpPost("get_monter_inv")]
+ public IActionResult GetMonterInvList([FromBody] BaseMaterialBomQueryDto parm)
+ {
+ var response = _BaseMaterialBomService.GetMonterInvList(parm);
+ return SUCCESS(response);
+ }
+
+ //TODO 获取子件
+ [HttpPost("get_son_inv")]
+ public IActionResult GetSonInvList([FromBody] BaseMaterialBomQueryDto parm)
+ {
+
+ var response = _BaseMaterialBomService.GetSonInvList(parm);
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 查询详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialbom:query")]
+ public IActionResult GetBaseMaterialBom(string Id)
+ {
+ var response = _BaseMaterialBomService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialbom:add")]
+ [Log(Title = "", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseMaterialBom([FromBody] BaseMaterialBomDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseMaterialBomService.AddBaseMaterialBom(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialbom:edit")]
+ [Log(Title = "", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseMaterialBom([FromBody] BaseMaterialBomDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseMaterialBomService.UpdateBaseMaterialBom(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialbom:delete")]
+ [Log(Title = "", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseMaterialBom(string ids)
+ {
+ int[] idsArr = Tools.SpitIntArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseMaterialBomService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialListController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialListController.cs
new file mode 100644
index 0000000..d62fa6e
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialListController.cs
@@ -0,0 +1,109 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 物料清单
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseMaterialList")]
+ public class BaseMaterialListController : BaseController
+ {
+ ///
+ /// 物料清单接口
+ ///
+ private readonly IBaseMaterialListService _BaseMaterialListService;
+
+ public BaseMaterialListController(IBaseMaterialListService BaseMaterialListService)
+ {
+ _BaseMaterialListService = BaseMaterialListService;
+ }
+
+ ///
+ /// 查询物料清单列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:basemateriallist:list")]
+ public IActionResult QueryBaseMaterialList([FromQuery] BaseMaterialListQueryDto parm)
+ {
+ var response = _BaseMaterialListService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询物料清单详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basemateriallist:query")]
+ public IActionResult GetBaseMaterialList(string Id)
+ {
+ var response = _BaseMaterialListService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加物料清单
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "baseManagement:basemateriallist:add")]
+ [Log(Title = "物料清单", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseMaterialList([FromBody] BaseMaterialListDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseMaterialListService.AddBaseMaterialList(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新物料清单
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "baseManagement:basemateriallist:edit")]
+ [Log(Title = "物料清单", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseMaterialList([FromBody] BaseMaterialListDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseMaterialListService.UpdateBaseMaterialList(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除物料清单
+ ///
+ ///
+ [HttpDelete("{ids}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basemateriallist:delete")]
+ [Log(Title = "物料清单", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseMaterialList(string ids)
+ {
+ string[] idsArr = Tools.SpitStrArrary(ids);
+ if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseMaterialListService.Delete(idsArr);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialTypeController.cs b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialTypeController.cs
new file mode 100644
index 0000000..3e4e655
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Base/material_account/BaseMaterialTypeController.cs
@@ -0,0 +1,112 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Service.MES.base_.IService;
+using DOAN.Admin.WebApi.Filters;
+
+//创建时间:2024-07-08
+namespace DOAN.Admin.WebApi.Controllers
+{
+ ///
+ /// 物料类别
+ ///
+ [Verify]
+ [Route("mes/baseManagement/BaseMaterialType")]
+ public class BaseMaterialTypeController : BaseController
+ {
+ ///
+ /// 物料类别接口
+ ///
+ private readonly IBaseMaterialTypeService _BaseMaterialTypeService;
+
+ public BaseMaterialTypeController(IBaseMaterialTypeService BaseMaterialTypeService)
+ {
+ _BaseMaterialTypeService = BaseMaterialTypeService;
+ }
+
+ ///
+ /// 查询物料类别列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialtype:list")]
+ public IActionResult QueryBaseMaterialType([FromQuery] BaseMaterialTypeQueryDto parm)
+ {
+ var response = _BaseMaterialTypeService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询物料类别详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialtype:query")]
+ public IActionResult GetBaseMaterialType(int Id)
+ {
+ var response = _BaseMaterialTypeService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加物料类别
+ ///
+ ///
+ [HttpPost("insert")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialtype:add")]
+ [Log(Title = "物料类别", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddBaseMaterialType([FromBody] BaseMaterialTypeDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _BaseMaterialTypeService.AddBaseMaterialType(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新物料类别
+ ///
+ ///
+ [HttpPost("update")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialtype:edit")]
+ [Log(Title = "物料类别", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateBaseMaterialType([FromBody] BaseMaterialTypeDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _BaseMaterialTypeService.UpdateBaseMaterialType(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除物料类别
+ ///
+ ///
+ [HttpGet("delete/{id}")]
+ [ActionPermissionFilter(Permission = "baseManagement:basematerialtype:delete")]
+ [Log(Title = "物料类别", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteBaseMaterialType(int id)
+ {
+
+ if (id <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
+
+ var response = _BaseMaterialTypeService.Delete(id);
+
+ return ToResponse(response);
+ }
+
+
+
+
+ }
+
+}
+
+
+
diff --git a/DOAN.Admin.WebApi/DOAN.Admin.WebApi.csproj b/DOAN.Admin.WebApi/DOAN.Admin.WebApi.csproj
index fda4e9b..e0720ac 100644
--- a/DOAN.Admin.WebApi/DOAN.Admin.WebApi.csproj
+++ b/DOAN.Admin.WebApi/DOAN.Admin.WebApi.csproj
@@ -27,7 +27,6 @@
-
diff --git a/DOAN.Service/MES/Base/BaseCustomService.cs b/DOAN.Service/MES/Base/BaseCustomService.cs
new file mode 100644
index 0000000..b9cdf86
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseCustomService.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Linq;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using SqlSugar;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 客户信息Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseCustomService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseCustomService : BaseService, IBaseCustomService
+ {
+ ///
+ /// 查询客户信息列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseCustomQueryDto parm)
+ {
+ var predicate = Expressionable
+ .Create()
+ .AndIF(
+ !string.IsNullOrEmpty(parm.CustomNo),
+ it => it.CustomNo.Contains(parm.CustomNo)
+ )
+ .AndIF(
+ !string.IsNullOrEmpty(parm.CustomName),
+ it => it.CustomName.Contains(parm.CustomName)
+ )
+ .AndIF(parm.Type > -1, it => it.Type == parm.Type)
+ .AndIF(parm.Status > -1, it => it.Status == parm.Status);
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .OrderBy(it=>it.CustomNo)
+ .ToPage(parm);
+
+ return response;
+ }
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseCustom GetInfo(int Id)
+ {
+ var response = Queryable().Where(x => x.Id == Id).First();
+
+ return response;
+ }
+
+ ///
+ /// 添加客户信息
+ ///
+ ///
+ ///
+ public BaseCustom AddBaseCustom(BaseCustom model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改客户信息
+ ///
+ ///
+ ///
+ public int UpdateBaseCustom(BaseCustom model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseCustom()
+ //{
+ // CustomNo = model.CustomNo,
+ // CustomName = model.CustomName,
+ // CustomAddress = model.CustomAddress,
+ // CustomLiaison = model.CustomLiaison,
+ // CustomPhone = model.CustomPhone,
+ // Type = model.Type,
+ // Status = model.Status,
+ // Remark = model.Remark,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+ }
+}
diff --git a/DOAN.Service/MES/Base/BaseDeviceService.cs b/DOAN.Service/MES/Base/BaseDeviceService.cs
new file mode 100644
index 0000000..c912d07
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseDeviceService.cs
@@ -0,0 +1,109 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+
+using System.Linq;
+using Microsoft.IdentityModel.Tokens;
+using Mapster;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 设备信息Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseDeviceService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseDeviceService : BaseService, IBaseDeviceService
+ {
+ ///
+ /// 查询设备信息列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseDeviceQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.DeviceCode), it => it.DeviceCode.Contains(parm.DeviceCode))
+ .AndIF(!string.IsNullOrEmpty(parm.DeviceName), it => it.DeviceName.Contains(parm.DeviceName))
+ .AndIF(!string.IsNullOrEmpty(parm.DeviceSpecification), it => it.DeviceSpecification.Contains(parm.DeviceSpecification))
+ .AndIF(!string.IsNullOrEmpty(parm.DeviceSupplier), it => it.DeviceSupplier.Contains(parm.DeviceSupplier))
+ .AndIF(parm.FkWorkStation > -1, it => it.FkWorkStation == parm.FkWorkStation)
+ .AndIF(parm.Status > -1, it => it.Status == parm.Status)
+ ;
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+
+ return response;
+ }
+ ///
+ /// 查询设备信息列表 未绑定工位的设备
+ ///
+ ///
+ ///
+ public List GetList_nobind(int id)
+ {
+ var response= Context.Queryable().Where(it => (it.Status==1&&it.FkWorkStation == null) || (it.Status == 1 && it.FkWorkStation == id))
+ .ToList().Adapt>();
+ return response;
+ }
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseDevice GetInfo(int Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加设备信息
+ ///
+ ///
+ ///
+ public BaseDevice AddBaseDevice(BaseDevice model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改设备信息
+ ///
+ ///
+ ///
+ public int UpdateBaseDevice(BaseDevice model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseDevice()
+ //{
+ // FkWorkStation = model.FkWorkStation,
+ // DeviceCode = model.DeviceCode,
+ // DeviceName = model.DeviceName,
+ // DeviceSpecification = model.DeviceSpecification,
+ // PurchaseTime = model.PurchaseTime,
+ // DeviceSupplier = model.DeviceSupplier,
+ // Remark = model.Remark,
+ // Status = model.Status,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseGroupService.cs b/DOAN.Service/MES/Base/BaseGroupService.cs
new file mode 100644
index 0000000..52d68f0
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseGroupService.cs
@@ -0,0 +1,88 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+
+
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 组Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseGroupService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseGroupService : BaseService, IBaseGroupService
+ {
+ ///
+ /// 查询组列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseGroupQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.GroupCode), it => it.GroupCode == parm.GroupCode)
+ .AndIF(!string.IsNullOrEmpty(parm.GroupName), it => it.GroupName == parm.GroupName)
+ .AndIF(parm.Status > 0, it => it.Status == parm.Status);
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+
+ return response;
+ }
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseGroup GetInfo(int Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加组
+ ///
+ ///
+ ///
+ public BaseGroup AddBaseGroup(BaseGroup model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改组
+ ///
+ ///
+ ///
+ public int UpdateBaseGroup(BaseGroup model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseGroup()
+ //{
+ // GroupName = model.GroupName,
+ // Remark = model.Remark,
+ // Status = model.Status,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseMaterialBOM_oldService.cs b/DOAN.Service/MES/Base/BaseMaterialBOM_oldService.cs
new file mode 100644
index 0000000..cd7dfb3
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseMaterialBOM_oldService.cs
@@ -0,0 +1,242 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+
+using System.Linq;
+using Microsoft.IdentityModel.Tokens;
+using Mapster;
+using System.Xml.Linq;
+using static Org.BouncyCastle.Crypto.Engines.SM2Engine;
+using Infrastructure.Model;
+using Aliyun.OSS;
+
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 物料清单Service业务层处理
+ ///
+ //[AppService(ServiceType = typeof(IBaseMaterialBOMService), ServiceLifetime = LifeTime.Transient)]
+ //public class BaseMaterialBOMService : BaseService, IBaseMaterialBOMService
+ //{
+ // ///
+ // /// 查询物料清单列表
+ // ///
+ // ///
+ // ///
+ // public PagedInfo GetList(BaseMaterialListQueryDto2 parm)
+ // {
+ // int[] nodes = null;
+
+ // if (parm.Type == 1)
+ // {
+ // nodes = FindLeafNodes(Context.Queryable().ToList(), 6).Select(it => it.Id).ToArray();
+ // }
+ // else if (parm.Type == 2)
+ // {
+
+ // nodes = FindLeafNodes(Context.Queryable().ToList(), 5).Select(it => it.Id).ToArray();
+
+ // }
+ // var predicate = Expressionable.Create();
+
+ // var response = Queryable()
+ // .Where(it => nodes.Contains(it.FkTypeId.Value))
+ // .Where(predicate.ToExpression())
+ // .ToPage(parm);
+
+ // return response;
+ // }
+
+
+ // ///
+ // /// 获取详情
+ // ///
+ // ///
+ // ///
+ // public BaseMaterialList GetInfo(string Id)
+ // {
+ // var response = Queryable()
+ // .Where(x => x.Id == Id)
+ // .First();
+
+ // return response;
+ // }
+
+ // ///
+ // /// 添加物料清单
+ // ///
+ // ///
+ // ///
+ // public BaseMaterialList AddBaseMaterialList(BaseMaterialList model)
+ // {
+ // return Context.Insertable(model).ExecuteReturnEntity();
+ // }
+
+ // ///
+ // /// 修改物料清单
+ // ///
+ // ///
+ // ///
+ // public int UpdateBaseMaterialList(BaseMaterialList model)
+ // {
+ // //var response = Update(w => w.Id == model.Id, it => new BaseMaterialList()
+ // //{
+ // // Name = model.Name,
+ // // Code = model.Code,
+ // // Customer code = model.Customer code,
+ // // Color = model.Color,
+ // // Specification = model.Specification,
+ // // Unit = model.Unit,
+ // // Description = model.Description,
+ // // ExpirationUnit = model.ExpirationUnit,
+ // // ExpirationDate = model.ExpirationDate,
+ // // ShelfLifeWarningDays = model.ShelfLifeWarningDays,
+ // // IsShelfLife = model.IsShelfLife,
+ // // StartTime = model.StartTime,
+ // // StopTime = model.StopTime,
+ // // BarCode = model.BarCode,
+ // // IsBatch = model.IsBatch,
+ // // CreatedBy = model.CreatedBy,
+ // // CreatedTime = model.CreatedTime,
+ // // UpdatedBy = model.UpdatedBy,
+ // // UpdatedTime = model.UpdatedTime,
+ // //});
+ // //return response;
+ // return Update(model, true);
+ // }
+
+ // ///
+ // /// 获取bom结构
+ // ///
+ // ///
+ // ///
+ // public List Achieve_BOM(string id)
+ // {
+ // var query1 = Context.Queryable().Where(it => it.FkParentId == id);
+ // return Context.Queryable(query1).LeftJoin((q, m) => q.FkId == m.Id)
+ // .InnerJoin((q, m, t) => m.FkTypeId == t.Id)
+ // .Select((q, m, t) => new BaseMaterialListDto2()
+ // {
+ // Type_Name = t.Name,
+ // Type_Code = t.Code,
+ // }, true)
+ // .ToList()
+ // .Adapt>()
+ // ;
+
+
+
+ // }
+
+ // ///
+ // /// 删除绑定关系
+ // ///
+ // ///
+ // ///
+ // public int DeleteBOMBind(string id, string parent_id)
+ // {
+ // return Context.Deleteable().Where(it => it.FkId == id)
+ // .Where(it => it.FkParentId == parent_id)
+ // .ExecuteCommand();
+ // }
+ // ///
+ // /// 增加绑定关系
+ // ///
+ // ///
+ // ///
+ // public int ADDBOMBind(string id, string parent_id)
+ // {
+ // BaseMaterialBom bom = new BaseMaterialBom();
+ // bom.FkId = id;
+ // bom.FkParentId = parent_id;
+ // bom.CreatedTime = DateTime.Now;
+ // return Context.Insertable(bom).ExecuteCommand();
+ // }
+
+
+ // ///
+ // /// 获取未绑定的BOM结构
+ // ///
+ // ///
+ // ///
+ // public PagedInfo Achieve_BOM_no_bind(BaseMaterialListQueryDto3 query)
+ // {
+ // // 成品id 的Bom结构
+ // string[] binded_array = Context.Queryable().Where(it => it.FkParentId == query.Id).Select(it => it.FkId).ToArray();
+
+ // //在原材料和半成品中 选择
+ // List typeList = Context.Queryable().ToList();
+ // int[] leaf = FindLeafNodes(typeList, 1).Select(it => it.Id).ToArray();
+ // int[] leaf2 = FindLeafNodes(typeList, 5).Select(it => it.Id).ToArray();
+ // int[] leaf3 = leaf.Concat(leaf2).ToArray();
+ // var predicate = Expressionable.Create()
+ // .AndIF(!string.IsNullOrEmpty(query.Name), it => it.Name.Contains(query.Name))
+ // .AndIF(!string.IsNullOrEmpty(query.Code), it => it.Name.Contains(query.Code))
+ // .AndIF(!string.IsNullOrEmpty(query.CustomerCode), it => it.Name.Contains(query.CustomerCode))
+ // ;
+
+ // var qua = Context.Queryable().Where(it => !binded_array.Contains(it.Id))
+ // .Where(predicate.ToExpression())
+ // .Where(it => leaf3.Contains(it.FkTypeId.Value));
+ // return Context.Queryable(qua).InnerJoin((q, t) => q.FkTypeId == t.Id)
+ // .Select((q, t) => new BaseMaterialListDto2()
+ // {
+ // Type_Name = t.Name,
+ // Type_Code = t.Code,
+ // }, true).ToPage(query);
+
+
+ // }
+
+ // public static List FindLeafNodes(List nodes, int ancestorId)
+ // {
+ // List leafNodes = new List();
+
+ // void FindLeaves(int currentId)
+ // {
+ // // 查找当前ID的直接子节点
+ // var children = nodes.Where(n => n.ParentId == currentId).ToList();
+
+ // // 如果没有子节点,说明是叶子节点
+ // if (!children.Any())
+ // {
+ // leafNodes.Add(nodes.FirstOrDefault(n => n.Id == currentId));
+ // }
+ // else
+ // {
+ // // 对每个子节点递归调用FindLeaves
+ // foreach (var child in children)
+ // {
+ // FindLeaves(child.Id);
+ // }
+ // }
+ // }
+
+ // // 从指定的祖先节点开始查找
+ // FindLeaves(ancestorId);
+
+ // return leafNodes;
+ // }
+
+ // ///
+ // /// bom视图
+ // ///
+ // ///
+ // ///
+ // public BaseParseNode ShowBOMView(string id)
+ // {
+ // //TODO 获取成品id的一级子集 bom
+
+ // return null;
+ // }
+
+ //}
+}
diff --git a/DOAN.Service/MES/Base/BaseMaterialBomService.cs b/DOAN.Service/MES/Base/BaseMaterialBomService.cs
new file mode 100644
index 0000000..b30e447
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseMaterialBomService.cs
@@ -0,0 +1,158 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+
+using System.Linq;
+using Microsoft.IdentityModel.Tokens;
+using Mapster;
+using System.Xml.Linq;
+using static Org.BouncyCastle.Crypto.Engines.SM2Engine;
+using Infrastructure.Model;
+using Aliyun.OSS;
+using NPOI.SS.Formula.Functions;
+using MathNet.Numerics.Distributions;
+
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseMaterialBomService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseMaterialBomService : BaseService, IBaseMaterialBomService
+ {
+ ///
+ /// 查询列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseMaterialBomQueryDto parm)
+ {
+ var predicate = Expressionable.Create();
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+ //Context.Queryable().Where(predicate.ToExpression()).ToTree(it => it.Child, it => it.InvCode, 0, it => it.Id)
+
+
+ //var response = Context.Queryable()
+ // .Where(predicate.ToExpression())
+ // .Includes(x => x.Child).ToList();
+
+
+
+
+
+
+
+ return response;
+ }
+
+ ///
+ /// 获取母件BOM清单
+ ///
+ ///
+ ///
+ public PagedInfo GetMonterInvList(BaseMaterialBomQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.InvCode),it=>it.InvCode.Contains(parm.InvCode))
+ .AndIF(!string.IsNullOrEmpty(parm.SubInvCode),it=>it.SubInvCode.Contains(parm.SubInvCode))
+ ;
+
+ var query = Context.Queryable()
+ .Where(predicate.ToExpression())
+ .GroupBy(it => it.InvCode)
+ .Select(it => new BaseMaterialBomDto()
+ {
+
+ Id = SqlFunc.AggregateMax(it.Id),
+ InvCode = SqlFunc.AggregateMax(it.InvCode),
+ InvName = SqlFunc.AggregateMax(it.InvName),
+ SubInvName = SqlFunc.AggregateMax(it.SubInvName),
+ Iusequantity = SqlFunc.AggregateMax(it.Iusequantity),
+ BOMVersion = SqlFunc.AggregateMax(it.BOMVersion),
+ CreatedBy = SqlFunc.AggregateMax(it.CreatedBy),
+ CreatedTime = SqlFunc.AggregateMax(it.CreatedTime),
+ UpdatedBy = SqlFunc.AggregateMax(it.UpdatedBy),
+ UpdatedTime = SqlFunc.AggregateMax(it.UpdatedTime)
+
+
+ });
+ var response = query.ToPage(parm);
+
+
+ return response;
+
+
+ }
+
+ ///
+ /// 获取子件
+ ///
+ ///
+ ///
+ public List GetSonInvList(BaseMaterialBomQueryDto parm)
+ {
+ return Context.Queryable().Where(it => it.InvCode == parm.InvCode).ToList();
+
+ }
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseMaterialBom GetInfo(string Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加
+ ///
+ ///
+ ///
+ public BaseMaterialBom AddBaseMaterialBom(BaseMaterialBom model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改
+ ///
+ ///
+ ///
+ public int UpdateBaseMaterialBom(BaseMaterialBom model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseMaterialBom()
+ //{
+ // InvCode = model.InvCode,
+ // InvName = model.InvName,
+ // SubInvCode = model.SubInvCode,
+ // SubcInvName = model.SubcInvName,
+ // Iusequantity = model.Iusequantity,
+ // BOMVersion = model.BOMVersion,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseMaterialListService.cs b/DOAN.Service/MES/Base/BaseMaterialListService.cs
new file mode 100644
index 0000000..ef5115f
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseMaterialListService.cs
@@ -0,0 +1,123 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using System.Linq;
+using Mapster;
+
+using System.Buffers;
+using System.ComponentModel;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 物料清单Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseMaterialListService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseMaterialListService : BaseService, IBaseMaterialListService
+ {
+
+
+ ///
+ /// 查询物料清单列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseMaterialListQueryDto parm)
+ {
+
+
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.Name), it => it.Name.Contains(parm.Name))
+ .AndIF(!string.IsNullOrEmpty(parm.Code), it => it.Code.Contains (parm.Code))
+
+ .AndIF(!string.IsNullOrEmpty(parm.FkMaterialTypeCode) , it => it.FkMaterialTypeCode.Contains(parm.FkMaterialTypeCode))
+
+ .AndIF(parm.TimeRange != null && parm.TimeRange.Length == 2 && parm.TimeRange[0] > DateTime.MinValue, it => it.CreatedTime >= parm.TimeRange[0])
+ .AndIF(parm.TimeRange != null && parm.TimeRange.Length == 2 && parm.TimeRange[1] > DateTime.MinValue, it => it.CreatedTime <= parm.TimeRange[1]);
+
+ var query01 = Queryable()
+
+ .Where(predicate.ToExpression());
+
+ var response = Context.Queryable(query01).LeftJoin((q, t) => q.FkMaterialTypeCode == t.Code)
+ // .LeftJoin((q, t, s) => q.FkSupplierId == s.Id)
+ .Select((q, t) => new BaseMaterialListDto2
+ {
+
+ FkMaterialTypeName = t.Name,
+ FkMaterialTypeCode = t.Code,
+
+
+ }, true).ToPage(parm);
+
+ return response;
+ }
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseMaterialList GetInfo(string Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加物料清单
+ ///
+ ///
+ ///
+ public BaseMaterialList AddBaseMaterialList(BaseMaterialList model)
+ {
+ model.Id = SnowFlakeSingle.Instance.NextId().ToString();
+
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改物料清单
+ ///
+ ///
+ ///
+ public int UpdateBaseMaterialList(BaseMaterialList model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseMaterialList()
+ //{
+ // Name = model.Name,
+ // Code = model.Code,
+ // Customer code = model.Customer code,
+ // Color = model.Color,
+ // Specification = model.Specification,
+ // Unit = model.Unit,
+ // Description = model.Description,
+ // ExpirationUnit = model.ExpirationUnit,
+ // ExpirationDate = model.ExpirationDate,
+ // ShelfLifeWarningDays = model.ShelfLifeWarningDays,
+ // IsShelfLife = model.IsShelfLife,
+ // StartTime = model.StartTime,
+ // StopTime = model.StopTime,
+ // BarCode = model.BarCode,
+ // IsBatch = model.IsBatch,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseMaterialTypeService.cs b/DOAN.Service/MES/Base/BaseMaterialTypeService.cs
new file mode 100644
index 0000000..3f0852f
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseMaterialTypeService.cs
@@ -0,0 +1,91 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using System.Linq;
+using Mapster;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 物料类别Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseMaterialTypeService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseMaterialTypeService : BaseService, IBaseMaterialTypeService
+ {
+ ///
+ /// 查询物料类别列表
+ ///
+ ///
+ ///
+ public List GetList(BaseMaterialTypeQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.Name),it=>it.Name.Contains(parm.Name))
+ .AndIF(!string.IsNullOrEmpty(parm.Code),it=>it.Code.Contains(parm.Code))
+ .AndIF(parm.Status>-1,it=>it.Status==parm.Status)
+ ;
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .ToList()
+ .Adapt>();
+
+
+ return response;
+ }
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseMaterialType GetInfo(int Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加物料类别
+ ///
+ ///
+ ///
+ public BaseMaterialType AddBaseMaterialType(BaseMaterialType model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改物料类别
+ ///
+ ///
+ ///
+ public int UpdateBaseMaterialType(BaseMaterialType model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseMaterialType()
+ //{
+ // Name = model.Name,
+ // Code = model.Code,
+ // Status = model.Status,
+ // Remark = model.Remark,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseSupplierService.cs b/DOAN.Service/MES/Base/BaseSupplierService.cs
new file mode 100644
index 0000000..ca1e293
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseSupplierService.cs
@@ -0,0 +1,93 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using System.Linq;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 供应商信息Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseSupplierService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseSupplierService : BaseService, IBaseSupplierService
+ {
+ ///
+ /// 查询供应商信息列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseSupplierQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.SupplierNo), it => it.SupplierNo.Contains(parm.SupplierNo))
+ .AndIF(!string.IsNullOrEmpty(parm.SupplierName), it => it.SupplierName.Contains(parm.SupplierName))
+ .AndIF(parm.Type > -1, it => it.Type == parm.Type)
+ .AndIF(parm.Status > -1, it => it.Status == parm.Status);
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .OrderBy(it => it.SupplierNo)
+ .ToPage(parm);
+
+ return response;
+ }
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseSupplier GetInfo(int Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加供应商信息
+ ///
+ ///
+ ///
+ public BaseSupplier AddBaseSupplier(BaseSupplier model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改供应商信息
+ ///
+ ///
+ ///
+ public int UpdateBaseSupplier(BaseSupplier model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseSupplier()
+ //{
+ // SupplierNo = model.SupplierNo,
+ // SupplierName = model.SupplierName,
+ // SupplierAddress = model.SupplierAddress,
+ // SupplierLiaison = model.SupplierLiaison,
+ // SupplierPhone = model.SupplierPhone,
+ // Type = model.Type,
+ // Status = model.Status,
+ // Remark = model.Remark,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseUnitService.cs b/DOAN.Service/MES/Base/BaseUnitService.cs
new file mode 100644
index 0000000..c061eae
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseUnitService.cs
@@ -0,0 +1,88 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using System.Linq;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 单位信息Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseUnitService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseUnitService : BaseService, IBaseUnitService
+ {
+ ///
+ /// 查询单位信息列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseUnitQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.UnitCode),it=>it.UnitCode.Contains(parm.UnitCode))
+ .AndIF(!string.IsNullOrEmpty(parm.UnitName),it=>it.UnitName.Contains(parm.UnitName))
+ .AndIF(parm.Status>=0,it=>it.Status==parm.Status)
+ ;
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+
+ return response;
+ }
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseUnit GetInfo(int Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加单位信息
+ ///
+ ///
+ ///
+ public BaseUnit AddBaseUnit(BaseUnit model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改单位信息
+ ///
+ ///
+ ///
+ public int UpdateBaseUnit(BaseUnit model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseUnit()
+ //{
+ // UnitName = model.UnitName,
+ // UnitCode = model.UnitCode,
+ // Remark = model.Remark,
+ // Status = model.Status,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseWorkProcessesService.cs b/DOAN.Service/MES/Base/BaseWorkProcessesService.cs
new file mode 100644
index 0000000..1158946
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseWorkProcessesService.cs
@@ -0,0 +1,163 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using System.Linq;
+using Mapster;
+using Microsoft.AspNetCore.Routing;
+using Org.BouncyCastle.Ocsp;
+
+namespace DOAN.Service.Business
+{
+ ///
+ /// 生产工序Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseWorkProcessesService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseWorkProcessesService : BaseService, IBaseWorkProcessesService
+ {
+ ///
+ /// 查询生产工序列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseWorkProcessesQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.Name),it=>it.Name.Contains(parm.Name))
+ .AndIF(!string.IsNullOrEmpty(parm.DictWorkType),it=>it.DictWorkType.Contains(parm.DictWorkType))
+ .AndIF(parm.Status>-1,it=>it.Status==parm.Status)
+ ;
+
+ var response = Queryable()
+ .Includes(x => x.BindedWorkStationArray)
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+
+ return response;
+ }
+ ///
+ /// 查询未绑定工序
+ ///
+ ///
+ ///
+ public PagedInfo GetList_No_bind(BaseWorkProcessesQueryDto2 parm)
+ {
+ //获取工艺流程绑定的工序
+ //1 获取
+ var q11 = Context.Queryable().Where(it => it.Id == parm.FkRouteCode);
+
+ int[] workProcessesArray= Context.Queryable(q11).LeftJoin((route,rel)=> route.Id== rel.FkWorkProcesses)
+ // .LeftJoin((route, rel,pro)=>rel.FkWorkProcesses==pro.Id)
+ .Where((route, rel)=>rel.FkWorkProcesses!=null)
+ .Select((route, rel)=>rel.FkWorkProcesses)
+ .ToArray();
+
+ // 在工序中排除
+ return Context
+ .Queryable()
+ .Where(it=>!workProcessesArray.Contains(it.Id.Value))
+ .WhereIF(!string.IsNullOrEmpty(parm.Name),it => it.Name.Contains(parm.Name))
+ .WhereIF(!string.IsNullOrEmpty(parm.DictWorkType), it =>it.DictWorkType.Contains(parm.DictWorkType))
+ .ToPage(parm);
+
+ //var predicate = Expressionable.Create()
+ // .AndIF(!string.IsNullOrEmpty(parm.Name), (w, r) => w.Name.Contains(parm.Name))
+ // .AndIF(!string.IsNullOrEmpty(parm.DictWorkType), (w, r) => w.DictWorkType.Contains(parm.DictWorkType))
+ // .And((w, r) => r.FkWorkProcesses == null&&w.Status==1)
+ // ;
+
+ // return Context.Queryable()
+ // .InnerJoin((w,r)=>w.Id==r.FkWorkProcesses)
+ // .Where(predicate.ToExpression())
+ // .Distinct()
+ // .Select((w,r)=>w)
+ // .ToList()
+ // .Adapt>();
+
+
+ }
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseWorkProcesses GetInfo(int Id)
+ {
+ var response = Queryable()
+ .Includes(x => x.BindedWorkStationArray)
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加生产工序
+ ///
+ ///
+ ///
+ public BaseWorkProcesses AddBaseWorkProcesses(BaseWorkProcesses model, int[] BindedWorkStationArray)
+ {
+ // 处理绑定
+ BaseWorkProcesses resp = Context.Insertable(model).ExecuteReturnEntity();
+ Context.Updateable()
+ .SetColumns(it => it.FkWorkProcesses == resp.Id)
+ .Where(it => BindedWorkStationArray.Contains(it.Id))
+ .Where(it => it.FkWorkProcesses == null).ExecuteCommand();
+
+
+
+ return resp;
+ }
+
+ ///
+ /// 修改生产工序
+ ///
+ ///
+ ///
+ public int UpdateBaseWorkProcesses(BaseWorkProcesses model, int[] BindedWorkStationArray)
+ {
+
+ UseTran2(() =>
+ {
+ //解绑
+ Context.Updateable().SetColumns(it => it.FkWorkProcesses == null)
+ .Where(it => it.FkWorkProcesses == model.Id)
+ .ExecuteCommand();
+ // 处理绑定
+ Context.Updateable().SetColumns(it => it.FkWorkProcesses == model.Id)
+ .Where(it => BindedWorkStationArray.Contains(it.Id))
+ .Where(it => it.FkWorkProcesses == null).ExecuteCommand();
+ });
+
+
+ //var response = Update(w => w.Id == model.Id, it => new BaseWorkProcesses()
+ //{
+ // DictWorkType = model.DictWorkType,
+ // Name = model.Name,
+ // Status = model.Status,
+ // Remark = model.Remark,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ public void DeleteHandle(int[] idsArr)
+ {
+ Context.Updateable().SetColumns(it => it.FkWorkProcesses == null)
+ .Where(it => idsArr.Contains(it.FkWorkProcesses.Value))
+ .ExecuteCommand();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseWorkRouteService.cs b/DOAN.Service/MES/Base/BaseWorkRouteService.cs
new file mode 100644
index 0000000..8eca54c
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseWorkRouteService.cs
@@ -0,0 +1,197 @@
+using System;
+using System.Linq;
+using System.Reflection;
+using DOAN.Model;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using JinianNet.JNTemplate.Dynamic;
+using SqlSugar;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 工艺路线Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseWorkRouteService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseWorkRouteService : BaseService, IBaseWorkRouteService
+ {
+ ///
+ /// 查询工艺路线列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseWorkRouteQueryDto parm)
+ {
+ List baseWorks = Context.Queryable()
+ .LeftJoin((r, p) => r.FkWorkProcesses == p.Id)
+ .Where((r, p) => r.FkWorkRoute != null)
+ .Select((r, p) => new BaseWorkProcessesDto3()
+ {
+ fk_id = r.FkWorkRoute
+ }, true)
+ .ToList();
+ var predicate = Expressionable
+ .Create()
+ .AndIF(!string.IsNullOrEmpty(parm.Name), it => it.Name.Contains(parm.Name))
+ .AndIF(!string.IsNullOrEmpty(parm.Code), it => it.Code.Contains(parm.Code))
+ .AndIF(parm.Status > -1, it => it.Status == parm.Status);
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+ if (response != null && response.Result.Count > 0)
+ {
+ foreach (var item in response.Result)
+ {
+ item.BaseWorkProcessesList = baseWorks.Where(it => it.fk_id == item.Id).ToList();
+ }
+
+ }
+
+ return response;
+ }
+
+
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseWorkRoute GetInfo(int Id)
+ {
+ var response = Queryable().Where(x => x.Id == Id).First();
+
+ return response;
+ }
+
+ ///
+ /// 添加工艺路线
+ ///
+ ///
+ ///
+ public BaseWorkRoute AddBaseWorkRoute(BaseWorkRoute model)
+ {
+ return Context.Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改工艺路线
+ ///
+ ///
+ ///
+ public int UpdateBaseWorkRoute(BaseWorkRoute model)
+ {
+ //var response = Update(w => w.Id == model.Id, it => new BaseWorkRoute()
+ //{
+ // Name = model.Name,
+ // Status = model.Status,
+ // Remark = model.Remark,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ // Code = model.Code,
+ // LogicFlowData = model.LogicFlowData,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ ///
+ /// 工艺路线解析后绑定工序
+ ///
+ ///
+ ///
+ public int ParseRouteBindProccess(BaseParseNodeDto baseParseNodeDto)
+ {
+ int result = 0;
+ //TODO 1 解析string->object
+ BaseParseNode baseParse = JsonConvert.DeserializeObject(baseParseNodeDto.LogicFlowData);
+
+ //TODO 2 获取绑定的节点
+ //int[] workProcess = null;
+ //if (baseParse != null && (baseParse.nodes.Count() > 0))
+ //{
+ // // 绑定的工序id
+ // workProcess = new int[baseParse.nodes.Count()];
+ // int index = 0;
+ // foreach (var node in baseParse.nodes)
+ // {
+ // workProcess[index] = node.properties.processesId;
+ // index++;
+ // }
+
+ //}
+
+ //TODO 3 排序
+ // 找到首节点 首节点没有终点target
+ List need_insert_node = new List();
+ string first_node_id = "";// 首节点id
+ foreach (var node in baseParse.nodes)
+ {
+ int count = 0;
+ foreach (var edge in baseParse.edges)
+ {
+ if (node.id == first_node_id)
+ {
+ count++;
+ }
+ }
+ if (count == 0)
+ {
+ first_node_id = node.id;
+ break;
+
+ }
+
+ }
+ BaseRelWorkRouteProcesses firstnode = new BaseRelWorkRouteProcesses();
+ firstnode.FkWorkProcesses = baseParse.nodes.Where(it => it.id == first_node_id).Select(it => it.properties.processesId).FirstOrDefault();
+ firstnode.Sort = 0;
+ firstnode.FkWorkRoute = baseParseNodeDto.FkRouteCode;
+ firstnode.CreatedTime = DateTime.Now;
+ need_insert_node.Add(firstnode);
+ //----------------------------------------
+
+ string levels = first_node_id;
+ int index3 = 0;
+ while (true)
+ {
+ index3++;
+ string next_id = baseParse.edges.Where(it => it.sourceNodeId == levels).Select(it => it.targetNodeId).FirstOrDefault();
+ if (!string.IsNullOrEmpty(next_id))
+ {
+ levels = next_id;
+ BaseRelWorkRouteProcesses nextnode = new BaseRelWorkRouteProcesses();
+ nextnode.FkWorkProcesses = baseParse.nodes.Where(it => it.id == levels).Select(it => it.properties.processesId).FirstOrDefault(); ;
+ nextnode.Sort = index3;
+ nextnode.FkWorkRoute = baseParseNodeDto.FkRouteCode;
+ nextnode.CreatedTime = DateTime.Now;
+ need_insert_node.Add(nextnode);
+ }
+ else
+ {
+ break;
+ }
+ }
+
+
+ //TODO 4 解绑 然后更新
+ UseTran2(() =>
+ {
+ Context.Deleteable()
+ .Where(it => it.FkWorkRoute == baseParseNodeDto.FkRouteCode)
+ .ExecuteCommand();
+ result = Context.Insertable(need_insert_node).ExecuteCommand();
+ });
+ return result;
+ }
+
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/BaseWorkStationService.cs b/DOAN.Service/MES/Base/BaseWorkStationService.cs
new file mode 100644
index 0000000..4b9302c
--- /dev/null
+++ b/DOAN.Service/MES/Base/BaseWorkStationService.cs
@@ -0,0 +1,128 @@
+using System;
+using SqlSugar;
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Repository;
+using DOAN.Service.MES.base_.IService;
+using System.Linq;
+using Mapster;
+
+namespace DOAN.Service.MES.base_
+{
+ ///
+ /// 工位Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IBaseWorkStationService), ServiceLifetime = LifeTime.Transient)]
+ public class BaseWorkStationService : BaseService, IBaseWorkStationService
+ {
+ ///
+ /// 查询工位列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(BaseWorkStationQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.WorkStationDescription),it=>it.WorkStationDescription.Contains(parm.WorkStationDescription))
+ .AndIF(parm.Status>-1,it=>it.Status==parm.Status)
+ ;
+
+ var response = Queryable()
+ .Includes(x => x.BindedDeviceArray)
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+ // Context.Queryable().InnerJoin((w,d)=>w.Id==d.FkWorkStation).Select
+
+ return response;
+ }
+
+ public List GetList_Drop_down(int id)
+ {
+ var response = Context.Queryable().Where(it => (it.Status == 1 && it.FkWorkProcesses == null) || (it.Status == 1 && it.FkWorkProcesses == id))
+ .ToList().Adapt>();
+ return response;
+ }
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public BaseWorkStation GetInfo(int Id)
+ {
+ var response = Queryable()
+ .Includes(x => x.BindedDeviceArray)
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加工位
+ ///
+ ///
+ ///
+ public BaseWorkStation AddBaseWorkStation(BaseWorkStation model, int[] BindedDeviceArray)
+ {
+ BaseWorkStation resp= Context.Insertable(model).ExecuteReturnEntity();
+ // 处理绑定
+ Context.Updateable()
+ .SetColumns(it => it.FkWorkStation == resp.Id)
+ .Where(it => BindedDeviceArray.Contains(it.Id))
+ .Where(it => it.FkWorkStation == null).ExecuteCommand();
+ return resp;
+ }
+
+ ///
+ /// 修改工位
+ ///
+ ///
+ ///
+ public int UpdateBaseWorkStation(BaseWorkStation model,int[] BindedDeviceArray)
+ {
+ UseTran2(() =>
+ {
+ //解绑
+ Context.Updateable().SetColumns(it => it.FkWorkStation == null)
+ .Where(it => it.FkWorkStation == model.Id)
+ .ExecuteCommand();
+ // 处理绑定
+ Context.Updateable().SetColumns(it => it.FkWorkStation == model.Id)
+ .Where(it => BindedDeviceArray.Contains(it.Id))
+ .Where(it => it.FkWorkStation == null).ExecuteCommand();
+ });
+
+ //var response = Update(w => w.Id == model.Id, it => new BaseWorkStation()
+ //{
+ // FkWorkProcesses = model.FkWorkProcesses,
+ // DictWorkType = model.DictWorkType,
+ // WorkStationDescription = model.WorkStationDescription,
+ // Status = model.Status,
+ // Remark = model.Remark,
+ // CreatedBy = model.CreatedBy,
+ // CreatedTime = model.CreatedTime,
+ // UpdatedBy = model.UpdatedBy,
+ // UpdatedTime = model.UpdatedTime,
+ //});
+ //return response;
+ return Update(model, true);
+ }
+
+ ///
+ /// 删除绑定关系
+ ///
+ ///
+ public void DeleteHandle(int[] idsArr)
+ {
+ Context.Updateable().SetColumns(it => it.FkWorkStation == null)
+ .Where(it => idsArr.Contains(it.FkWorkStation.Value))
+ .ExecuteCommand();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/IService/IBaseCustomService.cs b/DOAN.Service/MES/Base/IService/IBaseCustomService.cs
new file mode 100644
index 0000000..ad2d829
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseCustomService.cs
@@ -0,0 +1,24 @@
+using System;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 客户信息service接口
+ ///
+ public interface IBaseCustomService : IBaseService
+ {
+ PagedInfo GetList(BaseCustomQueryDto parm);
+
+ BaseCustom GetInfo(int Id);
+
+ BaseCustom AddBaseCustom(BaseCustom parm);
+
+ int UpdateBaseCustom(BaseCustom parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseDeviceService.cs b/DOAN.Service/MES/Base/IService/IBaseDeviceService.cs
new file mode 100644
index 0000000..bc4a5b0
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseDeviceService.cs
@@ -0,0 +1,25 @@
+using System;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 设备信息service接口
+ ///
+ public interface IBaseDeviceService : IBaseService
+ {
+ PagedInfo GetList(BaseDeviceQueryDto parm);
+ List GetList_nobind(int id);
+
+ BaseDevice GetInfo(int Id);
+
+ BaseDevice AddBaseDevice(BaseDevice parm);
+
+ int UpdateBaseDevice(BaseDevice parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseGroupService.cs b/DOAN.Service/MES/Base/IService/IBaseGroupService.cs
new file mode 100644
index 0000000..4e77fce
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseGroupService.cs
@@ -0,0 +1,23 @@
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 组service接口
+ ///
+ public interface IBaseGroupService : IBaseService
+ {
+ PagedInfo GetList(BaseGroupQueryDto parm);
+
+ BaseGroup GetInfo(int Id);
+
+ BaseGroup AddBaseGroup(BaseGroup parm);
+
+ int UpdateBaseGroup(BaseGroup parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseMaterialBOM_oldService.cs b/DOAN.Service/MES/Base/IService/IBaseMaterialBOM_oldService.cs
new file mode 100644
index 0000000..c332961
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseMaterialBOM_oldService.cs
@@ -0,0 +1,32 @@
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 物料清单service接口
+ ///
+ public interface IBaseMaterialBOM_oldService : IBaseService
+ {
+ PagedInfo GetList(BaseMaterialListQueryDto2 parm);
+
+ BaseMaterialList GetInfo(string Id);
+
+ BaseMaterialList AddBaseMaterialList(BaseMaterialList parm);
+
+ int UpdateBaseMaterialList(BaseMaterialList parm);
+
+ List Achieve_BOM(string id);
+
+ PagedInfo Achieve_BOM_no_bind(BaseMaterialListQueryDto3 quary);
+
+ int DeleteBOMBind(string id, string parent_id);
+ int ADDBOMBind(string id, string parent_id);
+
+ BaseParseNode ShowBOMView(string id);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseMaterialBomService.cs b/DOAN.Service/MES/Base/IService/IBaseMaterialBomService.cs
new file mode 100644
index 0000000..82e0fe1
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseMaterialBomService.cs
@@ -0,0 +1,28 @@
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using Microsoft.AspNetCore.Mvc;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// service接口
+ ///
+ public interface IBaseMaterialBomService : IBaseService
+ {
+ PagedInfo GetList(BaseMaterialBomQueryDto parm);
+
+ PagedInfo GetMonterInvList( BaseMaterialBomQueryDto parm);
+
+ List GetSonInvList(BaseMaterialBomQueryDto parm);
+
+ BaseMaterialBom GetInfo(string Id);
+
+ BaseMaterialBom AddBaseMaterialBom(BaseMaterialBom parm);
+
+ int UpdateBaseMaterialBom(BaseMaterialBom parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseMaterialListService.cs b/DOAN.Service/MES/Base/IService/IBaseMaterialListService.cs
new file mode 100644
index 0000000..f2ba2b5
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseMaterialListService.cs
@@ -0,0 +1,25 @@
+
+using System;
+using DOAN.Model;
+using DOAN.Model.Dto;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 物料清单service接口 IBaseMaterialListService
+ ///
+ public interface IBaseMaterialListService : IBaseService
+ {
+ PagedInfo GetList(BaseMaterialListQueryDto parm);
+
+ BaseMaterialList GetInfo(string Id);
+
+ BaseMaterialList AddBaseMaterialList(BaseMaterialList parm);
+
+ int UpdateBaseMaterialList(BaseMaterialList parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseMaterialTypeService .cs b/DOAN.Service/MES/Base/IService/IBaseMaterialTypeService .cs
new file mode 100644
index 0000000..3da7007
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseMaterialTypeService .cs
@@ -0,0 +1,23 @@
+using System;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 物料类别service接口
+ ///
+ public interface IBaseMaterialTypeService : IBaseService
+ {
+ List GetList(BaseMaterialTypeQueryDto parm);
+
+ BaseMaterialType GetInfo(int Id);
+
+ BaseMaterialType AddBaseMaterialType(BaseMaterialType parm);
+
+ int UpdateBaseMaterialType(BaseMaterialType parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseSupplierService.cs b/DOAN.Service/MES/Base/IService/IBaseSupplierService.cs
new file mode 100644
index 0000000..e4e28c1
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseSupplierService.cs
@@ -0,0 +1,23 @@
+using System;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 供应商信息service接口
+ ///
+ public interface IBaseSupplierService : IBaseService
+ {
+ PagedInfo GetList(BaseSupplierQueryDto parm);
+
+ BaseSupplier GetInfo(int Id);
+
+ BaseSupplier AddBaseSupplier(BaseSupplier parm);
+
+ int UpdateBaseSupplier(BaseSupplier parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseUnitService.cs b/DOAN.Service/MES/Base/IService/IBaseUnitService.cs
new file mode 100644
index 0000000..5377f1a
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseUnitService.cs
@@ -0,0 +1,23 @@
+using System;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 单位信息service接口
+ ///
+ public interface IBaseUnitService : IBaseService
+ {
+ PagedInfo GetList(BaseUnitQueryDto parm);
+
+ BaseUnit GetInfo(int Id);
+
+ BaseUnit AddBaseUnit(BaseUnit parm);
+
+ int UpdateBaseUnit(BaseUnit parm);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseWorkProcessesService.cs b/DOAN.Service/MES/Base/IService/IBaseWorkProcessesService.cs
new file mode 100644
index 0000000..7d8ee73
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseWorkProcessesService.cs
@@ -0,0 +1,30 @@
+using System;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 生产工序service接口
+ ///
+ public interface IBaseWorkProcessesService : IBaseService
+ {
+ PagedInfo GetList(BaseWorkProcessesQueryDto parm);
+
+
+ PagedInfo GetList_No_bind(BaseWorkProcessesQueryDto2 parm);
+
+
+ BaseWorkProcesses GetInfo(int Id);
+
+ BaseWorkProcesses AddBaseWorkProcesses(BaseWorkProcesses parm,int[] BindedDeviceArray);
+
+ int UpdateBaseWorkProcesses(BaseWorkProcesses parm, int[] BindedDeviceArray);
+
+
+ void DeleteHandle(int[] idsArr);
+
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseWorkRouteService.cs b/DOAN.Service/MES/Base/IService/IBaseWorkRouteService.cs
new file mode 100644
index 0000000..0234349
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseWorkRouteService.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using DOAN.Model;
+using DOAN.Model.MES.base_;
+using DOAN.Model.MES.base_.Dto;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 工艺路线service接口
+ ///
+ public interface IBaseWorkRouteService : IBaseService
+ {
+ PagedInfo GetList(BaseWorkRouteQueryDto parm);
+
+ int ParseRouteBindProccess(BaseParseNodeDto baseParseNodeDto);
+ BaseWorkRoute GetInfo(int Id);
+
+ BaseWorkRoute AddBaseWorkRoute(BaseWorkRoute parm);
+
+ int UpdateBaseWorkRoute(BaseWorkRoute parm);
+ }
+}
diff --git a/DOAN.Service/MES/Base/IService/IBaseWorkStationService.cs b/DOAN.Service/MES/Base/IService/IBaseWorkStationService.cs
new file mode 100644
index 0000000..bdb9a5f
--- /dev/null
+++ b/DOAN.Service/MES/Base/IService/IBaseWorkStationService.cs
@@ -0,0 +1,25 @@
+using System;
+using DOAN.Model;
+using DOAN.Model.MES.base_.Dto;
+using DOAN.Model.MES.base_;
+using System.Collections.Generic;
+
+namespace DOAN.Service.MES.base_.IService
+{
+ ///
+ /// 工位service接口
+ ///
+ public interface IBaseWorkStationService : IBaseService
+ {
+ PagedInfo GetList(BaseWorkStationQueryDto parm);
+ List GetList_Drop_down(int id);
+ BaseWorkStation GetInfo(int Id);
+
+ BaseWorkStation AddBaseWorkStation(BaseWorkStation parm, int[] BindedWorkStationArray);
+
+ int UpdateBaseWorkStation(BaseWorkStation parm, int[] BindedWorkStationArray);
+
+ void DeleteHandle(int[] idsArr);
+
+ }
+}
diff --git a/Infrastructure/WebExtensions/LogoExtension.cs b/Infrastructure/WebExtensions/LogoExtension.cs
index 73094b6..d84ee56 100644
--- a/Infrastructure/WebExtensions/LogoExtension.cs
+++ b/Infrastructure/WebExtensions/LogoExtension.cs
@@ -16,7 +16,7 @@ namespace Infrastructure
Console.WriteLine(content);
Console.ForegroundColor = ConsoleColor.Blue;
- Console.WriteLine("苏州道安自动化网址:http://www.izhaorui.cn");
+ Console.WriteLine("苏州道安自动化网址:http://www.doan-tech.com");
Console.WriteLine($"Swagger地址:{url}/swagger/index.html");
Console.WriteLine($"初始化种子数据地址:{url}/common/InitSeedData");
}