Ver Fonte

查看日报

seyason há 1 ano atrás
pai
commit
1ea9efcd20

+ 36 - 36
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -98,15 +98,15 @@ public class ReportController {
 //     * 根据时间 按照人分类 获取报告信息
 //     * date 日期 格式yyyy-mm-dd
 //     */
-//    @RequestMapping("/getReportFillStatus")
-//    public HttpRespMsg getReportFillStatus(String startDate, String endDate, String userId) {
-//        return reportService.getReportFillStatus(startDate, endDate, userId, request);
-//    }
+    @RequestMapping("/getReportFillStatus")
+    public HttpRespMsg getReportFillStatus(String startDate, String endDate, String userId) {
+        return reportService.getReportFillStatus(startDate, endDate, userId, request);
+    }
 //
-//    @RequestMapping("/getReportList")
-//    public HttpRespMsg getReportList(@RequestParam String date, @RequestParam(required = false) Integer deptId, @RequestParam(required = false) String userId) {
-//        return reportService.getReportList(date, deptId, userId, request);
-//    }
+    @RequestMapping("/getReportList")
+    public HttpRespMsg getReportList(@RequestParam String date, @RequestParam(required = false) Integer deptId, @RequestParam(required = false) String userId) {
+        return reportService.getReportList(date, deptId, userId, request);
+    }
 //
 //    /**
 //     * 导出报告
@@ -1316,14 +1316,14 @@ public class ReportController {
 //        return reportService.denyHisReport(hisId, reason, request);
 //    }
 //
-//    @RequestMapping("/getMembList")
-//    public HttpRespMsg getMembList(@RequestParam(required=false) String date, HttpServletRequest request) {
-//        if (date == null) {
-//            //默认获取今天的
-//            date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
-//        }
-//        return reportService.getMembList(date, request);
-//    }
+    @RequestMapping("/getMembList")
+    public HttpRespMsg getMembList(@RequestParam(required=false) String date, HttpServletRequest request) {
+        if (date == null) {
+            //默认获取今天的
+            date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
+        }
+        return reportService.getMembList(date, request);
+    }
 //
 //    @RequestMapping("/approveAllImport")
 //    public HttpRespMsg approveAllImport(HttpServletRequest request) {
@@ -1334,26 +1334,26 @@ public class ReportController {
 //    public HttpRespMsg batchDelete(@RequestParam String userIds, String startDate, String endDate, HttpServletRequest request) {
 //        return reportService.batchDelete(userIds,startDate, endDate, request);
 //    }
-//
-//    @RequestMapping("/getUserDailyWorkTime")
-//    public HttpRespMsg getUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate) {
-//        return reportService.getUserDailyWorkTime(request, startDate, endDate);
-//    }
-//
-//    @RequestMapping("/getNoReportUserList")
-//    public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate) {
-//        return reportService.getNoReportUserList(request, startDate, endDate);
-//    }
-//
-//    @RequestMapping("/exportNoReportUserList")
-//    public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate) {
-//        return reportService.exportNoReportUserList(request, startDate, endDate);
-//    }
-//
-//    @RequestMapping("/exportUserDailyWorkTime")
-//    public HttpRespMsg exportUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate) {
-//        return reportService.exportUserDailyWorkTime(request, startDate, endDate);
-//    }
+
+    @RequestMapping("/getUserDailyWorkTime")
+    public HttpRespMsg getUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate) {
+        return reportService.getUserDailyWorkTime(request, startDate, endDate);
+    }
+
+    @RequestMapping("/getNoReportUserList")
+    public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate) {
+        return reportService.getNoReportUserList(request, startDate, endDate);
+    }
+
+    @RequestMapping("/exportNoReportUserList")
+    public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate) {
+        return reportService.exportNoReportUserList(request, startDate, endDate);
+    }
+
+    @RequestMapping("/exportUserDailyWorkTime")
+    public HttpRespMsg exportUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate) {
+        return reportService.exportUserDailyWorkTime(request, startDate, endDate);
+    }
 //
 //    @RequestMapping("/isWorkDay")
 //    public HttpRespMsg isWorkDay(String date) {

+ 8 - 8
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java

@@ -23,7 +23,7 @@ import java.util.Map;
  * @since 2019-12-31
  */
 public interface ReportService extends IService<Report> {
-//    HttpRespMsg getReportList(String date, Integer deptId, String userId, HttpServletRequest request);
+    HttpRespMsg getReportList(String date, Integer deptId, String userId, HttpServletRequest request);
 //
 //    HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate, Integer projectId,Integer stateKey,Integer departmentId, HttpServletRequest request);
 //
@@ -44,19 +44,19 @@ public interface ReportService extends IService<Report> {
 //                               HttpServletRequest request);
 //
 //
-//    HttpRespMsg getMembList(String date, HttpServletRequest request);
+    HttpRespMsg getMembList(String date, HttpServletRequest request);
 //
 //    HttpRespMsg cancelReport(String userId, String reportIds, HttpServletRequest request);
 //
-//    HttpRespMsg getReportFillStatus(String startDate, String endDate, String userId, HttpServletRequest request);
+    HttpRespMsg getReportFillStatus(String startDate, String endDate, String userId, HttpServletRequest request);
 //
 //    HttpRespMsg listByStateProfession(Integer state, Integer departmentId, Integer projectId, String date, HttpServletRequest request);
 //
 //    HttpRespMsg listByStateDepartment(Integer state, Integer projectId, String date, HttpServletRequest request);
 //
-//    HttpRespMsg getUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate);
+    HttpRespMsg getUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate);
 //
-//    HttpRespMsg exportUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate);
+    HttpRespMsg exportUserDailyWorkTime(HttpServletRequest request, String startDate, String endDate);
 //
 //    HttpRespMsg importData(Integer companyId, Integer withCheckIn, MultipartFile file, HttpServletRequest request);
 //
@@ -71,9 +71,9 @@ public interface ReportService extends IService<Report> {
 //
 //    HttpRespMsg getlastWeekFillTime(String userId);
 //
-//    HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate);
-//
-//    HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate);
+    HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate);
+
+    HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate);
 //
 //    HttpRespMsg approveAllImport(HttpServletRequest request);
 //

Diff do ficheiro suprimidas por serem muito extensas
+ 797 - 992
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java


+ 39 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -29,5 +29,44 @@
     <sql id="Base_Column_List">
         id, creator_id, create_date, working_time, create_time, cost, dept_id, company_id, group_id, plan_id, progress, product_id, prod_procedure_id, check_type, checker_id, task_change_notice_num, task_name, task_type_id, task_type_name
     </sql>
+    <select id="getReportFillStatus" resultType="java.util.Map">
+        SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as createDate FROM report
+        WHERE create_date BETWEEN #{startDate} AND #{endDate} AND creator_id = #{userId} GROUP BY create_date
+    </select>
 
+    <!--根据日期获取报告上传人-->
+    <select id="getReportNameByDate" resultType="java.util.Map">
+        SELECT DISTINCT b.id, b.name, IFNULL(sum(a.working_time),0) as workingTime
+        FROM report AS a
+        JOIN user AS b ON a.creator_id=b.id
+        left join product on product.id = a.product_id
+        WHERE 1=1
+        <if test="date != null and date != ''">
+            AND a.create_date=#{date}
+        </if>
+        <if test="companyId != null and companyId != ''">
+            AND b.company_id=#{companyId}
+        </if>
+        group by a.creator_id
+    </select>
+
+    <select id="getUserDailyWorkTime" resultType="java.util.Map">
+        SELECT user.id, user.name,department.department_name as departmentName,department.corpwx_deptid as corpwxDeptId, report.create_date as createDate, sum(working_time) as workingTime,user.inactive_date as inactiveDate,user.corpwx_userid as corpwxUserId
+        FROM user
+        left join report on user.id = report.creator_id
+        left join department on department.department_id = user.department_id
+        WHERE  user.company_id = #{companyId} and (user.is_active=1 or(user.is_active=0 and user.inactive_date>=#{startDate}))
+        <if test="deptIds != null">
+            AND user.department_id in <foreach collection="deptIds" separator="," index="index" item="item" close=")" open="(">
+            #{item}
+        </foreach>
+        </if>
+        <if test="startDate != null">
+            AND report.create_date &gt;= #{startDate}
+        </if>
+        <if test="endDate != null">
+            AND report.create_date &lt;= #{endDate}
+        </if>
+        GROUP BY user.id, report.create_date;
+    </select>
 </mapper>

