Commit 8e11071d authored by Mr.Tang's avatar Mr.Tang

人事管理-转正人数统计bug修复

parent 1ff0eede
......@@ -62,7 +62,10 @@ public interface EmploymentApprovalMapper
*/
public int deleteEmploymentApprovalByIds(Long[] ids);
/**
* 判断导入数据是否存在 是则更新 不是则插入
*
*/
public boolean checkExists(EmploymentApproval employmentApproval);
......@@ -87,16 +90,31 @@ public interface EmploymentApprovalMapper
public int updateEmploymentApprovalDraft(EmploymentApproval employmentApproval);
/**
* 批准同意
*
*/
public int updateApproval(EmploymentApproval employmentApproval);
/**
* 批准不同意
*
*/
public int updateApproval2(EmploymentApproval employmentApproval);
/**
* 基本信息自动填入
*
*/
public EmploymentApprovalDTO selectApprovalWithUser(Long userId);
/**
* 统计当天的生日人数(hr专有)
*
*/
public Long countTodayBirthday();
/**
* 统计当前季度生日卡人数(hr专有)
*
*/
public Long countCurrentQuarterBirthday();
}
......@@ -126,4 +126,16 @@ public class ApprovalRegularizationController extends BaseController
{
return toAjax(approvalRegularizationService.updateRegular2(approvalRegularization));
}
@PreAuthorize("@ss.hasRole('admin') or @ss.hasRole('project-manager') or @ss.hasRole('hr') or @ss.hasRole('general-manager')")
@GetMapping("/getCountCurrentRegularizationInTenDays")
public AjaxResult getCountCurrentRegularizationInTenDays()
{
return AjaxResult.success(approvalRegularizationService.countCurrentRegularizationInTenDays());
}
}
......@@ -64,4 +64,7 @@ public interface ApprovalRegularizationMapper
public int updateRegular(ApprovalRegularization approvalRegularization);
public int updateRegular2(ApprovalRegularization approvalRegularization);
public Long countCurrentRegularizationInTenDays();
}
......@@ -63,4 +63,7 @@ public interface IApprovalRegularizationService
public int updateRegular(ApprovalRegularization approvalRegularization);
public int updateRegular2(ApprovalRegularization approvalRegularization);
public Long countCurrentRegularizationInTenDays();
}
......@@ -104,4 +104,9 @@ public class ApprovalRegularizationServiceImpl implements IApprovalRegularizatio
return approvalRegularizationMapper.updateRegular2(approvalRegularization);
}
@Override
public Long countCurrentRegularizationInTenDays(){
return approvalRegularizationMapper.countCurrentRegularizationInTenDays();
}
}
......@@ -172,4 +172,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="countCurrentRegularizationInTenDays" resultType="Long">
SELECT COUNT(*) FROM approval_regularization
<where>
<if test="achievementDescription != null and achievementDescription != ''"> and achievement_description = #{achievementDescription}</if>
<if test="selfEvaluation != null and selfEvaluation != ''"> and self_evaluation = #{selfEvaluation}</if>
<if test="confirmationMaterials != null and confirmationMaterials != ''"> and confirmation_materials = #{confirmationMaterials}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="applicationTime != null "> and application_time = #{applicationTime}</if>
<if test="workNumber != null and workNumber != ''"> and work_number = #{workNumber}</if>
<if test="serviceDepart != null and serviceDepart != ''"> and service_depart = #{serviceDepart}</if>
<if test="position != null and position != ''"> and position = #{position}</if>
<if test="employmentForm != null and employmentForm != ''"> and employment_form = #{employmentForm}</if>
<if test="idNumber != null and idNumber != ''"> and id_number = #{idNumber}</if>
<if test="serviceDate != null "> and service_date = #{serviceDate}</if>
<if test="proposedDate != null "> and proposed_date = #{proposedDate}</if>
<if test="formalSalary != null "> and formal_salary = #{formalSalary}</if>
<if test="trialPeriodSalary != null "> and trial_period_salary = #{trialPeriodSalary}</if>
<if test="departHead != null and departHead != ''"> and depart_head = #{departHead}</if>
<if test="isPassPeriod != null "> and is_pass_period = #{isPassPeriod}</if>
<if test="departManagerSignature != null and departManagerSignature != ''"> and depart_manager_signature = #{departManagerSignature}</if>
<if test="officialConversionDate != null "> and official_conversion_date = #{officialConversionDate}</if>
<if test="managerConfirm != null "> and manager_confirm = #{managerConfirm}</if>
<if test="confirmationApprovalState != null "> and confirmation_approval_state = #{confirmationApprovalState}</if>
<if test="currentNode != null "> and current_node = #{currentNode}</if>
AND (
-- 情况1:调整到当前年
DATEDIFF(
COALESCE( -- 处理非法日期(如闰年问题)
STR_TO_DATE(
CONCAT(YEAR(CURDATE()), '-', MONTH(proposed_date), '-', DAY(proposed_date)),
'%Y-%m-%d'
),
DATE_ADD( -- 如果日期非法,自动跳到下个月第一天
STR_TO_DATE(
CONCAT(YEAR(CURDATE()), '-', MONTH(proposed_date), '-01'),
'%Y-%m-%d'
),
INTERVAL DAY(proposed_date) DAY
)
),
CURDATE()
) BETWEEN 0 AND 10
OR
-- 情况2:调整到下一年
DATEDIFF(
COALESCE(
STR_TO_DATE(
CONCAT(YEAR(CURDATE()) + 1, '-', MONTH(proposed_date), '-', DAY(proposed_date)),
'%Y-%m-%d'
),
DATE_ADD(
STR_TO_DATE(
CONCAT(YEAR(CURDATE()) + 1, '-', MONTH(proposed_date), '-01'),
'%Y-%m-%d'
),
INTERVAL DAY(proposed_date) DAY
)
),
CURDATE()
) BETWEEN 0 AND 10
)
</where>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment