分支自 SuZhouGuanHong/TaiYuanTaiZhong

huanghongfeng
2024-06-21 00e346af99d35244ee22d4e7cf268c0d1cfa18ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Microsoft.AspNetCore.Mvc;
using System.Linq;
using WIDESEA_Core.EFDbContext;
using WIDESEA_Core.Extensions;
using WIDESEA_WCS.IRepositories;
using WIDESEA_WCS.Repositories;
using WIDESEA_WMS.IRepositories;
using WIDESEA_WMS.Repositories;
 
namespace WIDESEA_WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ReadplcController : Controller
    {
        #region  第五板块(新增内容)
        /// <summary>
        /// 工单信息VV_Workinfo
        /// </summary>
        /// <returns></returns>
        [HttpPost("Workinfo_information")]
        public object Workinfo_information()
        {
            VOLContext volContext = new VOLContext();
            Idt_mes_headRepository db = new dt_mes_headRepository(volContext);
            Idt_mes_detailRepository dbs = new dt_mes_detailRepository(volContext);
            var data = db.Find(_ => true).Where(x => x.processCode == "28").OrderByDescending(x => x.CreateTime).Take(10).ToList();
            var dataList = data.Select(x => new {
                jobID = x.jobID,
                drawingNo = x.drawingNo,
                quantity = x.quantity,
                heatID = string.Join(", ", dbs.Find(d => d.jobID == x.jobID).Select(d => d.heatID).Distinct())
            }).ToList();
            return Ok(dataList);
        }
        #endregion
    }
}