Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Property
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
Property
Commits
fc7862e9
Commit
fc7862e9
authored
Jul 27, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/liudong1993/property
parents
3f33e46d
fc9a020a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
0 deletions
+139
-0
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+93
-0
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+46
-0
No files found.
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
fc7862e9
...
...
@@ -2259,6 +2259,99 @@ namespace Property.Module.FixedAssets
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
;
}
/// <summary>
/// 设置盘点明细 耗材实盘数量
/// </summary>
/// <param name="checkDetailId"></param>
/// <param name="type"></param>
/// <param name="reality"></param>
/// <param name="imagesList"></param>
/// <param name="remark"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
SetSuppliesCheckDetailReality
(
int
checkDetailId
,
int
type
,
int
reality
,
List
<
string
>
imagesList
,
string
remark
,
UserInfo
userInfo
)
{
var
dmodel
=
supplies_CheckDetailRepository
.
GetEntity
(
checkDetailId
);
if
(
dmodel
==
null
)
{
return
false
;
}
if
(
type
==
1
)
{
//更新实际数量
PropertyCheckStatusEnum
pcs
=
PropertyCheckStatusEnum
.
HaveInventory
;
if
(
reality
==
(
dmodel
.
InventoryNum
??
0
))
{
pcs
=
PropertyCheckStatusEnum
.
HaveInventory
;
}
else
if
(
reality
>
(
dmodel
.
InventoryNum
??
0
))
{
pcs
=
PropertyCheckStatusEnum
.
InventoryProfit
;
}
else
if
(
reality
<
(
dmodel
.
InventoryNum
??
0
))
{
pcs
=
PropertyCheckStatusEnum
.
InventoryLosses
;
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_CheckDetail
.
RealityNum
),
reality
},
{
nameof
(
RB_Supplies_CheckDetail
.
CheckStatus
),
pcs
},
{
nameof
(
RB_Supplies_CheckDetail
.
CheckEmpId
),
userInfo
.
EmployeeId
},
{
nameof
(
RB_Supplies_CheckDetail
.
CheckDate
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_CheckDetail
.
Id
),
FiledValue
=
dmodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
supplies_CheckDetailRepository
.
Update
(
keyValues
,
wheres
);
}
else
if
(
type
==
2
)
{
//上传图片
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_CheckDetail
.
Images
),
JsonConvert
.
SerializeObject
(
imagesList
)},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_CheckDetail
.
Id
),
FiledValue
=
dmodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
supplies_CheckDetailRepository
.
Update
(
keyValues
,
wheres
);
}
else
if
(
type
==
3
)
{
//更新备注
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Supplies_CheckDetail
.
Remark
),
remark
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Supplies_CheckDetail
.
Id
),
FiledValue
=
dmodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
supplies_CheckDetailRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
return
false
;
}
}
#
endregion
}
}
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
fc7862e9
...
...
@@ -1761,6 +1761,52 @@ namespace Property.WebApi.Controllers.User
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 设置盘点明细 耗材实盘数量
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetSuppliesCheckDetailReality
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
int
CheckDetailId
=
parms
.
GetInt
(
"CheckDetailId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
// 1更新数量 2上传图片 3添加备注
int
Reality
=
parms
.
GetInt
(
"Reality"
,
0
);
string
ImageList
=
parms
.
GetStringValue
(
"ImageList"
);
string
Remark
=
parms
.
GetStringValue
(
"Remark"
);
if
(
CheckDetailId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递参数id"
);
}
if
(
Type
==
1
&&
Reality
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递实际数量"
);
}
List
<
string
>
ImagesList
=
new
List
<
string
>();
if
(
Type
==
2
)
{
if
(
string
.
IsNullOrEmpty
(
ImageList
))
{
return
ApiResult
.
ParamIsNull
(
"请上传图片"
);
}
ImagesList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
ImageList
);
}
//验证盘点单是否已整单完成
if
(
suppliesModule
.
ValidataSuppliesCheckDetail
(
CheckDetailId
))
{
return
ApiResult
.
Failed
(
"该盘点单已整单完成/取消,无法操作"
);
}
bool
flag
=
suppliesModule
.
SetSuppliesCheckDetailReality
(
CheckDetailId
,
Type
,
Reality
,
ImagesList
,
Remark
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
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