|
|
@ -62,7 +62,7 @@ import java.util.*; |
|
|
@RequestMapping("/app-enf/enfRegistration") |
|
|
@RequestMapping("/app-enf/enfRegistration") |
|
|
public class AppEnforcementRegistrationController extends BaseController { |
|
|
public class AppEnforcementRegistrationController extends BaseController { |
|
|
|
|
|
|
|
|
private final ISysConfigService sysConfigService; |
|
|
|
|
|
private final IEnforcementRegistrationService enforcementRegistrationService; |
|
|
private final IEnforcementRegistrationService enforcementRegistrationService; |
|
|
private final ISysDeptService sysDeptService; |
|
|
private final ISysDeptService sysDeptService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
@ -570,10 +570,6 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
if (list == null || list.isEmpty()) { |
|
|
if (list == null || list.isEmpty()) { |
|
|
return pageResult; |
|
|
return pageResult; |
|
|
} |
|
|
} |
|
|
//todo: 性能测试开启
|
|
|
|
|
|
if(isListFunEnabled()){ |
|
|
|
|
|
return pageResult; |
|
|
|
|
|
} |
|
|
|
|
|
// 1. 批量获取字典数据(只查询一次)
|
|
|
// 1. 批量获取字典数据(只查询一次)
|
|
|
List<SysDictDataVo> dicts = getCheckCategoryDicts(); |
|
|
List<SysDictDataVo> dicts = getCheckCategoryDicts(); |
|
|
Map<String, String> dictMap = buildDictMap(dicts); |
|
|
Map<String, String> dictMap = buildDictMap(dicts); |
|
|
@ -581,6 +577,8 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
// 2. 收集所有用户ID并批量查询(只查询一次)
|
|
|
// 2. 收集所有用户ID并批量查询(只查询一次)
|
|
|
List<Long> allUserIds = collectAllUserIds(list); |
|
|
List<Long> allUserIds = collectAllUserIds(list); |
|
|
Map<Long, SysUserVo> userMap = buildUserMap(allUserIds); |
|
|
Map<Long, SysUserVo> userMap = buildUserMap(allUserIds); |
|
|
|
|
|
// 2.5 按用户预构建展示文本(每人只解密一次,避免跨行重复解密)
|
|
|
|
|
|
Map<Long, String> displayTextMap = buildEnforcerDisplayTextMap(userMap); |
|
|
|
|
|
|
|
|
// 3. 批量查询投诉标记(只查询一次)
|
|
|
// 3. 批量查询投诉标记(只查询一次)
|
|
|
List<String> recordIds = extractRecordIds(list); |
|
|
List<String> recordIds = extractRecordIds(list); |
|
|
@ -590,20 +588,14 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
for (EnforcementRegistrationVo vo : list) { |
|
|
for (EnforcementRegistrationVo vo : list) { |
|
|
fillComplaintFlagFromMap(vo, complaintMap); |
|
|
fillComplaintFlagFromMap(vo, complaintMap); |
|
|
fillCheckCategoryText(vo, dictMap); |
|
|
fillCheckCategoryText(vo, dictMap); |
|
|
fillLawEnforcerInfo(vo, userMap); |
|
|
fillLawEnforcerInfo(vo, displayTextMap); |
|
|
fillOutTimeDayNum(vo); |
|
|
fillOutTimeDayNum(vo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return pageResult; |
|
|
return pageResult; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 校验系统参数 opt.fun 是否开启(1=true=Y 视为开启) |
|
|
|
|
|
*/ |
|
|
|
|
|
private boolean isListFunEnabled() { |
|
|
|
|
|
String value = sysConfigService.selectConfigByKey("list.fun"); |
|
|
|
|
|
return "1".equals(value) || "true".equalsIgnoreCase(value) || "Y".equalsIgnoreCase(value); |
|
|
|
|
|
} |
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取检查类别字典数据 |
|
|
* 获取检查类别字典数据 |
|
|
*/ |
|
|
*/ |
|
|
@ -743,24 +735,23 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
/** |
|
|
/** |
|
|
* 填充执法人员信息 |
|
|
* 填充执法人员信息 |
|
|
*/ |
|
|
*/ |
|
|
private void fillLawEnforcerInfo(EnforcementRegistrationVo vo, Map<Long, SysUserVo> userMap) { |
|
|
private void fillLawEnforcerInfo(EnforcementRegistrationVo vo, Map<Long, String> displayTextMap) { |
|
|
fillLawEnforcer1(vo, userMap); |
|
|
fillLawEnforcer1(vo, displayTextMap); |
|
|
fillLawEnforcer2(vo, userMap); |
|
|
fillLawEnforcer2(vo, displayTextMap); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 填充执法人员1信息 |
|
|
* 填充执法人员1信息 |
|
|
*/ |
|
|
*/ |
|
|
private void fillLawEnforcer1(EnforcementRegistrationVo vo, Map<Long, SysUserVo> userMap) { |
|
|
private void fillLawEnforcer1(EnforcementRegistrationVo vo, Map<Long, String> displayTextMap) { |
|
|
if (StringUtils.isEmpty(vo.getLawEnforcerId())) { |
|
|
if (StringUtils.isEmpty(vo.getLawEnforcerId())) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
Long userId = Long.parseLong(vo.getLawEnforcerId()); |
|
|
Long userId = Long.parseLong(vo.getLawEnforcerId()); |
|
|
SysUserVo user = userMap.get(userId); |
|
|
String displayText = displayTextMap.get(userId); |
|
|
if (user != null) { |
|
|
if (displayText != null) { |
|
|
String lawCN = buildEnforcerDisplayText(user); |
|
|
vo.setLawEnforcer(displayText); |
|
|
vo.setLawEnforcer(lawCN); |
|
|
|
|
|
} |
|
|
} |
|
|
} catch (NumberFormatException ignored) { |
|
|
} catch (NumberFormatException ignored) { |
|
|
} |
|
|
} |
|
|
@ -769,7 +760,7 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
/** |
|
|
/** |
|
|
* 填充执法人员2信息列表 |
|
|
* 填充执法人员2信息列表 |
|
|
*/ |
|
|
*/ |
|
|
private void fillLawEnforcer2(EnforcementRegistrationVo vo, Map<Long, SysUserVo> userMap) { |
|
|
private void fillLawEnforcer2(EnforcementRegistrationVo vo, Map<Long, String> displayTextMap) { |
|
|
List<String> lawTwoList = new ArrayList<>(); |
|
|
List<String> lawTwoList = new ArrayList<>(); |
|
|
if (StringUtils.isEmpty(vo.getLawEnforcerIdTwo())) { |
|
|
if (StringUtils.isEmpty(vo.getLawEnforcerIdTwo())) { |
|
|
vo.setLawEnforcer2List(lawTwoList); |
|
|
vo.setLawEnforcer2List(lawTwoList); |
|
|
@ -783,9 +774,9 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
Long userId = Long.parseLong(id.trim()); |
|
|
Long userId = Long.parseLong(id.trim()); |
|
|
SysUserVo user = userMap.get(userId); |
|
|
String displayText = displayTextMap.get(userId); |
|
|
if (user != null) { |
|
|
if (displayText != null) { |
|
|
lawTwoList.add(buildEnforcerDisplayText(user)); |
|
|
lawTwoList.add(displayText); |
|
|
} |
|
|
} |
|
|
} catch (NumberFormatException ignored) { |
|
|
} catch (NumberFormatException ignored) { |
|
|
} |
|
|
} |
|
|
@ -793,6 +784,21 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
vo.setLawEnforcer2List(lawTwoList); |
|
|
vo.setLawEnforcer2List(lawTwoList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 按用户批量构建执法人员展示文本(用户名 + 执法码/脱敏手机号) |
|
|
|
|
|
* <p>每页每个用户只解密一次,行级填充直接复用。</p> |
|
|
|
|
|
*/ |
|
|
|
|
|
private Map<Long, String> buildEnforcerDisplayTextMap(Map<Long, SysUserVo> userMap) { |
|
|
|
|
|
Map<Long, String> displayTextMap = new HashMap<>(); |
|
|
|
|
|
if (userMap == null || userMap.isEmpty()) { |
|
|
|
|
|
return displayTextMap; |
|
|
|
|
|
} |
|
|
|
|
|
for (Map.Entry<Long, SysUserVo> entry : userMap.entrySet()) { |
|
|
|
|
|
displayTextMap.put(entry.getKey(), buildEnforcerDisplayText(entry.getValue())); |
|
|
|
|
|
} |
|
|
|
|
|
return displayTextMap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 构建执法人员展示文本(用户名 + 执法码/加密手机号) |
|
|
* 构建执法人员展示文本(用户名 + 执法码/加密手机号) |
|
|
*/ |
|
|
*/ |
|
|
|