Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
71a3aa2c
Commit
71a3aa2c
authored
Aug 29, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EKP 权限-- 配置文件
parent
247ef19f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
13 deletions
+73
-13
SalaryProveController.java
...us/v1/yifu/archives/controller/SalaryProveController.java
+12
-0
TCompanyInfoController.java
...s/v1/yifu/archives/controller/TCompanyInfoController.java
+21
-11
TProveApplyService.java
...oud/plus/v1/yifu/archives/service/TProveApplyService.java
+4
-0
TProveApplyServiceImpl.java
...v1/yifu/archives/service/impl/TProveApplyServiceImpl.java
+30
-1
TCompanyInfoMapper.xml
...ives-biz/src/main/resources/mapper/TCompanyInfoMapper.xml
+1
-1
CacheConstants.java
...oud/plus/v1/yifu/common/core/constant/CacheConstants.java
+5
-0
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/SalaryProveController.java
View file @
71a3aa2c
...
...
@@ -215,6 +215,8 @@ public class SalaryProveController {
}
else
{
return
R
.
failed
(
"参数出错!"
);
}
// 存储最近一次选择的档案信息
tProveApplyService
.
setCompanyRedisInfo
(
record
.
getUnitName
(),
record
.
getUnitAddr
(),
record
.
getPhone
());
return
R
.
ok
(
record
);
}
...
...
@@ -427,4 +429,14 @@ public class SalaryProveController {
return
R
.
failed
(
"无此证明记录!"
);
}
}
/**
* 获取最近一次选择的客户名称
*
* @author fxj
* @date 2023-08-23 17:31:05
**/
@GetMapping
(
"/getLastCompanyName"
)
public
R
<
TCompanyInfo
>
getLastCompanyName
()
{
return
tProveApplyService
.
getLastCompanyName
();
}
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TCompanyInfoController.java
View file @
71a3aa2c
...
...
@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -37,6 +38,7 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletResponse
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -89,7 +91,7 @@ public class TCompanyInfoController {
*/
@Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('demo_tcompanyinfo_get')"
)
@GetMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('
demo_
tcompanyinfo_get')"
)
@PreAuthorize
(
"@pms.hasPermission('tcompanyinfo_get')"
)
public
R
<
TCompanyInfo
>
getById
(
@PathVariable
(
"id"
)
String
id
)
{
return
R
.
ok
(
tCompanyInfoService
.
getById
(
id
));
}
...
...
@@ -100,10 +102,10 @@ public class TCompanyInfoController {
* @param tCompanyInfo 收入证明 中的 单位信息维护表
* @return R
*/
@Operation
(
summary
=
"新增收入证明 中的 单位信息维护表"
,
description
=
"新增收入证明 中的 单位信息维护表:hasPermission('
demo_
tcompanyinfo_add')"
)
@Operation
(
summary
=
"新增收入证明 中的 单位信息维护表"
,
description
=
"新增收入证明 中的 单位信息维护表:hasPermission('tcompanyinfo_add')"
)
@SysLog
(
"新增收入证明 中的 单位信息维护表"
)
@PostMapping
@PreAuthorize
(
"@pms.hasPermission('
demo_
tcompanyinfo_add')"
)
@PreAuthorize
(
"@pms.hasPermission('tcompanyinfo_add')"
)
public
R
<
Boolean
>
save
(
@RequestBody
TCompanyInfo
tCompanyInfo
)
{
TCompanyInfo
exits
=
tCompanyInfoService
.
getOne
(
Wrappers
.<
TCompanyInfo
>
query
().
lambda
()
.
eq
(
TCompanyInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
...
...
@@ -111,6 +113,11 @@ public class TCompanyInfoController {
if
(
Common
.
isNotNull
(
exits
)){
return
R
.
failed
(
"已存在相同公司名称的有效数据!"
);
}
tCompanyInfo
.
setCreateName
(
SecurityUtils
.
getUser
().
getNickname
());
tCompanyInfo
.
setCreateBy
(
SecurityUtils
.
getUser
().
getId
());
tCompanyInfo
.
setCreateTime
(
LocalDateTime
.
now
());
tCompanyInfo
.
setUpdateBy
(
SecurityUtils
.
getUser
().
getId
());
tCompanyInfo
.
setUpdateTime
(
LocalDateTime
.
now
());
return
R
.
ok
(
tCompanyInfoService
.
save
(
tCompanyInfo
));
}
/**
...
...
@@ -119,10 +126,10 @@ public class TCompanyInfoController {
* @param tCompanyInfo 收入证明 中的 单位信息维护表
* @return R
*/
@Operation
(
summary
=
"修改收入证明 中的 单位信息维护表"
,
description
=
"修改收入证明 中的 单位信息维护表:hasPermission('
demo_
tcompanyinfo_edit')"
)
@Operation
(
summary
=
"修改收入证明 中的 单位信息维护表"
,
description
=
"修改收入证明 中的 单位信息维护表:hasPermission('tcompanyinfo_edit')"
)
@SysLog
(
"修改收入证明 中的 单位信息维护表"
)
@PutMapping
@PreAuthorize
(
"@pms.hasPermission('
demo_
tcompanyinfo_edit')"
)
@PreAuthorize
(
"@pms.hasPermission('tcompanyinfo_edit')"
)
public
R
<
Boolean
>
updateById
(
@RequestBody
TCompanyInfo
tCompanyInfo
)
{
TCompanyInfo
exits
=
tCompanyInfoService
.
getOne
(
Wrappers
.<
TCompanyInfo
>
query
().
lambda
()
.
eq
(
TCompanyInfo:
:
getDeleteFlag
,
CommonConstants
.
ZERO_STRING
)
...
...
@@ -131,6 +138,9 @@ public class TCompanyInfoController {
if
(
Common
.
isNotNull
(
exits
)){
return
R
.
failed
(
"已存在相同公司名称的有效数据!"
);
}
tCompanyInfo
.
setCreateTime
(
LocalDateTime
.
now
());
tCompanyInfo
.
setUpdateBy
(
SecurityUtils
.
getUser
().
getId
());
tCompanyInfo
.
setUpdateTime
(
LocalDateTime
.
now
());
return
R
.
ok
(
tCompanyInfoService
.
updateById
(
tCompanyInfo
));
}
...
...
@@ -140,10 +150,10 @@ public class TCompanyInfoController {
* @param id id
* @return R
*/
@Operation
(
summary
=
"通过id删除收入证明 中的 单位信息维护表"
,
description
=
"通过id删除收入证明 中的 单位信息维护表:hasPermission('
demo_
tcompanyinfo_del')"
)
@Operation
(
summary
=
"通过id删除收入证明 中的 单位信息维护表"
,
description
=
"通过id删除收入证明 中的 单位信息维护表:hasPermission('tcompanyinfo_del')"
)
@SysLog
(
"通过id删除收入证明 中的 单位信息维护表"
)
@DeleteMapping
(
"/{id}"
)
@PreAuthorize
(
"@pms.hasPermission('
demo_
tcompanyinfo_del')"
)
@PreAuthorize
(
"@pms.hasPermission('tcompanyinfo_del')"
)
public
R
<
Boolean
>
removeById
(
@PathVariable
String
id
)
{
return
R
.
ok
(
tCompanyInfoService
.
removeById
(
id
));
}
...
...
@@ -155,10 +165,10 @@ public class TCompanyInfoController {
* @date 2023-08-23 17:31:05
**/
@SneakyThrows
@Operation
(
description
=
"批量新增收入证明 中的 单位信息维护表 hasPermission('
demo_
tcompanyinfo-batch-import')"
)
@Operation
(
description
=
"批量新增收入证明 中的 单位信息维护表 hasPermission('tcompanyinfo-batch-import')"
)
@SysLog
(
"批量新增收入证明 中的 单位信息维护表"
)
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('
demo_
tcompanyinfo-batch-import')"
)
@PreAuthorize
(
"@pms.hasPermission('tcompanyinfo-batch-import')"
)
public
R
<
List
<
ErrorMessage
>>
importListAdd
(
@RequestBody
MultipartFile
file
)
{
return
tCompanyInfoService
.
importDiy
(
file
.
getInputStream
());
}
...
...
@@ -169,9 +179,9 @@ public class TCompanyInfoController {
* @author fxj
* @date 2023-08-23 17:31:05
**/
@Operation
(
description
=
"导出收入证明 中的 单位信息维护表 hasPermission('
demo_
tcompanyinfo-export')"
)
@Operation
(
description
=
"导出收入证明 中的 单位信息维护表 hasPermission('tcompanyinfo-export')"
)
@PostMapping
(
"/export"
)
@PreAuthorize
(
"@pms.hasPermission('
demo_
tcompanyinfo-export')"
)
@PreAuthorize
(
"@pms.hasPermission('tcompanyinfo-export')"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
TCompanyInfoSearchVo
searchVo
)
{
tCompanyInfoService
.
listExport
(
response
,
searchVo
);
}
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TProveApplyService.java
View file @
71a3aa2c
...
...
@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCompanyInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
...
...
@@ -23,4 +24,7 @@ public interface TProveApplyService extends IService<TProveApply> {
R
<
String
>
validSave
(
TProveApply
proveApply
,
String
[]
attaIdArray
);
R
<
TCompanyInfo
>
getLastCompanyName
();
void
setCompanyRedisInfo
(
String
unitName
,
String
unitAddr
,
String
phone
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TProveApplyServiceImpl.java
View file @
71a3aa2c
...
...
@@ -5,13 +5,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCompanyInfo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TProveApplyMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TProveApplyService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil
;
import
com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser
;
import
com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,7 +30,8 @@ import java.util.List;
*/
@Service
public
class
TProveApplyServiceImpl
extends
ServiceImpl
<
TProveApplyMapper
,
TProveApply
>
implements
TProveApplyService
{
@Autowired
private
RedisUtil
redisUtil
;
@Autowired
private
TAttaInfoService
tAttaInfoService
;
...
...
@@ -79,5 +83,30 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv
return
R
.
ok
(
"操作成功!"
);
}
@Override
public
R
<
TCompanyInfo
>
getLastCompanyName
()
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
Common
.
isEmpty
(
user
)){
return
R
.
failed
(
CommonConstants
.
USER_FAIL
);
}
String
userKey
=
CacheConstants
.
WXHR_LAST_SELECT_COMPANY_NAME
+
"_"
+
user
.
getId
();
Object
info
=
redisUtil
.
get
(
userKey
);
if
(
Common
.
isEmpty
(
info
)){
return
R
.
ok
(
null
);
}
return
R
.
ok
((
TCompanyInfo
)
info
);
}
@Override
public
void
setCompanyRedisInfo
(
String
unitName
,
String
unitAddr
,
String
phone
)
{
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(!
Common
.
isEmpty
(
user
)){
String
userKey
=
CacheConstants
.
WXHR_LAST_SELECT_COMPANY_NAME
+
"_"
+
user
.
getId
();
TCompanyInfo
info
=
new
TCompanyInfo
();
info
.
setCompanyName
(
unitName
);
info
.
setCompanyTel
(
phone
);
info
.
setCompanyAddress
(
unitAddr
);
redisUtil
.
set
(
userKey
,
info
);
}
}
}
yifu-archives/yifu-archives-biz/src/main/resources/mapper/TCompanyInfoMapper.xml
View file @
71a3aa2c
...
...
@@ -53,7 +53,7 @@
AND a.id = #{tCompanyInfo.id}
</if>
<if
test=
"tCompanyInfo.companyName != null and tCompanyInfo.companyName.trim() != ''"
>
AND a.COMPANY_NAME
= #{tCompanyInfo.companyName}
AND a.COMPANY_NAME
like CONCAT('%',#{tCompanyInfo.companyName},'%')
</if>
<if
test=
"tCompanyInfo.companyAddress != null and tCompanyInfo.companyAddress.trim() != ''"
>
AND a.COMPANY_ADDRESS = #{tCompanyInfo.companyAddress}
...
...
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/constant/CacheConstants.java
View file @
71a3aa2c
...
...
@@ -165,4 +165,9 @@ public interface CacheConstants {
String
FUND_IMPORT_HANDLE_LOCK
=
"fund_import_handle_handle_lock"
;
public
static
final
String
WX_ACCOSS_TOKEN
=
"WX_ACCOSS_TOKEN"
;
/**
* 登录用户最近一次选择的收入证明单位名称
*/
public
static
final
String
WXHR_LAST_SELECT_COMPANY_NAME
=
"wxhr_last_select_company_name"
;
}
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