diff --git a/libs/words/installMavenJar.bat b/libs/words/installMavenJar.bat new file mode 100644 index 0000000..c8c3b53 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/libs/words/words-15.8.0.jar b/libs/words/words-15.8.0.jar new file mode 100644 index 0000000..c0e699f Binary files /dev/null and b/libs/words/words-15.8.0.jar differ diff --git a/mailbox-common/pom.xml b/mailbox-common/pom.xml index a9c01aa..c4d3c25 100644 --- a/mailbox-common/pom.xml +++ b/mailbox-common/pom.xml @@ -31,12 +31,6 @@ org.springframework.boot spring-boot-starter-web - - - - - - @@ -77,7 +71,7 @@ jakarta.validation jakarta.validation-api - 2.0.2 + 3.0.2 @@ -86,12 +80,6 @@ mybatis-plus-boot-starter - - com.github.yulichang mybatis-plus-join-boot-starter @@ -135,31 +123,20 @@ commons-lang3 - - - commons-io - commons-io - 2.11.0 - - com.github.oshi oshi-core 6.1.2 - - com.tongweb - tongweb-embed-core-3.x - 7.0.E.6_P6 - compile - + io.swagger swagger-models 1.5.20 compile + com.tongweb.springboot tongweb-spring-boot-starter-3.x diff --git a/mailbox-common/src/main/java/com/biutag/validator/IDMustValidator.java b/mailbox-common/src/main/java/com/biutag/validator/IDMustValidator.java index 4a5356c..bc70921 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/IDMustValidator.java +++ b/mailbox-common/src/main/java/com/biutag/validator/IDMustValidator.java @@ -1,9 +1,8 @@ package com.biutag.validator; import com.biutag.validator.annotation.IDMust; - -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; /** * 验证主键ID参数 diff --git a/mailbox-common/src/main/java/com/biutag/validator/IdCardValidator.java b/mailbox-common/src/main/java/com/biutag/validator/IdCardValidator.java index 1512948..1cf3ab2 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/IdCardValidator.java +++ b/mailbox-common/src/main/java/com/biutag/validator/IdCardValidator.java @@ -1,11 +1,9 @@ package com.biutag.validator; import cn.hutool.core.util.IdcardUtil; -import cn.hutool.core.util.PhoneUtil; import com.biutag.validator.annotation.IdCard; - -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; public class IdCardValidator implements ConstraintValidator { diff --git a/mailbox-common/src/main/java/com/biutag/validator/IntArrayEmptyValidator.java b/mailbox-common/src/main/java/com/biutag/validator/IntArrayEmptyValidator.java index 3747dc2..ecf1b19 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/IntArrayEmptyValidator.java +++ b/mailbox-common/src/main/java/com/biutag/validator/IntArrayEmptyValidator.java @@ -1,10 +1,8 @@ package com.biutag.validator; import com.biutag.validator.annotation.IntArrayEmpty; - -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; - +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; /** * 验证整数数组是否为空 diff --git a/mailbox-common/src/main/java/com/biutag/validator/IntegerContainsValidator.java b/mailbox-common/src/main/java/com/biutag/validator/IntegerContainsValidator.java index 6b977ef..83de9ba 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/IntegerContainsValidator.java +++ b/mailbox-common/src/main/java/com/biutag/validator/IntegerContainsValidator.java @@ -1,9 +1,9 @@ package com.biutag.validator; 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.Set; diff --git a/mailbox-common/src/main/java/com/biutag/validator/PhoneValidator.java b/mailbox-common/src/main/java/com/biutag/validator/PhoneValidator.java index 35e76c5..929a2c8 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/PhoneValidator.java +++ b/mailbox-common/src/main/java/com/biutag/validator/PhoneValidator.java @@ -1,16 +1,18 @@ package com.biutag.validator; -import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.PhoneUtil; import com.biutag.validator.annotation.IdCard; +import com.biutag.validator.annotation.Phone; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; +public class PhoneValidator implements ConstraintValidator { -public class PhoneValidator implements ConstraintValidator { + public PhoneValidator() { + } @Override - public void initialize(IdCard constraintAnnotation) { + public void initialize(Phone constraintAnnotation) { ConstraintValidator.super.initialize(constraintAnnotation); } diff --git a/mailbox-common/src/main/java/com/biutag/validator/StringContainsValidator.java b/mailbox-common/src/main/java/com/biutag/validator/StringContainsValidator.java index 6363f66..860abbc 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/StringContainsValidator.java +++ b/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.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.Set; import java.util.stream.Collectors; diff --git a/mailbox-common/src/main/java/com/biutag/validator/annotation/IDMust.java b/mailbox-common/src/main/java/com/biutag/validator/annotation/IDMust.java index edf7194..8b964ff 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/annotation/IDMust.java +++ b/mailbox-common/src/main/java/com/biutag/validator/annotation/IDMust.java @@ -1,9 +1,9 @@ package com.biutag.validator.annotation; 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.*; @Documented diff --git a/mailbox-common/src/main/java/com/biutag/validator/annotation/IdCard.java b/mailbox-common/src/main/java/com/biutag/validator/annotation/IdCard.java index d132039..a1fb9dc 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/annotation/IdCard.java +++ b/mailbox-common/src/main/java/com/biutag/validator/annotation/IdCard.java @@ -1,18 +1,18 @@ package com.biutag.validator.annotation; 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.*; @Documented -@Constraint(validatedBy = IdCardValidator.class) +@Constraint(validatedBy = {IdCardValidator.class}) @Target({ ElementType.PARAMETER,ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) public @interface IdCard { - String message() default "证件非法"; + String message() default "身份证号码错误"; Class[] groups() default {}; diff --git a/mailbox-common/src/main/java/com/biutag/validator/annotation/IntArrayEmpty.java b/mailbox-common/src/main/java/com/biutag/validator/annotation/IntArrayEmpty.java index 6b3b873..9a87617 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/annotation/IntArrayEmpty.java +++ b/mailbox-common/src/main/java/com/biutag/validator/annotation/IntArrayEmpty.java @@ -1,9 +1,9 @@ package com.biutag.validator.annotation; 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.*; @Documented diff --git a/mailbox-common/src/main/java/com/biutag/validator/annotation/IntegerContains.java b/mailbox-common/src/main/java/com/biutag/validator/annotation/IntegerContains.java index 3c071ac..e389e91 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/annotation/IntegerContains.java +++ b/mailbox-common/src/main/java/com/biutag/validator/annotation/IntegerContains.java @@ -1,9 +1,9 @@ package com.biutag.validator.annotation; 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.*; @Documented diff --git a/mailbox-common/src/main/java/com/biutag/validator/annotation/Phone.java b/mailbox-common/src/main/java/com/biutag/validator/annotation/Phone.java index 9061d4b..a60fcd4 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/annotation/Phone.java +++ b/mailbox-common/src/main/java/com/biutag/validator/annotation/Phone.java @@ -1,9 +1,10 @@ package com.biutag.validator.annotation; + 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.*; @Documented diff --git a/mailbox-common/src/main/java/com/biutag/validator/annotation/StringContains.java b/mailbox-common/src/main/java/com/biutag/validator/annotation/StringContains.java index dd18a5d..3c1c424 100644 --- a/mailbox-common/src/main/java/com/biutag/validator/annotation/StringContains.java +++ b/mailbox-common/src/main/java/com/biutag/validator/annotation/StringContains.java @@ -1,9 +1,9 @@ package com.biutag.validator.annotation; 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.*; @Documented diff --git a/mailbox-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/mailbox-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 302df04..b47ab63 100644 --- a/mailbox-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/mailbox-common/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,4 +1,5 @@ com.biutag.exception.GlobalException cn.hutool.extra.spring.SpringUtil com.biutag.config.MinioProperties -com.biutag.config.Minio \ No newline at end of file +com.biutag.config.Minio +com.biutag.validator.PhoneValidator \ No newline at end of file diff --git a/mailbox-lan/pom.xml b/mailbox-lan/pom.xml index 6d6761c..443425d 100644 --- a/mailbox-lan/pom.xml +++ b/mailbox-lan/pom.xml @@ -39,19 +39,6 @@ spring-boot-starter-websocket - - jakarta.websocket - jakarta.websocket-api - 2.2.0-M1 - provided - - - jakarta.websocket - jakarta.websocket-client-api - 2.2.0-M1 - provided - - com.tongweb.springboot tongweb-spring-boot-starter-3.x @@ -126,24 +113,31 @@ com.alibaba easyexcel - 3.3.3 + + - junit - junit - test + com.github.ben-manes.caffeine + caffeine + - org.jetbrains - annotations - 24.1.0 - compile + com.aspose + aspose-words + 15.8.0 - com.github.ben-manes.caffeine - caffeine - 3.1.8 + jakarta.websocket + jakarta.websocket-api + 2.2.0-M1 + provided + + + jakarta.websocket + jakarta.websocket-client-api + 2.2.0-M1 + provided @@ -187,4 +181,5 @@ mailbox-lan - + + \ No newline at end of file diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/ApiV1Controller.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/ApiV1Controller.java index 242651c..f750e80 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/ApiV1Controller.java +++ b/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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.config.Minio; +import com.biutag.constants.AppConstants; import com.biutag.core.AjaxResult; import com.biutag.entity.system.Holiday; +import com.biutag.enums.ErrorEnum; import com.biutag.exception.AuthException; import com.biutag.exception.BusinessException; import com.biutag.lan.domain.Mail; +import com.biutag.lan.domain.MailMark; import com.biutag.lan.domain.MailSource; import com.biutag.lan.domain.bo.HolidayV1Req; import com.biutag.lan.domain.bo.MailApiV1Req; import com.biutag.lan.domain.bo.MailEvaluateApiV1Req; +import com.biutag.lan.enums.MailCategory; import com.biutag.lan.service.HolidayService; +import com.biutag.lan.service.MailMarkService; import com.biutag.lan.service.MailService; import com.biutag.lan.service.MailSourceService; import com.biutag.util.IOUtil; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.Valid; +import jakarta.validation.constraints.NotBlank; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.simpleframework.xml.core.Validate; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @@ -30,6 +37,7 @@ import java.util.Collections; import java.util.List; import java.util.Objects; +@Slf4j @RequiredArgsConstructor @Validate @RequestMapping("/v1/") @@ -40,6 +48,8 @@ public class ApiV1Controller { private final MailService mailService; + private final MailMarkService mailMarkService; + private final HolidayService holidayService; private final Minio minio; @@ -72,6 +82,7 @@ public class ApiV1Controller { @PutMapping("mail/evaluate") public AjaxResult updateMail(@RequestBody @Valid MailEvaluateApiV1Req req, HttpServletRequest request) { + log.info("更新信件信件评价:{}", JSON.toJSONString(req)); validAuth(request); Mail mail = mailService.getById(req.getId()); if (Objects.isNull(mail)) { @@ -82,6 +93,29 @@ public class ApiV1Controller { return AjaxResult.success(); } + @GetMapping("mail/state") + public AjaxResult 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") public AjaxResult addHoliday(@RequestBody @Valid List holidays, HttpServletRequest request) { validAuth(request); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java index 42a9e47..8c41ef6 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java @@ -62,7 +62,4 @@ public class MailController { return AjaxResult.success(mailService.invalidCompletion(completion)); } - - - } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java index e0fd1e2..cd5ff99 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/NoticeController.java @@ -1,12 +1,16 @@ package com.biutag.lan.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.aop.NotPower; import com.biutag.core.AjaxResult; import com.biutag.lan.domain.Notice; +import com.biutag.lan.domain.Work; import com.biutag.lan.domain.vo.NoticeTotalVo; +import com.biutag.lan.flow.FlowNameEnum; import com.biutag.lan.service.NoticeService; +import com.biutag.lan.service.WorkService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -19,6 +23,8 @@ public class NoticeController { private final NoticeService noticeService; + private final WorkService workService; + @NotPower @GetMapping("total") public AjaxResult total() { @@ -26,4 +32,11 @@ public class NoticeController { return AjaxResult.success(new NoticeTotalVo().setTotal(noticeIPage.getTotal()).setNotice(noticeIPage.getRecords().stream().findFirst().orElse(null))); } + @NotPower + @GetMapping("newMailAudio") + public AjaxResult newMailAudio() { + long count = workService.count(new LambdaQueryWrapper().eq(Work::getFlowName, FlowNameEnum.PENDING_SIGN.getName()).eq(Work::getWorkState, Work.State.todo.name())); + return AjaxResult.success(count > 0); + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java index b87e22f..cc783aa 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstApprovalFlow.java +++ b/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) { 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); Boolean problemSolvingStatus = data.getBoolean("problemSolvingStatus"); @@ -102,6 +102,8 @@ public class FirstApprovalFlow extends Flow { String returnOperate = data.getString("returnOperate"); String reason = data.getString("reason"); Assert.hasText(reason, "参数错误"); + // 更新已办 + workService.updateDoneByRole(mailId, FlowNameEnum.MAIL_RETURN.getDoneName()); Mail mail = mailService.getById(mailId); MailReturn mailReturn = new MailReturn() .setMailId(mailId) @@ -112,8 +114,6 @@ public class FirstApprovalFlow extends Flow { .setHandlerDeptName(AdminThreadLocal.getDeptName()) .setCreateTime(now); 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()); // 更新信件 diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java index 08ae340..770e935 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstDistributeFlow.java +++ b/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(); 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)); // 下发信件(主责单位) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java index d1a7f6e..454b9dd 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/FirstSignFlow.java @@ -111,7 +111,7 @@ public class FirstSignFlow extends Flow { .setUpdateTime(now); mailService.save(mail); // 更新为已办 - workService.updateByMunicipal(mailId, Work.State.done.name(), null); + workService.updateDoneByRole(mailId, null); return null; } @@ -132,7 +132,7 @@ public class FirstSignFlow extends Flow { .setInvalidationReason(invalidationReason); mailService.save(mail); // 更新为已办 - workService.updateByMunicipal(mailId, Work.State.done.name(), null); + workService.updateDoneByRole(mailId, null); return null; } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java index 60800a8..d2c23e8 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondApprovalFlow.java +++ b/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.domain.Mail; import com.biutag.lan.domain.MailReturn; -import com.biutag.lan.domain.Work; import com.biutag.lan.enums.CompleteMethod; import com.biutag.lan.flow.ActionEnum; import com.biutag.lan.flow.Flow; @@ -71,7 +70,7 @@ public class SecondApprovalFlow extends Flow { .setCreateTime(now); 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()); // 更新信件 @@ -90,9 +89,9 @@ public class SecondApprovalFlow extends Flow { // 审批意见 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) .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); // 将二级专班角色的信件改为已办 - 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()); Flow nextNode = next.get(nextActionKey); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondReportingFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondReportingFlow.java index e37390a..b71831c 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondReportingFlow.java +++ b/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(); 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); // 更新信件 mail.setUpdateTime(now) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java index 143822e..4ae65ff 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/SecondSignFlow.java +++ b/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()); 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); // 主责单位 if (work.getMainDeptFlag()) { @@ -97,13 +97,13 @@ public class SecondSignFlow extends Flow { public Flow sign(String nextActionKey, String mailId) { LocalDateTime now = LocalDateTime.now(); + String empNo = AdminThreadLocal.getEmpNo(); Integer roleId = AdminThreadLocal.getRoleId(); Integer deptId = AdminThreadLocal.getDeptId(); Work work = workService.getOne(mailId, roleId ,deptId); if (work.getWorkState().equals(Work.State.done.name())) { throw new BusinessException("该信件已被其他专班处理"); } - String empNo = AdminThreadLocal.getEmpNo(); // 更新我的工作 work.setPoliceEmpNo(empNo) .setUpdateTime(now) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java index e8049a0..42a6f8e 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java +++ b/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); JSONArray coHandlingPolices = data.getJSONArray("coHandlingPolices"); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java index 12adb97..80896cc 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java @@ -149,9 +149,8 @@ public class MailService extends ServiceImpl { } else { // 如果是会签中 flowDetail.setFlowNode(flowNodeService.getById(mail.getFlowKey())); } - List 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)); } // 申请延期 @@ -232,7 +231,7 @@ public class MailService extends ServiceImpl { public boolean invalidCompletion(InvalidCompletion completion) { LocalDateTime now = LocalDateTime.now(); // 将我的工作更新为已办 - workService.updateByMunicipal(completion.getMailId(), Work.State.done.name(), null); + workService.updateDoneByRole(completion.getMailId(), null); MailSource mailSource = mailSourceService.getById(completion.getMailId()); Mail mail = mailSource.toMail() diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java index ceb52c8..3a98207 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java +++ b/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.PoliceUser; import com.biutag.enums.RoleEnum; +import com.biutag.exception.BusinessException; import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.domain.*; import com.biutag.lan.domain.bo.MailQuery; @@ -168,8 +169,11 @@ public class WorkService extends ServiceImpl { return true; } - public boolean updateDone(String mailId, Integer roleId, Integer deptId, String flowName) { - Work work = getOne(mailId, roleId, deptId); + public boolean updateDoneByRole(String mailId, String flowName) { + 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); return updateById(work); } @@ -188,15 +192,13 @@ public class WorkService extends ServiceImpl { return updateById(work); } - public boolean updateByMunicipal(String mailId, String workState, String flowName) { + public boolean updateTodoByMunicipal(String mailId, String flowName) { Work work = getByMunicipal(mailId); work.setUpdateTime(LocalDateTime.now()).setSignDeptId(1) - .setWorkState(workState) + .setWorkState(Work.State.todo.name()) .setFlowName(flowName); 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; } @@ -206,13 +208,6 @@ public class WorkService extends ServiceImpl { 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) { LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .set(Work::getWorkState, Work.State.done.name()) diff --git a/mailbox-lan/src/test/java/com/biutag/lan/WordsTests.java b/mailbox-lan/src/test/java/com/biutag/lan/WordsTests.java new file mode 100644 index 0000000..53baa4e --- /dev/null +++ b/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; + } +} diff --git a/mailbox-outer-admin/pom.xml b/mailbox-outer-admin/pom.xml index f0a4385..3b7e37e 100644 --- a/mailbox-outer-admin/pom.xml +++ b/mailbox-outer-admin/pom.xml @@ -67,7 +67,6 @@ com.alibaba easyexcel - 3.3.2 io.jsonwebtoken diff --git a/mailbox-outer/pom.xml b/mailbox-outer/pom.xml index 6a456d4..1d1b855 100644 --- a/mailbox-outer/pom.xml +++ b/mailbox-outer/pom.xml @@ -71,7 +71,6 @@ com.github.ben-manes.caffeine caffeine - 3.1.8 diff --git a/mailbox-outer/src/main/java/com/biutag/outer/controller/MailController.java b/mailbox-outer/src/main/java/com/biutag/outer/controller/MailController.java index a3a92b0..90121d0 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/controller/MailController.java +++ b/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))); } + @PostMapping public AjaxResult add(@RequestBody @Valid MailBo mailBo) { if (!mailBo.getCode().equals(CodeUtil.get(mailBo.getSmsRequestId()))) { diff --git a/mailbox-outer/src/main/java/com/biutag/outer/domain/Mail.java b/mailbox-outer/src/main/java/com/biutag/outer/domain/Mail.java index 24be4e4..f3a5066 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/domain/Mail.java +++ b/mailbox-outer/src/main/java/com/biutag/outer/domain/Mail.java @@ -76,4 +76,9 @@ public class Mail { */ private String satisfaction; + /** + * 信件状态 + */ + private String mailState; + } diff --git a/mailbox-outer/src/main/java/com/biutag/outer/domain/MailDraft.java b/mailbox-outer/src/main/java/com/biutag/outer/domain/MailDraft.java index a295491..2063fe5 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/domain/MailDraft.java +++ b/mailbox-outer/src/main/java/com/biutag/outer/domain/MailDraft.java @@ -65,6 +65,16 @@ public class MailDraft { */ private LocalDateTime updateTime; + /** + * 涉及单位ID + */ + private Integer involvedDeptId; + + /** + * 涉及单位名称 + */ + private String involvedDeptName; + @TableLogic(value = Constants.UNDELETED, delval = Constants.DELETED) private String delFlag; diff --git a/mailbox-outer/src/main/java/com/biutag/outer/domain/bo/MailBo.java b/mailbox-outer/src/main/java/com/biutag/outer/domain/bo/MailBo.java index 19d00f4..1dba3a8 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/domain/bo/MailBo.java +++ b/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; /** * 联系人性别 */ - @NotBlank(message = "请选择联系人性别") + @NotBlank(message = "联系人性别不能为空") private String contactSex; /** @@ -45,7 +46,7 @@ public class MailBo { private String contactPhone; @NotBlank(message = "短信验证码不能为空") - @Length(max = 4) + @Length(min = 4, max = 4, message = "短信验证码错误") private String code; @NotBlank(message = "短信验证码错误或已失效") @@ -60,13 +61,13 @@ public class MailBo { * 内容 */ @Length(min= 10, max = 300, message = "信件内容不符合规范(不少于10字,不多于300字)") - @NotBlank(message = "请输入信件内容") + @NotBlank(message = "信件内容不能为空") private String content; /** * 附件 */ - @Size(max = 20, message = "附件数量不能超过20") + @Size(max = 5, message = "附件数量不能超过5") private List attachments; /** diff --git a/mailbox-outer/src/main/java/com/biutag/outer/domain/vo/MailDraftVo.java b/mailbox-outer/src/main/java/com/biutag/outer/domain/vo/MailDraftVo.java index 902411b..98926a5 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/domain/vo/MailDraftVo.java +++ b/mailbox-outer/src/main/java/com/biutag/outer/domain/vo/MailDraftVo.java @@ -8,7 +8,6 @@ import lombok.Getter; import lombok.Setter; import java.time.LocalDateTime; -import java.util.Date; @Setter @Getter @@ -64,6 +63,16 @@ public class MailDraftVo { private String title; + /** + * 涉及单位ID + */ + private Integer involvedDeptId; + + /** + * 涉及单位名称 + */ + private String involvedDeptName; + public static MailDraftVo of(MailDraft draft) { MailDraftVo vo = new MailDraftVo(); BeanUtil.copyProperties(draft, vo); diff --git a/mailbox-outer/src/main/java/com/biutag/outer/enums/MailStateEnum.java b/mailbox-outer/src/main/java/com/biutag/outer/enums/MailStateEnum.java new file mode 100644 index 0000000..941c238 --- /dev/null +++ b/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; + +} diff --git a/mailbox-outer/src/main/java/com/biutag/outer/job/Job.java b/mailbox-outer/src/main/java/com/biutag/outer/job/Job.java index 6d2b7be..b305e6d 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/job/Job.java +++ b/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.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.biutag.config.Minio; import com.biutag.entity.system.Holiday; import com.biutag.outer.domain.Mail; @@ -26,6 +27,7 @@ import org.springframework.stereotype.Component; import java.time.LocalDateTime; import java.util.Date; import java.util.List; +import java.util.Objects; @Slf4j @RequiredArgsConstructor @@ -87,11 +89,11 @@ public class Job { } /** - * 推送信件评价 10分钟 + * 推送信件评价 30 s */ - @Scheduled(fixedRate = 600000) + @Scheduled(fixedRate = 30000) public void pushMailEvaluate() { - System.out.println(LocalDateTime.now()); + log.info("推送信件评价-----------------------------"); List mails = mailMapper.listByMailEvaluateEtl(); for (Mail mail : mails) { try { @@ -119,6 +121,38 @@ public class Job { } } + /** + * 更新信件状态 30分钟 + */ + @Scheduled(fixedRate = 1800000) + public void updateMailState() { + List 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().set(Mail::getMailState, data.getString("mailState")).eq(Mail::getId, mail.getId())); + } catch (RuntimeException e) { + log.error("获取信件返回结果[{}]异常: {}", mail.getId(), e.getMessage(), e); + } + } + } + /** * 每年12月1日 零点执行 */ diff --git a/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailDraftMapper.java b/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailDraftMapper.java index f2fd719..f41081d 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailDraftMapper.java +++ b/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailDraftMapper.java @@ -8,4 +8,8 @@ import org.apache.ibatis.annotations.Select; @Mapper public interface MailDraftMapper extends BaseMapper { + + @Select("select * from mail_draft where id = #{id}") + MailDraft getById(String id); + } diff --git a/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailMapper.java b/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailMapper.java index cdd5d07..4863239 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailMapper.java +++ b/mailbox-outer/src/main/java/com/biutag/outer/mapper/MailMapper.java @@ -19,4 +19,7 @@ public interface MailMapper extends BaseMapper { @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 listByMailEvaluateEtl(); + @Select("select m.* from mail m where m.mail_state = 'processing'") + List listByMailState(); + } diff --git a/mailbox-outer/src/main/java/com/biutag/outer/service/MailDraftService.java b/mailbox-outer/src/main/java/com/biutag/outer/service/MailDraftService.java index c56f03a..afd37ac 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/service/MailDraftService.java +++ b/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.extension.plugins.pagination.Page; 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.bo.MailBo; import com.biutag.outer.domain.vo.MailDraftVo; @@ -14,6 +15,7 @@ import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.Date; +import java.util.Objects; import static java.util.stream.Collectors.toList; @@ -28,7 +30,12 @@ public class MailDraftService extends ServiceImpl { mailDraft.setCreateTime(LocalDateTime.now()); mailDraft.setUpdateTime(mailDraft.getCreateTime()); mailDraft.setUserId(UserHelper.getCurrentUserId()); - saveOrUpdate(mailDraft); + mailDraft.setDelFlag(Constants.UNDELETED); + if (Objects.isNull(baseMapper.getById(mailDraft.getId()))) { + save(mailDraft); + } else { + updateById(mailDraft); + } return mailDraft; } diff --git a/mailbox-outer/src/main/java/com/biutag/outer/service/MailService.java b/mailbox-outer/src/main/java/com/biutag/outer/service/MailService.java index b543010..e3e61f5 100644 --- a/mailbox-outer/src/main/java/com/biutag/outer/service/MailService.java +++ b/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.MailEvaluateBo; import com.biutag.outer.domain.vo.MailVo; +import com.biutag.outer.enums.MailStateEnum; import com.biutag.outer.mapper.MailMapper; import com.biutag.outer.util.UserHelper; import lombok.RequiredArgsConstructor; @@ -36,6 +37,7 @@ public class MailService extends ServiceImpl { mail.setId(generateMailId()); mail.setCreateTime(LocalDateTime.now()); mail.setUserId(UserHelper.getCurrentUserId()); + mail.setMailState(MailStateEnum.processing.getValue()); boolean save = save(mail); if (save) { userService.updatePhoneByCurrent(mailBo.getContactPhone()); diff --git a/mailbox-outer/src/test/java/SmsTest.java b/mailbox-outer/src/test/java/SmsTest.java index 79415f0..db42d7b 100644 --- a/mailbox-outer/src/test/java/SmsTest.java +++ b/mailbox-outer/src/test/java/SmsTest.java @@ -1,5 +1,6 @@ import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdcardUtil; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson2.JSONObject; @@ -11,6 +12,7 @@ import java.util.Date; public class SmsTest { public static void main(String[] args) { + System.out.println(IdcardUtil.isValidCard(null)); // String phoneNumber = "15608487213"; // String code = "1234"; // String url = "http://172.31.253.178:5050/ims/sms/sendSms"; diff --git a/pom.xml b/pom.xml index a2bfe7f..dfd5eba 100644 --- a/pom.xml +++ b/pom.xml @@ -82,6 +82,12 @@ 3.1.8 + + com.alibaba + easyexcel + 3.3.3 + +