Explorar o código

1.大中型统计报表新增接口评估部绩效扣分查询/导出

GouGengquan hai 10 meses
pai
achega
c363e18a8b

+ 21 - 0
biz-base/src/main/java/com/dayou/controller/MajorStatisticalStatementController.java

@@ -5,6 +5,7 @@ import com.dayou.common.RestResponse;
 import com.dayou.dto.MajorStatisticalSelectDTO;
 import com.dayou.service.IMajorStatisticalStatementService;
 import com.dayou.vo.MajorLedgerVO;
+import com.dayou.vo.MajorPerformanceDeductionVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -42,4 +43,24 @@ public class MajorStatisticalStatementController extends BaseController{
         exportPlus(response,"房地产总台账列表",result, MajorLedgerVO.class);
     }
 
+    /**
+     * 评估部绩效扣分查询
+     * @param dto 查询dto
+     * @return RestResponse<List<MajorPerformanceDeductionVO>>
+     */
+    @GetMapping("/getMajorPerformanceDeductionVO")
+    public RestResponse<List<MajorPerformanceDeductionVO>> getMajorPerformanceDeductionVO(MajorStatisticalSelectDTO dto) {
+        return RestResponse.data(majorStatisticalStatementService.getMajorPerformanceDeductionVO(dto));
+    }
+
+    /**
+     * 评估部绩效扣分查询
+     * @param dto 查询dto
+     */
+    @GetMapping("/getMajorPerformanceDeductionVO/export")
+    public void exportMajorPerformanceDeductionVO(MajorStatisticalSelectDTO dto, HttpServletResponse response) throws IOException {
+        List<MajorPerformanceDeductionVO> result = majorStatisticalStatementService.getMajorPerformanceDeductionVO(dto);
+        exportPlus(response,"评估部绩效扣分表数据",result, MajorPerformanceDeductionVO.class);
+    }
+
 }

+ 10 - 2
dao/src/main/java/com/dayou/mapper/MajorStatisticalStatementMapper.java

@@ -3,6 +3,7 @@ package com.dayou.mapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.MajorStatisticalSelectDTO;
 import com.dayou.vo.MajorLedgerVO;
+import com.dayou.vo.MajorPerformanceDeductionVO;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -15,13 +16,20 @@ public interface MajorStatisticalStatementMapper {
      * @param dto 查询条件
      * @return List<MajorLedgerVO>
      */
-    Page<MajorLedgerVO> getMajorLedgerVO(@Param("page") Page page, @Param("dto")MajorStatisticalSelectDTO dto);
+    Page<MajorLedgerVO> getMajorLedgerVO(@Param("page") Page page, @Param("dto") MajorStatisticalSelectDTO dto);
 
     /**
      * 导出大中型台账
      * @param dto 查询条件
      * @return Page<MajorLedgerVO>
      */
-    List<MajorLedgerVO> exportMajorLedgerVO(@Param("dto")MajorStatisticalSelectDTO dto);
+    List<MajorLedgerVO> exportMajorLedgerVO(@Param("dto") MajorStatisticalSelectDTO dto);
+
+    /**
+     * 评估部绩效扣分查询
+     * @param dto 查询dto
+     * @return List<MajorPerformanceDeductionVO>
+     */
+    List<MajorPerformanceDeductionVO> getMajorPerformanceDeductionVO(@Param("dto") MajorStatisticalSelectDTO dto);
 
 }

+ 46 - 0
dao/src/main/resources/mapper/MajorStatisticalStatementMapper.xml

@@ -146,4 +146,50 @@
     <select id="exportMajorLedgerVO" resultType="com.dayou.vo.MajorLedgerVO">
         <include refid="majorLedgerQuery" />
     </select>
