Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
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
huluobin
bailuntec-cost
Commits
5cdb9a3b
Commit
5cdb9a3b
authored
Mar 06, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
4b8216b3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
27 deletions
+43
-27
CostTypeDomain.java
...ain/java/com/blt/other/database/model/CostTypeDomain.java
+15
-8
AccountingSubject.java
...va/com/blt/other/module/cost/model/AccountingSubject.java
+6
-4
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+10
-3
CostApiServiceImpl.java
...lt/other/module/cost/service/impl/CostApiServiceImpl.java
+2
-2
CostTypeServiceImpl.java
...t/other/module/cost/service/impl/CostTypeServiceImpl.java
+6
-6
OtherApplicationTests.java
...ce/src/test/java/com/blt/other/OtherApplicationTests.java
+4
-4
No files found.
cost-service/src/main/java/com/blt/other/database/model/CostTypeDomain.java
View file @
5cdb9a3b
...
...
@@ -13,12 +13,20 @@ import java.time.LocalDateTime;
@TableName
(
value
=
"cost_type"
)
public
class
CostTypeDomain
{
//费用类型 包括付款 借还
public
static
final
Integer
feeType
=
0b1001
;
//收入类别 包括收款
public
static
final
Integer
incomeType
=
0b0100
;
//借支类别 包括借支
public
static
final
Integer
borrow
=
0b0010
;
/**
* 费用类型 包括付款 借还
*/
public
static
final
Integer
FEE_TYPE
=
0b1001
;
/**
* 收入类别 包括收款
*/
public
static
final
Integer
INCOME_TYPE
=
0b0100
;
/**
* 借支类别 包括借支
*/
public
static
final
Integer
BORROW
=
0b0010
;
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
...
...
@@ -65,7 +73,6 @@ public class CostTypeDomain {
@ApiModelProperty
(
value
=
"最后更新时间"
)
private
LocalDateTime
lastUpdateTime
;
@ApiModelProperty
(
value
=
"ns会计科目Id"
)
private
Integer
nsAccountingSubjectId
;
}
cost-service/src/main/java/com/blt/other/module/cost/model/AccountingSubject.java
View file @
5cdb9a3b
package
com
.
blt
.
other
.
module
.
cost
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
*
...
...
@@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode;
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@ApiModel
(
value
=
"AccountingSubject对象"
,
description
=
""
)
@ApiModel
(
value
=
"AccountingSubject对象"
,
description
=
""
)
public
class
AccountingSubject
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -49,5 +49,7 @@ public class AccountingSubject implements Serializable {
@ApiModelProperty
(
value
=
"最后更新时间"
)
private
LocalDateTime
lastUpdateTime
;
@ApiModelProperty
(
value
=
"ns会计科目Id"
)
private
Integer
nsAccountingSubjectId
;
}
cost-service/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
5cdb9a3b
...
...
@@ -94,8 +94,9 @@ public class CostDomain implements Serializable {
@ApiModelProperty
(
"描述"
)
private
String
description
;
@TableField
(
exist
=
false
)
//
@TableField(exist = false)
private
Integer
accountingSubjectId
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@ApiModelProperty
(
"会计一级科目"
)
...
...
@@ -279,14 +280,20 @@ public class CostDomain implements Serializable {
AccountingSubjectMapper
accountingSubjectMapper
=
SpringContextUtil
.
getBean
(
AccountingSubjectMapper
.
class
);
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectById
(
costTypeDomain
.
getAccountingSubjectId
());
this
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
this
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
this
.
setAccountingSubjectId
(
accountingSubject
.
getId
());
this
.
setNsAccountingSubjectId
(
accountingSubject
.
getNsAccountingSubjectId
());
this
.
setIsManageCost
(
costTypeDomain
.
getIsManageCost
());
this
.
setNsAccountingSubjectId
(
costTypeDomain
.
getNsAccountingSubjectId
());
}
private
static
final
String
REGEX_CHINESE
=
"[\u4e00-\u9fa5]"
;
// 中文正则
/**
* 中文正则
*/
private
static
final
String
REGEX_CHINESE
=
"[\u4e00-\u9fa5]"
;
public
PostApplyReq
buildPostApplyReq
()
{
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostApiServiceImpl.java
View file @
5cdb9a3b
...
...
@@ -69,7 +69,7 @@ public class CostApiServiceImpl implements CostApiService {
costDomain
.
setCostRemark
(
logisticsCostDto
.
getCostRemark
()
+
"【WMS系统推送】"
);
costDomain
.
setCostReason
(
logisticsCostDto
.
getCostReason
());
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNameAndType
(
"物流费"
,
CostTypeDomain
.
feeType
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNameAndType
(
"物流费"
,
CostTypeDomain
.
FEE_TYPE
);
costDomain
.
setCostType
(
costTypeDomain
);
costDomain
.
setCompanyName
(
"香港百伦科技有限公司"
);
...
...
@@ -179,7 +179,7 @@ public class CostApiServiceImpl implements CostApiService {
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_FINANCIAL_CHECK
);
//类型信息
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNameAndType
(
"工资"
,
CostTypeDomain
.
feeType
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNameAndType
(
"工资"
,
CostTypeDomain
.
FEE_TYPE
);
costDomain
.
setCostType
(
costTypeDomain
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostTypeServiceImpl.java
View file @
5cdb9a3b
...
...
@@ -73,7 +73,7 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
AccountingSubject
lendAccountingSubject
=
accountingSubjectMapper
.
selectByName
(
"其他应收款"
);
CostTypeDomain
lendCostTypeDomain
=
new
CostTypeDomain
();
lendCostTypeDomain
.
setCostTemplateType
(
CostTypeDomain
.
borrow
);
lendCostTypeDomain
.
setCostTemplateType
(
CostTypeDomain
.
BORROW
);
lendCostTypeDomain
.
setAccountingSubjectNo
(
lendAccountingSubject
.
getSubjectNo
());
lendCostTypeDomain
.
setTypeNo
(
IdWorker
.
getIdStr
());
lendCostTypeDomain
.
setTypeName
(
req
.
getTypeName
());
...
...
@@ -94,8 +94,8 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
if
(
StringUtils
.
isNotEmpty
(
req
.
getTypeNo
()))
{
CostTypeDomain
costTypeDomain
=
baseMapper
.
selectByNo
(
req
.
getTypeNo
());
if
(
costTypeDomain
.
getCostTemplateType
().
equals
(
CostTypeDomain
.
feeType
))
{
CostTypeDomain
lendCostTypeDomain
=
baseMapper
.
selectByNameAndType
(
costTypeDomain
.
getTypeName
(),
CostTypeDomain
.
borrow
);
if
(
costTypeDomain
.
getCostTemplateType
().
equals
(
CostTypeDomain
.
FEE_TYPE
))
{
CostTypeDomain
lendCostTypeDomain
=
baseMapper
.
selectByNameAndType
(
costTypeDomain
.
getTypeName
(),
CostTypeDomain
.
BORROW
);
if
(
lendCostTypeDomain
!=
null
)
{
lendCostTypeDomain
.
setTypeName
(
req
.
getTypeName
().
trim
());
...
...
@@ -211,11 +211,11 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
*/
private
Integer
getCostTemplateType
(
Integer
type
)
{
if
(
type
.
equals
(
1
))
{
return
CostTypeDomain
.
feeType
;
return
CostTypeDomain
.
FEE_TYPE
;
}
else
if
(
type
.
equals
(
2
))
{
return
CostTypeDomain
.
incomeType
;
return
CostTypeDomain
.
INCOME_TYPE
;
}
else
if
(
type
.
equals
(
3
))
{
return
CostTypeDomain
.
borrow
;
return
CostTypeDomain
.
BORROW
;
}
else
{
throw
new
BizRuntimeException
(
"invalid type"
);
}
...
...
cost-service/src/test/java/com/blt/other/OtherApplicationTests.java
View file @
5cdb9a3b
...
...
@@ -229,9 +229,9 @@ public class OtherApplicationTests {
private
void
syncData
()
{
Map
<
Integer
,
Integer
>
map
=
new
HashMap
<>();
map
.
put
(
1
,
CostTypeDomain
.
feeType
);
map
.
put
(
2
,
CostTypeDomain
.
incomeType
);
map
.
put
(
3
,
CostTypeDomain
.
borrow
);
map
.
put
(
1
,
CostTypeDomain
.
FEE_TYPE
);
map
.
put
(
2
,
CostTypeDomain
.
INCOME_TYPE
);
map
.
put
(
3
,
CostTypeDomain
.
BORROW
);
list
.
forEach
(
item
->
{
AccountingSubjectMapper
accountingSubjectMapper
=
SpringContextUtil
.
getBean
(
AccountingSubjectMapper
.
class
);
...
...
@@ -435,7 +435,7 @@ public class OtherApplicationTests {
costTypeDao
.
selectTestType
()
.
forEach
(
costTypeDomain
->
{
CostTypeDomain
item
=
new
CostTypeDomain
();
item
.
setCostTemplateType
(
CostTypeDomain
.
borrow
);
item
.
setCostTemplateType
(
CostTypeDomain
.
BORROW
);
item
.
setDescription
(
costTypeDomain
.
getDescription
());
item
.
setTypeNo
(
IdWorker
.
getIdStr
());
item
.
setTypeName
(
costTypeDomain
.
getTypeName
());
...
...
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