Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PropertyEdu
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
liudong1993
PropertyEdu
Commits
ee015e96
Commit
ee015e96
authored
May 06, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
耗材入库
parent
dedea2ef
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1205 additions
and
11 deletions
+1205
-11
FinanceConfigTypeEnum.cs
Property.Common/Enum/Edu/FinanceConfigTypeEnum.cs
+2
-2
RB_Property_Category.cs
Property.Model/Entity/Property/RB_Property_Category.cs
+5
-0
RB_Supplies_Material.cs
Property.Model/Entity/Supplies/RB_Supplies_Material.cs
+5
-0
RB_Supplies_Procurement.cs
Property.Model/Entity/Supplies/RB_Supplies_Procurement.cs
+110
-0
RB_Supplies_ProcurementDetail.cs
...ty.Model/Entity/Supplies/RB_Supplies_ProcurementDetail.cs
+71
-0
RB_Supplies_ProcurementDetail_Extend.cs
...l/Extend/Supplies/RB_Supplies_ProcurementDetail_Extend.cs
+55
-0
RB_Supplies_Procurement_Extend.cs
...y.Model/Extend/Supplies/RB_Supplies_Procurement_Extend.cs
+65
-0
PropertyModule.cs
Property.Modele.FixedAssets/PropertyModule.cs
+12
-3
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+501
-0
RB_Property_ProcurementRepository.cs
....Repository/Property/RB_Property_ProcurementRepository.cs
+2
-2
RB_Supplies_ProcurementDetailRepository.cs
...itory/Supplies/RB_Supplies_ProcurementDetailRepository.cs
+69
-0
RB_Supplies_ProcurementRepository.cs
....Repository/Supplies/RB_Supplies_ProcurementRepository.cs
+98
-0
PropertyController.cs
Property.WebApi/Controllers/Property/PropertyController.cs
+6
-2
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+204
-2
No files found.
Property.Common/Enum/Edu/FinanceConfigTypeEnum.cs
View file @
ee015e96
...
...
@@ -36,9 +36,9 @@ namespace REBORN.Common.Enum
[
EnumField
(
"耗材采购"
)]
SuppliesPurchase
=
5
,
/// <summary>
/// 耗材
成本
/// 耗材
费用(直接制费用单)
/// </summary>
[
EnumField
(
"耗材
成本
"
)]
[
EnumField
(
"耗材
费用
"
)]
SuppliesCost
=
6
,
/// <summary>
/// 耗材出库
...
...
Property.Model/Entity/Property/RB_Property_Category.cs
View file @
ee015e96
...
...
@@ -113,5 +113,10 @@ namespace Property.Model.Entity
/// 排序
/// </summary>
public
int
?
Sort
{
get
;
set
;
}
/// <summary>
/// 费用类型 1 采购 2 费用 (主对应制财务单据时,费用类型不同)
/// </summary>
public
int
FeeType
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Model/Entity/Supplies/RB_Supplies_Material.cs
View file @
ee015e96
...
...
@@ -202,5 +202,10 @@ namespace Property.Model.Entity
/// 商品分类名称
/// </summary>
public
string
GoodsCategoryName
{
get
;
set
;
}
/// <summary>
/// 费用类型 1成本 2费用 (对应制单时使用的费用类型)
/// </summary>
public
int
FeeType
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Model/Entity/Supplies/RB_Supplies_Procurement.cs
0 → 100644
View file @
ee015e96
using
System
;
using
REBORN.Common.AOP
;
using
REBORN.Common.Plugin
;
namespace
Property.Model.Entity
{
/// <summary>
/// 耗材采购实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_Procurement
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 采购仓库
/// </summary>
public
int
WareHouseId
{
get
;
set
;
}
/// <summary>
/// 总成本
/// </summary>
public
decimal
TotalCostMoney
{
get
;
set
;
}
/// <summary>
/// 总数量
/// </summary>
public
int
TotalNumber
{
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
;
}
/// <summary>
/// 财务单据id
/// </summary>
public
int
FinanceId
{
get
;
set
;
}
/// <summary>
/// 供应商id
/// </summary>
public
int
SupplierId
{
get
;
set
;
}
/// <summary>
/// 供应商名称
/// </summary>
public
string
SupplierName
{
get
;
set
;
}
/// <summary>
/// 入库状态 1未入库 2部分入库 3已入库
/// </summary>
public
int
StockInStatus
{
get
;
set
;
}
/// <summary>
/// 校区id
/// </summary>
public
int
SchoolId
{
get
;
set
;
}
/// <summary>
/// 请购单id
/// </summary>
public
int
BuyingRequisitionId
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Model/Entity/Supplies/RB_Supplies_ProcurementDetail.cs
0 → 100644
View file @
ee015e96
using
System
;
using
REBORN.Common.AOP
;
using
REBORN.Common.Plugin
;
namespace
Property.Model.Entity
{
/// <summary>
/// 耗材采购明细实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_ProcurementDetail
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 采购单id
/// </summary>
public
int
ProcurementId
{
get
;
set
;
}
/// <summary>
/// 物料id
/// </summary>
public
int
MaterialId
{
get
;
set
;
}
/// <summary>
/// 采购数量
/// </summary>
public
int
Number
{
get
;
set
;
}
/// <summary>
/// 成本价格
/// </summary>
public
decimal
CostMoney
{
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>
/// 已入库的数量
/// </summary>
public
int
StockInNum
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Model/Extend/Supplies/RB_Supplies_ProcurementDetail_Extend.cs
0 → 100644
View file @
ee015e96
using
System
;
using
System.Collections.Generic
;
using
Property.Model.Entity
;
using
REBORN.Common.AOP
;
namespace
Property.Model.Extend
{
/// <summary>
/// 耗材采购明细扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_ProcurementDetail_Extend
:
RB_Supplies_ProcurementDetail
{
/// <summary>
/// 采购ids
/// </summary>
public
string
ProcurementIds
{
get
;
set
;
}
/// <summary>
/// 分类名称
/// </summary>
public
string
CategoryName
{
get
;
set
;
}
/// <summary>
/// 分类id
/// </summary>
public
int
CategoryId
{
get
;
set
;
}
/// <summary>
/// 待入库数量
/// </summary>
public
int
WaitStockInNum
{
get
;
set
;
}
/// <summary>
/// 物料名称
/// </summary>
public
string
SuppliesName
{
get
;
set
;
}
/// <summary>
/// 物料编码
/// </summary>
public
string
SuppliesNum
{
get
;
set
;
}
/// <summary>
/// 品牌
/// </summary>
public
string
BrandName
{
get
;
set
;
}
/// <summary>
/// 单位
/// </summary>
public
string
Units
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Model/Extend/Supplies/RB_Supplies_Procurement_Extend.cs
0 → 100644
View file @
ee015e96
using
System
;
using
System.Collections.Generic
;
using
Property.Model.Entity
;
using
REBORN.Common.AOP
;
namespace
Property.Model.Extend
{
/// <summary>
/// 耗材采购扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Supplies_Procurement_Extend
:
RB_Supplies_Procurement
{
/// <summary>
/// 采购单Id
/// </summary>
public
int
ProcurementId
{
get
;
set
;
}
/// <summary>
/// 账户类型
/// </summary>
public
int
IsPublic
{
get
;
set
;
}
/// <summary>
/// 开始时间
/// </summary>
public
string
StartTime
{
get
;
set
;
}
/// <summary>
/// 结束时间
/// </summary>
public
string
EndTime
{
get
;
set
;
}
/// <summary>
/// 发起人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 学校名称
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
/// <summary>
/// 物料名称
/// </summary>
public
string
SuppliesName
{
get
;
set
;
}
/// <summary>
/// 仓库名称
/// </summary>
public
string
WareHouseName
{
get
;
set
;
}
/// <summary>
/// 入库日期
/// </summary>
public
string
StockInDate
{
get
;
set
;
}
/// <summary>
/// 明细列表
/// </summary>
public
List
<
RB_Supplies_ProcurementDetail_Extend
>
DetailList
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Modele.FixedAssets/PropertyModule.cs
View file @
ee015e96
...
...
@@ -147,6 +147,7 @@ namespace Property.Module.FixedAssets
{
nameof
(
RB_Property_Category_Extend
.
Tier
),
demodel
.
Tier
},
{
nameof
(
RB_Property_Category_Extend
.
UpdateBy
),
demodel
.
UpdateBy
},
{
nameof
(
RB_Property_Category_Extend
.
UpdateDate
),
demodel
.
UpdateDate
},
{
nameof
(
RB_Property_Category_Extend
.
FeeType
),
demodel
.
FeeType
},
};
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
...
...
@@ -3521,10 +3522,12 @@ namespace Property.Module.FixedAssets
public
object
GetPropertyIndexTask
(
UserInfo
userInfo
)
{
object
Robj
=
new
object
();
//请购
带
我审核
//请购
待
我审核
int
BRWaitCount
=
property_BuyingRequisitionRepository
.
GetBuyingRequisitionWaitMyAuditCount
(
new
RB_Property_BuyingRequisition_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
AuditEmId
=
userInfo
.
EmployeeId
});
//请购
带
我处理
//请购
待
我处理
int
BRWaitDeal
=
property_BuyingRequisitionRepository
.
GetBuyingRequisitionWaitMyAuditCount
(
new
RB_Property_BuyingRequisition_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
ManagersId
=
userInfo
.
EmployeeId
,
IsWaitDeal
=
1
});
//请购驳回
int
BRRejectCount
=
property_BuyingRequisitionRepository
.
GetBuyingRequisitionWaitMyAuditCount
(
new
RB_Property_BuyingRequisition_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
CreateBy
=
userInfo
.
EmployeeId
,
BuyStatus
=
BuyingRequisitionStatusEnum
.
Reject
});
//待我签字
int
SignCount
=
useReceiveRepository
.
GetPropertyWaitMySignCount
(
new
RB_Property_UseReceive_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
AuditEmId
=
userInfo
.
EmployeeId
});
//待我审核
...
...
@@ -3555,7 +3558,10 @@ namespace Property.Module.FixedAssets
RejectCount
,
MyProperty
,
MaturityCount
,
SafeCount
SafeCount
,
BRWaitCount
,
BRWaitDeal
,
BRRejectCount
};
}
...
...
@@ -4445,6 +4451,9 @@ namespace Property.Module.FixedAssets
if
(
bmodel
.
ProcurementId
>
0
)
{
return
ApiResult
.
ParamIsNull
(
"已经生成采购,无法再次生成"
);
}
if
(
bmodel
.
Type
!=
1
)
{
return
ApiResult
.
ParamIsNull
(
"该请购单不是资产类型"
);
}
}
var
configModel
=
finance_ConfigRepository
.
GetList
(
new
RB_Finance_Config_ViewModel
()
{
Group_Id
=
userInfo
.
RB_Group_id
,
Type
=
FinanceConfigTypeEnum
.
AssetPurchase
}).
FirstOrDefault
();
if
(
configModel
==
null
)
{
return
ApiResult
.
Failed
(
"未配置费用/流程信息,请联系管理员"
);
}
...
...
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
ee015e96
This diff is collapsed.
Click to expand it.
Property.Repository/Property/RB_Property_ProcurementRepository.cs
View file @
ee015e96
...
...
@@ -50,7 +50,7 @@ namespace Property.Repository
string
sql
=
$@" select pc.* from RB_Property_Procurement pc
left join rb_property_procurementdetail pc2 on pc.Id=pc2.ProcurementId
{
where
}
order by pc.Id desc"
;
{
where
}
group by pc.Id
order by pc.Id desc"
;
return
GetPage
<
RB_Property_Procurement_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
...
...
@@ -89,7 +89,7 @@ left join rb_property_procurementdetail pc2 on pc.Id=pc2.ProcurementId
string
sql
=
$@" select pc.* from RB_Property_Procurement pc
left join rb_property_procurementdetail pc2 on pc.Id=pc2.ProcurementId
{
where
}
order by pc.Id desc"
;
{
where
}
group by pc.Id
order by pc.Id desc"
;
return
Get
<
RB_Property_Procurement_Extend
>(
sql
).
ToList
();
}
}
...
...
Property.Repository/Supplies/RB_Supplies_ProcurementDetailRepository.cs
0 → 100644
View file @
ee015e96
using
Property.Model.Entity
;
using
Property.Model.Extend
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Dapper
;
namespace
Property.Repository
{
/// <summary>
/// 耗材采购明细仓储类
/// </summary>
public
partial
class
RB_Supplies_ProcurementDetailRepository
:
RepositoryBase
<
RB_Supplies_ProcurementDetail
>
{
/// <summary>
/// 获取岗位分页数据
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="dmodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_ProcurementDetail_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_ProcurementDetail_Extend
dmodel
,
out
long
count
)
{
DynamicParameters
parms
=
new
DynamicParameters
();
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND pc.{0}={1}"
,
nameof
(
RB_Supplies_ProcurementDetail_Extend
.
Status
),
0
);
where
+=
$@" and pc.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
ProcurementId
>
0
)
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_ProcurementDetail_Extend
.
ProcurementId
)
+
"="
+
dmodel
.
ProcurementId
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ProcurementIds
))
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_ProcurementDetail_Extend
.
ProcurementId
)
+
" in("
+
dmodel
.
ProcurementIds
+
")"
;
}
string
sql
=
$@" select pc.* from RB_Supplies_ProcurementDetail pc
{
where
}
order by pc.Id desc"
;
return
GetPage
<
RB_Supplies_ProcurementDetail_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_ProcurementDetail_Extend
>
GetList
(
RB_Supplies_ProcurementDetail_Extend
dmodel
)
{
DynamicParameters
parms
=
new
DynamicParameters
();
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND pc.{0}={1}"
,
nameof
(
RB_Supplies_ProcurementDetail_Extend
.
Status
),
0
);
where
+=
$@" and pc.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
ProcurementId
>
0
)
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_ProcurementDetail_Extend
.
ProcurementId
)
+
"="
+
dmodel
.
ProcurementId
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ProcurementIds
))
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_ProcurementDetail_Extend
.
ProcurementId
)
+
" in("
+
dmodel
.
ProcurementIds
+
")"
;
}
string
sql
=
$@" select pc.*,m.Name as SuppliesName,m.SuppliesNum,m.BrandName,m.Units,m.CategoryId from RB_Supplies_ProcurementDetail pc
left join rb_supplies_material m on pc.MaterialId = m.Id
{
where
}
order by pc.Id desc"
;
return
Get
<
RB_Supplies_ProcurementDetail_Extend
>(
sql
).
ToList
();
}
}
}
Property.Repository/Supplies/RB_Supplies_ProcurementRepository.cs
0 → 100644
View file @
ee015e96
using
Property.Model.Entity
;
using
Property.Model.Extend
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
Dapper
;
namespace
Property.Repository
{
/// <summary>
/// 耗材采购仓储类
/// </summary>
public
partial
class
RB_Supplies_ProcurementRepository
:
RepositoryBase
<
RB_Supplies_Procurement
>
{
/// <summary>
/// 获取分页数据
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="dmodel"></param>
/// <param name="count"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Procurement_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
RB_Supplies_Procurement_Extend
dmodel
,
out
long
count
)
{
DynamicParameters
parms
=
new
DynamicParameters
();
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND pc.{0}={1}"
,
nameof
(
RB_Supplies_Procurement_Extend
.
Status
),
0
);
where
+=
$@" and pc.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
SchoolId
>
0
)
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
SchoolId
)
+
"="
+
dmodel
.
SchoolId
;
}
if
(
dmodel
.
StockInStatus
>
0
)
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
StockInStatus
)
+
"="
+
dmodel
.
StockInStatus
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
CreateDate
)
+
" >='"
+
dmodel
.
StartTime
+
"'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
CreateDate
)
+
" <='"
+
dmodel
.
EndTime
+
" 23:59:59'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
SuppliesName
))
{
where
+=
" and m.Name like @SuppliesName"
;
parms
.
Add
(
"SuppliesName"
,
"%"
+
dmodel
.
SuppliesName
+
"%"
);
}
string
sql
=
$@" select pc.* from RB_Supplies_Procurement pc
left join rb_supplies_procurementdetail pc2 on pc.Id=pc2.ProcurementId
left join rb_supplies_material m on pc2.MaterialId = m.Id
{
where
}
group by pc.Id order by pc.Id desc"
;
return
GetPage
<
RB_Supplies_Procurement_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_Procurement_Extend
>
GetList
(
RB_Supplies_Procurement_Extend
dmodel
)
{
DynamicParameters
parms
=
new
DynamicParameters
();
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND pc.{0}={1}"
,
nameof
(
RB_Supplies_Procurement_Extend
.
Status
),
0
);
where
+=
$@" and pc.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
SchoolId
>
0
)
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
SchoolId
)
+
"="
+
dmodel
.
SchoolId
;
}
if
(
dmodel
.
StockInStatus
>
0
)
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
StockInStatus
)
+
"="
+
dmodel
.
StockInStatus
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
CreateDate
)
+
" >='"
+
dmodel
.
StartTime
+
"'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
" and pc."
+
nameof
(
RB_Supplies_Procurement_Extend
.
CreateDate
)
+
" <='"
+
dmodel
.
EndTime
+
" 23:59:59'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
SuppliesName
))
{
where
+=
" and m.Name like @SuppliesName"
;
parms
.
Add
(
"SuppliesName"
,
"%"
+
dmodel
.
SuppliesName
+
"%"
);
}
string
sql
=
$@" select pc.* from RB_Supplies_Procurement pc
left join rb_supplies_procurementdetail pc2 on pc.Id=pc2.ProcurementId
left join rb_supplies_material m on pc2.MaterialId = m.Id
{
where
}
group by pc.Id order by pc.Id desc"
;
return
Get
<
RB_Supplies_Procurement_Extend
>(
sql
).
ToList
();
}
}
}
Property.WebApi/Controllers/Property/PropertyController.cs
View file @
ee015e96
...
...
@@ -46,6 +46,7 @@ namespace Property.WebApi.Controllers.User
x
.
ParentName
,
x
.
Tier
,
x
.
Sort
,
x
.
FeeType
,
UpdateBy
=
CacheManager
.
User
.
UserReidsCache
.
GetEmployee
(
x
.
UpdateBy
)?.
EmName
??
""
,
UpdateDate
=
x
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
});
...
...
@@ -69,7 +70,8 @@ namespace Property.WebApi.Controllers.User
x
.
Id
,
x
.
Name
,
ParentId
=
x
.
ParentId
??
0
,
x
.
Tier
x
.
Tier
,
x
.
FeeType
}));
}
...
...
@@ -134,7 +136,8 @@ namespace Property.WebApi.Controllers.User
model
.
ParentId
,
model
.
Tier
,
model
.
Sort
,
model
.
Type
model
.
Type
,
model
.
FeeType
});
}
...
...
@@ -170,6 +173,7 @@ namespace Property.WebApi.Controllers.User
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateBy
=
userInfo
.
EmployeeId
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
demodel
.
FeeType
=
demodel
.
FeeType
==
0
?
1
:
demodel
.
FeeType
;
bool
flag
=
propertyModule
.
SetCateporyInfo
(
demodel
);
if
(
flag
)
{
...
...
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
ee015e96
...
...
@@ -56,7 +56,8 @@ namespace Property.WebApi.Controllers.User
x
.
GoodsSpecificationList
,
x
.
GoodsCategoryList
,
UpdateBy
=
CacheManager
.
User
.
UserReidsCache
.
GetEmployee
(
x
.
UpdateBy
)?.
EmName
??
""
,
UpdateDate
=
x
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
UpdateDate
=
x
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
),
x
.
FeeType
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
@@ -93,7 +94,8 @@ namespace Property.WebApi.Controllers.User
model
.
ReservedStock
,
model
.
SafetyStock
,
model
.
SuppliesModel
,
model
.
SuppliesNum
model
.
SuppliesNum
,
model
.
FeeType
});
}
...
...
@@ -130,6 +132,7 @@ namespace Property.WebApi.Controllers.User
}
demodel
.
Status
=
0
;
demodel
.
FeeType
=
demodel
.
FeeType
==
0
?
1
:
demodel
.
FeeType
;
demodel
.
RB_Branch_Id
=
userInfo
.
RB_Branch_id
;
demodel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
demodel
.
CreateBy
=
userInfo
.
EmployeeId
;
...
...
@@ -2848,5 +2851,204 @@ namespace Property.WebApi.Controllers.User
#
endregion
#
region
耗材采购
/// <summary>
/// 获取耗材采购分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSuppliesProcurementPageList
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
requestParm
.
msg
.
ToString
());
RB_Supplies_Procurement_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_Procurement_Extend
>(
requestParm
.
msg
.
ToString
());
demodel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
var
list
=
suppliesModule
.
GetSuppliesProcurementPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
demodel
,
out
long
count
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
TotalCostMoney
,
x
.
TotalNumber
,
x
.
Remark
,
x
.
CreateBy
,
CreateByName
=
CacheManager
.
User
.
UserReidsCache
.
GetEmployee
(
x
.
CreateBy
)?.
EmName
??
""
,
CreateDate
=
x
.
CreateDate
.
ToString
(
"yyyy-MM-dd"
),
x
.
FinanceId
,
x
.
SupplierId
,
x
.
SupplierName
,
x
.
StockInStatus
,
x
.
SchoolId
,
x
.
SchoolName
,
x
.
WareHouseId
,
x
.
WareHouseName
,
DetailList
=
x
.
DetailList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
SuppliesName
,
z
.
BrandName
,
z
.
CategoryId
,
z
.
CategoryName
,
z
.
Number
,
z
.
CostMoney
,
z
.
StockInNum
,
z
.
SuppliesNum
,
z
.
Units
})
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取耗材采购详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetSuppliesProcurementInfo
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
int
ProcurementId
=
parms
.
GetInt
(
"ProcurementId"
,
0
);
//采购单id
if
(
ProcurementId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递采购单id"
);
}
var
model
=
suppliesModule
.
GetSuppliesProcurementInfo
(
ProcurementId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"采购单不存在"
);
}
return
ApiResult
.
Success
(
""
,
new
{
model
.
Id
,
model
.
TotalCostMoney
,
model
.
TotalNumber
,
model
.
Remark
,
model
.
CreateBy
,
model
.
CreateByName
,
CreateDate
=
model
.
CreateDate
.
ToString
(
"yyyy-MM-dd"
),
model
.
FinanceId
,
model
.
SupplierId
,
model
.
SupplierName
,
model
.
StockInStatus
,
model
.
SchoolId
,
model
.
SchoolName
,
model
.
WareHouseId
,
model
.
WareHouseName
,
DetailList
=
model
.
DetailList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
MaterialId
,
z
.
SuppliesName
,
z
.
SuppliesNum
,
z
.
Units
,
z
.
BrandName
,
z
.
CategoryId
,
z
.
CategoryName
,
z
.
Number
,
z
.
CostMoney
,
z
.
StockInNum
})
});
}
/// <summary>
/// 生成耗材采购信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetSuppliesProcurementInfo
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
RB_Supplies_Procurement_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_Procurement_Extend
>(
requestParm
.
msg
.
ToString
());
if
(
demodel
.
SupplierId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递供应商id"
);
}
if
(
demodel
.
SchoolId
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择校区id"
);
}
if
(
demodel
.
WareHouseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择仓库"
);
}
if
(
demodel
.
DetailList
==
null
||
!
demodel
.
DetailList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请选择耗材信息"
);
}
foreach
(
var
item
in
demodel
.
DetailList
)
{
if
(
item
.
MaterialId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递耗材id"
);
}
if
(
item
.
Number
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"数量不能小于0"
);
}
}
demodel
.
Status
=
0
;
demodel
.
RB_Branch_Id
=
userInfo
.
RB_Branch_id
;
demodel
.
RB_Group_Id
=
userInfo
.
RB_Group_id
;
demodel
.
CreateBy
=
userInfo
.
EmployeeId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateBy
=
userInfo
.
EmployeeId
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
return
suppliesModule
.
SetSuppliesProcurementInfo
(
demodel
,
userInfo
);
}
/// <summary>
/// 耗材采购入库
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetSuppliesProcurementStockIn
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
RB_Supplies_Procurement_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Supplies_Procurement_Extend
>(
requestParm
.
msg
.
ToString
());
if
(
demodel
.
ProcurementId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递采购单id"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
StockInDate
))
{
return
ApiResult
.
ParamIsNull
(
"请选择入库日期"
);
}
if
(
demodel
.
DetailList
==
null
||
!
demodel
.
DetailList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请选择入库资产信息"
);
}
foreach
(
var
item
in
demodel
.
DetailList
)
{
if
(
item
.
Id
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递采购明细id"
);
}
if
(
item
.
MaterialId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
""
);
}
if
(
item
.
WaitStockInNum
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"入库数量不能小于1"
);
}
}
//判断当前仓库是否在盘点中2020-07-28 Add By:W
var
suppliesCheckList
=
suppliesModule
.
GetSuppliesCheckList
(
new
RB_Supplies_Check_Extend
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
StartDate
=
System
.
DateTime
.
Now
,
EndDate
=
System
.
DateTime
.
Now
,
WarehouseId
=
demodel
.
WareHouseId
,
CheckState
=
REBORN
.
Common
.
Enum
.
SuppliesCheckStatusEnum
.
InTheInventory
});
if
(
suppliesCheckList
!=
null
&&
suppliesCheckList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"仓库盘点中,不能入库"
);
}
return
suppliesModule
.
SetSuppliesProcurementStockIn
(
demodel
,
userInfo
);
}
#
endregion
}
}
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