yin_yu820 1 year ago
parent
commit
2fc8eb1693
20 changed files with 1261 additions and 34 deletions
  1. 127 4
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/controller/GwCirculationCard2Controller.java
  2. 12 2
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/domain/GwCirculationCard2.java
  3. 10 1
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/mapper/GwCirculationCard2Mapper.java
  4. 45 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/mapper/xml/GwCirculationCard2Mapper.xml
  5. 25 1
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/service/GwCirculationCard2Service.java
  6. 39 20
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/service/dto/GwCirculationCard2DTO.java
  7. 1 1
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/service/mapstruct/GwCirculationCard2Wrapper.java
  8. 233 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/controller/GwFlowController.java
  9. 47 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/domain/GwFlow.java
  10. 20 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/mapper/GwFlowMapper.java
  11. 23 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/mapper/xml/GwFlowMapper.xml
  12. 28 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/service/GwFlowService.java
  13. 64 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/service/dto/GwFlowDTO.java
  14. 24 0
      jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/service/mapstruct/GwFlowWrapper.java
  15. 1 1
      jp-ui/src/api/circulation2/gwCirculationCard2Service.js
  16. 60 0
      jp-ui/src/api/gwflow/gwFlowService.js
  17. 25 2
      jp-ui/src/views/circulation2/GwCirculationCard2Form.vue
  18. 21 2
      jp-ui/src/views/circulation2/GwCirculationCard2List.vue
  19. 130 0
      jp-ui/src/views/gwflow/GwFlowForm.vue
  20. 326 0
      jp-ui/src/views/gwflow/GwFlowList.vue

+ 127 - 4
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/controller/GwCirculationCard2Controller.java

@@ -11,6 +11,13 @@ import com.jeeplus.core.excel.EasyExcelUtils;
 import com.jeeplus.core.excel.ExcelOptions;
 import com.jeeplus.core.excel.annotation.ExportMode;
 import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.gwflow.service.GwFlowService;
+import com.jeeplus.gwflow.service.dto.GwFlowDTO;
+import com.jeeplus.gwflow.service.mapstruct.GwFlowWrapper;
+import com.jeeplus.sys.service.UserService;
+import com.jeeplus.sys.service.dto.RoleDTO;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.http.ResponseEntity;
@@ -28,11 +35,12 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.UUID;
 
 /**
  * 公文流转Controller
  * @author 尹宇
- * @version 2024-03-20
+ * @version 2024-03-21
  */
 
 @Api(tags ="公文流转")
@@ -40,6 +48,15 @@ import java.util.List;
 @RequestMapping(value = "/circulation2/gwCirculationCard2")
 public class GwCirculationCard2Controller {
 
+	@Autowired
+	private GwFlowService gwFlowService;
+
+	@Autowired
+	private GwFlowWrapper gwFlowWrapper;
+
+	@Autowired
+	private UserService userService;
+
 	@Autowired
 	private GwCirculationCard2Service gwCirculationCard2Service;
 
@@ -59,6 +76,82 @@ public class GwCirculationCard2Controller {
 		return ResponseEntity.ok (result);
 	}
 
+	/**
+	 * 公文流转列表数据(含待办筛选)
+	 */
+	@ApiLog("查询公文流转列表数据(含待办筛选)")
+	@ApiOperation(value = "查询公文流转列表数据(含待办筛选)")
+	@PreAuthorize("hasAuthority('circulation2:gwCirculationCard2:list')")
+	@GetMapping("list2")
+	public ResponseEntity<IPage<GwCirculationCard2DTO>> list2(GwCirculationCard2DTO gwCirculationCard2DTO, Page<GwCirculationCard2DTO> page) throws Exception {
+		//除   管理员、办公室管理员  之外的角色需要判断是否涉及自己流程
+		UserDTO userDTO=UserUtils.getCurrentUserDTO();
+		List<RoleDTO> list=userDTO.getRoleDTOList();
+		boolean isadmin=false;
+		for (RoleDTO aa:list) {
+			if(aa.getName().equals("租户管理员")||aa.getName().equals("管理员")||aa.getName().equals("办公室管理员")){
+				isadmin=true;
+			}
+		}
+
+		IPage<GwCirculationCard2DTO> result = null;
+//		if(isadmin){
+//			QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (gwCirculationCard2DTO, GwCirculationCard2DTO.class);
+//			result = gwCirculationCard2Wrapper.toDTO ( gwCirculationCard2Service.page (page, queryWrapper) );
+//		}else{
+			//
+			GwCirculationCard2DTO gwCirculationCard2DTO2=new GwCirculationCard2DTO();
+			QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (gwCirculationCard2DTO2, GwCirculationCard2DTO.class);
+
+
+			queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
+			queryWrapper.eq ("b.del_flag", 0 ); // 排除已经删除
+			queryWrapper.eq ("b.update_by_id", userDTO.getId() );
+			if(gwCirculationCard2DTO.getState()!=null&&!gwCirculationCard2DTO.getState().equals("null")&&!gwCirculationCard2DTO.getState().equals("")){
+				queryWrapper.ne ("a.state", gwCirculationCard2DTO.getState() );
+				if(!gwCirculationCard2DTO.getState().equals("1")){
+					queryWrapper.ne ("b.state", gwCirculationCard2DTO.getState() );
+				}
+			}
+			queryWrapper.groupBy("a.id");
+
+			result=gwCirculationCard2Service.findPage (page, queryWrapper);
+
+//		}
+
+
+
+
+
+		return ResponseEntity.ok (result);
+	}
+
+	/**
+	 * 公文流转列表数据(含待办筛选)
+	 */
+	@ApiLog("查询公文流转列表数据(含待办筛选)")
+	@ApiOperation(value = "查询公文流转列表数据(含待办筛选)")
+	@GetMapping("list3")
+	public ResponseEntity<IPage<GwCirculationCard2DTO>> list3(String state,String size,String current) throws Exception {
+		//除   管理员、办公室管理员  之外的角色需要判断是否涉及自己流程
+		UserDTO userDTO=UserUtils.getCurrentUserDTO();
+		List<RoleDTO> list=userDTO.getRoleDTOList();
+		boolean isadmin=false;
+		for (RoleDTO aa:list) {
+			if(aa.getName().equals("租户管理员")||aa.getName().equals("管理员")||aa.getName().equals("办公室管理员")){
+				isadmin=true;
+			}
+		}
+		IPage<GwCirculationCard2DTO> result = null;
+		if(isadmin){
+
+		}else{
+
+		}
+
+		return ResponseEntity.ok (result);
+	}
+
 
 	/**
 	 * 根据Id获取公文流转数据
@@ -80,7 +173,37 @@ public class GwCirculationCard2Controller {
 	@PostMapping("save")
 	public  ResponseEntity <String> save(@Valid @RequestBody GwCirculationCard2DTO gwCirculationCard2DTO) {
 		//新增或编辑表单保存
-		gwCirculationCard2Service.saveOrUpdate (gwCirculationCard2Wrapper.toEntity (gwCirculationCard2DTO));
+		if(gwCirculationCard2DTO.getId()!=null&&!gwCirculationCard2DTO.getId().equals("")){
+			gwCirculationCard2Service.saveOrUpdate (gwCirculationCard2Wrapper.toEntity (gwCirculationCard2DTO));
+		}else{
+			//新增的时候需要新增一条代办事项
+			gwCirculationCard2DTO.setId(UUID.randomUUID().toString());
+			UserDTO userDTO=UserUtils.getCurrentUserDTO();
+			gwCirculationCard2DTO.setNowUser(userDTO.getId());
+			gwCirculationCard2Service.saveGetId (gwCirculationCard2DTO);
+
+			//默认一条待办
+			GwFlowDTO gwFlowDTO=new GwFlowDTO();
+			gwFlowDTO.setGwId(gwCirculationCard2DTO.getId());
+			gwFlowDTO.setState("1");
+			String nextuser="";
+			if(gwCirculationCard2DTO.getNextUser()!=null&&!gwCirculationCard2DTO.getNextUser().equals("")){
+				nextuser=gwCirculationCard2DTO.getNextUser();
+			}
+			UserDTO userDTO2=userService.getUserByLoginName("bgszr","10000");
+			gwFlowDTO.setCreateBy(userDTO2);
+			gwFlowDTO.setUpdateBy(userDTO2);
+			gwFlowDTO.setCreateTruename(userDTO.getName());
+			gwFlowDTO.setNextTruename(userDTO2.getName());
+			gwFlowDTO.setNextUser(userDTO2.getId());
+			gwFlowDTO.setWhich("0");
+			gwFlowService.saveOrUpdate (gwFlowWrapper.toEntity (gwFlowDTO));
+
+		}
+
+
+
+
         return ResponseEntity.ok ( "保存公文流转成功" );
 	}
 
@@ -97,7 +220,7 @@ public class GwCirculationCard2Controller {
         gwCirculationCard2Service.removeByIds ( Lists.newArrayList ( idArray ) );
 		return ResponseEntity.ok( "删除公文流转成功" );
 	}
-	
+
     /**
      * 导出公文流转数据
      *
@@ -113,7 +236,7 @@ public class GwCirculationCard2Controller {
         String fileName = options.getFilename ( );
 		QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (gwCirculationCard2DTO, GwCirculationCard2DTO.class);
         if ( ExportMode.current.equals ( options.getMode ( ) ) ) { // 导出当前页数据
-            
+
         } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) { // 导出选中数据
             queryWrapper.in ( "id", options.getSelectIds () );
         } else { // 导出全部数据

+ 12 - 2
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/domain/GwCirculationCard2.java

@@ -11,7 +11,7 @@ import lombok.EqualsAndHashCode;
 /**
  * 公文流转Entity
  * @author 尹宇
- * @version 2024-03-20
+ * @version 2024-03-21
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -62,8 +62,18 @@ public class GwCirculationCard2 extends BaseEntity {
 	private String contentSummary;
 			
 	/**
-     * 来文附件id
+     * 来文附件
      */
 	private String attachedDocumentId;
+			
+	/**
+     * 备注
+     */
+	private String remark;
+			
+	/**
+     * 状态
+     */
+	private String state;
 
 }

+ 10 - 1
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/mapper/GwCirculationCard2Mapper.java

@@ -3,15 +3,24 @@
  */
 package com.jeeplus.circulation2.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jeeplus.circulation2.domain.GwCirculationCard2;
+import com.jeeplus.circulation2.service.dto.GwCirculationCard2DTO;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 公文流转MAPPER接口
  * @author 尹宇
- * @version 2024-03-20
+ * @version 2024-03-21
  */
 public interface GwCirculationCard2Mapper extends BaseMapper<GwCirculationCard2> {
 
+    int saveGetId(GwCirculationCard2DTO map);
+
+    IPage<GwCirculationCard2DTO> findList(Page<GwCirculationCard2DTO> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);
 
 }

+ 45 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/mapper/xml/GwCirculationCard2Mapper.xml

@@ -2,5 +2,50 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeeplus.circulation2.mapper.GwCirculationCard2Mapper">
 
+    <sql id="circulation2DetailColumns">
+        a.id AS "id",
+		a.year_num AS "yearNum",
+		a.card_num AS "cardNum",
+		a.sending_agency AS "sendingAgency",
+        a.doc_font_size AS "docFontFize",
+        a.file_source AS "fileSource",
+        a.written_time AS "writtenTime",
+        a.receiving_time AS "receivingTime",
+        a.content_summary AS "contentSummary",
+        a.attached_document_id AS "attachedDocumentId",
+        a.remark AS "remark",
+        a.state AS "state",
+
+        a.create_by_id AS "createById",
+		a.create_time AS "createTime",
+        b.create_time AS "createTime2",
+		a.update_by_id AS "updateById",
+		a.update_time AS "updateTime",
+        b.update_time AS "updateTime2",
+		a.del_flag AS "delFlag",
+        b.state AS "state2",
+        a.tenant_id,b.update_by_id,b.del_flag
+    </sql>
+
+    <sql id="circulation2DetailJoins">
+
+        LEFT JOIN gw_flow b ON a.id=b.gw_id
+    </sql>
+
+    <insert id="saveGetId" parameterType="com.jeeplus.circulation2.service.dto.GwCirculationCard2DTO">
+        insert into gw_circulation_card2 ( id,year_num, card_num, sending_agency,doc_font_size,file_source,written_time,receiving_time,content_summary,attached_document_id,
+        remark,state,create_by_id,create_time,update_by_id,update_time,del_flag )
+        values (#{id},#{yearNum}, #{cardNum}, #{sendingAgency}, #{docFontSize}, #{fileSource}, #{writtenTime}, #{receivingTime}, #{contentSummary}, #{attachedDocumentId}, #{remark},
+        1,#{nowUser},NOW(),#{nowUser},NOW(),'0')
+    </insert>
+
+    <select id="findList" resultType="com.jeeplus.circulation2.service.dto.GwCirculationCard2DTO">
+        SELECT
+        <include refid="circulation2DetailColumns"/>
+        FROM gw_circulation_card2 a
+        <include refid="circulation2DetailJoins"/>
+        ${ew.customSqlSegment}
+
+    </select>
 
 </mapper>

+ 25 - 1
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/service/GwCirculationCard2Service.java

@@ -3,19 +3,43 @@
  */
 package com.jeeplus.circulation2.service;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.circulation2.service.dto.GwCirculationCard2DTO;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jeeplus.circulation2.domain.GwCirculationCard2;
 import com.jeeplus.circulation2.mapper.GwCirculationCard2Mapper;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.UUID;
+
 /**
  * 公文流转Service
  * @author 尹宇
- * @version 2024-03-20
+ * @version 2024-03-21
  */
 @Service
 @Transactional
 public class GwCirculationCard2Service extends ServiceImpl<GwCirculationCard2Mapper, GwCirculationCard2> {
 
+    public int saveGetId(GwCirculationCard2DTO gwCirculationCard2DTO) {
+        return baseMapper.saveGetId(gwCirculationCard2DTO);
+    }
+
+    /**
+     * 自定义分页检索
+     * @param page
+     * @param queryWrapper
+     * @return
+     */
+    public IPage<GwCirculationCard2DTO> findPage(Page<GwCirculationCard2DTO> page, QueryWrapper queryWrapper) {
+
+        System.err.println( queryWrapper.getCustomSqlSegment() );
+        return  baseMapper.findList (page, queryWrapper);
+    }
+
 }

+ 39 - 20
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/service/dto/GwCirculationCard2DTO.java

@@ -8,13 +8,15 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.jeeplus.core.query.Query;
 import com.jeeplus.core.query.QueryType;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.jeeplus.core.excel.converter.ExcelDictDTOConverter;
+import com.jeeplus.core.excel.annotation.ExcelDictProperty;
 import com.jeeplus.core.service.dto.BaseDTO;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 /**
  * 公文流转DTO
  * @author 尹宇
- * @version 2024-03-20
+ * @version 2024-03-21
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -22,69 +24,86 @@ public class GwCirculationCard2DTO extends BaseDTO {
 
 	private static final long serialVersionUID = 1L;
 
-	        
+
 	/**
      * 年度
      */
     @Query(type = QueryType.LIKE)
-	@ExcelProperty("年度") 
+	@ExcelProperty("年度")
 	private String yearNum;
-	        
+
+	private String id;
+	private String nextUser;
+	private String nowUser;
 	/**
      * 卡号
      */
     @Query(type = QueryType.LIKE)
-	@ExcelProperty("卡号") 
+	@ExcelProperty("卡号")
 	private String cardNum;
-	        
+
 	/**
      * 来文机关
      */
     @Query(type = QueryType.LIKE)
-	@ExcelProperty("来文机关") 
+	@ExcelProperty("来文机关")
 	private String sendingAgency;
-	        
+
 	/**
      * 来文字号
      */
     @Query(type = QueryType.LIKE)
-	@ExcelProperty("来文字号") 
+	@ExcelProperty("来文字号")
 	private String docFontSize;
-	        
+
 	/**
      * 文件来源
      */
     @Query(type = QueryType.LIKE)
-	@ExcelProperty("文件来源") 
+	@ExcelProperty("文件来源")
 	private String fileSource;
-	        
+
 	/**
      * 成文时间
      */
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Query(type = QueryType.EQ)
-	@ExcelProperty("成文时间") 
+	@ExcelProperty("成文时间")
 	private Date writtenTime;
-	        
+
 	/**
      * 收文时间
      */
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Query(type = QueryType.EQ)
-	@ExcelProperty("收文时间") 
+	@ExcelProperty("收文时间")
 	private Date receivingTime;
-	        
+
 	/**
      * 内容摘要
      */
     @Query(type = QueryType.LIKE)
-	@ExcelProperty("内容摘要") 
+	@ExcelProperty("内容摘要")
 	private String contentSummary;
-	        
+
 	/**
-     * 来文附件id
+     * 来文附件
      */
-	@ExcelProperty("来文附件id") 
+	@ExcelProperty("来文附件")
 	private String attachedDocumentId;
 
+	/**
+     * 备注
+     */
+	@ExcelProperty("备注")
+	private String remark;
+
+	/**
+     * 状态
+     */
+    @Query(type = QueryType.EQ)
+	@ExcelProperty(value = "状态", converter = ExcelDictDTOConverter.class)
+	@ExcelDictProperty("gw_state")
+	private String state;
+
 }

