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
3c096e6d
Commit
3c096e6d
authored
Jul 29, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
de613f47
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
876 additions
and
29 deletions
+876
-29
PropertyCheckStatusEnum.cs
Mall.Common/Enum/Property/PropertyCheckStatusEnum.cs
+29
-0
PropertyStatusEnum.cs
Mall.Common/Enum/Property/PropertyStatusEnum.cs
+65
-0
RB_Supplies_Check.cs
Mall.Model/Entity/Property/RB_Supplies_Check.cs
+147
-0
RB_Supplies_CheckDetail.cs
Mall.Model/Entity/Property/RB_Supplies_CheckDetail.cs
+171
-0
RB_Supplies_CheckDetail_Extend.cs
Mall.Model/Extend/Property/RB_Supplies_CheckDetail_Extend.cs
+48
-0
RB_Supplies_Check_Extend.cs
Mall.Model/Extend/Property/RB_Supplies_Check_Extend.cs
+21
-0
PropertyModule.cs
Mall.Module.Property/PropertyModule.cs
+142
-2
RB_Supplies_CheckDetailRepository.cs
....Repository/Property/RB_Supplies_CheckDetailRepository.cs
+102
-0
RB_Supplies_CheckRepository.cs
Mall.Repository/Property/RB_Supplies_CheckRepository.cs
+92
-0
PropertyController.cs
Mall.WebApi/Controllers/Property/PropertyController.cs
+59
-27
No files found.
Mall.Common/Enum/Property/PropertyCheckStatusEnum.cs
0 → 100644
View file @
3c096e6d
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Common.Enum.Property
{
/// <summary>
/// 数据状态
/// </summary>
public
enum
SuppliesCheckStatusEnum
{
/// <summary>
/// 盘点中
/// </summary>
[
EnumField
(
"盘点中"
)]
InTheInventory
=
1
,
/// <summary>
/// 已完成
/// </summary>
[
EnumField
(
"已完成"
)]
Completed
=
2
,
/// <summary>
/// 已取消
/// </summary>
[
EnumField
(
"已取消"
)]
Cancel
=
3
}
}
Mall.Common/Enum/Property/PropertyStatusEnum.cs
0 → 100644
View file @
3c096e6d
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Common.Enum.Property
{
/// <summary>
/// 数据状态
/// </summary>
public
enum
PropertyStatusEnum
{
/// <summary>
/// 空闲
/// </summary>
[
EnumField
(
"空闲"
)]
Leisure
=
1
,
/// <summary>
/// 领用
/// </summary>
[
EnumField
(
"领用"
)]
Receive
=
2
,
/// <summary>
/// 借用
/// </summary>
[
EnumField
(
"借用"
)]
Borrow
=
3
,
/// <summary>
/// 调拨中
/// </summary>
[
EnumField
(
"调拨中"
)]
AllotW
=
4
,
/// <summary>
/// 领用待确认
/// </summary>
[
EnumField
(
"领用待确认"
)]
ReceiveW
=
5
,
/// <summary>
/// 退库待确认
/// </summary>
[
EnumField
(
"退库待确认"
)]
CancellingStocksW
=
6
,
/// <summary>
/// 借用待确认
/// </summary>
[
EnumField
(
"借用待确认"
)]
BorrowW
=
7
,
/// <summary>
/// 归还待确认
/// </summary>
[
EnumField
(
"归还待确认"
)]
GiveBackW
=
8
,
/// <summary>
/// 处置待确认
/// </summary>
[
EnumField
(
"处置待确认"
)]
DisposeW
=
9
,
/// <summary>
/// 已处置
/// </summary>
[
EnumField
(
"已处置"
)]
Dispose
=
10
}
}
Mall.Model/Entity/Property/RB_Supplies_Check.cs
0 → 100644
View file @
3c096e6d
using
Mall.Common.AOP
;
using
Mall.Common.Enum.Property
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Property
{
/// <summary>
/// 耗材盘点实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_Check
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 期数
/// </summary>
public
string
Periods
{
get
;
set
;
}
/// <summary>
/// 开始时间
/// </summary>
public
DateTime
?
StartDate
{
get
;
set
;
}
/// <summary>
/// 结束时间
/// </summary>
public
DateTime
?
EndDate
{
get
;
set
;
}
/// <summary>
/// 公司别 (暂不启用 都是网络印象同步的)
/// </summary>
public
int
?
BranchId
{
get
;
set
;
}
/// <summary>
/// 分类ids (暂不启用 都是电商同步的)
/// </summary>
public
string
CategoryIds
{
get
;
set
;
}
/// <summary>
/// 仓库id
/// </summary>
public
int
?
WarehouseId
{
get
;
set
;
}
/// <summary>
/// 盘点期数状态
/// </summary>
public
SuppliesCheckStatusEnum
?
CheckState
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 状态 0正常 1删除
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 公司
/// </summary>
public
int
?
RB_Branch_Id
{
get
;
set
;
}
/// <summary>
/// 集团
/// </summary>
public
int
?
RB_Group_Id
{
get
;
set
;
}
/// <summary>
/// CreateBy
/// </summary>
public
int
?
CreateBy
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateBy
/// </summary>
public
int
?
UpdateBy
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/Property/RB_Supplies_CheckDetail.cs
0 → 100644
View file @
3c096e6d
using
Mall.Common.AOP
;
using
Mall.Common.Enum.Property
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Property
{
/// <summary>
/// 耗材盘点明细实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_CheckDetail
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 盘点期数id
/// </summary>
public
int
?
CheckId
{
get
;
set
;
}
/// <summary>
/// 耗材id
/// </summary>
public
int
?
SuppliesId
{
get
;
set
;
}
/// <summary>
/// 当前库存的数量
/// </summary>
public
int
?
InventoryNum
{
get
;
set
;
}
/// <summary>
/// 实际数量
/// </summary>
public
int
?
RealityNum
{
get
;
set
;
}
/// <summary>
/// 盘点状态
/// </summary>
public
SuppliesCheckStatusEnum
?
CheckStatus
{
get
;
set
;
}
/// <summary>
/// 盘点人
/// </summary>
public
int
?
CheckEmpId
{
get
;
set
;
}
/// <summary>
/// 盘点时间
/// </summary>
public
DateTime
?
CheckDate
{
get
;
set
;
}
/// <summary>
/// 盘点图片列表 json格式
/// </summary>
public
string
Images
{
get
;
set
;
}
/// <summary>
/// 盘亏盘盈处理状态 1已处理 2未处理
/// </summary>
public
int
?
DealStatus
{
get
;
set
;
}
/// <summary>
/// 备注(报损 /报溢 需备注记录 出库单号/入库单号)
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 报损/报溢 自动生成财务单据
/// </summary>
public
int
?
FinanceId
{
get
;
set
;
}
/// <summary>
/// 状态 0正常 1删除
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 公司
/// </summary>
public
int
?
RB_Branch_Id
{
get
;
set
;
}
/// <summary>
/// 集团
/// </summary>
public
int
?
RB_Group_Id
{
get
;
set
;
}
/// <summary>
/// CreateBy
/// </summary>
public
int
?
CreateBy
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateBy
/// </summary>
public
int
?
UpdateBy
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Extend/Property/RB_Supplies_CheckDetail_Extend.cs
0 → 100644
View file @
3c096e6d
using
Mall.Common.AOP
;
using
Mall.Common.Enum.Property
;
using
Mall.Model.Entity.Property
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.Property
{
/// <summary>
/// 耗材盘点明细扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_CheckDetail_Extend
:
RB_Supplies_CheckDetail
{
/// <summary>
/// 耗材名称
/// </summary>
public
string
SuppliesName
{
get
;
set
;
}
/// <summary>
/// 耗材编码
/// </summary>
public
string
SuppliesNo
{
get
;
set
;
}
/// <summary>
/// 规格json格式
/// </summary>
public
string
SpecificationName
{
get
;
set
;
}
/// <summary>
/// 耗材的规格
/// </summary>
public
List
<
string
>
SpecificationList
{
get
;
set
;
}
/// <summary>
/// 图片列表
/// </summary>
public
List
<
string
>
ImageList
{
get
;
set
;
}
/// <summary>
/// 查询盘亏盘盈 1是
/// </summary>
public
int
?
IsSelectCheckLoss
{
get
;
set
;
}
/// <summary>
/// 只看有库存的
/// </summary>
public
int
?
IsSelectHaveInventory
{
get
;
set
;
}
}
}
Mall.Model/Extend/Property/RB_Supplies_Check_Extend.cs
0 → 100644
View file @
3c096e6d
using
Mall.Common.AOP
;
using
Mall.Model.Entity.Property
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.Property
{
/// <summary>
/// 耗材盘点扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_Check_Extend
:
RB_Supplies_Check
{
/// <summary>
/// 仓库名称
/// </summary>
public
string
WarehouseName
{
get
;
set
;
}
}
}
Mall.Module.Property/PropertyModule.cs
View file @
3c096e6d
...
@@ -7,6 +7,7 @@ using System.Text;
...
@@ -7,6 +7,7 @@ using System.Text;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
Mall.Common
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.API
;
using
Mall.Common.Enum.Property
;
using
Mall.Common.Plugin
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.Property
;
using
Mall.Model.Entity.Property
;
...
@@ -105,8 +106,14 @@ namespace Mall.Module.Property
...
@@ -105,8 +106,14 @@ namespace Mall.Module.Property
/// </summary>
/// </summary>
private
readonly
Rb_employeeRepository
erpemployeeRepository
=
new
Rb_employeeRepository
();
private
readonly
Rb_employeeRepository
erpemployeeRepository
=
new
Rb_employeeRepository
();
/// <summary>
/// 盘点单
/// </summary>
private
readonly
RB_Supplies_CheckRepository
supplies_CheckRepository
=
new
RB_Supplies_CheckRepository
();
/// <summary>
/// 盘点明细
/// </summary>
private
readonly
RB_Supplies_CheckDetailRepository
supplies_CheckDetailRepository
=
new
RB_Supplies_CheckDetailRepository
();
#
region
获取采购单
#
region
获取采购单
/// <summary>
/// <summary>
...
@@ -1290,5 +1297,138 @@ namespace Mall.Module.Property
...
@@ -1290,5 +1297,138 @@ namespace Mall.Module.Property
return
supplies_MaterialRepository
.
GetList
(
dmodel
);
return
supplies_MaterialRepository
.
GetList
(
dmodel
);
}
}
#
endregion
#
endregion
#
region
盘点
/// <summary>
/// 获取盘点单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="demodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Check_Extend
>
GetSuppliesCheckPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_Check_Extend
demodel
,
out
long
count
)
{
var
list
=
supplies_CheckRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
if
(
list
.
Any
())
{
//查询仓库
var
wlist
=
supplies_WareHouseRepository
.
GetList
(
new
RB_Supplies_WareHouse_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
WareHouseIdStr
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
WarehouseId
??
0
).
Distinct
())
});
foreach
(
var
item
in
list
)
{
var
wmodel
=
wlist
.
Where
(
x
=>
x
.
Id
==
item
.
WarehouseId
).
FirstOrDefault
();
item
.
WarehouseName
=
wmodel
?.
Name
??
""
;
}
}
return
list
;
}
/// <summary>
/// 根据条件获取盘点列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Check_Extend
>
GetSuppliesCheckList
(
RB_Supplies_Check_Extend
dmodel
)
{
return
supplies_CheckRepository
.
GetList
(
dmodel
);
}
/// <summary>
/// 获取盘点单
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
RB_Supplies_Check_Extend
GetSuppliesCheck
(
int
Id
)
{
return
supplies_CheckRepository
.
GetEntity
<
RB_Supplies_Check_Extend
>(
Id
);
}
/// <summary>
/// 盘点单复盘
/// </summary>
/// <param name="checkId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
RepeatSuppliesCheck
(
int
checkId
,
UserInfo
userInfo
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_Check_Extend
.
CheckState
),
SuppliesCheckStatusEnum
.
InTheInventory
},
{
nameof
(
RB_Supplies_Check_Extend
.
UpdateBy
),
userInfo
.
ERPEmpId
},
{
nameof
(
RB_Supplies_Check_Extend
.
UpdateDate
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_Check_Extend
.
Id
),
FiledValue
=
checkId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
supplies_CheckRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//是否需要重置盘点明细的盘点状态
}
return
flag
;
}
/// <summary>
/// 获取盘点单明细分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="demodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_CheckDetail_Extend
>
GetSuppliesCheckDetailPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_CheckDetail_Extend
demodel
,
out
long
count
)
{
var
list
=
supplies_CheckDetailRepository
.
GetPageList
(
pageIndex
,
pageSize
,
demodel
,
out
count
);
if
(
list
.
Any
())
{
//组装规格
foreach
(
var
item
in
list
)
{
item
.
SpecificationList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
SpecificationName
)
&&
item
.
SpecificationName
!=
"[]"
)
{
item
.
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
SpecificationName
);
}
item
.
ImageList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
Images
)
&&
item
.
Images
!=
"[]"
)
{
item
.
ImageList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
Images
);
}
}
}
return
list
;
}
/// <summary>
/// 验证盘点单状态
/// </summary>
/// <param name="checkDetailId"></param>
/// <returns></returns>
public
bool
ValidataSuppliesCheckDetail
(
int
checkDetailId
)
{
var
model
=
supplies_CheckDetailRepository
.
GetEntity
(
checkDetailId
);
var
cmodel
=
supplies_CheckRepository
.
GetEntity
(
model
?.
CheckId
??
0
);
if
(
cmodel
!=
null
&&
cmodel
.
CheckState
==
SuppliesCheckStatusEnum
.
InTheInventory
)
{
return
false
;
}
return
true
;
}
#
endregion
}
}
}
}
Mall.Repository/Property/RB_Supplies_CheckDetailRepository.cs
0 → 100644
View file @
3c096e6d
using
Mall.Model.Entity.Property
;
using
Mall.Model.Extend.Property
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.Property
{
/// <summary>
/// 耗材盘点明细仓储类
/// </summary>
public
partial
class
RB_Supplies_CheckDetailRepository
:
RepositoryBase
<
RB_Supplies_CheckDetail
>
{
/// <summary>
/// 获取盘点分页数据
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="dmodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_CheckDetail_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_CheckDetail_Extend
dmodel
,
out
long
count
)
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND cd.{0}={1}"
,
nameof
(
RB_Supplies_CheckDetail_Extend
.
Status
),
0
);
where
+=
$@" and cd.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
SuppliesId
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
SuppliesId
)
+
"="
+
dmodel
.
SuppliesId
;
}
if
(
dmodel
.
CheckId
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckId
)
+
"="
+
dmodel
.
CheckId
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
SuppliesName
))
{
where
+=
" and pi."
+
nameof
(
RB_Supplies_Material
.
Name
)
+
" like '%"
+
dmodel
.
SuppliesName
+
"%'"
;
}
if
(
dmodel
.
CheckStatus
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
"="
+
(
int
)
dmodel
.
CheckStatus
;
}
if
(
dmodel
.
DealStatus
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
DealStatus
)
+
"="
+
dmodel
.
DealStatus
;
}
if
(
dmodel
.
IsSelectCheckLoss
==
1
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
" in(3,4)"
;
}
if
(
dmodel
.
IsSelectHaveInventory
==
1
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
InventoryNum
)
+
">0"
;
}
string
sql
=
$@" select cd.*,pi.Name as SuppliesName,pi.SuppliesNum as SuppliesNo,pi.SpecificationName from RB_Supplies_CheckDetail cd
left join rb_supplies_material pi on cd.SuppliesId=pi.Id
{
where
}
order by cd.Id desc"
;
return
GetPage
<
RB_Supplies_CheckDetail_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 根据条件获取盘点列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_CheckDetail_Extend
>
GetList
(
RB_Supplies_CheckDetail_Extend
dmodel
)
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND cd.{0}={1}"
,
nameof
(
RB_Supplies_CheckDetail_Extend
.
Status
),
0
);
where
+=
$@" and cd.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
SuppliesId
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
SuppliesId
)
+
"="
+
dmodel
.
SuppliesId
;
}
if
(
dmodel
.
CheckId
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckId
)
+
"="
+
dmodel
.
CheckId
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
SuppliesName
))
{
where
+=
" and pi."
+
nameof
(
RB_Supplies_Material
.
Name
)
+
" like '%"
+
dmodel
.
SuppliesName
+
"%'"
;
}
if
(
dmodel
.
CheckStatus
>
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
"="
+
(
int
)
dmodel
.
CheckStatus
;
}
if
(
dmodel
.
DealStatus
>=
0
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
DealStatus
)
+
"="
+
dmodel
.
DealStatus
;
}
if
(
dmodel
.
IsSelectCheckLoss
==
1
)
{
where
+=
" and cd."
+
nameof
(
RB_Supplies_CheckDetail_Extend
.
CheckStatus
)
+
" in(3,4)"
;
}
string
sql
=
$@" select cd.*,pi.Name as SuppliesName,pi.SuppliesNo,pi.SpecificationName from RB_Supplies_CheckDetail cd
left join rb_supplies_material pi on cd.SuppliesId=pi.Id
{
where
}
order by cd.Id desc"
;
return
Get
<
RB_Supplies_CheckDetail_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Property/RB_Supplies_CheckRepository.cs
0 → 100644
View file @
3c096e6d
using
Mall.Model.Entity.Property
;
using
Mall.Model.Extend.Property
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.Property
{
/// <summary>
/// 耗材盘点仓储类
/// </summary>
public
partial
class
RB_Supplies_CheckRepository
:
RepositoryBase
<
RB_Supplies_Check
>
{
/// <summary>
/// 获取盘点分页数据
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="dmodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Check_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_Check_Extend
dmodel
,
out
long
count
)
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND {0}={1}"
,
nameof
(
RB_Supplies_Check_Extend
.
Status
),
0
);
where
+=
$@" and RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
BranchId
>
-
1
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
BranchId
)
+
"="
+
dmodel
.
BranchId
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
Periods
))
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
Periods
)
+
" like '%"
+
dmodel
.
Periods
+
"%'"
;
}
if
(
dmodel
.
WarehouseId
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
WarehouseId
)
+
"="
+
dmodel
.
WarehouseId
;
}
if
(
dmodel
.
CheckState
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
CheckState
)
+
"="
+
(
int
)
dmodel
.
CheckState
;
}
string
sql
=
$@" select * from RB_Supplies_Check
{
where
}
order by Id desc"
;
return
GetPage
<
RB_Supplies_Check_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 根据条件获取盘点列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Check_Extend
>
GetList
(
RB_Supplies_Check_Extend
dmodel
)
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND {0}={1}"
,
nameof
(
RB_Supplies_Check_Extend
.
Status
),
0
);
where
+=
$@" and RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
BranchId
>
-
1
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
BranchId
)
+
"="
+
dmodel
.
BranchId
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
Periods
))
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
Periods
)
+
" like '%"
+
dmodel
.
Periods
+
"%'"
;
}
if
(
dmodel
.
StartDate
.
HasValue
)
{
where
+=
$" and nameof(RB_Supplies_Check_Extend.StartDate) >=
{
dmodel
.
StartDate
}
"
;
}
if
(
dmodel
.
EndDate
.
HasValue
)
{
where
+=
$" and nameof(RB_Supplies_Check_Extend.StartDate) <=
{
dmodel
.
EndDate
}
"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
Periods
))
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
Periods
)
+
" like '%"
+
dmodel
.
Periods
+
"%'"
;
}
if
(
dmodel
.
WarehouseId
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
WarehouseId
)
+
"="
+
dmodel
.
WarehouseId
;
}
if
(
dmodel
.
CheckState
.
HasValue
&&
dmodel
.
CheckState
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Supplies_Check_Extend
.
CheckState
)
+
"="
+
(
int
)
dmodel
.
CheckState
;
}
string
sql
=
$@" select * from RB_Supplies_Check
{
where
}
order by Id desc"
;
return
Get
<
RB_Supplies_Check_Extend
>(
sql
).
ToList
();
}
}
}
Mall.WebApi/Controllers/Property/PropertyController.cs
View file @
3c096e6d
...
@@ -56,14 +56,15 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -56,14 +56,15 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
TotalNumber
,
x
.
TotalNumber
,
x
.
Remark
,
x
.
Remark
,
x
.
StockInStatus
,
x
.
StockInStatus
,
DetailList
=
x
.
DetailList
.
Select
(
y
=>
new
DetailList
=
x
.
DetailList
.
Select
(
y
=>
new
{
{
y
.
Id
,
y
.
Id
,
y
.
MaterialId
,
y
.
MaterialId
,
y
.
CostMoney
,
y
.
CostMoney
,
y
.
Number
,
y
.
Number
,
y
.
StockInNum
,
y
.
StockInNum
,
MaterialModel
=
new
{
MaterialModel
=
new
{
y
.
MaterialModel
.
Name
,
y
.
MaterialModel
.
Name
,
y
.
MaterialModel
.
SuppliesNum
,
y
.
MaterialModel
.
SuppliesNum
,
y
.
MaterialModel
.
Units
,
y
.
MaterialModel
.
Units
,
...
@@ -87,17 +88,19 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -87,17 +88,19 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetProcurementInfo
()
public
ApiResult
GetProcurementInfo
()
{
{
var
requestParm
=
RequestParm
;
var
requestParm
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
int
ProcurementId
=
parms
.
GetInt
(
"ProcurementId"
,
0
);
int
ProcurementId
=
parms
.
GetInt
(
"ProcurementId"
,
0
);
if
(
ProcurementId
<=
0
)
{
if
(
ProcurementId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
}
var
model
=
propertyModule
.
GetProcurementInfo
(
ProcurementId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
,
requestParm
.
ERPGroupId
);
var
model
=
propertyModule
.
GetProcurementInfo
(
ProcurementId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
,
requestParm
.
ERPGroupId
);
return
ApiResult
.
Success
(
""
,
new
{
return
ApiResult
.
Success
(
""
,
new
{
model
.
Id
,
model
.
Id
,
model
.
WareHouseId
,
model
.
WareHouseId
,
model
.
WareHouseName
,
model
.
WareHouseName
,
...
@@ -151,7 +154,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -151,7 +154,8 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
CoverImage
,
x
.
CoverImage
,
x
.
CostPrice
,
x
.
CostPrice
,
x
.
IsCustomSpecification
,
x
.
IsCustomSpecification
,
SpecificationList
=
x
.
SpecificationPriceList
.
Select
(
y
=>
new
{
SpecificationList
=
x
.
SpecificationPriceList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
Id
,
y
.
GoodsId
,
y
.
GoodsId
,
y
.
GoodsNumbers
,
y
.
GoodsNumbers
,
...
@@ -169,7 +173,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -169,7 +173,7 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetProcurementInfo
()
public
ApiResult
SetProcurementInfo
()
{
{
var
requestParm
=
RequestParm
;
var
requestParm
=
RequestParm
;
RB_Procurement_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Procurement_Extend
>(
requestParm
.
msg
.
ToString
());
RB_Procurement_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Procurement_Extend
>(
requestParm
.
msg
.
ToString
());
...
@@ -181,43 +185,54 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -181,43 +185,54 @@ namespace Mall.WebApi.Controllers.MallBase
{
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
}
if
(
requestParm
.
EmpId
<=
0
)
{
if
(
requestParm
.
EmpId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
}
if
(
demodel
.
IsPublic
<
0
)
{
if
(
demodel
.
IsPublic
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择账户类型"
);
return
ApiResult
.
ParamIsNull
(
"请选择账户类型"
);
}
}
if
((
demodel
.
SupplierId
??
0
)
<=
0
)
{
if
((
demodel
.
SupplierId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递供应商"
);
return
ApiResult
.
ParamIsNull
(
"请传递供应商"
);
}
}
if
((
demodel
.
WareHouseId
??
0
)
<=
0
)
{
if
((
demodel
.
WareHouseId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递仓库id"
);
return
ApiResult
.
ParamIsNull
(
"请传递仓库id"
);
}
}
if
(
demodel
.
DetailList
==
null
||
!
demodel
.
DetailList
.
Any
())
{
if
(
demodel
.
DetailList
==
null
||
!
demodel
.
DetailList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请选择商品"
);
return
ApiResult
.
ParamIsNull
(
"请选择商品"
);
}
}
if
(
demodel
.
DetailList
.
Count
()
!=
demodel
.
DetailList
.
Select
(
x
=>
x
.
GoodsId
+
","
+
x
.
SpecificationKey
).
Distinct
().
Count
())
{
if
(
demodel
.
DetailList
.
Count
()
!=
demodel
.
DetailList
.
Select
(
x
=>
x
.
GoodsId
+
","
+
x
.
SpecificationKey
).
Distinct
().
Count
())
{
return
ApiResult
.
ParamIsNull
(
"商品有重复数据"
);
return
ApiResult
.
ParamIsNull
(
"商品有重复数据"
);
}
}
foreach
(
var
item
in
demodel
.
DetailList
)
{
foreach
(
var
item
in
demodel
.
DetailList
)
if
(
item
.
GoodsId
<=
0
)
{
{
if
(
item
.
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"商品id未传递"
);
return
ApiResult
.
ParamIsNull
(
"商品id未传递"
);
}
}
if
((
item
.
CostMoney
??
0
)
<=
0
)
{
if
((
item
.
CostMoney
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入价格"
);
return
ApiResult
.
ParamIsNull
(
"请输入价格"
);
}
}
if
((
item
.
Number
??
0
)
<=
0
)
{
if
((
item
.
Number
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入数量"
);
return
ApiResult
.
ParamIsNull
(
"请输入数量"
);
}
}
}
}
string
msg
=
propertyModule
.
SetProcurementInfo
(
demodel
,
requestParm
.
ERPEmpId
,
requestParm
.
ERPBranchId
,
requestParm
.
ERPGroupId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
,
requestParm
.
EmpId
);
string
msg
=
propertyModule
.
SetProcurementInfo
(
demodel
,
requestParm
.
ERPEmpId
,
requestParm
.
ERPBranchId
,
requestParm
.
ERPGroupId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
,
requestParm
.
EmpId
);
if
(
msg
==
""
)
if
(
msg
==
""
)
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
(
msg
);
return
ApiResult
.
Failed
(
msg
);
}
}
}
}
...
@@ -231,7 +246,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -231,7 +246,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetProcurementStockIn
()
{
public
ApiResult
SetProcurementStockIn
()
{
var
requestParm
=
RequestParm
;
var
requestParm
=
RequestParm
;
RB_Procurement_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Procurement_Extend
>(
requestParm
.
msg
.
ToString
());
RB_Procurement_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Procurement_Extend
>(
requestParm
.
msg
.
ToString
());
...
@@ -248,9 +264,14 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -248,9 +264,14 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
}
if
(
demodel
.
Id
<=
0
)
{
if
(
demodel
.
Id
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递采购单id"
);
return
ApiResult
.
ParamIsNull
(
"请传递采购单id"
);
}
}
if
(
demodel
.
WareHouseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递仓库id"
);
}
if
(
demodel
.
DetailList
==
null
||
!
demodel
.
DetailList
.
Any
())
if
(
demodel
.
DetailList
==
null
||
!
demodel
.
DetailList
.
Any
())
{
{
return
ApiResult
.
ParamIsNull
(
"请选择商品"
);
return
ApiResult
.
ParamIsNull
(
"请选择商品"
);
...
@@ -272,6 +293,12 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -272,6 +293,12 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
}
}
//判断当前仓库是否在盘点中2020-07-28 Add By:W
var
suppliesCheckList
=
propertyModule
.
GetSuppliesCheckList
(
new
RB_Supplies_Check_Extend
{
RB_Group_Id
=
requestParm
.
ERPGroupId
,
StartDate
=
System
.
DateTime
.
Now
,
EndDate
=
System
.
DateTime
.
Now
,
WarehouseId
=
demodel
.
WareHouseId
??
0
,
CheckState
=
Common
.
Enum
.
Property
.
SuppliesCheckStatusEnum
.
InTheInventory
});
if
(
suppliesCheckList
!=
null
&&
suppliesCheckList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"仓库盘点中,不能入库"
);
}
string
msg
=
propertyModule
.
SetProcurementStockIn
(
demodel
,
requestParm
.
ERPEmpId
,
requestParm
.
ERPBranchId
,
requestParm
.
ERPGroupId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
,
requestParm
.
EmpId
);
string
msg
=
propertyModule
.
SetProcurementStockIn
(
demodel
,
requestParm
.
ERPEmpId
,
requestParm
.
ERPBranchId
,
requestParm
.
ERPGroupId
,
requestParm
.
TenantId
,
requestParm
.
MallBaseId
,
requestParm
.
EmpId
);
if
(
msg
==
""
)
if
(
msg
==
""
)
{
{
...
@@ -288,7 +315,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -288,7 +315,7 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetProcurementSotckInBatchList
()
public
ApiResult
GetProcurementSotckInBatchList
()
{
{
var
requestParm
=
RequestParm
;
var
requestParm
=
RequestParm
;
if
(
requestParm
.
ERPEmpId
<=
0
)
if
(
requestParm
.
ERPEmpId
<=
0
)
...
@@ -319,7 +346,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -319,7 +346,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetProcurementStockInLableList
()
{
public
ApiResult
GetProcurementStockInLableList
()
{
var
requestParm
=
RequestParm
;
var
requestParm
=
RequestParm
;
if
(
requestParm
.
ERPEmpId
<=
0
)
if
(
requestParm
.
ERPEmpId
<=
0
)
{
{
...
@@ -359,7 +387,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -359,7 +387,8 @@ namespace Mall.WebApi.Controllers.MallBase
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
requestParm
.
msg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
requestParm
.
msg
.
ToString
());
RB_Supplies_Material_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_Material_Extend
>(
requestParm
.
msg
.
ToString
());
RB_Supplies_Material_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_Material_Extend
>(
requestParm
.
msg
.
ToString
());
if
(
requestParm
.
ERPEmpId
<=
0
)
{
if
(
requestParm
.
ERPEmpId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
}
...
@@ -392,7 +421,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -392,7 +421,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetSyncGoodsToMaterial
()
{
public
ApiResult
SetSyncGoodsToMaterial
()
{
var
requestParm
=
RequestParm
;
var
requestParm
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
//int WareHouseId = parms.GetInt("WareHouseId", 0);//仓库id
//int WareHouseId = parms.GetInt("WareHouseId", 0);//仓库id
...
@@ -411,7 +441,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -411,7 +441,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
{
return
ApiResult
.
ParamIsNull
(
"分类格式有误"
);
return
ApiResult
.
ParamIsNull
(
"分类格式有误"
);
}
}
if
(
requestParm
.
ERPEmpId
<=
0
)
{
if
(
requestParm
.
ERPEmpId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递关联ERP用户id"
);
return
ApiResult
.
ParamIsNull
(
"请传递关联ERP用户id"
);
}
}
...
@@ -420,7 +451,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -420,7 +451,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
();
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