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
e61289b0
Commit
e61289b0
authored
Jan 16, 2025
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
销货单数据计算添加
parent
d9ff29d1
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
481 additions
and
48 deletions
+481
-48
CoptcDao.java
...ain/java/com/topsunit/scanservice/ximai/dao/CoptcDao.java
+24
-0
CoptdDao.java
...ain/java/com/topsunit/scanservice/ximai/dao/CoptdDao.java
+24
-0
CoptgCreateParams.java
...com/topsunit/scanservice/ximai/dto/CoptgCreateParams.java
+17
-17
CopthCreateParams.java
...com/topsunit/scanservice/ximai/dto/CopthCreateParams.java
+24
-24
Copma.java
...ain/java/com/topsunit/scanservice/ximai/entity/Copma.java
+4
-0
Coptc.java
...ain/java/com/topsunit/scanservice/ximai/entity/Coptc.java
+149
-0
CoptcId.java
...n/java/com/topsunit/scanservice/ximai/entity/CoptcId.java
+14
-0
Coptd.java
...ain/java/com/topsunit/scanservice/ximai/entity/Coptd.java
+126
-0
CoptdId.java
...n/java/com/topsunit/scanservice/ximai/entity/CoptdId.java
+17
-0
Coptn.java
...ain/java/com/topsunit/scanservice/ximai/entity/Coptn.java
+1
-1
CopthService.java
.../com/topsunit/scanservice/ximai/service/CopthService.java
+77
-5
messages.properties
src/main/resources/i18n/messages.properties
+4
-1
No files found.
src/main/java/com/topsunit/scanservice/ximai/dao/CoptcDao.java
0 → 100644
View file @
e61289b0
package
com
.
topsunit
.
scanservice
.
ximai
.
dao
;
import
com.topsunit.scanservice.ximai.entity.Cmsma
;
import
com.topsunit.scanservice.ximai.entity.Coptc
;
import
com.topsunit.scanservice.ximai.entity.Copto
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.math.BigDecimal
;
import
java.util.Optional
;
/**
* <p>Title: CoptcDao</p>
* <p>Description: 销售订单头 Dao</p>
*
* @author chicheng.li
* @version V1.0
* @date 2025/1/16
*/
public
interface
CoptcDao
extends
JpaRepository
<
Coptc
,
BigDecimal
>,
JpaSpecificationExecutor
<
Coptc
>
{
Optional
<
Coptc
>
findFirstByTc001AndTc002
(
String
tc001
,
String
tc002
);
}
src/main/java/com/topsunit/scanservice/ximai/dao/CoptdDao.java
0 → 100644
View file @
e61289b0
package
com
.
topsunit
.
scanservice
.
ximai
.
dao
;
import
com.topsunit.scanservice.ximai.entity.Cmsma
;
import
com.topsunit.scanservice.ximai.entity.Coptd
;
import
com.topsunit.scanservice.ximai.entity.Copto
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.math.BigDecimal
;
import
java.util.Optional
;
/**
* <p>Title: CoptdDao</p>
* <p>Description: 销售订单身 Dao</p>
*
* @author chicheng.li
* @version V1.0
* @date 2025/1/16
*/
public
interface
CoptdDao
extends
JpaRepository
<
Coptd
,
BigDecimal
>,
JpaSpecificationExecutor
<
Coptd
>
{
Optional
<
Coptd
>
findFirstByTd001AndTd002AndTd003
(
String
td001
,
String
td002
,
String
td003
);
}
src/main/java/com/topsunit/scanservice/ximai/dto/CoptgCreateParams.java
View file @
e61289b0
...
...
@@ -37,21 +37,21 @@ public class CoptgCreateParams {
@ApiModelProperty
(
"原币销货金额"
)
private
BigDecimal
tg013
;
@ApiModelProperty
(
"发票号码"
)
private
String
tg014
;
private
String
tg014
=
""
;
@ApiModelProperty
(
"税号"
)
private
String
tg015
;
private
String
tg015
=
""
;
@ApiModelProperty
(
"发票种类"
)
private
String
tg016
;
@ApiModelProperty
(
"税种"
)
private
String
tg017
;
@ApiModelProperty
(
"发票地址一"
)
private
String
tg018
;
private
String
tg018
=
""
;
@ApiModelProperty
(
"发票地址二"
)
private
String
tg019
;
private
String
tg019
=
""
;
@ApiModelProperty
(
"备注"
)
private
String
tg020
;
private
String
tg020
=
""
;
@ApiModelProperty
(
"发票日期"
)
private
String
tg021
;
private
String
tg021
=
""
;
@ApiModelProperty
(
"打印次数"
)
private
Integer
tg022
=
0
;
@ApiModelProperty
(
"审核码"
)
...
...
@@ -69,7 +69,7 @@ public class CoptgCreateParams {
@ApiModelProperty
(
"备注三"
)
private
String
tg029
=
""
;
@ApiModelProperty
(
"发票作废"
)
private
String
tg030
;
private
String
tg030
=
""
;
@ApiModelProperty
(
"烟酒注记"
)
private
String
tg031
=
"N"
;
@ApiModelProperty
(
"件数"
)
...
...
@@ -103,15 +103,15 @@ public class CoptgCreateParams {
@ApiModelProperty
(
"本币销货税额"
)
private
BigDecimal
tg046
;
@ApiModelProperty
(
"付款条件编号"
)
private
String
tg047
;
private
String
tg047
=
""
;
@ApiModelProperty
(
"订单单别"
)
private
String
tg048
;
private
String
tg048
=
""
;
@ApiModelProperty
(
"订单单号"
)
private
String
tg049
;
private
String
tg049
=
""
;
@ApiModelProperty
(
"预收待抵单别"
)
private
String
tg050
;
private
String
tg050
=
""
;
@ApiModelProperty
(
"预收待抵单号"
)
private
String
tg051
;
private
String
tg051
=
""
;
@ApiModelProperty
(
"冲抵金额"
)
private
BigDecimal
tg052
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"冲抵税额"
)
...
...
@@ -129,15 +129,15 @@ public class CoptgCreateParams {
@ApiModelProperty
(
"抛转状态"
)
private
String
tg059
=
"N"
;
@ApiModelProperty
(
"流程编号"
)
private
String
tg060
;
private
String
tg060
=
""
;
@ApiModelProperty
(
"随货附发票"
)
private
String
tg061
;
private
String
tg061
=
""
;
@ApiModelProperty
(
"开票人"
)
private
String
tg064
;
private
String
tg064
=
""
;
@ApiModelProperty
(
"发票代码"
)
private
String
tg065
;
private
String
tg065
=
""
;
@ApiModelProperty
(
"海关手册"
)
private
String
tg066
;
private
String
tg066
=
""
;
@ApiModelProperty
(
"传送次数"
)
private
Integer
tg067
=
0
;
...
...
src/main/java/com/topsunit/scanservice/ximai/dto/CopthCreateParams.java
View file @
e61289b0
...
...
@@ -35,7 +35,7 @@ public class CopthCreateParams {
@ApiModelProperty
(
"库存数量"
)
private
BigDecimal
th010
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"小单位"
)
private
String
th011
;
private
String
th011
=
""
;
@ApiModelProperty
(
"单价"
)
private
BigDecimal
th012
;
@ApiModelProperty
(
"金额"
)
...
...
@@ -57,31 +57,31 @@ public class CopthCreateParams {
@ApiModelProperty
(
"更新码"
)
private
String
th021
=
"N"
;
@ApiModelProperty
(
"保留字段"
)
private
String
th022
;
private
String
th022
=
""
;
@ApiModelProperty
(
"保留字段"
)
private
String
th023
;
private
String
th023
=
""
;
@ApiModelProperty
(
"赠/备品量"
)
private
BigDecimal
th024
;
private
BigDecimal
th024
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"折扣率"
)
private
BigDecimal
th025
;
private
BigDecimal
th025
=
BigDecimal
.
ONE
;
@ApiModelProperty
(
"结账码"
)
private
String
th026
=
"N"
;
@ApiModelProperty
(
"结账单别"
)
private
String
th027
;
private
String
th027
=
""
;
@ApiModelProperty
(
"结账单号"
)
private
String
th028
;
private
String
th028
=
""
;
@ApiModelProperty
(
"结账序号"
)
private
String
th029
;
private
String
th029
=
""
;
@ApiModelProperty
(
"项目编号"
)
private
String
th030
;
@ApiModelProperty
(
"类型"
)
private
String
th031
;
private
String
th031
=
""
;
@ApiModelProperty
(
"借出单别"
)
private
String
th032
;
private
String
th032
=
""
;
@ApiModelProperty
(
"借出单号"
)
private
String
th033
;
@ApiModelProperty
(
"借出序号"
)
private
String
th034
;
private
String
th034
=
""
;
@ApiModelProperty
(
"原币税前金额"
)
private
BigDecimal
th035
;
@ApiModelProperty
(
"原币税额"
)
...
...
@@ -91,17 +91,17 @@ public class CopthCreateParams {
@ApiModelProperty
(
"本币税额"
)
private
BigDecimal
th038
;
@ApiModelProperty
(
"包装数量"
)
private
BigDecimal
th039
;
private
BigDecimal
th039
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"赠/备品包装量"
)
private
BigDecimal
th040
;
private
BigDecimal
th040
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"包装单位"
)
private
String
th041
;
private
String
th041
=
""
;
@ApiModelProperty
(
"已结账数量"
)
private
BigDecimal
th042
;
private
BigDecimal
th042
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"件装"
)
private
BigDecimal
th043
;
private
BigDecimal
th043
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"件数"
)
private
BigDecimal
th044
;
private
BigDecimal
th044
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"出货通知单别"
)
private
String
th045
;
@ApiModelProperty
(
"出货通知单号"
)
...
...
@@ -111,19 +111,19 @@ public class CopthCreateParams {
@ApiModelProperty
(
"预留字段"
)
private
BigDecimal
th048
;
@ApiModelProperty
(
"批发价"
)
private
BigDecimal
th049
;
private
BigDecimal
th049
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"零售价"
)
private
BigDecimal
th050
;
private
BigDecimal
th050
=
BigDecimal
.
ZERO
;
@ApiModelProperty
(
"生产日期"
)
private
String
th051
;
private
String
th051
=
""
;
@ApiModelProperty
(
"有效日期"
)
private
String
th052
;
private
String
th052
=
""
;
@ApiModelProperty
(
"复检日期"
)
private
String
th053
;
private
String
th053
=
""
;
@ApiModelProperty
(
"原始客户"
)
private
String
th054
;
private
String
th054
=
""
;
@ApiModelProperty
(
"批号说明"
)
private
String
th055
;
private
String
th055
=
""
;
@ApiModelProperty
(
"库位"
)
private
String
th056
;
}
src/main/java/com/topsunit/scanservice/ximai/entity/Copma.java
View file @
e61289b0
...
...
@@ -27,6 +27,10 @@ public class Copma extends EntityBase {
@ApiModelProperty
(
"客户全称"
)
private
String
ma003
;
@ApiModelProperty
(
"客户地址"
)
private
String
ma027
;
@ApiModelProperty
(
"发票类型"
)
private
String
ma037
;
/**
* 1:已核准、2:尚待核准、3:不准交易[DEF:1]//20030312 5.0 P00-03030003 ADD BY 28995↓
...
...
src/main/java/com/topsunit/scanservice/ximai/entity/Coptc.java
0 → 100644
View file @
e61289b0
package
com
.
topsunit
.
scanservice
.
ximai
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.IdClass
;
import
java.math.BigDecimal
;
/**
* 销售单头
*/
@Data
@IdClass
(
CoptcId
.
class
)
@Entity
public
class
Coptc
extends
EntityBase
{
@Id
@ApiModelProperty
(
"单别"
)
private
String
tc001
;
@Id
@ApiModelProperty
(
"单号"
)
private
String
tc002
;
@ApiModelProperty
(
"订单日期"
)
private
String
tc003
;
@ApiModelProperty
(
"客户编号"
)
private
String
tc004
;
@ApiModelProperty
(
"部门编号"
)
private
String
tc005
;
@ApiModelProperty
(
"业务人员"
)
private
String
tc006
;
@ApiModelProperty
(
"出货工厂"
)
private
String
tc007
;
@ApiModelProperty
(
"交易币种"
)
private
String
tc008
;
@ApiModelProperty
(
"汇率"
)
private
BigDecimal
tc009
;
@ApiModelProperty
(
"送货地址(一)"
)
private
String
tc010
;
@ApiModelProperty
(
"送货地址(二)"
)
private
String
tc011
;
@ApiModelProperty
(
"客户单号"
)
private
String
tc012
;
@ApiModelProperty
(
"价格说明"
)
private
String
tc013
;
@ApiModelProperty
(
"付款条件"
)
private
String
tc014
;
@ApiModelProperty
(
"备注"
)
private
String
tc015
;
@ApiModelProperty
(
"税种"
)
private
String
tc016
;
@ApiModelProperty
(
"l/cno."
)
private
String
tc017
;
@ApiModelProperty
(
"联系人"
)
private
String
tc018
;
@ApiModelProperty
(
"运输方式"
)
private
String
tc019
;
@ApiModelProperty
(
"起始港口"
)
private
String
tc020
;
@ApiModelProperty
(
"目的港口"
)
private
String
tc021
;
@ApiModelProperty
(
"代理商"
)
private
String
tc022
;
@ApiModelProperty
(
"报关行"
)
private
String
tc023
;
@ApiModelProperty
(
"验货公司"
)
private
String
tc024
;
@ApiModelProperty
(
"运输公司"
)
private
String
tc025
;
@ApiModelProperty
(
"佣金比率"
)
private
BigDecimal
tc026
;
@ApiModelProperty
(
"审核码"
)
private
String
tc027
;
@ApiModelProperty
(
"打印次数"
)
private
Integer
tc028
;
@ApiModelProperty
(
"订单金额"
)
private
BigDecimal
tc029
;
@ApiModelProperty
(
"订单税额"
)
private
BigDecimal
tc030
;
@ApiModelProperty
(
"总数量"
)
private
BigDecimal
tc031
;
@ApiModelProperty
(
"consignee"
)
private
String
tc032
;
@ApiModelProperty
(
"notify"
)
private
String
tc033
;
@ApiModelProperty
(
"唛头编号"
)
private
String
tc034
;
@ApiModelProperty
(
"目的地"
)
private
String
tc035
;
@ApiModelProperty
(
"往来银行"
)
private
String
tc036
;
@ApiModelProperty
(
"invoice备注"
)
private
String
tc037
;
@ApiModelProperty
(
"packing-list备注"
)
private
String
tc038
;
@ApiModelProperty
(
"单据日期"
)
private
String
tc039
;
@ApiModelProperty
(
"审核者"
)
private
String
tc040
;
@ApiModelProperty
(
"税率"
)
private
BigDecimal
tc041
;
@ApiModelProperty
(
"付款条件编号"
)
private
String
tc042
;
@ApiModelProperty
(
"总毛重(kg)"
)
private
BigDecimal
tc043
;
@ApiModelProperty
(
"总材积(cuft)"
)
private
BigDecimal
tc044
;
@ApiModelProperty
(
"订金比率"
)
private
BigDecimal
tc045
;
@ApiModelProperty
(
"总包装数量"
)
private
BigDecimal
tc046
;
@ApiModelProperty
(
"押汇银行"
)
private
String
tc047
;
@ApiModelProperty
(
"签核状态码"
)
private
String
tc048
;
@ApiModelProperty
(
"流程编号"
)
private
String
tc049
;
@ApiModelProperty
(
"抛转状态"
)
private
String
tc050
;
@ApiModelProperty
(
"下游供应商"
)
private
String
tc051
;
@ApiModelProperty
(
"其他备注一"
)
private
String
tc052
;
@ApiModelProperty
(
"其他备注二"
)
private
String
tc053
;
@ApiModelProperty
(
"其他备注三"
)
private
String
tc054
;
@ApiModelProperty
(
"其他备注四"
)
private
String
tc055
;
@ApiModelProperty
(
"正唛"
)
private
String
tc056
;
@ApiModelProperty
(
"侧唛"
)
private
String
tc057
;
@ApiModelProperty
(
"传送次数"
)
private
Integer
tc058
;
@ApiModelProperty
(
"预留字段"
)
private
String
tc059
;
@ApiModelProperty
(
"预留字段"
)
private
String
tc060
;
@ApiModelProperty
(
"预留字段"
)
private
String
tc061
;
@ApiModelProperty
(
"预留字段"
)
private
BigDecimal
tc062
;
@ApiModelProperty
(
"预留字段"
)
private
BigDecimal
tc063
;
@ApiModelProperty
(
"预留字段"
)
private
BigDecimal
tc064
;
}
src/main/java/com/topsunit/scanservice/ximai/entity/CoptcId.java
0 → 100644
View file @
e61289b0
package
com
.
topsunit
.
scanservice
.
ximai
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
CoptcId
implements
Serializable
{
@ApiModelProperty
(
"通知单别"
)
private
String
tc001
;
@ApiModelProperty
(
"通知单号"
)
private
String
tc002
;
}
src/main/java/com/topsunit/scanservice/ximai/entity/Coptd.java
0 → 100644
View file @
e61289b0
package
com
.
topsunit
.
scanservice
.
ximai
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.IdClass
;
import
java.math.BigDecimal
;
/**
* 销售单头
*/
@Data
@IdClass
(
CoptdId
.
class
)
@Entity
public
class
Coptd
extends
EntityBase
{
@Id
@ApiModelProperty
(
"单别"
)
private
String
td001
;
@Id
@ApiModelProperty
(
"单号"
)
private
String
td002
;
@Id
@ApiModelProperty
(
"序号"
)
private
String
td003
;
@ApiModelProperty
(
"品号"
)
private
String
td004
;
@ApiModelProperty
(
"品名"
)
private
String
td005
;
@ApiModelProperty
(
"规格"
)
private
String
td006
;
@ApiModelProperty
(
"仓库"
)
private
String
td007
;
@ApiModelProperty
(
"订单数量"
)
private
BigDecimal
td008
;
@ApiModelProperty
(
"已交数量"
)
private
BigDecimal
td009
;
@ApiModelProperty
(
"单位"
)
private
String
td010
;
@ApiModelProperty
(
"单价"
)
private
BigDecimal
td011
;
@ApiModelProperty
(
"金额"
)
private
BigDecimal
td012
;
@ApiModelProperty
(
"预交货日"
)
private
String
td013
;
@ApiModelProperty
(
"客户品号"
)
private
String
td014
;
@ApiModelProperty
(
"预测编号"
)
private
String
td015
;
@ApiModelProperty
(
"结束"
)
private
String
td016
;
@ApiModelProperty
(
"前置单据-单别"
)
private
String
td017
;
@ApiModelProperty
(
"前置单据-单号"
)
private
String
td018
;
@ApiModelProperty
(
"前置单据-序号"
)
private
String
td019
;
@ApiModelProperty
(
"备注"
)
private
String
td020
;
@ApiModelProperty
(
"审核码"
)
private
String
td021
;
@ApiModelProperty
(
"库存数量"
)
private
BigDecimal
td022
;
@ApiModelProperty
(
"小单位"
)
private
String
td023
;
@ApiModelProperty
(
"赠品量"
)
private
BigDecimal
td024
;
@ApiModelProperty
(
"赠品已交量"
)
private
BigDecimal
td025
;
@ApiModelProperty
(
"折扣率"
)
private
BigDecimal
td026
;
@ApiModelProperty
(
"项目编号"
)
private
String
td027
;
@ApiModelProperty
(
"预测序号"
)
private
String
td028
;
@ApiModelProperty
(
"包装方式"
)
private
String
td029
;
@ApiModelProperty
(
"毛重(kg)"
)
private
BigDecimal
td030
;
@ApiModelProperty
(
"材积(cuft)"
)
private
BigDecimal
td031
;
@ApiModelProperty
(
"订单包装数量"
)
private
BigDecimal
td032
;
@ApiModelProperty
(
"已交包装数量"
)
private
BigDecimal
td033
;
@ApiModelProperty
(
"赠品包装量"
)
private
BigDecimal
td034
;
@ApiModelProperty
(
"赠品已交包装量"
)
private
BigDecimal
td035
;
@ApiModelProperty
(
"包装单位"
)
private
String
td036
;
@ApiModelProperty
(
"税率"
)
private
BigDecimal
td037
;
@ApiModelProperty
(
"税前金额"
)
private
BigDecimal
td038
;
@ApiModelProperty
(
"税额"
)
private
BigDecimal
td039
;
@ApiModelProperty
(
"件装"
)
private
BigDecimal
td040
;
@ApiModelProperty
(
"件数"
)
private
BigDecimal
td041
;
@ApiModelProperty
(
"批发价"
)
private
BigDecimal
td042
;
@ApiModelProperty
(
"零售价"
)
private
BigDecimal
td043
;
@ApiModelProperty
(
"出货待销量"
)
private
BigDecimal
td044
;
@ApiModelProperty
(
"出货待销包装量"
)
private
BigDecimal
td045
;
@ApiModelProperty
(
"原始客户"
)
private
String
td046
;
@ApiModelProperty
(
"预留字段"
)
private
String
td047
;
@ApiModelProperty
(
"预留字段"
)
private
String
td048
;
@ApiModelProperty
(
"预留字段"
)
private
String
td049
;
@ApiModelProperty
(
"预留字段"
)
private
BigDecimal
td050
;
@ApiModelProperty
(
"预留字段"
)
private
BigDecimal
td051
;
@ApiModelProperty
(
"预留字段"
)
private
BigDecimal
td052
;
}
src/main/java/com/topsunit/scanservice/ximai/entity/CoptdId.java
0 → 100644
View file @
e61289b0
package
com
.
topsunit
.
scanservice
.
ximai
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Id
;
import
java.io.Serializable
;
@Data
public
class
CoptdId
implements
Serializable
{
@ApiModelProperty
(
"单别"
)
private
String
td001
;
@ApiModelProperty
(
"单号"
)
private
String
td002
;
@ApiModelProperty
(
"序号"
)
private
String
td003
;
}
src/main/java/com/topsunit/scanservice/ximai/entity/Coptn.java
View file @
e61289b0
...
...
@@ -37,7 +37,7 @@ public class Coptn extends EntityBase{
private
String
tn009
;
@ApiModelProperty
(
"送货地址(二)"
)
private
String
tn010
;
@ApiModelProperty
(
"1.应税内含、2.应税外加、3.零税率、4.免税、9.不计税"
)
@ApiModelProperty
(
"
税种
1.应税内含、2.应税外加、3.零税率、4.免税、9.不计税"
)
private
String
tn011
;
@ApiModelProperty
(
"备注"
)
private
String
tn012
;
...
...
src/main/java/com/topsunit/scanservice/ximai/service/CopthService.java
View file @
e61289b0
...
...
@@ -4,10 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.util.StrUtil
;
import
com.topsunit.scanservice.ximai.common.DateUtil
;
import
com.topsunit.scanservice.ximai.common.TopsunitException
;
import
com.topsunit.scanservice.ximai.dao.CoptgDao
;
import
com.topsunit.scanservice.ximai.dao.CopthDao
;
import
com.topsunit.scanservice.ximai.dao.CoptnDao
;
import
com.topsunit.scanservice.ximai.dao.CoptoDao
;
import
com.topsunit.scanservice.ximai.dao.*
;
import
com.topsunit.scanservice.ximai.dto.*
;
import
com.topsunit.scanservice.ximai.entity.*
;
import
com.topsunit.scanservice.ximai.utils.MessageUtils
;
...
...
@@ -18,6 +15,7 @@ import org.springframework.stereotype.Service;
import
javax.transaction.Transactional
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
...
...
@@ -34,30 +32,52 @@ public class CopthService {
private
CoptnDao
coptnDao
;
@Autowired
private
CoptoDao
coptoDao
;
@Autowired
private
CoptcDao
coptcDao
;
@Autowired
private
CoptdDao
coptdDao
;
@Autowired
private
CopmaDao
copmaDao
;
@Transactional
public
void
create
(
StockSaleOutParams
params
){
Coptn
coptn
=
coptnDao
.
findFirstByTn001AndTn002
(
"251"
,
params
.
getApplyNo
())
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到出货通知单:"
)+
params
.
getApplyNo
()));
BigDecimal
total
=
BigDecimal
.
ZERO
;
BigDecimal
total013
=
BigDecimal
.
ZERO
;
BigDecimal
total025
=
BigDecimal
.
ZERO
;
BigDecimal
total045
=
BigDecimal
.
ZERO
;
BigDecimal
total046
=
BigDecimal
.
ZERO
;
Calendar
curr
=
Calendar
.
getInstance
();
String
currStr
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
format
(
curr
.
getTime
(),
"yyyyMMdd"
);
Coptg
coptg
=
BeanUtil
.
copyProperties
(
new
CoptgCreateParams
(),
Coptg
.
class
);
Copma
copma
=
copmaDao
.
findById
(
coptn
.
getTn004
())
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到客户:{0}"
,
coptg
.
getTg004
())));
coptg
.
setTg002
(
this
.
getNewTg002
(
coptg
.
getTg001
()));
coptg
.
setTg003
(
currStr
);
coptg
.
setTg042
(
currStr
);
coptg
.
setTg004
(
coptn
.
getTn004
());
coptg
.
setTg005
(
coptn
.
getTn006
());
coptg
.
setTg006
(
coptn
.
getTn007
());
coptg
.
setTg008
(
coptn
.
getTn009
());
coptg
.
setTg009
(
coptn
.
getTn010
());
coptg
.
setTg011
(
coptn
.
getTn013
());
coptg
.
setTg012
(
coptn
.
getTn014
());
coptg
.
setTg017
(
coptn
.
getTn011
());
coptg
.
setTg044
(
coptn
.
getTn030
());
coptg
.
setTg008
(
copma
.
getMa027
());
coptg
.
setTg016
(
copma
.
getMa037
());
int
i
=
1
;
for
(
StockSaleOutParams
.
StockSaleOutDetail
s
:
params
.
getData
()){
s
.
setWarehouse
(
StrUtil
.
trim
(
s
.
getWarehouse
()));
s
.
setLocation
(
StrUtil
.
trim
(
s
.
getLocation
()));
//查询出货通知单明细
Copto
copto
=
coptoDao
.
findFirstByTo001AndTo002AndTo007
(
"251"
,
params
.
getApplyNo
(),
s
.
getMaterialNo
())
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到出货通知单明细:{0},{1}"
,
params
.
getApplyNo
(),
s
.
getMaterialNo
())));
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到出货通知单明细:{0},{1}"
,
params
.
getApplyNo
(),
s
.
getMaterialNo
())));
//查询销售订单明细
Coptd
coptd
=
coptdDao
.
findFirstByTd001AndTd002AndTd003
(
copto
.
getTo004
(),
copto
.
getTo005
(),
copto
.
getTo006
())
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到销售订单:{0},{1},{2}"
,
copto
.
getTo004
(),
copto
.
getTo005
(),
copto
.
getTo006
())));
CopthCreateParams
copthCreateParams
=
new
CopthCreateParams
();
Copth
copth
=
BeanUtil
.
copyProperties
(
copthCreateParams
,
Copth
.
class
);
copth
.
setTh001
(
coptg
.
getTg001
());
...
...
@@ -66,6 +86,7 @@ public class CopthService {
copth
.
setTh004
(
s
.
getMaterialNo
());
copth
.
setTh005
(
s
.
getMaterialName
());
copth
.
setTh007
(
s
.
getWarehouse
());
copth
.
setTh056
(
s
.
getLocation
());
copth
.
setTh008
(
s
.
getOutQuantity
());
copth
.
setTh009
(
s
.
getUnit
());
copth
.
setTh006
(
copto
.
getTo009
());
...
...
@@ -75,14 +96,65 @@ public class CopthService {
copth
.
setTh045
(
copto
.
getTo001
());
copth
.
setTh046
(
copto
.
getTo002
());
copth
.
setTh047
(
copto
.
getTo003
());
this
.
statAmount
(
copth
,
coptg
,
coptd
);
copthDao
.
save
(
copth
);
total
=
total
.
add
(
s
.
getOutQuantity
());
total025
=
total025
.
add
(
copth
.
getTh036
());
total045
=
total045
.
add
(
copth
.
getTh037
());
total046
=
total046
.
add
(
copth
.
getTh038
());
total013
=
total013
.
add
(
copth
.
getTh035
());
i
++;
}
coptg
.
setTg013
(
total013
);
coptg
.
setTg033
(
total
);
coptg
.
setTg045
(
total045
);
coptg
.
setTg046
(
total046
);
coptg
.
setTg025
(
total025
);
coptgDao
.
save
(
coptg
);
}
private
void
statAmount
(
Copth
copth
,
Coptg
coptg
,
Coptd
coptd
){
//TH012 单价字段 根据订单单别(TH014)+订单号(TH015)+订单项次(TH016) 去获取对应订单单价
copth
.
setTh012
(
coptd
.
getTd011
());
//TH013 金额字段 数量*单价
copth
.
setTh013
(
copth
.
getTh008
().
multiply
(
coptd
.
getTd011
())
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
//TH018 备注字段 根据订单单别(TH014)+订单号(TH015)+订单项次(TH016) 去获取对应订单表身备注
copth
.
setTh018
(
coptd
.
getTd020
());
//TH019 客户品号字段 根据订单单别(TH014)+订单号(TH015)+订单项次(TH016) 去获取对应订单表身客户品号
copth
.
setTh019
(
coptd
.
getTd014
());
//TH030='' 项目编号字段 根据订单单别(TH014)+订单号(TH015)+订单项次(TH016) 去获取对应订单表身项目编码
copth
.
setTh030
(
coptd
.
getTd027
());
//TH048 税率字段 根据订单单别(TH014)+订单号(TH015)+订单项次(TH016) 去获取对应订单表身税率字段
copth
.
setTh048
(
coptd
.
getTd037
());
//TH035 原币税前金额 如果表头字段TG017='1' 该字段的值为TH013-TH036 其他则等于TH013
//TH036 原币税额 如果表头字段TG017='1' 该字段的值为TH013/(1+TH048)*TH048 如果表头字段TG017='2' 该字段的值为TH013*TH048 其他则等于0.00
//TH038 本币税额 如果表头字段TG017='1' 该字段的值为TH013*COPTG.TG012/(1+TH048)*TH048 如果表头字段TG017='2' 该字段的值为TH013*TG012*TH048 其他则等于0.00
//TH037 本币税前金额 如果表头字段TG017='1' 该字段的值为TH013*COPTG.TG012-TH038 其他则等于TH013*COPTG.TG012
if
(
"1"
.
equals
(
coptg
.
getTg017
())){
copth
.
setTh036
(
copth
.
getTh013
().
divide
(
BigDecimal
.
ONE
.
add
(
copth
.
getTh048
()),
2
,
RoundingMode
.
HALF_UP
)
.
multiply
(
copth
.
getTh048
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
copth
.
setTh035
(
copth
.
getTh013
().
subtract
(
copth
.
getTh036
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
copth
.
setTh038
(
copth
.
getTh013
().
multiply
(
coptg
.
getTg012
()).
divide
(
BigDecimal
.
ONE
.
add
(
copth
.
getTh048
()),
2
,
RoundingMode
.
HALF_UP
).
multiply
(
copth
.
getTh048
())
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
copth
.
setTh037
(
copth
.
getTh013
().
multiply
(
coptg
.
getTg012
()).
subtract
(
copth
.
getTh038
())
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
else
if
(
"2"
.
equals
(
coptg
.
getTg017
())){
copth
.
setTh036
(
copth
.
getTh013
().
multiply
(
copth
.
getTh048
().
setScale
(
2
,
RoundingMode
.
HALF_UP
)));
copth
.
setTh035
(
copth
.
getTh013
());
copth
.
setTh038
(
copth
.
getTh013
().
multiply
(
coptg
.
getTg012
()).
multiply
(
copth
.
getTh048
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
copth
.
setTh037
(
copth
.
getTh013
().
multiply
(
coptg
.
getTg012
())
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
else
{
copth
.
setTh036
(
BigDecimal
.
ZERO
);
copth
.
setTh035
(
copth
.
getTh013
());
copth
.
setTh038
(
BigDecimal
.
ZERO
);
copth
.
setTh037
(
copth
.
getTh013
().
multiply
(
coptg
.
getTg012
())
.
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
}
private
String
getNewTg002
(
String
tg001
)
{
String
prefix
=
DateUtil
.
currentDateString
();
return
coptgDao
.
findFirstByTg001AndTg002StartingWithOrderByTg002Desc
(
tg001
,
prefix
)
...
...
src/main/resources/i18n/messages.properties
View file @
e61289b0
...
...
@@ -38,4 +38,7 @@
未找到采购订单{0},{1},{2}=未找到采购订单{0},{1},{2}
未找到工单:{0},{1}=未找到工单:{0},{1}
请维护账套数据库编码=请维护账套数据库编码
通知单{0}已全部出库=通知单{0}已全部出库
\ No newline at end of file
通知单{0}已全部出库=通知单{0}已全部出库
未找到销售订单:{0},{1}=未找到销售订单:{0},{1}
未找到销售订单:{0},{1},{2}=未找到销售订单:{0},{1},{2}
未找到客户:{0}=未找到客户:{0}
\ 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