+ 1 - 1
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/circulation2/service/mapstruct/GwCirculationCard2Wrapper.java

@@ -14,7 +14,7 @@ import org.mapstruct.factory.Mappers;
 /**
  *  GwCirculationCard2Wrapper
  * @author 尹宇
- * @version 2024-03-20
+ * @version 2024-03-21
  */
 @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
 public interface GwCirculationCard2Wrapper extends EntityWrapper<GwCirculationCard2DTO, GwCirculationCard2> {

+ 233 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/controller/GwFlowController.java

@@ -0,0 +1,233 @@
+/**
+ * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.gwflow.controller;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import com.google.common.collect.Lists;
+import com.jeeplus.aop.logging.annotation.ApiLog;
+import com.jeeplus.circulation2.service.GwCirculationCard2Service;
+import com.jeeplus.circulation2.service.dto.GwCirculationCard2DTO;
+import com.jeeplus.circulation2.service.mapstruct.GwCirculationCard2Wrapper;
+import com.jeeplus.core.excel.EasyExcelUtils;
+import com.jeeplus.core.excel.ExcelOptions;
+import com.jeeplus.core.excel.annotation.ExportMode;
+import com.jeeplus.core.query.QueryWrapperGenerator;
+import com.jeeplus.sys.service.UserService;
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jeeplus.gwflow.domain.GwFlow;
+import com.jeeplus.gwflow.service.dto.GwFlowDTO;
+import com.jeeplus.gwflow.service.mapstruct.GwFlowWrapper;
+import com.jeeplus.gwflow.service.GwFlowService;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * 公文流程Controller
+ * @author 尹宇
+ * @version 2024-03-21
+ */
+
+@Api(tags ="公文流程")
+@RestController
+@RequestMapping(value = "/gwflow/gwFlow")
+public class GwFlowController {
+
+	@Autowired
+	private GwFlowService gwFlowService;
+
+	@Autowired
+	private GwFlowWrapper gwFlowWrapper;
+
+	@Autowired
+	private UserService userService;
+
+	@Autowired
+	private GwCirculationCard2Service gwCirculationCard2Service;
+
+	@Autowired
+	private GwCirculationCard2Wrapper gwCirculationCard2Wrapper;
+	/**
+	 * 公文流程列表数据
+	 */
+	@ApiLog("查询公文流程列表数据")
+	@ApiOperation(value = "查询公文流程列表数据")
+	@PreAuthorize("hasAuthority('gwflow:gwFlow:list')")
+	@GetMapping("list")
+	public ResponseEntity<IPage<GwFlowDTO>> list(GwFlowDTO gwFlowDTO, Page<GwFlow> page) throws Exception {
+		QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (gwFlowDTO, GwFlowDTO.class);
+		IPage<GwFlowDTO> result = gwFlowWrapper.toDTO ( gwFlowService.page (page, queryWrapper) );
+		return ResponseEntity.ok (result);
+	}
+
+
+	/**
+	 * 根据Id获取公文流程数据
+	 */
+	@ApiLog("根据Id获取公文流程数据")
+	@ApiOperation(value = "根据Id获取公文流程数据")
+	@PreAuthorize("hasAnyAuthority('gwflow:gwFlow:view','gwflow:gwFlow:add','gwflow:gwFlow:edit')")
+	@GetMapping("queryById")
+	public ResponseEntity<GwFlowDTO> queryById(String id) {
+		return ResponseEntity.ok ( gwFlowWrapper.toDTO ( gwFlowService.getById ( id ) ) );
+	}
+
+	/**
+	 * 根据GWId获取公文流程数据
+	 */
+	@ApiLog("根据GWId获取公文流程数据")
+	@ApiOperation(value = "根据GWId获取公文流程数据")
+	@GetMapping("queryByGwId")
+	public ResponseEntity<List<GwFlowDTO>> queryByGwId(String Gwid) {
+		return ResponseEntity.ok (  gwFlowService.getByGwId ( Gwid )  );
+	}
+
+	/**
+	 * 保存公文流程
+	 */
+	@ApiLog("保存公文流程")
+	@ApiOperation(value = "保存公文流程")
+	@PreAuthorize("hasAnyAuthority('gwflow:gwFlow:add','gwflow:gwFlow:edit')")
+	@PostMapping("save")
+	public  ResponseEntity <String> save(@Valid @RequestBody GwFlowDTO gwFlowDTO) {
+		//新增或编辑表单保存
+		gwFlowService.saveOrUpdate (gwFlowWrapper.toEntity (gwFlowDTO));
+
+		//此时是办公室主任选人后的操作
+		if(gwFlowDTO.getNext()!=null&&gwFlowDTO.getNext().equals("1")){
+			UserDTO userDTO= UserUtils.getCurrentUserDTO();
+			//有选择领导的时候新增
+			if(gwFlowDTO.getNextLeadUser()!=null&&gwFlowDTO.getNextLeadUser().contains(",")) {
+			   String [] NextLeadUsers=gwFlowDTO.getNextLeadUser().split(",");
+				for (String user:NextLeadUsers) {//每个领导都生成一条流程数据
+					if(!user.equals("")){
+						GwFlowDTO a1=new GwFlowDTO();
+						a1.setGwId(gwFlowDTO.getGwId());
+						a1.setState("1");
+						UserDTO userDTO2=userService.getUserByLoginName(user,"10000");
+						a1.setCreateBy(userDTO);
+						a1.setUpdateBy(userDTO2);
+						a1.setCreateTruename(userDTO.getName());
+						a1.setNextTruename(userDTO2.getName());
+						a1.setNextUser(userDTO2.getId());
+						a1.setWhich("1");
+						gwFlowService.saveOrUpdate (gwFlowWrapper.toEntity (a1));
+					}
+				}
+			}
+
+
+			//有选择科室承办的时候新增
+			if(gwFlowDTO.getNextDepUser()!=null&&gwFlowDTO.getNextDepUser().contains(",")) {
+				String [] NextDepUsers=gwFlowDTO.getNextDepUser().split(",");
+				for (String user:NextDepUsers) {//每个领导都生成一条流程数据
+					if(!user.equals("")){
+						GwFlowDTO a1=new GwFlowDTO();
+						a1.setGwId(gwFlowDTO.getGwId());
+						a1.setState("1");
+						UserDTO userDTO2=userService.getUserByLoginName(user,"10000");
+						a1.setCreateBy(userDTO);
+						a1.setUpdateBy(userDTO2);
+						a1.setCreateTruename(userDTO.getName());
+						a1.setNextTruename(userDTO2.getName());
+						a1.setNextUser(userDTO2.getId());
+						a1.setWhich("2");
+						gwFlowService.saveOrUpdate (gwFlowWrapper.toEntity (a1));
+					}
+				}
+			}
+
+			//remark不为空时,备注更新
+			if(gwFlowDTO.getRemark()!=null&&!gwFlowDTO.getRemark().equals("")){
+				GwCirculationCard2DTO gwCirculationCard2DTO =gwCirculationCard2Wrapper.toDTO (gwCirculationCard2Service.getById ( gwFlowDTO.getGwId() ));
+				gwCirculationCard2DTO.setRemark(gwFlowDTO.getRemark());
+				gwCirculationCard2Service.saveOrUpdate (gwCirculationCard2Wrapper.toEntity (gwCirculationCard2DTO));
+			}
+
+
+		}
+
+        return ResponseEntity.ok ( "保存公文流程成功" );
+	}
+
+
+	/**
+	 * 删除公文流程
+	 */
+	@ApiLog("删除公文流程")
+	@ApiOperation(value = "删除公文流程")
+	@PreAuthorize("hasAuthority('gwflow:gwFlow:del')")
+	@DeleteMapping("delete")
+	public ResponseEntity <String> delete(String ids) {
+		String idArray[] = ids.split(",");
+        gwFlowService.removeByIds ( Lists.newArrayList ( idArray ) );
+		return ResponseEntity.ok( "删除公文流程成功" );
+	}
+
+    /**
+     * 导出公文流程数据
+     *
+     * @param gwFlowDTO
+     * @param page
+     * @param response
+     * @throws Exception
+     */
+    @ApiLog("导出公文流程数据")
+    @PreAuthorize("hasAnyAuthority('gwflow:gwFlow:export')")
+    @GetMapping("export")
+    public void exportFile(GwFlowDTO gwFlowDTO, Page <GwFlow> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+        String fileName = options.getFilename ( );
+		QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition (gwFlowDTO, GwFlowDTO.class);
+        if ( ExportMode.current.equals ( options.getMode ( ) ) ) { // 导出当前页数据
+
+        } else if ( ExportMode.selected.equals ( options.getMode ( ) ) ) { // 导出选中数据
+            queryWrapper.in ( "id", options.getSelectIds () );
+        } else { // 导出全部数据
+            page.setSize ( -1 );
+            page.setCurrent ( 0 );
+        }
+        List < GwFlow> result = gwFlowService.page ( page, queryWrapper ).getRecords ( );
+        EasyExcelUtils.newInstance ( gwFlowService, gwFlowWrapper ).exportExcel ( result,  options.getSheetName ( ), GwFlowDTO.class, fileName,options.getExportFields (), response );
+    }
+
+    /**
+     * 导入公文流程数据
+     *
+     * @return
+     */
+    @PreAuthorize("hasAnyAuthority('gwflow:gwFlow:import')")
+    @PostMapping("import")
+    public ResponseEntity importFile(MultipartFile file) throws IOException {
+        String result = EasyExcelUtils.newInstance ( gwFlowService, gwFlowWrapper ).importExcel ( file, GwFlowDTO.class );
+        return ResponseEntity.ok ( result );
+    }
+
+    /**
+     * 下载导入公文流程数据模板
+     *
+     * @param response
+     * @return
+     */
+    @PreAuthorize ("hasAnyAuthority('gwflow:gwFlow:import')")
+    @GetMapping("import/template")
+    public void importFileTemplate(HttpServletResponse response) throws IOException {
+        String fileName = "公文流程数据导入模板.xlsx";
+        List<GwFlowDTO> list = Lists.newArrayList();
+        EasyExcelUtils.newInstance ( gwFlowService, gwFlowWrapper ).exportExcel ( list,  "公文流程数据", GwFlowDTO.class, fileName, null, response );
+    }
+
+
+}

+ 47 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/domain/GwFlow.java

@@ -0,0 +1,47 @@
+/**
+ * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.gwflow.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.jeeplus.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+/**
+ * 公文流程Entity
+ * @author 尹宇
+ * @version 2024-03-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@TableName("gw_flow")
+public class GwFlow extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+
+	/**
+     * 公文id
+     */
+	private String gwId;
+
+	/**
+     * 内容
+     */
+	private String content;
+
+	/**
+     * 签名附件
+     */
+	private String signfj;
+
+	/**
+     * 流程状态
+     */
+	private String state;
+
+	private String createTruename;
+	private String nextTruename;
+	private String nextUser;
+	private String which;
+}

+ 20 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/mapper/GwFlowMapper.java

@@ -0,0 +1,20 @@
+/**
+ * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.gwflow.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.jeeplus.gwflow.domain.GwFlow;
+import com.jeeplus.gwflow.service.dto.GwFlowDTO;
+
+import java.util.List;
+
+/**
+ * 公文流程MAPPER接口
+ * @author 尹宇
+ * @version 2024-03-21
+ */
+public interface GwFlowMapper extends BaseMapper<GwFlow> {
+
+    List<GwFlowDTO> getByGwId(String Gwid);
+}

+ 23 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/mapper/xml/GwFlowMapper.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jeeplus.gwflow.mapper.GwFlowMapper">
+
+    <select id="getByGwId" resultType="com.jeeplus.gwflow.service.dto.GwFlowDTO">
+        SELECT  a.id AS "id",
+        a.gw_id as "gwId",
+        a.content as "content",
+        a.signfj AS "signfj",
+        a.state AS "state",
+
+        a.create_by_id AS "createBy.id",
+        a.create_time AS "createTime",
+        a.update_by_id AS "updateBy.id",
+        a.update_time AS "updateTime"
+        from gw_flow a
+        WHERE a.gw_id= #{Gwid} AND a.del_flag=0
+            order by a.update_time desc
+
+
+    </select>
+
+</mapper>

