Min há 1 ano atrás
pai
commit
6e6ce3bfff

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

@@ -106,12 +106,6 @@ public class TaskController {
         //当前用户
         User user = userMapper.selectById(userId);
         HttpRespMsg msg = new HttpRespMsg();
-        if(task.getServiceId()!=null){
-            SapProjectService one = sapProjectServiceService.getOne(new LambdaQueryWrapper<SapProjectService>().eq(SapProjectService::getCompanyId, user.getCompanyId()).eq(SapProjectService::getServiceCode,task.getServiceId()));
-            if(one!=null){
-                task.setName(one.getServiceName()+"-"+one.getServiceCode());
-            }
-        }
 
         //新建的任务,需要设置创建人,创建时间
         if (task.getId() == null) {

+ 4 - 4
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-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -215,10 +215,10 @@ public class Task extends Model<Task> {
     private String meetingId;
 
     /**
-     * SAP服务编号
+     * 前置任务ids,多个逗号隔开
      */
-    @TableField("service_id")
-    private String serviceId;
+    @TableField("ahead_tid")
+    private String aheadTid;
 
     @TableField(exist = false)
     private List<TaskExecutor> executorList;

+ 10 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TaskExecutor.java

@@ -1,9 +1,10 @@
 package com.management.platform.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -18,7 +19,7 @@ import java.util.List;
  * </p>
  *
  * @author Seyason
- * @since 2022-03-27
+ * @since 2023-12-05
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -60,6 +61,12 @@ public class TaskExecutor extends Model<TaskExecutor> {
     @TableField("project_id")
     private Integer projectId;
 
+    /**
+     * SAP项目服务ID
+     */
+    @TableField("service_id")
+    private String serviceId;
+
 
     @Override
     protected Serializable pkVal() {

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskExecutorMapper.xml

@@ -11,11 +11,12 @@
         <result column="executor_color" property="executorColor" />
         <result column="plan_hours" property="planHours" />
         <result column="project_id" property="projectId" />
+        <result column="service_id" property="serviceId" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, task_id, executor_id, executor_name, executor_color, plan_hours, project_id
+        id, task_id, executor_id, executor_name, executor_color, plan_hours, project_id, service_id
     </sql>
 
 </mapper>

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

@@ -30,7 +30,6 @@
         <result column="finish_date" property="finishDate" />
         <result column="start_date" property="startDate" />
         <result column="meeting_id" property="meetingId" />
-        <result column="service_id" property="serviceId" />
     </resultMap>
 
     <resultMap id="timeResultMap" type="com.management.platform.entity.TimeTask" >
@@ -96,7 +95,7 @@
 
     <!-- 通用查询结果列 -->
     <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, 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

+ 22 - 4
fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue

@@ -42,7 +42,7 @@
                     </el-option>
                 </el-select>
             </el-form-item>
-            <el-form-item v-if="this.user.companyId==3092" :label="$t('taskdefinition')" prop="serviceId">
+            <!-- <el-form-item v-if="this.user.companyId==3092" :label="$t('taskdefinition')" prop="serviceId">
                 <el-select filterable style="width:100%;"  v-model="addForm.serviceId" placeholder="请选择任务内容">
                     <el-option
                     v-for="item in sapServiceList"
@@ -51,8 +51,8 @@
                     :value="item.serviceCode">
                     </el-option>
                 </el-select>
-            </el-form-item>
-            <el-form-item v-else  :label="$t('taskdefinition')" prop="name">
+            </el-form-item> -->
+            <el-form-item  :label="$t('taskdefinition')" prop="name">
                 <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" :placeholder="$t('enterthetaskcontent')" clearable></el-input>
             </el-form-item>
             <!-- {{timelabel}}{{mileageCup}} -->
@@ -75,7 +75,16 @@
                     </el-option>
                 </el-select>
                 <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :filterable="true" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
-                
+                <span v-if="user.companyId==3092" style="margin-left:30px;margin-right:10px;">{{'项目服务'}}</span>
+                <el-select v-if="user.companyId==3092" multiple clearable  filterable  v-model="executorItem.serviceId" placeholder="请选择项目服务">
+                    <el-option
+                    v-for="item in sapServiceList"
+                    :key="item.id"
+                    :label="item.serviceName+'-'+item.serviceCode"
+                    :value="item.id">
+                    </el-option>
+                </el-select>
+
                 <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
                 <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100"  :placeholder="$t('danweitian')" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
                 <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="999"  :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
@@ -1053,6 +1062,12 @@ export default {
                 this.recentProgressInfo = res.data.progress;
                 
                 if(res.data.executorList.length > 0) {
+                    for(var i in res.data.executorList){
+                        if(res.data.executorList[i].serviceId) {
+                            res.data.executorList[i].serviceId = JSON.parse(res.data.executorList[i].serviceId)
+                        }
+                    }
+                    console.log("==================",res.data.executorList)
                     this.addForm.executorListFront = res.data.executorList;
                 } else {
                     this.addForm.executorListFront = [{executorId: null, planHours: 8}];
@@ -1382,6 +1397,9 @@ export default {
                 delete this.addForm.progress;
                 //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
                 // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
+                if(this.addForm.executorListFront.serviceId){
+                    this.addForm.executorListFront.serviceId= JSON.stringify(this.addForm.executorListFront.serviceId);
+                }
                 this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
                 this.addLoading = true;
                 this.http.post('/task/save',this.addForm,