diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/DataController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/DataController.java new file mode 100644 index 0000000..ced620c --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/DataController.java @@ -0,0 +1,47 @@ +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.enums.RoleEnum; +import com.biutag.lan.config.AdminThreadLocal; +import com.biutag.lan.domain.Notice; +import com.biutag.lan.domain.Work; +import com.biutag.lan.domain.bo.MailQuery; +import com.biutag.lan.domain.vo.DataVo; +import com.biutag.lan.domain.vo.NoticeTotalVo; +import com.biutag.lan.domain.vo.NoticeVo; +import com.biutag.lan.domain.vo.WorkVo; +import com.biutag.lan.flow.FlowNameEnum; +import com.biutag.lan.service.DataService; +import com.biutag.lan.service.NoticeService; +import com.biutag.lan.service.WorkService; +import com.biutag.lan.validate.system.DataSearchValidate; +import com.biutag.lan.validate.system.NoticeSearchValidate; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@RequiredArgsConstructor +@RequestMapping("/api/data") +@RestController +public class DataController { + + + + private final DataService dataService; + + @NotPower + @GetMapping("list") + public AjaxResult>> list(Page page, @Validated DataSearchValidate searchValidate) { + Page> list = dataService.list(page, searchValidate); + return AjaxResult.success(list); + } + +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java index 4846a08..a4139b2 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/system/DeptController.java @@ -5,6 +5,7 @@ import com.biutag.aop.NotPower; import com.biutag.core.AjaxResult; import com.biutag.entity.system.Dept; import com.biutag.entity.system.Duty; +import com.biutag.lan.domain.vo.EasyDeptVO; import com.biutag.lan.service.IDeptService; import com.biutag.lan.validate.commons.IdValidate; import com.biutag.lan.validate.system.DeptCreateValidate; @@ -18,6 +19,8 @@ import jakarta.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -129,4 +132,20 @@ public class DeptController { return AjaxResult.success(iDeptService.getDuty()); } + @NotPower + @GetMapping("/Easylist") + @ApiOperation(value="简易部门列表") + public AjaxResult> Easylist() { + List list = new ArrayList<>(); + EasyDeptVO easyDeptVO1 = new EasyDeptVO(); + easyDeptVO1.setId(1); + easyDeptVO1.setLabelName("市局"); + list.add(easyDeptVO1); + EasyDeptVO easyDeptVO2 = new EasyDeptVO(); + easyDeptVO2.setId(2); + easyDeptVO2.setLabelName("二级机构"); + list.add(easyDeptVO2); + return AjaxResult.success(list); + } + } diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/DataVo.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/DataVo.java new file mode 100644 index 0000000..36e4400 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/DataVo.java @@ -0,0 +1,46 @@ +package com.biutag.lan.domain.vo; + + +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(chain = true) +@Setter +@Getter +public class DataVo { + private static final long serialVersionUID = 1L; + + private String cname; + + private String cratenumber; + + private String crate; + + private String completed; + + private String csum; + + private String rname; + + private String resolved; + + private String rsum; + + private String ratenumber; + + private String rate; + + private String sname; + + private String satisfied; + + private String sum; + + private String sratenumber; + + private String srate; + + private String score; + +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/EasyDeptVO.java b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/EasyDeptVO.java new file mode 100644 index 0000000..6a564b9 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/domain/vo/EasyDeptVO.java @@ -0,0 +1,20 @@ +package com.biutag.lan.domain.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@ApiModel("简易deptVO") +public class EasyDeptVO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + private Integer id; + + + @ApiModelProperty(value = "名称") + private String labelName; +} diff --git a/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataMapper.java b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataMapper.java new file mode 100644 index 0000000..f118bc8 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/mapper/DataMapper.java @@ -0,0 +1,24 @@ +package com.biutag.lan.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.entity.system.Duty; +import com.biutag.lan.domain.Mail; +import com.biutag.lan.domain.vo.DataVo; +import com.biutag.lan.domain.vo.MailDetail; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +public interface DataMapper extends BaseMapper { + + + List> getFirstAllList(@Param("searchStartTime") String searchStartTime,@Param("searchEndTime") String searchEndTime); + + List> getSecondList(Page page,@Param("searchStartTime") String searchStartTime,@Param("searchEndTime") String searchEndTime); + + List> getThirdList(Page page,@Param("searchStartTime") String searchStartTime,@Param("searchEndTime") String searchEndTime,@Param("deptId") String deptId); + +} + diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/DataService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/DataService.java new file mode 100644 index 0000000..830aaa9 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/DataService.java @@ -0,0 +1,85 @@ +package com.biutag.lan.service; +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.constants.AppConstants; +import com.biutag.enums.RoleEnum; +import com.biutag.lan.config.AdminThreadLocal; +import com.biutag.lan.domain.*; +import com.biutag.lan.domain.vo.DataVo; +import com.biutag.lan.domain.vo.NoticeVo; +import com.biutag.lan.mapper.*; +import com.biutag.lan.validate.system.DataSearchValidate; +import com.biutag.lan.validate.system.NoticeSearchValidate; +import com.biutag.mapper.setting.DictDataMapper; +import com.biutag.mapper.system.DeptMapper; +import jakarta.annotation.Resource; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import java.time.format.DateTimeFormatter; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + + +@RequiredArgsConstructor +@Service +public class DataService extends ServiceImpl { + + + + @Resource + private DataMapper dataMapper; + + public Page> list(Page page, @Validated DataSearchValidate searchValidate){ + List> combinedList = null; + List> mapfirst = null; + List> mapSecond = null; + List> mapThird = null; + if (searchValidate.getEasydept()==null||!searchValidate.getEasydept().equals("2")){ + if (searchValidate.getSearchTime()!=null){ + mapfirst = dataMapper.getFirstAllList(searchValidate.getSearchStartTime(),searchValidate.getSearchEndTime()); + mapSecond = dataMapper.getSecondList(page,searchValidate.getSearchStartTime(),searchValidate.getSearchEndTime()); + }else { + mapfirst = dataMapper.getFirstAllList(null,null); + mapSecond = dataMapper.getSecondList(page,null,null); + } + combinedList = Stream.concat(mapfirst.stream(), mapSecond.stream()) + .collect(Collectors.toList()); + }else if (searchValidate.getEasydept()!=null&&searchValidate.getEasydept().equals("2")){ + if (searchValidate.getSdept()!=null){ + if (searchValidate.getSearchTime()!=null){ + mapThird = dataMapper.getThirdList(page,searchValidate.getSearchStartTime(),searchValidate.getSearchEndTime(),searchValidate.getSdept()); + }else { + mapThird = dataMapper.getThirdList(page,null,null,searchValidate.getSdept()); + } + combinedList = mapThird; + }else{ + if (searchValidate.getSearchTime()!=null){ + mapfirst = dataMapper.getFirstAllList(searchValidate.getSearchStartTime(),searchValidate.getSearchEndTime()); + mapSecond = dataMapper.getSecondList(page,searchValidate.getSearchStartTime(),searchValidate.getSearchEndTime()); + }else { + mapfirst = dataMapper.getFirstAllList(null,null); + mapSecond = dataMapper.getSecondList(page,null,null); + } + combinedList = Stream.concat(mapfirst.stream(), mapSecond.stream()) + .collect(Collectors.toList()); + } + } + Page> dataVoPage = new Page<>(); + dataVoPage.setRecords(combinedList); + dataVoPage.setTotal(page.getTotal()); + dataVoPage.setCurrent(page.getCurrent()); + dataVoPage.setSize(page.getSize()); + dataVoPage.setPages(page.getPages()); + return dataVoPage; + } + + + +} \ No newline at end of file diff --git a/mailbox-lan/src/main/java/com/biutag/lan/validate/system/DataSearchValidate.java b/mailbox-lan/src/main/java/com/biutag/lan/validate/system/DataSearchValidate.java new file mode 100644 index 0000000..d060892 --- /dev/null +++ b/mailbox-lan/src/main/java/com/biutag/lan/validate/system/DataSearchValidate.java @@ -0,0 +1,30 @@ +package com.biutag.lan.validate.system; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +@ApiModel("通知搜素参数") +public class DataSearchValidate implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "搜索时间") + private String searchTime; + + @ApiModelProperty(value = "搜索时间") + private String searchStartTime; + + @ApiModelProperty(value = "搜索时间") + private String searchEndTime; + + @ApiModelProperty(value = "机构level") + private String easydept; + + @ApiModelProperty(value = "二级机构id") + private String sdept; + +} diff --git a/mailbox-lan/src/main/resources/mapper/DataMapper.xml b/mailbox-lan/src/main/resources/mapper/DataMapper.xml new file mode 100644 index 0000000..024c562 --- /dev/null +++ b/mailbox-lan/src/main/resources/mapper/DataMapper.xml @@ -0,0 +1,185 @@ + + + + + + + + + + +