Browse Source

Merge remote-tracking branch 'origin/master'

master
21819 2 years ago
parent
commit
dcaa2b88af
  1. 1
      libs/words/installMavenJar.bat
  2. BIN
      libs/words/words-15.8.0.jar
  3. 29
      mailbox-common/pom.xml
  4. 5
      mailbox-common/src/main/java/com/biutag/validator/IDMustValidator.java
  5. 6
      mailbox-common/src/main/java/com/biutag/validator/IdCardValidator.java
  6. 6
      mailbox-common/src/main/java/com/biutag/validator/IntArrayEmptyValidator.java
  7. 4
      mailbox-common/src/main/java/com/biutag/validator/IntegerContainsValidator.java
  8. 12
      mailbox-common/src/main/java/com/biutag/validator/PhoneValidator.java
  9. 4
      mailbox-common/src/main/java/com/biutag/validator/StringContainsValidator.java
  10. 4
      mailbox-common/src/main/java/com/biutag/validator/annotation/IDMust.java
  11. 8
      mailbox-common/src/main/java/com/biutag/validator/annotation/IdCard.java
  12. 4
      mailbox-common/src/main/java/com/biutag/validator/annotation/IntArrayEmpty.java
  13. 4
      mailbox-common/src/main/java/com/biutag/validator/annotation/IntegerContains.java
  14. 5
      mailbox-common/src/main/java/com/biutag/validator/annotation/Phone.java
  15. 4
      mailbox-common/src/main/java/com/biutag/validator/annotation/StringContains.java
  16. 3
      mailbox-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  17. 45
      mailbox-lan/pom.xml
  18. 34
      mailbox-lan/src/main/java/com/biutag/lan/controller/ApiV1Controller.java
  19. 3
      mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java
  20. 13
      mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java
  21. 6
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java
  22. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java
  23. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java
  24. 9
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java
  25. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondReportingFlow.java
  26. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java
  27. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java
  28. 5
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  29. 43
      mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java
  30. 10
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java
  31. 16
      mailbox-lan/src/main/java/com/biutag/lan/validate/system/DutyCreateValidate.java
  32. 18
      mailbox-lan/src/main/java/com/biutag/lan/validate/system/DutyUpdateValidate.java
  33. 32
      mailbox-lan/src/test/java/com/biutag/lan/WordsTests.java
  34. 1
      mailbox-outer-admin/pom.xml
  35. 1
      mailbox-outer/pom.xml
  36. 1
      mailbox-outer/src/main/java/com/biutag/outer/controller/MailController.java
  37. 5
      mailbox-outer/src/main/java/com/biutag/outer/domain/Mail.java
  38. 10
      mailbox-outer/src/main/java/com/biutag/outer/domain/MailDraft.java
  39. 11
      mailbox-outer/src/main/java/com/biutag/outer/domain/bo/MailBo.java
  40. 11
      mailbox-outer/src/main/java/com/biutag/outer/domain/vo/MailDraftVo.java
  41. 17
      mailbox-outer/src/main/java/com/biutag/outer/enums/MailStateEnum.java
  42. 40
      mailbox-outer/src/main/java/com/biutag/outer/job/Job.java
  43. 4
      mailbox-outer/src/main/java/com/biutag/outer/mapper/MailDraftMapper.java
  44. 3
      mailbox-outer/src/main/java/com/biutag/outer/mapper/MailMapper.java
  45. 9
      mailbox-outer/src/main/java/com/biutag/outer/service/MailDraftService.java
  46. 2
      mailbox-outer/src/main/java/com/biutag/outer/service/MailService.java
  47. 2
      mailbox-outer/src/test/java/SmsTest.java
  48. 6
      pom.xml

1
libs/words/installMavenJar.bat

@ -0,0 +1 @@
mvn install:install-file -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=15.8.0 -Dfile="words-15.8.0.jar" -Dpackaging=jar

BIN
libs/words/words-15.8.0.jar

Binary file not shown.

29
mailbox-common/pom.xml

@ -31,12 +31,6 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-logging</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
</dependency> </dependency>
<!-- Autoconfigure --> <!-- Autoconfigure -->
@ -77,7 +71,7 @@
<dependency> <dependency>
<groupId>jakarta.validation</groupId> <groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId> <artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version> <version>3.0.2</version>
</dependency> </dependency>
<!-- MyBatis-Plus --> <!-- MyBatis-Plus -->
@ -86,12 +80,6 @@
<artifactId>mybatis-plus-boot-starter</artifactId> <artifactId>mybatis-plus-boot-starter</artifactId>
</dependency> </dependency>
<!-- MyBatis-Plus-Join -->
<!-- <dependency>
<groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join</artifactId>
<version>1.2.4</version>
</dependency>-->
<dependency> <dependency>
<groupId>com.github.yulichang</groupId> <groupId>com.github.yulichang</groupId>
<artifactId>mybatis-plus-join-boot-starter</artifactId> <artifactId>mybatis-plus-join-boot-starter</artifactId>
@ -135,31 +123,20 @@
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
</dependency> </dependency>
<!-- IO工具 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<!-- 系统监控 --> <!-- 系统监控 -->
<dependency> <dependency>
<groupId>com.github.oshi</groupId> <groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId> <artifactId>oshi-core</artifactId>
<version>6.1.2</version> <version>6.1.2</version>
</dependency> </dependency>
<dependency>
<groupId>com.tongweb</groupId>
<artifactId>tongweb-embed-core-3.x</artifactId>
<version>7.0.E.6_P6</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId> <artifactId>swagger-models</artifactId>
<version>1.5.20</version> <version>1.5.20</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tongweb.springboot</groupId> <groupId>com.tongweb.springboot</groupId>
<artifactId>tongweb-spring-boot-starter-3.x</artifactId> <artifactId>tongweb-spring-boot-starter-3.x</artifactId>

5
mailbox-common/src/main/java/com/biutag/validator/IDMustValidator.java

@ -1,9 +1,8 @@
package com.biutag.validator; package com.biutag.validator;
import com.biutag.validator.annotation.IDMust; import com.biutag.validator.annotation.IDMust;
import jakarta.validation.ConstraintValidator;
import javax.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidatorContext;
/** /**
* 验证主键ID参数 * 验证主键ID参数

6
mailbox-common/src/main/java/com/biutag/validator/IdCardValidator.java

@ -1,11 +1,9 @@
package com.biutag.validator; package com.biutag.validator;
import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.PhoneUtil;
import com.biutag.validator.annotation.IdCard; import com.biutag.validator.annotation.IdCard;
import jakarta.validation.ConstraintValidator;
import javax.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidatorContext;
public class IdCardValidator implements ConstraintValidator<IdCard, String> { public class IdCardValidator implements ConstraintValidator<IdCard, String> {

6
mailbox-common/src/main/java/com/biutag/validator/IntArrayEmptyValidator.java

@ -1,10 +1,8 @@
package com.biutag.validator; package com.biutag.validator;
import com.biutag.validator.annotation.IntArrayEmpty; import com.biutag.validator.annotation.IntArrayEmpty;
import jakarta.validation.ConstraintValidator;
import javax.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidatorContext;
/** /**
* 验证整数数组是否为空 * 验证整数数组是否为空

4
mailbox-common/src/main/java/com/biutag/validator/IntegerContainsValidator.java

@ -1,9 +1,9 @@
package com.biutag.validator; package com.biutag.validator;
import com.biutag.validator.annotation.IntegerContains; import com.biutag.validator.annotation.IntegerContains;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

12
mailbox-common/src/main/java/com/biutag/validator/PhoneValidator.java

@ -1,16 +1,18 @@
package com.biutag.validator; package com.biutag.validator;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.PhoneUtil; import cn.hutool.core.util.PhoneUtil;
import com.biutag.validator.annotation.IdCard; import com.biutag.validator.annotation.IdCard;
import com.biutag.validator.annotation.Phone;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidator; public class PhoneValidator implements ConstraintValidator<Phone, String> {
import javax.validation.ConstraintValidatorContext;
public class PhoneValidator implements ConstraintValidator<IdCard, String> { public PhoneValidator() {
}
@Override @Override
public void initialize(IdCard constraintAnnotation) { public void initialize(Phone constraintAnnotation) {
ConstraintValidator.super.initialize(constraintAnnotation); ConstraintValidator.super.initialize(constraintAnnotation);
} }

4
mailbox-common/src/main/java/com/biutag/validator/StringContainsValidator.java

@ -2,9 +2,9 @@ package com.biutag.validator;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.biutag.validator.annotation.StringContains; import com.biutag.validator.annotation.StringContains;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.Arrays; import java.util.Arrays;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;

4
mailbox-common/src/main/java/com/biutag/validator/annotation/IDMust.java

@ -1,9 +1,9 @@
package com.biutag.validator.annotation; package com.biutag.validator.annotation;
import com.biutag.validator.IDMustValidator; import com.biutag.validator.IDMustValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*; import java.lang.annotation.*;
@Documented @Documented

8
mailbox-common/src/main/java/com/biutag/validator/annotation/IdCard.java

@ -1,18 +1,18 @@
package com.biutag.validator.annotation; package com.biutag.validator.annotation;
import com.biutag.validator.IdCardValidator; import com.biutag.validator.IdCardValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*; import java.lang.annotation.*;
@Documented @Documented
@Constraint(validatedBy = IdCardValidator.class) @Constraint(validatedBy = {IdCardValidator.class})
@Target({ ElementType.PARAMETER,ElementType.FIELD }) @Target({ ElementType.PARAMETER,ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface IdCard { public @interface IdCard {
String message() default "证件非法"; String message() default "身份证号码错误";
Class<?>[] groups() default {}; Class<?>[] groups() default {};

4
mailbox-common/src/main/java/com/biutag/validator/annotation/IntArrayEmpty.java

@ -1,9 +1,9 @@
package com.biutag.validator.annotation; package com.biutag.validator.annotation;
import com.biutag.validator.IntArrayEmptyValidator; import com.biutag.validator.IntArrayEmptyValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*; import java.lang.annotation.*;
@Documented @Documented

4
mailbox-common/src/main/java/com/biutag/validator/annotation/IntegerContains.java

@ -1,9 +1,9 @@
package com.biutag.validator.annotation; package com.biutag.validator.annotation;
import com.biutag.validator.IntegerContainsValidator; import com.biutag.validator.IntegerContainsValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*; import java.lang.annotation.*;
@Documented @Documented

5
mailbox-common/src/main/java/com/biutag/validator/annotation/Phone.java

@ -1,9 +1,10 @@
package com.biutag.validator.annotation; package com.biutag.validator.annotation;
import com.biutag.validator.PhoneValidator; import com.biutag.validator.PhoneValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*; import java.lang.annotation.*;
@Documented @Documented

4
mailbox-common/src/main/java/com/biutag/validator/annotation/StringContains.java

@ -1,9 +1,9 @@
package com.biutag.validator.annotation; package com.biutag.validator.annotation;
import com.biutag.validator.StringContainsValidator; import com.biutag.validator.StringContainsValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*; import java.lang.annotation.*;
@Documented @Documented

3
mailbox-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -1,4 +1,5 @@
com.biutag.exception.GlobalException com.biutag.exception.GlobalException
cn.hutool.extra.spring.SpringUtil cn.hutool.extra.spring.SpringUtil
com.biutag.config.MinioProperties com.biutag.config.MinioProperties
com.biutag.config.Minio com.biutag.config.Minio
com.biutag.validator.PhoneValidator

45
mailbox-lan/pom.xml

@ -39,19 +39,6 @@
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency> </dependency>
<dependency>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-api</artifactId>
<version>2.2.0-M1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-client-api</artifactId>
<version>2.2.0-M1</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>com.tongweb.springboot</groupId> <groupId>com.tongweb.springboot</groupId>
<artifactId>tongweb-spring-boot-starter-3.x</artifactId> <artifactId>tongweb-spring-boot-starter-3.x</artifactId>
@ -126,24 +113,31 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>3.3.3</version>
</dependency> </dependency>
<!-- 缓存 -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>junit</artifactId> <artifactId>caffeine</artifactId>
<scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains</groupId> <groupId>com.aspose</groupId>
<artifactId>annotations</artifactId> <artifactId>aspose-words</artifactId>
<version>24.1.0</version> <version>15.8.0</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.ben-manes.caffeine</groupId> <groupId>jakarta.websocket</groupId>
<artifactId>caffeine</artifactId> <artifactId>jakarta.websocket-api</artifactId>
<version>3.1.8</version> <version>2.2.0-M1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-client-api</artifactId>
<version>2.2.0-M1</version>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -187,4 +181,5 @@
</resources> </resources>
<finalName>mailbox-lan</finalName> <finalName>mailbox-lan</finalName>
</build> </build>
</project>
</project>

34
mailbox-lan/src/main/java/com/biutag/lan/controller/ApiV1Controller.java

@ -6,22 +6,29 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.biutag.config.Minio; import com.biutag.config.Minio;
import com.biutag.constants.AppConstants;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.entity.system.Holiday; import com.biutag.entity.system.Holiday;
import com.biutag.enums.ErrorEnum;
import com.biutag.exception.AuthException; import com.biutag.exception.AuthException;
import com.biutag.exception.BusinessException; import com.biutag.exception.BusinessException;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailMark;
import com.biutag.lan.domain.MailSource; import com.biutag.lan.domain.MailSource;
import com.biutag.lan.domain.bo.HolidayV1Req; import com.biutag.lan.domain.bo.HolidayV1Req;
import com.biutag.lan.domain.bo.MailApiV1Req; import com.biutag.lan.domain.bo.MailApiV1Req;
import com.biutag.lan.domain.bo.MailEvaluateApiV1Req; import com.biutag.lan.domain.bo.MailEvaluateApiV1Req;
import com.biutag.lan.enums.MailCategory;
import com.biutag.lan.service.HolidayService; import com.biutag.lan.service.HolidayService;
import com.biutag.lan.service.MailMarkService;
import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailService;
import com.biutag.lan.service.MailSourceService; import com.biutag.lan.service.MailSourceService;
import com.biutag.util.IOUtil; import com.biutag.util.IOUtil;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.simpleframework.xml.core.Validate; import org.simpleframework.xml.core.Validate;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -30,6 +37,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@Validate @Validate
@RequestMapping("/v1/") @RequestMapping("/v1/")
@ -40,6 +48,8 @@ public class ApiV1Controller {
private final MailService mailService; private final MailService mailService;
private final MailMarkService mailMarkService;
private final HolidayService holidayService; private final HolidayService holidayService;
private final Minio minio; private final Minio minio;
@ -72,6 +82,7 @@ public class ApiV1Controller {
@PutMapping("mail/evaluate") @PutMapping("mail/evaluate")
public AjaxResult<Void> updateMail(@RequestBody @Valid MailEvaluateApiV1Req req, HttpServletRequest request) { public AjaxResult<Void> updateMail(@RequestBody @Valid MailEvaluateApiV1Req req, HttpServletRequest request) {
log.info("更新信件信件评价:{}", JSON.toJSONString(req));
validAuth(request); validAuth(request);
Mail mail = mailService.getById(req.getId()); Mail mail = mailService.getById(req.getId());
if (Objects.isNull(mail)) { if (Objects.isNull(mail)) {
@ -82,6 +93,29 @@ public class ApiV1Controller {
return AjaxResult.success(); return AjaxResult.success();
} }
@GetMapping("mail/state")
public AjaxResult<JSONObject> addMail(@Valid @NotBlank String mailId, HttpServletRequest request) {
log.info("获取信件状态:{}", mailId);
validAuth(request);
if (StrUtil.isBlank(mailId)) {
new AjaxResult<>(ErrorEnum.SUCCESS.getCode(), ErrorEnum.SUCCESS.getMsg());
}
Mail mail = mailService.getById(mailId);
if (Objects.isNull(mail)) {
new AjaxResult<>(ErrorEnum.SUCCESS.getCode(), ErrorEnum.SUCCESS.getMsg());
}
// 感谢信 无效类、终止类
if (MailCategory.THANK_MAIL.getName().equals(mail.getMailFirstCategory()) || MailCategory.INVALID.getName().equals(mail.getMailFirstCategory()) ||
MailCategory.TERMINATION.getName().equals(mail.getMailFirstCategory())) {
return AjaxResult.success(JSONObject.of("id", mailId, "mailState", "terminated"));
}
MailMark mailMark = mailMarkService.getById(mailId);
if (Objects.isNull(mailMark) || AppConstants.NO.equals(mailMark.getCompleted())) {
new AjaxResult<>(ErrorEnum.SUCCESS.getCode(), ErrorEnum.SUCCESS.getMsg());
}
return AjaxResult.success(JSONObject.of("id", mailId, "mailState", "completion"));
}
@PostMapping("holiday") @PostMapping("holiday")
public AjaxResult<Void> addHoliday(@RequestBody @Valid List<HolidayV1Req> holidays, HttpServletRequest request) { public AjaxResult<Void> addHoliday(@RequestBody @Valid List<HolidayV1Req> holidays, HttpServletRequest request) {
validAuth(request); validAuth(request);

3
mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java

@ -62,7 +62,4 @@ public class MailController {
return AjaxResult.success(mailService.invalidCompletion(completion)); return AjaxResult.success(mailService.invalidCompletion(completion));
} }
} }

13
mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java

@ -1,12 +1,16 @@
package com.biutag.lan.controller; package com.biutag.lan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.aop.NotPower; import com.biutag.aop.NotPower;
import com.biutag.core.AjaxResult; import com.biutag.core.AjaxResult;
import com.biutag.lan.domain.Notice; import com.biutag.lan.domain.Notice;
import com.biutag.lan.domain.Work;
import com.biutag.lan.domain.vo.NoticeTotalVo; import com.biutag.lan.domain.vo.NoticeTotalVo;
import com.biutag.lan.flow.FlowNameEnum;
import com.biutag.lan.service.NoticeService; import com.biutag.lan.service.NoticeService;
import com.biutag.lan.service.WorkService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -19,6 +23,8 @@ public class NoticeController {
private final NoticeService noticeService; private final NoticeService noticeService;
private final WorkService workService;
@NotPower @NotPower
@GetMapping("total") @GetMapping("total")
public AjaxResult<NoticeTotalVo> total() { public AjaxResult<NoticeTotalVo> total() {
@ -26,4 +32,11 @@ public class NoticeController {
return AjaxResult.success(new NoticeTotalVo().setTotal(noticeIPage.getTotal()).setNotice(noticeIPage.getRecords().stream().findFirst().orElse(null))); return AjaxResult.success(new NoticeTotalVo().setTotal(noticeIPage.getTotal()).setNotice(noticeIPage.getRecords().stream().findFirst().orElse(null)));
} }
@NotPower
@GetMapping("newMailAudio")
public AjaxResult<Boolean> newMailAudio() {
long count = workService.count(new LambdaQueryWrapper<Work>().eq(Work::getFlowName, FlowNameEnum.PENDING_SIGN.getName()).eq(Work::getWorkState, Work.State.todo.name()));
return AjaxResult.success(count > 0);
}
} }

6
mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java

@ -60,7 +60,7 @@ public class FirstApprovalFlow extends Flow {
public void confirmedCompletion(String mailId, JSONObject data) { public void confirmedCompletion(String mailId, JSONObject data) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
// 将市局专班信件改为已办 // 将市局专班信件改为已办
workService.updateByMunicipal(mailId, Work.State.done.name(), FlowNameEnum.PENDING_APPROVAL.getDoneName()); workService.updateDoneByRole(mailId, FlowNameEnum.PENDING_APPROVAL.getDoneName());
// 更新信件(信件已办结) // 更新信件(信件已办结)
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
Boolean problemSolvingStatus = data.getBoolean("problemSolvingStatus"); Boolean problemSolvingStatus = data.getBoolean("problemSolvingStatus");
@ -102,6 +102,8 @@ public class FirstApprovalFlow extends Flow {
String returnOperate = data.getString("returnOperate"); String returnOperate = data.getString("returnOperate");
String reason = data.getString("reason"); String reason = data.getString("reason");
Assert.hasText(reason, "参数错误"); Assert.hasText(reason, "参数错误");
// 更新已办
workService.updateDoneByRole(mailId, FlowNameEnum.MAIL_RETURN.getDoneName());
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
MailReturn mailReturn = new MailReturn() MailReturn mailReturn = new MailReturn()
.setMailId(mailId) .setMailId(mailId)
@ -112,8 +114,6 @@ public class FirstApprovalFlow extends Flow {
.setHandlerDeptName(AdminThreadLocal.getDeptName()) .setHandlerDeptName(AdminThreadLocal.getDeptName())
.setCreateTime(now); .setCreateTime(now);
mailReturnService.save(mailReturn); mailReturnService.save(mailReturn);
// 更新已办
workService.updateByMunicipal(mailId, Work.State.done.name(), FlowNameEnum.MAIL_RETURN.getDoneName());
// 更新二级机构专班的待办 // 更新二级机构专班的待办
workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mail.getSecondDeptId(), FlowNameEnum.RETURN_RECTIFICATION.getName()); workService.updateTodo(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mail.getSecondDeptId(), FlowNameEnum.RETURN_RECTIFICATION.getName());
// 更新信件 // 更新信件

2
mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java

@ -46,7 +46,7 @@ public class FirstDistributeFlow extends Flow {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 将我的工作待办改成已办 // 将我的工作待办改成已办
workService.updateByMunicipal(mailId, Work.State.done.name(), FlowNameEnum.PENDING_DISTRIBUTE.getDoneName()); workService.updateDoneByRole(mailId, FlowNameEnum.PENDING_DISTRIBUTE.getDoneName());
JSONObject firstDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId)); JSONObject firstDistributeInfo = JSONObject.of("mainDept", JSONObject.of("id", mainDeptId));
// 下发信件(主责单位) // 下发信件(主责单位)

4
mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java

@ -111,7 +111,7 @@ public class FirstSignFlow extends Flow {
.setUpdateTime(now); .setUpdateTime(now);
mailService.save(mail); mailService.save(mail);
// 更新为已办 // 更新为已办
workService.updateByMunicipal(mailId, Work.State.done.name(), null); workService.updateDoneByRole(mailId, null);
return null; return null;
} }
@ -132,7 +132,7 @@ public class FirstSignFlow extends Flow {
.setInvalidationReason(invalidationReason); .setInvalidationReason(invalidationReason);
mailService.save(mail); mailService.save(mail);
// 更新为已办 // 更新为已办
workService.updateByMunicipal(mailId, Work.State.done.name(), null); workService.updateDoneByRole(mailId, null);
return null; return null;
} }

9
mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java

@ -7,7 +7,6 @@ import com.biutag.exception.BusinessException;
import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.Mail;
import com.biutag.lan.domain.MailReturn; import com.biutag.lan.domain.MailReturn;
import com.biutag.lan.domain.Work;
import com.biutag.lan.enums.CompleteMethod; import com.biutag.lan.enums.CompleteMethod;
import com.biutag.lan.flow.ActionEnum; import com.biutag.lan.flow.ActionEnum;
import com.biutag.lan.flow.Flow; import com.biutag.lan.flow.Flow;
@ -71,7 +70,7 @@ public class SecondApprovalFlow extends Flow {
.setCreateTime(now); .setCreateTime(now);
mailReturnService.save(mailReturn); mailReturnService.save(mailReturn);
// 更新已办 // 更新已办
workService.updateDone(mailId, AdminThreadLocal.getEmpNo(), FlowNameEnum.MAIL_RETURN.getDoneName()); workService.updateDoneByRole(mailId, FlowNameEnum.MAIL_RETURN.getDoneName());
// 更新三级机构专班的待办 // 更新三级机构专班的待办
workService.updateTodo(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mail.getThreeDeptId(), FlowNameEnum.RETURN_RECTIFICATION.getName()); workService.updateTodo(mailId, RoleEnum.THREE_DEPT_CLASSES.getRoleId(), mail.getThreeDeptId(), FlowNameEnum.RETURN_RECTIFICATION.getName());
// 更新信件 // 更新信件
@ -90,9 +89,9 @@ public class SecondApprovalFlow extends Flow {
// 审批意见 // 审批意见
mailApprovalService.saveOrUpdate(mail.getId(), mail.getFlowKey(), data.getString("approvalComment"), null, now); mailApprovalService.saveOrUpdate(mail.getId(), mail.getFlowKey(), data.getString("approvalComment"), null, now);
// 将二级专班角色的信件改为已办 // 将二级专班角色的信件改为已办
workService.updateDone(mail.getId(), RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), mail.getSecondDeptId(), FlowNameEnum.PENDING_APPROVAL.getDoneName()); workService.updateDoneByRole(mail.getId(), FlowNameEnum.PENDING_APPROVAL.getDoneName());
// 将市局专班信件改为待办 // 将市局专班信件改为待办
workService.updateByMunicipal(mail.getId(), Work.State.todo.name(), FlowNameEnum.PENDING_APPROVAL.getName()); workService.updateTodoByMunicipal(mail.getId(), FlowNameEnum.PENDING_APPROVAL.getName());
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)
.setFlowKey(FlowNodeEnum.FIRST_APPROVAL.getKey()) .setFlowKey(FlowNodeEnum.FIRST_APPROVAL.getKey())
@ -111,7 +110,7 @@ public class SecondApprovalFlow extends Flow {
// 审批意见 // 审批意见
mailApprovalService.saveOrUpdate(mail.getId(), mail.getFlowKey(), data.getString("approvalComment"), leaderEmpNo, now); mailApprovalService.saveOrUpdate(mail.getId(), mail.getFlowKey(), data.getString("approvalComment"), leaderEmpNo, now);
// 将二级专班角色的信件改为已办 // 将二级专班角色的信件改为已办
workService.updateDone(mail.getId(), RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), AdminThreadLocal.getDeptId(), FlowNameEnum.PENDING_APPROVAL.getDoneName()); workService.updateDoneByRole(mail.getId(), FlowNameEnum.PENDING_APPROVAL.getDoneName());
// 将二级副职领导新增信件 // 将二级副职领导新增信件
workService.saveOrUpdate(mail, leaderEmpNo, now, FlowNameEnum.PENDING_APPROVAL.getName()); workService.saveOrUpdate(mail, leaderEmpNo, now, FlowNameEnum.PENDING_APPROVAL.getName());
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);

4
mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondReportingFlow.java

@ -27,9 +27,9 @@ public class SecondReportingFlow extends Flow {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 将二级专班信件改为已办 // 将二级专班信件改为已办
workService.updateDone(mailId, RoleEnum.SECOND_DEPT_CLASSES.getRoleId(), AdminThreadLocal.getDeptId(), FlowNameEnum.PENDING_REPORT.getDoneName()); workService.updateDoneByRole(mailId, FlowNameEnum.PENDING_REPORT.getDoneName());
// 将市局专班信件改为待办 // 将市局专班信件改为待办
workService.updateByMunicipal(mailId, Work.State.todo.name(), FlowNameEnum.PENDING_APPROVAL.getName()); workService.updateTodoByMunicipal(mailId, FlowNameEnum.PENDING_APPROVAL.getName());
Flow nextNode = next.get(nextActionKey); Flow nextNode = next.get(nextActionKey);
// 更新信件 // 更新信件
mail.setUpdateTime(now) mail.setUpdateTime(now)

4
mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java

@ -69,7 +69,7 @@ public class SecondSignFlow extends Flow {
work.setUpdateTime(now).setWorkState(Work.State.done.name()); work.setUpdateTime(now).setWorkState(Work.State.done.name());
workService.updateById(work); workService.updateById(work);
// 更新市局专班的待办 // 更新市局专班的待办
workService.updateByMunicipal(mailId, Work.State.todo.name(), FlowNameEnum.MAIL_RETURN.getName()); workService.updateTodoByMunicipal(mailId, FlowNameEnum.MAIL_RETURN.getName());
Mail mail = mailService.getById(mailId); Mail mail = mailService.getById(mailId);
// 主责单位 // 主责单位
if (work.getMainDeptFlag()) { if (work.getMainDeptFlag()) {
@ -97,13 +97,13 @@ public class SecondSignFlow extends Flow {
public Flow sign(String nextActionKey, String mailId) { public Flow sign(String nextActionKey, String mailId) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String empNo = AdminThreadLocal.getEmpNo();
Integer roleId = AdminThreadLocal.getRoleId(); Integer roleId = AdminThreadLocal.getRoleId();
Integer deptId = AdminThreadLocal.getDeptId(); Integer deptId = AdminThreadLocal.getDeptId();
Work work = workService.getOne(mailId, roleId ,deptId); Work work = workService.getOne(mailId, roleId ,deptId);
if (work.getWorkState().equals(Work.State.done.name())) { if (work.getWorkState().equals(Work.State.done.name())) {
throw new BusinessException("该信件已被其他专班处理"); throw new BusinessException("该信件已被其他专班处理");
} }
String empNo = AdminThreadLocal.getEmpNo();
// 更新我的工作 // 更新我的工作
work.setPoliceEmpNo(empNo) work.setPoliceEmpNo(empNo)
.setUpdateTime(now) .setUpdateTime(now)

2
mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java

@ -188,7 +188,7 @@ public class ThreeVerifyFlow extends Flow {
} }
// 将本人下的件改为已办 // 将本人下的件改为已办
workService.updateDone(mail.getId(), AdminThreadLocal.getRoleId(), AdminThreadLocal.getDeptId(), FlowNameEnum.VERIFY.getDoneName()); workService.updateDoneByRole(mail.getId(), FlowNameEnum.VERIFY.getDoneName());
// 处理协办民警 // 处理协办民警
threeSignFlow.saveCoHandling(mail, data); threeSignFlow.saveCoHandling(mail, data);
JSONArray coHandlingPolices = data.getJSONArray("coHandlingPolices"); JSONArray coHandlingPolices = data.getJSONArray("coHandlingPolices");

5
mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java

@ -149,9 +149,8 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
} else { // 如果是会签中 } else { // 如果是会签中
flowDetail.setFlowNode(flowNodeService.getById(mail.getFlowKey())); flowDetail.setFlowNode(flowNodeService.getById(mail.getFlowKey()));
} }
List<String> flowNodes = Arrays.asList(FlowNodeEnum.SECOND_APPROVAL.getKey());
// 退回件 // 退回件
if (!flowNodes.contains(mail.getFlowKey()) && !flows.isEmpty() && ActionEnum.mailReturn.getValue().equals(flows.get(0).getActionKey())) { if (!flows.isEmpty() && ActionEnum.mailReturn.getValue().equals(flows.get(0).getActionKey())) {
flowDetail.setMailReturns(mailReturnService.list(mailId)); flowDetail.setMailReturns(mailReturnService.list(mailId));
} }
// 申请延期 // 申请延期
@ -232,7 +231,7 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
public boolean invalidCompletion(InvalidCompletion completion) { public boolean invalidCompletion(InvalidCompletion completion) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
// 将我的工作更新为已办 // 将我的工作更新为已办
workService.updateByMunicipal(completion.getMailId(), Work.State.done.name(), null); workService.updateDoneByRole(completion.getMailId(), null);
MailSource mailSource = mailSourceService.getById(completion.getMailId()); MailSource mailSource = mailSourceService.getById(completion.getMailId());
Mail mail = mailSource.toMail() Mail mail = mailSource.toMail()

43
mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java

@ -13,6 +13,7 @@ import com.biutag.core.AjaxResult;
import com.biutag.entity.system.Dept; import com.biutag.entity.system.Dept;
import com.biutag.entity.system.PoliceUser; import com.biutag.entity.system.PoliceUser;
import com.biutag.enums.RoleEnum; import com.biutag.enums.RoleEnum;
import com.biutag.exception.BusinessException;
import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.config.AdminThreadLocal;
import com.biutag.lan.domain.*; import com.biutag.lan.domain.*;
import com.biutag.lan.domain.bo.MailQuery; import com.biutag.lan.domain.bo.MailQuery;
@ -168,8 +169,11 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return true; return true;
} }
public boolean updateDone(String mailId, Integer roleId, Integer deptId, String flowName) { public boolean updateDoneByRole(String mailId, String flowName) {
Work work = getOne(mailId, roleId, deptId); Work work = getOne(mailId, AdminThreadLocal.getRoleId(), AdminThreadLocal.getDeptId());
if (work.getWorkState().equals(Work.State.done.name())) {
throw new BusinessException("该信件已被其他专班处理");
}
work.setUpdateTime(LocalDateTime.now()).setWorkState(Work.State.done.name()).setFlowName(flowName); work.setUpdateTime(LocalDateTime.now()).setWorkState(Work.State.done.name()).setFlowName(flowName);
return updateById(work); return updateById(work);
} }
@ -188,15 +192,13 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return updateById(work); return updateById(work);
} }
public boolean updateByMunicipal(String mailId, String workState, String flowName) { public boolean updateTodoByMunicipal(String mailId, String flowName) {
Work work = getByMunicipal(mailId); Work work = getByMunicipal(mailId);
work.setUpdateTime(LocalDateTime.now()).setSignDeptId(1) work.setUpdateTime(LocalDateTime.now()).setSignDeptId(1)
.setWorkState(workState) .setWorkState(Work.State.todo.name())
.setFlowName(flowName); .setFlowName(flowName);
boolean flag = updateById(work); boolean flag = updateById(work);
if (work.getWorkState().equals(Work.State.todo.name())) { noticeService.save(work, String.format("%s 的来信未处理,请尽快处理!", work.getContactName()));
noticeService.save(work, String.format("%s 的来信未处理,请尽快处理!", work.getContactName()));
}
return flag; return flag;
} }
@ -206,13 +208,6 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
return updateById(work); return updateById(work);
} }
public boolean saveTodo(Work work) {
work.setWorkState(Work.State.todo.name());
boolean save = save(work);
noticeService.save(work, String.format("%s 的来信未处理,请尽快处理!", work.getContactName()));
return save;
}
public boolean updateAllDone(String mailId) { public boolean updateAllDone(String mailId) {
LambdaUpdateWrapper<Work> updateWrapper = new LambdaUpdateWrapper<Work>() LambdaUpdateWrapper<Work> updateWrapper = new LambdaUpdateWrapper<Work>()
.set(Work::getWorkState, Work.State.done.name()) .set(Work::getWorkState, Work.State.done.name())
@ -234,6 +229,8 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
.and(query -> { .and(query -> {
query.isNull("m.flow_key").or().ne("m.flow_key", FlowNodeEnum.COMPLETION.getKey()); query.isNull("m.flow_key").or().ne("m.flow_key", FlowNodeEnum.COMPLETION.getKey());
}); });
deptWorkSearch(todoQuery, queryWrapper);
Integer roleId = AdminThreadLocal.getRoleId(); Integer roleId = AdminThreadLocal.getRoleId();
Integer deptId = AdminThreadLocal.getDeptId(); Integer deptId = AdminThreadLocal.getDeptId();
String empNo = AdminThreadLocal.getEmpNo(); String empNo = AdminThreadLocal.getEmpNo();
@ -271,7 +268,7 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
queryWrapper.like("w.contact_name", todoQuery.getContactFieldValue()); queryWrapper.like("w.contact_name", todoQuery.getContactFieldValue());
break; break;
case "idCard": case "idCard":
queryWrapper.like("w.contactIdCard", todoQuery.getContactFieldValue()); queryWrapper.like("w.contact_id_card", todoQuery.getContactFieldValue());
break; break;
case "phone": queryWrapper.like("w.contact_phone", todoQuery.getContactFieldValue()); case "phone": queryWrapper.like("w.contact_phone", todoQuery.getContactFieldValue());
break; break;
@ -440,7 +437,21 @@ public class WorkService extends ServiceImpl<WorkMapper, Work> {
} }
} }
} }
private void deptWorkSearch(MailQuery mailQuery, QueryWrapper<Work> queryWrapper) {
if (StrUtil.isNotBlank(mailQuery.getDeptId())) {
Dept dept = deptMapper.selectById(mailQuery.getDeptId());
switch (dept.getLevel()) {
case 1:
break;
case 2:
queryWrapper.eq("m.second_dept_id", dept.getId());
break;
case 3:
queryWrapper.eq("m.three_dept_id", dept.getId());
break;
}
}
}
public void export(HttpServletResponse response, String ids) throws IOException { public void export(HttpServletResponse response, String ids) throws IOException {
List<String> data = JSON.parseArray(ids, String.class); List<String> data = JSON.parseArray(ids, String.class);

10
mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java

@ -128,8 +128,8 @@ public class DutyServiceImpl implements IDutyService {
@Override @Override
public void add(DutyCreateValidate createValidate) { public void add(DutyCreateValidate createValidate) {
Duty model = new Duty(); Duty model = new Duty();
model.setStartTime(createValidate.getStartTime()); model.setStartTime(createValidate.getReportDate()[0]);
model.setEndTime(createValidate.getEndTime()); model.setEndTime(createValidate.getReportDate()[1]);
model.setDepartId(createValidate.getDepartId()); model.setDepartId(createValidate.getDepartId());
PoliceUser policeUser= policeUserMapper.selectOne(new QueryWrapper<PoliceUser>() PoliceUser policeUser= policeUserMapper.selectOne(new QueryWrapper<PoliceUser>()
.select("id,name,emp_no,username,nickname,avatar," + .select("id,name,emp_no,username,nickname,avatar," +
@ -171,18 +171,20 @@ public class DutyServiceImpl implements IDutyService {
public void edit(DutyUpdateValidate updateValidate) { public void edit(DutyUpdateValidate updateValidate) {
Duty model = dutyMapper.selectOne( Duty model = dutyMapper.selectOne(
new QueryWrapper<Duty>() new QueryWrapper<Duty>()
.eq("id", updateValidate.getId()) .eq("emp_no", updateValidate.getEmpNo())
.last("limit 1")); .last("limit 1"));
Assert.notNull(model, "数据不存在!"); Assert.notNull(model, "数据不存在!");
model.setId(updateValidate.getId()); model.setId(model.getId());
model.setDepartId(updateValidate.getDepartId()); model.setDepartId(updateValidate.getDepartId());
// model.setDepartName(updateValidate.getDepartName()); // model.setDepartName(updateValidate.getDepartName());
model.setPoliceName(updateValidate.getPoliceName()); model.setPoliceName(updateValidate.getPoliceName());
model.setMobile(updateValidate.getMobile()); model.setMobile(updateValidate.getMobile());
// model.setRoleId(updateValidate.getRoleId()); // model.setRoleId(updateValidate.getRoleId());
model.setEmpNo(updateValidate.getEmpNo()); model.setEmpNo(updateValidate.getEmpNo());
model.setStartTime(updateValidate.getReportDate()[0]);
model.setEndTime(updateValidate.getReportDate()[1]);
// model.setRoleName(updateValidate.getRoleName()); // model.setRoleName(updateValidate.getRoleName());
model.setCreateTime(System.currentTimeMillis() / 1000); model.setCreateTime(System.currentTimeMillis() / 1000);
dutyMapper.updateById(model); dutyMapper.updateById(model);

16
mailbox-lan/src/main/java/com/biutag/lan/validate/system/DutyCreateValidate.java

@ -14,13 +14,17 @@ public class DutyCreateValidate implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = "开始时间参数缺失") // @NotNull(message = "开始时间参数缺失")
@ApiModelProperty(value = "开始时间") // @ApiModelProperty(value = "开始时间")
private String startTime; // private String startTime;
//
// @NotNull(message = "结束时间参数缺失")
// @ApiModelProperty(value = "结束时间")
// private String endTime;
@NotNull(message = "时间参数缺失")
@ApiModelProperty(value = "时间")
private String[] reportDate;
@NotNull(message = "结束时间参数缺失")
@ApiModelProperty(value = "结束时间")
private String endTime;
@NotNull(message = "结束时间参数缺失") @NotNull(message = "结束时间参数缺失")
@ApiModelProperty(value = "部门id") @ApiModelProperty(value = "部门id")

18
mailbox-lan/src/main/java/com/biutag/lan/validate/system/DutyUpdateValidate.java

@ -24,13 +24,17 @@ public class DutyUpdateValidate implements Serializable {
private Long id; private Long id;
@NotNull(message = "开始时间参数缺失") // @NotNull(message = "开始时间参数缺失")
@ApiModelProperty(value = "开始时间") // @ApiModelProperty(value = "开始时间")
private String startTime; // private String startTime;
//
@NotNull(message = "结束时间参数缺失") // @NotNull(message = "结束时间参数缺失")
@ApiModelProperty(value = "结束时间") // @ApiModelProperty(value = "结束时间")
private String endTime; // private String endTime;
@NotNull(message = "时间参数缺失")
@ApiModelProperty(value = "时间")
private String[] reportDate;
@NotNull(message = "结束时间参数缺失") @NotNull(message = "结束时间参数缺失")
@ApiModelProperty(value = "部门id") @ApiModelProperty(value = "部门id")

32
mailbox-lan/src/test/java/com/biutag/lan/WordsTests.java

@ -0,0 +1,32 @@
package com.biutag.lan;
import com.aspose.words.Document;
import com.aspose.words.License;
import com.biutag.entity.server.Sys;
import org.junit.jupiter.api.Test;
import java.io.FileInputStream;
import java.io.InputStream;
public class WordsTests {
@Test
public void testCover() throws Exception {
getLicense();
long l = System.currentTimeMillis();
Document doc = new Document("D:\\deploy\\《处理反馈表》.doc");
doc.save("D:\\deploy\\《处理反馈表》.docx");
System.out.println(System.currentTimeMillis() - l);
}
public static boolean getLicense() {
try (InputStream is = new FileInputStream("D:\\deploy\\license.xml")){
License aposeLic = new License();
aposeLic.setLicense(is);
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
}

1
mailbox-outer-admin/pom.xml

@ -67,7 +67,6 @@
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId> <artifactId>easyexcel</artifactId>
<version>3.3.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.jsonwebtoken</groupId> <groupId>io.jsonwebtoken</groupId>

1
mailbox-outer/pom.xml

@ -71,7 +71,6 @@
<dependency> <dependency>
<groupId>com.github.ben-manes.caffeine</groupId> <groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId> <artifactId>caffeine</artifactId>
<version>3.1.8</version>
</dependency> </dependency>
<dependency> <dependency>

1
mailbox-outer/src/main/java/com/biutag/outer/controller/MailController.java

@ -32,6 +32,7 @@ public class MailController {
return AjaxResult.success(MailVo.of(mailService.getById(id))); return AjaxResult.success(MailVo.of(mailService.getById(id)));
} }
@PostMapping @PostMapping
public AjaxResult<Boolean> add(@RequestBody @Valid MailBo mailBo) { public AjaxResult<Boolean> add(@RequestBody @Valid MailBo mailBo) {
if (!mailBo.getCode().equals(CodeUtil.get(mailBo.getSmsRequestId()))) { if (!mailBo.getCode().equals(CodeUtil.get(mailBo.getSmsRequestId()))) {

5
mailbox-outer/src/main/java/com/biutag/outer/domain/Mail.java

@ -76,4 +76,9 @@ public class Mail {
*/ */
private String satisfaction; private String satisfaction;
/**
* 信件状态
*/
private String mailState;
} }

10
mailbox-outer/src/main/java/com/biutag/outer/domain/MailDraft.java

@ -65,6 +65,16 @@ public class MailDraft {
*/ */
private LocalDateTime updateTime; private LocalDateTime updateTime;
/**
* 涉及单位ID
*/
private Integer involvedDeptId;
/**
* 涉及单位名称
*/
private String involvedDeptName;
@TableLogic(value = Constants.UNDELETED, delval = Constants.DELETED) @TableLogic(value = Constants.UNDELETED, delval = Constants.DELETED)
private String delFlag; private String delFlag;

11
mailbox-outer/src/main/java/com/biutag/outer/domain/bo/MailBo.java

@ -23,13 +23,14 @@ public class MailBo {
/** /**
* 联系人姓名 * 联系人姓名
*/ */
@NotBlank(message = "请输入联系人姓名") @NotBlank(message = "联系人姓名不能为空")
@Length(min = 2, max = 20, message = "联系人姓名不符合规范(2-20字)")
private String contactName; private String contactName;
/** /**
* 联系人性别 * 联系人性别
*/ */
@NotBlank(message = "请选择联系人性别") @NotBlank(message = "联系人性别不能为空")
private String contactSex; private String contactSex;
/** /**
@ -45,7 +46,7 @@ public class MailBo {
private String contactPhone; private String contactPhone;
@NotBlank(message = "短信验证码不能为空") @NotBlank(message = "短信验证码不能为空")
@Length(max = 4) @Length(min = 4, max = 4, message = "短信验证码错误")
private String code; private String code;
@NotBlank(message = "短信验证码错误或已失效") @NotBlank(message = "短信验证码错误或已失效")
@ -60,13 +61,13 @@ public class MailBo {
* 内容 * 内容
*/ */
@Length(min= 10, max = 300, message = "信件内容不符合规范(不少于10字,不多于300字)") @Length(min= 10, max = 300, message = "信件内容不符合规范(不少于10字,不多于300字)")
@NotBlank(message = "请输入信件内容") @NotBlank(message = "信件内容不能为空")
private String content; private String content;
/** /**
* 附件 * 附件
*/ */
@Size(max = 20, message = "附件数量不能超过20") @Size(max = 5, message = "附件数量不能超过5")
private List<Attachment> attachments; private List<Attachment> attachments;
/** /**

11
mailbox-outer/src/main/java/com/biutag/outer/domain/vo/MailDraftVo.java

@ -8,7 +8,6 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
@Setter @Setter
@Getter @Getter
@ -64,6 +63,16 @@ public class MailDraftVo {
private String title; private String title;
/**
* 涉及单位ID
*/
private Integer involvedDeptId;
/**
* 涉及单位名称
*/
private String involvedDeptName;
public static MailDraftVo of(MailDraft draft) { public static MailDraftVo of(MailDraft draft) {
MailDraftVo vo = new MailDraftVo(); MailDraftVo vo = new MailDraftVo();
BeanUtil.copyProperties(draft, vo); BeanUtil.copyProperties(draft, vo);

17
mailbox-outer/src/main/java/com/biutag/outer/enums/MailStateEnum.java

@ -0,0 +1,17 @@
package com.biutag.outer.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum MailStateEnum {
processing("processing", "办理中"),
terminated("terminated", "已终止"),
completion("completion", "已办结");
private String value;
private String name;
}

40
mailbox-outer/src/main/java/com/biutag/outer/job/Job.java

@ -8,6 +8,7 @@ import cn.hutool.http.Method;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.config.Minio; import com.biutag.config.Minio;
import com.biutag.entity.system.Holiday; import com.biutag.entity.system.Holiday;
import com.biutag.outer.domain.Mail; import com.biutag.outer.domain.Mail;
@ -26,6 +27,7 @@ import org.springframework.stereotype.Component;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
@Slf4j @Slf4j
@RequiredArgsConstructor @RequiredArgsConstructor
@ -87,11 +89,11 @@ public class Job {
} }
/** /**
* 推送信件评价 10分钟 * 推送信件评价 30 s
*/ */
@Scheduled(fixedRate = 600000) @Scheduled(fixedRate = 30000)
public void pushMailEvaluate() { public void pushMailEvaluate() {
System.out.println(LocalDateTime.now()); log.info("推送信件评价-----------------------------");
List<Mail> mails = mailMapper.listByMailEvaluateEtl(); List<Mail> mails = mailMapper.listByMailEvaluateEtl();
for (Mail mail : mails) { for (Mail mail : mails) {
try { try {
@ -119,6 +121,38 @@ public class Job {
} }
} }
/**
* 更新信件状态 30分钟
*/
@Scheduled(fixedRate = 1800000)
public void updateMailState() {
List<Mail> mails = mailMapper.listByMailState();
for (Mail mail : mails) {
try {
long timestamp = new Date().getTime();
HttpResponse httpResponse = HttpUtil.createRequest(Method.GET, mailboxUrl + "mail/state?mailId=" + mail.getId())
.header("timestamp", String.valueOf(timestamp))
.auth(MD5.create().digestHex(key + timestamp))
.execute();
if (!httpResponse.isOk()) {
throw new RuntimeException(String.format("httpCode: %s", httpResponse.getStatus()));
}
log.info("获取信件返回结果:{}", httpResponse.body());
JSONObject response = JSONObject.parseObject(httpResponse.body());
if (response.getInteger("code") != 200) {
throw new RuntimeException(response.getString("msg"));
}
JSONObject data = response.getJSONObject("data");
if (Objects.isNull(data)) {
return;
}
mailMapper.update(new LambdaUpdateWrapper<Mail>().set(Mail::getMailState, data.getString("mailState")).eq(Mail::getId, mail.getId()));
} catch (RuntimeException e) {
log.error("获取信件返回结果[{}]异常: {}", mail.getId(), e.getMessage(), e);
}
}
}
/** /**
* 每年12月1日 零点执行 * 每年12月1日 零点执行
*/ */

4
mailbox-outer/src/main/java/com/biutag/outer/mapper/MailDraftMapper.java

@ -8,4 +8,8 @@ import org.apache.ibatis.annotations.Select;
@Mapper @Mapper
public interface MailDraftMapper extends BaseMapper<MailDraft> { public interface MailDraftMapper extends BaseMapper<MailDraft> {
@Select("select * from mail_draft where id = #{id}")
MailDraft getById(String id);
} }

3
mailbox-outer/src/main/java/com/biutag/outer/mapper/MailMapper.java

@ -19,4 +19,7 @@ public interface MailMapper extends BaseMapper<Mail> {
@Select("select m.* from mail m left join mail_evaluate_etl etl on m.id = etl.mail_id and etl.success = 1 where m.satisfaction is not null and m.satisfaction != '' and etl.id is null") @Select("select m.* from mail m left join mail_evaluate_etl etl on m.id = etl.mail_id and etl.success = 1 where m.satisfaction is not null and m.satisfaction != '' and etl.id is null")
List<Mail> listByMailEvaluateEtl(); List<Mail> listByMailEvaluateEtl();
@Select("select m.* from mail m where m.mail_state = 'processing'")
List<Mail> listByMailState();
} }

9
mailbox-outer/src/main/java/com/biutag/outer/service/MailDraftService.java

@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.outer.constants.Constants;
import com.biutag.outer.domain.MailDraft; import com.biutag.outer.domain.MailDraft;
import com.biutag.outer.domain.bo.MailBo; import com.biutag.outer.domain.bo.MailBo;
import com.biutag.outer.domain.vo.MailDraftVo; import com.biutag.outer.domain.vo.MailDraftVo;
@ -14,6 +15,7 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.Objects;
import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toList;
@ -28,7 +30,12 @@ public class MailDraftService extends ServiceImpl<MailDraftMapper, MailDraft> {
mailDraft.setCreateTime(LocalDateTime.now()); mailDraft.setCreateTime(LocalDateTime.now());
mailDraft.setUpdateTime(mailDraft.getCreateTime()); mailDraft.setUpdateTime(mailDraft.getCreateTime());
mailDraft.setUserId(UserHelper.getCurrentUserId()); mailDraft.setUserId(UserHelper.getCurrentUserId());
saveOrUpdate(mailDraft); mailDraft.setDelFlag(Constants.UNDELETED);
if (Objects.isNull(baseMapper.getById(mailDraft.getId()))) {
save(mailDraft);
} else {
updateById(mailDraft);
}
return mailDraft; return mailDraft;
} }

2
mailbox-outer/src/main/java/com/biutag/outer/service/MailService.java

@ -9,6 +9,7 @@ import com.biutag.outer.domain.MailEvaluate;
import com.biutag.outer.domain.bo.MailBo; import com.biutag.outer.domain.bo.MailBo;
import com.biutag.outer.domain.bo.MailEvaluateBo; import com.biutag.outer.domain.bo.MailEvaluateBo;
import com.biutag.outer.domain.vo.MailVo; import com.biutag.outer.domain.vo.MailVo;
import com.biutag.outer.enums.MailStateEnum;
import com.biutag.outer.mapper.MailMapper; import com.biutag.outer.mapper.MailMapper;
import com.biutag.outer.util.UserHelper; import com.biutag.outer.util.UserHelper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -36,6 +37,7 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
mail.setId(generateMailId()); mail.setId(generateMailId());
mail.setCreateTime(LocalDateTime.now()); mail.setCreateTime(LocalDateTime.now());
mail.setUserId(UserHelper.getCurrentUserId()); mail.setUserId(UserHelper.getCurrentUserId());
mail.setMailState(MailStateEnum.processing.getValue());
boolean save = save(mail); boolean save = save(mail);
if (save) { if (save) {
userService.updatePhoneByCurrent(mailBo.getContactPhone()); userService.updatePhoneByCurrent(mailBo.getContactPhone());

2
mailbox-outer/src/test/java/SmsTest.java

@ -1,5 +1,6 @@
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
@ -11,6 +12,7 @@ import java.util.Date;
public class SmsTest { public class SmsTest {
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(IdcardUtil.isValidCard(null));
// String phoneNumber = "15608487213"; // String phoneNumber = "15608487213";
// String code = "1234"; // String code = "1234";
// String url = "http://172.31.253.178:5050/ims/sms/sendSms"; // String url = "http://172.31.253.178:5050/ims/sms/sendSms";

6
pom.xml

@ -82,6 +82,12 @@
<version>3.1.8</version> <version>3.1.8</version>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.3.3</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>

Loading…
Cancel
Save