xwt
4 天以前 db5e488203b05d785baf1614b727afaf20a03fe6
StandardInterface/MESApplication/Controllers/QC/LljController.cs
@@ -1,4 +1,4 @@
using System.Dynamic;
using System.Dynamic;
using MES.Service.Dto.service;
using MES.Service.Modes;
using MES.Service.service.QC;
@@ -294,9 +294,7 @@
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    //IqcQaSubmit
    }    //IqcQaSubmit
    [HttpPost("IqcQaSubmit")]
    public ResponseResult IqcQaSubmit(LLJDto rkjDto)
    {
@@ -305,6 +303,33 @@
            dynamic resultInfos = new ExpandoObject();
            var tbBillList =
                new LljService().IqcQaSubmit(rkjDto);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
                status = 0,
                message = "OK",
                data = resultInfos
            };
        }
        catch (Exception ex)
        {
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    /// 保存备注到主表
    /// </summary>
    [HttpPost("saveLotNo1")]
    public ResponseResult saveLotNo1([FromBody] JObject data)
    {
        var gid = Convert.ToDecimal(data["gid"].ToString());
        var releaseNo = data["releaseNo"]?.ToString();
        var lotNo1 = data["lotNo1"]?.ToString();
        try
        {
            dynamic resultInfos = new ExpandoObject();
            var tbBillList = new LljService().SaveLotNo1(gid, releaseNo, lotNo1);
            resultInfos.tbBillList = tbBillList;
            return new ResponseResult
            {
@@ -366,10 +391,21 @@
    public ResponseResult GetAttachments([FromBody] JObject data)
    {
        var itemNo = data["itemNo"]?.ToString();
        var fversion = data["fversion"]?.ToString();
        var fromPage = data["fromPage"]?.ToString();
        // 根据来源页面决定是否过滤
        string filterFversion = null;
        if (fromPage == "Detail" && !string.IsNullOrEmpty(fversion))
        {
            filterFversion = fversion;  // Detail页面需要过滤
        }
        // Add页面不传递filterFversion,显示所有附件
        try
        {
            dynamic resultInfos = new System.Dynamic.ExpandoObject();
            var tbBillList = new LljService().GetAttachments(itemNo);
            var tbBillList = new LljService().GetAttachments(itemNo, filterFversion);
            if (tbBillList == null || tbBillList.Count == 0)
            {
                return new ResponseResult
@@ -394,7 +430,7 @@
    }
    [HttpGet("PreviewFtpFile")]
    public IActionResult PreviewFtpFile([FromQuery] string itemNo, [FromQuery] string fileName, [FromQuery] string ftpServer)
    public IActionResult PreviewFtpFile([FromQuery] string itemNo, [FromQuery] string fileName, [FromQuery] string ftpServer, [FromQuery] string fversion = null)
    {
        try
        {
@@ -405,7 +441,7 @@
            Response.Headers.Add("Access-Control-Expose-Headers", "Content-Type, Content-Length");
            
            var service = new LljService();
            var fileBytes = service.GetFtpFile(itemNo, fileName, ftpServer);
            var fileBytes = service.GetFtpFile(itemNo, fileName, ftpServer, fversion);
            
            if (fileBytes == null || fileBytes.Length == 0)
            {
@@ -424,7 +460,7 @@
    }
    [HttpGet("DownloadFtpFile")]
    public IActionResult DownloadFtpFile([FromQuery] string itemNo, [FromQuery] string fileName, [FromQuery] string ftpServer)
    public IActionResult DownloadFtpFile([FromQuery] string itemNo, [FromQuery] string fileName, [FromQuery] string ftpServer, [FromQuery] string fversion = null)
    {
        try
        {
@@ -435,7 +471,7 @@
            Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition, Content-Length, Content-Type");
            
            var service = new LljService();
            var fileBytes = service.GetFtpFile(itemNo, fileName, ftpServer);
            var fileBytes = service.GetFtpFile(itemNo, fileName, ftpServer, fversion);
            
            if (fileBytes == null || fileBytes.Length == 0)
            {
@@ -559,10 +595,9 @@
                    data = null
                };
            }
            dynamic resultInfos = new System.Dynamic.ExpandoObject();
            var materialInfo = new LljService().GetMaterialByBarcode(data.itemBarcode, data.currentBillNo);
            if (materialInfo == null || materialInfo.Count == 0)
            {
                return new ResponseResult
@@ -572,7 +607,6 @@
                    data = null
                };
            }
            resultInfos.tbBillList = materialInfo;
            return new ResponseResult
            {
@@ -591,7 +625,6 @@
            };
        }
    }
    /// <summary>
    /// 查询破坏实验记录是否存在
    /// </summary>
@@ -611,7 +644,6 @@
                    data = null
                };
            }
            if (string.IsNullOrEmpty(data.releaseNo))
            {
                return new ResponseResult
@@ -621,12 +653,9 @@
                    data = null
                };
            }
            var exists = new LljService().CheckPhsyRecordExists(data.billNo, data.releaseNo);
            dynamic resultInfos = new System.Dynamic.ExpandoObject();
            resultInfos.exists = exists;
            return new ResponseResult
            {
                status = 0,
@@ -644,7 +673,6 @@
            };
        }
    }
    /// <summary>
    /// 调用破坏实验存储过程
    /// </summary>
@@ -664,7 +692,6 @@
                    data = null
                };
            }
            if (string.IsNullOrEmpty(data.billNo))
            {
                return new ResponseResult
@@ -674,7 +701,6 @@
                    data = null
                };
            }
            if (data.yqty <= 0)
            {
                return new ResponseResult
@@ -684,7 +710,6 @@
                    data = null
                };
            }
            if (data.cqty <= 0)
            {
                return new ResponseResult
@@ -694,7 +719,6 @@
                    data = null
                };
            }
            if (string.IsNullOrEmpty(data.releaseNo))
            {
                return new ResponseResult
@@ -704,20 +728,17 @@
                    data = null
                };
            }
            var (result, message) = new LljService().CallPhsyUpdateProcedure(
                data.itemBarcode,
                data.yqty,
                data.cqty,
                data.itemBarcode,
                data.yqty,
                data.cqty,
                data.billNo,
                data.lx,
                data.releaseNo,
                data.itemId);
            dynamic resultInfos = new System.Dynamic.ExpandoObject();
            resultInfos.result = result;
            resultInfos.message = message;
            return new ResponseResult
            {
                status = result,
@@ -735,7 +756,6 @@
            };
        }
    }
    public class GetWomdabRequest
    {
        public string daa001 { get; set; }
@@ -747,7 +767,6 @@
        public string itemBarcode { get; set; }
        public string currentBillNo { get; set; }
    }
    public class PhsyUpdateRequest
    {
        public string itemBarcode { get; set; }
@@ -758,13 +777,11 @@
        public string releaseNo { get; set; } // 检验单号
        public decimal? itemId { get; set; } // 物料ID
    }
    public class CheckPhsyRecordRequest
    {
        public string billNo { get; set; }
        public string releaseNo { get; set; }
    }
    [HttpPost("GetPhsyRecordInfo")]
    public ResponseResult GetPhsyRecordInfo([FromBody] CheckPhsyRecordRequest data)
    {
@@ -779,7 +796,6 @@
                    data = null
                };
            }
            if (string.IsNullOrEmpty(data.releaseNo))
            {
                return new ResponseResult
@@ -789,9 +805,7 @@
                    data = null
                };
            }
            var records = new LljService().GetPhsyRecordInfo(data.billNo, data.releaseNo);
            return new ResponseResult
            {
                status = 0,
@@ -809,7 +823,6 @@
            };
        }
    }
    /// <summary>
    /// 设置堵穴信息
    /// </summary>
@@ -829,7 +842,6 @@
                    data = null
                };
            }
            if (string.IsNullOrEmpty(data.blockedHoles))
            {
                return new ResponseResult
@@ -839,7 +851,6 @@
                    data = null
                };
            }
            if (data.itemId <= 0)
            {
                return new ResponseResult
@@ -849,9 +860,7 @@
                    data = null
                };
            }
            var (result, message) = new LljService().SetBlockedHoles(data.releaseNo, data.blockedHoles, data.itemId);
            return new ResponseResult
            {
                status = result,
@@ -869,8 +878,6 @@
            };
        }
    }
    public class SetBlockedHolesRequest
    {
        public string releaseNo { get; set; }