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
6163cebe
Commit
6163cebe
authored
Nov 02, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp 和xml重名方法 去除
parent
9018c100
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
471 additions
and
642 deletions
+471
-642
OtherApplication.java
...st-core/src/main/java/com/blt/other/OtherApplication.java
+3
-1
MpJsonConfig.java
...c/main/java/com/blt/other/common/config/MpJsonConfig.java
+22
-0
MybatisPlusConfig.java
...n/java/com/blt/other/common/config/MybatisPlusConfig.java
+11
-14
CostStatusSyncJob.java
...main/java/com/blt/other/common/job/CostStatusSyncJob.java
+1
-1
CostCheckController.java
...ther/module/cost/controller/cost/CostCheckController.java
+0
-0
CostCheckLendController.java
.../module/cost/controller/cost/CostCheckLendController.java
+0
-0
CostController.java
...blt/other/module/cost/controller/cost/CostController.java
+66
-12
CostDao.java
.../src/main/java/com/blt/other/module/cost/dao/CostDao.java
+2
-5
CostPlanDao.java
.../main/java/com/blt/other/module/cost/dao/CostPlanDao.java
+4
-6
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+6
-2
CostService.java
...n/java/com/blt/other/module/cost/service/CostService.java
+18
-0
AbstractCostService.java
...er/module/cost/service/impl/cost/AbstractCostService.java
+126
-20
DefaultCostServiceImpl.java
...module/cost/service/impl/cost/DefaultCostServiceImpl.java
+6
-2
Lend2PayCostServiceImpl.java
...odule/cost/service/impl/cost/Lend2PayCostServiceImpl.java
+77
-1
FinalCheckState.java
...r/module/cost/service/impl/costcheck/FinalCheckState.java
+2
-0
PayedState.java
.../other/module/cost/service/impl/costcheck/PayedState.java
+3
-0
RefuseState.java
...other/module/cost/service/impl/costcheck/RefuseState.java
+1
-0
UnPayState.java
.../other/module/cost/service/impl/costcheck/UnPayState.java
+1
-0
AbstractCostPlanService.java
...e/cost/service/impl/costplan/AbstractCostPlanService.java
+2
-1
CostPlanNewLend1ServiceImpl.java
...st/service/impl/costplan/CostPlanNewLend1ServiceImpl.java
+2
-2
CostPlanNewLend2ServiceImpl.java
...st/service/impl/costplan/CostPlanNewLend2ServiceImpl.java
+3
-3
CostPlanNewPayServiceImpl.java
...cost/service/impl/costplan/CostPlanNewPayServiceImpl.java
+2
-2
CostPlanNewReceiptServiceImpl.java
.../service/impl/costplan/CostPlanNewReceiptServiceImpl.java
+2
-2
CostPlanTempServiceImpl.java
...e/cost/service/impl/costplan/CostPlanTempServiceImpl.java
+3
-3
ApplyCallbackUrlDataDataVo.java
.../blt/other/module/cost/vo/ApplyCallbackUrlDataDataVo.java
+3
-50
ApplyCallbackUrlDataVo.java
.../com/blt/other/module/cost/vo/ApplyCallbackUrlDataVo.java
+12
-32
ApplyCallbackUrlVo.java
...java/com/blt/other/module/cost/vo/ApplyCallbackUrlVo.java
+1
-0
CashierCallbackUrlDataDataVo.java
...lt/other/module/cost/vo/CashierCallbackUrlDataDataVo.java
+4
-69
CashierCallbackUrlDataVo.java
...om/blt/other/module/cost/vo/CashierCallbackUrlDataVo.java
+12
-32
CashierCallbackUrlVo.java
...va/com/blt/other/module/cost/vo/CashierCallbackUrlVo.java
+3
-23
CostCashiercallbackDomain.java
...ther/module/database/model/CostCashiercallbackDomain.java
+3
-221
CostCompanyDomain.java
...om/blt/other/module/database/model/CostCompanyDomain.java
+2
-1
CostPlanDomain.java
...a/com/blt/other/module/database/model/CostPlanDomain.java
+8
-5
BuyServiceImpl.java
.../other/module/purchasing/service/impl/BuyServiceImpl.java
+1
-1
application-test.yml
bailuntec-cost-core/src/main/resources/application-test.yml
+6
-6
Cost.xml
bailuntec-cost-core/src/main/resources/mapper/Cost.xml
+2
-94
CostPlanDao.xml
...untec-cost-core/src/main/resources/mapper/CostPlanDao.xml
+11
-31
CostPlanDaoTest.java
...t/java/com/blt/other/module/cost/dao/CostPlanDaoTest.java
+40
-0
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/OtherApplication.java
View file @
6163cebe
...
...
@@ -5,6 +5,7 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -12,7 +13,8 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
@RestController
@SpringBootApplication
(
scanBasePackages
=
{
"com.blt.other"
,
"com.bailuntec"
})
@SpringBootApplication
@ComponentScan
(
basePackages
=
{
"com.blt.other"
,
"com.bailuntec"
})
@EnableFeignClients
@MapperScan
(
basePackages
=
"com.blt.other.module.*.dao"
)
public
class
OtherApplication
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/common/config/MpJsonConfig.java
0 → 100644
View file @
6163cebe
package
com
.
blt
.
other
.
common
.
config
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.stereotype.Component
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/11/2 4:55 下午
*/
@Component
public
class
MpJsonConfig
implements
CommandLineRunner
{
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
JacksonTypeHandler
.
setObjectMapper
(
new
ObjectMapper
());
}
}
bailuntec-cost-core/src/main/java/com/blt/other/common/config/MybatisPlusConfig.java
View file @
6163cebe
...
...
@@ -2,12 +2,9 @@ package com.blt.other.common.config;
import
com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.github.pagehelper.PageHelper
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
java.util.Properties
;
/**
* mybatis plus配置
*
...
...
@@ -15,17 +12,17 @@ import java.util.Properties;
*/
@Configuration
public
class
MybatisPlusConfig
{
@Bean
public
PageHelper
pageHelper
()
{
PageHelper
pageHelper
=
new
PageHelper
();
Properties
p
=
new
Properties
();
p
.
setProperty
(
"offsetAsPageNum"
,
"true"
);
p
.
setProperty
(
"rowBoundsWithCount"
,
"true"
);
p
.
setProperty
(
"reasonable"
,
"true"
);
pageHelper
.
setProperties
(
p
);
return
pageHelper
;
}
//
//
@Bean
//
public PageHelper pageHelper() {
//
PageHelper pageHelper = new PageHelper();
//
Properties p = new Properties();
//
p.setProperty("offsetAsPageNum", "true");
//
p.setProperty("rowBoundsWithCount", "true");
//
p.setProperty("reasonable", "true");
//
pageHelper.setProperties(p);
//
return pageHelper;
//
}
@Bean
public
PaginationInterceptor
paginationInterceptor
()
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/common/job/CostStatusSyncJob.java
View file @
6163cebe
...
...
@@ -44,7 +44,7 @@ public class CostStatusSyncJob extends QuartzJobBean {
CostDomain
costDomain
=
new
CostDomain
();
costDomain
.
setCostNo
(
costDto
.
getCostNo
());
costDomain
.
setCostStatus
(
5
);
int
result
=
costDao
.
update
(
costDomain
);
int
result
=
costDao
.
update
ByNo
(
costDomain
);
if
(
result
>
0
)
{
CostLogDomain
costLog
=
new
CostLogDomain
();
costLog
.
setCostNo
(
costDto
.
getCostNo
());
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/cost/CostCheckController.java
View file @
6163cebe
This diff is collapsed.
Click to expand it.
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/cost/CostCheckLendController.java
View file @
6163cebe
This diff is collapsed.
Click to expand it.
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/cost/CostController.java
View file @
6163cebe
...
...
@@ -17,10 +17,7 @@ import com.blt.other.module.cost.service.CostLogService;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.service.impl.cost.CostServiceFactory
;
import
com.blt.other.module.cost.service.impl.costcheck.*
;
import
com.blt.other.module.cost.vo.CostExportVo
;
import
com.blt.other.module.cost.vo.CostListPrintVo
;
import
com.blt.other.module.cost.vo.CostListSearchKeysVo
;
import
com.blt.other.module.cost.vo.CostResp
;
import
com.blt.other.module.cost.vo.*
;
import
com.blt.other.module.database.model.CostExpDomain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -165,6 +162,18 @@ public class CostController {
@Autowired
UnSubmitState
unSubmitState
;
@Autowired
DepartmentCheckState
departmentCheckState
;
@Autowired
FinalCheckState
finalCheckState
;
@Autowired
FinancialCheckState
financialCheckState
;
@Autowired
PayedState
payedState
;
@Autowired
RefuseState
refuseState
;
@Autowired
UnPayState
unPayState
;
@ApiOperation
(
"提交费用单"
)
@PostMapping
(
"submitAudit"
)
...
...
@@ -191,9 +200,9 @@ public class CostController {
public
CostApiDto
.
GetAllLendCostResp
getAllLendCost
(
@RequestParam
Integer
createuserid
)
{
costService
=
CostServiceFactory
.
getCostService
();
List
<
CostDto
>
costDto
s
=
costDao
.
selectLinkLendCost
(
createuserid
).
stream
().
map
(
CostDomain:
:
castToDto
).
collect
(
Collectors
.
toList
());
List
<
CostDto
>
costDto
List
=
costDao
.
selectLinkLendCost
(
createuserid
).
stream
().
map
(
CostDomain:
:
castToDto
).
collect
(
Collectors
.
toList
());
CostApiDto
.
GetAllLendCostResp
resp
=
new
CostApiDto
.
GetAllLendCostResp
();
resp
.
setLends
(
costDto
s
);
resp
.
setLends
(
costDto
List
);
return
resp
;
}
...
...
@@ -224,7 +233,9 @@ public class CostController {
@GetMapping
(
"/check/departmentCheck"
)
public
CostResult
<
Void
>
departmentCheck
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
costService
.
departmentCheck
(
costNo
,
userid
);
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
departmentCheckState
);
costContext
.
handle
();
return
CostResult
.
success
();
}
...
...
@@ -233,7 +244,7 @@ public class CostController {
public
CostResult
<
Void
>
departmentCheckRefuse
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
new
DepartmentCheckState
()
);
costContext
.
setCostState
(
departmentCheckState
);
costContext
.
refuse
();
return
CostResult
.
success
();
...
...
@@ -244,7 +255,7 @@ public class CostController {
public
CostResult
<
Void
>
financialCheck
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
new
FinancialCheckState
()
);
costContext
.
setCostState
(
financialCheckState
);
costContext
.
handle
();
return
CostResult
.
success
();
}
...
...
@@ -254,7 +265,7 @@ public class CostController {
public
CostResult
<
Void
>
financialRefuse
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
new
FinancialCheckState
()
);
costContext
.
setCostState
(
financialCheckState
);
costContext
.
handle
();
return
CostResult
.
success
();
}
...
...
@@ -264,7 +275,7 @@ public class CostController {
public
CostResult
<
Void
>
finalCheck
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
new
FinalCheckState
()
);
costContext
.
setCostState
(
finalCheckState
);
costContext
.
handle
();
return
CostResult
.
success
();
}
...
...
@@ -274,7 +285,7 @@ public class CostController {
public
CostResult
<
Void
>
finalRefuse
(
@RequestParam
String
costNo
,
@RequestParam
Integer
userid
)
{
CostContext
costContext
=
new
CostContext
(
costNo
,
userid
);
costContext
.
setCostState
(
new
FinalCheckState
()
);
costContext
.
setCostState
(
finalCheckState
);
costContext
.
refuse
();
return
CostResult
.
success
();
}
...
...
@@ -289,6 +300,49 @@ public class CostController {
return
CostResult
.
success
();
}
@ApiOperation
(
"财务审核回调"
)
@PostMapping
({
"check/ApplyCallbackUrl"
,
"check/lendCashierCallbackUrl"
})
public
CostResult
<
Void
>
applyCallbackUrl
(
@RequestBody
ApplyCallbackUrlVo
applyCallbackUrlVo
)
{
String
costNo
=
applyCallbackUrlVo
.
getId
().
toUpperCase
();
if
(
costNo
.
contains
(
"-"
))
{
costNo
=
costNo
.
split
(
"-"
)[
0
];
}
costService
=
CostServiceFactory
.
getCostService
(
costNo
);
costService
.
applyCallback
(
applyCallbackUrlVo
);
return
CostResult
.
success
();
}
@ApiOperation
(
"财务付款回调接口"
)
@PostMapping
(
value
=
{
"check/CashierCallbackUrl"
,
"check/lend/CashierCallbackUrl"
})
public
CostResult
<
Void
>
cashierCallbackUrl
(
@RequestBody
CashierCallbackUrlVo
cashierCallbackUrlVo
)
{
String
costNo
=
cashierCallbackUrlVo
.
getId
().
toUpperCase
();
if
(
costNo
.
contains
(
"-"
))
{
costNo
=
costNo
.
split
(
"-"
)[
0
];
}
costService
=
CostServiceFactory
.
getCostService
(
costNo
);
costService
.
cashierCallback
(
cashierCallbackUrlVo
);
return
CostResult
.
success
();
}
@ApiOperation
(
"修改发票"
)
@PostMapping
(
value
=
"/check/lend/invoice"
)
public
CostApiDto
.
UpdateCostResp
invoice
(
@RequestParam
String
costNo
,
@RequestParam
Integer
hasInvoice
,
@RequestParam
Integer
updateuserid
)
{
CostDomain
costDomain
=
new
CostDomain
();
costDomain
.
setHasInvoice
(
hasInvoice
);
costDomain
.
setCostNo
(
costNo
);
CostApiDto
.
UpdateCostResp
resp
=
costService
.
updateCost
(
costDomain
);
if
(
hasInvoice
==
0
)
{
costLogService
.
save
(
costNo
,
Integer
.
valueOf
(
updateuserid
),
"更改发票状态为:未给"
);
}
else
if
(
hasInvoice
==
1
)
{
costLogService
.
save
(
costNo
,
Integer
.
valueOf
(
updateuserid
),
"更改发票状态为:已给"
);
}
resp
.
setMsg
(
"确认发票成功!"
);
return
resp
;
}
@PostMapping
(
"/exportList"
)
public
String
exportList
(
HttpServletResponse
response
,
HttpServletRequest
request
)
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dao/CostDao.java
View file @
6163cebe
...
...
@@ -5,15 +5,12 @@ import com.bailuntec.cost.api.dto.ManageCostDto;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.vo.CostExportVo
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
@Mapper
@Repository
public
interface
CostDao
extends
BaseMapper
<
CostDomain
>
{
...
...
@@ -36,7 +33,7 @@ public interface CostDao extends BaseMapper<CostDomain> {
* @param costDomain
* @return
*/
Integer
update
(
CostDomain
costDomain
);
Integer
update
ByNo
(
CostDomain
costDomain
);
/**
* 获取 status >= costStatus(param) 的费用单
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dao/CostPlanDao.java
View file @
6163cebe
...
...
@@ -2,16 +2,14 @@ package com.blt.other.module.cost.dao;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.blt.other.module.database.model.CostPlanDomain
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Mapper
@Repository
public
interface
CostPlanDao
extends
BaseMapper
<
CostPlanDomain
>
{
CostPlanDomain
selectByNo
(
String
costPlanNo
);
/**
...
...
@@ -22,7 +20,7 @@ public interface CostPlanDao extends BaseMapper<CostPlanDomain> {
* @param costPlanDomain 计划单
* @return res
*/
Integer
update
(
CostPlanDomain
costPlanDomain
);
Integer
update
ByNo
(
CostPlanDomain
costPlanDomain
);
/**
* <p>
...
...
@@ -32,7 +30,7 @@ public interface CostPlanDao extends BaseMapper<CostPlanDomain> {
* @param costPlanNo 计划单号
* @return res
*/
Integer
delete
d
(
String
costPlanNo
);
Integer
delete
ByNo
(
String
costPlanNo
);
List
<
CostPlanDomain
>
selectAll
(
@Param
(
"userId"
)
Integer
userId
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
6163cebe
...
...
@@ -8,21 +8,25 @@ import com.baomidou.mybatisplus.annotation.IdType;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.module.database.mapper.StatusMapper
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.util.Date
;
import
java.util.List
;
@TableName
(
"cost"
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"cost"
,
autoResultMap
=
true
)
@Data
public
class
CostDomain
{
public
class
CostDomain
implements
Serializable
{
//付款费用
public
final
static
Integer
COST_FROM_1
=
1
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/CostService.java
View file @
6163cebe
...
...
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.blt.other.module.cost.dto.CostApiDto
;
import
com.blt.other.module.cost.dto.CostPageResult
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.vo.ApplyCallbackUrlVo
;
import
com.blt.other.module.cost.vo.CashierCallbackUrlVo
;
import
java.util.List
;
...
...
@@ -116,4 +118,20 @@ public interface CostService {
* @param costDomain cost
*/
void
toFinancial
(
CostDomain
costDomain
);
/**
* <p>
* 财务审核回调
* </p>
*
* @param applyCallbackUrlVo req
*/
void
applyCallback
(
ApplyCallbackUrlVo
applyCallbackUrlVo
);
/**
* 出纳付款回调
*
* @param cashierCallbackUrlVo req
*/
void
cashierCallback
(
CashierCallbackUrlVo
cashierCallbackUrlVo
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/cost/AbstractCostService.java
View file @
6163cebe
This diff is collapsed.
Click to expand it.
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/cost/DefaultCostServiceImpl.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
cost
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostService
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.stereotype.Service
;
...
...
@@ -15,8 +17,10 @@ import org.springframework.stereotype.Service;
@Service
@Primary
public
class
DefaultCostServiceImpl
extends
AbstractCostService
implements
CostService
{
@Override
public
void
finalCheck
(
String
costNo
,
Integer
currentUserId
)
{
@Override
public
void
toFinancial
(
CostDomain
costDomain
)
{
throw
new
BizRuntimeException
(
"un impl method"
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/cost/Lend2PayCostServiceImpl.java
View file @
6163cebe
...
...
@@ -7,9 +7,11 @@ import com.bailuntec.api.bailuntec.cw.response.CwResult;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.JsonUtilByJackson
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.vo.TofinanceVo
;
import
com.blt.other.module.database.model.CostCashiercallbackDomain
;
import
com.blt.other.module.database.model.CostTofinanceDomain
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -17,6 +19,7 @@ import org.springframework.stereotype.Service;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -36,7 +39,7 @@ public class Lend2PayCostServiceImpl extends AbstractCostService implements Cost
@Override
public
void
toFinancial
(
CostDomain
cost
)
{
if
(
cost
.
getLendBalance
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
throw
new
BizRuntimeException
(
"invalid amount"
)
throw
new
BizRuntimeException
(
"invalid amount"
)
;
}
PostApplyReq
req
=
super
.
buildPostApplyReq
(
cost
);
...
...
@@ -70,4 +73,77 @@ public class Lend2PayCostServiceImpl extends AbstractCostService implements Cost
costTofinanceDomain
.
setCode
(
costTofinanceDomain
.
getCode
().
toUpperCase
());
costTofinanceService
.
saveCostTofinanceMsg
(
costTofinanceDomain
);
}
@Override
void
cashierCallbackPass
(
CostCashiercallbackDomain
costCashiercallbackDomain
)
{
// 付款成功,更改借还单信息,否则返回失败
CostDomain
costDomainByNo
=
this
.
getCostByCostNo
(
costCashiercallbackDomain
.
getCostNo
());
String
sonNo
=
costDomainByNo
.
getCostNo
().
toUpperCase
();
changeStatus
(
costCashiercallbackDomain
.
getCostNo
(),
4
,
costDomainByNo
.
getLendStatus
(),
costCashiercallbackDomain
.
getPayuserid
());
if
(
sonNo
.
contains
(
"S"
))
{
CostDomain
supCostDomain
=
this
.
getCostByCostNo
(
costDomainByNo
.
getSupCostNo
());
if
(
null
==
supCostDomain
.
getHadPay
())
supCostDomain
.
setHadPay
(
new
BigDecimal
(
0
));
if
(
null
==
supCostDomain
.
getCompensate
())
supCostDomain
.
setCompensate
(
new
BigDecimal
(
0
));
// supCostDomain.setCompensate(supCostDomain.getCompensate().add(costCashiercallbackDomain.getPayamount()));
supCostDomain
.
setCompensate
(
supCostDomain
.
getCompensate
().
subtract
(
costCashiercallbackDomain
.
getPayamount
()));
// supCostDomain.setHadPay(supCostDomain.getHadPay().add(costCashiercallbackDomain.getPayamount()));
// 借还单在出纳完成收付款后,不用直接获取返回的金额(使用费用系统中记录的提交金额,出纳系统结算的实时汇率和费用系统不一定一致)
supCostDomain
.
setHadPay
(
supCostDomain
.
getHadPay
().
add
(
costDomainByNo
.
getAmount
()));
// int i = supCostDomain.getAmount().compareTo(supCostDomain.getHadPay().subtract(supCostDomain.getCompensate()));
BigDecimal
zero
=
new
BigDecimal
(
0
);
if
(
supCostDomain
.
getCompensate
().
compareTo
(
zero
)
==
0
)
{
supCostDomain
.
setLendStatus
(
4
);
// 已补差额,但是仍有金额未到账
BigDecimal
allPayAmount
=
supCostDomain
.
getAmount
().
add
(
costCashiercallbackDomain
.
getPayamount
());
int
i
=
allPayAmount
.
compareTo
(
supCostDomain
.
getHadPay
());
if
(
0
<
i
)
{
supCostDomain
.
setLendStatus
(
2
);
}
}
if
(
supCostDomain
.
getCompensate
().
compareTo
(
zero
)
==
1
)
{
supCostDomain
.
setLendStatus
(
3
);
}
this
.
updateCost
(
supCostDomain
);
}
if
(!
sonNo
.
contains
(
"S"
)
&&
null
!=
costDomainByNo
.
getSupCostNo
())
{
CostDomain
supCostDomain
=
this
.
getCostByCostNo
(
costDomainByNo
.
getSupCostNo
());
if
(
null
==
supCostDomain
.
getHadPay
())
{
supCostDomain
.
setHadPay
(
new
BigDecimal
(
0
));
}
// supCostDomain.setHadPay(supCostDomain.getHadPay().add(costCashiercallbackDomain.getCashierpaymoney()));
// 借还单在出纳完成收付款后,不用直接获取返回的金额(使用费用系统中记录的提交金额,出纳系统结算的实时汇率和费用系统不一定一致)
supCostDomain
.
setHadPay
(
supCostDomain
.
getHadPay
().
add
(
costDomainByNo
.
getAmount
()));
if
(
supCostDomain
.
getHadPay
().
compareTo
(
supCostDomain
.
getAmount
())
==
0
)
{
supCostDomain
.
setLendStatus
(
4
);
}
if
(
supCostDomain
.
getHadPay
().
compareTo
(
supCostDomain
.
getAmount
())
==
-
1
)
{
supCostDomain
.
setLendStatus
(
2
);
}
if
(
supCostDomain
.
getHadPay
().
compareTo
(
supCostDomain
.
getAmount
())
==
1
)
{
supCostDomain
.
setLendStatus
(
3
);
supCostDomain
.
setCompensate
(
supCostDomain
.
getHadPay
().
subtract
(
supCostDomain
.
getAmount
()));
}
this
.
updateCost
(
supCostDomain
);
}
costLogService
.
save
(
costCashiercallbackDomain
.
getCostNo
(),
costCashiercallbackDomain
.
getPayuserid
(),
"出纳收/付款成功:"
+
costCashiercallbackDomain
.
getPaynote
());
}
private
void
changeStatus
(
String
costNo
,
Integer
costStatus
,
Integer
lendStatus
,
Integer
updateUserId
)
{
Date
now
=
new
Date
();
CostDomain
costDomain
=
this
.
getCostByCostNo
(
costNo
);
costDomain
.
setCostStatus
(
costStatus
);
costDomain
.
setCostNo
(
costNo
);
costDomain
.
setLendStatus
(
lendStatus
);
costDomain
.
setPayUserId
(
updateUserId
);
costDomain
.
setPayTime
(
now
);
BigDecimal
toRmbRate
=
CurUtils
.
getCur
(
costDomain
.
getDic
(),
"CNY"
,
getExchangeRateApi
);
costDomain
.
setToRmbRate
(
toRmbRate
);
costDomain
.
setAmountRmb
(
costDomain
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
costDomain
.
setAuditTime
(
now
);
this
.
updateCost
(
costDomain
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/FinalCheckState.java
View file @
6163cebe
...
...
@@ -7,6 +7,7 @@ import com.blt.other.module.cost.model.CostDomain;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.database.model.CostCompanyDomain
;
import
com.blt.other.module.database.model.CostLogDomain
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
...
...
@@ -18,6 +19,7 @@ import javax.annotation.Resource;
* @author robbendev
* @since 2020/10/30 2:57 下午
*/
@Component
public
class
FinalCheckState
extends
CostState
{
@Resource
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/PayedState.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
costcheck
;
import
org.springframework.stereotype.Component
;
/**
* <p>
*
...
...
@@ -8,6 +10,7 @@ package com.blt.other.module.cost.service.impl.costcheck;
* @author robbendev
* @since 2020/10/30 2:57 下午
*/
@Component
public
class
PayedState
extends
CostState
{
@Override
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/RefuseState.java
View file @
6163cebe
...
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Component;
* @author robbendev
* @since 2020/10/30 2:57 下午
*/
@Component
public
class
RefuseState
extends
CostState
{
@Override
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costcheck/UnPayState.java
View file @
6163cebe
...
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Component;
* @author robbendev
* @since 2020/10/30 2:57 下午
*/
@Component
public
class
UnPayState
extends
CostState
{
@Override
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/AbstractCostPlanService.java
View file @
6163cebe
...
...
@@ -111,7 +111,7 @@ public abstract class AbstractCostPlanService implements CostPlanService {
@Override
public
void
deleted
(
String
costPlanNo
)
{
costPlanDao
.
delete
d
(
costPlanNo
);
costPlanDao
.
delete
ByNo
(
costPlanNo
);
}
@Override
...
...
@@ -131,6 +131,7 @@ public abstract class AbstractCostPlanService implements CostPlanService {
@Override
public
CostPlanApiDto
.
GetCostPlanResp
getByPlanNo
(
String
planNo
)
{
CostPlanDomain
costPlanDomain
=
costPlanDao
.
selectByNo
(
planNo
);
costPlanDomain
.
setCostTemplate
(
costTemplateService
.
queryDetail
(
costPlanDomain
.
getCostTemplateId
()));
String
filePath
=
costPlanDomain
.
getFilePath
();
String
fileName
=
null
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewLend1ServiceImpl.java
View file @
6163cebe
...
...
@@ -56,7 +56,7 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
planDomain
.
setKindName
(
costTypeKindDomain
.
getKindName
());
planDomain
.
setTypeNo
(
costTypeKindDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeKindDomain
.
getTypeName
());
costPlanDao
.
update
(
planDomain
);
costPlanDao
.
update
ByNo
(
planDomain
);
}
@Override
...
...
@@ -66,7 +66,7 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
throw
new
BizRuntimeException
(
"只能更新待确认的计划单"
);
}
costPlanDomain
.
setCostPlanStatus
(
1
);
costPlanDao
.
update
(
costPlanDomain
);
costPlanDao
.
update
ByNo
(
costPlanDomain
);
CostDomain
costDomain
=
planToCost
(
costPlanDomain
.
getCostPlanNo
());
String
costNo
=
getCostNo
();
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewLend2ServiceImpl.java
View file @
6163cebe
...
...
@@ -56,7 +56,7 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
planDomain
.
setTypeNo
(
costTypeKindDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeKindDomain
.
getTypeName
());
costPlanDao
.
update
(
planDomain
);
costPlanDao
.
update
ByNo
(
planDomain
);
}
@Override
...
...
@@ -68,7 +68,7 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
}
//已确认
costPlanDomain
.
setCostPlanStatus
(
1
);
costPlanDao
.
update
(
costPlanDomain
);
costPlanDao
.
update
ByNo
(
costPlanDomain
);
// 借还单确认时,根据借支单金额、冲销金额、余额拆单
//关联的借支单
...
...
@@ -186,7 +186,7 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
supCost
.
setCompensate
(
new
BigDecimal
(
0
));
}
supCost
.
setCompensate
(
supCost
.
getCompensate
().
add
(
payPlan
.
getPlanAmount
()));
costDao
.
update
(
supCost
);
costDao
.
update
ByNo
(
supCost
);
}
else
{
log
.
info
(
"生成一张补差额的付款单失败:"
+
costDomain1
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewPayServiceImpl.java
View file @
6163cebe
...
...
@@ -48,7 +48,7 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
List
<
CostPlanTempDomain
>
list
=
costPlanTempDao
.
selectListByPlanNo
(
planDomain
.
getCostPlanNo
());
BigDecimal
planAmount
=
list
.
stream
().
map
(
CostPlanTempDomain:
:
getAmount
).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
planDomain
.
setPlanAmount
(
planAmount
);
costPlanDao
.
update
(
planDomain
);
costPlanDao
.
update
ByNo
(
planDomain
);
}
@Override
...
...
@@ -59,7 +59,7 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
throw
new
BizRuntimeException
(
"只能更新待确认的计划单"
);
}
costPlanDomain
.
setCostPlanStatus
(
1
);
costPlanDao
.
update
(
costPlanDomain
);
costPlanDao
.
update
ByNo
(
costPlanDomain
);
List
<
CostPlanTempDomain
>
costPlanTempDomains
=
costPlanTempDao
.
selectListByPlanNo
(
costPlanNo
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewReceiptServiceImpl.java
View file @
6163cebe
...
...
@@ -49,7 +49,7 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
planDomain
.
setTypeNo
(
costTypeKindDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeKindDomain
.
getTypeName
());
costPlanDao
.
update
(
planDomain
);
costPlanDao
.
update
ByNo
(
planDomain
);
}
@Override
...
...
@@ -59,7 +59,7 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
throw
new
BizRuntimeException
(
"只能更新待确认的计划单"
);
}
costPlanDomain
.
setCostPlanStatus
(
1
);
costPlanDao
.
update
(
costPlanDomain
);
costPlanDao
.
update
ByNo
(
costPlanDomain
);
CostDomain
costDomain
=
planToCost
(
costPlanNo
);
String
costNo
=
getCostNo
();
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanTempServiceImpl.java
View file @
6163cebe
...
...
@@ -88,7 +88,7 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
CostPlanDomain
costPlanDomain
=
costPlanDao
.
selectByNo
(
costPlanTempDomain
.
getCostPlanNo
());
if
(
costPlanDomain
!=
null
)
{
costPlanDomain
.
setPlanAmount
(
costPlanDomain
.
getPlanAmount
().
add
(
costPlanTempDomain
.
getAmount
()));
costPlanDao
.
update
(
costPlanDomain
);
costPlanDao
.
update
ByNo
(
costPlanDomain
);
}
CostPlanTempApiDto
.
AddItemResp
resp
=
new
CostPlanTempApiDto
.
AddItemResp
();
...
...
@@ -132,7 +132,7 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
if
(
costPlanDomain
!=
null
)
{
costPlanDomain
.
setPlanAmount
(
costPlanDomain
.
getPlanAmount
().
subtract
(
costPlanTempDomain
.
getAmount
()));
costPlanDao
.
update
(
costPlanDomain
);
costPlanDao
.
update
ByNo
(
costPlanDomain
);
return
costPlanDomain
.
getPlanAmount
();
}
return
BigDecimal
.
ZERO
;
...
...
@@ -184,7 +184,7 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
if
(
1
==
plan
.
getCostForm
()
&&
(
null
!=
plan
.
getIsLend
()
&&
2
==
plan
.
getIsLend
()))
{
plan
.
setPayPlanAmount
(
newAmount
.
divide
(
plan
.
getPayCur
(),
4
));
}
costPlanDao
.
update
(
plan
);
costPlanDao
.
update
ByNo
(
plan
);
}
return
costPlanTempDomain
;
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/vo/ApplyCallbackUrlDataDataVo.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
vo
;
import
lombok.Data
;
@Data
public
class
ApplyCallbackUrlDataDataVo
{
private
Integer
applyid
;
...
...
@@ -8,54 +11,4 @@ public class ApplyCallbackUrlDataDataVo {
private
Integer
audituserid
;
private
String
auditusername
;
public
Integer
getApplyid
()
{
return
applyid
;
}
public
void
setApplyid
(
Integer
applyid
)
{
this
.
applyid
=
applyid
;
}
public
String
getApplyno
()
{
return
applyno
;
}
public
void
setApplyno
(
String
applyno
)
{
this
.
applyno
=
applyno
;
}
public
String
getAuditnote
()
{
return
auditnote
;
}
public
void
setAuditnote
(
String
auditnote
)
{
this
.
auditnote
=
auditnote
;
}
public
Integer
getAudituserid
()
{
return
audituserid
;
}
public
void
setAudituserid
(
Integer
audituserid
)
{
this
.
audituserid
=
audituserid
;
}
public
String
getAuditusername
()
{
return
auditusername
;
}
public
void
setAuditusername
(
String
auditusername
)
{
this
.
auditusername
=
auditusername
;
}
@Override
public
String
toString
()
{
return
"ApplyCallbackUrlDataDataVo{"
+
"applyid="
+
applyid
+
", applyno='"
+
applyno
+
'\''
+
", auditnote='"
+
auditnote
+
'\''
+
", audituserid="
+
audituserid
+
", auditusername='"
+
auditusername
+
'\''
+
'}'
;
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/vo/ApplyCallbackUrlDataVo.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
vo
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
@Data
public
class
ApplyCallbackUrlDataVo
{
@JsonProperty
(
"Success"
)
private
boolean
success
;
private
String
message
;
private
ApplyCallbackUrlDataDataVo
data
;
public
boolean
isSuccess
()
{
return
success
;
}
public
void
setSuccess
(
boolean
success
)
{
this
.
success
=
success
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
ApplyCallbackUrlDataDataVo
getData
()
{
return
data
;
}
@JsonProperty
(
"Success"
)
private
String
message
;
public
void
setData
(
ApplyCallbackUrlDataDataVo
data
)
{
this
.
data
=
data
;
}
/**
* {@link ApplyCallbackUrlDataDataVo}
*/
@JsonProperty
(
"Data"
)
private
String
data
;
@Override
public
String
toString
()
{
return
"ApplyCallbackUrlDataVo{"
+
"success="
+
success
+
", message='"
+
message
+
'\''
+
", data="
+
data
+
'}'
;
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/vo/ApplyCallbackUrlVo.java
View file @
6163cebe
...
...
@@ -6,6 +6,7 @@ import lombok.Data;
public
class
ApplyCallbackUrlVo
{
private
ApplyCallbackUrlDataVo
data
;
private
String
id
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/vo/CashierCallbackUrlDataDataVo.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
vo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
CashierCallbackUrlDataDataVo
{
private
Integer
payid
;
private
String
payno
;
private
BigDecimal
payamount
;
private
Integer
payuserid
;
private
String
payusername
;
private
String
payusername
;
private
String
paynote
;
private
Paydetail
paydetail
;
public
Integer
getPayid
()
{
return
payid
;
}
public
void
setPayid
(
Integer
payid
)
{
this
.
payid
=
payid
;
}
public
String
getPayno
()
{
return
payno
;
}
public
void
setPayno
(
String
payno
)
{
this
.
payno
=
payno
;
}
public
BigDecimal
getPayamount
()
{
return
payamount
;
}
public
void
setPayamount
(
BigDecimal
payamount
)
{
this
.
payamount
=
payamount
;
}
public
Integer
getPayuserid
()
{
return
payuserid
;
}
public
void
setPayuserid
(
Integer
payuserid
)
{
this
.
payuserid
=
payuserid
;
}
public
String
getPayusername
()
{
return
payusername
;
}
public
void
setPayusername
(
String
payusername
)
{
this
.
payusername
=
payusername
;
}
public
String
getPaynote
()
{
return
paynote
;
}
public
void
setPaynote
(
String
paynote
)
{
this
.
paynote
=
paynote
;
}
public
Paydetail
getPaydetail
()
{
return
paydetail
;
}
public
void
setPaydetail
(
Paydetail
paydetail
)
{
this
.
paydetail
=
paydetail
;
}
@Override
public
String
toString
()
{
return
"CashierCallbackUrlDataDataVo{"
+
"payid="
+
payid
+
", payno='"
+
payno
+
'\''
+
", payamount="
+
payamount
+
", payuserid="
+
payuserid
+
", payusername='"
+
payusername
+
'\''
+
", paynote='"
+
paynote
+
'\''
+
", paydetail="
+
paydetail
+
'}'
;
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/vo/CashierCallbackUrlDataVo.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
vo
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
@Data
public
class
CashierCallbackUrlDataVo
{
@JsonProperty
(
"Success"
)
private
boolean
success
;
private
String
message
;
private
CashierCallbackUrlDataDataVo
data
;
public
boolean
isSuccess
()
{
return
success
;
}
public
void
setSuccess
(
boolean
success
)
{
this
.
success
=
success
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
CashierCallbackUrlDataDataVo
getData
()
{
return
data
;
}
@JsonProperty
(
"Message"
)
private
String
message
;
public
void
setData
(
CashierCallbackUrlDataDataVo
data
)
{
this
.
data
=
data
;
}
/**
* {@link CashierCallbackUrlDataDataVo}
*/
@JsonProperty
(
"Data"
)
private
String
data
;
@Override
public
String
toString
()
{
return
"CashierCallbackUrlDataVo{"
+
"success="
+
success
+
", message='"
+
message
+
'\''
+
", data="
+
data
+
'}'
;
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/vo/CashierCallbackUrlVo.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
vo
;
import
lombok.Data
;
@Data
public
class
CashierCallbackUrlVo
{
private
String
id
;
// 对应数据库中的 buyno
private
CashierCallbackUrlDataVo
data
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
CashierCallbackUrlDataVo
getData
()
{
return
data
;
}
public
void
setData
(
CashierCallbackUrlDataVo
data
)
{
this
.
data
=
data
;
}
@Override
public
String
toString
()
{
return
"CashierCallbackUrlVo{"
+
"id='"
+
id
+
'\''
+
", data="
+
data
+
'}'
;
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/database/model/CostCashiercallbackDomain.java
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
database
.
model
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
CostCashiercallbackDomain
{
private
Integer
id
;
private
String
costNo
;
...
...
@@ -28,225 +31,4 @@ public class CostCashiercallbackDomain {
private
String
cashiermothercard
;
private
BigDecimal
toRmbRate
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getCostNo
()
{
return
costNo
;
}
public
void
setCostNo
(
String
costNo
)
{
this
.
costNo
=
costNo
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
Integer
getPayid
()
{
return
payid
;
}
public
void
setPayid
(
Integer
payid
)
{
this
.
payid
=
payid
;
}
public
String
getPayno
()
{
return
payno
;
}
public
void
setPayno
(
String
payno
)
{
this
.
payno
=
payno
;
}
public
BigDecimal
getPayamount
()
{
return
payamount
;
}
public
void
setPayamount
(
BigDecimal
payamount
)
{
this
.
payamount
=
payamount
;
}
public
Integer
getPayuserid
()
{
return
payuserid
;
}
public
void
setPayuserid
(
Integer
payuserid
)
{
this
.
payuserid
=
payuserid
;
}
public
String
getPayusername
()
{
return
payusername
;
}
public
void
setPayusername
(
String
payusername
)
{
this
.
payusername
=
payusername
;
}
public
String
getPaynote
()
{
return
paynote
;
}
public
void
setPaynote
(
String
paynote
)
{
this
.
paynote
=
paynote
;
}
public
Integer
getCashierbankaccountid
()
{
return
cashierbankaccountid
;
}
public
void
setCashierbankaccountid
(
Integer
cashierbankaccountid
)
{
this
.
cashierbankaccountid
=
cashierbankaccountid
;
}
public
String
getCashierbankname
()
{
return
cashierbankname
;
}
public
void
setCashierbankname
(
String
cashierbankname
)
{
this
.
cashierbankname
=
cashierbankname
;
}
public
String
getCashierbankcard
()
{
return
cashierbankcard
;
}
public
void
setCashierbankcard
(
String
cashierbankcard
)
{
this
.
cashierbankcard
=
cashierbankcard
;
}
public
String
getCashierbankcardname
()
{
return
cashierbankcardname
;
}
public
void
setCashierbankcardname
(
String
cashierbankcardname
)
{
this
.
cashierbankcardname
=
cashierbankcardname
;
}
public
String
getCashierunitcode
()
{
return
cashierunitcode
;
}
public
void
setCashierunitcode
(
String
cashierunitcode
)
{
this
.
cashierunitcode
=
cashierunitcode
;
}
public
String
getCashierunitname
()
{
return
cashierunitname
;
}
public
void
setCashierunitname
(
String
cashierunitname
)
{
this
.
cashierunitname
=
cashierunitname
;
}
public
BigDecimal
getCashierrate
()
{
return
cashierrate
;
}
public
void
setCashierrate
(
BigDecimal
cashierrate
)
{
this
.
cashierrate
=
cashierrate
;
}
public
BigDecimal
getCashierpaymoney
()
{
return
cashierpaymoney
;
}
public
void
setCashierpaymoney
(
BigDecimal
cashierpaymoney
)
{
this
.
cashierpaymoney
=
cashierpaymoney
;
}
public
BigDecimal
getCashierpaymoneyrmb
()
{
return
cashierpaymoneyrmb
;
}
public
void
setCashierpaymoneyrmb
(
BigDecimal
cashierpaymoneyrmb
)
{
this
.
cashierpaymoneyrmb
=
cashierpaymoneyrmb
;
}
public
BigDecimal
getCashierservicemoneyrmb
()
{
return
cashierservicemoneyrmb
;
}
public
void
setCashierservicemoneyrmb
(
BigDecimal
cashierservicemoneyrmb
)
{
this
.
cashierservicemoneyrmb
=
cashierservicemoneyrmb
;
}
public
String
getOtherordercode
()
{
return
otherordercode
;
}
public
void
setOtherordercode
(
String
otherordercode
)
{
this
.
otherordercode
=
otherordercode
;
}
public
String
getCashierannex
()
{
return
cashierannex
;
}
public
void
setCashierannex
(
String
cashierannex
)
{
this
.
cashierannex
=
cashierannex
;
}
public
Integer
getCashierbankcardtype
()
{
return
cashierbankcardtype
;
}
public
void
setCashierbankcardtype
(
Integer
cashierbankcardtype
)
{
this
.
cashierbankcardtype
=
cashierbankcardtype
;
}
public
String
getCashiermothercard
()
{
return
cashiermothercard
;
}
public
void
setCashiermothercard
(
String
cashiermothercard
)
{
this
.
cashiermothercard
=
cashiermothercard
;
}
public
BigDecimal
getToRmbRate
()
{
return
toRmbRate
;
}
public
void
setToRmbRate
(
BigDecimal
toRmbRate
)
{
this
.
toRmbRate
=
toRmbRate
;
}
@Override
public
String
toString
()
{
return
"CostCashiercallbackDomain{"
+
"id="
+
id
+
", costNo='"
+
costNo
+
'\''
+
", message='"
+
message
+
'\''
+
", payid="
+
payid
+
", payno='"
+
payno
+
'\''
+
", payamount="
+
payamount
+
", payuserid="
+
payuserid
+
", payusername='"
+
payusername
+
'\''
+
", paynote='"
+
paynote
+
'\''
+
", cashierbankaccountid="
+
cashierbankaccountid
+
", cashierbankname='"
+
cashierbankname
+
'\''
+
", cashierbankcard='"
+
cashierbankcard
+
'\''
+
", cashierbankcardname='"
+
cashierbankcardname
+
'\''
+
", cashierunitcode='"
+
cashierunitcode
+
'\''
+
", cashierunitname='"
+
cashierunitname
+
'\''
+
", cashierrate="
+
cashierrate
+
", cashierpaymoney="
+
cashierpaymoney
+
", cashierpaymoneyrmb="
+
cashierpaymoneyrmb
+
", cashierservicemoneyrmb="
+
cashierservicemoneyrmb
+
", otherordercode='"
+
otherordercode
+
'\''
+
", cashierannex='"
+
cashierannex
+
'\''
+
", cashierbankcardtype="
+
cashierbankcardtype
+
", cashiermothercard='"
+
cashiermothercard
+
'\''
+
", toRmbRate="
+
toRmbRate
+
'}'
;
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/database/model/CostCompanyDomain.java
View file @
6163cebe
...
...
@@ -11,7 +11,8 @@ import lombok.Data;
import
java.time.LocalDateTime
;
import
java.util.List
;
@TableName
(
"cost_company"
)
@TableName
(
value
=
"cost_company"
,
autoResultMap
=
true
)
@Data
public
class
CostCompanyDomain
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/database/model/CostPlanDomain.java
View file @
6163cebe
...
...
@@ -13,15 +13,18 @@ import com.blt.other.module.database.mapper.StatusMapper;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
org.springframework.beans.BeanUtils
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
@TableName
(
"cost_plan"
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"cost_plan"
,
autoResultMap
=
true
)
@Data
public
class
CostPlanDomain
{
public
class
CostPlanDomain
implements
Serializable
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
// 费用单表 id
...
...
@@ -133,9 +136,9 @@ public class CostPlanDomain {
@ApiModelProperty
(
"公司主体value"
)
private
Integer
companyValue
;
// 公司主体value
@TableField
(
typeHandler
=
JacksonTypeHandler
.
class
)
@TableField
(
value
=
"`attach`"
,
typeHandler
=
JacksonTypeHandler
.
class
)
@ApiModelProperty
(
"附加字段"
)
private
List
<
CostAttach
>
attach
;
private
CostAttach
attach
;
@ApiModelProperty
(
"费用模版id"
)
private
Integer
costTemplateId
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/purchasing/service/impl/BuyServiceImpl.java
View file @
6163cebe
...
...
@@ -390,7 +390,7 @@ public class BuyServiceImpl implements BuyService {
costDao
.
insert
(
backCost
);
costLogService
.
save
(
backCost
.
getCostNo
(),
updateUserId
,
"采购单【"
+
buyListDto
.
getBuyno
()
+
"】冲销借支单【"
+
linkLendCost
.
getCostNo
()
+
"】时由系统自动生成"
);
costDao
.
update
(
linkLendCost
);
costDao
.
update
ByNo
(
linkLendCost
);
costLogService
.
save
(
linkLendCost
.
getCostNo
(),
updateUserId
,
"财务审核:"
+
result
);
return
result
;
}
...
...
bailuntec-cost-core/src/main/resources/application-test.yml
View file @
6163cebe
...
...
@@ -22,12 +22,12 @@ mybatis-plus:
-
classpath:mapper/*.xml
-
classpath:mapper/**/*.xml
#分页插件
pagehelper
:
helper-dialect
:
mysql
reasonable
:
true
support-methods-arguments
:
true
params
:
count=countSql
#
#
分页插件
#
pagehelper:
#
helper-dialect: mysql
#
reasonable: true
#
support-methods-arguments: true
#
params: count=countSql
logging
:
file
:
...
...
bailuntec-cost-core/src/main/resources/mapper/Cost.xml
View file @
6163cebe
...
...
@@ -3,32 +3,6 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.blt.other.module.cost.dao.CostDao"
>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
>
INSERT INTO cost(cost_no, company_no, company_name, type_no, type_name, subject_code, kind_no, kind_name,
create_usercode, create_username, cost_remark,
create_time, son_cost_no, sup_cost_no, cost_status, file_path, mor_file_path, amount,
create_userid, sub_logistics_supplier_id, logistics_supplier_id,
bank_name, bank_card, bank_card_user, mor_remark, cost_form, cost_reason, is_lend, had_pay,
lend_status, compensate, counteract, lend_balance,
reject_reason, bank_company, cost_plan_no, dic, pay_counteract, pay_lend_balance,
pay_plan_amount, pay_dic, pay_cur, is_tax,
detail_key, pay_user_id, pay_time, amount_rmb, to_rmb_rate, company_value, audit_time,
source_from, project_type, customer_num)
VALUE
(
#{costNo}, #{companyNo}, #{companyName}, #{typeNo}, #{typeName}, #{subjectCode}, #{kindNo}, #{kindName},
#{createUsercode}, #{createUsername}, #{costRemark},
#{createTime}, #{sonCostNo}, #{supCostNo}, #{costStatus}, #{filePath}, #{morFilePath}, #{amount},
#{createUserid}, #{subLogisticsSupplierId}, #{logisticsSupplierId},
#{bankName}, #{bankCard}, #{bankCardUser}, #{morRemark}, #{costForm}, #{costReason}, #{isLend}, #{hadPay},
#{lendStatus}, #{compensate}, #{counteract}, #{lendBalance},
#{rejectReason}, #{bankCompany}, #{costPlanNo}, #{dic}, #{payCounteract}, #{payLendBalance},
#{payPlanAmount}, #{payDic}, #{payCur}, #{isTax},
#{detailKey}, #{payUserId}, #{payTime}, #{amountRmb}, #{toRmbRate}, #{companyValue}, #{auditTime},
#{sourceFrom}, #{projectType}, #{customerNum}
)
</insert>
<select
id=
"selectAll"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
SELECT
*
...
...
@@ -55,7 +29,7 @@
DESC
</select>
<update
id=
"update"
parameterType=
"com.blt.other.module.cost.model.CostDomain"
>
<update
id=
"update
ByNo
"
parameterType=
"com.blt.other.module.cost.model.CostDomain"
>
UPDATE
cost
<set>
...
...
@@ -120,69 +94,6 @@
cost_no = #{costNo}
</update>
<update
id=
"updateById"
parameterType=
"com.blt.other.module.cost.model.CostDomain"
>
UPDATE
cost
<set>
<if
test=
" costNo!=null"
>
cost_no=#{costNo},
</if>
<if
test=
" companyNo!=null"
>
company_no=#{companyNo},
</if>
<if
test=
" companyName!=null"
>
company_name=#{companyName},
</if>
<if
test=
" typeNo!=null"
>
type_no=#{typeNo},
</if>
<if
test=
" typeName!=null"
>
type_name=#{typeName},
</if>
<if
test=
" subjectCode!=null"
>
subject_code=#{subjectCode},
</if>
<if
test=
" kindNo!=null"
>
kind_no=#{kindNo},
</if>
<if
test=
" kindName!=null"
>
kind_name=#{kindName},
</if>
<if
test=
" createUserid!=null"
>
create_userid=#{createUserid},
</if>
<if
test=
" createUsercode!=null"
>
create_usercode=#{createUsercode},
</if>
<if
test=
" createUsername!=null"
>
create_username=#{createUsername},
</if>
<if
test=
" costRemark!=null"
>
cost_remark=#{costRemark},
</if>
<if
test=
" createTime!=null"
>
create_time=#{createTime},
</if>
<if
test=
" sonCostNo!=null"
>
son_cost_no=#{sonCostNo},
</if>
<if
test=
" supCostNo!=null"
>
sup_cost_no=#{supCostNo},
</if>
<if
test=
" costStatus!=null"
>
cost_status=#{costStatus},
</if>
<if
test=
" filePath!=null"
>
file_path=#{filePath},
</if>
<if
test=
" morFilePath!=null"
>
mor_file_path=#{morFilePath},
</if>
<if
test=
" amount!=null"
>
amount=#{amount},
</if>
<if
test=
" logisticsSupplierId!=null"
>
logistics_supplier_id=#{logisticsSupplierId},
</if>
<if
test=
" bankName!=null"
>
bank_name=#{bankName},
</if>
<if
test=
" bankCard!=null"
>
bank_card=#{bankCard},
</if>
<if
test=
" bankCardUser!=null"
>
bank_card_user=#{bankCardUser},
</if>
<if
test=
" morRemark!=null"
>
mor_remark=#{morRemark},
</if>
<if
test=
" costForm!=null"
>
cost_form=#{costForm},
</if>
<if
test=
" costReason!=null"
>
cost_reason=#{costReason},
</if>
<if
test=
" isLend!=null"
>
is_lend=#{isLend},
</if>
<if
test=
" hadPay!=null"
>
had_pay=#{hadPay},
</if>
<if
test=
" lendStatus!=null"
>
lend_status=#{lendStatus},
</if>
<if
test=
" compensate!=null"
>
compensate=#{compensate},
</if>
<if
test=
" counteract!=null"
>
counteract=#{counteract},
</if>
<if
test=
" lendBalance!=null"
>
lend_balance=#{lendBalance},
</if>
<if
test=
" rejectReason!=null"
>
reject_reason=#{rejectReason},
</if>
<if
test=
" costPlanNo!=null"
>
cost_plan_no=#{costPlanNo},
</if>
<if
test=
" dic!=null"
>
dic=#{dic},
</if>
<if
test=
" payCounteract!=null"
>
pay_counteract=#{payCounteract},
</if>
<if
test=
" payLendBalance!=null"
>
pay_lend_balance=#{payLendBalance},
</if>
<if
test=
" payPlanAmount!=null"
>
pay_plan_amount=#{payPlanAmount},
</if>
<if
test=
" payDic!=null"
>
pay_dic=#{payDic},
</if>
<if
test=
" payCur!=null"
>
pay_cur=#{payCur},
</if>
<if
test=
" isTax!=null"
>
is_tax=#{isTax},
</if>
<if
test=
" detailKey!=null"
>
detail_key=#{detailKey},
</if>
<if
test=
" bankCompany!=null"
>
bank_company=#{bankCompany},
</if>
<if
test=
" payUserId!=null"
>
pay_user_id=#{payUserId},
</if>
<if
test=
" payTime!=null"
>
pay_time=#{payTime},
</if>
<if
test=
" toRmbRate!=null"
>
to_rmb_rate=#{toRmbRate},
</if>
<if
test=
" amountRmb!=null"
>
amount_rmb=#{amountRmb},
</if>
<if
test=
" companyValue!=null"
>
company_value=#{companyValue},
</if>
<if
test=
" auditTime!=null"
>
audit_time=#{auditTime},
</if>
<if
test=
"hasInvoice != null"
>
has_invoice = #{hasInvoice},
</if>
<if
test=
"rejectType != null"
>
reject_type = #{rejectType},
</if>
<if
test=
"sourceFrom != null"
>
source_from = #{sourceFrom},
</if>
<if
test=
"projectType != null"
>
project_type = #{projectType},
</if>
<if
test=
"customerNum != null"
>
customer_num = #{customerNum}
</if>
</set>
WHERE
id = #{id}
</update>
<select
id=
"selectByStatus"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
SELECT *
FROM cost
...
...
@@ -293,7 +204,6 @@
LIMIT 1
</select>
<select
id=
"selectLinkLendCost"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
SELECT *
FROM cost
...
...
@@ -307,7 +217,6 @@
ORDER BY id DESC
</select>
<!--管理成本:查询付款单+收款单+借还单+采购单-->
<select
id=
"selectManageCost"
resultType=
"com.bailuntec.cost.api.dto.ManageCostDto"
>
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form
...
...
@@ -457,7 +366,6 @@
<if
test=
"endDate != null"
>
AND b.pay_time
<![CDATA[<]]>
#{endDate}
</if>
</select>
<!--查询所有的物流费用单和采购单-->
<select
id=
"getLogisticsCostList"
resultType=
"com.bailuntec.cost.api.dto.ManageCostDto"
>
SELECT c.cost_no no,c.bank_company receiveUnit,d.cost_reason reason,c.pay_time payTime,c.cost_form
...
...
@@ -564,7 +472,6 @@
</foreach>
</select>
<select
id=
"selectCostStatusByNo"
resultType=
"integer"
>
select cost_status
from cost
...
...
@@ -586,6 +493,7 @@
and cost_status = 4
and cashier_file_path = ''
</select>
<select
id=
"listCostNoAll"
resultType=
"java.lang.String"
>
select cost_no from cost
WHERE
...
...
bailuntec-cost-core/src/main/resources/mapper/CostPlan
Mapper
.xml
→
bailuntec-cost-core/src/main/resources/mapper/CostPlan
Dao
.xml
View file @
6163cebe
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.blt.other.module.cost.dao.CostPlanDao"
>
<select
id=
"selectByNo"
resultType=
"com.blt.other.module.database.model.CostPlanDomain"
>
SELECT
*
FROM
cost_plan
WHERE
cost_plan_no = #{costPlanNo}
SELECT *
FROM cost_plan
WHERE cost_plan_no = #{costPlanNo}
</select>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
>
INSERT INTO
cost_plan(
cost_plan_no,company_no,company_name,type_no,type_name,kind_no,kind_name,create_usercode,create_username,cost_remark,
create_time,son_cost_no,sup_cost_no,cost_plan_status,file_path,mor_file_path,plan_amount,create_userid,sub_logistics_supplier_id,logistics_supplier_id,
bank_name,bank_card,bank_card_user,mor_remark,cost_form,cost_reason,is_lend,had_pay,lend_status,compensate,counteract,lend_balance,
reject_reason,bank_company,dic,pay_counteract,pay_lend_balance,pay_plan_amount,pay_dic,pay_cur,is_tax,company_value
)
VALUE
(
#{costPlanNo},#{companyNo},#{companyName},#{typeNo},#{typeName},#{kindNo},#{kindName},#{createUsercode},#{createUsername},#{costRemark},
#{createTime},#{sonCostNo},#{supCostNo},#{costPlanStatus},#{filePath},#{morFilePath},#{planAmount},#{createUserid},#{subLogisticsSupplierId},#{logisticsSupplierId},
#{bankName},#{bankCard},#{bankCardUser},#{morRemark},#{costForm},#{costReason},#{isLend},#{hadPay},#{lendStatus},#{compensate},#{counteract},
#{lendBalance},#{rejectReason},#{bankCompany},#{dic},#{payCounteract},#{payLendBalance},#{payPlanAmount},#{payDic},#{payCur},#{isTax},#{companyValue}
)
</insert>
<update
id=
"update"
parameterType=
"com.blt.other.module.cost.model.CostDomain"
>
<update
id=
"updateByNo"
parameterType=
"com.blt.other.module.cost.model.CostDomain"
>
UPDATE
cost_plan
<set>
...
...
@@ -78,11 +58,10 @@
cost_plan_no = #{costPlanNo}
</update>
<delete
id=
"deleted"
>
DELETE FROM
cost_plan
WHERE
cost_plan_no = #{costPlanNo}
<delete
id=
"deleteByNo"
>
DELETE
FROM cost_plan
WHERE cost_plan_no = #{costPlanNo}
</delete>
<select
id=
"selectAll"
resultType=
"com.blt.other.module.database.model.CostPlanDomain"
>
...
...
@@ -96,4 +75,5 @@
ORDER BY
id DESC
</select>
</mapper>
bailuntec-cost-core/src/test/java/com/blt/other/module/cost/dao/CostPlanDaoTest.java
0 → 100644
View file @
6163cebe
package
com
.
blt
.
other
.
module
.
cost
.
dao
;
import
com.bailuntec.cost.api.dto.CostAttach
;
import
com.blt.other.OtherApplication
;
import
com.blt.other.module.database.model.CostPlanDomain
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
javax.annotation.Resource
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/11/2 4:32 下午
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
OtherApplication
.
class
)
@ActiveProfiles
(
"test"
)
public
class
CostPlanDaoTest
{
@Resource
CostPlanDao
costPlanDao
;
@Test
public
void
insert
()
{
CostPlanDomain
costPlanDomain
=
new
CostPlanDomain
();
CostAttach
costAttach
=
new
CostAttach
();
costAttach
.
setName
(
"sda"
);
costPlanDomain
.
setAttach
(
costAttach
);
costPlanDomain
.
setCostPlanStatus
(
1
);
costPlanDao
.
insert
(
costPlanDomain
);
}
}
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