Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/EnterpriseInspectionsController.java
master
DX 2 months ago
parent
commit
f678807229
  1. 15
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java
  2. 61
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
  3. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java
  4. 8
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  5. 17
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java
  6. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java
  7. 9
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java
  8. 36
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/EnterpriseInspectionsController.java
  9. 24
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsPageReqVO.java
  10. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsRespVO.java
  11. 20
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/SelectUserChangeVO.java
  12. 55
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/InspectionsLogController.java
  13. 24
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/vo/InspectionsLogAppListVO.java
  14. 4
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/vo/InspectionsLogPageReqVO.java
  15. 12
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/vo/InspectionsLogRespVO.java
  16. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/inspectionslog/vo/InspectionsLogSaveReqVO.java
  17. 32
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/maxkb/MaxkbController.java
  18. 16
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/maxkb/vo/MaxkbdocumentVo.java
  19. 96
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/SignInLogController.java
  20. 39
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/vo/SignInLogPageReqVO.java
  21. 43
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/vo/SignInLogRespVO.java
  22. 32
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/vo/SignInLogSaveReqVO.java
  23. 110
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java
  24. 15
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoPageReqVO.java
  25. 34
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java
  26. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java
  27. 22
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java
  28. 20
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/DeptUserReqVO.java
  29. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSaveReqVO.java
  30. 56
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/weixin/WeChatController.java
  31. 15
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java
  32. 19
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterpriseinspections/EnterpriseInspectionsDO.java
  33. 12
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/inspectionslog/InspectionsLogDO.java
  34. 49
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/signinlog/SignInLogDO.java
  35. 25
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taskinfo/TaskInfoDO.java
  36. 29
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java
  37. 22
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterpriseinspections/EnterpriseInspectionsMapper.java
  38. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/inspectionslog/InspectionsLogMapper.java
  39. 30
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/signinlog/SignInLogMapper.java
  40. 25
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taskinfo/TaskInfoMapper.java
  41. 14
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tasktag/TaskTagMapper.java
  42. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java
  43. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java
  44. 12
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java
  45. 31
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java
  46. 16
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java
  47. 309
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java
  48. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/fileInfo/FileInfoService.java
  49. 26
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/fileInfo/FileInfoServiceImpl.java
  50. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogService.java
  51. 293
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogServiceImpl.java
  52. 13
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/maxkb/MaxkbApiService.java
  53. 72
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/maxkb/MaxkbApiServiceImpl.java
  54. 56
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/signinlog/SignInLogService.java
  55. 74
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/signinlog/SignInLogServiceImpl.java
  56. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryService.java
  57. 36
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryServiceImpl.java
  58. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoService.java
  59. 177
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java
  60. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagService.java
  61. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagServiceImpl.java
  62. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java
  63. 31
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java
  64. 42
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/weixin/TokenValidatorService.java
  65. 67
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/weixin/WeChatService.java
  66. 8
      yudao-server/src/main/resources/application-dev.yaml
  67. 8
      yudao-server/src/main/resources/application-local.yaml
  68. 1
      yudao-server/src/main/resources/application.yaml

15
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java

@ -191,4 +191,19 @@ public interface ErrorCodeConstants {
ErrorCode ENTERPRISE_INSPECTIONS_STATUS_ERROR = new ErrorCode(1-003-002-000, "此状态下,不能转发执法任务");
ErrorCode ENTERPRISE_INSPECTIONS_STATUS_ERROR2 = new ErrorCode(1-003-002-001, "任务不能转给自己");
ErrorCode SIGN_IN_LOG_ERROR = new ErrorCode(1-003-005-001, "打卡记录不存在");
ErrorCode SIGN_IN_LOG_ERROR2 = new ErrorCode(1-003-005-001, "已经打卡,不能重复打卡");
ErrorCode SIGN_IN_LOG_ERROR3 = new ErrorCode(1-003-005-002, "此状态不能打卡");
ErrorCode SIGN_IN_LOG_ERROR4 = new ErrorCode(1-003-005-003, "执行人还未打卡");
ErrorCode SIGN_IN_LOG_ERROR5 = new ErrorCode(1-003-005-003, "只有当前企业执行人才能提交审核");
ErrorCode SIGN_IN_LOG_ERROR6 = new ErrorCode(1-003-005-003, "超过2人才能打开");
}

61
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java