+ 28 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/service/GwFlowService.java

@@ -0,0 +1,28 @@
+/**
+ * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.gwflow.service;
+
+import com.jeeplus.gwflow.service.dto.GwFlowDTO;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jeeplus.gwflow.domain.GwFlow;
+import com.jeeplus.gwflow.mapper.GwFlowMapper;
+
+import java.util.List;
+
+/**
+ * 公文流程Service
+ * @author 尹宇
+ * @version 2024-03-21
+ */
+@Service
+@Transactional
+public class GwFlowService extends ServiceImpl<GwFlowMapper, GwFlow> {
+
+    public List<GwFlowDTO> getByGwId(String Gwid){
+        return baseMapper.getByGwId(Gwid);
+    }
+
+}

+ 64 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/service/dto/GwFlowDTO.java

@@ -0,0 +1,64 @@
+/**
+ * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.gwflow.service.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.jeeplus.core.excel.converter.ExcelDictDTOConverter;
+import com.jeeplus.core.excel.annotation.ExcelDictProperty;
+import com.jeeplus.core.service.dto.BaseDTO;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+/**
+ * 公文流程DTO
+ * @author 尹宇
+ * @version 2024-03-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class GwFlowDTO extends BaseDTO {
+
+	private static final long serialVersionUID = 1L;
+
+
+	/**
+     * 公文id
+     */
+	@ExcelProperty("公文id")
+	private String gwId;
+
+	/**
+     * 内容
+     */
+	@ExcelProperty("内容")
+	private String content;
+
+	/**
+     * 签名附件
+     */
+	@ExcelProperty("签名附件")
+	private String signfj;
+
+	/**
+     * 流程状态
+     */
+	@ExcelProperty(value = "流程状态", converter = ExcelDictDTOConverter.class)
+	@ExcelDictProperty("gw_flow_state")
+	private String state;
+
+	@ExcelProperty("创建人姓名")
+	private String createTruename;
+	@ExcelProperty("下一步待办人姓名")
+	private String nextTruename;
+	@ExcelProperty("下一步待办人")
+	private String nextUser;
+	@ExcelProperty("领导:1,科室承办:2,")
+	private String which;
+
+	//是否选择人提交  1是
+	private String next;
+	private String nextLeadUser;//下一步提交   领导
+	private String nextDepUser;//下一步提交   科室承办
+	private String remark;//办公室拟办的时候填写的备注
+
+}

+ 24 - 0
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/service/mapstruct/GwFlowWrapper.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
+ */
+package com.jeeplus.gwflow.service.mapstruct;
+
+
+import com.jeeplus.core.mapstruct.EntityWrapper;
+import com.jeeplus.gwflow.service.dto.GwFlowDTO;
+import com.jeeplus.gwflow.domain.GwFlow;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+
+/**
+ *  GwFlowWrapper
+ * @author 尹宇
+ * @version 2024-03-21
+ */
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
+public interface GwFlowWrapper extends EntityWrapper<GwFlowDTO, GwFlow> {
+
+    GwFlowWrapper INSTANCE = Mappers.getMapper(GwFlowWrapper.class);
+}
+

+ 1 - 1
jp-ui/src/api/circulation2/gwCirculationCard2Service.js

@@ -27,7 +27,7 @@ export default {
 
 	list: function (params) {
 		return request({
-			url: "/circulation2/gwCirculationCard2/list",
+			url: "/circulation2/gwCirculationCard2/list2",
 			method: "get",
 			params: params,
 		});

+ 60 - 0
jp-ui/src/api/gwflow/gwFlowService.js

@@ -0,0 +1,60 @@
+import request from "@/utils/httpRequest";
+
+export default {
+	save: function (inputForm) {
+		return request({
+			url: "/gwflow/gwFlow/save",
+			method: "post",
+			data: inputForm,
+		});
+	},
+
+	delete: function (ids) {
+		return request({
+			url: "/gwflow/gwFlow/delete",
+			method: "delete",
+			params: { ids: ids },
+		});
+	},
+
+	queryById: function (id) {
+		return request({
+			url: "/gwflow/gwFlow/queryById",
+			method: "get",
+			params: { id: id },
+		});
+	},
+
+	list: function (params) {
+		return request({
+			url: "/gwflow/gwFlow/list",
+			method: "get",
+			params: params,
+		});
+	},
+
+	exportTemplate: function () {
+		return request({
+			url: "/gwflow/gwFlow/import/template",
+			method: "get",
+			responseType: "blob",
+		});
+	},
+
+	exportExcel: function (params) {
+		return request({
+			url: "/gwflow/gwFlow/export",
+			method: "get",
+			params: params,
+			responseType: "blob",
+		});
+	},
+
+	importExcel: function (data) {
+		return request({
+			url: "/gwflow/gwFlow/import",
+			method: "post",
+			data: data,
+		});
+	},
+};

+ 25 - 2
jp-ui/src/views/circulation2/GwCirculationCard2Form.vue

@@ -74,12 +74,33 @@
            </el-form-item>
         </el-col>
         <el-col :span="24">
-            <el-form-item label="来文附件id" prop="attachedDocumentId"
+            <el-form-item label="来文附件" prop="attachedDocumentId"
                 :rules="[
                  ]">
 	            <image-upload v-model="inputForm.attachedDocumentId" :limit="3" tip="最多上传3个图片,单个图片不要超过10M"></image-upload>
            </el-form-item>
         </el-col>
+        <el-col :span="12">
+            <el-form-item label="备注" prop="remark"
+                :rules="[
+                 ]">
+          <el-input type="textarea" v-model="inputForm.remark" placeholder="请填写备注"     ></el-input>
+           </el-form-item>
+        </el-col>
+        <el-col :span="12">
+            <el-form-item label="状态" prop="state"
+                :rules="[
+                 ]">
+                <el-select v-model="inputForm.state" placeholder="请选择"  style="width: 100%;">
+                          <el-option
+                            v-for="item in $dictUtils.getDictList('gw_state')"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                          </el-option>
+                      </el-select>
+           </el-form-item>
+        </el-col>
         </el-row>
     </el-form>
     <template #footer>    
@@ -110,7 +131,9 @@
           writtenTime: '',
           receivingTime: '',
           contentSummary: '',
-          attachedDocumentId: ''
+          attachedDocumentId: '',
+          remark: '',
+          state: ''
         }
       }
     },

+ 21 - 2
jp-ui/src/views/circulation2/GwCirculationCard2List.vue

@@ -44,6 +44,16 @@
       <el-form-item prop="contentSummary" label="内容摘要:">
         <el-input v-model="searchForm.contentSummary" placeholder="请输入内容摘要" clearable></el-input>
 		   </el-form-item>
+      <el-form-item prop="state" label="状态:">
+        <el-select v-model="searchForm.state" placeholder="请选择状态">
+						  <el-option
+						    v-for="item in $dictUtils.getDictList('gw_state')"
+						    :key="item.value"
+						    :label="item.label"
+						    :value="item.value">
+						  </el-option>
+						</el-select>
+		   </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="refreshList()" icon="search">查询</el-button>
         <el-button type="default" @click="resetSearch()" icon="refresh-right">重置</el-button>
@@ -162,7 +172,7 @@
     <vxe-column
 		  field="attachedDocumentId"
 		  sortable
-		  title="来文附件id">
+		  title="来文附件">
 		  <template  #default="{ row }">
 		    <template v-if="row.attachedDocumentId">
 				  <el-image
@@ -173,6 +183,14 @@
 		     </template>
 		  </template>
 		</vxe-column>
+    <vxe-column
+		  field="state"
+		  sortable
+		  title="状态">
+		  <template #default="{ row }">
+				  {{ $dictUtils.getDictLabel("gw_state", row.state, '-') }}
+		  </template>
+		</vxe-column>
 		<vxe-column
 		  fixed="right"
 		  align="center"
@@ -217,7 +235,8 @@
 		    fileSource: '',
 		    writtenTime: '',
 		    receivingTime: '',
-		    contentSummary: ''
+		    contentSummary: '',
+		    state: ''
 		  },
 		  dataList: [],
 		  tablePage: {

+ 130 - 0
jp-ui/src/views/gwflow/GwFlowForm.vue

@@ -0,0 +1,130 @@
+<template>
+  <v-dialog
+    :title="title"
+    :close-on-click-modal="false"
+    v-model="visible">
+    <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'" label-width="120px">
+      <el-row  :gutter="15">
+        <el-col :span="12">
+            <el-form-item label="公文id" prop="gwId"
+                :rules="[
+                 ]">
+              <el-input v-model="inputForm.gwId" placeholder="请填写公文id"     ></el-input>
+           </el-form-item>
+        </el-col>
+        <el-col :span="12">
+            <el-form-item label="内容" prop="content"
+                :rules="[
+                 ]">
+              <el-input v-model="inputForm.content" placeholder="请填写内容"     ></el-input>
+           </el-form-item>
+        </el-col>
+        <el-col :span="24">
+            <el-form-item label="签名附件" prop="signfj"
+                :rules="[
+                 ]">
+	            <image-upload v-model="inputForm.signfj" :limit="3" tip="最多上传3个图片,单个图片不要超过10M"></image-upload>
+           </el-form-item>
+        </el-col>
+        <el-col :span="12">
+            <el-form-item label="流程状态" prop="state"
+                :rules="[
+                 ]">
+                <el-select v-model="inputForm.state" placeholder="请选择"  style="width: 100%;">
+                          <el-option
+                            v-for="item in $dictUtils.getDictList('gw_flow_state')"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                          </el-option>
+                      </el-select>
+           </el-form-item>
+        </el-col>
+        </el-row>
+    </el-form>
+    <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="visible = false" icon="circle-close">关闭</el-button>
+          <el-button  type="primary" v-if="method != 'view'" @click="doSubmit()" icon="circle-check" v-noMoreClick>确定</el-button>
+        </span>
+    </template>
+  </v-dialog>
+</template>
+
+<script>
+  import gwFlowService from '@/api/gwflow/gwFlowService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          id: '1771076298371096577',
+          gwId: '777cb67d-4d97-4366-98c7-19edc7d8919f',
+          content: '',
+          signfj: '',
+		  createTruename: '1',
+		  nextTruename: '2',
+		  nextUser: '1770356250971054081',
+		  which: '1',
+          state: '',
+
+		  next: '1',
+		  nextLeadUser: 'jld,fgld',
+		  nextDepUser: 'ks1,ks2',
+		  remark: '办公室拟办备注',
+
+        }
+      }
+    },
+    components: {
+    },
+    created () {
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm.id = id
+        if (method === 'add') {
+          this.title = `新建公文流程`
+        } else if (method === 'edit') {
+          this.title = '修改公文流程'
+        } else if (method === 'view') {
+          this.title = '查看公文流程'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          this.$refs.inputForm.resetFields()
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            gwFlowService.queryById(this.inputForm.id).then((data) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+
+
+            gwFlowService.save(this.inputForm).then((data) => {
+              this.visible = false
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      }
+    }
+  }
+</script>

+ 326 - 0
jp-ui/src/views/gwflow/GwFlowList.vue

@@ -0,0 +1,326 @@
+<template>
+  <div class="page">
+    <el-form
+      :inline="true"
+      v-if="searchVisible"
+      class="query-form m-b-10"
+      ref="searchForm"
+      :model="searchForm"
+      @keyup.enter="refreshList()"
+      @submit.prevent
+    >
+      <!-- 搜索框-->
+      <el-form-item>
+        <el-button type="primary" @click="refreshList()" icon="search">查询</el-button>
+        <el-button type="default" @click="resetSearch()" icon="refresh-right">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+		<div class="jp-table">
+		  <vxe-toolbar ref="gwFlowToolbar" :refresh="{query: refreshList}" import export print custom>
+		    <template #buttons>
+				<el-button v-if="hasPermission('gwflow:gwFlow:add')" type="primary"  icon="plus" @click="add()">新建</el-button>
+				<el-button v-if="hasPermission('gwflow:gwFlow:edit')" type="warning" icon="edit-filled" @click="edit()" v-show="$refs.gwFlowTable && $refs.gwFlowTable.getCheckboxRecords().length === 1" plain>修改</el-button>
+				<el-button v-if="hasPermission('gwflow:gwFlow:del')" type="danger"   icon="del-filled" @click="del()" v-show="$refs.gwFlowTable && $refs.gwFlowTable.getCheckboxRecords().length > 0" plain>删除</el-button>
+		    </template>
+		    <template #tools>
+		<vxe-button
+		  type="text"
+		  :title="
+		    searchVisible ? '收起检索' : '展开检索'
+		  "
+		  icon="vxe-icon-search"
+		  class="tool-btn"
+		  @click="searchVisible = !searchVisible"
+		></vxe-button>
+		<vxe-button
+		  type="text"
+		  title="下载导入模板"
+		  v-if="hasPermission('gwflow:gwFlow:import')"
+		  icon="iconfont icon-xiazaimoban1"
+		  class="tool-btn m-l-0"
+		  @click="downloadTpl()"
+		>
+		</vxe-button>
+    </template>
+		  </vxe-toolbar>
+		  <div class="jp-table-body">
+		  <vxe-table
+				border="inner"
+				auto-resize
+				resizable
+				height="auto"
+				:loading="loading"
+				size="small"
+				ref="gwFlowTable"
+				show-header-overflow
+				show-overflow
+				highlight-hover-row
+				:menu-config="{}"
+				:print-config="{}"
+  :import-config="{
+    importMethod: importMethod,
+    types: ['csv', 'xls', 'xlsx'],
+    remote: true,
+  }"
+  :export-config="{
+    remote: true,
+    filename: `公文流程数据${moment(new Date()).format(
+		'YYYY-MM-DD'
+    )}`,
+    sheetName: '公文流程数据',
+    exportMethod: exportMethod,
+    types: ['xlsx'],
+    modes: ['current', 'selected', 'all'],
+  }"
+
+				@sort-change="sortChangeHandle"
+				:sort-config="{remote:true}"
+				:data="dataList"
+				:checkbox-config="{}">
+				<vxe-column type="seq" width="40"></vxe-column>
+				<vxe-column type="checkbox"  width="40px"></vxe-column>
+    <vxe-column
+		  field="gwId"
+		  sortable
+		  title="公文id">
+				<template  #default="{ row }">
+				  <el-link  type="primary" :underline="false" v-if="hasPermission('gwflow:gwFlow:edit')" @click="edit(row.id)">{{row.gwId}}</el-link>
+				  <el-link  type="primary" :underline="false" v-else-if="hasPermission('gwflow:gwFlow:view')"  @click="view(row.id)">{{row.gwId}}</el-link>
+				  <span v-else>{{row.gwId}}</span>
+				</template>
+		</vxe-column>
+    <vxe-column
+		  field="content"
+		  sortable
+		  title="内容">
+		</vxe-column>
+    <vxe-column
+		  field="signfj"
+		  sortable
+		  title="签名附件">
+		  <template  #default="{ row }">
+		    <template v-if="row.signfj">
+				  <el-image
+				    style="height: 50px;width:50px;margin-right:10px;"
+				    :src="src" v-for="(src, index) in row.signfj.split(',')" :key="index"
+				    :preview-src-list="row.signfj.split(',')">
+				  </el-image>
+		     </template>
+		  </template>
+		</vxe-column>
+    <vxe-column
+		  field="state"
+		  sortable
+		  title="流程状态">
+		  <template #default="{ row }">
+				  {{ $dictUtils.getDictLabel("gw_flow_state", row.state, '-') }}
+		  </template>
+		</vxe-column>
+    <vxe-column
+		  field="createBy.id"
+		  sortable
+		  title="创建者">
+		</vxe-column>
+		<vxe-column
+		  fixed="right"
+		  align="center"
+		  width="200"
+		  title="操作">
+		  <template   #default="{ row }">
+		    <el-button v-if="hasPermission('gwflow:gwFlow:view')" type="primary" text icon="view-filled" @click="view(row.id)">查看</el-button>
+		    <el-button v-if="hasPermission('gwflow:gwFlow:edit')" type="primary" text icon="edit-filled" @click="edit(row.id)">修改</el-button>
+		    <el-button v-if="hasPermission('gwflow:gwFlow:del')"  type="danger"  text icon="del-filled" @click="del(row.id)">删除</el-button>
+		  </template>
+		</vxe-column>
+    </vxe-table>
+    <vxe-pager
+		background
+		size="small"
+		:current-page="tablePage.currentPage"
+		:page-size="tablePage.pageSize"
+		:total="tablePage.total"
+		:page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+		:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+		@page-change="currentChangeHandle">
+    </vxe-pager>
+    </div>
+    </div>
+		  <!-- 弹窗, 新增 / 修改 -->
+    <GwFlowForm  ref="gwFlowForm" @refreshDataList="refreshList"></GwFlowForm>
+  </div>
+</template>
+
+<script>
+  import GwFlowForm from './GwFlowForm'
+  import gwFlowService from '@/api/gwflow/gwFlowService'
+  export default {
+    data () {
+		return {
+		  searchVisible: true,
+		  searchForm: {
+		  },
+		  dataList: [],
+		  tablePage: {
+		    total: 0,
+		    currentPage: 1,
+		    pageSize: 10,
+		    orders: [{ column: "create_time", asc: false }],
+		  },
+		  loading: false
+		}
+    },
+    components: {
+		GwFlowForm
+    },
+    created () {
+    },    
+    mounted () {
+		this.$nextTick(() => {
+		  // 将表格和工具栏进行关联
+		  const $table = this.$refs.gwFlowTable
+		  const $toolbar = this.$refs.gwFlowToolbar
+		  $table.connect($toolbar)
+		})
+    }, 
+    activated () {
+		this.refreshList()
+    },
+    methods: {
+		// 获取数据列表
+		refreshList () {
+		  this.loading = true
+		  gwFlowService.list({
+		    'current': this.tablePage.currentPage,
+		    'size': this.tablePage.pageSize,
+		    'orders': this.tablePage.orders,
+		    ...this.searchForm
+		  }).then((data) => {
+		    this.dataList = data.records
+		    this.tablePage.total = data.total
+		    this.loading = false
+		  })
+		},
+		// 当前页
+		currentChangeHandle ({ currentPage, pageSize }) {
+		  this.tablePage.currentPage = currentPage
+		  this.tablePage.pageSize = pageSize
+		  this.refreshList()
+		},
+		// 排序
+    sortChangeHandle(obj) {
+		  this.tablePage.orders = [];
+		  if (obj.order != null) {
+		    this.tablePage.orders = [{ column: obj.column.sortBy || this.$utils.toLine(obj.property), asc: obj.order === "asc" }];
+		  } else {
+		    this.tablePage.orders = [{ column: "create_time", asc: false }];
+		  }
+		  this.refreshList();
+		},
+		// 新增
+		add () {
+		  this.$refs.gwFlowForm.init('add', '')
+		},
+		// 修改
+		edit (id) {
+		  id = id || this.$refs.gwFlowTable.getCheckboxRecords().map(item => {
+		    return item.id
+		  })[0]
+		  this.$refs.gwFlowForm.init('edit', id)
+		},
+		// 查看
+		view (id) {
+		  this.$refs.gwFlowForm.init('view', id)
+		},
+		// 删除
+		del (id) {
+		  let ids = id || this.$refs.gwFlowTable.getCheckboxRecords().map(item => {
+		    return item.id
+		  }).join(',')
+		  this.$confirm(`确定删除所选项吗?`, '提示', {
+		    confirmButtonText: '确定',
+		    cancelButtonText: '取消',
+		    type: 'warning'
+		  }).then(() => {
+		    this.loading = true
+		    gwFlowService.delete(ids).then((data) => {
+				this.$message.success(data)
+				this.refreshList()
+				this.loading = false
+		    })
+		  })
+		},
+		// 下载模板
+		downloadTpl() {
+		this.loading = true
+		gwFlowService
+		  .exportTemplate()
+		  .then((data) => {
+		    // 将二进制流文件写入excel表,以下为重要步骤
+		    this.$utils.downloadExcel(data, "公文流程导入模板");
+		    this.loading = false
+		  })
+		  .catch(function (err) {
+				this.loading = false
+		    if (err.response) {
+				console.log(err.response);
+		    }
+		  });
+    },
+    // 自定义服务端导入
+    importMethod({ file }) {
+		// 处理表单
+		const formBody = new FormData();
+		formBody.append("file", file);
+		this.loading = true
+		gwFlowService.importExcel(formBody).then((result) => {
+		  this.$message.success({
+		    dangerouslyUseHTMLString: true,
+		    message: result,
+		  });
+		  this.refreshList();
+		});
+    },
+    // 自定义服务端导出
+    exportMethod({ options }) {
+		// 传给服务端的参数
+		const params = {
+		  current: this.tablePage.currentPage,
+		  size: this.tablePage.pageSize,
+		  orders: this.tablePage.orders,
+		  ...this.searchForm,
+		  filename: options.filename,
+		  sheetName: options.sheetName,
+		  isHeader: options.isHeader,
+		  original: options.original,
+		  mode: options.mode,
+		  selectIds:
+		    options.mode === "selected"
+				? options.data.map((item) => item.id)
+				: [],
+		  exportFields: options.columns.map(
+		    (column) => column.property && column.property.split(".")[0]
+		  ),
+		};
+		this.loading = true;
+		return gwFlowService
+		  .exportExcel(params)
+		  .then((data) => {
+		    // 将二进制流文件写入excel表,以下为重要步骤
+		    this.$utils.downloadExcel(data, options.filename);
+		    this.loading = false;
+		  })
+		  .catch(function (err) {
+		    if (err.response) {
+				console.log(err.response);
+		    }
+		  });
+    },
+		resetSearch () {
+		  this.$refs.searchForm.resetFields()
+		  this.refreshList()
+		}
+    }
+  }
+</script>
+