Commit b1ed3760 authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:新增投保办理权限认证和获取唯一性的排序规则"

See merge request fangxinjiang/yifu!141
parents 29668d7c 5b5d668d
......@@ -130,6 +130,12 @@ public interface CommonConstants {
String THIRTEEN_STRING = "13";
String FOURTEEN_STRING = "14";
String FIFTEEN_STRING = "15";
String SIXTEEN_STRING = "16";
/**
* number 0
*/
......
......@@ -45,4 +45,10 @@ public class InsuranceExportListParam implements Serializable {
*/
@Schema(description = "商险id集合")
private List<String> idList;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
}
......@@ -63,4 +63,10 @@ public class InsuranceListParam implements Serializable {
*/
@Schema(description = "项目编码列表")
private List<String> deptNoList;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
}
......@@ -76,6 +76,19 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getInsuranceHandleListPage(page, param));
}
/**
* 投保办理不分页查询
*
* @author licancan
* @param param
* @return {@link R<List<InsuranceListVO>>}
*/
@Operation(summary = "投保办理不分页查询", description = "投保办理不分页查询")
@PostMapping("/getInsuranceHandleList")
public R<List<InsuranceListVO>> getInsuranceHandleList(@RequestBody InsuranceListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceHandleList(param));
}
/**
* 投保分页查询
*
......@@ -103,18 +116,7 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getInsuranceList(param));
}
/**
* 投保办理不分页查询
*
* @author licancan
* @param param
* @return {@link R<List<InsuranceListVO>>}
*/
@Operation(summary = "投保办理不分页查询", description = "投保办理不分页查询")
@PostMapping("/getInsuranceHandleList")
public R<List<InsuranceListVO>> getInsuranceHandleList(@RequestBody InsuranceListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceHandleList(param));
}
/**
* 商险新增
......
......@@ -228,6 +228,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
public IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param) {
//todo 根据登录人获取数据权限
IPage<InsuranceListVO> iPage = new Page<>();
YifuUser user = SecurityUtils.getUser();
String regionSQL = getRegionSQL(user);
if (StringUtils.isBlank(regionSQL)){
return iPage;
}
param.setRegionSql(regionSQL);
IPage<InsuranceListVO> insuranceList = baseMapper.getInsuranceHandleListPage(page,param);
//根据项目编码获取项目名称
setProjectNameByDeptNo(insuranceList.getRecords());
......@@ -249,6 +256,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public List<InsuranceListVO> getInsuranceHandleList(InsuranceListParam param) {
YifuUser user = SecurityUtils.getUser();
String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL);
//todo 根据登录人获取数据权限
List<InsuranceListVO> insuranceList = baseMapper.getInsuranceHandleList(param);
//根据项目编码获取项目名称
......@@ -757,9 +767,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
public List<InsuranceExportListVO> getInsuranceExportList(InsuranceExportListParam param) {
YifuUser user = SecurityUtils.getUser();
List<InsuranceExportListVO> insuranceExportList;
List<InsuranceExportListVO> insuranceExportList = new ArrayList<>();
//todo 根据登录人获取数据权限
String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL);
if(StringUtils.isBlank(regionSQL)){
return insuranceExportList;
}
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){
insuranceExportList = baseMapper.getInsuranceExportListBySelect(param.getIdList());
......@@ -2683,6 +2697,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param) {
YifuUser user = SecurityUtils.getUser();
List<String> deptNoList = getDeptNoList(user);
param.setDeptNoList(deptNoList);
List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){
//根据项目编码获取项目名称
......@@ -3495,11 +3512,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo )
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)).last(CommonConstants.LAST_ONE_SQL);
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......@@ -3763,12 +3784,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo )
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) )
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)).last(CommonConstants.LAST_ONE_SQL);
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......@@ -3994,12 +4019,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo)
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)).last(CommonConstants.LAST_ONE_SQL);
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......@@ -4255,7 +4285,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
public String getRegionSQL(YifuUser user){
String sql = "detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)";
String id = user.getId();
String sql ;
//user_id=14, 合肥办理1
//user_id=15,合肥办理2
//user_id=16,上海办理
if(CommonConstants.FOURTEEN_STRING.equals(id)){
sql = "detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)";
}else if(CommonConstants.FIFTEEN_STRING.equals(id)){
sql = "detail.INSURANCE_HANDLE_PROVINCE in (12) and detail.INSURANCE_HANDLE_CITY in (135)";
}else if(CommonConstants.SIXTEEN_STRING.equals(id)){
sql = "detail.INSURANCE_HANDLE_PROVINCE in (9) and detail.INSURANCE_HANDLE_CITY in (109)";
}else{
sql = "detail.INSURANCE_HANDLE_PROVINCE in (12,9) and detail.INSURANCE_HANDLE_CITY in (135,109)";
}
return sql;
}
......
......@@ -168,6 +168,9 @@
#{item}
</foreach>
</if>
<if test="param.regionSql != null and param.regionSql.trim() != ''">
and ${param.regionSql}
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
......@@ -272,6 +275,7 @@
#{item}
</foreach>
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO">
......@@ -348,7 +352,7 @@
</foreach>
ORDER BY detail.CREATE_TIME DESC
</select>
<!--出办理非勾选查询结果-->
<select id="getInsuranceExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO">
select detail.id as id,
detail.DEPT_NO as deptNo,
......@@ -385,6 +389,9 @@
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.regionSql != null and param.regionSql.trim() != ''">
and ${param.regionSql}
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
......
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