From 97a73035e8391fb60cdb26c00f7ff8b05296c68c Mon Sep 17 00:00:00 2001
From: zjh <2207896513@qq.com>
Date: 星期五, 07 三月 2025 15:12:22 +0800
Subject: [PATCH] 获取料号图纸接口代码完整提交
---
StandardPda/MESApplication/Controllers/QC/LljController.cs | 40 ++++++++++++-------
StandardPda/MES.Service/service/QC/LljService.cs | 51 +++++++++++++++++++++++++
2 files changed, 76 insertions(+), 15 deletions(-)
diff --git a/StandardPda/MES.Service/service/QC/LljService.cs b/StandardPda/MES.Service/service/QC/LljService.cs
index 4137734..34826a8 100644
--- a/StandardPda/MES.Service/service/QC/LljService.cs
+++ b/StandardPda/MES.Service/service/QC/LljService.cs
@@ -5,8 +5,12 @@
using MES.Service.Modes;
using MES.Service.util;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
+using Newtonsoft.Json;
using SqlSugar;
using DbType = System.Data.DbType;
+using System.Net.Http;
+using System.Threading.Tasks;
+
namespace MES.Service.service.QC;
@@ -651,4 +655,51 @@
throw new Exception(ex.Message);
}
}
+ /// <summary>
+ /// 鏂欏彿鍥剧焊鎺ュ彛杩斿洖瀵硅薄
+ /// </summary>
+ public class ApiResponse
+ {
+ [JsonProperty("status")]
+ public int Status { get; set; }
+ [JsonProperty("message")]
+ public string Message { get; set; }
+ [JsonProperty("data")]
+ public string[] Data { get; set; }
+ [JsonProperty("totalCount")]
+ public int TotalCount { get; set; }
+ }
+ private static readonly HttpClient client = new HttpClient();
+ /// <summary>
+ /// 浠嶶9鑾峰彇鏂欏彿鍥剧焊鍒楄〃
+ /// </summary>
+ /// <param name="Type">u9No锛歶9鐗╂枡缂栧彿</param>
+ /// <param name="U9No">type锛�1锛氬浘绾歌鏍间功 2锛氳繘鏂欐楠屾枃浠� </param>
+ /// <returns></returns>
+ /// <exception cref="Exception"></exception>
+ public async Task<string[]> GetFileUrlByU9List(string Type,string U9No)
+ {
+ try
+ {
+ var requestUrl = $"https://erp.dream-maker.com/api/public/getFileUrlByU9No?u9No={Uri.EscapeDataString(U9No)}&type={Type}";
+ var response = await client.GetAsync(requestUrl);
+ response.EnsureSuccessStatusCode(); // 妫�鏌TTP鐘舵�佺爜
+ var responseContent = await response.Content.ReadAsStringAsync();
+ var result = JsonConvert.DeserializeObject<ApiResponse>(responseContent);
+
+ if (result.Status == 0 && result.Data != null)
+ {
+ return result.Data;
+ }
+ else
+ {
+ return null;
+ }
+
+ }
+ catch (Exception ex)
+ {
+ throw new Exception(ex.Message);
+ }
+ }
}
\ No newline at end of file
diff --git a/StandardPda/MESApplication/Controllers/QC/LljController.cs b/StandardPda/MESApplication/Controllers/QC/LljController.cs
index f4c58c0..e5df8ef 100644
--- a/StandardPda/MESApplication/Controllers/QC/LljController.cs
+++ b/StandardPda/MESApplication/Controllers/QC/LljController.cs
@@ -273,27 +273,37 @@
return ResponseResult.ResponseError(ex);
}
}
+
//IqcQaSubmit
[HttpPost("GetFileUrlByU9List")]
- public ResponseResult GetFileUrlByU9List(LLJDto rkjDto)
+ public async Task<ResponseResult> GetFileUrlByU9List([FromBody] JObject data)
{
try
{
- //dynamic resultInfos = new ExpandoObject();
- //var tbBillList =
- // new LljService().IqcQaSubmit(rkjDto);
- //resultInfos.tbBillList = tbBillList;
- string[] fileUrls =
- {
- "https://new-service.oss-cn-hangzhou.aliyuncs.com/sheet-attachment/1728624575152_ty5VSi9R.png",
- "https://new-service.oss-cn-hangzhou.aliyuncs.com/sheet-attachment/1728624610583_EwIN55BL.pdf"
-};
- return new ResponseResult
+ var type = data["type"]?.ToString();
+ var itemID = data["u9No"]?.ToString();
+ dynamic resultInfos = new ExpandoObject();
+ var lljService = new LljService();
+ var tbBillList = await lljService.GetFileUrlByU9List(type, itemID);
+ if (tbBillList!=null)
{
- status = 0,
- message = "OK",
- data = fileUrls
- };
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = tbBillList
+ };
+ }
+ else
+ {
+ return new ResponseResult
+ {
+ status = 0,
+ message = "OK",
+ data = ""
+ };
+ }
+
}
catch (Exception ex)
{
--
Gitblit v1.9.3