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
8b549795
Commit
8b549795
authored
Jan 18, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 费用系统之屑
parent
c6b39183
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
305 additions
and
253 deletions
+305
-253
pom.xml
cost-interfaces/pom.xml
+7
-0
CostApi.java
...erfaces/src/main/java/com/bailuntec/cost/api/CostApi.java
+8
-8
CostApiConfig.java
...s/src/main/java/com/bailuntec/cost/api/CostApiConfig.java
+12
-0
ManageCostDto.java
...c/main/java/com/bailuntec/cost/api/dto/ManageCostDto.java
+4
-4
ManageCostListReq.java
...ava/com/bailuntec/cost/api/request/ManageCostListReq.java
+2
-7
application-prod.yml
cost-interfaces/src/main/resources/application-prod.yml
+1
-0
application-test.yml
cost-interfaces/src/main/resources/application-test.yml
+1
-0
CostPlanDomain.java
...ain/java/com/blt/other/database/model/CostPlanDomain.java
+21
-6
CostPlanTempDomain.java
...java/com/blt/other/database/model/CostPlanTempDomain.java
+18
-4
CostTypeDomain.java
...ain/java/com/blt/other/database/model/CostTypeDomain.java
+3
-1
CostController.java
.../com/blt/other/module/cost/controller/CostController.java
+4
-4
CostReportController.java
...lt/other/module/cost/controller/CostReportController.java
+4
-1
CostDetailDomain.java
...ava/com/blt/other/module/cost/model/CostDetailDomain.java
+7
-3
CostDomain.java
...main/java/com/blt/other/module/cost/model/CostDomain.java
+20
-23
CostDetailService.java
.../com/blt/other/module/cost/service/CostDetailService.java
+0
-2
CostTypeService.java
...va/com/blt/other/module/cost/service/CostTypeService.java
+1
-1
AppCostServiceImpl.java
...lt/other/module/cost/service/impl/AppCostServiceImpl.java
+4
-2
CostApiServiceImpl.java
...lt/other/module/cost/service/impl/CostApiServiceImpl.java
+9
-10
CostCurrentReviewerServiceImpl.java
...ule/cost/service/impl/CostCurrentReviewerServiceImpl.java
+4
-4
CostDetailServiceImpl.java
...other/module/cost/service/impl/CostDetailServiceImpl.java
+6
-16
CostExportServiceImpl.java
...other/module/cost/service/impl/CostExportServiceImpl.java
+1
-1
CostListSearchServiceImpl.java
...r/module/cost/service/impl/CostListSearchServiceImpl.java
+1
-1
CostLogServiceImpl.java
...lt/other/module/cost/service/impl/CostLogServiceImpl.java
+3
-42
CostTypeImportExcelItemListener.java
...le/cost/service/impl/CostTypeImportExcelItemListener.java
+2
-2
CostTypeServiceImpl.java
...t/other/module/cost/service/impl/CostTypeServiceImpl.java
+8
-3
AbstractCostService.java
...er/module/cost/service/impl/cost/AbstractCostService.java
+13
-14
Lend2PayCostServiceImpl.java
...odule/cost/service/impl/cost/Lend2PayCostServiceImpl.java
+2
-2
AbstractCostPlanService.java
...e/cost/service/impl/costplan/AbstractCostPlanService.java
+7
-6
CostPlanNewLend1ServiceImpl.java
...st/service/impl/costplan/CostPlanNewLend1ServiceImpl.java
+2
-2
CostPlanNewLend2ServiceImpl.java
...st/service/impl/costplan/CostPlanNewLend2ServiceImpl.java
+2
-13
CostPlanNewPayServiceImpl.java
...cost/service/impl/costplan/CostPlanNewPayServiceImpl.java
+7
-11
CostPlanNewReceiptServiceImpl.java
.../service/impl/costplan/CostPlanNewReceiptServiceImpl.java
+4
-5
CostPlanTempServiceImpl.java
...e/cost/service/impl/costplan/CostPlanTempServiceImpl.java
+8
-13
PurchasingListDetailController.java
...purchasing/controller/PurchasingListDetailController.java
+2
-2
BuyServiceImpl.java
.../other/module/purchasing/service/impl/BuyServiceImpl.java
+1
-1
Cost.xml
cost-service/src/main/resources/mapper/Cost.xml
+26
-5
CostDetailMapper.xml
cost-service/src/main/resources/mapper/CostDetailMapper.xml
+21
-10
CostPlanDao.xml
cost-service/src/main/resources/mapper/CostPlanDao.xml
+16
-4
CostPlanTempMapper.xml
...-service/src/main/resources/mapper/CostPlanTempMapper.xml
+33
-8
OtherApplicationTests.java
...ce/src/test/java/com/blt/other/OtherApplicationTests.java
+2
-3
AbstractCostServiceTest.java
...odule/cost/service/impl/cost/AbstractCostServiceTest.java
+4
-3
FinancialCheckStateTest.java
.../cost/service/impl/costcheck/FinancialCheckStateTest.java
+4
-6
No files found.
cost-interfaces/pom.xml
View file @
8b549795
...
...
@@ -24,6 +24,13 @@
<packaging>
jar
</packaging>
<dependencies>
<!--spring boot自动配置-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
<!--mp 增加Mybatis-->
<dependency>
<groupId>
com.baomidou
</groupId>
...
...
cost-interfaces/src/main/java/com/bailuntec/cost/api/CostApi.java
View file @
8b549795
...
...
@@ -14,37 +14,37 @@ import org.springframework.web.bind.annotation.*;
import
java.io.IOException
;
import
java.util.List
;
@FeignClient
(
name
=
"bailuntec-cost-api"
,
url
=
"http://api.fee.bailuntec.com/purchase/other
/cost/api
"
)
@FeignClient
(
name
=
"bailuntec-cost-api"
,
url
=
"http://api.fee.bailuntec.com/purchase/other"
)
public
interface
CostApi
{
@ApiOperation
(
"接受工资单,自动生成付款费用单到财务审核"
)
@PostMapping
(
"/pushWageCost"
)
@PostMapping
(
"/
cost/api/
pushWageCost"
)
CostResult
<
Void
>
pushWageCost
(
@RequestBody
WageCostDto
wageCostDto
)
throws
IOException
;
@ApiOperation
(
"接收物流单,自动生成付款费用单到财务审核"
)
@PostMapping
(
"/pushLogisticsCost"
)
@PostMapping
(
"/
cost/api/
pushLogisticsCost"
)
CostResult
<
Void
>
pushLogisticsCost
(
@RequestBody
LogisticsCostDto
logisticsCostDto
)
throws
Exception
;
@ApiOperation
(
"吴通接收物流单,自动生成收款费用单到财务审核"
)
@PostMapping
(
"/pushLogisticsReceipt"
)
@PostMapping
(
"/
cost/api/
pushLogisticsReceipt"
)
CostResult
<
Void
>
pushLogisticsReceipt
(
@RequestBody
LogisticsCostDto
logisticsCostDto
)
throws
Exception
;
@ApiOperation
(
"获取所有费用单和采购单"
)
@PostMapping
(
"/manageCostList"
)
@PostMapping
(
"/
cost/api/
manageCostList"
)
CostResult
<
List
<
ManageCostDto
>>
manageCostList
(
@RequestBody
ManageCostListReq
req
);
@GetMapping
(
"/noPayCost"
)
@GetMapping
(
"/
cost/api/
noPayCost"
)
@ApiOperation
(
"查询原来传输到数据中心时为待支付状态 变成 已支付状态后的费用单"
)
CostResult
<
List
<
CostDto
>>
getNoPayCost
(
@RequestParam
(
name
=
"costNoList"
)
List
<
String
>
costNoList
);
@ApiOperation
(
"吴通新增 根据费用单号获取费用单大类"
)
@GetMapping
(
"/type/{costNo}"
)
@GetMapping
(
"/
cost/api/
type/{costNo}"
)
CostResult
<
String
>
getTypeName
(
@PathVariable
(
"costNo"
)
String
costNo
);
@ApiOperation
(
"获取费用系统列表"
)
@GetMapping
({
"/getCostList"
})
@GetMapping
({
"/
cost/api/
getCostList"
})
CostResult
<
List
<
CostDto
>>
getCostList
(
@RequestParam
(
name
=
"startDate"
)
String
stKartDate
,
@RequestParam
(
name
=
"endDate"
)
String
endDate
,
@RequestParam
(
name
=
"pageNum"
)
Integer
pageNum
,
...
...
cost-interfaces/src/main/java/com/bailuntec/cost/api/CostApiConfig.java
0 → 100644
View file @
8b549795
package
com
.
bailuntec
.
cost
.
api
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/1/18 9:36 上午
*/
public
class
CostApiConfig
{
}
cost-interfaces/src/main/java/com/bailuntec/cost/api/dto/ManageCostDto.java
View file @
8b549795
...
...
@@ -42,15 +42,15 @@ public class ManageCostDto {
private
String
feeSuperType
;
// 费用小类
private
String
feeSubType
;
@JSONField
(
name
=
"cashier_paymoney"
)
// 金额
private
BigDecimal
amount
;
@JSONField
(
name
=
"cashier_unitcode"
)
// 币种
private
String
currency
;
// 人民币金额
private
BigDecimal
amountRmb
;
@JSONField
(
name
=
"cashier_paymoneyrmb"
)
private
BigDecimal
amountRmb
;
// 人民币金额
//费用单Id
private
Integer
costId
;
//费用单详情Id
...
...
cost-interfaces/src/main/java/com/bailuntec/cost/api/request/ManageCostListReq.java
View file @
8b549795
...
...
@@ -15,11 +15,6 @@ public class ManageCostListReq {
private
String
startDateStr
;
private
String
endDateStr
;
private
String
feeSuperType
;
private
String
feeSubType
;
private
Integer
companyValue
;
private
String
companyName
;
private
String
departmentName
;
private
Integer
createUserId
;
private
Integer
payUserId
;
}
cost-interfaces/src/main/resources/application-prod.yml
0 → 100644
View file @
8b549795
cost.api
:
http://api.fee.bailuntec.com/purchase/other/
cost-interfaces/src/main/resources/application-test.yml
0 → 100644
View file @
8b549795
cost.api
:
http://api.fee.bailuntec.com/purchase/other/
cost-service/src/main/java/com/blt/other/database/model/CostPlanDomain.java
View file @
8b549795
...
...
@@ -8,8 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.database.mapper.StatusMapper
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -41,11 +41,31 @@ public class CostPlanDomain implements Serializable {
@ApiModelProperty
(
"主体名称"
)
private
String
companyName
;
@ApiModelProperty
(
"类型编号"
)
private
Integer
typeId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型编号"
)
private
String
typeNo
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型标题"
)
private
String
typeName
;
// @TableField(exist = false)
// private CostTypeDomain costType;
private
Integer
accountingSubjectId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
// @TableField(exist = false)
// private AccountingSubject accountingSubject;
@ApiModelProperty
(
"创建人id"
)
private
Integer
createUserid
;
@ApiModelProperty
(
"创建人编号"
)
...
...
@@ -135,11 +155,6 @@ public class CostPlanDomain implements Serializable {
@ApiModelProperty
(
"费用模版id"
)
private
Integer
costTemplateId
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
///-------
@TableField
(
exist
=
false
)
...
...
cost-service/src/main/java/com/blt/other/database/model/CostPlanTempDomain.java
View file @
8b549795
...
...
@@ -3,10 +3,12 @@ package com.blt.other.database.model;
import
com.bailuntec.common.SpringContextUtil
;
import
com.bailuntec.cost.api.dto.CostPlanTempDto
;
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.blt.other.common.util.PathUtil
;
import
com.blt.other.module.cost.dao.CostTypeDao
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -33,12 +35,24 @@ public class CostPlanTempDomain {
private
String
costReason
;
// 币种
private
String
dic
;
// 大类编号
@ApiModelProperty
(
"类型编号"
)
private
Integer
typeId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型编号"
)
private
String
typeNo
;
// 会计一级科目
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型标题"
)
private
String
typeName
;
// @TableField(exist = false)
// private CostTypeDomain costType;
private
Integer
accountingSubjectId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
//会计一级科目
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
...
...
@@ -58,7 +72,7 @@ public class CostPlanTempDomain {
CostPlanTempDto
dto
=
new
CostPlanTempDto
();
BeanUtils
.
copyProperties
(
this
,
dto
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectBy
No
(
typeNo
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectBy
Id
(
typeId
);
if
(
costTypeDomain
!=
null
)
{
dto
.
setTypeNameDto
(
costTypeDomain
.
getTypeName
());
}
...
...
cost-service/src/main/java/com/blt/other/database/model/CostTypeDomain.java
View file @
8b549795
...
...
@@ -32,7 +32,9 @@ public class CostTypeDomain {
@ApiModelProperty
(
"费用类型标题"
)
private
String
typeName
;
private
String
accountingSubjectNo
;
// private String accountingSubjectNo;
private
Integer
accountingSubjectId
;
private
Boolean
isManageCost
;
...
...
cost-service/src/main/java/com/blt/other/module/cost/controller/CostController.java
View file @
8b549795
...
...
@@ -154,7 +154,7 @@ public class CostController {
costDomain
.
setFilePath
(
filePath
);
UpdateCostResp
resp
=
costService
.
updateCost
(
costDomain
);
costLogService
.
save
(
costNo
,
cost
Dao
.
selec
tByCostNo
(
costNo
).
getCreateUserid
(),
"修改发票信息"
);
costLogService
.
save
(
costNo
,
cost
Service
.
getCos
tByCostNo
(
costNo
).
getCreateUserid
(),
"修改发票信息"
);
return
resp
;
}
...
...
@@ -165,7 +165,7 @@ public class CostController {
costService
=
CostServiceFactory
.
getCostService
(
costDomain
);
UpdateCostResp
resp
=
costService
.
updateCost
(
costDomain
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
cost
Dao
.
selec
tByCostNo
(
costDomain
.
getCostNo
()).
getCreateUserid
(),
"修改费用单信息"
);
costLogService
.
save
(
costDomain
.
getCostNo
(),
cost
Service
.
getCos
tByCostNo
(
costDomain
.
getCostNo
()).
getCreateUserid
(),
"修改费用单信息"
);
return
resp
;
}
...
...
@@ -184,7 +184,7 @@ public class CostController {
UpdateCostResp
resp
=
new
UpdateCostResp
();
resp
.
setMsg
(
"success"
);
resp
.
setResult
(
cost
Dao
.
selec
tByCostNo
(
costDomain
.
getCostNo
()));
resp
.
setResult
(
cost
Service
.
getCos
tByCostNo
(
costDomain
.
getCostNo
()));
resp
.
setUpdate
(
1
);
return
resp
;
...
...
@@ -323,7 +323,7 @@ public class CostController {
costService
=
CostServiceFactory
.
getCostService
(
costNo
);
costService
.
setStatus
(
costNo
,
5
);
costLogService
.
save
(
costNo
,
cost
Dao
.
selec
tByCostNo
(
costNo
).
getCreateUserid
(),
"作废费用单"
);
costLogService
.
save
(
costNo
,
cost
Service
.
getCos
tByCostNo
(
costNo
).
getCreateUserid
(),
"作废费用单"
);
return
CostResult
.
success
();
}
...
...
cost-service/src/main/java/com/blt/other/module/cost/controller/CostReportController.java
View file @
8b549795
...
...
@@ -8,6 +8,7 @@ import com.blt.other.database.model.CostExpDomain;
import
com.blt.other.module.cost.dao.CostDao
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostExportService
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.vo.CostExportVo
;
import
io.swagger.annotations.Api
;
import
org.springframework.core.io.FileSystemResource
;
...
...
@@ -42,6 +43,8 @@ public class CostReportController {
CostExportService
costExportService
;
@Resource
CostDao
costDao
;
@Resource
CostService
costService
;
@PostMapping
(
"/cost/list/exportList"
)
public
String
exportList
(
HttpServletResponse
response
,
HttpServletRequest
request
)
{
...
...
@@ -111,7 +114,7 @@ public class CostReportController {
String
detailNo
=
request
.
getParameter
(
"detailNo"
);
CostDomain
cost
=
cost
Dao
.
selec
tByCostNo
(
detailNo
);
CostDomain
cost
=
cost
Service
.
getCos
tByCostNo
(
detailNo
);
String
filePath
=
null
;
String
fileName
=
null
;
if
(
null
!=
cost
)
{
...
...
cost-service/src/main/java/com/blt/other/module/cost/model/CostDetailDomain.java
View file @
8b549795
package
com
.
blt
.
other
.
module
.
cost
.
model
;
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
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -20,21 +21,24 @@ public class CostDetailDomain {
private
String
costNo
;
@ApiModelProperty
(
"类型
id
"
)
@ApiModelProperty
(
"类型
编号
"
)
private
Integer
typeId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型编号"
)
private
String
typeNo
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型标题"
)
private
String
typeName
;
@ApiModelProperty
(
"会计科目id"
)
private
Integer
accountingSubjectId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
@ApiModelProperty
(
"创建人id"
)
private
Integer
createUserid
;
@ApiModelProperty
(
"创建人名称"
)
...
...
cost-service/src/main/java/com/blt/other/module/cost/model/CostDomain.java
View file @
8b549795
...
...
@@ -75,18 +75,25 @@ public class CostDomain implements Serializable {
@ApiModelProperty
(
"主体名称"
)
private
String
companyName
;
@ApiModelProperty
(
"类型
id
"
)
@ApiModelProperty
(
"类型
编号
"
)
private
Integer
typeId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型编号"
)
private
String
typeNo
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"描述"
)
private
String
description
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"类型标题"
)
private
String
typeName
;
@ApiModelProperty
(
"会计科目id"
)
private
Integer
accountingSubjectId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
...
...
@@ -250,6 +257,9 @@ public class CostDomain implements Serializable {
@TableField
(
exist
=
false
)
private
String
costCurrentReviewer
;
@TableField
(
exist
=
false
)
private
List
<
CostDetailDomain
>
costDetailDomainList
;
private
static
final
String
REGEX_CHINESE
=
"[\u4e00-\u9fa5]"
;
// 中文正则
...
...
@@ -384,11 +394,12 @@ public class CostDomain implements Serializable {
public
CostDto
castToDto
()
{
StatusMapper
statusMapper
=
SpringContextUtil
.
getBean
(
StatusMapper
.
class
);
CostDto
costDto
=
new
CostDto
();
BeanUtils
.
copyProperties
(
this
,
costDto
);
StatusMapper
statusMapper
=
SpringContextUtil
.
getBean
(
StatusMapper
.
class
);
/*字典翻译*/
costDto
.
setCostStatusDto
(
statusMapper
.
getStatusValue
(
"cost_status"
,
this
.
getCostStatus
()));
if
(
null
!=
this
.
getIsLend
())
{
...
...
@@ -400,21 +411,21 @@ public class CostDomain implements Serializable {
if
(
null
!=
this
.
getLendStatus
())
{
costDto
.
setLendStatusDto
(
statusMapper
.
getStatusValue
(
"lend_status"
,
this
.
getLendStatus
()));
}
// 抵个税
if
(
1
==
costDto
.
getCostForm
())
{
costDto
.
setIsTaxStr
(
statusMapper
.
getStatusValue
(
"is_tax"
,
costDto
.
getIsTax
()));
}
// 获取文件名
String
filePath
=
this
.
getFilePath
();
if
(
null
!=
filePath
&&
filePath
.
contains
(
"&"
))
{
String
fileName
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
"&"
)
+
1
);
costDto
.
setFileName
(
fileName
);
}
// 抵个税
if
(
1
==
costDto
.
getCostForm
())
{
costDto
.
setIsTaxStr
(
statusMapper
.
getStatusValue
(
"is_tax"
,
costDto
.
getIsTax
()));
}
// 币种
costDto
.
setDicDto
(
CurUtils
.
getCurDto
(
costDto
.
getDic
()));
costDto
.
setPayDicDto
(
CurUtils
.
getCurDto
(
costDto
.
getPayDic
()));
//
DecimalFormat
df
=
new
DecimalFormat
(
"#0.00"
);
if
(
null
!=
costDto
.
getAmount
())
{
String
format
=
df
.
format
(
costDto
.
getAmount
());
...
...
@@ -436,20 +447,6 @@ public class CostDomain implements Serializable {
return
costDto
;
}
public
static
void
main
(
String
[]
args
)
{
String
filePath
=
"2132131.jpg"
;
if
(
StringUtils
.
isNotEmpty
(
filePath
))
{
int
i
=
filePath
.
lastIndexOf
(
'.'
);
String
extension
=
""
;
if
(
i
>
0
)
{
extension
=
filePath
.
substring
(
i
+
1
);
}
System
.
out
.
println
(
extension
);
System
.
out
.
println
(
picFilter
.
contains
(
extension
));
}
}
public
void
setCostTemplateIdByFrom
()
{
if
(
costForm
==
1
)
{
this
.
costTemplateId
=
3
;
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/CostDetailService.java
View file @
8b549795
...
...
@@ -13,8 +13,6 @@ public interface CostDetailService extends IService<CostDetailDomain> {
CostDetailDomain
getCostDetailByDetailNo
(
String
detailNo
);
void
deleteFilePath
(
String
detailNo
);
Integer
update
(
CostDetailDomain
domain
);
ResetResp
reset
(
ResetReq
req
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/CostTypeService.java
View file @
8b549795
...
...
@@ -10,7 +10,6 @@ import com.blt.other.module.cost.dto.response.GetLogisticsCodeResp;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
public
interface
CostTypeService
extends
IService
<
CostTypeDomain
>
{
...
...
@@ -71,4 +70,5 @@ public interface CostTypeService extends IService<CostTypeDomain> {
//导出
void
exportExcel
(
HttpServletResponse
response
,
CostTypeExportExcelReq
req
)
throws
IOException
;
}
cost-service/src/main/java/com/blt/other/module/cost/service/impl/AppCostServiceImpl.java
View file @
8b549795
...
...
@@ -12,6 +12,7 @@ import com.blt.other.module.cost.dto.request.AppCostPassReq;
import
com.blt.other.module.cost.dto.request.AppCostRejectReq
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.AppCostService
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.service.impl.costcheck.*
;
import
org.springframework.stereotype.Service
;
...
...
@@ -30,7 +31,8 @@ public class AppCostServiceImpl implements AppCostService {
@Resource
CostDao
costDao
;
@Resource
CostService
costService
;
@Override
public
Page
<
CostDto
>
appCheckCostList
(
AppCheckCostListReq
req
)
{
...
...
@@ -57,7 +59,7 @@ public class AppCostServiceImpl implements AppCostService {
}
private
CostContext
getCostState
(
String
costNo
,
Integer
oaUserId
)
{
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
costNo
);
CostState
costState
;
CostContext
costContext
;
switch
(
costDomain
.
getCostStatus
())
{
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostApiServiceImpl.java
View file @
8b549795
...
...
@@ -15,10 +15,10 @@ import com.blt.other.database.model.CostTypeDomain;
import
com.blt.other.database.model.UserDomain
;
import
com.blt.other.module.auth.dao.UserDao
;
import
com.blt.other.module.cost.dao.*
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostApiService
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.service.UserCostFinansysService
;
import
com.blt.other.module.cost.service.impl.costcheck.CostContext
;
import
com.blt.other.module.cost.service.impl.costcheck.FinancialCheckState
;
...
...
@@ -53,6 +53,8 @@ public class CostApiServiceImpl implements CostApiService {
CostLogDao
costLogDao
;
@Resource
CostCompanyDao
costCompanyDao
;
@Resource
CostService
costService
;
@Override
@Transactional
...
...
@@ -66,8 +68,9 @@ public class CostApiServiceImpl implements CostApiService {
costDomain
.
setCostStatus
(
0
);
costDomain
.
setCostRemark
(
logisticsCostDto
.
getCostRemark
()
+
"【WMS系统推送】"
);
costDomain
.
setCostReason
(
logisticsCostDto
.
getCostReason
());
costDomain
.
setTypeNo
(
"CTN1809180519188"
);
costDomain
.
setTypeName
(
"销售费用/物流费"
);
costDomain
.
setTypeId
(
5028
);
// costDomain.setTypeNo("CTN1809180519188");
// costDomain.setTypeName("销售费用/物流费");
costDomain
.
setCompanyName
(
"香港百伦科技有限公司"
);
costDomain
.
setCompanyNo
(
"COM1806191800013"
);
...
...
@@ -157,7 +160,7 @@ public class CostApiServiceImpl implements CostApiService {
@Override
public
CostDomain
getCostDetails
(
String
costNo
)
{
return
cost
Dao
.
selec
tByCostNo
(
costNo
);
return
cost
Service
.
getCos
tByCostNo
(
costNo
);
}
@Resource
...
...
@@ -179,12 +182,8 @@ public class CostApiServiceImpl implements CostApiService {
//类型信息
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNameAndType
(
"工资"
,
CostTypeDomain
.
feeType
);
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
costTypeDomain
.
getAccountingSubjectNo
());
costDomain
.
setTypeNo
(
costTypeDomain
.
getTypeName
());
costDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
costDomain
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
costDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
costDomain
.
setTypeId
(
costTypeDomain
.
getId
());
costDomain
.
setAccountingSubjectId
(
costTypeDomain
.
getAccountingSubjectId
());
//公司
CostCompanyDomain
costCompany
=
costCompanyDao
.
selectByName
(
wageCostDto
.
getCompanyName
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostCurrentReviewerServiceImpl.java
View file @
8b549795
...
...
@@ -5,15 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.cost.dao.CostCurrentReviewerMapper
;
import
com.blt.other.module.cost.dao.CostDao
;
import
com.blt.other.module.cost.dto.request.TransferReviewReq
;
import
com.blt.other.module.cost.model.CostCurrentReviewer
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostLogService
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.service.ICostCurrentReviewerService
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.google.common.collect.Lists
;
import
org.springframework.stereotype.Service
;
...
...
@@ -37,7 +37,7 @@ public class CostCurrentReviewerServiceImpl extends ServiceImpl<CostCurrentRevie
@Resource
CostLogService
costLogService
;
@Resource
Cost
Dao
costDao
;
Cost
Service
costService
;
@Override
...
...
@@ -91,7 +91,7 @@ public class CostCurrentReviewerServiceImpl extends ServiceImpl<CostCurrentRevie
@Override
public
void
transferReview
(
TransferReviewReq
req
)
{
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
req
.
getCostNo
());
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
req
.
getCostNo
());
if
(!
Lists
.
newArrayList
(
CostDomain
.
STATUS_HR_CHECK
,
CostDomain
.
STATUS_DEPARTMENT_CHECK
,
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostDetailServiceImpl.java
View file @
8b549795
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
import
com.bailuntec.common.BeanUtils
;
import
com.bailuntec.common.StringUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.module.cost.dao.AccountingSubjectMapper
;
import
com.blt.other.module.cost.dao.CostDetailDao
;
import
com.blt.other.module.cost.dao.CostTypeDao
;
import
com.blt.other.module.cost.dto.request.ResetReq
;
import
com.blt.other.module.cost.dto.response.ResetResp
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.model.CostDetailDomain
;
import
com.blt.other.module.cost.service.CostDetailService
;
import
com.blt.other.module.cost.service.CostService
;
...
...
@@ -39,11 +38,6 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
return
costDetailDao
.
selectByDetailNo
(
detailNo
);
}
@Override
public
void
deleteFilePath
(
String
detailNo
)
{
costDetailDao
.
deletedFilePath
(
detailNo
);
}
@Transactional
@Override
...
...
@@ -55,8 +49,7 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
@Resource
CostTypeDao
costTypeDao
;
@Resource
AccountingSubjectMapper
accountingSubjectMapper
;
@Override
public
ResetResp
reset
(
ResetReq
req
)
{
...
...
@@ -70,16 +63,13 @@ public class CostDetailServiceImpl extends ServiceImpl<CostDetailDao, CostDetail
String
path
=
CostFileUtil
.
upload
(
req
.
getFileSelect2
(),
filePath
);
costDetailDomain
.
setFilePath
(
path
);
}
if
(
req
.
getTypeNo
()
!=
null
)
{
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
req
.
getTypeNo
());
costDetailDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
costTypeDomain
.
getAccountingSubjectNo
());
costDetailDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
if
(
StringUtils
.
isNotEmpty
(
req
.
getTypeNo
()))
{
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
req
.
getTypeNo
());
costDetailDomain
.
setTypeId
(
costTypeDomain
.
getId
());
costDetailDomain
.
setAccountingSubjectId
(
costTypeDomain
.
getAccountingSubjectId
());
}
baseMapper
.
updateById
(
costDetailDomain
);
costService
.
resetCost
(
costDetailDomain
.
getCostNo
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostExportServiceImpl.java
View file @
8b549795
...
...
@@ -187,7 +187,7 @@ public class CostExportServiceImpl implements CostExportService {
if
(
null
!=
exportNos
&&
exportNos
.
size
()
>=
1
)
{
exportList
=
new
ArrayList
<>();
for
(
String
costNo
:
exportNos
)
{
CostDto
costDtoByNo
=
cost
Dao
.
selec
tByCostNo
(
costNo
).
castToDto
();
CostDto
costDtoByNo
=
cost
Service
.
getCos
tByCostNo
(
costNo
).
castToDto
();
if
(
1
==
costDtoByNo
.
getCostForm
())
{
// 付款单,将子项目赋值到 CostDto 逐一打印
List
<
CostDetailDomain
>
costDetailDomains
=
costDetailDao
.
selectListByCostNo
(
costNo
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostListSearchServiceImpl.java
View file @
8b549795
...
...
@@ -54,7 +54,7 @@ public class CostListSearchServiceImpl implements CostListSearchService {
PageInfo
<
CostDomain
>
pageInfo
=
new
PageInfo
<>(
domains
);
if
(
null
!=
searchKeysVo
.
getParams
().
getKeys
().
getLinkCost
()
&&
!
searchKeysVo
.
getParams
().
getKeys
().
getLinkCost
().
isEmpty
())
{
List
<
CostDomain
>
list
=
new
ArrayList
<>();
CostDomain
supCost
=
cost
Dao
.
selec
tByCostNo
(
searchKeysVo
.
getParams
().
getKeys
().
getLinkCost
());
CostDomain
supCost
=
cost
Service
.
getCos
tByCostNo
(
searchKeysVo
.
getParams
().
getKeys
().
getLinkCost
());
list
.
add
(
supCost
);
if
(
null
!=
domains
&&
domains
.
size
()
>=
1
)
{
list
.
addAll
(
domains
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostLogServiceImpl.java
View file @
8b549795
...
...
@@ -12,7 +12,7 @@ import com.blt.other.module.cost.dao.CostDao;
import
com.blt.other.module.cost.dao.CostLogDao
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostLogService
;
import
com.blt.other.module.
sys.dao.DepartmentReviewerMapper
;
import
com.blt.other.module.
cost.service.CostService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -68,7 +68,7 @@ public class CostLogServiceImpl implements CostLogService {
@Resource
CostCompanyDao
costCompanyDao
;
@Resource
DepartmentReviewerMapper
departmentReviewerMapper
;
CostService
costService
;
@Override
public
void
saveByManage
(
String
costNo
,
String
updateMainNote
,
Integer
type
)
{
...
...
@@ -76,51 +76,12 @@ public class CostLogServiceImpl implements CostLogService {
costLog
.
setCostNo
(
costNo
);
costLog
.
setUpdateTime
(
new
Date
());
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
costNo
);
OaUser
costUser
=
oaUserMapper
.
selectByOaUserId
(
costDomain
.
getCreateUserid
());
CostCompanyDomain
costCompany
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
OaUser
reviewer
=
OaUser
.
DEFAULT
;
// //部门自动审核日志
// if (type.equals(CostLogDomain.DEPARTMENT_AUTO_PASS)) {
//
// DepartmentReviewer departmentReviewer = departmentReviewerMapper.selectByPrimaryDepartmentId(costUser.getPrimaryDepartmentId());
//
// reviewer = costReviewerMapper.selectList(new LambdaQueryWrapper<CostReviewer>()
// .eq(CostReviewer::getType, CostReviewer.departmentReviewer)
// .eq(CostReviewer::getReferId, departmentReviewer.getId()))
// .stream()
// .limit(1)
// .findAny()
// .map(costReviewer -> oaUserMapper.selectByOaUserId(costReviewer.getReviewerUserId()))
// .orElse(OaUser.DEFAULT);
// }
// //财务自动审核日志
// else if (type.equals(CostLogDomain.FINANCIAL_AUTO_PASS)) {
// reviewer = costReviewerMapper.selectList(new LambdaQueryWrapper<CostReviewer>()
// .eq(CostReviewer::getType, CostReviewer.financialReviewer)
// .eq(CostReviewer::getReferId, costCompany.getId()))
// .stream()
// .limit(1)
// .findAny()
// .map(costReviewer -> oaUserMapper.selectByOaUserId(costReviewer.getReviewerUserId()))
// .orElse(OaUser.DEFAULT);
// }
// //最终审核自动审核日志
// else if (type.equals(CostLogDomain.FINAL_AUTO_PASS)) {
// reviewer = costReviewerMapper.selectList(new LambdaQueryWrapper<CostReviewer>()
// .eq(CostReviewer::getType, CostReviewer.finalReviewer)
// .eq(CostReviewer::getReferId, costCompany.getId()))
// .stream()
// .limit(1)
// .findAny()
// .map(costReviewer -> oaUserMapper.selectByOaUserId(costReviewer.getReviewerUserId()))
// .orElse(OaUser.DEFAULT);
// } else {
// throw new BizRuntimeException("invalid param");
// }
costLog
.
setUpdateUsercode
(
reviewer
.
getUserCode
());
costLog
.
setUpdateUsername
(
reviewer
.
getUserName
());
costLog
.
setUpdateUserid
(
reviewer
.
getOaUserId
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostTypeImportExcelItemListener.java
View file @
8b549795
...
...
@@ -77,13 +77,13 @@ public class CostTypeImportExcelItemListener extends AnalysisEventListener<CostT
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectOne
(
new
LambdaQueryWrapper
<
CostTypeDomain
>()
.
eq
(
CostTypeDomain:
:
getTypeName
,
item
.
getTypeName
())
.
eq
(
CostTypeDomain:
:
getAccountingSubject
No
,
accountingSubject
.
getSubjectNo
()));
.
eq
(
CostTypeDomain:
:
getAccountingSubject
Id
,
accountingSubject
.
getId
()));
if
(
costTypeDomain
==
null
)
{
costTypeDomain
=
new
CostTypeDomain
();
costTypeDomain
.
setTypeNo
(
IdWorker
.
getIdStr
());
costTypeDomain
.
setTypeName
(
item
.
getTypeName
());
costTypeDomain
.
setDescription
(
item
.
getTypeDesc
());
costTypeDomain
.
setAccountingSubject
No
(
accountingSubject
.
getSubjectNo
());
costTypeDomain
.
setAccountingSubject
Id
(
accountingSubject
.
getId
());
costTypeDomain
.
setCostTemplateType
(
costTemplateType
);
costTypeDomain
.
setUpdateUserId
(
sysUser
.
getOaUserId
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/CostTypeServiceImpl.java
View file @
8b549795
...
...
@@ -18,6 +18,7 @@ import com.blt.other.module.cost.dto.response.CostTypeExportExcelItem;
import
com.blt.other.module.cost.dto.response.CostTypeResult
;
import
com.blt.other.module.cost.dto.response.GetLogisticsBankResp
;
import
com.blt.other.module.cost.dto.response.GetLogisticsCodeResp
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.service.CostTypeKindService
;
import
com.blt.other.module.cost.service.CostTypeService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -42,7 +43,9 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
@Override
public
void
addCostType
(
CostTypeAddReq
req
)
{
CostTypeDomain
costTypeDomain
=
new
CostTypeDomain
();
costTypeDomain
.
setAccountingSubjectNo
(
req
.
getAccountingSubjectNo
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
req
.
getAccountingSubjectNo
());
costTypeDomain
.
setAccountingSubjectId
(
accountingSubject
.
getId
());
costTypeDomain
.
setTypeNo
(
IdWorker
.
getIdStr
());
costTypeDomain
.
setTypeName
(
req
.
getTypeName
());
costTypeDomain
.
setDescription
(
req
.
getDescription
());
...
...
@@ -56,7 +59,7 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
if
(
req
.
getType
().
equals
(
1
))
{
CostTypeDomain
lendCostTypeDomain
=
new
CostTypeDomain
();
lendCostTypeDomain
.
setCostTemplateType
(
CostTypeDomain
.
borrow
);
lendCostTypeDomain
.
setAccountingSubject
No
(
"1345912843756503041"
);
lendCostTypeDomain
.
setAccountingSubject
Id
(
43
);
lendCostTypeDomain
.
setTypeNo
(
IdWorker
.
getIdStr
());
lendCostTypeDomain
.
setTypeName
(
req
.
getTypeName
());
lendCostTypeDomain
.
setDescription
(
req
.
getDescription
());
...
...
@@ -86,7 +89,9 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
costTypeDomain
.
setUpdateUserId
(
oaUser
.
getOaUserId
());
costTypeDomain
.
setUpdateUser
(
oaUser
.
getUserName
());
costTypeDomain
.
setLastUpdateTime
(
LocalDateTime
.
now
());
costTypeDomain
.
setAccountingSubjectNo
(
req
.
getAccountingSubjectNo
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
req
.
getAccountingSubjectNo
());
costTypeDomain
.
setAccountingSubjectId
(
accountingSubject
.
getId
());
costTypeDomain
.
setIsManageCost
(
req
.
getIsManageCost
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/cost/AbstractCostService.java
View file @
8b549795
...
...
@@ -136,7 +136,6 @@ public abstract class AbstractCostService implements CostService {
}
});
}
}
@Resource
...
...
@@ -155,6 +154,10 @@ public abstract class AbstractCostService implements CostService {
}
costDomain
.
setCanAudit
(
costCurrentReviewerService
.
canAudit
(
currentUserId
,
costNo
));
List
<
CostDetailDomain
>
costDetailDomainList
=
costDetailDao
.
selectListByCostNo
(
costNo
);
costDomain
.
setCostDetailDomainList
(
costDetailDomainList
);
return
costDomain
;
}
...
...
@@ -188,7 +191,7 @@ public abstract class AbstractCostService implements CostService {
resp
.
setMsg
(
"success"
);
resp
.
setResult
(
costDao
.
selec
tByCostNo
(
costDomain
.
getCostNo
()));
resp
.
setResult
(
this
.
getCos
tByCostNo
(
costDomain
.
getCostNo
()));
resp
.
setUpdate
(
update
);
return
resp
;
...
...
@@ -218,18 +221,14 @@ public abstract class AbstractCostService implements CostService {
for
(
CostDetailDomain
domain
:
costDetailDomains
)
{
amount
=
amount
.
add
(
domain
.
getAmount
());
}
CostDomain
costDomain
=
costDao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
this
.
getCos
tByCostNo
(
costNo
);
costDomain
.
setAmount
(
amount
);
BigDecimal
toRmbRate
=
CurUtils
.
getCur
(
costDomain
.
getDic
(),
"CNY"
);
costDomain
.
setToRmbRate
(
toRmbRate
);
costDomain
.
setAmountRmb
(
costDomain
.
getAmount
().
multiply
(
toRmbRate
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
costDomain
.
setTypeNo
(
costDetailDomains
.
get
(
0
).
getTypeNo
());
costDomain
.
setTypeName
(
costDetailDomains
.
get
(
0
).
getTypeName
());
costDomain
.
setTypeId
(
costDetailDomains
.
get
(
0
).
getTypeId
());
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
...
...
@@ -244,7 +243,7 @@ public abstract class AbstractCostService implements CostService {
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
if
(
costDomain
.
getCostStatus
().
equals
(
5
))
{
//释放已申请的金额
CostDomain
supCost
=
costDao
.
selec
tByCostNo
(
costDomain
.
getSupCostNo
());
CostDomain
supCost
=
this
.
getCos
tByCostNo
(
costDomain
.
getSupCostNo
());
if
(
supCost
!=
null
)
{
supCost
.
setRepaymentAppliedAmount
(
supCost
.
getRepaymentAppliedAmount
().
subtract
(
costDomain
.
getAmount
()));
...
...
@@ -264,7 +263,7 @@ public abstract class AbstractCostService implements CostService {
@Override
public
void
updateCashierAnnex
(
String
costNo
,
String
filePath
,
String
downloadUrl
)
{
CostDomain
costDomain
=
costDao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
this
.
getCos
tByCostNo
(
costNo
);
costDomain
.
setCashierFilePath
(
filePath
);
costDomain
.
setCashierDownloadPath
(
downloadUrl
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
...
...
@@ -366,7 +365,7 @@ public abstract class AbstractCostService implements CostService {
costCashiercallbackDomain
.
setPayno
(
costCashiercallbackDomain
.
getPayno
().
toUpperCase
());
CostDomain
costDomain
=
costDao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
this
.
getCos
tByCostNo
(
costNo
);
//
if
(!
costDomain
.
getCostStatus
().
equals
(
CostDomain
.
STATUS_UN_PAY
))
{
return
;
...
...
@@ -387,16 +386,16 @@ public abstract class AbstractCostService implements CostService {
if
(
costNo
.
startsWith
(
"S"
))
{
//费用计划
CostDomain
costDomain
=
costDao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
this
.
getCos
tByCostNo
(
costNo
);
//费用计划关联借支单
CostDomain
supCost
=
costDao
.
selec
tByCostNo
(
costDomain
.
getSupCostNo
());
CostDomain
supCost
=
this
.
getCos
tByCostNo
(
costDomain
.
getSupCostNo
());
supCost
.
setCompensate
(
supCost
.
getCompensate
().
subtract
(
costDomain
.
getAmount
()));
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
supCost
);
}
CostDomain
costDomain
=
costDao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
this
.
getCos
tByCostNo
(
costNo
);
costDomain
.
setCostStatus
(
CostDomain
.
STATUS_REJECT
);
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/cost/Lend2PayCostServiceImpl.java
View file @
8b549795
...
...
@@ -115,8 +115,8 @@ public class Lend2PayCostServiceImpl extends AbstractCostService implements Cost
super
.
reject
(
costNo
);
//释放已申请的金额
CostDomain
costDomain
=
costDao
.
selec
tByCostNo
(
costNo
);
CostDomain
supCost
=
costDao
.
selec
tByCostNo
(
costDomain
.
getSupCostNo
());
CostDomain
costDomain
=
this
.
getCos
tByCostNo
(
costNo
);
CostDomain
supCost
=
this
.
getCos
tByCostNo
(
costDomain
.
getSupCostNo
());
supCost
.
setRepaymentAppliedAmount
(
supCost
.
getRepaymentAppliedAmount
().
subtract
(
costDomain
.
getAmount
()));
supCost
.
setLastModifyDate
(
LocalDateTime
.
now
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/AbstractCostPlanService.java
View file @
8b549795
...
...
@@ -4,7 +4,6 @@ import com.bailuntec.common.ListUtil;
import
com.bailuntec.cost.api.dto.CostPlanDto
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.database.model.*
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.dao.UserDao
;
import
com.blt.other.module.cost.dao.*
;
import
com.blt.other.module.cost.dto.request.GetAllCostPlanReq
;
...
...
@@ -62,6 +61,8 @@ public abstract class AbstractCostPlanService implements CostPlanService {
CostLogService
costLogService
;
@Autowired
CostDetailDao
costDetailDao
;
@Resource
CostService
costService
;
void
check
(
CostPlanDomain
planDomain
)
{
...
...
@@ -115,6 +116,9 @@ public abstract class AbstractCostPlanService implements CostPlanService {
});
}
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectById
(
costPlanDomain
.
getId
());
costPlanDomain
.
setAccountingSubjectId
(
costTypeDomain
.
getAccountingSubjectId
());
}
@Override
...
...
@@ -137,7 +141,7 @@ public abstract class AbstractCostPlanService implements CostPlanService {
//费用计划
CostPlanDomain
costPlanDomain
=
costPlanDao
.
selectByNo
(
costPlanNo
);
//费用计划关联借支单
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
costPlanDomain
.
getSupCostNo
());
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
costPlanDomain
.
getSupCostNo
());
costDomain
.
setCompensate
(
costDomain
.
getCompensate
().
subtract
(
costPlanDomain
.
getPlanAmount
()));
costDomain
.
setLastModifyDate
(
LocalDateTime
.
now
());
costDao
.
updateById
(
costDomain
);
...
...
@@ -198,9 +202,6 @@ public abstract class AbstractCostPlanService implements CostPlanService {
BeanUtils
.
copyProperties
(
costPlanTempDomain
,
costDetailDomain
);
costDetailDomain
.
setDetailNo
(
costPlanDomain
.
getCostPlanNo
()
+
"-"
+
index
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
costPlanTempDomain
.
getTypeNo
());
costDetailDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
costDetailDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
return
costDetailDomain
;
}
...
...
@@ -211,7 +212,7 @@ public abstract class AbstractCostPlanService implements CostPlanService {
*/
protected
String
getCostNo
()
{
String
costNo
=
CostUtils
.
getIdNum
();
CostDomain
costByNo
=
cost
Dao
.
selec
tByCostNo
(
costNo
);
CostDomain
costByNo
=
cost
Service
.
getCos
tByCostNo
(
costNo
);
while
(
null
!=
costByNo
&&
null
!=
costByNo
.
getId
())
{
costNo
=
CostUtils
.
getIdNum
();
}
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewLend1ServiceImpl.java
View file @
8b549795
...
...
@@ -40,8 +40,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
planDomain
.
getTypeNo
());
planDomain
.
setTypeId
(
costTypeDomain
.
getId
());
planDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
this
.
check
(
planDomain
);
costPlanDao
.
insert
(
planDomain
);
...
...
@@ -53,8 +53,8 @@ public class CostPlanNewLend1ServiceImpl extends AbstractCostPlanService impleme
this
.
completedCostPlan
(
planDomain
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
planDomain
.
getTypeNo
());
planDomain
.
setTypeId
(
costTypeDomain
.
getId
());
planDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
costPlanDao
.
update
(
planDomain
,
new
LambdaQueryWrapper
<
CostPlanDomain
>()
.
eq
(
CostPlanDomain:
:
getCostPlanNo
,
planDomain
.
getCostPlanNo
()));
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewLend2ServiceImpl.java
View file @
8b549795
...
...
@@ -5,7 +5,6 @@ import com.blt.other.common.exception.BizRuntimeException;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostPlanTempDomain
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostPlanService
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -38,10 +37,6 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
this
.
check
(
planDomain
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
planDomain
.
getTypeNo
());
planDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
costPlanDao
.
insert
(
planDomain
);
}
...
...
@@ -51,11 +46,6 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
this
.
doSaveFinanceRecord
(
planDomain
);
this
.
completedCostPlan
(
planDomain
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
planDomain
.
getTypeNo
());
planDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
costPlanDao
.
update
(
planDomain
,
new
LambdaQueryWrapper
<
CostPlanDomain
>()
.
eq
(
CostPlanDomain:
:
getCostPlanNo
,
planDomain
.
getCostPlanNo
()));
...
...
@@ -83,7 +73,7 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
costPlanDao
.
updateById
(
costPlanDomain
);
//关联的借支单
CostDomain
supCost
=
cost
Dao
.
selec
tByCostNo
(
costPlanDomain
.
getSupCostNo
());
CostDomain
supCost
=
cost
Service
.
getCos
tByCostNo
(
costPlanDomain
.
getSupCostNo
());
//借支还需要还的金额 (借支单币种) = 借支单金额 - 借支单已还金额
BigDecimal
subtract
=
supCost
.
getAmount
().
subtract
(
supCost
.
getRepaymentAppliedAmount
());
if
(
subtract
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
{
...
...
@@ -172,7 +162,6 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
payPlan
.
setPayCounteract
(
BigDecimal
.
ZERO
);
payPlan
.
setIsTax
(
0
);
payPlan
.
setTypeNo
(
null
);
payPlan
.
setTypeName
(
null
);
payPlan
.
setCostReason
(
"借支差额:"
+
payPlan
.
getSupCostNo
());
costPlanDao
.
insert
(
payPlan
);
...
...
@@ -209,7 +198,7 @@ public class CostPlanNewLend2ServiceImpl extends AbstractCostPlanService impleme
costPlanDao
.
updateById
(
costPlanDomain
);
//关联的借支单
CostDomain
supCost
=
cost
Dao
.
selec
tByCostNo
(
costPlanDomain
.
getSupCostNo
());
CostDomain
supCost
=
cost
Service
.
getCos
tByCostNo
(
costPlanDomain
.
getSupCostNo
());
//借支还需要还的金额 = 借支单金额 - 借支单已还金额
BigDecimal
subtract
=
supCost
.
getAmount
().
subtract
(
supCost
.
getHadPay
());
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewPayServiceImpl.java
View file @
8b549795
...
...
@@ -81,12 +81,12 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
).
collect
(
Collectors
.
toList
());
// 根据大类分类
Map
<
String
,
List
<
CostDetailDomain
>>
detailMap
=
costDetailDomainList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CostDetailDomain:
:
getType
No
)
Map
<
Integer
,
List
<
CostDetailDomain
>>
detailMap
=
costDetailDomainList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CostDetailDomain:
:
getType
Id
)
);
// 按照不同的大类生成付款费用单、费用详情
detailMap
.
forEach
((
type
No
,
costDetailDomains
)
->
{
detailMap
.
forEach
((
type
Id
,
costDetailDomains
)
->
{
// 生成付款费用单
CostDomain
costDomain
=
this
.
planToCost
(
costPlanNo
);
String
costNo
=
CostUtils
.
getIdNum
();
...
...
@@ -94,20 +94,17 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
if
(
costPlanNo
.
startsWith
(
"S"
))
{
costNo
=
"S"
+
costNo
;
}
CostDomain
costByNo
=
cost
Dao
.
selec
tByCostNo
(
costNo
);
CostDomain
costByNo
=
cost
Service
.
getCos
tByCostNo
(
costNo
);
while
(
null
!=
costByNo
&&
null
!=
costByNo
.
getId
())
{
costNo
=
CostUtils
.
getIdNum
();
if
(
costPlanNo
.
startsWith
(
"S"
))
{
costNo
=
"S"
+
costNo
;
}
costByNo
=
cost
Dao
.
selec
tByCostNo
(
costNo
);
costByNo
=
cost
Service
.
getCos
tByCostNo
(
costNo
);
}
costDomain
.
setCostNo
(
costNo
);
costDomain
.
setTypeNo
(
typeNo
);
costDomain
.
setTypeId
(
costDetailDomains
.
get
(
0
).
getTypeId
());
costDomain
.
setTypeName
(
costDetailDomains
.
get
(
0
).
getTypeName
());
costDomain
.
setAccountingSubjectNo
(
costDetailDomains
.
get
(
0
).
getAccountingSubjectNo
());
costDomain
.
setAccountingSubjectName
(
costDetailDomains
.
get
(
0
).
getAccountingSubjectName
());
costDomain
.
setTypeId
(
typeId
);
costDomain
.
setAccountingSubjectId
(
costDetailDomains
.
get
(
0
).
getAccountingSubjectId
());
if
(
null
==
costDomain
.
getAmount
())
{
costDomain
.
setAmount
(
new
BigDecimal
(
0
));
...
...
@@ -134,7 +131,6 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
if
(
insert
>=
1
)
{
// 记录日志
costLogService
.
save
(
costDomain
.
getCostNo
(),
costDomain
.
getCreateUserid
(),
"由费用计划:"
+
costDomain
.
getCostPlanNo
()
+
" 生成付款单"
);
}
});
return
detailMap
.
keySet
().
size
();
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewReceiptServiceImpl.java
View file @
8b549795
...
...
@@ -3,10 +3,10 @@ package com.blt.other.module.cost.service.impl.costplan;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostPlanService
;
import
com.blt.other.database.model.CostPlanDomain
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -32,8 +32,8 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
planDomain
.
getTypeNo
());
planDomain
.
setType
No
(
costTypeDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
planDomain
.
setType
Id
(
costTypeDomain
.
getId
());
this
.
check
(
planDomain
);
costPlanDao
.
insert
(
planDomain
);
}
...
...
@@ -45,8 +45,7 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
planDomain
.
getTypeNo
());
planDomain
.
setTypeNo
(
costTypeDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeDomain
.
getTypeName
());
planDomain
.
setTypeId
(
costTypeDomain
.
getId
());
costPlanDao
.
update
(
planDomain
,
new
LambdaQueryWrapper
<
CostPlanDomain
>()
.
eq
(
CostPlanDomain:
:
getCostPlanNo
,
planDomain
.
getCostPlanNo
()));
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanTempServiceImpl.java
View file @
8b549795
...
...
@@ -14,7 +14,6 @@ import com.blt.other.module.cost.dto.request.AddItemReq;
import
com.blt.other.module.cost.dto.request.AddItemResp
;
import
com.blt.other.module.cost.dto.request.ResetItemReq
;
import
com.blt.other.module.cost.dto.response.GetCostTempByPlanNoResp
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.service.CostPlanTempService
;
import
com.blt.other.module.cost.service.CostTypeKindService
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -80,16 +79,15 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
CostPlanTempDomain
costPlanTempDomain
=
new
CostPlanTempDomain
();
BeanUtils
.
copyProperties
(
req
,
costPlanTempDomain
);
costPlanTempDomain
.
setTempNo
(
this
.
createNo
());
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
req
.
getTypeNo
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
costTypeDomain
.
getAccountingSubjectNo
());
costPlanTempDomain
.
setTempNo
(
this
.
createNo
());
costPlanTempDomain
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
costPlanTempDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
this
.
checkDic
(
costPlanTempDomain
);
costPlanTempDomain
.
setTypeId
(
costTypeDomain
.
getId
());
costPlanTempDomain
.
setAccountingSubjectId
(
costTypeDomain
.
getAccountingSubjectId
());
this
.
checkDic
(
costPlanTempDomain
);
//新增付款子项目
costPlanTempDao
.
insert
(
costPlanTempDomain
);
...
...
@@ -170,15 +168,13 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
com
.
bailuntec
.
common
.
BeanUtils
.
copyProperties
(
req
,
costPlanTempDomain
,
"id"
);
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectByNo
(
req
.
getTypeNo
());
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
costTypeDomain
.
getAccountingSubjectNo
());
costPlanTempDomain
.
setTempNo
(
this
.
createNo
());
costPlanTempDomain
.
setAccountingSubjectNo
(
accountingSubject
.
getSubjectNo
());
costPlanTempDomain
.
setAccountingSubjectName
(
accountingSubject
.
getName
());
costPlanTempDomain
.
setTypeId
(
costTypeDomain
.
getId
());
costPlanTempDomain
.
setAccountingSubjectId
(
costTypeDomain
.
getAccountingSubjectId
());
costPlanTempDao
.
updateById
(
costPlanTempDomain
);
this
.
chalkResetDec
(
costPlanTempDomain
.
getCostPlanNo
());
// 同步更新费用计划金额
...
...
@@ -191,8 +187,7 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
if
(
plan
.
getCostForm
()
==
1
&&
(
null
!=
plan
.
getIsLend
()
&&
2
==
plan
.
getIsLend
()))
{
plan
.
setPayPlanAmount
(
newAmount
.
divide
(
plan
.
getPayCur
(),
4
));
}
costPlanDao
.
update
(
plan
,
new
LambdaQueryWrapper
<
CostPlanDomain
>()
.
eq
(
CostPlanDomain:
:
getCostPlanNo
,
plan
.
getCostPlanNo
()));
costPlanDao
.
update
(
plan
,
new
LambdaQueryWrapper
<
CostPlanDomain
>().
eq
(
CostPlanDomain:
:
getCostPlanNo
,
plan
.
getCostPlanNo
()));
}
return
costPlanTempDomain
;
}
...
...
cost-service/src/main/java/com/blt/other/module/purchasing/controller/PurchasingListDetailController.java
View file @
8b549795
...
...
@@ -225,7 +225,7 @@ public class PurchasingListDetailController {
buyDomain
.
setBuyno
(
buyno
);
buyDomain
.
setNote
(
note
);
if
(
linkLendCostNo
!=
null
&&
!
"null"
.
equals
(
linkLendCostNo
))
{
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
linkLendCostNo
);
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
linkLendCostNo
);
BuyListDto
buyByBuyno
=
buyService
.
getBuyByBuyno
(
buyno
);
String
judgeResult
=
buyService
.
judgeLinkLendCost
(
costDomain
,
buyByBuyno
);
// 采购单关联借支单判断
if
(
judgeResult
!=
null
)
{
...
...
@@ -276,7 +276,7 @@ public class PurchasingListDetailController {
String
msg
=
buyByBuyno
.
getBuystatusDto
();
if
(
buystatus
<=
2
)
{
if
(
linkLendCostNo
!=
null
&&
!
""
.
equals
(
linkLendCostNo
))
{
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
linkLendCostNo
);
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
linkLendCostNo
);
// 借支单状态为已支付,借还状态为未还、部分还款
if
(
costDomain
.
getCostStatus
()
==
4
&&
(
costDomain
.
getLendStatus
()
==
1
||
costDomain
.
getLendStatus
()
==
2
))
{
msg
=
buyService
.
buyLinkLendCost
(
costDomain
,
buyByBuyno
,
Integer
.
parseInt
(
userid
));
// 采购单关联借支单
...
...
cost-service/src/main/java/com/blt/other/module/purchasing/service/impl/BuyServiceImpl.java
View file @
8b549795
...
...
@@ -346,8 +346,8 @@ public class BuyServiceImpl implements BuyService {
payPlan
.
setCounteract
(
new
BigDecimal
(
0
));
payPlan
.
setPayCounteract
(
new
BigDecimal
(
0
));
payPlan
.
setIsTax
(
0
);
payPlan
.
setTypeId
(
4036
);
payPlan
.
setTypeNo
(
"CTN1809140510102"
);
payPlan
.
setTypeName
(
"办公费"
);
//todo 办公
payPlan
.
setCostReason
(
"借支差额:"
+
payPlan
.
getSupCostNo
());
...
...
cost-service/src/main/resources/mapper/Cost.xml
View file @
8b549795
...
...
@@ -11,10 +11,16 @@
<select
id=
"selectAll"
resultMap=
"cost"
>
SELECT
t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name,
group_concat(distinct t2.username) as cost_current_reviewer
FROM
cost t1
left join cost_current_reviewer t2 on t1.cost_no = t2.cost_no
left join cost_type ct on t1.type_id = ct.id
left join accounting_subject ast on ct.accounting_subject_id = ast.id
<if
test=
"userId != null"
>
where t1.create_userid = #{userId}
</if>
...
...
@@ -31,9 +37,16 @@
<select
id=
"selectByCostNo"
resultMap=
"cost"
>
SELECT t1.*,
ct.type_no,
ct.type_name,
ct.description,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name,
group_concat(distinct t2.username) as cost_current_reviewer
FROM cost t1
left join cost_current_reviewer t2 on t1.cost_no = t2.cost_no
left join cost_type ct on t1.type_id = ct.id
left join accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE t1.cost_no = #{costNo}
group by t1.id
ORDER BY t1.id
...
...
@@ -43,9 +56,15 @@
<select
id=
"selectByKeys"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
SELECT
t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name,
group_concat(distinct t2.username) as cost_current_reviewer
from cost t1
left join cost_current_reviewer t2 on t1.cost_no = t2.cost_no
left join cost_type ct on t1.type_id = ct.id
left join accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE
t1.cost_status >= 1
<if
test=
" costForm!=null and costForm != ''"
>
and t1.cost_form= #{costForm}
</if>
...
...
@@ -78,11 +97,7 @@
FROM cost
WHERE cost_status = 4
AND create_userid = #{createuserid}
AND (
lend_status = 1
OR
lend_status = 2
)
AND (lend_status = 1 OR lend_status = 2)
ORDER BY id DESC
</select>
...
...
@@ -292,9 +307,15 @@
<select
id=
"queryPage"
resultType=
"com.blt.other.module.cost.model.CostDomain"
>
SELECT
t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name,
group_concat(distinct t2.username) as cost_current_reviewer
from cost t1
left join cost_current_reviewer t2 on t1.cost_no = t2.cost_no
left join cost_type ct on t1.type_id = ct.id
left join accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE
true
<if
test=
" req.costForm!=null and req.costForm != ''"
>
and t1.cost_form= #{req.costForm}
</if>
...
...
cost-service/src/main/resources/mapper/CostDetailMapper.xml
View file @
8b549795
...
...
@@ -4,22 +4,33 @@
<mapper
namespace=
"com.blt.other.module.cost.dao.CostDetailDao"
>
<select
id=
"selectListByCostNo"
resultType=
"com.blt.other.module.cost.model.CostDetailDomain"
>
SELECT *
FROM cost_detail
WHERE cost_no = #{costNo}
SELECT t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM cost_detail t1
left join cost_type ct on t1.type_id = ct.id
left join bailun_other.accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE t1.cost_no = #{costNo}
</select>
<select
id=
"selectByDetailNo"
resultType=
"com.blt.other.module.cost.model.CostDetailDomain"
>
SELECT *
FROM cost_detail
WHERE detail_no = #{detailNo}
SELECT t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM cost_detail t1
left join cost_type ct on t1.type_id = ct.id
left join bailun_other.accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE t1.detail_no = #{detailNo}
</select>
<update
id=
"deletedFilePath"
parameterType=
"com.blt.other.database.model.CostPlanTempDomain"
>
UPDATE
cost_detail
SET file_path = NULL
WHERE detail_no = #{detailNo}
update cost_detail
set file_path = null
where detail_no = #{detailNo}
</update>
</mapper>
cost-service/src/main/resources/mapper/CostPlanDao.xml
View file @
8b549795
...
...
@@ -8,8 +8,14 @@
</resultMap>
<select
id=
"selectByNo"
resultMap=
"costPlan"
>
SELECT *
FROM cost_plan
SELECT t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM cost_plan t1
left join cost_type ct on t1.type_id = ct.id
left join accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE cost_plan_no = #{costPlanNo}
</select>
...
...
@@ -22,9 +28,15 @@
<select
id=
"selectAll"
resultMap=
"costPlan"
>
SELECT
*
t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM
cost_plan
cost_plan t1
left join cost_type ct on t1.type_id = ct.id
left join accounting_subject ast on ct.accounting_subject_id = ast.id
<if
test=
"userId != null"
>
where create_userid = #{userId}
</if>
...
...
cost-service/src/main/resources/mapper/CostPlanTempMapper.xml
View file @
8b549795
...
...
@@ -3,18 +3,31 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.blt.other.module.cost.dao.CostPlanTempDao"
>
<select
id=
"selectByNo"
resultType=
"com.blt.other.database.model.CostPlanTempDomain"
>
SELECT *
FROM cost_plan_temp
SELECT t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM cost_plan_temp t1
left join cost_type ct on t1.type_id = ct.id
left join accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE temp_no = #{tempNo}
</select>
<select
id=
"selectListByPlanNo"
resultType=
"com.blt.other.database.model.CostPlanTempDomain"
>
SELECT *
FROM cost_plan_temp
SELECT t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM cost_plan_temp t1
left join cost_type ct on t1.type_id = ct.id
left join bailun_other.accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE cost_plan_no = #{costPlanNo}
ORDER BY id DESC
</select>
<!--parameterType="StudentEntity"-->
<delete
id=
"deletedByPlanNoAndTempNo"
>
DELETE
...
...
@@ -31,16 +44,28 @@
</update>
<select
id=
"selectByPlanNoAndTypeNo"
resultType=
"com.blt.other.database.model.CostPlanTempDomain"
>
SELECT *
FROM cost_plan_temp
SELECT t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM cost_plan_temp t1
left join cost_type ct on t1.type_id = ct.id
left join bailun_other.accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE cost_plan_no = #{costPlanNo}
AND type_no = #{typeNo}
ORDER BY id DESC
</select>
<select
id=
"selectByPlanNoAndTempNo"
resultType=
"com.blt.other.database.model.CostPlanTempDomain"
>
SELECT *
FROM cost_plan_temp
SELECT t1.*,
ct.type_no,
ct.type_name,
ast.subject_no accounting_subject_no,
ast.name accounting_subject_name
FROM cost_plan_temp t1
left join cost_type ct on t1.type_id = ct.id
left join bailun_other.accounting_subject ast on ct.accounting_subject_id = ast.id
WHERE cost_plan_no = #{costPlanNo}
AND temp_no = #{tempNo}
ORDER BY id DESC
...
...
cost-service/src/test/java/com/blt/other/OtherApplicationTests.java
View file @
8b549795
...
...
@@ -250,7 +250,7 @@ public class OtherApplicationTests {
CostTypeDomain
costTypeDomain
=
costTypeDao
.
selectOne
(
new
LambdaQueryWrapper
<
CostTypeDomain
>()
.
eq
(
CostTypeDomain:
:
getTypeName
,
item
.
getType
())
.
eq
(
CostTypeDomain:
:
getCostTemplateType
,
map
.
get
(
item
.
getCostType
()))
.
eq
(
CostTypeDomain:
:
getAccountingSubject
No
,
accountingSubject
.
getSubjectNo
()));
.
eq
(
CostTypeDomain:
:
getAccountingSubject
Id
,
accountingSubject
.
getId
()));
if
(
costTypeDomain
==
null
)
{
costTypeDomain
=
new
CostTypeDomain
();
...
...
@@ -260,7 +260,7 @@ public class OtherApplicationTests {
costTypeDomain
.
setTypeName
(
item
.
getType
());
costTypeDomain
.
setTypeNo
(
IdWorker
.
getIdStr
());
costTypeDomain
.
setDescription
(
item
.
getDesc
());
costTypeDomain
.
setAccountingSubject
No
(
accountingSubject
.
getSubjectNo
());
costTypeDomain
.
setAccountingSubject
Id
(
accountingSubject
.
getId
());
boolean
b
=
costTypeDao
.
updateById
(
costTypeDomain
)
>
0
||
costTypeDao
.
insert
(
costTypeDomain
)
>
0
;
...
...
@@ -371,7 +371,6 @@ public class OtherApplicationTests {
.
forEach
(
costTypeDomain
->
{
CostTypeDomain
item
=
new
CostTypeDomain
();
item
.
setCostTemplateType
(
CostTypeDomain
.
borrow
);
item
.
setAccountingSubjectNo
(
"1345912843756503041"
);
item
.
setDescription
(
costTypeDomain
.
getDescription
());
item
.
setTypeNo
(
IdWorker
.
getIdStr
());
item
.
setTypeName
(
costTypeDomain
.
getTypeName
());
...
...
cost-service/src/test/java/com/blt/other/module/cost/service/impl/cost/AbstractCostServiceTest.java
View file @
8b549795
...
...
@@ -6,8 +6,8 @@ import com.bailuntec.common.JsonUtilByFsJson;
import
com.blt.other.common.config.property.CostUrlProperties
;
import
com.blt.other.database.model.CostCompanyDomain
;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostDao
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.vo.CashierCallbackUrlDataDataVo
;
import
com.blt.other.module.cost.vo.CashierCallbackUrlDataVo
;
import
com.blt.other.module.cost.vo.CashierCallbackUrlVo
;
...
...
@@ -45,7 +45,7 @@ class AbstractCostServiceTest {
@Resource
CostUrlProperties
costUrlProperties
;
@Resource
Cost
Dao
costDao
;
Cost
Service
costService
;
PostApplyReq
buildPostApplyReq
(
CostDomain
cost
)
{
...
...
@@ -89,6 +89,7 @@ class AbstractCostServiceTest {
if
(
null
==
detailKey
||
!
detailKey
.
contains
(
"F"
))
{
detailKey
=
cost
.
getCostNo
();
}
// 回调必要的key参数(DetailKey)不能为空;
req
.
setDetailKey
(
detailKey
);
req
.
setTypeName
(
cost
.
getTypeName
());
...
...
@@ -99,7 +100,7 @@ class AbstractCostServiceTest {
@Rollback
@Test
void
toFinancial
()
{
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
"F030246"
);
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
"F030246"
);
PostApplyReq
req
=
this
.
buildPostApplyReq
(
costDomain
);
// 审核回调地址(ApplyCallbackUrl)不可为空;
...
...
cost-service/src/test/java/com/blt/other/module/cost/service/impl/costcheck/FinancialCheckStateTest.java
View file @
8b549795
...
...
@@ -5,6 +5,7 @@ import com.blt.other.database.model.CostCompanyDomain;
import
com.blt.other.module.cost.dao.CostCompanyDao
;
import
com.blt.other.module.cost.dao.CostDao
;
import
com.blt.other.module.cost.model.CostDomain
;
import
com.blt.other.module.cost.service.CostService
;
import
com.blt.other.module.cost.service.ICostCurrentReviewerService
;
import
com.blt.other.module.sys.dao.CostReviewerMapper
;
import
com.blt.other.module.sys.model.CostReviewer
;
...
...
@@ -35,7 +36,7 @@ import java.util.List;
class
FinancialCheckStateTest
{
@Resource
Cost
Dao
costDao
;
Cost
Service
costService
;
@Resource
CostCompanyDao
costCompanyDao
;
@Resource
...
...
@@ -52,11 +53,8 @@ class FinancialCheckStateTest {
costs
.
forEach
(
this
::
reSet
);
}
//F031366
//F031367
//F031370
private
void
reSet
(
String
costNo
)
{
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
costNo
);
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
costNo
);
CostCompanyDomain
costCompanyDomain
=
costCompanyDao
.
selectByNo
(
costDomain
.
getCompanyNo
());
...
...
@@ -71,7 +69,7 @@ class FinancialCheckStateTest {
@Test
void
updateCurrentReviewer
()
{
CostDomain
costDomain
=
cost
Dao
.
selec
tByCostNo
(
"F031533"
);
CostDomain
costDomain
=
cost
Service
.
getCos
tByCostNo
(
"F031533"
);
CostContext
costContext
=
new
CostContext
(
"F031533"
,
costDomain
.
getCreateUserid
());
costContext
.
setCostState
(
financialCheckState
);
financialCheckState
.
updateCurrentReviewer
();
...
...
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