Commit fa77967d authored by fangxinjiang's avatar fangxinjiang

权限配置页面

parent ad6156ad
...@@ -127,6 +127,8 @@ public class TEmployeeContractAreaResController { ...@@ -127,6 +127,8 @@ public class TEmployeeContractAreaResController {
if (Common.isNotNull(res)){ if (Common.isNotNull(res)){
return R.failed("已存在对应审核人及地市配置!"); return R.failed("已存在对应审核人及地市配置!");
} }
// 清理缓存
tEmployeeContractAreaResService.removeAuthCache();
return R.ok(tEmployeeContractAreaResService.save(areaRes)); return R.ok(tEmployeeContractAreaResService.save(areaRes));
} }
...@@ -162,6 +164,8 @@ public class TEmployeeContractAreaResController { ...@@ -162,6 +164,8 @@ public class TEmployeeContractAreaResController {
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
areaRes.setStatus(status); areaRes.setStatus(status);
// 清理缓存
tEmployeeContractAreaResService.removeAuthCache();
return R.ok(tEmployeeContractAreaResService.updateById(areaRes)); return R.ok(tEmployeeContractAreaResService.updateById(areaRes));
} }
/** /**
...@@ -175,6 +179,8 @@ public class TEmployeeContractAreaResController { ...@@ -175,6 +179,8 @@ public class TEmployeeContractAreaResController {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('temployeecontractareares_del')") @PreAuthorize("@pms.hasPermission('temployeecontractareares_del')")
public R<Boolean> removeById(@PathVariable String id) { public R<Boolean> removeById(@PathVariable String id) {
// 清理缓存
tEmployeeContractAreaResService.removeAuthCache();
return R.ok(tEmployeeContractAreaResService.removeById(id)); return R.ok(tEmployeeContractAreaResService.removeById(id));
} }
......
...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo; ...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; 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.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
...@@ -53,4 +54,6 @@ public interface TEmployeeContractAreaResService extends IService<TEmployeeContr ...@@ -53,4 +54,6 @@ public interface TEmployeeContractAreaResService extends IService<TEmployeeContr
R<List<ErrorMessage>> importDiy(InputStream inputStream); R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TEmployeeContractAreaResSearchVo searchVo); void listExport(HttpServletResponse response, TEmployeeContractAreaResSearchVo searchVo);
void removeAuthCache();
} }
...@@ -33,9 +33,12 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAreaResServ ...@@ -33,9 +33,12 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractAreaResServ
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpContractAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractAreaResVo;
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.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -55,6 +58,9 @@ import java.util.List; ...@@ -55,6 +58,9 @@ import java.util.List;
@Log4j2 @Log4j2
@Service @Service
public class TEmployeeContractAreaResServiceImpl extends ServiceImpl<TEmployeeContractAreaResMapper, TEmployeeContractAreaRes> implements TEmployeeContractAreaResService { public class TEmployeeContractAreaResServiceImpl extends ServiceImpl<TEmployeeContractAreaResMapper, TEmployeeContractAreaRes> implements TEmployeeContractAreaResService {
@Autowired
private RedisUtil redisUtil;
/** /**
* 合同地市权限配置表简单分页查询 * 合同地市权限配置表简单分页查询
* *
...@@ -227,4 +233,21 @@ public class TEmployeeContractAreaResServiceImpl extends ServiceImpl<TEmployeeCo ...@@ -227,4 +233,21 @@ public class TEmployeeContractAreaResServiceImpl extends ServiceImpl<TEmployeeCo
BeanUtil.copyProperties(excel, insert); BeanUtil.copyProperties(excel, insert);
this.save(insert); this.save(insert);
} }
/**
* @Author fxj
* @Description 清除项目缓存
* @Date 17:08 2022/7/11
* @Param
* @return
**/
@Override
public void removeAuthCache() {
try{
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ONE_STRING);
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ZERO_STRING);
} catch (Exception e) {
log.error("清除权限配置缓存错误:",e);
}
}
} }
...@@ -1100,9 +1100,6 @@ public class ExcelUtil <T> implements Serializable { ...@@ -1100,9 +1100,6 @@ public class ExcelUtil <T> implements Serializable {
field.set(vo, Common.isNotNull(value)?value:field.get(vo)); field.set(vo, Common.isNotNull(value)?value:field.get(vo));
}catch (Exception e){ }catch (Exception e){
log.error("字典数据解析异常"); log.error("字典数据解析异常");
}finally {
fields.clear();
allField.clear();
} }
} }
} }
......
...@@ -124,6 +124,8 @@ public class TInsuranceAreaResController { ...@@ -124,6 +124,8 @@ public class TInsuranceAreaResController {
if (Common.isNotNull(res)){ if (Common.isNotNull(res)){
return R.failed("已存在对应审核人及地市配置!"); return R.failed("已存在对应审核人及地市配置!");
} }
// 清理缓存
tInsuranceAreaResService.removeAuthCache();
return R.ok(tInsuranceAreaResService.save(areaRes)); return R.ok(tInsuranceAreaResService.save(areaRes));
} }
...@@ -152,6 +154,8 @@ public class TInsuranceAreaResController { ...@@ -152,6 +154,8 @@ public class TInsuranceAreaResController {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('tinsuranceareares_del')") @PreAuthorize("@pms.hasPermission('tinsuranceareares_del')")
public R<Boolean> removeById(@PathVariable String id) { public R<Boolean> removeById(@PathVariable String id) {
// 清理缓存
tInsuranceAreaResService.removeAuthCache();
return R.ok(tInsuranceAreaResService.removeById(id)); return R.ok(tInsuranceAreaResService.removeById(id));
} }
...@@ -174,6 +178,8 @@ public class TInsuranceAreaResController { ...@@ -174,6 +178,8 @@ public class TInsuranceAreaResController {
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
areaRes.setStatus(status); areaRes.setStatus(status);
// 清理缓存
tInsuranceAreaResService.removeAuthCache();
return R.ok(tInsuranceAreaResService.updateById(areaRes)); return R.ok(tInsuranceAreaResService.updateById(areaRes));
} }
......
...@@ -53,4 +53,6 @@ public interface TInsuranceAreaResService extends IService<TInsuranceAreaRes> { ...@@ -53,4 +53,6 @@ public interface TInsuranceAreaResService extends IService<TInsuranceAreaRes> {
R<List<ErrorMessage>> importDiy(InputStream inputStream); R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TInsuranceAreaResSearchVo searchVo); void listExport(HttpServletResponse response, TInsuranceAreaResSearchVo searchVo);
void removeAuthCache();
} }
...@@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; 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.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.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAreaRes;
...@@ -39,6 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo; ...@@ -39,6 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaExportVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAreaResVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -57,7 +59,10 @@ import java.util.List; ...@@ -57,7 +59,10 @@ import java.util.List;
@Log4j2 @Log4j2
@Service @Service
public class TInsuranceAreaResServiceImpl extends ServiceImpl<TInsuranceAreaResMapper, TInsuranceAreaRes> implements TInsuranceAreaResService { public class TInsuranceAreaResServiceImpl extends ServiceImpl<TInsuranceAreaResMapper, TInsuranceAreaRes> implements TInsuranceAreaResService {
/**
@Autowired
private RedisUtil redisUtil;
/**
* 商险地市权限配置表简单分页查询 * 商险地市权限配置表简单分页查询
* @param tInsuranceAreaRes 商险地市权限配置表 * @param tInsuranceAreaRes 商险地市权限配置表
* @return * @return
...@@ -132,7 +137,17 @@ public class TInsuranceAreaResServiceImpl extends ServiceImpl<TInsuranceAreaResM ...@@ -132,7 +137,17 @@ public class TInsuranceAreaResServiceImpl extends ServiceImpl<TInsuranceAreaResM
} }
} }
@Override @Override
public void removeAuthCache() {
try{
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ONE_STRING);
redisUtil.remove(CacheConstants.DATA_AUTH_DETAILS + CommonConstants.ZERO_STRING);
} catch (Exception e) {
log.error("清除权限配置缓存错误:",e);
}
}
@Override
public List<TInsuranceAreaExportVo> noPageDiy(TInsuranceAreaResSearchVo searchVo, public List<TInsuranceAreaExportVo> noPageDiy(TInsuranceAreaResSearchVo searchVo,
List<String> settleDomainIds, List<String> settleDomainIds,
List<String> ids, List<String> ids,
......
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