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
bc95f135
Commit
bc95f135
authored
Sep 01, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sdzq' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq-ld
parents
b7f28ab9
634036a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
43 deletions
+45
-43
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+45
-43
No files found.
Mall.Module.Product/GuideCarModule.cs
View file @
bc95f135
...
@@ -6,6 +6,8 @@ using System.Text.RegularExpressions;
...
@@ -6,6 +6,8 @@ using System.Text.RegularExpressions;
using
Mall.AOP.CustomerAttribute
;
using
Mall.AOP.CustomerAttribute
;
using
Mall.Common.API
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Entity.GuideCar
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
...
@@ -183,9 +185,9 @@ namespace Mall.Module.Product
...
@@ -183,9 +185,9 @@ namespace Mall.Module.Product
RB_GuideCar_Site_Extend
model
=
SiteRepository
.
GetLogisticsRulesList
(
query
).
FirstOrDefault
();
RB_GuideCar_Site_Extend
model
=
SiteRepository
.
GetLogisticsRulesList
(
query
).
FirstOrDefault
();
if
(
model
!=
null
)
if
(
model
!=
null
)
{
{
//List<RB_Logistics_RulesRegion_Extend> listLogisticsRulesRegion = logisticsRulesRegionRepository.GetListRepository(new RB_Logistics_RulesRegion_Extend { TenantId = query.TenantId, RulesType = query.RulesType, MallBaseId = query.MallBaseId, RulesPric
eId = model.ID });
List
<
RB_GuideCar_SiteRegion_Extend
>
listLogisticsRulesRegion
=
SiteRegionRepository
.
GetListRepository
(
new
RB_GuideCar_SiteRegion_Extend
{
TenantId
=
query
.
TenantId
,
RulesType
=
query
.
RulesType
,
MallBaseId
=
query
.
MallBaseId
,
Sit
eId
=
model
.
ID
});
//model.List = new List<RB_Logistics_Rules
Region_Extend>();
model
.
RegionList
=
new
List
<
RB_GuideCar_Site
Region_Extend
>();
//model.
List = listLogisticsRulesRegion;
model
.
Region
List
=
listLogisticsRulesRegion
;
}
}
return
model
;
return
model
;
...
@@ -196,57 +198,57 @@ namespace Mall.Module.Product
...
@@ -196,57 +198,57 @@ namespace Mall.Module.Product
/// </summary>
/// </summary>
/// <param name="model"></param>
/// <param name="model"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
AddOrUpdate
Pinkage
(
RB_Logistics_Rules
_Extend
model
)
public
bool
AddOrUpdate
GuideCarSite
(
RB_GuideCar_Site
_Extend
model
)
{
{
bool
flag
=
false
;
bool
flag
=
false
;
var
trans
=
logisticsRules
Repository
.
DbTransaction
;
var
trans
=
Site
Repository
.
DbTransaction
;
try
try
{
{
int
rulesId
=
0
;
int
rulesId
=
0
;
if
(
model
.
ID
==
0
)
if
(
model
.
ID
==
0
)
{
{
rulesId
=
logisticsRules
Repository
.
Insert
(
model
,
trans
);
rulesId
=
Site
Repository
.
Insert
(
model
,
trans
);
flag
=
rulesId
>
0
;
flag
=
rulesId
>
0
;
}
}
else
else
{
{
rulesId
=
model
.
ID
;
rulesId
=
model
.
ID
;
flag
=
logisticsRules
Repository
.
Update
(
model
,
trans
);
flag
=
Site
Repository
.
Update
(
model
,
trans
);
List
<
RB_
Logistics_RulesRegion_Extend
>
listLogisticsRulesRegion
=
logisticsRulesRegionRepository
.
GetListRepository
(
new
RB_Logistics_RulesRegion_Extend
{
TenantId
=
model
.
TenantId
,
RulesType
=
model
.
RulesType
,
MallBaseId
=
model
.
MallBaseId
,
RulesPric
eId
=
model
.
ID
});
List
<
RB_
GuideCar_SiteRegion_Extend
>
listLogisticsRulesRegion
=
SiteRegionRepository
.
GetListRepository
(
new
RB_GuideCar_SiteRegion_Extend
{
TenantId
=
model
.
TenantId
,
RulesType
=
model
.
RulesType
,
MallBaseId
=
model
.
MallBaseId
,
Sit
eId
=
model
.
ID
});
//删除之前的区域
//删除之前的区域
foreach
(
var
itemRegion
in
listLogisticsRulesRegion
.
Where
(
x
=>
x
.
RulesPric
eId
==
model
.
ID
))
foreach
(
var
itemRegion
in
listLogisticsRulesRegion
.
Where
(
x
=>
x
.
Sit
eId
==
model
.
ID
))
{
{
IDictionary
<
string
,
object
>
filedsRegion
=
new
Dictionary
<
string
,
object
>()
//删除价格下面对应的地区
IDictionary
<
string
,
object
>
filedsRegion
=
new
Dictionary
<
string
,
object
>()
//删除价格下面对应的地区
{
{
{
nameof
(
RB_
Logistics_Rules
Region
.
Status
),
1
},
{
nameof
(
RB_
GuideCar_Site
Region
.
Status
),
1
},
{
nameof
(
RB_
Logistics_Rules
Region
.
UpdateDate
),
System
.
DateTime
.
Now
},
{
nameof
(
RB_
GuideCar_Site
Region
.
UpdateDate
),
System
.
DateTime
.
Now
},
};
};
IList
<
WhereHelper
>
whereHelpersRegion
=
new
List
<
WhereHelper
>()
IList
<
WhereHelper
>
whereHelpersRegion
=
new
List
<
WhereHelper
>()
{
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
Region
.
ID
),
FiledValue
=
itemRegion
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
}
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
GuideCar_Site
Region
.
ID
),
FiledValue
=
itemRegion
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
};
logisticsRules
RegionRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
,
trans
);
Site
RegionRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
,
trans
);
}
}
}
}
if
(
model
.
List
!=
null
&&
model
.
List
.
Any
())
if
(
model
.
RegionList
!=
null
&&
model
.
Region
List
.
Any
())
{
{
model
.
List
.
ForEach
(
x
=>
x
.
TenantId
=
model
.
TenantId
);
model
.
Region
List
.
ForEach
(
x
=>
x
.
TenantId
=
model
.
TenantId
);
model
.
List
.
ForEach
(
x
=>
x
.
CreateDate
=
System
.
DateTime
.
Now
);
model
.
Region
List
.
ForEach
(
x
=>
x
.
CreateDate
=
System
.
DateTime
.
Now
);
model
.
List
.
ForEach
(
x
=>
x
.
ID
=
0
);
model
.
Region
List
.
ForEach
(
x
=>
x
.
ID
=
0
);
model
.
List
.
ForEach
(
x
=>
x
.
RulesPric
eId
=
rulesId
);
model
.
RegionList
.
ForEach
(
x
=>
x
.
Sit
eId
=
rulesId
);
model
.
List
.
ForEach
(
x
=>
x
.
RulesType
=
model
.
RulesType
);
model
.
Region
List
.
ForEach
(
x
=>
x
.
RulesType
=
model
.
RulesType
);
model
.
List
.
ForEach
(
x
=>
x
.
MallBaseId
=
model
.
MallBaseId
);
model
.
Region
List
.
ForEach
(
x
=>
x
.
MallBaseId
=
model
.
MallBaseId
);
logisticsRulesRegionRepository
.
InsertBatch
(
model
.
List
,
trans
);
SiteRegionRepository
.
InsertBatch
(
model
.
Region
List
,
trans
);
}
}
logisticsRules
Repository
.
DBSession
.
Commit
();
Site
Repository
.
DBSession
.
Commit
();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogHelper
.
Write
(
ex
,
"AddOrUpdate
Pinkag
e"
);
LogHelper
.
Write
(
ex
,
"AddOrUpdate
GuideCarSit
e"
);
logisticsRulesRepository
.
DBSession
.
Rollback
(
"AddOrUpdatePinkag
e"
);
SiteRepository
.
DBSession
.
Rollback
(
"AddOrUpdateGuideCarSit
e"
);
return
false
;
return
false
;
}
}
return
flag
;
return
flag
;
...
@@ -258,71 +260,71 @@ namespace Mall.Module.Product
...
@@ -258,71 +260,71 @@ namespace Mall.Module.Product
/// <param name="gradeId"></param>
/// <param name="gradeId"></param>
/// <param name="uid"></param>
/// <param name="uid"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
Del
Pinkag
eInfo
(
int
id
,
int
uid
,
int
mallBaseId
)
public
bool
Del
GuideCarSit
eInfo
(
int
id
,
int
uid
,
int
mallBaseId
)
{
{
var
trans
=
logisticsRules
Repository
.
DbTransaction
;
var
trans
=
Site
Repository
.
DbTransaction
;
bool
flag
;
bool
flag
;
try
try
{
{
Dictionary
<
string
,
object
>
cols
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
cols
=
new
Dictionary
<
string
,
object
>()
{
{
{
nameof
(
RB_
Logistics_Rules
.
Status
),
1
},
{
nameof
(
RB_
GuideCar_Site
.
Status
),
1
},
{
nameof
(
RB_
Logistics_Rules
.
UpdateDate
),
DateTime
.
Now
},
{
nameof
(
RB_
GuideCar_Site
.
UpdateDate
),
DateTime
.
Now
},
};
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
.
ID
),
FiledName
=
nameof
(
RB_
GuideCar_Site
.
ID
),
FiledValue
=
id
,
FiledValue
=
id
,
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
},
},
new
WhereHelper
(){
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
.
TenantId
),
FiledName
=
nameof
(
RB_
GuideCar_Site
.
TenantId
),
FiledValue
=
Convert
.
ToInt32
(
uid
),
FiledValue
=
Convert
.
ToInt32
(
uid
),
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
},
},
new
WhereHelper
(){
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
.
MallBaseId
),
FiledName
=
nameof
(
RB_
GuideCar_Site
.
MallBaseId
),
FiledValue
=
Convert
.
ToInt32
(
mallBaseId
),
FiledValue
=
Convert
.
ToInt32
(
mallBaseId
),
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
},
},
new
WhereHelper
(){
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
.
RulesType
),
FiledName
=
nameof
(
RB_
GuideCar_Site
.
RulesType
),
FiledValue
=
Convert
.
ToInt32
(
Common
.
Enum
.
MallBase
.
RulesTypeEnum
.
Pinkage
),
FiledValue
=
Convert
.
ToInt32
(
Common
.
Enum
.
MallBase
.
RulesTypeEnum
.
Pinkage
),
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
}
}
};
};
flag
=
logisticsRules
Repository
.
Update
(
cols
,
wheres1
,
trans
);
flag
=
Site
Repository
.
Update
(
cols
,
wheres1
,
trans
);
IDictionary
<
string
,
object
>
filedsRegion
=
new
Dictionary
<
string
,
object
>()
//删除价格下面对应的地区
IDictionary
<
string
,
object
>
filedsRegion
=
new
Dictionary
<
string
,
object
>()
//删除价格下面对应的地区
{
{
{
nameof
(
RB_
Logistics_Rules
Region
.
Status
),
1
},
{
nameof
(
RB_
GuideCar_Site
Region
.
Status
),
1
},
{
nameof
(
RB_
Logistics_Rules
Region
.
UpdateDate
),
System
.
DateTime
.
Now
},
{
nameof
(
RB_
GuideCar_Site
Region
.
UpdateDate
),
System
.
DateTime
.
Now
},
};
};
IList
<
WhereHelper
>
whereHelpersRegion
=
new
List
<
WhereHelper
>()
IList
<
WhereHelper
>
whereHelpersRegion
=
new
List
<
WhereHelper
>()
{
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_RulesRegion
.
RulesPric
eId
),
FiledValue
=
id
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
GuideCar_SiteRegion
.
Sit
eId
),
FiledValue
=
id
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
Region
.
TenantId
),
FiledName
=
nameof
(
RB_
GuideCar_Site
Region
.
TenantId
),
FiledValue
=
Convert
.
ToInt32
(
uid
),
FiledValue
=
Convert
.
ToInt32
(
uid
),
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
},
},
new
WhereHelper
(){
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
Region
.
MallBaseId
),
FiledName
=
nameof
(
RB_
GuideCar_Site
Region
.
MallBaseId
),
FiledValue
=
Convert
.
ToInt32
(
mallBaseId
),
FiledValue
=
Convert
.
ToInt32
(
mallBaseId
),
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
},
},
new
WhereHelper
(){
new
WhereHelper
(){
FiledName
=
nameof
(
RB_
Logistics_Rules
Region
.
RulesType
),
FiledName
=
nameof
(
RB_
GuideCar_Site
Region
.
RulesType
),
FiledValue
=
Convert
.
ToInt32
(
Common
.
Enum
.
MallBase
.
RulesTypeEnum
.
Pinkage
),
FiledValue
=
Convert
.
ToInt32
(
Common
.
Enum
.
MallBase
.
RulesTypeEnum
.
Pinkage
),
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
}
};
}
};
flag
=
logisticsRules
RegionRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
,
trans
);
flag
=
Site
RegionRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
,
trans
);
logisticsRules
Repository
.
DBSession
.
Commit
();
Site
Repository
.
DBSession
.
Commit
();
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogHelper
.
Write
(
ex
,
"Del
Pinkag
eInfo"
);
LogHelper
.
Write
(
ex
,
"Del
GuideCarSit
eInfo"
);
logisticsRulesRepository
.
DBSession
.
Rollback
(
"DelPinkag
eInfo"
);
SiteRepository
.
DBSession
.
Rollback
(
"DelGuideCarSit
eInfo"
);
return
false
;
return
false
;
}
}
return
flag
;
return
flag
;
...
...
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