Browse Source

1、办事指南调整
2、我的承办初始化

dzx 7 months ago
parent
commit
d58a8dcd1c

+ 2 - 21
src/main/java/com/xjrsoft/module/oa/controller/OfficialDocumentReceivedHandleController.java

@@ -2,29 +2,22 @@ package com.xjrsoft.module.oa.controller;
 
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.oa.dto.AddOfficialDocumentReceivedHandleDto;
 import com.xjrsoft.module.oa.dto.AddOfficialDocumentReceivedHandleDto;
 import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto;
 import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto;
 import com.xjrsoft.module.oa.dto.UpdateOfficialDocumentReceivedHandleDto;
 import com.xjrsoft.module.oa.dto.UpdateOfficialDocumentReceivedHandleDto;
-import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
 import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedHandleService;
 import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedHandleService;
 import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
 import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
 import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo;
 import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo;
 import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandleVo;
 import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandleVo;
-import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
-import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -57,19 +50,7 @@ public class OfficialDocumentReceivedHandleController {
     @SaCheckPermission("officialdocumentreceivedhandle:detail")
     @SaCheckPermission("officialdocumentreceivedhandle:detail")
     @XjrLog(value = "公文收文-承办表列表(分页)")
     @XjrLog(value = "公文收文-承办表列表(分页)")
     public RT<PageOutput<OfficialDocumentReceivedHandlePageVo>> page(@Valid OfficialDocumentReceivedHandlePageDto dto){
     public RT<PageOutput<OfficialDocumentReceivedHandlePageVo>> page(@Valid OfficialDocumentReceivedHandlePageDto dto){
-
-        MPJLambdaWrapper<OfficialDocumentReceived> queryWrapper = new MPJLambdaWrapper<>();
-        queryWrapper
-                .select(OfficialDocumentReceived::getId)
-                .select(OfficialDocumentReceived.class,x -> VoToColumnUtil.fieldsToColumns(OfficialDocumentReceived.class).contains(x.getProperty()))
-                .innerJoin(WorkflowFormRelation.class, WorkflowFormRelation::getFormKeyValue, OfficialDocumentReceived::getId)
-                .eq(WorkflowFormRelation::getCurrentState, HistoricProcessInstance.STATE_COMPLETED)
-                .eq(StrUtil.isNotEmpty(dto.getReceivedType()), OfficialDocumentReceived::getReceivedType, dto.getReceivedType())
-                .like(StrUtil.isNotEmpty(dto.getReceivedTitle()), OfficialDocumentReceived::getReceivedTitle, dto.getReceivedTitle())
-                .eq(ObjectUtil.isNotNull(dto.getIsHandle()), OfficialDocumentReceived::getIsHandle, dto.getIsHandle())
-                .eq(ObjectUtil.isNotNull(dto.getIsHandle()), OfficialDocumentReceived::getIsHandle, dto.getIsHandle())
-                .orderByDesc(OfficialDocumentReceived::getId);
-        IPage<OfficialDocumentReceived> page = officialDocumentReceivedService.page(ConventPage.getPage(dto), queryWrapper);
+        Page<OfficialDocumentReceivedHandlePageVo> page = officialDocumentReceivedHandleService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<OfficialDocumentReceivedHandlePageVo> pageOutput = ConventPage.getPageOutput(page, OfficialDocumentReceivedHandlePageVo.class);
         PageOutput<OfficialDocumentReceivedHandlePageVo> pageOutput = ConventPage.getPageOutput(page, OfficialDocumentReceivedHandlePageVo.class);
         return RT.ok(pageOutput);
         return RT.ok(pageOutput);
     }
     }

+ 20 - 0
src/main/java/com/xjrsoft/module/oa/dto/OfficialDocumentReceivedHandlePageDto.java

@@ -4,6 +4,9 @@ import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
 
 
 
 
 /**
 /**
@@ -30,4 +33,21 @@ public class OfficialDocumentReceivedHandlePageDto extends PageInput {
 
 
     @ApiModelProperty("落实负责人")
     @ApiModelProperty("落实负责人")
     private String handleDutyUserName;
     private String handleDutyUserName;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("收文日期-开始")
+    private LocalDate receivedDateStart;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("收文日期-结束")
+    private LocalDate receivedDateEnd;
+
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("落实日期-开始")
+    private LocalDate handleDateStart;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty("落实日期-结束")
+    private LocalDate handleDateEnd;
 }
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/oa/mapper/OfficialDocumentReceivedHandleMapper.java

@@ -1,8 +1,12 @@
 package com.xjrsoft.module.oa.mapper;
 package com.xjrsoft.module.oa.mapper;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
 * @title: 公文收文-承办表
 * @title: 公文收文-承办表
@@ -13,4 +17,5 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 @Mapper
 public interface OfficialDocumentReceivedHandleMapper extends MPJBaseMapper<OfficialDocumentReceivedHandle> {
 public interface OfficialDocumentReceivedHandleMapper extends MPJBaseMapper<OfficialDocumentReceivedHandle> {
 
 
+    Page<OfficialDocumentReceivedHandlePageVo> getPage(Page<OfficialDocumentReceivedHandlePageVo> page, @Param("dto") OfficialDocumentReceivedHandlePageDto dto);
 }
 }

+ 6 - 0
src/main/java/com/xjrsoft/module/oa/service/IOfficialDocumentReceivedHandleService.java

@@ -1,7 +1,11 @@
 package com.xjrsoft.module.oa.service;
 package com.xjrsoft.module.oa.service;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
 * @title: 公文收文-承办表
 * @title: 公文收文-承办表
@@ -11,4 +15,6 @@ import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
 */
 */
 
 
 public interface IOfficialDocumentReceivedHandleService extends MPJBaseService<OfficialDocumentReceivedHandle> {
 public interface IOfficialDocumentReceivedHandleService extends MPJBaseService<OfficialDocumentReceivedHandle> {
+
+    Page<OfficialDocumentReceivedHandlePageVo> getPage(Page<OfficialDocumentReceivedHandlePageVo> page, OfficialDocumentReceivedHandlePageDto dto);
 }
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/oa/service/impl/NewsServiceImpl.java

@@ -544,6 +544,9 @@ public class NewsServiceImpl extends MPJBaseServiceImpl<NewsMapper, News> implem
             news.setStatus(2);
             news.setStatus(2);
         }
         }
 
 
