Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
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
黄奎
mall.oytour.com
Commits
cdb7e1cd
Commit
cdb7e1cd
authored
Jul 06, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
9814d904
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
50 deletions
+50
-50
ActivityModule.cs
Mall.Module.Education/ActivityModule.cs
+42
-42
EducationController.cs
Mall.WebApi/Controllers/Education/EducationController.cs
+8
-8
No files found.
Mall.Module.Education/ActivityModule.cs
View file @
cdb7e1cd
...
@@ -299,7 +299,7 @@ namespace Mall.Module.Education
...
@@ -299,7 +299,7 @@ namespace Mall.Module.Education
public
bool
SetActivityModule
(
RB_Education_Activity_Extend
model
)
public
bool
SetActivityModule
(
RB_Education_Activity_Extend
model
)
{
{
bool
flag
;
bool
flag
;
//
var trans = education_ActivityRepository.DbTransaction;
var
trans
=
education_ActivityRepository
.
DbTransaction
;
try
try
{
{
if
(
model
.
Id
>
0
)
if
(
model
.
Id
>
0
)
...
@@ -331,59 +331,59 @@ namespace Mall.Module.Education
...
@@ -331,59 +331,59 @@ namespace Mall.Module.Education
{
nameof
(
RB_Education_Activity_Extend
.
LnsideLimit
),
model
.
LnsideLimit
},
{
nameof
(
RB_Education_Activity_Extend
.
LnsideLimit
),
model
.
LnsideLimit
},
};
};
flag
=
education_ActivityRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Education_Activity_Extend
.
Id
),
model
.
Id
));
flag
=
education_ActivityRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Education_Activity_Extend
.
Id
),
model
.
Id
)
,
trans
);
//
if (flag)
if
(
flag
)
//
{
{
//
var titleList = education_ActivityTitleRepository.GetActivityTitleList(new RB_Education_ActivityTitle_Extend { ActivityId = model.Id, TenantId = model.TenantId, MallBaseId = model.MallBaseId });
var
titleList
=
education_ActivityTitleRepository
.
GetActivityTitleList
(
new
RB_Education_ActivityTitle_Extend
{
ActivityId
=
model
.
Id
,
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
});
//
if (titleList != null && titleList.Any())
if
(
titleList
!=
null
&&
titleList
.
Any
())
//
{
{
//
education_ActivityTitleRepository.DeleteBatch(titleList, trans);
education_ActivityTitleRepository
.
DeleteBatch
(
titleList
,
trans
);
//
}
}
//
var planList = education_ActivityPlanRepository.GetActivityPlanList(new RB_Education_ActivityPlan_Extend { ActivityId = model.Id, TenantId = model.TenantId, MallBaseId = model.MallBaseId });
var
planList
=
education_ActivityPlanRepository
.
GetActivityPlanList
(
new
RB_Education_ActivityPlan_Extend
{
ActivityId
=
model
.
Id
,
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
});
//
if (planList != null && planList.Any())
if
(
planList
!=
null
&&
planList
.
Any
())
//
{
{
//
education_ActivityPlanRepository.DeleteBatch(planList, trans);
education_ActivityPlanRepository
.
DeleteBatch
(
planList
,
trans
);
//
}
}
//
}
}
}
}
else
else
{
{
var
newId
=
education_ActivityRepository
.
Insert
(
model
);
var
newId
=
education_ActivityRepository
.
Insert
(
model
,
trans
);
model
.
Id
=
newId
;
model
.
Id
=
newId
;
flag
=
newId
>
0
;
flag
=
newId
>
0
;
}
}
//
if (flag && model.ActivityTitleList != null && model.ActivityTitleList.Any())
if
(
flag
&&
model
.
ActivityTitleList
!=
null
&&
model
.
ActivityTitleList
.
Any
())
//
{
{
//
model.ActivityTitleList.ForEach(x => x.TenantId = model.TenantId);
model
.
ActivityTitleList
.
ForEach
(
x
=>
x
.
TenantId
=
model
.
TenantId
);
//
model.ActivityTitleList.ForEach(x => x.MallBaseId = model.MallBaseId);
model
.
ActivityTitleList
.
ForEach
(
x
=>
x
.
MallBaseId
=
model
.
MallBaseId
);
//
model.ActivityTitleList.ForEach(x => x.ActivityId = model.Id);
model
.
ActivityTitleList
.
ForEach
(
x
=>
x
.
ActivityId
=
model
.
Id
);
//
model.ActivityTitleList.ForEach(x => x.Id = 0);
model
.
ActivityTitleList
.
ForEach
(
x
=>
x
.
Id
=
0
);
//
model.ActivityTitleList.ForEach(x => x.Status = Common.Enum.DateStateEnum.Normal);
model
.
ActivityTitleList
.
ForEach
(
x
=>
x
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
);
//
foreach (var item in model.ActivityTitleList)
foreach
(
var
item
in
model
.
ActivityTitleList
)
//
{
{
//
var titleId = education_ActivityTitleRepository.Insert(item, trans);
var
titleId
=
education_ActivityTitleRepository
.
Insert
(
item
,
trans
);
//
if (item.ActivityPlanList != null && item.ActivityPlanList.Any())
if
(
item
.
ActivityPlanList
!=
null
&&
item
.
ActivityPlanList
.
Any
())
//
{
{
//
item.ActivityPlanList.ForEach(x => x.Id = 0);
item
.
ActivityPlanList
.
ForEach
(
x
=>
x
.
Id
=
0
);
//
item.ActivityPlanList.ForEach(x => x.TenantId = model.TenantId);
item
.
ActivityPlanList
.
ForEach
(
x
=>
x
.
TenantId
=
model
.
TenantId
);
//
item.ActivityPlanList.ForEach(x => x.MallBaseId = model.MallBaseId);
item
.
ActivityPlanList
.
ForEach
(
x
=>
x
.
MallBaseId
=
model
.
MallBaseId
);
//
item.ActivityPlanList.ForEach(x => x.ActivityId = model.Id);
item
.
ActivityPlanList
.
ForEach
(
x
=>
x
.
ActivityId
=
model
.
Id
);
//
item.ActivityPlanList.ForEach(x => x.TitleId = titleId);
item
.
ActivityPlanList
.
ForEach
(
x
=>
x
.
TitleId
=
titleId
);
//
item.ActivityPlanList.ForEach(x => x.TripPic = (x.TripPicList != null && x.TripPicList.Any()) ? JsonConvert.SerializeObject(x.TripPicList) : "");
item
.
ActivityPlanList
.
ForEach
(
x
=>
x
.
TripPic
=
(
x
.
TripPicList
!=
null
&&
x
.
TripPicList
.
Any
())
?
JsonConvert
.
SerializeObject
(
x
.
TripPicList
)
:
""
);
//
item.ActivityPlanList.ForEach(x => x.Status = Common.Enum.DateStateEnum.Normal);
item
.
ActivityPlanList
.
ForEach
(
x
=>
x
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
);
//
education_ActivityPlanRepository.InsertBatch(item.ActivityPlanList, trans);
education_ActivityPlanRepository
.
InsertBatch
(
item
.
ActivityPlanList
,
trans
);
//
}
}
//
}
}
//
}
}
//
education_ActivityRepository.DBSession.Commit();
education_ActivityRepository
.
DBSession
.
Commit
();
return
flag
;
return
flag
;
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
//
education_ActivityRepository.DBSession.Rollback("SetActivityModule");
education_ActivityRepository
.
DBSession
.
Rollback
(
"SetActivityModule"
);
return
false
;
return
false
;
}
}
}
}
...
...
Mall.WebApi/Controllers/Education/EducationController.cs
View file @
cdb7e1cd
...
@@ -2082,14 +2082,14 @@ namespace Mall.WebApi.Controllers.Education
...
@@ -2082,14 +2082,14 @@ namespace Mall.WebApi.Controllers.Education
LocationName
=
jObj
.
GetStringValue
(
"LocationName"
),
LocationName
=
jObj
.
GetStringValue
(
"LocationName"
),
LnsideLimit
=
jObj
.
GetInt
(
"LnsideLimit"
,
0
),
LnsideLimit
=
jObj
.
GetInt
(
"LnsideLimit"
,
0
),
};
};
//
try
try
//
{
{
//
extModel.ActivityTitleList = JsonConvert.DeserializeObject<List<RB_Education_ActivityTitle_Extend>>(jObj.GetStringValue("ActivityTitle"));
extModel
.
ActivityTitleList
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Education_ActivityTitle_Extend
>>(
jObj
.
GetStringValue
(
"ActivityTitle"
));
//
}
}
//
catch (Exception ex)
catch
(
Exception
ex
)
//
{
{
//
extModel.ActivityTitleList = new List<RB_Education_ActivityTitle_Extend>();
extModel
.
ActivityTitleList
=
new
List
<
RB_Education_ActivityTitle_Extend
>();
//
}
}
extModel
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
extModel
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
...
...
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