南骏 池
10 天以前 2ed39b33a7f3dd6a7bd2e66b7ee5de78e00861f1
service/QC/OaApi.cs
@@ -23,9 +23,13 @@
public class OaApiService : Repository<dynamic>
{
    private readonly HttpClient _httpClient;
    private const string AppId = "303233EF-AC39-40C1-8364-AC989C6258A5";
    private const string BaseUrl = "http://192.168.1.149:8099/api/ec/dev/auth/";
    private const string WorkflowUrl = "http://192.168.1.149:8099/api/workflow/paService/doCreateRequest";
    //private const string AppId = "303233EF-AC39-40C1-8364-AC989C6258A5";
    //private const string BaseUrl = "http://192.168.1.149:8099/api/ec/dev/auth/";
    //private const string WorkflowUrl = "http://192.168.1.149:8099/api/workflow/paService/doCreateRequest";
    private const string AppId = "AB7F0461-89C3-4EAD-B5B5-B7D540617921";
    private const string BaseUrl = "http://192.168.1.20:80/api/ec/dev/auth/";
    private const string WorkflowUrl = "http://192.168.1.20:80/api/workflow/paService/doCreateRequest";
    public OaApiService()
    {
@@ -160,7 +164,7 @@
        {
            {"mainData", BuildMainData(queryObj)},
            {"requestName", $"IQC异常处置单流程-{DateTime.Now:yyyyMMddHHmmss}"},
            {"workflowId", "379"},
            {"workflowId", "600"},//测试:379 正式:600
            //{"otherParams", BuildOtherParams()},
            {"detailData", BuildDetailData(queryObj)}
        };
@@ -199,11 +203,15 @@
        // 字段映射配置(字段名 -> 数据库列名)
        var fieldMappings = new Dictionary<string, (string Field, string Default)>
        {
            ["sqr"] = ("sqr", "0"),       // 默认值改为数字
            ["sqrq"] = ("sqrq", ""),       // 空字符串用于日期格式化
            ["szbm"] = ("szbm", "0"),      // 默认值改为数字
            ["szdw"] = ("szdw", "0"),      // 默认值改为数字
            ["ycczdh"] = ("ycczdh", "N/A"),
            ["wlbm"] = ("wlbm", "N/A"),
            ["lh"] = ("lh", "N/A"),
            ["khgys"] = ("khgys", "N/A"),
            ["jzmcwlmc"] = ("jzmcwlmc", "N/A"),
            ["dhdhmes"] = ("dhdhmes", "N/A"),
            ["dhdhtxt"] = ("dhdhtxt", "N/A"),
            ["bhgpqxms"] = ("bhgpqxms", "无缺陷描述")
        };
@@ -211,7 +219,16 @@
        var result = new JArray();
        foreach (var mapping in fieldMappings)
        {
            var value = GetDynamicValue(firstRecord, mapping.Value.Field, mapping.Value.Default);
            var value = mapping.Key switch
            {
                "sqr" or "szbm" or "szdw" =>
                    int.TryParse(GetDynamicValue(firstRecord, mapping.Value.Field, mapping.Value.Default), out int num)
                        ? num : 0,
                "sqrq" => DateTime.TryParse(GetDynamicValue(firstRecord, mapping.Value.Field, ""), out DateTime date)
                    ? date.ToString("yyyy-MM-dd")
                    : DateTime.Now.ToString("yyyy-MM-dd"),
                _ => GetDynamicValue(firstRecord, mapping.Value.Field, mapping.Value.Default)
            };
            result.Add(new JObject
            {
                ["fieldName"] = mapping.Key,
@@ -406,7 +423,7 @@
        {
            new JObject
            {
                ["tableDBName"] = "formtable_main_33_dt1",
                ["tableDBName"] = "formtable_main_321_dt1",//测试:formtable_main_33_dt1
                ["workflowRequestTableRecords"] = tableRecords
            }
        };