Просмотр исходного кода

stop tracking application-dev.yml

Huanyi 3 месяцев назад
Родитель
Сommit
e4247c5691
34 измененных файлов с 406 добавлено и 411 удалено
  1. 0 284
      ruoyi-admin/src/main/resources/application-dev.yml
  2. 4 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java
  3. 19 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java
  4. 16 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/constant/QcTaskDetailStatusConst.java
  5. 4 2
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/constant/QcTaskStatusConst.java
  6. 8 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/DocumentQcTaskController.java
  7. 11 3
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/DocumentQcTaskDetailController.java
  8. 9 1
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/ProjectController.java
  9. 1 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/WpsController.java
  10. 5 1
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/Document.java
  11. 1 1
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/DocumentAuditLog.java
  12. 0 5
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/DocumentQcTask.java
  13. 4 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/DocumentQcTaskDetail.java
  14. 3 1
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/DocumentBo.java
  15. 4 8
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/DocumentQcTaskBo.java
  16. 16 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/DocumentQcTaskDetailListBo.java
  17. 2 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/ProjectMemberEditMemberBo.java
  18. 2 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/dto/WpsR.java
  19. 3 3
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/AppletMyTaskDocumentVo.java
  20. 2 2
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentAuditLogVo.java
  21. 38 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentQcTaskDetailListVo.java
  22. 1 7
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentQcTaskVo.java
  23. 8 5
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentVo.java
  24. 2 3
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/TaskCenterAuditListVo.java
  25. 4 5
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/TaskCenterFilingListVo.java
  26. 3 4
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/TaskCenterSubmissionListVo.java
  27. 6 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/IDocumentQcTaskDetailService.java
  28. 2 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/IDocumentQcTaskService.java
  29. 17 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/CommonDocumentService.java
  30. 43 0
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentQcTaskDetailServiceImpl.java
  31. 116 36
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentQcTaskServiceImpl.java
  32. 26 18
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentServiceImpl.java
  33. 7 5
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/FolderServiceImpl.java
  34. 19 17
      ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/ProjectServiceImpl.java

+ 0 - 284
ruoyi-admin/src/main/resources/application-dev.yml

@@ -1,284 +0,0 @@
---- # 监控中心配置
-spring.boot.admin.client:
-    # 增加客户端开关
-    enabled: false
-    url: http://localhost:9090/admin
-    instance:
-        service-host-type: IP
-        metadata:
-            username: ${spring.boot.admin.client.username}
-            userpassword: ${spring.boot.admin.client.password}
-    username: @monitor.username@
-    password: @monitor.password@
-
---- # snail-job 配置
-snail-job:
-    enabled: false
-    # 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
-    group: "ruoyi_group"
-    # SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
-    token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
-    server:
-        host: 127.0.0.1
-        port: 17888
-    # 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
-    namespace: ${spring.profiles.active}
-    # 随主应用端口漂移
-    port: 2${server.port}
-    # 客户端ip指定
-    host:
-
---- # 数据源配置
-spring:
-    datasource:
-        type: com.zaxxer.hikari.HikariDataSource
-        # 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
-        dynamic:
-            # 性能分析插件(有性能损耗 不建议生产环境使用)
-            p6spy: true
-            # 设置默认的数据源或者数据源组,默认值即为 master
-            primary: master
-            # 严格模式 匹配不到数据源则报错
-            strict: true
-            datasource:
-                # 主库数据源
-                master:
-                    type: ${spring.datasource.type}
-                    driverClassName: com.mysql.cj.jdbc.Driver
-                    # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
-                    # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-                    url: jdbc:mysql://127.0.0.1:3306/intelligent_etmf_system?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-                    username: root
-                    password: 1234
-            #        # 从库数据源
-            #        slave:
-            #          lazy: true
-            #          type: ${spring.datasource.type}
-            #          driverClassName: com.mysql.cj.jdbc.Driver
-            #          url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-            #          username:
-            #          password:
-            #        oracle:
-            #          type: ${spring.datasource.type}
-            #          driverClassName: oracle.jdbc.OracleDriver
-            #          url: jdbc:oracle:thin:@//localhost:1521/XE
-            #          username: ROOT
-            #          password: root
-            #        postgres:
-            #          type: ${spring.datasource.type}
-            #          driverClassName: org.postgresql.Driver
-            #          url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
-            #          username: root
-            #          password: root
-            #        sqlserver:
-            #          type: ${spring.datasource.type}
-            #          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
-            #          url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
-            #          username: SA
-            #          password: root
-            hikari:
-                # 最大连接池数量
-                maxPoolSize: 20
-                # 最小空闲线程数量
-                minIdle: 10
-                # 配置获取连接等待超时的时间
-                connectionTimeout: 30000
-                # 校验超时时间
-                validationTimeout: 5000
-                # 空闲连接存活最大时间,默认10分钟
-                idleTimeout: 600000
-                # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
-                maxLifetime: 1800000
-                # 多久检查一次连接的活性
-                keepaliveTime: 30000
-
---- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
-spring.data:
-    redis:
-        # 地址
-        host: 127.0.0.1
-        # 端口,默认为6379
-        port: 6379
-        # 数据库索引
-        database: 14
-#        # redis 密码必须配置
-#        password: ruoyi123
-        # 连接超时时间
-        timeout: 10s
-        # 是否开启ssl
-        ssl.enabled: false
-
-# redisson 配置
-redisson:
-    # redis key前缀
-    keyPrefix:
-    # 线程池数量
-    threads: 4
-    # Netty线程池数量
-    nettyThreads: 8
-    # 单节点配置
-    singleServerConfig:
-        # 客户端名称 不能用中文
-        clientName: intelligent-etmf-system
-        # 最小空闲连接数
-        connectionMinimumIdleSize: 8
-        # 连接池大小
-        connectionPoolSize: 32
-        # 连接空闲超时,单位:毫秒
-        idleConnectionTimeout: 10000
-        # 命令等待超时,单位:毫秒
-        timeout: 3000
-        # 发布和订阅连接池大小
-        subscriptionConnectionPoolSize: 50
-
---- # mail 邮件发送
-mail:
-    enabled: false
-    host: smtp.163.com
-    port: 465
-    # 是否需要用户名密码验证
-    auth: true
-    # 发送方,遵循RFC-822标准
-    from: xxx@163.com
-    # 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
-    user: xxx@163.com
-    # 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
-    pass: xxxxxxxxxx
-    # 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
-    starttlsEnable: true
-    # 使用SSL安全连接
-    sslEnable: true
-    # SMTP超时时长,单位毫秒,缺省值不超时
-    timeout: 0
-    # Socket连接超时值,单位毫秒,缺省值不超时
-    connectionTimeout: 0
-
---- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
-# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
-sms:
-    # 配置源类型用于标定配置来源(interface,yaml)
-    config-type: yaml
-    # 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
-    restricted: true
-    # 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
-    minute-max: 1
-    # 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
-    account-max: 30
-    # 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
-    blends:
-        # 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
-        # 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
-        config1:
-            # 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
-            supplier: alibaba
-            # 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
-            access-key-id: 您的accessKey
-            # 称为accessSecret有些称之为apiSecret
-            access-key-secret: 您的accessKeySecret
-            signature: 您的短信签名
-            sdk-app-id: 您的sdkAppId
-        config2:
-            # 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
-            supplier: tencent
-            access-key-id: 您的accessKey
-            access-key-secret: 您的accessKeySecret
-            signature: 您的短信签名
-            sdk-app-id: 您的sdkAppId
-
-logging:
-    config: classpath:logback-plus-without-file.xml
-
-captcha:
-    # 是否启用验证码校验
-    enable: false
-    # 验证码类型 math 数组计算 char 字符验证
-    type: MATH
-    # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
-    category: CIRCLE
-    # 数字验证码位数
-    numberLength: 1
-    # 字符验证码长度
-    charLength: 4
-
---- # 三方授权
-justauth:
-    # 前端外网访问地址
-    address: http://localhost:80
-    type:
-        maxkey:
-            # maxkey 服务器地址
-            # 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
-            server-url: http://sso.maxkey.top
-            client-id: 876892492581044224
-            client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
-            redirect-uri: ${justauth.address}/social-callback?source=maxkey
-        topiam:
-            # topiam 服务器地址
-            server-url: http://127.0.0.1:1898/api/v1/authorize/y0q************spq***********8ol
-            client-id: 449c4*********937************759
-            client-secret: ac7***********1e0************28d
-            redirect-uri: ${justauth.address}/social-callback?source=topiam
-            scopes: [ openid, email, phone, profile ]
-        qq:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=qq
-            union-id: false
-        weibo:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=weibo
-        gitee:
-            client-id: 91436b7940090d09c72c7daf85b959cfd5f215d67eea73acbf61b6b590751a98
-            client-secret: 02c6fcfd70342980cd8dd2f2c06c1a350645d76c754d7a264c4e125f9ba915ac
-            redirect-uri: ${justauth.address}/social-callback?source=gitee
-        dingtalk:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=dingtalk
-        baidu:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=baidu
-        csdn:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=csdn
-        coding:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=coding
-            coding-group-name: xx
-        oschina:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=oschina
-        alipay_wallet:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
-            alipay-public-key: MIIB**************DAQAB
-        wechat_open:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=wechat_open
-        wechat_mp:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
-        wechat_enterprise:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
-            agent-id: 1000002
-        gitlab:
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=gitlab
-        gitea:
-            # 前端改动 https://gitee.com/JavaLionLi/plus-ui/pulls/204
-            # gitea 服务器地址
-            server-url: https://demo.gitea.com
-            client-id: 10**********6
-            client-secret: 1f7d08**********5b7**********29e
-            redirect-uri: ${justauth.address}/social-callback?source=gitea

+ 4 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysUserService.java

@@ -252,4 +252,8 @@ public interface ISysUserService {
     boolean updateGender(String gender);
 
     boolean updateAvatar(Long avatar);
+
+    SysUserVo getById(Long id);
+
+    boolean updateOnProject(Long id, String nickname, String phoneNumber, String email, String password);
 }

+ 19 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.crypto.digest.BCrypt;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -693,6 +694,24 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
         ) > 0;
     }
 
+    @Override
+    public SysUserVo getById(Long id) {
+        return baseMapper.selectVoById(id);
+    }
+
+    @Override
+    public boolean updateOnProject(Long id, String nickname, String phoneNumber, String email, String password) {
+        return baseMapper.update(
+            Wrappers.lambdaUpdate(SysUser.class)
+                .eq(SysUser::getUserId, id)
+                .set(StringUtils.isNotBlank(nickname), SysUser::getNickName, nickname)
+                .set(StringUtils.isNotBlank(phoneNumber), SysUser::getPhonenumber, phoneNumber)
+                .set(StringUtils.isNotBlank(phoneNumber), SysUser::getUserName, phoneNumber)
+                .set(StringUtils.isNotBlank(email), SysUser::getEmail, email)
+                .set(StringUtils.isNotBlank(password), SysUser::getPassword, BCrypt.hashpw(password))
+        ) > 0;
+    }
+
     /**
      * 通过用户ID查询用户账户
      *

+ 16 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/constant/QcTaskDetailStatusConst.java

@@ -0,0 +1,16 @@
+package com.yingpaipay.business.constant;
+
+public interface QcTaskDetailStatusConst {
+
+    Integer UN_AUDIT = 0;
+
+    Integer PASS = 1;
+
+    Integer REJECT = 2;
+
+    /**
+     * 为了查询时不过多去联表导致查询变慢.因此设置驳回以后的待审核
+     */
+    Integer TO_AUDIT = 3;
+
+}

+ 4 - 2
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/constant/QcTaskStatusConst.java

@@ -2,8 +2,10 @@ package com.yingpaipay.business.constant;
 
 public interface QcTaskStatusConst {
 
-    Integer UNFINISHED = 0;
+    Integer NOT_STARTED = 0;
 
-    Integer COMPLETE = 1;
+    Integer UNDERWAY = 1;
+
+    Integer FINISHED = 2;
 
 }

+ 8 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/DocumentQcTaskController.java

@@ -107,4 +107,12 @@ public class DocumentQcTaskController extends BaseController {
                           @PathVariable Long[] ids) {
         return toAjax(documentQcTaskDetailService.deleteWithValidByIds(List.of(ids), true));
     }
+
+    @SaCheckPermission("qc:task:start")
+    @Log(title = "文档指控任务", businessType = BusinessType.UPDATE)
+    @PutMapping("/{id}")
+    public R<Void> start(@PathVariable Long id) {
+        return toAjax(documentQcTaskDetailService.start(id));
+    }
+
 }

+ 11 - 3
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/DocumentQcTaskDetailController.java

@@ -1,9 +1,14 @@
 package com.yingpaipay.business.controller;
 
 
+import com.yingpaipay.business.domain.bo.DocumentQcTaskDetailListBo;
 import com.yingpaipay.business.domain.vo.DocumentQcGenerateVo;
+import com.yingpaipay.business.domain.vo.DocumentQcTaskDetailListVo;
+import com.yingpaipay.business.domain.vo.DocumentQcTaskDetailVo;
 import lombok.RequiredArgsConstructor;
 import org.dromara.common.core.domain.R;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.validation.annotation.Validated;
 import org.dromara.common.web.core.BaseController;
