seyason 1 سال پیش
والد
کامیت
fda39219ac
15فایلهای تغییر یافته به همراه108 افزوده شده و 45 حذف شده
  1. 19 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  2. 10 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java
  3. 8 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Task.java
  4. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/UserMapper.java
  5. 8 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  6. 10 11
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  7. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  8. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
  9. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml
  10. 8 8
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml
  11. 12 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/UserMapper.xml
  12. 25 10
      fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue
  13. 0 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue
  14. 1 2
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  15. 2 2
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 19 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -367,12 +367,30 @@ public class TaskController {
                 return msg;
             }
         }
+        //检查前置任务是否都已经完成
+
         boolean isFinishTask = false;
         if (task.getTaskStatus() == 0) {
             task.setTaskStatus(1);
             isFinishTask = true;
             //计算排序,需要移动到最后
             Task old = taskService.getById(task.getId());
+            //检查前置任务是否都已经完成
+            if (!StringUtils.isEmpty(old.getAheadTid())) {
+                //解析JSONArray字符串
+                List<String> aheadTidList = JSONArray.parseArray(old.getAheadTid(), String.class);
+                if (aheadTidList.size() > 0) {
+                    List<Task> aheadTaskList = taskService.list(new QueryWrapper<Task>().in("id", aheadTidList));
+                    if (aheadTaskList.size() > 0) {
+                        List<Task> notFinishList = aheadTaskList.stream().filter(ahead->ahead.getTaskStatus() == 0).collect(Collectors.toList());
+                        if (notFinishList.size() > 0) {
+                            msg.setError("存在前置任务未完成:["+notFinishList.stream().map(Task::getName).collect(Collectors.joining(","))+"]。");
+                            return msg;
+                        }
+                    }
+                }
+            }
+
             if (old.getFinishDate() == null) {
                 //仅对没有完成日期的任务设置完成日期
                 task.setFinishDate(LocalDate.now());
@@ -571,6 +589,7 @@ public class TaskController {
         return msg;
     }
 
+
     @RequestMapping("/getTaskOnlyList")
     public HttpRespMsg getTaskOnlyList(Integer projectId) {
         HttpRespMsg msg = new HttpRespMsg();

+ 10 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java

@@ -20,11 +20,11 @@ import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * <p>
- *
+ * 
  * </p>
  *
  * @author Seyason
- * @since 2023-08-10
+ * @since 2023-12-06
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -397,6 +397,14 @@ public class Report extends Model<Report> {
     @TableField(exist = false)
     private Integer extraField3Name;
 
+
+    /**
+     * SAP项目服务ID
+     */
+    @TableField("sap_service_id")
+    private Integer sapServiceId;
+
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Task.java

@@ -21,7 +21,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2023-11-23
+ * @since 2023-12-04
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -236,6 +236,13 @@ public class Task extends Model<Task> {
     @TableField(exist = false)
     private boolean canAddTask;
 
+    /**
+     * 前置任务ids,多个逗号隔开
+     */
+    @TableField("ahead_tid")
+    private String aheadTid;
+
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/UserMapper.java

@@ -28,7 +28,7 @@ public interface UserMapper extends BaseMapper<User> {
 
     List<Map<String, Object>> getUserByDepartmentList(Page page,
                                                       @Param("companyId") Integer companyId,
-                                                      @Param("departmentIds") List departmentIds, String keyword, Integer status, @Param("roleId") Integer roleId);
+                                                      @Param("departmentIds") List departmentIds,Integer matchingType, String keyword, Integer status, @Param("roleId") Integer roleId);
 
     List<Map<String, Object>> getPushUserList(@Param("companyId") Integer companyId,Integer alertType, String date);
 

+ 8 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -2847,9 +2847,15 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
 
             ArrayList<DepartmentVO> realMDeptList = new ArrayList<>();
-            for (Department d : allMDeptList) {
-                realMDeptList.addAll(getSpecifiedDept(list, d.getDepartmentId()));
+            //存在负责的部门,需要查询所有子部门
+            if (allMDeptList.size() > 0) {
+                HttpRespMsg departmentList = departmentService.getDepartmentList(request);
+                list = (List<DepartmentVO>) departmentList.data;
+                for (Department d : allMDeptList) {
+                    realMDeptList.addAll(getSpecifiedDept(list, d.getDepartmentId()));
+                }
             }
+
             //去掉第一层的部门是其他第一层部门的子部门的数据
 
             for (int i=0;i<realMDeptList.size(); i++) {
@@ -2862,7 +2868,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
 
             list = realMDeptList;
-            System.out.println("负责部门的数量:"+list.size());
         }
 
         if (list.size() > 0) {

+ 10 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -848,25 +848,24 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", WXCompanyId));
         HashMap<String, Object> data = new HashMap<>();
         httpRespMsg.data=data;
-        //当企业开启了微信通讯录的情况下
-        if (org.apache.commons.lang3.StringUtils.isNotBlank(keyword) && wxCorpInfo!=null && wxCorpInfo.getSaasSyncContact()==1 && departmentId == -1){
+        //企业微信同步方式下,按姓名查找,需要去调用企微通讯录搜索接口
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(keyword) && wxCorpInfo!=null && wxCorpInfo.getSaasSyncContact()==1 && matchingType == 0){
             System.out.println("====================开始查询通讯录名单======================");
             HashMap<String, List> result = wxCorpInfoService.getOpenId(wxCorpInfo.getCorpid(), keyword, cursor,1,200);
             List users = result.get("user");
-            if (users.size()!=0&&matchingType==0){
+            if (users.size() > 0){
                 List<User> realUser = userMapper.selectList(new QueryWrapper<User>().in("corpwx_userid", users));
-
                 long total = realUser.size();
                 data.put("records",realUser);
                 data.put("nextCursor",result.get("nextCursor").get(0));
                 data.put("total",total);
             }else {
-                System.err.println("======================user列表没有查询到数据===========================");
-                System.err.println("======================httpRespMsg返回空集合===========================");
-                List<User> realUser = userMapper.selectList(new QueryWrapper<User>().eq("company_id",WXCompanyId).like(MATCHING_FILED[matchingType],keyword));
-                long total = realUser.size();
-                data.put("records",realUser);
-                data.put("nextCursor",result.get("nextCursor").get(0));
+//                System.err.println("======================user列表没有查询到数据===========================");
+//                System.err.println("======================httpRespMsg返回空集合===========================");
+//                List<User> realUser = userMapper.selectList(new QueryWrapper<User>().eq("company_id",WXCompanyId).like(MATCHING_FILED[matchingType],keyword));
+                long total = 0;
+                data.put("records",new ArrayList<>());
+                data.put("nextCursor","");
                 data.put("total",total);
             }
             return httpRespMsg;
@@ -897,7 +896,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                         ids = departmentService.getDeptIncludeSubDeptIds(departmentId, allDeptList);
                     }
 
-                    list = userMapper.getUserByDepartmentList(page, companyId, ids, keyword, status, roleId);
+                    list = userMapper.getUserByDepartmentList(page, companyId, ids, matchingType, keyword, status, roleId);
                     total = page.getTotal();
                 }
                 Map<String, Object> resultMap = new HashMap<>();

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

@@ -2051,6 +2051,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                     }
                 }else {
                     System.err.println("===================通讯录查询请求失败=================");
+                    System.out.println(respJson.toString());
                 }
             }
         }else {

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -18,7 +18,7 @@ spring:
     url: jdbc:mysql://47.101.180.183:17089/man_hour_manager?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     username: root
     password: P011430@Huoshi*
-    
+
     hikari:
       maximum-pool-size: 60
       minimum-idle: 10

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml


+ 8 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

@@ -31,8 +31,8 @@
         <result column="start_date" property="startDate" />
         <result column="meeting_id" property="meetingId" />
         <result column="service_id" property="serviceId" />
+        <result column="ahead_tid" property="aheadTid" />
     </resultMap>
-
     <resultMap id="timeResultMap" type="com.management.platform.entity.TimeTask" >
         <id column="id" property="id" />
         <result column="name" property="name" />
@@ -93,11 +93,11 @@
         <result column="stages_name" property="stagesName" />
         <result column="department_name" property="departmentName" />
     </resultMap>
-
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, name, task_desc, creater_id, creater_name, creator_color, executor_id, executor_name, executor_color, task_level, task_status, create_date, end_date, project_id, stages_id, company_id, indate, parent_tid, group_id, seq, plan_hours, task_type, parent_tname, finish_date, start_date, meeting_id, service_id
+        id, name, task_desc, creater_id, creater_name, creator_color, executor_id, executor_name, executor_color, task_level, task_status, create_date, end_date, project_id, stages_id, company_id, indate, parent_tid, group_id, seq, plan_hours, task_type, parent_tname, finish_date, start_date, meeting_id, service_id, ahead_tid
     </sql>
+
     <select id="simpleList" resultMap="BaseResultMap">
         select id, name, creater_id, creater_name, creator_color, executor_id, executor_name, executor_color, task_level, task_status, create_date, end_date, project_id, stages_id, company_id, indate, parent_tid, group_id, seq, plan_hours, task_type, parent_tname, finish_date, start_date
         from task
@@ -109,7 +109,7 @@
     <select id="nameList" resultMap="BaseResultMap">
         select id, name, task_level, stages_id, company_id, indate,  group_id, seq,task_type,task_desc
         from task
-        ${ew.customSqlSegment}
+                 ${ew.customSqlSegment}
     </select>
 
     <!--计算执行人任务分布-->
@@ -131,7 +131,7 @@
     <select id="getStagesPanel" resultType="java.util.Map">
         SELECT a.stages_id AS stagesId, stages.`stages_name` AS name,  COUNT(1) AS value
         FROM task a
-        LEFT JOIN stages ON stages.id = a.`stages_id`
+            LEFT JOIN stages ON stages.id = a.`stages_id`
         WHERE a.project_id = #{projectId}
         GROUP BY a.stages_id
         ORDER BY stages.`sequence`
@@ -140,7 +140,7 @@
     <!--计算耗时排名前十的任务-->
     <select id="getTopCostTask" resultType="java.util.Map">
         SELECT task.id , task.name AS name, IFNULL(SUM(report.`working_time`),0) AS value FROM task
-        LEFT JOIN report ON report.`task_id` = task.id
+            LEFT JOIN report ON report.`task_id` = task.id
         WHERE task.project_id = #{projectId} and report.state = 1
         GROUP BY task.id ORDER BY SUM(report.`working_time`) DESC LIMIT 10
     </select>
@@ -148,7 +148,7 @@
     <!-- 查询任务实际工时和计划工时对比,仅查询有实际工时的数据 -->
     <select id="getTaskTimeCompare" resultType="java.util.Map">
         SELECT task.id , task.name AS name, task.plan_hours as planHours, IFNULL(SUM(report.`working_time`),0) AS workHours FROM report
-        LEFT JOIN task ON report.`task_id` = task.id AND report.state = 1
+                                                                                                                                     LEFT JOIN task ON report.`task_id` = task.id AND report.state = 1
         WHERE task.project_id = #{projectId}
         GROUP BY task.id
     </select>
@@ -236,7 +236,7 @@
         select * from task where
         task.task_type=1
         <if test="ids!=null">
-        and task.project_id in
+            and task.project_id in
             <foreach collection="ids" index="index" close=")" open="(" separator="," item="item">
                 #{item}
             </foreach>

+ 12 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/UserMapper.xml

@@ -106,7 +106,18 @@
             #{departmentId}
         </foreach>
         <if test="keyword != null and keyword != ''">
-            AND a.name like '%${keyword}%'
+            AND
+            <choose>
+                <when test="matchingType==0">
+                    a.name like '%${keyword}%'
+                </when>
+                <when test="matchingType==1">
+                    a.phone like '%${keyword}%'
+                </when>
+                <when test="matchingType==2">
+                    a.job_number like '%${keyword}%'
+                </when>
+            </choose>
         </if>
         <if test="status != null">
             AND a.is_active = #{status}

+ 25 - 10
fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue

@@ -4,18 +4,12 @@
         <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="120px">
             <el-form-item label="所属项目" v-if="showOrNot" prop="projectId">
                 <el-select v-model="addForm.projectId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(1)" filterable="true" style="width:100%;">
-
-                    <!-- <el-option v-for="item in projectList" :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
-                        <span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
-                        <span style="float: right;font-size: 13px;">{{ item.projectName }}</span>
-                    </el-option> -->
                     <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
                         <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
                             <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
                             <span style="float: right;">{{ item.projectName }}</span>
                         </el-option>
                     </el-option-group>
-
                 </el-select>
             </el-form-item>
             <el-form-item label="所属任务分组" v-if="showOrNot" prop="groupId">
@@ -34,6 +28,11 @@
                     <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
                 </el-select>
             </el-form-item>
+            <el-form-item label="前置任务" prop="aheadTidList" >
+                <el-select v-model="addForm.aheadTidList" style="width:100%;" multiple filterable @change="$forceUpdate()">
+                    <el-option v-for="item in relationdata" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                </el-select>
+            </el-form-item>
             <el-form-item :label="$t('types')">
                 <el-select v-model="addForm.taskType" style="width:100%;" :disabled="((this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement) && !(groupResponsibleId == user.id)" @change="selchg()">
                     <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
@@ -855,7 +854,8 @@ export default {
     this.gstimday = [1]
     this.getSapServiceList()
 
-    this.timess()
+    this.timess();
+    
   },
   methods: {
     // 触发外层的会议
@@ -874,6 +874,7 @@ export default {
         if(obj.create) {
             this.mileageCup = false
             this.addFormVisible = true;
+            this.curProjectId = obj.stage.projectId;
             this.addForm = {projectId: obj.stage.projectId, groupId: obj.stage.groupId, stagesId: obj.stage.id, taskLevel:0, planHours: 8, taskType: 0};
             this.addForm.executorListFront = [{executorId:null, planHours:this.user.timeType.allday}];
             this.gstimhour = [this.user.timeType.allday]
@@ -888,6 +889,7 @@ export default {
                 this.isEditFile = true;
                 this.getDetail(obj.curProjectId)
             }
+            this.curProjectId = obj.task.projectId;
             this.getTaskDetail(obj.id);
             this.getTaskProgressList(obj.id); // 获取任务进展列表 
             this.gain(obj.task); // 获取评论列表
@@ -895,6 +897,7 @@ export default {
             this.getRelationTaskList(obj.num, obj.id)
             this.getTaskFileList(obj.num,obj.id)
         }
+        this.getrelation();
     },
     // 代办任务创建事件
     agentCreatesEvents(num) {
@@ -902,6 +905,7 @@ export default {
             this.addForm.groupId = ''
             this.addForm.stagesId = ''
             this.getTaskGrouping()
+            this.getrelation();
         } else if(num == 2) {
             this.addForm.stagesId = ''
             this.getTaskList()
@@ -1044,6 +1048,12 @@ export default {
                     }   
                 }
                 this.addForm = res.data;
+                if (this.addForm.aheadTid) {
+                    this.addForm.aheadTidList = JSON.parse(this.addForm.aheadTid);
+                } else {
+                    this.addForm.aheadTidList = [];
+                }
+                
                 this.addForm.createDate = null;
                 this.addForm.indate = null;
                 this.addLoading = false;
@@ -1383,6 +1393,7 @@ export default {
                 //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
                 // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
                 this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
+                this.addForm.aheadTid = JSON.stringify(this.addForm.aheadTidList);
                 this.addLoading = true;
                 this.http.post('/task/save',this.addForm,
                     res => {
@@ -1597,16 +1608,20 @@ export default {
         this.isRelationTab = true
         this.getrelation()
     },
-    getrelation(){  //获取选择关联列表
+    getrelation(){  
+
+        //获取选择关联列表
         this.http.post('/task/getTaskOnlyList',{
-            projectId: this.curProjectId
+            projectId: this.curProjectId?this.curProjectId:this.addForm.projectId
         },
         res => {
             if (res.code == "ok") {
                 this.relationdata = []
                 res.data.forEach( (item) =>{
                     if(item.taskType != 1){
-                        this.relationdata.push(item)
+                        if (item.id != this.addForm.id) {
+                            this.relationdata.push(item)
+                        }
                     }
                 })
                 

+ 0 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -2668,7 +2668,6 @@
                                 } else {
                                     this.getViewTaskList();
                                 }
-                                
                             } else {
                                 this.$message({
                                     message: res.msg,

+ 1 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -17,13 +17,12 @@
             </div>
             <el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
             <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
-                <!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree> -->
-                <!-- <el-tree :data="data" :props="defaultProps" node-key="id" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa"> -->
                 <el-tree :data="data" 
                 :props="defaultProps" 
                 :draggable="adjustPosition"
                 :allow-drop="allowDrop"
                 @node-drop="nodeDrop"
+                style="padding-bottom:70px;"
                 :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa">
                     <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node }" @mouseleave= mouseleave(data,$event) @mouseover= mouseover(data,$event)>
                         <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue