This commit is contained in:
xiaowei.song
2024-06-11 17:04:49 +08:00
parent be0ce445a4
commit 95103397b1
15 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,137 @@
using Infrastructure.Extensions;
using JinianNet.JNTemplate;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Text.Json;
using ZR.Admin.WebApi.Extensions;
using ZR.Model.mes.pro;
using ZR.Model.MES.qc.DTO;
using ZR.Model.MES.ql;
using ZR.Model.MES.ql.DTO;
using ZR.Service.mes.pro;
using ZR.Service.mes.pro.IService;
using ZR.Service.mes.ql;
using ZR.Service.mes.ql.IService;
using ZR.Service.mes.qu.IService;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Admin.WebApi.Controllers.mes.ql
{
[Route("mes/ql/PaintLab")]
public class PainLab02Controller : BaseController
{
private readonly IPLTestService plTestService;
public PainLab02Controller(IPLTestService pltestservice)
{
this.plTestService = pltestservice;
}
/// <summary>
/// 获取测试数据
/// </summary>
/// <param name="starttime"></param>
/// <param name="endTime"></param>
/// <param name="pageNum"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
[HttpGet("gettestlist")]
public IActionResult GetTestlist(DateTime starttime, DateTime endTime, int pageNum, int pageSize)
{
starttime = starttime.AddHours(8);
endTime = endTime.AddHours(8);
// 时间要增加8个小时
(List<PLTest>, int) lst = plTestService.GetPLTestTable(starttime, endTime, pageNum, pageSize);
return ToResponse(new ApiResult(200, "success", lst));
}
/// <summary>
/// 增加测试数据记录
/// </summary>
/// <param name="num"></param>
/// <returns></returns>
[HttpGet("addtestlist")]
public IActionResult AddTestlist(int num)
{
int ret = plTestService.AddPLTestRecords(1, 5);
return ToResponse(new ApiResult(200, "success", ret));
}
/// <summary>
/// 删除测试数据记录
/// </summary>
/// <param name="idGroup"></param>
/// <returns></returns>
[HttpGet("deltestlist")]
public IActionResult DelTestlist(string idGroup)
{
int ret = plTestService.DelPLTestRecords(idGroup);
return ToResponse(new ApiResult(200, "success", ret));
}
/// <summary>
/// 更新测试数据记录
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
[HttpPost("updatetestlist")]
[Log(Title = "更新测试数据记录", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateTestlist([FromBody] List<PLTestDto> list)
{
List<PLTest> lstDest = new List<PLTest>();
foreach (PLTestDto dto in list)
{
lstDest.Add(ConvertDTO2PLTest(dto));
}
int ret = plTestService.UpdatePLTestRecords(lstDest);
return ToResponse(new ApiResult(200, "success", ret));
}
public PLTest ConvertDTO2PLTest(PLTestDto pLTestDto)
{
PLTest pLTest = new PLTest();
pLTest.Id = pLTestDto.Id;
pLTest.IdGroup = pLTestDto.plIdGroup;
pLTest.Code = pLTestDto.plCode;
pLTest.Dt = pLTestDto.plDt;
pLTest.Value01 = pLTestDto.plValue01;
pLTest.Value02 = pLTestDto.plValue02;
pLTest.Value03 = pLTestDto.plValue03;
pLTest.Value04 = pLTestDto.plValue04;
pLTest.Value05 = pLTestDto.plValue05;
pLTest.Value06 = pLTestDto.plValue06;
pLTest.Value07 = pLTestDto.plValue07;
pLTest.Value08 = pLTestDto.plValue08;
pLTest.Value09 = pLTestDto.plValue09;
pLTest.Value10 = pLTestDto.plValue10;
pLTest.Value11 = pLTestDto.plValue11;
pLTest.Value12 = pLTestDto.plValue12;
pLTest.Value13 = pLTestDto.plValue13;
pLTest.Value14 = pLTestDto.plValue14;
pLTest.Value15 = pLTestDto.plValue15;
pLTest.Value16 = pLTestDto.plValue16;
pLTest.CreatedBy = pLTestDto.plCreatedBy;
pLTest.UpdatedBy = pLTestDto.plUpdatedBy;
try
{
pLTest.CreatedTime = Convert.ToDateTime(pLTestDto.plCreatedTime);
pLTest.UpdatedTime = Convert.ToDateTime(pLTestDto.plUpdatedTime);
}
catch { }
return pLTest;
}
}
}

View File

@@ -0,0 +1,140 @@
using Infrastructure.Extensions;
using JinianNet.JNTemplate;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Text.Json;
using ZR.Admin.WebApi.Extensions;
using ZR.Model.mes.pro;
using ZR.Model.MES.qc.DTO;
using ZR.Model.MES.ql;
using ZR.Model.MES.ql.DTO;
using ZR.Service.mes.pro;
using ZR.Service.mes.pro.IService;
using ZR.Service.mes.ql;
using ZR.Service.mes.ql.IService;
using ZR.Service.mes.qu.IService;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Admin.WebApi.Controllers.mes.ql
{
[Route("mes/ql/PaintLab")]
public class PainLab03Controller : BaseController
{
private readonly IPLBatchService plBatchService;
public PainLab03Controller(IPLBatchService plbatchservice)
{
this.plBatchService = plbatchservice;
}
/// <summary>
/// 获取批处理数据
/// </summary>
/// <param name="starttime"></param>
/// <param name="endTime"></param>
/// <param name="pageNum"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
[HttpGet("getbatchlist")]
public IActionResult GetBatchlist(DateTime starttime, DateTime endTime, int pageNum, int pageSize)
{
starttime = starttime.AddHours(8);
endTime = endTime.AddHours(8);
// 时间要增加8个小时
(List<PLBatch>, int) lst = plBatchService.GetPLBatchTable(starttime, endTime, pageNum, pageSize);
return ToResponse(new ApiResult(200, "success", lst));
}
/// <summary>
/// 增加批处理数据记录
/// </summary>
/// <param name="num"></param>
/// <returns></returns>
[HttpGet("addbatchlist")]
public IActionResult AddBatchlist(int num)
{
int ret = plBatchService.AddPLBatchRecords(1, 5);
return ToResponse(new ApiResult(200, "success", ret));
}
/// <summary>
/// 删除测试数据记录
/// </summary>
/// <param name="idGroup"></param>
/// <returns></returns>
[HttpGet("delbatchlist")]
public IActionResult DelBatchlist(string idGroup)
{
int ret = plBatchService.DelPLBatchRecords(idGroup);
return ToResponse(new ApiResult(200, "success", ret));
}
/// <summary>
/// 更新批处理数据记录
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
[HttpPost("updatebatchlist")]
[Log(Title = "更新批处理数据记录", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateTestlist([FromBody] List<PLBatchDto> list)
{
List<PLBatch> lstDest = new List<PLBatch>();
foreach (PLBatchDto dto in list)
{
lstDest.Add(ConvertDTO2PLBatch(dto));
}
int ret = plBatchService.UpdatePLBatchRecords(lstDest);
return ToResponse(new ApiResult(200, "success", ret));
}
public PLBatch ConvertDTO2PLBatch(PLBatchDto pLBatchDto)
{
PLBatch pLBatch = new PLBatch();
pLBatch.Id = pLBatchDto.Id;
pLBatch.IdGroup = pLBatchDto.plIdGroup;
pLBatch.Code = pLBatchDto.plCode;
pLBatch.Dt = pLBatchDto.plDt;
pLBatch.Value01 = pLBatchDto.plValue01;
pLBatch.Value02 = pLBatchDto.plValue02;
pLBatch.Value03 = pLBatchDto.plValue03;
pLBatch.Value04 = pLBatchDto.plValue04;
pLBatch.Value05 = pLBatchDto.plValue05;
pLBatch.Value06 = pLBatchDto.plValue06;
pLBatch.Value07 = pLBatchDto.plValue07;
pLBatch.Value08 = pLBatchDto.plValue08;
pLBatch.Value09 = pLBatchDto.plValue09;
pLBatch.Value10 = pLBatchDto.plValue10;
pLBatch.Value11 = pLBatchDto.plValue11;
pLBatch.Value12 = pLBatchDto.plValue12;
pLBatch.Value13 = pLBatchDto.plValue13;
pLBatch.Value14 = pLBatchDto.plValue14;
pLBatch.Value15 = pLBatchDto.plValue15;
pLBatch.Value16 = pLBatchDto.plValue16;
pLBatch.Value17 = pLBatchDto.plValue17;
pLBatch.Value18 = pLBatchDto.plValue18;
pLBatch.Value19 = pLBatchDto.plValue19;
pLBatch.CreatedBy = pLBatchDto.plCreatedBy;
pLBatch.UpdatedBy = pLBatchDto.plUpdatedBy;
try
{
pLBatch.CreatedTime = Convert.ToDateTime(pLBatchDto.plCreatedTime);
pLBatch.UpdatedTime = Convert.ToDateTime(pLBatchDto.plUpdatedTime);
}
catch { }
return pLBatch;
}
}
}

View File

@@ -0,0 +1,132 @@
using Aliyun.OSS;
using Infrastructure.Extensions;
using JinianNet.JNTemplate;
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Text.Json;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model.mes.pro;
using ZR.Model.MES.qc;
using ZR.Model.MES.ql.DTO;
using ZR.Model.MES.ql;
using ZR.Service.mes.pro;
using ZR.Service.mes.pro.IService;
using ZR.Service.mes.ql.IService;
using ZR.Service.mes.qu.IService;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace ZR.Admin.WebApi.Controllers.mes.ql
{
[Route("mes/ql/PaintLab")]
public class PainLabController : BaseController
{
private readonly IPLRawMaterialService plRawMaterialService;
public PainLabController(IPLRawMaterialService plrawmaterialservice)
{
this.plRawMaterialService = plrawmaterialservice;
}
/// <summary>
/// 查询原材料记录表
/// </summary>
/// <param name="starttime"></param>
/// <param name="endTime"></param>
/// <param name="pageNum"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
[HttpGet("getrawmateriallist")]
public IActionResult GetRawMateriallist(DateTime starttime, DateTime endTime, int pageNum, int pageSize)
{
starttime = starttime.AddHours(8);
endTime = endTime.AddHours(8);
// 时间要增加8个小时
(List<PLRawMaterial>, int) lst = plRawMaterialService.GetRawMaterialTable(starttime, endTime, pageNum, pageSize);
return ToResponse(new ApiResult(200, "success", lst));
}
/// <summary>
/// 增加原材料记录
/// </summary>
/// <param name="num"></param>
/// <returns></returns>
[HttpGet("addrawmateriallist")]
public IActionResult AddRawMateriallist(int num)
{
int ret = plRawMaterialService.AddRawMaterialRecords(1, 5);
return ToResponse(new ApiResult(200, "success", ret));
}
/// <summary>
/// 删除原材料记录
/// </summary>
/// <param name="idGroup"></param>
/// <returns></returns>
[HttpGet("delrawmateriallist")]
public IActionResult DelRawMateriallist(string idGroup)
{
int ret = plRawMaterialService.DelRawMaterialRecords(idGroup);
return ToResponse(new ApiResult(200, "success", ret));
}
/// <summary>
/// 更新原材料记录
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
[HttpPost("updaterawmateriallist")]
[Log(Title = "更新原材料记录", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateRawMateriallist([FromBody] List<PLRawMaterialDto> list)
{
List<PLRawMaterial> lstDest = new List<PLRawMaterial>();
foreach (PLRawMaterialDto dto in list)
{
lstDest.Add(ConvertDTO2PLRawMaterial(dto));
}
int ret = plRawMaterialService.UpdateRawMaterialRecords(lstDest);
return ToResponse(new ApiResult(200, "success", ret));
}
public PLRawMaterial ConvertDTO2PLRawMaterial(PLRawMaterialDto pLRawMaterialDto)
{
PLRawMaterial pLRawMaterial = new PLRawMaterial();
pLRawMaterial.Id = pLRawMaterialDto.Id;
pLRawMaterial.IdGroup = pLRawMaterialDto.plIdGroup;
pLRawMaterial.Code = pLRawMaterialDto.plCode;
pLRawMaterial.Pci = pLRawMaterialDto.plPci;
pLRawMaterial.Value01 = pLRawMaterialDto.plValue01;
pLRawMaterial.Value02 = pLRawMaterialDto.plValue02;
pLRawMaterial.Value03 = pLRawMaterialDto.plValue03;
pLRawMaterial.Value04 = pLRawMaterialDto.plValue04;
pLRawMaterial.Value05 = pLRawMaterialDto.plValue05;
pLRawMaterial.Value06 = pLRawMaterialDto.plValue06;
pLRawMaterial.Value07 = pLRawMaterialDto.plValue07;
pLRawMaterial.Value08 = pLRawMaterialDto.plValue08;
pLRawMaterial.Value09 = pLRawMaterialDto.plValue09;
pLRawMaterial.Value10 = pLRawMaterialDto.plValue10;
pLRawMaterial.Value11 = pLRawMaterialDto.plValue11;
pLRawMaterial.CreatedBy = pLRawMaterialDto.plCreatedBy;
pLRawMaterial.UpdatedBy = pLRawMaterialDto.plUpdatedBy;
try
{
pLRawMaterial.CreatedTime = Convert.ToDateTime(pLRawMaterialDto.plCreatedTime);
pLRawMaterial.UpdatedTime = Convert.ToDateTime(pLRawMaterialDto.plUpdatedTime);
}
catch { }
return pLRawMaterial;
}
}
}