Browse Source

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

 Conflicts:
	fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties
cs 2 years ago
parent
commit
3477c1016d

+ 85 - 57
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -71,6 +71,8 @@ public class ReportController {
     private ProjectMapper projectMapper;
     @Resource
     private SysFunctionMapper sysFunctionMapper;
+    @Resource
+    private UserCorpwxTimeMapper userCorpwxTimeMapper;
 
 
 
@@ -273,47 +275,47 @@ public class ReportController {
         }
 
 
-        //检查项目是否可填报
+        //检查项目是否可填报; 修改为不校验项目,前端加载的项目已经过滤掉了完成和撤销的
         List<Integer> integers = Arrays.asList(projectId);
         List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", integers));
-        for (int i=0;i<projectId.length; i++) {
-            int pid = projectId[i];
-            Optional<Project> findP = projectList.stream().filter(p->p.getId().equals(pid)).findFirst();
-            if (findP.isPresent()) {
-                Project curP = findP.get();
-                if (!createDate[i].contains("@")) {
-                    if (curP.getStatus() == 2) {
-                        HttpRespMsg msg = new HttpRespMsg();
-                        //msg.setError("项目["+curP.getProjectName()+"]已完成。");
-                        msg.setError(MessageUtils.message("project.complete",curP.getProjectName()));
-                        return msg;
-                    }
-                    if (curP.getStatus() == 3) {
-                        HttpRespMsg msg = new HttpRespMsg();
-                        //msg.setError("项目["+curP.getProjectName()+"]已撤销。");
-                        msg.setError(MessageUtils.message("project.revoke",curP.getProjectName()));
-                        return msg;
-                    }
-                } else {
-                    //批量填报(含代填)
-                    String[] dateArr = createDate[i].split("@");
-                    for (String curDate : dateArr) {
-                        if (curP.getStatus() == 2) {
-                            HttpRespMsg msg = new HttpRespMsg();
-                            //msg.setError("项目["+curP.getProjectName()+"]已完成。");
-                            msg.setError(MessageUtils.message("project.complete",curP.getProjectName()));
-                            return msg;
-                        }
-                        if (curP.getStatus() == 3) {
-                            HttpRespMsg msg = new HttpRespMsg();
-                            //msg.setError("项目["+curP.getProjectName()+"]已撤销。");
-                            msg.setError(MessageUtils.message("project.revoke",curP.getProjectName()));
-                            return msg;
-                        }
-                    }
-                }
-            }
-        }
+//        for (int i=0;i<projectId.length; i++) {
+//            int pid = projectId[i];
+//            Optional<Project> findP = projectList.stream().filter(p->p.getId().equals(pid)).findFirst();
+//            if (findP.isPresent()) {
+//                Project curP = findP.get();
+//                if (!createDate[i].contains("@")) {
+//                    if (curP.getStatus() == 2) {
+//                        HttpRespMsg msg = new HttpRespMsg();
+//                        //msg.setError("项目["+curP.getProjectName()+"]已完成。");
+//                        msg.setError(MessageUtils.message("project.complete",curP.getProjectName()));
+//                        return msg;
+//                    }
+//                    if (curP.getStatus() == 3) {
+//                        HttpRespMsg msg = new HttpRespMsg();
+//                        //msg.setError("项目["+curP.getProjectName()+"]已撤销。");
+//                        msg.setError(MessageUtils.message("project.revoke",curP.getProjectName()));
+//                        return msg;
+//                    }
+//                } else {
+//                    //批量填报(含代填)
+//                    String[] dateArr = createDate[i].split("@");
+//                    for (String curDate : dateArr) {
+//                        if (curP.getStatus() == 2) {
+//                            HttpRespMsg msg = new HttpRespMsg();
+//                            //msg.setError("项目["+curP.getProjectName()+"]已完成。");
+//                            msg.setError(MessageUtils.message("project.complete",curP.getProjectName()));
+//                            return msg;
+//                        }
+//                        if (curP.getStatus() == 3) {
+//                            HttpRespMsg msg = new HttpRespMsg();
+//                            //msg.setError("项目["+curP.getProjectName()+"]已撤销。");
+//                            msg.setError(MessageUtils.message("project.revoke",curP.getProjectName()));
+//                            return msg;
+//                        }
+//                    }
+//                }
+//            }
+//        }
         TimeType comTimeType = timeTypeMapper.selectById(user.getCompanyId());
         List<ReportAuditorSetting> auditorSettingList = null;
         if (comTimeType.getReportAuditType() == 3) {
@@ -1015,28 +1017,54 @@ public class ReportController {
                                 return msg;
                             }
                         }
-                    } else {
-                        //按周填报时不校验已填的工时日报了
-//                        List<LocalDate> collect = oldReportList.stream().map(Report::getCreateDate).collect(Collectors.toList());
-//                        for (Report report : reportList) {
-//                            if (report.getId() == null) {
-//                                if (collect.stream().anyMatch(oldDate->oldDate.isEqual(report.getCreateDate()))) {
-//                                    sb.append(mdFormatter.format(report.getCreateDate())).append(",");
-//                                }
-//                            }
-//                        }
-
-//                        String s = sb.toString();
-//                        if (s.length() > 0) {
-//                            s = s.substring(0, s.length() -1);
-//                            HttpRespMsg msg = new HttpRespMsg();
-//                            msg.setError("已存在填写日报: " + s+", 请先删除后再填报。");
-//                            return msg;
-//                        }
                     }
                 }
             }
         }