+        news.setCreateDate(LocalDateTime.now());
+        news.setCreateUserId(StpUtil.getLoginIdAsLong());
+
         newsMapper.insert(news);
         newsMapper.insert(news);
         //添加附件子表
         //添加附件子表
         if (addNewsDto.getAppendixList() != null) {
         if (addNewsDto.getAppendixList() != null) {

+ 7 - 0
src/main/java/com/xjrsoft/module/oa/service/impl/OfficialDocumentReceivedHandleServiceImpl.java

@@ -1,9 +1,12 @@
 package com.xjrsoft.module.oa.service.impl;
 package com.xjrsoft.module.oa.service.impl;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
 import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
 import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedHandleMapper;
 import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedHandleMapper;
 import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedHandleService;
 import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedHandleService;
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -16,4 +19,8 @@ import org.springframework.stereotype.Service;
 @Service
 @Service
 @AllArgsConstructor
 @AllArgsConstructor
 public class OfficialDocumentReceivedHandleServiceImpl extends MPJBaseServiceImpl<OfficialDocumentReceivedHandleMapper, OfficialDocumentReceivedHandle> implements IOfficialDocumentReceivedHandleService {
 public class OfficialDocumentReceivedHandleServiceImpl extends MPJBaseServiceImpl<OfficialDocumentReceivedHandleMapper, OfficialDocumentReceivedHandle> implements IOfficialDocumentReceivedHandleService {
+    @Override
+    public Page<OfficialDocumentReceivedHandlePageVo> getPage(Page<OfficialDocumentReceivedHandlePageVo> page, OfficialDocumentReceivedHandlePageDto dto) {
+        return this.getPage(page, dto);
+    }
 }
 }

+ 15 - 3
src/main/resources/mapper/oa/OfficialDocumentReceivedHandleMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedMapper">
+<mapper namespace="com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedHandleMapper">
     <select id="getPage" resultType="com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto" parameterType="com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo">
     <select id="getPage" resultType="com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto" parameterType="com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo">
         SELECT DISTINCT t1.id, t6.name AS received_type_cn, t1.received_title,t1.received_number,
         SELECT DISTINCT t1.id, t6.name AS received_type_cn, t1.received_title,t1.received_number,
         t1.received_date,t1.communication_org,t1.communication_number,t3.name AS handle_duty_user_name,
         t1.received_date,t1.communication_org,t1.communication_number,t3.name AS handle_duty_user_name,
@@ -25,8 +25,20 @@
         <if test="dto.handleDutyUserName != null and dto.handleDutyUserName != ''">
         <if test="dto.handleDutyUserName != null and dto.handleDutyUserName != ''">
             AND t3.name like concat('%', #{dto.handleDutyUserName},'%')
             AND t3.name like concat('%', #{dto.handleDutyUserName},'%')
         </if>
         </if>
-        <if test="dto.handleDutyUserName != null and dto.handleDutyUserName != ''">
-            AND t3.name like concat('%', #{dto.handleDutyUserName},'%')
+        <if test="dto.receivedTitle != null and dto.receivedTitle != ''">
+            AND t1.received_title like concat('%', #{dto.receivedTitle},'%')
+        </if>
+        <if test="dto.isHandle != null">
+            AND t1.is_handle = #{dto.isHandle}
+        </if>
+        <if test="dto.receivedType != null and dto.receivedType != ''">
+            AND t1.received_type like concat('%', #{dto.receivedType},'%')
+        </if>
+        <if test="dto.receivedDateStart != null and dto.receivedDateEnd != ''">
+            AND t1.received_date between and #{dto.receivedDateStart} and #{dto.receivedDateEnd}
+        </if>
+        <if test="dto.handleDateStart != null and dto.handleDateEnd != ''">
+            AND DATE_FORMAT(t1.handle_time, '%Y-%m-%d') between and #{dto.handleDateStart} and #{dto.handleDateEnd}
         </if>
         </if>
         order by t1.id desc
         order by t1.id desc
     </select>
     </select>