成品检验
This commit is contained in:
parent
b75378c493
commit
80c122558f
@ -0,0 +1,108 @@
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
using DOAN.Service.MES.quality.FQC.IService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//创建时间:2024-10-10
|
||||
namespace DOAN.WebApi.Controllers.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别
|
||||
/// </summary>
|
||||
//[Verify]
|
||||
[Route("mes/qualityManagement/FQC/QcDefectConfig")]
|
||||
public class QcDefectConfigController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别接口
|
||||
/// </summary>
|
||||
private readonly IQcDefectConfigService _QcDefectConfigService;
|
||||
|
||||
public QcDefectConfigController(IQcDefectConfigService QcDefectConfigService)
|
||||
{
|
||||
_QcDefectConfigService = QcDefectConfigService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询缺陷类别列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectconfig:list")]
|
||||
public IActionResult QueryQcDefectConfig([FromQuery] QcDefectConfigQueryDto parm)
|
||||
{
|
||||
var response = _QcDefectConfigService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询缺陷类别详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectconfig:query")]
|
||||
public IActionResult GetQcDefectConfig(int Id)
|
||||
{
|
||||
var response = _QcDefectConfigService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<QcDefectConfig>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加缺陷类别
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectconfig:add")]
|
||||
[Log(Title = "缺陷类别", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddQcDefectConfig([FromBody] QcDefectConfigDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<QcDefectConfig>().ToCreate(HttpContext);
|
||||
|
||||
var response = _QcDefectConfigService.AddQcDefectConfig(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新缺陷类别
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectconfig:edit")]
|
||||
[Log(Title = "缺陷类别", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateQcDefectConfig([FromBody] QcDefectConfigDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<QcDefectConfig>().ToUpdate(HttpContext);
|
||||
var response = _QcDefectConfigService.UpdateQcDefectConfig(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除缺陷类别
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectconfig:delete")]
|
||||
[Log(Title = "缺陷类别", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteQcDefectConfig(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _QcDefectConfigService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
using DOAN.Service.MES.quality.FQC.IService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
//创建时间:2024-10-10
|
||||
namespace DOAN.WebApi.Controllers.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 成品检验 缺陷收集
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
[Route("mes/qualityManagement/FQC/QcFinishedproductDefect")]
|
||||
public class QcFinishedproductDefectController : BaseController
|
||||
{
|
||||
private readonly IQcFinishedproductDefectService qcFinishedproductDefectService;
|
||||
public QcFinishedproductDefectController(IQcFinishedproductDefectService qcFinishedproductDefectService)
|
||||
{
|
||||
this.qcFinishedproductDefectService = qcFinishedproductDefectService;
|
||||
}
|
||||
|
||||
|
||||
//TODO 增加 缺陷数
|
||||
[HttpGet("add_defect_num")]
|
||||
public IActionResult AddDefectNum(string WorkOrder, string DefectCode)
|
||||
{
|
||||
if (string.IsNullOrEmpty(WorkOrder) || string.IsNullOrEmpty(DefectCode))
|
||||
{
|
||||
throw new CustomException("WorkOrder为空||DefectCode为空");
|
||||
}
|
||||
var response = qcFinishedproductDefectService.AddDefectNum(WorkOrder, DefectCode);
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
|
||||
//TODO 修改缺陷数
|
||||
[HttpGet("update_defect_num")]
|
||||
public IActionResult UpdateDefectNum(string WorkOrder, string DefectCode, int num)
|
||||
{
|
||||
if (string.IsNullOrEmpty(WorkOrder) || string.IsNullOrEmpty(DefectCode))
|
||||
{
|
||||
throw new CustomException("WorkOrder为空||DefectCode为空");
|
||||
}
|
||||
var response = qcFinishedproductDefectService.UpdateDefectNum(WorkOrder, DefectCode, num);
|
||||
return SUCCESS(response);
|
||||
|
||||
}
|
||||
|
||||
//TODO 查询指定工单下的缺陷
|
||||
[HttpGet("search_defects")]
|
||||
public IActionResult SearchDefectList(string WorkOrder)
|
||||
{
|
||||
if (string.IsNullOrEmpty(WorkOrder) )
|
||||
{
|
||||
throw new CustomException("WorkOrder为空");
|
||||
}
|
||||
var response = qcFinishedproductDefectService.SearchDefectList(WorkOrder);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -12,4 +12,8 @@
|
||||
<PackageReference Include="SqlSugarCoreNoDrive" Version="5.1.4.169" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="MES\Quality\FQC\Dto\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 成品缺陷
|
||||
/// </summary>
|
||||
[SugarTable("qc_finishedproduct_defect_collection")]
|
||||
public class QcFinishedproductDefectCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// 雪花
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单号
|
||||
/// </summary>
|
||||
public string Workorder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缺陷描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "defect_code")]
|
||||
public string DefectCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
/// </summary>
|
||||
public int? Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CreatedBy
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CreatedTime
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_time")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UpdatedBy
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// UpdatedTime
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_time")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
126
DOAN.Model/MES/Quality/IPQC/Dto/QcDefectCollectionDto.cs
Normal file
126
DOAN.Model/MES/Quality/IPQC/Dto/QcDefectCollectionDto.cs
Normal file
@ -0,0 +1,126 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.MES.quality.IPQC.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 缺陷收集查询对象
|
||||
/// </summary>
|
||||
public class QcDefectCollectionQueryDto : PagerInfo
|
||||
{
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
public int? Tqm { get; set; }
|
||||
|
||||
public int? Type { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缺陷收集输入输出对象
|
||||
/// </summary>
|
||||
public class QcDefectCollectionDto
|
||||
{
|
||||
[Required(ErrorMessage = "id不能为空")] public string Id { get; set; }
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品编码
|
||||
/// </summary>
|
||||
|
||||
public string ProductCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
|
||||
public string ProductName { get; set; }
|
||||
|
||||
public string BatchNumber { get; set; }
|
||||
|
||||
public string Unit { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 供应商编码
|
||||
/// </summary>
|
||||
|
||||
public string SupplierCode { get; set; }
|
||||
|
||||
public string SupplierName { get; set; }
|
||||
|
||||
public decimal PlanNum { get; set; }
|
||||
|
||||
public decimal ActualNum { get; set; }
|
||||
|
||||
public decimal Quantity { get; set; }
|
||||
|
||||
public string ProcessName { get; set; }
|
||||
|
||||
public string Superintendent { get; set; }
|
||||
|
||||
public string DefectDescription { get; set; }
|
||||
|
||||
public int? Tqm { get; set; }
|
||||
public int? Type { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 报损单
|
||||
/// </summary>
|
||||
public class QcDefectCollectionQueryDto2 : PagerInfo
|
||||
{
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
//public int? Tqm { get; set; }
|
||||
|
||||
public int? Type { get; set; }
|
||||
|
||||
public string SupplierCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商名称
|
||||
/// </summary>
|
||||
public string SupplierName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品编码
|
||||
/// </summary>
|
||||
|
||||
public string ProductCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
|
||||
public string ProductName { get; set; }
|
||||
}
|
||||
152
DOAN.Model/MES/Quality/IPQC/QcDefectCollection.cs
Normal file
152
DOAN.Model/MES/Quality/IPQC/QcDefectCollection.cs
Normal file
@ -0,0 +1,152 @@
|
||||
namespace DOAN.Model.MES.quality.IPQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷收集
|
||||
/// </summary>
|
||||
[SugarTable("qc_defect_collection")]
|
||||
public class QcDefectCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 线别
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "line_code")]
|
||||
public string LineCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "date_time")]
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 原材料编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "material_code")]
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 原材料名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "material_name")]
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "product_code")]
|
||||
public string ProductCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "product_name")]
|
||||
public string ProductName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "batch_number")]
|
||||
public string BatchNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
|
||||
|
||||
public string Specification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "supplier_code")]
|
||||
public string SupplierCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "supplier_name")]
|
||||
public string SupplierName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 计划数量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "plan_num")]
|
||||
public decimal PlanNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实际数量
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "actual_num")]
|
||||
public decimal ActualNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缺陷数量
|
||||
/// </summary>
|
||||
public decimal Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "process_name")]
|
||||
public string ProcessName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 负责人
|
||||
/// </summary>
|
||||
public string Superintendent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 缺陷描述
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "defect_description")]
|
||||
public string DefectDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 5M1E(1-人 2-机 3-料 4-法 5-环 6-测)
|
||||
/// </summary>
|
||||
public int? Tqm { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 1:报损单 2:索赔单
|
||||
/// </summary>
|
||||
public int? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
}
|
||||
}
|
||||
47
DOAN.Model/MES/Quality/IQC/Dto/QcDefectConfigDto.cs
Normal file
47
DOAN.Model/MES/Quality/IQC/Dto/QcDefectConfigDto.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DOAN.Model.MES.quality.IQC.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别查询对象
|
||||
/// </summary>
|
||||
public class QcDefectConfigQueryDto : PagerInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string Group { get; set; }
|
||||
public string QcType { get; set; }
|
||||
public string Status { get; set; }
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缺陷类别输入输出对象
|
||||
/// </summary>
|
||||
public class QcDefectConfigDto
|
||||
{
|
||||
[Required(ErrorMessage = "主键不能为空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public string Group { get; set; }
|
||||
|
||||
public string QcType { get; set; }
|
||||
|
||||
public string Status { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
66
DOAN.Model/MES/Quality/IQC/QcDefectConfig.cs
Normal file
66
DOAN.Model/MES/Quality/IQC/QcDefectConfig.cs
Normal file
@ -0,0 +1,66 @@
|
||||
namespace DOAN.Model.MES.quality.IQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别
|
||||
/// </summary>
|
||||
[SugarTable("qc_defect_config")]
|
||||
public class QcDefectConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编号
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 组
|
||||
/// </summary>
|
||||
public string Group { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质检类别(FQC,IPQC,IQC)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "qc_type")]
|
||||
public string QcType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生效
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_BY")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "cREATED_TIME")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_BY")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "uPDATED_TIME")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
36
DOAN.Model/Mobile/Dto/CheckMaterialDto.cs
Normal file
36
DOAN.Model/Mobile/Dto/CheckMaterialDto.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.Mobile.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 校验物料是否在指定线和日期内
|
||||
/// </summary>
|
||||
public class CheckMaterialDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料清单
|
||||
/// </summary>
|
||||
public string[] MatetialCodeArray { get; set; }
|
||||
/// <summary>
|
||||
/// 线别
|
||||
/// </summary>
|
||||
public string LineCode { get; set; }
|
||||
/// <summary>
|
||||
/// 指定日期
|
||||
/// </summary>
|
||||
public DateTime HandelDate { get; set; }
|
||||
|
||||
}
|
||||
public class CheckMaterialResult
|
||||
{
|
||||
public string MatetialCode { get; set; }
|
||||
|
||||
public bool result { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
42
DOAN.Model/Mobile/Dto/MaterialModel.cs
Normal file
42
DOAN.Model/Mobile/Dto/MaterialModel.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.Mobile.Dto
|
||||
{
|
||||
public class MaterialModel
|
||||
{
|
||||
public string Partnumber { get; set; }
|
||||
|
||||
public string MaterialName { get; set; }
|
||||
public string Batchnumber { get; set; }
|
||||
|
||||
public float quantity { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 颜色
|
||||
/// </summary>
|
||||
public string Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格型号
|
||||
/// </summary>
|
||||
public string Specification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计量单位
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
56
DOAN.Model/Mobile/Dto/MobileTask.cs
Normal file
56
DOAN.Model/Mobile/Dto/MobileTask.cs
Normal file
@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Model.Mobile.Dto
|
||||
{
|
||||
public class IngredientTaskRequestForm
|
||||
{
|
||||
|
||||
public List<MobileTaskDto> Ingredient_task { get; set; }
|
||||
|
||||
public string workorder { get; set; }
|
||||
|
||||
|
||||
}
|
||||
public class IngredientTaskRequestForm2
|
||||
{
|
||||
|
||||
public List<MobileTaskDto> Ingredient_task { get; set; }
|
||||
|
||||
public string lineCode { get; set; }
|
||||
public DateTime HandleDate { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class MobileTaskDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料code
|
||||
/// </summary>
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格型号
|
||||
/// </summary>
|
||||
public string Specification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配料数量
|
||||
/// </summary>
|
||||
public decimal Quantity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
|
||||
namespace DOAN.Service.MES.quality.FQC.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别service接口
|
||||
/// </summary>
|
||||
public interface IQcDefectConfigService : IBaseService<QcDefectConfig>
|
||||
{
|
||||
PagedInfo<QcDefectConfigDto> GetList(QcDefectConfigQueryDto parm);
|
||||
|
||||
QcDefectConfig GetInfo(int Id);
|
||||
|
||||
QcDefectConfig AddQcDefectConfig(QcDefectConfig parm);
|
||||
|
||||
int UpdateQcDefectConfig(QcDefectConfig parm);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
using DOAN.Model.MES.quality.FQC;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DOAN.Service.MES.quality.FQC.IService
|
||||
{
|
||||
public interface IQcFinishedproductDefectService
|
||||
{
|
||||
bool AddDefectNum(string WorkOrder,string name);
|
||||
bool UpdateDefectNum(string WorkOrder,string name,int num);
|
||||
List<QcFinishedproductDefectCollection> SearchDefectList(string WorkOrder);
|
||||
}
|
||||
}
|
||||
87
DOAN.Service/MES/Quality/FQC/QcDefectConfigService.cs
Normal file
87
DOAN.Service/MES/Quality/FQC/QcDefectConfigService.cs
Normal file
@ -0,0 +1,87 @@
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.MES.quality.FQC.IService;
|
||||
using Infrastructure.Attribute;
|
||||
|
||||
namespace DOAN.Service.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 缺陷类别Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IQcDefectConfigService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class QcDefectConfigService : BaseService<QcDefectConfig>, IQcDefectConfigService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询缺陷类别列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<QcDefectConfigDto> GetList(QcDefectConfigQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<QcDefectConfig>()
|
||||
.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.Group), it => it.Group.Contains(parm.Group))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.QcType), it => it.QcType.Contains(parm.QcType))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Status), it => it.Status == parm.Status);
|
||||
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<QcDefectConfig, QcDefectConfigDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public QcDefectConfig GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加缺陷类别
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public QcDefectConfig AddQcDefectConfig(QcDefectConfig model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改缺陷类别
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateQcDefectConfig(QcDefectConfig model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new QcDefectConfig()
|
||||
//{
|
||||
// Name = model.Name,
|
||||
// Code = model.Code,
|
||||
// Group = model.Group,
|
||||
// QcType = model.QcType,
|
||||
// Status = model.Status,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.quality.FQC;
|
||||
using DOAN.Model.MES.quality.IQC;
|
||||
using DOAN.Model.MES.quality.IQC.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.MES.quality.FQC.IService;
|
||||
using Infrastructure.Attribute;
|
||||
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
|
||||
|
||||
namespace DOAN.Service.MES.quality.FQC
|
||||
{
|
||||
/// <summary>
|
||||
/// 成品缺陷收集 Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IQcFinishedproductDefectService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class QcFinishedproductDefectService : BaseService<QcFinishedproductDefectCollection>, IQcFinishedproductDefectService
|
||||
{
|
||||
public bool AddDefectNum(string WorkOrder, string DefectCode)
|
||||
{
|
||||
int flag = 0;
|
||||
|
||||
// 检查 Workorder 是否存在
|
||||
var existingRecord = Context.Queryable<QcFinishedproductDefectCollection>()
|
||||
.Where(it => it.Workorder == WorkOrder)
|
||||
.Where(it => it.DefectCode == DefectCode)
|
||||
.First();
|
||||
|
||||
if (existingRecord != null)
|
||||
{
|
||||
// 更新 Number 字段
|
||||
flag = Context.Updateable<QcFinishedproductDefectCollection>()
|
||||
.SetColumns(it => new QcFinishedproductDefectCollection
|
||||
{
|
||||
Number = it.Number + 1,
|
||||
UpdatedTime = DateTime.Now
|
||||
})
|
||||
.Where(it => it.Workorder == WorkOrder)
|
||||
.Where(it => it.DefectCode == DefectCode)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 插入新记录
|
||||
QcFinishedproductDefectCollection qcFinishedproductDefect = new QcFinishedproductDefectCollection();
|
||||
qcFinishedproductDefect.Id = XueHua;
|
||||
qcFinishedproductDefect.Workorder = WorkOrder;
|
||||
qcFinishedproductDefect.DefectCode = DefectCode;
|
||||
qcFinishedproductDefect.CreatedTime = DateTime.Now;
|
||||
qcFinishedproductDefect.UpdatedTime = DateTime.Now;
|
||||
qcFinishedproductDefect.Number = 1;
|
||||
flag = Context.Insertable(qcFinishedproductDefect).ExecuteCommand();
|
||||
}
|
||||
|
||||
return flag > 0 ? true : false;
|
||||
}
|
||||
|
||||
|
||||
public bool UpdateDefectNum(string WorkOrder, string DefectCode, int num)
|
||||
{
|
||||
int flag = 0;
|
||||
|
||||
flag = Context.Updateable<QcFinishedproductDefectCollection>()
|
||||
.SetColumns(it => new QcFinishedproductDefectCollection
|
||||
{
|
||||
Number = num,
|
||||
UpdatedTime = DateTime.Now
|
||||
})
|
||||
.Where(it => it.Workorder == WorkOrder)
|
||||
.Where(it => it.DefectCode == DefectCode)
|
||||
.ExecuteCommand();
|
||||
return flag > 0 ? true : false;
|
||||
}
|
||||
|
||||
public List<QcFinishedproductDefectCollection> SearchDefectList(string WorkOrder)
|
||||
{
|
||||
return Context.Queryable<QcFinishedproductDefectCollection>().Where(it => it.Workorder == WorkOrder).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user