Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
217d7353
Commit
217d7353
authored
May 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
f24996eb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
131 additions
and
17 deletions
+131
-17
RB_Duty_Content_ViewModel.cs
Edu.Model/ViewModel/Duty/RB_Duty_Content_ViewModel.cs
+4
-1
DutyModule.cs
Edu.Module.Duty/DutyModule.cs
+3
-3
DutyPlanModule.cs
Edu.Module.Duty/DutyPlanModule.cs
+104
-3
RB_Duty_ConfigRepository.cs
Edu.Repository/Duty/RB_Duty_ConfigRepository.cs
+1
-1
DutyController.cs
Edu.WebApi/Controllers/Duty/DutyController.cs
+4
-4
DutyPlanController.cs
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
+15
-3
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+0
-2
No files found.
Edu.Model/ViewModel/Duty/RB_Duty_Content_ViewModel.cs
View file @
217d7353
...
...
@@ -11,6 +11,9 @@ namespace Edu.Model.ViewModel.Duty
/// </summary>
public
class
RB_Duty_Content_ViewModel
:
RB_Duty_Content
{
/// <summary>
/// 页面修改
/// </summary>
public
List
<
string
>
FileList
{
get
;
set
;
}
}
}
Edu.Module.Duty/DutyModule.cs
View file @
217d7353
...
...
@@ -162,9 +162,9 @@ namespace Edu.Module.Duty
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Duty_Config_ViewModel
>
GetDutyConfigList
(
RB_Duty_Config_ViewModel
query
)
public
List
<
RB_Duty_Config_ViewModel
>
GetDutyConfigList
Module
(
RB_Duty_Config_ViewModel
query
)
{
return
dutyConfigRepository
.
GetDutyConfigList
(
query
);
return
dutyConfigRepository
.
GetDutyConfigList
Repository
(
query
);
}
/// <summary>
...
...
@@ -186,7 +186,7 @@ namespace Edu.Module.Duty
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetDutyConfigMod
el
(
RB_Duty_Config_ViewModel
model
)
public
bool
SetDutyConfigMod
ule
(
RB_Duty_Config_ViewModel
model
)
{
if
(
model
.
Id
==
0
)
{
...
...
Edu.Module.Duty/DutyPlanModule.cs
View file @
217d7353
using
Edu.Common.Enum
;
using
Edu.Common.Message
;
using
Edu.Model.CacheModel
;
using
Edu.Model.ViewModel.Duty
;
using
Edu.Model.ViewModel.User
;
...
...
@@ -158,7 +159,7 @@ namespace Edu.Module.Duty
/// <param name="model"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
virtual
bool
SetDutyPlanModule
(
RB_Duty_Plan_ViewModel
model
)
public
virtual
bool
SetDutyPlanModule
(
RB_Duty_Plan_ViewModel
model
,
UserInfo
userInfo
)
{
bool
flag
=
false
;
if
(
model
.
Id
>
0
)
...
...
@@ -184,6 +185,7 @@ namespace Edu.Module.Duty
{
PlanId
=
model
.
Id
});
List
<
PushMessageModel
>
messageList
=
new
List
<
PushMessageModel
>();
//原没有班次信息
if
(
oldPlanDetailsList
==
null
||
(
oldPlanDetailsList
!=
null
&&
oldPlanDetailsList
.
Count
==
0
))
{
...
...
@@ -193,15 +195,44 @@ namespace Edu.Module.Duty
{
item
.
PlanId
=
model
.
Id
;
duty_PlanDetailsRepository
.
Insert
(
item
);
messageList
.
Add
(
new
PushMessageModel
()
{
CategoryId
=
0
,
Content
=
string
.
Format
(
"您有{0}的值班信息,请注意查收!"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
Date
)),
CoverImg
=
""
,
CreateByName
=
userInfo
.
AccountName
,
JumpUrl
=
""
,
ReceiveId
=
item
.
DutyMan
.
ToString
(),
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"值班信息"
,
Platform
=
2
});
}
}
}
else
{
//现在没有
阶梯报价了【直接删除以前的阶梯报价
】
//现在没有
值班信息了【直接删除以前的值班信息
】
if
(
model
.
PlanDetails
==
null
||
(
model
.
PlanDetails
!=
null
&&
model
.
PlanDetails
.
Count
==
0
))
{
duty_PlanDetailsRepository
.
DeletePlanDetailsRepository
(
model
.
Id
);
foreach
(
var
item
in
model
.
PlanDetails
)
{
messageList
.
Add
(
new
PushMessageModel
()
{
CategoryId
=
0
,
Content
=
string
.
Format
(
"您在{0}的值班,已被取消!"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
Date
)),
CoverImg
=
""
,
CreateByName
=
userInfo
.
AccountName
,
JumpUrl
=
""
,
ReceiveId
=
item
.
DutyMan
.
ToString
(),
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"值班取消"
,
Platform
=
2
});
}
}
//找出差异的数据
var
deleteList
=
oldPlanDetailsList
.
Where
(
qitem
=>
!
model
.
PlanDetails
.
Any
(
oldItem
=>
qitem
.
Id
==
oldItem
.
Id
)).
ToList
();
...
...
@@ -211,6 +242,19 @@ namespace Edu.Module.Duty
{
duty_PlanDetailsRepository
.
Delete
(
dItem
.
Id
);
}
messageList
.
Add
(
new
PushMessageModel
()
{
CategoryId
=
0
,
Content
=
string
.
Format
(
"您在{0}的值班,已被取消!"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
Date
)),
CoverImg
=
""
,
CreateByName
=
userInfo
.
AccountName
,
JumpUrl
=
""
,
ReceiveId
=
dItem
.
DutyMan
.
ToString
(),
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"值班取消"
,
Platform
=
2
});
}
foreach
(
var
item
in
model
.
PlanDetails
)
{
...
...
@@ -218,6 +262,19 @@ namespace Edu.Module.Duty
if
(
item
.
Id
==
0
)
{
duty_PlanDetailsRepository
.
Insert
(
item
);
messageList
.
Add
(
new
PushMessageModel
()
{
CategoryId
=
0
,
Content
=
string
.
Format
(
"您有{0}的值班信息,请注意查收!"
,
Common
.
ConvertHelper
.
FormatDate
(
model
.
Date
)),
CoverImg
=
""
,
CreateByName
=
userInfo
.
AccountName
,
JumpUrl
=
""
,
ReceiveId
=
item
.
DutyMan
.
ToString
(),
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"值班信息"
,
Platform
=
2
});
}
else
{
...
...
@@ -248,13 +305,42 @@ namespace Edu.Module.Duty
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
RemoveDutyPlanModule
(
int
Id
)
[
TransactionCallHandler
]
public
virtual
bool
RemoveDutyPlanModule
(
int
Id
,
UserInfo
userInfo
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Duty_Plan_ViewModel
.
Status
),(
int
)
DateStateEnum
.
Delete
}
};
var
flag
=
duty_PlanRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Duty_Plan_ViewModel
.
Id
),
Id
));
if
(
flag
)
{
var
dutyModel
=
GetDutyPlanModule
(
Id
);
if
(
dutyModel
!=
null
&&
dutyModel
.
PlanDetails
!=
null
&&
dutyModel
.
PlanDetails
.
Count
>
0
)
{
List
<
PushMessageModel
>
messageList
=
new
List
<
PushMessageModel
>();
foreach
(
var
item
in
dutyModel
.
PlanDetails
)
{
messageList
.
Add
(
new
PushMessageModel
()
{
CategoryId
=
0
,
Content
=
string
.
Format
(
"您在{0}的值班,已被取消!"
,
Common
.
ConvertHelper
.
FormatDate
(
dutyModel
.
Date
)),
CoverImg
=
""
,
CreateByName
=
userInfo
.
AccountName
,
JumpUrl
=
""
,
ReceiveId
=
item
.
DutyMan
.
ToString
(),
SendTime
=
DateTime
.
Now
,
SendType
=
0
,
Title
=
"值班取消"
,
Platform
=
2
});
}
if
(
messageList
!=
null
&&
messageList
.
Count
>
0
)
{
Common
.
Message
.
MessageHelper
.
SendMessage
(
messageList
);
}
}
}
return
flag
;
}
...
...
@@ -274,6 +360,21 @@ namespace Edu.Module.Duty
}
//获取所有的值班内容
var
contentList
=
duty_ContentRepository
.
GetDutyContentListRepository
(
new
RB_Duty_Content_ViewModel
()
{
PlanId
=
model
.
Id
});
foreach
(
var
item
in
contentList
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
FileURL
))
{
try
{
item
.
FileList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
item
.
FileURL
);
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"OnDutyModule_FileList"
);
}
}
}
//当前班次
var
currentModel
=
new
RB_Duty_PlanDetails_ViewModel
();
//上一个班次
...
...
Edu.Repository/Duty/RB_Duty_ConfigRepository.cs
View file @
217d7353
...
...
@@ -84,7 +84,7 @@ namespace Edu.Repository.Duty
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Duty_Config_ViewModel
>
GetDutyConfigList
(
RB_Duty_Config_ViewModel
query
)
public
List
<
RB_Duty_Config_ViewModel
>
GetDutyConfigList
Repository
(
RB_Duty_Config_ViewModel
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
...
...
Edu.WebApi/Controllers/Duty/DutyController.cs
View file @
217d7353
...
...
@@ -323,7 +323,7 @@ namespace Edu.WebApi.Controllers.Duty
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
),
};
var
list
=
dutyModule
.
GetDutyConfig
Repository
(
query
);
var
list
=
dutyModule
.
GetDutyConfig
Module
(
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
...
...
@@ -352,7 +352,7 @@ namespace Edu.WebApi.Controllers.Duty
{
return
ApiResult
.
Failed
(
"请传入值班设置Id"
);
}
var
model
=
dutyModule
.
GetDutyConfig
Repository
(
query
).
FirstOrDefault
();
var
model
=
dutyModule
.
GetDutyConfig
Module
(
query
).
FirstOrDefault
();
if
(
model
==
null
||
model
.
Id
<=
0
)
{
return
ApiResult
.
Failed
(
"数据不存在"
);
...
...
@@ -398,7 +398,7 @@ namespace Edu.WebApi.Controllers.Duty
{
return
ApiResult
.
Failed
(
"请输入值班机器码"
);
}
var
oldList
=
dutyModule
.
GetDutyConfigList
(
new
RB_Duty_Config_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
MachineCode
=
query
.
MachineCode
});
var
oldList
=
dutyModule
.
GetDutyConfigList
Module
(
new
RB_Duty_Config_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
MachineCode
=
query
.
MachineCode
});
if
(
oldList
!=
null
&&
oldList
.
Any
(
x
=>
x
.
Id
!=
query
.
Id
))
{
return
ApiResult
.
Failed
(
"机器码已存在"
);
...
...
@@ -410,7 +410,7 @@ namespace Edu.WebApi.Controllers.Duty
}
query
.
UpdateBy
=
base
.
UserInfo
.
Id
;
query
.
UpdateTime
=
System
.
DateTime
.
Now
;
bool
retult
=
dutyModule
.
SetDutyConfigMod
el
(
query
);
bool
retult
=
dutyModule
.
SetDutyConfigMod
ule
(
query
);
return
retult
?
ApiResult
.
Success
(
"新增/修改值班设置成功"
)
:
ApiResult
.
Failed
(
"新增/修改值班设置失败"
);
}
...
...
Edu.WebApi/Controllers/Duty/DutyPlanController.cs
View file @
217d7353
...
...
@@ -188,7 +188,7 @@ namespace Edu.WebApi.Controllers.Duty
model
.
CreateTime
=
DateTime
.
Now
;
model
.
UpdateBy
=
base
.
UserInfo
.
Id
;
model
.
UpdateTime
=
DateTime
.
Now
;
bool
flag
=
dutyPlanModule
.
SetDutyPlanModule
(
model
);
bool
flag
=
dutyPlanModule
.
SetDutyPlanModule
(
model
,
base
.
UserInfo
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -212,7 +212,7 @@ namespace Edu.WebApi.Controllers.Duty
public
ApiResult
RemoveDutyPlan
()
{
var
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
);
var
model
=
dutyPlanModule
.
RemoveDutyPlanModule
(
Id
);
var
model
=
dutyPlanModule
.
RemoveDutyPlanModule
(
Id
,
base
.
UserInfo
);
return
ApiResult
.
Success
(
data
:
model
);
}
...
...
@@ -256,13 +256,25 @@ namespace Edu.WebApi.Controllers.Duty
PlanShift
=
base
.
ParmJObj
.
GetInt
(
"PlanShift"
),
PlanType
=
base
.
ParmJObj
.
GetInt
(
"PlanType"
),
PlanId
=
base
.
ParmJObj
.
GetInt
(
"PlanId"
),
FileURL
=
base
.
ParmJObj
.
GetStringValue
(
"FileURL"
),
OtherContent
=
base
.
ParmJObj
.
GetStringValue
(
"OtherContent"
),
OtherRemark
=
base
.
ParmJObj
.
GetStringValue
(
"OtherRemark"
),
WorkContent
=
base
.
ParmJObj
.
GetStringValue
(
"WorkContent"
),
WorkIsFinish
=
base
.
ParmJObj
.
GetInt
(
"WorkIsFinish"
),
ItemId
=
base
.
ParmJObj
.
GetInt
(
"ItemId"
),
};
try
{
model
.
FileList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
string
>>(
base
.
ParmJObj
.
GetStringValue
(
"FileList"
));
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"SetDutyContent_FileList"
);
}
if
(
model
.
FileList
==
null
)
{
model
.
FileList
=
new
List
<
string
>();
}
model
.
FileURL
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
model
.
FileList
);
model
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
model
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
...
Edu.WebApi/Controllers/User/LoginController.cs
View file @
217d7353
...
...
@@ -290,8 +290,6 @@ namespace Edu.WebApi.Controllers.User
password
=
Common
.
DES
.
Encrypt
(
password
);
if
(
model
.
Password
!=
password
)
{
return
ApiResult
.
Failed
(
"密码错误"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment