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
816b06b1
Commit
816b06b1
authored
Jun 24, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
d9026760
4c1578c3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
204 additions
and
99 deletions
+204
-99
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+89
-89
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+86
-9
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+29
-1
No files found.
Mall.Module.Product/OrderModule.cs
View file @
816b06b1
This diff is collapsed.
Click to expand it.
Mall.Module.Product/ProductModule.cs
View file @
816b06b1
...
...
@@ -3906,7 +3906,7 @@ namespace Mall.Module.Product
goodsRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
else
if
(
goodsModel
.
IsProxy
==
2
&&
demodel
.
IsProxy
==
1
&&
demodel
.
GoodsStatus
==
1
)
else
if
(
(
goodsModel
.
IsProxy
==
2
||
goodsModel
.
IsProxy
==
1
)
&&
demodel
.
IsProxy
==
1
&&
demodel
.
GoodsStatus
==
1
)
{
//启用代理 检测是否有已代理的 同步数据 并采购商品状态
var
plist
=
goods_ProxyRepository
.
GetList
(
new
RB_Goods_Proxy_Extend
()
{
GoodsId
=
demodel
.
Id
,
MallBaseId
=
goodsModel
.
MallBaseId
,
TenantId
=
goodsModel
.
TenantId
});
...
...
@@ -3924,6 +3924,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Goods
.
IsGoodsNegotiable
),
demodel
.
IsGoodsNegotiable
},
{
nameof
(
RB_Goods
.
GoodsNumbers
),
demodel
.
GoodsNumbers
},
{
nameof
(
RB_Goods
.
GoodsWeight
),
demodel
.
GoodsWeight
},
{
nameof
(
RB_Goods
.
ProcurementStatus
),
1
},
{
nameof
(
RB_Goods
.
UpdateDate
),
demodel
.
UpdateDate
}
};
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
...
...
@@ -3942,15 +3943,16 @@ namespace Mall.Module.Product
}
else
{
//删除规格
}
var
slist
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsId
=
item
.
Id
,
TenantId
=
item
.
TenantId
,
MallBaseId
=
item
.
MallBaseId
});
var
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsId
=
item
.
Id
,
TenantId
=
item
.
TenantId
,
MallBaseId
=
item
.
MallBaseId
});
var
splist
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsId
=
item
.
Id
,
TenantId
=
item
.
TenantId
,
MallBaseId
=
item
.
MallBaseId
});
//删除
goods_SpecificationRepository
.
DeleteBatch
(
slist
);
goods_SpecificationValueRepository
.
DeleteBatch
(
svlist
);
goods_SpecificationPriceRepository
.
DeleteBatch
(
splist
);
}
}
}
else
if
(
goodsModel
.
IsProxy
==
1
&&
demodel
.
IsProxy
==
1
&&
demodel
.
GoodsStatus
==
1
)
{
//修改所有采购商品 成本价格 规格
}
#
endregion
}
...
...
@@ -4704,6 +4706,9 @@ namespace Mall.Module.Product
if
(
goodsModel
==
null
)
{
return
ApiResult
.
Failed
(
"采购商品不存在"
);
}
if
(
goodsModel
.
GoodsStatus
!=
1
)
{
return
ApiResult
.
Failed
(
"该商品未上架,无法采购"
);
}
if
(
goodsModel
.
IsProxy
!=
1
)
{
return
ApiResult
.
Failed
(
"采购商品不可代理"
);
}
...
...
@@ -4779,6 +4784,19 @@ namespace Mall.Module.Product
},
trans
);
if
(
Id
>
0
)
{
goods_ProxyRepository
.
Insert
(
new
RB_Goods_Proxy
()
{
CreateDate
=
DateTime
.
Now
,
GoodsId
=
goodsId
,
Id
=
0
,
MallBaseId
=
goodsModel
.
MallBaseId
,
TenantId
=
goodsModel
.
TenantId
,
ProxyGoodsId
=
Id
,
ProxyMallBaseId
=
mallBaseId
,
ProxyTenantId
=
tenantId
,
Remark
=
"新增采购"
,
Status
=
0
},
trans
);
//商品分类
foreach
(
var
item
in
categoryList
)
{
goods_CategoryRepository
.
Insert
(
new
RB_Goods_Category
()
...
...
@@ -4891,6 +4909,65 @@ namespace Mall.Module.Product
return
flag
;
}
/// <summary>
/// 设置采购商品上下架
/// </summary>
/// <param name="goodsId"></param>
/// <param name="type">类型 1上架 2下架</param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
bool
SetGoodsProxyStatus
(
int
goodsId
,
int
type
,
int
tenantId
,
int
mallBaseId
)
{
var
goodsModel
=
goodsRepository
.
GetEntity
(
goodsId
);
if
(
goodsModel
==
null
)
{
return
false
;
}
if
(
goodsModel
.
IsProcurement
!=
1
)
{
return
false
;
}
if
(
goodsModel
.
ProcurementStatus
!=
1
)
{
return
false
;
}
int
GoodsStatus
=
1
;
if
(
type
==
1
)
{
if
(
goodsModel
.
GoodsStatus
!=
2
)
{
return
false
;
}
}
else
{
if
(
goodsModel
.
GoodsStatus
!=
1
)
{
return
false
;
}
GoodsStatus
=
2
;
}
var
pModel
=
goods_ProxyRepository
.
GetList
(
new
RB_Goods_Proxy_Extend
()
{
ProxyGoodsId
=
goodsId
,
ProxyMallBaseId
=
mallBaseId
,
ProxyTenantId
=
tenantId
}).
FirstOrDefault
();
if
(
pModel
==
null
)
{
return
false
;
}
var
gModel
=
goodsRepository
.
GetEntity
(
pModel
.
GoodsId
);
if
(
gModel
==
null
)
{
return
false
;
}
if
(
gModel
.
GoodsStatus
==
1
&&
gModel
.
IsProxy
==
1
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
GoodsStatus
),
GoodsStatus
},
{
nameof
(
RB_Goods
.
UpdateDate
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods
.
Id
),
FiledValue
=
goodsModel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
goodsRepository
.
Update
(
keyValues1
,
wheres1
);
}
return
false
;
}
#
endregion
#
region
商品导入
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
816b06b1
...
...
@@ -1984,6 +1984,7 @@ namespace Mall.WebApi.Controllers.MallBase
//demodel.MallBaseId = parms.MallBaseId;
demodel
.
IsProxy
=
1
;
demodel
.
IsProcurement
=
2
;
demodel
.
GoodsStatus
=
1
;
var
list
=
productModule
.
GetProductGoodsProxyPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
...
...
@@ -2020,7 +2021,8 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品id"
);
}
if
(
string
.
IsNullOrEmpty
(
CategoryStr
))
{
if
(
string
.
IsNullOrEmpty
(
CategoryStr
)
||
CategoryStr
==
"[]"
)
{
return
ApiResult
.
ParamIsNull
(
"请选择分类"
);
}
List
<
int
>
CategoryList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
CategoryStr
);
...
...
@@ -2054,6 +2056,32 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 采购商品上下架
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsProxyStatus
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
parms
.
GetInt
(
"GoodsId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
//类型 1上架 2下架
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品id"
);
}
bool
flag
=
productModule
.
SetGoodsProxyStatus
(
GoodsId
,
Type
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
#
region
商品导入
...
...
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