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
3bbdec0b
Commit
3bbdec0b
authored
Jul 09, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/liudong1993/property
parents
5e35908e
4b43f936
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
189 additions
and
0 deletions
+189
-0
RB_Supplies_StockIn.cs
Property.Model/Entity/Supplies/RB_Supplies_StockIn.cs
+4
-0
SuppliesModule.cs
Property.Modele.FixedAssets/SuppliesModule.cs
+112
-0
RB_Supplies_StockInDetailRepository.cs
...epository/Supplies/RB_Supplies_StockInDetailRepository.cs
+3
-0
RB_Supplies_StockInRepository.cs
...erty.Repository/Supplies/RB_Supplies_StockInRepository.cs
+45
-0
SuppliesController.cs
Property.WebApi/Controllers/Property/SuppliesController.cs
+25
-0
No files found.
Property.Model/Entity/Supplies/RB_Supplies_StockIn.cs
View file @
3bbdec0b
...
...
@@ -131,5 +131,9 @@ namespace Property.Model.Entity
get
;
set
;
}
/// <summary>
/// 采购单id
/// </summary>
public
int
?
ProcurementId
{
get
;
set
;
}
}
}
\ No newline at end of file
Property.Modele.FixedAssets/SuppliesModule.cs
View file @
3bbdec0b
...
...
@@ -1803,6 +1803,118 @@ namespace Property.Module.FixedAssets
return
pmodel
;
}
/// <summary>
/// 获取扫码采购商品信息
/// </summary>
/// <param name="code"></param>
/// <param name="wareHouseId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
object
GetProcurementGoodsInfo
(
string
code
,
int
wareHouseId
,
UserInfo
userInfo
)
{
code
=
code
.
Replace
(
"A"
,
"-"
);
string
[]
codeArr
=
code
.
Split
(
'-'
);
if
(
codeArr
.
Length
!=
5
)
{
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
]);
if
(
WarehouseId
!=
wareHouseId
)
{
return
new
{
Status
=
1
,
Msg
=
"商品仓库不正确"
};
}
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
);
}
#
region
库存验证
var
ilist
=
supplies_InventoryRepository
.
GetList
(
new
RB_Supplies_Inventory_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
WarehouseId
=
WarehouseId
,
SuppliesId
=
SuppliesId
});
if
(
ilist
.
Any
())
{
var
iModel
=
ilist
.
FirstOrDefault
();
if
(
iModel
.
Number
<=
0
)
{
return
new
{
Status
=
1
,
Msg
=
"该物料库存不足"
};
}
}
#
endregion
var
stockInList
=
supplies_StockInRepository
.
GetList
(
new
RB_Supplies_StockIn_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
Id
=
StockInId
,
ProcurementId
=
ProcurementId
});
if
(!
stockInList
.
Any
())
{
return
new
{
Status
=
1
,
Msg
=
"该商品未入库"
};
}
var
stockInModel
=
stockInList
.
FirstOrDefault
();
var
stockInDetailList
=
supplies_StockInDetailRepository
.
GetList
(
new
RB_Supplies_StockInDetail_Extend
()
{
RB_Group_Id
=
userInfo
.
RB_Group_id
,
SuppliesId
=
SuppliesId
,
StockInId
=
StockInId
});
if
(!
stockInDetailList
.
Any
())
{
return
new
{
Status
=
1
,
Msg
=
"该商品未入库"
};
}
var
detModel
=
stockInDetailList
.
FirstOrDefault
();
return
new
{
Status
=
0
,
Msg
=
"查询成功"
,
GoodsModel
=
new
{
WarehouseId
,
SuppliesId
,
materialModel
.
GoodsId
,
materialModel
.
Name
,
materialModel
.
SuppliesNum
,
materialModel
.
SpecificationKey
,
SpecificationList
,
ImageList
,
materialModel
.
Units
,
StockInId
,
stockInModel
.
StockInNum
,
StockInDate
=
stockInModel
.
StockInDate
.
HasValue
?
stockInModel
.
StockInDate
.
Value
.
ToString
(
"yyyy-MM-dd"
):
""
,
detModel
.
UnitPrice
}
};
}
#
endregion
}
}
Property.Repository/Supplies/RB_Supplies_StockInDetailRepository.cs
View file @
3bbdec0b
...
...
@@ -25,6 +25,9 @@ namespace Property.Repository
if
(
dmodel
.
StockInId
>
0
)
{
where
+=
" and ssd."
+
nameof
(
RB_Supplies_StockInDetail_Extend
.
StockInId
)
+
"="
+
dmodel
.
StockInId
;
}
if
(
dmodel
.
SuppliesId
>
0
)
{
where
+=
" and ssd."
+
nameof
(
RB_Supplies_StockInDetail_Extend
.
SuppliesId
)
+
"="
+
dmodel
.
SuppliesId
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StockInIdStr
))
{
where
+=
" and ssd."
+
nameof
(
RB_Supplies_StockInDetail_Extend
.
StockInId
)
+
" in("
+
dmodel
.
StockInIdStr
+
")"
;
}
...
...
Property.Repository/Supplies/RB_Supplies_StockInRepository.cs
View file @
3bbdec0b
...
...
@@ -62,6 +62,51 @@ left join rb_supplies_material sm on ssd.SuppliesId=sm.Id
return
GetPage
<
RB_Supplies_StockIn_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取耗材分页数据
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Supplies_StockIn_Extend
>
GetList
(
RB_Supplies_StockIn_Extend
dmodel
)
{
string
where
=
" where 1=1 "
;
where
+=
string
.
Format
(
" AND ss.{0}={1}"
,
nameof
(
RB_Supplies_StockIn_Extend
.
Status
),
0
);
where
+=
$@" and ss.RB_Group_Id=
{
dmodel
.
RB_Group_Id
}
"
;
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
StartTime
))
{
where
+=
$@" and ss.
{
nameof
(
RB_Supplies_StockIn_Extend
.
StockInDate
)}
>='
{
dmodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
EndTime
))
{
where
+=
$@" and ss.
{
nameof
(
RB_Supplies_StockIn_Extend
.
StockInDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
StockInNum
))
{
where
+=
" and ss."
+
nameof
(
RB_Supplies_StockIn_Extend
.
StockInNum
)
+
" like '%"
+
dmodel
.
StockInNum
+
"%'"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
SupplierName
))
{
where
+=
" and ss."
+
nameof
(
RB_Supplies_StockIn_Extend
.
SupplierName
)
+
" like '%"
+
dmodel
.
SupplierName
.
Trim
()
+
"%'"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
" and ss."
+
nameof
(
RB_Supplies_StockIn_Extend
.
Id
)
+
"="
+
dmodel
.
Id
;
}
if
(
dmodel
.
WarehouseId
>
0
)
{
where
+=
" and ss."
+
nameof
(
RB_Supplies_StockIn_Extend
.
WarehouseId
)
+
"="
+
dmodel
.
WarehouseId
;
}
if
(
dmodel
.
ProcurementId
>
0
)
{
where
+=
" and ss."
+
nameof
(
RB_Supplies_StockIn_Extend
.
ProcurementId
)
+
"="
+
dmodel
.
ProcurementId
;
}
string
sql
=
$@" select ss.*,sw.Name as WareHouseName from RB_Supplies_StockIn ss
left join rb_supplies_warehouse sw on ss.WarehouseId=sw.Id
{
where
}
order by ss.Id desc"
;
return
Get
<
RB_Supplies_StockIn_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取耗材入库出库情况
...
...
Property.WebApi/Controllers/Property/SuppliesController.cs
View file @
3bbdec0b
...
...
@@ -1500,5 +1500,30 @@ namespace Property.WebApi.Controllers.User
#
endregion
#
region
根据二维码标识
获取商品信息
/// <summary>
/// 获取物料信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProcurementGoodsInfo
()
{
var
requestParm
=
GetRequestParm
();
UserInfo
userInfo
=
CacheManager
.
User
.
UserReidsCache
.
GetUserLoginInfo
(
requestParm
.
uid
);
JObject
parms
=
JObject
.
Parse
(
requestParm
.
msg
.
ToString
());
string
Code
=
parms
.
GetStringValue
(
"Code"
);
int
WareHouseId
=
parms
.
GetInt
(
"WareHouseId"
,
0
);
if
(
string
.
IsNullOrEmpty
(
Code
))
{
return
ApiResult
.
ParamIsNull
(
"请传递参数"
);
}
if
(
WareHouseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递仓库id"
);
}
var
obj
=
suppliesModule
.
GetProcurementGoodsInfo
(
Code
,
WareHouseId
,
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
#
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