Bläddra i källkod

-支部成员管理导入导出

jiangbiao 2 år sedan
förälder
incheckning
363210f5c8
23 ändrade filer med 2114 tillägg och 479 borttagningar
  1. 2 11
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  2. 336 49
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/branch/TBranchMemberController.java
  3. 113 54
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  4. BIN
      ruoyi-admin/src/main/resources/static/template/dymc.xlsx
  5. BIN
      ruoyi-admin/src/main/resources/static/template/jjfz&fzdxmc.xlsx
  6. BIN
      ruoyi-admin/src/main/resources/static/template/wyhmc.xlsx
  7. 60 4
      ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
  8. 309 0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ExcelUtils.java
  9. 1 1
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  10. 215 164
      ruoyi-system/src/main/java/com/ruoyi/branch/domain/TBranchMember.java
  11. 204 0
      ruoyi-system/src/main/java/com/ruoyi/branch/domain/vo/TBranchDyVo.java
  12. 275 0
      ruoyi-system/src/main/java/com/ruoyi/branch/domain/vo/TBranchJjfzFzdxVo.java
  13. 204 0
      ruoyi-system/src/main/java/com/ruoyi/branch/domain/vo/TBranchWyhVo.java
  14. 15 8
      ruoyi-system/src/main/java/com/ruoyi/branch/mapper/TBranchMemberMapper.java
  15. 14 8
      ruoyi-system/src/main/java/com/ruoyi/branch/service/ITBranchMemberService.java
  16. 26 8
      ruoyi-system/src/main/java/com/ruoyi/branch/service/impl/TBranchMemberServiceImpl.java
  17. 167 6
      ruoyi-system/src/main/resources/mapper/branch/TBranchMemberMapper.xml
  18. 24 21
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  19. 37 36
      ruoyi-ui/src/views/branch/zbjs/dymc/index.vue
  20. 37 36
      ruoyi-ui/src/views/branch/zbjs/fzdxmc/index.vue
  21. 37 36
      ruoyi-ui/src/views/branch/zbjs/sqrjjfzmc/index.vue
  22. 37 36
      ruoyi-ui/src/views/branch/zbjs/wyhmc/index.vue
  23. 1 1
      ruoyi-ui/vue.config.js

+ 2 - 11
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -6,7 +6,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
 
 /**
  * 启动程序
- * 
+ *
  * @author ruoyi
  */
 @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@@ -16,15 +16,6 @@ public class RuoYiApplication
     {
         // System.setProperty("spring.devtools.restart.enabled", "false");
         SpringApplication.run(RuoYiApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  若依启动成功   ლ(´ڡ`ლ)゙  \n" +
-                " .-------.       ____     __        \n" +
-                " |  _ _   \\      \\   \\   /  /    \n" +
-                " | ( ' )  |       \\  _. /  '       \n" +
-                " |(_ o _) /        _( )_ .'         \n" +
-                " | (_,_).' __  ___(_ o _)'          \n" +
-                " |  |\\ \\  |  ||   |(_,_)'         \n" +
-                " |  | \\ `'   /|   `-'  /           \n" +
-                " |  |  \\    /  \\      /           \n" +
-                " ''-'   `'-'    `-..-'              ");
+        System.out.println("(♥◠‿◠)ノ゙  若依启动成功   ლ(´ڡ`ლ)゙  ");
     }
 }

+ 336 - 49
ruoyi-admin/src/main/java/com/ruoyi/web/controller/branch/TBranchMemberController.java

@@ -1,19 +1,32 @@
 package com.ruoyi.web.controller.branch;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.servlet.http.HttpServletResponse;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
 import com.ruoyi.branch.domain.TBranchMemTransfer;
+import com.ruoyi.branch.domain.TBranchMember;
 import com.ruoyi.branch.domain.approve.DevTask;
+import com.ruoyi.branch.domain.vo.TBranchDyVo;
+import com.ruoyi.branch.domain.vo.TBranchJjfzFzdxVo;
+import com.ruoyi.branch.domain.vo.TBranchWyhVo;
 import com.ruoyi.branch.service.ITBranchMemTransferService;
+import com.ruoyi.branch.service.ITBranchMemberService;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.SysPost;
+import com.ruoyi.system.service.ISysDeptService;
+import com.ruoyi.system.service.ISysDictTypeService;
+import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysUserService;
 import org.activiti.engine.ProcessEngine;
 import org.activiti.engine.ProcessEngines;
@@ -22,23 +35,20 @@ import org.activiti.engine.TaskService;
 import org.activiti.engine.impl.identity.Authentication;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
-import org.springframework.security.access.prepost.PreAuthorize;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.annotation.Log;
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.branch.domain.TBranchMember;
-import com.ruoyi.branch.service.ITBranchMemberService;
-import com.ruoyi.common.utils.poi.ExcelUtil;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * 支部成员管理Controller
@@ -48,8 +58,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
  */
 @RestController
 @RequestMapping("/branch/member")
-public class TBranchMemberController extends BaseController
-{
+public class TBranchMemberController extends BaseController {
     @Autowired
     private ITBranchMemberService tBranchMemberService;
 
@@ -62,6 +71,15 @@ public class TBranchMemberController extends BaseController
     @Autowired
     private ITBranchMemTransferService transferService;
 
+    @Autowired
+    private ISysDictTypeService sysDictTypeService;
+
+    @Autowired
+    private ISysDeptService sysDeptService;
+
+    @Autowired
+    private ISysPostService sysPostService;
+
     /**
      * 审批处理
      *
@@ -135,8 +153,7 @@ public class TBranchMemberController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('branch:member:edit')")
     @PutMapping("/apply")
-    public AjaxResult apply(@RequestBody TBranchMember tBranchMember)
-    {
+    public AjaxResult apply(@RequestBody TBranchMember tBranchMember) {
         String userId = getUserId().toString();
 
         // 开始流程
@@ -180,8 +197,7 @@ public class TBranchMemberController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('branch:member:list')")
     @GetMapping("/listPoliticalBirthday")
-    public AjaxResult listPoliticalBirthday(TBranchMember tBranchMember)
-    {
+    public AjaxResult listPoliticalBirthday(TBranchMember tBranchMember) {
         return AjaxResult.success(tBranchMemberService.selectPoliticalBirthdayList(tBranchMember));
     }
 
@@ -190,8 +206,7 @@ public class TBranchMemberController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('branch:member:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TBranchMember tBranchMember)
-    {
+    public TableDataInfo list(TBranchMember tBranchMember) {
         startPage();
         List<TBranchMember> list = tBranchMemberService.selectTBranchMemberList(tBranchMember);
         TableDataInfo dataTable = getDataTable(list);
@@ -205,11 +220,60 @@ public class TBranchMemberController extends BaseController
     @PreAuthorize("@ss.hasPermi('branch:member:export')")
     @Log(title = "支部成员管理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, TBranchMember tBranchMember)
-    {
-        List<TBranchMember> list = tBranchMemberService.selectTBranchMemberList(tBranchMember);
-        ExcelUtil<TBranchMember> util = new ExcelUtil<TBranchMember>(TBranchMember.class);
-        util.exportExcel(response, list, "支部成员管理数据");
+    public void export(HttpServletResponse response, TBranchMember tBranchMember) {
+        if ("1".equals(tBranchMember.getMemberType())) {
+            List<TBranchJjfzFzdxVo> list = tBranchMemberService.selectTBranchJjfzFzdxVoList(tBranchMember);
+            for (TBranchJjfzFzdxVo vo : list) {
+                if (StringUtils.isNotEmpty(vo.getCurrentMentor())) {
+                    String name = "";
+                    for (String s : vo.getCurrentMentor().split(",")) {
+                        SysUser sysUser = userService.selectUserById(Long.valueOf(s));
+                        name += sysUser.getNickName() + "、";
+                    }
+                    vo.setCurrentMentor(name.substring(0, name.length() - 1));
+                }
+            }
+            ExcelUtil<TBranchJjfzFzdxVo> util = new ExcelUtil<TBranchJjfzFzdxVo>(TBranchJjfzFzdxVo.class);
+            util.exportExcel(response, list, "积极分子名册数据");
+        } else if ("4".equals(tBranchMember.getMemberType())) {
+            List<TBranchJjfzFzdxVo> list = tBranchMemberService.selectTBranchJjfzFzdxVoList(tBranchMember);
+            for (TBranchJjfzFzdxVo vo : list) {
+                if (StringUtils.isNotEmpty(vo.getCurrentMentor())) {
+                    String name = "";
+                    for (String s : vo.getCurrentMentor().split(",")) {
+                        SysUser sysUser = userService.selectUserById(Long.valueOf(s));
+                        name += sysUser.getNickName() + "、";
+                    }
+                    vo.setCurrentMentor(name.substring(0, name.length() - 1));
+                }
+            }
+            ExcelUtil<TBranchJjfzFzdxVo> util = new ExcelUtil<TBranchJjfzFzdxVo>(TBranchJjfzFzdxVo.class);
+            util.exportExcel(response, list, "发展对象名册数据");
+        } else if ("2".equals(tBranchMember.getMemberType())) {
+            List<TBranchDyVo> list = tBranchMemberService.selectTBranchDyVoList(tBranchMember);
+            ExcelUtil<TBranchDyVo> util = new ExcelUtil<TBranchDyVo>(TBranchDyVo.class);
+            util.exportExcel(response, list, "党员名册数据");
+        } else if ("3".equals(tBranchMember.getMemberType())) {
+            List<TBranchWyhVo> list = tBranchMemberService.selectTBranchWyhVoList(tBranchMember);
+            for (TBranchWyhVo vo : list) {
+                if (CollectionUtils.isNotEmpty(vo.getPosts())) {
+                    String postName = "";
+                    for (SysPost post : vo.getPosts()) {
+                        postName += post.getPostName() + "兼";
+                    }
+                    vo.setPost(postName.substring(0, postName.length() - 1));
+                }
+                if (CollectionUtils.isNotEmpty(vo.getRoles())) {
+                    String roleName = "";
+                    for (SysRole role : vo.getRoles()) {
+                        roleName += role.getRoleName() + "兼";
+                    }
+                    vo.setRole(roleName.substring(0, roleName.length() - 1));
+                }
+            }
+            ExcelUtil<TBranchWyhVo> util = new ExcelUtil<TBranchWyhVo>(TBranchWyhVo.class);
+            util.exportExcel(response, list, "委员会名册数据");
+        }
     }
 
     /**
@@ -217,8 +281,7 @@ public class TBranchMemberController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('branch:member:query')")
     @GetMapping(value = "/{memberId}")
-    public AjaxResult getInfo(@PathVariable("memberId") Long memberId)
-    {
+    public AjaxResult getInfo(@PathVariable("memberId") Long memberId) {
         return success(tBranchMemberService.selectTBranchMemberByMemberId(memberId));
     }
 
@@ -228,11 +291,7 @@ public class TBranchMemberController extends BaseController
     @PreAuthorize("@ss.hasPermi('branch:member:add')")
     @Log(title = "支部成员管理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TBranchMember tBranchMember)
-    {
-        Long userId = getUserId();
-        Long deptId = userService.selectUserById(userId).getDeptId();
-        tBranchMember.setDeptId(deptId);
+    public AjaxResult add(@RequestBody TBranchMember tBranchMember) {
         return toAjax(tBranchMemberService.insertTBranchMember(tBranchMember));
     }
 
@@ -242,8 +301,7 @@ public class TBranchMemberController extends BaseController
     @PreAuthorize("@ss.hasPermi('branch:member:edit')")
     @Log(title = "支部成员管理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TBranchMember tBranchMember)
-    {
+    public AjaxResult edit(@RequestBody TBranchMember tBranchMember) {
         return toAjax(tBranchMemberService.updateTBranchMember(tBranchMember));
     }
 
@@ -252,9 +310,238 @@ public class TBranchMemberController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('branch:member:remove')")
     @Log(title = "支部成员管理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{memberIds}")
-    public AjaxResult remove(@PathVariable Long[] memberIds)
-    {
+    @DeleteMapping("/{memberIds}")
+    public AjaxResult remove(@PathVariable Long[] memberIds) {
         return toAjax(tBranchMemberService.deleteTBranchMemberByMemberIds(memberIds));
     }
+
+    @PostMapping("/importData/{memberType}")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file, @PathVariable String memberType) throws IOException {
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TBranchMember> list = new ArrayList<>();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        int failNumber = 0;
+        //字典查询
+        List<SysDictData> educationLevel = sysDictTypeService.selectDictDataByType("member_education_level");
+        List<SysDept> sysDepts = sysDeptService.selectAllDeptList(new SysDept());
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getLastCellNum();
+                TBranchMember entity = new TBranchMember();
+                entity.setMemberType(memberType);
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    if (cell == null) {
+                        continue;
+                    }
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        // 党支部
+                        for (SysDept sysDept : sysDepts) {
+                            if (sysDept.getDeptName().contains(cellValue)) {
+                                entity.setDeptId(sysDept.getDeptId());
+                            }
+                        }
+                    } else if (j == 1) {
+                        // 委员会或党员名册导入时第二列为姓名
+                        if ("2".equals(memberType) || "3".equals(memberType)) {
+                            SysUser sysUser = new SysUser();
+                            sysUser.setNickName(cellValue);
+                            List<SysUser> sysUsers = userService.selectUserList(sysUser);
+                            if (CollectionUtils.isEmpty(sysUsers) || sysUsers.size() > 1) {
+                                failNumber++;
+                                failRow.add(i + 1);
+                                break;
+                            }
+                            //姓名
+                            entity.setUserId(sysUsers.get(0).getUserId());
+                        } else {
+                            //积极分子或发展对象为工号
+                            entity.setStaffId(cellValue);
+                        }
+                    } else if (j == 2) {
+                        // 积极分子或发展对象为姓名
+                        if ("4".equals(memberType) || "1".equals(memberType)) {
+
+                            SysUser sysUser = new SysUser();
+                            sysUser.setNickName(cellValue);
+                            List<SysUser> sysUsers = userService.selectUserList(sysUser);
+                            if (CollectionUtils.isEmpty(sysUsers) || sysUsers.size() > 1) {
+                                failNumber++;
+                                failRow.add(i + 1);
+                                break;
+                            }
+                            //姓名
+                            entity.setUserId(sysUsers.get(0).getUserId());
+                        }
+                    } else if (j == 3) {
+                        if ("2".equals(memberType) || "3".equals(memberType)) {
+                            //出生年月
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setBirthday(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 4) {
+                        if ("2".equals(memberType) || "3".equals(memberType)) {
+                            // 学历
+                            for (SysDictData data : educationLevel) {
+                                if (data.getDictLabel().equals(cellValue)) {
+                                    entity.setEducationLevel(data.getDictValue());
+                                }
+                            }
+                        } else {
+                            entity.setEthnic(cellValue);//民族
+                        }
+                    } else if (j == 5) {
+                        if ("2".equals(memberType)) {
+                            // 参加工作时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setWorkJoinTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        } else if ("3".equals(memberType)) {
+                            // 入职时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setWorkEntryTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        } else {
+                            //出生年月
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setBirthday(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 6) {
+                        if ("1".equals(memberType) || "4".equals(memberType)) {
+                            // 参加工作时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setWorkJoinTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        } else if ("2".equals(memberType)) {
+                            // 入党时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setPartyEntryTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 7) {
+                        if ("1".equals(memberType) || "4".equals(memberType)) {
+                            // 入BYC时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setWorkEntryTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        } else if ("3".equals(memberType)) {
+                            // 入党时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setPartyEntryTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        } else {
+                            // 联系方式
+                            entity.setPhonenumber(cellValue);
+                        }
+                    } else if (j == 8) {
+                        if ("1".equals(memberType) || "4".equals(memberType)) {
+                            // 学历
+                            for (SysDictData data : educationLevel) {
+                                if (data.getDictLabel().equals(cellValue)) {
+                                    entity.setEducationLevel(data.getDictValue());
+                                }
+                            }
+                        } else if ("2".equals(memberType)) {
+                            // 调进时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setEntryTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 9) {
+                        if ("2".equals(memberType)) {
+                            // 调出时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setLeaveTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        } else if ("3".equals(memberType)) {
+                            // 任职时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setLabourEntryTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        } else {
+                            // 是否团员
+                            entity.setIsLeague("是".equals(cellValue) ? "1" : "0");
+                        }
+                    } else if (j == 10) {
+                        if ("2".equals(memberType)) {
+                            // 备注
+                            entity.setRemarks(cellValue);
+                        } else if ("3".equals(memberType)) {
+                            // 离职时间
+                            if (StringUtils.isNotEmpty(cellValue))
+                                entity.setLabourLeaveTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                        }
+                    } else if (j == 11) {
+                        // 申请入党时间
+                        if (StringUtils.isNotEmpty(cellValue))
+                            entity.setApplyTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                    } else if (j == 12) {
+                        //建表考察时间
+                        if (StringUtils.isNotEmpty(cellValue))
+                            entity.setFormCreateTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                    } else if (j == 13) {
+                        // 现培养人
+                        if (StringUtils.isNotEmpty(cellValue)) {
+                            String[] names = cellValue.split("、");
+                            String userIds = null;
+                            for (String name : names) {
+                                SysUser sysUser = new SysUser();
+                                sysUser.setNickName(name);
+                                List<SysUser> sysUsers = userService.selectUserList(sysUser);
+                                if (CollectionUtils.isNotEmpty(sysUsers) && sysUsers.size() == 1) {
+                                    userIds += sysUsers.get(0).getUserId() + ",";
+                                }
+                            }
+                            if (StringUtils.isNotEmpty(userIds))
+                                entity.setCurrentMentor(userIds.substring(0, userIds.length() - 1));
+                        }
+                    } else if (j == 14) {
+                        // 计划发展时间
+                        if (StringUtils.isNotEmpty(cellValue))
+                            entity.setPlanDevelopDuration(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                    } else if (j == 15) {
+                        // 是否参加过入党前培训
+                        entity.setIsTrained("是".equals(cellValue) ? "1" : "0");
+                    } else if (j == 16) {
+                        // 备注
+                        entity.setRemarks(cellValue);
+                    }
+
+                }
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + JSON.toJSONString(e));
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TBranchMember t : list) {
+            failNum++;
+            try {
+                TBranchMember tBranchMember = new TBranchMember();
+                tBranchMember.setUserId(t.getUserId());
+                tBranchMember.setMemberType(memberType);
+                tBranchMember.setBirthday(t.getBirthday());
+                if (CollectionUtils.isEmpty(tBranchMemberService.selectTBranchMemberList(tBranchMember))) {
+                    add(t);
+                    successNumber++;
+                } else {
+                    failNumber++;
+                    logger.info("======================数据已存在");
+                    failRow.add(failNum + 1);
+                }
+            } catch (Exception e) {
+                failNumber++;
+                logger.info("e:" + e);
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + successNumber);
+        logger.info("failNumber:" + failNumber);
+        logger.info("failRow:" + failRow);
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
 }

+ 113 - 54
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -1,18 +1,5 @@
 package com.ruoyi.web.controller.common;
 
-import java.util.ArrayList;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
 import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -20,16 +7,31 @@ import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.framework.config.ServerConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 通用请求处理
- * 
+ *
  * @author ruoyi
  */
 @RestController
 @RequestMapping("/common")
-public class CommonController
-{
+public class CommonController {
     private static final Logger log = LoggerFactory.getLogger(CommonController.class);
 
     @Autowired
@@ -39,17 +41,14 @@ public class CommonController
 
     /**
      * 通用下载请求
-     * 
+     *
      * @param fileName 文件名称
-     * @param delete 是否删除
+     * @param delete   是否删除
      */
     @GetMapping("/download")
-    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(fileName))
-            {
+    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
+        try {
+            if (!FileUtils.checkAllowDownload(fileName)) {
                 throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
             }
             String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
@@ -58,13 +57,10 @@ public class CommonController
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, realFileName);
             FileUtils.writeBytes(filePath, response.getOutputStream());
-            if (delete)
-            {
+            if (delete) {
                 FileUtils.deleteFile(filePath);
             }
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("下载文件失败", e);
         }
     }
@@ -73,10 +69,8 @@ public class CommonController
      * 通用上传请求(单个)
      */
     @PostMapping("/upload")
-    public AjaxResult uploadFile(MultipartFile file) throws Exception
-    {
-        try
-        {
+    public AjaxResult uploadFile(MultipartFile file) throws Exception {
+        try {
             // 上传文件路径
             String filePath = RuoYiConfig.getUploadPath();
             // 上传并返回新文件名称
@@ -88,9 +82,7 @@ public class CommonController
             ajax.put("newFileName", FileUtils.getName(fileName));
             ajax.put("originalFilename", file.getOriginalFilename());
             return ajax;
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             return AjaxResult.error(e.getMessage());
         }
     }
@@ -99,18 +91,15 @@ public class CommonController
      * 通用上传请求(多个)
      */
     @PostMapping("/uploads")
-    public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
-    {
-        try
-        {
+    public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
+        try {
             // 上传文件路径
             String filePath = RuoYiConfig.getUploadPath();
             List<String> urls = new ArrayList<String>();
             List<String> fileNames = new ArrayList<String>();
             List<String> newFileNames = new ArrayList<String>();
             List<String> originalFilenames = new ArrayList<String>();
-            for (MultipartFile file : files)
-            {
+            for (MultipartFile file : files) {
                 // 上传并返回新文件名称
                 String fileName = FileUploadUtils.upload(filePath, file);
                 String url = serverConfig.getUrl() + fileName;
@@ -125,9 +114,7 @@ public class CommonController
             ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
             ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
             return ajax;
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             return AjaxResult.error(e.getMessage());
         }
     }
@@ -137,12 +124,9 @@ public class CommonController
      */
     @GetMapping("/download/resource")
     public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
-            throws Exception
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(resource))
-            {
+            throws Exception {
+        try {
+            if (!FileUtils.checkAllowDownload(resource)) {
                 throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
             }
             // 本地资源路径
@@ -154,10 +138,85 @@ public class CommonController
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, downloadName);
             FileUtils.writeBytes(downloadPath, response.getOutputStream());
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("下载文件失败", e);
         }
     }
+
+
+    /**
+     * 导入下载模板
+     */
+    @RequestMapping("/template")
+    @ResponseBody
+    public void template(String type, HttpServletRequest request, HttpServletResponse response) throws IOException {
+        String downloadname = "";
+        String url = "";
+        switch (type) {
+            case "wyhmc":
+                downloadname = "委员会名册导入模板.xlsx";
+                url = "static/template/wyhmc.xlsx";
+                break;
+            case "dymc":
+                downloadname = "党员名册导入模板.xlsx";
+                url = "static/template/dymc.xlsx";
+                break;
+            case "jjfzmc":
+                downloadname = "积极分子名册导入模板.xlsx";
+                url = "static/template/jjfz&fzdxmc.xlsx";
+                break;
+            case "fzdxmc":
+                downloadname = "发展对象名册导入模板.xlsx";
+                url = "static/template/jjfz&fzdxmc.xlsx";
+                break;
+        }
+        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(url);
+
+        downloadFile(downloadname, is, request, response);
+    }
+
+    public static void downloadFile(String filename, InputStream is, HttpServletRequest request, HttpServletResponse response) throws IOException {
+        response.reset();
+        if (filename.endsWith(".doc") || filename.endsWith(".docx")) {
+            response.setContentType("application/msword;charset=utf-8");
+        } else if (filename.endsWith(".xls") || filename.endsWith(".xlsx")) {
+            response.setContentType("application/vnd.ms-excel;charset=utf-8");
+        } else {
+            response.setHeader("content-type", "application/octet-stream");
+        }
+        //下载文件的名称
+        response.setHeader("Content-Disposition", "attachment;filename=" + new String(filename.getBytes("UTF-8"), "iso-8859-1"));
+        request.setCharacterEncoding("UTF-8");
+
+        ServletOutputStream out = null;
+        BufferedInputStream bis = null;
+        BufferedOutputStream bos = null;
+        try {
+            out = response.getOutputStream();
+            bis = new BufferedInputStream(is);
+            bos = new BufferedOutputStream(out);
+            byte[] buff = new byte[2048];
+            int bytesRead;
+            while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
+                bos.write(buff, 0, bytesRead);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (bis != null) {
+                    bis.close();
+                }
+                if (bos != null) {
+                    bos.close();
+                }
+                if (is != null) {
+                    is.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
 }

BIN
ruoyi-admin/src/main/resources/static/template/dymc.xlsx


BIN
ruoyi-admin/src/main/resources/static/template/jjfz&fzdxmc.xlsx


BIN
ruoyi-admin/src/main/resources/static/template/wyhmc.xlsx


+ 60 - 4
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -9,11 +9,13 @@ import java.time.LocalTime;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
 import java.util.Date;
+import java.util.regex.Pattern;
+
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 /**
  * 时间工具类
- * 
+ *
  * @author ruoyi
  */
 public class DateUtils extends org.apache.commons.lang3.time.DateUtils
@@ -29,13 +31,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
 
     private static String[] parsePatterns = {
-            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", 
+            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
             "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
             "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
 
     /**
      * 获取当前Date型日期
-     * 
+     *
      * @return Date() 当前日期
      */
     public static Date getNowDate()
@@ -45,7 +47,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
 
     /**
      * 获取当前日期, 默认格式为yyyy-MM-dd
-     * 
+     *
      * @return String
      */
     public static String getDate()
@@ -188,4 +190,58 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
         return Date.from(zdt.toInstant());
     }
+
+    public static String getDateFormat(String str) {
+        boolean year = false;
+        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
+        if (pattern.matcher(str.substring(0, 4)).matches()) {
+            year = true;
+        }
+        StringBuilder sb = new StringBuilder();
+        int index = 0;
+        if (!year) {
+            if (str.contains("月") || str.contains("-") || str.contains("/") || str.contains(".")) {
+                if (Character.isDigit(str.charAt(0))) {
+                    index = 1;
+                }
+            } else {
+                index = 3;
+            }
+        }
+        for (int i = 0; i < str.length(); i++) {
+            char chr = str.charAt(i);
+            if (Character.isDigit(chr)) {
+                if (index == 0) {
+                    sb.append("y");
+                }
+                if (index == 1) {
+                    sb.append("M");
+                }
+                if (index == 2) {
+                    sb.append("d");
+                }
+                if (index == 3) {
+                    sb.append("H");
+                }
+                if (index == 4) {
+                    sb.append("m");
+                }
+                if (index == 5) {
+                    sb.append("s");
+                }
+                if (index == 6) {
+                    sb.append("S");
+                }
+            } else {
+                if (i > 0) {
+                    char lastChar = str.charAt(i - 1);
+                    if (Character.isDigit(lastChar)) {
+                        index++;
+                    }
+                }
+                sb.append(chr);
+            }
+        }
+        return sb.toString();
+    }
 }

+ 309 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ExcelUtils.java

@@ -0,0 +1,309 @@
+package com.ruoyi.common.utils.file;
+
+
+import org.apache.poi.hssf.usermodel.HSSFDataFormat;
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by Administrator on 2018/7/26 0026.
+ */
+public class ExcelUtils {
+
+    public static Workbook getWorkBook(MultipartFile file) {
+        //获得文件名
+        String fileName = file.getOriginalFilename();
+        //创建Workbook工作薄对象,表示整个excel
+        Workbook workbook = null;
+        try {
+            //获取excel文件的io流
+            InputStream is = file.getInputStream();
+            //根据文件后缀名不同(xls和xlsx)获得不同的Workbook实现类对象
+            if (fileName.endsWith("xls")) {
+                //2003
+                workbook = new HSSFWorkbook(is);
+            } else if (fileName.endsWith("xlsx")) {
+                //2007 及2007以上
+                workbook = new XSSFWorkbook(is);
+            }
+        } catch (IOException e) {
+//            log.error(e.getMessage());
+        }
+        return workbook;
+    }
+
+    public static Workbook getWorkBook(File file) {
+        //获得文件名
+        String fileName = file.getName();
+        //创建Workbook工作薄对象,表示整个excel
+        Workbook workbook = null;
+        try {
+            //获取excel文件的io流
+            InputStream is =new FileInputStream(file);
+            //根据文件后缀名不同(xls和xlsx)获得不同的Workbook实现类对象
+            if (fileName.endsWith("xls")) {
+                //2003
+                workbook = new HSSFWorkbook(is);
+            } else if (fileName.endsWith("xlsx")) {
+                //2007 及2007以上
+                workbook = new XSSFWorkbook(is);
+            }
+        } catch (IOException e) {
+//            log.error(e.getMessage());
+        }
+        return workbook;
+    }
+
+    public static String getCellValue(Cell cell) {
+        String cellValue = "";
+        if (cell == null) {
+            return cellValue;
+        }
+        System.out.println("Excel格式:"+ cell.getCellType().name());
+
+        switch (cell.getCellType().name()) {
+            case "STRING":
+                cellValue = cell.getRichStringCellValue().getString();
+                break;
+            case "NUMERIC":
+                System.out.println("Excel数据样式:"+ cell.getCellStyle().getDataFormatString());
+                if("General".equals(cell.getCellStyle().getDataFormatString())){
+                    cellValue = new BigDecimal(cell.getNumericCellValue()).toPlainString();
+                }else if("m/d/yyyy;@".equals(cell.getCellStyle().getDataFormatString())){
+                    cellValue =  new SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue());
+                }else if("@".equals(cell.getCellStyle().getDataFormatString())){
+                    cellValue = cell.getNumericCellValue() + "";
+                }else if(cell.getCellStyle().getDataFormatString().indexOf("0_") > -1){
+                    //数字非日期
+                    System.out.println("Excel值:"+ cell.getNumericCellValue());
+                    cellValue = cell.getNumericCellValue() + "";
+                }else{
+                    try {
+                        cellValue =  new SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue());
+                    }catch (Exception e){
+                        cellValue = cell.getNumericCellValue() + "";
+                    }
+                }
+                break;
+            case "BLANK":
+                cellValue = "";
+                break;
+            default:
+                cellValue = cell.toString();
+                break;
+        }
+        //判断数据的类型
+//        switch (cell.getCellType()) {
+//            case Cell.CELL_TYPE_NUMERIC: //数字
+//                cellValue = stringDateProcess(cell);
+//                break;
+//            case Cell.CELL_TYPE_STRING: //字符串
+//                cellValue = String.valueOf(cell.getStringCellValue());
+//                break;
+//            case Cell.CELL_TYPE_BOOLEAN: //Boolean
+//                cellValue = String.valueOf(cell.getBooleanCellValue());
+//                break;
+//            case Cell.CELL_TYPE_FORMULA: //公式
+//                cellValue = String.valueOf(cell.getCellFormula());
+//                break;
+//            case Cell.CELL_TYPE_BLANK: //空值
+//                cellValue = "";
+//                break;
+//            case Cell.CELL_TYPE_ERROR: //故障
+//                cellValue = "非法字符";
+//                break;
+//            default:
+//                cellValue = "未知类型";
+//                break;
+//        }
+//        cellValue = String.valueOf(cell.getStringCellValue());
+        return cellValue;
+    }
+
+    /**
+     * 时间格式处理
+     *
+     * @return
+     * @author Liu Xin Nan
+     * @data 2017年11月27日
+     */
+    public static String stringDateProcess(Cell cell) {
+        String result = new String();
+        if (HSSFDateUtil.isCellDateFormatted(cell)) {// 处理日期格式、时间格式
+            SimpleDateFormat sdf = null;
+            if (cell.getCellStyle().getDataFormat() == HSSFDataFormat.getBuiltinFormat("h:mm")) {
+                sdf = new SimpleDateFormat("HH:mm");
+            } else {// 日期
+                sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+            }
+            Date date = cell.getDateCellValue();
+            result = sdf.format(date);
+        } else if (cell.getCellStyle().getDataFormat() == 58) {
+            // 处理自定义日期格式:m月d日(通过判断单元格的格式id解决,id的值是58)
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+            double value = cell.getNumericCellValue();
+            Date date = DateUtil
+                    .getJavaDate(value);
+            result = sdf.format(date);
+        } else {
+            double value = cell.getNumericCellValue();
+            CellStyle style = cell.getCellStyle();
+            DecimalFormat format = new DecimalFormat();
+            String temp = style.getDataFormatString();
+            // 单元格设置成常规
+            if (temp.equals("General")) {
+                format.applyPattern("#");
+            }
+            result = format.format(value);
+        }
+
+        return result;
+    }
+
+    /**
+     * 合并单元格处理,获取合并行
+     *
+     * @param sheet
+     * @return List<CellRangeAddress>
+     */
+    public static List<CellRangeAddress> getCombineCell(Sheet sheet) {
+        List<CellRangeAddress> list = new ArrayList<CellRangeAddress>();
+        //获得一个 sheet 中合并单元格的数量
+        int sheetmergerCount = sheet.getNumMergedRegions();
+        //遍历所有的合并单元格
+        for (int i = 0; i < sheetmergerCount; i++) {
+            //获得合并单元格保存进list中
+            CellRangeAddress ca = sheet.getMergedRegion(i);
+            list.add(ca);
+        }
+        return list;
+    }
+
+    public static int getRowNum(List<CellRangeAddress> listCombineCell, Cell cell, Sheet sheet) {
+        int xr = 0;
+        int firstC = 0;
+        int lastC = 0;
+        int firstR = 0;
+        int lastR = 0;
+        for (CellRangeAddress ca : listCombineCell) {
+            //获得合并单元格的起始行, 结束行, 起始列, 结束列
+            firstC = ca.getFirstColumn();
+            lastC = ca.getLastColumn();
+            firstR = ca.getFirstRow();
+            lastR = ca.getLastRow();
+            if (cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR) {
+                if (cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC) {
+                    xr = lastR;
+                }
+            }
+        }
+        return xr;
+
+    }
+
+    /**
+     * 判断单元格是否为合并单元格,是的话则将单元格的值返回
+     *
+     * @param listCombineCell 存放合并单元格的list
+     * @param cell            需要判断的单元格
+     * @param sheet           sheet
+     * @return
+     */
+    public static String isCombineCell(List<CellRangeAddress> listCombineCell, Cell cell, Sheet sheet)
+            throws Exception {
+        int firstC = 0;
+        int lastC = 0;
+        int firstR = 0;
+        int lastR = 0;
+        String cellValue = null;
+        for (CellRangeAddress ca : listCombineCell) {
+            //获得合并单元格的起始行, 结束行, 起始列, 结束列
+            firstC = ca.getFirstColumn();
+            lastC = ca.getLastColumn();
+            firstR = ca.getFirstRow();
+            lastR = ca.getLastRow();
+            if (cell.getRowIndex() >= firstR && cell.getRowIndex() <= lastR) {
+                if (cell.getColumnIndex() >= firstC && cell.getColumnIndex() <= lastC) {
+                    Row fRow = sheet.getRow(firstR);
+                    Cell fCell = fRow.getCell(firstC);
+                    cellValue = getCellValue(fCell);
+                    break;
+                }
+            } else {
+                cellValue = "";
+            }
+        }
+        return cellValue;
+    }
+
+    /**
+     * 获取合并单元格的值
+     *
+     * @param sheet
+     * @param row
+     * @param column
+     * @return
+     */
+    public static String getMergedRegionValue(Sheet sheet, int row, int column) {
+        int sheetMergeCount = sheet.getNumMergedRegions();
+
+        for (int i = 0; i < sheetMergeCount; i++) {
+            CellRangeAddress ca = sheet.getMergedRegion(i);
+            int firstColumn = ca.getFirstColumn();
+            int lastColumn = ca.getLastColumn();
+            int firstRow = ca.getFirstRow();
+            int lastRow = ca.getLastRow();
+
+            if (row >= firstRow && row <= lastRow) {
+                if (column >= firstColumn && column <= lastColumn) {
+                    Row fRow = sheet.getRow(firstRow);
+                    Cell fCell = fRow.getCell(firstColumn);
+                    return getCellValue(fCell);
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * 判断指定的单元格是否是合并单元格
+     *
+     * @param sheet
+     * @param row    行下标
+     * @param column 列下标
+     * @return
+     */
+    public static boolean isMergedRegion(Sheet sheet, int row, int column) {
+        int sheetMergeCount = sheet.getNumMergedRegions();
+        for (int i = 0; i < sheetMergeCount; i++) {
+            CellRangeAddress range = sheet.getMergedRegion(i);
+            int firstColumn = range.getFirstColumn();
+            int lastColumn = range.getLastColumn();
+            int firstRow = range.getFirstRow();
+            int lastRow = range.getLastRow();
+            if (row >= firstRow && row <= lastRow) {
+                if (column >= firstColumn && column <= lastColumn) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+}

+ 1 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java

@@ -115,7 +115,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 // 静态资源,可匿名访问
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
-                .antMatchers("/ehs/approvedanger/processImg/**").anonymous()
+                .antMatchers("/ehs/approvedanger/processImg/**","/common/template").anonymous()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()
                 .and()

+ 215 - 164
ruoyi-system/src/main/java/com/ruoyi/branch/domain/TBranchMember.java

@@ -1,159 +1,227 @@
 package com.ruoyi.branch.domain;
 
-import java.util.Date;
-import java.util.List;
-
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.system.domain.SysPost;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ruoyi.common.annotation.Excel;
-import com.ruoyi.common.core.domain.BaseEntity;
+
+import java.util.Date;
+import java.util.List;
 
 /**
  * 支部成员管理对象 t_branch_member
- * 
+ *
  * @author ruoyi
  * @date 2023-06-15
  */
-public class TBranchMember extends BaseEntity
-{
+public class TBranchMember extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 主键id */
-    @Excel(name = "主键id")
+    /**
+     * 主键id
+     */
+    //@Excel(name = "主键id")
     private Long memberId;
 
-    /** 用户id */
-    @Excel(name = "用户id")
+    /**
+     * 用户id
+     */
+    //@Excel(name = "用户id")
     private Long userId;
 
-    /** 成员类型 */
-    @Excel(name = "成员类型")
+    @Excel(name = "党支部")
+    private String deptName;
+
+    /**
+     * 成员类型
+     */
+    @Excel(name = "成员类型", dictType = "member_type")
     private String memberType;
 
-    /** 出生年月 */
+    /**
+     * 出生年月
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
     private Date birthday;
 
-    /** 学历 */
-    @Excel(name = "学历")
+    /**
+     * 学历
+     */
+    @Excel(name = "学历", dictType = "member_education_level")
     private String educationLevel;
 
-    /** 参加工作时间 */
+    /**
+     * 参加工作时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "参加工作时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date workJoinTime;
 
-    /** 入职时间 */
+    /**
+     * 入职时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date workEntryTime;
 
-    /** 入党时间 */
+    /**
+     * 入党时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "入党时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date partyEntryTime;
 
-    /** 任职时间 */
+    /**
+     * 任职时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "任职时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date labourEntryTime;
 
-    /** 离任时间 */
+    /**
+     * 离任时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "离任时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date labourLeaveTime;
 
-    /** 调进时间 */
+    /**
+     * 调进时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "调进时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date entryTime;
 
-    /** 调出时间 */
+    /**
+     * 调出时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "调出时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date leaveTime;
 
-    /** 是否团员 */
-    @Excel(name = "是否团员")
+    /**
+     * 是否团员
+     */
+    @Excel(name = "是否团员", readConverterExp = "1=是,0=否")
     private String isLeague;
 
-    /** 申请入党时间 */
+    /**
+     * 申请入党时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "申请入党时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date applyTime;
 
-    /** 建表考察时间 */
+    /**
+     * 建表考察时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "建表考察时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date formCreateTime;
 
-    /** 现培养人 */
+    /**
+     * 现培养人
+     */
     @Excel(name = "现培养人")
     private String currentMentor;
 
-    /** 计划发展时间 */
+    /**
+     * 计划发展时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "计划发展时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date planDevelopDuration;
 
-    /** 是否参加过入党前培训(2年有效) */
-    @Excel(name = "是否参加过入党前培训", readConverterExp = "2=年有效")
+    /**
+     * 是否参加过入党前培训(2年有效)
+     */
+    @Excel(name = "是否参加过入党前培训(2年有效)", readConverterExp = "1=是,0=否")
     private String isTrained;
 
-    /** 备注(增减原因) */
-    @Excel(name = "备注", readConverterExp = "增=减原因")
+    /**
+     * 备注(增减原因)
+     */
+    @Excel(name = "备注(增减原因)")
     private String remarks;
 
-    /** 删除标志(0代表存在 2代表删除) */
+    /**
+     * 删除标志(0代表存在 2代表删除)
+     */
     private String delFlag;
 
-    /** 部门id */
-    @Excel(name = "部门id")
+    /**
+     * 部门id
+     */
+
     private Long deptId;
 
-    /** 原支部id */
+    /**
+     * 原支部id
+     */
     private Long oldDeptId;
 
-    /** 转入支部id */
+    /**
+     * 转入支部id
+     */
     private Long newDeptId;
 
-    /** 用户昵称 */
+    /**
+     * 用户昵称
+     */
     @Excel(name = "用户名称")
     private String nickName;
 
-    /** 用户性别 */
+    /**
+     * 用户性别
+     */
     @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
     private String sex;
 
-    /** 手机号码 */
+    /**
+     * 手机号码
+     */
     @Excel(name = "手机号码")
     private String phonenumber;
 
-    /** 角色对象 */
+    /**
+     * 角色对象
+     */
     private List<SysRole> roles;
 
-    /** 岗位对象 */
+    /**
+     * 岗位对象
+     */
     private List<SysPost> posts;
 
-    /** 民族 */
+    /**
+     * 民族
+     */
     @Excel(name = "民族")
     private String ethnic;
 
-    /** 工号 */
+    /**
+     * 工号
+     */
     @Excel(name = "工号")
     private String staffId;
 
-    /** 申请编号 */
+    /**
+     * 申请编号
+     */
     private String apNo;
 
-    /** 流程编号 */
+    /**
+     * 流程编号
+     */
     private String processId;
 
-    /** 申请状态(1已审核 0未审核) */
+    /**
+     * 申请状态(1已审核 0未审核)
+     */
     private String apStatus;
 
     /** 照片 */
@@ -167,6 +235,14 @@ public class TBranchMember extends BaseEntity
         this.photo = photo;
     }
 
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
     public String getApStatus() {
         return apStatus;
     }
@@ -255,235 +331,210 @@ public class TBranchMember extends BaseEntity
         this.sex = sex;
     }
 
-    public List<SysRole> getRoles()
-    {
+    public List<SysRole> getRoles() {
         return roles;
     }
 
-    public void setRoles(List<SysRole> roles)
-    {
+    public void setRoles(List<SysRole> roles) {
         this.roles = roles;
     }
 
-    public void setMemberId(Long memberId) 
-    {
+    public void setMemberId(Long memberId) {
         this.memberId = memberId;
     }
 
-    public Long getMemberId() 
-    {
+    public Long getMemberId() {
         return memberId;
     }
-    public void setUserId(Long userId) 
-    {
+
+    public void setUserId(Long userId) {
         this.userId = userId;
     }
 
-    public Long getUserId() 
-    {
+    public Long getUserId() {
         return userId;
     }
-    public void setMemberType(String memberType) 
-    {
+
+    public void setMemberType(String memberType) {
         this.memberType = memberType;
     }
 
-    public String getMemberType() 
-    {
+    public String getMemberType() {
         return memberType;
     }
-    public void setBirthday(Date birthday) 
-    {
+
+    public void setBirthday(Date birthday) {
         this.birthday = birthday;
     }
 
-    public Date getBirthday() 
-    {
+    public Date getBirthday() {
         return birthday;
     }
-    public void setEducationLevel(String educationLevel) 
-    {
+
+    public void setEducationLevel(String educationLevel) {
         this.educationLevel = educationLevel;
     }
 
-    public String getEducationLevel() 
-    {
+    public String getEducationLevel() {
         return educationLevel;
     }
-    public void setWorkJoinTime(Date workJoinTime) 
-    {
+
+    public void setWorkJoinTime(Date workJoinTime) {
         this.workJoinTime = workJoinTime;
     }
 
-    public Date getWorkJoinTime() 
-    {
+    public Date getWorkJoinTime() {
         return workJoinTime;
     }
-    public void setWorkEntryTime(Date workEntryTime) 
-    {
+
+    public void setWorkEntryTime(Date workEntryTime) {
         this.workEntryTime = workEntryTime;
     }
 
-    public Date getWorkEntryTime() 
-    {
+    public Date getWorkEntryTime() {
         return workEntryTime;
     }
-    public void setPartyEntryTime(Date partyEntryTime) 
-    {
+
+    public void setPartyEntryTime(Date partyEntryTime) {
         this.partyEntryTime = partyEntryTime;
     }
 
-    public Date getPartyEntryTime() 
-    {
+    public Date getPartyEntryTime() {
         return partyEntryTime;
     }
 
-    public void setLabourEntryTime(Date labourEntryTime) 
-    {
+    public void setLabourEntryTime(Date labourEntryTime) {
         this.labourEntryTime = labourEntryTime;
     }
 
-    public Date getLabourEntryTime() 
-    {
+    public Date getLabourEntryTime() {
         return labourEntryTime;
     }
-    public void setLabourLeaveTime(Date labourLeaveTime) 
-    {
+
+    public void setLabourLeaveTime(Date labourLeaveTime) {
         this.labourLeaveTime = labourLeaveTime;
     }
 
-    public Date getLabourLeaveTime() 
-    {
+    public Date getLabourLeaveTime() {
         return labourLeaveTime;
     }
-    public void setEntryTime(Date entryTime) 
-    {
+
+    public void setEntryTime(Date entryTime) {
         this.entryTime = entryTime;
     }
 
-    public Date getEntryTime() 
-    {
+    public Date getEntryTime() {
         return entryTime;
     }
-    public void setLeaveTime(Date leaveTime) 
-    {
+
+    public void setLeaveTime(Date leaveTime) {
         this.leaveTime = leaveTime;
     }
 
-    public Date getLeaveTime() 
-    {
+    public Date getLeaveTime() {
         return leaveTime;
     }
-    public void setIsLeague(String isLeague)
-    {
+
+    public void setIsLeague(String isLeague) {
         this.isLeague = isLeague;
     }
 
-    public String getIsLeague()
-    {
+    public String getIsLeague() {
         return isLeague;
     }
-    public void setApplyTime(Date applyTime) 
-    {
+
+    public void setApplyTime(Date applyTime) {
         this.applyTime = applyTime;
     }
 
-    public Date getApplyTime() 
-    {
+    public Date getApplyTime() {
         return applyTime;
     }
-    public void setFormCreateTime(Date formCreateTime) 
-    {
+
+    public void setFormCreateTime(Date formCreateTime) {
         this.formCreateTime = formCreateTime;
     }
 
-    public Date getFormCreateTime() 
-    {
+    public Date getFormCreateTime() {
         return formCreateTime;
     }
-    public void setCurrentMentor(String currentMentor)
-    {
+
+    public void setCurrentMentor(String currentMentor) {
         this.currentMentor = currentMentor;
     }
 
-    public String getCurrentMentor()
-    {
+    public String getCurrentMentor() {
         return currentMentor;
     }
-    public void setPlanDevelopDuration(Date planDevelopDuration)
-    {
+
+    public void setPlanDevelopDuration(Date planDevelopDuration) {
         this.planDevelopDuration = planDevelopDuration;
     }
 
-    public Date getPlanDevelopDuration()
-    {
+    public Date getPlanDevelopDuration() {
         return planDevelopDuration;
     }
-    public void setIsTrained(String isTrained)
-    {
+
+    public void setIsTrained(String isTrained) {
         this.isTrained = isTrained;
     }
 
-    public String getIsTrained()
-    {
+    public String getIsTrained() {
         return isTrained;
     }
-    public void setRemarks(String remarks) 
-    {
+
+    public void setRemarks(String remarks) {
         this.remarks = remarks;
     }
 
-    public String getRemarks() 
-    {
+    public String getRemarks() {
         return remarks;
     }
-    public void setDelFlag(String delFlag) 
-    {
+
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
 
-    public String getDelFlag() 
-    {
+    public String getDelFlag() {
         return delFlag;
     }
-    public void setDeptId(Long deptId) 
-    {
+
+    public void setDeptId(Long deptId) {
         this.deptId = deptId;
     }
 
-    public Long getDeptId() 
-    {
+    public Long getDeptId() {
         return deptId;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("memberId", getMemberId())
-            .append("userId", getUserId())
-            .append("memberType", getMemberType())
-            .append("birthday", getBirthday())
-            .append("educationLevel", getEducationLevel())
-            .append("workJoinTime", getWorkJoinTime())
-            .append("workEntryTime", getWorkEntryTime())
-            .append("partyEntryTime", getPartyEntryTime())
-            .append("labourEntryTime", getLabourEntryTime())
-            .append("labourLeaveTime", getLabourLeaveTime())
-            .append("entryTime", getEntryTime())
-            .append("leaveTime", getLeaveTime())
-            .append("isLeague", getIsLeague())
-            .append("applyTime", getApplyTime())
-            .append("formCreateTime", getFormCreateTime())
-            .append("currentMentor", getCurrentMentor())
-            .append("planDevelopDuration", getPlanDevelopDuration())
-            .append("isTrained", getIsTrained())
-            .append("remarks", getRemarks())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("deptId", getDeptId())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("memberId", getMemberId())
+                .append("userId", getUserId())
+                .append("memberType", getMemberType())
+                .append("birthday", getBirthday())
+                .append("educationLevel", getEducationLevel())
+                .append("workJoinTime", getWorkJoinTime())
+                .append("workEntryTime", getWorkEntryTime())
+                .append("partyEntryTime", getPartyEntryTime())
+                .append("labourEntryTime", getLabourEntryTime())
+                .append("labourLeaveTime", getLabourLeaveTime())
+                .append("entryTime", getEntryTime())
+                .append("leaveTime", getLeaveTime())
+                .append("isLeague", getIsLeague())
+                .append("applyTime", getApplyTime())
+                .append("formCreateTime", getFormCreateTime())
+                .append("currentMentor", getCurrentMentor())
+                .append("planDevelopDuration", getPlanDevelopDuration())
+                .append("isTrained", getIsTrained())
+                .append("remarks", getRemarks())
+                .append("delFlag", getDelFlag())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("deptId", getDeptId())
+                .toString();
     }
 }

+ 204 - 0
ruoyi-system/src/main/java/com/ruoyi/branch/domain/vo/TBranchDyVo.java

@@ -0,0 +1,204 @@
+package com.ruoyi.branch.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.system.domain.SysPost;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 支部成员管理对象 t_branch_member
+ *
+ * @author ruoyi
+ * @date 2023-06-15
+ */
+public class TBranchDyVo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name = "党支部")
+    private String deptName;
+
+    /**
+     * 用户昵称
+     */
+    @Excel(name = "姓名")
+    private String nickName;
+
+    /**
+     * 用户性别
+     */
+    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
+    private String sex;
+
+    /**
+     * 出生年月
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date birthday;
+
+    /**
+     * 学历
+     */
+    @Excel(name = "学历", dictType = "member_education_level")
+    private String educationLevel;
+
+    /**
+     * 参加工作时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "参加工作时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date workJoinTime;
+
+    /**
+     * 入党时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "入党时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date partyEntryTime;
+
+    /**
+     * 手机号码
+     */
+    @Excel(name = "联系方式")
+    private String phonenumber;
+
+    /**
+     * 调进时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "调进时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date entryTime;
+
+    /**
+     * 调出时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "调出时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date leaveTime;
+
+    /**
+     * 备注(增减原因)
+     */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /**
+     * 角色对象
+     */
+    private List<SysRole> roles;
+
+    /**
+     * 岗位对象
+     */
+    private List<SysPost> posts;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public Date getBirthday() {
+        return birthday;
+    }
+
+    public void setBirthday(Date birthday) {
+        this.birthday = birthday;
+    }
+
+    public String getEducationLevel() {
+        return educationLevel;
+    }
+
+    public void setEducationLevel(String educationLevel) {
+        this.educationLevel = educationLevel;
+    }
+
+    public Date getWorkJoinTime() {
+        return workJoinTime;
+    }
+
+    public void setWorkJoinTime(Date workJoinTime) {
+        this.workJoinTime = workJoinTime;
+    }
+
+    public Date getPartyEntryTime() {
+        return partyEntryTime;
+    }
+
+    public void setPartyEntryTime(Date partyEntryTime) {
+        this.partyEntryTime = partyEntryTime;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public Date getEntryTime() {
+        return entryTime;
+    }
+
+    public void setEntryTime(Date entryTime) {
+        this.entryTime = entryTime;
+    }
+
+    public Date getLeaveTime() {
+        return leaveTime;
+    }
+
+    public void setLeaveTime(Date leaveTime) {
+        this.leaveTime = leaveTime;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public List<SysRole> getRoles() {
+        return roles;
+    }
+
+    public void setRoles(List<SysRole> roles) {
+        this.roles = roles;
+    }
+
+    public List<SysPost> getPosts() {
+        return posts;
+    }
+
+    public void setPosts(List<SysPost> posts) {
+        this.posts = posts;
+    }
+}

+ 275 - 0
ruoyi-system/src/main/java/com/ruoyi/branch/domain/vo/TBranchJjfzFzdxVo.java

@@ -0,0 +1,275 @@
+package com.ruoyi.branch.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.system.domain.SysPost;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 支部成员管理对象 t_branch_member
+ *
+ * @author ruoyi
+ * @date 2023-06-15
+ */
+public class TBranchJjfzFzdxVo extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name = "党支部")
+    private String deptName;
+
+    /**
+     * 工号
+     */
+    @Excel(name = "工号")
+    private String staffId;
+
+    /**
+     * 用户昵称
+     */
+    @Excel(name = "用户名称")
+    private String nickName;
+
+    /**
+     * 用户性别
+     */
+    @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
+    private String sex;
+
+    /**
+     * 民族
+     */
+    @Excel(name = "民族",dictType = "member_ethnic")
+    private String ethnic;
+
+    /**
+     * 出生年月
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date birthday;
+
+    /**
+     * 参加工作时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "参加工作时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date workJoinTime;
+
+    /**
+     * 入职时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date workEntryTime;
+
+    /**
+     * 学历
+     */
+    @Excel(name = "学历", dictType = "member_education_level")
+    private String educationLevel;
+
+    /**
+     * 是否团员
+     */
+    @Excel(name = "是否团员", readConverterExp = "1=是,0=否")
+    private String isLeague;
+
+    /**
+     * 申请入党时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "申请入党时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date applyTime;
+
+    /**
+     * 建表考察时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "建表考察时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date formCreateTime;
+
+    /**
+     * 现培养人
+     */
+    @Excel(name = "现培养人")
+    private String currentMentor;
+
+    /**
+     * 计划发展时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "计划发展时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date planDevelopDuration;
+
+    /**
+     * 是否参加过入党前培训(2年有效)
+     */
+    @Excel(name = "是否参加过入党前培训(2年有效)", readConverterExp = "1=是,0=否")
+    private String isTrained;
+
+    /**
+     * 备注(增减原因)
+     */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /**
+     * 角色对象
+     */
+    private List<SysRole> roles;
+
+    /**
+     * 岗位对象
+     */
+    private List<SysPost> posts;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getStaffId() {
+        return staffId;
+    }
+
+    public void setStaffId(String staffId) {
+        this.staffId = staffId;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public String getEthnic() {
+        return ethnic;
+    }
+
+    public void setEthnic(String ethnic) {
+        this.ethnic = ethnic;
+    }
+
+    public Date getBirthday() {
+        return birthday;
+    }
+
+    public void setBirthday(Date birthday) {
+        this.birthday = birthday;
+    }
+
+    public Date getWorkJoinTime() {
+        return workJoinTime;
+    }
+
+    public void setWorkJoinTime(Date workJoinTime) {
+        this.workJoinTime = workJoinTime;
+    }
+
+    public Date getWorkEntryTime() {
+        return workEntryTime;
+    }
+
+    public void setWorkEntryTime(Date workEntryTime) {
+        this.workEntryTime = workEntryTime;
+    }
+
+    public String getEducationLevel() {
+        return educationLevel;
+    }
+
+    public void setEducationLevel(String educationLevel) {
+        this.educationLevel = educationLevel;
+    }
+
+    public String getIsLeague() {
+        return isLeague;
+    }
+
+    public void setIsLeague(String isLeague) {
+        this.isLeague = isLeague;
+    }
+
+    public Date getApplyTime() {
+        return applyTime;
+    }
+
+    public void setApplyTime(Date applyTime) {
+        this.applyTime = applyTime;
+    }
+
+    public Date getFormCreateTime() {
+        return formCreateTime;
+    }
+
+    public void setFormCreateTime(Date formCreateTime) {
+        this.formCreateTime = formCreateTime;
+    }
+
+    public String getCurrentMentor() {
+        return currentMentor;
+    }
+
+    public void setCurrentMentor(String currentMentor) {
+        this.currentMentor = currentMentor;
+    }
+
+    public Date getPlanDevelopDuration() {
+        return planDevelopDuration;
+    }
+
+    public void setPlanDevelopDuration(Date planDevelopDuration) {
+        this.planDevelopDuration = planDevelopDuration;
+    }
+
+    public String getIsTrained() {
+        return isTrained;
+    }
+
+    public void setIsTrained(String isTrained) {
+        this.isTrained = isTrained;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public List<SysRole> getRoles() {
+        return roles;
+    }
+
+    public void setRoles(List<SysRole> roles) {
+        this.roles = roles;
+    }
+
+    public List<SysPost> getPosts() {
+        return posts;
+    }
+
+    public void setPosts(List<SysPost> posts) {
+        this.posts = posts;
+    }
+}

+ 204 - 0
ruoyi-system/src/main/java/com/ruoyi/branch/domain/vo/TBranchWyhVo.java

@@ -0,0 +1,204 @@
+package com.ruoyi.branch.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.system.domain.SysPost;
+
+import java.util.Date;
+import java.util.List;
+
+public class TBranchWyhVo {
+
+    @Excel(name = "党支部")
+    private String deptName;
+
+    /**
+     * 用户昵称
+     */
+    @Excel(name = "姓名")
+    private String nickName;
+
+    /**
+     * 用户性别
+     */
+    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
+    private String sex;
+
+    /**
+     * 出生年月
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date birthday;
+
+    /**
+     * 学历
+     */
+    @Excel(name = "学历", dictType = "member_education_level")
+    private String educationLevel;
+
+    /**
+     * 入职时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "入职时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date workEntryTime;
+
+    @Excel(name = "现岗位")
+    private String post;
+
+    /**
+     * 入党时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "入党时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date partyEntryTime;
+
+    @Excel(name = "委员分工")
+    private String role;
+
+    /**
+     * 任职时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "任职时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date labourEntryTime;
+
+    /**
+     * 离任时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "离任时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date labourLeaveTime;
+
+
+    /**
+     * 备注(增减原因)
+     */
+    @Excel(name = "备注")
+    private String remarks;
+
+
+    /**
+     * 角色对象
+     */
+    private List<SysRole> roles;
+
+    /**
+     * 岗位对象
+     */
+    private List<SysPost> posts;
+
+    public String getRole() {
+        return role;
+    }
+
+    public void setRole(String role) {
+        this.role = role;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public Date getBirthday() {
+        return birthday;
+    }
+
+    public void setBirthday(Date birthday) {
+        this.birthday = birthday;
+    }
+
+    public String getEducationLevel() {
+        return educationLevel;
+    }
+
+    public void setEducationLevel(String educationLevel) {
+        this.educationLevel = educationLevel;
+    }
+
+    public Date getWorkEntryTime() {
+        return workEntryTime;
+    }
+
+    public void setWorkEntryTime(Date workEntryTime) {
+        this.workEntryTime = workEntryTime;
+    }
+
+    public Date getPartyEntryTime() {
+        return partyEntryTime;
+    }
+
+    public void setPartyEntryTime(Date partyEntryTime) {
+        this.partyEntryTime = partyEntryTime;
+    }
+
+    public String getPost() {
+        return post;
+    }
+
+    public void setPost(String post) {
+        this.post = post;
+    }
+
+    public Date getLabourEntryTime() {
+        return labourEntryTime;
+    }
+
+    public void setLabourEntryTime(Date labourEntryTime) {
+        this.labourEntryTime = labourEntryTime;
+    }
+
+    public Date getLabourLeaveTime() {
+        return labourLeaveTime;
+    }
+
+    public void setLabourLeaveTime(Date labourLeaveTime) {
+        this.labourLeaveTime = labourLeaveTime;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public List<SysRole> getRoles() {
+        return roles;
+    }
+
+    public void setRoles(List<SysRole> roles) {
+        this.roles = roles;
+    }
+
+    public List<SysPost> getPosts() {
+        return posts;
+    }
+
+    public void setPosts(List<SysPost> posts) {
+        this.posts = posts;
+    }
+}

+ 15 - 8
ruoyi-system/src/main/java/com/ruoyi/branch/mapper/TBranchMemberMapper.java

@@ -2,18 +2,21 @@ package com.ruoyi.branch.mapper;
 
 import java.util.List;
 import com.ruoyi.branch.domain.TBranchMember;
+import com.ruoyi.branch.domain.vo.TBranchDyVo;
+import com.ruoyi.branch.domain.vo.TBranchJjfzFzdxVo;
+import com.ruoyi.branch.domain.vo.TBranchWyhVo;
 
 /**
  * 支部成员管理Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2023-06-15
  */
-public interface TBranchMemberMapper 
+public interface TBranchMemberMapper
 {
     /**
      * 查询支部成员管理
-     * 
+     *
      * @param memberId 支部成员管理主键
      * @return 支部成员管理
      */
@@ -29,15 +32,19 @@ public interface TBranchMemberMapper
 
     /**
      * 查询支部成员管理列表
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 支部成员管理集合
      */
     public List<TBranchMember> selectTBranchMemberList(TBranchMember tBranchMember);
+    public List<TBranchWyhVo> selectTBranchWyhVoList(TBranchMember tBranchMember);
+    public List<TBranchDyVo> selectTBranchDyVoList(TBranchMember tBranchMember);
+    public List<TBranchJjfzFzdxVo> selectTBranchJjfzFzdxVoList(TBranchMember tBranchMember);
+
 
     /**
      * 新增支部成员管理
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 结果
      */
@@ -45,7 +52,7 @@ public interface TBranchMemberMapper
 
     /**
      * 修改支部成员管理
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 结果
      */
@@ -53,7 +60,7 @@ public interface TBranchMemberMapper
 
     /**
      * 删除支部成员管理
-     * 
+     *
      * @param memberId 支部成员管理主键
      * @return 结果
      */
@@ -61,7 +68,7 @@ public interface TBranchMemberMapper
 
     /**
      * 批量删除支部成员管理
-     * 
+     *
      * @param memberIds 需要删除的数据主键集合
      * @return 结果
      */

+ 14 - 8
ruoyi-system/src/main/java/com/ruoyi/branch/service/ITBranchMemberService.java

@@ -2,18 +2,21 @@ package com.ruoyi.branch.service;
 
 import java.util.List;
 import com.ruoyi.branch.domain.TBranchMember;
+import com.ruoyi.branch.domain.vo.TBranchDyVo;
+import com.ruoyi.branch.domain.vo.TBranchJjfzFzdxVo;
+import com.ruoyi.branch.domain.vo.TBranchWyhVo;
 
 /**
  * 支部成员管理Service接口
- * 
+ *
  * @author ruoyi
  * @date 2023-06-15
  */
-public interface ITBranchMemberService 
+public interface ITBranchMemberService
 {
     /**
      * 查询支部成员管理
-     * 
+     *
      * @param memberId 支部成员管理主键
      * @return 支部成员管理
      */
@@ -29,15 +32,18 @@ public interface ITBranchMemberService
 
     /**
      * 查询支部成员管理列表
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 支部成员管理集合
      */
     public List<TBranchMember> selectTBranchMemberList(TBranchMember tBranchMember);
+    public List<TBranchWyhVo> selectTBranchWyhVoList(TBranchMember tBranchMember);
+    public List<TBranchDyVo> selectTBranchDyVoList(TBranchMember tBranchMember);
+    public List<TBranchJjfzFzdxVo> selectTBranchJjfzFzdxVoList(TBranchMember tBranchMember);
 
     /**
      * 新增支部成员管理
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 结果
      */
@@ -45,7 +51,7 @@ public interface ITBranchMemberService
 
     /**
      * 修改支部成员管理
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 结果
      */
@@ -53,7 +59,7 @@ public interface ITBranchMemberService
 
     /**
      * 批量删除支部成员管理
-     * 
+     *
      * @param memberIds 需要删除的支部成员管理主键集合
      * @return 结果
      */
@@ -61,7 +67,7 @@ public interface ITBranchMemberService
 
     /**
      * 删除支部成员管理信息
-     * 
+     *
      * @param memberId 支部成员管理主键
      * @return 结果
      */

+ 26 - 8
ruoyi-system/src/main/java/com/ruoyi/branch/service/impl/TBranchMemberServiceImpl.java

@@ -2,6 +2,9 @@ package com.ruoyi.branch.service.impl;
 
 import java.util.List;
 
+import com.ruoyi.branch.domain.vo.TBranchDyVo;
+import com.ruoyi.branch.domain.vo.TBranchJjfzFzdxVo;
+import com.ruoyi.branch.domain.vo.TBranchWyhVo;
 import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -12,19 +15,19 @@ import com.ruoyi.branch.service.ITBranchMemberService;
 
 /**
  * 支部成员管理Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2023-06-15
  */
 @Service
-public class TBranchMemberServiceImpl implements ITBranchMemberService 
+public class TBranchMemberServiceImpl implements ITBranchMemberService
 {
     @Autowired
     private TBranchMemberMapper tBranchMemberMapper;
 
     /**
      * 查询支部成员管理
-     * 
+     *
      * @param memberId 支部成员管理主键
      * @return 支部成员管理
      */
@@ -49,7 +52,7 @@ public class TBranchMemberServiceImpl implements ITBranchMemberService
 
     /**
      * 查询支部成员管理列表
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 支部成员管理
      */
@@ -62,7 +65,7 @@ public class TBranchMemberServiceImpl implements ITBranchMemberService
 
     /**
      * 新增支部成员管理
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 结果
      */
@@ -75,7 +78,7 @@ public class TBranchMemberServiceImpl implements ITBranchMemberService
 
     /**
      * 修改支部成员管理
-     * 
+     *
      * @param tBranchMember 支部成员管理
      * @return 结果
      */
@@ -88,7 +91,7 @@ public class TBranchMemberServiceImpl implements ITBranchMemberService
 
     /**
      * 批量删除支部成员管理
-     * 
+     *
      * @param memberIds 需要删除的支部成员管理主键
      * @return 结果
      */
@@ -100,7 +103,7 @@ public class TBranchMemberServiceImpl implements ITBranchMemberService
 
     /**
      * 删除支部成员管理信息
-     * 
+     *
      * @param memberId 支部成员管理主键
      * @return 结果
      */
@@ -109,4 +112,19 @@ public class TBranchMemberServiceImpl implements ITBranchMemberService
     {
         return tBranchMemberMapper.deleteTBranchMemberByMemberId(memberId);
     }
+
+    @Override
+    public List<TBranchWyhVo> selectTBranchWyhVoList(TBranchMember tBranchMember) {
+        return tBranchMemberMapper.selectTBranchWyhVoList(tBranchMember);
+    }
+
+    @Override
+    public List<TBranchDyVo> selectTBranchDyVoList(TBranchMember tBranchMember) {
+        return tBranchMemberMapper.selectTBranchDyVoList(tBranchMember);
+    }
+
+    @Override
+    public List<TBranchJjfzFzdxVo> selectTBranchJjfzFzdxVoList(TBranchMember tBranchMember) {
+        return tBranchMemberMapper.selectTBranchJjfzFzdxVoList(tBranchMember);
+    }
 }

+ 167 - 6
ruoyi-system/src/main/resources/mapper/branch/TBranchMemberMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.branch.mapper.TBranchMemberMapper">
-    
+
     <resultMap type="TBranchMember" id="TBranchMemberResult">
         <result property="memberId"    column="member_id"    />
         <result property="userId"    column="user_id"    />
@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="deptId"    column="dept_id"    />
+        <result property="deptName"    column="dept_name"    />
         <result property="nickName"    column="nick_name"    />
         <result property="sex"    column="sex"    />
         <result property="phonenumber"    column="phonenumber"    />
@@ -44,6 +45,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <collection  property="roles"   javaType="java.util.List" resultMap="RoleResult" />
         <collection  property="posts"   javaType="java.util.List" resultMap="PostResult" />
     </resultMap>
+    <resultMap type="TBranchWyhVo" id="TBranchWyhResult">
+        <result property="birthday"    column="birthday"    />
+        <result property="educationLevel"    column="education_level"    />
+        <result property="workEntryTime"    column="work_entry_time"    />
+        <result property="partyEntryTime"    column="party_entry_time"    />
+        <result property="labourEntryTime"    column="labour_entry_time"    />
+        <result property="labourLeaveTime"    column="labour_leave_time"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="sex"    column="sex"    />
+        <collection  property="roles"   javaType="java.util.List" resultMap="RoleResult" />
+        <collection  property="posts"   javaType="java.util.List" resultMap="PostResult" />
+    </resultMap>
+    <resultMap type="tBranchDyVo" id="TBranchDyResult">
+        <result property="birthday"    column="birthday"    />
+        <result property="educationLevel"    column="education_level"    />
+        <result property="workJoinTime"    column="work_join_time"    />
+        <result property="partyEntryTime"    column="party_entry_time"    />
+        <result property="entryTime"    column="entry_time"    />
+        <result property="leaveTime"    column="leave_time"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="sex"    column="sex"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <collection  property="roles"   javaType="java.util.List" resultMap="RoleResult" />
+        <collection  property="posts"   javaType="java.util.List" resultMap="PostResult" />
+    </resultMap>
+    <resultMap type="tBranchJjfzFzdxVo" id="TBranchJjfzFzdxResult">
+        <result property="birthday"    column="birthday"    />
+        <result property="educationLevel"    column="education_level"    />
+        <result property="workJoinTime"    column="work_join_time"    />
+        <result property="workEntryTime"    column="work_entry_time"    />
+        <result property="isLeague"    column="is_league"    />
+        <result property="applyTime"    column="apply_time"    />
+        <result property="formCreateTime"    column="form_create_time"    />
+        <result property="currentMentor"    column="current_mentor"    />
+        <result property="planDevelopDuration"    column="plan_develop_duration"    />
+        <result property="isTrained"    column="is_trained"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="sex"    column="sex"    />
+        <result property="ethnic"    column="ethnic"    />
+        <result property="staffId"    column="staff_id"    />
+        <collection  property="roles"   javaType="java.util.List" resultMap="RoleResult" />
+        <collection  property="posts"   javaType="java.util.List" resultMap="PostResult" />
+    </resultMap>
 
     <resultMap id="RoleResult" type="SysRole">
         <id     property="roleId"       column="role_id"        />
@@ -66,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select u.member_id, u.new_dept_id, u.old_dept_id, u.ap_no, u.process_id, u.ap_status, u.user_id, u.staff_id, u.ethnic, u.member_type, u.birthday, u.education_level, u.work_join_time, u.work_entry_time, u.party_entry_time, u.labour_entry_time, u.labour_leave_time, u.entry_time, u.leave_time, u.is_league, u.apply_time, u.form_create_time, u.current_mentor, u.plan_develop_duration, u.is_trained, u.remarks, u.del_flag, u.create_by, u.create_time, u.update_by, u.update_time, u.dept_id,
         us.NICK_NAME, us.SEX, us.PHONENUMBER, us.PHOTO,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
-        p.post_id, p.post_code, p.post_name, p.post_sort, p.status as post_status
+        p.post_id, p.post_code, p.post_name, p.post_sort, p.status as post_status,d.dept_name
         from t_branch_member u
             left join sys_dept d on u.dept_id = d.dept_id
             left join SYS_USER us on us.user_id = u.user_id
@@ -86,7 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTBranchMemberList" parameterType="TBranchMember" resultMap="TBranchMemberResult">
         <include refid="selectTBranchMemberVo"/>
-        <where>  
+        <where>
             <if test="memberId != null "> and u.member_id = #{memberId}</if>
             <if test="userId != null "> and u.user_id = #{userId}</if>
             <if test="memberType != null  and memberType != '' and memberType == 1"> and u.member_type = '1' </if>
@@ -118,13 +176,116 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <!-- 数据范围过滤 -->
         ${params.dataScope}
     </select>
-    
+
+    <select id="selectTBranchWyhVoList" parameterType="TBranchMember" resultMap="TBranchWyhResult">
+        <include refid="selectTBranchMemberVo"/>
+        <where>
+            <if test="memberId != null "> and u.member_id = #{memberId}</if>
+            <if test="userId != null "> and u.user_id = #{userId}</if>
+            <if test="memberType != null  and memberType != '' and memberType == 1"> and u.member_type = '1' </if>
+            <if test="memberType != null  and memberType != '' and memberType == 2"> and u.member_type in ('2', '3') </if>
+            <if test="memberType != null  and memberType != '' and memberType == 3"> and u.member_type = '3' </if>
+            <if test="memberType != null  and memberType != '' and memberType == 4"> and u.member_type = '4' </if>
+            <if test="ethnic != null  and ethnic != ''"> and u.ethnic = #{ethnic}</if>
+            <if test="staffId != null  and staffId != ''"> and u.staff_id = #{staffId}</if>
+            <if test="birthday != null "> and u.birthday = #{birthday}</if>
+            <if test="educationLevel != null  and educationLevel != ''"> and u.education_level = #{educationLevel}</if>
+            <if test="workJoinTime != null "> and u.work_join_time = #{workJoinTime}</if>
+            <if test="workEntryTime != null "> and u.work_entry_time = #{workEntryTime}</if>
+            <if test="partyEntryTime != null "> and u.party_entry_time = #{partyEntryTime}</if>
+            <if test="labourEntryTime != null "> and u.labour_entry_time = #{labourEntryTime}</if>
+            <if test="labourLeaveTime != null "> and u.labour_leave_time = #{labourLeaveTime}</if>
+            <if test="entryTime != null "> and u.entry_time = #{entryTime}</if>
+            <if test="leaveTime != null "> and u.leave_time = #{leaveTime}</if>
+            <if test="isLeague != null  and isLeague != ''"> and u.is_league = #{isLeague}</if>
+            <if test="applyTime != null "> and u.apply_time = #{applyTime}</if>
+            <if test="formCreateTime != null "> and u.form_create_time = #{formCreateTime}</if>
+            <if test="currentMentor != null  and currentMentor != ''"> and u.current_mentor = #{currentMentor}</if>
+            <if test="planDevelopDuration != null  and planDevelopDuration != ''"> and u.plan_develop_duration = #{planDevelopDuration}</if>
+            <if test="isTrained != null  and isTrained != ''"> and u.is_trained = #{isTrained}</if>
+            <if test="remarks != null  and remarks != ''"> and u.remarks like concat(concat('%', #{remarks}), '%')</if>
+            <if test="deptId != null "> and u.dept_id = #{deptId}</if>
+            <if test="nickName != null  and nickName != ''"> and us.nick_name like concat(concat('%', #{nickName}), '%')</if>
+            and u.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    <select id="selectTBranchDyVoList" parameterType="TBranchMember" resultMap="TBranchDyResult">
+        <include refid="selectTBranchMemberVo"/>
+        <where>
+            <if test="memberId != null "> and u.member_id = #{memberId}</if>
+            <if test="userId != null "> and u.user_id = #{userId}</if>
+            <if test="memberType != null  and memberType != '' and memberType == 1"> and u.member_type = '1' </if>
+            <if test="memberType != null  and memberType != '' and memberType == 2"> and u.member_type in ('2', '3') </if>
+            <if test="memberType != null  and memberType != '' and memberType == 3"> and u.member_type = '3' </if>
+            <if test="memberType != null  and memberType != '' and memberType == 4"> and u.member_type = '4' </if>
+            <if test="ethnic != null  and ethnic != ''"> and u.ethnic = #{ethnic}</if>
+            <if test="staffId != null  and staffId != ''"> and u.staff_id = #{staffId}</if>
+            <if test="birthday != null "> and u.birthday = #{birthday}</if>
+            <if test="educationLevel != null  and educationLevel != ''"> and u.education_level = #{educationLevel}</if>
+            <if test="workJoinTime != null "> and u.work_join_time = #{workJoinTime}</if>
+            <if test="workEntryTime != null "> and u.work_entry_time = #{workEntryTime}</if>
+            <if test="partyEntryTime != null "> and u.party_entry_time = #{partyEntryTime}</if>
+            <if test="labourEntryTime != null "> and u.labour_entry_time = #{labourEntryTime}</if>
+            <if test="labourLeaveTime != null "> and u.labour_leave_time = #{labourLeaveTime}</if>
+            <if test="entryTime != null "> and u.entry_time = #{entryTime}</if>
+            <if test="leaveTime != null "> and u.leave_time = #{leaveTime}</if>
+            <if test="isLeague != null  and isLeague != ''"> and u.is_league = #{isLeague}</if>
+            <if test="applyTime != null "> and u.apply_time = #{applyTime}</if>
+            <if test="formCreateTime != null "> and u.form_create_time = #{formCreateTime}</if>
+            <if test="currentMentor != null  and currentMentor != ''"> and u.current_mentor = #{currentMentor}</if>
+            <if test="planDevelopDuration != null  and planDevelopDuration != ''"> and u.plan_develop_duration = #{planDevelopDuration}</if>
+            <if test="isTrained != null  and isTrained != ''"> and u.is_trained = #{isTrained}</if>
+            <if test="remarks != null  and remarks != ''"> and u.remarks like concat(concat('%', #{remarks}), '%')</if>
+            <if test="deptId != null "> and u.dept_id = #{deptId}</if>
+            <if test="nickName != null  and nickName != ''"> and us.nick_name like concat(concat('%', #{nickName}), '%')</if>
+            and u.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    <select id="selectTBranchJjfzFzdxVoList" parameterType="TBranchMember" resultMap="TBranchJjfzFzdxResult">
+        <include refid="selectTBranchMemberVo"/>
+        <where>
+            <if test="memberId != null "> and u.member_id = #{memberId}</if>
+            <if test="userId != null "> and u.user_id = #{userId}</if>
+            <if test="memberType != null  and memberType != '' and memberType == 1"> and u.member_type = '1' </if>
+            <if test="memberType != null  and memberType != '' and memberType == 2"> and u.member_type in ('2', '3') </if>
+            <if test="memberType != null  and memberType != '' and memberType == 3"> and u.member_type = '3' </if>
+            <if test="memberType != null  and memberType != '' and memberType == 4"> and u.member_type = '4' </if>
+            <if test="ethnic != null  and ethnic != ''"> and u.ethnic = #{ethnic}</if>
+            <if test="staffId != null  and staffId != ''"> and u.staff_id = #{staffId}</if>
+            <if test="birthday != null "> and u.birthday = #{birthday}</if>
+            <if test="educationLevel != null  and educationLevel != ''"> and u.education_level = #{educationLevel}</if>
+            <if test="workJoinTime != null "> and u.work_join_time = #{workJoinTime}</if>
+            <if test="workEntryTime != null "> and u.work_entry_time = #{workEntryTime}</if>
+            <if test="partyEntryTime != null "> and u.party_entry_time = #{partyEntryTime}</if>
+            <if test="labourEntryTime != null "> and u.labour_entry_time = #{labourEntryTime}</if>
+            <if test="labourLeaveTime != null "> and u.labour_leave_time = #{labourLeaveTime}</if>
+            <if test="entryTime != null "> and u.entry_time = #{entryTime}</if>
+            <if test="leaveTime != null "> and u.leave_time = #{leaveTime}</if>
+            <if test="isLeague != null  and isLeague != ''"> and u.is_league = #{isLeague}</if>
+            <if test="applyTime != null "> and u.apply_time = #{applyTime}</if>
+            <if test="formCreateTime != null "> and u.form_create_time = #{formCreateTime}</if>
+            <if test="currentMentor != null  and currentMentor != ''"> and u.current_mentor = #{currentMentor}</if>
+            <if test="planDevelopDuration != null  and planDevelopDuration != ''"> and u.plan_develop_duration = #{planDevelopDuration}</if>
+            <if test="isTrained != null  and isTrained != ''"> and u.is_trained = #{isTrained}</if>
+            <if test="remarks != null  and remarks != ''"> and u.remarks like concat(concat('%', #{remarks}), '%')</if>
+            <if test="deptId != null "> and u.dept_id = #{deptId}</if>
+            <if test="nickName != null  and nickName != ''"> and us.nick_name like concat(concat('%', #{nickName}), '%')</if>
+            and u.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+
     <select id="selectTBranchMemberByMemberId" parameterType="Long" resultMap="TBranchMemberResult">
         <include refid="selectTBranchMemberVo"/>
         where u.member_id = #{memberId}
         and u.del_flag = 0
     </select>
-        
+
     <insert id="insertTBranchMember" parameterType="TBranchMember">
         <selectKey keyProperty="memberId" resultType="long" order="BEFORE">
             SELECT seq_t_branch_member.NEXTVAL as memberId FROM DUAL
@@ -259,4 +420,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{memberId}
         </foreach>
     </update>
-</mapper>
+</mapper>

+ 24 - 21
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <association property="dept"    column="dept_id" javaType="SysDept" resultMap="deptResult" />
         <collection  property="roles"   javaType="java.util.List"           resultMap="RoleResult" />
     </resultMap>
-	
+
     <resultMap id="deptResult" type="SysDept">
         <id     property="deptId"    column="dept_id"     />
         <result property="parentId"  column="parent_id"   />
@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="leader"    column="leader"      />
         <result property="status"    column="dept_status" />
     </resultMap>
-	
+
     <resultMap id="RoleResult" type="SysRole">
         <id     property="roleId"       column="role_id"        />
         <result property="roleName"     column="role_name"      />
@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="dataScope"     column="data_scope"    />
         <result property="status"       column="role_status"    />
     </resultMap>
-	
+
 	<sql id="selectUserVo">
         select u.user_id, u.photo, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		    left join sys_user_role ur on u.user_id = ur.user_id
 		    left join sys_role r on r.role_id = ur.role_id
     </sql>
-    
+
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
 		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
@@ -73,6 +73,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="phonenumber != null and phonenumber != ''">
 			AND u.phonenumber like concat(concat('%', #{phonenumber}), '%')
 		</if>
+		<if test="nickName != null and nickName != ''">
+			AND u.nick_name like concat(concat('%', #{nickName}), '%')
+		</if>
 		<!--<if test="params.beginTime != null and params.beginTime != ''">&lt;!&ndash; 开始时间检索 &ndash;&gt;-->
 			<!--AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')-->
 		<!--</if>-->
@@ -85,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
 	</select>
-	
+
 	<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
 	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
@@ -102,7 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
 	</select>
-	
+
 	<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
 	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
 	    from sys_user u
@@ -120,29 +123,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<!-- 数据范围过滤 -->
 		${params.dataScope}
 	</select>
-	
+
 	<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
 	    <include refid="selectUserVo"/>
 		where u.user_name = #{userName} and u.del_flag = '0'
 	</select>
-	
+
 	<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
 		<include refid="selectUserVo"/>
 		where u.user_id = #{userId}
 	</select>
-	
+
 	<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
 		select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0'  and rownum <![CDATA[ <= ]]> 1
 	</select>
-	
+
 	<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
 		select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0'  and rownum <![CDATA[ <= ]]> 1
 	</select>
-	
+
 	<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
 		select user_id, email from sys_user where email = #{email} and del_flag = '0'  and rownum <![CDATA[ <= ]]> 1
 	</select>
-	
+
 	<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
 		<selectKey keyProperty="userId" resultType="long" order="BEFORE">
 			SELECT seq_sys_user.NEXTVAL as userId FROM DUAL
@@ -177,7 +180,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			sysdate
  		)
 	</insert>
-	
+
 	<update id="updateUser" parameterType="SysUser">
  		update sys_user
  		<set>
@@ -199,28 +202,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  		</set>
  		where user_id = #{userId}
 	</update>
-	
+
 	<update id="updateUserStatus" parameterType="SysUser">
  		update sys_user set status = #{status} where user_id = #{userId}
 	</update>
-	
+
 	<update id="updateUserAvatar" parameterType="SysUser">
  		update sys_user set avatar = #{avatar} where user_name = #{userName}
 	</update>
-	
+
 	<update id="resetUserPwd" parameterType="SysUser">
  		update sys_user set password = #{password} where user_name = #{userName}
 	</update>
-	
+
 	<delete id="deleteUserById" parameterType="Long">
  		update sys_user set del_flag = '2' where user_id = #{userId}
  	</delete>
- 	
+
  	<delete id="deleteUserByIds" parameterType="Long">
  		update sys_user set del_flag = '2' where user_id in
  		<foreach collection="array" item="userId" open="(" separator="," close=")">
  			#{userId}
-        </foreach> 
+        </foreach>
  	</delete>
-	
-</mapper> 
+
+</mapper>

+ 37 - 36
ruoyi-ui/src/views/branch/zbjs/dymc/index.vue

@@ -96,26 +96,26 @@
           v-hasPermi="['branch:member:remove']"
         >删除</el-button>
       </el-col>
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="info"-->
-          <!--plain-->
-          <!--icon="el-icon-upload2"-->
-          <!--size="mini"-->
-          <!--@click="handleImport"-->
-          <!--v-hasPermi="['branch:member:edit']"-->
-        <!--&gt;导入</el-button>-->
-      <!--</el-col>-->
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="warning"-->
-          <!--plain-->
-          <!--icon="el-icon-download"-->
-          <!--size="mini"-->
-          <!--@click="handleExport"-->
-          <!--v-hasPermi="['branch:member:export']"-->
-        <!--&gt;导出</el-button>-->
-      <!--</el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['branch:member:edit']"
+        >导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['branch:member:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -359,9 +359,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+<!--          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -440,6 +443,9 @@
         deptList: [],
         // 用户导入参数
         upload: {
+          downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+          //下载模板类型
+          type: "dymc",
           // 是否显示弹出层(用户导入)
           open: false,
           // 弹出层标题(用户导入)
@@ -451,7 +457,7 @@
           // 设置上传的请求头部
           headers: { Authorization: "Bearer " + getToken() },
           // 上传的地址
-          url: process.env.VUE_APP_BASE_API + "/branch/member/importData"
+          url: process.env.VUE_APP_BASE_API + "/branch/member/importData/2"
         },
         // 查询参数
         queryParams: {
@@ -778,16 +784,9 @@
       },
       /** 导出按钮操作 */
       handleExport() {
-        const queryParams = this.queryParams;
-        this.$confirm('是否确认导出所有党员名册数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportMember(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+        this.download('branch/member/export', {
+          ...this.queryParams
+        }, `党员名册_${new Date().getTime()}.xlsx`)
       },
       /** 导入按钮操作 */
       handleImport() {
@@ -796,9 +795,7 @@
       },
       /** 下载模板操作 */
       importTemplate() {
-        importTemplate().then(response => {
-          this.download(response.msg);
-        });
+        this.$refs['downloadFileForm'].submit()
       },
       // 文件上传中处理
       handleFileUploadProgress(event, file, fileList) {
@@ -809,7 +806,11 @@
         this.upload.open = false;
         this.upload.isUploading = false;
         this.$refs.upload.clearFiles();
-        this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+        if (response.data[0] != null) {
+          this.$alert('成功导入' + response.msg + '条数据' + "," + '第' + response.data + '行数据出现错误导入失败' + "。", '导入结果', {dangerouslyUseHTMLString: true});
+        } else {
+          this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+        }
         this.getList();
       },
       // 提交上传文件

+ 37 - 36
ruoyi-ui/src/views/branch/zbjs/fzdxmc/index.vue

@@ -142,26 +142,26 @@
           v-hasPermi="['branch:member:remove']"
         >删除</el-button>
       </el-col>
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="info"-->
-          <!--plain-->
-          <!--icon="el-icon-upload2"-->
-          <!--size="mini"-->
-          <!--@click="handleImport"-->
-          <!--v-hasPermi="['branch:member:edit']"-->
-        <!--&gt;导入</el-button>-->
-      <!--</el-col>-->
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="warning"-->
-          <!--plain-->
-          <!--icon="el-icon-download"-->
-          <!--size="mini"-->
-          <!--@click="handleExport"-->
-          <!--v-hasPermi="['branch:member:export']"-->
-        <!--&gt;导出</el-button>-->
-      <!--</el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['branch:member:edit']"
+        >导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['branch:member:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -446,9 +446,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+<!--          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -525,6 +528,9 @@
         deptList: [],
         // 用户导入参数
         upload: {
+          downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+          //下载模板类型
+          type: "fzdxmc",
           // 是否显示弹出层(用户导入)
           open: false,
           // 弹出层标题(用户导入)
@@ -536,7 +542,7 @@
           // 设置上传的请求头部
           headers: { Authorization: "Bearer " + getToken() },
           // 上传的地址
-          url: process.env.VUE_APP_BASE_API + "/branch/member/importData"
+          url: process.env.VUE_APP_BASE_API + "/branch/member/importData/4"
         },
         // 查询参数
         queryParams: {
@@ -862,16 +868,9 @@
       },
       /** 导出按钮操作 */
       handleExport() {
-        const queryParams = this.queryParams;
-        this.$confirm('是否确认导出所有发展对象名册数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportMember(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+        this.download('branch/member/export', {
+          ...this.queryParams
+        }, `发展对象名册_${new Date().getTime()}.xlsx`)
       },
       /** 导入按钮操作 */
       handleImport() {
@@ -880,9 +879,7 @@
       },
       /** 下载模板操作 */
       importTemplate() {
-        importTemplate().then(response => {
-          this.download(response.msg);
-        });
+        this.$refs['downloadFileForm'].submit()
       },
       // 文件上传中处理
       handleFileUploadProgress(event, file, fileList) {
@@ -893,7 +890,11 @@
         this.upload.open = false;
         this.upload.isUploading = false;
         this.$refs.upload.clearFiles();
-        this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+        if (response.data[0] != null) {
+          this.$alert('成功导入' + response.msg + '条数据' + "," + '第' + response.data + '行数据出现错误导入失败' + "。", '导入结果', {dangerouslyUseHTMLString: true});
+        } else {
+          this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+        }
         this.getList();
       },
       // 提交上传文件

+ 37 - 36
ruoyi-ui/src/views/branch/zbjs/sqrjjfzmc/index.vue

@@ -142,26 +142,26 @@
           v-hasPermi="['branch:member:remove']"
         >删除</el-button>
       </el-col>
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="info"-->
-          <!--plain-->
-          <!--icon="el-icon-upload2"-->
-          <!--size="mini"-->
-          <!--@click="handleImport"-->
-          <!--v-hasPermi="['branch:member:edit']"-->
-        <!--&gt;导入</el-button>-->
-      <!--</el-col>-->
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="warning"-->
-          <!--plain-->
-          <!--icon="el-icon-download"-->
-          <!--size="mini"-->
-          <!--@click="handleExport"-->
-          <!--v-hasPermi="['branch:member:export']"-->
-        <!--&gt;导出</el-button>-->
-      <!--</el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['branch:member:edit']"
+        >导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['branch:member:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -446,9 +446,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+<!--          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -525,6 +528,9 @@
         deptList: [],
         // 用户导入参数
         upload: {
+          downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+          //下载模板类型
+          type: "jjfzmc",
           // 是否显示弹出层(用户导入)
           open: false,
           // 弹出层标题(用户导入)
@@ -536,7 +542,7 @@
           // 设置上传的请求头部
           headers: { Authorization: "Bearer " + getToken() },
           // 上传的地址
-          url: process.env.VUE_APP_BASE_API + "/branch/member/importData"
+          url: process.env.VUE_APP_BASE_API + "/branch/member/importData/1"
         },
         // 查询参数
         queryParams: {
@@ -862,16 +868,9 @@
       },
       /** 导出按钮操作 */
       handleExport() {
-        const queryParams = this.queryParams;
-        this.$confirm('是否确认导出所有积极分子名册数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportMember(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+        this.download('branch/member/export', {
+          ...this.queryParams
+        }, `积极分子名册_${new Date().getTime()}.xlsx`)
       },
       /** 导入按钮操作 */
       handleImport() {
@@ -880,9 +879,7 @@
       },
       /** 下载模板操作 */
       importTemplate() {
-        importTemplate().then(response => {
-          this.download(response.msg);
-        });
+        this.$refs['downloadFileForm'].submit()
       },
       // 文件上传中处理
       handleFileUploadProgress(event, file, fileList) {
@@ -893,7 +890,11 @@
         this.upload.open = false;
         this.upload.isUploading = false;
         this.$refs.upload.clearFiles();
-        this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+        if (response.data[0] != null) {
+          this.$alert('成功导入' + response.msg + '条数据' + "," + '第' + response.data + '行数据出现错误导入失败' + "。", '导入结果', {dangerouslyUseHTMLString: true});
+        } else {
+          this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+        }
         this.getList();
       },
       // 提交上传文件

+ 37 - 36
ruoyi-ui/src/views/branch/zbjs/wyhmc/index.vue

@@ -96,26 +96,26 @@
           v-hasPermi="['branch:member:remove']"
         >删除</el-button>
       </el-col>
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="info"-->
-          <!--plain-->
-          <!--icon="el-icon-upload2"-->
-          <!--size="mini"-->
-          <!--@click="handleImport"-->
-          <!--v-hasPermi="['branch:member:edit']"-->
-        <!--&gt;导入</el-button>-->
-      <!--</el-col>-->
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="warning"-->
-          <!--plain-->
-          <!--icon="el-icon-download"-->
-          <!--size="mini"-->
-          <!--@click="handleExport"-->
-          <!--v-hasPermi="['branch:member:export']"-->
-        <!--&gt;导出</el-button>-->
-      <!--</el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['branch:member:add']"
+        >导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['branch:member:export']"
+        >导出</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -322,9 +322,12 @@
           <em>点击上传</em>
         </div>
         <div class="el-upload__tip" slot="tip">
-          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+<!--          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
           <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
         </div>
+        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+          <input name="type" :value="upload.type" hidden/>
+        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
       </el-upload>
       <div slot="footer" class="dialog-footer">
@@ -401,6 +404,9 @@
         deptList: [],
         // 用户导入参数
         upload: {
+          downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+          //下载模板类型
+          type: "wyhmc",
           // 是否显示弹出层(用户导入)
           open: false,
           // 弹出层标题(用户导入)
@@ -412,7 +418,7 @@
           // 设置上传的请求头部
           headers: { Authorization: "Bearer " + getToken() },
           // 上传的地址
-          url: process.env.VUE_APP_BASE_API + "/branch/member/importData"
+          url: process.env.VUE_APP_BASE_API + "/branch/member/importData/3"
         },
         // 查询参数
         queryParams: {
@@ -711,16 +717,9 @@
       },
       /** 导出按钮操作 */
       handleExport() {
-        const queryParams = this.queryParams;
-        this.$confirm('是否确认导出所有委员会名册数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportMember(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+        this.download('branch/member/export', {
+          ...this.queryParams
+        }, `委员会名册_${new Date().getTime()}.xlsx`)
       },
       /** 导入按钮操作 */
       handleImport() {
@@ -729,9 +728,7 @@
       },
       /** 下载模板操作 */
       importTemplate() {
-        importTemplate().then(response => {
-          this.download(response.msg);
-        });
+        this.$refs['downloadFileForm'].submit()
       },
       // 文件上传中处理
       handleFileUploadProgress(event, file, fileList) {
@@ -742,7 +739,11 @@
         this.upload.open = false;
         this.upload.isUploading = false;
         this.$refs.upload.clearFiles();
-        this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+        if (response.data[0] != null) {
+          this.$alert('成功导入' + response.msg +'条数据' + "," + '第' + response.data + '行数据出现错误导入失败' + "。", '导入结果', {dangerouslyUseHTMLString: true});
+        } else {
+          this.$alert('成功导入' + response.msg + '条数据', '导入结果', {dangerouslyUseHTMLString: true});
+        }
         this.getList();
       },
       // 提交上传文件

+ 1 - 1
ruoyi-ui/vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://43.143.92.79:8092`,
+        target: `http://localhost:8092`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''