Parcourir la source

1. 登录兼容简易版
2. 修改企业微信漏填的模板关键字
3. 项目甘特图按任务分组过滤接口
4. 修改资源需求的接口

seyason il y a 3 ans
Parent
commit
bcb8024c61

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

@@ -333,8 +333,8 @@ public class ProjectController {
     }
 
     @RequestMapping("/getGanttData")
-    public HttpRespMsg getGanttData(@RequestParam(required = false, defaultValue = "0") Integer type, String startDate, String endDate, String userId, Integer projectId, HttpServletRequest request) {
-        return projectService.getGanttData(type, startDate, endDate, userId, projectId, request);
+    public HttpRespMsg getGanttData(@RequestParam(required = false, defaultValue = "0") Integer type, String startDate, String endDate, String userId, Integer projectId, String groupName, HttpServletRequest request) {
+        return projectService.getGanttData(type, startDate, endDate, userId, projectId, groupName, request);
     }
 
     /**

+ 10 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectRequirementController.java

@@ -65,7 +65,7 @@ public class ProjectRequirementController {
         HttpRespMsg msg = new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("TOKEN")).getCompanyId();
         int startIndex = (pageIndex-1)*pageSize;
-        long total = projectMapper.selectCount(new QueryWrapper<Project>().eq("company_id", companyId));
+
         LocalDate now = LocalDate.now();
         now = now.minusDays(7);
         String startDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now);
@@ -74,8 +74,16 @@ public class ProjectRequirementController {
             List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
             List<Integer> collect = projectList.stream().map(Project::getId).collect(Collectors.toList());
             List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("name", groupName).in("project_id", collect));
-            projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
+            projectIds = taskGroups.stream().map(TaskGroup::getProjectId).distinct().collect(Collectors.toList());
+        }
+        long total = 0;
+        if (projectIds.size() > 0) {
+            total = projectIds.size();
+        } else {
+            QueryWrapper<Project> queryWrapper = new QueryWrapper<Project>().eq("company_id", companyId);
+            total = projectMapper.selectCount(queryWrapper);
         }
+
         List<ProjectRequirement> projectRequirements = projectRequirementMapper.customSelect(companyId, startDate, projectId, projectIds.size()==0?null:projectIds, startIndex, pageSize);
         HashMap map = new HashMap();
         map.put("total", total);

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

@@ -50,7 +50,7 @@ public class WxCorpInfoController {
         JSONObject json=new JSONObject();
         JSONArray dataJson=new JSONArray();
         JSONObject jsonObj=new JSONObject();
-        jsonObj.put("key", "提");
+        jsonObj.put("key", "提");
         jsonObj.put("value", "测试提醒消息");
         dataJson.add(jsonObj);
         json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");

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

@@ -88,7 +88,7 @@ public interface ProjectService extends IService<Project> {
 
     HttpRespMsg exportCustomerProjectInAndOut(HttpServletRequest request);
 
-    HttpRespMsg getGanttData(Integer type, String startDate, String endDate, String userId, Integer projectId,HttpServletRequest request);
+    HttpRespMsg getGanttData(Integer type, String startDate, String endDate, String userId, Integer projectId, String groupName, HttpServletRequest request);
 
     HttpRespMsg getProjectStagesCost(Integer pageIndex, Integer pageSize, HttpServletRequest request);
 

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

@@ -1447,7 +1447,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     }
 
     @Override
-    public HttpRespMsg getGanttData(Integer type, String startDate, String endDate, String targetUserId, Integer targetProjectId, HttpServletRequest request) {
+    public HttpRespMsg getGanttData(Integer type, String startDate, String endDate, String targetUserId, Integer targetProjectId, String groupName, HttpServletRequest request) {
         //根据人员权限来获取,
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
@@ -1599,6 +1599,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
             } else {
                 //按照项目获取
+                if (!StringUtils.isEmpty(groupName)) {
+                    List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
+                    List<Integer> collect = projectList.stream().map(Project::getId).collect(Collectors.toList());
+                    List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("name", groupName).in("project_id", collect));
+                    List<Integer> groupRefProjectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
+                    if (projectIds == null) {
+                        projectIds = groupRefProjectIds;
+                    } else {
+                        //做个过滤,匹配按分组筛选的项目
+                        projectIds = projectIds.stream().filter(p->groupRefProjectIds.stream().anyMatch(grp->grp.equals(p))).collect(Collectors.toList());
+                    }
+                }
                 String btLastItemId = null;
                 GanttDataItem btLastParentItem=null;
                 ganttData = projectMapper.getTaskPlanByProject(projectIds, startDate ,endDate, user.getCompanyId());

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -321,7 +321,7 @@ public class TimingTask {
                         JSONObject json=new JSONObject();
                         JSONArray dataJson=new JSONArray();
                         JSONObject jsonObj=new JSONObject();
-                        jsonObj.put("key", "提");
+                        jsonObj.put("key", "提");
                         jsonObj.put("value", StringUtils.isEmpty(t.getAlertMsg())?"":t.getAlertMsg());
                         dataJson.add(jsonObj);
                         json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");

+ 14 - 25
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -90,17 +90,13 @@
             } 
             if (localStorage.userInfo != null) {
                 var user = JSON.parse(localStorage.userInfo);
-                // if (user.role == 3) {
-                //     //公司高层
-                //     this.$router.push({ path: '/cost' });
-                // } else if (user.role == 4) {
-                //     //财务管理员
-                //     this.$router.push({ path: '/team' });
-                // } else {
-                //     this.$router.push({ path: '/daily' });
-                // }
-                if(user.moduleList.length > 0) {
-                    this.$router.push({ path: user.moduleList[0].path })
+                if (user.company.packageSimple == 1) {
+                    //简易模式,直接进入工时统计表
+                    this.$router.push({ path: '/simple' });
+                } else {
+                    if(user.moduleList.length > 0) {
+                        this.$router.push({ path: user.moduleList[0].path })
+                    }
                 }
             } else {
                 if (this.isCorpWX) {
@@ -282,20 +278,13 @@
                                 var user = res.data;
                                 sessionStorage.setItem('user', JSON.stringify(res.data));
                                 this.permissionsList(res.data)
-                                // if (user.company.packageSimple == 1) {
-                                //     //简易模式,直接进入工时统计表
-                                //     this.$router.push({ path: '/simple' });
-                                // } else if (user.role == 3) {
-                                //     //公司高层
-                                //     this.$router.push({ path: '/cost' });
-                                // } else if (user.role == 4) {
-                                //     //财务管理员
-                                //     this.$router.push({ path: '/team' });
-                                // } else {
-                                //     this.$router.push({ path: '/daily' });
-                                // }
-                                if(user.moduleList.length > 0) {
-                                    this.$router.push({ path: user.moduleList[0].path })
+                                if (user.company.packageSimple == 1) {
+                                    //简易模式,直接进入工时统计表
+                                    this.$router.push({ path: '/simple' });
+                                } else {
+                                    if(user.moduleList.length > 0) {
+                                        this.$router.push({ path: user.moduleList[0].path })
+                                    }
                                 }
                             } else {
                                 this.$message({

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

@@ -150,9 +150,8 @@
             </el-table-column>
             <el-table-column label="操作" width="220">
                 <template slot-scope="scope">
-                    <el-button v-if="scope.row.state == 0" type="primary" :loading="logining" size="small" @click="approve(scope.row.id,scope.row.date, scope.row)">通过</el-button>
-                    <el-button v-if="scope.row.state == 0" type="danger" :loading="logining" size="small" @click="showDenyDialog(scope.row.id,0,scope.row.dateStr, scope.row)">驳回</el-button>
-                    <el-button v-if="scope.row.state == 1" type="danger" :loading="logining" size="small" @click="showDenyDialog(scope.row.id,1,scope.row.dateStr, scope.row)">撤销</el-button>
+                    <el-button type="primary" :loading="logining" size="small" @click="approve(scope.row.id,scope.row.date, scope.row)">通过</el-button>
+                    <el-button type="danger" :loading="logining" size="small" @click="showDenyDialog(scope.row.id,0,scope.row.dateStr, scope.row)">驳回</el-button>
                 </template>
             </el-table-column>
         </el-table>

+ 2 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -79,9 +79,8 @@
                         </div>
                     </div>
                     <div class="form_btn" slot="footer">
-                        <van-button v-if="(flg || user.id == item.data[0].projectAuditorId)&&item.state == 0" size="small" type="info" @click="approve(item.id, item)">通过</van-button>
-                        <van-button v-if="(flg || user.id == item.data[0].projectAuditorId)&&item.state == 0" size="small" type="danger" @click="showDenyDialog(item.id,0,item.dateStr, item)">驳回</van-button>
-                        <van-button v-if="(flg || user.id == item.data[0].inchargerId) && item.state == 1" size="small" type="danger" @click="showDenyDialog(item.id,1,item.dateStr, item)">撤销</van-button>
+                        <van-button size="small" type="info" @click="approve(item.id, item)">通过</van-button>
+                        <van-button size="small" type="danger" @click="showDenyDialog(item.id,0,item.dateStr, item)">驳回</van-button>
                     </div>
                     <van-popup v-model="imgShow" position="bottom" closeable >
                         <van-swipe class="my-swipe"  indicator-color="white">