Commit 77652ce1 authored by fangxinjiang's avatar fangxinjiang

HRO 收入证明 客户资料

parent 56221aab
...@@ -215,6 +215,8 @@ public class SalaryProveController { ...@@ -215,6 +215,8 @@ public class SalaryProveController {
} else { } else {
return R.failed("参数出错!"); return R.failed("参数出错!");
} }
// 存储最近一次选择的档案信息
tProveApplyService.setCompanyRedisInfo(record.getUnitName());
return R.ok(record); return R.ok(record);
} }
...@@ -427,4 +429,14 @@ public class SalaryProveController { ...@@ -427,4 +429,14 @@ public class SalaryProveController {
return R.failed("无此证明记录!"); return R.failed("无此证明记录!");
} }
} }
/**
* 获取最近一次选择的客户名称
*
* @author fxj
* @date 2023-08-23 17:31:05
**/
@GetMapping
public R<String> getLastCompanyName() {
return tProveApplyService.getLastCompanyName();
}
} }
...@@ -23,4 +23,7 @@ public interface TProveApplyService extends IService<TProveApply> { ...@@ -23,4 +23,7 @@ public interface TProveApplyService extends IService<TProveApply> {
R<String> validSave(TProveApply proveApply, String[] attaIdArray); R<String> validSave(TProveApply proveApply, String[] attaIdArray);
R<String> getLastCompanyName();
void setCompanyRedisInfo(String unitName);
} }
...@@ -9,9 +9,11 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TProveApply; ...@@ -9,9 +9,11 @@ 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;
import com.yifu.cloud.plus.v1.yifu.archives.service.TProveApplyService; 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.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; 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.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.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,7 +29,8 @@ import java.util.List; ...@@ -27,7 +29,8 @@ import java.util.List;
*/ */
@Service @Service
public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProveApply> implements TProveApplyService { public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProveApply> implements TProveApplyService {
@Autowired
private RedisUtil redisUtil;
@Autowired @Autowired
private TAttaInfoService tAttaInfoService; private TAttaInfoService tAttaInfoService;
...@@ -79,5 +82,26 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv ...@@ -79,5 +82,26 @@ public class TProveApplyServiceImpl extends ServiceImpl<TProveApplyMapper, TProv
return R.ok("操作成功!"); return R.ok("操作成功!");
} }
@Override
public R<String> 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);
}
return R.ok(companyName.toString());
}
@Override
public void setCompanyRedisInfo(String unitName) {
YifuUser user = SecurityUtils.getUser();
if (!Common.isEmpty(user)){
String userKey = CacheConstants.WXHR_LAST_SELECT_COMPANY_NAME + "_" + user.getId();
redisUtil.set(userKey,unitName);
}
}
} }
...@@ -165,4 +165,9 @@ public interface CacheConstants { ...@@ -165,4 +165,9 @@ public interface CacheConstants {
String FUND_IMPORT_HANDLE_LOCK = "fund_import_handle_handle_lock"; String FUND_IMPORT_HANDLE_LOCK = "fund_import_handle_handle_lock";
public static final String WX_ACCOSS_TOKEN = "WX_ACCOSS_TOKEN"; public static final String WX_ACCOSS_TOKEN = "WX_ACCOSS_TOKEN";
/**
* 登录用户最近一次选择的收入证明单位名称
*/
public static final String WXHR_LAST_SELECT_COMPANY_NAME = "wxhr_last_select_company_name";
} }
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