Commit 17aada3a by 张富康

feat(perfSalary): 添加绩效考核列表相关支持

- 将AppraisalInfoDTO中的日期字段改为字符串类型,避免日期格式转换问题
- 在PerformanceEvaluationMapper接口中新增perfAppraisalList方法签名
- 优化PerformanceEvaluationMapper.xml中perfAppraisalStatisticsCard SQL,使用COALESCE避免空值
- 在PerformanceEvaluationService中新增perfAppraisalList方法实现框架但暂未完成返回结果
- 在PerfRuleRemoteImpl中实现perfAppraisalList远程调用,添加异常捕获和日志
- 修改PerfRuleReqDTO中merchantId字段类型由String改为Integer以匹配需求
1 parent d0574ee5
package cn.com.glsx.dj.staff.dto.perfSalary; package cn.com.glsx.dj.staff.dto.perfSalary;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
...@@ -8,7 +7,6 @@ import lombok.NoArgsConstructor; ...@@ -8,7 +7,6 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 员工绩效 * 员工绩效
...@@ -37,14 +35,7 @@ public class AppraisalInfoDTO implements Serializable { ...@@ -37,14 +35,7 @@ public class AppraisalInfoDTO implements Serializable {
* 评分月份(yyyy-mm) * 评分月份(yyyy-mm)
*/ */
@ApiModelProperty(notes = "评分月份(yyyy-mm)") @ApiModelProperty(notes = "评分月份(yyyy-mm)")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String evaluationMonth;
private Date evaluationMonth;
/**
* 门店id
*/
@ApiModelProperty(notes = "门店id")
private Integer merchantId;
/** /**
* 门店名称 * 门店名称
...@@ -92,8 +83,7 @@ public class AppraisalInfoDTO implements Serializable { ...@@ -92,8 +83,7 @@ public class AppraisalInfoDTO implements Serializable {
* 入职日期 * 入职日期
*/ */
@ApiModelProperty(notes = "入职日期") @ApiModelProperty(notes = "入职日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String entryDate;
private Date entryDate;
/** /**
* 自动绩效配置id * 自动绩效配置id
......
...@@ -37,7 +37,7 @@ public class PerfRuleReqDTO implements Serializable { ...@@ -37,7 +37,7 @@ public class PerfRuleReqDTO implements Serializable {
* 门店id * 门店id
*/ */
@ApiModelProperty(notes = "门店id") @ApiModelProperty(notes = "门店id")
private String merchantId; private Integer merchantId;
/** /**
* 绩效等级 * 绩效等级
......
package cn.com.glsx.dj.staff.mapper.perfSalary; package cn.com.glsx.dj.staff.mapper.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.AppraisalInfoDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO; import cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.PerfRuleReqDTO; import cn.com.glsx.dj.staff.dto.perfSalary.PerfRuleReqDTO;
import cn.com.glsx.dj.staff.model.perfSalary.PerformanceEvaluation; import cn.com.glsx.dj.staff.model.perfSalary.PerformanceEvaluation;
...@@ -17,4 +18,6 @@ public interface PerformanceEvaluationMapper extends OreMapper<PerformanceEvalua ...@@ -17,4 +18,6 @@ public interface PerformanceEvaluationMapper extends OreMapper<PerformanceEvalua
void insertOrUpdateBatch(@Param("list") List<PerformanceEvaluation> performanceEvaluationList); void insertOrUpdateBatch(@Param("list") List<PerformanceEvaluation> performanceEvaluationList);
PerfAppraisalStatisticsCardDTO perfAppraisalStatisticsCard(PerfRuleReqDTO perfRuleReqDTO); PerfAppraisalStatisticsCardDTO perfAppraisalStatisticsCard(PerfRuleReqDTO perfRuleReqDTO);
List<AppraisalInfoDTO> perfAppraisalList(PerfRuleReqDTO perfRuleReqDTO);
} }
\ No newline at end of file \ No newline at end of file
...@@ -84,7 +84,12 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote { ...@@ -84,7 +84,12 @@ public class PerfRuleRemoteImpl implements PerfRuleRemote {
*/ */
@Override @Override
public RpcResponse<List<AppraisalInfoDTO>> perfAppraisalList(PerfRuleReqDTO perfRuleReqDTO) { public RpcResponse<List<AppraisalInfoDTO>> perfAppraisalList(PerfRuleReqDTO perfRuleReqDTO) {
return null; try {
return RpcResponse.success(performanceEvaluationService.perfAppraisalList(perfRuleReqDTO));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
} }
/** /**
......
package cn.com.glsx.dj.staff.service.perfSalary; package cn.com.glsx.dj.staff.service.perfSalary;
import cn.com.glsx.dj.staff.dto.perfSalary.AppraisalInfoDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO; import cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO;
import cn.com.glsx.dj.staff.dto.perfSalary.PerfRuleReqDTO; import cn.com.glsx.dj.staff.dto.perfSalary.PerfRuleReqDTO;
import cn.com.glsx.dj.staff.mapper.perfSalary.PerformanceEvaluationMapper; import cn.com.glsx.dj.staff.mapper.perfSalary.PerformanceEvaluationMapper;
...@@ -10,6 +11,7 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -10,6 +11,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@Slf4j @Slf4j
...@@ -32,4 +34,11 @@ public class PerformanceEvaluationService { ...@@ -32,4 +34,11 @@ public class PerformanceEvaluationService {
return performanceEvaluationMapper.perfAppraisalStatisticsCard(perfRuleReqDTO); return performanceEvaluationMapper.perfAppraisalStatisticsCard(perfRuleReqDTO);
} }
/**
* 绩效考核列表
*/
public List<AppraisalInfoDTO> perfAppraisalList(PerfRuleReqDTO perfRuleReqDTO) {
List<AppraisalInfoDTO> result = performanceEvaluationMapper.perfAppraisalList(perfRuleReqDTO);
return null;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -260,15 +260,13 @@ ...@@ -260,15 +260,13 @@
<select id="perfAppraisalStatisticsCard" resultType="cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO"> <select id="perfAppraisalStatisticsCard" resultType="cn.com.glsx.dj.staff.dto.perfSalary.PerfAppraisalStatisticsCardDTO">
SELECT SELECT
-- 绩效等级统计(7个固定等级) COALESCE(SUM(CASE WHEN grade = 'S' THEN 1 ELSE 0 END), 0) AS sCount,
SUM(CASE WHEN grade = 'S' THEN 1 ELSE 0 END) AS sCount, COALESCE(SUM(CASE WHEN grade = 'A' THEN 1 ELSE 0 END), 0) AS aCount,
SUM(CASE WHEN grade = 'A' THEN 1 ELSE 0 END) AS aCount, COALESCE(SUM(CASE WHEN grade = 'B+' THEN 1 ELSE 0 END), 0) AS bPlusCount,
SUM(CASE WHEN grade = 'B+' THEN 1 ELSE 0 END) AS bPlusCount, COALESCE(SUM(CASE WHEN grade = 'B' THEN 1 ELSE 0 END), 0) AS bCount,
SUM(CASE WHEN grade = 'B' THEN 1 ELSE 0 END) AS bCount, COALESCE(SUM(CASE WHEN grade = 'B-' THEN 1 ELSE 0 END), 0) AS bMinusCount,
SUM(CASE WHEN grade = 'B-' THEN 1 ELSE 0 END) AS bMinusCount, COALESCE(SUM(CASE WHEN grade = 'C' THEN 1 ELSE 0 END), 0) AS cCount,
SUM(CASE WHEN grade = 'C' THEN 1 ELSE 0 END) AS cCount, COALESCE(SUM(CASE WHEN grade = 'D' THEN 1 ELSE 0 END), 0) AS dCount,
SUM(CASE WHEN grade = 'D' THEN 1 ELSE 0 END) AS dCount,
-- 汇总数据(总人数/入职人数)
(SELECT COUNT(*) FROM sal_performance_evaluation (SELECT COUNT(*) FROM sal_performance_evaluation
WHERE evaluation_month = #{queryMonth} WHERE evaluation_month = #{queryMonth}
AND deleted_flag = 'N' AND deleted_flag = 'N'
...@@ -280,15 +278,23 @@ ...@@ -280,15 +278,23 @@
AND is_entry = 1) AS entryCount AND is_entry = 1) AS entryCount
FROM ( FROM (
SELECT SELECT
-- 优先取manual_grade_code,为空则取auto_grade_code CASE
COALESCE(manual_grade_code, auto_grade_code) AS grade WHEN adopt_type = 1 AND auto_grade_code IS NOT NULL THEN auto_grade_code
WHEN adopt_type = 2 AND manual_grade_code IS NOT NULL THEN manual_grade_code
ELSE NULL
END AS grade
FROM sal_performance_evaluation FROM sal_performance_evaluation
WHERE WHERE deleted_flag = 'N'
evaluation_month = #{queryMonth} AND evaluation_month = #{queryMonth}
AND deleted_flag = 'N'
AND superior_leader_mobile_phone = #{regionManagerMobilePhone} AND superior_leader_mobile_phone = #{regionManagerMobilePhone}
AND (manual_grade_code IS NOT NULL OR auto_grade_code IS NOT NULL) AND adopt_type IN (1, 2)
) t ) t
</select> </select>
<select id="perfAppraisalList" resultType="cn.com.glsx.dj.staff.dto.perfSalary.AppraisalInfoDTO">
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!