Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warehouse
Overview
Overview
Details
Activity
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
胡懿
warehouse
Commits
a0af70bd
Commit
a0af70bd
authored
Feb 23, 2023
by
zhanglt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增领用单,自动生成领用单号
parent
5b21c8b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
ProfitWarehousingService.java
...e/profitwarehousing/service/ProfitWarehousingService.java
+34
-2
No files found.
src/main/java/com/jeeplus/modules/warehouse/profitwarehousing/service/ProfitWarehousingService.java
View file @
a0af70bd
...
...
@@ -3,10 +3,14 @@
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
profitwarehousing
.
service
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
com.jeeplus.modules.warehouse.code.util.CodeUtil
;
import
com.jeeplus.modules.warehouse.code.util.StaticNumSeq
;
import
com.jeeplus.modules.warehouse.ledger.entity.Ledger
;
import
com.jeeplus.modules.warehouse.ledger.entity.LedgerInfo
;
import
com.jeeplus.modules.warehouse.ledger.mapper.LedgerMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -30,7 +34,9 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe
@Autowired
private
ProfitWarehousingInfoMapper
profitWarehousingInfoMapper
;
@Autowired
private
LedgerMapper
ledgerMapper
;
public
ProfitWarehousing
get
(
String
id
)
{
ProfitWarehousing
profitWarehousing
=
super
.
get
(
id
);
profitWarehousing
.
setProfitWarehousingInfoList
(
profitWarehousingInfoMapper
.
findList
(
new
ProfitWarehousingInfo
(
profitWarehousing
)));
...
...
@@ -77,5 +83,30 @@ public class ProfitWarehousingService extends CrudService<ProfitWarehousingMappe
super
.
delete
(
profitWarehousing
);
profitWarehousingInfoMapper
.
delete
(
new
ProfitWarehousingInfo
(
profitWarehousing
));
}
//盘盈入库 保存 盘盈入库信息 ,并添加对应的台账信息
@Transactional
(
readOnly
=
false
)
public
void
inLedgerInfo
(
ProfitWarehousing
profitWarehousing
)
{
List
<
ProfitWarehousingInfo
>
profitWarehousingInfoList
=
profitWarehousing
.
getProfitWarehousingInfoList
();
//当前盘盈入库单的明细信息
BigDecimal
sum
=
BigDecimal
.
ONE
;
if
(
profitWarehousingInfoList
!=
null
){
if
(
profitWarehousingInfoList
.
size
()
>
0
){
for
(
ProfitWarehousingInfo
one:
profitWarehousingInfoList
)
{
BigDecimal
amount
=
one
.
getAmount
();
if
(
amount
!=
null
){
//总价 是所有单价之和
sum
=
sum
.
add
(
amount
);
}
//获取同名称类型型号的台账主表信息
Ledger
ledger
=
new
Ledger
(
one
.
getName
(),
one
.
getType
(),
one
.
getMarking
());
Ledger
oldLeger
=
ledgerMapper
.
findByTypeAndModel
(
ledger
);
if
(
oldLeger
!=
null
){
LedgerInfo
ledgerInfo
=
new
LedgerInfo
();
ledgerInfo
.
setLedger
(
oldLeger
);
ledgerInfo
.
setAmount
(
one
.
getAmount
());
}
}
}
}
}
}
\ No newline at end of file
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