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
cbfdb3b8
Commit
cbfdb3b8
authored
Sep 23, 2021
by
季圣华
Browse files
给订单去除仓库
parent
a7ac4581
Changes
3
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/constants/BusinessConstants.java
View file @
cbfdb3b8
...
@@ -67,12 +67,14 @@ public class BusinessConstants {
...
@@ -67,12 +67,14 @@ public class BusinessConstants {
public
static
final
String
BILLS_STATUS_SKIP
=
"2"
;
public
static
final
String
BILLS_STATUS_SKIP
=
"2"
;
/**
/**
* 出入库分类
* 出入库分类
*采购、采购退货、其它、零售、销售、调拨
*采购、采购退货、其它、零售、销售、调拨
等
* */
* */
public
static
final
String
SUB_TYPE_PURCHASE_ORDER
=
"采购订单"
;
public
static
final
String
SUB_TYPE_PURCHASE
=
"采购"
;
public
static
final
String
SUB_TYPE_PURCHASE
=
"采购"
;
public
static
final
String
SUB_TYPE_PURCHASE_TETURNS
=
"采购退货"
;
public
static
final
String
SUB_TYPE_PURCHASE_TETURNS
=
"采购退货"
;
public
static
final
String
SUB_TYPE_OTHER
=
"其它"
;
public
static
final
String
SUB_TYPE_OTHER
=
"其它"
;
public
static
final
String
SUB_TYPE_RETAIL
=
"零售"
;
public
static
final
String
SUB_TYPE_RETAIL
=
"零售"
;
public
static
final
String
SUB_TYPE_SALES_ORDER
=
"销售订单"
;
public
static
final
String
SUB_TYPE_SALES
=
"销售"
;
public
static
final
String
SUB_TYPE_SALES
=
"销售"
;
public
static
final
String
SUB_TYPE_TRANSFER
=
"调拨"
;
public
static
final
String
SUB_TYPE_TRANSFER
=
"调拨"
;
/**
/**
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
cbfdb3b8
...
@@ -105,8 +105,7 @@ public class DepotHeadService {
...
@@ -105,8 +105,7 @@ public class DepotHeadService {
List
<
DepotHeadVo4List
>
resList
=
new
ArrayList
<>();
List
<
DepotHeadVo4List
>
resList
=
new
ArrayList
<>();
List
<
DepotHeadVo4List
>
list
=
new
ArrayList
<>();
List
<
DepotHeadVo4List
>
list
=
new
ArrayList
<>();
try
{
try
{
String
depotIds
=
depotService
.
findDepotStrByCurrentUser
();
String
[]
depotArray
=
getDepotArray
(
subType
);
String
[]
depotArray
=
StringUtil
.
isNotEmpty
(
depotIds
)?
depotIds
.
split
(
","
):
null
;
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
Map
<
Long
,
String
>
personMap
=
personService
.
getPersonMap
();
Map
<
Long
,
String
>
personMap
=
personService
.
getPersonMap
();
Map
<
Long
,
String
>
accountMap
=
accountService
.
getAccountMap
();
Map
<
Long
,
String
>
accountMap
=
accountService
.
getAccountMap
();
...
@@ -154,8 +153,7 @@ public class DepotHeadService {
...
@@ -154,8 +153,7 @@ public class DepotHeadService {
String
materialParam
,
Long
organId
,
Long
creator
,
Long
depotId
)
throws
Exception
{
String
materialParam
,
Long
organId
,
Long
creator
,
Long
depotId
)
throws
Exception
{
Long
result
=
null
;
Long
result
=
null
;
try
{
try
{
String
depotIds
=
depotService
.
findDepotStrByCurrentUser
();
String
[]
depotArray
=
getDepotArray
(
subType
);
String
[]
depotArray
=
StringUtil
.
isNotEmpty
(
depotIds
)?
depotIds
.
split
(
","
):
null
;
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
String
[]
creatorArray
=
getCreatorArray
(
roleType
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
beginTime
=
Tools
.
parseDayToTime
(
beginTime
,
BusinessConstants
.
DAY_FIRST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
endTime
=
Tools
.
parseDayToTime
(
endTime
,
BusinessConstants
.
DAY_LAST_TIME
);
...
@@ -167,6 +165,21 @@ public class DepotHeadService {
...
@@ -167,6 +165,21 @@ public class DepotHeadService {
return
result
;
return
result
;
}
}
/**
* 根据单据类型获取仓库数组
* @param subType
* @return
* @throws Exception
*/
public
String
[]
getDepotArray
(
String
subType
)
throws
Exception
{
String
[]
depotArray
=
null
;
if
(!
BusinessConstants
.
SUB_TYPE_PURCHASE_ORDER
.
equals
(
subType
)
&&
!
BusinessConstants
.
SUB_TYPE_SALES_ORDER
.
equals
(
subType
))
{
String
depotIds
=
depotService
.
findDepotStrByCurrentUser
();
depotArray
=
StringUtil
.
isNotEmpty
(
depotIds
)
?
depotIds
.
split
(
","
)
:
null
;
}
return
depotArray
;
}
/**
/**
* 根据角色类型获取操作员数组
* 根据角色类型获取操作员数组
* @param roleType
* @param roleType
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
cbfdb3b8
...
@@ -363,8 +363,11 @@ public class DepotItemService {
...
@@ -363,8 +363,11 @@ public class DepotItemService {
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"depotId"
)))
{
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"depotId"
)))
{
depotItem
.
setDepotId
(
rowObj
.
getLong
(
"depotId"
));
depotItem
.
setDepotId
(
rowObj
.
getLong
(
"depotId"
));
}
else
{
}
else
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_DEPOT_FAILED_CODE
,
if
(!
BusinessConstants
.
SUB_TYPE_PURCHASE_ORDER
.
equals
(
depotHead
.
getSubType
())
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_DEPOT_FAILED_MSG
));
&&
!
BusinessConstants
.
SUB_TYPE_SALES_ORDER
.
equals
(
depotHead
.
getSubType
()))
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_DEPOT_FAILED_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_DEPOT_FAILED_MSG
));
}
}
}
if
(
BusinessConstants
.
SUB_TYPE_TRANSFER
.
equals
(
depotHead
.
getSubType
()))
{
if
(
BusinessConstants
.
SUB_TYPE_TRANSFER
.
equals
(
depotHead
.
getSubType
()))
{
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"anotherDepotId"
)))
{
if
(
StringUtil
.
isExist
(
rowObj
.
get
(
"anotherDepotId"
)))
{
...
@@ -576,20 +579,22 @@ public class DepotItemService {
...
@@ -576,20 +579,22 @@ public class DepotItemService {
* @param dId
* @param dId
*/
*/
public
void
updateCurrentStockFun
(
Long
mId
,
Long
dId
)
{
public
void
updateCurrentStockFun
(
Long
mId
,
Long
dId
)
{
MaterialCurrentStockExample
example
=
new
MaterialCurrentStockExample
();
if
(
mId
!=
null
&&
dId
!=
null
)
{
example
.
createCriteria
().
andMaterialIdEqualTo
(
mId
).
andDepotIdEqualTo
(
dId
)
MaterialCurrentStockExample
example
=
new
MaterialCurrentStockExample
();
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
example
.
createCriteria
().
andMaterialIdEqualTo
(
mId
).
andDepotIdEqualTo
(
dId
)
List
<
MaterialCurrentStock
>
list
=
materialCurrentStockMapper
.
selectByExample
(
example
);
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
MaterialCurrentStock
materialCurrentStock
=
new
MaterialCurrentStock
();
List
<
MaterialCurrentStock
>
list
=
materialCurrentStockMapper
.
selectByExample
(
example
);
materialCurrentStock
.
setMaterialId
(
mId
);
MaterialCurrentStock
materialCurrentStock
=
new
MaterialCurrentStock
();
materialCurrentStock
.
setDepotId
(
dId
);
materialCurrentStock
.
setMaterialId
(
mId
);
materialCurrentStock
.
setCurrentNumber
(
getStockByParam
(
dId
,
mId
,
null
,
null
));
materialCurrentStock
.
setDepotId
(
dId
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
materialCurrentStock
.
setCurrentNumber
(
getStockByParam
(
dId
,
mId
,
null
,
null
));
Long
mcsId
=
list
.
get
(
0
).
getId
();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
materialCurrentStock
.
setId
(
mcsId
);
Long
mcsId
=
list
.
get
(
0
).
getId
();
materialCurrentStockMapper
.
updateByPrimaryKeySelective
(
materialCurrentStock
);
materialCurrentStock
.
setId
(
mcsId
);
}
else
{
materialCurrentStockMapper
.
updateByPrimaryKeySelective
(
materialCurrentStock
);
materialCurrentStockMapper
.
insertSelective
(
materialCurrentStock
);
}
else
{
materialCurrentStockMapper
.
insertSelective
(
materialCurrentStock
);
}
}
}
}
}
}
}
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