Browse Source

监督端-普法服务

dev-V1.0.1
niujiyi 5 months ago
parent
commit
21fb6a9d87
  1. 4
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppNonEnforcementRegistrationController.java
  2. 106
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/web/supervision/EnforcementEducationServicesController.java
  3. 25
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/bo/EnforcementEducationServicesBo.java
  4. 19
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/EnforcementEducationServicesVo.java
  5. 19
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/IEnforcementEducationServicesService.java
  6. 138
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EnforcementEducationServicesServiceImpl.java

4
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppNonEnforcementRegistrationController.java

@ -1,5 +1,6 @@
package com.zdxt.enforcementcode.controller.app.enforcement; package com.zdxt.enforcementcode.controller.app.enforcement;
import cn.dev33.satoken.annotation.SaIgnore;
import com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo; import com.zdxt.enforcementcode.domain.bo.NonEnforcementRegistrationBo;
import com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo; import com.zdxt.enforcementcode.domain.vo.NonEnforcementRegistrationVo;
import com.zdxt.enforcementcode.service.INonEnforcementRegistrationService; import com.zdxt.enforcementcode.service.INonEnforcementRegistrationService;
@ -34,8 +35,9 @@ public class AppNonEnforcementRegistrationController extends BaseController {
} }
/** /**
* 执法端-非行政查询执法登记列表 * 执法端-非行政查询执法登记列表(历史活动)
*/ */
@SaIgnore
@GetMapping("/queryList") @GetMapping("/queryList")
public TableDataInfo queryList(NonEnforcementRegistrationBo bo) public TableDataInfo queryList(NonEnforcementRegistrationBo bo)
{ {

106
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/web/supervision/EnforcementEducationServicesController.java

@ -0,0 +1,106 @@
package com.zdxt.enforcementcode.controller.web.supervision;
import java.util.List;
import cn.dev33.satoken.annotation.SaIgnore;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import com.zdxt.enforcementcode.domain.vo.EnforcementEducationServicesVo;
import com.zdxt.enforcementcode.domain.bo.EnforcementEducationServicesBo;
import com.zdxt.enforcementcode.service.IEnforcementEducationServicesService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* 普法服务主表
*
* @author niujiyi
* @date 2026-05-26
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/web/enforcementcode/educationServices")
public class EnforcementEducationServicesController extends BaseController {
private final IEnforcementEducationServicesService enforcementEducationServicesService;
/**
* 查询普法服务主表列表
*/
//@SaCheckPermission("enforcementcode:educationServices:list")
@SaIgnore
@GetMapping("/list")
public TableDataInfo<EnforcementEducationServicesVo> list(EnforcementEducationServicesBo bo, PageQuery pageQuery) {
return enforcementEducationServicesService.queryPageList(bo, pageQuery);
}
/**
* 导出普法服务主表列表
*/
@SaCheckPermission("enforcementcode:educationServices:export")
@Log(title = "普法服务主表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(EnforcementEducationServicesBo bo, HttpServletResponse response) {
List<EnforcementEducationServicesVo> list = enforcementEducationServicesService.queryList(bo);
ExcelUtil.exportExcel(list, "普法服务主表", EnforcementEducationServicesVo.class, response);
}
/**
* 获取普法服务主表详细信息
*
* @param id 主键
*/
//@SaCheckPermission("enforcementcode:educationServices:query")
@SaIgnore
@GetMapping("/details")
public R<EnforcementEducationServicesVo> details(String id) {
return R.ok(enforcementEducationServicesService.queryEducationServicesById(id));
}
/**
* 新增普法服务主表
*/
//@SaCheckPermission("enforcementcode:educationServices:add")
@SaIgnore
@Log(title = "普法服务主表", businessType = BusinessType.INSERT)
@PostMapping("/add")
public R<Void> add(@Validated(AddGroup.class) @RequestBody EnforcementEducationServicesBo bo) {
return toAjax(enforcementEducationServicesService.insertEducationServices(bo));
}
/**
* 修改普法服务主表
*/
//@SaCheckPermission("enforcementcode:educationServices:edit")
@Log(title = "普法服务主表", businessType = BusinessType.UPDATE)
@SaIgnore
@PostMapping("/edit")
public R<Void> edit(@RequestBody EnforcementEducationServicesBo bo) {
return toAjax(enforcementEducationServicesService.updateByBo(bo));
}
/**
* 删除普法服务主表
*
* @param ids 主键串
*/
//@SaCheckPermission("enforcementcode:educationServices:remove")
@SaIgnore
@GetMapping("/remove")
public R<Void> remove(String[] ids) {
return toAjax(enforcementEducationServicesService.deleteWithValidByIds(List.of(ids), true));
}
}

25
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/bo/EnforcementEducationServicesBo.java

@ -9,6 +9,9 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*; import jakarta.validation.constraints.*;
import java.util.Date;
import java.util.List;
/** /**
* 执法信息发布主业务对象 enforcement_education_services * 执法信息发布主业务对象 enforcement_education_services
* *
@ -23,31 +26,26 @@ public class EnforcementEducationServicesBo extends BaseEntity {
/** /**
* 主键ID * 主键ID
*/ */
@NotBlank(message = "主键ID不能为空", groups = { EditGroup.class })
private String id; private String id;
/** /**
* 标题 * 标题
*/ */
@NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class })
private String title; private String title;
/** /**
* 发布部门ID(多个用逗号分隔) * 发布部门ID(多个用逗号分隔)
*/ */
@NotBlank(message = "发布部门ID(多个用逗号分隔)不能为空", groups = { AddGroup.class, EditGroup.class })
private String publishDeptIds; private String publishDeptIds;
/** /**
* 发布部门名称(冗余存储) * 发布部门名称(冗余存储)
*/ */
@NotBlank(message = "发布部门名称(冗余存储)不能为空", groups = { AddGroup.class, EditGroup.class })
private String publishDeptNames; private String publishDeptNames;
/** /**
* 发布平台 0-全部 1-监督端 2-执法端 3-企业端 * 发布平台 0-全部 1-监督端 2-执法端 3-企业端
*/ */
@NotNull(message = "发布平台 0-全部 1-监督端 2-执法端 3-企业端不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer targetPlatform; private Integer targetPlatform;
/** /**
@ -58,7 +56,6 @@ public class EnforcementEducationServicesBo extends BaseEntity {
/** /**
* 来源类型 1|原生 2|转载 * 来源类型 1|原生 2|转载
*/ */
@NotNull(message = "来源类型 1|原生 2|转载不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer sourceType; private Integer sourceType;
/** /**
@ -79,7 +76,6 @@ public class EnforcementEducationServicesBo extends BaseEntity {
/** /**
* 浏览次数 * 浏览次数
*/ */
@NotNull(message = "浏览次数不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer viewCount; private Integer viewCount;
/** /**
@ -105,7 +101,6 @@ public class EnforcementEducationServicesBo extends BaseEntity {
/** /**
* 是否删除 0=否 1=是 * 是否删除 0=否 1=是
*/ */
@NotNull(message = "是否删除 0=否 1=是不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer isDelete; private Integer isDelete;
/** /**
@ -113,5 +108,19 @@ public class EnforcementEducationServicesBo extends BaseEntity {
*/ */
private String remark; private String remark;
/**
* 附件列表
*/
private List<ZdxtFileBo> fileList;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
} }

19
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/EnforcementEducationServicesVo.java

@ -7,7 +7,7 @@ import lombok.Data;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
@ -60,12 +60,24 @@ public class EnforcementEducationServicesVo implements Serializable {
@ExcelProperty(value = "内容分类") @ExcelProperty(value = "内容分类")
private Integer contentType; private Integer contentType;
/**
* 内容分类标签(字典翻译)
*/
@ExcelProperty(value = "内容分类名称")
private String contentTypeLabel;
/** /**
* 来源类型 1|原生 2|转载 * 来源类型 1|原生 2|转载
*/ */
@ExcelProperty(value = "来源类型 1|原生 2|转载") @ExcelProperty(value = "来源类型 1|原生 2|转载")
private Integer sourceType; private Integer sourceType;
/**
* 发布平台标签(字典翻译)
*/
@ExcelProperty(value = "发布平台名称")
private String targetPlatformLabel;
/** /**
* 服务信息(富文本内容) * 服务信息(富文本内容)
*/ */
@ -132,4 +144,9 @@ public class EnforcementEducationServicesVo implements Serializable {
private Integer isRead; private Integer isRead;
/**
* 附件信息
*/
@ExcelProperty(value = "附件信息")
private List<ZdxtFileVo> fileList;
} }

19
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/IEnforcementEducationServicesService.java

@ -23,7 +23,13 @@ public interface IEnforcementEducationServicesService {
* @return 执法信息发布主 * @return 执法信息发布主
*/ */
EnforcementEducationServicesVo queryById(String id); EnforcementEducationServicesVo queryById(String id);
/**
* 查询普法信息详情
*
* @param id 主键
* @return 详情
*/
EnforcementEducationServicesVo queryEducationServicesById(String id);
/** /**
* 分页查询执法信息发布主列表 * 分页查询执法信息发布主列表
* *
@ -49,6 +55,14 @@ public interface IEnforcementEducationServicesService {
*/ */
Boolean insertByBo(EnforcementEducationServicesBo bo); Boolean insertByBo(EnforcementEducationServicesBo bo);
/**
* 监督端-新增执法信息发布主
*
* @param bo 执法信息发布主
* @return 是否新增成功
*/
Boolean insertEducationServices(EnforcementEducationServicesBo bo);
/** /**
* 修改执法信息发布主 * 修改执法信息发布主
* *
@ -72,4 +86,7 @@ public interface IEnforcementEducationServicesService {
* @return 未读普法消息数量 * @return 未读普法消息数量
*/ */
Long countUnreadEducationServices(); Long countUnreadEducationServices();
} }

138
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EnforcementEducationServicesServiceImpl.java

@ -3,7 +3,11 @@ package com.zdxt.enforcementcode.service.impl;
import com.zdxt.enforcementcode.common.commonenum.MsgSourceTypeEnum; import com.zdxt.enforcementcode.common.commonenum.MsgSourceTypeEnum;
import com.zdxt.enforcementcode.common.commonenum.PlatformTypeEnums; import com.zdxt.enforcementcode.common.commonenum.PlatformTypeEnums;
import com.zdxt.enforcementcode.domain.bean.EnforcementEducationServices; import com.zdxt.enforcementcode.domain.bean.EnforcementEducationServices;
import com.zdxt.enforcementcode.domain.vo.ZdxtFileVo;
import com.zdxt.enforcementcode.service.ISysMessageViewLogService; import com.zdxt.enforcementcode.service.ISysMessageViewLogService;
import com.zdxt.enforcementcode.domain.bo.ZdxtFileBo;
import com.zdxt.enforcementcode.service.IZdxtFileService;
import org.dromara.common.core.service.DictService;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -43,6 +47,34 @@ public class EnforcementEducationServicesServiceImpl implements IEnforcementEduc
private final ISysMessageViewLogService sysMessageViewLogService; private final ISysMessageViewLogService sysMessageViewLogService;
private final IZdxtFileService zdxtFileService;
private final DictService dictService;
/**
* 查询执法信息发布主
*
* @param id 主键
* @return 执法信息发布主
*/
@Override
public EnforcementEducationServicesVo queryEducationServicesById(String id){
EnforcementEducationServicesVo vo = baseMapper.selectVoById(id);
if (vo != null) {
// 回显附件信息
ZdxtFileBo fileBo = new ZdxtFileBo();
fileBo.setBusinessId(id);
List<ZdxtFileVo> fileList = zdxtFileService.queryList(fileBo);
vo.setFileList(fileList);
// 设置字典标签
setDictLabels(vo);
}
return vo;
}
/** /**
* 查询执法信息发布主 * 查询执法信息发布主
* *
@ -73,8 +105,10 @@ public class EnforcementEducationServicesServiceImpl implements IEnforcementEduc
LambdaQueryWrapper<EnforcementEducationServices> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<EnforcementEducationServices> lqw = buildQueryWrapper(bo);
Page<EnforcementEducationServicesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<EnforcementEducationServicesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
// 为每条记录设置是否已读状态
// 为每条记录设置字典标签和已读状态
if (result.getRecords() != null && !result.getRecords().isEmpty()) { if (result.getRecords() != null && !result.getRecords().isEmpty()) {
setDictLabels(result.getRecords());
setReadStatus(result.getRecords()); setReadStatus(result.getRecords());
} }
@ -90,7 +124,50 @@ public class EnforcementEducationServicesServiceImpl implements IEnforcementEduc
@Override @Override
public List<EnforcementEducationServicesVo> queryList(EnforcementEducationServicesBo bo) { public List<EnforcementEducationServicesVo> queryList(EnforcementEducationServicesBo bo) {
LambdaQueryWrapper<EnforcementEducationServices> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<EnforcementEducationServices> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw); List<EnforcementEducationServicesVo> list = baseMapper.selectVoList(lqw);
// 设置字典标签
if (list != null && !list.isEmpty()) {
setDictLabels(list);
}
return list;
}
/**
* 为单条记录设置字典标签
*
* @param vo 记录对象
*/
private void setDictLabels(EnforcementEducationServicesVo vo) {
if (vo == null) {
return;
}
// 内容分类标签
if (vo.getContentType() != null) {
String contentTypeLabel = dictService.getDictLabel("web_content_classification", vo.getContentType().toString());
vo.setContentTypeLabel(contentTypeLabel);
}
// 发布平台标签
if (vo.getTargetPlatform() != null) {
String targetPlatformLabel = dictService.getDictLabel("web_publishing_platform", vo.getTargetPlatform().toString());
vo.setTargetPlatformLabel(targetPlatformLabel);
}
}
/**
* 为列表设置字典标签
*
* @param records 记录列表
*/
private void setDictLabels(List<EnforcementEducationServicesVo> records) {
if (records == null || records.isEmpty()) {
return;
}
records.forEach(this::setDictLabels);
} }
/** /**
@ -162,7 +239,7 @@ public class EnforcementEducationServicesServiceImpl implements IEnforcementEduc
lqw.orderByAsc(EnforcementEducationServices::getId); lqw.orderByAsc(EnforcementEducationServices::getId);
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), EnforcementEducationServices::getTitle, bo.getTitle()); lqw.eq(StringUtils.isNotBlank(bo.getTitle()), EnforcementEducationServices::getTitle, bo.getTitle());
lqw.eq(StringUtils.isNotBlank(bo.getPublishDeptIds()), EnforcementEducationServices::getPublishDeptIds, bo.getPublishDeptIds()); lqw.eq(StringUtils.isNotBlank(bo.getPublishDeptIds()), EnforcementEducationServices::getPublishDeptIds, bo.getPublishDeptIds());
lqw.eq(StringUtils.isNotBlank(bo.getPublishDeptNames()), EnforcementEducationServices::getPublishDeptNames, bo.getPublishDeptNames()); lqw.like(StringUtils.isNotBlank(bo.getPublishDeptNames()), EnforcementEducationServices::getPublishDeptNames, bo.getPublishDeptNames());
lqw.eq(bo.getTargetPlatform() != null, EnforcementEducationServices::getTargetPlatform, bo.getTargetPlatform()); lqw.eq(bo.getTargetPlatform() != null, EnforcementEducationServices::getTargetPlatform, bo.getTargetPlatform());
lqw.eq(bo.getContentType() != null, EnforcementEducationServices::getContentType, bo.getContentType()); lqw.eq(bo.getContentType() != null, EnforcementEducationServices::getContentType, bo.getContentType());
lqw.eq(bo.getSourceType() != null, EnforcementEducationServices::getSourceType, bo.getSourceType()); lqw.eq(bo.getSourceType() != null, EnforcementEducationServices::getSourceType, bo.getSourceType());
@ -175,6 +252,16 @@ public class EnforcementEducationServicesServiceImpl implements IEnforcementEduc
lqw.like(StringUtils.isNotBlank(bo.getCreateByName()), EnforcementEducationServices::getCreateByName, bo.getCreateByName()); lqw.like(StringUtils.isNotBlank(bo.getCreateByName()), EnforcementEducationServices::getCreateByName, bo.getCreateByName());
lqw.like(StringUtils.isNotBlank(bo.getUpdateByName()), EnforcementEducationServices::getUpdateByName, bo.getUpdateByName()); lqw.like(StringUtils.isNotBlank(bo.getUpdateByName()), EnforcementEducationServices::getUpdateByName, bo.getUpdateByName());
lqw.eq(bo.getIsDelete() != null, EnforcementEducationServices::getIsDelete, bo.getIsDelete()); lqw.eq(bo.getIsDelete() != null, EnforcementEducationServices::getIsDelete, bo.getIsDelete());
// 创建时间范围筛选
if (bo.getStartTime() != null && bo.getEndTime() != null) {
lqw.between(EnforcementEducationServices::getCreateTime, bo.getStartTime(), bo.getEndTime());
} else if (bo.getStartTime() != null) {
lqw.ge(EnforcementEducationServices::getCreateTime, bo.getStartTime());
} else if (bo.getEndTime() != null) {
lqw.le(EnforcementEducationServices::getCreateTime, bo.getEndTime());
}
return lqw; return lqw;
} }
@ -195,6 +282,51 @@ public class EnforcementEducationServicesServiceImpl implements IEnforcementEduc
return flag; return flag;
} }
/**
* 监督端-新增执法信息发布主
*
* @param bo 执法信息发布主
* @return 是否新增成功
*/
@Override
public Boolean insertEducationServices(EnforcementEducationServicesBo bo) {
EnforcementEducationServices add = MapstructUtils.convert(bo, EnforcementEducationServices.class);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setId(add.getId());
// 保存附件信息
if (bo.getFileList() != null && !bo.getFileList().isEmpty()) {
saveAttachmentFiles(bo.getFileList(), add.getId());
}
}
return flag;
}
/**
* 批量保存附件信息
*
* @param fileList 附件列表
* @param businessId 业务ID(普法服务主表ID)
*/
private void saveAttachmentFiles(List<ZdxtFileBo> fileList, String businessId) {
for (ZdxtFileBo fileBo : fileList) {
// 设置业务ID关联
fileBo.setBusinessId(businessId);
// 保存附件
try {
zdxtFileService.insertByBo(fileBo);
log.info("成功保存附件: businessId={}, fileName={}", businessId, fileBo.getFileName());
} catch (Exception e) {
log.error("保存附件失败: businessId={}, fileName={}, error={}",
businessId, fileBo.getFileName(), e.getMessage(), e);
}
}
}
/** /**
* 修改执法信息发布主 * 修改执法信息发布主
* *

Loading…
Cancel
Save