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
0260142f
Commit
0260142f
authored
Apr 01, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
457134a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
145 additions
and
1 deletion
+145
-1
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+125
-1
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+20
-0
No files found.
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
0260142f
...
...
@@ -103,6 +103,10 @@ namespace Property.Module.FixedAssets
/// 出库审核
/// </summary>
private
readonly
RB_WarehouseOut_GoodsDetailRepository
warehouseOutGoodsDetailRepository
=
new
RB_WarehouseOut_GoodsDetailRepository
();
/// <summary>
/// 有效期
/// </summary>
private
readonly
RB_Supplies_StockInValidityRepository
supplies_StockInValidityRepository
=
new
RB_Supplies_StockInValidityRepository
();
//流程模板
private
readonly
WorkFlowModule
workFlowModule
=
new
WorkFlowModule
();
...
...
@@ -2004,8 +2008,27 @@ namespace Property.Module.FixedAssets
int
SuppliesId
=
Convert
.
ToInt32
(
codeArr
[
3
]);
int
StockInId
=
Convert
.
ToInt32
(
codeArr
[
4
]);
int
ValidityId
=
0
;
//单个商品id
string
ExpirationDate
=
""
;
//过期时间
if
(
codeArr
.
Length
==
6
)
{
ValidityId
=
Convert
.
ToInt32
(
codeArr
[
5
]);
if
(
ValidityId
>
0
)
{
var
vmodel
=
supplies_StockInValidityRepository
.
GetEntity
(
ValidityId
);
if
(
vmodel
==
null
)
{
return
new
{
Status
=
1
,
Msg
=
"商品唯一码未查询到"
};
}
if
(
vmodel
.
IsOut
==
1
)
{
return
new
{
Status
=
1
,
Msg
=
"商品已出库,请核实后再试"
};
}
ExpirationDate
=
vmodel
.
ExpirationDate
.
ToString
(
"yyyy-MM-dd"
);
}
}
if
(
WarehouseId
!=
wareHouseId
)
{
...
...
@@ -2093,7 +2116,108 @@ namespace Property.Module.FixedAssets
stockInModel
.
StockInNum
,
StockInDate
=
stockInModel
.
StockInDate
.
HasValue
?
stockInModel
.
StockInDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
,
detModel
.
UnitPrice
,
ValidityId
ValidityId
,
ExpirationDate
}
};
}
/// <summary>
/// 获取已出库商品信息
/// </summary>
/// <param name="code"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
object
GetStockOutGoodsInfo
(
string
code
,
UserInfo
userInfo
)
{
code
=
code
.
Replace
(
"A"
,
"-"
);
string
[]
codeArr
=
code
.
Split
(
'-'
);
if
(
codeArr
.
Length
!=
5
&&
codeArr
.
Length
!=
6
)
{
return
new
{
Status
=
1
,
Msg
=
"编码格式不正确"
};
}
if
(
codeArr
[
0
]
!=
"D"
)
{
return
new
{
Status
=
1
,
Msg
=
"编码格式不正确"
};
}
int
WarehouseId
=
Convert
.
ToInt32
(
codeArr
[
1
]);
int
ProcurementId
=
Convert
.
ToInt32
(
codeArr
[
2
]);
int
SuppliesId
=
Convert
.
ToInt32
(
codeArr
[
3
]);
int
StockInId
=
Convert
.
ToInt32
(
codeArr
[
4
]);
int
ValidityId
=
0
;
//单个商品id
string
ExpirationDate
=
""
;
//过期时间
if
(
codeArr
.
Length
==
6
)
{
ValidityId
=
Convert
.
ToInt32
(
codeArr
[
5
]);
if
(
ValidityId
>
0
)
{
var
vmodel
=
supplies_StockInValidityRepository
.
GetEntity
(
ValidityId
);
if
(
vmodel
==
null
)
{
return
new
{
Status
=
1
,
Msg
=
"商品唯一码未查询到"
};
}
if
(
vmodel
.
IsOut
!=
1
)
{
return
new
{
Status
=
1
,
Msg
=
"商品未出库,请核实后再试"
};
}
ExpirationDate
=
vmodel
.
ExpirationDate
.
ToString
(
"yyyy-MM-dd"
);
}
}
var
materialModel
=
supplies_MaterialRepository
.
GetEntity
(
SuppliesId
);
if
(
materialModel
==
null
)
{
return
new
{
Status
=
1
,
Msg
=
"物料档案不存在"
};
}
List
<
string
>
SpecificationList
=
new
List
<
string
>();
List
<
string
>
ImageList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
materialModel
.
SpecificationName
)
&&
materialModel
.
SpecificationName
!=
"[]"
)
{
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
materialModel
.
SpecificationName
);
}
if
(!
string
.
IsNullOrEmpty
(
materialModel
.
Images
)
&&
materialModel
.
Images
!=
"[]"
)
{
ImageList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
materialModel
.
Images
);
}
return
new
{
Status
=
0
,
Msg
=
"查询成功"
,
GoodsModel
=
new
{
WarehouseId
,
SuppliesId
,
materialModel
.
GoodsId
,
materialModel
.
Name
,
materialModel
.
SuppliesNum
,
materialModel
.
SpecificationKey
,
SpecificationList
,
ImageList
,
materialModel
.
Units
,
StockInId
,
ValidityId
,
ExpirationDate
}
};
}
...
...
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
0260142f
...
...
@@ -1701,6 +1701,26 @@ namespace Property.WebApi.Controllers.User
return
ApiResult
.
Success
(
""
,
obj
);
}
/// <summary>
/// 重新入库获取物料信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetStockOutGoodsInfo
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
string
Code
=
parms
.
GetStringValue
(
"Code"
);
if
(
string
.
IsNullOrEmpty
(
Code
))
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
var
obj
=
suppliesModule
.
GetStockOutGoodsInfo
(
Code
,
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
#
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