|
|
|
@ -3,8 +3,10 @@ package com.zdxt.enforcementcode.service.impl; |
|
|
|
import cn.hutool.core.convert.Convert; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.zdxt.enforcementcode.common.annotation.DataScope; |
|
|
|
import com.zdxt.enforcementcode.common.util.CommonUtil; |
|
|
|
import com.zdxt.enforcementcode.domain.NonEnforcementRegistration; |
|
|
|
import com.zdxt.enforcementcode.domain.ZdxtFile; |
|
|
|
import com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo; |
|
|
|
import com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo; |
|
|
|
@ -19,6 +21,8 @@ import org.dromara.common.core.enums.FormatsType; |
|
|
|
import org.dromara.common.core.exception.ServiceException; |
|
|
|
import org.dromara.common.core.utils.DateUtils; |
|
|
|
import org.dromara.common.core.utils.StringUtils; |
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery; |
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
|
import org.dromara.system.domain.vo.SysDictDataVo; |
|
|
|
import org.dromara.system.domain.vo.SysUserVo; |
|
|
|
@ -57,27 +61,35 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg |
|
|
|
@Override |
|
|
|
public NonEnforcementRegistrationVo selectNonEnforcementRegistrationById(String id) |
|
|
|
{ |
|
|
|
NonEnforcementRegistrationVo nonReg = nonEnforcementRegistrationMapper.selectNonEnforcementRegistrationById(id); |
|
|
|
if (nonReg.getId() != null) { |
|
|
|
SysUserVo user = sysUserMapper.selectUserById(Long.valueOf(nonReg.getLawEnforcerId())); |
|
|
|
String temp=user.getLawCertificateNum(); |
|
|
|
if(StringUtils.isEmpty(temp)){ |
|
|
|
temp= CommonUtil.encryptPhone(user.getPhonenumber()); |
|
|
|
NonEnforcementRegistrationVo nonReg = nonEnforcementRegistrationMapper.selectVoById(id); |
|
|
|
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()); |
|
|
|
} |
|
|
|
nonReg.setLawEnforcer(user.getUserName() + " " + temp); |
|
|
|
} |
|
|
|
} |
|
|
|
nonReg.setLawEnforcer(user.getUserName()+" "+temp); |
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(nonReg.getLawEnforcerOther())){ |
|
|
|
List<SysUserVo> list = sysUserMapper.selectUserByIds(Convert.toStrArray(nonReg.getLawEnforcerIdOther())); |
|
|
|
if(list.size()!=0){ |
|
|
|
if(list != null && list.size() != 0){ |
|
|
|
String tmpUserShow = ""; |
|
|
|
for (SysUserVo ub : list) { |
|
|
|
String t = ub.getLawCertificateNum(); |
|
|
|
if(StringUtils.isEmpty(t)){ |
|
|
|
t=CommonUtil.encryptPhone(ub.getPhonenumber()); |
|
|
|
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); |
|
|
|
tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length() - 1); |
|
|
|
} |
|
|
|
nonReg.setLawEnforcerOther(tmpUserShow); |
|
|
|
} |
|
|
|
@ -85,7 +97,7 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg |
|
|
|
|
|
|
|
LambdaQueryWrapper<ZdxtFile> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(ZdxtFile::getBusinessId, nonReg.getId()); |
|
|
|
List<ZdxtFile> zdxtFileCommons=zdxtFileMapper.selectList(queryWrapper); |
|
|
|
List<ZdxtFile> zdxtFileCommons = zdxtFileMapper.selectList(queryWrapper); |
|
|
|
if (zdxtFileCommons.size() > 0) { |
|
|
|
Map<String, Object> params = new HashMap<String, Object>(); |
|
|
|
params.put("fileList", zdxtFileCommons); |
|
|
|
@ -95,6 +107,183 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg |
|
|
|
return nonReg; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 分页查询非行政执法登记列表 |
|
|
|
* |
|
|
|
* @param bo 查询条件 |
|
|
|
* @param pageQuery 分页参数 |
|
|
|
* @return 非行政执法登记分页列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public TableDataInfo<NonEnforcementRegistrationVo> queryPageList(NonEnforcementRegistrationBo bo, PageQuery pageQuery) { |
|
|
|
LambdaQueryWrapper<NonEnforcementRegistration> lqw = buildQueryWrapper(bo); |
|
|
|
Page<NonEnforcementRegistrationVo> result = nonEnforcementRegistrationMapper.selectVoPage(pageQuery.build(), lqw); |
|
|
|
|
|
|
|
// 处理执法人员信息等附加数据
|
|
|
|
if (result.getRecords() != null && !result.getRecords().isEmpty()) { |
|
|
|
enrichLawEnforcerInfo(result.getRecords()); |
|
|
|
} |
|
|
|
|
|
|
|
return TableDataInfo.build(result); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 构建查询条件 |
|
|
|
* |
|
|
|
* @param bo 查询条件 |
|
|
|
* @return LambdaQueryWrapper |
|
|
|
*/ |
|
|
|
private LambdaQueryWrapper<NonEnforcementRegistration> buildQueryWrapper(NonEnforcementRegistrationBo bo) { |
|
|
|
LambdaQueryWrapper<NonEnforcementRegistration> lqw = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
// 根据XML文件中的查询条件添加查询条件
|
|
|
|
if (bo != null) { |
|
|
|
// 企业名称 - 模糊查询
|
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getEnterpriseName()), NonEnforcementRegistration::getEnterpriseName, bo.getEnterpriseName()); |
|
|
|
// 企业编号 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseNumber()), NonEnforcementRegistration::getEnterpriseNumber, bo.getEnterpriseNumber()); |
|
|
|
// 执法时间 - 精确查询
|
|
|
|
lqw.eq(bo.getEnforcementTime() != null, NonEnforcementRegistration::getEnforcementTime, bo.getEnforcementTime()); |
|
|
|
// 执法人员姓名 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcer()), NonEnforcementRegistration::getLawEnforcer, bo.getLawEnforcer()); |
|
|
|
// 执法人员ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcerId()), NonEnforcementRegistration::getLawEnforcerId, bo.getLawEnforcerId()); |
|
|
|
// 其他执法人员姓名 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcerOther()), NonEnforcementRegistration::getLawEnforcerOther, bo.getLawEnforcerOther()); |
|
|
|
// 其他执法人员ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcerIdOther()), NonEnforcementRegistration::getLawEnforcerIdOther, bo.getLawEnforcerIdOther()); |
|
|
|
// 执法类别 - 精确查询
|
|
|
|
lqw.eq(bo.getLawEnforcementType() != null, NonEnforcementRegistration::getLawEnforcementType, bo.getLawEnforcementType()); |
|
|
|
// 执法类别文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementTypeText()), NonEnforcementRegistration::getLawEnforcementTypeText, bo.getLawEnforcementTypeText()); |
|
|
|
// 执法事项 - 精确查询
|
|
|
|
lqw.eq(bo.getLawEnforcementItem() != null, NonEnforcementRegistration::getLawEnforcementItem, bo.getLawEnforcementItem()); |
|
|
|
// 执法事项文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementItemText()), NonEnforcementRegistration::getLawEnforcementItemText, bo.getLawEnforcementItemText()); |
|
|
|
// 执法依据 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementBasis()), NonEnforcementRegistration::getLawEnforcementBasis, bo.getLawEnforcementBasis()); |
|
|
|
// 执法依据文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawEnforcementBasisText()), NonEnforcementRegistration::getLawEnforcementBasisText, bo.getLawEnforcementBasisText()); |
|
|
|
// 执法结果 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getReslut() != null, NonEnforcementRegistration::getReslut, bo.getReslut()); |
|
|
|
// 状态 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getStatus() != null, NonEnforcementRegistration::getStatus, bo.getStatus()); |
|
|
|
// 是否删除 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasDelete() != null, NonEnforcementRegistration::getHasDelete, bo.getHasDelete()); |
|
|
|
// 是否投诉 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasComplaint() != null, NonEnforcementRegistration::getHasComplaint, bo.getHasComplaint()); |
|
|
|
// 是否提交 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasSubmit() != null, NonEnforcementRegistration::getHasSubmit, bo.getHasSubmit()); |
|
|
|
// 是否评价 - 精确查询 (Long类型)
|
|
|
|
lqw.eq(bo.getHasEvaluate() != null, NonEnforcementRegistration::getHasEvaluate, bo.getHasEvaluate()); |
|
|
|
// 预告ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawId()), NonEnforcementRegistration::getLawId, bo.getLawId()); |
|
|
|
// 预告文本 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getLawText()), NonEnforcementRegistration::getLawText, bo.getLawText()); |
|
|
|
// 执法主体部门ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getBureauDeptId()), NonEnforcementRegistration::getBureauDeptId, bo.getBureauDeptId()); |
|
|
|
// 执法主体部门名称 - 模糊查询
|
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getBureauDeptName()), NonEnforcementRegistration::getBureauDeptName, bo.getBureauDeptName()); |
|
|
|
// 统一信用代码 - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCreditcode()), NonEnforcementRegistration::getCreditcode, bo.getCreditcode()); |
|
|
|
// 用户ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), NonEnforcementRegistration::getUserId, bo.getUserId()); |
|
|
|
// 部门ID - 精确查询
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), NonEnforcementRegistration::getDeptId, bo.getDeptId()); |
|
|
|
|
|
|
|
// searchValue - 多字段模糊查询
|
|
|
|
if (StringUtils.isNotBlank(bo.getSearchValue())) { |
|
|
|
lqw.and(wrapper -> wrapper |
|
|
|
.like(NonEnforcementRegistration::getLawEnforcementItemText, bo.getSearchValue()) |
|
|
|
.or().like(NonEnforcementRegistration::getBureauDeptName, bo.getSearchValue()) |
|
|
|
.or().like(NonEnforcementRegistration::getLawEnforcer, bo.getSearchValue()) |
|
|
|
.or().like(NonEnforcementRegistration::getLawEnforcerOther, bo.getSearchValue()) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// dateType - 时间范围查询
|
|
|
|
if (bo.getDateType() != null) { |
|
|
|
if (bo.getDateType() == 1) { |
|
|
|
// 本月
|
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')"); |
|
|
|
} else if (bo.getDateType() == 2) { |
|
|
|
// 本季度
|
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y-%m') >= CONCAT(YEAR(CURDATE()), '-', " + |
|
|
|
"CASE WHEN QUARTER(CURDATE()) IN (1) THEN '01' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (2) THEN '04' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (3) THEN '07' " + |
|
|
|
"ELSE '10' END) " + |
|
|
|
"and DATE_FORMAT(enforcement_time, '%Y-%m') <= CONCAT(YEAR(CURDATE()), '-', " + |
|
|
|
"CASE " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (1) THEN '03' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (2) THEN '06' " + |
|
|
|
"WHEN QUARTER(CURDATE()) IN (3) THEN '09' " + |
|
|
|
"ELSE '12' " + |
|
|
|
"END)"); |
|
|
|
} else if (bo.getDateType() == 3) { |
|
|
|
// 本年
|
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y') = DATE_FORMAT(CURDATE(), '%Y')"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// dateSearch - 时间范围查询
|
|
|
|
if (StringUtils.isNotBlank(bo.getDateSearch())) { |
|
|
|
lqw.apply("DATE_FORMAT(enforcement_time, '%Y-%m') = {0}", bo.getDateSearch()); |
|
|
|
} |
|
|
|
|
|
|
|
// 按执法时间倒序排序
|
|
|
|
lqw.orderByDesc(NonEnforcementRegistration::getEnforcementTime); |
|
|
|
} |
|
|
|
|
|
|
|
return lqw; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 补充执法人员信息 |
|
|
|
* |
|
|
|
* @param list 记录列表 |
|
|
|
*/ |
|
|
|
private void enrichLawEnforcerInfo(List<NonEnforcementRegistrationVo> list) { |
|
|
|
if (list == null || list.isEmpty()) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 执法人员 没有执法证件号展示加密手机号
|
|
|
|
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()); |
|
|
|
} |
|
|
|
li.setLawEnforcer(sysUserVo.getUserName() + " " + lawCN); |
|
|
|
} else { |
|
|
|
li.setLawEnforcer(li.getLawEnforcer()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 处理其他执法人员信息
|
|
|
|
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()); |
|
|
|
} |
|
|
|
lawTwoList.add(u.getUserName() + " " + temp); |
|
|
|
} |
|
|
|
}); |
|
|
|
li.setLawEnforcerOtherList(lawTwoList); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询非行政执法登记列表 |
|
|
|
* |
|
|
|
@ -104,41 +293,11 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg |
|
|
|
@Override |
|
|
|
public List<NonEnforcementRegistrationVo> selectNonEnforcementRegistrationList(NonEnforcementRegistrationBo bo) |
|
|
|
{ |
|
|
|
List<NonEnforcementRegistrationVo> list=nonEnforcementRegistrationMapper.selectNonEnforcementRegistrationList(bo); |
|
|
|
if(list.size()!=0){ |
|
|
|
// 执法人员 没有执法证件号展示加密手机号
|
|
|
|
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()); |
|
|
|
} |
|
|
|
li.setLawEnforcer(sysUserVo.getUserName() + " " + lawCN); |
|
|
|
} else { |
|
|
|
li.setLawEnforcer(li.getLawEnforcer()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<NonEnforcementRegistrationVo> list = nonEnforcementRegistrationMapper.selectNonEnforcementRegistrationList(bo); |
|
|
|
|
|
|
|
// 使用公共方法处理执法人员信息
|
|
|
|
enrichLawEnforcerInfo(list); |
|
|
|
|
|
|
|
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()); |
|
|
|
} |
|
|
|
lawTwoList.add(u.getUserName() + " " + temp); |
|
|
|
} |
|
|
|
}); |
|
|
|
li.setLawEnforcerOtherList(lawTwoList); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
|