浏览代码

1.修复误删文件

lirui 3 年之前
父节点
当前提交
2d11edb943
共有 16 个文件被更改,包括 1447 次插入0 次删除
  1. 95 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/domain/DmInformation.java
  2. 57 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/repository/DmInformationRepository.java
  3. 123 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/rest/DmInformationController.java
  4. 113 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/DmInformationService.java
  5. 81 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/dto/DmInformationDto.java
  6. 41 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/dto/DmInformationQueryCriteria.java
  7. 287 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/impl/DmInformationServiceImpl.java
  8. 32 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/mapstruct/DmInformationMapper.java
  9. 83 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/domain/DmInformationApproval.java
  10. 60 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/repository/DmInformationApprovalRepository.java
  11. 87 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/rest/DmInformationApprovalController.java
  12. 100 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/DmInformationApprovalService.java
  13. 72 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/dto/DmInformationApprovalDto.java
  14. 49 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/dto/DmInformationApprovalQueryCriteria.java
  15. 135 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/impl/DmInformationApprovalServiceImpl.java
  16. 32 0
      eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/mapstruct/DmInformationApprovalMapper.java

+ 95 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/domain/DmInformation.java

@@ -0,0 +1,95 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import me.zhengjie.base.BaseEntity;
+import me.zhengjie.modules.dm.user.domain.DmUser;
+
+import javax.persistence.*;
+import javax.validation.constraints.*;
+import java.sql.Timestamp;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author xwx
+* @date 2021-04-22
+**/
+@Entity
+@Data
+@Table(name="dm_information")
+public class DmInformation extends BaseEntity implements Serializable {
+
+    @Id
+    @Column(name = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @Column(name = "content")
+    @ApiModelProperty(value = "发布内容(需发布的信息内容)")
+    private String content;
+
+    @Column(name = "status")
+    @ApiModelProperty(value = "(00-待审核  01-审批通过(已发布) 02-审核未通过)")
+    private String status;
+
+    @Column(name = "approval_remark")
+    @ApiModelProperty(value = "审批备注")
+    private String approvalRemark;
+
+    @ApiModelProperty(value = "审批人")
+    @OneToOne
+    @JoinColumn(name = "approval_user")
+    private DmUser approvalUser;
+
+    @Column(name = "is_has_approval")
+    @ApiModelProperty(value = "是否添加审批人")
+    private Boolean isHasApproval ;
+
+    @Column(name = "task_id")
+    @ApiModelProperty(value = "任务ID act_ru_task")
+    private String taskId;
+
+    @Column(name = "proc_inst_id")
+    @ApiModelProperty(value = "任务实例id act_ru_execution")
+    private String procInstId;
+
+    @OneToOne
+    @JoinColumn(name = "request_user")
+    @ApiModelProperty(value = "发起人")
+    private DmUser requestUser;
+
+    @Column(name = "release_time")
+    @ApiModelProperty(value = "发布时间")
+    private Timestamp releaseTime;
+
+    @Column(name = "approval_time")
+    @ApiModelProperty(value = "审批时间")
+    private Timestamp approvalTime;
+
+    @Transient
+    private List<DmUser> approvalUserList;
+
+    public void copy(DmInformation source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}

+ 57 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/repository/DmInformationRepository.java

@@ -0,0 +1,57 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.repository;
+
+import me.zhengjie.modules.dm.information.domain.DmInformation;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationDto;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationQueryCriteria;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-22
+**/
+public interface DmInformationRepository extends JpaRepository<DmInformation, Long>, JpaSpecificationExecutor<DmInformation> {
+
+    @Modifying
+    @Query(value = "update dm_information set task_id =:#{#resources.taskId} ,proc_inst_id =:#{#resources.procInstId} where id =:#{#resources.id} ",nativeQuery = true )
+    void updateTask(@Param(value = "resources") DmInformation resources);
+
+    @Query(value = "select GROUP_CONCAT(DISTINCT(approval_user)) as userIds from dm_information_approval where is_new = '1' and info_id = ?1 ",nativeQuery = true )
+    Map<String,Object> selectInfoApproveUserNames(Long id);
+
+    @Modifying
+    @Query(value = "update dm_information set status = '00' ,approval_user = null,approval_remark=null where id = ?1 ",nativeQuery = true )
+    void reset(Long id);
+
+    @Query(value = "select status from dm_information where id = ?1",nativeQuery = true)
+    String findSubmitBeforeStatus(Long id);
+
+    @Query(value = "select a.*  from  dm_information a left join dm_information_approval b on a.id= b.info_id where b.is_new = 1 and  b.approval_user = ?1 and a.status = '00' group by a.id",
+            countQuery = "select count(*) from (select a.* from dm_information a left join dm_information_approval b on a.id= b.info_id where b.is_new = 1 and  b.approval_user = ?1 and a.status = '00' group by a.id)",
+            nativeQuery = true)
+    Page<DmInformation> findAllDSP(String approval_user, Pageable pageable);
+}

+ 123 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/rest/DmInformationController.java

@@ -0,0 +1,123 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.rest;
+
+import me.zhengjie.annotation.Log;
+import me.zhengjie.modules.dm.information.domain.DmInformation;
+import me.zhengjie.modules.dm.information.service.DmInformationService;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-22
+**/
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "dmInformation管理")
+@RequestMapping("/api/dmInformation")
+public class DmInformationController {
+
+    private final DmInformationService dmInformationService;
+
+    @Log("导出数据")
+    @ApiOperation("导出数据")
+    @GetMapping(value = "/download")
+    @PreAuthorize("@el.check('dmInformation:list')")
+    public void download(HttpServletResponse response, DmInformationQueryCriteria criteria) throws IOException {
+        dmInformationService.download(dmInformationService.queryAll(criteria), response);
+    }
+
+    @GetMapping
+    @Log("查询dmInformation")
+    @ApiOperation("查询dmInformation")
+    @PreAuthorize("@el.check('dmInformation:list')")
+    public ResponseEntity<Object> query(DmInformationQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity<>(dmInformationService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @GetMapping(value = "approvalList")
+    @Log("查询dmInformation")
+    @ApiOperation("查询dmInformation")
+    @PreAuthorize("@el.check('dmInformation:list')")
+    public ResponseEntity<Object> approvalList(DmInformationQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity<>(dmInformationService.findAllDSP(pageable),HttpStatus.OK);
+    }
+
+    @PostMapping
+    @Log("新增dmInformation")
+    @ApiOperation("新增dmInformation")
+    @PreAuthorize("@el.check('dmInformation:add')")
+    public ResponseEntity<Object> create(@Validated @RequestBody DmInformation resources){
+        return new ResponseEntity<>(dmInformationService.create(resources),HttpStatus.CREATED);
+    }
+
+    @PostMapping(value = "/addApprovalUser")
+    @Log("新增审批人")
+    @ApiOperation("新增审批人")
+    @PreAuthorize("@el.check('dmInformation:edit')")
+    public ResponseEntity<Object> addApprovalUser(@Validated @RequestBody DmInformation resources){
+        dmInformationService.addApprovalUser(resources);
+        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除dmInformation")
+    @ApiOperation("删除dmInformation")
+    @PreAuthorize("@el.check('dmInformation:del')")
+    @DeleteMapping
+    public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
+        dmInformationService.deleteAll(ids);
+        return new ResponseEntity<>(HttpStatus.OK);
+    }
+
+    @PutMapping
+    @Log("修改dmInformation")
+    @ApiOperation("修改dmInformation")
+    @PreAuthorize("@el.check('dmInformation:edit')")
+    public ResponseEntity<Object> update(@Validated @RequestBody DmInformation resources){
+        dmInformationService.update(resources);
+        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+    }
+
+    @PostMapping(value = "/approval")
+    @Log("审批")
+    @ApiOperation("审批")
+    public ResponseEntity<Object> Approval(@RequestBody DmInformation resources){
+        dmInformationService.approval(resources);
+        return new ResponseEntity<>("审批完成",HttpStatus.OK);
+
+
+    }
+
+    @Log("撤回dmInformation")
+    @ApiOperation("撤回dmInformation")
+    @PreAuthorize("@el.check('dmInformation:edit')")
+    @PostMapping(value = "ch")
+    public ResponseEntity<Object> ch(@RequestBody Long ids) {
+        dmInformationService.ch(ids);
+        return new ResponseEntity<>(HttpStatus.OK);
+    }
+}

+ 113 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/DmInformationService.java

@@ -0,0 +1,113 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.service;
+
+import me.zhengjie.modules.dm.information.domain.DmInformation;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationDto;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @description 服务接口
+* @author xwx
+* @date 2021-04-22
+**/
+public interface DmInformationService {
+
+    /**
+    * 查询数据分页
+    * @param criteria 条件
+    * @param pageable 分页参数
+    * @return Map<String,Object>
+    */
+    Map<String,Object> queryAll(DmInformationQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria 条件参数
+    * @return List<DmInformationDto>
+    */
+    List<DmInformationDto> queryAll(DmInformationQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id ID
+     * @return DmInformationDto
+     */
+    DmInformationDto findById(Long id);
+
+    /**
+    * 创建
+    * @param resources /
+    * @return DmInformationDto
+    */
+    DmInformationDto create(DmInformation resources);
+
+    /**
+    * 编辑
+    * @param resources /
+    */
+    void update(DmInformation resources,String ... statusList);
+
+    /**
+    * 多选删除
+    * @param ids /
+    */
+    void deleteAll(Long[] ids);
+
+    /**
+    * 导出数据
+    * @param all 待导出的数据
+    * @param response /
+    * @throws IOException /
+    */
+    void download(List<DmInformationDto> all, HttpServletResponse response) throws IOException;
+
+     DmInformation toEntity(DmInformationDto dto);
+
+    void updateTask(DmInformation resources);
+
+    /**
+     * todo 添加审批人
+     * @param resources
+     */
+    void addApprovalUser(DmInformation resources);
+
+    /**
+     * todo 审批
+     * @param resources
+     */
+    void approval(DmInformation resources);
+
+    /**
+     * todo 撤回
+     * @param id
+     */
+    void ch(Long id);
+
+    /**
+     * 查询数据分页
+     * @param pageable 分页参数
+     * @return Map<String,Object>
+     */
+    Map<String,Object> findAllDSP(Pageable pageable);
+
+}

+ 81 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/dto/DmInformationDto.java

@@ -0,0 +1,81 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.service.dto;
+
+import lombok.Data;
+import java.sql.Timestamp;
+import java.io.Serializable;
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
+import me.zhengjie.modules.dm.user.domain.DmUser;
+import me.zhengjie.modules.dm.user.service.dto.DmUserDto;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author xwx
+* @date 2021-04-22
+**/
+@Data
+public class DmInformationDto implements Serializable {
+
+    /** 主键 */
+    /** 防止精度丢失 */
+    @JSONField(serializeUsing = ToStringSerializer.class)
+    private Long id;
+
+    /** 发布内容(需发布的信息内容) */
+    private String content;
+
+    /** (00-待审核  01-审批通过(已发布) 02-审核未通过) */
+    private String status;
+
+    /** 审批备注 */
+    private String approvalRemark;
+
+    /** 审批人 */
+    private DmUserDto approvalUser;
+
+    /** 是否添加审批人 */
+    private Boolean isHasApproval ;
+
+    /** 任务ID act_ru_task */
+    private String taskId;
+
+    /** 任务实例id act_ru_execution */
+    private String procInstId;
+
+    /** 发起人 */
+    private DmUserDto requestUser;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 创建日期 */
+    private Timestamp createTime;
+
+    /** 更新时间 */
+    private Timestamp updateTime;
+
+    /** 发布时间 */
+    private Timestamp releaseTime;
+
+    /** 审批时间 */
+    private Timestamp approvalTime;
+}

+ 41 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/dto/DmInformationQueryCriteria.java

@@ -0,0 +1,41 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.service.dto;
+
+import lombok.Data;
+import java.sql.Timestamp;
+import java.util.List;
+import me.zhengjie.annotation.Query;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-22
+**/
+@Data
+public class DmInformationQueryCriteria{
+
+    /** 模糊 */
+    @Query(type = Query.Type.INNER_LIKE)
+    private String content;
+
+    /** 精确 */
+    @Query
+    private String status;
+    /** BETWEEN */
+    @Query(type = Query.Type.BETWEEN)
+    private List<Timestamp> releaseTime;
+}

+ 287 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/impl/DmInformationServiceImpl.java

@@ -0,0 +1,287 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.service.impl;
+
+import me.zhengjie.exception.BadRequestException;
+import me.zhengjie.modules.dm.activiti.event.ActivitiEvent;
+import me.zhengjie.modules.dm.activiti.status.OperationStatus;
+import me.zhengjie.modules.dm.information.domain.DmInformation;
+import me.zhengjie.modules.dm.informationApproval.domain.DmInformationApproval;
+import me.zhengjie.modules.dm.informationApproval.service.DmInformationApprovalService;
+import me.zhengjie.modules.dm.user.domain.DmUser;
+import me.zhengjie.modules.dm.user.service.mapstruct.DmUserMapper;
+import me.zhengjie.modules.dm.user.util.DmUserUtils;
+import me.zhengjie.modules.system.service.UserService;
+import me.zhengjie.modules.system.service.dto.UserDto;
+import me.zhengjie.utils.*;
+import lombok.RequiredArgsConstructor;
+import me.zhengjie.modules.dm.information.repository.DmInformationRepository;
+import me.zhengjie.modules.dm.information.service.DmInformationService;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationDto;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationQueryCriteria;
+import me.zhengjie.modules.dm.information.service.mapstruct.DmInformationMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import cn.hutool.core.lang.Snowflake;
+import cn.hutool.core.util.IdUtil;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+import java.awt.*;
+import java.sql.Timestamp;
+import java.util.*;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @description 服务实现
+* @author xwx
+* @date 2021-04-22
+**/
+@Service
+@RequiredArgsConstructor
+public class DmInformationServiceImpl implements DmInformationService {
+
+    private final DmInformationRepository dmInformationRepository;
+    private final DmInformationMapper dmInformationMapper;
+    @Autowired
+    private DmInformationApprovalService approvalService;
+    @Resource
+    private ApplicationContext applicationContext;
+
+    /** 用户信息 */
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private final DmUserMapper dmUserMapper;
+
+    @Override
+    public Map<String,Object> queryAll(DmInformationQueryCriteria criteria, Pageable pageable){
+        Page<DmInformation> page = dmInformationRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
+        return PageUtil.toPage(page.map(dmInformationMapper::toDto));
+    }
+
+    @Override
+    public List<DmInformationDto> queryAll(DmInformationQueryCriteria criteria){
+        return dmInformationMapper.toDto(dmInformationRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
+    }
+
+    @Override
+    @Transactional
+    public DmInformationDto findById(Long id) {
+        DmInformation dmInformation = dmInformationRepository.findById(id).orElseGet(DmInformation::new);
+        ValidationUtil.isNull(dmInformation.getId(),"DmInformation","id",id);
+        return dmInformationMapper.toDto(dmInformation);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public DmInformationDto create(DmInformation resources) {
+        Snowflake snowflake = IdUtil.createSnowflake(1, 1);
+        resources.setId(snowflake.nextId());
+        resources.setRequestUser(dmUserMapper.toEntity(DmUserUtils.getCurrDmUser()));
+        resources.setStatus("00");
+        resources.setIsHasApproval(false);
+        DmInformationDto dto = dmInformationMapper.toDto(dmInformationRepository.save(resources));
+        dto.setRequestUser(DmUserUtils.getCurrDmUser());
+        ActivitiEvent event = new ActivitiEvent(this,resources,OperationStatus.SUBMIT);
+        applicationContext.publishEvent(event);
+        return dto;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(DmInformation resources,String ... statusList) {
+        DmInformation dmInformation = dmInformationRepository.findById(resources.getId()).orElseGet(DmInformation::new);
+        ValidationUtil.isNull( dmInformation.getId(),"DmInformation","id",resources.getId());
+        dmInformation.copy(resources);
+         String status = statusList.length>0?statusList[0]:dmInformation.getStatus();
+         //判断是否驳回后修改
+         Boolean isApprovalUpdate = "02".equals(status);
+        //触发审批流程
+        if(isApprovalUpdate){
+            //初始化所有信息
+            reset(dmInformation.getId());
+            ActivitiEvent event = new ActivitiEvent(this,resources,OperationStatus.SUBMIT_APPROVAL_USER);
+            applicationContext.publishEvent(event);
+        }
+        if("02".equals(status) || "03".equals(status)){
+            dmInformation.setStatus("00");//将状态改为待审批
+            dmInformationRepository.save(dmInformation);
+        }
+
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void addApprovalUser(DmInformation resources){
+        DmInformation dmInformation = dmInformationRepository.findById(resources.getId()).orElseGet(DmInformation::new);
+        ValidationUtil.isNull( dmInformation.getId(),"DmInformation","id",resources.getId());
+
+        dmInformation.setIsHasApproval(true);
+        List<DmUser> appUsers = resources.getApprovalUserList();
+
+        if(appUsers !=null && appUsers.size()>0){
+            for(DmUser dmUser : appUsers){
+                DmInformationApproval approval = new DmInformationApproval();
+                approval.setInformation(resources);
+                approval.setApprovalUser(dmUser);
+                approval.setStatus("00");
+                approval.setIsNew(true);
+                approvalService.create(approval);
+            }
+        }
+        dmInformationRepository.save(dmInformation);
+
+        //触发审批流程
+        ActivitiEvent event = new ActivitiEvent(this,dmInformation,OperationStatus.SUBMIT_APPROVAL_USER);
+        applicationContext.publishEvent(event);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void approval(DmInformation resources) {
+        DmInformation information = dmInformationRepository.findById(resources.getId()).orElseGet(DmInformation::new);
+        ValidationUtil.isNull( information.getId(),"DmInformation","id",resources.getId());
+        information.copy(resources);
+
+        //判断用户是否具备审批权限
+        //1、判断是否具有审批用户
+        UserDto user= userService.findById(SecurityUtils.getCurrentUserId());
+        Boolean isApproval =true;
+        List<DmInformationApproval> approvalList = approvalService.findInfoByReqAndUser(information.getId(),user.getDmUser().getId()+"");
+        DmInformationApproval approval = approvalList==null || approvalList.size()<=0 || approvalList.get(0).getId() == null?null:approvalList.get(0);
+        isApproval=!(approval==null);
+        if(!isApproval){
+            throw new BadRequestException("无审批权限");
+        }
+        String status = information.getStatus();
+        if(!"01".equals(status) && !"02".equals(status)){
+            throw new BadRequestException("审批状态错误");
+        }
+
+        DmInformation information1 = approval.getInformation();
+        System.out.println("information1.getStatus() ==> "+information1.getStatus());
+        if(information1 == null || information1.getId() == null ||  !"00".equals(approval.getStatus())){
+            throw new BadRequestException("当前状态不可审批");
+        }
+        DmUser dmUser = dmUserMapper.toEntity(user.getDmUser());
+        String inistatus = approval.getStatus();
+
+        //修改信息
+        information.setApprovalUser(dmUser);
+        information.setApprovalTime(new Timestamp(System.currentTimeMillis()));
+        this.update(information,inistatus);
+        //保存审批信息
+        approval.setApprovalUser(dmUser);
+        approval.setStatus(information.getStatus());
+        approval.setApprovalRemark(information.getApprovalRemark());
+        approvalService.update(approval);
+
+        //触发审批流程
+        information.setTaskId(approval.getTaskId());
+        ActivitiEvent event = new ActivitiEvent(this,information,OperationStatus.APPROVE);
+        applicationContext.publishEvent(event);
+    }
+
+
+    @Override
+    public void deleteAll(Long[] ids) {
+        for (Long id : ids) {
+            dmInformationRepository.deleteById(id);
+        }
+    }
+
+    @Override
+    public void download(List<DmInformationDto> all, HttpServletResponse response) throws IOException {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (DmInformationDto dmInformation : all) {
+            Map<String,Object> map = new LinkedHashMap<>();
+            map.put("发布内容(需发布的信息内容)", dmInformation.getContent());
+            map.put("(00-待审核  01-审批通过(已发布) 02-审核未通过)", dmInformation.getStatus());
+            map.put("审批人", dmInformation.getApprovalUser());
+            map.put("任务ID act_ru_task", dmInformation.getTaskId());
+            map.put("任务实例id act_ru_execution", dmInformation.getProcInstId());
+            map.put("发起人", dmInformation.getRequestUser());
+            map.put("创建者", dmInformation.getCreateBy());
+            map.put("更新者", dmInformation.getUpdateBy());
+            map.put("创建日期", dmInformation.getCreateTime());
+            map.put("更新时间", dmInformation.getUpdateTime());
+            map.put("发布时间", dmInformation.getReleaseTime());
+            map.put("审批时间", dmInformation.getApprovalTime());
+            list.add(map);
+        }
+        FileUtil.downloadExcel(list, response);
+    }
+
+    @Override
+    public void ch(Long id){
+        DmInformation information = dmInformationRepository.findById(id).orElseGet(DmInformation::new);
+        ValidationUtil.isNull( information.getId(),"DmInformation","id",id);
+        if("00".equals(information.getStatus())){
+            information.setStatus("03");
+            this.update(information,"00");
+        }else {
+            throw new BadRequestException("当前状态不可撤回");
+        }
+    }
+
+    @Override
+    public Map<String, Object> findAllDSP(Pageable pageable) {
+        Page<DmInformation> page = dmInformationRepository.findAllDSP(DmUserUtils.getCurrDmUser().getId()+"",pageable);
+        return PageUtil.toPage(page.map(dmInformationMapper::toDto));
+    }
+
+    @Override
+    public DmInformation toEntity(DmInformationDto dto) {
+        if ( dto == null ) {
+            return null;
+        }
+
+        DmInformation dmInformation = new DmInformation();
+
+        dmInformation.setCreateBy( dto.getCreateBy() );
+        dmInformation.setCreateTime( dto.getCreateTime() );
+        dmInformation.setUpdateTime( dto.getUpdateTime() );
+        dmInformation.setId( dto.getId() );
+        dmInformation.setContent( dto.getContent() );
+        dmInformation.setStatus( dto.getStatus() );
+        dmInformation.setTaskId( dto.getTaskId() );
+        dmInformation.setProcInstId( dto.getProcInstId() );
+        dmInformation.setReleaseTime( dto.getReleaseTime() );
+        dmInformation.setApprovalTime( dto.getApprovalTime() );
+
+        return dmInformation;
+    }
+
+    @Override
+    public void updateTask(DmInformation resources) {
+        dmInformationRepository.updateTask(resources);
+    }
+
+
+    public void reset (Long id){
+        //修改审批状态为待审批
+        approvalService.reset(id);
+        //修改申请为待审批状态
+        dmInformationRepository.reset(id);
+    }
+}

+ 32 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/information/service/mapstruct/DmInformationMapper.java

@@ -0,0 +1,32 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.information.service.mapstruct;
+
+import me.zhengjie.base.BaseMapper;
+import me.zhengjie.modules.dm.information.domain.DmInformation;
+import me.zhengjie.modules.dm.information.service.dto.DmInformationDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-22
+**/
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface DmInformationMapper extends BaseMapper<DmInformationDto, DmInformation> {
+
+}

+ 83 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/domain/DmInformationApproval.java

@@ -0,0 +1,83 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import me.zhengjie.base.BaseEntity;
+import me.zhengjie.modules.dm.information.domain.DmInformation;
+import me.zhengjie.modules.dm.user.domain.DmUser;
+import org.hibernate.annotations.*;
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author xwx
+* @date 2021-04-23
+**/
+@Entity
+@Data
+@Table(name="dm_information_approval")
+public class DmInformationApproval  extends BaseEntity implements Serializable {
+
+    @Id
+    @Column(name = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    @ApiModelProperty(value = "信息")
+    @OneToOne
+    @JoinColumn(name = "info_id")
+    private DmInformation information;
+
+    @ApiModelProperty(value = "审批人")
+    @OneToOne
+    @JoinColumn(name = "approval_user")
+    private DmUser approvalUser;
+
+    @Column(name = "status")
+    @ApiModelProperty(value = "(00-待审核  01-审批通过(已发布) 02-审核未通过)")
+    private String status;
+
+    @Column(name = "approval_remark")
+    @ApiModelProperty(value = "审批备注")
+    private String approvalRemark;
+
+    @Column(name = "is_new")
+    @ApiModelProperty(value = "是否为最新审批")
+    private Boolean isNew;
+
+    @Column(name = "task_id")
+    @ApiModelProperty(value = "任务ID act_ru_task")
+    private String taskId;
+
+    @Column(name = "proc_inst_id")
+    @ApiModelProperty(value = "任务实例id act_ru_execution")
+    private String procInstId;
+
+    public void copy(DmInformationApproval source){
+        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+    }
+}

+ 60 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/repository/DmInformationApprovalRepository.java

@@ -0,0 +1,60 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.repository;
+
+import me.zhengjie.modules.dm.informationApproval.domain.DmInformationApproval;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.List;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-23
+**/
+public interface DmInformationApprovalRepository extends JpaRepository<DmInformationApproval, Long>, JpaSpecificationExecutor<DmInformationApproval> {
+
+    /**
+     * todo 修改审批人
+     */
+    @Modifying
+    @Query(value = "update dm_information_approval set approval_user = ?1 where request_id = ?2",nativeQuery = true)
+    void editApprovalUser(String approvalUser,Long requestId);
+
+    /**
+     * todo 重置
+     * @param infoId
+     */
+    @Modifying
+    @Query(value = "update dm_information_approval set status = '00',approval_remark = ''  where is_new = '1' and  info_id = ?1",nativeQuery = true)
+    void reset(Long infoId);
+
+    /**
+     * todo 刷新任务信息
+     */
+    @Modifying
+    @Query(value = "update dm_information_approval set task_id = ?3 , proc_inst_id=?4  where is_new = '1' and  info_id = ?1 and approval_user = ?2 ",nativeQuery = true)
+    void resetTask(Long infoId,String approvalUser,String taskId,String procInstId);
+
+    @Query(value="select * from dm_information_approval where info_id = ?1 and  approval_user = ?2 and is_new = '1' ",nativeQuery = true)
+    List<DmInformationApproval> findInfoByReqAndUser(Long infoId, String approvalUser);
+
+
+
+}

+ 87 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/rest/DmInformationApprovalController.java

@@ -0,0 +1,87 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.rest;
+
+import me.zhengjie.annotation.Log;
+import me.zhengjie.modules.dm.informationApproval.domain.DmInformationApproval;
+import me.zhengjie.modules.dm.informationApproval.service.DmInformationApprovalService;
+import me.zhengjie.modules.dm.informationApproval.service.dto.DmInformationApprovalQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-23
+**/
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "dmInformationApproval管理")
+@RequestMapping("/api/dmInformationApproval")
+public class DmInformationApprovalController {
+
+    private final DmInformationApprovalService dmInformationApprovalService;
+
+    @Log("导出数据")
+    @ApiOperation("导出数据")
+    @GetMapping(value = "/download")
+    @PreAuthorize("@el.check('dmInformationApproval:list')")
+    public void download(HttpServletResponse response, DmInformationApprovalQueryCriteria criteria) throws IOException {
+        dmInformationApprovalService.download(dmInformationApprovalService.queryAll(criteria), response);
+    }
+
+    @GetMapping
+    @Log("查询dmInformationApproval")
+    @ApiOperation("查询dmInformationApproval")
+    @PreAuthorize("@el.check('dmInformationApproval:list')")
+    public ResponseEntity<Object> query(DmInformationApprovalQueryCriteria criteria, Pageable pageable){
+        return new ResponseEntity<>(dmInformationApprovalService.queryAll(criteria,pageable),HttpStatus.OK);
+    }
+
+    @PostMapping
+    @Log("新增dmInformationApproval")
+    @ApiOperation("新增dmInformationApproval")
+    @PreAuthorize("@el.check('dmInformationApproval:add')")
+    public ResponseEntity<Object> create(@Validated @RequestBody DmInformationApproval resources){
+        return new ResponseEntity<>(dmInformationApprovalService.create(resources),HttpStatus.CREATED);
+    }
+
+    @PutMapping
+    @Log("修改dmInformationApproval")
+    @ApiOperation("修改dmInformationApproval")
+    @PreAuthorize("@el.check('dmInformationApproval:edit')")
+    public ResponseEntity<Object> update(@Validated @RequestBody DmInformationApproval resources){
+        dmInformationApprovalService.update(resources);
+        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+    }
+
+    @Log("删除dmInformationApproval")
+    @ApiOperation("删除dmInformationApproval")
+    @PreAuthorize("@el.check('dmInformationApproval:del')")
+    @DeleteMapping
+    public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
+        dmInformationApprovalService.deleteAll(ids);
+        return new ResponseEntity<>(HttpStatus.OK);
+    }
+}

+ 100 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/DmInformationApprovalService.java

@@ -0,0 +1,100 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.service;
+
+import me.zhengjie.modules.dm.informationApproval.domain.DmInformationApproval;
+import me.zhengjie.modules.dm.informationApproval.service.dto.DmInformationApprovalDto;
+import me.zhengjie.modules.dm.informationApproval.service.dto.DmInformationApprovalQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import java.util.Map;
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+* @website https://el-admin.vip
+* @description 服务接口
+* @author xwx
+* @date 2021-04-23
+**/
+public interface DmInformationApprovalService {
+
+    /**
+    * 查询数据分页
+    * @param criteria 条件
+    * @param pageable 分页参数
+    * @return Map<String,Object>
+    */
+    Map<String,Object> queryAll(DmInformationApprovalQueryCriteria criteria, Pageable pageable);
+
+    /**
+    * 查询所有数据不分页
+    * @param criteria 条件参数
+    * @return List<DmInformationApprovalDto>
+    */
+    List<DmInformationApprovalDto> queryAll(DmInformationApprovalQueryCriteria criteria);
+
+    /**
+     * 根据ID查询
+     * @param id ID
+     * @return DmInformationApprovalDto
+     */
+    DmInformationApprovalDto findById(Long id);
+
+    /**
+    * 创建
+    * @param resources /
+    * @return DmInformationApprovalDto
+    */
+    DmInformationApprovalDto create(DmInformationApproval resources);
+
+    /**
+    * 编辑
+    * @param resources /
+    */
+    void update(DmInformationApproval resources);
+
+    /**
+    * 多选删除
+    * @param ids /
+    */
+    void deleteAll(Long[] ids);
+
+    /**
+    * 导出数据
+    * @param all 待导出的数据
+    * @param response /
+    * @throws IOException /
+    */
+    void download(List<DmInformationApprovalDto> all, HttpServletResponse response) throws IOException;
+
+    /**
+     * todo 刷新任务信息
+     * @param infoId
+     */
+    void reset (Long infoId);
+
+    /**
+     * todo 刷新任务信息
+     * @param infoId
+     * @param approvalUser
+     * @param taskId
+     * @param procInstId
+     */
+    void resetTask (Long infoId,String approvalUser,String taskId,String procInstId);
+
+    List<DmInformationApproval> findInfoByReqAndUser(Long infoId,String approvalUser);
+}

+ 72 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/dto/DmInformationApprovalDto.java

@@ -0,0 +1,72 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.service.dto;
+
+import lombok.Data;
+import java.sql.Timestamp;
+import java.io.Serializable;
+import com.alibaba.fastjson.annotation.JSONField;
+import com.alibaba.fastjson.serializer.ToStringSerializer;
+import me.zhengjie.modules.dm.information.domain.DmInformation;
+import me.zhengjie.modules.dm.user.domain.DmUser;
+
+/**
+* @website https://el-admin.vip
+* @description /
+* @author xwx
+* @date 2021-04-23
+**/
+@Data
+public class DmInformationApprovalDto implements Serializable {
+
+    /** 主键 */
+    /** 防止精度丢失 */
+    @JSONField(serializeUsing = ToStringSerializer.class)
+    private Long id;
+
+    /** 信息主键 */
+   private DmInformation information;
+
+    /** 审批人 */
+    private DmUser approvalUser;
+
+    /** (00-待审核  01-审批通过(已发布) 02-审核未通过) */
+    private String status;
+
+    /** 审批备注 */
+    private String approvalRemark;
+
+    /** 是否为最新审批 */
+    private Boolean isNew;
+
+    /** 任务ID act_ru_task */
+    private String taskId;
+
+    /** 任务实例id act_ru_execution */
+    private String procInstId;
+
+    /** 创建者 */
+    private String createBy;
+
+    /** 更新者 */
+    private String updateBy;
+
+    /** 创建日期 */
+    private Timestamp createTime;
+
+    /** 更新时间 */
+    private Timestamp updateTime;
+}

+ 49 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/dto/DmInformationApprovalQueryCriteria.java

@@ -0,0 +1,49 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.service.dto;
+
+import lombok.Data;
+import java.util.List;
+import me.zhengjie.annotation.Query;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-23
+**/
+@Data
+public class DmInformationApprovalQueryCriteria{
+
+    /** 精确 */
+    @Query
+    private Long infoId;
+
+    /** 精确 */
+    @Query
+    private String approvalUser;
+
+    /** 精确 */
+    @Query
+    private String status;
+
+    /** 模糊 */
+    @Query(type = Query.Type.INNER_LIKE)
+    private String approvalRemark;
+
+    /** 精确 */
+    @Query
+    private String isNew;
+}

+ 135 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/impl/DmInformationApprovalServiceImpl.java

@@ -0,0 +1,135 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.service.impl;
+
+import me.zhengjie.modules.dm.informationApproval.domain.DmInformationApproval;
+import me.zhengjie.utils.ValidationUtil;
+import me.zhengjie.utils.FileUtil;
+import lombok.RequiredArgsConstructor;
+import me.zhengjie.modules.dm.informationApproval.repository.DmInformationApprovalRepository;
+import me.zhengjie.modules.dm.informationApproval.service.DmInformationApprovalService;
+import me.zhengjie.modules.dm.informationApproval.service.dto.DmInformationApprovalDto;
+import me.zhengjie.modules.dm.informationApproval.service.dto.DmInformationApprovalQueryCriteria;
+import me.zhengjie.modules.dm.informationApproval.service.mapstruct.DmInformationApprovalMapper;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import cn.hutool.core.lang.Snowflake;
+import cn.hutool.core.util.IdUtil;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import me.zhengjie.utils.PageUtil;
+import me.zhengjie.utils.QueryHelp;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+
+/**
+* @website https://el-admin.vip
+* @description 服务实现
+* @author xwx
+* @date 2021-04-23
+**/
+@Service
+@RequiredArgsConstructor
+public class DmInformationApprovalServiceImpl implements DmInformationApprovalService {
+
+    private final DmInformationApprovalRepository dmInformationApprovalRepository;
+    private final DmInformationApprovalMapper dmInformationApprovalMapper;
+
+    @Override
+    public Map<String,Object> queryAll(DmInformationApprovalQueryCriteria criteria, Pageable pageable){
+        Page<DmInformationApproval> page = dmInformationApprovalRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
+        return PageUtil.toPage(page.map(dmInformationApprovalMapper::toDto));
+    }
+
+    @Override
+    public List<DmInformationApprovalDto> queryAll(DmInformationApprovalQueryCriteria criteria){
+        return dmInformationApprovalMapper.toDto(dmInformationApprovalRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
+    }
+
+    @Override
+    @Transactional
+    public DmInformationApprovalDto findById(Long id) {
+        DmInformationApproval dmInformationApproval = dmInformationApprovalRepository.findById(id).orElseGet(DmInformationApproval::new);
+        ValidationUtil.isNull(dmInformationApproval.getId(),"DmInformationApproval","id",id);
+        return dmInformationApprovalMapper.toDto(dmInformationApproval);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public DmInformationApprovalDto create(DmInformationApproval resources) {
+        Snowflake snowflake = IdUtil.createSnowflake(1, 1);
+        resources.setId(snowflake.nextId()); 
+        return dmInformationApprovalMapper.toDto(dmInformationApprovalRepository.save(resources));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void update(DmInformationApproval resources) {
+        DmInformationApproval dmInformationApproval = dmInformationApprovalRepository.findById(resources.getId()).orElseGet(DmInformationApproval::new);
+        ValidationUtil.isNull( dmInformationApproval.getId(),"DmInformationApproval","id",resources.getId());
+        dmInformationApproval.copy(resources);
+        dmInformationApprovalRepository.save(dmInformationApproval);
+    }
+
+    @Override
+    public void deleteAll(Long[] ids) {
+        for (Long id : ids) {
+            dmInformationApprovalRepository.deleteById(id);
+        }
+    }
+
+    @Override
+    public void download(List<DmInformationApprovalDto> all, HttpServletResponse response) throws IOException {
+        List<Map<String, Object>> list = new ArrayList<>();
+        for (DmInformationApprovalDto dmInformationApproval : all) {
+            Map<String,Object> map = new LinkedHashMap<>();
+            map.put("信息主键", dmInformationApproval.getInformation().getId());
+            map.put("审批人", dmInformationApproval.getApprovalUser());
+            map.put("(00-待审核  01-审批通过(已发布) 02-审核未通过)", dmInformationApproval.getStatus());
+            map.put("审批备注", dmInformationApproval.getApprovalRemark());
+            map.put("是否为最新审批", dmInformationApproval.getIsNew());
+            map.put("任务ID act_ru_task", dmInformationApproval.getTaskId());
+            map.put("任务实例id act_ru_execution", dmInformationApproval.getProcInstId());
+            map.put("创建者", dmInformationApproval.getCreateBy());
+            map.put("更新者", dmInformationApproval.getUpdateBy());
+            map.put("创建日期", dmInformationApproval.getCreateTime());
+            map.put("更新时间", dmInformationApproval.getUpdateTime());
+            list.add(map);
+        }
+        FileUtil.downloadExcel(list, response);
+    }
+
+    @Override
+    public void reset(Long infoId) {
+        dmInformationApprovalRepository.reset(infoId);
+    }
+
+    @Override
+    public void resetTask(Long infoId, String approvalUser, String taskId, String procInstId) {
+        dmInformationApprovalRepository.resetTask(infoId,approvalUser,taskId,procInstId);
+    }
+
+    @Override
+    public List<DmInformationApproval> findInfoByReqAndUser(Long infoId, String approvalUser) {
+        return dmInformationApprovalRepository.findInfoByReqAndUser(infoId,approvalUser);
+    }
+
+
+}

+ 32 - 0
eladmin-system/src/main/java/me/zhengjie/modules/dm/informationApproval/service/mapstruct/DmInformationApprovalMapper.java

@@ -0,0 +1,32 @@
+/*
+*  Copyright 2019-2020 Zheng Jie
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*  http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+package me.zhengjie.modules.dm.informationApproval.service.mapstruct;
+
+import me.zhengjie.base.BaseMapper;
+import me.zhengjie.modules.dm.informationApproval.domain.DmInformationApproval;
+import me.zhengjie.modules.dm.informationApproval.service.dto.DmInformationApprovalDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+/**
+* @website https://el-admin.vip
+* @author xwx
+* @date 2021-04-23
+**/
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface DmInformationApprovalMapper extends BaseMapper<DmInformationApprovalDto, DmInformationApproval> {
+
+}