|
|
@@ -39,16 +39,38 @@ public class ReportSearchConfigurationServiceImpl extends ServiceImpl<ReportSear
|
|
|
@Override
|
|
|
public List<ReportSearchConfigurationDto> getSearchConfigurationList(String userId,String routerKey) {
|
|
|
List<ReportSearchConfigurationDto> list = this.getBaseMapper().getSearchConfigurationList(routerKey);
|
|
|
- if(list!=null && !list.isEmpty()){
|
|
|
+ setParamList(userId, list);
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2025/9/19 11:12
|
|
|
+ * @Description: 设置参数信息
|
|
|
+ */
|
|
|
+ private void setParamList(String userId, List<ReportSearchConfigurationDto> list) {
|
|
|
+ if(list !=null && !list.isEmpty()){
|
|
|
for (ReportSearchConfigurationDto reportSearchConfigurationDto : list) {
|
|
|
+ //赋值多选框
|
|
|
+ if("2".equals(reportSearchConfigurationDto.getSelectType())){
|
|
|
+ reportSearchConfigurationDto.setInputType("select-multiple");
|
|
|
+ }
|
|
|
if(StringUtils.isNotBlank(reportSearchConfigurationDto.getSearchSql())){
|
|
|
//通过配置的sql查询具体的对象
|
|
|
- List<?> searchConfigurationList = getSearchConfigurationList(userId, reportSearchConfigurationDto.getSearchSql(), reportSearchConfigurationDto.getSearchKey(), reportSearchConfigurationDto.getShowType());
|
|
|
- reportSearchConfigurationDto.setList(searchConfigurationList);
|
|
|
+ List<?> searchConfigurationList = getSearchConfigurationList(userId, reportSearchConfigurationDto.getSearchSql(), reportSearchConfigurationDto.getKey(), reportSearchConfigurationDto.getInputType());
|
|
|
+ reportSearchConfigurationDto.setListOption(searchConfigurationList);
|
|
|
+ }
|
|
|
+ //单选、多选赋值默认值和选中值
|
|
|
+ if("select-single".equals(reportSearchConfigurationDto.getInputType()) || "select-multiple".equals(reportSearchConfigurationDto.getInputType())){
|
|
|
+ reportSearchConfigurationDto.setDefaultValue("0");
|
|
|
+ reportSearchConfigurationDto.setSelectValue("全部");
|
|
|
+ }
|
|
|
+ //保险公司添加
|
|
|
+ if("select-single".equals(reportSearchConfigurationDto.getInputType()) && reportSearchConfigurationDto.getKey().equals(SearchKeyCodeEnum.SEARCHKEY_COMPANYID.getCode())){
|
|
|
+ reportSearchConfigurationDto.setIsFirst(true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return list;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -59,20 +81,21 @@ public class ReportSearchConfigurationServiceImpl extends ServiceImpl<ReportSear
|
|
|
*/
|
|
|
public List<?> getSearchConfigurationList(String userId,String sqlType,String searchKey,String showType) {
|
|
|
// 查询字典列表
|
|
|
- if("select".equals(showType) && SearchKeyCodeEnum.getSearchKeyCode(searchKey)!=null && StringUtils.isNotBlank(SearchKeyCodeEnum.getSearchKeyCode(searchKey).getDistCode()) && "dictSql".equals(sqlType) ){
|
|
|
+ if(("select-single".equals(showType) || " select-multiple".equals(showType) ) && SearchKeyCodeEnum.getSearchKeyCode(searchKey)!=null && StringUtils.isNotBlank(SearchKeyCodeEnum.getSearchKeyCode(searchKey).getDistCode()) && "dictSql".equals(sqlType) ){
|
|
|
String distCode = SearchKeyCodeEnum.getSearchKeyCode(searchKey).getDistCode();
|
|
|
- return this.getBaseMapper().selectDictListByCode(distCode);
|
|
|
+ List<ReportDictDto> reportDictDtos = this.getBaseMapper().selectDictListByCode(distCode);
|
|
|
+ return reportDictDtos;
|
|
|
}
|
|
|
//查询用户配置的查询保险公司
|
|
|
- if("select".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_COMPANYID.getCode())){
|
|
|
+ if("select-single".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_COMPANYID.getCode())){
|
|
|
return queryCompanyListByUserId(userId);
|
|
|
}
|
|
|
//查询用户配置的出单机构
|
|
|
- if("tree".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_ORGIDS.getCode())){
|
|
|
+ if("date-tree".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_ORGIDS.getCode())){
|
|
|
return getDeptTree(userId);
|
|
|
}
|
|
|
//查询所有的省
|
|
|
- if("areaSelect".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_AREACODES.getCode())){
|
|
|
+ if("date-cascader".equals(showType) && searchKey.equals(SearchKeyCodeEnum.SEARCHKEY_AREACODES.getCode())){
|
|
|
return querySysAreaList();
|
|
|
}
|
|
|
//查询 合作保险公司 单独写
|
|
|
@@ -144,6 +167,12 @@ public class ReportSearchConfigurationServiceImpl extends ServiceImpl<ReportSear
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ReportDictDto> getUserManageListByUserId(String userId) {
|
|
|
+ //先查租户是最上级
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
@@ -151,18 +180,19 @@ public class ReportSearchConfigurationServiceImpl extends ServiceImpl<ReportSear
|
|
|
@Override
|
|
|
public List<ReportSearchConfigurationDto> getSearchDefaultList(String userId, String routerKey) {
|
|
|
List<ReportSearchConfigurationDto> list = this.getBaseMapper().getSearchDefaultList(routerKey);
|
|
|
- if(list!=null && !list.isEmpty()){
|
|
|
- for (ReportSearchConfigurationDto reportSearchConfigurationDto : list) {
|
|
|
- if(StringUtils.isNotBlank(reportSearchConfigurationDto.getSearchSql())){
|
|
|
- //通过配置的sql查询具体的对象
|
|
|
- List<?> searchConfigurationList = getSearchConfigurationList(userId, reportSearchConfigurationDto.getSearchSql(), reportSearchConfigurationDto.getSearchKey(), reportSearchConfigurationDto.getShowType());
|
|
|
- reportSearchConfigurationDto.setList(searchConfigurationList);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ setParamList(userId, list);
|
|
|
return list;
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * @version
|
|
|
+ * @author: hxl
|
|
|
+ * @Date: 2025/9/19 16:01
|
|
|
+ * @Description: 用户id
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String getUserIdByUserName(String userId){
|
|
|
+ return this.getBaseMapper().getUserIdByUserName(userId);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|