+
+    <!--评估部绩效扣分查询-->
+    <select id="getMajorPerformanceDeductionVO" resultType="com.dayou.vo.MajorPerformanceDeductionVO">
+        SELECT
+        department.id AS departmentId,
+        department.name AS departmentName,
+        COALESCE ( SUM( reCheckPer.normal_mistake ), 0 ) * 3 AS reCheckNormalMistakeScore,
+        COALESCE ( SUM( reCheckPer.hard_mistake ), 0 ) * 8 AS reCheckHardMistakeScore,
+        COALESCE ( SUM( reCheckPer.fatal_mistake ), 0 ) * 41 AS reCheckFatalMistakeScore,
+        COALESCE ( (COALESCE ( SUM( reCheckPer.normal_mistake ), 0 ) *3 ) + (COALESCE ( SUM( reCheckPer.hard_mistake ), 0 ) * 8) + (COALESCE ( SUM( reCheckPer.fatal_mistake ), 0 ) * 41) , 0) AS allMistakeScore
+        FROM
+        (
+        SELECT
+        department.id,
+        department.name
+        FROM
+        department,
+        sorted_department
+        WHERE
+        department.id = sorted_department.department_id
+        AND department.deleted = 0
+        AND sorted_department.business_type = 'MAJOR_BUSINESS'
+        ) AS department
+        LEFT JOIN (
+        SELECT
+        department_id,
+        major.created,
+        major_production.id AS production_id
+        FROM
+        major
+        LEFT JOIN major_production ON major_production.major_id = major.id
+        AND major_production.deleted = 0
+        ) AS orderInfo ON department.id = orderInfo.department_id
+        LEFT JOIN ( SELECT production_id, fatal_mistake, hard_mistake, normal_mistake FROM
+        business_production_performance WHERE business_type = 'MAJOR_BUSINESS' AND check_loop = '复审'
+        <if test="dto != null and dto.startTime != null and dto.endTime!= null">
+            AND (business_production_performance.modified BETWEEN #{dto.startTime} AND #{dto.endTime})
+        </if>
+        ) AS reCheckPer ON reCheckPer.production_id = orderInfo.production_id
+        <where>
+            <if test="dto != null and dto.departmentId != null">
+                AND department.id = #{dto.departmentId}
+            </if>
+        </where>
+        GROUP BY department.id
+    </select>
 </mapper>

+ 109 - 0
domain/src/main/java/com/dayou/vo/MajorPerformanceDeductionVO.java

@@ -0,0 +1,109 @@
+package com.dayou.vo;
+
+import com.dayou.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class MajorPerformanceDeductionVO {
+
+    /**
+     * 部门id
+     */
+    private Long departmentId;
+
+    /**
+     * 用户id
+     */
+    private Long userId;
+
+    /**
+     * 员工姓名
+     */
+    @Excel(name = "员工姓名")
+    private String userName;
+
+    /**
+     * 复审一般错误扣分
+     */
+    @Excel(name = "复审一般错误")
+    private Integer reCheckNormalMistakeScore;
+
+    /**
+     * 复审较大错误扣分
+     */
+    @Excel(name = "复审较大错误")
+    private Integer reCheckHardMistakeScore;
+
+    /**
+     * 复审严重错误扣分
+     */
+    @Excel(name = "复审严重错误")
+    private Integer reCheckFatalMistakeScore;
+
+    /**
+     * 外部投诉一般错误扣分
+     */
+    @Excel(name = "外部投诉一般错误")
+    private Integer externalComplaintNormalMistakeScore;
+
+    /**
+     * 外部投诉较大错误扣分
+     */
+    @Excel(name = "外部投诉较大错误")
+    private Integer externalComplaintHardMistakeScore;
+
+    /**
+     * 外部投诉严重错误扣分
+     */
+    @Excel(name = "外部投诉严重错误")
+    private Integer externalComplaintFatalMistakeScore;
+
+    /**
+     * 外部投诉服务态度恶劣
+     */
+    @Excel(name = "服务态度恶劣")
+    private Integer badServiceAttitude;
+
+    /**
+     * 内部投诉一般错误扣分
+     */
+    @Excel(name = "内部投诉一般错误")
+    private Integer internalComplaintNormalMistakeScore;
+
+    /**
+     * 内部投诉较大错误扣分
+     */
+    @Excel(name = "内部投诉较大错误")
+    private Integer internalComplaintHardMistakeScore;
+
+    /**
+     * 内部投诉严重错误扣分
+     */
+    @Excel(name = "内部投诉严重错误")
+    private Integer internalComplaintFatalMistakeScore;
+
+    /**
+     * 疑难项目加减分
+     */
+    @Excel(name = "疑难项目加减分")
+    private Integer difficultScore;
+
+    /**
+     * 总经理加减分
+     */
+    @Excel(name = "总经理加减分")
+    private Integer generalManagerScore;
+
+    /**
+     * 部门综合评分
+     */
+    @Excel(name = "部门综合评分")
+    private Integer integratedScore;
+
+    /**
+     * 扣分合计
+     */
+    @Excel(name = "扣分合计")
+    private Integer allMistakeScore;
+
+}

+ 7 - 0
service/src/main/java/com/dayou/service/IMajorStatisticalStatementService.java

@@ -3,6 +3,7 @@ package com.dayou.service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.MajorStatisticalSelectDTO;
 import com.dayou.vo.MajorLedgerVO;
+import com.dayou.vo.MajorPerformanceDeductionVO;
 
 import java.util.List;
 
@@ -23,4 +24,10 @@ public interface IMajorStatisticalStatementService {
      */
     List<MajorLedgerVO> exportMajorLedgerVO(MajorStatisticalSelectDTO dto);
 
+    /**
+     * 评估部绩效扣分查询
+     * @param dto 查询dto
+     * @return List<MajorPerformanceDeductionVO>
+     */
+    List<MajorPerformanceDeductionVO> getMajorPerformanceDeductionVO(MajorStatisticalSelectDTO dto);
 }

+ 11 - 0
service/src/main/java/com/dayou/service/impl/MajorStatisticalStatementServiceImpl.java

@@ -10,6 +10,7 @@ import com.dayou.mapper.MajorStatisticalStatementMapper;
 import com.dayou.service.IUserService;
 import com.dayou.service.IMajorStatisticalStatementService;
 import com.dayou.vo.MajorLedgerVO;
+import com.dayou.vo.MajorPerformanceDeductionVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -50,6 +51,16 @@ public class MajorStatisticalStatementServiceImpl implements IMajorStatisticalSt
     }
 
     /**
+     * 评估部绩效扣分查询
+     * @param dto 查询dto
+     * @return List<MajorPerformanceDeductionVO>
+     */
+    @Override
+    public List<MajorPerformanceDeductionVO> getMajorPerformanceDeductionVO(MajorStatisticalSelectDTO dto) {
+        return majorStatisticalStatementMapper.getMajorPerformanceDeductionVO(dto);
+    }
+
+    /**
      * 设置项目参与人
      * @param majorLedgerVOList 台账集合
      * @return List<MajorLedgerVO>