Browse Source

BUG 修复

master
wxc 2 years ago
parent
commit
e45987d21c
  1. 34
      mailbox-common/src/main/java/com/biutag/constants/AppConstants.java
  2. 2
      mailbox-lan/pom.xml
  3. 14
      mailbox-lan/sql/0319.sql
  4. 11
      mailbox-lan/src/main/java/com/biutag/lan/controller/MailController.java
  5. 5
      mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java
  6. 21
      mailbox-lan/src/main/java/com/biutag/lan/domain/bo/MailHandleDetailReq.java
  7. 2
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailDetail.java
  8. 7
      mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailVo.java
  9. 4
      mailbox-lan/src/main/java/com/biutag/lan/flow/FlowNodeEnum.java
  10. 2
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/CoHandlingFlow.java
  11. 3
      mailbox-lan/src/main/java/com/biutag/lan/flow/node/ThreeVerifyFlow.java
  12. 4
      mailbox-lan/src/main/java/com/biutag/lan/service/IDictDataService.java
  13. 7
      mailbox-lan/src/main/java/com/biutag/lan/service/MailCoHandlingService.java
  14. 34
      mailbox-lan/src/main/java/com/biutag/lan/service/MailService.java
  15. 7
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/DictDataServiceImpl.java
  16. 3
      mailbox-lan/src/main/java/com/biutag/lan/service/impl/HolidayServiceImpl.java
  17. 2
      mailbox-outer-admin/pom.xml
  18. 1
      pom.xml
  19. 1
      truncate.sql

34
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<Entity> 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";
}

2
mailbox-lan/pom.xml

@ -66,7 +66,7 @@
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>mailbox-common</artifactId>
</dependency>

14
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 '部门名称';

11
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<Boolean> updateHandleDetail(@RequestBody MailHandleDetailReq mailHandleDetailReq) {
return AjaxResult.success(mailService.updateHandleDetail(mailHandleDetailReq));
}
}

5
mailbox-lan/src/main/java/com/biutag/lan/domain/MailCoHandling.java

@ -36,4 +36,9 @@ public class MailCoHandling {
*/
private LocalDateTime createTime;
/**
*
*/
private String deptName;
}

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

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

7
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<MailExtensionApprovalVo> extensionApprovals = new ArrayList<>();
private List<MailCoHandling> coHandlings = new ArrayList<>();
public static MailVo of(Mail mail) {
MailVo mailVo = new MailVo();
BeanUtils.copyProperties(mail, mailVo);

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

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

3
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"))

4
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);
/**
* 字典数据新增
*

7
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<MailCoHandlingMapper, MailCoHandling> {
public List<MailCoHandling> list(String mailId) {
return list(new LambdaQueryWrapper<MailCoHandling>().eq(MailCoHandling::getMailId, mailId));
}
}

34
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<MailMapper, Mail> {
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<MailMapper, Mail> {
List<MailLabel> 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<MailMapper, Mail> {
.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<MailMapper, Mail> {
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<MailMapper, Mail> {
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<Work>().eq(Work::getMailId, mailId));
work.setWorkState(Work.State.todo.name());
workMapper.updateById(work);
@ -445,20 +450,15 @@ public class MailService extends ServiceImpl<MailMapper, Mail> {
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<Work>().eq(Work::getMailId, mailId.getId()));
if (StrUtil.isNotBlank(handleDetailReq.getVerifyDetails())) {
mail.setVerifyDetails(handleDetailReq.getVerifyDetails());
}
}
return true;
return updateById(mail);
}
}

7
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<DictType>().eq(DictType::getDictType, dataType));
return dictDataMapper.selectOne(new LambdaQueryWrapper<DictData>().eq(DictData::getTypeId, dictType.getId()).eq(DictData::getValue, value));
}
/**
* 字典数据新增
*

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

2
mailbox-outer-admin/pom.xml

@ -60,7 +60,7 @@
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>mailbox-common</artifactId>
</dependency>

1
pom.xml

@ -123,6 +123,7 @@
<configuration>
<compilerArgument>-parameters</compilerArgument>
</configuration>
<version></version>
</plugin>
</plugins>

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

Loading…
Cancel
Save