|
|
|
@ -1,13 +1,17 @@ |
|
|
|
package com.zdxt.enforcementcode.controller.app.enforcement; |
|
|
|
|
|
|
|
|
|
|
|
import com.zdxt.enforcementcode.common.util.CommonUtil; |
|
|
|
import com.zdxt.enforcementcode.domain.EnforcementRegistration; |
|
|
|
import com.zdxt.enforcementcode.domain.EnterpriseLawEnforcement; |
|
|
|
import com.zdxt.enforcementcode.domain.bo.EnforcementLawCheckPlanBo; |
|
|
|
import com.zdxt.enforcementcode.domain.bo.EnforcementRegistrationBo; |
|
|
|
import com.zdxt.enforcementcode.domain.bo.EnterpriseLawEnforcementBo; |
|
|
|
import com.zdxt.enforcementcode.domain.vo.EnforcementRegistrationVo; |
|
|
|
import com.zdxt.enforcementcode.domain.vo.EnterpriseEvaluateVo; |
|
|
|
import com.zdxt.enforcementcode.domain.vo.EnterpriseLawEnforcementVo; |
|
|
|
import com.zdxt.enforcementcode.service.IEnforcementRegistrationService; |
|
|
|
import com.zdxt.enforcementcode.service.IEnterpriseEvaluateService; |
|
|
|
import com.zdxt.enforcementcode.service.IEnterpriseLawEnforcementService; |
|
|
|
import io.swagger.v3.oas.annotations.responses.ApiResponse; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
@ -21,14 +25,19 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
|
import org.dromara.common.web.core.BaseController; |
|
|
|
import org.dromara.system.domain.SysDept; |
|
|
|
import org.dromara.system.domain.SysDictData; |
|
|
|
import org.dromara.system.domain.bo.SysDictDataBo; |
|
|
|
import org.dromara.system.domain.vo.SysDeptVo; |
|
|
|
import org.dromara.system.domain.vo.SysDictDataVo; |
|
|
|
import org.dromara.system.domain.vo.SysUserVo; |
|
|
|
import org.dromara.system.service.ISysDeptService; |
|
|
|
import org.dromara.system.service.ISysDictDataService; |
|
|
|
import org.dromara.system.service.ISysUserService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* 执法端-执法登记信息控制器 |
|
|
|
@ -45,6 +54,15 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
|
private final ISysDeptService sysDeptService; |
|
|
|
@Autowired |
|
|
|
private IEnterpriseLawEnforcementService enterpriseLawEnforcementService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISysUserService sysUserService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISysDictDataService sysDictDataService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IEnterpriseEvaluateService enterpriseEvaluateService; |
|
|
|
/** |
|
|
|
* 执法端-执法登记新增保存 |
|
|
|
*/ |
|
|
|
@ -57,6 +75,17 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 修改保存执法端-执法登记提交 |
|
|
|
*/ |
|
|
|
|
|
|
|
@PostMapping("/addSubmit") |
|
|
|
@ResponseBody |
|
|
|
public R<Void> submit(@RequestBody EnforcementRegistrationBo bo) |
|
|
|
{ |
|
|
|
return toAjax(enforcementRegistrationService.updateEnforcementRegistration(bo)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 执法端-查询执法记录-全市-本单位 |
|
|
|
*/ |
|
|
|
@ -96,7 +125,6 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
|
public R<Void> editSave(@RequestBody EnforcementRegistrationBo bo) |
|
|
|
{ |
|
|
|
int resNum = 0; |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(bo.getId())) { |
|
|
|
resNum = enforcementRegistrationService.updateEnforcementRegistration(bo); |
|
|
|
} else { |
|
|
|
@ -113,4 +141,287 @@ public class AppEnforcementRegistrationController extends BaseController { |
|
|
|
} |
|
|
|
return toAjax(resNum); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 执法端-联合执法查询补录(用于补录时关联) |
|
|
|
* 根据企业统一信用号, 搜索出该企业前推一小时内的联合执法. |
|
|
|
* 用于用户自行进行关联 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/queryUnionByHour") |
|
|
|
public R<List<Map<String, Object>>> queryUnionByHour(EnforcementRegistrationBo bo) |
|
|
|
{ |
|
|
|
return R.ok(enforcementRegistrationService.queryUnionByHour(bo)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 执法端-查询执法登记详情 |
|
|
|
*/ |
|
|
|
@GetMapping( "/getByIdToDataFillIn") |
|
|
|
@ResponseBody |
|
|
|
public R<EnforcementRegistrationVo> getByIdToDataFillIn(String id) |
|
|
|
{ |
|
|
|
EnforcementRegistrationVo vo = enforcementRegistrationService.queryById(id); |
|
|
|
return R.ok(vo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 执法端-执法登记详情(含字典回显和执法人员信息) |
|
|
|
*/ |
|
|
|
@GetMapping("/queryById") |
|
|
|
@ResponseBody |
|
|
|
public R<EnforcementRegistrationVo> queryById(String id) |
|
|
|
{ |
|
|
|
EnforcementRegistrationVo vo = enforcementRegistrationService.selectEnforcementRegistrationById(id); |
|
|
|
if (null != vo) { |
|
|
|
// 执法人员1需要展示用户名+执法码
|
|
|
|
SysUserVo sysUserVo = sysUserService.selectUserById(Long.valueOf(vo.getLawEnforcerId())); |
|
|
|
if(sysUserVo != null){ |
|
|
|
String lawCN = sysUserVo.getUserName() +" "+sysUserVo.getLawCertificateNum(); |
|
|
|
if(StringUtils.isEmpty(sysUserVo.getLawCertificateNum())){ |
|
|
|
lawCN= sysUserVo.getUserName() +" "+ CommonUtil.encryptPhone(sysUserVo.getPhonenumber()); |
|
|
|
} |
|
|
|
vo.setLawEnforcer(lawCN); |
|
|
|
} |
|
|
|
|
|
|
|
// 执法人员2需要展示用户名+执法码
|
|
|
|
List<SysUserVo> sysUserVos = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotEmpty(vo.getLawEnforcerIdTwo())) { |
|
|
|
String[] ids = vo.getLawEnforcerIdTwo().split(","); |
|
|
|
List<Long> userIds = new ArrayList<>(); |
|
|
|
for (String strid : ids) { |
|
|
|
if (StringUtils.isNotEmpty(strid.trim())) { |
|
|
|
userIds.add(Long.parseLong(strid.trim())); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!userIds.isEmpty()) { |
|
|
|
sysUserVos = sysUserService.selectUserByIds(userIds, null); |
|
|
|
} |
|
|
|
} |
|
|
|
String tmpUserShow = ""; |
|
|
|
for (SysUserVo ub : sysUserVos) { |
|
|
|
String temp = ub.getLawCertificateNum(); |
|
|
|
if(StringUtils.isEmpty(temp)){ |
|
|
|
temp=CommonUtil.encryptPhone(ub.getPhonenumber()); |
|
|
|
} |
|
|
|
|
|
|
|
tmpUserShow += ub.getUserName() +" "+ temp + ","; |
|
|
|
} |
|
|
|
if (tmpUserShow.length() > 0) { |
|
|
|
tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length()-1); |
|
|
|
} |
|
|
|
vo.setLawEnforcer2Show(tmpUserShow); |
|
|
|
|
|
|
|
// 字典回显
|
|
|
|
SysDictDataBo dictParams = new SysDictDataBo(); |
|
|
|
// 执法领域
|
|
|
|
if (StringUtils.isNotEmpty(vo.getLawField())) { |
|
|
|
dictParams.setDictType("law_field"); |
|
|
|
List<SysDictDataVo> dicts = sysDictDataService.selectDictDataList(dictParams); |
|
|
|
for (SysDictDataVo d : dicts) { |
|
|
|
if (d.getDictValue().equals(vo.getLawField())) { |
|
|
|
vo.setLawFieldText(d.getDictLabel()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 执法类别
|
|
|
|
if (StringUtils.isNotEmpty(vo.getCheckCategory())) { |
|
|
|
dictParams.setDictType("check_category"); |
|
|
|
List<SysDictDataVo> dicts = sysDictDataService.selectDictDataList(dictParams); |
|
|
|
for (SysDictDataVo d : dicts) { |
|
|
|
if (d.getDictValue().equals(vo.getCheckCategory())) { |
|
|
|
vo.setCheckCategoryText(d.getDictLabel()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 执法类别
|
|
|
|
if (StringUtils.isNotEmpty(vo.getLawEnforceCategory())) { |
|
|
|
dictParams.setDictType("law_enforce_category"); |
|
|
|
List<SysDictDataVo> dicts = sysDictDataService.selectDictDataList(dictParams); |
|
|
|
for (SysDictDataVo d : dicts) { |
|
|
|
if (d.getDictValue().equals(vo.getLawEnforceCategory())) { |
|
|
|
vo.setLawEnforceCategoryText(d.getDictLabel()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
return R.fail("数据不存在"); |
|
|
|
} |
|
|
|
return R.ok(vo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 执法端-执法登记详情-联合执法版本 |
|
|
|
*/ |
|
|
|
@GetMapping("/queryUniteById") |
|
|
|
public R<Map<String, List>> queryUniteById(String id) |
|
|
|
{ |
|
|
|
List<EnforcementRegistrationVo> regResults = new ArrayList<>(); |
|
|
|
List<EnterpriseLawEnforcementVo> lawResults = new ArrayList<>(); |
|
|
|
// 先获取登记数据 - 获取批次id
|
|
|
|
EnforcementRegistrationVo vo = enforcementRegistrationService.selectEnforcementRegistrationById(id); |
|
|
|
// 通过联合执法的批次id获取整个批次的联合执法 (查询详情这里不需要获取联合执法信息, 暂时先禁了, 省点性能)
|
|
|
|
if (false && StringUtils.isNotEmpty(vo.getUnionNo()) && 1 == vo.getHasUnion()) { |
|
|
|
// 已登记联合检查
|
|
|
|
EnforcementRegistrationBo bo = new EnforcementRegistrationBo(); |
|
|
|
// regRarams.setUniteCheck(enforcementRegistration.getUniteCheck());
|
|
|
|
bo.setUnionNo((vo.getUnionNo())); |
|
|
|
regResults = enforcementRegistrationService.selectEnforcementRegistrationList(bo, null); |
|
|
|
// 预约未登记的 (预约没要联合检查了)
|
|
|
|
EnterpriseLawEnforcementBo lawRarams = new EnterpriseLawEnforcementBo(); |
|
|
|
lawRarams.setUniteCheck(vo.getUniteCheck()); |
|
|
|
lawRarams.setIsReg(0L); |
|
|
|
lawResults = enterpriseLawEnforcementService.queryList(lawRarams); |
|
|
|
} else { |
|
|
|
regResults.add(vo); |
|
|
|
} |
|
|
|
|
|
|
|
//查询行政检查评价
|
|
|
|
EnterpriseEvaluateVo enterpriseEvaluateVo = new EnterpriseEvaluateVo(); |
|
|
|
if (StringUtils.isNotEmpty(regResults.get(0).getUnionNo())) { |
|
|
|
enterpriseEvaluateVo = enterpriseEvaluateService.selectEnterpriseEvaluateByUniteCheck(regResults.get(0).getUnionNo()); |
|
|
|
} else { |
|
|
|
enterpriseEvaluateVo = enterpriseEvaluateService.selectEnterpriseEvaluateByRelId(regResults.get(0).getId()); |
|
|
|
} |
|
|
|
|
|
|
|
for (EnforcementRegistrationVo reg : regResults) { |
|
|
|
// 执法人员1需要展示用户名+执法码 没有执法码展示加密手机号
|
|
|
|
SysUserVo sysUserVo = sysUserService.selectUserById(Long.valueOf(vo.getLawEnforcerId())); |
|
|
|
if (sysUserVo != null){ |
|
|
|
String lawCN = sysUserVo.getUserName() +" "+sysUserVo.getLawCertificateNum(); |
|
|
|
if(StringUtils.isEmpty(sysUserVo.getLawCertificateNum())){ |
|
|
|
lawCN=sysUserVo.getUserName() +" "+ CommonUtil.encryptPhone(sysUserVo.getPhonenumber()); |
|
|
|
} |
|
|
|
reg.setLawEnforcer(lawCN); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 执法人员2需要展示用户名+执法码 没有执法码展示加密手机号
|
|
|
|
List<SysUserVo> sysUserVos = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotEmpty(vo.getLawEnforcerIdTwo())) { |
|
|
|
String[] ids = vo.getLawEnforcerIdTwo().split(","); |
|
|
|
List<Long> userIds = new ArrayList<>(); |
|
|
|
for (String strid : ids) { |
|
|
|
if (StringUtils.isNotEmpty(strid.trim())) { |
|
|
|
userIds.add(Long.parseLong(strid.trim())); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!userIds.isEmpty()) { |
|
|
|
sysUserVos = sysUserService.selectUserByIds(userIds, null); |
|
|
|
} |
|
|
|
} |
|
|
|
String tmpUserShow = ""; |
|
|
|
for (SysUserVo ub : sysUserVos) { |
|
|
|
String temp = ub.getLawCertificateNum(); |
|
|
|
if(StringUtils.isEmpty(temp)){ |
|
|
|
temp= CommonUtil.encryptPhone(ub.getPhonenumber()); |
|
|
|
} |
|
|
|
tmpUserShow += ub.getUserName() +" "+ temp + ","; |
|
|
|
} |
|
|
|
if (tmpUserShow.length() > 0) { |
|
|
|
tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length()-1); |
|
|
|
} |
|
|
|
reg.setLawEnforcer2Show(tmpUserShow); |
|
|
|
|
|
|
|
// 字典回显
|
|
|
|
SysDictDataBo dictParams = new SysDictDataBo(); |
|
|
|
// 执法领域
|
|
|
|
if (StringUtils.isNotEmpty(reg.getLawField())) { |
|
|
|
dictParams.setDictType("law_field"); |
|
|
|
List<SysDictDataVo> dicts = sysDictDataService.selectDictDataList(dictParams); |
|
|
|
for (SysDictDataVo d : dicts) { |
|
|
|
if (d.getDictValue().equals(reg.getLawField())) { |
|
|
|
reg.setLawFieldText(d.getDictLabel()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 任务来源
|
|
|
|
if (StringUtils.isNotEmpty(reg.getCheckCategory())) { |
|
|
|
dictParams.setDictType("check_category"); |
|
|
|
List<SysDictDataVo> dicts = sysDictDataService.selectDictDataList(dictParams); |
|
|
|
for (SysDictDataVo d : dicts) { |
|
|
|
if (d.getDictValue().equals(reg.getCheckCategory())) { |
|
|
|
reg.setCheckCategoryText(d.getDictLabel()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 执法类别
|
|
|
|
if (StringUtils.isNotEmpty(reg.getLawEnforceCategory())) { |
|
|
|
dictParams.setDictType("law_enforce_category"); |
|
|
|
List<SysDictDataVo> dicts = sysDictDataService.selectDictDataList(dictParams); |
|
|
|
for (SysDictDataVo d : dicts) { |
|
|
|
if (d.getDictValue().equals(reg.getLawEnforceCategory())) { |
|
|
|
reg.setLawEnforceCategoryText(d.getDictLabel()); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
reg.setEnterpriseEvaluateVo(enterpriseEvaluateVo); |
|
|
|
} |
|
|
|
|
|
|
|
for (EnterpriseLawEnforcementVo law : lawResults) { |
|
|
|
// 执法人员1需要展示用户名+执法码
|
|
|
|
List<SysUserVo> userBeans1 = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotEmpty(law.getLawEnforcerId())) { |
|
|
|
String[] ids = law.getLawEnforcerId().split(","); |
|
|
|
List<Long> userIds = new ArrayList<>(); |
|
|
|
for (String strid : ids) { |
|
|
|
if (StringUtils.isNotEmpty(strid.trim())) { |
|
|
|
userIds.add(Long.parseLong(strid.trim())); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!userIds.isEmpty()) { |
|
|
|
userBeans1 = sysUserService.selectUserByIds(userIds, null); |
|
|
|
} |
|
|
|
} |
|
|
|
String tmpUserShow1 = ""; |
|
|
|
for (SysUserVo ub : userBeans1) { |
|
|
|
String lawCertificateNum = StringUtils.isEmpty(ub.getLawCertificateNum()) ? "" : ub.getLawCertificateNum(); |
|
|
|
tmpUserShow1 += ub.getUserName() + " " + lawCertificateNum + ","; |
|
|
|
} |
|
|
|
if (tmpUserShow1.length() > 0) { |
|
|
|
tmpUserShow1 = tmpUserShow1.substring(0, tmpUserShow1.length() - 1); |
|
|
|
} |
|
|
|
law.setLawEnforcer(tmpUserShow1); |
|
|
|
|
|
|
|
// 执法人员2需要展示用户名+执法码
|
|
|
|
List<SysUserVo> userBeans2 = new ArrayList<>(); |
|
|
|
if (StringUtils.isNotEmpty(law.getLawEnforcerTwoId())) { |
|
|
|
String[] ids = law.getLawEnforcerTwoId().split(","); |
|
|
|
List<Long> userIds = new ArrayList<>(); |
|
|
|
for (String strid : ids) { |
|
|
|
if (StringUtils.isNotEmpty(strid.trim())) { |
|
|
|
userIds.add(Long.parseLong(strid.trim())); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!userIds.isEmpty()) { |
|
|
|
userBeans2 = sysUserService.selectUserByIds(userIds, null); |
|
|
|
} |
|
|
|
} |
|
|
|
String tmpUserShow2 = ""; |
|
|
|
for (SysUserVo ub : userBeans2) { |
|
|
|
String lawCertificateNum = StringUtils.isEmpty(ub.getLawCertificateNum()) ? "" : ub.getLawCertificateNum(); |
|
|
|
tmpUserShow2 += ub.getUserName() + " " + lawCertificateNum + ","; |
|
|
|
} |
|
|
|
if (tmpUserShow2.length() > 0) { |
|
|
|
tmpUserShow2 = tmpUserShow2.substring(0, tmpUserShow2.length() - 1); |
|
|
|
} |
|
|
|
law.setLawEnforcer2Show(tmpUserShow2); |
|
|
|
} |
|
|
|
Map<String, List> result = new HashMap<>(); |
|
|
|
result.put("regResults", regResults); |
|
|
|
result.put("lawResults", lawResults); |
|
|
|
return R.ok(result); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|