+        if (createDate[0].contains("@") && targetUserList == null) {
+            //个人批量填报,判断是否需要考勤校验
+            if (comTimeType.getSyncCorpwxTime() == 1) {
+                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]));
+                //考勤记录不能为空或时长为0
+                if (comTimeType.getNotAllowedNoAttendance() == 1) {
+                    String str = "";
+                    for (Report r : reportList) {
+                        Optional<UserCorpwxTime> first = cardTimeList.stream().filter(card -> card.getCreateDate().isEqual(r.getCreateDate())).findFirst();
+                        if (first.isPresent()) {
+                            if (first.get().getWorkHours() == 0) {
+                                str += dtf.format(r.getCreateDate()) + ",";
+                            }
+                        } else {
+                            str += dtf.format(r.getCreateDate()) + ",";
+                        }
+                    }
+                    //有无考勤的日期
+                    if (str.length() > 0) {
+                        str = str.substring(0, str.length()-1);
+                        HttpRespMsg msg = new HttpRespMsg();
+                        msg.setError(MessageUtils.message("report.lackCardTime", str));
+                        return msg;
+                    }
+                }
+                String str = "";
+                for (Report r : reportList) {
+                    Optional<UserCorpwxTime> first = cardTimeList.stream().filter(card -> card.getCreateDate().isEqual(r.getCreateDate())).findFirst();
+                    if (first.isPresent()) {
+                        double cardTime = first.get().getWorkHours();
+                        if (r.getWorkingTime() > cardTime) {
+                            str += dtf.format(r.getCreateDate()) + ",";
+                        }
+                    }
+                }
+                if (str.length() > 0) {
+                    str = str.substring(0, str.length()-1);
+                    HttpRespMsg msg = new HttpRespMsg();
+                    msg.setError(MessageUtils.message("report.lackCardTime", str));
+                    return msg;
+                }
+            }
+        }
         return reportService.editReport(reportList, createDate.length > 0 ? createDate[0] : null, targetUserList, hourCost, user.getCompanyId());
     }
 

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

