|
|
@@ -8,6 +8,7 @@ using System.Security.Claims;
|
|
8
|
8
|
using System.Threading.Tasks;
|
|
9
|
9
|
using Microsoft.AspNetCore.Authorization;
|
|
10
|
10
|
using Microsoft.AspNetCore.Mvc;
|
|
|
11
|
+using SqlSugar;
|
|
11
|
12
|
|
|
12
|
13
|
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
|
13
|
14
|
|
|
|
@@ -38,23 +39,18 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
38
|
39
|
/// <param name="input"></param>
|
|
39
|
40
|
/// <returns></returns>
|
|
40
|
41
|
[HttpPost("add")]
|
|
41
|
|
- public async Task<IActionResult> AddAsync(int start, int getpercent, int getday, int startdebit, int debitpercent)
|
|
|
42
|
+ public async Task<IActionResult> AddAsync(int type, int vipid, string toperson, string notifyperson,string notice)
|
|
42
|
43
|
{
|
|
43
|
44
|
|
|
44
|
45
|
var model = new T_Cus_Msg();
|
|
45
|
|
- model.F_Type = start;
|
|
46
|
|
- model.F_VipInfoID = getpercent;
|
|
47
|
|
- model.F_ToPerson = "";
|
|
|
46
|
+ model.F_Type = 1;
|
|
|
47
|
+ model.F_VipInfoID = vipid;
|
|
|
48
|
+ model.F_ToPerson = toperson;
|
|
48
|
49
|
model.F_State = 0;
|
|
49
|
|
- model.F_NotifyPerson = "";
|
|
|
50
|
+ model.F_Notice = notice;
|
|
|
51
|
+ model.F_NotifyPerson = notifyperson;
|
|
50
|
52
|
model.F_CreateBy = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Sid).Value;
|
|
51
|
53
|
model.F_CreateOn = DateTime.Now;
|
|
52
|
|
-
|
|
53
|
|
- //if (await _cus_score_setRepository.GetCount(x => x.F_Name == input.name) > 0)
|
|
54
|
|
- //{
|
|
55
|
|
- // return Error("添加失败,存在相同标签信息");
|
|
56
|
|
- //}
|
|
57
|
|
-
|
|
58
|
54
|
var res = await _cus_msgRepository.Add(model);
|
|
59
|
55
|
if (res > 0)
|
|
60
|
56
|
{
|
|
|
@@ -66,5 +62,59 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
66
|
62
|
}
|
|
67
|
63
|
|
|
68
|
64
|
}
|
|
|
65
|
+
|
|
|
66
|
+ /// <summary>
|
|
|
67
|
+ /// 获取列表分页
|
|
|
68
|
+ /// </summary>
|
|
|
69
|
+ /// <param name="keyword"></param>
|
|
|
70
|
+ /// <param name="pageindex"></param>
|
|
|
71
|
+ /// <param name="pagesize"></param>
|
|
|
72
|
+ /// <returns></returns>
|
|
|
73
|
+ [HttpGet("getlistbypage")]
|
|
|
74
|
+ public async Task<IActionResult> GetListsByPageAsync(int getstate,string tousercode, string fromusercode, int type,int pageindex = 1, int pagesize = 20)//getstate传0时获取全部,传1时获取未处理,传2时获取已处理
|
|
|
75
|
+ {
|
|
|
76
|
+ List<IConditionalModel> conModels = new List<IConditionalModel>();
|
|
|
77
|
+ #region 条件筛选
|
|
|
78
|
+ if (getstate == 1)
|
|
|
79
|
+ {
|
|
|
80
|
+ conModels.Add(new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal, FieldValue = getstate.ToString() });
|
|
|
81
|
+ }
|
|
|
82
|
+ else if (getstate == 2)
|
|
|
83
|
+ {
|
|
|
84
|
+ conModels.Add(new ConditionalCollections()
|
|
|
85
|
+ {
|
|
|
86
|
+ ConditionalList = new List<KeyValuePair<WhereType, ConditionalModel>>()
|
|
|
87
|
+ {
|
|
|
88
|
+ new KeyValuePair<WhereType, ConditionalModel>(WhereType.And, new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal, FieldValue = "2" }),
|
|
|
89
|
+ new KeyValuePair<WhereType, ConditionalModel>( WhereType.Or , new ConditionalModel() { FieldName = "F_State", ConditionalType = ConditionalType.Equal, FieldValue = "3" })
|
|
|
90
|
+
|
|
|
91
|
+ }
|
|
|
92
|
+ });
|
|
|
93
|
+ }
|
|
|
94
|
+ if (!string.IsNullOrEmpty(tousercode))
|
|
|
95
|
+ {
|
|
|
96
|
+ conModels.Add(new ConditionalModel() { FieldName = "F_ToPerson", ConditionalType = ConditionalType.Equal , FieldValue = tousercode });
|
|
|
97
|
+ }
|
|
|
98
|
+ if (!string.IsNullOrEmpty(fromusercode))
|
|
|
99
|
+ {
|
|
|
100
|
+ conModels.Add(new ConditionalModel() { FieldName = "F_CreateBy", ConditionalType = ConditionalType.Equal, FieldValue = fromusercode });
|
|
|
101
|
+ }
|
|
|
102
|
+ //if (!string.IsNullOrEmpty(keyword))
|
|
|
103
|
+ //{
|
|
|
104
|
+ // conModels.Add(new ConditionalModel() { FieldName = "F_Name", ConditionalType = ConditionalType.Like, FieldValue = keyword });
|
|
|
105
|
+ //}
|
|
|
106
|
+
|
|
|
107
|
+ #endregion
|
|
|
108
|
+ int recordCount = 0;
|
|
|
109
|
+ var list = await _cus_msgRepository.GetListByPage(conModels, new MyPageModel() { PageIndex = pageindex, PageSize = pagesize, PageCount = recordCount });
|
|
|
110
|
+ var obj = new
|
|
|
111
|
+ {
|
|
|
112
|
+ state = "success",
|
|
|
113
|
+ message = "成功",
|
|
|
114
|
+ rows = list,
|
|
|
115
|
+ total = recordCount,
|
|
|
116
|
+ };
|
|
|
117
|
+ return Content(obj.ToJson());
|
|
|
118
|
+ }
|
|
69
|
119
|
}
|
|
70
|
120
|
}
|