Sfoglia il codice sorgente

Merge branch 'master' of http://47.112.200.206:3000/shenhao/sys

wuwen 3 anni fa
parent
commit
0161f8647d

+ 3 - 1
src/main/java/com/ssj/api/controller/ApiManagerTeacherController.java

@@ -304,6 +304,7 @@ public class ApiManagerTeacherController extends BaseController {
             }
             List<Map<String,Object>> list = getSalaryList(manager.getUserId());
             data.put("list",list);
+            data.put("teacherName",manager.getName());
             responseEntity.success(data,"获取列表成功");
         } catch (Exception e) {
             logger.error("薪酬列表异常", e);
@@ -322,8 +323,9 @@ public class ApiManagerTeacherController extends BaseController {
             os = response.getOutputStream();
             //清空输出流
             response.reset();
-            exportExcelHead(response,libName);
+
             TbLibManager manager = managerService.getById(id);
+            exportExcelHead(response,manager.getName()+libName);
             List<Map<String,Object>> list = getSalaryList(manager.getUserId());
             /**
              * workDate	string	list	日期

+ 112 - 0
src/main/java/com/ssj/api/domain/vo/statistics/TeacherSalarysVO.java

@@ -0,0 +1,112 @@
+package com.ssj.api.domain.vo.statistics;
+
+/**
+ * @author sh
+ * @className TeacherSalarysVO
+ * @description vo
+ * @date 2021/3/4
+ */
+public class TeacherSalarysVO {
+    /**
+     * workDate	string	list	日期
+     * correctNums	int	list	批注总张数
+     * overtimeNums	int	list	超时批注总张数
+     * perkNums	int	list	高峰时段批注张数
+     * perkEfficiency	String	list	高峰时段平均批注时间
+     * errorNums	int	list	报错张数
+     * accuracy	string	list	正确率
+     * perkSalary	String	list	高峰时段薪资
+     * otherSalary	String	list	其他时段薪资
+     * salary	String	list
+     */
+    private String workDate;
+    private Integer correctNums;
+    private Integer overtimeNums;
+    private Integer perkNums;
+    private Integer errorNums;
+    private String  perkEfficiency;
+    private String  accuracy;
+    private String  otherSalary;
+    private String  perkSalary;
+    private String  salary;
+
+    public String getWorkDate() {
+        return workDate;
+    }
+
+    public void setWorkDate(String workDate) {
+        this.workDate = workDate;
+    }
+
+    public Integer getCorrectNums() {
+        return correctNums;
+    }
+
+    public void setCorrectNums(Integer correctNums) {
+        this.correctNums = correctNums;
+    }
+
+    public Integer getOvertimeNums() {
+        return overtimeNums;
+    }
+
+    public void setOvertimeNums(Integer overtimeNums) {
+        this.overtimeNums = overtimeNums;
+    }
+
+    public Integer getPerkNums() {
+        return perkNums;
+    }
+
+    public void setPerkNums(Integer perkNums) {
+        this.perkNums = perkNums;
+    }
+
+    public Integer getErrorNums() {
+        return errorNums;
+    }
+
+    public void setErrorNums(Integer errorNums) {
+        this.errorNums = errorNums;
+    }
+
+    public String getPerkEfficiency() {
+        return perkEfficiency;
+    }
+
+    public void setPerkEfficiency(String perkEfficiency) {
+        this.perkEfficiency = perkEfficiency;
+    }
+
+    public String getAccuracy() {
+        return accuracy;
+    }
+
+    public void setAccuracy(String accuracy) {
+        this.accuracy = accuracy;
+    }
+
+    public String getOtherSalary() {
+        return otherSalary;
+    }
+
+    public void setOtherSalary(String otherSalary) {
+        this.otherSalary = otherSalary;
+    }
+
+    public String getPerkSalary() {
+        return perkSalary;
+    }
+
+    public void setPerkSalary(String perkSalary) {
+        this.perkSalary = perkSalary;
+    }
+
+    public String getSalary() {
+        return salary;
+    }
+
+    public void setSalary(String salary) {
+        this.salary = salary;
+    }
+}

+ 8 - 0
src/main/java/com/ssj/statistics/dao/IStatisticsQueryDao.java

@@ -2,6 +2,7 @@ package com.ssj.statistics.dao;
 
 import com.ssj.api.domain.vo.homework.CheckDetailVO;
 import com.ssj.api.domain.vo.statistics.ListVO;
+import com.ssj.api.domain.vo.statistics.TeacherSalarysVO;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 
@@ -28,4 +29,11 @@ public interface IStatisticsQueryDao {
     List<Map<String, Object>> salaryList(String userId, int month, int year);
 
     List<ListVO> statisticsDataList(String dataDate);
+
+    /**
+     *
+     * @param month
+     * @return
+     */
+    List<TeacherSalarysVO> addTeacherSalarysData(String month);
 }

+ 30 - 0
src/main/java/com/ssj/statistics/dao/impl/StatisticsQueryImpl.java

@@ -2,6 +2,7 @@ package com.ssj.statistics.dao.impl;
 
 import com.ssj.api.domain.vo.homework.CheckDetailVO;
 import com.ssj.api.domain.vo.statistics.ListVO;
+import com.ssj.api.domain.vo.statistics.TeacherSalarysVO;
 import com.ssj.framework.core.persistence.PagingHibernateJdbcDao;
 import com.ssj.statistics.dao.IStatisticsQueryDao;
 import org.apache.commons.collections4.MapUtils;
@@ -167,6 +168,35 @@ public class StatisticsQueryImpl implements IStatisticsQueryDao {
     }
 
     @Override
+    public List<TeacherSalarysVO> addTeacherSalarysData(String month) {
+        StringBuffer sql = new StringBuffer();
+        List<Object> queryParams = new ArrayList<>();
+        sql.append("SELECT a.correct_nums,a.teacher_id,a.overtime_nums,a.perk_nums,a.error_nums,a.work_date,a.`month`,a.`year`,FLOOR(a.sum_perk)/a.perk_nums as perk_efficiency,Floor(100*(a.correct_nums-a.error_nums)/a.correct_nums) as accuracy,\n");
+        sql.append("(a.perk_nums-a.error_nums)*0.15 as perk_salary,(a.correct_nums-a.perk_nums-a.error_nums)*0.15 as other_salary,a.create_time\n" );
+        sql.append("from (\n" );
+        sql.append("SELECT\n" );
+        sql.append("count(1) as correct_nums,\n" );
+        sql.append("0 as overtime_nums,\n" );
+        sql.append("count(IF(DATE_FORMAT(t.start_time,'%H:%s')>='18:00' and DATE_FORMAT(t.start_time,'%H:%s')<='20:00',TRUE,null)) as perk_nums,\n" );
+        sql.append("count(IF(t.is_check_error=1,TRUE,null)) as error_nums,\n" );
+        sql.append("DATE_FORMAT(t.start_time,'%Y-%m-%d') as work_date,\n" );
+        sql.append("2 as month,\n" );
+        sql.append("2021 as year,\n" );
+        sql.append("NOW() as create_time,\n" );
+        sql.append("sum(IF(DATE_FORMAT(t.start_time,'%H:%s')>='18:00' and DATE_FORMAT(t.start_time,'%H:%s')<='20:00',t.correction_time,0)) as sum_perk,\n" );
+        sql.append("t11.teacher_id,\n" );
+        sql.append("t.end_time,\n" );
+        sql.append("t.start_time \n" );
+        sql.append("from scon_homework_picture_correct t \n" );
+        sql.append("join scon_homework_picture t11 on t.homework_picture_id = t11.id\n" );
+        sql.append("where t.type=8 and t11.is_mark in(0,2) \n" );
+        sql.append("and t.start_time like '%2021-02%'\n" );
+        sql.append("GROUP BY t11.teacher_id\n" );
+        sql.append(") a");
+        return dao.findList(sql.toString(),queryParams.toArray(),TeacherSalarysVO.class);
+    }
+
+    @Override
     public List<CheckDetailVO> checkDetailList(String homeworkId) {
         StringBuffer sql = new StringBuffer();
         List<Object> queryParams = new ArrayList<>();

+ 2 - 1
src/main/java/com/ssj/statistics/service/impl/StatisticsServiceImpl.java

@@ -2,6 +2,7 @@ package com.ssj.statistics.service.impl;
 
 import com.ssj.api.domain.vo.homework.CheckDetailVO;
 import com.ssj.api.domain.vo.statistics.ListVO;
+import com.ssj.api.domain.vo.statistics.TeacherSalarysVO;
 import com.ssj.bean.statistics.PlatTeacherStatistics;
 import com.ssj.framework.core.common.service.BaseServiceImpl;
 import com.ssj.framework.weixin.util.DateUtil;
@@ -98,6 +99,6 @@ public class StatisticsServiceImpl  extends BaseServiceImpl<PlatTeacherStatistic
         if(StringUtils.isBlank(month)){
             month = DateUtil.format_yyyyMMdd(DateUtil.addMonth(-1));
         }
-//        List<>
+        List<TeacherSalarysVO> list = queryDao.addTeacherSalarysData(month);
     }
 }