Bläddra i källkod

Merge remote-tracking branch 'origin/master'

yusm 2 månader sedan
förälder
incheckning
1a3f4a3aeb

+ 10 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1359,18 +1359,21 @@ public class ReportController {
                 }
                 for (Report report : targetCheckList) {
                     HttpRespMsg httpRespMsg = new HttpRespMsg();
-                    Optional<Project> first = targetProjectList.stream().filter(tl -> tl.getId().equals(report.getProjectId())).findFirst();
+                    //按项目进行校验
+                    Integer curProjectId = report.getProjectId();
+                    Optional<Project> first = targetProjectList.stream().filter(tl -> tl.getId().equals(curProjectId)).findFirst();
                     if(first.isPresent()){
-                        double nowReport = targetCheckList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId())).mapToDouble(Report::getWorkingTime).sum();
+                        //增加项目id过滤
+                        double todayProjectTime = targetCheckList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId()) && rl.getProjectId().equals(curProjectId)).mapToDouble(Report::getWorkingTime).sum();
                         if(first.get().getManDay()!=null && first.get().getManDay()>0){
                             //已填报的工时情况
                             double sum;
                             if(first.get().getManDayStartDate()!=null){
-                                sum = oldRelatedReportList.stream().filter(npl -> npl.getProjectId().equals(first.get().getId()) &&(npl.getCreateDate().isAfter(first.get().getManDayStartDate())||npl.getCreateDate().isEqual(first.get().getManDayStartDate()))&& (npl.getState() == 0 || npl.getState() == 1)).mapToDouble(Report::getWorkingTime).sum();
+                                sum = oldRelatedReportList.stream().filter(npl -> npl.getProjectId().equals(curProjectId) &&(npl.getCreateDate().isAfter(first.get().getManDayStartDate())||npl.getCreateDate().isEqual(first.get().getManDayStartDate()))&& (npl.getState() == 0 || npl.getState() == 1)).mapToDouble(Report::getWorkingTime).sum();
                             }else {
-                                sum = oldRelatedReportList.stream().filter(npl -> npl.getProjectId().equals(first.get().getId()) && (npl.getState() == 0 || npl.getState() == 1)).mapToDouble(Report::getWorkingTime).sum();
+                                sum = oldRelatedReportList.stream().filter(npl -> npl.getProjectId().equals(curProjectId) && (npl.getState() == 0 || npl.getState() == 1)).mapToDouble(Report::getWorkingTime).sum();
                             }
-                            BigDecimal hasReport = new BigDecimal(sum).add(new BigDecimal(nowReport));
+                            BigDecimal hasReport = new BigDecimal(sum).add(new BigDecimal(todayProjectTime));
                             BigDecimal multiply = new BigDecimal(first.get().getManDay()).multiply(new BigDecimal(comTimeType.getAllday()));
                             if(hasReport.doubleValue()>multiply.doubleValue()){
                                 sendReportTimeWarningMsg(company, first.get(), null, null);
@@ -1396,8 +1399,8 @@ public class ReportController {
                                     }else {
                                         groupSum = oldRelatedReportList.stream().filter(npl -> npl.getGroupId().equals(targetGpId) && (npl.getState() == 0 || npl.getState() == 1)).mapToDouble(Report::getWorkingTime).sum();
                                     }
-                                    nowReport = targetCheckList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId()) && targetGpId.equals(rl.getGroupId())).mapToDouble(Report::getWorkingTime).sum();
-                                    hasReport = new BigDecimal(groupSum).add(new BigDecimal(nowReport));
+                                    todayProjectTime = targetCheckList.stream().filter(rl -> rl.getCreateDate().equals(report.getCreateDate()) && rl.getCreatorId().equals(report.getCreatorId()) && targetGpId.equals(rl.getGroupId())).mapToDouble(Report::getWorkingTime).sum();
+                                    hasReport = new BigDecimal(groupSum).add(new BigDecimal(todayProjectTime));
                                     TaskGroup tgp = taskGroupService.getById(targetGpId);
                                     //设置的数值大于0时检查是否超额
                                     if (tgp != null && tgp.getManDay() != null && tgp.getManDay() > 0) {

+ 9 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -81,7 +81,7 @@
                 </el-select>
 
                 <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'1'"
-                  :subject="users" :disabled="!permissions.costAudit" :subjectId="addForm.ownerId" ref="selectCat"
+                  :subject="users" :disabled="!permissions.costAudit && expenseMainTypeValue != 14454" :subjectId="addForm.ownerId" ref="selectCat"
                   @selectCal="selectCal"></selectCat>
 
               </el-form-item>
@@ -540,8 +540,11 @@
           <el-form-item :label="$t('peopleconcerned')" style="width: 270px"
             :rules="{ required: true, message: $t('pleaseselecttheapplicant'), trigger: 'blur' }">
 
-            <el-input v-model="ParticularsList.ownerName"
+            <!-- <el-input v-model="ParticularsList.ownerName"
               :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId"
+              v-if="user.userNameNeedTranslate != '1'"></el-input> -->
+            <el-input v-model="ParticularsList.ownerName"
+              :disabled="true"
               v-if="user.userNameNeedTranslate != '1'"></el-input>
             <!-- <el-select v-model="ParticularsList.ownerId" :placeholder="$t('pleaseselecttheapplicant')" style="width: 150px" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId">
                 <span v-for="(item, index) in users" :key="index">
@@ -549,8 +552,11 @@
                 </span>
               </el-select> -->
 
-            <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'"
+            <!-- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'"
               :subject="users" :disabled="flg || ParticularsList.ownerId == ParticularsList.operatorId"
+              :subjectId="ParticularsList.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat> -->
+            <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :widthStr="'150'" :distinction="'3'"
+              :subject="users" :disabled="true"
               :subjectId="ParticularsList.ownerId" ref="selectCat" @selectCal="selectCal"></selectCat>
 
           </el-form-item>