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
011e77de
Commit
011e77de
authored
Aug 27, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购调整
parent
efbc6c4c
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
550 additions
and
49 deletions
+550
-49
Config.cs
Mall.Common/Config.cs
+11
-0
FinanceFlowConnectEnum.cs
Mall.Common/Enum/Finance/FinanceFlowConnectEnum.cs
+31
-0
PropertyFlowEnum.cs
Mall.Common/Enum/Property/PropertyFlowEnum.cs
+66
-0
RB_FinanceFlowConnect.cs
Mall.Model/Entity/Finance/RB_FinanceFlowConnect.cs
+67
-0
RB_Property_AuditRelevance.cs
Mall.Model/Entity/Property/RB_Property_AuditRelevance.cs
+81
-0
RB_Supplies_StockIn.cs
Mall.Model/Entity/Property/RB_Supplies_StockIn.cs
+4
-0
RB_FinanceFlowConnect_Extend.cs
Mall.Model/Extend/Finance/RB_FinanceFlowConnect_Extend.cs
+34
-0
PropertyModule.cs
Mall.Module.Property/PropertyModule.cs
+158
-49
RB_FinanceFlowConnectRepository.cs
Mall.Repository/Finance/RB_FinanceFlowConnectRepository.cs
+62
-0
Rb_Workflow_TemplateRepository.cs
Mall.Repository/Finance/Rb_Workflow_TemplateRepository.cs
+4
-0
RB_Property_AuditRelevanceRepository.cs
...pository/Property/RB_Property_AuditRelevanceRepository.cs
+32
-0
No files found.
Mall.Common/Config.cs
View file @
011e77de
...
...
@@ -521,6 +521,17 @@ namespace Mall.Common
}
}
/// <summary>
/// 生成收入财务单据
/// </summary>
public
static
string
PropertyApi
{
get
{
return
ReadConfigKey
(
"PropertyApi"
);
}
}
/// <summary>
/// 财务单据请求参数Key
/// </summary>
...
...
Mall.Common/Enum/Finance/FinanceFlowConnectEnum.cs
0 → 100644
View file @
011e77de
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.Finance
{
/// <summary>
/// 财务适用公司,费用类型
/// </summary>
public
enum
FinanceFlowConnectEnum
{
/// <summary>
///公司
/// </summary>
[
EnumField
(
"公司"
)]
Branch
=
1
,
/// <summary>
/// 费用
/// </summary>
[
EnumField
(
"费用"
)]
CostType
=
2
,
/// <summary>
/// 集团
/// </summary>
[
EnumField
(
"集团"
)]
Company
=
3
,
}
}
Mall.Common/Enum/Property/PropertyFlowEnum.cs
0 → 100644
View file @
011e77de
using
Mall.Common.Plugin
;
namespace
Mall.Common.Enum.Property
{
/// <summary>
/// 资产审批枚举
/// </summary>
public
enum
PropertyFlowEnum
{
/// <summary>
/// 领用
/// </summary>
[
EnumField
(
"领用"
)]
Receive
=
1
,
/// <summary>
/// 退库
/// </summary>
[
EnumField
(
"退库"
)]
CancellingStocks
=
2
,
/// <summary>
/// 借用
/// </summary>
[
EnumField
(
"借用"
)]
Borrow
=
3
,
/// <summary>
/// 归还
/// </summary>
[
EnumField
(
"归还"
)]
GiveBack
=
4
,
/// <summary>
/// 调拨
/// </summary>
[
EnumField
(
"调拨"
)]
Allot
=
5
,
/// <summary>
/// 处置
/// </summary>
[
EnumField
(
"处置"
)]
Dispose
=
6
,
/// <summary>
/// 维修
/// </summary>
[
EnumField
(
"维修"
)]
Maintain
=
7
,
/// <summary>
/// 员工领用资产
/// </summary>
[
EnumField
(
"员工领用资产"
)]
EmpReceive
=
8
,
/// <summary>
/// 员工退库资产
/// </summary>
[
EnumField
(
"员工退库资产"
)]
EmpCancellingStocks
=
9
,
/// <summary>
/// 变更领用人
/// </summary>
[
EnumField
(
"变更领用人"
)]
Change
=
10
,
/// <summary>
/// 入库
/// </summary>
[
EnumField
(
"入库"
)]
StockIn
=
11
}
}
Mall.Model/Entity/Finance/RB_FinanceFlowConnect.cs
0 → 100644
View file @
011e77de
using
Mall.Common.Enum.Finance
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.Finance
{
/// <summary>
/// 财务流程关联表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"FinanceConnection"
)]
public
class
RB_FinanceFlowConnect
{
/// <summary>
/// Id
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 流程模板id
/// </summary>
public
int
?
FlowtemplateId
{
get
;
set
;
}
/// <summary>
/// 使用对象 当type=3时,对象为集团=0
/// </summary>
public
int
?
SuitableObjectId
{
get
;
set
;
}
/// <summary>
/// 1-公司,2-费用对象为0表示通用,3-集团 (备注:当为3时,请一定将SuitableObjectId=0)
/// </summary>
public
FinanceFlowConnectEnum
?
Type
{
get
;
set
;
}
/// <summary>
/// 状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 收入支出
/// </summary>
public
int
?
Class
{
get
;
set
;
}
}
}
Mall.Model/Entity/Property/RB_Property_AuditRelevance.cs
0 → 100644
View file @
011e77de
using
Mall.Common.Enum.Property
;
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.Property
{
/// <summary>
/// 资产审批关联实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"PropertyConnection"
)]
public
class
RB_Property_AuditRelevance
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 类型
/// </summary>
public
PropertyFlowEnum
?
Type
{
get
;
set
;
}
/// <summary>
/// 是否启用 1是 2否
/// </summary>
public
int
?
Enabled
{
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
;
}
}
}
\ No newline at end of file
Mall.Model/Entity/Property/RB_Supplies_StockIn.cs
View file @
011e77de
...
...
@@ -135,5 +135,9 @@ namespace Mall.Model.Entity.Property
/// 采购单id
/// </summary>
public
int
?
ProcurementId
{
get
;
set
;
}
/// <summary>
/// 流程模板id
/// </summary>
public
int
?
TempleteId
{
get
;
set
;
}
}
}
\ No newline at end of file
Mall.Model/Extend/Finance/RB_FinanceFlowConnect_Extend.cs
0 → 100644
View file @
011e77de
using
VT.FW.DB
;
using
Mall.Model.Entity.Finance
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Model.Extend.Finance
{
/// <summary>
/// 财务流程关联表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"FinanceConnection"
)]
public
class
RB_FinanceFlowConnect_Extend
:
RB_FinanceFlowConnect
{
/// <summary>
/// 多个使用对象
/// </summary>
public
string
SuitableObjectIds
{
get
;
set
;
}
/// <summary>
/// 多个流程模板
/// </summary>
public
string
FlowtemplateIds
{
get
;
set
;
}
/// <summary>
/// 对象名称
/// </summary>
public
string
SuitableObjectName
{
get
;
set
;
}
}
}
Mall.Module.Property/PropertyModule.cs
View file @
011e77de
...
...
@@ -7,17 +7,20 @@ using System.Text;
using
System.Text.RegularExpressions
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Enum.Finance
;
using
Mall.Common.Enum.Property
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.Property
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.Finance
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.Property
;
using
Mall.Model.Extend.User
;
using
Mall.Model.Query
;
using
Mall.Repository
;
using
Mall.Repository.BaseSetUp
;
using
Mall.Repository.Finance
;
using
Mall.Repository.Product
;
using
Mall.Repository.Property
;
using
Mall.Repository.User
;
...
...
@@ -115,6 +118,20 @@ namespace Mall.Module.Property
/// 盘点明细
/// </summary>
private
readonly
RB_Supplies_CheckDetailRepository
supplies_CheckDetailRepository
=
new
RB_Supplies_CheckDetailRepository
();
/// <summary>
/// 资产流程
/// </summary>
private
readonly
RB_Property_AuditRelevanceRepository
auditRelevanceRepository
=
new
RB_Property_AuditRelevanceRepository
();
/// <summary>
/// 财务流程
/// </summary>
private
readonly
Rb_Workflow_TemplateRepository
workflow_TemplateRepository
=
new
Rb_Workflow_TemplateRepository
();
/// <summary>
/// 财务流程配置
/// </summary>
private
readonly
RB_FinanceFlowConnectRepository
financeFlowConnectRepository
=
new
RB_FinanceFlowConnectRepository
();
#
region
获取采购单
/// <summary>
...
...
@@ -658,7 +675,7 @@ namespace Mall.Module.Property
});
}
bool
falg2
=
SetStockInInfo
(
stockInModel
,
trans
);
bool
falg2
=
SetStockInInfo
(
stockInModel
,
null
);
if
(
falg2
==
false
)
{
procurementRepository
.
DBSession
.
Rollback
();
...
...
@@ -700,6 +717,13 @@ namespace Mall.Module.Property
{
//生产编号
demodel
.
StockInState
=
1
;
var
tmodel
=
GetTempleteModel
(
PropertyFlowEnum
.
StockIn
,
demodel
.
RB_Branch_Id
??
0
);
demodel
.
TempleteId
=
tmodel
?.
Id
??
0
;
var
rmodel
=
auditRelevanceRepository
.
GetList
(
new
RB_Property_AuditRelevance
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
Type
=
PropertyFlowEnum
.
StockIn
}).
FirstOrDefault
();
if
(
rmodel
!=
null
&&
rmodel
.
Enabled
==
1
)
{
demodel
.
StockInState
=
2
;
}
int
Id
=
supplies_StockInRepository
.
Insert
(
demodel
,
trans
);
if
(
Id
>
0
)
{
...
...
@@ -753,6 +777,8 @@ namespace Mall.Module.Property
UpdateDate
=
demodel
.
UpdateDate
},
trans
);
if
(
false
)
{
//新增库存表数据
var
ilist
=
supplies_InventoryRepository
.
GetList
(
new
RB_Supplies_Inventory_Extend
()
{
RB_Group_Id
=
demodel
.
RB_Group_Id
,
WarehouseId
=
demodel
.
WarehouseId
,
SuppliesId
=
item
.
SuppliesId
});
if
(
ilist
.
Any
())
...
...
@@ -818,7 +844,58 @@ namespace Mall.Module.Property
}
}
}
}
#
region
新增耗材入库流程
//判断是否需要流程审批
if
(
rmodel
!=
null
&&
rmodel
.
Enabled
==
1
)
{
if
(
tmodel
==
null
)
{
return
true
;
}
var
financeObj
=
new
{
StockInId
=
Id
};
string
sign
=
EncryptionHelper
.
AesEncrypt
(
JsonHelper
.
Serialize
(
financeObj
),
Config
.
FinanceKey
);
var
resultInfo
=
new
{
msg
=
sign
};
//调用资产 生成审核流程
string
apiResult
=
HttpHelper
.
HttpPost
(
Config
.
PropertyApi
,
JsonHelper
.
Serialize
(
resultInfo
),
""
);
LogHelper
.
Write
(
apiResult
);
var
apir
=
JsonConvert
.
DeserializeObject
<
ApiResult
>(
apiResult
);
if
(
apir
.
resultCode
==
1
)
{
Dictionary
<
string
,
object
>
files1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_StockIn
.
Remark
),
"创建流程成功"
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_StockIn
.
Id
),
FiledValue
=
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
supplies_StockInRepository
.
Update
(
files1
,
wheres1
,
trans
);
}
else
{
Dictionary
<
string
,
object
>
files1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_StockIn
.
Remark
),
"创建流程失败"
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_StockIn
.
Id
),
FiledValue
=
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
supplies_StockInRepository
.
Update
(
files1
,
wheres1
,
trans
);
}
}
#
endregion
}
return
Id
>
0
;
}
...
...
@@ -829,6 +906,38 @@ namespace Mall.Module.Property
}
}
/// <summary>
/// 获取流程模板
/// </summary>
/// <param name="audite"></param>
/// <param name="BranchId"></param>
/// <returns></returns>
private
Rb_Workflow_Template_Extend
GetTempleteModel
(
PropertyFlowEnum
audite
,
int
BranchId
)
{
var
tempList
=
workflow_TemplateRepository
.
GetList
(
new
Rb_Workflow_Template_Extend
()
{
TemplateSorce
=
2
,
PropertyType
=
(
int
)
audite
,
Status
=
1
});
List
<
RB_FinanceFlowConnect_Extend
>
fcList
=
new
List
<
RB_FinanceFlowConnect_Extend
>();
//再验证公司别
if
(
tempList
.
Any
())
{
fcList
=
financeFlowConnectRepository
.
GetExtendList
(
new
RB_FinanceFlowConnect_Extend
()
{
FlowtemplateIds
=
string
.
Join
(
","
,
tempList
.
Select
(
x
=>
x
.
Id
))
});
}
foreach
(
var
item
in
tempList
)
{
var
fc2list
=
fcList
.
Where
(
x
=>
x
.
FlowtemplateId
==
item
.
Id
).
ToList
();
if
(
fc2list
.
Where
(
x
=>
x
.
Type
==
FinanceFlowConnectEnum
.
Company
).
Any
())
{
//集团通用
return
item
;
}
else
if
(
fc2list
.
Where
(
x
=>
x
.
Type
==
FinanceFlowConnectEnum
.
Branch
&&
x
.
SuitableObjectId
==
BranchId
).
Any
())
{
//该公司在使用该流程
return
item
;
}
}
return
null
;
}
/// <summary>
/// 获取入库单的标签
/// </summary>
...
...
Mall.Repository/Finance/RB_FinanceFlowConnectRepository.cs
0 → 100644
View file @
011e77de
using
Mall.Model.Entity.Finance
;
using
Mall.Model.Extend.Finance
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
VT.FW.DB
;
namespace
Mall.Repository.Finance
{
/// <summary>
/// 财务流程关联扩展方法
/// </summary>
public
class
RB_FinanceFlowConnectRepository
:
BaseRepository
<
RB_FinanceFlowConnect
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_FinanceFlowConnect
);
}
}
/// <summary>
/// 获取财务流程关联表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
List
<
RB_FinanceFlowConnect_Extend
>
GetExtendList
(
RB_FinanceFlowConnect_Extend
model
)
{
string
where
=
" WHERE 1=1 "
;
where
+=
string
.
Format
(
" AND "
+
nameof
(
RB_FinanceFlowConnect
.
Status
)
+
"={0}"
,
0
);
if
(
model
.
Type
>
0
)
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
RB_FinanceFlowConnect
.
Type
)
+
"={0}"
,
(
int
)
model
.
Type
);
}
if
(
model
.
Class
>
0
)
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
RB_FinanceFlowConnect
.
Class
)
+
"={0}"
,
(
int
)
model
.
Class
);
}
if
(
model
.
FlowtemplateId
>=
0
)
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
RB_FinanceFlowConnect
.
FlowtemplateId
)
+
"={0}"
,
model
.
FlowtemplateId
);
}
if
(
model
.
SuitableObjectId
>=
0
)
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
RB_FinanceFlowConnect
.
SuitableObjectId
)
+
"={0}"
,
model
.
SuitableObjectId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
SuitableObjectIds
))
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
RB_FinanceFlowConnect
.
SuitableObjectId
)
+
" in ({0})"
,
model
.
SuitableObjectId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
FlowtemplateIds
))
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
RB_FinanceFlowConnect
.
FlowtemplateId
)
+
" in ({0})"
,
model
.
FlowtemplateIds
);
}
string
sql
=
string
.
Format
(
" SELECT * FROM {0} {1}"
,
TableName
,
where
);
return
Get
<
RB_FinanceFlowConnect_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Finance/Rb_Workflow_TemplateRepository.cs
View file @
011e77de
...
...
@@ -67,6 +67,10 @@ namespace Mall.Repository.Finance
if
(
model
.
TempLateClass
>
0
)
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
Rb_Workflow_Template
.
TempLateClass
)
+
"={0}"
,
(
int
)
model
.
TempLateClass
);
}
if
(
model
.
PropertyType
>
0
)
{
where
+=
string
.
Format
(
" AND "
+
nameof
(
Rb_Workflow_Template
.
PropertyType
)
+
"={0}"
,
(
int
)
model
.
PropertyType
);
}
string
sql
=
string
.
Format
(
" SELECT * FROM {0} {1}"
,
TableName
,
where
);
return
Get
<
Rb_Workflow_Template_Extend
>(
sql
).
ToList
();
...
...
Mall.Repository/Property/RB_Property_AuditRelevanceRepository.cs
0 → 100644
View file @
011e77de
using
Mall.Model.Entity.Property
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Repository.Property
{
/// <summary>
/// 资产审批关联仓储类
/// </summary>
public
partial
class
RB_Property_AuditRelevanceRepository
:
BaseRepository
<
RB_Property_AuditRelevance
>
{
/// <summary>
/// 获取列表数据
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Property_AuditRelevance
>
GetList
(
RB_Property_AuditRelevance
dmodel
)
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND {0}={1}"
,
nameof
(
RB_Property_AuditRelevance
.
Status
),
0
);
where
+=
$@" and RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(
dmodel
.
Type
>
0
)
{
where
+=
" and "
+
nameof
(
RB_Property_AuditRelevance
.
Type
)
+
"="
+
(
int
)
dmodel
.
Type
;
}
string
sql
=
$@" select * from RB_Property_AuditRelevance
{
where
}
"
;
return
Get
<
RB_Property_AuditRelevance
>(
sql
).
ToList
();
}
}
}
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