+ 6 - 91
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/workReport/daily.vue

@@ -34,14 +34,7 @@
                                 <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" v-if="user.userNameNeedTranslate != 1" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
                                     <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
                                 </el-input>
-                                <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
-                                <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
-                                <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
-                                <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
-                                <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
-                                <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
-                                <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
-                                </el-select>
+                                
                             </div>
                             <div>
                                 <el-tree :data="data"  @node-click="handleNodeClick" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading">
@@ -1924,7 +1917,7 @@
                 deptId:null,
                 targetUid: null,
                 membCount:0,
-                selectState:"-1",
+                
                 user: JSON.parse(sessionStorage.getItem("user")),
                 allUsersList: [],
                 showAddMore:false,
@@ -2148,9 +2141,7 @@
             if(this.user.timeType.reportAuditType == 3){
                 this.getAllUsersList()
             }
-            if (this.user.company.packageProject == 1) {
-                this.getBasecostItemList();
-            }
+            
             if(this.user.timeType.lockWorktime){
                 this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
             }
@@ -4148,49 +4139,7 @@
                     list[i].membCount = cnt;
                 }
             },
-            stateChange() {
-                // console.log(this.allData,'alldate');
-                this.membCount = 0;
-                if (this.selectState == -1) {
-                    //全部状态
-                    this.data = this.allData;
-                } else {
-                    //未填报
-                    this.seluserText = ''
-                    var newData = JSON.parse(JSON.stringify(this.allData));
-                    this.filterState(this.selectState, newData);
-                    this.data = newData;
-                }
-                this.calculateMembCount(this.data);
-                this.data[0].membCount = this.membCount;//总人数
-            },
-            //按状态过滤部门人员
-            filterState(state, list) {
-                for (var i =0;i<list.length; i++) {
-                    var obj = list[i];
-                    if (obj.isUser == 1) {
-                        var match = false;
-                        if (state == -2) {
-                            if (obj.state == null) {
-                                match = true;
-                            }
-                        } else {
-                            if (obj.state == state) {
-                                match = true;
-                            }
-                        }
-                        if (!match) {
-                            list.splice(i, 1);
-                            i--;
-                        } else {
-                        }
-                    } else {
-                        if (obj.children != null) {
-                            this.filterState(state, obj.children);
-                        }
-                    }
-                }
-            },
+            
             //a按名称过滤部门人员
             
             seluserforText(){
@@ -4721,31 +4670,7 @@
                     });
                 });
             },
-            // 处理数据
-            // dealWith() {
-            //     var tianxie = 0
-            //     var weixtianxie = 0
-            //     if(this.selectState == -1) {
-
-            //     } else {
-            //         var arr = []
-            //         for (var i in this.reportList) {
-            //             arr.push(this.reportList[i].id)
-            //         }
-            //         this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
-            //     }
-            // },
-            // getDealWith(item, tx, wtx, arr) {
-            //     for(var i in item) {
-            //         if(item[i].children) {
-            //             this.getDealWith(item[i].children, tx, wtx, arr)
-            //         } else {
-            //             if(arr.indexOf(item[i].id) != '-1') {
-            //                 tx = +tx + 1
-            //             }
-            //         }
-            //     }
-            // },
+            
             //导出员工工时统计
             exportUserTime() {
                 this.listLoading = true;
@@ -4868,17 +4793,7 @@
                     });
                 });
             },
-            getBasecostItemList() {
-                this.http.post('/project-basecost-setting/getReportBasecostList', {
-                    companyId: this.user.companyId
-                },
-                res => {
-                    if (res.code == "ok") {
-                        this.timeBasecostList = res.data;
-                    }
-                    });
-                
-            },
+            
             getAIReport(createDate) {
                 this.http.post('/report/getAIReport', {},
                 res => {