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

修改工时导入,增加工作事项

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

+ 0 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java

@@ -387,12 +387,6 @@ public class Report extends Model<Report> {
     @TableField("extra_field3")
     private Integer extraField3;
 
-    /**
-     * SAP项目服务ID
-     */
-    @TableField("sap_service_id")
-    private Integer sapServiceId;
-
     @TableField(exist = false)
     private List<ProFunWorkContext> workContentList;
 

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

@@ -21,7 +21,8 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2023-11-23 */
+ * @since 2023-12-06
+ */
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
@@ -213,17 +214,6 @@ public class Task extends Model<Task> {
     @TableField("meeting_id")
     private String meetingId;
 
-    /**
-     * 前置任务ids,多个逗号隔开
-     */
-    private String serviceId;
-
-    /**
-     * SAP项目任务编号
-     */
-    @TableField("sap_task_code")
-    private String sapTaskCode;
-
     @TableField(exist = false)
     private List<TaskExecutor> executorList;
 
@@ -246,6 +236,12 @@ public class Task extends Model<Task> {
     @TableField("ahead_tid")
     private String aheadTid;
 
+    /**
+     * SAP项目任务编号
+     */
+    @TableField("sap_task_code")
+    private String sapTaskCode;
+
 
     @Override
     protected Serializable pkVal() {

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -4710,6 +4710,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if (ExcelUtil.isRowEmpty(row)) {
                     continue;
                 }
+                //设置字符格式,防止纯数字工号读取时报错
+                row.getCell(1).setCellType(CellType.STRING);
                 String username = row.getCell(1).getStringCellValue().trim();
 
                 if (rowIndex == 0) {
@@ -4831,8 +4833,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                             return msg;
                         }
                     }
-                    String workContent = row.getCell(7)==null?null:row.getCell(7).getStringCellValue();
-                    String stringCellValue = row.getCell(8)==null?null:row.getCell(8).getStringCellValue();
+                    String stringCellValue = row.getCell(7)==null?null:row.getCell(7).getStringCellValue();
+                    String workContent = row.getCell(8)==null?null:row.getCell(8).getStringCellValue();
                     double time = 0;
                     if (!StringUtils.isEmpty(stringCellValue)) {
                         time = Double.parseDouble(stringCellValue);

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

@@ -30,8 +30,8 @@
         <result column="finish_date" property="finishDate" />
         <result column="start_date" property="startDate" />
         <result column="meeting_id" property="meetingId" />
-        <result column="sap_task_code" property="sapTaskCode" />
         <result column="ahead_tid" property="aheadTid" />
+        <result column="sap_task_code" property="sapTaskCode" />
     </resultMap>
     <resultMap id="timeResultMap" type="com.management.platform.entity.TimeTask" >
         <id column="id" property="id" />
@@ -60,6 +60,8 @@
         <result column="finish_date" property="finishDate" />
         <result column="start_date" property="startDate" />
         <result column="meeting_id" property="meetingId" />
+        <result column="ahead_tid" property="aheadTid" />
+        <result column="sap_task_code" property="sapTaskCode" />
         <result column="work_hours" property="workHours" />
     </resultMap>
     <resultMap id="RichResultMap" type="com.management.platform.entity.Task">
@@ -90,13 +92,15 @@
         <result column="project_name" property="projectName" />
         <result column="start_date" property="startDate" />
         <result column="meeting_id" property="meetingId" />
+        <result column="ahead_tid" property="aheadTid" />
+        <result column="sap_task_code" property="sapTaskCode" />
         <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    </sql>
-
+        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, sap_task_code
+    </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
@@ -108,7 +112,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>
 
     <!--计算执行人任务分布-->
@@ -139,7 +143,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>
@@ -147,7 +151,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>
@@ -235,7 +239,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>

BIN
fhKeeper/formulahousekeeper/management-platform/src/main/resources/upload/员工工时导入模板_新版.xlsx


Разница между файлами не показана из-за своего большого размера
+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue