diff --git a/mailbox-common/src/main/java/com/biutag/util/TimeUtils.java b/mailbox-common/src/main/java/com/biutag/util/TimeUtils.java index 542176f..7c10d0a 100644 --- a/mailbox-common/src/main/java/com/biutag/util/TimeUtils.java +++ b/mailbox-common/src/main/java/com/biutag/util/TimeUtils.java @@ -535,4 +535,18 @@ public class TimeUtils { // long sec = diff % nd % nh % nm / ns; return day + "天" + hour + "小时" + min + "分钟"; } + + + public static String secondsToTime(int seconds){ + int h=seconds/3600; //小时 + int m=(seconds%3600)/60; //分钟 + int s=(seconds%3600)%60; //秒 + if(h>0){ + return h+"小时"+m+"分钟"+s+"秒"; + } + if(m>0){ + return m+"分钟"+s+"秒"; + } + return s+"秒"; + } } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java index c53b4de..566f159 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java @@ -1,15 +1,19 @@ package com.biutag.lan.controller.datascreen; import com.biutag.aop.NotLogin; +import com.biutag.aop.NotPower; import com.biutag.core.AjaxResult; import com.biutag.entity.system.Duty; import com.biutag.enums.DeptTypeEnum; import com.biutag.lan.AdminThreadLocal; import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.MailSource; +import com.biutag.lan.domain.vo.MailDetail; +import com.biutag.lan.domain.vo.MailFlowDetail; import com.biutag.lan.service.DataScreenService; import com.biutag.lan.service.IDutyService; import com.biutag.lan.service.IIndexService; +import com.biutag.lan.service.MailService; import com.biutag.util.DateUtils; import com.biutag.util.StringUtils; import com.google.gson.JsonObject; @@ -17,10 +21,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.*; @@ -35,8 +36,8 @@ public class DataScreenController { DataScreenService dataScreenService; @Resource IDutyService iDutyService; - - + @Resource + MailService mailService; @NotLogin @GetMapping("/mapData") @ApiOperation(value="大屏地图数据") @@ -123,4 +124,10 @@ public class DataScreenController { + @NotPower + @GetMapping("getMailDetail") + public AjaxResult getMailDetail(@RequestParam Map params) { + return AjaxResult.success(dataScreenService.getMailDetail(params)); + } + } 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 new file mode 100644 index 0000000..2929cfa --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/MailDetail.java @@ -0,0 +1,288 @@ +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; +import java.util.Map; + + +@Setter +@Getter +public class MailDetail { + + + private String id; + + /** + * 联系人姓名 + */ + private String contactName; + /** + * 联系人性别 M / F + */ + private String contactSex; + /** + * 联系人身份证号码 + */ + private String contactIdCard; + /** + * 联系人手机号 + */ + private String contactPhone; + /** + * 案件编号 + */ + private String caseNumber; + /** + * 内容 + */ + private String content; + /** + * 附件 + */ + private String attachments; + /** + * 创建时间 + */ + private LocalDateTime createTime; + /** + * 更新时间 + */ + private LocalDateTime updateTime; + /** + * 来信时间 + */ + private LocalDateTime mailTime; + /** + * 来源 + */ + private String source; + + /** + * 满意读(群众) + */ + private String satisfaction; + + /*-------------------------------*/ + + /** + * 信件状态 + */ + private String mailState; + /** + * 信件当前流程 + */ + private String flowKey; + /** + * 信件当前流程节点 + */ + private String flowBeforeName; + + /** + * 流程限时最后操作时间 + */ + private LocalDateTime flowLimitedLastHandlerTime; + + /** + * 信件源数据ID (多个) + */ + private String mailSourceId; + + /** + * 信件类名 + */ + private String mailCategory; + /** + * 信件一级类目 + */ + private String mailFirstCategory; + /** + * 信件二级类目 + */ + private String mailSecondCategory; + /** + * 信件三级类目 + */ + private String mailThreeCategory; + /** + * 信件等级 + */ + private String mailLevel; + + /** + * 二级单位ID(主责) + */ + private Integer secondDeptId; + + private String secondDeptName; + + /** + * 三级单位ID(主责) + */ + private Integer threeDeptId; + + private String threeDeptName; + + /** + * 协办核查民警(String) + */ + private String coHandlingPolices; + /** + * 联系民警名称 + */ + private String contactPoliceName; + /** + * 联系民警 + */ + private String contactPoliceEmpNo; + /** + * 联系群众时间 + */ + private LocalDateTime contactTime; + /** + * 联系时长(秒) + */ + private String contactDuration; + /** + * 延期日期 + */ + private LocalDateTime extensionDate; + /** + * 是否联系群众 + */ + private String contactFlag; + /** + * 是否申请延期 + */ + private Boolean extensionFlag; + /** + * 接访形式 + */ + private String interviewType; + /** + * 是否领导接访 + */ + private Boolean interviewIsLeader; + /** + * 接访人员警号 + */ + private String interviewPoliceEmpNo; + /** + * 接访人员姓名 + */ + private String interviewPoliceName; + /** + * 接访情况 + */ + private String interviewDetails; + /** + * 接访附件(佐证材料) + */ + private String interviewAttachments; + /** + * 核办情况 + */ + private String verifyDetails; + /** + * 核办-是否属实 + */ + private String verifyIsTrue; + /** + * 核办-被举报对象(json) + */ + private String verifyReportedPolices; + /** + * 核办-查证属实问题(json) + */ + private String verifyProblem; + /** + * 核办-是否需要问责 + */ + private Boolean verifyNeedAccountability; + /** + * 核办-责任追究(json) + */ + private String verifyPunish; + + /** + * 核办-群众反映事项解决情况(是否已解决) + */ + private Boolean verifyIsResolved; + + /** + * 核办-办理反馈情况 + */ + private String verifyFeedback; + + /** + * 核办-回访人信息(String) + */ + private String verifyFollowupPolice; + + /** + * 核办-附件(上传佐证) + */ + private String verifyAttachments; + + /** + * 办结方式 + */ + private String completeMethod; + + /** + * 办理合格情况 + */ + private String qualifiedProcessingStatus; + + /** + * 问题解决情况 + */ + private Boolean problemSolvingStatus; + + /** + * 群众回复情况 + */ + private String satisfactionStatus; + + + /** + * 认定办结意见 + */ + private String completionComment; + + /** + * 是否是简易流程 + */ + private Boolean simpleFlowFlag; + + + + private List verifyPoliceList; + + //二级机构签收时长 + private Integer signDuration; + + private String signDurationStr; + //二级机构签收限制时长 + private Integer limitedDuration; + + + //三级机构联系时长 + private Integer contactMassesDuration; + private String contactMassesDurationStr; + //二级机构签收限制时长 + private Integer contactLimitedDuration; + + + private String followName; + private String followMobile; + private String followEmpNo; + + + private List mailFlowList; +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java index 47c5a07..cc18e9b 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataScreenMapper.java @@ -8,6 +8,7 @@ import com.biutag.entity.system.Duty; import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.MailSource; import com.biutag.lan.domain.Work; +import com.biutag.lan.domain.vo.MailDetail; import com.biutag.lan.domain.vo.WorkVo; import org.apache.ibatis.annotations.Param; @@ -141,4 +142,14 @@ public interface DataScreenMapper extends BaseMapper { List getToDayDuty(@Param("depatType") String depatType,@Param("deptId") String deptId); + + + MailDetail getMailDetail(Map params); + + + Map getVerifyPolice(Map params); + + + //获取流程时长 + Map getDuration(@Param("mailId") String mailId,@Param("flowKey") String flowKey); } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java index 9252fba..63bf6f1 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/DataScreenService.java @@ -1,17 +1,28 @@ package com.biutag.lan.service; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.entity.system.Duty; import com.biutag.enums.DeptTypeEnum; import com.biutag.lan.domain.Mail; +import com.biutag.lan.domain.MailFlow; +import com.biutag.lan.domain.vo.MailDetail; +import com.biutag.lan.flow.FlowNodeEnum; import com.biutag.lan.mapper.DataScreenMapper; import com.biutag.util.DateUtils; import com.biutag.util.StringUtils; +import com.biutag.util.TimeUtils; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; import com.google.gson.Gson; +import com.google.gson.JsonElement; import com.google.gson.JsonObject; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; - +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.*; import java.util.concurrent.atomic.AtomicReference; @@ -20,6 +31,8 @@ import java.util.concurrent.atomic.AtomicReference; public class DataScreenService extends ServiceImpl { + + private final MailFlowService mailFlowService; public List> mapData(String deptId){ return baseMapper.mapData(deptId); } @@ -231,4 +244,46 @@ public class DataScreenService extends ServiceImpl { } return map; } + + + public MailDetail getMailDetail(Map params){ + MailDetail mailDetail= baseMapper.getMailDetail(params); + if(StringUtils.isNotNull(mailDetail.getVerifyFollowupPolice())){ + String verifyReportedPolicesJSON=mailDetail.getVerifyReportedPolices(); + JSONArray jsonArray= JSONArray.parse(verifyReportedPolicesJSON); + List mapList=new ArrayList<>(); + if (jsonArray.size() > 0) { + for (int i = 0; i < jsonArray.size(); i++) { + Map mapPolice = JSON.parseObject(jsonArray.get(i).toString()); + mapList.add(baseMapper.getVerifyPolice(mapPolice)) ; + } + } + mailDetail.setVerifyPoliceList(mapList); + } + //获取主单位签收时长 + Map signMap = baseMapper.getDuration(mailDetail.getId(), FlowNodeEnum.SECOND_SIGN.getKey()); + if(signMap.size()>0) { + mailDetail.setSignDuration(signMap.get("consuming_time")); + mailDetail.setSignDuration(signMap.get("limited_time")); + mailDetail.setSignDurationStr(TimeUtils.secondsToTime(signMap.get("consuming_time"))); + } + //获取三级机构联系群众时长 + Map contactMap = baseMapper.getDuration(mailDetail.getId(), FlowNodeEnum.CONTACT_WRITER.getKey()); + if(contactMap.size()>0) { + mailDetail.setContactMassesDuration(contactMap.get("consuming_time")); + mailDetail.setContactLimitedDuration(contactMap.get("limited_time")); + mailDetail.setContactMassesDurationStr(TimeUtils.secondsToTime(contactMap.get("consuming_time"))); + } + + if(StringUtils.isNotNull(mailDetail.getVerifyFollowupPolice())){ + String verifyFollowupPolice=mailDetail.getVerifyFollowupPolice(); + JSONObject mapPolice = JSON.parseObject(verifyFollowupPolice); + mailDetail.setFollowName(mapPolice.getString("name")); + mailDetail.setFollowMobile(mapPolice.getString("phone")); + mailDetail.setFollowEmpNo(mapPolice.getString("empNo")); + } + + mailDetail.setMailFlowList( mailFlowService.listOrderByCreateTimeDesc( mailDetail.getId())); + return mailDetail; + } } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/MailFlowService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/MailFlowService.java index f234dfb..a388e0e 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/MailFlowService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/MailFlowService.java @@ -29,4 +29,9 @@ public class MailFlowService extends ServiceImpl { return list.get(list.size() - 1).getCreateTime(); } + + public List listOrderByCreateTimeDesc(String mailId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(MailFlow::getMailId, mailId).orderByDesc(MailFlow::getCreateTime); + return list(queryWrapper); + } } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java index 0b73df3..80271d1 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/impl/DutyServiceImpl.java @@ -68,7 +68,7 @@ public class DutyServiceImpl implements IDutyService { queryWrapper.orderByDesc("create_time"); - if(StringUtils.isNotEmpty(searchValidate.getSearchTime()) ) { + if(StringUtils.isNotNull(searchValidate.getSearchTime())&& !"null".equals(searchValidate.getSearchTime())) { dutyMapper.setSearch(queryWrapper, searchValidate, new String[]{ "like:departName@depart_name:str", "like:policeName@police_name:str", 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 75eff03..40c08a0 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 @@ -47,7 +47,7 @@ public class HolidayServiceImpl implements IHolidayService { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.orderByDesc("id"); - if(StringUtils.isNotEmpty(searchValidate.getSearchDate()) ) { + if(StringUtils.isNotNull(searchValidate.getSearchDate())&& !"null".equals(searchValidate.getSearchDate())) { holidayMapper.setSearch(queryWrapper, searchValidate, new String[]{ "like:holidayName@holiday_name:str", "<=:searchDate@start_date:str", diff --git a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml index 169c238..e0b3a7d 100644 --- a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml +++ b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml @@ -209,5 +209,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY d.name,a.id + + + +