Browse Source

执法端-非行政查询

dev-V1.0.1
niujiyi 5 months ago
parent
commit
8530a9c72e
  1. 94
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/NonEnforcementRegistrationServiceImpl.java

94
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/NonEnforcementRegistrationServiceImpl.java

@ -15,6 +15,7 @@ import com.zdxt.enforcementcode.mapper.ZdxtFileMapper;
import com.zdxt.enforcementcode.service.INonEnforcementRegistrationService;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.dromara.common.core.enums.FormatsType;
@ -43,6 +44,7 @@ import java.util.stream.Collectors;
* @author kylin
* @date 2025-06-19
*/
@Slf4j
@Service
public class NonEnforcementRegistrationServiceImpl implements INonEnforcementRegistrationService
{
@ -65,33 +67,41 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg
if (nonReg != null && nonReg.getId() != null) {
// 处理主执法人员信息
if (StringUtils.isNotEmpty(nonReg.getLawEnforcerId())) {
SysUserVo user = sysUserMapper.selectUserById(Long.valueOf(nonReg.getLawEnforcerId()));
if (user != null) {
String temp = user.getLawCertificateNum();
if (StringUtils.isEmpty(temp)) {
temp = CommonUtil.encryptPhone(user.getPhonenumber());
try {
SysUserVo user = sysUserMapper.selectUserById(Long.valueOf(nonReg.getLawEnforcerId()));
if (user != null) {
String temp = user.getLawCertificateNum();
if (StringUtils.isEmpty(temp)) {
temp = CommonUtil.encryptPhone(user.getPhonenumber());
}
nonReg.setLawEnforcer(user.getUserName() + " " + temp);
}
nonReg.setLawEnforcer(user.getUserName() + " " + temp);
} catch (NumberFormatException e) {
log.warn("无效的执法人员ID: {}", nonReg.getLawEnforcerId());
}
}
if(StringUtils.isNotEmpty(nonReg.getLawEnforcerOther())){
List<SysUserVo> list = sysUserMapper.selectUserByIds(Convert.toStrArray(nonReg.getLawEnforcerIdOther()));
if(list != null && list.size() != 0){
String tmpUserShow = "";
for (SysUserVo ub : list) {
if (ub != null) {
String t = ub.getLawCertificateNum();
if(StringUtils.isEmpty(t)){
t = CommonUtil.encryptPhone(ub.getPhonenumber());
try {
List<SysUserVo> list = sysUserMapper.selectUserByIds(Convert.toStrArray(nonReg.getLawEnforcerIdOther()));
if(list != null && list.size() != 0){
String tmpUserShow = "";
for (SysUserVo ub : list) {
if (ub != null) {
String t = ub.getLawCertificateNum();
if(StringUtils.isEmpty(t)){
t = CommonUtil.encryptPhone(ub.getPhonenumber());
}
tmpUserShow += ub.getUserName() + " " + t + ",";
}
tmpUserShow += ub.getUserName() + " " + t + ",";
}
if (tmpUserShow.length() > 0) {
tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length() - 1);
}
nonReg.setLawEnforcerOther(tmpUserShow);
}
if (tmpUserShow.length() > 0) {
tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length() - 1);
}
nonReg.setLawEnforcerOther(tmpUserShow);
} catch (NumberFormatException e) {
log.warn("无效的其他执法人员ID: {}", nonReg.getLawEnforcerIdOther());
}
}
@ -252,33 +262,41 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg
list.forEach(li -> {
// 处理主执法人员信息
if (StringUtils.isNotEmpty(li.getLawEnforcerId())) {
SysUserVo sysUserVo = sysUserMapper.selectUserById(Long.valueOf(li.getLawEnforcerId()));
if (sysUserVo != null) {
String lawCN = sysUserVo.getLawCertificateNum();
if (StringUtils.isEmpty(lawCN)) {
lawCN = CommonUtil.encryptPhone(sysUserVo.getPhonenumber());
try {
SysUserVo sysUserVo = sysUserMapper.selectUserById(Long.valueOf(li.getLawEnforcerId()));
if (sysUserVo != null) {
String lawCN = sysUserVo.getLawCertificateNum();
if (StringUtils.isEmpty(lawCN)) {
lawCN = CommonUtil.encryptPhone(sysUserVo.getPhonenumber());
}
li.setLawEnforcer(sysUserVo.getUserName() + " " + lawCN);
} else {
li.setLawEnforcer(li.getLawEnforcer());
}
li.setLawEnforcer(sysUserVo.getUserName() + " " + lawCN);
} else {
li.setLawEnforcer(li.getLawEnforcer());
} catch (NumberFormatException e) {
log.warn("无效的执法人员ID: {}", li.getLawEnforcerId());
}
}
// 处理其他执法人员信息
List<String> lawTwoList = new ArrayList<>();
if (StringUtils.isNotEmpty(li.getLawEnforcerOther()) && StringUtils.isNotEmpty(li.getLawEnforcerIdOther())) {
List<SysUserVo> userBeans = sysUserMapper.selectUserByIds(Convert.toStrArray(li.getLawEnforcerIdOther()));
if (userBeans != null && !userBeans.isEmpty()) {
userBeans.forEach(u -> {
if (u != null) {
String temp = u.getLawCertificateNum();
if (StringUtils.isEmpty(temp)) {
temp = CommonUtil.encryptPhone(u.getPhonenumber());
try {
List<SysUserVo> userBeans = sysUserMapper.selectUserByIds(Convert.toStrArray(li.getLawEnforcerIdOther()));
if (userBeans != null && !userBeans.isEmpty()) {
userBeans.forEach(u -> {
if (u != null) {
String temp = u.getLawCertificateNum();
if (StringUtils.isEmpty(temp)) {
temp = CommonUtil.encryptPhone(u.getPhonenumber());
}
lawTwoList.add(u.getUserName() + " " + temp);
}
lawTwoList.add(u.getUserName() + " " + temp);
}
});
li.setLawEnforcerOtherList(lawTwoList);
});
li.setLawEnforcerOtherList(lawTwoList);
}
} catch (NumberFormatException e) {
log.warn("无效的其他执法人员ID: {}", li.getLawEnforcerIdOther());
}
}
});

Loading…
Cancel
Save