Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms_api
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
高宇
wms_api
Commits
408ec09e
Commit
408ec09e
authored
Dec 19, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善退单
parent
10998c53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
12 deletions
+32
-12
StoreGoodsApplyServiceImpl.java
...regoodsapply/service/impl/StoreGoodsApplyServiceImpl.java
+12
-11
StoreGoodsLog.java
...a/org/rcisoft/bus/storegoodslog/entity/StoreGoodsLog.java
+2
-0
StoreGoodsLogServiceImpl.java
.../storegoodslog/service/impl/StoreGoodsLogServiceImpl.java
+18
-1
No files found.
src/main/java/org/rcisoft/bus/storegoodsapply/service/impl/StoreGoodsApplyServiceImpl.java
View file @
408ec09e
...
...
@@ -256,19 +256,20 @@ public class StoreGoodsApplyServiceImpl extends ServiceImpl<StoreGoodsApplyRepos
@Override
public
CyPersistModel
merge
(
StoreGoodsApply
storeGoodsApply
)
{
StoreGoodsLog
storeGoodsLog
=
new
StoreGoodsLog
();
storeGoodsLog
.
setApplyId
(
storeGoodsApply
.
getBusinessId
());
//根据id查询子表
for
(
StoreGoodsLog
box
:
storeGoodsLogServiceImpl
.
findAll
(
storeGoodsLog
))
{
StoreGoodsStock
goodsStock
=
storeGoodsStockRepository
.
selectByGoodsId
(
box
.
getGoodsId
());
goodsStock
.
setGoodsCounts
(
goodsStock
.
getGoodsCounts
()
+
box
.
getGoodsCounts
());
// 返回库存
storeGoodsStockRepositoryImpl
.
updateCounts
(
goodsStock
);
if
(
storeGoodsApply
.
getIsReturn
().
equals
(
"2"
)){
StoreGoodsLog
storeGoodsLog
=
new
StoreGoodsLog
();
storeGoodsLog
.
setApplyId
(
storeGoodsApply
.
getBusinessId
());
//根据id查询子表
for
(
StoreGoodsLog
box
:
storeGoodsLogServiceImpl
.
findAll
(
storeGoodsLog
))
{
StoreGoodsStock
goodsStock
=
storeGoodsStockRepository
.
selectByGoodsId
(
box
.
getGoodsId
());
goodsStock
.
setGoodsCounts
(
goodsStock
.
getGoodsCounts
()
+
box
.
getGoodsCounts
());
// 返回库存
storeGoodsStockRepositoryImpl
.
updateCounts
(
goodsStock
);
}
//修改子表状态
storeGoodsLogServiceImpl
.
updateStatus
(
storeGoodsApply
);
}
//修改子表状态
storeGoodsLogServiceImpl
.
updateStatus
(
storeGoodsApply
);
int
line
=
baseMapper
.
updateById
(
storeGoodsApply
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
storeGoodsApply
.
getBusinessId
()
+
"的商品申请表信息"
);
return
new
CyPersistModel
(
line
);
...
...
src/main/java/org/rcisoft/bus/storegoodslog/entity/StoreGoodsLog.java
View file @
408ec09e
...
...
@@ -48,5 +48,7 @@ public class StoreGoodsLog extends CyIdIncreEntity<StoreGoodsLog> {
* @default
*/
private
BigDecimal
totalPrice
;
private
String
isReturn
;
}
src/main/java/org/rcisoft/bus/storegoodslog/service/impl/StoreGoodsLogServiceImpl.java
View file @
408ec09e
...
...
@@ -8,6 +8,9 @@ import org.rcisoft.bus.storegoodsapply.service.StoreGoodsApplyService;
import
org.rcisoft.bus.storegoodslog.dao.StoreGoodsLogRepository
;
import
org.rcisoft.bus.storegoodslog.entity.StoreGoodsLog
;
import
org.rcisoft.bus.storegoodslog.service.StoreGoodsLogService
;
import
org.rcisoft.bus.storegoodsstock.dao.StoreGoodsStockRepository
;
import
org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock
;
import
org.rcisoft.bus.storegoodsstock.service.StoreGoodsStockService
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.util.CyUserUtil
;
...
...
@@ -33,6 +36,12 @@ public class StoreGoodsLogServiceImpl extends ServiceImpl<StoreGoodsLogRepositor
@Autowired
private
StoreGoodsApplyService
storeGoodsApplyServiceImpl
;
@Autowired
private
StoreGoodsStockRepository
storeGoodsStockRepository
;
@Autowired
private
StoreGoodsStockService
storeGoodsStockRepositoryImpl
;
/**
* 保存 商品记录表
*
...
...
@@ -92,12 +101,20 @@ public class StoreGoodsLogServiceImpl extends ServiceImpl<StoreGoodsLogRepositor
StoreGoodsLog
oldStoreGoodsLog
=
storeGoodsLogServiceImpl
.
findById
(
storeGoodsLog
.
getBusinessId
());
for
(
StoreGoodsLog
box
:
storeGoodsLogServiceImpl
.
findAll
(
oldStoreGoodsLog
))
{
StoreGoodsStock
goodsStock
=
storeGoodsStockRepository
.
selectByGoodsId
(
box
.
getGoodsId
());
goodsStock
.
setGoodsCounts
(
goodsStock
.
getGoodsCounts
()
+
box
.
getGoodsCounts
());
// 返回库存
storeGoodsStockRepositoryImpl
.
updateCounts
(
goodsStock
);
}
StoreGoodsApply
storeGoodsApply
=
new
StoreGoodsApply
();
storeGoodsApply
.
setBusinessId
(
oldStoreGoodsLog
.
getApplyId
());
storeGoodsApply
.
setIsReturn
(
"1"
);
storeGoodsApplyServiceImpl
.
merge
(
storeGoodsApply
);
int
line
=
baseMapper
.
updateById
(
storeGoodsLog
);
oldStoreGoodsLog
.
setIsReturn
(
"1"
);
int
line
=
baseMapper
.
updateById
(
oldStoreGoodsLog
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
storeGoodsLog
.
getBusinessId
()
+
"的商品记录表信息"
);
return
new
CyPersistModel
(
line
);
}
...
...
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