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