调整
This commit is contained in:
parent
8e4eb0d6b7
commit
b9cfd99360
@ -1,11 +1,14 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.controller;
|
||||
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsAddForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.vo.AffairsVO;
|
||||
import net.lab1024.sa.admin.module.business.affairs.service.AffairsService;
|
||||
import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeDetailVO;
|
||||
import net.lab1024.sa.base.common.domain.ValidateList;
|
||||
import net.lab1024.sa.base.common.util.SmartRequestUtil;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
@ -18,6 +21,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
@ -69,4 +73,14 @@ public class AffairsController {
|
||||
public ResponseDTO<String> batchDelete(@PathVariable Long affairsId) {
|
||||
return affairsService.delete(affairsId);
|
||||
}
|
||||
|
||||
@Operation(summary = "三务公开-查看")
|
||||
@GetMapping("/affairs/view/{affairsId}")
|
||||
public ResponseDTO<Object> view(@PathVariable Long affairsId, HttpServletRequest request) {
|
||||
return affairsService.view(
|
||||
affairsId,
|
||||
ServletUtil.getClientIP(request),
|
||||
request.getHeader("User-Agent")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,67 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.controller;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsViewRecordAddForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsViewRecordQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsViewRecordUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.vo.AffairsViewRecordVO;
|
||||
import net.lab1024.sa.admin.module.business.affairs.service.AffairsViewRecordService;
|
||||
import net.lab1024.sa.base.common.domain.ValidateList;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 Controller
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@Tag(name = "三务公开-查看记录")
|
||||
public class AffairsViewRecordController {
|
||||
|
||||
@Resource
|
||||
private AffairsViewRecordService affairsViewRecordService;
|
||||
|
||||
@Operation(summary = "分页查询 @author pengjie")
|
||||
@PostMapping("/affairsViewRecord/queryPage")
|
||||
public ResponseDTO<PageResult<AffairsViewRecordVO>> queryPage(@RequestBody @Valid AffairsViewRecordQueryForm queryForm) {
|
||||
return ResponseDTO.ok(affairsViewRecordService.queryPage(queryForm));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加 @author pengjie")
|
||||
@PostMapping("/affairsViewRecord/add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid AffairsViewRecordAddForm addForm) {
|
||||
return affairsViewRecordService.add(addForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "更新 @author pengjie")
|
||||
@PostMapping("/affairsViewRecord/update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid AffairsViewRecordUpdateForm updateForm) {
|
||||
return affairsViewRecordService.update(updateForm);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除 @author pengjie")
|
||||
@PostMapping("/affairsViewRecord/batchDelete")
|
||||
public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
|
||||
return affairsViewRecordService.batchDelete(idList);
|
||||
}
|
||||
|
||||
@Operation(summary = "单个删除 @author pengjie")
|
||||
@GetMapping("/affairsViewRecord/delete/{affairsId}")
|
||||
public ResponseDTO<String> batchDelete(@PathVariable Long affairsId) {
|
||||
return affairsViewRecordService.delete(affairsId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.dao;
|
||||
|
||||
import java.util.List;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.entity.AffairsViewRecordEntity;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsViewRecordQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.vo.AffairsViewRecordVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 Dao
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@Mapper
|
||||
@Component
|
||||
public interface AffairsViewRecordDao extends BaseMapper<AffairsViewRecordEntity> {
|
||||
|
||||
/**
|
||||
* 分页 查询
|
||||
*
|
||||
* @param page
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
List<AffairsViewRecordVO> queryPage(Page page, @Param("queryForm") AffairsViewRecordQueryForm queryForm);
|
||||
|
||||
void insertViewRecord(@Param("affairsId") Long affairsId, @Param("employeeId") Long employeeId, @Param("ip") String ip, @Param("userAgent") String userAgent,@Param("pageViewCount") Integer pageViewCount);
|
||||
|
||||
void updateViewRecord(@Param("affairsId")Long affairsId, @Param("employeeId")Long employeeId,@Param("ip") String ip, @Param("userAgent")String userAgent);
|
||||
}
|
||||
@ -34,7 +34,7 @@ public class AffairsEntity {
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 可见范围类型(1:人员;2:组织)
|
||||
* 可见范围类型(1:人员;2:部门)
|
||||
*/
|
||||
private Integer rangeType;
|
||||
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 实体类
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@Data
|
||||
@TableName("affairs_view_record")
|
||||
public class AffairsViewRecordEntity {
|
||||
|
||||
/**
|
||||
* 三务公开id
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
private Long affairsId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 查看次数
|
||||
*/
|
||||
private Integer pageViewCount;
|
||||
|
||||
/**
|
||||
* 首次ip
|
||||
*/
|
||||
private String firstIp;
|
||||
|
||||
/**
|
||||
* 首次用户设备等标识
|
||||
*/
|
||||
private String firstUserAgent;
|
||||
|
||||
/**
|
||||
* 最后一次ip
|
||||
*/
|
||||
private String lastIp;
|
||||
|
||||
/**
|
||||
* 最后一次用户设备等标识
|
||||
*/
|
||||
private String lastUserAgent;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.domain.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 新建表单
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AffairsViewRecordAddForm {
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "查看次数")
|
||||
private Integer pageViewCount;
|
||||
|
||||
@Schema(description = "首次ip")
|
||||
private String firstIp;
|
||||
|
||||
@Schema(description = "首次用户设备等标识")
|
||||
private String firstUserAgent;
|
||||
|
||||
@Schema(description = "最后一次ip")
|
||||
private String lastIp;
|
||||
|
||||
@Schema(description = "最后一次用户设备等标识")
|
||||
private String lastUserAgent;
|
||||
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.domain.form;
|
||||
|
||||
import net.lab1024.sa.base.common.domain.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 分页查询表单
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class AffairsViewRecordQueryForm extends PageParam {
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "三务公开id")
|
||||
private Long affairsId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.domain.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 更新表单
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AffairsViewRecordUpdateForm {
|
||||
|
||||
@Schema(description = "三务公开id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "三务公开id 不能为空")
|
||||
private Long affairsId;
|
||||
|
||||
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "用户id 不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "查看次数")
|
||||
private Integer pageViewCount;
|
||||
|
||||
@Schema(description = "首次ip")
|
||||
private String firstIp;
|
||||
|
||||
@Schema(description = "首次用户设备等标识")
|
||||
private String firstUserAgent;
|
||||
|
||||
@Schema(description = "最后一次ip")
|
||||
private String lastIp;
|
||||
|
||||
@Schema(description = "最后一次用户设备等标识")
|
||||
private String lastUserAgent;
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.domain.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 列表VO
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AffairsViewRecordVO {
|
||||
|
||||
|
||||
@Schema(description = "三务公开id")
|
||||
private Long affairsId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "查看次数")
|
||||
private Integer pageViewCount;
|
||||
|
||||
@Schema(description = "首次ip")
|
||||
private String firstIp;
|
||||
|
||||
@Schema(description = "首次用户设备等标识")
|
||||
private String firstUserAgent;
|
||||
|
||||
@Schema(description = "最后一次ip")
|
||||
private String lastIp;
|
||||
|
||||
@Schema(description = "最后一次用户设备等标识")
|
||||
private String lastUserAgent;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.manager;
|
||||
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.entity.AffairsViewRecordEntity;
|
||||
import net.lab1024.sa.admin.module.business.affairs.dao.AffairsViewRecordDao;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 Manager
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
@Service
|
||||
public class AffairsViewRecordManager extends ServiceImpl<AffairsViewRecordDao, AffairsViewRecordEntity> {
|
||||
|
||||
|
||||
}
|
||||
@ -3,12 +3,18 @@ package net.lab1024.sa.admin.module.business.affairs.service;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import net.lab1024.sa.admin.module.business.affairs.dao.AffairsDao;
|
||||
import net.lab1024.sa.admin.module.business.affairs.dao.AffairsViewRecordDao;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.entity.AffairsEntity;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.entity.AffairsViewRecordEntity;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsAddForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.vo.AffairsVO;
|
||||
import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeDetailVO;
|
||||
import net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeUpdateFormVO;
|
||||
import net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity;
|
||||
import net.lab1024.sa.base.common.domain.RequestUser;
|
||||
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||
@ -35,6 +41,9 @@ public class AffairsService {
|
||||
@Resource
|
||||
private AffairsDao affairsDao;
|
||||
|
||||
@Resource
|
||||
private AffairsViewRecordDao affairsViewRecordDao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -99,4 +108,30 @@ public class AffairsService {
|
||||
affairsDao.deleteById(affairsId);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看三务公开
|
||||
*/
|
||||
public ResponseDTO<Object> view(Long affairsId, String ip, String userAgent) {
|
||||
AffairsEntity affairsEntity = affairsDao.selectById(affairsId);
|
||||
if (affairsEntity == null) {
|
||||
return ResponseDTO.userErrorParam("三务公开不存在");
|
||||
}
|
||||
|
||||
RequestUser requestUser = SmartRequestUtil.getRequestUser();
|
||||
if ((affairsEntity.getRangeType() == 1 && !affairsEntity.getRange().contains(requestUser.getUserId().toString())) &&
|
||||
(affairsEntity.getRangeType() == 2 && !affairsEntity.getRange().contains(requestUser.getVillageId().toString()))) {
|
||||
return ResponseDTO.userErrorParam("对不起,您没有权限查看内容");
|
||||
}
|
||||
|
||||
AffairsViewRecordEntity affairsViewRecordEntity = affairsViewRecordDao.selectOne(Wrappers.<AffairsViewRecordEntity>lambdaQuery()
|
||||
.eq(AffairsViewRecordEntity::getAffairsId, affairsId)
|
||||
.eq(AffairsViewRecordEntity::getUserId, requestUser.getUserId()));
|
||||
if (affairsViewRecordEntity == null) {
|
||||
affairsViewRecordDao.insertViewRecord(affairsId, requestUser.getUserId(), ip, userAgent, 1);
|
||||
} else {
|
||||
affairsViewRecordDao.updateViewRecord(affairsId, requestUser.getUserId(), ip, userAgent);
|
||||
}
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
package net.lab1024.sa.admin.module.business.affairs.service;
|
||||
|
||||
import java.util.List;
|
||||
import net.lab1024.sa.admin.module.business.affairs.dao.AffairsViewRecordDao;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.entity.AffairsViewRecordEntity;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsViewRecordAddForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsViewRecordQueryForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.form.AffairsViewRecordUpdateForm;
|
||||
import net.lab1024.sa.admin.module.business.affairs.domain.vo.AffairsViewRecordVO;
|
||||
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 三务公开-查看记录 Service
|
||||
*
|
||||
* @Author pengjie
|
||||
* @Date 2025-07-18 11:57:59
|
||||
* @Copyright jxj
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class AffairsViewRecordService {
|
||||
|
||||
@Resource
|
||||
private AffairsViewRecordDao affairsViewRecordDao;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param queryForm
|
||||
* @return
|
||||
*/
|
||||
public PageResult<AffairsViewRecordVO> queryPage(AffairsViewRecordQueryForm queryForm) {
|
||||
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||
List<AffairsViewRecordVO> list = affairsViewRecordDao.queryPage(page, queryForm);
|
||||
PageResult<AffairsViewRecordVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public ResponseDTO<String> add(AffairsViewRecordAddForm addForm) {
|
||||
AffairsViewRecordEntity affairsViewRecordEntity = SmartBeanUtil.copy(addForm, AffairsViewRecordEntity.class);
|
||||
affairsViewRecordDao.insert(affairsViewRecordEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param updateForm
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> update(AffairsViewRecordUpdateForm updateForm) {
|
||||
AffairsViewRecordEntity affairsViewRecordEntity = SmartBeanUtil.copy(updateForm, AffairsViewRecordEntity.class);
|
||||
affairsViewRecordDao.updateById(affairsViewRecordEntity);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
public ResponseDTO<String> batchDelete(List<Long> idList) {
|
||||
if (CollectionUtils.isEmpty(idList)){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
affairsViewRecordDao.deleteBatchIds(idList);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个删除
|
||||
*/
|
||||
public ResponseDTO<String> delete(Long affairsId) {
|
||||
if (null == affairsId){
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
affairsViewRecordDao.deleteById(affairsId);
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
}
|
||||
@ -20,4 +20,6 @@ public class PetitionersTypeQueryForm extends PageParam {
|
||||
@Schema(description = "父ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "类型名称")
|
||||
private String name;
|
||||
}
|
||||
|
||||
@ -181,4 +181,25 @@ public class VillagerVO {
|
||||
|
||||
@Schema(description = "乡村名称")
|
||||
private String villageName;
|
||||
|
||||
@Schema(description = "刑满释放人员ID")
|
||||
private Long releaseId;
|
||||
|
||||
@Schema(description = "社区矫正人员ID")
|
||||
private Long correctId;
|
||||
|
||||
@Schema(description = "精神病人员ID")
|
||||
private Long mentalDiseaseId;
|
||||
|
||||
@Schema(description = "吸毒人员ID")
|
||||
private Long drugsId;
|
||||
|
||||
@Schema(description = "艾滋病人员ID")
|
||||
private Long aidsId;
|
||||
|
||||
@Schema(description = "重点青少年ID")
|
||||
private Long adolescentId;
|
||||
|
||||
@Schema(description = "信访人员ID")
|
||||
private Long petitionersId;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ public class PetitionersTypeService {
|
||||
public List<PetitionersTypeVO> queryTree(PetitionersTypeQueryForm queryForm) {
|
||||
queryForm.setParentId(0L);
|
||||
List<PetitionersTypeVO> parentList = petitionersTypeDao.queryPage(queryForm);
|
||||
List<PetitionersTypeVO> allList = petitionersTypeDao.queryPage(null);
|
||||
List<PetitionersTypeVO> allList = petitionersTypeDao.queryPage(new PetitionersTypeQueryForm());
|
||||
getChildren(parentList, allList);
|
||||
return parentList;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte
|
||||
if (sct == SqlCommandType.INSERT) {
|
||||
Class<?> clazz = Class.forName(ms.getId().substring(0, ms.getId().lastIndexOf(StringPool.DOT)));
|
||||
DataScope annotation = clazz.getAnnotation(DataScope.class);
|
||||
if (annotation == null || annotation.type() == 2) {
|
||||
if (annotation == null) {
|
||||
return;
|
||||
}
|
||||
PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql();
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.lab1024.sa.admin.module.business.affairs.dao.AffairsViewRecordDao">
|
||||
|
||||
<!-- 查询结果列 -->
|
||||
<sql id="base_columns">
|
||||
affairs_view_record.affairs_id,
|
||||
affairs_view_record.user_id,
|
||||
affairs_view_record.user_name,
|
||||
affairs_view_record.page_view_count,
|
||||
affairs_view_record.first_ip,
|
||||
affairs_view_record.first_user_agent,
|
||||
affairs_view_record.last_ip,
|
||||
affairs_view_record.last_user_agent,
|
||||
affairs_view_record.create_time,
|
||||
affairs_view_record.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.affairs.domain.vo.AffairsViewRecordVO">
|
||||
SELECT
|
||||
<include refid="base_columns"/>
|
||||
FROM affairs_view_record
|
||||
<where>
|
||||
<!--用户id-->
|
||||
<if test="queryForm.userId != null">
|
||||
AND affairs_view_record.user_id = #{queryForm.userId}
|
||||
</if>
|
||||
<!--三务公开id-->
|
||||
<if test="queryForm.affairsId != null">
|
||||
AND affairs_view_record.affairs_id = #{queryForm.affairsId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertViewRecord">
|
||||
insert into affairs_view_record (affairs_id, user_id, first_ip, first_user_agent, page_view_count)
|
||||
values (#{affairsId}, #{employeeId}, #{ip}, #{userAgent}, #{pageViewCount})
|
||||
</insert>
|
||||
|
||||
<update id="updateViewRecord">
|
||||
update affairs_view_record
|
||||
set page_view_count = page_view_count + 1,
|
||||
last_ip = #{ip},
|
||||
last_user_agent = #{userAgent}
|
||||
where affairs_id = #{affairs_id}
|
||||
and user_id = #{employeeId}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -25,7 +25,7 @@
|
||||
AND INSTR(petitioners_type.name,#{queryForm.name})
|
||||
</if>
|
||||
<!--父ID-->
|
||||
<if test="queryForm.parentId != null and queryForm.parentId != ''">
|
||||
<if test="queryForm.parentId != null">
|
||||
AND petitioners_type.parent_id = #{queryForm.parentId}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user