@@ -25,12 +30,15 @@ public class DocumentQcTaskDetailController extends BaseController {
 
     private final IDocumentQcTaskDetailService documentQcTaskDetailService;
 
-    /**
-     * 已废弃
-     */
+    @Deprecated
     @GetMapping("/generate")
     public R<List<DocumentQcGenerateVo>> generate(@RequestParam Long projectId) {
         return R.ok(documentQcTaskDetailService.generate(projectId));
     }
 
+    @GetMapping("/listPage")
+    public TableDataInfo<DocumentQcTaskDetailListVo> listPage(DocumentQcTaskDetailListBo bo, PageQuery pageQuery) {
+        return documentQcTaskDetailService.listPage(bo, pageQuery);
+    }
+
 }

+ 9 - 1
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/ProjectController.java

@@ -9,6 +9,8 @@ import lombok.RequiredArgsConstructor;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.constraints.*;
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.dromara.system.domain.vo.SysUserVo;
+import org.dromara.system.service.ISysUserService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.validation.annotation.Validated;
 import org.dromara.common.idempotent.annotation.RepeatSubmit;
@@ -37,6 +39,7 @@ public class ProjectController extends BaseController {
 
     private final IProjectService projectService;
     private final IFolderService folderService;
+    private final ISysUserService userService;
 
     /**
      * 查询项目管理列表
@@ -169,7 +172,12 @@ public class ProjectController extends BaseController {
     @SaCheckPermission("project:management:queryProjectMemberEditMember")
     @PutMapping("/queryProjectMemberEditMember")
     public R<Void> queryProjectMemberEditMember(@RequestBody ProjectMemberEditMemberBo bo) {
-        return R.ok();
+        return toAjax(userService.updateOnProject(bo.getId(), bo.getNickname(), bo.getPhoneNumber(), bo.getEmail(), bo.getPassword()));
+    }
+
+    @GetMapping("/queryUser")
+    public R<SysUserVo> queryUser(@RequestParam("id") Long id) {
+        return R.ok(userService.getById(id));
     }
 
 }

+ 1 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/controller/WpsController.java

@@ -37,6 +37,7 @@ import java.util.concurrent.ConcurrentHashMap;
  * @Description: 由于 WPS 服务对于版本管理非常的麻烦,版本回退一直没有很好的解决方案,因此直接由我们自己负责管理版本。
  */
 
+@Deprecated
 @RestController
 @RequestMapping("/wps/callback/v3/3rd")
 @RequiredArgsConstructor

+ 5 - 1
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/Document.java

@@ -77,7 +77,7 @@ public class Document extends TenantEntity {
 
     private Integer type;
 
-    private Long submitterId;
+    private Long submitter;
 
     private Date submitTime;
 
@@ -89,4 +89,8 @@ public class Document extends TenantEntity {
 
     private Boolean sendStatus;
 
+    private Long planSubmitter;
+
+    private Date passTime;
+
 }

+ 1 - 1
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/DocumentAuditLog.java

@@ -26,7 +26,7 @@ public class DocumentAuditLog extends TenantEntity {
 
     private String auditorType;
 
-    private Long auditorId;
+    private Long auditor;
 
     private Integer result;
 

+ 0 - 5
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/DocumentQcTask.java

@@ -43,11 +43,6 @@ public class DocumentQcTask extends TenantEntity {
      */
     private Long projectId;
 
-    /**
-     * 开始时间
-     */
-    private Date startDate;
-
     /**
      * 截止时间
      */

+ 4 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/DocumentQcTaskDetail.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.io.Serial;
+import java.util.Date;
 
 /**
  * 文档质控细节对象 document_quality_control_task_detail
@@ -63,5 +64,8 @@ public class DocumentQcTaskDetail extends TenantEntity {
      */
     private Long projectId;
 
+    private Date executionTime;
+
+    private Date finishTime;
 
 }

+ 3 - 1
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/DocumentBo.java

@@ -49,10 +49,12 @@ public class DocumentBo extends BaseEntity {
      */
     private Integer type;
 
+    private Long planSubmitter;
+
     /**
      * 递交人
      */
-    private Long submitterId;
+    private Long submitter;
 
     /**
      * 递交截止日期

+ 4 - 8
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/DocumentQcTaskBo.java

@@ -46,12 +46,6 @@ public class DocumentQcTaskBo extends BaseEntity {
     @NotNull(message = "质控项目不能为空", groups = { AddGroup.class, EditGroup.class })
     private Long projectId;
 
-    /**
-     * 开始时间
-     */
-    @NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
-    private Date startDate;
-
     /**
      * 截止时间
      */
@@ -69,7 +63,9 @@ public class DocumentQcTaskBo extends BaseEntity {
      */
     private String note;
 
-    @NotEmpty(message = "指控任务不能为空")
-    private List<DocumentQcTaskDetailBo> details;
+    /**
+     * 质控占比
+     */
+    private Integer proportion;
 
 }

+ 16 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/DocumentQcTaskDetailListBo.java

@@ -0,0 +1,16 @@
+package com.yingpaipay.business.domain.bo;
+
+import lombok.Data;
+
+@Data
+public class DocumentQcTaskDetailListBo {
+
+    private Long taskId;
+
+    private Long projectId;
+
+    private String documentName;
+
+    private Integer status;
+
+}

+ 2 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/bo/ProjectMemberEditMemberBo.java

@@ -13,4 +13,6 @@ public class ProjectMemberEditMemberBo {
 
     private String email;
 
+    private String password;
+
 }

+ 2 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/dto/WpsR.java

@@ -1,10 +1,12 @@
 package com.yingpaipay.business.domain.dto;
 
+import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 @Data
 @NoArgsConstructor
+@AllArgsConstructor
 public class WpsR<E> {
 
     private Integer code;

+ 3 - 3
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/AppletMyTaskDocumentVo.java

@@ -28,9 +28,9 @@ public class AppletMyTaskDocumentVo implements Serializable {
     private String createByName;
     private Long createBy;
 
-    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitterId")
-    private String submitter;
-    private Long submitterId;
+    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitter")
+    private String submitterName;
+    private Long submitter;
 
     private Integer status;
 

+ 2 - 2
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentAuditLogVo.java

@@ -38,9 +38,9 @@ public class DocumentAuditLogVo implements Serializable {
     private String auditorType;
 
     @ExcelProperty(value = "审核人")
-    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "auditorId")
+    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "auditor")
     private String auditorName;
-    private Long auditorId;
+    private Long auditor;
 
     @ExcelProperty(value = "审核结果")
     private String resultLabel;

+ 38 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentQcTaskDetailListVo.java

@@ -0,0 +1,38 @@
+package com.yingpaipay.business.domain.vo;
+
+import lombok.Data;
+import org.dromara.common.translation.annotation.Translation;
+import org.dromara.common.translation.constant.TransConstant;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class DocumentQcTaskDetailListVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    private Long document;
+
+    private String documentName;
+
+    private Long ossId;
+
+    private Long executor;
+
+    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "executor")
+    private String executorName;
+
+    private Integer status;
+
+    private String note;
+
+    private Date executionTime;
+
+    private Date finishTime;
+
+}

+ 1 - 7
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentQcTaskVo.java

@@ -55,12 +55,6 @@ public class DocumentQcTaskVo implements Serializable {
     private String projectName;
     private Long projectId;
 
-    /**
-     * 开始时间
-     */
-    @ExcelProperty(value = "开始时间")
-    private Date startDate;
-
     /**
      * 截止时间
      */
@@ -105,6 +99,6 @@ public class DocumentQcTaskVo implements Serializable {
     @ExcelProperty(value = "更新时间")
     private Date updateTime;
 
-    private List<DocumentQcTaskDetailVo> details;
+    private Long schedule;
 
 }

+ 8 - 5
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/DocumentVo.java

@@ -81,7 +81,6 @@ public class DocumentVo implements Serializable {
      * 文档本体
      */
     @ExcelProperty(value = "实际文档")
-    private String url;
     private String fileName;
     private Long ossId;
 
@@ -107,10 +106,10 @@ public class DocumentVo implements Serializable {
     @ExcelProperty(value = "更新时间")
     private Date updateTime;
 
-    @ExcelProperty(value = "计划递交人")
-    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitterId")
-    private String submitter;
-    private Long submitterId;
+    @ExcelProperty(value = "递交人")
+//    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitter")
+    private String submitterName;
+    private Long submitter;
 
     private Integer type;
 
@@ -120,4 +119,8 @@ public class DocumentVo implements Serializable {
 
     private Boolean sendStatus;
 
+    @ExcelProperty(value = "计划递交人")
+//    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "planSubmitter")
+    private String planSubmitterName;
+    private Long planSubmitter;
 }

+ 2 - 3
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/TaskCenterAuditListVo.java

@@ -20,9 +20,8 @@ public class TaskCenterAuditListVo implements Serializable {
 
     private Integer status;
 
-    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitterId")
-    private String submitter;
-    private Long submitterId;
+    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitter")
+    private Long submitter;
 
     private Date deadline;
 

+ 4 - 5
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/TaskCenterFilingListVo.java

@@ -20,11 +20,8 @@ public class TaskCenterFilingListVo implements Serializable {
 
     private Integer status;
 
-    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitterId")
-    private String submitter;
-    private Long submitterId;
-
-    private Date deadline;
+    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitter")
+    private Long submitter;
 
     private Date submitTime;
 
@@ -46,4 +43,6 @@ public class TaskCenterFilingListVo implements Serializable {
     private Long folderId;
     private String folderName;
 
+    private Date passTime;
+
 }

+ 3 - 4
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/domain/vo/TaskCenterSubmissionListVo.java

@@ -24,10 +24,6 @@ public class TaskCenterSubmissionListVo implements Serializable {
 
     private String documentType;
 
-    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitterId")
-    private String submitter;
-    private Long submitterId;
-
     private Date deadline;
 
     private Date submitTime;
@@ -41,4 +37,7 @@ public class TaskCenterSubmissionListVo implements Serializable {
 
     private Boolean sendStatus;
 
+    @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "planSubmitter")
+    private Long planSubmitter;
+
 }

+ 6 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/IDocumentQcTaskDetailService.java

@@ -1,6 +1,10 @@
 package com.yingpaipay.business.service;
 
+import com.yingpaipay.business.domain.bo.DocumentQcTaskDetailListBo;
 import com.yingpaipay.business.domain.vo.DocumentQcGenerateVo;
+import com.yingpaipay.business.domain.vo.DocumentQcTaskDetailListVo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
 
 import java.util.List;
 
@@ -13,4 +17,6 @@ import java.util.List;
 public interface IDocumentQcTaskDetailService {
 
     List<DocumentQcGenerateVo> generate(Long projectId);
+
+    TableDataInfo<DocumentQcTaskDetailListVo> listPage(DocumentQcTaskDetailListBo bo, PageQuery pageQuery);
 }

+ 2 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/IDocumentQcTaskService.java

@@ -65,4 +65,6 @@ public interface IDocumentQcTaskService {
      * @return 是否删除成功
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    boolean start(Long id);
 }

+ 17 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/CommonDocumentService.java

@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.yingpaipay.business.constant.DocumentStatusConst;
 import com.yingpaipay.business.domain.Document;
 import com.yingpaipay.business.mapper.DocumentMapper;
+import jakarta.validation.constraints.NotNull;
 import lombok.RequiredArgsConstructor;
+import org.dromara.common.core.utils.StringUtils;
 import org.springframework.stereotype.Service;
 
 import java.util.Collections;
@@ -58,4 +60,19 @@ public class CommonDocumentService {
                 .in(Document::getId, ids)
         );
     }
+
+    public List<Document> selectByProjectId(Long projectId) {
+        return baseMapper.selectList(
+            Wrappers.lambdaQuery(Document.class)
+                .eq(Document::getProjectId, projectId)
+        );
+    }
+
+    public List<Document> getByName(Long projectId, String name) {
+        return baseMapper.selectList(
+            Wrappers.lambdaQuery(Document.class)
+                .eq(Document::getProjectId, projectId)
+                .like(StringUtils.isNotBlank(name), Document::getName, name)
+        );
+    }
 }

+ 43 - 0
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentQcTaskDetailServiceImpl.java

@@ -1,12 +1,21 @@
 package com.yingpaipay.business.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.yingpaipay.business.domain.Document;
 import com.yingpaipay.business.domain.DocumentQcTaskDetail;
+import com.yingpaipay.business.domain.bo.DocumentQcTaskDetailListBo;
 import com.yingpaipay.business.domain.vo.DocumentQcGenerateVo;
+import com.yingpaipay.business.domain.vo.DocumentQcTaskDetailListVo;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.dromara.common.core.exception.BusinessException;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.system.domain.vo.SysUserVo;
 import org.dromara.system.service.ISysUserService;
 import org.springframework.stereotype.Service;
@@ -85,4 +94,38 @@ public class DocumentQcTaskDetailServiceImpl implements IDocumentQcTaskDetailSer
         return result;
 
     }
+
+    @Override
+    public TableDataInfo<DocumentQcTaskDetailListVo> listPage(DocumentQcTaskDetailListBo bo, PageQuery pageQuery) {
+        List<Long> documentIds = new ArrayList<>();
+        Map<Long, Document> documentMap = new HashMap<>();
+        documentService.getByName(bo.getProjectId(), bo.getDocumentName()).forEach(e -> {
+            documentIds.add(e.getId());
+            documentMap.put(e.getId(), e);
+        });
+        IPage<DocumentQcTaskDetail> page = baseMapper.selectPage(pageQuery.build(), buildListPageWrapper(bo, documentIds));
+        return TableDataInfo.build(page.convert(e -> {
+            DocumentQcTaskDetailListVo vo = new DocumentQcTaskDetailListVo();
+            vo.setId(e.getId());
+            Document document = documentMap.get(e.getDocumentId());
+
+            vo.setDocument(document.getId());
+            vo.setDocumentName(document.getName());
+            vo.setOssId(document.getOssId());
+            vo.setExecutor(e.getExecutor());
+            vo.setStatus(e.getStatus());
+            vo.setNote(e.getNote());
+            vo.setExecutionTime(e.getExecutionTime());
+            vo.setFinishTime(e.getFinishTime());
+            return vo;
+        }));
+    }
+
+    private LambdaQueryWrapper<DocumentQcTaskDetail> buildListPageWrapper(DocumentQcTaskDetailListBo bo, List<Long> documentIds) {
+
+        return Wrappers.lambdaQuery(DocumentQcTaskDetail.class)
+            .eq(DocumentQcTaskDetail::getTaskId, bo.getTaskId())
+            .in(StringUtils.isNotBlank(bo.getDocumentName()), DocumentQcTaskDetail::getDocumentId, documentIds.isEmpty() ? List.of(-1L) : documentIds)
+            .orderByDesc(DocumentQcTaskDetail::getId);
+    }
 }

+ 116 - 36
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentQcTaskServiceImpl.java

@@ -1,5 +1,9 @@
 package com.yingpaipay.business.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
+import com.yingpaipay.business.constant.DocumentStatusConst;
+import com.yingpaipay.business.constant.QcTaskDetailStatusConst;
+import com.yingpaipay.business.constant.QcTaskStatusConst;
 import com.yingpaipay.business.domain.Document;
 import com.yingpaipay.business.domain.DocumentQcTask;
 import com.yingpaipay.business.domain.DocumentQcTaskDetail;
@@ -10,6 +14,7 @@ import com.yingpaipay.business.domain.vo.DocumentQcTaskVo;
 import com.yingpaipay.business.mapper.DocumentQcTaskDetailMapper;
 import org.dromara.common.core.exception.BusinessException;
 import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.SpringUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.PageQuery;
@@ -18,14 +23,21 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.dromara.common.satoken.utils.LoginHelper;
+import org.dromara.common.tenant.helper.TenantHelper;
 import org.dromara.system.domain.vo.SysUserVo;
 import org.dromara.system.service.ISysUserService;
 import org.springframework.stereotype.Service;
 import com.yingpaipay.business.mapper.DocumentQcTaskMapper;
 import com.yingpaipay.business.service.IDocumentQcTaskService;
+import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.support.TransactionTemplate;
 
 import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * 文档质控任务Service业务层处理
@@ -45,6 +57,8 @@ public class DocumentQcTaskServiceImpl implements IDocumentQcTaskService {
     private final CommonDocumentService documentService;
     private final ISysUserService userService;
 
+    private static final Map<Long, Object> TASK_LOCK = new ConcurrentHashMap<>();
+
     /**
      * 查询文档质控任务
      *
@@ -52,29 +66,15 @@ public class DocumentQcTaskServiceImpl implements IDocumentQcTaskService {
      * @return 文档质控任务
      */
     @Override
-    public DocumentQcTaskVo queryById(Long id){
+    public DocumentQcTaskVo queryById(Long id) {
         DocumentQcTaskVo vo = baseMapper.selectVoById(id);
-        List<DocumentQcTaskDetailVo> voList = detailMapper.selectVoList(
+        vo.setProjectName(projectService.queryById(vo.getProjectId()).getName());
+        List<DocumentQcTaskDetail> details = detailMapper.selectList(
             Wrappers.lambdaQuery(DocumentQcTaskDetail.class)
                 .eq(DocumentQcTaskDetail::getTaskId, vo.getId())
         );
-        List<Long> documentIds = new ArrayList<>();
-        List<Long> userIds = new ArrayList<>();
-        Map<Long, String> documentMap = new HashMap<>();
-        Map<Long, SysUserVo> userMap = new HashMap<>();
-        voList.forEach(e -> {
-            documentIds.add(e.getDocumentId());
-            userIds.add(e.getExecutor());
-        });
-        documentService.getByIds(documentIds).forEach(e -> documentMap.put(e.getId(), e.getName()));
-        userService.selectUserByIds(userIds).forEach(e -> userMap.put(e.getUserId(), e));
-        voList.forEach(e -> {
-            e.setDocumentName(documentMap.get(e.getDocumentId()));
-            SysUserVo executor = userMap.get(e.getExecutor());
-            e.setExecutorName(executor.getNickName());
-            e.setExecutorStatus(e.getStatus());
-        });
-        vo.setDetails(voList);
+        long count = details.stream().filter(e -> !Objects.equals(e.getStatus(), QcTaskDetailStatusConst.UN_AUDIT)).count();
+        vo.setSchedule(count / details.size());
         return vo;
     }
 
@@ -94,11 +94,32 @@ public class DocumentQcTaskServiceImpl implements IDocumentQcTaskService {
     }
 
     private void buildVo(List<DocumentQcTaskVo> result) {
+        if (result.isEmpty()) {
+            return;
+        }
         List<Long> projectIds = new ArrayList<>();
         result.forEach(e -> projectIds.add(e.getProjectId()));
+
+        Map<Long, List<DocumentQcTaskDetail>> detailMap = detailMapper.selectList(
+            Wrappers.lambdaQuery(DocumentQcTaskDetail.class)
+                .in(DocumentQcTaskDetail::getProjectId, projectIds)
+        ).stream().collect(Collectors.groupingBy(DocumentQcTaskDetail::getProjectId));
+
         Map<Long, String> projectMap = new HashMap<>();
+        Map<Long, Long> scheduleMap = new HashMap<>();
         projectService.queryByIds(projectIds).forEach(e -> projectMap.put(e.getId(), e.getName()));
-        result.forEach(e -> e.setProjectName(projectMap.get(e.getProjectId())));
+
+        detailMap.forEach((projectId, list) -> {
+            List<DocumentQcTaskDetail> details = detailMap.get(projectId);
+            long count = details.stream().filter(e -> !Objects.equals(e.getStatus(), QcTaskDetailStatusConst.UN_AUDIT)).count();
+            scheduleMap.put(projectId, count / details.size());
+        });
+
+        result.forEach(e -> {
+            e.setProjectName(projectMap.get(e.getProjectId()));
+            e.setSchedule(scheduleMap.get(e.getProjectId()));
+        });
+
     }
 
     /**
@@ -122,8 +143,6 @@ public class DocumentQcTaskServiceImpl implements IDocumentQcTaskService {
         lqw.like(StringUtils.isNotBlank(bo.getName()), DocumentQcTask::getName, bo.getName());
         lqw.eq(bo.getInitiator() != null, DocumentQcTask::getInitiator, bo.getInitiator());
         lqw.eq(bo.getProjectId() != null, DocumentQcTask::getProjectId, bo.getProjectId());
-        lqw.between(params.get("beginStartDate") != null && params.get("endStartDate") != null,
-            DocumentQcTask::getStartDate ,params.get("beginStartDate"), params.get("endStartDate"));
         lqw.between(params.get("beginDeadline") != null && params.get("endDeadline") != null,
             DocumentQcTask::getDeadline ,params.get("beginDeadline"), params.get("endDeadline"));
         lqw.eq(bo.getStatus() != null, DocumentQcTask::getStatus, bo.getStatus());
@@ -145,23 +164,61 @@ public class DocumentQcTaskServiceImpl implements IDocumentQcTaskService {
     @Transactional(rollbackFor = Exception.class)
     @Override
     public Boolean insertByBo(DocumentQcTaskBo bo) {
+
         DocumentQcTask add = MapstructUtils.convert(bo, DocumentQcTask.class);
         validEntityBeforeSave(add);
-        boolean flag = baseMapper.insert(add) == 0;
-        if (flag) {
-            throw new BusinessException("新增指控任务失败");
+
+        boolean tastFlag = baseMapper.insert(add) == 0;
+        if (tastFlag) {
+            throw new RuntimeException("任务新增失败");
         }
 
-        // FIXME 这里存在着问题 : 并发场景下生成了同一个文档的不同指控任务,暂不考虑
-        List<DocumentQcTaskDetailBo> details = bo.getDetails();
-        List<DocumentQcTaskDetail> list = new ArrayList<>();
-        details.forEach(e -> {
-            e.setTaskId(add.getId());
-            list.add(MapstructUtils.convert(e, DocumentQcTaskDetail.class));
-        });
-        boolean detailFlag = detailMapper.insertBatch(list);
-        if (!detailFlag) {
-            throw new BusinessException("指控细节插入失败");
+        /**
+         * TODO 避免同一个文件反复参与质控
+         * FIXME 需要思考一个更好的方案,尽可能避免所有操作全部串行化
+         */
+        Object lock = TASK_LOCK.computeIfAbsent(bo.getProjectId(), projectId -> new Object());
+
+        List<Document> selectedDocuments;
+
+        synchronized (lock) {
+            List<Long> historyIds = new ArrayList<>();
+            detailMapper.selectList(
+                Wrappers.lambdaQuery(DocumentQcTaskDetail.class)
+                    .eq(DocumentQcTaskDetail::getProjectId, bo.getProjectId())
+            ).forEach(e -> historyIds.add(e.getDocumentId()));
+
+            List<Document> documents = documentService.selectByProjectId(bo.getProjectId());
+            selectedDocuments = documents.stream()
+                .filter(e -> e.getStatus().equals(DocumentStatusConst.FILING))
+                .filter(e -> !historyIds.contains(e.getId()))
+                .collect(Collectors.toList());
+            if (selectedDocuments.isEmpty()) {
+                throw new BusinessException("无任务进行");
+            }
+            Collections.shuffle(selectedDocuments, new Random((long) documents.size() * bo.getProportion() / 100));
+
+            List<DocumentQcTaskDetail> details = new ArrayList<>();
+            selectedDocuments.forEach(e -> {
+                DocumentQcTaskDetail detail = new DocumentQcTaskDetail();
+                detail.setTaskId(add.getId());
+                detail.setDocumentId(e.getId());
+                detail.setExecutor(LoginHelper.getUserId());
+                detail.setProjectId(bo.getProjectId());
+                detail.setTenantId(TenantHelper.getTenantId());
+                detail.setCreateDept(LoginHelper.getDeptId());
+                detail.setCreateBy(LoginHelper.getUserId());
+                detail.setCreateTime(new Date());
+                detail.setUpdateBy(LoginHelper.getUserId());
+                detail.setUpdateTime(new Date());
+                details.add(detail);
+            });
+
+            boolean flag = detailMapper.insertBatch(details);
+            if (!flag) {
+                throw new RuntimeException("批量插入失败");
+            }
+
         }
 
         return true;
@@ -194,11 +251,34 @@ public class DocumentQcTaskServiceImpl implements IDocumentQcTaskService {
      * @param isValid 是否进行有效性校验
      * @return 是否删除成功
      */
+    @Transactional(rollbackFor = Exception.class)
     @Override
     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
         if(isValid){
             //TODO 做一些业务上的校验,判断是否需要校验
         }
-        return baseMapper.deleteByIds(ids) > 0;
+        boolean taskFlag = baseMapper.deleteByIds(ids) == 0;
+        if (taskFlag) {
+            throw new RuntimeException("删除主任务失败");
+        }
+
+        boolean detailFlag = detailMapper.delete(
+            Wrappers.lambdaQuery(DocumentQcTaskDetail.class)
+                .in(DocumentQcTaskDetail::getTaskId, ids)
+        ) == 0;
+        if (detailFlag) {
+            throw new RuntimeException("删除细节失败");
+        }
+
+        return true;
+    }
+
+    @Override
+    public boolean start(Long id) {
+        return baseMapper.update(
+            Wrappers.lambdaUpdate(DocumentQcTask.class)
+                .eq(DocumentQcTask::getId, id)
+                .set(DocumentQcTask::getStatus, QcTaskStatusConst.UNDERWAY)
+        ) > 0;
     }
 }

+ 26 - 18
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/DocumentServiceImpl.java

@@ -103,6 +103,7 @@ public class DocumentServiceImpl implements IDocumentService {
         Map<String, String> planDocumentTypeMap = new HashMap<>();
         Map<String, String> centerFileSpecificationMap = new HashMap<>();
         Map<String, String> projectFileSpecificationMap = new HashMap<>();
+        Map<Long, String> userMap = new HashMap<>();
         dictTypeService.selectDictDataByType(DictTypeConst.PLAN_DOCUMENT_TYPE)
             .forEach(e -> planDocumentTypeMap.put(e.getDictValue(), e.getDictLabel()));
         dictTypeService.selectDictDataByType(DictTypeConst.CENTER_FILE_SPECIFICATION)
@@ -112,16 +113,19 @@ public class DocumentServiceImpl implements IDocumentService {
         documents.forEach(e -> {
             ossIds.add(e.getOssId());
             folderIds.add(e.getFolderId());
-            userIds.add(e.getSubmitterId());
+            userIds.add(e.getSubmitter());
+            userIds.add(e.getPlanSubmitter());
         });
         folderService.queryListByIds(folderIds).forEach(e -> folderMap.put(e.getId(), e.getName()));
         ossService.queryListByIds(ossIds).forEach(e -> ossMap.put(e.getOssId(), e));
+        userService.selectUserByIds(userIds).forEach(e -> userMap.put(e.getUserId(), e.getNickName()));
         documents.forEach(e -> {
             SysOssVo ossVo = ossMap.get(e.getOssId());
             if (ossVo != null) {
-                e.setUrl(ossVo.getUrl());
                 e.setFileName(ossVo.getOriginalName());
             }
+            e.setSubmitterName(userMap.get(e.getSubmitter()));
+            e.setPlanSubmitterName(userMap.get(e.getPlanSubmitter()));
             e.setFolderName(folderMap.get(e.getFolderId()));
         });
     }
@@ -228,7 +232,7 @@ public class DocumentServiceImpl implements IDocumentService {
                 .eq(Document::getId, bo.getDocumentId())
                 .set(Document::getOssId, bo.getOssId())
                 .set(Document::getSubmitTime, new Date())
-                .set(Document::getSubmitterId, LoginHelper.getUserId())
+                .set(Document::getSubmitter, LoginHelper.getUserId())
                 .set(Document::getStatus, DocumentStatusConst.UN_AUDIT)
         ) > 0;
     }
@@ -241,6 +245,10 @@ public class DocumentServiceImpl implements IDocumentService {
         if (document == null) {
             throw new BusinessException(MessageUtils.message("document.document.audit.documentnotfound"));
         }
+
+        if (Objects.equals(bo.getResult(), DocumentStatusConst.UN_FILING)) {
+            document.setPassTime(new Date());
+        }
         document.setStatus(bo.getResult());
         boolean documentFlag = baseMapper.updateById(document) == 0;
         if (documentFlag) {
@@ -324,12 +332,12 @@ public class DocumentServiceImpl implements IDocumentService {
             vo.setStatus(e.getStatus());
             vo.setType(e.getType());
             vo.setDocumentType(e.getPlanType());
-            vo.setSubmitterId(e.getSubmitterId());
             vo.setDeadline(e.getSubmitDeadline());
             vo.setSubmitTime(e.getSubmitTime());
             vo.setCreateTime(e.getCreateTime());
             vo.setSendFlag(e.getSendFlag());
             vo.setSendStatus(e.getSendStatus());
+            vo.setPlanSubmitter(e.getPlanSubmitter());
             return vo;
         }));
     }
@@ -353,7 +361,7 @@ public class DocumentServiceImpl implements IDocumentService {
             vo.setName(e.getName());
             vo.setStatus(e.getStatus());
             vo.setDeadline(e.getSubmitDeadline());
-            vo.setSubmitterId(e.getSubmitterId());
+            vo.setSubmitter(e.getSubmitter());
             vo.setSubmitTime(e.getSubmitTime());
             vo.setCreateTime(e.getCreateTime());
             vo.setOssId(e.getOssId());
@@ -466,8 +474,7 @@ public class DocumentServiceImpl implements IDocumentService {
             vo.setId(e.getId());
             vo.setName(e.getName());
             vo.setStatus(e.getStatus());
-            vo.setDeadline(e.getSubmitDeadline());
-            vo.setSubmitterId(e.getSubmitterId());
+            vo.setSubmitter(e.getSubmitter());
             vo.setSubmitTime(e.getSubmitTime());
             vo.setCreateTime(e.getCreateTime());
             vo.setOssId(e.getOssId());
@@ -477,6 +484,7 @@ public class DocumentServiceImpl implements IDocumentService {
             vo.setProjectId(e.getProjectId());
             vo.setFolderId(e.getFolderId());
             vo.setFolderName(folderMap.get(e.getFolderId()));
+            vo.setPassTime(e.getPassTime());
             return vo;
         }));
     }
@@ -486,7 +494,7 @@ public class DocumentServiceImpl implements IDocumentService {
         AppletMineCountVo vo = new AppletMineCountVo();
         List<Document> documentList = baseMapper.selectList(
             Wrappers.lambdaQuery(Document.class)
-                .eq(Document::getSubmitterId, LoginHelper.getUserId())
+                .eq(Document::getSubmitter, LoginHelper.getUserId())
                 .in(Document::getStatus, List.of(DocumentStatusConst.UN_UPLOAD, DocumentStatusConst.UN_AUDIT, DocumentStatusConst.AUDIT_REJECT))
         );
         vo.setToSubmit(
@@ -512,7 +520,7 @@ public class DocumentServiceImpl implements IDocumentService {
             pageQuery.build(),
             Wrappers.lambdaQuery(Document.class)
                 .like(StringUtils.isNotBlank(bo.getName()), Document::getName, bo.getName())
-                .eq(Document::getSubmitterId, LoginHelper.getUserId())
+                .eq(Document::getSubmitter, LoginHelper.getUserId())
                 .ne(Document::getStatus, DocumentStatusConst.UN_UPLOAD)
                 .orderByDesc(Document::getId)
         );
@@ -531,7 +539,7 @@ public class DocumentServiceImpl implements IDocumentService {
         IPage<Document> page = baseMapper.selectPage(
             pageQuery.build(),
             Wrappers.lambdaQuery(Document.class)
-                .eq(Document::getSubmitterId, LoginHelper.getUserId())
+                .eq(Document::getSubmitter, LoginHelper.getUserId())
                 .eq(bo.getStatus() != null, Document::getStatus, bo.getStatus())
                 .like(StringUtils.isNotBlank(bo.getName()), Document::getName, bo.getName())
                 .orderByDesc(Document::getId)
@@ -543,7 +551,7 @@ public class DocumentServiceImpl implements IDocumentService {
             vo.setCreateTime(e.getCreateTime());
             vo.setOssId(e.getOssId());
             vo.setCreateBy(e.getCreateBy());
-            vo.setSubmitterId(e.getSubmitterId());
+            vo.setSubmitter(e.getSubmitter());
             vo.setStatus(e.getStatus());
             return vo;
         }));
@@ -554,7 +562,7 @@ public class DocumentServiceImpl implements IDocumentService {
         IPage<Document> page = baseMapper.selectPage(
             pageQuery.build(),
             Wrappers.lambdaQuery(Document.class)
-                .eq(Document::getSubmitterId, LoginHelper.getUserId())
+                .eq(Document::getSubmitter, LoginHelper.getUserId())
                 .in(Document::getStatus, List.of(DocumentStatusConst.UN_UPLOAD, DocumentStatusConst.AUDIT_REJECT))
                 .like(StringUtils.isNotBlank(bo.getName()), Document::getName, bo.getName())
                 .orderByDesc(Document::getId)
@@ -677,7 +685,7 @@ public class DocumentServiceImpl implements IDocumentService {
         document.setOssId(ossVo.getOssId());
         document.setNote(bo.getNote());
         document.setType(DocumentTypeConst.NOT_PLAN);
-        document.setSubmitterId(LoginHelper.getUserId());
+        document.setSubmitter(LoginHelper.getUserId());
         document.setSubmitTime(new Date());
         document.setProjectId(bo.getProjectId());
         document.setSendFlag(false);
@@ -709,7 +717,7 @@ public class DocumentServiceImpl implements IDocumentService {
             .like(StringUtils.isNotBlank(bo.getName()), Document::getName, bo.getName())
             .eq(Document::getCreateBy, LoginHelper.getUserId())
             .in(!folderIds.isEmpty(), Document::getFolderId, folderIds)
-            .in(Document::getStatus, List.of(DocumentStatusConst.UN_FILING, DocumentStatusConst.FILING))
+            .eq(Document::getStatus, DocumentStatusConst.UN_FILING)
             .orderByDesc(Document::getId);
     }
 
@@ -729,9 +737,9 @@ public class DocumentServiceImpl implements IDocumentService {
     private LambdaQueryWrapper<Document> buildAuditListWrapper(TaskCenterAuditListBo bo, List<Long> folderIds) {
         return Wrappers.lambdaQuery(Document.class)
             .like(StringUtils.isNotBlank(bo.getName()), Document::getName, bo.getName())
-            .eq(Document::getSubmitterId, LoginHelper.getUserId())
+            .eq(Document::getSubmitter, LoginHelper.getUserId())
             .in(!folderIds.isEmpty(), Document::getFolderId, folderIds)
-            .in(Document::getStatus, List.of(DocumentStatusConst.UN_AUDIT, DocumentStatusConst.UN_FILING))
+            .eq(Document::getStatus, DocumentStatusConst.UN_AUDIT)
             .orderByDesc(Document::getId);
     }
 
@@ -739,7 +747,7 @@ public class DocumentServiceImpl implements IDocumentService {
         return Wrappers.lambdaQuery(Document.class)
             .like(StringUtils.isNotBlank(bo.getName()), Document::getName, bo.getName())
             .eq(bo.getStatus() != null, Document::getStatus, bo.getStatus())
-            .eq(Document::getSubmitterId, LoginHelper.getUserId())
+            .eq(Document::getPlanSubmitter, LoginHelper.getUserId())
             .in(!folderIds.isEmpty(), Document::getFolderId, folderIds)
             .in(Document::getStatus, List.of(DocumentStatusConst.UN_UPLOAD, DocumentStatusConst.AUDIT_REJECT))
             .orderByDesc(Document::getId);
@@ -750,7 +758,7 @@ public class DocumentServiceImpl implements IDocumentService {
         log.setDocumentId(document.getId());
         log.setOssId(document.getOssId());
         log.setAuditorType(type);
-        log.setAuditorId(LoginHelper.getUserId());
+        log.setAuditor(LoginHelper.getUserId());
         log.setResult(bo.getResult());
         log.setRejectReason(bo.getRejectReason());
         log.setAuditTime(new Date());

+ 7 - 5
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/FolderServiceImpl.java

@@ -335,11 +335,13 @@ public class FolderServiceImpl implements IFolderService {
             }
 
             vo.setCenters(String.join(",", new TreeSet<>(centers.stream().map(Folder::getName).collect(Collectors.toSet()))));
-            vo.setId(user.getUserId());
-            vo.setName(user.getNickName());
-            vo.setPhoneNumber(user.getPhonenumber());
-            vo.setDept(deptMap.get(user.getDeptId()));
-            vo.setTime(user.getCreateTime());
+            if (user != null) {
+                vo.setId(user.getUserId());
+                vo.setName(user.getNickName());
+                vo.setPhoneNumber(user.getPhonenumber());
+                vo.setDept(deptMap.get(user.getDeptId()));
+                vo.setTime(user.getCreateTime());
+            }
             return vo;
         }));
     }

+ 19 - 17
ruoyi-modules/yingpaipay-business/src/main/java/com/yingpaipay/business/service/impl/ProjectServiceImpl.java

@@ -360,23 +360,25 @@ public class ProjectServiceImpl implements IProjectService {
             vo.setId(e.getId());
             vo.setCode(e.getCode());
             vo.setName(e.getName());
-            int total = documentList.size();
-            long onTimeSubmit = 0L, lateSubmit = 0L, notSubmit = 0L;
-            List<Document> planDocuments = documentList.stream()
-                .filter(item -> item.getType().equals(DocumentTypeConst.PLAN))
-                .toList();
-            if (total > 0) {
-                onTimeSubmit = planDocuments.stream()
-                    .filter(item -> item.getOssId() != null && item.getSubmitTime().before(item.getSubmitDeadline()))
-                    .count();
-                lateSubmit = planDocuments.stream()
-                    .filter(item -> item.getOssId() != null)
-                    .filter(item -> item.getSubmitDeadline().before(item.getSubmitTime()))
-                    .count();
-                notSubmit = planDocuments.stream()
-                    .filter(item -> item.getOssId() == null)
-                    .filter(item -> item.getSubmitDeadline().before(new Date()))
-                    .count();
+            long total = 0L, onTimeSubmit = 0L, lateSubmit = 0L, notSubmit = 0L;
+            if (documentList != null) {
+                total = documentList.size();
+                List<Document> planDocuments = documentList.stream()
+                    .filter(item -> item.getType().equals(DocumentTypeConst.PLAN))
+                    .toList();
+                if (total > 0) {
+                    onTimeSubmit = planDocuments.stream()
+                        .filter(item -> item.getOssId() != null && item.getSubmitTime().before(item.getSubmitDeadline()))
+                        .count();
+                    lateSubmit = planDocuments.stream()
+                        .filter(item -> item.getOssId() != null)
+                        .filter(item -> item.getSubmitDeadline().before(item.getSubmitTime()))
+                        .count();
+                    notSubmit = planDocuments.stream()
+                        .filter(item -> item.getOssId() == null)
+                        .filter(item -> item.getSubmitDeadline().before(new Date()))
+                        .count();
+                }
             }
 //            long onTimeSubmit = planDocuments.stream()
 //                .filter(item -> item.getOssId() != null && item.getSubmitTime().before(item.getSubmitDeadline()))