Browse Source

执法记录转发

master
DX 2 months ago
parent
commit
840287f2b8
  1. 15
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/EnterpriseInspectionsController.java
  2. 15
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/InspectionsLogController.java
  3. 5
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/vo/InspectionsLogRespVO.java
  4. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java
  5. 20
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/DeptUserReqVO.java
  6. 4
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/inspectionslog/InspectionsLogDO.java
  7. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java
  8. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java
  9. 9
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java
  10. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/fileInfo/FileInfoService.java
  11. 26
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/fileInfo/FileInfoServiceImpl.java
  12. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java
  13. 31
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java
  14. 8
      yudao-server/src/main/resources/application-local.yaml

15
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/EnterpriseInspectionsController.java

@ -48,8 +48,9 @@ public class EnterpriseInspectionsController {
@PostMapping("/passOn")
@Operation(summary = "执法记录转交")
@PreAuthorize("@ss.hasPermission('system:enterprise-inspections:create')")
public CommonResult<Long> passOn(@Valid @RequestBody PassOnSaveVO passOnSaveVO) {
return success(enterpriseInspectionsService.passOn(passOnSaveVO));
public CommonResult<String> passOn(@Valid @RequestBody PassOnSaveVO passOnSaveVO) {
enterpriseInspectionsService.passOn(passOnSaveVO);
return success("添加成功");
}
@PutMapping("/update")
@ -86,6 +87,16 @@ public class EnterpriseInspectionsController {
return success(BeanUtils.toBean(pageResult, EnterpriseInspectionsRespVO.class));
}
//listByUserIdAndTaskName
@GetMapping("/getListByUserIdAndTaskName")
@Operation(summary = "PC端获得企业检查记录表,用于记录与企业相关的环保检查信息。分页")
@PreAuthorize("@ss.hasPermission('system:enterprise-inspections:query')")
public CommonResult<List<EnterpriseInspectionsRespVO>> getListByUserIdAndTaskName(@RequestParam("userId") Long userId,
@RequestParam("taskName") String taskName) {
List<EnterpriseInspectionsDO> pageResult = enterpriseInspectionsService.getListByUserIdAndTaskName(userId, taskName);
return success(BeanUtils.toBean(pageResult, EnterpriseInspectionsRespVO.class));
}
@GetMapping("/pcpage")
@Operation(summary = "PC端获得企业检查记录表,用于记录与企业相关的环保检查信息。分页")
@PreAuthorize("@ss.hasPermission('system:enterprise-inspections:query')")

15
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/InspectionsLogController.java

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.inspectionslog;
import cn.iocoder.yudao.module.system.service.fileInfo.FileInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
@ -38,6 +39,8 @@ public class InspectionsLogController {
@Resource
private InspectionsLogService inspectionsLogService;
@Resource
private FileInfoService fileInfoService;
@PostMapping("/create")
@Operation(summary = "创建检查结果日志")
@ -54,7 +57,6 @@ public class InspectionsLogController {
return success(true);
}
@PutMapping("/update")
@Operation(summary = "更新检查结果日志")
@PreAuthorize("@ss.hasPermission('system:inspections-log:update')")
@ -86,6 +88,8 @@ public class InspectionsLogController {
@PreAuthorize("@ss.hasPermission('system:inspections-log:query')")
public CommonResult<PageResult<InspectionsLogRespVO>> getInspectionsLogPage(@Valid InspectionsLogPageReqVO pageReqVO) {
PageResult<InspectionsLogDO> pageResult = inspectionsLogService.getInspectionsLogPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, InspectionsLogRespVO.class));
}
@ -94,6 +98,15 @@ public class InspectionsLogController {
@PreAuthorize("@ss.hasPermission('system:inspections-log:query')")
public CommonResult<List<InspectionsLogRespVO>> getInspectionsLogList(@Valid InspectionsLogPageReqVO pageReqVO) {
List<InspectionsLogDO> list = inspectionsLogService.list(pageReqVO);
if (list != null && list.size() > 0) {
list.forEach(item->{
//图片相关
final List<Map<String, String>> fileList = fileInfoService.getFileList("644", "2", item.getId().toString());
item.setFileList(fileList);
});
}
return success(BeanUtils.toBean(list, InspectionsLogRespVO.class));
}

5
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/vo/InspectionsLogRespVO.java

@ -47,4 +47,7 @@ public class InspectionsLogRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}
@Schema(description = "相关文件")
private List<Map<String, String>> fileList;
}

6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java

@ -132,6 +132,12 @@ public class UserController {
return success(UserConvert.INSTANCE.convertSimpleList(list, deptMap));
}
@GetMapping({"/simple-zg-list"})
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
public CommonResult<List<DeptUserReqVO>> getSimpleUserZGList() {
return success(userService.getSimpleUserZGList());
}
@GetMapping("/get")
@Operation(summary = "获得用户详情")
@Parameter(name = "id", description = "编号", required = true, example = "1024")

20
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/DeptUserReqVO.java

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.system.controller.admin.user.vo.user;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class DeptUserReqVO {
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
private Long id;
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
private String realName;
@Schema(description = "部门ID", example = "我是一个用户")
private Long deptId;
@Schema(description = "部门名称", example = "IT 部")
private String deptName;
}

4
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/inspectionslog/InspectionsLogDO.java

@ -58,5 +58,7 @@ public class InspectionsLogDO extends BaseDO {
//协同人员的id 还是要加上 会有同名的情况
private String cooperateWithIds;
//协同人员是否可以看到任务记录
//相关文件
@TableField(exist = false)
private List<Map<String, String>> fileList;
}

2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java

@ -23,7 +23,7 @@ public interface EnterpriseInspectionsMapper extends BaseMapperX<EnterpriseInspe
.eqIfPresent(EnterpriseInspectionsDO::getTaskId, reqVO.getTaskId())
.eqIfPresent(EnterpriseInspectionsDO::getEnterpriseId, reqVO.getEnterpriseId())
.betweenIfPresent(EnterpriseInspectionsDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(EnterpriseInspectionsDO::getId));
.orderByDesc(EnterpriseInspectionsDO::getCreateTime));
}
default PageResult<EnterpriseInspectionsDO> selectPageGroup(EnterpriseInspectionsPageReqVO reqVO) {

2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java

@ -54,4 +54,6 @@ public interface EnterpriseInspectionsService {
PageResult<EnterpriseInspectionsDO> getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO);
void passOn(PassOnSaveVO passOnSaveVO);
List<EnterpriseInspectionsDO> getListByUserIdAndTaskName(Long userId, String taskName);
}

