Commit f5d9c9a1 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.6' into MVP1.7.6

parents 4c6d498a 71dd2124
......@@ -3990,8 +3990,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
// 职业资格信息——职业资格证书
// mvp1.7.6-chenyuxi: 是否有职业资格证书都存
if (Common.isNotNull(info.getHaveQualification())) {
if (Common.isNotNull(info.getHaveQualification())
&& CommonConstants.IS_TRUE.equals(main.getHaveQualification())
&& CommonConstants.IS_TRUE.equals(info.getHaveQualification())) {
tPreEmpProfessionalQualification = new TPreEmpProfessionalQualification();
tPreEmpProfessionalQualification.setPreMainId(mainId);
tPreEmpProfessionalQualification.setSettleDomain(deptId);
......@@ -4004,18 +4005,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpProfessionalQualification.setCreateBy(user.getId());
tPreEmpProfessionalQualification.setCreateName(user.getNickname());
tPreEmpProfessionalQualification.setCreateTime(LocalDateTime.now());
// mvp1.7.6-chenyuxi:
// 先默认没有职业资格证书
tPreEmpProfessionalQualification.setHaveQualification(CommonConstants.ONE_STRING);
if (CommonConstants.IS_TRUE.equals(main.getHaveQualification())
&& CommonConstants.IS_TRUE.equals(info.getHaveQualification())) {
// 有职业资格证书 申报年度 职业资格名称
tPreEmpProfessionalQualification.setDeclareYear(info.getDeclareYearValue());
tPreEmpProfessionalQualification.setQualificationType(info.getQualificationTypeValue());
tPreEmpProfessionalQualification.setHaveQualification(CommonConstants.ZERO_STRING);
}
// 是否有职业资格证书 申报年度 职业资格名称
tPreEmpProfessionalQualification.setDeclareYear(info.getDeclareYearValue());
tPreEmpProfessionalQualification.setQualificationType(info.getQualificationTypeValue());
// mvp1.7.6-chenyuxi:增加标识
tPreEmpProfessionalQualification.setHaveQualification(CommonConstants.ZERO_STRING);
preEmpProfessionalQualificationList.add(tPreEmpProfessionalQualification);
}
}
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 商险订单明细表
*
* @author huych
* @date 2025-02-07 15:17:24
*/
@Data
@TableName("ekp_insurances_info")
@EqualsAndHashCode()
@Schema(description = "商险订单明细表")
public class EkpInsurancesInfo {
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "fd_Id")
private String fd_id;
@Schema(description = "单据类型")
private String fd_3adfe6af71a1cc;
@Schema(description = "fd_3adfe658c6229e")
private String fd_3adfe658c6229e;
@Schema(description = "fd_3adfe6592b4158")
private String fd_3adfe6592b4158;
@Schema(description = "单号")
private String fd_3adfe67a9f6364;
@Schema(description = "fd_3adfe6598281e8")
private String fd_3adfe6598281e8;
@Schema(description = "fd_3adfe7a2688902")
private String fd_3adfe7a2688902;
@Schema(description = "fd_3adfe67c24dace")
private Date fd_3adfe67c24dace;
@Schema(description = "fd_3adfe65d759650")
private String fd_3adfe65d759650;
@Schema(description = "fd_3adfe65dbd9f68")
private String fd_3adfe65dbd9f68;
@Schema(description = "发票号")
private String fd_3adfe65e0cd094;
@Schema(description = "险种")
private String fd_3adfe65f6599e4;
@Schema(description = "保险公司")
private String fd_3adfe65ea04728;
@Schema(description = "保单号")
private String fd_3adfe65e60e110;
@Schema(description = "保险开始日期")
private Date fd_3adfe6b7e0ede8;
@Schema(description = "保险结束日期")
private Date fd_3adfe6b847bfe6;
@Schema(description = "购买标准")
private Double fd_3adfe6d55384c6;
@Schema(description = "实际保费")
private Double fd_3adfe6610c0d2c;
@Schema(description = "fd_3adfe66041a996")
private Double fd_3adfe66041a996;
@Schema(description = "事故或残疾")
private String fd_3adfe6609aa810;
@Schema(description = "应收")
private Double fd_3adfe6e30f2a3c;
@Schema(description = "结算状态")
private String fd_3adfe6ec6a8cbe;
@Schema(description = "收款状态")
private String fd_3adfe6ef5dfaac;
@Schema(description = "fd_3adfe79fd_04606")
private String fd_3adfe79fd04606;
@Schema(description = "fd_3adfe7a117f086")
private String fd_3adfe7a117f086;
@Schema(description = "应支出")
private Double fd_3adfe6e3911ffe;
@Schema(description = "支出结算状态")
private String fd_3adfe6eda67236;
@Schema(description = "付款状态")
private String fd_3adfe6f05531ec;
@Schema(description = "fd_3adfe7a035849c")
private String fd_3adfe7a035849c;
@Schema(description = "fd_3adfe7a08eba96")
private String fd_3adfe7a08eba96;
@Schema(description = "状态")
private String fd_3af9197b31071c;
@Schema(description = "实际结算月份")
private Date fd_3af9d11088facc;
@Schema(description = "有无预估")
private String fd_3af9d1441ef7b6;
@Schema(description = "预估金额")
private Double fd_3af9d15f7018fa;
@Schema(description = "fd_3af9d1662141a4")
private Double fd_3af9d1662141a4;
@Schema(description = "商险ID")
private String fd_3b0a5743acab7e;
@Schema(description = "fd_3b13ad2da5d476")
private String fd_3b13ad2da5d476;
@Schema(description = "fd_3b13ad3948940c")
private Date fd_3b13ad3948940c;
@Schema(description = "HRO结算月")
private Date fd_3b13b3076af5a0;
@Schema(description = "是否全部结算")
private String fd_3b13b2ecc164aa;
@Schema(description = "fd_3b16da0eb23648")
private String fd_3b16da0eb23648;
@Schema(description = "项目编码")
private String fd_3b16dfb32778f2_text;
@Schema(description = "项目台账ID(ID)")
private String fd_3b16dfb32778f2;
@Schema(description = "是否为BPO业务")
private String fd_3b178fab62d196;
@Schema(description = "变更记录")
private String fd_3b3e4653122c9e;
@Schema(description = "商险变更记录")
private String fd_3b5bf1628c5a68;
@Schema(description = "变更发票号")
private String fd_3b5bf17f2fc25c;
@Schema(description = "变更购买标准")
private String fd_3b5bf180e08fbe;
@Schema(description = "保单开始时间")
private Date fd_3b5bf17ae91f9c;
@Schema(description = "保单结束时间")
private Date fd_3b5bf17c6df310;
@Schema(description = "投保类型")
private String fd_3b5bf17d9297c2;
@Schema(description = "商险封面抬头")
private String fd_3b941cbcea3e1a;
@Schema(description = "fd_3c6f0108e05c84")
private String fd_3c6f0108e05c84;
@Schema(description = "是否启用BPO结算模式")
private String fd_usebpo_settle;
@Schema(description = "创建时间")
private Date createTime;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @Author huyc
* @Date 2025/2/7
* @Description 获取项目明细信息
* @Version 1.0
*/
@Data
public class EkpInsuranceDeptInfoVo implements Serializable {
/**
* fdId
**/
private String fdId;
/**
* 是否为BPO项目
**/
private String isBpo;
/**
* 商险费用
**/
private String insurancesType;
/**
* 结算方式
**/
private String settleType;
/**
* 商险封面抬头
**/
private String insurancesTitle;
/**
* 是否启用BPO结算模式
**/
private String bpoSettle;
/**
* 项目编码
**/
private String deptNo;
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.EkpInsurancesInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商险订单明细表
*
* @author huych
* @date 2025-02-07 15:17:24
*/
@Mapper
public interface EkpInsurancesInfoMapper extends BaseMapper<EkpInsurancesInfo> {
List<EkpInsurancesInfo> getEkpInsurancesInfoList(@Param("detailId") String detailId);
//查询未结算实缴
EkpInsurancesInfo getEkpInsurancesInfo(@Param("detailId") String detailId);
//查询未结算预估
EkpInsurancesInfo getEkpInsurancesInfoYg(@Param("detailId") String detailId);
//查询不为未结算的商险记录
EkpInsurancesInfo getEkpInsurancesInfoNotSettle(@Param("detailId") String detailId);
//查询未结算的商险记录
EkpInsurancesInfo getEkpInsurancesInfoSettle(@Param("detailId") String detailId);
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.DeptSettleVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -64,4 +61,6 @@ public interface EkpSettleMapper {
List<EkpSocialViewVo> selectSalarylViewBySettleNo(@Param("settleNo") String settleNo,@Param("payFlag") String payFlag);
EkpInsuranceDeptInfoVo getInsuranceEkpDeptInfo(@Param("deptNo") String deptNo);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.EkpInsurancesInfo;
/**
* 商险订单明细表
*
* @author huych
* @date 2025-02-07 15:17:24
*/
public interface EkpInsurancesInfoService extends IService<EkpInsurancesInfo> {
}
......@@ -3,10 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.DeptSettleVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import java.util.List;
......@@ -28,6 +25,8 @@ public interface EkpSettleService extends IService<TInsuranceTypeRate> {
DeptSettleVo getDeptSettle(String id);
EkpInsuranceDeptInfoVo getInsuranceEkpDeptInfo(String deptNo);
DeptSettleVo getDeptYgSettle(String id);
/**
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.EkpInsurancesInfo;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpInsurancesInfoMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpInsurancesInfoService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 商险订单明细表
*
* @author huych
* @date 2025-02-07 15:17:24
*/
@Log4j2
@Service
public class EkpInsurancesInfoServiceImpl extends ServiceImpl<EkpInsurancesInfoMapper, EkpInsurancesInfo> implements EkpInsurancesInfoService {
}
......@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpSettleMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.DeptSettleVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -37,6 +34,11 @@ public class EkpSettleServiceImpl implements EkpSettleService {
return ekpSettleMapper.getDeptSettle(id);
}
@Override
public EkpInsuranceDeptInfoVo getInsuranceEkpDeptInfo(String deptNo) {
return ekpSettleMapper.getInsuranceEkpDeptInfo(deptNo);
}
@Override
public DeptSettleVo getDeptYgSettle(String id) {
return ekpSettleMapper.getDeptYgSettle(id);
......
<?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.yifu.cloud.plus.v1.yifu.insurances.mapper.ekp.EkpInsurancesInfoMapper">
<resultMap id="ekpInsurancesInfoMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.EkpInsurancesInfo">
<id property="fd_id" column="fd_id"/>
<result property="fd_3adfe6af71a1cc" column="fd_3adfe6af71a1cc"/>
<result property="fd_3adfe658c6229e" column="fd_3adfe658c6229e"/>
<result property="fd_3adfe6592b4158" column="fd_3adfe6592b4158"/>
<result property="fd_3adfe67a9f6364" column="fd_3adfe67a9f6364"/>
<result property="fd_3adfe6598281e8" column="fd_3adfe6598281e8"/>
<result property="fd_3adfe7a2688902" column="fd_3adfe7a2688902"/>
<result property="fd_3adfe67c24dace" column="fd_3adfe67c24dace"/>
<result property="fd_3adfe65d759650" column="fd_3adfe65d759650"/>
<result property="fd_3adfe65dbd9f68" column="fd_3adfe65dbd9f68"/>
<result property="fd_3adfe65e0cd094" column="fd_3adfe65e0cd094"/>
<result property="fd_3adfe65f6599e4" column="fd_3adfe65f6599e4"/>
<result property="fd_3adfe65ea04728" column="fd_3adfe65ea04728"/>
<result property="fd_3adfe65e60e110" column="fd_3adfe65e60e110"/>
<result property="fd_3adfe6b7e0ede8" column="fd_3adfe6b7e0ede8"/>
<result property="fd_3adfe6b847bfe6" column="fd_3adfe6b847bfe6"/>
<result property="fd_3adfe6d55384c6" column="fd_3adfe6d55384c6"/>
<result property="fd_3adfe6610c0d2c" column="fd_3adfe6610c0d2c"/>
<result property="fd_3adfe66041a996" column="fd_3adfe66041a996"/>
<result property="fd_3adfe6609aa810" column="fd_3adfe6609aa810"/>
<result property="fd_3adfe6e30f2a3c" column="fd_3adfe6e30f2a3c"/>
<result property="fd_3adfe6ec6a8cbe" column="fd_3adfe6ec6a8cbe"/>
<result property="fd_3adfe6ef5dfaac" column="fd_3adfe6ef5dfaac"/>
<result property="fd_3adfe79fd04606" column="fd_3adfe79fd04606"/>
<result property="fd_3adfe7a117f086" column="fd_3adfe7a117f086"/>
<result property="fd_3adfe6e3911ffe" column="fd_3adfe6e3911ffe"/>
<result property="fd_3adfe6eda67236" column="fd_3adfe6eda67236"/>
<result property="fd_3adfe6f05531ec" column="fd_3adfe6f05531ec"/>
<result property="fd_3adfe7a035849c" column="fd_3adfe7a035849c"/>
<result property="fd_3adfe7a08eba96" column="fd_3adfe7a08eba96"/>
<result property="fd_3af9197b31071c" column="fd_3af9197b31071c"/>
<result property="fd_3af9d11088facc" column="fd_3af9d11088facc"/>
<result property="fd_3af9d1441ef7b6" column="fd_3af9d1441ef7b6"/>
<result property="fd_3af9d15f7018fa" column="fd_3af9d15f7018fa"/>
<result property="fd_3af9d1662141a4" column="fd_3af9d1662141a4"/>
<result property="fd_3b0a5743acab7e" column="fd_3b0a5743acab7e"/>
<result property="fd_3b13ad2da5d476" column="fd_3b13ad2da5d476"/>
<result property="fd_3b13ad3948940c" column="fd_3b13ad3948940c"/>
<result property="fd_3b13b3076af5a0" column="fd_3b13b3076af5a0"/>
<result property="fd_3b13b2ecc164aa" column="fd_3b13b2ecc164aa"/>
<result property="fd_3b16da0eb23648" column="fd_3b16da0eb23648"/>
<result property="fd_3b16dfb32778f2_text" column="fd_3b16dfb32778f2_text"/>
<result property="fd_3b16dfb32778f2" column="fd_3b16dfb32778f2"/>
<result property="fd_3b178fab62d196" column="fd_3b178fab62d196"/>
<result property="fd_3b3e4653122c9e" column="fd_3b3e4653122c9e"/>
<result property="fd_3b5bf1628c5a68" column="fd_3b5bf1628c5a68"/>
<result property="fd_3b5bf17f2fc25c" column="fd_3b5bf17f2fc25c"/>
<result property="fd_3b5bf180e08fbe" column="fd_3b5bf180e08fbe"/>
<result property="fd_3b5bf17ae91f9c" column="fd_3b5bf17ae91f9c"/>
<result property="fd_3b5bf17c6df310" column="fd_3b5bf17c6df310"/>
<result property="fd_3b5bf17d9297c2" column="fd_3b5bf17d9297c2"/>
<result property="fd_3b941cbcea3e1a" column="fd_3b941cbcea3e1a"/>
<result property="fd_3c6f0108e05c84" column="fd_3c6f0108e05c84"/>
<result property="fd_usebpo_settle" column="fd_usebpo_settle"/>
<result property="createTime" column="create_time"/>
</resultMap>
<!-- ekpInsurancesInfo简单分页查询 -->
<select id="getEkpInsurancesInfoList" resultMap="ekpInsurancesInfoMap">
SELECT
*
FROM ekp_insurances_info a
where fd_3adfe6ec6a8cbe = '未结算' and fd_3b0a5743acab7e = #{detailId}
</select>
<select id="getEkpInsurancesInfo" resultMap="ekpInsurancesInfoMap">
SELECT
*
FROM ekp_insurances_info a
where fd_3adfe6ec6a8cbe = '未结算'
and fd_3adfe6af71a1cc = '实缴'
and fd_3b0a5743acab7e = #{detailId}
limit 1
</select>
<select id="getEkpInsurancesInfoYg" resultMap="ekpInsurancesInfoMap">
SELECT
*
FROM ekp_insurances_info a
where fd_3adfe6ec6a8cbe = '未结算'
and fd_3adfe6af71a1cc = '预估'
and fd_3b0a5743acab7e = #{detailId}
limit 1
</select>
<select id="getEkpInsurancesInfoNotSettle" resultMap="ekpInsurancesInfoMap">
SELECT
*
FROM ekp_insurances_info a
where fd_3adfe6eda67236 != '未结算'
and fd_3b0a5743acab7e = #{detailId}
limit 1
</select>
<select id="getEkpInsurancesInfoSettle" resultMap="ekpInsurancesInfoMap">
SELECT
*
FROM ekp_insurances_info a
where fd_3adfe6eda67236 = '未结算'
and fd_3b0a5743acab7e = #{detailId}
limit 1
</select>
</mapper>
......@@ -63,7 +63,7 @@
from
ekp_e96a0a28442447c81ec0
where
fd_3b0a5743acab7e = #{id} limit 1
fd_3b0a5743acab7e = #{id} and fd_3adfe6af71a1cc = '实缴' limit 1
</select>
<select id="getDeptSettle" resultMap="BaseDeptResultMap">
......@@ -191,6 +191,21 @@
and gongzi.fd_3aeadf17522642 = #{settleNo}
</if>
</select>
<!--查询项目信息-->
<select id="getInsuranceEkpDeptInfo" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceDeptInfoVo">
SELECT
a.fd_id as fdId,
a.fd_3b1480cd9dcb60 as settleType,
a.fd_3b15f64dd59a28 as isBpo,
a.fd_3b13b272078eda as insurancesType,
a.fd_3b1480c5fe3580_text as insurancesTitle,
a.fd_usebpo_settle as bpoSettle,
a.fd_3a37fe508071fe as deptNo
from ekp_24a8e6a7fc143bb8c48a a
where a.fd_3a37fe508071fe = #{deptNo}
limit 1
</select>
</mapper>
......
......@@ -55,7 +55,7 @@ public class EkpPermissionTask {
/**
* @return
* @Author hgw
* @Description 每天1点,定时同步HCM审批出差数据
* @Description 每天2点,定时同步HCM审批出差数据
* @Date 2024-4-29 15:59:31
* @Param
**/
......@@ -81,4 +81,17 @@ public class EkpPermissionTask {
log.info("-------------获取企微招聘数据-定时任务结束------------");
}
}
\ No newline at end of file
/**
* 每天2点30,定时同步昨天HCM审批加班数据
* @author chenyuxi
* @since 1.9.6
* @date 2025-02-06
**/
public void doSaveHcmWorkOvertime() throws Exception {
log.info("-------------获取HCM加班数据-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprEkpPermissionProperties.getAppUrl(), daprEkpPermissionProperties.getAppId(),
"/qiWei/inner/everyDaySaveHcmWorkOvertime", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------获取HCM加班数据-定时任务结束------------");
}
}
package com.yifu.cloud.plus.v1.yifu.permission.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.poi.hpsf.Decimal;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* E人事项目加班申请
* @author chenyuxi
* @since 1.9.6
* @date 2025-02-06
*/
@TableName(value = "ekp_qiwei_workovertime")
@Data
@Schema(description = "E人事项目加班申请")
public class EkpQiwiWorkovertime {
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键", name = "fdId")
private String fdId;
@Schema(description = "申请编号")
@NotBlank(message = "申请编号不能为空")
private String fdSpNo;
@Schema(description = "申请人姓名")
@NotBlank(message = "申请人姓名不能为空")
private String fdApplyUserName;
@Schema(description = "申请人部门")
@NotBlank(message = "申请人部门不能为空")
private String fdApplyUserDept;
@Schema(description = "申请日期")
@NotNull(message = "申请日期不能为空")
private LocalDateTime fdApplyDate;
@Schema(description = "加班开始时间")
private LocalDateTime fdWorkBegin;
@Schema(description = "加班结束时间")
private LocalDateTime fdWorkEnd;
@Schema(description = "加班事由")
private String fdReason;
@Schema(description = "加班时间用于")
private String fdTimeUse;
@Schema(description = "岗位级别")
private String fdPositionLevel;
@Schema(description = "项目名称")
private String fdProjectName;
@Schema(description = "项目编码")
private String fdProjectCode;
@Schema(description = "工作日加班时长(小时)")
private String fdWorkDuration;
@Schema(description = "节假日加班时长(小时)")
private String fdHolidayDuration;
@Schema(description = "休息日加班时长(小时)")
private String fdRestDuration;
@Schema(description = "累计加班时长(小时)")
private String fdSumDuration;
@Schema(description = "是否出差加班:是、否")
private String fdIsAway;
@Schema(description = "关联加班费状态")
private String fdOvertimePayStatus;
@Schema(description = "关联加班费的项目报销单号ID")
private String fdOvertimePayId;
@Schema(description = "关联加班费的项目报销单号编号")
private String fdOvertimePayCode;
@Schema(description = "关联加班餐费状态")
private String fdOvertimeFoodStatus;
@Schema(description = "关联加班餐费的项目报销单号ID")
private String fdOvertimeFoodId;
@Schema(description = "关联加班餐费的项目报销单号编号")
private String fdOvertimeFoodCode;
@Schema(description = "拉取数据时间")
private LocalDateTime createTime;
@Schema(description = "原始数据存储")
private String orgData;
}
......@@ -57,6 +57,8 @@ public class WxConfig {
private String hcmAppSecret;
@Value("${hcm.appUrl}")
private String hcmAppUrl;
@Value("${hcm.appWorkOvertimeUrl}")
private String appWorkOvertimeUrl;
@Autowired
private RedisTemplate redisTemplate;
......
......@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiChuchai;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiZhaoPin;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -152,4 +153,54 @@ public class QiWeiController {
return R.failed();
}
/**
* 获取HCM审批通过的加班数据并存储到EKP
* @author chenyuxi
* @since 1.9.6
* @date 2025-02-06
* @return R<List<EkpQiwiChuchai>>
**/
@PostMapping("/inner/everyDaySaveHcmWorkOvertime")
@Inner
public R<List<EkpQiwiWorkovertime>> everyDaySaveHcmWorkOvertime() {
String startDay = DateUtil.addDay(-1);
String endDay = DateUtil.addDay(0);
return wxSalaryService.getHcmWorkOvertimeAndSave(startDay, endDay);
}
/**
* 初次获取HCM审批通过的加班数据并存储到EKP
* @author chenyuxi
* @since 1.9.6
* @date 2025-02-06
* @return R<List<EkpQiwiChuchai>>
**/
@Operation(summary = "初次获取HCM审批通过的加班数据并存储到EKP")
@SysLog("初次获取HCM审批通过的加班数据并存储到EKP")
@GetMapping("/initialSaveHcmWorkOvertime")
public R<List<EkpQiwiWorkovertime>> initialSaveHcmWorkOvertime() {
String startDay = DateUtil.addDay(-29);
String endDay = DateUtil.addDay(0);
return wxSalaryService.getHcmWorkOvertimeAndSave(startDay, endDay);
}
/**
* 手动同步当日HCM的加班数据并存储到EKP
* @author chenyuxi
* @date 2024-10-17
* @since 1.9.6
**/
@Operation(summary = "手动同步当日HCM的E人事审批里的加班数据--EKP调用接口")
@SysLog("手动同步当日HCM的E人事审批里的加班数据--EKP调用接口")
@GetMapping("/getEWorkOvertimeInfo")
public R<String> getEWorkOvertimeInfo() {
String startDay = DateUtil.addDay(0);
String endDay = DateUtil.addDay(0);
R<List<EkpQiwiWorkovertime>> returnR = wxSalaryService.getHcmWorkOvertimeAndSave(startDay, endDay);
if (returnR != null && returnR.getCode() == CommonConstants.SUCCESS) {
return R.ok();
}
return R.failed();
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.permission.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiZhaoPin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* E人事加班申请
*
* @author chenyuxi
* @since 1.9.6
*/
@Mapper
public interface EkpQiweiWorkovertimeMapper extends BaseMapper<EkpQiwiWorkovertime> {
/**
* 已被拉取的90天内的数据Map
* 获取全部的列表,用来: 拉取企E人事加班数据时,不覆盖数据
* @return java.util.Map<java.lang.String, java.lang.String>
**/
List<EkpQiwiWorkovertime> getWorkovertimeMapByTimeRange(@Param("queryStartTime") String queryStartTime,@Param("queryEndTime") String queryEndTime);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.permission.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiZhaoPin;
import java.util.List;
import java.util.Map;
/**
* E人事加班申请
*
* @author chenyuxi
* @since 1.9.6
*/
public interface EkpQiweiWorkovertimeService extends IService<EkpQiwiWorkovertime> {
/**
* 已被拉取的90天内的数据Map(定时任务是拉前一天的,手动执行是当面的。所以对90内的查重足够了。查全部数据对IO是浪费的)
* 用来: 拉取企E人事加班数据时,不覆盖数据
* @return java.util.Map<java.lang.String, java.lang.String>
**/
Map<String, String> getWorkovertimeMapByTimeRange(String queryStartTime,String queryEndTime);
/**
* 获取HCM审批通过的加班数据并存储到EKP
* @param startTime 开始时间
* @param endTime 结束时间
* @return R<List<EkpQiwiChuchai>>
**/
List<EkpQiwiWorkovertime> saveWorkovertimeList(String startTime, String endTime);
}
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.permission.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiChuchai;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiZhaoPin;
import java.util.List;
......@@ -35,4 +36,16 @@ public interface QiWeiService extends IService<EkpQiwiChuchai> {
**/
R<List<EkpQiwiZhaoPin>> getQiWeiZhaoPinAndSave(String startTime, String endTime);
/**
* 获取HCM审批通过的加班数据并存储到EKP
* @param startDay 开始日期
* @param endDay 结束日期
* @author chenyuxi
* @since 1.9.6
* @date 2025-02-06
* @return R<List<EkpQiwiChuchai>>
**/
R<List<EkpQiwiWorkovertime>> getHcmWorkOvertimeAndSave(String startDay, String endDay);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.permission.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.config.WxConfig;
import com.yifu.cloud.plus.v1.permission.mapper.EkpQiweiWorkovertimeMapper;
import com.yifu.cloud.plus.v1.permission.mapper.EkpQiweiZhaopinMapper;
import com.yifu.cloud.plus.v1.permission.service.EkpQiweiWorkovertimeService;
import com.yifu.cloud.plus.v1.permission.service.EkpQiweiZhaopinService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiZhaoPin;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* E人事加班申请
*
* @author chenyuxi
* @since 1.9.6
*/
@Log4j2
@Service
@AllArgsConstructor
public class EkpQiweiWorkovertimeServiceImpl extends ServiceImpl<EkpQiweiWorkovertimeMapper, EkpQiwiWorkovertime> implements EkpQiweiWorkovertimeService {
private final WxConfig wxConfig;
private RestTemplate restTemplate = new RestTemplate();
/**
* 已被拉取的90天内的数据Map(定时任务是拉前一天的,手动执行是当面的。所以对90内的查重足够了。查全部数据对IO是浪费的)
* 用来: 拉取企E人事加班数据时,不覆盖数据
* @return java.util.Map<java.lang.String, java.lang.String>
**/
@Override
public Map<String, String> getWorkovertimeMapByTimeRange(String queryStartTime,String queryEndTime) {
List<EkpQiwiWorkovertime> cpHistoryList = baseMapper.getWorkovertimeMapByTimeRange(queryStartTime,queryEndTime);
Map<String, String> cpMap = new HashMap<>();
for (EkpQiwiWorkovertime cpHis : cpHistoryList) {
cpMap.put(cpHis.getFdSpNo(), "0");
}
return cpMap;
}
/**
* 获取HCM审批通过的加班数据并存储到EKP
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return R<List < EkpQiwiChuchai>>
**/
@Override
public List<EkpQiwiWorkovertime> saveWorkovertimeList(String startTime, String endTime) {
// 拉取E人事昨天的全量数据
List<EkpQiwiWorkovertime> hcmAllList = new ArrayList<>();
// 可存储的数据
List<EkpQiwiWorkovertime> saveCpList = new ArrayList<>();
// 已被拉取的90天内的数据Map(定时任务是拉前一天的,手动执行是当面的。所以对90内的查重足够了。查全部数据对IO是浪费的)
String queryStartDay = DateUtil.addDay(-90);
String queryStartTimes = queryStartDay + " 00:00:00";
Map<String, String> cpHistoryMap = this.getWorkovertimeMapByTimeRange(queryStartTimes,endTime);
// 拉取E人事昨天的全量数据
this.getWorkOvertimeListByHcm(startTime, endTime, hcmAllList);
log.debug("获取HCM审批通过的加班数据——hcmAllList.size()=" + hcmAllList.size());
if (!hcmAllList.isEmpty()) {
for (EkpQiwiWorkovertime cp : hcmAllList) {
if (cpHistoryMap.get(cp.getFdSpNo()) == null) {
saveCpList.add(cp);
}
}
}
log.debug("获取HCM审批通过的加班数据——saveCpList.size()=" + saveCpList.size());
// 填充基础数据并保存:
if (Common.isNotNull(saveCpList)) {
this.saveBatch(saveCpList);
}
cpHistoryMap.clear();
return saveCpList;
}
/**
* 从HCM-获取审批通过的加班数据
* @param startTime 开始时间
* @param endTime 结束时间
**/
private void getWorkOvertimeListByHcm(String startTime, String endTime, List<EkpQiwiWorkovertime> cpAllList) {
String sign = wxConfig.getHcmSign();
if (Common.isEmpty(sign)) {
log.error("从HCM-获取审批通过的加班数据>>获取HCM的sign失败!");
}
String appWorkOvertimeUrl = wxConfig.getAppWorkOvertimeUrl();
if (Common.isEmpty(appWorkOvertimeUrl)) {
log.error("从HCM-获取审批通过的加班数据>>获取HCM的appWorkOvertimeUrl失败!");
}
log.info("从HCM-获取审批通过的加班数据》》sign=" + sign);
HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
headers.setContentType(type);
headers.add("Accept", MediaType.APPLICATION_JSON.toString());
headers.add("sign", sign);
HttpEntity<String> formEntity = new HttpEntity<>(headers);
log.info("从HCM-获取审批通过的加班数据》》appWorkOvertimeUrl=" + appWorkOvertimeUrl);
// 从HCM-获取审批通过的加班数据
String dataResultList = restTemplate.postForEntity(appWorkOvertimeUrl, formEntity, String.class, startTime, endTime).getBody();
log.info("从HCM-获取审批通过的加班数据》》dataResultList=" + dataResultList);
if (Common.isEmpty(dataResultList)) {
throw new AuthenticationServiceException("从HCM-获取审批通过的加班数据失败");
}
JSONObject jsonObject = JSON.parseObject(dataResultList);
String code = jsonObject.getString("code");
if (!"200".equals(code)) {
log.error("从HCM-获取审批通过的加班数据>>返回code非200");
}
// 时间段内的总审批单个数
String data = jsonObject.getString("data");
if (Common.isNotNull(data)) {
List<JSONObject> dataList = JSON.parseArray(data, JSONObject.class);
log.debug("从HCM-获取审批通过的加班数据》》dataList的数量=" + dataList.size());
JSONObject formData;
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
EkpQiwiWorkovertime workOvertimeInfo;
for (JSONObject datas : dataList) {
workOvertimeInfo = new EkpQiwiWorkovertime();
// 存原始报文
workOvertimeInfo.setOrgData(datas.toJSONString());
if (Common.isNotNull(datas.getString("applyTimeFormat"))) {
workOvertimeInfo.setFdApplyDate(LocalDateTime.parse(datas.getString("applyTimeFormat"), df));
}
if (Common.isNotNull(datas.getString("startTimeFormat"))) {
workOvertimeInfo.setFdWorkBegin(LocalDateTime.parse(datas.getString("startTimeFormat"), df));
}
if (Common.isNotNull(datas.getString("endTimeFormat"))) {
workOvertimeInfo.setFdWorkEnd(LocalDateTime.parse(datas.getString("endTimeFormat"), df));
}
workOvertimeInfo.setCreateTime(LocalDateTime.now());
workOvertimeInfo.setFdApplyUserName(datas.getString("applyName"));
workOvertimeInfo.setFdApplyUserDept(datas.getString("applyDeptName"));
workOvertimeInfo.setFdSpNo(datas.getString("flowId"));
workOvertimeInfo.setFdReason(datas.getString("initiationReason"));
workOvertimeInfo.setFdTimeUse(datas.getString("dataType"));
workOvertimeInfo.setFdWorkDuration(datas.getString("weekdayHour"));
workOvertimeInfo.setFdHolidayDuration(datas.getString("holidayHour"));
workOvertimeInfo.setFdRestDuration(datas.getString("restDayHour"));
workOvertimeInfo.setFdSumDuration(datas.getString("duration"));
// 关联状态默认为"未关联"
workOvertimeInfo.setFdOvertimeFoodStatus("未关联");
workOvertimeInfo.setFdOvertimePayStatus("未关联");
if (Common.isNotNull(datas.getString("formData"))) {
formData = JSON.parseObject(datas.getString("formData"));
workOvertimeInfo.setFdPositionLevel(formData.getString("岗位级别"));
workOvertimeInfo.setFdProjectName(formData.getString("项目名称"));
workOvertimeInfo.setFdProjectCode(formData.getString("项目编码"));
workOvertimeInfo.setFdIsAway(formData.getString("是否是出差加班"));
}
cpAllList.add(workOvertimeInfo);
}
}
}
}
......@@ -6,18 +6,22 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.config.WxConfig;
import com.yifu.cloud.plus.v1.permission.mapper.EkpQiweiChuchaiMapper;
import com.yifu.cloud.plus.v1.permission.service.EkpQiweiWorkovertimeService;
import com.yifu.cloud.plus.v1.permission.service.EkpQiweiZhaopinService;
import com.yifu.cloud.plus.v1.permission.service.QiWeiService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiChuchai;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime;
import com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiZhaoPin;
import com.yifu.cloud.plus.v1.yifu.permission.vo.QiWeiUserVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
......@@ -38,6 +42,7 @@ import java.util.*;
*/
@Service
@AllArgsConstructor
@Log4j2
public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwiChuchai> implements QiWeiService {
private RestTemplate restTemplate = new RestTemplate();
......@@ -52,6 +57,8 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
private final EkpQiweiZhaopinService ekpQiwiZhaoPinService;
private final EkpQiweiWorkovertimeService ekpQiweiWorkovertimeService;
/**
* @Description: 获取企业微信审批里的【招聘平台采购/调配】
* @Author: hgw
......@@ -173,7 +180,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
userMap = this.getUserMap();
String qwType = "chuChai";
this.getCostPaymentListByMonth(startTime, endTime, cpAllList, qwType);
log.error("1拉取企业微信出差数据cpAllList.size()=" + cpAllList.size());
log.debug("1拉取企业微信出差数据cpAllList.size()=" + cpAllList.size());
if (!cpAllList.isEmpty()) {
for (EkpQiwiChuchai cp : cpAllList) {
if (cpMap.get(cp.getFdSpNo()) == null) {
......@@ -181,19 +188,19 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
}
}
}
log.error("1拉取企业微信出差数据returnCpList.size()=" + returnCpList.size());
log.debug("1拉取企业微信出差数据returnCpList.size()=" + returnCpList.size());
// 填充详情
if (!returnCpList.isEmpty()) {
log.error("拉取企业微信出差数据:" + returnCpList.size() + " 条,开始循环拉取明细!");
log.debug("拉取企业微信出差数据:" + returnCpList.size() + " 条,开始循环拉取明细!");
this.getTStatisticsProjectReimburseDetail(returnCpList, userMap);
log.error("拉取企业微信出差数据结束");
log.debug("拉取企业微信出差数据结束");
}
} else {
// type 2:HCM的E人事
// 已被拉取的Map
cpMap = this.getAllMap();
this.getChuChaiListByHcm(startTimes, endTimes, cpAllList);
log.error("2拉取HCM的E人事出差数据cpAllList.size()=" + cpAllList.size());
log.debug("2拉取HCM的E人事出差数据cpAllList.size()=" + cpAllList.size());
if (!cpAllList.isEmpty()) {
for (EkpQiwiChuchai cp : cpAllList) {
if (cpMap.get(cp.getFdSpNo()) == null) {
......@@ -201,7 +208,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
}
}
}
log.error("2拉取HCM的E人事出差数据returnCpList.size()=" + returnCpList.size());
log.debug("2拉取HCM的E人事出差数据returnCpList.size()=" + returnCpList.size());
}
// 填充基础数据并保存:
if (!returnCpList.isEmpty()) {
......@@ -242,7 +249,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
**/
private R<List<EkpQiwiChuchai>> getTStatisticsProjectReimburseListByWx(String startTime, String endTime, String qwType) {
String accessToken = wxConfig.getReimbursementToken(restTemplate);
log.error("1拉取企业微信出差数据accessToken=" + accessToken);
log.debug("1拉取企业微信出差数据accessToken=" + accessToken);
JSONObject json = new JSONObject();
List<Map<String, String>> paramList = new ArrayList<>();
Map<String, String> paramMap = new HashMap<>();
......@@ -273,7 +280,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
headers.add("Accept", MediaType.APPLICATION_JSON.toString());
HttpEntity<String> formEntity = new HttpEntity<>(json.toString(), headers);
String dataResultList = restTemplate.postForEntity(SecurityConstants.WX_GET_APPROVAL_LIST, formEntity, String.class, accessToken).getBody();
log.error("1拉取企业微信出差数据dataResultList=" + dataResultList);
log.debug("1拉取企业微信出差数据dataResultList=" + dataResultList);
if (Common.isEmpty(dataResultList)) {
throw new AuthenticationServiceException("获取企业微信审批数据失败");
}
......@@ -328,7 +335,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
if (Common.isEmpty(appUrl)) {
return R.failed("获取HCM的appUrl失败!");
}
log.error("1拉取HCM出差数据sign=" + sign);
log.debug("1拉取HCM出差数据sign=" + sign);
HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
headers.setContentType(type);
......@@ -338,7 +345,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
// 线上地址 appUrl = "http://119.96.166.49:28950/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}"
// 测试地址 appUrl = "https://qas-hcm.yfzxtech.com:28950/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}"
String dataResultList = restTemplate.postForEntity(appUrl, formEntity, String.class, startTime, endTime).getBody();
log.error("1拉取HCM出差数据dataResultList=" + dataResultList);
log.debug("1拉取HCM出差数据dataResultList=" + dataResultList);
if (Common.isEmpty(dataResultList)) {
throw new AuthenticationServiceException("获取HCM出差数据失败");
}
......@@ -499,7 +506,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
String errmsg;
String info;
for (EkpQiwiZhaoPin r : list) {
log.error("企业微信招聘【" + i + "/" + "" + list.size() + "】条");
log.debug("企业微信招聘【" + i + "/" + "" + list.size() + "】条");
jsonDetail = new JSONObject();
jsonDetail.put("sp_no", r.getFdSpNo());
formEntityDetail = new HttpEntity<>(jsonDetail.toString(), headers);
......@@ -549,7 +556,7 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
String errmsg;
String info;
for (EkpQiwiChuchai r : list) {
log.error("企业微信出差【" + i + "/" + "" + list.size() + "】条");
log.info("企业微信出差【" + i + "/" + "" + list.size() + "】条");
jsonDetail = new JSONObject();
jsonDetail.put("sp_no", r.getFdSpNo());
formEntityDetail = new HttpEntity<>(jsonDetail.toString(), headers);
......@@ -1060,4 +1067,32 @@ public class QiWeiServiceImpl extends ServiceImpl<EkpQiweiChuchaiMapper, EkpQiwi
return null;
}
/**
* 获取HCM审批通过的加班数据并存储到EKP
* @param startDay 开始日期
* @param endDay 结束日期
* @author chenyuxi
* @since 1.9.6
* @date 2025-02-06
* @return R<List<EkpQiwiChuchai>>
**/
@Override
public synchronized R<List<EkpQiwiWorkovertime>> getHcmWorkOvertimeAndSave(String startDay, String endDay) {
try {
String startTime = startDay + START_TIME;
String endTime = endDay + END_TIME;
// 可存储的数据
List<EkpQiwiWorkovertime> saveCpList = ekpQiweiWorkovertimeService.saveWorkovertimeList(startTime, endTime);
return new R<>(saveCpList);
} catch (Exception e) {
e.printStackTrace();
log.error("拉取HCM审批通过的加班数据失败:", e);
return R.failed("拉取失败" + e.getMessage());
}
}
}
......@@ -29,4 +29,5 @@ spring:
hcm:
appId: 627673F79C6BAB92
appSecret: EA2641EF627673F79C6BAB9280137F00
appUrl: https://qas-hcm.yfzxtech.com:28950/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}
\ No newline at end of file
appUrl: https://qas-hcm.yfzxtech.com:28950/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}
appWorkOvertimeUrl: https://qas-hcm.yfzxtech.com:28950/api/v1/instance/overtime/list?startTime={startTime}&endTime={endTime}&flowName=项目加班流程
......@@ -29,4 +29,5 @@ spring:
hcm:
appId: b2475bbd0a7ef3f3
appSecret: C800A676B2475BBD0A7EF3F3C4265582
appUrl: https://hcm.yfzxtech.com/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}
\ No newline at end of file
appUrl: https://hcm.yfzxtech.com/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}
appWorkOvertimeUrl: https://hcm.yfzxtech.com/api/v1/instance/overtime/list?startTime={startTime}&endTime={endTime}&flowName=项目加班流程
......@@ -29,4 +29,5 @@ spring:
hcm:
appId: 627673F79C6BAB92
appSecret: EA2641EF627673F79C6BAB9280137F00
appUrl: https://qas-hcm.yfzxtech.com:28950/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}
\ No newline at end of file
appUrl: https://qas-hcm.yfzxtech.com:28950/api/v1/instance/business/list?startTime={startTime}&endTime={endTime}
appWorkOvertimeUrl: https://qas-hcm.yfzxtech.com:28950/api/v1/instance/overtime/list?startTime={startTime}&endTime={endTime}&flowName=项目加班流程
......@@ -54,5 +54,29 @@
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
<springProfile name="prd">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="dev">
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="debug">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
</configuration>
<?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.yifu.cloud.plus.v1.permission.mapper.EkpQiweiWorkovertimeMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.permission.entity.EkpQiwiWorkovertime">
<id property="fdId" column="fd_ID" />
<result property="fdSpNo" column="FD_SP_NO"/>
<result property="fdApplyUserName" column="FD_APPLY_USER_NAME"/>
<result property="fdApplyUserDept" column="FD_APPLY_USER_DEPT"/>
<result property="fdApplyDate" column="FD_APPLY_DATE"/>
<result property="fdWorkBegin" column="FD_WORK_BEGIN"/>
<result property="fdWorkEnd" column="FD_WORK_END"/>
<result property="fdReason" column="FD_REASON"/>
<result property="fdTimeUse" column="FD_TIME_USE"/>
<result property="fdPositionLevel" column="FD_POSITION_LEVEL"/>
<result property="fdProjectName" column="FD_PROJECT_NAME"/>
<result property="fdProjectCode" column="FD_PROJECT_CODE"/>
<result property="fdWorkDuration" column="FD_WORK_DURATION"/>
<result property="fdHolidayDuration" column="FD_HOLIDAY_DURATION"/>
<result property="fdRestDuration" column="FD_REST_DURATION"/>
<result property="fdSumDuration" column="FD_SUM_DURATION"/>
<result property="fdIsAway" column="FD_IS_AWAY"/>
<result property="fdOvertimePayStatus" column="FD_OVERTIME_PAY_STATUS"/>
<result property="fdOvertimePayId" column="FD_OVERTIME_PAY_ID"/>
<result property="fdOvertimePayCode" column="FD_OVERTIME_PAY_CODE"/>
<result property="fdOvertimeFoodStatus" column="FD_OVERTIME_FOOD_STATUS"/>
<result property="fdOvertimeFoodId" column="FD_OVERTIME_FOOD_ID"/>
<result property="fdOvertimeFoodCode" column="FD_OVERTIME_FOOD_CODE"/>
<result property="createTime" column="create_time"/>
<result property="orgData" column="org_data"/>
</resultMap>
<sql id="Base_Column_List">
a.FD_ID,
a.FD_SP_NO,
a.FD_APPLY_USER_NAME,
a.FD_APPLY_USER_DEPT,
a.FD_APPLY_DATE,
a.FD_WORK_BEGIN,
a.FD_WORK_END,
a.FD_REASON,
a.FD_TIME_USE,
a.FD_POSITION_LEVEL,
a.FD_PROJECT_NAME,
a.FD_PROJECT_CODE,
a.FD_WORK_DURATION,
a.FD_HOLIDAY_DURATION,
a.FD_REST_DURATION,
a.FD_SUM_DURATION,
a.FD_IS_AWAY,
a.FD_OVERTIME_PAY_STATUS,
a.FD_OVERTIME_PAY_ID,
a.FD_OVERTIME_PAY_CODE,
a.FD_OVERTIME_FOOD_STATUS,
a.FD_OVERTIME_FOOD_ID,
a.FD_OVERTIME_FOOD_CODE,
a.create_time,
a.org_data
</sql>
<!--获取全部的,用来: 拉取企业微信时,不覆盖数据 -->
<select id="getWorkovertimeMapByTimeRange" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM ekp_qiwei_workovertime a
<where>
a.FD_APPLY_DATE >= #{queryStartTime} and a.FD_APPLY_DATE <![CDATA[<=]]> #{queryEndTime}
</where>
</select>
</mapper>
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