Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
erp-service
Project
Project
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
ximai
erp-service
Commits
9d4919cc
Commit
9d4919cc
authored
Oct 13, 2025
by
chicheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工序完工后端接口添加
parent
fa4ec878
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
768 additions
and
1307 deletions
+768
-1307
SfctbController.java
...opsunit/scanservice/ximai/controller/SfctbController.java
+62
-55
SfctbProcessParams.java
...om/topsunit/scanservice/ximai/dto/SfctbProcessParams.java
+50
-0
Sfctc.java
...ain/java/com/topsunit/scanservice/ximai/entity/Sfctc.java
+117
-832
SfctbService.java
.../com/topsunit/scanservice/ximai/service/SfctbService.java
+539
-420
No files found.
erp-system/src/main/java/com/topsunit/scanservice/ximai/controller/SfctbController.java
View file @
9d4919cc
package
com
.
topsunit
.
scanservice
.
ximai
.
controller
;
package
com
.
topsunit
.
scanservice
.
ximai
.
controller
;
import
com.topsunit.scanservice.ximai.dto.*
;
import
com.topsunit.scanservice.ximai.dto.*
;
import
com.topsunit.scanservice.ximai.service.SfctbService
;
import
com.topsunit.scanservice.ximai.service.SfctbService
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
/**
/**
* <p>Title: SfctbController</p>
* <p>Title: SfctbController</p>
* <p>Description: 转移单 Controller</p>
* <p>Description: 转移单 Controller</p>
*
*
* @author xi.feng
* @author xi.feng
* @version V1.0
* @version V1.0
* @date 2021/10/28
* @date 2021/10/28
*/
*/
@RestController
@RestController
public
class
SfctbController
{
public
class
SfctbController
{
private
final
SfctbService
sfctbService
;
private
final
SfctbService
sfctbService
;
public
SfctbController
(
@RequestBody
SfctbService
sfctbService
)
{
public
SfctbController
(
@RequestBody
SfctbService
sfctbService
)
{
this
.
sfctbService
=
sfctbService
;
this
.
sfctbService
=
sfctbService
;
}
}
@ApiOperation
(
"转移单创建"
)
@ApiOperation
(
"转移单创建"
)
@PostMapping
(
"/sfctb/createfortransfer"
)
@PostMapping
(
"/sfctb/createfortransfer"
)
public
void
createForTransfer
(
@RequestBody
SfctbCreateParams
params
)
{
public
void
createForTransfer
(
@RequestBody
SfctbCreateParams
params
)
{
sfctbService
.
createForTransfer
(
params
);
sfctbService
.
createForTransfer
(
params
);
}
}
@ApiOperation
(
"入库单创建"
)
@PostMapping
(
"/sfctb/createforstorage"
)
@ApiOperation
(
"工序完工"
)
public
void
createForStorage
(
@RequestBody
SfctbCreateParams
params
)
{
@PostMapping
(
"/sfctb/processTransfer"
)
sfctbService
.
createForStorage
(
params
);
public
void
processTransfer
(
@RequestBody
SfctbProcessParams
params
)
{
}
sfctbService
.
processTransfer
(
params
);
}
@ApiOperation
(
"转移单检验"
)
@PostMapping
(
"/sfctb/getfortransfercheck"
)
@ApiOperation
(
"入库单创建"
)
public
List
<
SfctcDto
>
getForTransferCheck
(
@RequestBody
SfctcTransferCheckCriteria
criteria
)
{
@PostMapping
(
"/sfctb/createforstorage"
)
return
sfctbService
.
getForTransferCheck
(
criteria
);
public
void
createForStorage
(
@RequestBody
SfctbCreateParams
params
)
{
}
sfctbService
.
createForStorage
(
params
);
}
@ApiOperation
(
"入库单检验"
)
@PostMapping
(
"/sfctb/getforstoragecheck"
)
@ApiOperation
(
"转移单检验"
)
public
List
<
SfctcDto
>
getForStorageCheck
(
@RequestBody
SfctcStorageCheckCriteria
criteria
)
{
@PostMapping
(
"/sfctb/getfortransfercheck"
)
return
sfctbService
.
getForStorageCheck
(
criteria
);
public
List
<
SfctcDto
>
getForTransferCheck
(
@RequestBody
SfctcTransferCheckCriteria
criteria
)
{
}
return
sfctbService
.
getForTransferCheck
(
criteria
);
@ApiOperation
(
"转移单检验确认"
)
}
@PostMapping
(
"/sfctb/check"
)
public
void
check
(
@RequestBody
SfctcCheckParams
params
)
{
@ApiOperation
(
"入库单检验"
)
sfctbService
.
check
(
params
);
@PostMapping
(
"/sfctb/getforstoragecheck"
)
}
public
List
<
SfctcDto
>
getForStorageCheck
(
@RequestBody
SfctcStorageCheckCriteria
criteria
)
{
}
return
sfctbService
.
getForStorageCheck
(
criteria
);
}
@ApiOperation
(
"转移单检验确认"
)
@PostMapping
(
"/sfctb/check"
)
public
void
check
(
@RequestBody
SfctcCheckParams
params
)
{
sfctbService
.
check
(
params
);
}
}
erp-system/src/main/java/com/topsunit/scanservice/ximai/dto/SfctbProcessParams.java
0 → 100644
View file @
9d4919cc
package
com
.
topsunit
.
scanservice
.
ximai
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* <p>Title: SfctbTranCreateParams</p>
* <p>Description: 录入转移单参数</p>
*
* @author xi.feng
* @version V1.0
* @date 2021/10/28
*/
@Data
public
class
SfctbProcessParams
{
@ApiModelProperty
(
"转移单别"
)
private
String
tb001
=
"D20"
;
@ApiModelProperty
(
"移出地"
)
private
String
tb005
;
@ApiModelProperty
(
"移出地名称"
)
private
String
tb006
;
@ApiModelProperty
(
"移入地"
)
private
String
tb008
;
@ApiModelProperty
(
"移入地名称"
)
private
String
tb009
;
@ApiModelProperty
(
"工单单别"
)
private
String
tc004
;
@ApiModelProperty
(
"工单单号"
)
private
String
tc005
;
@ApiModelProperty
(
"称出加工顺序"
)
private
String
tc006
;
@ApiModelProperty
(
"称出加工顺序名称"
)
private
String
tc007
;
@ApiModelProperty
(
"移入加工顺序"
)
private
String
tc008
;
@ApiModelProperty
(
"移入加工顺序名称"
)
private
String
tc009
;
@ApiModelProperty
(
"类型"
)
private
String
tc013
;
@ApiModelProperty
(
"使用人时"
)
private
Integer
tc020
;
@ApiModelProperty
(
"使用机时"
)
private
Integer
tc021
;
@ApiModelProperty
(
"批号"
)
private
String
tc032
;
@ApiModelProperty
(
"转移数量"
)
private
BigDecimal
tc036
;
}
erp-system/src/main/java/com/topsunit/scanservice/ximai/entity/Sfctc.java
View file @
9d4919cc
package
com
.
topsunit
.
scanservice
.
ximai
.
entity
;
package
com
.
topsunit
.
scanservice
.
ximai
.
entity
;
import
javax.persistence.Entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.persistence.Id
;
import
lombok.Data
;
import
javax.persistence.IdClass
;
import
java.math.BigDecimal
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
/**
import
javax.persistence.IdClass
;
* <p>Title: Sfctc</p>
import
java.math.BigDecimal
;
* <p>Description: 转移单单身档</p>
*
/**
* @author xi.feng
* <p>Title: Sfctc</p>
* @version V1.0
* <p>Description: 转移单单身档</p>
* @date 2021/10/28
*
*/
* @author xi.feng
@Entity
* @version V1.0
@IdClass
(
SfctcId
.
class
)
* @date 2021/10/28
public
class
Sfctc
extends
EntityBase
{
*/
@Id
@Entity
private
String
tc001
=
""
;
@Data
@Id
@IdClass
(
SfctcId
.
class
)
private
String
tc002
=
""
;
public
class
Sfctc
extends
EntityBase
{
@Id
@Id
private
String
tc003
=
""
;
private
String
tc001
=
""
;
private
String
tc004
=
""
;
@Id
private
String
tc005
=
""
;
private
String
tc002
=
""
;
private
String
tc006
=
""
;
@Id
private
String
tc007
=
""
;
private
String
tc003
=
""
;
private
String
tc008
=
""
;
private
String
tc004
=
""
;
private
String
tc009
=
""
;
private
String
tc005
=
""
;
private
String
tc010
=
""
;
private
String
tc006
=
""
;
private
String
tc011
=
""
;
private
String
tc007
=
""
;
private
String
tc012
=
""
;
private
String
tc008
=
""
;
private
String
tc013
=
""
;
private
String
tc009
=
""
;
private
BigDecimal
tc014
=
BigDecimal
.
ZERO
;
private
String
tc010
=
""
;
private
BigDecimal
tc015
=
BigDecimal
.
ZERO
;
private
String
tc011
=
""
;
private
BigDecimal
tc016
=
BigDecimal
.
ZERO
;
private
String
tc012
=
""
;
private
BigDecimal
tc017
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"转移类型(1:正常完成 2:返工完成 3:退回返工 4:拨转 5:盘盈盘亏 6:投入 )"
)
private
BigDecimal
tc018
=
BigDecimal
.
ZERO
;
private
String
tc013
=
""
;
private
BigDecimal
tc019
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc014
=
BigDecimal
.
ZERO
;
private
Integer
tc020
=
0
;
private
BigDecimal
tc015
=
BigDecimal
.
ZERO
;
private
Integer
tc021
=
0
;
private
BigDecimal
tc016
=
BigDecimal
.
ZERO
;
private
String
tc022
=
""
;
private
BigDecimal
tc017
=
BigDecimal
.
ZERO
;
private
String
tc023
=
""
;
private
BigDecimal
tc018
=
BigDecimal
.
ZERO
;
private
String
tc024
=
""
;
private
BigDecimal
tc019
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc025
=
BigDecimal
.
ZERO
;
private
Integer
tc020
=
0
;
private
String
tc026
=
""
;
private
Integer
tc021
=
0
;
private
String
tc027
=
""
;
private
String
tc022
=
""
;
private
String
tc028
=
""
;
private
String
tc023
=
""
;
private
String
tc029
=
""
;
private
String
tc024
=
""
;
private
String
tc030
=
""
;
private
BigDecimal
tc025
=
BigDecimal
.
ZERO
;
private
String
tc031
=
""
;
private
String
tc026
=
""
;
private
String
tc032
=
""
;
private
String
tc027
=
""
;
private
String
tc033
=
""
;
private
String
tc028
=
""
;
private
String
tc034
=
""
;
private
String
tc029
=
""
;
private
String
tc035
=
""
;
private
String
tc030
=
""
;
private
BigDecimal
tc036
=
BigDecimal
.
ZERO
;
private
String
tc031
=
""
;
private
BigDecimal
tc037
=
BigDecimal
.
ZERO
;
private
String
tc032
=
""
;
private
String
tc038
=
""
;
private
String
tc033
=
""
;
private
String
tc039
=
""
;
private
String
tc034
=
""
;
private
String
tc040
=
""
;
private
String
tc035
=
""
;
private
String
tc041
=
""
;
private
BigDecimal
tc036
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc042
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc037
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc043
=
BigDecimal
.
ZERO
;
private
String
tc038
=
""
;
private
BigDecimal
tc044
=
BigDecimal
.
ZERO
;
private
String
tc039
=
""
;
private
BigDecimal
tc045
=
BigDecimal
.
ZERO
;
private
String
tc040
=
""
;
private
BigDecimal
tc046
=
BigDecimal
.
ZERO
;
private
String
tc041
=
""
;
private
String
tc047
=
""
;
private
BigDecimal
tc042
=
BigDecimal
.
ZERO
;
private
String
tc048
=
""
;
private
BigDecimal
tc043
=
BigDecimal
.
ZERO
;
private
String
tc049
=
""
;
private
BigDecimal
tc044
=
BigDecimal
.
ZERO
;
private
String
tc050
=
""
;
private
BigDecimal
tc045
=
BigDecimal
.
ZERO
;
private
String
tc051
=
""
;
private
BigDecimal
tc046
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc052
=
BigDecimal
.
ZERO
;
private
String
tc047
=
""
;
private
BigDecimal
tc053
=
BigDecimal
.
ZERO
;
private
String
tc048
=
""
;
private
String
tc054
=
""
;
private
String
tc049
=
""
;
private
BigDecimal
tc055
=
BigDecimal
.
ZERO
;
private
String
tc050
=
""
;
private
String
tc056
=
""
;
private
String
tc051
=
""
;
private
String
tc057
=
""
;
private
BigDecimal
tc052
=
BigDecimal
.
ZERO
;
private
String
tc058
=
""
;
private
BigDecimal
tc053
=
BigDecimal
.
ZERO
;
private
String
tc059
=
""
;
private
String
tc054
=
""
;
private
BigDecimal
tc060
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc055
=
BigDecimal
.
ZERO
;
private
BigDecimal
tc061
=
BigDecimal
.
ZERO
;
private
String
tc056
=
""
;
private
BigDecimal
tc062
=
BigDecimal
.
ZERO
;
private
String
tc057
=
""
;
private
String
tc063
=
""
;
private
String
tc058
=
""
;
private
String
tcd01
=
""
;
private
String
tc059
=
""
;
private
String
tcd02
=
""
;
private
BigDecimal
tc060
=
BigDecimal
.
ZERO
;
private
String
tc064
=
""
;
private
BigDecimal
tc061
=
BigDecimal
.
ZERO
;
private
String
udf01
=
""
;
private
BigDecimal
tc062
=
BigDecimal
.
ZERO
;
private
String
udf02
=
""
;
private
String
tc063
=
""
;
private
String
udf03
=
""
;
private
String
tcd01
=
""
;
private
String
udf04
=
""
;
private
String
tcd02
=
""
;
private
String
udf05
=
""
;
private
String
tc064
=
""
;
private
String
udf06
=
""
;
private
String
udf01
=
""
;
private
BigDecimal
udf51
=
BigDecimal
.
ZERO
;
private
String
udf02
=
""
;
private
BigDecimal
udf52
=
BigDecimal
.
ZERO
;
private
String
udf03
=
""
;
private
BigDecimal
udf53
=
BigDecimal
.
ZERO
;
private
String
udf04
=
""
;
private
BigDecimal
udf54
=
BigDecimal
.
ZERO
;
private
String
udf05
=
""
;
private
BigDecimal
udf55
=
BigDecimal
.
ZERO
;
private
String
udf06
=
""
;
private
BigDecimal
udf56
=
BigDecimal
.
ZERO
;
private
BigDecimal
udf51
=
BigDecimal
.
ZERO
;
private
String
udf07
=
""
;
private
BigDecimal
udf52
=
BigDecimal
.
ZERO
;
private
String
udf08
=
""
;
private
BigDecimal
udf53
=
BigDecimal
.
ZERO
;
private
String
udf09
=
""
;
private
BigDecimal
udf54
=
BigDecimal
.
ZERO
;
private
String
udf10
=
""
;
private
BigDecimal
udf55
=
BigDecimal
.
ZERO
;
private
String
udf11
=
""
;
private
BigDecimal
udf56
=
BigDecimal
.
ZERO
;
private
String
udf12
=
""
;
private
String
udf07
=
""
;
private
BigDecimal
udf57
=
BigDecimal
.
ZERO
;
private
String
udf08
=
""
;
private
BigDecimal
udf58
=
BigDecimal
.
ZERO
;
private
String
udf09
=
""
;
private
BigDecimal
udf59
=
BigDecimal
.
ZERO
;
private
String
udf10
=
""
;
private
BigDecimal
udf60
=
BigDecimal
.
ZERO
;
private
String
udf11
=
""
;
private
BigDecimal
udf61
=
BigDecimal
.
ZERO
;
private
String
udf12
=
""
;
private
BigDecimal
udf62
=
BigDecimal
.
ZERO
;
private
BigDecimal
udf57
=
BigDecimal
.
ZERO
;
private
BigDecimal
udf58
=
BigDecimal
.
ZERO
;
public
String
getTc001
()
{
private
BigDecimal
udf59
=
BigDecimal
.
ZERO
;
return
tc001
;
private
BigDecimal
udf60
=
BigDecimal
.
ZERO
;
}
private
BigDecimal
udf61
=
BigDecimal
.
ZERO
;
private
BigDecimal
udf62
=
BigDecimal
.
ZERO
;
public
void
setTc001
(
String
tc001
)
{
}
this
.
tc001
=
tc001
;
}
public
String
getTc002
()
{
return
tc002
;
}
public
void
setTc002
(
String
tc002
)
{
this
.
tc002
=
tc002
;
}
public
String
getTc003
()
{
return
tc003
;
}
public
void
setTc003
(
String
tc003
)
{
this
.
tc003
=
tc003
;
}
public
String
getTc004
()
{
return
tc004
;
}
public
void
setTc004
(
String
tc004
)
{
this
.
tc004
=
tc004
;
}
public
String
getTc005
()
{
return
tc005
;
}
public
void
setTc005
(
String
tc005
)
{
this
.
tc005
=
tc005
;
}
public
String
getTc006
()
{
return
tc006
;
}
public
void
setTc006
(
String
tc006
)
{
this
.
tc006
=
tc006
;
}
public
String
getTc007
()
{
return
tc007
;
}
public
void
setTc007
(
String
tc007
)
{
this
.
tc007
=
tc007
;
}
public
String
getTc008
()
{
return
tc008
;
}
public
void
setTc008
(
String
tc008
)
{
this
.
tc008
=
tc008
;
}
public
String
getTc009
()
{
return
tc009
;
}
public
void
setTc009
(
String
tc009
)
{
this
.
tc009
=
tc009
;
}
public
String
getTc010
()
{
return
tc010
;
}
public
void
setTc010
(
String
tc010
)
{
this
.
tc010
=
tc010
;
}
public
String
getTc011
()
{
return
tc011
;
}
public
void
setTc011
(
String
tc011
)
{
this
.
tc011
=
tc011
;
}
public
String
getTc012
()
{
return
tc012
;
}
public
void
setTc012
(
String
tc012
)
{
this
.
tc012
=
tc012
;
}
public
String
getTc013
()
{
return
tc013
;
}
public
void
setTc013
(
String
tc013
)
{
this
.
tc013
=
tc013
;
}
public
BigDecimal
getTc014
()
{
return
tc014
;
}
public
void
setTc014
(
BigDecimal
tc014
)
{
this
.
tc014
=
tc014
;
}
public
BigDecimal
getTc015
()
{
return
tc015
;
}
public
void
setTc015
(
BigDecimal
tc015
)
{
this
.
tc015
=
tc015
;
}
public
BigDecimal
getTc016
()
{
return
tc016
;
}
public
void
setTc016
(
BigDecimal
tc016
)
{
this
.
tc016
=
tc016
;
}
public
BigDecimal
getTc017
()
{
return
tc017
;
}
public
void
setTc017
(
BigDecimal
tc017
)
{
this
.
tc017
=
tc017
;
}
public
BigDecimal
getTc018
()
{
return
tc018
;
}
public
void
setTc018
(
BigDecimal
tc018
)
{
this
.
tc018
=
tc018
;
}
public
BigDecimal
getTc019
()
{
return
tc019
;
}
public
void
setTc019
(
BigDecimal
tc019
)
{
this
.
tc019
=
tc019
;
}
public
Integer
getTc020
()
{
return
tc020
;
}
public
void
setTc020
(
Integer
tc020
)
{
this
.
tc020
=
tc020
;
}
public
Integer
getTc021
()
{
return
tc021
;
}
public
void
setTc021
(
Integer
tc021
)
{
this
.
tc021
=
tc021
;
}
public
String
getTc022
()
{
return
tc022
;
}
public
void
setTc022
(
String
tc022
)
{
this
.
tc022
=
tc022
;
}
public
String
getTc023
()
{
return
tc023
;
}
public
void
setTc023
(
String
tc023
)
{
this
.
tc023
=
tc023
;
}
public
String
getTc024
()
{
return
tc024
;
}
public
void
setTc024
(
String
tc024
)
{
this
.
tc024
=
tc024
;
}
public
BigDecimal
getTc025
()
{
return
tc025
;
}
public
void
setTc025
(
BigDecimal
tc025
)
{
this
.
tc025
=
tc025
;
}
public
String
getTc026
()
{
return
tc026
;
}
public
void
setTc026
(
String
tc026
)
{
this
.
tc026
=
tc026
;
}
public
String
getTc027
()
{
return
tc027
;
}
public
void
setTc027
(
String
tc027
)
{
this
.
tc027
=
tc027
;
}
public
String
getTc028
()
{
return
tc028
;
}
public
void
setTc028
(
String
tc028
)
{
this
.
tc028
=
tc028
;
}
public
String
getTc029
()
{
return
tc029
;
}
public
void
setTc029
(
String
tc029
)
{
this
.
tc029
=
tc029
;
}
public
String
getTc030
()
{
return
tc030
;
}
public
void
setTc030
(
String
tc030
)
{
this
.
tc030
=
tc030
;
}
public
String
getTc031
()
{
return
tc031
;
}
public
void
setTc031
(
String
tc031
)
{
this
.
tc031
=
tc031
;
}
public
String
getTc032
()
{
return
tc032
;
}
public
void
setTc032
(
String
tc032
)
{
this
.
tc032
=
tc032
;
}
public
String
getTc033
()
{
return
tc033
;
}
public
void
setTc033
(
String
tc033
)
{
this
.
tc033
=
tc033
;
}
public
String
getTc034
()
{
return
tc034
;
}
public
void
setTc034
(
String
tc034
)
{
this
.
tc034
=
tc034
;
}
public
String
getTc035
()
{
return
tc035
;
}
public
void
setTc035
(
String
tc035
)
{
this
.
tc035
=
tc035
;
}
public
BigDecimal
getTc036
()
{
return
tc036
;
}
public
void
setTc036
(
BigDecimal
tc036
)
{
this
.
tc036
=
tc036
;
}
public
BigDecimal
getTc037
()
{
return
tc037
;
}
public
void
setTc037
(
BigDecimal
tc037
)
{
this
.
tc037
=
tc037
;
}
public
String
getTc038
()
{
return
tc038
;
}
public
void
setTc038
(
String
tc038
)
{
this
.
tc038
=
tc038
;
}
public
String
getTc039
()
{
return
tc039
;
}
public
void
setTc039
(
String
tc039
)
{
this
.
tc039
=
tc039
;
}
public
String
getTc040
()
{
return
tc040
;
}
public
void
setTc040
(
String
tc040
)
{
this
.
tc040
=
tc040
;
}
public
String
getTc041
()
{
return
tc041
;
}
public
void
setTc041
(
String
tc041
)
{
this
.
tc041
=
tc041
;
}
public
BigDecimal
getTc042
()
{
return
tc042
;
}
public
void
setTc042
(
BigDecimal
tc042
)
{
this
.
tc042
=
tc042
;
}
public
BigDecimal
getTc043
()
{
return
tc043
;
}
public
void
setTc043
(
BigDecimal
tc043
)
{
this
.
tc043
=
tc043
;
}
public
BigDecimal
getTc044
()
{
return
tc044
;
}
public
void
setTc044
(
BigDecimal
tc044
)
{
this
.
tc044
=
tc044
;
}
public
BigDecimal
getTc045
()
{
return
tc045
;
}
public
void
setTc045
(
BigDecimal
tc045
)
{
this
.
tc045
=
tc045
;
}
public
BigDecimal
getTc046
()
{
return
tc046
;
}
public
void
setTc046
(
BigDecimal
tc046
)
{
this
.
tc046
=
tc046
;
}
public
String
getTc047
()
{
return
tc047
;
}
public
void
setTc047
(
String
tc047
)
{
this
.
tc047
=
tc047
;
}
public
String
getTc048
()
{
return
tc048
;
}
public
void
setTc048
(
String
tc048
)
{
this
.
tc048
=
tc048
;
}
public
String
getTc049
()
{
return
tc049
;
}
public
void
setTc049
(
String
tc049
)
{
this
.
tc049
=
tc049
;
}
public
String
getTc050
()
{
return
tc050
;
}
public
void
setTc050
(
String
tc050
)
{
this
.
tc050
=
tc050
;
}
public
String
getTc051
()
{
return
tc051
;
}
public
void
setTc051
(
String
tc051
)
{
this
.
tc051
=
tc051
;
}
public
BigDecimal
getTc052
()
{
return
tc052
;
}
public
void
setTc052
(
BigDecimal
tc052
)
{
this
.
tc052
=
tc052
;
}
public
BigDecimal
getTc053
()
{
return
tc053
;
}
public
void
setTc053
(
BigDecimal
tc053
)
{
this
.
tc053
=
tc053
;
}
public
String
getTc054
()
{
return
tc054
;
}
public
void
setTc054
(
String
tc054
)
{
this
.
tc054
=
tc054
;
}
public
BigDecimal
getTc055
()
{
return
tc055
;
}
public
void
setTc055
(
BigDecimal
tc055
)
{
this
.
tc055
=
tc055
;
}
public
String
getTc056
()
{
return
tc056
;
}
public
void
setTc056
(
String
tc056
)
{
this
.
tc056
=
tc056
;
}
public
String
getTc057
()
{
return
tc057
;
}
public
void
setTc057
(
String
tc057
)
{
this
.
tc057
=
tc057
;
}
public
String
getTc058
()
{
return
tc058
;
}
public
void
setTc058
(
String
tc058
)
{
this
.
tc058
=
tc058
;
}
public
String
getTc059
()
{
return
tc059
;
}
public
void
setTc059
(
String
tc059
)
{
this
.
tc059
=
tc059
;
}
public
BigDecimal
getTc060
()
{
return
tc060
;
}
public
void
setTc060
(
BigDecimal
tc060
)
{
this
.
tc060
=
tc060
;
}
public
BigDecimal
getTc061
()
{
return
tc061
;
}
public
void
setTc061
(
BigDecimal
tc061
)
{
this
.
tc061
=
tc061
;
}
public
BigDecimal
getTc062
()
{
return
tc062
;
}
public
void
setTc062
(
BigDecimal
tc062
)
{
this
.
tc062
=
tc062
;
}
public
String
getTc063
()
{
return
tc063
;
}
public
void
setTc063
(
String
tc063
)
{
this
.
tc063
=
tc063
;
}
public
String
getTcd01
()
{
return
tcd01
;
}
public
void
setTcd01
(
String
tcd01
)
{
this
.
tcd01
=
tcd01
;
}
public
String
getTcd02
()
{
return
tcd02
;
}
public
void
setTcd02
(
String
tcd02
)
{
this
.
tcd02
=
tcd02
;
}
public
String
getTc064
()
{
return
tc064
;
}
public
void
setTc064
(
String
tc064
)
{
this
.
tc064
=
tc064
;
}
public
String
getUdf01
()
{
return
udf01
;
}
public
void
setUdf01
(
String
udf01
)
{
this
.
udf01
=
udf01
;
}
public
String
getUdf02
()
{
return
udf02
;
}
public
void
setUdf02
(
String
udf02
)
{
this
.
udf02
=
udf02
;
}
public
String
getUdf03
()
{
return
udf03
;
}
public
void
setUdf03
(
String
udf03
)
{
this
.
udf03
=
udf03
;
}
public
String
getUdf04
()
{
return
udf04
;
}
public
void
setUdf04
(
String
udf04
)
{
this
.
udf04
=
udf04
;
}
public
String
getUdf05
()
{
return
udf05
;
}
public
void
setUdf05
(
String
udf05
)
{
this
.
udf05
=
udf05
;
}
public
String
getUdf06
()
{
return
udf06
;
}
public
void
setUdf06
(
String
udf06
)
{
this
.
udf06
=
udf06
;
}
public
BigDecimal
getUdf51
()
{
return
udf51
;
}
public
void
setUdf51
(
BigDecimal
udf51
)
{
this
.
udf51
=
udf51
;
}
public
BigDecimal
getUdf52
()
{
return
udf52
;
}
public
void
setUdf52
(
BigDecimal
udf52
)
{
this
.
udf52
=
udf52
;
}
public
BigDecimal
getUdf53
()
{
return
udf53
;
}
public
void
setUdf53
(
BigDecimal
udf53
)
{
this
.
udf53
=
udf53
;
}
public
BigDecimal
getUdf54
()
{
return
udf54
;
}
public
void
setUdf54
(
BigDecimal
udf54
)
{
this
.
udf54
=
udf54
;
}
public
BigDecimal
getUdf55
()
{
return
udf55
;
}
public
void
setUdf55
(
BigDecimal
udf55
)
{
this
.
udf55
=
udf55
;
}
public
BigDecimal
getUdf56
()
{
return
udf56
;
}
public
void
setUdf56
(
BigDecimal
udf56
)
{
this
.
udf56
=
udf56
;
}
public
String
getUdf07
()
{
return
udf07
;
}
public
void
setUdf07
(
String
udf07
)
{
this
.
udf07
=
udf07
;
}
public
String
getUdf08
()
{
return
udf08
;
}
public
void
setUdf08
(
String
udf08
)
{
this
.
udf08
=
udf08
;
}
public
String
getUdf09
()
{
return
udf09
;
}
public
void
setUdf09
(
String
udf09
)
{
this
.
udf09
=
udf09
;
}
public
String
getUdf10
()
{
return
udf10
;
}
public
void
setUdf10
(
String
udf10
)
{
this
.
udf10
=
udf10
;
}
public
String
getUdf11
()
{
return
udf11
;
}
public
void
setUdf11
(
String
udf11
)
{
this
.
udf11
=
udf11
;
}
public
String
getUdf12
()
{
return
udf12
;
}
public
void
setUdf12
(
String
udf12
)
{
this
.
udf12
=
udf12
;
}
public
BigDecimal
getUdf57
()
{
return
udf57
;
}
public
void
setUdf57
(
BigDecimal
udf57
)
{
this
.
udf57
=
udf57
;
}
public
BigDecimal
getUdf58
()
{
return
udf58
;
}
public
void
setUdf58
(
BigDecimal
udf58
)
{
this
.
udf58
=
udf58
;
}
public
BigDecimal
getUdf59
()
{
return
udf59
;
}
public
void
setUdf59
(
BigDecimal
udf59
)
{
this
.
udf59
=
udf59
;
}
public
BigDecimal
getUdf60
()
{
return
udf60
;
}
public
void
setUdf60
(
BigDecimal
udf60
)
{
this
.
udf60
=
udf60
;
}
public
BigDecimal
getUdf61
()
{
return
udf61
;
}
public
void
setUdf61
(
BigDecimal
udf61
)
{
this
.
udf61
=
udf61
;
}
public
BigDecimal
getUdf62
()
{
return
udf62
;
}
public
void
setUdf62
(
BigDecimal
udf62
)
{
this
.
udf62
=
udf62
;
}
}
erp-system/src/main/java/com/topsunit/scanservice/ximai/service/SfctbService.java
View file @
9d4919cc
package
com
.
topsunit
.
scanservice
.
ximai
.
service
;
package
com
.
topsunit
.
scanservice
.
ximai
.
service
;
import
com.topsunit.scanservice.ximai.common.DateUtil
;
import
com.topsunit.scanservice.ximai.common.DateUtil
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.dao.*
;
import
com.topsunit.scanservice.ximai.dao.*
;
import
com.topsunit.scanservice.ximai.dto.*
;
import
com.topsunit.scanservice.ximai.dto.*
;
import
com.topsunit.scanservice.ximai.dto.mapper.SfctbMapper
;
import
com.topsunit.scanservice.ximai.dto.mapper.SfctbMapper
;
import
com.topsunit.scanservice.ximai.entity.*
;
import
com.topsunit.scanservice.ximai.entity.*
;
import
com.topsunit.scanservice.ximai.security.CurrentActor
;
import
com.topsunit.scanservice.ximai.security.CurrentActor
;
import
com.topsunit.scanservice.ximai.utils.MessageUtils
;
import
com.topsunit.scanservice.ximai.utils.MessageUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
* <p>Title: SfctbService</p>
* <p>Title: SfctbService</p>
* <p>Description: 转移单服务</p>
* <p>Description: 转移单服务</p>
*
*
* @author xi.feng
* @author xi.feng
* @version V1.0
* @version V1.0
* @date 2021/10/28
* @date 2021/10/28
*/
*/
@Service
@Service
public
class
SfctbService
{
public
class
SfctbService
{
private
final
CmsmaDao
cmsmaDao
;
private
final
CmsmaDao
cmsmaDao
;
private
final
CmsmcDao
cmsmcDao
;
private
final
CmsmcDao
cmsmcDao
;
private
final
CmsniDao
cmsniDao
;
private
final
CmsniDao
cmsniDao
;
private
final
CmsmgDao
cmsmgDao
;
private
final
CmsmgDao
cmsmgDao
;
private
final
InvmbDao
invmbDao
;
private
final
InvmbDao
invmbDao
;
private
final
MoctaDao
moctaDao
;
private
final
MoctaDao
moctaDao
;
private
final
SfctaDao
sfctaDao
;
private
final
SfctaDao
sfctaDao
;
private
final
SfctbDao
sfctbDao
;
private
final
SfctbDao
sfctbDao
;
private
final
SfctcDao
sfctcDao
;
private
final
SfctcDao
sfctcDao
;
private
final
CurrentActor
currentActor
;
private
final
CurrentActor
currentActor
;
private
final
SfctbMapper
sfctbMapper
;
private
final
SfctbMapper
sfctbMapper
;
public
SfctbService
(
CmsmaDao
cmsmaDao
,
CmsmcDao
cmsmcDao
,
CmsniDao
cmsniDao
,
CmsmgDao
cmsmgDao
,
InvmbDao
invmbDao
,
MoctaDao
moctaDao
,
SfctaDao
sfctaDao
,
SfctbDao
sfctbDao
,
SfctcDao
sfctcDao
,
CurrentActor
currentActor
,
SfctbMapper
sfctbMapper
)
{
public
SfctbService
(
CmsmaDao
cmsmaDao
,
CmsmcDao
cmsmcDao
,
CmsniDao
cmsniDao
,
CmsmgDao
cmsmgDao
,
InvmbDao
invmbDao
,
MoctaDao
moctaDao
,
SfctaDao
sfctaDao
,
SfctbDao
sfctbDao
,
SfctcDao
sfctcDao
,
CurrentActor
currentActor
,
SfctbMapper
sfctbMapper
)
{
this
.
cmsmaDao
=
cmsmaDao
;
this
.
cmsmaDao
=
cmsmaDao
;
this
.
cmsmcDao
=
cmsmcDao
;
this
.
cmsmcDao
=
cmsmcDao
;
this
.
cmsniDao
=
cmsniDao
;
this
.
cmsniDao
=
cmsniDao
;
this
.
cmsmgDao
=
cmsmgDao
;
this
.
cmsmgDao
=
cmsmgDao
;
this
.
invmbDao
=
invmbDao
;
this
.
invmbDao
=
invmbDao
;
this
.
moctaDao
=
moctaDao
;
this
.
moctaDao
=
moctaDao
;
this
.
sfctaDao
=
sfctaDao
;
this
.
sfctaDao
=
sfctaDao
;
this
.
sfctbDao
=
sfctbDao
;
this
.
sfctbDao
=
sfctbDao
;
this
.
sfctcDao
=
sfctcDao
;
this
.
sfctcDao
=
sfctcDao
;
this
.
currentActor
=
currentActor
;
this
.
currentActor
=
currentActor
;
this
.
sfctbMapper
=
sfctbMapper
;
this
.
sfctbMapper
=
sfctbMapper
;
}
}
/**
/**
* 录入转移单
* 录入转移单
* @param params 录入转移单参数
* @param params 录入转移单参数
*/
*/
@Transactional
@Transactional
public
void
createForTransfer
(
SfctbCreateParams
params
)
{
public
void
createForTransfer
(
SfctbCreateParams
params
)
{
String
currentDate
=
DateUtil
.
currentDateString
();
String
currentDate
=
DateUtil
.
currentDateString
();
Mocta
mocta
=
moctaDao
.
findById
(
new
MoctaId
(
params
.
getTc004
(),
params
.
getTc005
()))
Mocta
mocta
=
moctaDao
.
findById
(
new
MoctaId
(
params
.
getTc004
(),
params
.
getTc005
()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到工单"
)));
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到工单"
)));
Invmb
invmb
=
invmbDao
.
findById
(
mocta
.
getTa006
())
Invmb
invmb
=
invmbDao
.
findById
(
mocta
.
getTa006
())
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到品号"
)));
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到品号"
)));
Sfcta
outSfcta
=
sfctaDao
.
findById
(
new
SfctaId
(
params
.
getTc004
(),
params
.
getTc005
(),
params
.
getTc006
(),
params
.
getTb005
()))
Sfcta
outSfcta
=
sfctaDao
.
findById
(
new
SfctaId
(
params
.
getTc004
(),
params
.
getTc005
(),
params
.
getTc006
(),
params
.
getTb005
()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到移出工艺"
)));
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到移出工艺"
)));
Sfcta
inSfcta
=
sfctaDao
.
findById
(
new
SfctaId
(
params
.
getTc004
(),
params
.
getTc005
(),
params
.
getTc008
(),
params
.
getTb008
()))
Sfcta
inSfcta
=
sfctaDao
.
findById
(
new
SfctaId
(
params
.
getTc004
(),
params
.
getTc005
(),
params
.
getTc008
(),
params
.
getTb008
()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到移入工艺"
)));
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到移入工艺"
)));
Cmsma
cmsma
=
cmsmaDao
.
findAll
().
stream
()
Cmsma
cmsma
=
cmsmaDao
.
findAll
().
stream
()
.
findFirst
()
.
findFirst
()
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未设置共享参数设置挡"
)));
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未设置共享参数设置挡"
)));
Optional
<
Cmsmg
>
cmsmg
=
cmsmgDao
.
findFirstByMg001OrderByMg002Desc
(
"RMB"
);
Optional
<
Cmsmg
>
cmsmg
=
cmsmgDao
.
findFirstByMg001OrderByMg002Desc
(
"RMB"
);
BigDecimal
inProcessQuantity
=
getInProcessQuantity
(
outSfcta
);
BigDecimal
inProcessQuantity
=
getInProcessQuantity
(
outSfcta
);
if
(
params
.
getTc036
().
compareTo
(
inProcessQuantity
)
>
0
)
{
if
(
params
.
getTc036
().
compareTo
(
inProcessQuantity
)
>
0
)
{
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"转移数量不能超过在制量"
));
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"转移数量不能超过在制量"
));
}
}
String
tc039
=
outSfcta
.
getTa033
().
trim
().
equals
(
"0"
)
?
"0"
:
"1"
;
String
tc039
=
outSfcta
.
getTa033
().
trim
().
equals
(
"0"
)
?
"0"
:
"1"
;
Sfctb
sfctb
=
new
Sfctb
();
Sfctb
sfctb
=
new
Sfctb
();
sfctb
.
setTb001
(
params
.
getTb001
());
// 转移单别
sfctb
.
setTb001
(
params
.
getTb001
());
// 转移单别
sfctb
.
setTb002
(
getNewTG002
());
// 转移单号
sfctb
.
setTb002
(
getNewTG002
());
// 转移单号
sfctb
.
setTb003
(
currentDate
);
// 转移日期
sfctb
.
setTb003
(
currentDate
);
// 转移日期
sfctb
.
setTb004
(
outSfcta
.
getTa005
().
trim
());
// 移出类别
sfctb
.
setTb004
(
outSfcta
.
getTa005
().
trim
());
// 移出类别
sfctb
.
setTb005
(
outSfcta
.
getTa006
());
// 移出地
sfctb
.
setTb005
(
outSfcta
.
getTa006
());
// 移出地
sfctb
.
setTb006
(
outSfcta
.
getTa007
());
// 移出地名称
sfctb
.
setTb006
(
outSfcta
.
getTa007
());
// 移出地名称
sfctb
.
setTb007
(
inSfcta
.
getTa005
().
trim
());
// 移入类别
sfctb
.
setTb007
(
inSfcta
.
getTa005
().
trim
());
// 移入类别
sfctb
.
setTb008
(
inSfcta
.
getTa006
());
// 移入地
sfctb
.
setTb008
(
inSfcta
.
getTa006
());
// 移入地
sfctb
.
setTb009
(
inSfcta
.
getTa007
());
// 移入地名称
sfctb
.
setTb009
(
inSfcta
.
getTa007
());
// 移入地名称
sfctb
.
setTb010
(
"01"
);
// 工厂编号
sfctb
.
setTb010
(
"01"
);
// 工厂编号
sfctb
.
setTb011
(
0
);
// 打印次数
sfctb
.
setTb011
(
0
);
// 打印次数
sfctb
.
setTb012
(
"N"
);
// 更新码
sfctb
.
setTb012
(
"N"
);
// 更新码
sfctb
.
setTb013
(
"N"
);
// 审核码
sfctb
.
setTb013
(
"N"
);
// 审核码
// tb014
// tb014
sfctb
.
setTb015
(
currentDate
);
// 单据日期
sfctb
.
setTb015
(
currentDate
);
// 单据日期
// tb016
// tb016
sfctb
.
setTb017
(
"N"
);
// 签核状态码
sfctb
.
setTb017
(
"N"
);
// 签核状态码
sfctb
.
setTb018
(
0
);
// 传送次数
sfctb
.
setTb018
(
0
);
// 传送次数
sfctb
.
setTb019
(
"2"
);
// 税种
sfctb
.
setTb019
(
"2"
);
// 税种
sfctb
.
setTb020
(
cmsma
.
getMa004
());
// 税率
sfctb
.
setTb020
(
cmsma
.
getMa004
());
// 税率
sfctb
.
setTb021
(
"RMB"
);
// 币种
sfctb
.
setTb021
(
"RMB"
);
// 币种
sfctb
.
setTb022
(
cmsmg
.
map
(
Cmsmg:
:
getMg003
).
orElse
(
BigDecimal
.
ONE
));
// 汇率
sfctb
.
setTb022
(
cmsmg
.
map
(
Cmsmg:
:
getMg003
).
orElse
(
BigDecimal
.
ONE
));
// 汇率
sfctb
.
setTb023
(
outSfcta
.
getTa051
());
// 移出部门
sfctb
.
setTb023
(
outSfcta
.
getTa051
());
// 移出部门
sfctb
.
setTb024
(
inSfcta
.
getTa051
());
// 移入部门
sfctb
.
setTb024
(
inSfcta
.
getTa051
());
// 移入部门
// tb025
// tb025
// tb026
// tb026
// tb027
// tb027
// tb029
// tb029
// tb030
// tb030
sfctb
.
setTb031
(
mocta
.
getTa083
());
// 项目编号
sfctb
.
setTb031
(
mocta
.
getTa083
());
// 项目编号
Sfctc
sfctc
=
new
Sfctc
();
Sfctc
sfctc
=
new
Sfctc
();
sfctc
.
setTc001
(
sfctb
.
getTb001
());
// 转移单单别
sfctc
.
setTc001
(
sfctb
.
getTb001
());
// 转移单单别
sfctc
.
setTc002
(
sfctb
.
getTb002
());
// 转移单单号
sfctc
.
setTc002
(
sfctb
.
getTb002
());
// 转移单单号
sfctc
.
setTc003
(
"0001"
);
// 序号
sfctc
.
setTc003
(
"0001"
);
// 序号
sfctc
.
setTc004
(
mocta
.
getTa001
());
// 工单单别
sfctc
.
setTc004
(
mocta
.
getTa001
());
// 工单单别
sfctc
.
setTc005
(
mocta
.
getTa002
());
// 工单单号
sfctc
.
setTc005
(
mocta
.
getTa002
());
// 工单单号
sfctc
.
setTc006
(
outSfcta
.
getTa003
());
// 移出加工顺序
sfctc
.
setTc006
(
outSfcta
.
getTa003
());
// 移出加工顺序
sfctc
.
setTc007
(
outSfcta
.
getTa004
());
// 移出工艺
sfctc
.
setTc007
(
outSfcta
.
getTa004
());
// 移出工艺
sfctc
.
setTc008
(
inSfcta
.
getTa003
());
// 移入加工顺序
sfctc
.
setTc008
(
inSfcta
.
getTa003
());
// 移入加工顺序
sfctc
.
setTc009
(
inSfcta
.
getTa004
());
// 移入工艺
sfctc
.
setTc009
(
inSfcta
.
getTa004
());
// 移入工艺
sfctc
.
setTc010
(
invmb
.
getMb004
());
// 单位
sfctc
.
setTc010
(
invmb
.
getMb004
());
// 单位
// tc011
// tc011
sfctc
.
setTc012
(
outSfcta
.
getTa020
());
// 计价单位
sfctc
.
setTc012
(
outSfcta
.
getTa020
());
// 计价单位
sfctc
.
setTc013
(
params
.
getTc013
());
// 类型
sfctc
.
setTc013
(
params
.
getTc013
());
// 类型
sfctc
.
setTc014
(
tc039
.
equals
(
"0"
)
?
params
.
getTc036
()
:
BigDecimal
.
ZERO
);
sfctc
.
setTc014
(
tc039
.
equals
(
"0"
)
?
params
.
getTc036
()
:
BigDecimal
.
ZERO
);
sfctc
.
setTc015
(
sfctc
.
getTc014
());
sfctc
.
setTc015
(
sfctc
.
getTc014
());
// tc016
// tc016
sfctc
.
setTc017
(
outSfcta
.
getTa021
());
// 委外单价
sfctc
.
setTc017
(
outSfcta
.
getTa021
());
// 委外单价
sfctc
.
setTc018
(
sfctb
.
getTb004
().
trim
().
equals
(
"2"
)?
sfctc
.
getTc015
().
multiply
(
sfctc
.
getTc017
())
:
BigDecimal
.
ZERO
);
// 加工金额
sfctc
.
setTc018
(
sfctb
.
getTb004
().
trim
().
equals
(
"2"
)?
sfctc
.
getTc015
().
multiply
(
sfctc
.
getTc017
())
:
BigDecimal
.
ZERO
);
// 加工金额
// tc019
// tc019
sfctc
.
setTc020
(
params
.
getTc020
());
// 使用人时
sfctc
.
setTc020
(
params
.
getTc020
());
// 使用人时
sfctc
.
setTc021
(
params
.
getTc021
());
// 使用机时
sfctc
.
setTc021
(
params
.
getTc021
());
// 使用机时
sfctc
.
setTc022
(
"N"
);
// 审核码
sfctc
.
setTc022
(
"N"
);
// 审核码
sfctc
.
setTc023
(
outSfcta
.
getTa006
());
// 移出地
sfctc
.
setTc023
(
outSfcta
.
getTa006
());
// 移出地
sfctc
.
setTc024
(
currentDate
);
// 预交货日期
sfctc
.
setTc024
(
currentDate
);
// 预交货日期
// tc025
// tc025
sfctc
.
setTc026
(
"N"
);
// 结束
sfctc
.
setTc026
(
"N"
);
// 结束
sfctc
.
setTc027
(
"N"
);
// 超期码
sfctc
.
setTc027
(
"N"
);
// 超期码
// tc028
// tc028
// tc029
// tc029
// tc030
// tc030
// tc031
// tc031
sfctc
.
setTc032
(
"********************"
);
// 批号
sfctc
.
setTc032
(
"********************"
);
// 批号
// tc033
// tc033
// tc034
// tc034
sfctc
.
setTc035
(
"N"
);
// 急料
sfctc
.
setTc035
(
"N"
);
// 急料
sfctc
.
setTc036
(
params
.
getTc036
());
// 转移数量
sfctc
.
setTc036
(
params
.
getTc036
());
// 转移数量
// tc037
// tc037
sfctc
.
setTc038
(
currentDate
);
// 验收日期
sfctc
.
setTc038
(
currentDate
);
// 验收日期
sfctc
.
setTc039
(
tc039
);
// 检验状态
sfctc
.
setTc039
(
tc039
);
// 检验状态
// tc040
// tc040
sfctc
.
setTc041
(
inSfcta
.
getTa006
());
// 移入地
sfctc
.
setTc041
(
inSfcta
.
getTa006
());
// 移入地
// tc042
// tc042
// tc043
// tc043
// tc044
// tc044
// tc045
// tc045
// tc046
// tc046
sfctc
.
setTc047
(
mocta
.
getTa006
());
// 产品品号
sfctc
.
setTc047
(
mocta
.
getTa006
());
// 产品品号
sfctc
.
setTc048
(
mocta
.
getTa034
());
// 产品品名
sfctc
.
setTc048
(
mocta
.
getTa034
());
// 产品品名
sfctc
.
setTc049
(
mocta
.
getTa035
());
// 产品规格
sfctc
.
setTc049
(
mocta
.
getTa035
());
// 产品规格
// tc051
// tc051
// tc052
// tc052
// tc053
// tc053
sfctc
.
setTc054
(
"N"
);
// 报废码
sfctc
.
setTc054
(
"N"
);
// 报废码
// tc055
// tc055
sfctc
.
setTc056
(
"##########"
);
sfctc
.
setTc056
(
"##########"
);
// tc057
// tc057
sfctc
.
setTc058
(
currentDate
);
// 生产日期
sfctc
.
setTc058
(
currentDate
);
// 生产日期
// tc059
// tc059
// tc060
// tc060
// tc061
// tc061
// tc062
// tc062
// tc063
// tc063
sfctc
.
setTcd01
(
currentActor
.
getActorStr
());
// 员工编号
sfctc
.
setTcd01
(
currentActor
.
getActorStr
());
// 员工编号
// tcd02
// tcd02
sfctc
.
setTc064
(
mocta
.
getTa083
());
// 项目编号
sfctc
.
setTc064
(
mocta
.
getTa083
());
// 项目编号
sfctbDao
.
save
(
sfctb
);
sfctbDao
.
save
(
sfctb
);
sfctcDao
.
save
(
sfctc
);
sfctcDao
.
save
(
sfctc
);
}
}
/**
* 录入转移单
/**
* @param params 录入转移单参数
* 录入入库单
*/
* @param params 录入入库单参数
@Transactional
*/
public
void
processTransfer
(
SfctbProcessParams
params
)
{
@Transactional
String
currentDate
=
DateUtil
.
currentDateString
();
public
void
createForStorage
(
SfctbCreateParams
params
){
Mocta
mocta
=
moctaDao
.
findById
(
new
MoctaId
(
params
.
getTc004
(),
params
.
getTc005
()))
String
currentDate
=
DateUtil
.
currentDateString
();
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
Mocta
mocta
=
moctaDao
.
findById
(
new
MoctaId
(
params
.
getTc004
(),
params
.
getTc005
()))
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到工单"
)));
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
Invmb
invmb
=
invmbDao
.
findById
(
mocta
.
getTa006
())
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到工单"
)));
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
Invmb
invmb
=
invmbDao
.
findById
(
mocta
.
getTa006
())
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到品号"
)));
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
Cmsma
cmsma
=
cmsmaDao
.
findAll
().
stream
()
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到品号"
)));
.
findFirst
()
Cmsmc
cmsmc
=
cmsmcDao
.
findById
(
params
.
getTb008
())
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未设置共享参数设置挡"
)));
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
Optional
<
Cmsmg
>
cmsmg
=
cmsmgDao
.
findFirstByMg001OrderByMg002Desc
(
"RMB"
);
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"仓库不存在"
)));
String
tc039
=
"0"
;
cmsniDao
.
findById
(
new
CmsniId
(
params
.
getTb008
(),
params
.
getTc056
()))
Sfctb
sfctb
=
new
Sfctb
();
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
sfctb
.
setTb001
(
params
.
getTb001
());
// 转移单别
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"库位不存在"
)));
sfctb
.
setTb002
(
getNewTG002
());
// 转移单号
Cmsma
cmsma
=
cmsmaDao
.
findAll
().
stream
()
sfctb
.
setTb003
(
currentDate
);
// 转移日期
.
findFirst
().
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未设置共享参数设置挡"
)));
sfctb
.
setTb004
(
"1"
);
// 移出类别
Optional
<
Cmsmg
>
cmsmg
=
cmsmgDao
.
findFirstByMg001OrderByMg002Desc
(
"RMB"
);
sfctb
.
setTb005
(
params
.
getTb005
());
// 移出地
// Sfcta outSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc006(), params.getTb005()))
sfctb
.
setTb006
(
params
.
getTb006
());
// 移出地名称
// //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
sfctb
.
setTb007
(
"1"
);
// 移入类别
// .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到移出工艺")));
sfctb
.
setTb008
(
params
.
getTb008
());
// 移入地
// BigDecimal inProcessQuantity = getInProcessQuantity(outSfcta);
sfctb
.
setTb009
(
params
.
getTb009
());
// 移入地名称
// if (params.getTc036().compareTo(inProcessQuantity) > 0) {
sfctb
.
setTb010
(
"01"
);
// 工厂编号
// throw new TopsunitException(MessageUtils.getMessage("转移数量不能超过在制量"));
sfctb
.
setTb011
(
0
);
// 打印次数
// }
sfctb
.
setTb012
(
"N"
);
// 更新码
sfctb
.
setTb013
(
"N"
);
// 审核码
Sfctb
sfctb
=
new
Sfctb
();
// tb014
sfctb
.
setTb001
(
params
.
getTb001
());
// 转移单别
sfctb
.
setTb015
(
currentDate
);
// 单据日期
sfctb
.
setTb002
(
getNewTG002
());
// 转移单号
// tb016
sfctb
.
setTb003
(
currentDate
);
// 转移日期
sfctb
.
setTb017
(
"N"
);
// 签核状态码
// String tc039 = outSfcta.getTa033().trim().equals("0") ? "0" : "1";
sfctb
.
setTb018
(
0
);
// 传送次数
// sfctb.setTb004(outSfcta.getTa005().trim()); // 移出类别
sfctb
.
setTb019
(
"2"
);
// 税种
// sfctb.setTb005(outSfcta.getTa006()); // 移出地
sfctb
.
setTb020
(
cmsma
.
getMa004
());
// 税率
// sfctb.setTb006(outSfcta.getTa007()); // 移出地名称
sfctb
.
setTb021
(
"RMB"
);
// 币种
// sfctb.setTb023(outSfcta.getTa051()); // 移出部门
sfctb
.
setTb022
(
cmsmg
.
map
(
Cmsmg:
:
getMg003
).
orElse
(
BigDecimal
.
ONE
));
// 汇率
sfctb
.
setTb007
(
"3"
);
// 移入类别
sfctb
.
setTb023
(
null
);
// 移出部门
sfctb
.
setTb008
(
cmsmc
.
getMc001
());
// 移入地
sfctb
.
setTb024
(
null
);
// 移入部门
sfctb
.
setTb009
(
cmsmc
.
getMc002
());
// 移入地名称
// tb025
sfctb
.
setTb010
(
"01"
);
// 工厂编号
// tb026
sfctb
.
setTb011
(
0
);
// 打印次数
// tb027
sfctb
.
setTb012
(
"N"
);
// 更新码
// tb029
sfctb
.
setTb013
(
"N"
);
// 审核码
// tb030
// tb014
sfctb
.
setTb031
(
mocta
.
getTa083
());
// 项目编号
sfctb
.
setTb015
(
currentDate
);
// 单据日期
// tb016
Sfctc
sfctc
=
new
Sfctc
();
sfctb
.
setTb017
(
"N"
);
// 签核状态码
sfctc
.
setTc001
(
sfctb
.
getTb001
());
// 转移单单别
sfctb
.
setTb018
(
0
);
// 传送次数
sfctc
.
setTc002
(
sfctb
.
getTb002
());
// 转移单单号
sfctb
.
setTb019
(
"2"
);
// 税种
sfctc
.
setTc003
(
"0001"
);
// 序号
sfctb
.
setTb020
(
cmsma
.
getMa004
());
// 税率
sfctc
.
setTc004
(
mocta
.
getTa001
());
// 工单单别
sfctb
.
setTb021
(
"RMB"
);
// 币种
sfctc
.
setTc005
(
mocta
.
getTa002
());
// 工单单号
sfctb
.
setTb022
(
cmsmg
.
map
(
Cmsmg:
:
getMg003
).
orElse
(
BigDecimal
.
ONE
));
// 汇率
sfctc
.
setTc006
(
params
.
getTc006
());
// 移出加工顺序
sfctb
.
setTb024
(
""
);
// 移入部门
sfctc
.
setTc007
(
params
.
getTc007
());
// 移出工艺
// tb025
sfctc
.
setTc008
(
params
.
getTc008
());
// 移入加工顺序
// tb026
sfctc
.
setTc009
(
params
.
getTc009
());
// 移入工艺
// tb027
sfctc
.
setTc010
(
invmb
.
getMb004
());
// 单位
// tb029
// tc011
// tb030
sfctc
.
setTc012
(
"PCS"
);
// 计价单位
sfctb
.
setTb031
(
mocta
.
getTa083
());
// 项目编号
sfctc
.
setTc013
(
params
.
getTc013
());
// 类型
sfctc
.
setTc014
(
tc039
.
equals
(
"0"
)
?
params
.
getTc036
()
:
BigDecimal
.
ZERO
);
Sfctc
sfctc
=
new
Sfctc
();
sfctc
.
setTc015
(
sfctc
.
getTc014
());
sfctc
.
setTc001
(
sfctb
.
getTb001
());
// 转移单单别
// tc016
sfctc
.
setTc002
(
sfctb
.
getTb002
());
// 转移单单号
sfctc
.
setTc017
(
BigDecimal
.
ZERO
);
// 委外单价
sfctc
.
setTc003
(
"0001"
);
// 序号
sfctc
.
setTc018
(
sfctb
.
getTb004
().
trim
().
equals
(
"2"
)?
sfctc
.
getTc015
().
multiply
(
sfctc
.
getTc017
())
:
BigDecimal
.
ZERO
);
// 加工金额
sfctc
.
setTc004
(
mocta
.
getTa001
());
// 工单单别
// tc019
sfctc
.
setTc005
(
mocta
.
getTa002
());
// 工单单号
sfctc
.
setTc020
(
params
.
getTc020
());
// 使用人时
// sfctc.setTc006(outSfcta.getTa003()); // 移出加工顺序
sfctc
.
setTc021
(
params
.
getTc021
());
// 使用机时
// sfctc.setTc007(outSfcta.getTa004()); // 移出工艺
sfctc
.
setTc022
(
"N"
);
// 审核码
// sfctc.setTc012(outSfcta.getTa020()); // 计价单位
sfctc
.
setTc023
(
params
.
getTb006
());
// 移出地
// sfctc.setTc017(outSfcta.getTa021()); // 委外单价
sfctc
.
setTc024
(
currentDate
);
// 预交货日期
// sfctc.setTc023(outSfcta.getTa006()); // 移出地
// tc025
// sfctc.setTc014(tc039.equals("0") ? params.getTc036() : BigDecimal.ZERO);
sfctc
.
setTc026
(
"N"
);
// 结束
// sfctc.setTc039(tc039); // 检验状态
sfctc
.
setTc027
(
"N"
);
// 超期码
sfctc
.
setTc008
(
""
);
// 移入加工顺序
// tc028
sfctc
.
setTc009
(
""
);
// 移入工艺
// tc029
sfctc
.
setTc010
(
invmb
.
getMb004
());
// 单位
// tc030
// tc011
// tc031
sfctc
.
setTc013
(
params
.
getTc013
());
// 类型
sfctc
.
setTc032
(
"********************"
);
// 批号
sfctc
.
setTc015
(
sfctc
.
getTc014
());
// tc033
// tc016
// tc034
sfctc
.
setTc018
(
sfctb
.
getTb004
().
trim
().
equals
(
"2"
)?
sfctc
.
getTc015
().
multiply
(
sfctc
.
getTc017
())
:
BigDecimal
.
ZERO
);
// 加工金额
sfctc
.
setTc035
(
"N"
);
// 急料
// tc019
sfctc
.
setTc036
(
params
.
getTc036
());
// 转移数量
sfctc
.
setTc020
(
params
.
getTc020
());
// 使用人时
// tc037
sfctc
.
setTc021
(
params
.
getTc021
());
// 使用机时
sfctc
.
setTc038
(
currentDate
);
// 验收日期
sfctc
.
setTc022
(
"N"
);
// 审核码
sfctc
.
setTc039
(
tc039
);
// 检验状态
sfctc
.
setTc024
(
currentDate
);
// 预交货日期
// tc040
// tc025
sfctc
.
setTc041
(
params
.
getTb009
());
// 移入地
sfctc
.
setTc026
(
"N"
);
// 结束
// tc042
sfctc
.
setTc027
(
"N"
);
// 超期码
// tc043
// tc028
// tc044
// tc029
// tc045
// tc030
// tc046
// tc031
sfctc
.
setTc047
(
mocta
.
getTa006
());
// 产品品号
sfctc
.
setTc032
(
params
.
getTc032
());
// 批号
sfctc
.
setTc048
(
mocta
.
getTa034
());
// 产品品名
// tc033
sfctc
.
setTc049
(
mocta
.
getTa035
());
// 产品规格
// tc034
// tc051
sfctc
.
setTc035
(
"N"
);
// 急料
// tc052
sfctc
.
setTc036
(
params
.
getTc036
());
// 转移数量
// tc053
// tc037
sfctc
.
setTc054
(
"N"
);
// 报废码
sfctc
.
setTc038
(
currentDate
);
// 验收日期
// tc055
// tc040
sfctc
.
setTc056
(
"##########"
);
sfctc
.
setTc041
(
cmsmc
.
getMc001
());
// 移入地
// tc057
// tc042
sfctc
.
setTc058
(
currentDate
);
// 生产日期
// tc043
// tc059
// tc044
// tc060
// tc045
// tc061
// tc046
// tc062
sfctc
.
setTc047
(
mocta
.
getTa006
());
// 产品品号
// tc063
sfctc
.
setTc048
(
mocta
.
getTa034
());
// 产品品名
sfctc
.
setTcd01
(
currentActor
.
getActorStr
());
// 员工编号
sfctc
.
setTc049
(
mocta
.
getTa035
());
// 产品规格
// tcd02
// tc051
sfctc
.
setTc064
(
mocta
.
getTa083
());
// 项目编号
// tc052
// tc053
sfctbDao
.
save
(
sfctb
);
sfctc
.
setTc054
(
"N"
);
// 报废码
sfctcDao
.
save
(
sfctc
);
// tc055
}
sfctc
.
setTc056
(
params
.
getTc056
());
// 库位
// tc057
/**
sfctc
.
setTc058
(
currentDate
);
// 生产日期
* 录入入库单
// tc059
* @param params 录入入库单参数
// tc060
*/
// tc061
@Transactional
// tc062
public
void
createForStorage
(
SfctbCreateParams
params
){
// tc063
String
currentDate
=
DateUtil
.
currentDateString
();
sfctc
.
setTcd01
(
currentActor
.
getActorStr
());
// 员工编号
Mocta
mocta
=
moctaDao
.
findById
(
new
MoctaId
(
params
.
getTc004
(),
params
.
getTc005
()))
// tcd02
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
sfctc
.
setTc064
(
mocta
.
getTa083
());
// 项目编号
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到工单"
)));
Invmb
invmb
=
invmbDao
.
findById
(
mocta
.
getTa006
())
sfctbDao
.
save
(
sfctb
);
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
sfctcDao
.
save
(
sfctc
);
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到品号"
)));
}
Cmsmc
cmsmc
=
cmsmcDao
.
findById
(
params
.
getTb008
())
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
/**
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"仓库不存在"
)));
* 获取转移单检验信息
cmsniDao
.
findById
(
new
CmsniId
(
params
.
getTb008
(),
params
.
getTc056
()))
* @param criteria 查询条件
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
* @return
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"库位不存在"
)));
*/
Cmsma
cmsma
=
cmsmaDao
.
findAll
().
stream
()
public
List
<
SfctcDto
>
getForTransferCheck
(
SfctcTransferCheckCriteria
criteria
)
{
.
findFirst
().
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未设置共享参数设置挡"
)));
return
sfctcDao
.
findAllByTc004AndTc005AndTc006AndTc008
(
criteria
.
getTc004
(),
criteria
.
getTc005
(),
criteria
.
getTc006
(),
criteria
.
getTc008
())
Optional
<
Cmsmg
>
cmsmg
=
cmsmgDao
.
findFirstByMg001OrderByMg002Desc
(
"RMB"
);
.
stream
()
// Sfcta outSfcta = sfctaDao.findById(new SfctaId(params.getTc004(), params.getTc005(), params.getTc006(), params.getTb005()))
//.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim()))
// //.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
filter
(
i
->
i
.
getTc022
().
trim
().
equals
(
"N"
))
// .orElseThrow(() -> new TopsunitException(MessageUtils.getMessage("未找到移出工艺")));
.
filter
(
i
->
i
.
getTc014
().
add
(
i
.
getTc016
()).
add
(
i
.
getTc037
()).
compareTo
(
i
.
getTc036
())
<
0
)
// BigDecimal inProcessQuantity = getInProcessQuantity(outSfcta);
.
map
(
sfctbMapper:
:
toSfctcDto
)
// if (params.getTc036().compareTo(inProcessQuantity) > 0) {
.
collect
(
Collectors
.
toList
());
// throw new TopsunitException(MessageUtils.getMessage("转移数量不能超过在制量"));
}
// }
/**
Sfctb
sfctb
=
new
Sfctb
();
* 获取入库单检验信息
sfctb
.
setTb001
(
params
.
getTb001
());
// 转移单别
* @param criteria 查询条件
sfctb
.
setTb002
(
getNewTG002
());
// 转移单号
* @return
sfctb
.
setTb003
(
currentDate
);
// 转移日期
*/
// String tc039 = outSfcta.getTa033().trim().equals("0") ? "0" : "1";
public
List
<
SfctcDto
>
getForStorageCheck
(
SfctcStorageCheckCriteria
criteria
)
{
// sfctb.setTb004(outSfcta.getTa005().trim()); // 移出类别
return
sfctcDao
.
findAllByTc004AndTc005AndTc006AndTc056
(
criteria
.
getTc004
(),
criteria
.
getTc005
(),
criteria
.
getTc006
(),
criteria
.
getTc056
())
// sfctb.setTb005(outSfcta.getTa006()); // 移出地
.
stream
()
// sfctb.setTb006(outSfcta.getTa007()); // 移出地名称
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
// sfctb.setTb023(outSfcta.getTa051()); // 移出部门
.
filter
(
i
->
i
.
getTc022
().
trim
().
equals
(
"N"
))
sfctb
.
setTb007
(
"3"
);
// 移入类别
.
filter
(
i
->
i
.
getTc014
().
add
(
i
.
getTc016
()).
add
(
i
.
getTc037
()).
compareTo
(
i
.
getTc036
())
<
0
)
sfctb
.
setTb008
(
cmsmc
.
getMc001
());
// 移入地
.
map
(
sfctbMapper:
:
toSfctcDto
)
sfctb
.
setTb009
(
cmsmc
.
getMc002
());
// 移入地名称
.
collect
(
Collectors
.
toList
());
sfctb
.
setTb010
(
"01"
);
// 工厂编号
}
sfctb
.
setTb011
(
0
);
// 打印次数
sfctb
.
setTb012
(
"N"
);
// 更新码
/**
sfctb
.
setTb013
(
"N"
);
// 审核码
* 转移单/入库单 检验
// tb014
* @param params 检验参数
sfctb
.
setTb015
(
currentDate
);
// 单据日期
*/
// tb016
@Transactional
sfctb
.
setTb017
(
"N"
);
// 签核状态码
public
void
check
(
SfctcCheckParams
params
)
{
sfctb
.
setTb018
(
0
);
// 传送次数
sfctb
.
setTb019
(
"2"
);
// 税种
Sfctc
sfctc
=
sfctcDao
.
findById
(
new
SfctcId
(
params
.
getTc001
(),
params
.
getTc002
(),
params
.
getTc003
()))
sfctb
.
setTb020
(
cmsma
.
getMa004
());
// 税率
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
sfctb
.
setTb021
(
"RMB"
);
// 币种
.
filter
(
i
->
i
.
getTc022
().
trim
().
equals
(
"N"
))
sfctb
.
setTb022
(
cmsmg
.
map
(
Cmsmg:
:
getMg003
).
orElse
(
BigDecimal
.
ONE
));
// 汇率
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"此条码已审核,无法检验"
)));
sfctb
.
setTb024
(
""
);
// 移入部门
if
(
params
.
getTc015
().
compareTo
(
params
.
getTc014
())
>
0
)
{
// tb025
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"计价数量不能大于验收数量"
));
// tb026
}
// tb027
int
finisedFlag
=
params
.
getTc014
().
add
(
params
.
getTc016
()).
add
(
sfctc
.
getTc037
()).
compareTo
(
sfctc
.
getTc036
());
// tb029
if
(
finisedFlag
>
0
)
{
// tb030
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"验收数量+验退数量+报废数量不能大于转移数量"
));
sfctb
.
setTb031
(
mocta
.
getTa083
());
// 项目编号
}
else
if
(
finisedFlag
==
0
){
if
(
params
.
getTc014
().
compareTo
(
sfctc
.
getTc036
())
>=
0
){
Sfctc
sfctc
=
new
Sfctc
();
sfctc
.
setTc039
(
"2"
);
sfctc
.
setTc001
(
sfctb
.
getTb001
());
// 转移单单别
}
else
{
sfctc
.
setTc002
(
sfctb
.
getTb002
());
// 转移单单号
sfctc
.
setTc039
(
"3"
);
sfctc
.
setTc003
(
"0001"
);
// 序号
}
sfctc
.
setTc004
(
mocta
.
getTa001
());
// 工单单别
}
sfctc
.
setTc005
(
mocta
.
getTa002
());
// 工单单号
sfctbMapper
.
updateSfctc
(
params
,
sfctc
);
// sfctc.setTc006(outSfcta.getTa003()); // 移出加工顺序
sfctc
.
setTc037
(
sfctc
.
getTc036
().
subtract
(
sfctc
.
getTc014
()).
subtract
(
sfctc
.
getTc016
()));
// sfctc.setTc007(outSfcta.getTa004()); // 移出工艺
// sfctc.setTc012(outSfcta.getTa020()); // 计价单位
sfctbDao
.
findById
(
new
SfctbId
(
params
.
getTc001
(),
params
.
getTc002
())).
ifPresent
(
i
->
{
// sfctc.setTc017(outSfcta.getTa021()); // 委外单价
if
(
i
.
getTb004
().
trim
().
equals
(
"2"
)){
// sfctc.setTc023(outSfcta.getTa006()); // 移出地
sfctc
.
setTc018
(
sfctc
.
getTc015
().
multiply
(
sfctc
.
getTc017
()));
// sfctc.setTc014(tc039.equals("0") ? params.getTc036() : BigDecimal.ZERO);
}
// sfctc.setTc039(tc039); // 检验状态
});
sfctc
.
setTc008
(
""
);
// 移入加工顺序
}
sfctc
.
setTc009
(
""
);
// 移入工艺
sfctc
.
setTc010
(
invmb
.
getMb004
());
// 单位
private
String
getNewTG002
()
{
// tc011
String
prefix
=
DateUtil
.
currentDateString
();
sfctc
.
setTc013
(
params
.
getTc013
());
// 类型
return
sfctbDao
.
findFirstByTb002StartingWithOrderByTb002Desc
(
prefix
)
sfctc
.
setTc015
(
sfctc
.
getTc014
());
.
map
(
i
->
{
// tc016
int
currentOrdianl
=
Integer
.
parseInt
(
i
.
getTb002
().
replace
(
prefix
,
""
));
sfctc
.
setTc018
(
sfctb
.
getTb004
().
trim
().
equals
(
"2"
)?
sfctc
.
getTc015
().
multiply
(
sfctc
.
getTc017
())
:
BigDecimal
.
ZERO
);
// 加工金额
return
prefix
+
String
.
format
(
"%03d"
,
currentOrdianl
+
1
);
// tc019
})
sfctc
.
setTc020
(
params
.
getTc020
());
// 使用人时
.
orElse
(
prefix
+
"001"
);
sfctc
.
setTc021
(
params
.
getTc021
());
// 使用机时
}
sfctc
.
setTc022
(
"N"
);
// 审核码
sfctc
.
setTc024
(
currentDate
);
// 预交货日期
private
BigDecimal
getInProcessQuantity
(
Sfcta
sfcta
)
{
// tc025
BigDecimal
sfctcTc036Count
=
BigDecimal
.
ZERO
;
sfctc
.
setTc026
(
"N"
);
// 结束
List
<
Sfctc
>
sfctcs
=
sfctcDao
.
findAllByTc004AndTc005AndTc006AndTc022
(
sfcta
.
getTa001
(),
sfcta
.
getTa002
(),
sfcta
.
getTa003
(),
"N"
)
sfctc
.
setTc027
(
"N"
);
// 超期码
.
stream
()
// tc028
.
filter
(
i
->
{
// tc029
String
tc013
=
i
.
getTc013
().
trim
();
// tc030
if
(
tc013
.
equals
(
"1"
)
||
tc013
.
equals
(
"2"
)
||
tc013
.
equals
(
"4"
))
{
// tc031
return
true
;
sfctc
.
setTc032
(
params
.
getTc032
());
// 批号
}
// tc033
return
false
;
// tc034
})
sfctc
.
setTc035
(
"N"
);
// 急料
.
collect
(
Collectors
.
toList
());
sfctc
.
setTc036
(
params
.
getTc036
());
// 转移数量
for
(
Sfctc
sfctc
:
sfctcs
)
{
// tc037
sfctcTc036Count
=
sfctcTc036Count
.
add
(
sfctc
.
getTc036
());
sfctc
.
setTc038
(
currentDate
);
// 验收日期
}
// tc040
return
sfcta
.
getTa010
()
sfctc
.
setTc041
(
cmsmc
.
getMc001
());
// 移入地
.
add
(
sfcta
.
getTa013
())
// tc042
.
add
(
sfcta
.
getTa016
())
// tc043
.
subtract
(
sfcta
.
getTa011
())
// tc044
.
subtract
(
sfcta
.
getTa012
())
// tc045
.
subtract
(
sfcta
.
getTa056
())
// tc046
.
subtract
(
sfcta
.
getTa014
())
sfctc
.
setTc047
(
mocta
.
getTa006
());
// 产品品号
.
subtract
(
sfcta
.
getTa015
())
sfctc
.
setTc048
(
mocta
.
getTa034
());
// 产品品名
.
subtract
(
sfctcTc036Count
);
sfctc
.
setTc049
(
mocta
.
getTa035
());
// 产品规格
}
// tc051
}
// tc052
// tc053
sfctc
.
setTc054
(
"N"
);
// 报废码
// tc055
sfctc
.
setTc056
(
params
.
getTc056
());
// 库位
// tc057
sfctc
.
setTc058
(
currentDate
);
// 生产日期
// tc059
// tc060
// tc061
// tc062
// tc063
sfctc
.
setTcd01
(
currentActor
.
getActorStr
());
// 员工编号
// tcd02
sfctc
.
setTc064
(
mocta
.
getTa083
());
// 项目编号
sfctbDao
.
save
(
sfctb
);
sfctcDao
.
save
(
sfctc
);
}
/**
* 获取转移单检验信息
* @param criteria 查询条件
* @return
*/
public
List
<
SfctcDto
>
getForTransferCheck
(
SfctcTransferCheckCriteria
criteria
)
{
return
sfctcDao
.
findAllByTc004AndTc005AndTc006AndTc008
(
criteria
.
getTc004
(),
criteria
.
getTc005
(),
criteria
.
getTc006
(),
criteria
.
getTc008
())
.
stream
()
//.filter(i -> i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
filter
(
i
->
i
.
getTc022
().
trim
().
equals
(
"N"
))
.
filter
(
i
->
i
.
getTc014
().
add
(
i
.
getTc016
()).
add
(
i
.
getTc037
()).
compareTo
(
i
.
getTc036
())
<
0
)
.
map
(
sfctbMapper:
:
toSfctcDto
)
.
collect
(
Collectors
.
toList
());
}
/**
* 获取入库单检验信息
* @param criteria 查询条件
* @return
*/
public
List
<
SfctcDto
>
getForStorageCheck
(
SfctcStorageCheckCriteria
criteria
)
{
return
sfctcDao
.
findAllByTc004AndTc005AndTc006AndTc056
(
criteria
.
getTc004
(),
criteria
.
getTc005
(),
criteria
.
getTc006
(),
criteria
.
getTc056
())
.
stream
()
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
filter
(
i
->
i
.
getTc022
().
trim
().
equals
(
"N"
))
.
filter
(
i
->
i
.
getTc014
().
add
(
i
.
getTc016
()).
add
(
i
.
getTc037
()).
compareTo
(
i
.
getTc036
())
<
0
)
.
map
(
sfctbMapper:
:
toSfctcDto
)
.
collect
(
Collectors
.
toList
());
}
/**
* 转移单/入库单 检验
* @param params 检验参数
*/
@Transactional
public
void
check
(
SfctcCheckParams
params
)
{
Sfctc
sfctc
=
sfctcDao
.
findById
(
new
SfctcId
(
params
.
getTc001
(),
params
.
getTc002
(),
params
.
getTc003
()))
//.filter(i->i.getCompany().trim().equals(currentActor.getCompany().trim()))
.
filter
(
i
->
i
.
getTc022
().
trim
().
equals
(
"N"
))
.
orElseThrow
(()
->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"此条码已审核,无法检验"
)));
if
(
params
.
getTc015
().
compareTo
(
params
.
getTc014
())
>
0
)
{
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"计价数量不能大于验收数量"
));
}
int
finisedFlag
=
params
.
getTc014
().
add
(
params
.
getTc016
()).
add
(
sfctc
.
getTc037
()).
compareTo
(
sfctc
.
getTc036
());
if
(
finisedFlag
>
0
)
{
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"验收数量+验退数量+报废数量不能大于转移数量"
));
}
else
if
(
finisedFlag
==
0
){
if
(
params
.
getTc014
().
compareTo
(
sfctc
.
getTc036
())
>=
0
){
sfctc
.
setTc039
(
"2"
);
}
else
{
sfctc
.
setTc039
(
"3"
);
}
}
sfctbMapper
.
updateSfctc
(
params
,
sfctc
);
sfctc
.
setTc037
(
sfctc
.
getTc036
().
subtract
(
sfctc
.
getTc014
()).
subtract
(
sfctc
.
getTc016
()));
sfctbDao
.
findById
(
new
SfctbId
(
params
.
getTc001
(),
params
.
getTc002
())).
ifPresent
(
i
->
{
if
(
i
.
getTb004
().
trim
().
equals
(
"2"
)){
sfctc
.
setTc018
(
sfctc
.
getTc015
().
multiply
(
sfctc
.
getTc017
()));
}
});
}
private
String
getNewTG002
()
{
String
prefix
=
DateUtil
.
currentDateString
();
return
sfctbDao
.
findFirstByTb002StartingWithOrderByTb002Desc
(
prefix
)
.
map
(
i
->
{
int
currentOrdianl
=
Integer
.
parseInt
(
i
.
getTb002
().
replace
(
prefix
,
""
));
return
prefix
+
String
.
format
(
"%03d"
,
currentOrdianl
+
1
);
})
.
orElse
(
prefix
+
"001"
);
}
private
BigDecimal
getInProcessQuantity
(
Sfcta
sfcta
)
{
BigDecimal
sfctcTc036Count
=
BigDecimal
.
ZERO
;
List
<
Sfctc
>
sfctcs
=
sfctcDao
.
findAllByTc004AndTc005AndTc006AndTc022
(
sfcta
.
getTa001
(),
sfcta
.
getTa002
(),
sfcta
.
getTa003
(),
"N"
)
.
stream
()
.
filter
(
i
->
{
String
tc013
=
i
.
getTc013
().
trim
();
if
(
tc013
.
equals
(
"1"
)
||
tc013
.
equals
(
"2"
)
||
tc013
.
equals
(
"4"
))
{
return
true
;
}
return
false
;
})
.
collect
(
Collectors
.
toList
());
for
(
Sfctc
sfctc
:
sfctcs
)
{
sfctcTc036Count
=
sfctcTc036Count
.
add
(
sfctc
.
getTc036
());
}
return
sfcta
.
getTa010
()
.
add
(
sfcta
.
getTa013
())
.
add
(
sfcta
.
getTa016
())
.
subtract
(
sfcta
.
getTa011
())
.
subtract
(
sfcta
.
getTa012
())
.
subtract
(
sfcta
.
getTa056
())
.
subtract
(
sfcta
.
getTa014
())
.
subtract
(
sfcta
.
getTa015
())
.
subtract
(
sfctcTc036Count
);
}
}
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