9
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java

@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.taskinfo.TaskInfoMapper;
import cn.iocoder.yudao.module.system.dal.mysql.tasktag.TaskTagMapper;
import cn.iocoder.yudao.module.system.service.dept.DeptService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -211,6 +212,14 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
}
@Override
public List<EnterpriseInspectionsDO> getListByUserIdAndTaskName(Long userId, String taskName) {
LambdaQueryWrapper<EnterpriseInspectionsDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EnterpriseInspectionsDO::getUserId, userId);
wrapper.eq(EnterpriseInspectionsDO::getTaskName, taskName);
return enterpriseInspectionsMapper.selectList(wrapper);
}
//获得检测记录最新一条
public InspectionsLogDO getInspectionsLogNew(Long inspectionsId) {
QueryWrapper<InspectionsLogDO> wrapper = new QueryWrapper<>();

1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/fileInfo/FileInfoService.java

@ -53,4 +53,5 @@ public interface FileInfoService {
*/
PageResult<FileInfoDO> getFileInfoPage(FileInfoPageReqVO pageReqVO);
List<Map<String,String>> getFileList(String dictType, String dictData, String unitId);
}

26
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/fileInfo/FileInfoServiceImpl.java

@ -1,10 +1,14 @@
package cn.iocoder.yudao.module.system.service.fileInfo;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
import cn.iocoder.yudao.module.system.controller.admin.fileInfo.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -30,6 +34,9 @@ public class FileInfoServiceImpl implements FileInfoService {
@Resource
private FileInfoMapper fileInfoMapper;
@Resource
private FileApi fileApi;
@Override
public Long createFileInfo(FileInfoSaveReqVO createReqVO) {
// 插入
@ -72,4 +79,23 @@ public class FileInfoServiceImpl implements FileInfoService {
return fileInfoMapper.selectPage(pageReqVO);
}
@Override
public List<Map<String, String>> getFileList(String dictType, String dictData, String unitId) {
List<Map<String, String>> mapList = new ArrayList<>();
LambdaQueryWrapper<FileInfoDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FileInfoDO::getDictType, dictType);
wrapper.eq(FileInfoDO::getDictData, dictData);
wrapper.eq(FileInfoDO::getUnitId, unitId);
final List<Long> collect = fileInfoMapper.selectList(wrapper).stream().map(res -> res.getInfraFileId()).collect(Collectors.toList());
if (!collect.isEmpty()) {
final List<Map<String,String>> list = fileApi.listFile(collect);
mapList.addAll(list);
}
return mapList;
}
}

7
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java

@ -7,10 +7,7 @@ import cn.iocoder.yudao.module.system.api.social.dto.SocialUserRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthRegisterReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportExcelVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportRespVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
import cn.iocoder.yudao.module.system.controller.admin.userAuditlog.vo.UserAuditLogSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import com.xingyuv.jushauth.model.AuthUser;
@ -229,4 +226,6 @@ public interface AdminUserService {
AdminUserDO autoRegisterUser(AuthUser authUser, int userType);
void userAudit(UserAuditLogSaveReqVO auditLogSaveReqVO);
List<DeptUserReqVO> getSimpleUserZGList();
}

31
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java

@ -17,10 +17,7 @@ import cn.iocoder.yudao.module.system.api.social.dto.SocialUserRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthRegisterReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportExcelVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportRespVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
import cn.iocoder.yudao.module.system.controller.admin.userAuditlog.vo.UserAuditLogSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO;
@ -36,6 +33,7 @@ import cn.iocoder.yudao.module.system.service.dept.PostService;
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
import cn.iocoder.yudao.module.system.service.userAuditlog.UserAuditLogService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.annotations.VisibleForTesting;
import com.mzt.logapi.context.LogRecordContext;
import com.mzt.logapi.service.impl.DiffParseFunction;
@ -52,6 +50,7 @@ import javax.validation.ConstraintViolationException;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
@ -93,6 +92,8 @@ public class AdminUserServiceImpl implements AdminUserService {
private ConfigApi configApi;
@Resource
private UserAuditLogMapper userAuditLogMapper;
@Resource
private AdminUserMapper adminUserMapper;
@Override
@Transactional(rollbackFor = Exception.class)
@ -579,6 +580,28 @@ public class AdminUserServiceImpl implements AdminUserService {
}
@Override
public List<DeptUserReqVO> getSimpleUserZGList() {
List<DeptUserReqVO> list = new ArrayList<>();
LambdaQueryWrapper<AdminUserDO> wrapper = new LambdaQueryWrapper<>();
wrapper.isNotNull(AdminUserDO::getRealName);
wrapper.eq(AdminUserDO::getStatus, CommonStatusEnum.ENABLE.getStatus());
wrapper.isNotNull(AdminUserDO::getDeptId);
final List<AdminUserDO> adminUserDOS = userMapper.selectList(wrapper);
adminUserDOS.forEach(item->{
DeptUserReqVO deptUserReqVO = new DeptUserReqVO();
deptUserReqVO.setId(item.getId());
deptUserReqVO.setRealName(item.getRealName());
final DeptDO dept = deptService.getDept(item.getDeptId());
deptUserReqVO.setDeptName(dept.getName());
list.add(deptUserReqVO);
});
return list;
}
public void bindSocialUser(Long userId, AuthUser authUser) {
// SocialUserDO socialUser = new SocialUserDO();
// socialUser.setUserId(userId);

8
yudao-server/src/main/resources/application-local.yaml

@ -46,7 +46,7 @@ spring:
primary: master
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/hb-yudao?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
url: jdbc:mysql://192.168.2.5:3306/hb-yudao?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
@ -55,7 +55,7 @@ spring:
# url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例
username: root
password: 123123
password: jingke@123
# username: sa # SQL Server 连接的示例
# password: Yudao@2024 # SQL Server 连接的示例
# username: SYSDBA # DM 连接的示例
@ -185,8 +185,8 @@ wx:
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
# app-id: wx041349c6f39b268b # 测试号(牛希尧提供的)
# secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx5b23ba7a5589ecbb # 测试号(自己的)
secret: 2a7b3b20c537e52e74afd395eb85f61f
app-id: wx6d80755768234f3b # 测试号(自己的)
secret: c8180f2ab1b8454d403c7aa336782e21
# app-id: wxa69ab825b163be19 # 测试号(Kongdy 提供的)
# secret: bd4f9fab889591b62aeac0d7b8d8b4a0
# 存储配置,解决 AccessToken 的跨节点的共享

Loading…
Cancel
Save