Commit e50ed5c9 authored by fangxinjiang's avatar fangxinjiang

EKP 权限-- 配置文件

parent abe0b70b
...@@ -216,7 +216,7 @@ public class SalaryProveController { ...@@ -216,7 +216,7 @@ public class SalaryProveController {
return R.failed("参数出错!"); return R.failed("参数出错!");
} }
// 存储最近一次选择的档案信息 // 存储最近一次选择的档案信息
tProveApplyService.setCompanyRedisInfo(record.getUnitName()); tProveApplyService.setCompanyRedisInfo(record.getUnitName(),record.getUnitAddr(),record.getPhone());
return R.ok(record); return R.ok(record);
} }
...@@ -436,7 +436,7 @@ public class SalaryProveController { ...@@ -436,7 +436,7 @@ public class SalaryProveController {
* @date 2023-08-23 17:31:05 * @date 2023-08-23 17:31:05
**/ **/
@GetMapping("/getLastCompanyName") @GetMapping("/getLastCompanyName")
public R<String> getLastCompanyName() { public R<TCompanyInfo> getLastCompanyName() {
return tProveApplyService.getLastCompanyName(); return tProveApplyService.getLastCompanyName();
} }
} }
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; 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.archives.entity.TProveApply;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
...@@ -23,7 +24,7 @@ public interface TProveApplyService extends IService<TProveApply> { ...@@ -23,7 +24,7 @@ public interface TProveApplyService extends IService<TProveApply> {
R<String> validSave(TProveApply proveApply, String[] attaIdArray); 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; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.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.entity.TProveApply;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TProveApplyMapper; 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.TAttaInfoService;
...@@ -83,25 +84,29 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv ...@@ -83,25 +84,29 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv
} }
@Override @Override
public R<String> getLastCompanyName() { public R<TCompanyInfo> getLastCompanyName() {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){ if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL); return R.failed(CommonConstants.USER_FAIL);
} }
String userKey = CacheConstants.WXHR_LAST_SELECT_COMPANY_NAME + "_" + user.getId(); String userKey = CacheConstants.WXHR_LAST_SELECT_COMPANY_NAME + "_" + user.getId();
Object companyName = redisUtil.get(userKey); Object info = redisUtil.get(userKey);
if(Common.isEmpty(companyName)){ if(Common.isEmpty(info)){
return R.ok(CommonConstants.EMPTY_STRING); return R.ok(null);
} }
return R.ok(companyName.toString()); return R.ok((TCompanyInfo)info);
} }
@Override @Override
public void setCompanyRedisInfo(String unitName) { public void setCompanyRedisInfo(String unitName, String unitAddr, String phone) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (!Common.isEmpty(user)){ if (!Common.isEmpty(user)){
String userKey = CacheConstants.WXHR_LAST_SELECT_COMPANY_NAME + "_" + user.getId(); 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 @@ ...@@ -53,7 +53,7 @@
AND a.id = #{tCompanyInfo.id} AND a.id = #{tCompanyInfo.id}
</if> </if>
<if test="tCompanyInfo.companyName != null and tCompanyInfo.companyName.trim() != ''"> <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>
<if test="tCompanyInfo.companyAddress != null and tCompanyInfo.companyAddress.trim() != ''"> <if test="tCompanyInfo.companyAddress != null and tCompanyInfo.companyAddress.trim() != ''">
AND a.COMPANY_ADDRESS = #{tCompanyInfo.companyAddress} 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