@@ -317,7 +317,7 @@ public class UserCorpwxTimeController {
                 .eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDate localDate = LocalDate.parse(date, df);
-        if(!localDate.isEqual(LocalDate.now())&&oldCorpwxTimes.size()>0){
+        if(!localDate.isEqual(LocalDate.now())&&oldCorpwxTimes.size()>0 && oldCorpwxTimes.get(0).getWorkHours() > 0){
             UserCorpwxTime time = oldCorpwxTimes.get(0);
             resultMap.put("time", time);
             msg.data=resultMap;

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties

@@ -178,8 +178,8 @@ profession.impProReject=\u60A8{0}\u5BFC\u5165\u7684\u65E5\u62A5\u4E2D{1}\u9879\u
 profession.fillProReject=\u60A8{0}\u586B\u5199\u7684\u65E5\u62A5\u4E2D{1}\u9879\u76EE\u88AB[{2}]\u9A73\u56DE\u3002\u539F\u56E0:{3}\u3002
 profession.approver=\u8BF7\u8BBE\u7F6E\u5BA1\u6279\u4EBA
 profession.checker=\u8BF7\u8BBE\u7F6E\u5BA1\u6838\u4EBA
-profession.approved=\u901A\u8FC7
-profession.batchPass=\u6279\u91CF\u901A\u8FC7
+profession.approved=\u5BA1\u6838\u901A\u8FC7
+profession.batchPass=\u6279\u91CF\u5BA1\u6838\u901A\u8FC7
 # \u9879\u76EE\u76F8\u5173
 project.deleteErrorByProject=\u5220\u9664\u5931\u8D25\uFF0C\u5DF2\u7ED1\u5B9A\u9879\u76EE
 project.deleteErrorByMaster=\u5220\u9664\u5931\u8D25\uFF0C\u5DF2\u7ED1\u5B9A\u4E3B\u9879\u76EE
@@ -321,6 +321,8 @@ report.hourAll=\u60A8\u4E0A\u5468\u5171\u53C2\u4E0E\u4E86{0}\u4E2A\u9879\u76EE\u
 report.dailyReject=\u60A8{0}\u586B\u5199\u7684\u65E5\u62A5\u4E2D{1}\u9879\u76EE\u88AB[{2}]\u9A73\u56DE\u3002\u539F\u56E0:{3}
 report.reportApp=\u5BA1\u6838\u901A\u8FC7\u4E86\u65E5\u62A5
 report.hourReportNoFilled=\u60A8{0}\u7684\u5DE5\u65F6\u62A5\u544A\u8FD8\u672A\u586B\u5199
+report.lackCardTime=\u7F3A\u5C11\u8003\u52E4\u65F6\u957F: {0}
+report.timeReachLimitError=\u586B\u62A5\u5DE5\u65F6\u4E0D\u53EF\u8D85\u8FC7\u8003\u52E4\u65F6\u957F: {0}
 #\u6A21\u677F\u76F8\u5173
 Template.subProject=\u5B50\u9879\u76EE
 Template.AlreadyExists=\u8BE5\u6A21\u677F\u540D\u79F0\u5DF2\u5B58\u5728

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties

@@ -321,6 +321,8 @@ report.hourAll=You participated in {0} projects last week with a total of {1} ho
 report.dailyReject=The {1} project in the daily report you filled in by {0} was rejected by [{2}]. Reason: {3}
 report.reportApp=Daily report approved
 report.hourReportNoFilled=Your work hour report for {0} has not been completed.
+report.lackCardTime=Lack attendance record: {0}
+report.timeReachLimitError=Report working time cannot be larger than attendance time: {0}
 #\u6A21\u677F\u76F8\u5173
 Template.subProject=subproject
 Template.AlreadyExists=The template name already exists.

+ 0 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_zh_CN.properties

@@ -1 +0,0 @@
-user.notExists=用户不存在

+ 4 - 1
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -208,6 +208,7 @@
                 <el-form-item><el-checkbox v-model="dialogData.reportAutoApprove">是否开启日报自动审核</el-checkbox></el-form-item>
                 <el-form-item><el-checkbox v-model="dialogData.notAllowedNoAttendance">是否开启考勤为0不可填报</el-checkbox></el-form-item>
                 <el-form-item><el-checkbox v-model="dialogData.stageHasEvtime">是否开启预估工时</el-checkbox></el-form-item>
+                <el-form-item><el-checkbox v-model="dialogData.financeAudit">财务导入是否需要审核</el-checkbox></el-form-item>
                 <el-form-item>
                     日报审核模式:
                     <el-select v-model="dialogData.reportAuditType" size="small">
@@ -312,7 +313,8 @@
                     this.dialogData.packageEngineering = this.dialogData.packageEngineering ? true : false,
                     this.dialogData.packageSimple = this.dialogData.packageSimple ? true : false,
                     this.dialogData.packageFinance = this.dialogData.packageFinance ? true : false,
-                    this.dialogData.packageProvider = this.dialogData.packageProvider ? true : false
+                    this.dialogData.packageProvider = this.dialogData.packageProvider ? true : false,
+                    this.dialogData.financeAudit = this.dialogData.financeAudit ? true : false
                 }
                 else if(i == 'D'){ this.editDialogD = true }
                 else if (i=='E') {
@@ -368,6 +370,7 @@
                             this.$set(this.dialogData,'reportAutoApprove',res.data.reportAutoApprove ? true : false)
                             this.$set(this.dialogData,'notAllowedNoAttendance',res.data.notAllowedNoAttendance ? true : false)
                             this.$set(this.dialogData,'stageHasEvtime',res.data.stageHasEvtime ? true : false)
+                            this.$set(this.dialogData,'financeAudit',res.data.financeAudit ? true : false)
                             this.$set(this.dialogData,'reportAuditType',res.data.reportAuditType)
                         }else{
                             this.$message({

+ 19 - 12
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -352,8 +352,11 @@
                     <span v-if="reportTimeType.type == 3">{{$t('time.hour')}}</span>
 
                     <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}{{$t('time.hour')}}</span>
-                    <span v-if="(user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
-                    <el-button type="default" style="margin-left:5px;" size="mini" :loading="syncTimeLoading" v-if="user.timeType.syncCorpwxTime==1 && (workForm.createDate == today || (!workForm.time))" icon="el-icon-refresh" @click="refreshWXCardTime(workForm.createDate)"></el-button>
+                    <!--批量填报和批量代填不显示考勤记录-->
+                    <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
+                    <el-button type="default" style="margin-left:5px;" size="mini" :loading="syncTimeLoading" 
+                    v-if="!isBatch && user.timeType.syncCorpwxTime==1 && (workForm.createDate == today || !workForm.time || workForm.time.workHours == 0)" icon="el-icon-refresh" 
+                            @click="refreshWXCardTime(workForm.createDate)"></el-button>
                 </el-form-item>
                 <!-- 000000 -->
                 <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
@@ -1952,6 +1955,7 @@
                 // console.log('test',this.depData,this.data[0].membCount,this.reportList.length);
             },
             refreshWXCardTime(workdate) {
+                if (!workdate) return;
                 this.syncTimeLoading = true;
                 this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
                     date: workdate,
@@ -5707,24 +5711,27 @@
                         for (var t=0;t<this.workForm.domains.length; t++) {
                             totalTime += parseFloat(this.workForm.domains[t].workingTime);
                         }
-                        
-                        if(this.user.timeType.notAllowedNoAttendance == 1){
-                            if (this.workForm.time){
-                                if (this.workForm.time.workHours == 0){
+                        //批量填报不校验考勤时长,交给后台校验
+                        if (!this.isBatch) {
+                            if(this.user.timeType.notAllowedNoAttendance == 1){
+                                if (this.workForm.time){
+                                    if (this.workForm.time.workHours == 0){
+                                        this.$message({
+                                            message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
+                                            type: 'error'
+                                        })
+                                        return
+                                    }
+                                }else{
                                     this.$message({
                                         message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
                                         type: 'error'
                                     })
                                     return
                                 }
-                            }else{
-                                this.$message({
-                                    message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
-                                    type: 'error'
-                                })
-                                return
                             }
                         }
+                        
 
                         if (this.reportTimeType.type == 1 && this.workForm.time) {
                             if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {