Browse Source

赛元需求

seyason 8 months ago
parent
commit
88cc9761c7

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

@@ -5082,20 +5082,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     //数据行
                     //读取工作内容
                     String workContent = null;
-                    if (withCheckIn!=null) {
-                        int workContentIndex = projectNameStartIndex -1;
-                        if (row.getCell(workContentIndex) == null) {
-                            //msg.setError("第"+dataCount+"行缺少工作内容");工作内容为必填项
-                            msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
-                            return msg;
-                        }
-                        workContent = row.getCell(workContentIndex).getStringCellValue().trim();
-                        if (StringUtils.isEmpty(workContent)) {
-                            //msg.setError("第"+dataCount+"行缺少工作内容");
-                            msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
-                            return msg;
-                        }
-                    }
+
 
                     for (int i=1;i<projectNameStartIndex+projectList.size(); i++) {
                         if (row.getCell(i) != null) {
@@ -5130,6 +5117,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         return msg;
                     }
                     User reportCreator = any.get();
+                    double curRowTotalTime = 0;
                     for (int i=projectNameStartIndex; i < projectNameStartIndex + projectList.size(); i++) {
                         if (row.getCell(i) == null) {
                             continue;
@@ -5190,6 +5178,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                 report.setCreateDate(LocalDate.parse(reportDate, dtf));
                                 report.setCost(reportCreator.getCost()==null?new BigDecimal(0) : reportCreator.getCost().multiply(new BigDecimal(time)));
                                 reportList.add(report);
+                                curRowTotalTime += time;
                             } else if (time < 0) {
                                 //msg.setError(username + "的工时存在负数,请检查修改");
                                 msg.setError(MessageUtils.message("report.negativeError",username));
@@ -5197,6 +5186,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                             }
                         }
                     }
+                    //导入工时大于0时,需要有工作内容
+                    if (curRowTotalTime > 0) {
+                        if (withCheckIn!=null) {
+                            int workContentIndex = projectNameStartIndex -1;
+                            if (row.getCell(workContentIndex) == null) {
+                                //msg.setError("第"+dataCount+"行缺少工作内容");工作内容为必填项
+                                msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
+                                return msg;
+                            }
+                            workContent = row.getCell(workContentIndex).getStringCellValue().trim();
+                            if (StringUtils.isEmpty(workContent)) {
+                                //msg.setError("第"+dataCount+"行缺少工作内容");
+                                msg.setError(MessageUtils.message("data.LackWorkContentByRow",dataCount));
+                                return msg;
+                            }
+                        }
+                    }
                 }
             }
 
@@ -6463,12 +6469,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                                     }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
                                                         projectAuditorName = "$userName=" + userItem.getDingdingUserid() + "$";
                                                     }
-                                                    item.add("待项目审核人" + "(" + projectAuditorName + ")审核");
+                                                    item.add("待"+(companyId == 469?"部门主管":"项目审核人") + "(" + projectAuditorName + ")审核");
                                                     break;
                                                 }
                                             }
                                         } else {
-                                            item.add("待项目审核人" + "(" + projectAuditorName + ")审核");
+                                            item.add("待"+(companyId == 469?"部门主管":"项目审核人") + "(" + projectAuditorName + ")审核");
                                         }
                                     }
                                 }
@@ -6478,8 +6484,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 }
 
                 if (timeType.getEnableNewWeeklyfill() == 1) {
-//                    String createDate = new SimpleDateFormat("yyyy-MM-dd")
-//                            .format((java.sql.Date) map.get("createDate"));
                     ReportBatch batchItem = reportBatchMapper.selectOne(new QueryWrapper<ReportBatch>().eq("creator_id", map.get("creatorId")).eq("start_date", createDate).last("limit 1"));
                     if (batchItem != null) {
                         item.add(batchItem.getSummary());

+ 4 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -100,14 +100,14 @@
                                         <span v-else>
                                             <span v-if="item.isDeptAudit==0">
                                                 <span v-if="item.projectAuditState==0">
-                                                    {{ $t('other.waitForTheProjectReviewer') }}<span v-if="item.projectAuditorName != null">(
+                                                    {{ user.companyId == 469?"待部门主管":$t('other.waitForTheProjectReviewer') }}<span v-if="item.projectAuditorName != null">(
                                                         <!-- {{item.projectAuditorName}} -->
                                                         <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.projectAuditorName'></TranslationOpenDataText></span>
                                                         <span v-if="user.userNameNeedTranslate != '1'">{{item.projectAuditorName}}</span>
                                                         )</span>{{ $t('other.audit') }}
                                                 </span>
                                                 <span style="color:#32CD32;" v-else-if="item.projectAuditState==1">
-                                                    {{ $t('other.projectAuditor') }}<span v-if="item.projectAuditorName != null">(
+                                                    {{ user.companyId == 469?"待部门主管":$t('other.projectAuditor') }}<span v-if="item.projectAuditorName != null">(
                                                         <!-- {{item.projectAuditorName}} -->
                                                         <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.projectAuditorName'></TranslationOpenDataText></span>
                                                         <span v-if="user.userNameNeedTranslate != '1'">{{item.projectAuditorName}}</span>
@@ -249,7 +249,7 @@
                                         <!-- {{scope.row.isDeptAudit==0?$t('other.Tobereviewedbytheprojectreviewer'):($t('other.await')+scope.row.auditDeptName+('('+scope.row.deptAuditorName+')')+$t('other.audit'))}} -->
                                         <span v-if="scope.row.isDeptAudit==0">
                                             <span>
-                                                {{ $t('other.waitForTheProjectReviewer') }}<span>(
+                                                {{ user.companyId == 469?"待部门主管":$t('other.waitForTheProjectReviewer') }}<span>(
                                                     <template v-for="(auditItem, auditindexs) in (scope.row.reviewerNames || [])">
                                                         <TranslationOpenDataText type='userName' :openid='auditItem'></TranslationOpenDataText>
                                                         <span v-if="auditindexs < scope.row.reviewerNames.length-1">,</span>
@@ -269,7 +269,7 @@
                                     <!-- <span v-if="scope.row.isDeptAudit==0">{{$t('other.Tobereviewedbytheprojectreviewer')}}</span> -->
                                      <span v-if="scope.row.isDeptAudit==0">
                                         <span>
-                                            {{ $t('other.waitForTheProjectReviewer') }}<span>(
+                                            {{ user.companyId == 469?"待部门主管":$t('other.waitForTheProjectReviewer') }}<span>(
                                                 <template v-for="(auditItem, auditindexs) in (scope.row.reviewerNames || [])">
                                                     <TranslationOpenDataText type='userName' :openid='auditItem'></TranslationOpenDataText>
                                                     <span v-if="auditindexs < scope.row.reviewerNames.length-1">,</span>