Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
5f9e2055
Commit
5f9e2055
authored
Jun 11, 2019
by
qiankunpingtai
Browse files
修改查询库存数量的方法
parent
99d85611
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
View file @
5f9e2055
...
...
@@ -176,5 +176,5 @@ public interface DepotItemMapperEx {
int
findStockWarningCountTotal
(
@Param
(
"pid"
)
Integer
pid
);
BigDecimal
getCurrentRepByMaterialIdAndDepotId
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"depotId"
)
Long
depotId
);
BigDecimal
getCurrentRepByMaterialIdAndDepotId
(
@Param
(
"materialId"
)
Long
materialId
,
@Param
(
"depotId"
)
Long
depotId
,
@Param
(
"tenantId"
)
Long
tenantId
);
}
src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
5f9e2055
...
...
@@ -30,6 +30,7 @@ import java.math.BigDecimal;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
@Service
public
class
DepotItemService
{
...
...
@@ -819,8 +820,18 @@ public class DepotItemService {
*/
public
BigDecimal
getCurrentRepByMaterialIdAndDepotId
(
Long
materialId
,
Long
depotId
)
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
HttpServletRequest
request
=
((
ServletRequestAttributes
)
Objects
.
requireNonNull
(
RequestContextHolder
.
getRequestAttributes
())).
getRequest
();
Long
tenantId
=
null
;
Object
tenantIdO
=
request
.
getSession
().
getAttribute
(
"tenantId"
);
if
(
tenantIdO
!=
null
){
//多租户模式,租户id从当前用户获取
tenantId
=
Long
.
valueOf
(
tenantId
.
toString
());
}
else
{
//无租户模式,租户id为-1
tenantId
=
Long
.
valueOf
(-
1
);
}
try
{
result
=
depotItemMapperEx
.
getCurrentRepByMaterialIdAndDepotId
(
materialId
,
depotId
);
result
=
depotItemMapperEx
.
getCurrentRepByMaterialIdAndDepotId
(
materialId
,
depotId
,
tenantId
);
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
...
...
src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
5f9e2055
...
...
@@ -618,6 +618,8 @@
jsh_depothead dh,jsh_depotitem di
where 1=1
and dh.id=di.HeaderId
and dh.tenant_id=#{tenantId}
and di.tenant_id=#{tenantId}
and di.MaterialId=#{materialId}
and ifnull(dh.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1') as curep
...
...
Write
Preview
Supports
Markdown
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