Commit e50ed5c9 authored by fangxinjiang's avatar fangxinjiang

EKP 权限-- 配置文件

parent abe0b70b
......@@ -216,7 +216,7 @@ public class SalaryProveController {
return R.failed("参数出错!");
}
// 存储最近一次选择的档案信息
tProveApplyService.setCompanyRedisInfo(record.getUnitName());
tProveApplyService.setCompanyRedisInfo(record.getUnitName(),record.getUnitAddr(),record.getPhone());
return R.ok(record);
}
......@@ -436,7 +436,7 @@ public class SalaryProveController {
* @date 2023-08-23 17:31:05
**/
@GetMapping("/getLastCompanyName")
public R<String> getLastCompanyName() {
public R<TCompanyInfo> getLastCompanyName() {
return tProveApplyService.getLastCompanyName();
}
}
......@@ -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,7 +24,7 @@ public interface TProveApplyService extends IService<TProveApply> {
R<String> validSave(TProveApply proveApply, String[] attaIdArray);
R<String> getLastCompanyName();
R<TCompanyInfo> getLastCompanyName();
void setCompanyRedisInfo(String unitName);
void setCompanyRedisInfo(String unitName, String unitAddr, String phone);
}
......@@ -5,6 +5,7 @@ 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;
......@@ -83,25 +84,29 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv
}
@Override
public R<String> getLastCompanyName() {
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 companyName = redisUtil.get(userKey);
if(Common.isEmpty(companyName)){
return R.ok(CommonConstants.EMPTY_STRING);
Object info = redisUtil.get(userKey);
if(Common.isEmpty(info)){
return R.ok(null);
}
return R.ok(companyName.toString());
return R.ok((TCompanyInfo)info);
}
@Override
public void setCompanyRedisInfo(String unitName) {
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();
redisUtil.set(userKey,unitName);
TCompanyInfo info = new TCompanyInfo();
info.setCompanyName(unitName);
info.setCompanyTel(phone);
info.setCompanyAddress(unitAddr);
redisUtil.set(userKey,info);
}
}
}
......@@ -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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment