Commit 18143da9 authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents 363afc19 b1ed3760
...@@ -130,6 +130,12 @@ public interface CommonConstants { ...@@ -130,6 +130,12 @@ public interface CommonConstants {
String THIRTEEN_STRING = "13"; String THIRTEEN_STRING = "13";
String FOURTEEN_STRING = "14";
String FIFTEEN_STRING = "15";
String SIXTEEN_STRING = "16";
/** /**
* number 0 * number 0
*/ */
......
...@@ -45,4 +45,10 @@ public class InsuranceExportListParam implements Serializable { ...@@ -45,4 +45,10 @@ public class InsuranceExportListParam implements Serializable {
*/ */
@Schema(description = "商险id集合") @Schema(description = "商险id集合")
private List<String> idList; private List<String> idList;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
} }
...@@ -63,4 +63,10 @@ public class InsuranceListParam implements Serializable { ...@@ -63,4 +63,10 @@ public class InsuranceListParam implements Serializable {
*/ */
@Schema(description = "项目编码列表") @Schema(description = "项目编码列表")
private List<String> deptNoList; private List<String> deptNoList;
/**
* 办理地分流sql
*/
@Schema(description = "办理地分流sql")
private String regionSql;
} }
...@@ -76,6 +76,19 @@ public class TInsuranceDetailController { ...@@ -76,6 +76,19 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getInsuranceHandleListPage(page, param)); 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 { ...@@ -103,18 +116,7 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getInsuranceList(param)); 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 ...@@ -228,6 +228,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param) { public IPage<InsuranceListVO> getInsuranceHandleListPage(Page<InsuranceListVO> page, InsuranceListParam param) {
//todo 根据登录人获取数据权限 //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); IPage<InsuranceListVO> insuranceList = baseMapper.getInsuranceHandleListPage(page,param);
//根据项目编码获取项目名称 //根据项目编码获取项目名称
setProjectNameByDeptNo(insuranceList.getRecords()); setProjectNameByDeptNo(insuranceList.getRecords());
...@@ -249,6 +256,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -249,6 +256,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public List<InsuranceListVO> getInsuranceHandleList(InsuranceListParam param) { public List<InsuranceListVO> getInsuranceHandleList(InsuranceListParam param) {
YifuUser user = SecurityUtils.getUser();
String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL);
//todo 根据登录人获取数据权限 //todo 根据登录人获取数据权限
List<InsuranceListVO> insuranceList = baseMapper.getInsuranceHandleList(param); List<InsuranceListVO> insuranceList = baseMapper.getInsuranceHandleList(param);
//根据项目编码获取项目名称 //根据项目编码获取项目名称
...@@ -769,9 +779,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -769,9 +779,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public List<InsuranceExportListVO> getInsuranceExportList(InsuranceExportListParam param) { public List<InsuranceExportListVO> getInsuranceExportList(InsuranceExportListParam param) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<InsuranceExportListVO> insuranceExportList; List<InsuranceExportListVO> insuranceExportList = new ArrayList<>();
//todo 根据登录人获取数据权限 //todo 根据登录人获取数据权限
String regionSQL = getRegionSQL(user);
param.setRegionSql(regionSQL);
if(StringUtils.isBlank(regionSQL)){
return insuranceExportList;
}
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集 //如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){ if (CollectionUtils.isNotEmpty(param.getIdList())){
insuranceExportList = baseMapper.getInsuranceExportListBySelect(param.getIdList()); insuranceExportList = baseMapper.getInsuranceExportListBySelect(param.getIdList());
...@@ -2721,6 +2735,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2721,6 +2735,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param) { 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); List<InsuranceRefundListVo> insuranceRefundList = this.baseMapper.getInsuranceRefundList(param);
if (CollectionUtils.isNotEmpty(insuranceRefundList)){ if (CollectionUtils.isNotEmpty(insuranceRefundList)){
//根据项目编码获取项目名称 //根据项目编码获取项目名称
...@@ -3533,11 +3550,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3533,11 +3550,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo )
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)) .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); List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){ if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY); param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
...@@ -3801,12 +3822,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3801,12 +3822,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//必填格式校通过后查询对应的保单信息 //必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName ) .eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo )
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ) .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); List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){ if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY); param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
...@@ -4032,12 +4057,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4032,12 +4057,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//必填格式校通过后查询对应的保单信息 //必填格式校通过后查询对应的保单信息
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT).eq(TInsuranceDetail ::getEmpName,empName ) queryWrapper.eq(TInsuranceDetail :: getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ).eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName ) .eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard).eq(TInsuranceDetail::getDeptNo,oldDeptNo) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo )
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName )
.eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail::getDeptNo,oldDeptNo)
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)) .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); List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){ if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY); param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
...@@ -4293,7 +4323,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4293,7 +4323,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
public String getRegionSQL(YifuUser user){ 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; return sql;
} }
......
...@@ -168,6 +168,9 @@ ...@@ -168,6 +168,9 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="param.regionSql != null and param.regionSql.trim() != ''">
and ${param.regionSql}
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
...@@ -272,6 +275,7 @@ ...@@ -272,6 +275,7 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
<select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO"> <select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO">
...@@ -348,7 +352,7 @@ ...@@ -348,7 +352,7 @@
</foreach> </foreach>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
<!--出办理非勾选查询结果-->
<select id="getInsuranceExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO"> <select id="getInsuranceExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO">
select detail.id as id, select detail.id as id,
detail.DEPT_NO as deptNo, detail.DEPT_NO as deptNo,
...@@ -385,6 +389,9 @@ ...@@ -385,6 +389,9 @@
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''"> <if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%') and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.regionSql != null and param.regionSql.trim() != ''">
and ${param.regionSql}
</if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </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