zs
2025-05-05 25750ab29ce4e243f4e4e17a796167f3a0f0697b
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
39
40
41
42
43
44
45
46
47
48
49
 
 
using GenerateCode_WeiBen_WMS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace GenerateCode_GEBrilliantFactory
{
    /// <summary>
    /// 生成查询实体类
    /// </summary>
    public class AppService_Generate : BaseGenerate
    {
        public static string CreateText(GenerateCodeParam param)
        {
            var str = TextHelper.ReadText(@"Templete\AppService\AppService模板.txt");
            CommonReplace(ref str);
 
            CommonHelper.CommonReplaceStr(param, ref str);
 
            string attrString = "";
            List<ColumnModel> newColumnNameList = ListHelper.RemoveAttrForExport(param.ColumnNameList);
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForUpdateModel(newColumnNameList[i], param);
            }
            str = str.Replace("$UpdateAttributes$", attrString);
 
            attrString = "";
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForUpdateModelByImport(newColumnNameList[i], param);
            }
            str = str.Replace("$UpdateAttributesForImport$", attrString);
 
            attrString = "";
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForCheckCreateOrUpdateDtoAsync(newColumnNameList[i], param);
            }
            str = str.Replace("$UpdateAttributesForCheckCreateOrUpdateDtoAsync$", attrString);
 
            
            return str;
        }
    }
}