Commit fa77967d authored by fangxinjiang's avatar fangxinjiang

权限配置页面

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