Browse Source

请假出差,日报,费用报销相关Bug修复

seyason 2 years ago
parent
commit
96a897618d

+ 20 - 20
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -385,34 +385,34 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 XSSFCell reportDateCell = firstRow.getCell(1);
                 XSSFCell expenseTypeCell = firstRow.getCell(2);
                 XSSFCell remarksCell = firstRow.getCell(3);
-                List<String> userNameList=new ArrayList<>();
-                String value = reimburserCell.getStringCellValue();
-                if(!value.equals("")){
-                    userNameList.add(value);
-                }
-                System.out.println("参与搜素的人员列表"+userNameList);
-                HttpRespMsg respMsg=new HttpRespMsg();
-                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
-                    if(respMsg.code.equals("0")){
-                        msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
-                        return msg;
-                    }
-                }
-                List<User> targetUserList= (List<User>) respMsg.data;
+
                 if (reimburserCell != null) reimburserCell.setCellType(CellType.STRING);
                 if (reportDateCell != null) reportDateCell.setCellType(CellType.NUMERIC);
                 if (expenseTypeCell != null) expenseTypeCell.setCellType(CellType.STRING);
                 if (remarksCell != null) remarksCell.setCellType(CellType.STRING);
-                if (reimburserCell == null) {//报销人为空的直接跳过
+                if (reimburserCell == null || StringUtils.isEmpty(reimburserCell.getStringCellValue())) {//报销人为空的直接跳过
                     throw new Exception("报销人名称不能为空");
                 }
                 if (expenseTypeCell == null) {
                     throw new Exception("费用类型不能为空");
                 }
-                if (reportDateCell == null) {
+                if (reportDateCell == null  || StringUtils.isEmpty(reportDateCell.getStringCellValue())) {
                     throw new Exception("填报日期不能为空");
                 }
+                //做完非空校验后,进行姓名处理
+                List<String> userNameList=new ArrayList<>();
+                String reimburserName = reimburserCell.getStringCellValue();
+                userNameList.add(reimburserName);
+                HttpRespMsg respMsg= null;
+                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                    System.out.println("参与搜素的人员列表"+userNameList);
+                    respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
+                    if(respMsg.code.equals("0")){
+                        msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
+                        return msg;
+                    }
+                }
+                List<User> targetUserList= (List<User>) respMsg.data;
                 ExpenseSheet expenseSheet = new ExpenseSheet();
                 if(functionList.size()>0){
                     expenseSheet.setStatus(0);
@@ -441,10 +441,10 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 expenseSheet.setCreateDate(localDate);
                 Optional<User> first;
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(reimburserCell.getStringCellValue())).findFirst();
-                    first = userList.stream().filter(us -> us.getName().equals(reimburserCell.getStringCellValue())||(us.getJobNumber()!=null&&us.getJobNumber().equals(reimburserCell.getStringCellValue()))||(optional.isPresent()&&us.getCorpwxUserid()!=null&&us.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                    Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(reimburserName)).findFirst();
+                    first = userList.stream().filter(us -> us.getName().equals(reimburserName)||(us.getJobNumber()!=null&&us.getJobNumber().equals(reimburserName))||(optional.isPresent()&&us.getCorpwxUserid()!=null&&us.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
                 }else {
-                    first = userList.stream().filter(us -> us.getName().equals(reimburserCell.getStringCellValue())).findFirst();
+                    first = userList.stream().filter(us -> us.getName().equals(reimburserName)).findFirst();
                 }
                 if (first.isPresent()) {
                     expenseSheet.setOwnerId(first.get().getId());

+ 43 - 36
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -3188,9 +3188,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         userNameList.add(inchargerName);
                     }
                 }
-                System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
                 HttpRespMsg respMsg=new HttpRespMsg();
-                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
+                if(userNameList.size() > 0 && wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
+                    System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
                     respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                     if(respMsg.code.equals("0")){
                         msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
@@ -3386,44 +3386,51 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     List<Participation> participationList = new ArrayList<>();
                     if(inchargerCell!=null){
-                        String value = inchargerCell.getStringCellValue();
-                        String s1;
-                        if(value.startsWith("/")){
-                            s1=value.substring(1,value.length());
-                        }else s1=value;
-                        String s2;
-                        if(s1.endsWith("/")){
-                            s2=s1.substring(0,s1.length()-1);
-                        }else s2=s1;
-                        String[] split = s2.split("/");
-                        Optional<User> first;
-                        Integer exception=null;
-                        if(split.length==1){
-                            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                                Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
-                                first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                        String value = inchargerCell.getStringCellValue().trim();
+                        if (!StringUtils.isEmpty(value)) {
+                            //有项目经理
+                            String s1;
+                            if(value.startsWith("/")){
+                                s1=value.substring(1,value.length());
                             }else {
-                                first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                s1=value;
                             }
-                            exception=0;
-                        }else {
-                            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                                Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
-                                first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
-                                exception=1;
+                            String s2;
+                            if(s1.endsWith("/")){
+                                s2=s1.substring(0,s1.length()-1);
                             }else {
-                                first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                s2=s1;
                             }
-                        }
-                        Participation p = new Participation();
-                        if (first.isPresent()) {
-                            p.setUserId(first.get().getId());
-                            p.setProjectId(project.getId());
-                            participationList.add(p);
-                        } else {
-                            switch (exception){
-                                case 0:throw new Exception("["+split[0]+"]在系统中不存在");
-                                case 1:throw new Exception("["+split[0]+"]在系统中不存在");
+                            String[] split = s2.split("/");
+                            Optional<User> first;
+                            Integer exception=null;
+                            if(split.length==1){
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[0])).findFirst();
+                                    first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                                }else {
+                                    first= userList.stream().filter(u -> u.getName().equals(split[0])||(u.getJobNumber()!=null&&u.getJobNumber().equals(split[0]))).findFirst();
+                                }
+                                exception=0;
+                            }else {
+                                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                                    Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(split[1])).findFirst();
+                                    first= userList.stream().filter(u ->(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
+                                    exception=1;
+                                }else {
+                                    first= userList.stream().filter(u -> u.getName().equals(split[0])&&(u.getJobNumber()!=null&&u.getJobNumber().equals(split[1]))).findFirst();
+                                }
+                            }
+                            Participation p = new Participation();
+                            if (first.isPresent()) {
+                                p.setUserId(first.get().getId());
+                                p.setProjectId(project.getId());
+                                participationList.add(p);
+                            } else {
+                                switch (exception){
+                                    case 0:throw new Exception("["+split[0]+"]在系统中不存在");
+                                    case 1:throw new Exception("["+split[0]+"]在系统中不存在");
+                                }
                             }
                         }
                     }

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -3533,9 +3533,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     userNameList.add(username);
                 }
             }
-            System.out.println("参与搜素的人员列表"+userNameList);
             HttpRespMsg respMsg=new HttpRespMsg();
             if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
+                System.out.println("参与搜素的人员列表"+userNameList);
                 respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                 if(respMsg.code.equals("0")){
                     msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");

BIN
fhKeeper/formulahousekeeper/management-platform/src/main/resources/upload/项目导入模板.xlsx


+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -10,7 +10,7 @@
                     <span slot="title">{{ $t('businesstriisallowed') }}</span>
                 </el-menu-item>
                 <el-menu-item index="2" @select="bills" @click="auditList()" v-if="permissions.awayOfficeAudit">
-                <i class="iconfont firerock-iconbaoxiaodan"></i>
+                <i class="iconfont firerock-iconshenhe"></i>
                 <span slot="title">出差审核</span>
                 </el-menu-item>
                 <el-menu-item index="3" @select="bills" @click="bills(false, 2)" >
@@ -20,7 +20,7 @@
                 
                 <el-menu-item index="4" v-if="permissions.awayOfficeStatistical">
                     <template slot="title">
-                        <i class="iconfont firerock-icontianbao"></i>
+                        <i class="iconfont firerock-icongongshitongji"></i>
                         <span slot="title">{{ $t('businessstatistics') }}</span>
                     </template>
                 </el-menu-item>

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -30,7 +30,7 @@
           </el-submenu> -->
 
           <el-menu-item index="2" @select="bills" @click="auditList()" v-if="permissions.leaveAudit">
-              <i class="iconfont firerock-iconbaoxiaodan"></i>
+              <i class="iconfont firerock-iconshenhe"></i>
               <span slot="title">请假审核</span>
             </el-menu-item>
             <el-menu-item index="3" @select="bills" @click="bills(false, 2)" >
@@ -44,7 +44,7 @@
             
             <el-menu-item index="4" v-if="permissions.leaveStatistical">
               <template slot="title">
-                <i class="iconfont firerock-icontianbao"></i>
+                <i class="iconfont firerock-icongongshitongji"></i>
                 <span slot="title">{{ $t('for') }}</span>
               </template>
           </el-menu-item>
@@ -58,7 +58,7 @@
 
           <el-menu-item index="6" v-if="permissions.leaveAnnual">
               <template slot="title">
-                <i class="iconfont firerock-icontianbao"></i>
+                <i class="iconfont firerock-iconsetting"></i>
                 <span slot="title">{{ $t('annualleavemanagement') }}</span>
               </template>
           </el-menu-item>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -1334,7 +1334,7 @@ import { error } from 'dingtalk-jsapi';
                     sums[index] = this.$t('zongjia');
                     return;
                 }
-                if (index === 1 || index === 2){
+                if (index === 1){
                     sums[index] = ''
                     return
                 }