@ -1,10 +1,15 @@
package cn.iocoder.yudao.module.system.controller.admin.auth;
import cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
import cn.iocoder.yudao.framework.security.config.SecurityProperties;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
@ -12,11 +17,14 @@ import cn.iocoder.yudao.module.system.api.social.dto.SocialWxQrcodeReqDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.*;
import cn.iocoder.yudao.module.system.convert.auth.AuthConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum;
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService;
import cn.iocoder.yudao.module.system.service.permission.MenuService;
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
import cn.iocoder.yudao.module.system.service.permission.RoleService;
@ -28,6 +36,7 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -38,10 +47,13 @@ import javax.validation.Valid;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.AUTH_THIRD_LOGIN_NOT_BIND;
@Tag(name = "管理后台 - 认证")
@RestController
@ -70,6 +82,12 @@ public class AuthController {
private SocialUserService socialUserService;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private OAuth2TokenService oAuth2TokenService;
@PostMapping("/login")
@PermitAll
@Operation(summary = "使用账号密码登录")
@ -99,7 +117,7 @@ public class AuthController {
}
@PermitAll
@PostMapping("/web_login")
@PostMapping("/web_code_login")
@Operation(summary = "后台调用小程序微信扫码登录")
public CommonResult<byte[]> webLogin(@RequestBody @Valid SocialWxQrcodeReqDTO reqVO) {
return success(socialClientService.getWxaQrcode(reqVO));
@ -198,4 +216,45 @@ public class AuthController {
return success(authService.socialLogin(reqVO));
}
@PostMapping("/social-login-openid")
@PermitAll
@Operation(summary = "社交快捷登录,使用 code 授权码", description = "适合未登录的用户,但是社交账号已绑定用户")
public CommonResult<Boolean> socialQuickLoginOpenId(@RequestBody AuthSocialLoginReqVO reqVO) {
OAuth2AccessTokenDO accessToken = oAuth2TokenService.getAccessToken(reqVO.getOpenid());
Long userId = accessToken.getUserId();
List<SocialUserDO> socialUserList = socialUserService.getSocialUserList(userId, UserTypeEnum.MEMBER.getValue());
//判断是否为对象空
if(!CollUtil.isEmpty(socialUserList) && StrUtil.isNotEmpty(reqVO.getCode())){
stringRedisTemplate.opsForValue().set(reqVO.getCode(), JsonUtils.toJsonString(socialUserList.get(0)),10, TimeUnit.MINUTES);
return success(true);
}
return success(false);
}
@PostMapping("/social-qr-login-openid")
@PermitAll
@Operation(summary = "社交快捷登录,使用 code 授权码", description = "适合未登录的用户,但是社交账号已绑定用户")
public CommonResult<AuthLoginRespVO> qrLoginCode(@RequestBody AuthSocialLoginReqVO reqVO) {
String json = stringRedisTemplate.opsForValue().get(reqVO.getCode());
//判断是否为对象空
if(StrUtil.isNotEmpty(json)){
SocialUserDO socialUserDO = JsonUtils.parseObject(json, SocialUserDO.class);
AuthSocialLoginReqVO authSocialLoginReqVO=new AuthSocialLoginReqVO();
authSocialLoginReqVO.setCode(socialUserDO.getCode());
authSocialLoginReqVO.setType(socialUserDO.getType());
authSocialLoginReqVO.setState(socialUserDO.getState());
authSocialLoginReqVO.setOpenid(socialUserDO.getOpenid());
AuthLoginRespVO authLoginRespVO = authService.socialLogin(authSocialLoginReqVO);
if(ObjUtil.isNotEmpty(authLoginRespVO)){
stringRedisTemplate.delete(reqVO.getCode());
return success(authLoginRespVO);
}
}
return success(null);
}
}

3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/vo/AuthSocialLoginReqVO.java

@ -34,4 +34,7 @@ public class AuthSocialLoginReqVO {
@Schema(description = "用户类型" )
private Integer userType;
@Schema(description = "社交 openid", example = "oz-Jdt0kd_jdhUxJHQdBJMlOFN7w")
private String openid;
}

8
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java

@ -85,6 +85,13 @@ public class EnterpriseController {
return success(enterpriseService.createEnterprise(createReqVO));
}
@PostMapping("/pccreate")
@Operation(summary = "PC端创建企业")
// @PreAuthorize("@ss.hasPermission('system:enterprise:create')")
public CommonResult<Long> pccreateEnterprise(@RequestBody EnterpriseSaveReqVO createReqVO) {
return success(enterpriseService.pccreateEnterprise(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新企业")
// @PreAuthorize("@ss.hasPermission('system:enterprise:update')")
@ -139,7 +146,6 @@ public class EnterpriseController {
pageResult.getList().forEach(item->{
item.setInviterName(adminUserService.getUser(Long.valueOf(item.getUserId())).getNickname());
});
return success(BeanUtils.toBean(pageResult, EnterpriseRespVO.class));
}

17
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java

@ -17,6 +17,10 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ToString(callSuper = true)
public class EnterprisePageReqVO extends PageParam {
@Schema(description = "ID", example = "10990")
private Long Id;
@Schema(description = "所属部门ID", example = "10990")
private Long departmentId;
@ -35,6 +39,10 @@ public class EnterprisePageReqVO extends PageParam {
@Schema(description = "企业地址")
private String address;
@Schema(description = "企业状态")
private Long enterprisesStatus;
@Schema(description = "环保负责人姓名", example = "张三")
private String contactName;
@ -54,6 +62,9 @@ public class EnterprisePageReqVO extends PageParam {
@Schema(description = "企业经纬度")
private String gpsLocation;
@Schema(description = "签到半径")
private String signRadius;
@Schema(description = "创建人")
private String create;
@ -64,9 +75,15 @@ public class EnterprisePageReqVO extends PageParam {
@Schema(description = "修改人")
private String updater;
// @Schema(description = "管理部门", example = "26433")
// private Long deptId;
@Schema(description = "邀请人")
private String inviterName;
@Schema(description = "邀请人")
private List<Long> ids;
@Schema(description = "根据标签类型过滤")
private List<Long> tagList;

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java

@ -44,6 +44,12 @@ public class EnterpriseRespVO {
@ExcelProperty("企业地址")
private String address;
@Schema(description = "企业状态")
@ExcelProperty("企业状态")
private Long enterprisesStatus;
@Schema(description = "环保负责人姓名", example = "张三")
@ExcelProperty("环保负责人姓名")
private String contactName;
@ -68,6 +74,10 @@ public class EnterpriseRespVO {
@ExcelProperty("企业经纬度")
private String gpsLocation;
@Schema(description = "签到半径")
@ExcelProperty("签到半径")
private String signRadius;
@Schema(description = "创建人")
@ExcelProperty("创建人")
private String createBy;

9
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprise.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -34,6 +35,10 @@ public class EnterpriseSaveReqVO {
@Schema(description = "企业地址")
private String address;
@Schema(description = "企业状态")
private Long enterprisesStatus;
@Schema(description = "环保负责人姓名", example = "张三")
private String contactName;
@ -52,6 +57,10 @@ public class EnterpriseSaveReqVO {
@Schema(description = "企业经纬度")
private String gpsLocation;
@Schema(description = "签到半径")
private String signRadius;
@Schema(description = "创建人")
private String createBy;

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

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
@ -46,11 +47,18 @@ public class EnterpriseInspectionsController {
}
@PostMapping("/passOn")
@Operation(summary = "执法记录转交")
@PreAuthorize("@ss.hasPermission('system:enterprise-inspections:create')")
@Operation(summary = "执法记录变更")
@PreAuthorize("@ss.hasPermission('system:enterpriseinspections:index')")
public CommonResult<String> passOn(@Valid @RequestBody PassOnSaveVO passOnSaveVO) {
enterpriseInspectionsService.passOn(passOnSaveVO);
return success("转发成功");
return success("添加成功");
}
@GetMapping("/changeSelectUser")
@Operation(summary = "根据部门返回部门下的其他人员")
// @PreAuthorize("@ss.hasPermission('system:enterprise-inspections:create')")
public CommonResult<List<SelectUserChangeVO>> changeSelectUser(Long deptId) {
return success(enterpriseInspectionsService.changeSelectUser(deptId));
}
@PutMapping("/update")
@ -79,14 +87,34 @@ public class EnterpriseInspectionsController {
return success(BeanUtils.toBean(enterpriseInspections, EnterpriseInspectionsRespVO.class));
}
@GetMapping("/getEnterpriseInspectionsByTaskId")
@Operation(summary = "根据任务id查询自己偶发")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:enterprise-inspections:query')")
public CommonResult<EnterpriseInspectionsRespVO> getEnterpriseInspectionsByTaskId(@RequestParam("id") Long id) {
EnterpriseInspectionsDO enterpriseInspections = enterpriseInspectionsService.getEnterpriseInspections(id);
return success(BeanUtils.toBean(enterpriseInspections, EnterpriseInspectionsRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得企业检查记录表,用于记录与企业相关的环保检查信息。分页")
@PreAuthorize("@ss.hasPermission('system:enterprise-inspections:query')")
// @PreAuthorize("@ss.hasPermission('system:enterprise-inspections:query')")
public CommonResult<PageResult<EnterpriseInspectionsRespVO>> getEnterpriseInspectionsPage(@Valid EnterpriseInspectionsPageReqVO pageReqVO) {
PageResult<EnterpriseInspectionsDO> pageResult = enterpriseInspectionsService.getEnterpriseInspectionsPage(pageReqVO);
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')")

24
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsPageReqVO.java

@ -21,8 +21,32 @@ public class EnterpriseInspectionsPageReqVO extends PageParam {
@Schema(description = "企业ID", example = "27002")
private Long enterpriseId;
@Schema(description = "用户id", example = "1")
private Long userId;
@Schema(description = "企业名称", example = "27002")
private String enterpriseName;
@Schema(description = "任务名称", example = "1")
private String taskName ;
@Schema(description = "企业名称", example = "27002")
private List<Long> enterpriseList;
@Schema(description = "任务名称", example = "1")
private List<Long> taskList;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "任务状态", example = "1")
private Integer inspectionsStatus;
@Schema(description = "按部门")
private Long departmentId;
@Schema(description = "按部门查询的用户id集合")
private List<Long> userIds;
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsRespVO.java

@ -24,6 +24,10 @@ public class EnterpriseInspectionsRespVO {
@ExcelProperty("任务名称")
private String taskName;
@Schema(description = "任务编码", example = "29150")
@ExcelProperty("任务编码")
private String taskNumber;
@Schema(description = "企业ID", example = "27002")
@ExcelProperty("企业ID")
private Long enterpriseId;
@ -32,6 +36,10 @@ public class EnterpriseInspectionsRespVO {
@ExcelProperty("企业名称")
private String enterpriseName;
@Schema(description = "企业地址", example = "27002")
@ExcelProperty("企业地址")
private String enterpriseAddress;
@Schema(description = "任务类型", example = "27002")
@ExcelProperty("任务类型")
private List<String> tagList;
@ -40,6 +48,8 @@ public class EnterpriseInspectionsRespVO {
@ExcelProperty("进度状态")
private String inspectionStatus;
@Schema(description = "执法部门", example = "一大队")
@ExcelProperty("执法部门")
private String department;

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

@ -0,0 +1,20 @@
package cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
public class SelectUserChangeVO {
@Schema(description = "用户ID", example = "3876")
private Long userId;
@Schema(description = "用户姓名", example = "29150")
private String realName;
@Schema(description = "部门名称", example = "29150")
private List<String> roleName;
@Schema(description = "部门名称", example = "29150")
private String avatar;
}

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

@ -1,6 +1,9 @@
package cn.iocoder.yudao.module.system.controller.admin.inspectionslog;
import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.PassOnSaveVO;
import cn.iocoder.yudao.module.system.service.fileInfo.FileInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
@ -34,27 +37,44 @@ import javax.validation.Valid;
@RestController
@RequestMapping("/system/inspections-log")
@Validated
@Slf4j
public class InspectionsLogController {
@Resource
private InspectionsLogService inspectionsLogService;
@Resource
private FileInfoService fileInfoService;
@PostMapping("/signIn")
@Operation(summary = "创建打卡")
public CommonResult<String> createInspectionsLog(@Valid @RequestBody InspectionsLogSaveReqVO createReqVO) {
inspectionsLogService.createInspectionsLog(createReqVO);
return success("打卡成功");
}
@PostMapping("/create")
@Operation(summary = "创建检查结果日志")
@PreAuthorize("@ss.hasPermission('system:inspections-log:create')")
public CommonResult<Long> createInspectionsLog(@Valid @RequestBody InspectionsLogSaveReqVO createReqVO) {
return success(inspectionsLogService.createInspectionsLog(createReqVO));
@PutMapping("/confirmSignIn")
@Operation(summary = "确认打卡")
public CommonResult<String> confirmSignIn(@Valid @RequestBody InspectionsLogSaveReqVO createReqVO) {
log.info("createReqVO:{}", createReqVO);
inspectionsLogService.confirmSignIn(createReqVO);
return success("打卡成功");
}
@GetMapping("/signInList")
@Operation(summary = "打卡记录")
// @PreAuthorize("@ss.hasPermission('system:inspections-log:create')")
public CommonResult<List<InspectionsLogAppListVO>> signInList(Long inspectionsId) {
return success(inspectionsLogService.signInList(inspectionsId));
}
@PutMapping("/cooperateWithSignIn")
@Operation(summary = "协同人员打开")
@Operation(summary = "协同人员打")
@PreAuthorize("@ss.hasPermission('system:inspections-log:update')")
public CommonResult<Boolean> cooperateWithSignIn(Long inspectionsLogId) {
inspectionsLogService.cooperateWithSignIn(inspectionsLogId);
return success(true);
}
@PutMapping("/update")
@Operation(summary = "更新检查结果日志")
@PreAuthorize("@ss.hasPermission('system:inspections-log:update')")
@ -81,9 +101,17 @@ public class InspectionsLogController {
return success(BeanUtils.toBean(inspectionsLog, InspectionsLogRespVO.class));
}
@GetMapping("/page")
@PostMapping("/inspectionsAudit")
@Operation(summary = "审核")
@PreAuthorize("@ss.hasPermission('system:enterpriseinspections:index')")
public CommonResult<String> inspectionsAudit(@Valid @RequestBody InspectionsLogSaveReqVO createReqVO) {
inspectionsLogService.inspectionsAudit(createReqVO);
return success("审核成功");
}
@GetMapping("/appList")
@Operation(summary = "获得检查结果日志分页")
@PreAuthorize("@ss.hasPermission('system:inspections-log:query')")
// @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 +122,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));
}

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

@ -0,0 +1,24 @@
package cn.iocoder.yudao.module.system.controller.admin.inspectionslog.vo;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@Data
public class InspectionsLogAppListVO {
private Long userId;
private String realName;
private String deptName;
private String avtar;
private LocalDateTime time;
private Boolean isInspect;
}

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

@ -21,8 +21,8 @@ public class InspectionsLogPageReqVO extends PageParam {
@Schema(description = "检查状态1.签到2.通过.3整改", example = "2")
private Integer status;
@Schema(description = "检查人员签到位置信息,格式:经纬度")
private String gpsLocation;
@Schema(description = "默认状态", example = "2")
private Integer mrStatus;
@Schema(description = "反馈信息")
private String feedBack;

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

@ -27,10 +27,6 @@ public class InspectionsLogRespVO {
@DictFormat("Inspections_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private Integer status;
@Schema(description = "检查人员签到位置信息,格式:经纬度")
@ExcelProperty("检查人员签到位置信息,格式:经纬度")
private String gpsLocation;
@Schema(description = "反馈信息")
@ExcelProperty("反馈信息")
private String feedBack;
@ -47,4 +43,12 @@ public class InspectionsLogRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "相关文件")
private List<Map<String, String>> fileList;
@Schema(description = "执法人员列表", example = "李四")
@ExcelProperty("执法人员列表")
private List<InspectionsLogAppListVO> userList;
}

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

@ -10,7 +10,7 @@ import java.util.*;
@Data
public class InspectionsLogSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2308")
@Schema(description = "主键", example = "2308")
private Long id;
@Schema(description = "检查记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18375")

32
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/maxkb/MaxkbController.java

@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.system.controller.admin.maxkb;
import cn.iocoder.yudao.module.system.controller.admin.maxkb.vo.MaxkbdocumentVo;
import cn.iocoder.yudao.module.system.service.maxkb.MaxkbApiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
@Tag(name = "管理后台 - maxkb")
@RestController
@RequestMapping("/system/maxkb")
@Validated
@Slf4j
public class MaxkbController {
@Resource
MaxkbApiService maxkbApiService;
@PostMapping("/pushWeb")
@PermitAll
@Operation(summary = "导入知识库")
public void pushWebUrl(MaxkbdocumentVo maxkbdocumentVo) {
maxkbApiService.pushWebUrl(maxkbdocumentVo);
}
}

16
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/maxkb/vo/MaxkbdocumentVo.java

@ -0,0 +1,16 @@
package cn.iocoder.yudao.module.system.controller.admin.maxkb.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.List;
@Data
public class MaxkbdocumentVo {
public String[] source_url_list;
public String selector;
@JsonIgnore
public String id;
}

96
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/SignInLogController.java

@ -0,0 +1,96 @@
package cn.iocoder.yudao.module.system.controller.admin.signinlog;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.system.controller.admin.signinlog.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.signinlog.SignInLogDO;
import cn.iocoder.yudao.module.system.service.signinlog.SignInLogService;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@Tag(name = "管理后台 - 协调人员打卡记录")
@RestController
@RequestMapping("/system/sign-in-log")
@Validated
public class SignInLogController {
@Resource
private SignInLogService signInLogService;
@PostMapping("/signIn")
@Operation(summary = "创建协调人员打卡记录")
@PreAuthorize("@ss.hasPermission('system:sign-in-log:create')")
public CommonResult<Long> createSignInLog(@Valid @RequestBody SignInLogSaveReqVO createReqVO) {
return success(signInLogService.createSignInLog(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新协调人员打卡记录")
@PreAuthorize("@ss.hasPermission('system:sign-in-log:update')")
public CommonResult<Boolean> updateSignInLog(@Valid @RequestBody SignInLogSaveReqVO updateReqVO) {
signInLogService.updateSignInLog(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除协调人员打卡记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:sign-in-log:delete')")
public CommonResult<Boolean> deleteSignInLog(@RequestParam("id") Long id) {
signInLogService.deleteSignInLog(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得协调人员打卡记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:sign-in-log:query')")
public CommonResult<SignInLogRespVO> getSignInLog(@RequestParam("id") Long id) {
SignInLogDO signInLog = signInLogService.getSignInLog(id);
return success(BeanUtils.toBean(signInLog, SignInLogRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得协调人员打卡记录分页")
@PreAuthorize("@ss.hasPermission('system:sign-in-log:query')")
public CommonResult<PageResult<SignInLogRespVO>> getSignInLogPage(@Valid SignInLogPageReqVO pageReqVO) {
PageResult<SignInLogDO> pageResult = signInLogService.getSignInLogPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, SignInLogRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出协调人员打卡记录 Excel")
@PreAuthorize("@ss.hasPermission('system:sign-in-log:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportSignInLogExcel(@Valid SignInLogPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<SignInLogDO> list = signInLogService.getSignInLogPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "协调人员打卡记录.xls", "数据", SignInLogRespVO.class,
BeanUtils.toBean(list, SignInLogRespVO.class));
}
}

39
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/vo/SignInLogPageReqVO.java

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.controller.admin.signinlog.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 协调人员打卡记录分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class SignInLogPageReqVO extends PageParam {
@Schema(description = "执法记录id", example = "19972")
private Long insId;
@Schema(description = "用户id", example = "30997")
private Long userId;
@Schema(description = "用户名称", example = "张三")
private String realName;
/**
* 检查人员签到位置信息格式经纬度
*/
private String gpsLocation;
//知否是执行人
private Boolean isInspect;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

43
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/vo/SignInLogRespVO.java

@ -0,0 +1,43 @@
package cn.iocoder.yudao.module.system.controller.admin.signinlog.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 协调人员打卡记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class SignInLogRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10998")
@ExcelProperty("主键")
private Long id;
@Schema(description = "执法记录id", example = "19972")
@ExcelProperty("执法记录id")
private Long insId;
@Schema(description = "用户id", example = "30997")
@ExcelProperty("用户id")
private Long userId;
@Schema(description = "用户名称", example = "张三")
@ExcelProperty("用户名称")
private String realName;
/**
* 检查人员签到位置信息格式经纬度
*/
private String gpsLocation;
//知否是执行人
private Boolean isInspect;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

32
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/signinlog/vo/SignInLogSaveReqVO.java

@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.system.controller.admin.signinlog.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
@Schema(description = "管理后台 - 协调人员打卡记录新增/修改 Request VO")
@Data
public class SignInLogSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "10998")
private Long id;
@Schema(description = "执法记录id", example = "19972")
private Long insId;
@Schema(description = "用户id", example = "30997")
private Long userId;
@Schema(description = "用户名称", example = "张三")
private String realName;
/**
* 检查人员签到位置信息格式经纬度
*/
private String gpsLocation;
//知否是执行人
private Boolean isInspect;
}

110
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/TaskInfoController.java

@ -1,11 +1,28 @@
package cn.iocoder.yudao.module.system.controller.admin.taskinfo;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.infra.api.job.JobApi;
import cn.iocoder.yudao.module.system.controller.admin.enterprise.vo.EnterprisePageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsSaveReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tasktag.vo.TaskTagPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
import cn.iocoder.yudao.module.system.service.dept.DeptService;
import cn.iocoder.yudao.module.system.service.enterprise.EnterpriseService;
import cn.iocoder.yudao.module.system.service.enterpriseinspections.EnterpriseInspectionsService;
import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService;
import cn.iocoder.yudao.module.system.service.tasktag.TaskTagService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
@ -15,6 +32,7 @@ import io.swagger.v3.oas.annotations.Operation;
import java.util.*;
import java.io.IOException;
import java.util.stream.Collectors;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -35,6 +53,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@Slf4j
@Tag(name = "管理后台 - 任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。")
@RestController
@RequestMapping("/system/task-info")
@ -47,7 +66,16 @@ public class TaskInfoController {
private AdminUserService adminUserService;
@Resource
private DeptService deptService;
@Resource
private EnterpriseInspectionsService enterpriseInspectionsService;
@Resource
private TaskTagService taskTagService;
@Resource
private EnterpriseService enterpriseService;
@Resource
private TagLibraryService tagLibraryService;
@Resource
private AdminUserMapper adminUserMapper;
@PostMapping("/create")
@Operation(summary = "创建任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。")
@ -60,6 +88,19 @@ public class TaskInfoController {
@Operation(summary = "更新任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。")
@PreAuthorize("@ss.hasPermission('system:task-info:update')")
public CommonResult<Boolean> updateTaskInfo(@Valid @RequestBody TaskInfoSaveReqVO updateReqVO) {
List<Long> eid=updateReqVO.getEnterpriseIds();
if (eid == null || eid.isEmpty()) {
return success(false);
}
int del=enterpriseInspectionsService.deleteEnterpriseInspectionsTaskId(updateReqVO.getId());
EnterpriseInspectionsSaveReqVO enterpriseInspectionsSaveReqVO=new EnterpriseInspectionsSaveReqVO();
for(Long enterprise:eid) {
enterpriseInspectionsSaveReqVO.setTaskId(updateReqVO.getId());
enterpriseInspectionsSaveReqVO.setEnterpriseId(enterprise);
if(del>0){
enterpriseInspectionsService.createEnterpriseInspections(enterpriseInspectionsSaveReqVO);
}
}
taskInfoService.updateTaskInfo(updateReqVO);
return success(true);
}
@ -79,7 +120,56 @@ public class TaskInfoController {
@PreAuthorize("@ss.hasPermission('system:task-info:query')")
public CommonResult<TaskInfoRespVO> getTaskInfo(@RequestParam("id") Long id) {
TaskInfoDO taskInfo = taskInfoService.getTaskInfo(id);
//获取任务包含企业
EnterpriseInspectionsPageReqVO enterpriseInspectionsPageReqVO=new EnterpriseInspectionsPageReqVO();
enterpriseInspectionsPageReqVO.setTaskId(taskInfo.getId());
List<EnterpriseInspectionsDO> enterpriseInspectionsides=enterpriseInspectionsService.getEnterpriseInspectionsList(enterpriseInspectionsPageReqVO);
EnterprisePageReqVO enterprisePageReqVO=new EnterprisePageReqVO();
List<Long> longs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId);
enterprisePageReqVO.setIds(longs);
List<EnterpriseDO> enterpriseIdes=enterpriseService.getEnterpriseList(enterprisePageReqVO);
TaskInfoRespVO bean = BeanUtils.toBean(taskInfo, TaskInfoRespVO.class);
bean.setEnterpriseIdes(enterpriseIdes);
//获取任务标签
TaskTagPageReqVO taskTagPageReqVO=new TaskTagPageReqVO();
taskTagPageReqVO.setTaskId(taskInfo.getId());
List<TaskTagDO> taskTagides=taskTagService.getTaskTagList(taskTagPageReqVO);
List<Long> taglongs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId);
bean.setTaskTagIdes(taskTagides);
return success(bean);
}
@GetMapping("/appGet")
@Operation(summary = "获得任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:task-info:query')")
public CommonResult<TaskInfoRespVO> appGet(@RequestParam("id") Long id) {
TaskInfoDO taskInfo = taskInfoService.getTaskInfo(id);
if (taskInfo != null) {
//标签
final List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByTaskId(taskInfo.getId());
if (CollUtil.isNotEmpty(tagLibraryDOS)) {
taskInfo.setTagList(tagLibraryDOS.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList()));
}
//发布部门
final Long userId = Long.valueOf(taskInfo.getCreator());
AdminUserDO user = adminUserMapper.selectById(userId);
if (user != null && user.getDeptId() != null) {
final DeptDO dept = deptService.getDept(user.getDeptId());
taskInfo.setDeptName(dept.getName());
}
}
return success(BeanUtils.toBean(taskInfo, TaskInfoRespVO.class));
}
@GetMapping("/page")
@ -89,9 +179,19 @@ public class TaskInfoController {
PageResult<TaskInfoDO> pageResult = taskInfoService.getTaskInfoPage(pageReqVO);
AdminUserDO user = adminUserService.getUser(SecurityFrameworkUtils.getLoginUserId());
DeptDO dep= deptService.getDept( user.getDeptId());
EnterpriseInspectionsPageReqVO enterpriseInspectionsPageReqVO=new EnterpriseInspectionsPageReqVO();
pageResult.getList().forEach(item->{
item.setPublishDep(dep.getName());
item.setCreateName(adminUserService.getUser(Long.valueOf(item.getCreator())).getRealName());
enterpriseInspectionsPageReqVO.setTaskId(item.getId());
List<EnterpriseInspectionsDO> enterpriseInspectionsides=enterpriseInspectionsService.getEnterpriseInspectionsList(enterpriseInspectionsPageReqVO);
EnterprisePageReqVO enterprisePageReqVO=new EnterprisePageReqVO();
List<Long> longs = CollectionUtils.convertList(enterpriseInspectionsides, EnterpriseInspectionsDO::getEnterpriseId);
enterprisePageReqVO.setIds(longs);
List<EnterpriseDO> enterpriseIdes=enterpriseService.getEnterpriseList(enterprisePageReqVO);
item.setEnterpriseIdes(enterpriseIdes);
});
return success(BeanUtils.toBean(pageResult, TaskInfoRespVO.class));
}
@ -110,6 +210,14 @@ public class TaskInfoController {
return success(BeanUtils.toBean(pageResult, TaskInfoRespVO.class));
}
@GetMapping("/appPage")
@Operation(summary = "获得任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。分页")
@PreAuthorize("@ss.hasPermission('system:task-info:query')")
public CommonResult<PageResult<TaskInfoRespVO>> appPage(@Valid TaskInfoPageReqVO pageReqVO) {
PageResult<TaskInfoDO> pageResult = taskInfoService.getTaskInfoAppPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, TaskInfoRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。 Excel")
@PreAuthorize("@ss.hasPermission('system:task-info:export')")

15
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoPageReqVO.java

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import lombok.*;
import java.time.LocalDate;
@ -63,4 +64,18 @@ public class TaskInfoPageReqVO extends PageParam {
@Schema(description = "总共几步")
private Integer taskTotal;
@Schema(description = "企业集合", example = "1")
private List<Long> enterpriseInspectionsIdes;
/*
小程序查询用
*/
@Schema(description = "任务标签集合", example = "1")
private List<Long> tagList;
@Schema(description = "按时间查询", example = "1")
private Integer selectWeek;
}

34
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoRespVO.java

@ -1,5 +1,9 @@
package cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -21,6 +25,7 @@ public class TaskInfoRespVO {
@ExcelProperty("任务ID,主键")
private Long id;
private Integer reverseStauts;
//任务编号
@Schema(description = "任务编号", example = "你猜")
@ -94,6 +99,35 @@ public class TaskInfoRespVO {
@ExcelProperty("发布部门")
private String publishDep;
@Schema(description = "企业集合")
@ExcelProperty("企业集合")
private List<EnterpriseDO> enterpriseIdes;
@Schema(description = "标签集合")
@ExcelProperty("标签集合")
private List<TaskTagDO> taskTagIdes;
@Schema(description = "标签集合")
@ExcelProperty("标签集合")
private List<TagLibraryDO> tagLibraryIds;
//任务总数
private Integer taskExecNum;
//已完成数
private Integer taskFinishNum;
//任务标签
private List<String> tagList;
//发布部门
private String deptName;

3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taskinfo/vo/TaskInfoSaveReqVO.java

@ -16,6 +16,9 @@ public class TaskInfoSaveReqVO {
@Schema(description = "任务ID,主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4541")
private Long id;
@Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED)
private String taskNumber;
@Schema(description = "任务标题", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "任务标题不能为空")
private String title;

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

@ -122,6 +122,22 @@ public class UserController {
pageResult.getTotal()));
}
@GetMapping("/pcpage")
@Operation(summary = "获得用户分页列表")
public CommonResult<PageResult<UserRespVO>> getPcUserPage(@Valid UserPageReqVO pageReqVO) {
// 获得用户分页列表
PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(new PageResult<>(pageResult.getTotal()));
}
// 拼接数据
Map<Long, DeptDO> deptMap = deptService.getDeptMap(
convertList(pageResult.getList(), AdminUserDO::getDeptId));
return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
pageResult.getTotal()));
}
@GetMapping({"/list-all-simple", "/simple-list"})
@Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项")
public CommonResult<List<UserSimpleRespVO>> getSimpleUserList() {
@ -132,6 +148,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;
}

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

@ -23,7 +23,7 @@ public class UserSaveReqVO {
@Schema(description = "用户账号", requiredMode = Schema.RequiredMode.REQUIRED, example = "yudao")
@NotBlank(message = "用户账号不能为空")
@Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由 数字、字母 组成")
@Pattern(regexp = "^[a-zA-Z0-9_]{4,30}$", message = "用户账号由 数字、字母 组成")
@Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符")
@DiffLogField(name = "用户账号")
private String username;

56
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/weixin/WeChatController.java

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.system.controller.admin.weixin;
import cn.iocoder.yudao.module.system.service.weixin.TokenValidatorService;
import cn.iocoder.yudao.module.system.service.weixin.WeChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
@RestController
@RequestMapping("/wechat")
@PermitAll
public class WeChatController {
@Resource
private WeChatService weChatService;
@Resource
private TokenValidatorService tokenValidatorService;
private static final String TOKEN = "hbts";
@GetMapping("/send")
@PermitAll
public String sendMessage() {
try {
String accessToken = weChatService.getAccessToken();
String openId = "ogEz46_ADXNd_SmC9f57tYZkswRg"; // 替换为用户的 OpenID
String templateId = "E8RK91cPLMios6ZHoKx6FJOV4H2kodx6yPWYp7jpLJY"; // 替换为订阅消息模板 ID
weChatService.sendSubscribeMessage(accessToken, openId, templateId);
return "Message sent successfully";
} catch (Exception e) {
e.printStackTrace();
return "Failed to send message";
}
}
@GetMapping("/push")
@PermitAll
public String validate(@RequestParam("signature") String signature,
@RequestParam("timestamp") String timestamp,
@RequestParam("nonce") String nonce,
@RequestParam("echostr") String echostr) {
if (tokenValidatorService.validateToken(TOKEN, signature, timestamp, nonce)) {
return echostr;
}
return "";
}
}

15
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java

@ -55,6 +55,11 @@ public class EnterpriseDO extends BaseDO {
* 企业地址
*/
private String address;
/**
* 企业状态
*/
private Long enterprisesStatus ;
/**
* 环保负责人姓名
*/
@ -79,6 +84,16 @@ public class EnterpriseDO extends BaseDO {
* 企业经纬度
*/
private String gpsLocation;
/**
* 签到半径
*/
private String signRadius;
// /**
// * 管理部门
// */
// private Long deptId;
@TableField(exist = false)
private Integer audit;

19
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterpriseinspections/EnterpriseInspectionsDO.java

@ -43,21 +43,36 @@ public class EnterpriseInspectionsDO extends BaseDO {
*/
private Long userId;
//状态 1.任务未启动 2. 任务已启动 3.已转交,未执行不展示 4.已转交,整改中,留痕
//状态 1.任务未启动 2. 任务已启动 4.已转交,整改中,留痕
private Integer status;
//任务编号
@TableField(exist = false)
private String taskNumber;
//任务名称
@TableField(exist = false)
private String taskName;
//企业名称
@TableField(exist = false)
private String enterpriseName;
//企业名称
@TableField(exist = false)
private String enterpriseAddress;
//进度状态
@TableField(exist = false)
private Integer inspectionStatus;
//标签集合
//企业标签集合
@TableField(exist = false)
private List<String> tagList;
//任务标签
@TableField(exist = false)
private String taskTag;
//执法部门
@TableField(exist = false)
private String department;

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

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog;
import cn.iocoder.yudao.module.system.controller.admin.inspectionslog.vo.InspectionsLogAppListVO;
import com.sun.xml.bind.v2.TODO;
import lombok.*;
import java.util.*;
@ -38,10 +39,6 @@ public class InspectionsLogDO extends BaseDO {
* 枚举 {@link TODO Inspections_status 对应的类}
*/
private Integer status;
/**
* 检查人员签到位置信息格式经纬度
*/
private String gpsLocation;
/**
* 反馈信息
*/
@ -55,8 +52,13 @@ public class InspectionsLogDO extends BaseDO {
*/
private String inspectName;
@TableField(exist = false)
private List<InspectionsLogAppListVO> userList;
//协同人员的id 还是要加上 会有同名的情况
private String cooperateWithIds;
//协同人员是否可以看到任务记录
//相关文件
@TableField(exist = false)
private List<Map<String, String>> fileList;
}

49
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/signinlog/SignInLogDO.java

@ -0,0 +1,49 @@
package cn.iocoder.yudao.module.system.dal.dataobject.signinlog;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 协调人员打卡记录 DO
*
* @author 芋道源码
*/
@TableName("sign_in_log")
@KeySequence("sign_in_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SignInLogDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 执法记录id
*/
private Long insId;
/**
* 用户id
*/
private Long userId;
private String realName;
/**
* 检查人员签到位置信息格式经纬度
*/
private String gpsLocation;
//知否是执行人
private Boolean isInspect;
}

25
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/taskinfo/TaskInfoDO.java

@ -1,10 +1,16 @@
package cn.iocoder.yudao.module.system.dal.dataobject.taskinfo;
import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import com.alibaba.excel.annotation.ExcelProperty;
import com.sun.xml.bind.v2.TODO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@ -30,8 +36,9 @@ public class TaskInfoDO extends BaseDO {
@TableId
private Long id;
//任务编号
@TableField(exist = false)
// @TableField(exist = false)
private String taskNumber;
/**
* 任务标题
@ -94,10 +101,22 @@ public class TaskInfoDO extends BaseDO {
@TableField(exist = false)
private String publishDep;
//企业集合
@TableField(exist = false)
private List<EnterpriseDO> enterpriseIdes;
//任务总数
@TableField(exist = false)
private Integer taskExecNum;
//已完成数
@TableField(exist = false)
private Integer taskFinishNum;
@TableField(exist = false)
private List<String> tagList;
//发布部门
@TableField(exist = false)
private String deptName;
}

29
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java

@ -9,6 +9,9 @@ import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.enterprise.vo.*;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
/**
* 企业 Mapper
*
@ -25,6 +28,7 @@ public interface EnterpriseMapper extends BaseMapperX<EnterpriseDO> {
.eqIfPresent(EnterpriseDO::getRegion, reqVO.getRegion())
.likeIfPresent(EnterpriseDO::getEnterprisesName, reqVO.getEnterprisesName())
.eqIfPresent(EnterpriseDO::getAddress, reqVO.getAddress())
.eqIfPresent(EnterpriseDO::getEnterprisesStatus, reqVO.getEnterprisesStatus())
.likeIfPresent(EnterpriseDO::getContactName, reqVO.getContactName())
.eqIfPresent(EnterpriseDO::getEnvironmentalContactPhone, reqVO.getEnvironmentalContactPhone())
.eqIfPresent(EnterpriseDO::getRegistrationNumber, reqVO.getRegistrationNumber())
@ -33,12 +37,33 @@ public interface EnterpriseMapper extends BaseMapperX<EnterpriseDO> {
.eqIfPresent(EnterpriseDO::getGpsLocation, reqVO.getGpsLocation())
.betweenIfPresent(EnterpriseDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(EnterpriseDO::getUpdater, reqVO.getUpdater())
.or(w->w.eq(EnterpriseDO::getCreator, reqVO.getCreate()))
// .or(w->w.eq( EnterpriseDO::getCreator, getLoginUserId()))
.orderByDesc(EnterpriseDO::getId));
}
default List<EnterpriseDO> selectListByStatus() {
return selectList();
}
default List<EnterpriseDO> selectList(EnterprisePageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<EnterpriseDO>()
.eqIfPresent(EnterpriseDO::getId, reqVO.getId())
.eqIfPresent(EnterpriseDO::getDepartmentId, reqVO.getDepartmentId())
.eqIfPresent(EnterpriseDO::getUserId, reqVO.getUserId())
.eqIfPresent(EnterpriseDO::getType, reqVO.getType())
.eqIfPresent(EnterpriseDO::getRegion, reqVO.getRegion())
.likeIfPresent(EnterpriseDO::getEnterprisesName, reqVO.getEnterprisesName())
.eqIfPresent(EnterpriseDO::getAddress, reqVO.getAddress())
.eqIfPresent(EnterpriseDO::getEnterprisesStatus, reqVO.getEnterprisesStatus())
.likeIfPresent(EnterpriseDO::getContactName, reqVO.getContactName())
.eqIfPresent(EnterpriseDO::getEnvironmentalContactPhone, reqVO.getEnvironmentalContactPhone())
.eqIfPresent(EnterpriseDO::getRegistrationNumber, reqVO.getRegistrationNumber())
.eqIfPresent(EnterpriseDO::getIntroduction, reqVO.getIntroduction())
.betweenIfPresent(EnterpriseDO::getEstablishmentDate, reqVO.getEstablishmentDate())
.eqIfPresent(EnterpriseDO::getGpsLocation, reqVO.getGpsLocation())
.eqIfPresent(EnterpriseDO::getCreator, reqVO.getCreate())
.betweenIfPresent(EnterpriseDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(EnterpriseDO::getUpdater, reqVO.getUpdater())
.inIfPresent(EnterpriseDO::getId,reqVO.getIds())
.orderByDesc(EnterpriseDO::getId));
}
}

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

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections;
import java.util.*;
import java.util.stream.Collectors;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
@ -21,18 +20,33 @@ public interface EnterpriseInspectionsMapper extends BaseMapperX<EnterpriseInspe
default PageResult<EnterpriseInspectionsDO> selectPage(EnterpriseInspectionsPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EnterpriseInspectionsDO>()
.eqIfPresent(EnterpriseInspectionsDO::getTaskId, reqVO.getTaskId())
.eqIfPresent(EnterpriseInspectionsDO::getUserId, reqVO.getUserId())
.eqIfPresent(EnterpriseInspectionsDO::getEnterpriseId, reqVO.getEnterpriseId())
.betweenIfPresent(EnterpriseInspectionsDO::getCreateTime, reqVO.getCreateTime())
.inIfPresent(EnterpriseInspectionsDO::getEnterpriseId, reqVO.getEnterpriseList())
.inIfPresent(EnterpriseInspectionsDO::getTaskId, reqVO.getTaskList())
.inIfPresent(EnterpriseInspectionsDO::getUserId, reqVO.getUserIds())
.orderByDesc(EnterpriseInspectionsDO::getId));
}
default PageResult<EnterpriseInspectionsDO> selectPageGroup(EnterpriseInspectionsPageReqVO reqVO) {
default PageResult<EnterpriseInspectionsDO> selectAppPage(EnterpriseInspectionsPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EnterpriseInspectionsDO>()
.eqIfPresent(EnterpriseInspectionsDO::getTaskId, reqVO.getTaskId())
.eqIfPresent(EnterpriseInspectionsDO::getUserId, reqVO.getUserId())
.eqIfPresent(EnterpriseInspectionsDO::getEnterpriseId, reqVO.getEnterpriseId())
.betweenIfPresent(EnterpriseInspectionsDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(EnterpriseInspectionsDO::getId).groupBy(EnterpriseInspectionsDO::getTaskId)
);
.orderByDesc(EnterpriseInspectionsDO::getId));
}
default List<EnterpriseInspectionsDO> selectList(EnterpriseInspectionsPageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<EnterpriseInspectionsDO>()
.eqIfPresent(EnterpriseInspectionsDO::getTaskId, reqVO.getTaskId())
.eqIfPresent(EnterpriseInspectionsDO::getEnterpriseId, reqVO.getEnterpriseId())
.betweenIfPresent(EnterpriseInspectionsDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(EnterpriseInspectionsDO::getId));
}
}

2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/inspectionslog/InspectionsLogMapper.java

@ -21,7 +21,7 @@ public interface InspectionsLogMapper extends BaseMapperX<InspectionsLogDO> {
return selectPage(reqVO, new LambdaQueryWrapperX<InspectionsLogDO>()
.eqIfPresent(InspectionsLogDO::getInspectionsId, reqVO.getInspectionsId())
.eqIfPresent(InspectionsLogDO::getStatus, reqVO.getStatus())
.eqIfPresent(InspectionsLogDO::getGpsLocation, reqVO.getGpsLocation())
.gtIfPresent(InspectionsLogDO::getStatus, reqVO.getMrStatus())
.eqIfPresent(InspectionsLogDO::getFeedBack, reqVO.getFeedBack())
.likeIfPresent(InspectionsLogDO::getCooperateWithName, reqVO.getCooperateWithName())
.likeIfPresent(InspectionsLogDO::getInspectName, reqVO.getInspectName())

30
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/signinlog/SignInLogMapper.java

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.dal.mysql.signinlog;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.signinlog.SignInLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.signinlog.vo.*;
/**
* 协调人员打卡记录 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface SignInLogMapper extends BaseMapperX<SignInLogDO> {
default PageResult<SignInLogDO> selectPage(SignInLogPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<SignInLogDO>()
.eqIfPresent(SignInLogDO::getInsId, reqVO.getInsId())
.eqIfPresent(SignInLogDO::getUserId, reqVO.getUserId())
.eqIfPresent(SignInLogDO::getGpsLocation, reqVO.getGpsLocation())
.betweenIfPresent(SignInLogDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SignInLogDO::getId));
}
}

25
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/taskinfo/TaskInfoMapper.java

@ -20,6 +20,7 @@ public interface TaskInfoMapper extends BaseMapperX<TaskInfoDO> {
default PageResult<TaskInfoDO> selectPage(TaskInfoPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<TaskInfoDO>()
.eqIfPresent(TaskInfoDO::getTitle, reqVO.getTitle())
.eqIfPresent(TaskInfoDO::getTaskNumber, reqVO.getTaskNumber())
.eqIfPresent(TaskInfoDO::getDescription, reqVO.getDescription())
.eqIfPresent(TaskInfoDO::getExecCycle, reqVO.getExecCycle())
.eqIfPresent(TaskInfoDO::getTaskType, reqVO.getTaskType())
@ -35,4 +36,28 @@ public interface TaskInfoMapper extends BaseMapperX<TaskInfoDO> {
.orderByDesc(TaskInfoDO::getId));
}
default PageResult<TaskInfoDO> selectAppPage(TaskInfoPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<TaskInfoDO>()
.eqIfPresent(TaskInfoDO::getTitle, reqVO.getTitle())
.eqIfPresent(TaskInfoDO::getTaskNumber, reqVO.getTaskNumber())
.eqIfPresent(TaskInfoDO::getDescription, reqVO.getDescription())
.eqIfPresent(TaskInfoDO::getExecCycle, reqVO.getExecCycle())
.eqIfPresent(TaskInfoDO::getTaskType, reqVO.getTaskType())
.eqIfPresent(TaskInfoDO::getPriority, reqVO.getPriority())
.eqIfPresent(TaskInfoDO::getStatus, reqVO.getStatus())
.betweenIfPresent(TaskInfoDO::getStartDate, reqVO.getStartDate())
.betweenIfPresent(TaskInfoDO::getEndDate, reqVO.getEndDate())
.betweenIfPresent(TaskInfoDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(TaskInfoDO::getParentId, reqVO.getParentId())
.eqIfPresent(TaskInfoDO::getParentType, reqVO.getParentType())
.eqIfPresent(TaskInfoDO::getTaskStep, reqVO.getTaskStep())
.eqIfPresent(TaskInfoDO::getTaskTotal, reqVO.getTaskTotal())
.inIfPresent(TaskInfoDO::getId, reqVO.getTagList())
.gtIfPresent(TaskInfoDO::getStatus, 1)
.orderByAsc(TaskInfoDO::getStatus));
}
}

14
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/tasktag/TaskTagMapper.java

@ -5,6 +5,8 @@ import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.tasktag.vo.*;
@ -25,4 +27,16 @@ public interface TaskTagMapper extends BaseMapperX<TaskTagDO> {
.orderByDesc(TaskTagDO::getId));
}
default List<TaskTagDO> selectList(TaskTagPageReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<TaskTagDO>()
.eqIfPresent(TaskTagDO::getTaskId, reqVO.getTaskId())
.eqIfPresent(TaskTagDO::getTagId, reqVO.getTagId())
.betweenIfPresent(TaskTagDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(TaskTagDO::getId));
}
}

2
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java

@ -174,7 +174,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
@Override
public AuthLoginRespVO socialLogin(AuthSocialLoginReqVO reqVO) {
// 使用 code 授权码,进行登录。然后,获得到绑定的用户编号
SocialUserRespDTO socialUser = socialUserService.getSocialUserByCode(UserTypeEnum.ADMIN.getValue(), reqVO.getType(),
SocialUserRespDTO socialUser = socialUserService.getSocialUserByCode(UserTypeEnum.MEMBER.getValue(), reqVO.getType(),
reqVO.getCode(), reqVO.getState());
if (socialUser == null || socialUser.getUserId() == null) {
throw exception(AUTH_THIRD_LOGIN_NOT_BIND);

1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java

@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqV
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
import cn.iocoder.yudao.module.system.dal.redis.RedisKeyConstants;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.google.common.annotations.VisibleForTesting;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.CacheEvict;

12
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java

@ -23,6 +23,15 @@ public interface EnterpriseService {
*/
Long createEnterprise(EnterpriseSaveReqVO createReqVO);
/**
* PC创建企业
*
* @param createReqVO 创建信息
* @return 编号
*/
Long pccreateEnterprise(EnterpriseSaveReqVO createReqVO);
/**
* 更新企业
*
@ -53,5 +62,8 @@ public interface EnterpriseService {
*/
PageResult<EnterpriseDO> getEnterprisePage(EnterprisePageReqVO pageReqVO);
List<EnterpriseDO> getEnterpriseList(EnterprisePageReqVO pageReqVO);
PageResult<EnterpriseDO> getEnterpriseByUserId(EnterprisePageReqVO pageReqVO);
}

31
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTag
import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.UserRoleDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taskinfo.TaskInfoDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseauditlog.EnterpriseAuditLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.enterprisetag.EnterpriseTagMapper;
@ -104,6 +105,29 @@ public class EnterpriseServiceImpl implements EnterpriseService {
return enterprise.getId();
}
@Override
@Transactional
public Long pccreateEnterprise(EnterpriseSaveReqVO createReqVO) {
EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class);
enterprise.setDepartmentId(1L);
enterpriseMapper.insert(enterprise);
if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) {
for (Long fileId : createReqVO.getFileIds()) {
FileInfoDO fileInfoDO = new FileInfoDO();
fileInfoDO.setDictData(1l); //文件类型
fileInfoDO.setDictType(644l);
fileInfoDO.setUnitId(enterprise.getId().toString());
fileInfoDO.setInfraFileId(fileId);
fileInfoMapper.insert(fileInfoDO);
}
}
// 返回
return enterprise.getId();
}
@Override
public void updateEnterprise(EnterpriseSaveReqVO updateReqVO) {
// 校验存在
@ -155,6 +179,13 @@ public class EnterpriseServiceImpl implements EnterpriseService {
return enterpriseDOPageResult;
}
@Override
public List<EnterpriseDO> getEnterpriseList(EnterprisePageReqVO pageReqVO) {
return enterpriseMapper.selectList(pageReqVO);
}
@Override
public PageResult<EnterpriseDO> getEnterpriseByUserId(EnterprisePageReqVO pageReqVO) {
//根据不同身份查询企业

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

@ -4,7 +4,8 @@ import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import javax.validation.Valid;
@ -37,6 +38,8 @@ public interface EnterpriseInspectionsService {
*/
void deleteEnterpriseInspections(Long id);
void passOn(PassOnSaveVO passOnSaveVO);
/**
* 获得企业检查记录表用于记录与企业相关的环保检查信息
*
@ -45,6 +48,12 @@ public interface EnterpriseInspectionsService {
*/
EnterpriseInspectionsDO getEnterpriseInspections(Long id);
List<EnterpriseInspectionsDO> getListByUserIdAndTaskName(Long userId, String taskName);
int deleteEnterpriseInspectionsTaskId(Long taskId);
InspectionsLogDO getInspectionsLogNew(Long inspectionsId);
/**
* 获得企业检查记录表用于记录与企业相关的环保检查信息分页
*
@ -53,5 +62,8 @@ public interface EnterpriseInspectionsService {
*/
PageResult<EnterpriseInspectionsDO> getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO);
void passOn(PassOnSaveVO passOnSaveVO);
List<EnterpriseInspectionsDO> getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO);
List<SelectUserChangeVO> changeSelectUser(Long deptId);
}

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

@ -3,17 +3,28 @@ package cn.iocoder.yudao.module.system.service.enterpriseinspections;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.UserRoleDO;
import cn.iocoder.yudao.module.system.dal.dataobject.signinlog.SignInLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taskinfo.TaskInfoDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
import cn.iocoder.yudao.module.system.dal.mysql.enterprise.EnterpriseMapper;
import cn.iocoder.yudao.module.system.dal.mysql.inspectionslog.InspectionsLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper;
import cn.iocoder.yudao.module.system.dal.mysql.permission.UserRoleMapper;
import cn.iocoder.yudao.module.system.dal.mysql.signinlog.SignInLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.taglibrary.TagLibraryMapper;
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.dal.mysql.user.AdminUserMapper;
import cn.iocoder.yudao.module.system.service.dept.DeptService;
import cn.iocoder.yudao.module.system.service.inspectionslog.InspectionsLogService;
import cn.iocoder.yudao.module.system.service.taglibrary.TagLibraryService;
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;
@ -21,6 +32,8 @@ 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.enterpriseinspections.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -32,6 +45,8 @@ import cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections.Enterprise
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
@ -60,6 +75,16 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
private AdminUserService adminUserService;
@Resource
private DeptService deptService;
@Resource
private TagLibraryService tagLibraryService;
@Resource
private AdminUserMapper adminUserMapper;
@Resource
private UserRoleMapper userRoleMapper;
@Resource
private RoleMapper roleMapper;
@Resource
private SignInLogMapper signInLogMapper;
@Override
public Long createEnterpriseInspections(EnterpriseInspectionsSaveReqVO createReqVO) {
@ -70,6 +95,25 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
return enterpriseInspections.getId();
}
/**
* 根据执行记录id查询打卡记录
*
* @param inspectionsId
* @Author dx
* @Date 2025-02-14 上午11:55
**/
public List<SignInLogDO> getSingnInLogList(Long inspectionsId) {
LambdaQueryWrapper<InspectionsLogDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(InspectionsLogDO::getInspectionsId, inspectionsId);
wrapper.eq(InspectionsLogDO::getStatus, 1);
wrapper.orderByDesc(InspectionsLogDO::getCreateTime);
List<InspectionsLogDO> list = inspectionsLogMapper.selectList(wrapper);
if (list != null) {
return signInLogMapper.selectList(new LambdaQueryWrapper<SignInLogDO>().eq(SignInLogDO::getInsId, list.get(0).getId()));
}
return Collections.emptyList();
}
@Override
@ -88,7 +132,15 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
// 删除
enterpriseInspectionsMapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public int deleteEnterpriseInspectionsTaskId(Long taskId) {
LambdaQueryWrapper<EnterpriseInspectionsDO> taskMembersDOLambdaQueryWrapper = new LambdaQueryWrapper<>();
taskMembersDOLambdaQueryWrapper.eq(EnterpriseInspectionsDO::getTaskId, taskId);
// 删除
return enterpriseInspectionsMapper.delete(taskMembersDOLambdaQueryWrapper);
}
private void validateEnterpriseInspectionsExists(Long id) {
if (enterpriseInspectionsMapper.selectById(id) == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
@ -97,12 +149,93 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
@Override
public EnterpriseInspectionsDO getEnterpriseInspections(Long id) {
return enterpriseInspectionsMapper.selectById(id);
final EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(id);
if (enterpriseInspectionsDO == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
}
final TaskInfoDO taskInfoDO = taskInfoMapper.selectById(enterpriseInspectionsDO.getTaskId());
if (taskInfoDO == null) {
throw exception(TASK_INFO_NOT_EXISTS);
}
enterpriseInspectionsDO.setTaskName(taskInfoDO.getTitle());
enterpriseInspectionsDO.setTaskName(taskInfoDO.getTitle());
enterpriseInspectionsDO.setTaskNumber(taskInfoDO.getTaskNumber());
final EnterpriseDO enterpriseDO = enterpriseMapper.selectById(enterpriseInspectionsDO.getEnterpriseId());
if (enterpriseDO == null) {
throw exception(ENTERPRISE_NOT_EXISTS);
}
//任务类型
enterpriseInspectionsDO.setEnterpriseName(enterpriseDO.getEnterprisesName());
final AdminUserDO user = adminUserService.getUser(enterpriseInspectionsDO.getUserId());
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
enterpriseInspectionsDO.setInspectName(user.getRealName());
final DeptDO dept = deptService.getDept(user.getDeptId());
enterpriseInspectionsDO.setDepartment(dept.getName());
return enterpriseInspectionsDO;
}
@Override
public PageResult<EnterpriseInspectionsDO> getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO) {
//根据角色显示不同
/*
管理员局长查全部
检查员查自己的
队长 查本部门
*/
Long loginUserId = getLoginUserId();
final AdminUserDO user1 = adminUserService.getUser(loginUserId);
if (user1.getPostIds().contains(1l) || user1.getPostIds().contains(2l)) {
//全部
} else if (user1.getPostIds().contains(4l)) {
//本部门
pageReqVO.setDepartmentId(user1.getDeptId());
} else if (user1.getPostIds().contains(5l)) {
//自己
pageReqVO.setUserId(loginUserId);
}
//按照部门查询
if (pageReqVO.getDepartmentId() != null) {
final List<AdminUserDO> adminUserDOS = adminUserMapper.selectList(new QueryWrapper<AdminUserDO>().eq("dept_id", pageReqVO.getDepartmentId()));
if (adminUserDOS != null || adminUserDOS.size() > 0) {
final List<Long> collect = adminUserDOS.stream().map(item -> item.getId()).collect(Collectors.toList());
pageReqVO.setUserIds(collect);
}
}
//根据企业名称查询
if (pageReqVO.getEnterpriseName() != null) {
LambdaQueryWrapper<EnterpriseDO> wrapper = new LambdaQueryWrapper<>();
wrapper.like(EnterpriseDO::getEnterprisesName, pageReqVO.getEnterpriseName());
final List<EnterpriseDO> enterpriseDOS = enterpriseMapper.selectList(wrapper);
if (enterpriseDOS != null || enterpriseDOS.size() > 0) {
final List<Long> collect = enterpriseDOS.stream().map(item -> item.getId()).collect(Collectors.toList());
pageReqVO.setEnterpriseList(collect);
}
}
//根据任务名称查询
if (pageReqVO.getTaskName() != null) {
LambdaQueryWrapper<TaskInfoDO> wrapper = new LambdaQueryWrapper<>();
wrapper.like(TaskInfoDO::getTitle, pageReqVO.getTaskName());
final List<TaskInfoDO> taskInfoDOS = taskInfoMapper.selectList(wrapper);
if (taskInfoDOS != null || taskInfoDOS.size() > 0) {
final List<Long> collect = taskInfoDOS.stream().map(item -> item.getId()).collect(Collectors.toList());
pageReqVO.setTaskList(collect);
}
}
final PageResult<EnterpriseInspectionsDO> enterpriseInspectionsDOPageResult = enterpriseInspectionsMapper.selectPage(pageReqVO);
if ( enterpriseInspectionsDOPageResult.getList() != null && enterpriseInspectionsDOPageResult.getList().size() > 0 ) {
enterpriseInspectionsDOPageResult.getList().forEach(item->{
@ -114,53 +247,73 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
}
item.setTaskName(taskInfoDO.getTitle());
//查询任务标签
QueryWrapper<TaskTagDO> wrapper = new QueryWrapper<>();
wrapper.eq("task_id", taskInfoDO.getId());
final List<TaskTagDO> taskTagDOS = taskTagMapper.selectList(wrapper);
List<String> tagList = new ArrayList<>();
if (taskTagDOS != null && taskTagDOS.size() > 0) {
taskTagDOS.forEach(taskTagItem->{
final TagLibraryDO tagLibraryDO = tagLibraryMapper.selectById(taskTagItem.getTagId());
if (tagLibraryDO != null) {
tagList.add(tagLibraryDO.getTagName());
}
});
}
item.setTagList(tagList);
//查询企业
final EnterpriseDO enterpriseDO = enterpriseMapper.selectById(item.getEnterpriseId());
if (enterpriseDO == null) {
throw exception(ENTERPRISE_NOT_EXISTS);
}
//查询企业标签
final List<TagLibraryDO> tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterpriseDO.getId());
if (tagLibraryDOS != null) {
item.setTagList(tagLibraryDOS.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList()));
}
item.setEnterpriseName(enterpriseDO.getEnterprisesName());
item.setEnterpriseAddress(enterpriseDO.getAddress());
//查询执行的最新一条记录
final InspectionsLogDO inspectionsLogNew = this.getInspectionsLogNew(item.getId());
if (inspectionsLogNew != null) {
item.setInspectionStatus(inspectionsLogNew.getStatus());
//执行人,协同执法
//查询打卡记录
final List<SignInLogDO> singnInLogList = this.getSingnInLogList(item.getId());
if (singnInLogList != null && singnInLogList.size() > 0) {
final List<String> collect = singnInLogList.stream().filter(signInLogDO -> signInLogDO.getIsInspect() == false).map(item2 -> item2.getRealName()).collect(Collectors.toList());
if (collect != null && collect.size() > 0) {
item.setCooperateWithName(String.join(",", collect));
}
final List<String> collect2 = singnInLogList.stream().filter(signInLogDO -> signInLogDO.getIsInspect() == true).map(item2 -> item2.getRealName()).collect(Collectors.toList());
if (collect2 != null && collect2.size() > 0) {
item.setInspectName(String.join(",", collect2));
}
}
//查询检查记录
QueryWrapper<InspectionsLogDO> inspectionsLogWrapper = new QueryWrapper<>();
inspectionsLogWrapper.eq("inspections_id", item.getId());
inspectionsLogWrapper.orderByDesc("create_time");
final List<InspectionsLogDO> inspectionsLogDOS = inspectionsLogMapper.selectList(inspectionsLogWrapper);
if (inspectionsLogDOS != null && inspectionsLogDOS.size() > 0) {
item.setInspectionStatus(inspectionsLogDOS.get(0).getStatus());
item.setInspectName(inspectionsLogDOS.get(0).getInspectName());
item.setCooperateWithName(inspectionsLogDOS.get(0).getCooperateWithName());
item.setExecTime(inspectionsLogDOS.get(0).getCreateTime());
item.setExecTime(inspectionsLogNew.getCreateTime());
//根据执法人员id 查询其所属部门
final Long userId = Long.valueOf(inspectionsLogDOS.get(0).getCreator());
final Long userId = Long.valueOf(inspectionsLogNew.getCreator());
final AdminUserDO user = adminUserService.getUser(userId);
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
final DeptDO dept = deptService.getDept(user.getDeptId());
item.setDepartment(dept.getName());
} else {
//根据执法人员id 查询其所属部门
if (item.getUserId() != null) {
final Long userId = Long.valueOf(item.getUserId());
final AdminUserDO user = adminUserService.getUser(userId);
item.setInspectName(user.getRealName());
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
}
}
});
}
if (pageReqVO.getInspectionsStatus() != null) {
final List<EnterpriseInspectionsDO> collect = enterpriseInspectionsDOPageResult.getList().stream().filter(item -> item.getInspectionStatus() == pageReqVO.getInspectionsStatus()).collect(Collectors.toList());
enterpriseInspectionsDOPageResult.setList(collect);
enterpriseInspectionsDOPageResult.setTotal(Long.valueOf(collect.size()));
}
return enterpriseInspectionsDOPageResult;
}
@ -174,6 +327,11 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
//循环记录id列表
passOnSaveVO.getInspectionsId().forEach(item->{
final EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(item);
if (enterpriseInspectionsDO.getUserId() == passOnSaveVO.getUserId()) {
throw exception(ENTERPRISE_INSPECTIONS_STATUS_ERROR2);
}
if (enterpriseInspectionsDO == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
}
@ -186,32 +344,54 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
//已经开始 就要判断是否是整改状态 整改状态才能转
enterpriseInspectionsDO.setStatus(4);
} else {
enterpriseInspectionsDO.setStatus(3);
enterpriseInspectionsDO.setStatus(1);
enterpriseInspectionsDO.setUserId(passOnSaveVO.getUserId());
}
enterpriseInspectionsMapper.updateById(enterpriseInspectionsDO);
AdminUserDO user = adminUserService.getUser(passOnSaveVO.getUserId());
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
EnterpriseInspectionsDO inspectionsDO = new EnterpriseInspectionsDO();
inspectionsDO.setEnterpriseId(enterpriseInspectionsDO.getEnterpriseId());
inspectionsDO.setTaskId(enterpriseInspectionsDO.getTaskId());
// if (enterpriseInspectionsDO.getStatus() == 4) {
// AdminUserDO user = adminUserService.getUser(passOnSaveVO.getUserId());
// if (user == null) {
// throw exception(USER_NOT_EXISTS);
// }
// EnterpriseInspectionsDO inspectionsDO = new EnterpriseInspectionsDO();
// inspectionsDO.setEnterpriseId(enterpriseInspectionsDO.getEnterpriseId());
// inspectionsDO.setTaskId(enterpriseInspectionsDO.getTaskId());
// inspectionsDO.setUserId(passOnSaveVO.getUserId());
// inspectionsDO.setInspectName(user.getRealName());
// enterpriseInspectionsMapper.insert(inspectionsDO);
// }
inspectionsDO.setUserId(passOnSaveVO.getUserId());
inspectionsDO.setInspectName(user.getRealName());
enterpriseInspectionsMapper.insert(inspectionsDO);
} else {
throw exception(ENTERPRISE_INSPECTIONS_STATUS_ERROR);
}
});
}
@Override
public List<EnterpriseInspectionsDO> getListByUserIdAndTaskName(Long userId, String taskName) {
LambdaQueryWrapper<EnterpriseInspectionsDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EnterpriseInspectionsDO::getUserId, userId);
wrapper.eq(EnterpriseInspectionsDO::getTaskName, taskName);
final List<EnterpriseInspectionsDO> enterpriseInspectionsDOS = enterpriseInspectionsMapper.selectList(wrapper);
//筛选出可以转交的检查记录
List<EnterpriseInspectionsDO> list = new ArrayList<>();
if (enterpriseInspectionsDOS != null && enterpriseInspectionsDOS.size() > 0) {
enterpriseInspectionsDOS.forEach(item->{
final InspectionsLogDO inspectionsLogNew = this.getInspectionsLogNew(item.getId());
if (inspectionsLogNew == null || inspectionsLogNew.getStatus() == 3) {
//已经开始 就要判断是否是整改状态 整改状态才能转
list.add(item);
}
});
}
return list;
}
//获得检测记录最新一条
@Override
public InspectionsLogDO getInspectionsLogNew(Long inspectionsId) {
QueryWrapper<InspectionsLogDO> wrapper = new QueryWrapper<>();
wrapper.eq("inspections_id", inspectionsId);
@ -221,7 +401,52 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe
return null;
}
return inspectionsLogDOS.get(0);
}
@Override
public List<EnterpriseInspectionsDO> getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO) {
return enterpriseInspectionsMapper.selectList(pageReqVO);
}
@Override
public List<SelectUserChangeVO> changeSelectUser(Long deptId) {
List<SelectUserChangeVO> list = new ArrayList<>();
List<AdminUserDO> adminUserDOS;
LambdaQueryWrapper<AdminUserDO> wrapper = new LambdaQueryWrapper<>();
wrapper.isNotNull(AdminUserDO::getRealName);
wrapper.ne(AdminUserDO::getId, 1L);
if (deptId != null) {
wrapper.eq(AdminUserDO::getDeptId, deptId);
}
adminUserDOS = adminUserMapper.selectList(wrapper);
if (adminUserDOS != null && adminUserDOS.size() > 0) {
adminUserDOS.forEach(item-> {
SelectUserChangeVO userChangeVO = new SelectUserChangeVO();
userChangeVO.setUserId(item.getId());
userChangeVO.setRealName(item.getRealName());
userChangeVO.setAvatar(item.getAvatar());
QueryWrapper<UserRoleDO> roleDOQueryWrapper = new QueryWrapper<>();
roleDOQueryWrapper.eq("user_id", item.getId());
List<UserRoleDO> userRoleDOS = userRoleMapper.selectList(roleDOQueryWrapper);
if (userRoleDOS != null && userRoleDOS.size() > 0) {
//查询角色名称
List<Long> roleIds = userRoleDOS.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList());
List<RoleDO> roleDOS = roleMapper.selectBatchIds(roleIds);
if (roleDOS != null && roleDOS.size() > 0) {
List<String> roleNames = roleDOS.stream().map(RoleDO::getName).collect(Collectors.toList());
userChangeVO.setRoleName(roleNames);
}
}
list.add(userChangeVO);
});
};
return list;
}
}

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;
}
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogService.java

@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.system.controller.admin.inspectionslog.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.system.dal.dataobject.signinlog.SignInLogDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import javax.validation.Valid;
@ -22,7 +23,7 @@ public interface InspectionsLogService {
* @param createReqVO 创建信息
* @return 编号
*/
Long createInspectionsLog(@Valid InspectionsLogSaveReqVO createReqVO);
void createInspectionsLog(@Valid InspectionsLogSaveReqVO createReqVO);
/**
* 更新检查结果日志
@ -57,4 +58,11 @@ public interface InspectionsLogService {
List<InspectionsLogDO> list(InspectionsLogPageReqVO pageReqVO);
void cooperateWithSignIn(Long inspectionsLogId);
void confirmSignIn(InspectionsLogSaveReqVO createReqVO);
void inspectionsAudit(InspectionsLogSaveReqVO createReqVO);
List<InspectionsLogAppListVO> signInList(Long inspectionsId);
}

293
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/inspectionslog/InspectionsLogServiceImpl.java

@ -1,11 +1,17 @@
package cn.iocoder.yudao.module.system.service.inspectionslog;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import cn.iocoder.yudao.module.system.dal.dataobject.signinlog.SignInLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taskinfo.TaskInfoDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections.EnterpriseInspectionsMapper;
import cn.iocoder.yudao.module.system.dal.mysql.signinlog.SignInLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.taskinfo.TaskInfoMapper;
import cn.iocoder.yudao.module.system.service.dept.DeptService;
import cn.iocoder.yudao.module.system.service.enterpriseinspections.EnterpriseInspectionsService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.alibaba.excel.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
@ -13,6 +19,8 @@ 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.inspectionslog.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -45,65 +53,69 @@ public class InspectionsLogServiceImpl implements InspectionsLogService {
private EnterpriseInspectionsMapper enterpriseInspectionsMapper;
@Resource
private TaskInfoMapper taskInfoMapper;
@Resource
private SignInLogMapper signInLogMapper;
@Resource
private EnterpriseInspectionsService enterpriseInspectionsService;
@Resource
private DeptService deptService;
@Override
public Long createInspectionsLog(InspectionsLogSaveReqVO createReqVO) {
//当前用户id
Long loginUserId = getLoginUserId();
AdminUserDO user = adminUserService.getUser(loginUserId);
//根据查询出的列表判断执行到哪一步
LambdaQueryWrapper<InspectionsLogDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(InspectionsLogDO::getInspectionsId, createReqVO.getInspectionsId());
wrapper.orderByDesc(InspectionsLogDO::getCreateTime);
List<InspectionsLogDO> list = inspectionsLogMapper.selectList(wrapper);
@Transactional
public void createInspectionsLog(InspectionsLogSaveReqVO createReqVO) {
if (list == null || list.size() == 0) {
//签到
createReqVO.setStatus(1);
createReqVO.setInspectId(loginUserId);
createReqVO.setInspectName(user.getRealName());
//查询执法记录
EnterpriseInspectionsDO inspections = enterpriseInspectionsMapper.selectById(createReqVO.getInspectionsId());
if (inspections == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
}
if (list != null && createReqVO.getStatus() != null && createReqVO.getStatus() == 1) {
//请不要重复签到
throw exception(INSPECTIONS_SUCCESS);
}
//当前用户id
Long loginUserId = getLoginUserId();
final AdminUserDO user = adminUserService.getUser(loginUserId);
if (list != null && list.get(0).getStatus() == 2) {
throw exception(INSPECTIONS_SUCCESS);
}
//根据查询出的列表判断执行到哪一步
final InspectionsLogDO inspectionsLogNew = enterpriseInspectionsService.getInspectionsLogNew(createReqVO.getInspectionsId());
//没有记录和整改状态为打卡
if (inspectionsLogNew == null || (inspectionsLogNew != null && inspectionsLogNew.getStatus() == 3)) {
createReqVO.setStatus(0);
InspectionsLogDO inspectionsLog = BeanUtils.toBean(createReqVO, InspectionsLogDO.class);
final int insert = inspectionsLogMapper.insert(inspectionsLog);
if (insert > 0) {
final SignInLogDO signInLogDO = new SignInLogDO();
signInLogDO.setInsId(inspectionsLog.getId());
signInLogDO.setUserId(loginUserId);
signInLogDO.setRealName(user.getRealName());
signInLogDO.setGpsLocation(createReqVO.getGpsLocation());
if (loginUserId == inspections.getUserId()) {
signInLogDO.setIsInspect(true);
}
signInLogMapper.insert(signInLogDO);
}
// 插入
InspectionsLogDO inspectionsLog = BeanUtils.toBean(createReqVO, InspectionsLogDO.class);
inspectionsLogMapper.insert(inspectionsLog);
} else {
//整改需要重新创建子任务
if (list != null && createReqVO.getStatus() != null && createReqVO.getStatus() == 3) {
//查看打卡记录
final List<SignInLogDO> signInLog = this.getSignInLog(inspectionsLogNew.getId());
if (signInLog == null) {
throw exception(SIGN_IN_LOG_ERROR);
}
//查询父任务,和执法记录
EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(createReqVO.getInspectionsId());
if (enterpriseInspectionsDO == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
//查看当前用户是否已打卡
final List<Long> collect = signInLog.stream().map(SignInLogDO::getUserId).collect(Collectors.toList());
if(collect.contains(loginUserId)) {
throw exception(SIGN_IN_LOG_ERROR2);
}
//添加子任务
TaskInfoDO taskInfo = new TaskInfoDO();
taskInfo.setTitle(enterpriseInspectionsDO.getEnterpriseId() + "-" + "整改任务");
taskInfo.setTaskType(1); //整改默认是普通专项任务类型
taskInfo.setParentId(enterpriseInspectionsDO.getTaskId());
taskInfo.setParentType(21); //父子任务类型
taskInfoMapper.insert(taskInfo);
//添加执法记录
EnterpriseInspectionsDO enterpriseInspectionsDO1 = new EnterpriseInspectionsDO();
enterpriseInspectionsDO1.setUserId(getLoginUserId());
enterpriseInspectionsDO1.setEnterpriseId(enterpriseInspectionsDO.getEnterpriseId());
enterpriseInspectionsDO1.setTaskId(taskInfo.getId());
enterpriseInspectionsDO1.setStatus(2); //整改任务默认是启动的状态
enterpriseInspectionsMapper.insert(enterpriseInspectionsDO1);
}
// 返回
return inspectionsLog.getId();
signInLogMapper.insert(new SignInLogDO().setInsId(inspectionsLogNew.getId()).setUserId(loginUserId).setRealName(user.getRealName()));
}
}
public List<SignInLogDO> getSignInLog(Long insId) {
LambdaQueryWrapper<SignInLogDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SignInLogDO::getInsId, insId);
return signInLogMapper.selectList(wrapper);
}
@Override
@ -136,14 +148,115 @@ public class InspectionsLogServiceImpl implements InspectionsLogService {
@Override
public PageResult<InspectionsLogDO> getInspectionsLogPage(InspectionsLogPageReqVO pageReqVO) {
return inspectionsLogMapper.selectPage(pageReqVO);
//不显示待确认签到的状态
pageReqVO.setPageNo(-1);
if (pageReqVO.getStatus() == null) {
pageReqVO.setMrStatus(0);
}
final PageResult<InspectionsLogDO> inspectionsLogDOPageResult = inspectionsLogMapper.selectPage(pageReqVO);
if (inspectionsLogDOPageResult.getList() != null && inspectionsLogDOPageResult.getList().size() > 0) {
inspectionsLogDOPageResult.getList().forEach(item->{
final EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(item.getInspectionsId());
if (enterpriseInspectionsDO == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
}
item.setUserList(this.getInspectionsLogAppListVO2(item.getId()));
});
}
return inspectionsLogDOPageResult;
}
//封装
public List<InspectionsLogAppListVO> getInspectionsLogAppListVO2(Long insId) {
List<InspectionsLogAppListVO> appListVO = new ArrayList<>();
//取最新一条签到状态
LambdaQueryWrapper<InspectionsLogDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(InspectionsLogDO::getStatus, 1);
wrapper.eq(InspectionsLogDO::getInspectionsId, insId);
wrapper.orderByDesc(InspectionsLogDO::getCreateTime);
final List<InspectionsLogDO> list = inspectionsLogMapper.selectList(wrapper);
if (list != null) {
final Long id = list.get(0).getId();
final List<SignInLogDO> signInLog = this.getSignInLog(id);
if (signInLog != null && signInLog.size() > 0) {
signInLog.forEach(signInLogDO->{
final AdminUserDO user = adminUserService.getUser(signInLogDO.getUserId());
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
InspectionsLogAppListVO appListVO1 = new InspectionsLogAppListVO();
appListVO1.setRealName(signInLogDO.getRealName());
appListVO1.setTime(signInLogDO.getCreateTime());
appListVO1.setUserId(signInLogDO.getUserId());
appListVO1.setIsInspect(signInLogDO.getIsInspect());
final DeptDO dept = deptService.getDept(user.getDeptId());
if (dept != null) {
appListVO1.setDeptName(dept.getName());
}
appListVO1.setAvtar(user.getAvatar());
appListVO.add(appListVO1);
});
}
}
return appListVO;
}
//封装
public List<InspectionsLogAppListVO> getInspectionsLogAppListVO(Long insId) {
List<InspectionsLogAppListVO> appListVO = new ArrayList<>();
//取最新一条签到状态
final List<SignInLogDO> signInLog = this.getSignInLog(insId);
if (signInLog != null && signInLog.size() > 0) {
signInLog.forEach(signInLogDO->{
final AdminUserDO user = adminUserService.getUser(signInLogDO.getUserId());
if (user == null) {
throw exception(USER_NOT_EXISTS);
}
InspectionsLogAppListVO appListVO1 = new InspectionsLogAppListVO();
appListVO1.setRealName(signInLogDO.getRealName());
appListVO1.setTime(signInLogDO.getCreateTime());
appListVO1.setUserId(signInLogDO.getUserId());
appListVO1.setIsInspect(signInLogDO.getIsInspect());
final DeptDO dept = deptService.getDept(user.getDeptId());
if (dept != null) {
appListVO1.setDeptName(dept.getName());
}
appListVO1.setAvtar(user.getAvatar());
appListVO.add(appListVO1);
});
}
return appListVO;
}
@Override
@Transactional
public List<InspectionsLogDO> list(InspectionsLogPageReqVO pageReqVO) {
QueryWrapper<InspectionsLogDO> wrapper = new QueryWrapper<>();
wrapper.eq("inspections_id", pageReqVO.getInspectionsId());
return inspectionsLogMapper.selectList(wrapper);
final List<InspectionsLogDO> list = inspectionsLogMapper.selectList(wrapper);
if (list != null && list.size() > 0) {
//把签到记录起来
List<InspectionsLogAppListVO> appListVO = new ArrayList<>();
list.forEach(item->{
if (item.getStatus() != null && item.getStatus() == 1) {
final List<InspectionsLogAppListVO> inspectionsLogAppListVO2 = this.getInspectionsLogAppListVO2(item.getInspectionsId());
if (inspectionsLogAppListVO2 != null) {}
}
});
}
return list;
}
/**
@ -174,6 +287,86 @@ public class InspectionsLogServiceImpl implements InspectionsLogService {
}
inspectionsLogMapper.updateById(inspectionsLogDO);
//插入协同人员打卡记录表
SignInLogDO signInLogDO = new SignInLogDO();
signInLogDO.setInsId(inspectionsLogId);
signInLogDO.setUserId(getLoginUserId());
signInLogMapper.insert(signInLogDO);
}
@Override
public void confirmSignIn(InspectionsLogSaveReqVO createReqVO) {
//查询执法记录
final EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(createReqVO.getInspectionsId());
if (enterpriseInspectionsDO == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
}
//根据查询出的列表判断执行到哪一步
final InspectionsLogDO inspectionsLogNew = enterpriseInspectionsService.getInspectionsLogNew(createReqVO.getInspectionsId());
if (inspectionsLogNew == null) {
throw exception(INSPECTIONS_LOG_NOT_EXISTS);
}
final List<SignInLogDO> signInLog = this.getSignInLog(inspectionsLogNew.getId());
if (signInLog == null) {
throw exception(SIGN_IN_LOG_ERROR);
}
//打卡记录里面必须有执行人
final List<Long> collect = signInLog.stream().map(item -> item.getUserId()).collect(Collectors.toList());
if(!collect.contains(enterpriseInspectionsDO.getUserId())) {
throw exception(SIGN_IN_LOG_ERROR4);
}
if (signInLog.size() < 2) {
throw exception(SIGN_IN_LOG_ERROR6);
}
//查看状态等于0 并且起到人员大于2 修改状态
if (inspectionsLogNew.getStatus() == 0) {
inspectionsLogNew.setStatus(1);
inspectionsLogMapper.updateById(inspectionsLogNew);
}
}
@Override
@Transactional
public void inspectionsAudit(InspectionsLogSaveReqVO createReqVO) {
//查询执法记录
final EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(createReqVO.getInspectionsId());
if (enterpriseInspectionsDO == null) {
throw exception(ENTERPRISE_INSPECTIONS_NOT_EXISTS);
}
//只有当前企业执行人才能提交审核
if (enterpriseInspectionsDO.getUserId() != getLoginUserId()) {
throw exception(SIGN_IN_LOG_ERROR5);
}
InspectionsLogDO updateObj = BeanUtils.toBean(createReqVO, InspectionsLogDO.class);
inspectionsLogMapper.insert(updateObj);
//修改执行记录状态
}
@Override
public List<InspectionsLogAppListVO> signInList(Long inspectionsId) {
//查询最新状态
final InspectionsLogDO inspectionsLogDO = enterpriseInspectionsService.getInspectionsLogNew(inspectionsId);
if (inspectionsLogDO != null) {
//如果当前状态不是待确认打卡的状态报错
// if (inspectionsLogDO.getStatus() != 0) {
// throw exception(SIGN_IN_LOG_ERROR3);
// }
//根据记录查询
return this.getInspectionsLogAppListVO(inspectionsLogDO.getId());
}
return Collections.emptyList();
}
}

13
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/maxkb/MaxkbApiService.java

@ -0,0 +1,13 @@
package cn.iocoder.yudao.module.system.service.maxkb;
import cn.iocoder.yudao.module.system.controller.admin.maxkb.vo.MaxkbdocumentVo;
import java.util.List;
public interface MaxkbApiService {
public void getAccessToken() ;
public void pushWebUrl(MaxkbdocumentVo maxkbdocumentVo) ;
}

72
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/maxkb/MaxkbApiServiceImpl.java

@ -0,0 +1,72 @@
package cn.iocoder.yudao.module.system.service.maxkb;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
import cn.iocoder.yudao.module.system.controller.admin.maxkb.vo.MaxkbdocumentVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Service
@Slf4j
public class MaxkbApiServiceImpl implements MaxkbApiService {
static final String MAXKB_ACCOUNT_URL = "maxkb-account-url";
static final String MAXKB_ACCOUNT_USER = "maxkb-account-user";
static final String MAXKB_ACCOUNT_PASSWORD = "maxkb-account-password";
static final String MAXKB_ACCOUNT_TOKEN = "maxkb-account-url-token";
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private ConfigApi configApi;
@Override
public void getAccessToken() {
String accountUrl = configApi.getConfigValueByKey(MAXKB_ACCOUNT_URL);
String accountUser = configApi.getConfigValueByKey(MAXKB_ACCOUNT_USER);
String accountPassword = configApi.getConfigValueByKey(MAXKB_ACCOUNT_PASSWORD);
JSONObject jsonObject=new JSONObject();
jsonObject.set("username",accountUser);
jsonObject.set("password",accountPassword);
String s = HttpUtils.post(accountUrl+"/api/user/login", null,jsonObject.toString());
if(s!=null){
JSONObject res = new JSONObject(s);
stringRedisTemplate.opsForValue().set(MAXKB_ACCOUNT_TOKEN, res.getStr("data"),10, TimeUnit.MINUTES);
}
}
@Override
public void pushWebUrl(MaxkbdocumentVo maxkbdocumentVo) {
String s = HttpUtils.post(configApi.getConfigValueByKey(MAXKB_ACCOUNT_URL) + "/api/dataset/"+maxkbdocumentVo.getId()+"/document/web",getMaxkbHeager(), JSONUtil.toJsonStr(maxkbdocumentVo));
log.info("web知识库返回信息"+s);
}
private Map<String,String>getMaxkbHeager(){
String token = stringRedisTemplate.opsForValue().get(MAXKB_ACCOUNT_TOKEN);
if(StrUtil.isEmpty(token)){
getAccessToken();
token = stringRedisTemplate.opsForValue().get(MAXKB_ACCOUNT_TOKEN);
}
Map<String,String> map=new HashMap<>();
map.put("authorization",token);
map.put("content-type","application/json");
return map;
}
// /api/dataset/bff33a78-e5bd-11ef-825e-0242ac110003/document/web
}

56
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/signinlog/SignInLogService.java

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.system.service.signinlog;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.signinlog.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.signinlog.SignInLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import javax.validation.Valid;
/**
* 协调人员打卡记录 Service 接口
*
* @author 芋道源码
*/
public interface SignInLogService {
/**
* 创建协调人员打卡记录
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createSignInLog(@Valid SignInLogSaveReqVO createReqVO);
/**
* 更新协调人员打卡记录
*
* @param updateReqVO 更新信息
*/
void updateSignInLog(@Valid SignInLogSaveReqVO updateReqVO);
/**
* 删除协调人员打卡记录
*
* @param id 编号
*/
void deleteSignInLog(Long id);
/**
* 获得协调人员打卡记录
*
* @param id 编号
* @return 协调人员打卡记录
*/
SignInLogDO getSignInLog(Long id);
/**
* 获得协调人员打卡记录分页
*
* @param pageReqVO 分页查询
* @return 协调人员打卡记录分页
*/
PageResult<SignInLogDO> getSignInLogPage(SignInLogPageReqVO pageReqVO);
}

74
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/signinlog/SignInLogServiceImpl.java

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.system.service.signinlog;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.signinlog.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.signinlog.SignInLogDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.dal.mysql.signinlog.SignInLogMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
* 协调人员打卡记录 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class SignInLogServiceImpl implements SignInLogService {
@Resource
private SignInLogMapper signInLogMapper;
@Override
public Long createSignInLog(SignInLogSaveReqVO createReqVO) {
// 插入
SignInLogDO signInLog = BeanUtils.toBean(createReqVO, SignInLogDO.class);
signInLogMapper.insert(signInLog);
// 返回
return signInLog.getId();
}
@Override
public void updateSignInLog(SignInLogSaveReqVO updateReqVO) {
// 校验存在
validateSignInLogExists(updateReqVO.getId());
// 更新
SignInLogDO updateObj = BeanUtils.toBean(updateReqVO, SignInLogDO.class);
signInLogMapper.updateById(updateObj);
}
@Override
public void deleteSignInLog(Long id) {
// 校验存在
validateSignInLogExists(id);
// 删除
signInLogMapper.deleteById(id);
}
private void validateSignInLogExists(Long id) {
if (signInLogMapper.selectById(id) == null) {
throw exception(USER_NOT_EXISTS);
}
}
@Override
public SignInLogDO getSignInLog(Long id) {
return signInLogMapper.selectById(id);
}
@Override
public PageResult<SignInLogDO> getSignInLogPage(SignInLogPageReqVO pageReqVO) {
return signInLogMapper.selectPage(pageReqVO);
}
}

6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryService.java

@ -56,4 +56,10 @@ public interface TagLibraryService {
List<TagLibraryDO> list(String[] codeList);
List<TagLibraryDO> childrenList(Long id);
//根据任务id差标签
List<TagLibraryDO> listByTaskId(Long taskId);
//根据企业id标签查标签
List<TagLibraryDO> listByEnterpriseId(Long enterpriseId);
}

36
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryServiceImpl.java

@ -1,5 +1,10 @@
package cn.iocoder.yudao.module.system.service.taglibrary;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterprisetag.EnterpriseTagMapper;
import cn.iocoder.yudao.module.system.dal.mysql.tasktag.TaskTagMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;
@ -15,6 +20,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
@ -30,6 +36,10 @@ public class TagLibraryServiceImpl implements TagLibraryService {
@Resource
private TagLibraryMapper tagLibraryMapper;
@Resource
private TaskTagMapper taskTagMapper;
@Resource
private EnterpriseTagMapper enterpriseTagMapper;
@Override
public Integer createTagLibrary(TagLibrarySaveReqVO createReqVO) {
@ -104,6 +114,32 @@ public class TagLibraryServiceImpl implements TagLibraryService {
return tagLibraryMapper.selectList(wrapper);
}
@Override
public List<TagLibraryDO> listByTaskId(Long taskId) {
LambdaQueryWrapper<TaskTagDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(TaskTagDO::getTaskId, taskId);
final List<TaskTagDO> taskTagDOS = taskTagMapper.selectList(wrapper);
if (taskTagDOS != null && taskTagDOS.size() > 0) {
final List<TagLibraryDO> tagLibraryDOS = tagLibraryMapper.selectByIds(taskTagDOS.stream().map(TaskTagDO::getTagId).collect(Collectors.toList()));
return tagLibraryDOS;
}
return null;
}
@Override
public List<TagLibraryDO> listByEnterpriseId(Long enterpriseId) {
LambdaQueryWrapper<EnterpriseTagDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EnterpriseTagDO::getEnterpriseId, enterpriseId);
final List<EnterpriseTagDO> enterpriseTagDOS = enterpriseTagMapper.selectList(wrapper);
if (enterpriseTagDOS != null && enterpriseTagDOS.size() > 0) {
final List<TagLibraryDO> tagLibraryDOS = tagLibraryMapper.selectByIds(enterpriseTagDOS.stream().map(EnterpriseTagDO::getTagId).collect(Collectors.toList()));
return tagLibraryDOS;
}
return null;
}
// 递归构建树
private List<TagLibraryDO> buildTree(List<TagLibraryDO> tags, Integer parentId) {
List<TagLibraryDO> tree = new ArrayList<>();

3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoService.java

@ -53,7 +53,10 @@ public interface TaskInfoService {
*/
PageResult<TaskInfoDO> getTaskInfoPage(TaskInfoPageReqVO pageReqVO);
// List<TaskInfoDO> getTaskInfoList(TaskInfoPageReqVO pageReqVO);
//定时执行任务
void sendTask(Long taskId);
PageResult<TaskInfoDO> getTaskInfoAppPage(TaskInfoPageReqVO pageReqVO);
}

177
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java

@ -1,22 +1,33 @@
package cn.iocoder.yudao.module.system.service.taskinfo;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.infra.api.job.JobApi;
import cn.iocoder.yudao.module.system.controller.admin.tasktag.vo.TaskTagPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO;
import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taglibrary.TagLibraryDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tasktag.TaskTagDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterprise.EnterpriseMapper;
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections.EnterpriseInspectionsMapper;
import cn.iocoder.yudao.module.system.dal.mysql.inspectionslog.InspectionsLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.taglibrary.TagLibraryMapper;
import cn.iocoder.yudao.module.system.dal.mysql.tasktag.TaskTagMapper;
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
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;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.taskinfo.TaskInfoDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -29,7 +40,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.taskinfo.TaskInfoMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
@ -39,6 +50,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
*/
@Service
@Validated
@Slf4j
public class TaskInfoServiceImpl implements TaskInfoService {
@Resource
@ -52,13 +64,24 @@ public class TaskInfoServiceImpl implements TaskInfoService {
@Resource
private EnterpriseInspectionsMapper enterpriseInspectionsMapper;
@Resource
private InspectionsLogMapper inspectionsLogMapper;
private TagLibraryMapper tagLibraryMapper;
@Resource
private AdminUserService adminUserService;
@Resource
private AdminUserMapper adminUserMapper;
@Override
@Transactional
public Long createTaskInfo(TaskInfoSaveReqVO createReqVO) {
// 插入
TaskInfoDO taskInfo = BeanUtils.toBean(createReqVO, TaskInfoDO.class);
String serialNumber = "";
String time = "";
time = DateUtil.format(new Date(), "yyyyMMddHHmm");
serialNumber = "HB" + time;
taskInfo.setTaskNumber(serialNumber);
taskInfoMapper.insert(taskInfo);
//添加任务标签
@ -68,14 +91,7 @@ public class TaskInfoServiceImpl implements TaskInfoService {
});
}
//
// //添加定时任务
// JobSaveReqVO jobSaveReqVO = new JobSaveReqVO();
// try {
// jobApi.createJob(jobSaveReqVO);
// } catch (Throwable e) {
// throw new RuntimeException(e);
// }
//添加企业范围
if (!createReqVO.getEnterpriseIds().isEmpty() && createReqVO.getEnterpriseIds().size() > 0) {
List<EnterpriseInspectionsDO> list = new ArrayList<>();
@ -88,13 +104,26 @@ public class TaskInfoServiceImpl implements TaskInfoService {
EnterpriseInspectionsDO inspection = new EnterpriseInspectionsDO();
inspection.setTaskId(taskInfo.getId());
inspection.setEnterpriseId(item);
//专管员
inspection.setUserId(enterpriseDO.getUserId());
if (enterpriseDO.getUserId() != null) {
inspection.setCreator(enterpriseDO.getUserId().toString());
}
list.add(inspection);
});
enterpriseInspectionsMapper.insertBatch(list);
}
if(taskInfo.getId()>0){
// //添加定时任务
// JobSaveReqVO jobSaveReqVO = new JobSaveReqVO();
// try {
// jobApi.createJob(jobSaveReqVO);
// } catch (Throwable e) {
// throw new RuntimeException(e);
// }
}
// 返回
return taskInfo.getId();
@ -148,25 +177,10 @@ public class TaskInfoServiceImpl implements TaskInfoService {
@Override
public PageResult<TaskInfoDO> getTaskInfoPage(TaskInfoPageReqVO pageReqVO) {
// final Long loginUserId = getLoginUserId();
//根据分配表反查任务表
LambdaQueryWrapper<EnterpriseInspectionsDO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EnterpriseInspectionsDO::getCreator, getLoginUserId());
List<EnterpriseInspectionsDO> list = enterpriseInspectionsMapper.selectList(wrapper);
if (!list.isEmpty() && list.size() > 0) {
final List<Map<String, String>> data = new ArrayList<>();
list.forEach(item->{
// Map<String, String> map = new HashMap<>();
// map.put("id", item.getTaskId().toString());
// map.put("name", item.get)
// taskIds.add(item.getTaskId());
});
}
return taskInfoMapper.selectPage(pageReqVO);
}
@Override
public void sendTask(Long taskId) {
final TaskInfoDO taskInfoDO = taskInfoMapper.selectById(taskId);
@ -181,4 +195,105 @@ public class TaskInfoServiceImpl implements TaskInfoService {
}
@Override
public PageResult<TaskInfoDO> getTaskInfoAppPage(TaskInfoPageReqVO pageReqVO) {
//按标签查询
if (pageReqVO.getTagList() != null && pageReqVO.getTagList().size() > 0) {
LambdaQueryWrapper<TaskTagDO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(TaskTagDO::getTagId, pageReqVO.getTagList());
final List<TaskTagDO> taskTagDOS = taskTagMapper.selectList(wrapper);
if (taskTagDOS != null && taskTagDOS.size() > 0) {
pageReqVO.setTagList(taskTagDOS.stream().map(item->item.getTaskId()).collect(Collectors.toList()));
}
}
//按时间查询
if (pageReqVO.getSelectWeek() != null) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime[] dateList = new LocalDateTime[2];
switch (pageReqVO.getSelectWeek()) {
case 1:
dateList[0] = now.minusDays(3); // 三天前
break;
case 2:
dateList[0] = now.minusWeeks(1); // 一周前
break;
case 3:
dateList[0] = now.minusMonths(1); // 一月前
break;
case 4:
dateList[0] = now.minusYears(1); // 一年前
break;
}
dateList[1] = now;
pageReqVO.setEndDate(dateList);
}
final PageResult<TaskInfoDO> taskInfoDOPageResult = taskInfoMapper.selectAppPage(pageReqVO);
if (taskInfoDOPageResult.getList() != null && taskInfoDOPageResult.getList().size() > 0) {
taskInfoDOPageResult.getList().forEach(item->{
QueryWrapper<EnterpriseInspectionsDO> wrapper = new QueryWrapper<>();
wrapper.eq("task_id", item.getId());
//根据不同的角色查询
/*
管理员局长查全部
检查员查自己的
队长 查本部门
*/
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
final AdminUserDO user1 = adminUserService.getUser(loginUserId);
if (user1.getPostIds().contains(1l) || user1.getPostIds().contains(2l)) {
//全部
} else if (user1.getPostIds().contains(4l)) {
//本部门
final List<AdminUserDO> adminUserDOS = adminUserMapper.selectList(new QueryWrapper<AdminUserDO>().eq("dept_id", user1.getDeptId()));
if (adminUserDOS != null || adminUserDOS.size() > 0) {
final List<Long> collect = adminUserDOS.stream().map(res -> res.getId()).collect(Collectors.toList());
wrapper.in("user_id", collect);
}
} else if (user1.getPostIds().contains(5l)) {
//自己
wrapper.eq("user_id", loginUserId);
}
item.setTaskExecNum(0);
List<EnterpriseInspectionsDO> enterpriseInspectionsDOList = enterpriseInspectionsMapper.selectList(wrapper);
log.info("enterpriseInspectionsDOList:{}", enterpriseInspectionsDOList);
if (enterpriseInspectionsDOList != null && enterpriseInspectionsDOList.size() > 0) {
item.setTaskExecNum(enterpriseInspectionsDOList.size());
final List<EnterpriseInspectionsDO> collect = enterpriseInspectionsDOList.stream().filter(res -> res.getStatus() == 5).collect(Collectors.toList());
item.setTaskFinishNum(collect.size());
}
//获取任务标签
QueryWrapper<TaskTagDO> wrapper1 = new QueryWrapper<>();
wrapper1.eq("task_id", item.getId());
List<TaskTagDO> taskTagDOList = taskTagMapper.selectList(wrapper1);
if (taskTagDOList != null && taskTagDOList.size() > 0) {
final List<Long> collect = taskTagDOList.stream().map(TaskTagDO::getTagId).collect(Collectors.toList());
final List<TagLibraryDO> tagLibraryDOS = tagLibraryMapper.selectByIds(collect);
if (tagLibraryDOS != null && tagLibraryDOS.size() > 0) {
item.setTagList(tagLibraryDOS.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList()));
}
}
enterpriseInspectionsMapper.selectList();
});
}
//筛选出 TaskExecNum 为0的
if (taskInfoDOPageResult.getList() != null && taskInfoDOPageResult.getList().size() > 0) {
final List<TaskInfoDO> collect = taskInfoDOPageResult.getList().stream().filter(res -> res.getTaskExecNum() > 0).collect(Collectors.toList());
taskInfoDOPageResult.setList(collect);
taskInfoDOPageResult.setTotal(Long.valueOf(collect.size()));
}
return taskInfoDOPageResult;
}
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagService.java

@ -53,4 +53,14 @@ public interface TaskTagService {
*/
PageResult<TaskTagDO> getTaskTagPage(TaskTagPageReqVO pageReqVO);
/**
* 获得任务标签关联分页
*
* @param pageReqVO 分页查询
* @return 任务标签关联分页
*/
List<TaskTagDO> getTaskTagList(TaskTagPageReqVO pageReqVO);
}

6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tasktag/TaskTagServiceImpl.java

@ -72,4 +72,10 @@ public class TaskTagServiceImpl implements TaskTagService {
return taskTagMapper.selectPage(pageReqVO);
}
@Override
public List<TaskTagDO> getTaskTagList(TaskTagPageReqVO pageReqVO) {
return taskTagMapper.selectList(pageReqVO);
}
}

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);

42
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/weixin/TokenValidatorService.java

@ -0,0 +1,42 @@
package cn.iocoder.yudao.module.system.service.weixin;
import org.springframework.stereotype.Service;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
@Service
public class TokenValidatorService {
public static boolean validateToken(String token, String signature, String timestamp, String nonce) {
String[] arr = new String[]{token, timestamp, nonce};
// 对 token、timestamp 和 nonce 按字典序排序
Arrays.sort(arr);
StringBuilder content = new StringBuilder();
for (String s : arr) {
content.append(s);
}
String tempStr = sha1Encode(content.toString());
// 将加密后的字符串与 signature 进行对比
return tempStr!= null && tempStr.equals(signature);
}
private static String sha1Encode(String str) {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-1");
digest.update(str.getBytes());
byte[] bytes = digest.digest();
StringBuilder hexStr = new StringBuilder();
for (byte b : bytes) {
String hex = Integer.toHexString(0xFF & b);
if (hex.length() == 1) {
hexStr.append('0');
}
hexStr.append(hex);
}
return hexStr.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return null;
}
}

67
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/weixin/WeChatService.java

@ -0,0 +1,67 @@
package cn.iocoder.yudao.module.system.service.weixin;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
@Service
public class WeChatService {
@Autowired
private ObjectMapper objectMapper;
@Value("${wx.miniapp.appid}")
private String APP_ID ; // 替换为你的小程序 AppID
@Value("${wx.miniapp.secret}")
private String APP_SECRET; // 替换为你的小程序 AppSecret
/**
* 获取微信 Access Token
*/
public String getAccessToken() throws Exception {
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + APP_ID + "&secret=" + APP_SECRET;
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(url);
String response = EntityUtils.toString(httpClient.execute(httpGet).getEntity());
httpClient.close();
ObjectMapper mapper = new ObjectMapper();
JsonNode node = mapper.readTree(response);
return node.get("access_token").asText();
}
/**
* 发送订阅消息
*/
public void sendSubscribeMessage(String accessToken, String openId, String templateId) throws Exception {
String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + accessToken;
// 构建消息内容
ObjectNode data = objectMapper.createObjectNode();
data.put("touser", openId); // 用户的 OpenID
data.put("template_id", templateId); // 订阅消息模板 ID
data.put("page", "/sub/common/waiting"); // 点击消息跳转的小程序页面
data.put("data", objectMapper.createObjectNode()
.put("thing1", objectMapper.createObjectNode().put("value", "Hello, World!"))
.at("thing2"));
// 发送 HTTP 请求
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setEntity(new StringEntity(data.toString()));
String response = EntityUtils.toString(httpClient.execute(httpPost).getEntity());
httpClient.close();
System.out.println("订阅消息发送结果: " + response);
}
}

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

@ -145,16 +145,16 @@ logging:
wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
mp:
# 公众号配置(必填)
app-id: wx041349c6f39b268b
secret: 5abee519483bc9f8cb37ce280e814bd0
app-id: wx6d80755768234f3b
secret: c8180f2ab1b8454d403c7aa336782e21
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
appid: wx63c280fe3248a3e7
secret: 6f270509224a7ae1296bbf1c8cb97aed
appid: wx6d80755768234f3b
secret: c8180f2ab1b8454d403c7aa336782e21
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀

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 的跨节点的共享

1
yudao-server/src/main/resources/application.yaml

@ -259,6 +259,7 @@ yudao:
- /admin-api/pay/notify/** # 支付回调通知,不携带租户编号
- /jmreport/* # 积木报表,无法携带租户编号
- /admin-api/mp/open/** # 微信公众号开放平台,微信回调接口,无法携带租户编号
- /admin-api/system/wechat/**
ignore-tables:
- system_tenant
- system_tenant_package

Loading…
Cancel
Save