From 3014d7c96c13c7e032d5a7dfee7faf193afc557f Mon Sep 17 00:00:00 2001
From: yz <yz_0812@outlook.com>
Date: 星期二, 23 三月 2021 22:16:32 +0800
Subject: [PATCH] 修改导入

---
 febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpPhysicalExamServiceImpl.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpPhysicalExamServiceImpl.java b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpPhysicalExamServiceImpl.java
index ac06349..b37bd93 100644
--- a/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpPhysicalExamServiceImpl.java
+++ b/febs-server/febs-server-hr/src/main/java/cc/mrbird/febs/server/hr/service/impl/EmpPhysicalExamServiceImpl.java
@@ -94,10 +94,12 @@
         } else {
             queryWrapper.in("a.EmpStatus", 0);
         }
-        Page<EmpPhysicalExam> page = new Page<>(request.getPageNum(), request.getPageSize());
         queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA));
-        IPage<EmpPhysicalExam> iPage = empPhysicalexamMapper.selectPageVo(page, queryWrapper);
+
+        Page<EmpPhysicalExam> page = new Page<>(request.getPageNum(), request.getPageSize());
         SortUtil.handlePageSort(request, page, "createTime", FebsConstant.ORDER_DESC, true);
+        IPage<EmpPhysicalExam> iPage = empPhysicalexamMapper.selectPageVo(page, queryWrapper);
+
         List<EmpPhysicalExam> list = iPage.getRecords();
         //设置字典数据
         List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class);
@@ -182,7 +184,7 @@
     @Transactional(rollbackFor = Exception.class)
 	public void importEmpPhysicalExam(List<List<Object>> listObject,List<String>  returnList,List<DicItem> dicItems) {
 		for (List<Object> list : listObject) {
-            if (list.size()==0){
+            if (list.size()==0||StrUtil.isBlank(list.get(0).toString())){
                 continue;
             }
 			EmpPhysicalExam physicalExam = new EmpPhysicalExam();
@@ -190,6 +192,9 @@
 			physicalExam.setEmpNumb(list.get(0).toString());
 			physicalExam.setDeptName(list.get(1).toString());
 			List<Dept> depts = CastUtil.castList(redisService.get("depts"), Dept.class);
+            if(null == depts){
+                depts =remoteDeptService.setDeptRedis();
+            }
             Dept dept = depts.stream().filter(d -> d.getDeptName().equals(list.get(1).toString())).findFirst().orElse(null);
             if (null == dept) {
                 returnList.add(StrUtil.format("导入员工体检信息异常: 出现位置第{}行, 原因:{}部门不存在",listObject.indexOf(list)+1,list.get(1).toString()));

--
Gitblit v1.8.0