generated from dxfeng/secondev-wugang-dxfeng
SSC门户
This commit is contained in:
parent
92597d7cf2
commit
eb3edfeca8
|
|
@ -0,0 +1,34 @@
|
|||
package com.weaver.seconddev.portal.controller;
|
||||
|
||||
import com.weaver.common.authority.annotation.WeaPermission;
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.seconddev.portal.entity.po.ExpirationReminderPo;
|
||||
import com.weaver.seconddev.portal.service.SscPortalService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/secondev/portal/ssc")
|
||||
@WeaPermission(publicPermission = true)
|
||||
public class SscPortalController {
|
||||
|
||||
@Autowired
|
||||
SscPortalService sscPortalService;
|
||||
|
||||
@PostMapping("/getExpirationReminder")
|
||||
private WeaResult<ExpirationReminderPo> getExpirationReminder(@RequestBody Map<String, String> params) {
|
||||
return sscPortalService.getExpirationReminder(params);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.weaver.seconddev.portal.entity.param;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SscParam extends BaseParam {
|
||||
private String tenantKey;
|
||||
private Set<Long> departmentIdList;
|
||||
private String currentDate;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.weaver.seconddev.portal.entity.po;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ExpirationReminderPo {
|
||||
/**
|
||||
* 合同到期
|
||||
*/
|
||||
private int contractExpiration;
|
||||
private String contractExpirationUrl;
|
||||
/**
|
||||
* 身份证到期
|
||||
*/
|
||||
private int idCardExpiration;
|
||||
private String idCardExpirationUrl;
|
||||
/**
|
||||
* 健康证到期
|
||||
*/
|
||||
private int healthCertificateExpiration;
|
||||
private String healthCertificateExpirationUrl;
|
||||
/**
|
||||
* 入职周年提醒
|
||||
*/
|
||||
private int employmentAnniversary;
|
||||
private String employmentAnniversaryUrl;
|
||||
/**
|
||||
* 管理层生日提醒
|
||||
*/
|
||||
private int birthdayNum;
|
||||
private String birthdayNumUrl;
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.weaver.seconddev.portal.mapper;
|
||||
|
||||
import com.weaver.seconddev.portal.entity.param.SscParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SscPortalMapper {
|
||||
|
||||
/**
|
||||
* 合同到期
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int getExpirationReminderCount(SscParam param);
|
||||
|
||||
/**
|
||||
* 身份证到期
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int getIdCardExpirationCount(SscParam param);
|
||||
|
||||
/**
|
||||
* 健康证到期
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int getHealthCertificateExpirationCount(SscParam param);
|
||||
|
||||
/**
|
||||
* 入职周年提醒
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int getEmploymentAnniversaryCount(SscParam param);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.weaver.seconddev.portal.service;
|
||||
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.seconddev.portal.entity.po.ExpirationReminderPo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface SscPortalService {
|
||||
/**
|
||||
* 到期提醒
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
WeaResult<ExpirationReminderPo> getExpirationReminder(Map<String, String> params);
|
||||
}
|
||||
|
|
@ -60,10 +60,10 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
|||
// 待离职
|
||||
map.put("leave", toLeaveCount);
|
||||
map.put("leaveUrl", urlMap.get("leave"));
|
||||
// 待签订
|
||||
//TODO 待签订
|
||||
map.put("sign", toSignCount);
|
||||
map.put("signUrl", urlMap.get("sign"));
|
||||
// 代理期转正
|
||||
//TODO 代理期转正
|
||||
map.put("proxy", toProxyCount);
|
||||
map.put("proxyUrl", urlMap.get("proxy"));
|
||||
return WeaResult.success(map);
|
||||
|
|
@ -114,6 +114,7 @@ public class HrbpPortalServiceImpl implements HrbpPortalService {
|
|||
|
||||
@Override
|
||||
public WeaResult<Map<String, Object>> getTodayOverview(Map<String, String> params) {
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,8 +132,7 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
// 入职流程中人数
|
||||
returnMap.put("entryingNumber", entryingNumber);
|
||||
returnMap.put("entryingNumberUrl", urlMap.get("entryingNumber"));
|
||||
// TODO 测试用
|
||||
returnMap.put("basicPersonnelParam", basicPersonnelParam);
|
||||
|
||||
|
||||
return WeaResult.success(returnMap);
|
||||
}
|
||||
|
|
@ -176,8 +175,6 @@ public class ManagerPortalServiceImpl implements ManagerPortalService {
|
|||
returnMap.put("employmentAnniversary", employmentAnniversary);
|
||||
returnMap.put("employmentAnniversaryUrl", urlMap.get("employmentAnniversary"));
|
||||
|
||||
// TODO 测试用
|
||||
returnMap.put("basicPersonnelParam", basicPersonnelParam);
|
||||
return WeaResult.success(returnMap);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
package com.weaver.seconddev.portal.service.impl;
|
||||
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.seconddev.portal.entity.param.SscParam;
|
||||
import com.weaver.seconddev.portal.entity.po.ExpirationReminderPo;
|
||||
import com.weaver.seconddev.portal.entity.po.PortalUrlDetail;
|
||||
import com.weaver.seconddev.portal.mapper.PortalMapper;
|
||||
import com.weaver.seconddev.portal.mapper.SscPortalMapper;
|
||||
import com.weaver.seconddev.portal.service.SscPortalService;
|
||||
import com.weaver.teams.security.context.UserContext;
|
||||
import com.weaver.teams.security.user.User;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2025/07/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SscPortalServiceImpl implements SscPortalService {
|
||||
private static final String PORTAL_KEY = "sscPortal";
|
||||
|
||||
@Autowired
|
||||
SscPortalMapper sscPortalMapper;
|
||||
|
||||
@Autowired
|
||||
PortalMapper portalMapper;
|
||||
|
||||
@Override
|
||||
public WeaResult<ExpirationReminderPo> getExpirationReminder(Map<String, String> params) {
|
||||
User currentUser = UserContext.getCurrentUser();
|
||||
SscParam sscParam = new SscParam();
|
||||
sscParam.setTenantKey(currentUser.getTenantKey());
|
||||
|
||||
ExpirationReminderPo expirationReminderPo = new ExpirationReminderPo();
|
||||
|
||||
// 合同到期
|
||||
expirationReminderPo.setContractExpiration(sscPortalMapper.getExpirationReminderCount(sscParam));
|
||||
expirationReminderPo.setIdCardExpiration(sscPortalMapper.getIdCardExpirationCount(sscParam));
|
||||
expirationReminderPo.setHealthCertificateExpiration(sscPortalMapper.getHealthCertificateExpirationCount(sscParam));
|
||||
expirationReminderPo.setEmploymentAnniversary(sscPortalMapper.getEmploymentAnniversaryCount(sscParam));
|
||||
// TODO
|
||||
expirationReminderPo.setBirthdayNum(-1);
|
||||
|
||||
|
||||
// 设置穿透地址
|
||||
List<PortalUrlDetail> portalUrlDetails = portalMapper.getPortalUrlDetail(sscParam.getTenantKey(), PORTAL_KEY, "getExpirationReminder");
|
||||
Map<String, String> urlMap = portalUrlDetails.stream().collect(Collectors.toMap(PortalUrlDetail::getDetailKey, PortalUrlDetail::getUrlAddress));
|
||||
expirationReminderPo.setContractExpirationUrl(urlMap.get("contractExpiration"));
|
||||
expirationReminderPo.setIdCardExpirationUrl(urlMap.get("idCardExpiration"));
|
||||
expirationReminderPo.setHealthCertificateExpirationUrl(urlMap.get("healthCertificateExpiration"));
|
||||
expirationReminderPo.setEmploymentAnniversaryUrl(urlMap.get("employmentAnniversary"));
|
||||
expirationReminderPo.setBirthdayNumUrl(urlMap.get("birthdayNum"));
|
||||
|
||||
|
||||
return WeaResult.success(expirationReminderPo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.weaver.seconddev.portal.mapper.SscPortalMapper">
|
||||
|
||||
<select id="getExpirationReminderCount" resultType="java.lang.Integer">
|
||||
select count(t.id) as value from ${e10_common}.uf_jcl_employee_information t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.htzzrq <![CDATA[ <= ]]> CURDATE()
|
||||
</select>
|
||||
|
||||
<select id="getIdCardExpirationCount" resultType="java.lang.Integer">
|
||||
select count(t.id) as value from ${e10_common}.uf_jcl_employee_information t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.sfzyxjsrq <![CDATA[ <= ]]> CURDATE()
|
||||
</select>
|
||||
|
||||
<select id="getHealthCertificateExpirationCount" resultType="java.lang.Integer">
|
||||
select count(t.id) as value from ${e10_common}.uf_jcl_employee_information t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
and t.jkzdqrq <![CDATA[ <= ]]> CURDATE()
|
||||
</select>
|
||||
|
||||
<select id="getEmploymentAnniversaryCount" resultType="java.lang.Integer">
|
||||
select count(t.id) as value from ${e10_common}.uf_jcl_employee_information t
|
||||
where t.delete_type = 0 and t.tenant_key = #{tenantKey}
|
||||
<if test="departmentIdList != null and departmentIdList.size() > 0">
|
||||
AND t.department IN
|
||||
<foreach collection="departmentIdList" item="departmentId" open="(" close=")" separator=",">
|
||||
#{departmentId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND (
|
||||
(
|
||||
DATE_FORMAT(hiredate, '%m-%d') BETWEEN
|
||||
DATE_FORMAT(CURDATE(), '%m-%d') AND DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
|
||||
)
|
||||
OR (
|
||||
DATE_FORMAT(CURDATE(), '%m-%d') > DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
|
||||
AND (
|
||||
DATE_FORMAT(hiredate, '%m-%d') >= DATE_FORMAT(CURDATE(), '%m-%d')
|
||||
OR DATE_FORMAT(hiredate, '%m-%d') <= DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')
|
||||
)
|
||||
)
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue