9 changed files with 1632 additions and 6 deletions
@ -0,0 +1,186 @@ |
|||
package com.zdxt.app.controller.external.company; |
|||
|
|||
import com.zdxt.auth.dto.DictDataBean; |
|||
import com.zdxt.auth.feign.DictDataApi; |
|||
import com.zdxt.code.domain.ComplaintItem; |
|||
import com.zdxt.code.service.IComplaintItemService; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.io.File; |
|||
import java.io.IOException; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 外部接口-企业端-投诉事项Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2024-09-24 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/external/code/item") |
|||
@Api( tags = "外部接口-企业端-投诉事项") |
|||
public class OutComplaintItemController extends BaseController { |
|||
private String prefix = "code/item"; |
|||
|
|||
@Autowired |
|||
private IComplaintItemService complaintItemService; |
|||
@Autowired |
|||
private DictDataApi dictDataApi; |
|||
|
|||
@GetMapping() |
|||
public String item() { |
|||
return prefix + "/item"; |
|||
} |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(ComplaintItem complaintItem) { |
|||
startPage(); |
|||
List<ComplaintItem> list = complaintItemService.selectComplaintItemList(complaintItem); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 查询投诉事项列表 |
|||
*/ |
|||
@GetMapping("/queryList") |
|||
@ResponseBody |
|||
public TableDataInfo queryList(ComplaintItem complaintItem) { |
|||
startPage(); |
|||
List<ComplaintItem> list = complaintItemService.selectComplaintItemList(complaintItem); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 新增投诉事项 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() { |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存投诉事项 |
|||
*/ |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public ZDResponse addSave(ComplaintItem complaintItem) { |
|||
int i = complaintItemService.insertComplaintItem(complaintItem); |
|||
return i > 0 ? ZDResponse.success("保存成功") : ZDResponse.error("保存失败"); |
|||
} |
|||
|
|||
/** |
|||
* 修改投诉事项 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") String id, ModelMap mmap) { |
|||
ComplaintItem complaintItem = complaintItemService.selectComplaintItemById(id); |
|||
mmap.put("complaintItem", complaintItem); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存投诉事项 |
|||
*/ |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public ZDResponse editSave(ComplaintItem complaintItem) { |
|||
int i = complaintItemService.updateComplaintItem(complaintItem); |
|||
return i > 0 ? ZDResponse.success("修改成功") : ZDResponse.error("修改失败"); |
|||
} |
|||
|
|||
/** |
|||
* 删除投诉事项 |
|||
*/ |
|||
@PostMapping("/remove") |
|||
@ResponseBody |
|||
public ZDResponse remove(String ids) { |
|||
int i = complaintItemService.deleteComplaintItemByIds(ids); |
|||
return i > 0 ? ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
|||
} |
|||
|
|||
@PostMapping("/exportItem") |
|||
@ResponseBody |
|||
public void exportItem(MultipartFile file) throws Exception { |
|||
// String filePath = FileUploadUtils.getDefaultBaseDir();
|
|||
// File file1 = new File(filePath);
|
|||
// file.transferTo(file1);
|
|||
// File file1 = new File("C:\\Users\\soul\\Desktop\\执法监督码部署\\司法局投诉事项.xlsx");
|
|||
// JSONArray objects = ExcelUtils.readFile(file1);
|
|||
// for (int i = 0; i < objects.size(); i++) {
|
|||
// JSONObject jsonObject = objects.getJSONObject(i);
|
|||
// ComplaintItem complaintItem = new ComplaintItem();
|
|||
// complaintItem.setComplaintItemName(jsonObject.getString("subName"));
|
|||
// complaintItem.setComplaintItemCode(jsonObject.getString("itemCode"));
|
|||
// complaintItem.setSubName(jsonObject.getString("subName"));
|
|||
// complaintItemService.insertComplaintItem(complaintItem);
|
|||
// }
|
|||
} |
|||
|
|||
|
|||
public File transferToFile(MultipartFile multipartFile) { |
|||
// 选择用缓冲区来实现这个转换即使用java 创建的临时文件 使用 MultipartFile.transferto()方法 。
|
|||
File file = null; |
|||
try { |
|||
String originalFilename = multipartFile.getOriginalFilename(); |
|||
String[] filename = originalFilename.split("\\."); |
|||
file = File.createTempFile(filename[0], filename[1] + "."); |
|||
multipartFile.transferTo(file); |
|||
// file.deleteOnExit();
|
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return file; |
|||
} |
|||
|
|||
/** |
|||
* 获取区/街道数据用来做级联 |
|||
* @return |
|||
*/ |
|||
@GetMapping("/getRegionCascade") |
|||
@ResponseBody |
|||
public ZDResponse getRegionCascade() { |
|||
List<Map<String, Object>> result = new ArrayList<>(); |
|||
DictDataBean dictParams = new DictDataBean(); |
|||
dictParams.setDictType("address_type"); |
|||
List<DictDataBean> dictDatas = dictDataApi.getDictData(dictParams); |
|||
String[] areaKey = dictDatas.stream().map(DictDataBean::getDictValue).toArray(String[]::new); |
|||
List<DictDataBean> streams = dictDataApi.getDatasByTypeIn(areaKey); |
|||
for (DictDataBean dictData : dictDatas) { |
|||
Map<String, Object> areaMap = new HashMap<>(); |
|||
areaMap.put("text", dictData.getDictLabel()); |
|||
areaMap.put("value", dictData.getDictValue()); |
|||
List<Map<String, Object>> tmps = new ArrayList<>(); |
|||
for (DictDataBean stream : streams) { |
|||
if (dictData.getDictValue().equals(stream.getDictType())) { |
|||
Map<String, Object> streamMap = new HashMap<>(); |
|||
streamMap.put("text", stream.getDictLabel()); |
|||
streamMap.put("value", stream.getDictValue()); |
|||
tmps.add(streamMap); |
|||
} |
|||
} |
|||
Map<String, Object> streamNull = new HashMap<>(); |
|||
streamNull.put("text", "暂不选择街道"); |
|||
streamNull.put("value", ""); |
|||
tmps.add(streamNull); |
|||
areaMap.put("children", tmps); |
|||
result.add(areaMap); |
|||
} |
|||
return ZDResponse.success("街道获取成功", result); |
|||
} |
|||
} |
|||
@ -0,0 +1,939 @@ |
|||
package com.zdxt.app.controller.external.company; |
|||
|
|||
import com.zdxt.auth.dto.DeptBean; |
|||
import com.zdxt.auth.dto.DictDataBean; |
|||
import com.zdxt.auth.dto.UserBean; |
|||
import com.zdxt.auth.feign.DeptApi; |
|||
import com.zdxt.auth.feign.DictDataApi; |
|||
import com.zdxt.auth.feign.UserApi; |
|||
import com.zdxt.auth.project.system.user.service.IUserService; |
|||
import com.zdxt.code.domain.*; |
|||
import com.zdxt.code.service.*; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.CommonUtil; |
|||
import com.zdxt.common.util.StringUtils; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.time.Instant; |
|||
import java.time.LocalDate; |
|||
import java.time.ZoneId; |
|||
import java.time.temporal.ChronoUnit; |
|||
import java.util.*; |
|||
|
|||
|
|||
/** |
|||
* 执法端-执法登记Controller |
|||
* |
|||
* @author chenrui |
|||
* @date 2024-02-23 |
|||
*/ |
|||
@Tag(name = "外部接口", description = "执法端-执法登记") |
|||
@Controller |
|||
@RequestMapping("/external/code/registration") |
|||
public class OutEnforcementRegistrationController extends BaseController |
|||
{ |
|||
private String prefix = "project/code/registration"; |
|||
|
|||
@Autowired private IEnforcementRegistrationService enforcementRegistrationService; |
|||
@Autowired private IEnterpriseLawEnforcementService enterpriseLawEnforcementService; |
|||
@Autowired private ILinkageDictService iLinkageDictService; |
|||
@Autowired private IEnterpriseComplaintService enterpriseComplaintService; |
|||
@Autowired private IEnterpriseInformationService iEnterpriseInformationService; |
|||
@Autowired private IEnterpriseEvaluateService enterpriseEvaluateService; |
|||
@Autowired private IZqyjjdm137344Service iZqyjjdm137344Service; |
|||
@Autowired private UserApi userApi; |
|||
@Autowired private DeptApi deptApi; |
|||
@Autowired private DictDataApi dictDataApi; |
|||
@Autowired |
|||
private IUserService userService; |
|||
|
|||
@RequiresPermissions("code:registration:view") |
|||
@GetMapping() |
|||
public String registration() |
|||
{ |
|||
return prefix + "/registration"; |
|||
} |
|||
|
|||
/** |
|||
* 查询执法端-执法登记列表 |
|||
*/ |
|||
@RequiresPermissions("code:registration:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(EnforcementRegistration enforcementRegistration) |
|||
{ |
|||
startPage(); |
|||
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList(enforcementRegistration); |
|||
return getDataTable(list); |
|||
} |
|||
// /**
|
|||
// * 查询执法端-执法登记列表
|
|||
// */
|
|||
// @GetMapping("/selectList")
|
|||
// @ResponseBody
|
|||
// public ZDResponse selectList(EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
// List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList(enforcementRegistration);
|
|||
// DictDataBean dictParams = new DictDataBean();
|
|||
// dictParams.setDictType("check_category");
|
|||
// List<DictDataBean> dicts = dictDataApi.getDictData(dictParams);
|
|||
// for (EnforcementRegistration ee : list) {
|
|||
// // 判断是否投诉
|
|||
// EnterpriseComplaint params = new EnterpriseComplaint();
|
|||
// params.setRelId(ee.getId());
|
|||
// params.setComOrOpi(1);
|
|||
// List<EnterpriseComplaint> enterpriseComplaints = enterpriseComplaintService.selectEnterpriseComplaintList(params);
|
|||
// if (null!=enterpriseComplaints && enterpriseComplaints.size()>0) {
|
|||
// ee.setComOrOpi(1);
|
|||
// } else {
|
|||
// ee.setComOrOpi(0);
|
|||
// }
|
|||
//
|
|||
// // 执法类别
|
|||
// for (DictDataBean dict : dicts) {
|
|||
// if (dict.getDictValue().equals(ee.getCheckCategory())) {
|
|||
// ee.setCheckCategoryText(dict.getDictLabel());
|
|||
// }
|
|||
// }
|
|||
//
|
|||
// // 执法人员1需要展示用户名+执法码
|
|||
// UserBean userBean = userApi.getUserByUserId(ee.getLawEnforcerId());
|
|||
// String lawCN = StringUtils.isEmpty(userBean.getLawCertificateNum())?"":userBean.getLawCertificateNum();
|
|||
// ee.setLawEnforcer(userBean.getUserName() +" "+ lawCN);
|
|||
// // 执法人员2需要展示用户名+执法码
|
|||
// List<String> lawTwoList = new ArrayList<>();
|
|||
// List<UserBean> userBeans = new ArrayList<>();
|
|||
// if (StringUtils.isNotEmpty(ee.getLawEnforcerIdTwo())) {
|
|||
// userBeans = userApi.getUserByUserIds(ee.getLawEnforcerIdTwo());
|
|||
// }
|
|||
// for (UserBean ub : userBeans) {
|
|||
// String lawCertificateNum = StringUtils.isEmpty(ub.getLawCertificateNum())?"":ub.getLawCertificateNum();
|
|||
// lawTwoList.add(ub.getUserName() +" "+ lawCertificateNum);
|
|||
// }
|
|||
// ee.setLawEnforcer2List(lawTwoList);
|
|||
// }
|
|||
//
|
|||
// return ZDResponse.success("获取执法登录信息",list);
|
|||
// }
|
|||
//
|
|||
//
|
|||
// /**
|
|||
// * 查询执法端-执法登记列表
|
|||
// */
|
|||
//// @RequiresPermissions("code:registration:list")
|
|||
// @PostMapping("/queryList")
|
|||
// @ResponseBody
|
|||
// public TableDataInfo queryList(@RequestBody EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
//// startPage();
|
|||
// int totalNum = enforcementRegistrationService.countEnforcementRegistrationList(enforcementRegistration);
|
|||
// List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList(enforcementRegistration);
|
|||
// DictDataBean dictParams = new DictDataBean();
|
|||
// dictParams.setDictType("check_category");
|
|||
// List<DictDataBean> dicts = dictDataApi.getDictData(dictParams);
|
|||
// for (EnforcementRegistration ee : list) {
|
|||
// // 判断是否投诉
|
|||
// EnterpriseComplaint params = new EnterpriseComplaint();
|
|||
// params.setRelId(ee.getId());
|
|||
// params.setComOrOpi(1);
|
|||
// List<EnterpriseComplaint> enterpriseComplaints = enterpriseComplaintService.selectEnterpriseComplaintList(params);
|
|||
// if (null!=enterpriseComplaints && enterpriseComplaints.size()>0) {
|
|||
// ee.setComOrOpi(1);
|
|||
// } else {
|
|||
// ee.setComOrOpi(0);
|
|||
// }
|
|||
//
|
|||
// // 执法类别
|
|||
// for (DictDataBean dict : dicts) {
|
|||
// if (dict.getDictValue().equals(ee.getCheckCategory())) {
|
|||
// ee.setCheckCategoryText(dict.getDictLabel());
|
|||
// }
|
|||
// }
|
|||
//
|
|||
// // 执法人员1需要展示用户名+执法码 没有执法码展示加密手机号
|
|||
// UserBean userBean = userApi.getUserByUserId(ee.getLawEnforcerId());
|
|||
// String lawCN =userBean.getUserName() +" "+userBean.getLawCertificateNum();
|
|||
// if(StringUtils.isEmpty(userBean.getLawCertificateNum())){
|
|||
// lawCN=userBean.getUserName() +" "+ CommonUtil.encryptPhone(userBean.getPhonenumber());
|
|||
// }
|
|||
// ee.setLawEnforcer(lawCN);
|
|||
//
|
|||
// // 执法人员2需要展示用户名+执法码 没有执法码展示加密手机号
|
|||
// List<String> lawTwoList = new ArrayList<>();
|
|||
// List<UserBean> userBeans = new ArrayList<>();
|
|||
// if (StringUtils.isNotEmpty(ee.getLawEnforcerIdTwo())) {
|
|||
// userBeans = userApi.getUserByUserIds(ee.getLawEnforcerIdTwo());
|
|||
// }
|
|||
//// String tmpUserShow = "";
|
|||
// for (UserBean ub : userBeans) {
|
|||
// String temp=ub.getUserName() +" "+ub.getLawCertificateNum();
|
|||
// if(StringUtils.isEmpty(ub.getLawCertificateNum())){
|
|||
// temp=ub.getUserName() +" "+ CommonUtil.encryptPhone(ub.getPhonenumber());
|
|||
// }
|
|||
// lawTwoList.add(temp);
|
|||
// }
|
|||
//// if (tmpUserShow.length() > 0) {
|
|||
//// tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length()-1);
|
|||
//// }
|
|||
// ee.setLawEnforcer2List(lawTwoList);
|
|||
//
|
|||
// // 判断超时多少天
|
|||
// Instant instant = ee.getEnforcementTime().toInstant();
|
|||
// ZoneId zoneId = ZoneId.systemDefault();
|
|||
// LocalDate startDate = instant.atZone(zoneId).toLocalDate();
|
|||
// // 今天距离执法时间所差天数
|
|||
// long daysBetween = ChronoUnit.DAYS.between(startDate, LocalDate.now());
|
|||
// ee.setOutTimeDayNum(daysBetween);
|
|||
// }
|
|||
//
|
|||
// TableDataInfo rspData = getDataTable(list);
|
|||
// rspData.setCode(0);
|
|||
// rspData.setRows(list);
|
|||
// rspData.setTotal(totalNum);
|
|||
// return rspData;
|
|||
// }
|
|||
//
|
|||
//
|
|||
// /**
|
|||
// * 查询执法端-执法登记列表
|
|||
// */
|
|||
//// @RequiresPermissions("code:registration:list")
|
|||
// @GetMapping("/queryListNew")
|
|||
// @ResponseBody
|
|||
// public TableDataInfo queryListNew(EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
// if (Objects.nonNull(enforcementRegistration.getUserId()) && enforcementRegistration.getDateType()==0) {
|
|||
// UserBean userByUser = userApi.getUserByUserId(enforcementRegistration.getUserId());
|
|||
// enforcementRegistration.setDeptId(userByUser == null ? null : userByUser.getDeptId());
|
|||
//
|
|||
// DeptBean bureauDept = deptApi.iterationDeptParentToBureau(userByUser.getDeptId());
|
|||
// enforcementRegistration.setBureauDeptId(bureauDept.getDeptId());
|
|||
// }
|
|||
// //查询检查总次数
|
|||
// List<EnforcementRegistration> registrations = enforcementRegistrationService.selectEnforcementRegistrationListNew(enforcementRegistration);
|
|||
// int count = 0;
|
|||
// if (registrations.size() >0) {
|
|||
// count = registrations.stream().map(item -> Integer.valueOf(item.getNum())).reduce(0, Integer::sum);
|
|||
// }
|
|||
// //查询列表
|
|||
// startPage();
|
|||
// List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationListNew(enforcementRegistration);
|
|||
// TableDataInfo dataTable = getDataTable(list);
|
|||
// dataTable.setMsg(count);
|
|||
// return dataTable;
|
|||
// }
|
|||
|
|||
@GetMapping("/queryByEpId") |
|||
@ResponseBody |
|||
public ZDResponse queryByEpId(EnforcementRegistration enforcementRegistration) |
|||
{ |
|||
if (Objects.nonNull(enforcementRegistration.getUserId()) && enforcementRegistration.getDateType()==0) { |
|||
UserBean userByUser = userApi.getUserByUserId(enforcementRegistration.getUserId()); |
|||
enforcementRegistration.setDeptId(userByUser == null ? null : userByUser.getDeptId()); |
|||
|
|||
DeptBean bureauDept = deptApi.iterationDeptParentToBureau(userByUser.getDeptId()); |
|||
enforcementRegistration.setBureauDeptId(bureauDept.getDeptId()); |
|||
} |
|||
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationByEpId(enforcementRegistration); |
|||
return ZDResponse.success("获取当前企业本月登记信息",list); |
|||
} |
|||
|
|||
/** |
|||
* 查询企业端-执法登记列表 |
|||
*/ |
|||
@GetMapping("/queryEnterpriseList") |
|||
@ResponseBody |
|||
public TableDataInfo queryEnterpriseList(EnforcementRegistration enforcementRegistration) |
|||
{ |
|||
startPage(); |
|||
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnterpriseRegistrationList(enforcementRegistration); |
|||
DictDataBean dictParams = new DictDataBean(); |
|||
dictParams.setDictType("law_enforce_category"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (EnforcementRegistration ee : list) { |
|||
// 判断是否投诉
|
|||
EnterpriseComplaint params = new EnterpriseComplaint(); |
|||
params.setRelId(ee.getId()); |
|||
params.setComOrOpi(1); |
|||
List<EnterpriseComplaint> enterpriseComplaints = enterpriseComplaintService.selectEnterpriseComplaintList(params); |
|||
if (null!=enterpriseComplaints && enterpriseComplaints.size()>0) { |
|||
ee.setComOrOpi(1); |
|||
} else { |
|||
ee.setComOrOpi(0); |
|||
} |
|||
// 执法类别
|
|||
for (DictDataBean dict : dicts) { |
|||
if (dict.getDictValue().equals(ee.getLawEnforceCategory())) { |
|||
ee.setCheckCategoryText(dict.getDictLabel()); |
|||
} |
|||
} |
|||
|
|||
// 执法人员1需要展示用户名+执法码
|
|||
UserBean userBean = userApi.getUserByUserId(ee.getLawEnforcerId()); |
|||
|
|||
String lawCN = userBean.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(lawCN)){ |
|||
lawCN=CommonUtil.encryptPhone(userBean.getPhonenumber()); |
|||
} |
|||
ee.setLawEnforcer(userBean.getUserName() +" "+ lawCN); |
|||
|
|||
// 执法人员2需要展示用户名+执法码
|
|||
List<String> lawTwoList = new ArrayList<>(); |
|||
List<UserBean> userBeans = new ArrayList<>(); |
|||
if (StringUtils.isNotEmpty(ee.getLawEnforcerIdTwo())) { |
|||
userBeans = userApi.getUserByUserIds(ee.getLawEnforcerIdTwo()); |
|||
} |
|||
for (UserBean ub : userBeans) { |
|||
String temp = ub.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(temp)){ |
|||
temp=CommonUtil.encryptPhone(ub.getPhonenumber()); |
|||
} |
|||
lawTwoList.add(ub.getUserName() +" "+ temp); |
|||
} |
|||
ee.setLawEnforcer2List(lawTwoList); |
|||
|
|||
// 判断超时多少天
|
|||
Instant instant = ee.getEnforcementTime().toInstant(); |
|||
ZoneId zoneId = ZoneId.systemDefault(); |
|||
LocalDate startDate = instant.atZone(zoneId).toLocalDate(); |
|||
// 今天距离执法时间所差天数
|
|||
long daysBetween = ChronoUnit.DAYS.between(startDate, LocalDate.now()); |
|||
ee.setOutTimeDayNum(daysBetween); |
|||
} |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** 剔除执法日期距离今天超过5天的执法数据 */ |
|||
@GetMapping("/queryList2") |
|||
@ResponseBody |
|||
public ZDResponse queryList2(EnforcementRegistration enforcementRegistration) |
|||
{ |
|||
List<EnforcementRegistration> res = new ArrayList<>(); |
|||
List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList(enforcementRegistration); |
|||
for (EnforcementRegistration ee : list) { |
|||
// 判断是否投诉
|
|||
EnterpriseComplaint params = new EnterpriseComplaint(); |
|||
params.setRelId(ee.getId()); |
|||
params.setComOrOpi(1); |
|||
List<EnterpriseComplaint> enterpriseComplaints = enterpriseComplaintService.selectEnterpriseComplaintList(params); |
|||
if (null!=enterpriseComplaints && enterpriseComplaints.size()>0) { |
|||
ee.setComOrOpi(1); |
|||
} else { |
|||
ee.setComOrOpi(0); |
|||
} |
|||
// 判断超时多少天
|
|||
Instant instant = ee.getEnforcementTime().toInstant(); |
|||
ZoneId zoneId = ZoneId.systemDefault(); |
|||
LocalDate startDate = instant.atZone(zoneId).toLocalDate(); |
|||
// 今天距离执法时间所差天数
|
|||
long daysBetween = ChronoUnit.DAYS.between(startDate, LocalDate.now()); |
|||
ee.setOutTimeDayNum(daysBetween); |
|||
if (daysBetween <= 4) { |
|||
res.add(ee); |
|||
} |
|||
} |
|||
return ZDResponse.success("查询成功",res); |
|||
} |
|||
//
|
|||
// /** 剔除执法日期距离今天超过5天的执法数据 */
|
|||
// @GetMapping("/queryListWithFiveDay")
|
|||
// @ResponseBody
|
|||
// public TableDataInfo queryListWithFiveDay(EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
//
|
|||
// startPage();
|
|||
// List<EnforcementRegistration> res = new ArrayList<>();
|
|||
// List<EnforcementRegistration> list = enforcementRegistrationService.selectEnforcementRegistrationList(enforcementRegistration);
|
|||
// for (EnforcementRegistration ee : list) {
|
|||
// // 判断是否投诉
|
|||
// EnterpriseComplaint params = new EnterpriseComplaint();
|
|||
// params.setRelId(ee.getId());
|
|||
// params.setComOrOpi(1);
|
|||
// List<EnterpriseComplaint> enterpriseComplaints = enterpriseComplaintService.selectEnterpriseComplaintList(params);
|
|||
// if (null!=enterpriseComplaints && enterpriseComplaints.size()>0) {
|
|||
// ee.setComOrOpi(1);
|
|||
// } else {
|
|||
// ee.setComOrOpi(0);
|
|||
// }
|
|||
// // 执法人员1需要展示用户名+执法码
|
|||
// UserBean userBean = userApi.getUserByUserId(ee.getLawEnforcerId());
|
|||
// String lawCN = StringUtils.isEmpty(userBean.getLawCertificateNum())?"":userBean.getLawCertificateNum();
|
|||
// ee.setLawEnforcer(userBean.getUserName() +" "+ lawCN);
|
|||
//
|
|||
// // 执法人员2需要展示用户名+执法码
|
|||
// List<String> lawTwoList = new ArrayList<>();
|
|||
// List<UserBean> userBeans = new ArrayList<>();
|
|||
// if (StringUtils.isNotEmpty(ee.getLawEnforcerIdTwo())) {
|
|||
// userBeans = userApi.getUserByUserIds(ee.getLawEnforcerIdTwo());
|
|||
// }
|
|||
// for (UserBean ub : userBeans) {
|
|||
// String lawCertificateNum = StringUtils.isEmpty(ub.getLawCertificateNum())?"":ub.getLawCertificateNum();
|
|||
// lawTwoList.add(ub.getUserName() +" "+ lawCertificateNum);
|
|||
// }
|
|||
// ee.setLawEnforcer2List(lawTwoList);
|
|||
// // 判断超时多少天
|
|||
// Instant instant = ee.getEnforcementTime().toInstant();
|
|||
// ZoneId zoneId = ZoneId.systemDefault();
|
|||
// LocalDate startDate = instant.atZone(zoneId).toLocalDate();
|
|||
// // 今天距离执法时间所差天数
|
|||
// long daysBetween = ChronoUnit.DAYS.between(startDate, LocalDate.now());
|
|||
// ee.setOutTimeDayNum(daysBetween);
|
|||
// if (daysBetween <= 4) {
|
|||
// res.add(ee);
|
|||
// }
|
|||
// }
|
|||
// return getDataTable(res);
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 新增执法端-执法登记
|
|||
// */
|
|||
// @GetMapping("/add")
|
|||
// public String add()
|
|||
// {
|
|||
// return prefix + "/add";
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 新增保存执法端-执法登记
|
|||
// */
|
|||
//// @RequiresPermissions("code:registration:add")
|
|||
// @PostMapping("/add")
|
|||
// @ResponseBody
|
|||
// public ZDResponse addSave(@RequestBody EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
// String district = "";
|
|||
// String street = "";
|
|||
// if (StringUtils.isNotEmpty(enforcementRegistration.getEnterpriseAddress())) {
|
|||
// district = extract(enforcementRegistration.getEnterpriseAddress(), "([^\\s市]+?区)");
|
|||
// street = extract(enforcementRegistration.getEnterpriseAddress(), "([^\\s区]+?街道)");
|
|||
// }
|
|||
// enforcementRegistration.setDistrict(district);
|
|||
// enforcementRegistration.setStreet(street);
|
|||
// return enforcementRegistrationService.insertEnforcementRegistration(enforcementRegistration) > 0
|
|||
// ? ZDResponse.success("保存成功") : ZDResponse.error("保存失败");
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 根据企业统一信用号, 搜索出该企业前推一小时内的联合执法.
|
|||
// * 用于用户自行进行关联
|
|||
// * @param enterpriseNumber
|
|||
// * @return
|
|||
// */
|
|||
// @GetMapping("/queryUnionByHour/{enterpriseNumber}/{checkCss}/{enforcementTime}/{unionNo}")
|
|||
// @ResponseBody
|
|||
// public ZDResponse queryUnionByHour(@PathVariable String enterpriseNumber, @PathVariable String checkCss, @PathVariable String enforcementTime, @PathVariable String unionNo)
|
|||
// {
|
|||
// return ZDResponse.success("操作成功", enforcementRegistrationService.queryUnionByHour(enterpriseNumber, checkCss, enforcementTime, unionNo));
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 修改执法端-执法登记
|
|||
// */
|
|||
// @GetMapping("/edit/{id}")
|
|||
// public String edit(@PathVariable("id") String id, ModelMap mmap)
|
|||
// {
|
|||
// EnforcementRegistration enforcementRegistration = enforcementRegistrationService.selectEnforcementRegistrationById(id);
|
|||
// mmap.put("enforcementRegistration", enforcementRegistration);
|
|||
// return prefix + "/edit";
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 修改保存执法端-执法登记
|
|||
// */
|
|||
//// @RequiresPermissions("code:registration:edit")
|
|||
// @PostMapping("/edit")
|
|||
// @ResponseBody
|
|||
// public ZDResponse editSave(@RequestBody EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
// int resNum = 0;
|
|||
// enforcementRegistration.setIsSubmit(1);
|
|||
// String district = "";
|
|||
// String street = "";
|
|||
// if (StringUtils.isNotEmpty(enforcementRegistration.getEnterpriseAddress())) {
|
|||
// district = extract(enforcementRegistration.getEnterpriseAddress(), "([^\\s市]+?区)");
|
|||
// street = extract(enforcementRegistration.getEnterpriseAddress(), "([^\\s区]+?街道)");
|
|||
// }
|
|||
// enforcementRegistration.setDistrict(district);
|
|||
// enforcementRegistration.setStreet(street);
|
|||
// if (StringUtils.isNotEmpty(enforcementRegistration.getId())) {
|
|||
// resNum = enforcementRegistrationService.updateEnforcementRegistration(enforcementRegistration);
|
|||
// } else {
|
|||
// resNum = enforcementRegistrationService.insertEnforcementRegistration(enforcementRegistration);
|
|||
// if (resNum > 0 && StringUtils.isNotEmpty(enforcementRegistration.getLawId())) {
|
|||
// enforcementRegistration.setId(null);
|
|||
// }
|
|||
// }
|
|||
// if (StringUtils.isNotEmpty(enforcementRegistration.getLawId())) {
|
|||
// EnterpriseLawEnforcement law = new EnterpriseLawEnforcement();
|
|||
// law.setId(enforcementRegistration.getLawId());
|
|||
// law.setIsReg(1);
|
|||
// resNum = enterpriseLawEnforcementService.updateEnterpriseLawEnforcement(law);
|
|||
// }
|
|||
// return resNum > 0 ? ZDResponse.success("修改成功") : ZDResponse.error("修改失败");
|
|||
// }
|
|||
//
|
|||
// @PostMapping("/edit2")
|
|||
// @ResponseBody
|
|||
// public ZDResponse editSave2(@RequestBody EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
// enforcementRegistration.setIsSubmit(0);
|
|||
// String district = extract(enforcementRegistration.getEnterpriseAddress(), "([^\\s市]+?区)");
|
|||
// String street = extract(enforcementRegistration.getEnterpriseAddress(), "([^\\s区]+?街道)");
|
|||
// enforcementRegistration.setDistrict(district);
|
|||
// enforcementRegistration.setStreet(street);
|
|||
// int resNum = enforcementRegistrationService.updateEnforcementRegistration(enforcementRegistration);
|
|||
// if (StringUtils.isNotEmpty(enforcementRegistration.getLawId())) {
|
|||
// EnterpriseLawEnforcement law = new EnterpriseLawEnforcement();
|
|||
// law.setId(enforcementRegistration.getLawId());
|
|||
// law.setIsReg(1);
|
|||
// resNum = enterpriseLawEnforcementService.updateEnterpriseLawEnforcement(law);
|
|||
// }
|
|||
// return resNum > 0 ? ZDResponse.success("修改成功") : ZDResponse.error("修改失败");
|
|||
// }
|
|||
//
|
|||
//
|
|||
// /**
|
|||
// * 修改执法端-执法登记
|
|||
// */
|
|||
// @GetMapping("/detail/{id}")
|
|||
// public String detail(@PathVariable("id") String id, ModelMap mmap)
|
|||
// {
|
|||
// EnforcementRegistration enforcementRegistration = enforcementRegistrationService.selectEnforcementRegistrationById(id);
|
|||
// mmap.put("enforcementRegistration", enforcementRegistration);
|
|||
// return prefix + "/detail";
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 修改保存执法端-执法登记提交
|
|||
// */
|
|||
// @RequiresPermissions("code:registration:submit")
|
|||
// @PostMapping("/submit")
|
|||
// @ResponseBody
|
|||
// public ZDResponse submit(@RequestBody EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
// return enforcementRegistrationService.updateEnforcementRegistration(enforcementRegistration) > 0 ?
|
|||
// ZDResponse.success("提交成功") : ZDResponse.error("提交失败");
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 删除执法端-执法登记
|
|||
// */
|
|||
// @RequiresPermissions("code:registration:remove")
|
|||
// @PostMapping( "/remove")
|
|||
// @ResponseBody
|
|||
// public ZDResponse remove(String ids)
|
|||
// {
|
|||
// return enforcementRegistrationService.deleteEnforcementRegistrationByIds(ids) > 0 ?
|
|||
// ZDResponse.success("删除成功") : ZDResponse.error("删除失败");
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 获取预警信息
|
|||
// */
|
|||
//// @RequiresPermissions("code:registration:list")
|
|||
// @GetMapping("/queryEarlyWarning")
|
|||
// @ResponseBody
|
|||
// public ZDResponse queryEarlyWarning(EnforcementRegistration enforcementRegistration)
|
|||
// {
|
|||
// List<EnforceRegCount> list = enforcementRegistrationService.queryEarlyWarning(enforcementRegistration.getSearchValue());
|
|||
// return ZDResponse.success("查询成功",list);
|
|||
// }
|
|||
|
|||
/** |
|||
* 执法登记详情 |
|||
*/ |
|||
@GetMapping("/queryById/{id}") |
|||
@ResponseBody |
|||
public ZDResponse queryById(@PathVariable("id") String id) |
|||
{ |
|||
EnforcementRegistration enforcementRegistration = enforcementRegistrationService.selectEnforcementRegistrationById(id); |
|||
if (null != enforcementRegistration) { |
|||
// LinkageDict ld1 = iLinkageDictService.selectLinkageDictById(enforcementRegistration.getLawEnforcementItem());
|
|||
// Zqyjjdm137344 zq = new Zqyjjdm137344();
|
|||
// try {
|
|||
// zq = iZqyjjdm137344Service.getZqyjjdmById(enforcementRegistration.getLawEnforcementBasis());
|
|||
// } catch (Exception e) {
|
|||
// e.printStackTrace();
|
|||
// }
|
|||
// enforcementRegistration.setLawEnforcementItemText(null==ld1?"":ld1.getTitle());
|
|||
// enforcementRegistration.setLawEnforcementBasisText(null==zq?"":zq.getLawName());
|
|||
|
|||
// 执法人员1需要展示用户名+执法码
|
|||
UserBean userBean = userApi.getUserByUserId(enforcementRegistration.getLawEnforcerId()); |
|||
String lawCN = userBean.getUserName() +" "+userBean.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(userBean.getLawCertificateNum())){ |
|||
lawCN= userBean.getUserName() +" "+CommonUtil.encryptPhone(userBean.getPhonenumber()); |
|||
} |
|||
enforcementRegistration.setLawEnforcer(lawCN); |
|||
|
|||
// 执法人员2需要展示用户名+执法码
|
|||
List<UserBean> userBeans = new ArrayList<>(); |
|||
if (StringUtils.isNotEmpty(enforcementRegistration.getLawEnforcerIdTwo())) { |
|||
userBeans = userApi.getUserByUserIds(enforcementRegistration.getLawEnforcerIdTwo()); |
|||
} |
|||
String tmpUserShow = ""; |
|||
for (UserBean ub : userBeans) { |
|||
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); |
|||
} |
|||
enforcementRegistration.setLawEnforcer2Show(tmpUserShow); |
|||
|
|||
// 字典回显
|
|||
DictDataBean dictParams = new DictDataBean(); |
|||
// 执法领域
|
|||
if (StringUtils.isNotEmpty(enforcementRegistration.getLawField())) { |
|||
dictParams.setDictType("law_field"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (DictDataBean d : dicts) { |
|||
if (d.getDictValue().equals(enforcementRegistration.getLawField())) { |
|||
enforcementRegistration.setLawFieldText(d.getDictLabel()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
// 执法类别
|
|||
if (StringUtils.isNotEmpty(enforcementRegistration.getCheckCategory())) { |
|||
dictParams.setDictType("check_category"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (DictDataBean d : dicts) { |
|||
if (d.getDictValue().equals(enforcementRegistration.getCheckCategory())) { |
|||
enforcementRegistration.setCheckCategoryText(d.getDictLabel()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
// 执法类别
|
|||
if (StringUtils.isNotEmpty(enforcementRegistration.getLawEnforceCategory())) { |
|||
dictParams.setDictType("law_enforce_category"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (DictDataBean d : dicts) { |
|||
if (d.getDictValue().equals(enforcementRegistration.getLawEnforceCategory())) { |
|||
enforcementRegistration.setLawEnforceCategoryText(d.getDictLabel()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return ZDResponse.success("查询成功",enforcementRegistration); |
|||
} |
|||
|
|||
/** |
|||
* 执法登记详情 - 联合执法版本 |
|||
*/ |
|||
@GetMapping("/queryUniteById/{id}") |
|||
@ResponseBody |
|||
public ZDResponse queryUniteById(@PathVariable("id") String id) |
|||
{ |
|||
List<EnforcementRegistration> regResults = new ArrayList<>(); |
|||
List<EnterpriseLawEnforcement> lawResults = new ArrayList<>(); |
|||
// 先获取登记数据 - 获取批次id
|
|||
EnforcementRegistration enforcementRegistration = enforcementRegistrationService.selectEnforcementRegistrationById(id); |
|||
// 通过联合执法的批次id获取整个批次的联合执法 (查询详情这里不需要获取联合执法信息, 暂时先禁了, 省点性能)
|
|||
if (false && StringUtils.isNotEmpty(enforcementRegistration.getUnionNo()) && 1 == enforcementRegistration.getHasUnion()) { |
|||
// 已登记联合检查
|
|||
EnforcementRegistration regRarams = new EnforcementRegistration(); |
|||
// regRarams.setUniteCheck(enforcementRegistration.getUniteCheck());
|
|||
regRarams.setUnionNo((enforcementRegistration.getUnionNo())); |
|||
regResults = enforcementRegistrationService.selectEnforcementRegistrationList(regRarams); |
|||
// 预约未登记的 (预约没要联合检查了)
|
|||
EnterpriseLawEnforcement lawRarams = new EnterpriseLawEnforcement(); |
|||
lawRarams.setUniteCheck(enforcementRegistration.getUniteCheck()); |
|||
lawRarams.setIsReg(0); |
|||
lawResults = enterpriseLawEnforcementService.selectEnterpriseLawEnforcementList2(lawRarams); |
|||
} else { |
|||
regResults.add(enforcementRegistration); |
|||
} |
|||
|
|||
//查询行政检查评价
|
|||
EnterpriseEvaluate enterpriseEvaluate = new EnterpriseEvaluate(); |
|||
// if (StringUtils.isNotEmpty(regResults.get(0).getUniteCheck())) {
|
|||
// enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByUniteCheck(regResults.get(0).getUniteCheck());
|
|||
if (StringUtils.isNotEmpty(regResults.get(0).getUnionNo())) { |
|||
enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByUniteCheck(regResults.get(0).getUnionNo()); |
|||
} else { |
|||
enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByRelId(regResults.get(0).getId()); |
|||
} |
|||
|
|||
for (EnforcementRegistration reg : regResults) { |
|||
// 执法人员1需要展示用户名+执法码 没有执法码展示加密手机号
|
|||
UserBean userBean = userApi.getUserByUserId(reg.getLawEnforcerId()); |
|||
String lawCN = userBean.getUserName() +" "+userBean.getLawCertificateNum(); |
|||
if(StringUtils.isEmpty(userBean.getLawCertificateNum())){ |
|||
lawCN=userBean.getUserName() +" "+ CommonUtil.encryptPhone(userBean.getPhonenumber()); |
|||
} |
|||
reg.setLawEnforcer(lawCN); |
|||
|
|||
// 执法人员2需要展示用户名+执法码 没有执法码展示加密手机号
|
|||
List<UserBean> userBeans = new ArrayList<>(); |
|||
if (StringUtils.isNotEmpty(reg.getLawEnforcerIdTwo())) { |
|||
userBeans = userApi.getUserByUserIds(reg.getLawEnforcerIdTwo()); |
|||
} |
|||
String tmpUserShow = ""; |
|||
for (UserBean ub : userBeans) { |
|||
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); |
|||
|
|||
// 字典回显
|
|||
DictDataBean dictParams = new DictDataBean(); |
|||
// 执法领域
|
|||
if (StringUtils.isNotEmpty(reg.getLawField())) { |
|||
dictParams.setDictType("law_field"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (DictDataBean d : dicts) { |
|||
if (d.getDictValue().equals(reg.getLawField())) { |
|||
reg.setLawFieldText(d.getDictLabel()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
// 任务来源
|
|||
if (StringUtils.isNotEmpty(reg.getCheckCategory())) { |
|||
dictParams.setDictType("check_category"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (DictDataBean d : dicts) { |
|||
if (d.getDictValue().equals(reg.getCheckCategory())) { |
|||
reg.setCheckCategoryText(d.getDictLabel()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 执法类别
|
|||
if (StringUtils.isNotEmpty(reg.getLawEnforceCategory())) { |
|||
dictParams.setDictType("law_enforce_category"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (DictDataBean d : dicts) { |
|||
if (d.getDictValue().equals(reg.getLawEnforceCategory())) { |
|||
reg.setLawEnforceCategoryText(d.getDictLabel()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
// 评价
|
|||
|
|||
//查询行政检查评价
|
|||
// EnterpriseEvaluate enterpriseEvaluate = new EnterpriseEvaluate();
|
|||
// if (StringUtils.isNotEmpty(enforcementRegistration.getUniteCheck())) {
|
|||
// enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByUniteCheck(enforcementRegistration.getUniteCheck());
|
|||
// } else {
|
|||
// enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByRelId(enforcementRegistration.getId());
|
|||
// }
|
|||
reg.setEnterpriseEvaluate(enterpriseEvaluate); |
|||
} |
|||
|
|||
for (EnterpriseLawEnforcement law : lawResults) { |
|||
// 执法人员1需要展示用户名+执法码
|
|||
List<UserBean> userBeans1 = new ArrayList<>(); |
|||
if (StringUtils.isNotEmpty(law.getLawEnforcerId())) { |
|||
userBeans1 = userApi.getUserByUserIds(law.getLawEnforcerId()); |
|||
} |
|||
String tmpUserShow1 = ""; |
|||
for (UserBean 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<UserBean> userBeans2 = new ArrayList<>(); |
|||
if (StringUtils.isNotEmpty(law.getLawEnforcerTwoId())) { |
|||
userBeans2 = userApi.getUserByUserIds(law.getLawEnforcerTwoId()); |
|||
} |
|||
String tmpUserShow2 = ""; |
|||
for (UserBean 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 ZDResponse.success("查询成功",result); |
|||
} |
|||
|
|||
/** |
|||
* 查询附件信息 |
|||
* |
|||
* @param key |
|||
* @return |
|||
*/ |
|||
@GetMapping("/queryFiles/{key}") |
|||
@ResponseBody |
|||
public ZDResponse queryFiles(@PathVariable String key) { |
|||
HashMap<String, Object> map = new HashMap<>(); |
|||
map.put("filePreview", enforcementRegistrationService.queryFiles(key)); |
|||
return ZDResponse.success("获取成功", map); |
|||
} |
|||
|
|||
/** |
|||
* 查询附件信息 |
|||
* |
|||
* @param key |
|||
* @return |
|||
*/ |
|||
@PostMapping("/queryFilesPost") |
|||
@ResponseBody |
|||
public ZDResponse queryFilesPost(String key) { |
|||
HashMap<String, Object> map = new HashMap<>(); |
|||
map.put("filePreview", enforcementRegistrationService.queryFiles(key)); |
|||
return ZDResponse.success("获取成功", map); |
|||
} |
|||
|
|||
/** |
|||
* 查看预约记录详情 |
|||
*/ |
|||
// @GetMapping( "/getByUserIdAndZero/{userId}")
|
|||
// @ResponseBody
|
|||
// public ZDResponse getByUserIdAndZero(@PathVariable Long userId)
|
|||
// {
|
|||
// EnforcementRegistration registration = enforcementRegistrationService.getByUserIdAndZero(userId);
|
|||
// Map<String, Object> params = new HashMap<>();
|
|||
// LinkageDict tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementItem());
|
|||
// params.put("lawEnforcementItemText", null!=tmp?tmp.getTitle():"");
|
|||
// tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementBasis());
|
|||
// params.put("lawEnforcementBasisText", null!=tmp?tmp.getTitle():"");
|
|||
// registration.setParams(params);
|
|||
// return ZDResponse.success("查询成功", registration);
|
|||
// }
|
|||
// @GetMapping( "/getByUserIdAndEnterpriseNumber/{modth}/{userId}/{enterpriseNumber}")
|
|||
// @ResponseBody
|
|||
// public ZDResponse getByUserIdAndEnterpriseNumber(@PathVariable String modth, @PathVariable Long userId, @PathVariable String enterpriseNumber)
|
|||
// {
|
|||
// // 拿到的企业编码是加密盐的, 和登记表对不上
|
|||
// EnterpriseInformation enterpriseInformation = null;
|
|||
// if ("add".equals(modth)) {
|
|||
// enterpriseInformation = iEnterpriseInformationService.selectEnterpriseInformationBySalt(enterpriseNumber);
|
|||
// } else {
|
|||
// enterpriseInformation = iEnterpriseInformationService.selectEnterpriseInformationByNum(enterpriseNumber);
|
|||
// }
|
|||
// // 前端似乎没保存部门id, 所以弄个userId上来 通过userId获取其部门id
|
|||
// UserBean userBean = userApi.getUserByUserId(userId);
|
|||
// EnforcementRegistration registration = enforcementRegistrationService.getByDeptIdAndEnterpriseNumber(userBean.getDeptId(), enterpriseInformation.getEnterpriseNumber());
|
|||
// // 执法人员需要展示用户名+执法码
|
|||
// List<UserBean> userBeans = new ArrayList<>();
|
|||
// if (StringUtils.isNotEmpty(registration.getLawEnforcerIdTwo())) {
|
|||
// userBeans = userApi.getUserByUserIds(registration.getLawEnforcerIdTwo());
|
|||
// }
|
|||
// String tmpUserShow = "";
|
|||
// for (UserBean ub : userBeans) {
|
|||
// String lawCertificateNum = StringUtils.isEmpty(ub.getLawCertificateNum())?"":ub.getLawCertificateNum();
|
|||
// tmpUserShow += ub.getUserName() +" "+ lawCertificateNum + ",";
|
|||
// }
|
|||
// if (tmpUserShow.length() > 0) {
|
|||
// tmpUserShow = tmpUserShow.substring(0, tmpUserShow.length()-1);
|
|||
// }
|
|||
// registration.setLawEnforcer2Show(tmpUserShow);
|
|||
//
|
|||
// // 字典回显
|
|||
// DictDataBean dictParams = new DictDataBean();
|
|||
// // 执法领域
|
|||
// if (StringUtils.isNotEmpty(registration.getLawField())) {
|
|||
// dictParams.setDictType("law_field");
|
|||
// List<DictDataBean> dicts = dictDataApi.getDictData(dictParams);
|
|||
// for (DictDataBean d : dicts) {
|
|||
// if (d.getDictValue().equals(registration.getLawField())) {
|
|||
// registration.setLawFieldText(d.getDictLabel());
|
|||
// break;
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
// // 执法类别
|
|||
// if (StringUtils.isNotEmpty(registration.getCheckCategory())) {
|
|||
// dictParams.setDictType("check_category");
|
|||
// List<DictDataBean> dicts = dictDataApi.getDictData(dictParams);
|
|||
// for (DictDataBean d : dicts) {
|
|||
// if (d.getDictValue().equals(registration.getCheckCategory())) {
|
|||
// registration.setCheckCategoryText(d.getDictLabel());
|
|||
// break;
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
//
|
|||
// if (null!=registration && StringUtils.isNotEmpty(registration.getId())) {
|
|||
// Map<String, Object> params = new HashMap<>();
|
|||
// LinkageDict tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementItem());
|
|||
// params.put("lawEnforcementItemText", null != tmp ? tmp.getTitle() : "");
|
|||
// registration.setParams(params);
|
|||
// return ZDResponse.success("查询成功", registration);
|
|||
// }
|
|||
// return ZDResponse.error("查询失败");
|
|||
// }
|
|||
|
|||
/** |
|||
* 查看预约记录详情 |
|||
*/ |
|||
@GetMapping( "/getByIdToDataFillIn/{id}") |
|||
@ResponseBody |
|||
public ZDResponse getByIdToDataFillIn(@PathVariable String id) |
|||
{ |
|||
EnforcementRegistration registration = enforcementRegistrationService.getEnforcementRegistrationById(id); |
|||
|
|||
//TODO 执法事项修改为手动输入
|
|||
// Map<String, Object> params = new HashMap<>();
|
|||
// LinkageDict tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementItem());
|
|||
// params.put("lawEnforcementItemText", tmp.getTitle());
|
|||
// tmp = iLinkageDictService.selectLinkageDictById(registration.getLawEnforcementBasis());
|
|||
// params.put("lawEnforcementBasisText", tmp.getTitle());
|
|||
// registration.setParams(params);
|
|||
return ZDResponse.success("查询成功", registration); |
|||
} |
|||
|
|||
/** |
|||
* 获取全部执法部门 |
|||
* @param bean |
|||
* @return |
|||
*/ |
|||
@PostMapping("/getAllEnforceDept") |
|||
@ResponseBody |
|||
public TableDataInfo getAllEnforceDept(@RequestBody DeptBean bean){ |
|||
int count=deptApi.getAllEnforceDeptCount(bean); |
|||
List<DeptBean> list= deptApi.getAllEnforceDept(bean); |
|||
TableDataInfo rspData = getDataTable(list); |
|||
rspData.setCode(0); |
|||
rspData.setRows(list); |
|||
rspData.setTotal(count); |
|||
return rspData; |
|||
} |
|||
|
|||
private static String extract(String text, String regex) { |
|||
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile(regex); |
|||
java.util.regex.Matcher matcher = pattern.matcher(text); |
|||
if (matcher.find()) { |
|||
return matcher.group(1); |
|||
} |
|||
return ""; |
|||
} |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,254 @@ |
|||
package com.zdxt.app.controller.external.company; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.convert.Convert; |
|||
import com.zdxt.auth.dto.DictDataBean; |
|||
import com.zdxt.auth.feign.DictDataApi; |
|||
import com.zdxt.auth.feign.ZdxtFileCommonApi; |
|||
import com.zdxt.code.domain.*; |
|||
import com.zdxt.code.mapper.EnforcementRegistrationMapper; |
|||
import com.zdxt.code.service.IEnforcementRegistrationService; |
|||
import com.zdxt.code.service.IEnterpriseComplaintService; |
|||
import com.zdxt.code.service.MssqApiService; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.StringUtils; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import com.zdxt.common.zdxtFile.ZdxtFileCommon; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 外部接口-企业执法-在线投诉Controller |
|||
* |
|||
* @author chenrui |
|||
* @date 2024-02-23 |
|||
*/ |
|||
@Tag(name = "外部接口", description = "企业执法-在线投诉") |
|||
@Controller |
|||
@RequestMapping("/external/code/complaint") |
|||
public class OutEnterpriseComplaintController extends BaseController { |
|||
private String prefix = "code/complaint"; |
|||
|
|||
@Autowired |
|||
private IEnterpriseComplaintService enterpriseComplaintService; |
|||
@Autowired |
|||
private ZdxtFileCommonApi zdxtFileCommonApi; |
|||
@Autowired private DictDataApi dictDataApi; |
|||
@Autowired private IEnforcementRegistrationService enforcementRegistrationService; |
|||
|
|||
@Autowired |
|||
private EnforcementRegistrationMapper enforcementRegistrationMapper; |
|||
@Autowired |
|||
private MssqApiService mssqApiService; |
|||
|
|||
// @RequiresPermissions("code:complaint:view")
|
|||
// @GetMapping()
|
|||
// public String complaint() {
|
|||
// return prefix + "/complaint";
|
|||
// }
|
|||
//
|
|||
// /**
|
|||
// * 查询企业执法-在线投诉列表
|
|||
// */
|
|||
// @RequiresPermissions("code:complaint:list")
|
|||
// @PostMapping("/list")
|
|||
// @ResponseBody
|
|||
// public TableDataInfo list(EnterpriseComplaint enterpriseComplaint) {
|
|||
// startPage();
|
|||
// List<EnterpriseComplaint> list = enterpriseComplaintService.selectEnterpriseComplaintList(enterpriseComplaint);
|
|||
// return getDataTable(list);
|
|||
// }
|
|||
|
|||
/** |
|||
* 查询企业执法-在线投诉列表 |
|||
*/ |
|||
@PostMapping("/queryList") |
|||
@ResponseBody |
|||
public TableDataInfo queryList(@RequestBody EnterpriseComplaint enterpriseComplaint) { |
|||
DictDataBean dictParams = new DictDataBean(); |
|||
dictParams.setDictType("caseType"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
int total = enterpriseComplaintService.selectTotal(enterpriseComplaint); |
|||
List<EnterpriseComplaint> pageList = enterpriseComplaintService.selectEnterpriseComplaintList(enterpriseComplaint); |
|||
//手动分页
|
|||
// List<EnterpriseComplaint> pageList = list.stream()
|
|||
// .skip(ServletUtils.getParameterToInt(Constants.PAGE_NUM))
|
|||
// .limit(ServletUtils.getParameterToInt(Constants.PAGE_SIZE))
|
|||
// .collect(Collectors.toList());
|
|||
pageList.forEach(res ->{ |
|||
if(StringUtils.isNotEmpty(res.getComplaintDepartments())){ |
|||
String[] strings = Convert.toStrArray(res.getComplaintDepartments()); |
|||
res.setComplaintDepartmentList(Arrays.asList(strings)); |
|||
} |
|||
}); |
|||
for (int i = 0; i < pageList.size(); i++) { |
|||
// 执法类别
|
|||
for (DictDataBean dict : dicts) { |
|||
if (dict.getDictValue().equals(pageList.get(i).getEnforceType().toString())) { |
|||
pageList.get(i).setEnforceTypeStr(dict.getDictLabel()); |
|||
} |
|||
} |
|||
if(StringUtils.isNotEmpty(pageList.get(i).getRelId())){ |
|||
EnforcementRegistration enforcementRegistration = |
|||
enforcementRegistrationMapper.selectEnforcementRegistrationById(pageList.get(i).getRelId()); |
|||
//判断检查事件是否为空
|
|||
if(BeanUtil.isNotEmpty(enforcementRegistration) && StringUtils.isNotEmpty(enforcementRegistration.getLawEnforcementItemText())){ |
|||
pageList.get(i).setLawEnforcementIncident(enforcementRegistration.getLawEnforcementItemText()); |
|||
pageList.get(i).setBureauDeptName(enforcementRegistration.getBureauDeptName()); |
|||
} |
|||
} |
|||
} |
|||
TableDataInfo rspData = getDataTable(pageList); |
|||
rspData.setCode(0); |
|||
rspData.setRows(pageList); |
|||
rspData.setTotal(total); |
|||
return rspData; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存企业执法-在线投诉 |
|||
*/ |
|||
// @RequiresPermissions("code:complaint:add")
|
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public ZDResponse addSave(@RequestBody EnterpriseComplaint enterpriseComplaint) { |
|||
return enterpriseComplaintService.insertEnterpriseComplaint(enterpriseComplaint) > 0 ? |
|||
ZDResponse.success("保存成功") : ZDResponse.error("保存失败"); |
|||
} |
|||
|
|||
/** |
|||
* 查询在线投诉详情 |
|||
*/ |
|||
@GetMapping("/queryById") |
|||
@ResponseBody |
|||
public ZDResponse queryById(String id) { |
|||
EnterpriseComplaint enterpriseComplaint = enterpriseComplaintService.selectEnterpriseComplaintById(id); |
|||
// 获取投诉类型
|
|||
if (null != enterpriseComplaint.getEnforceType()) { |
|||
DictDataBean dictParams = new DictDataBean(); |
|||
dictParams.setDictType("caseType"); |
|||
List<DictDataBean> dicts = dictDataApi.getDictData(dictParams); |
|||
for (DictDataBean d : dicts) { |
|||
if (d.getDictValue().equals(enterpriseComplaint.getEnforceType().toString())) { |
|||
enterpriseComplaint.setEnforceTypeText(d.getDictLabel()); |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 获取相关事项 - 移到 service 里面去了
|
|||
// if (StringUtils.isNotEmpty(enterpriseComplaint.getRelId())) {
|
|||
// EnforcementRegistration registration = enforcementRegistrationService.selectEnforcementRegistrationById(enterpriseComplaint.getRelId());
|
|||
// enterpriseComplaint.setLawEnforcementIncident(registration.getLawEnforcementItemText());
|
|||
// }
|
|||
|
|||
|
|||
Map<String, Object> resMap = new HashMap<>(); |
|||
//TODO 客户要求删除投诉的评价入口 2024年8月27日20:41:36
|
|||
// if (StringUtils.isNotEmpty(enterpriseComplaint.getProWoCode())) {
|
|||
// MssqAddOrder mparams = new MssqAddOrder();
|
|||
// mparams.setProWoCode(enterpriseComplaint.getProWoCode());
|
|||
// String resStr = null;
|
|||
// try {
|
|||
// resStr = mssqApiService.mssqQueryEndInfo(mparams);
|
|||
// JSONObject resObj = JSONObject.parseObject(resStr);
|
|||
// if ("0".equals(resObj.getString("resultCode"))) {
|
|||
// // 再判断是否超过5天 (超过5天也不让评价)
|
|||
// JSONObject endData = resObj.getJSONObject("endData");
|
|||
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|||
// Date date = format.parse(endData.getString("endTime"));
|
|||
// Instant instant = date.toInstant();
|
|||
// ZoneId zoneId = ZoneId.systemDefault();
|
|||
// LocalDate calDate = instant.atZone(zoneId).toLocalDate();
|
|||
// long daysBetween = ChronoUnit.DAYS.between(calDate, LocalDate.now());
|
|||
// if (daysBetween <= 4) {
|
|||
// resMap.put("res", endData);
|
|||
// } else {
|
|||
// resMap.put("res", "0");
|
|||
// }
|
|||
// } else {
|
|||
// resMap.put("res", "0");
|
|||
// }
|
|||
// enterpriseComplaint.setParams(resMap);
|
|||
// } catch (Exception e) {
|
|||
// e.printStackTrace();
|
|||
// resMap.put("res", "0");
|
|||
// }
|
|||
// }
|
|||
// 获取图片
|
|||
List<ZdxtFileCommon> files = zdxtFileCommonApi.selectZdxtFileById(id); |
|||
resMap.put("file", files); |
|||
enterpriseComplaint.setParams(resMap); |
|||
return ZDResponse.success("投诉详情查询", enterpriseComplaint); |
|||
} |
|||
|
|||
/** |
|||
* 查询在线投诉详情 |
|||
*/ |
|||
@GetMapping("/queryProcessById") |
|||
@ResponseBody |
|||
public ZDResponse queryProcessById(String id) { |
|||
|
|||
List<MssqOrderFlow> mssqOrderFlows = |
|||
enterpriseComplaintService.selectEnterpriseComplaintProcess(id); |
|||
return ZDResponse.success("投诉进度查询", mssqOrderFlows); |
|||
} |
|||
|
|||
|
|||
@GetMapping("/getById/{id}") |
|||
@ResponseBody |
|||
public ZDResponse getById(@PathVariable("id") String id) { |
|||
// return ZDResponse.success("查询成功", enterpriseComplaintService.selectEnterpriseComplaintById(id));
|
|||
EnterpriseComplaint params = new EnterpriseComplaint(); |
|||
params.setRelId(id); |
|||
params.setComOrOpi(1); |
|||
List<EnterpriseComplaint> enterpriseComplaints = enterpriseComplaintService.selectEnterpriseComplaintList(params); |
|||
if (null != enterpriseComplaints && enterpriseComplaints.size() > 0) { |
|||
return ZDResponse.success("查询成功", enterpriseComplaints.get(0)); |
|||
} |
|||
return ZDResponse.success("查询成功", null); |
|||
} |
|||
|
|||
/** |
|||
* 诉求工单评价页面 |
|||
* |
|||
* @param |
|||
* @return |
|||
* @throws Exception |
|||
*/ |
|||
@PostMapping("/mssqAppraise") |
|||
@ResponseBody |
|||
public ZDResponse mssqAppraise(@RequestBody MssqAddOrder mssqAddOrder) throws Exception { |
|||
String url = mssqApiService.mssqAppraise(mssqAddOrder); |
|||
return ZDResponse.success("查询成功", url); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取行政and非行政未被投诉的列表 |
|||
* @param param |
|||
* @return |
|||
*/ |
|||
@PostMapping("/getAllCheckList") |
|||
@ResponseBody |
|||
public TableDataInfo getAllCheckList(@RequestBody EnterpriseComplaint param){ |
|||
if(StringUtils.isEmpty(param.getEnterpriseNumber())){ |
|||
return getDataTable(new ArrayList<>()); |
|||
} |
|||
int count=enterpriseComplaintService.getAllCheckCount(param); |
|||
List<ComplaintRegistration> list=enterpriseComplaintService.getAllCheckList(param); |
|||
TableDataInfo rspData = getDataTable(list); |
|||
rspData.setCode(0); |
|||
rspData.setRows(list); |
|||
rspData.setTotal(count); |
|||
return rspData; |
|||
} |
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
package com.zdxt.app.controller.external.company; |
|||
|
|||
import com.zdxt.code.domain.EnterpriseEvaluate; |
|||
import com.zdxt.code.service.IEnterpriseEvaluateService; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 外部接口-企业端-执法评价Controller |
|||
* |
|||
* @author Vincent |
|||
* @date 2026-04-07 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/external/evaluate") |
|||
@Tag(name = "外部接口", description = "企业端-执法评价") |
|||
public class OutEnterpriseEvaluateController extends BaseController |
|||
{ |
|||
private String prefix = "project/code/evaluate"; |
|||
|
|||
@Autowired |
|||
private IEnterpriseEvaluateService enterpriseEvaluateService; |
|||
|
|||
@RequiresPermissions("system:evaluate:view") |
|||
@GetMapping() |
|||
public String evaluate() |
|||
{ |
|||
return prefix + "/evaluate"; |
|||
} |
|||
|
|||
/** |
|||
* 查询企业端-执法评价列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(EnterpriseEvaluate enterpriseEvaluate) |
|||
{ |
|||
startPage(); |
|||
List<EnterpriseEvaluate> list = enterpriseEvaluateService.selectEnterpriseEvaluateList(enterpriseEvaluate); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 新增企业端-执法评价 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存企业端-执法评价 |
|||
*/ |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public ZDResponse addSave(@RequestBody EnterpriseEvaluate enterpriseEvaluate) |
|||
{ |
|||
return enterpriseEvaluateService.insertEnterpriseEvaluate(enterpriseEvaluate) > 0 |
|||
?ZDResponse.success("保存成功"):ZDResponse.error("保存失败"); |
|||
} |
|||
|
|||
/** |
|||
* 修改企业端-执法评价 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") String id, ModelMap mmap) |
|||
{ |
|||
EnterpriseEvaluate enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateById(id); |
|||
mmap.put("enterpriseEvaluate", enterpriseEvaluate); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存企业端-执法评价 |
|||
*/ |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public ZDResponse editSave(EnterpriseEvaluate enterpriseEvaluate) |
|||
{ |
|||
return enterpriseEvaluateService.updateEnterpriseEvaluate(enterpriseEvaluate) > 0 ? |
|||
ZDResponse.success("修改成功"):ZDResponse.error("修改失败"); |
|||
} |
|||
|
|||
/** |
|||
* 删除企业端-执法评价 |
|||
*/ |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public ZDResponse remove(String ids) |
|||
{ |
|||
return enterpriseEvaluateService.deleteEnterpriseEvaluateByIds(ids) > 0 ? |
|||
ZDResponse.success("删除成功") : ZDResponse.error("删除失败"); |
|||
} |
|||
} |
|||
@ -0,0 +1,116 @@ |
|||
package com.zdxt.app.controller.external.company; |
|||
|
|||
import cn.hutool.core.util.IdUtil; |
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.zdxt.auth.dto.DeptBean; |
|||
import com.zdxt.auth.dto.DictDataBean; |
|||
import com.zdxt.auth.dto.UserBean; |
|||
import com.zdxt.auth.feign.DictDataApi; |
|||
import com.zdxt.auth.feign.UserApi; |
|||
import com.zdxt.code.domain.EnterpriseInformation; |
|||
import com.zdxt.code.domain.EnterpriseLawEnforcement; |
|||
import com.zdxt.code.domain.LinkageDict; |
|||
import com.zdxt.code.mapper.EnterpriseInformationMapper; |
|||
import com.zdxt.code.service.IEnterpriseComplaintService; |
|||
import com.zdxt.code.service.IEnterpriseLawEnforcementService; |
|||
import com.zdxt.code.service.ILinkageDictService; |
|||
import com.zdxt.code.utils.ZwSmsClient; |
|||
import com.zdxt.common.ZDResponse; |
|||
import com.zdxt.common.controller.BaseController; |
|||
import com.zdxt.common.util.CommonUtil; |
|||
import com.zdxt.common.util.StringUtils; |
|||
import com.zdxt.common.util.TableDataInfo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.time.LocalDate; |
|||
import java.time.format.DateTimeFormatter; |
|||
import java.time.temporal.ChronoUnit; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 企业端-执法部门预约记录Controller |
|||
* |
|||
* @author chenrui |
|||
* @date 2024-02-21 |
|||
*/ |
|||
@Tag(name = "外部接口", description = "企业端-企业端-执法部门预约记") |
|||
@Controller |
|||
@RequestMapping("/external/code/enforcement") |
|||
public class OutEnterpriseLawEnforcementController extends BaseController |
|||
{ |
|||
private String prefix = "code/enforcement"; |
|||
|
|||
@Autowired |
|||
private IEnterpriseLawEnforcementService enterpriseLawEnforcementService; |
|||
@Autowired |
|||
EnterpriseInformationMapper enterpriseInformationMapper; |
|||
|
|||
@Autowired private UserApi userApi; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 查询企业端-执法部门预约记录列表 |
|||
*/ |
|||
@RequiresPermissions("code:enforcement:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(EnterpriseLawEnforcement enterpriseLawEnforcement) |
|||
{ |
|||
startPage(); |
|||
List<EnterpriseLawEnforcement> list = enterpriseLawEnforcementService.selectEnterpriseLawEnforcementList(enterpriseLawEnforcement); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 查询企业端-执法部门预约记录列表 |
|||
*/ |
|||
// @RequiresPermissions("code:enforcement:queryList")
|
|||
@PostMapping("/queryList") |
|||
@ResponseBody |
|||
public TableDataInfo queryList(@RequestBody EnterpriseLawEnforcement enterpriseLawEnforcement) |
|||
{ |
|||
// startPage();
|
|||
int total = enterpriseLawEnforcementService.selectTotal(enterpriseLawEnforcement); |
|||
List<EnterpriseLawEnforcement> list = enterpriseLawEnforcementService.selectEnterpriseLawEnforcementList2(enterpriseLawEnforcement); |
|||
|
|||
TableDataInfo rspData = new TableDataInfo(); |
|||
rspData.setCode(0); |
|||
rspData.setRows(list); |
|||
rspData.setTotal(total); |
|||
return rspData; |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 查看预约记录详情 |
|||
*/ |
|||
@GetMapping( "/getById/{id}") |
|||
@ResponseBody |
|||
public ZDResponse getById(@PathVariable("id") String id) |
|||
{ |
|||
EnterpriseLawEnforcement enterpriseLawEnforcement = |
|||
enterpriseLawEnforcementService.selectEnterpriseLawEnforcementById(id); |
|||
// 判断是否超时
|
|||
LocalDate checkTime = LocalDate.parse(enterpriseLawEnforcement.getCheckTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
|||
long daysBetween = ChronoUnit.DAYS.between(LocalDate.now(), checkTime); |
|||
if (daysBetween < 0) { |
|||
enterpriseLawEnforcement.setStatus(3); |
|||
} |
|||
return ZDResponse.success("查询成功",enterpriseLawEnforcement); |
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue