diff --git a/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java b/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java index c4b372e..dfe6b14 100644 --- a/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java +++ b/mailbox-common/src/main/java/com/biutag/constants/AppConstants.java @@ -25,40 +25,8 @@ public class AppConstants { public static final String FALSE = "0"; - static class Entity { - private String name; - private String age; - public Entity(String name, String age) { - this.name = name; - this.age = age; - } - - public String getName() { - return name; - } - - public String getAge() { - return age; - } - } - - - public static void main(String[] args) { - List entityList = new ArrayList<>(); - entityList.add(new Entity("Alice", "20")); - entityList.add(new Entity("Bob", "25")); - entityList.add(new Entity("Charlie", "30")); - - String targetAge = "25"; - - String matchedNames = entityList.stream() - .filter(entity -> entity.getAge() .equals(targetAge)) - .map(Entity::getName).findFirst().get(); - - System.out.println("Found matching names:"+matchedNames); - - } + public static final String MAIL_SOURCE = "mail_source"; } diff --git a/mailbox-lan/pom.xml b/mailbox-lan/pom.xml index dda6e1b..4e7768a 100644 --- a/mailbox-lan/pom.xml +++ b/mailbox-lan/pom.xml @@ -66,7 +66,7 @@ - ${groupId} + ${project.groupId} mailbox-common diff --git a/mailbox-lan/sql/0319.sql b/mailbox-lan/sql/0319.sql new file mode 100644 index 0000000..812ffb0 --- /dev/null +++ b/mailbox-lan/sql/0319.sql @@ -0,0 +1,14 @@ +update dict_data set remark = 'XXWW' where "value" = 'mailbox' and type_id = 7; +update dict_data set remark = 'JBTS' where "value" = '110_report_complaints' and type_id = 7; +update dict_data set remark = 'SZRX' where "value" = '12345_mayor''s_hotline' and type_id = 7; +update dict_data set remark = 'HWWZ' where "value" = 'red_network_politics' and type_id = 7; +update dict_data set remark = 'ZJXJ' where "value" = 'create_your_own_letters' and type_id = 7; +update dict_data set remark = 'XXTS' where "value" = 'petition_complaints' and type_id = 7; +update dict_data set remark = 'XXYQ' where "value" = 'news_opinion' and type_id = 7; + +update mail m set m.contact_police_emp_no = p.emp_no from police_user p where m.contact_police_emp_no is not null and m.contact_Police_name = p.name and m.three_dept_id = p.dept_ids; + +ALTER TABLE "mailbox"."mail_co_handling" + ADD COLUMN "dept_name" text; + +COMMENT ON COLUMN "mailbox"."mail_co_handling"."dept_name" IS '部门名称'; \ No newline at end of file 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 5ad03af..2198508 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 @@ -5,10 +5,7 @@ import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.biutag.aop.NotPower; import com.biutag.core.AjaxResult; -import com.biutag.lan.domain.bo.CoHandlingReq; -import com.biutag.lan.domain.bo.FlowAction; -import com.biutag.lan.domain.bo.InvalidCompletion; -import com.biutag.lan.domain.bo.MailOuter; +import com.biutag.lan.domain.bo.*; import com.biutag.lan.domain.vo.MailFlowDetail; import com.biutag.lan.service.MailService; import com.biutag.lan.validate.commons.MailIdValidate; @@ -83,4 +80,10 @@ public class MailController { return AjaxResult.success(mailService.saveCoHandling(coHandlingReq)); } + @NotPower + @PutMapping("handleDetail") + public AjaxResult updateHandleDetail(@RequestBody MailHandleDetailReq mailHandleDetailReq) { + return AjaxResult.success(mailService.updateHandleDetail(mailHandleDetailReq)); + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java index e0e9c9a..1e67a4a 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java @@ -36,4 +36,9 @@ public class MailCoHandling { */ private LocalDateTime createTime; + /** + * + */ + private String deptName; + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailHandleDetailReq.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailHandleDetailReq.java new file mode 100644 index 0000000..e1e82d2 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailHandleDetailReq.java @@ -0,0 +1,21 @@ +package com.biutag.lan.domain.bo; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class MailHandleDetailReq { + + private String mailId; + + /** + * 接访情况 + */ + private String interviewDetails; + + /** + * 核办情况 + */ + private String verifyDetails; +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailDetail.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailDetail.java index 2929cfa..306f7dc 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailDetail.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailDetail.java @@ -1,10 +1,8 @@ package com.biutag.lan.domain.vo; -import com.baomidou.mybatisplus.annotation.TableId; import com.biutag.lan.domain.MailFlow; import lombok.Getter; import lombok.Setter; -import lombok.experimental.Accessors; import java.time.LocalDateTime; import java.util.List; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java index a57d8ce..e458560 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java @@ -5,10 +5,7 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.biutag.enums.RoleEnum; -import com.biutag.lan.domain.Mail; -import com.biutag.lan.domain.MailCountersign; -import com.biutag.lan.domain.MailExtensionApproval; -import com.biutag.lan.domain.Work; +import com.biutag.lan.domain.*; import com.biutag.lan.enums.WorkType; import com.biutag.lan.flow.FlowNodeEnum; import com.fasterxml.jackson.annotation.JsonFormat; @@ -365,6 +362,8 @@ public class MailVo { private List extensionApprovals = new ArrayList<>(); + private List coHandlings = new ArrayList<>(); + public static MailVo of(Mail mail) { MailVo mailVo = new MailVo(); BeanUtils.copyProperties(mail, mailVo); diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java index 3e9e20a..17c0651 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java @@ -1,5 +1,6 @@ package com.biutag.lan.flow; +import cn.hutool.core.util.StrUtil; import lombok.AllArgsConstructor; import lombok.Getter; @@ -43,6 +44,9 @@ public enum FlowNodeEnum { } public static boolean isSignReturn(String key) { + if (StrUtil.isBlank(key)) { + return true; + } for (FlowNodeEnum value : values()) { if (value.getKey().equals(key)) { return value.getIndex() < THREE_SIGN.index; diff --git a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java index 27b9168..6139f1b 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java @@ -2,6 +2,7 @@ package com.biutag.lan.flow.node; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import com.biutag.lan.config.AdminThreadLocal; import com.biutag.lan.domain.MailCoHandling; import com.biutag.lan.domain.Work; import com.biutag.lan.enums.CoType; @@ -38,6 +39,7 @@ public class CoHandlingFlow extends Flow { .setCreateTime(now) .setVerifyDetails(verifyDetails) .setVerifyAttachments(verifyAttachments.toJSONString()) + .setDeptName(AdminThreadLocal.getDeptName()) .setCoType(CoType.secondary.name()); mailCoHandlingService.save(mailCoHandling); 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 440bc61..e2b48e1 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 @@ -99,7 +99,6 @@ public class ThreeVerifyFlow extends Flow { .setContactPolicePost(Optional.ofNullable(contactPolice).map(item -> item.getString("post")).orElse(null)) .setContactTime(Optional.ofNullable(data.getString("contactTime")).map(item -> DateUtil.parseLocalDateTime(item, DatePattern.NORM_DATETIME_PATTERN)).orElse(null)) .setContactDuration(data.getLong("contactDuration")) - .setContactPoliceEmpNo(data.getString("contactDuration")) .setContactFlag(data.getBoolean("contactFlag")) // 接访群众 .setInterviewType(data.getString("interviewType")) @@ -126,6 +125,7 @@ public class ThreeVerifyFlow extends Flow { "mobile", verifyFollowupPoliceObj.getString("mobile")).toJSONString(); source.setVerifyFollowupPolice(verifyFollowupPolice); } + BeanUtil.copyProperties(source, mail, CopyOptions.create().setIgnoreNullValue(true)); mailService.updateById(mail); return null; } @@ -150,7 +150,6 @@ public class ThreeVerifyFlow extends Flow { .setContactPolicePost(Optional.ofNullable(contactPolice).map(item -> item.getString("post")).orElse(null)) .setContactTime(Optional.ofNullable(data.getString("contactTime")).map(item -> DateUtil.parseLocalDateTime(item, DatePattern.NORM_DATETIME_PATTERN)).orElse(null)) .setContactDuration(data.getLong("contactDuration")) - .setContactPoliceEmpNo(data.getString("contactDuration")) .setContactFlag(data.getBoolean("contactFlag")) // 接访群众 .setInterviewType(data.getString("interviewType")) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/IDictDataService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/IDictDataService.java index 0f6b21a..b26a775 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/IDictDataService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/IDictDataService.java @@ -1,5 +1,6 @@ package com.biutag.lan.service; +import com.biutag.entity.setting.DictData; import com.biutag.lan.validate.commons.PageValidate; import com.biutag.lan.validate.setting.DictDataCreateValidate; import com.biutag.lan.validate.setting.DictDataUpdateValidate; @@ -41,6 +42,9 @@ public interface IDictDataService { */ DictDataVo detail(Integer id); + + DictData getByDateTypeAndValue(String dataType, String value); + /** * 字典数据新增 * diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailCoHandlingService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailCoHandlingService.java index 0db8acb..4be50c0 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailCoHandlingService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailCoHandlingService.java @@ -1,11 +1,18 @@ package com.biutag.lan.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.lan.domain.MailCoHandling; import com.biutag.lan.mapper.MailCoHandlingMapper; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class MailCoHandlingService extends ServiceImpl { + public List list(String mailId) { + return list(new LambdaQueryWrapper().eq(MailCoHandling::getMailId, mailId)); + } + } 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 61fa8ed..feb88d0 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 @@ -31,7 +31,6 @@ import com.biutag.lan.flow.node.FirstSignFlow; import com.biutag.lan.mapper.MailMapper; import com.biutag.lan.mapper.MailSourceMapper; import com.biutag.lan.mapper.WorkMapper; -import com.biutag.lan.validate.commons.MailIdValidate; import jakarta.annotation.Resource; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; @@ -78,6 +77,10 @@ public class MailService extends ServiceImpl { private final IHolidayService holidayService; + private final IDictDataService dictDataService; + + private final MailCoHandlingService mailCoHandlingService; + @Resource private MailSourceMapper mailSourceMapper; @@ -189,6 +192,8 @@ public class MailService extends ServiceImpl { List mailLabels = mailLabelService.listByIds(Arrays.stream(mail.getMailLabels().split(",")).map(Integer::parseInt).collect(Collectors.toList())); mailVo.setMailLabels(mailLabels.stream().map(MailLabel::getLabelName).collect(Collectors.toList())); } + // 协办 + mailVo.setCoHandlings(mailCoHandlingService.list(mailId)); return flowDetail; } @@ -231,8 +236,8 @@ public class MailService extends ServiceImpl { .setLimitedTime(flow.getFlowNode().getLimitedTime()) .setConsumingTime(consumingTime) .setCreateTime(now); - if (Objects.nonNull(flowAction.getData().getString("comment"))) { - mailFlow.setRemark(flowAction.getData().getString("comment")); + if (Objects.nonNull(flowAction.getData().getString("approvalComment"))) { + mailFlow.setRemark(flowAction.getData().getString("approvalComment")); } else if (Objects.nonNull(flowAction.getData().getString("comments"))) { mailFlow.setRemark(flowAction.getData().getString("comments")); } else if (Objects.nonNull(flowAction.getData().getString("reason"))) { @@ -378,7 +383,7 @@ public class MailService extends ServiceImpl { zeroString.append('0'); } // XXWW 信箱外网 - return DateUtil.format(new Date(), "yyyyMMddHHMM") + MailSource.Source.get(source).getKey() + zeroString + seqVal; + return DateUtil.format(new Date(), "yyyyMMddHHMM") + Optional.ofNullable(dictDataService.getByDateTypeAndValue(AppConstants.MAIL_SOURCE, source)).map(DictData::getRemark).orElse("") + zeroString + seqVal; } public boolean exists(String mailId) { @@ -396,7 +401,7 @@ public class MailService extends ServiceImpl { mail.setFlowKey(FlowNodeEnum.FIRST_SIGN.getKey()) .setMailState(MailState.processing.getValue()) .setFlowName(FlowNodeEnum.FIRST_SIGN.getFullName()) - .setMailCategory("").setMailFirstCategory(""); + .setMailCategory(null).setMailFirstCategory(null); Work work = workMapper.selectOne(new LambdaQueryWrapper().eq(Work::getMailId, mailId)); work.setWorkState(Work.State.todo.name()); workMapper.updateById(work); @@ -445,20 +450,15 @@ public class MailService extends ServiceImpl { return true; } - - public boolean delete(MailIdValidate mailId) { - if (mailId.getId()==null||mailId.getId().equals("")){ - return false; + public boolean updateHandleDetail(MailHandleDetailReq handleDetailReq) { + Mail mail = getById(handleDetailReq.getMailId()); + if (StrUtil.isNotBlank(handleDetailReq.getInterviewDetails())) { + mail.setInterviewDetails(handleDetailReq.getInterviewDetails()); } - Mail mail = baseMapper.selectById(mailId.getId()); - if (mailId.getId()!=null||!mailId.getId().equals("")){ - if (mail.getFlowKey().equals(FlowNodeEnum.FIRST_SIGN.getKey())||mail.getFlowKey().equals(FlowNodeEnum.FIRST_DISTRIBUTE.getKey())){ - baseMapper.deleteById(mailId.getId()); - mailSourceMapper.deleteById(mailId.getId()); - workMapper.delete(new LambdaQueryWrapper().eq(Work::getMailId, mailId.getId())); - } + if (StrUtil.isNotBlank(handleDetailReq.getVerifyDetails())) { + mail.setVerifyDetails(handleDetailReq.getVerifyDetails()); } - return true; + return updateById(mail); } } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DictDataServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DictDataServiceImpl.java index 199c2cc..d7b95b5 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DictDataServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DictDataServiceImpl.java @@ -1,5 +1,6 @@ package com.biutag.lan.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Assert; @@ -148,6 +149,12 @@ public class DictDataServiceImpl implements IDictDataService { return vo; } + @Override + public DictData getByDateTypeAndValue(String dataType, String value) { + DictType dictType = dictTypeMapper.selectOne(new LambdaQueryWrapper().eq(DictType::getDictType, dataType)); + return dictDataMapper.selectOne(new LambdaQueryWrapper().eq(DictData::getTypeId, dictType.getId()).eq(DictData::getValue, value)); + } + /** * 字典数据新增 * diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java index b12bd84..bc42178 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java @@ -159,6 +159,9 @@ public class HolidayServiceImpl implements IHolidayService { * @return */ public long getFlowRemainingTime(long limitedTime, LocalDateTime flowLimitedLastHandlerTime, Boolean extensionFlag, Integer extensionDays) { + if (Objects.isNull(flowLimitedLastHandlerTime)) { + return 0; + } // 86400 s 一天 if (limitedTime < 86400) { return limitedTime - Duration.between(flowLimitedLastHandlerTime, LocalDateTime.now()).getSeconds(); diff --git a/mailbox-outer-admin/pom.xml b/mailbox-outer-admin/pom.xml index 3b7e37e..505b054 100644 --- a/mailbox-outer-admin/pom.xml +++ b/mailbox-outer-admin/pom.xml @@ -60,7 +60,7 @@ - ${groupId} + ${project.groupId} mailbox-common diff --git a/pom.xml b/pom.xml index dfd5eba..b9afe1c 100644 --- a/pom.xml +++ b/pom.xml @@ -123,6 +123,7 @@ -parameters + diff --git a/truncate.sql b/truncate.sql index 3747395..546e766 100644 --- a/truncate.sql +++ b/truncate.sql @@ -9,6 +9,7 @@ truncate table mail_countersign; truncate table mail_return; truncate table mail_label; truncate table mail_mark; +truncate table mail_appeal; truncate table work; truncate table favorite;