Просмотр исходного кода

解决专业版代填时的任务选择问题

seyason 1 год назад
Родитель
Сommit
cfb17a567d

+ 12 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -767,17 +767,22 @@ public class TaskController {
     }
 
     @RequestMapping("/getRecentTask")
-    public HttpRespMsg getRecentTask(Integer projectId,
+    public HttpRespMsg getRecentTask(Integer projectId, String userId,
                                      @RequestParam(required = false, defaultValue = "0") Integer isSubstitude, String stage, Integer groupId) {
         HttpRespMsg msg = new HttpRespMsg();
-        String userId = request.getHeader("Token");
-        if (isSubstitude == 0) {
-            msg.data = taskMapper.recentSimpleList(projectId, userId, stage, groupId);
-        } else {
-            //代填的情况,获取的是项目中的所有任务
-            msg.data = taskMapper.recentSimpleList(projectId, null, stage, groupId);
+        if (isSubstitude == 0 || userId == null) {
+            userId = request.getHeader("Token");
         }
 
+        msg.data = taskMapper.recentSimpleList(projectId, userId, stage, groupId);
+
+//        if (isSubstitude == 0) {
+//            msg.data = taskMapper.recentSimpleList(projectId, userId, stage, groupId);
+//        } else {
+//            //代填的情况,获取的是项目中的所有任务
+//            msg.data = taskMapper.recentSimpleList(projectId, null, stage, groupId);
+//        }
+
         return msg;
     }
 

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

@@ -2426,7 +2426,7 @@ public class WeiXinCorpController {
                             //设置层级部门
                             changeUser.setDepartmentCascade(convertDepartmentIdToCascade(changeUser.getDepartmentId(), allDeptList));
                             changeUser.setCorpwxDeptid(userItem.getCorpwxDeptid());
-                        } else if (oldUser.getCorpwxDeptid() == 1) {
+                        } else if (oldUser.getCorpwxDeptid() == null || oldUser.getCorpwxDeptid() == 1) {
                             changeUser.setId(oldUser.getId());
                             //从待分配变成有部门的时候才更新;避免原来有部门的被冲掉,变成无部门
                             changeUser.setDepartmentId(0);

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

@@ -282,7 +282,9 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 System.out.println("设置状态为待审核"+itemList.size());
                 itemList.forEach(item->item.setStatus(1));
                 expenseItemService.remove(new QueryWrapper<ExpenseItem>().eq("expense_id", sheet.getId()).ne("status", 0));
-                expenseItemService.saveOrUpdateBatch(itemList);
+                if (itemList.size() > 0) {
+                    expenseItemService.saveOrUpdateBatch(itemList);
+                }
             }
         } else {
             //新增时都是待审核

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

@@ -773,7 +773,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                     if(timeType.getProjectManDay()==1){
                         project.setManDay(manDay);
-                        if (!StringUtils.isEmpty(planEndDate)) {
+                        if (!StringUtils.isEmpty(manDayStartDate)) {
                             project.setManDayStartDate(LocalDate.parse(manDayStartDate));
                         }
                     }

+ 26 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -3930,9 +3930,19 @@
 
             //确定选择参与人
             chooseParticip() {
-                this.chooseParticipVisible = false;
                 var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
                 this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
+                //针对专业版,只能选择一个人进行代填,防止任务有问题
+                if (this.user.company.packageProject == 1) {
+                    if (this.chosenMembList.length > 1) {
+                        this.$message({
+                            message: '每次仅支持代填一个人',
+                            type: "error",
+                        });
+                        return;
+                    }
+                }
+                this.chooseParticipVisible = false;
                 this.workForm.userNames = '';
                 this.workForm.userId = [];
                 this.participator = [];
@@ -4230,9 +4240,10 @@
             getRecentTaskList(domain, index) {
                 //刷新任务时,清空服务
                 this.$set(domain, 'sapServiceId', null);
+                this.$set(domain, 'taskId', null);
                 var param = { 
                     projectId: domain.projectId,
-                    isSubstitude:this.isSubstitude?1:0
+                    isSubstitude:this.isSubstitude?1:0,
                 };
                 if (domain.groupId) {
                     param.groupId = domain.groupId;
@@ -4240,6 +4251,19 @@
                 if (domain.stage) {
                     param.stage = domain.stage;
                 }
+                //专业版代填,获取代填员工的任务
+                if (this.user.company.packageProject==1 && this.isSubstitude) {
+                    if (!this.workForm.userId || this.workForm.userId.length == 0) {
+                        this.$message({
+                            message: '请选择代填的员工',
+                            type: "error"
+                        });
+                        return;
+                    } else {
+                        param.userId = this.workForm.userId[0];
+                    }
+                }
+                
                 this.http.post('/task/getRecentTask',param,
                 res => {
                     if (res.code == "ok") {