Jelajahi Sumber

fix null bug

QuYueTing 7 bulan lalu
induk
melakukan
d6ea5b1799

+ 1 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1794,10 +1794,9 @@ public class ReportController {
         }
 
 
-        //个人和代填都要检验考勤时长
         if (createDate[0].contains("@")) {
             //个人批量填报,判断是否需要考勤校验
-            if (comTimeType.getSyncCorpwxTime() == 1) {
+            if (comTimeType.getSyncCorpwxTime() == 1 && targetUids == null) {
                 String[] dateArr = createDate[0].split("@");
                 List<UserCorpwxTime> cardTimeList = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("corpwx_userid", user.getCorpwxUserid()).between("create_date", dateArr[0], dateArr[1]));
                 if (company.getId() == 3918 || company.getId() == 4281) {

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

@@ -4745,7 +4745,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         for (UserMonthWork userMonthWork : userMonthWorks) {
             List<Map<String, Object>> worktimeList = userMonthWork.worktimeList;
             //获取到该员工请假的数据
-            List<UserCorpwxTime> curUserCorpTime = userCorpwxTimeList.stream().filter(s->s.getCorpwxUserid().equals(userMonthWork.corpwxUserId)).collect(Collectors.toList());
+            List<UserCorpwxTime> curUserCorpTime = userCorpwxTimeList.stream().filter(s->s.getCorpwxUserid() != null && s.getCorpwxUserid().equals(userMonthWork.corpwxUserId)).collect(Collectors.toList());
 //            for (Map<String, Object> corpWx : userCorpwxTimeMapList) {
 //                if (((String)corpWx.get("corpwx_userid")).equals(userMonthWork.corpwxUserId)) {
 //                    curUserCorpTime.add(corpWx);

+ 4 - 5
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -20,7 +20,7 @@
                     </van-field>
                     <template #right-icon>
                         <!--先开放几家,试一下-->
-                        <span style="color:#20a0ff;" @click="getAIReport()" v-if="!hasWrittenReport && (user.companyId==10||user.companyId==7||user.companyId==7030)">智能填报</span>
+                        <span style="color:#20a0ff;" @click="getAIReport()" v-if="!substitute && !hasWrittenReport && (user.companyId==10||user.companyId==7||user.companyId==7030)">智能填报</span>
                     </template>
                 </van-cell>
                 
@@ -2283,8 +2283,6 @@ export default {
                 }
             }
             this.dateAr = alp
-            console.log(this.reportTimeType, this.dateAr, '<=== this.reportTimeType')
-
             const { timeCanOverlap } = this.reportTimeType // timeCanOverlap 为零时校验不允许重叠
             if (this.dateAr.length > 0 && timeCanOverlap == 0) {
                 let trus = this.fns()
@@ -2374,7 +2372,8 @@ export default {
                     return;
                 }
             }
-            if (this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0) {
+            //非代填情况下要校验考勤
+            if (!this.substitute && this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0) {
                 if (this.report.time) {
                     if (this.report.time.workHours == 0) {
                         this.$toast.fail('无考勤记录不可填报')
@@ -2386,7 +2385,7 @@ export default {
                 }
             }
             //针对凡己,不校验考勤时长
-            if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.report.time) {
+            if (!this.substitute && this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.report.time) {
                 var totalTime = 0;
                 for (var t = 0; t < this.form.domains.length; t++) {
                     totalTime += parseFloat(this.form.domains[t].workingTime);

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/login/index.vue

@@ -266,7 +266,7 @@
             }
             let href = window.location.href;
             //优先处理企业微信工作台点击进入,后台已经处理过,有userId传过来了
-            if (this.isCorpWX && href.indexOf("userId") > 0) {
+            if (href.indexOf("userId") > 0) {
                 //判断企业微信,是否存在授权
                 var loginUserId = href.substring(href.indexOf("userId=")+"userId=".length);
                 if (loginUserId.includes('#/')) {