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
1ba1a5d1
Commit
1ba1a5d1
authored
Dec 23, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
e3ed459e
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
360 additions
and
48 deletions
+360
-48
GlobalExceptionHandler.java
...om/blt/other/common/exception/GlobalExceptionHandler.java
+18
-3
JwtUtil.java
...core/src/main/java/com/blt/other/common/util/JwtUtil.java
+4
-1
CostTypeDomain.java
...ain/java/com/blt/other/database/model/CostTypeDomain.java
+9
-1
OaCompanyController.java
...blt/other/module/auth/controller/OaCompanyController.java
+1
-0
OaDepartmentController.java
.../other/module/auth/controller/OaDepartmentController.java
+11
-3
OaDepartmentMapper.java
...ava/com/blt/other/module/auth/dao/OaDepartmentMapper.java
+4
-0
IOaDepartmentService.java
...m/blt/other/module/auth/service/IOaDepartmentService.java
+7
-1
OaDepartmentServiceImpl.java
...her/module/auth/service/impl/OaDepartmentServiceImpl.java
+8
-10
AccountingSubjectController.java
...r/module/cost/controller/AccountingSubjectController.java
+9
-0
CostTypeController.java
.../blt/other/module/cost/controller/CostTypeController.java
+18
-1
CostTypeDao.java
.../main/java/com/blt/other/module/cost/dao/CostTypeDao.java
+3
-0
AccountingSubjectModifyReq.java
...r/module/cost/dto/request/AccountingSubjectModifyReq.java
+27
-0
CostTypeModifyReq.java
.../blt/other/module/cost/dto/request/CostTypeModifyReq.java
+1
-3
SpecDepartmentCheckDeleteReq.java
...module/cost/dto/request/SpecDepartmentCheckDeleteReq.java
+21
-0
SpecDepartmentCheckModifyReq.java
...module/cost/dto/request/SpecDepartmentCheckModifyReq.java
+32
-0
CostTypeResult.java
...om/blt/other/module/cost/dto/response/CostTypeResult.java
+25
-1
AccountingSubject.java
...va/com/blt/other/module/cost/model/AccountingSubject.java
+5
-1
CostTypeService.java
...va/com/blt/other/module/cost/service/CostTypeService.java
+16
-1
IAccountingSubjectService.java
.../other/module/cost/service/IAccountingSubjectService.java
+7
-0
AccountingSubjectServiceImpl.java
...odule/cost/service/impl/AccountingSubjectServiceImpl.java
+15
-0
CostTypeServiceImpl.java
...t/other/module/cost/service/impl/CostTypeServiceImpl.java
+17
-12
SpecDepartmentCheckConfigController.java
...e/sys/controller/SpecDepartmentCheckConfigController.java
+14
-0
ISpecDepartmentCheckConfigService.java
...module/sys/service/ISpecDepartmentCheckConfigService.java
+15
-1
SpecDepartmentCheckConfigServiceImpl.java
...ys/service/impl/SpecDepartmentCheckConfigServiceImpl.java
+36
-3
CostTypeMapper.xml
...ec-cost-core/src/main/resources/mapper/CostTypeMapper.xml
+30
-5
OaDepartmentMapper.xml
...ore/src/main/resources/mapper/auth/OaDepartmentMapper.xml
+7
-1
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/common/exception/GlobalExceptionHandler.java
View file @
1ba1a5d1
...
...
@@ -4,12 +4,12 @@ package com.blt.other.common.exception;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
java.sql.SQLIntegrityConstraintViolationException
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -24,7 +24,6 @@ import java.util.Map;
public
class
GlobalExceptionHandler
{
/**
* 自定义异常
*/
...
...
@@ -46,7 +45,7 @@ public class GlobalExceptionHandler {
* 自定义异常
*/
@ResponseBody
@ExceptionHandler
(
RuntimeException
.
class
)
@ExceptionHandler
(
{
RuntimeException
.
class
}
)
public
Map
<
String
,
Object
>
handleRuntimeException
(
HttpServletRequest
request
,
RuntimeException
e
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
...
...
@@ -58,6 +57,22 @@ public class GlobalExceptionHandler {
return
result
;
}
/**
* 数据库唯一键冲突异常
*/
@ResponseBody
@ExceptionHandler
({
SQLIntegrityConstraintViolationException
.
class
})
public
Map
<
String
,
Object
>
handleSQLIntegrityConstraintViolationException
(
HttpServletRequest
request
,
RuntimeException
e
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"success"
,
false
);
result
.
put
(
"msg"
,
"数据重复"
);
result
.
put
(
"message"
,
"数据重复"
);
log
.
error
(
e
.
getMessage
(),
e
);
return
result
;
}
/**
* 未捕获异常
...
...
bailuntec-cost-core/src/main/java/com/blt/other/common/util/JwtUtil.java
View file @
1ba1a5d1
package
com
.
blt
.
other
.
common
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.bailuntec.common.JsonUtilByFsJson
;
import
com.blt.other.common.base.SysUser
;
import
com.blt.other.common.exception.BizRuntimeException
;
...
...
@@ -40,7 +42,8 @@ public class JwtUtil {
JwtConsumer
consumer
=
new
JwtConsumerBuilder
()
.
setExpectedAudience
(
"http://localhost:5001/resources"
,
"bailunApi"
)
.
setVerificationKey
(
new
RsaJsonWebKey
(
JsonUtilByFsJson
.
jsonToBean
(
PUBLIC_KEY
,
map
.
getClass
())).
getPublicKey
())
.
setVerificationKey
(
new
RsaJsonWebKey
(
JSON
.
parseObject
(
PUBLIC_KEY
,
new
TypeReference
<
HashMap
<
String
,
Object
>>()
{
})).
getPublicKey
())
.
build
();
JwtClaims
claims
=
consumer
.
processToClaims
(
token
.
replaceAll
(
TOKEN_PREFIX
,
""
));
if
(
claims
!=
null
)
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/database/model/CostTypeDomain.java
View file @
1ba1a5d1
...
...
@@ -3,6 +3,7 @@ package com.blt.other.database.model;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -40,17 +41,24 @@ public class CostTypeDomain {
@ApiModelProperty
(
"费用模版类型作用"
)
private
Integer
costTemplateType
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"创建人id"
)
private
Integer
createUserId
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createUser
;
@ApiModelProperty
(
value
=
"更新人id"
)
private
Integer
updateUserId
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateUser
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"最后更新时间"
)
private
LocalDateTime
lastUpdateTime
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/controller/OaCompanyController.java
View file @
1ba1a5d1
...
...
@@ -38,4 +38,5 @@ public class OaCompanyController {
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/controller/OaDepartmentController.java
View file @
1ba1a5d1
...
...
@@ -31,13 +31,21 @@ public class OaDepartmentController {
@Resource
IOaDepartmentService
oaDepartmentService
;
@ApiOperation
(
"获取
百伦
公司主体下面的一级部门列表"
)
@ApiOperation
(
"获取公司主体下面的一级部门列表"
)
@GetMapping
(
"/primaryDepartment"
)
public
CostResult
<
List
<
OaDepartment
>>
oa
Department
(
@RequestParam
Integer
companyId
)
{
List
<
OaDepartment
>
oaDepartmentList
=
oaDepartmentService
.
oa
Department
(
companyId
);
public
CostResult
<
List
<
OaDepartment
>>
primary
Department
(
@RequestParam
Integer
companyId
)
{
List
<
OaDepartment
>
oaDepartmentList
=
oaDepartmentService
.
primary
Department
(
companyId
);
return
CostResult
.
success
(
oaDepartmentList
);
}
@ApiOperation
(
"获取公所有部门列表"
)
@GetMapping
(
"/allOaDepartment"
)
public
CostResult
<
List
<
OaDepartment
>>
allOaDepartment
()
{
List
<
OaDepartment
>
oaDepartmentList
=
oaDepartmentService
.
allOaDepartment
();
return
CostResult
.
success
(
oaDepartmentList
);
}
@ApiOperation
(
"更新部门审核金额"
)
@GetMapping
(
"/updateDepartmentMinimumReviewAmount"
)
public
CostResult
<
Void
>
updateDepartmentMinimumReviewAmount
(
@RequestParam
Integer
oaDepartmentId
,
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/dao/OaDepartmentMapper.java
View file @
1ba1a5d1
...
...
@@ -7,6 +7,8 @@ import com.blt.other.module.sys.dto.response.DepartmentReviewerListItem;
import
com.blt.other.module.auth.model.OaDepartment
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
* Mapper 接口
...
...
@@ -28,4 +30,6 @@ public interface OaDepartmentMapper extends BaseMapper<OaDepartment> {
@Param
(
"req"
)
DepartmentReviewerListReq
req
);
OaDepartment
selectByDepartmentId
(
Integer
oaDepartmentId
);
List
<
OaDepartment
>
allOaDepartment
();
}
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/service/IOaDepartmentService.java
View file @
1ba1a5d1
...
...
@@ -29,7 +29,7 @@ public interface IOaDepartmentService extends IService<OaDepartment> {
* @param companyId 公司主体id
* @return 一级部门列表
*/
List
<
OaDepartment
>
oa
Department
(
@NonNull
Integer
companyId
);
List
<
OaDepartment
>
primary
Department
(
@NonNull
Integer
companyId
);
/**
...
...
@@ -50,4 +50,10 @@ public interface IOaDepartmentService extends IService<OaDepartment> {
* @param amount 金额
*/
void
updateDepartmentMinimumReviewAmount
(
Integer
oaDepartmentId
,
BigDecimal
amount
);
/**
* 获取百伦所有部门
* @return 所有部门
*/
List
<
OaDepartment
>
allOaDepartment
();
}
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/service/impl/OaDepartmentServiceImpl.java
View file @
1ba1a5d1
package
com
.
blt
.
other
.
module
.
auth
.
service
.
impl
;
import
com.bailuntec.common.ListUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.module.sys.dao.CostReviewerMapper
;
import
com.blt.other.module.auth.dao.OaDepartmentMapper
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.sys.dto.request.DepartmentReviewerListReq
;
import
com.blt.other.module.sys.dto.response.DepartmentReviewerListItem
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
com.blt.other.module.auth.model.OaDepartment
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.IOaDepartmentService
;
import
com.blt.other.module.sys.dao.CostReviewerMapper
;
import
com.blt.other.module.sys.model.CostReviewer
;
import
org.springframework.lang.NonNull
;
import
org.springframework.stereotype.Service
;
...
...
@@ -21,8 +16,6 @@ import javax.annotation.Resource;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -40,7 +33,7 @@ public class OaDepartmentServiceImpl extends ServiceImpl<OaDepartmentMapper, OaD
OaUserMapper
oaUserMapper
;
@Override
public
List
<
OaDepartment
>
oa
Department
(
@NonNull
Integer
companyId
)
{
public
List
<
OaDepartment
>
primary
Department
(
@NonNull
Integer
companyId
)
{
return
this
.
list
(
new
LambdaQueryWrapper
<
OaDepartment
>()
.
eq
(
OaDepartment:
:
getParentId
,
0
)
.
eq
(
OaDepartment:
:
getCompanyId
,
companyId
));
...
...
@@ -85,4 +78,9 @@ public class OaDepartmentServiceImpl extends ServiceImpl<OaDepartmentMapper, OaD
oaDepartment
.
setDepartmentMinimumReviewAmount
(
amount
);
baseMapper
.
updateById
(
oaDepartment
);
}
@Override
public
List
<
OaDepartment
>
allOaDepartment
()
{
return
baseMapper
.
allOaDepartment
();
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/AccountingSubjectController.java
View file @
1ba1a5d1
...
...
@@ -42,6 +42,15 @@ public class AccountingSubjectController {
return
CostResult
.
success
();
}
@ApiOperation
(
"更新会计一级科目"
)
@PostMapping
(
"/modify"
)
public
CostResult
<
Void
>
modify
(
@RequestBody
AccountingSubjectAddReq
req
)
{
log
.
info
(
"新增会计一级科目:{}"
,
JsonUtilByFsJson
.
beanToJson
(
req
));
accountingSubjectService
.
modify
(
req
);
return
CostResult
.
success
();
}
@ApiOperation
(
"获取会计一级科目"
)
@PostMapping
(
"/queryAll"
)
public
CostResult
<
List
<
AccountingSubject
>>
queryAll
()
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/CostTypeController.java
View file @
1ba1a5d1
...
...
@@ -2,13 +2,13 @@ package com.blt.other.module.cost.controller;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.blt.other.database.model.LogisticsSupplierBankDomain
;
import
com.blt.other.module.cost.dto.request.CostTypeAddReq
;
import
com.blt.other.module.cost.dto.request.CostTypeModifyReq
;
import
com.blt.other.module.cost.dto.request.CostTypeQueryPageReq
;
import
com.blt.other.module.cost.dto.response.CostTypeResult
;
import
com.blt.other.module.cost.service.CostTypeKindService
;
import
com.blt.other.module.cost.service.CostTypeService
;
import
com.blt.other.database.model.LogisticsSupplierBankDomain
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -36,6 +36,23 @@ public class CostTypeController {
return
CostResult
.
success
(
page
);
}
@ApiOperation
(
"获取费用类型详情"
)
@PostMapping
(
"/queryDetail"
)
public
CostResult
<
CostTypeResult
>
queryDetail
(
@RequestParam
Integer
id
)
{
CostTypeResult
result
=
costTypeService
.
queryDetail
(
id
);
return
CostResult
.
success
(
result
);
}
@ApiOperation
(
"删除费用类型详情"
)
@PostMapping
(
"/deleteById"
)
public
CostResult
<
Void
>
deleteById
(
@RequestParam
Integer
id
)
{
costTypeService
.
deleteById
(
id
);
return
CostResult
.
success
();
}
@ApiOperation
(
"添加费用类型"
)
@PostMapping
(
"/addCostType"
)
public
CostResult
<
Void
>
addCostType
(
@RequestBody
CostTypeAddReq
req
)
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dao/CostTypeDao.java
View file @
1ba1a5d1
...
...
@@ -19,4 +19,7 @@ public interface CostTypeDao extends BaseMapper<CostTypeDomain> {
//根据编号查
CostTypeDomain
selectByNo
(
String
typeNo
);
//获取费用类型详情
CostTypeResult
queryDetail
(
Integer
id
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/AccountingSubjectModifyReq.java
0 → 100644
View file @
1ba1a5d1
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 4:37 下午
*/
@Data
public
class
AccountingSubjectModifyReq
{
@ApiModelProperty
(
value
=
"会计一级类目编号"
)
private
String
subjectNo
;
@ApiModelProperty
(
value
=
"会计一级类目名称"
)
private
String
name
;
@ApiModelProperty
(
value
=
"更新人id"
)
private
Integer
updateUserId
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/CostTypeModifyReq.java
View file @
1ba1a5d1
...
...
@@ -14,6 +14,7 @@ import lombok.Data;
@Data
public
class
CostTypeModifyReq
{
@ApiModelProperty
(
"费用类型编号"
)
private
String
typeNo
;
...
...
@@ -26,9 +27,6 @@ public class CostTypeModifyReq {
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectNo
;
@ApiModelProperty
(
"会计一级科目"
)
private
String
accountingSubjectName
;
private
Integer
currentUserId
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/SpecDepartmentCheckDeleteReq.java
0 → 100644
View file @
1ba1a5d1
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:28 上午
*/
@Data
public
class
SpecDepartmentCheckDeleteReq
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/request/SpecDepartmentCheckModifyReq.java
0 → 100644
View file @
1ba1a5d1
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/12/17 10:28 上午
*/
@Data
public
class
SpecDepartmentCheckModifyReq
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"付款财务主体id"
)
private
Integer
costCompanyId
;
@ApiModelProperty
(
value
=
"申请人oa公司id"
)
private
Integer
oaCompanyId
;
@ApiModelProperty
(
value
=
"特殊审核人oa用户id"
)
private
Integer
reviewerUserId
;
@ApiModelProperty
(
value
=
"修改人id"
)
private
Integer
updateUserId
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/response/CostTypeResult.java
View file @
1ba1a5d1
...
...
@@ -2,9 +2,12 @@ package com.blt.other.module.cost.dto.response;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* <p>
*
...
...
@@ -30,9 +33,30 @@ public class CostTypeResult {
private
String
typeName
;
@ApiModelProperty
(
value
=
"会计一级类目编号"
)
private
String
accountingSubject
Code
;
private
String
accountingSubject
No
;
@ApiModelProperty
(
value
=
"会计一级类目名称"
)
private
String
accountingSubjectName
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"创建人id"
)
private
Integer
createUserId
;
@ApiModelProperty
(
value
=
"创建人"
)
private
String
createUser
;
@ApiModelProperty
(
value
=
"更新人id"
)
private
Integer
updateUserId
;
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateUser
;
@ApiModelProperty
(
value
=
"最后更新时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
lastUpdateTime
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/AccountingSubject.java
View file @
1ba1a5d1
...
...
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import
java.time.LocalDateTime
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.io.Serializable
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -11,7 +13,7 @@ import lombok.EqualsAndHashCode;
/**
* <p>
*
*
* </p>
*
* @author robbendev
...
...
@@ -33,6 +35,7 @@ public class AccountingSubject implements Serializable {
@ApiModelProperty
(
value
=
"会计一级类目名称"
)
private
String
name
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
...
...
@@ -42,6 +45,7 @@ public class AccountingSubject implements Serializable {
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateUser
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@ApiModelProperty
(
value
=
"最后更新时间"
)
private
LocalDateTime
lastUpdateTime
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/CostTypeService.java
View file @
1ba1a5d1
...
...
@@ -2,11 +2,11 @@ package com.blt.other.module.cost.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.module.cost.dto.request.CostTypeAddReq
;
import
com.blt.other.module.cost.dto.request.CostTypeModifyReq
;
import
com.blt.other.module.cost.dto.request.CostTypeQueryPageReq
;
import
com.blt.other.module.cost.dto.response.CostTypeResult
;
import
com.blt.other.database.model.CostTypeDomain
;
public
interface
CostTypeService
extends
IService
<
CostTypeDomain
>
{
...
...
@@ -32,4 +32,19 @@ public interface CostTypeService extends IService<CostTypeDomain> {
* @param req req
*/
void
modifyCostType
(
CostTypeModifyReq
req
);
/**
* 获取费用类型详情
*
* @param id id
* @return res
*/
CostTypeResult
queryDetail
(
Integer
id
);
/**
* 删除费用类型详情
*
* @param id id
*/
void
deleteById
(
Integer
id
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/IAccountingSubjectService.java
View file @
1ba1a5d1
...
...
@@ -20,4 +20,11 @@ public interface IAccountingSubjectService extends IService<AccountingSubject> {
* @param req req
*/
void
add
(
AccountingSubjectAddReq
req
);
/**
* 更新一级科目
*
* @param req req
*/
void
modify
(
AccountingSubjectAddReq
req
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/AccountingSubjectServiceImpl.java
View file @
1ba1a5d1
...
...
@@ -44,4 +44,19 @@ public class AccountingSubjectServiceImpl extends ServiceImpl<AccountingSubjectM
accountingSubject
.
setLastUpdateTime
(
LocalDateTime
.
now
());
this
.
save
(
accountingSubject
);
}
@Override
public
void
modify
(
AccountingSubjectAddReq
req
)
{
AccountingSubject
accountingSubject
=
baseMapper
.
selectByNo
(
req
.
getSubjectNo
());
accountingSubject
.
setUpdateUserId
(
req
.
getUpdateUserId
());
OaUser
oaUser
=
oaUserMapper
.
selectByOaUserId
(
req
.
getUpdateUserId
());
accountingSubject
.
setUpdateUser
(
oaUser
.
getUserName
());
accountingSubject
.
setLastUpdateTime
(
LocalDateTime
.
now
());
accountingSubject
.
setName
(
req
.
getName
());
baseMapper
.
updateById
(
accountingSubject
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/CostTypeServiceImpl.java
View file @
1ba1a5d1
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.database.model.CostTypeDomain
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.cost.dao.AccountingSubjectMapper
;
...
...
@@ -14,7 +15,6 @@ import com.blt.other.module.cost.dto.request.CostTypeQueryPageReq;
import
com.blt.other.module.cost.dto.response.CostTypeResult
;
import
com.blt.other.module.cost.model.AccountingSubject
;
import
com.blt.other.module.cost.service.CostTypeService
;
import
com.blt.other.database.model.CostTypeDomain
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
...
...
@@ -37,7 +37,7 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
costTypeDomain
.
setTypeName
(
req
.
getTypeName
());
costTypeDomain
.
setDescription
(
req
.
getDescription
());
costTypeDomain
.
setCostTemplateType
(
req
.
getType
(
));
costTypeDomain
.
setCostTemplateType
(
this
.
getCostTemplateType
(
req
.
getType
()
));
this
.
save
(
costTypeDomain
);
}
...
...
@@ -64,19 +64,24 @@ public class CostTypeServiceImpl extends ServiceImpl<CostTypeDao, CostTypeDomain
costTypeDomain
.
setUpdateUserId
(
oaUser
.
getOaUserId
());
costTypeDomain
.
setUpdateUser
(
oaUser
.
getUserName
());
costTypeDomain
.
setLastUpdateTime
(
LocalDateTime
.
now
());
costTypeDomain
.
setAccountingSubjectNo
(
req
.
getAccountingSubjectNo
());
log
.
info
(
"{} 更新会计一级科目"
,
oaUser
.
getUserName
());
this
.
updateById
(
costTypeDomain
);
}
log
.
info
(
"{} 更新会计一级科目"
,
oaUser
.
getUserName
());
if
(
req
.
getAccountingSubjectNo
()
!=
null
)
{
AccountingSubject
accountingSubject
=
accountingSubjectMapper
.
selectByNo
(
req
.
getAccountingSubjectNo
());
accountingSubject
.
setName
(
req
.
getAccountingSubjectName
().
trim
());
accountingSubject
.
setLastUpdateTime
(
LocalDateTime
.
now
());
accountingSubject
.
setUpdateUserId
(
oaUser
.
getOaUserId
());
accountingSubject
.
setUpdateUser
(
oaUser
.
getUserName
());
accountingSubject
.
setLastUpdateTime
(
LocalDateTime
.
now
());
accountingSubjectMapper
.
updateById
(
accountingSubject
);
}
}
@Override
public
CostTypeResult
queryDetail
(
Integer
id
)
{
return
baseMapper
.
queryDetail
(
id
);
}
@Override
public
void
deleteById
(
Integer
id
)
{
baseMapper
.
deleteById
(
id
);
}
/**
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/sys/controller/SpecDepartmentCheckConfigController.java
View file @
1ba1a5d1
...
...
@@ -55,6 +55,20 @@ public class SpecDepartmentCheckConfigController {
return
CostResult
.
success
();
}
@ApiOperation
(
"更新特殊审核数据"
)
@PostMapping
(
"/modify"
)
public
CostResult
<
Void
>
modify
(
@RequestBody
SpecDepartmentCheckModifyReq
req
)
{
specDepartmentCheckConfigService
.
modify
(
req
);
return
CostResult
.
success
();
}
@ApiOperation
(
"删除特殊审核数据"
)
@PostMapping
(
"/delete"
)
public
CostResult
<
Void
>
delete
(
@RequestBody
SpecDepartmentCheckDeleteReq
req
)
{
specDepartmentCheckConfigService
.
delete
(
req
);
return
CostResult
.
success
();
}
@ApiOperation
(
"批量导入数据"
)
@PostMapping
(
"/importExcel"
)
public
CostResult
<
Void
>
importExcel
(
@RequestBody
SpecDepartmentCheckImportExcelReq
excel
)
throws
IOException
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/sys/service/ISpecDepartmentCheckConfigService.java
View file @
1ba1a5d1
...
...
@@ -51,7 +51,21 @@ public interface ISpecDepartmentCheckConfigService extends IService<SpecDepartme
* 导出excel
*
* @param response response
* @param req req
* @param req
req
*/
void
exportExcel
(
HttpServletResponse
response
,
SpecDepartmentCheckExportExcelReq
req
)
throws
IOException
;
/**
* 更新特殊审核数据
*
* @param req req
*/
void
modify
(
SpecDepartmentCheckModifyReq
req
);
/**
* 删除特殊审核数据
*
* @param req req
*/
void
delete
(
SpecDepartmentCheckDeleteReq
req
);
}
bailuntec-cost-core/src/main/java/com/blt/other/module/sys/service/impl/SpecDepartmentCheckConfigServiceImpl.java
View file @
1ba1a5d1
...
...
@@ -9,13 +9,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.module.auth.dao.OaCompanyMapper
;
import
com.blt.other.module.auth.dao.OaUserMapper
;
import
com.blt.other.module.auth.model.OaUser
;
import
com.blt.other.module.auth.service.IOaCompanyService
;
import
com.blt.other.module.cost.dao.SpecDepartmentCheckConfigMapper
;
import
com.blt.other.module.cost.dto.request.*
;
import
com.blt.other.module.sys.model.SpecDepartmentCheckConfig
;
import
com.blt.other.module.cost.service.CostCompanyService
;
import
com.blt.other.module.sys.model.SpecDepartmentCheckConfig
;
import
com.blt.other.module.sys.service.ISpecDepartmentCheckConfigService
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -49,6 +50,8 @@ public class SpecDepartmentCheckConfigServiceImpl extends ServiceImpl<SpecDepart
private
CostCompanyService
costCompanyService
;
@Resource
private
IOaCompanyService
oaCompanyService
;
@Resource
private
OaCompanyMapper
oaCompanyMapper
;
private
<
T
extends
SpecDepartmentCheckBaseQuery
>
LambdaQueryWrapper
<
SpecDepartmentCheckConfig
>
buildQueryWrapper
(
T
req
)
{
LambdaQueryWrapper
<
SpecDepartmentCheckConfig
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
@@ -100,10 +103,10 @@ public class SpecDepartmentCheckConfigServiceImpl extends ServiceImpl<SpecDepart
specDepartmentCheckConfig
.
setReviewerUser
(
oaUserMapper
.
selectByOaUserId
(
req
.
getReviewerUserId
()).
getUserName
());
specDepartmentCheckConfig
.
setOaCompanyId
(
req
.
getOaCompanyId
());
specDepartmentCheckConfig
.
setOaCompany
(
oaCompany
Service
.
getB
yId
(
req
.
getOaCompanyId
()).
getName
());
specDepartmentCheckConfig
.
setOaCompany
(
oaCompany
Mapper
.
selectByCompan
yId
(
req
.
getOaCompanyId
()).
getName
());
specDepartmentCheckConfig
.
setCostCompanyId
(
req
.
getCostCompanyId
());
specDepartmentCheckConfig
.
set
OaCompany
(
costCompanyService
.
getById
(
req
.
getCostCompanyId
()).
getCompanyName
());
specDepartmentCheckConfig
.
set
CostCompanyName
(
costCompanyService
.
getById
(
req
.
getCostCompanyId
()).
getCompanyName
());
specDepartmentCheckConfig
.
setUpdateUserId
(
req
.
getUpdateUserId
());
specDepartmentCheckConfig
.
setUpdateUserName
(
oaUserMapper
.
selectByOaUserId
(
req
.
getUpdateUserId
()).
getUserName
());
...
...
@@ -143,6 +146,36 @@ public class SpecDepartmentCheckConfigServiceImpl extends ServiceImpl<SpecDepart
EasyExcel
.
write
(
response
.
getOutputStream
(),
SpecDepartmentCheckConfigExportExcelItem
.
class
).
sheet
(
"sheet"
).
doWrite
(
aiList
);
}
@Override
public
void
modify
(
SpecDepartmentCheckModifyReq
req
)
{
SpecDepartmentCheckConfig
specDepartmentCheckConfig
=
this
.
getById
(
req
.
getId
());
if
(
req
.
getReviewerUserId
()
!=
null
)
{
specDepartmentCheckConfig
.
setReviewerUserId
(
req
.
getReviewerUserId
());
specDepartmentCheckConfig
.
setReviewerUser
(
oaUserMapper
.
selectByOaUserId
(
req
.
getReviewerUserId
()).
getUserName
());
}
if
(
req
.
getOaCompanyId
()
!=
null
)
{
specDepartmentCheckConfig
.
setOaCompanyId
(
req
.
getOaCompanyId
());
specDepartmentCheckConfig
.
setOaCompany
(
oaCompanyMapper
.
selectByCompanyId
(
req
.
getOaCompanyId
()).
getName
());
}
if
(
req
.
getCostCompanyId
()
!=
null
)
{
specDepartmentCheckConfig
.
setCostCompanyId
(
req
.
getCostCompanyId
());
specDepartmentCheckConfig
.
setCostCompanyName
(
costCompanyService
.
getById
(
req
.
getCostCompanyId
()).
getCompanyName
());
}
specDepartmentCheckConfig
.
setUpdateUserId
(
req
.
getUpdateUserId
());
specDepartmentCheckConfig
.
setUpdateUserName
(
oaUserMapper
.
selectByOaUserId
(
req
.
getUpdateUserId
()).
getUserName
());
specDepartmentCheckConfig
.
setLastUpdateTime
(
LocalDateTime
.
now
());
this
.
save
(
specDepartmentCheckConfig
);
}
@Override
public
void
delete
(
SpecDepartmentCheckDeleteReq
req
)
{
this
.
removeById
(
req
.
getId
());
}
@Data
static
class
SpecDepartmentCheckConfigExportExcelItem
{
...
...
bailuntec-cost-core/src/main/resources/mapper/CostTypeMapper.xml
View file @
1ba1a5d1
...
...
@@ -4,16 +4,23 @@
<mapper
namespace=
"com.blt.other.module.cost.dao.CostTypeDao"
>
<select
id=
"queryPage"
resultType=
"com.blt.other.module.cost.dto.response.CostTypeResult"
>
select t1.type_no,
select t1.id,
t1.type_no,
t1.type_name,
t1.description,
t1.accounting_subject_code,
t2.name as accounting_subject_name
t1.accounting_subject_no,
t2.name as accounting_subject_name,
t1.create_time,
t1.update_user,
t1.update_user_id,
t1.last_update_time,
t1.create_user_id,
t1.create_user
from cost_type t1
left join accounting_subject t2 on t1.accounting_subject_
code
= t2.subject_no
left join accounting_subject t2 on t1.accounting_subject_
no
= t2.subject_no
where t1.cost_template_type =#{req.costTemplateType}
<if
test=
"req.accountingSubjectNo !=null"
>
and t1.accounting_subject_
code
= #{req.accountingSubjectNo}
and t1.accounting_subject_
no
= #{req.accountingSubjectNo}
</if>
</select>
...
...
@@ -23,4 +30,22 @@
where type_no = #{typeNo}
</select>
<select
id=
"queryDetail"
resultType=
"com.blt.other.module.cost.dto.response.CostTypeResult"
>
select t1.id,
t1.type_no,
t1.type_name,
t1.description,
t1.accounting_subject_no,
t2.name as accounting_subject_name,
t1.create_time,
t1.update_user,
t1.update_user_id,
t1.last_update_time,
t1.create_user_id,
t1.create_user
from cost_type t1
left join accounting_subject t2 on t1.accounting_subject_no = t2.subject_no
where t1.id = #{id}
</select>
</mapper>
bailuntec-cost-core/src/main/resources/mapper/auth/OaDepartmentMapper.xml
View file @
1ba1a5d1
...
...
@@ -6,7 +6,7 @@
SELECT distinct t1.*,
t2.`name` company_name
from oa_department t1
left join oa_department s2 on t1.department_id
= s2.parent_id
left join oa_department s2 on t1.department_id = s2.parent_id
left join oa_company t2 on s2.company_id = t2.oa_company_id
left join cost_reviewer t3 on t1.department_id = t3.refer_id and (t3.type = 1)
where t1.parent_id = 0
...
...
@@ -37,6 +37,12 @@
from oa_department
where department_id = #{oaDepartmentId}
</select>
<select
id=
"allOaDepartment"
resultType=
"com.blt.other.module.auth.model.OaDepartment"
>
select t1.*,
t2.name company_name
from oa_department t1
left join oa_company t2 on t1.company_id = t2.oa_company_id
</select>
</mapper>
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