Commit ae2679c9 authored by huyuchen's avatar huyuchen

Merge branch 'develop'

# Conflicts:
#	yifu-ekp/yifu-ekp-biz/src/main/resources/mapper/EkpShenhepeizhiMapper.xml
parents fffc2346 0ab73ad6
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
......@@ -79,6 +80,16 @@ public class TEmpBadRecord extends BaseEntity {
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 是否有不良记录 0 是 1 否
*/
@ExcelAttribute(name = "是否有不良记录" , isNotEmpty = true, errorInfo = "是否有不良记录不可为空",readConverterExp = "0=是,1=否")
@Schema(description ="是否有不良记录 0 是 1 否 ")
@HeadFontStyle(fontHeightInPoints = 11)
@ColumnWidth(20)
@ExcelProperty("是否有不良记录")
private String badRecordFlag;
/**
* 产生项目
*/
......@@ -138,6 +149,7 @@ public class TEmpBadRecord extends BaseEntity {
@ExcelProperty("其他损失")
private BigDecimal loseFeeOther;
/**
* 项目ID
*/
......@@ -154,13 +166,4 @@ public class TEmpBadRecord extends BaseEntity {
@ExcelIgnore
private String attaIds;
/**
* 是否曾经或正在追究与承担过刑事责任 0 是 1 否
*/
@ExcelAttribute(name = "是否曾经或正在追究与承担过刑事责任" , isNotEmpty = false,needExport = false, errorInfo = "是否曾经或正在追究与承担过刑事责任不可为空",readConverterExp = "0=是,1=否")
@Schema(description ="是否曾经或正在追究与承担过刑事责任 0 是 1 否 ")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否曾经或正在追究与承担过刑事责任")
@ExcelIgnore
private BigDecimal badRecordFlag;
}
......@@ -127,6 +127,13 @@ public class TEmpProfessionalQualification extends BaseEntity {
@Schema(description ="备注")
private String remark;
/**
* @author chenyuxi
* @since 1.9.6
**/
@Schema(description = "是否有职业资格证书0是/1否")
private String haveQualification;
/**
* @Author fxj
* @Description 附件ID
......
......@@ -147,4 +147,11 @@ public class TPreEmpBadRecord extends BaseEntity {
@Schema(description = "结算主体ID")
private String settleDomain;
/**
* @author chenyuxi
* @since 1.9.6
**/
@Schema(description = "是否曾经或正在追究与承担过刑事责任 0 是 1 否")
private String badRecordFlag;
}
......@@ -188,6 +188,13 @@ public class TPreEmpProfessionalQualification extends BaseEntity {
@Schema(description = "备注")
private String remark;
/**
* @author chenyuxi
* @since 1.9.6
**/
@Schema(description = "是否有职业资格证书0是/1否")
private String haveQualification;
/**
* @Description: 执业资格证书
* @Author: hgw
......
......@@ -23,7 +23,7 @@ public class EmpBadRecordVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" ,maxLength = 20)
@ExcelAttribute(name = "员工姓名" ,maxLength = 20, isNotEmpty = true)
@Schema(description ="员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
......@@ -48,7 +48,7 @@ public class EmpBadRecordVo extends RowIndex implements Serializable {
/**
* 项目编码
*/
@ExcelAttribute(name = "产生项目编码" ,maxLength = 50, isNotEmpty = true)
@ExcelAttribute(name = "产生项目编码" ,maxLength = 50)
@Schema(description ="产生项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("产生项目编码")
......@@ -57,7 +57,7 @@ public class EmpBadRecordVo extends RowIndex implements Serializable {
/**
* 发生时间
*/
@ExcelAttribute(name = "发生时间" , isNotEmpty = false)
@ExcelAttribute(name = "发生时间")
@Schema(description ="发生时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("发生时间")
......@@ -66,7 +66,7 @@ public class EmpBadRecordVo extends RowIndex implements Serializable {
/**
* 备注
*/
@ExcelAttribute(name = "不良记录描述", maxLength = 200, isNotEmpty = true)
@ExcelAttribute(name = "不良记录描述", maxLength = 200)
@Schema(description ="不良记录描述")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("不良记录描述")
......@@ -93,10 +93,10 @@ public class EmpBadRecordVo extends RowIndex implements Serializable {
/**
* 是否曾经或正在追究与承担过刑事责任 0 是 1 否
*/
@ExcelAttribute(name = "是否曾经或正在追究与承担过刑事责任" , isNotEmpty = false, errorInfo = "是否曾经或正在追究与承担过刑事责任不可为空",readConverterExp = "0=是,1=否")
@ExcelAttribute(name = "是否有不良记录" , isNotEmpty = true,readConverterExp = "0=是,1=否")
@Schema(description ="是否曾经或正在追究与承担过刑事责任 0 是 1 否 ")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否曾经或正在追究与承担过刑事责任")
private BigDecimal badRecordFlag;
@ExcelProperty("是否有不良记录")
private String badRecordFlag;
}
......@@ -42,8 +42,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 资格类型
*/
@ExcelAttribute(name = "职业资格名称",isNotEmpty = true,errorInfo = "职业资格名称不可为空",isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_TYPE)
@NotNull(message = "职业资格名称不可为空")
@ExcelAttribute(name = "职业资格名称",isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_TYPE)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="职业资格名称")
private String qualificationType;
......@@ -51,8 +50,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 资格等级
*/
@ExcelAttribute(name = "资格等级",isNotEmpty = false,errorInfo = "资格等级不可为空",isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_LEVEL)
@NotNull(message = "资格等级不可为空")
@ExcelAttribute(name = "资格等级",isDataId = true, dataType = ExcelAttributeConstants.QUALIFICATION_LEVEL)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="资格等级")
private String qualificationLevel;
......@@ -84,7 +82,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 申报年度
*/
@ExcelAttribute(name = "申报年度",isInteger = true,isNotEmpty = true,errorInfo = "申报年度不可为空")
@ExcelAttribute(name = "申报年度",isInteger = true)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="申报年度")
private String declareYear;
......@@ -92,8 +90,7 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
/**
* 是否最高资格0是/1否
*/
@ExcelAttribute(name = "是否最高资格",isNotEmpty = false,errorInfo = "是否最高资格不可为空",readConverterExp = "0=是,1=否")
@NotNull(message = "是否最高资格不可为空")
@ExcelAttribute(name = "是否最高资格",readConverterExp = "0=是,1=否")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="是否最高资格")
private String heightIdentification;
......@@ -105,4 +102,14 @@ public class EmpCertificateExcelVO extends RowIndex implements Serializable {
@ExcelProperty(value ="备注")
private String remark;
/**
* 是否有职业资格证书0是/1否
* @author chenyuxi
* @since mvp1.7.5
**/
@ExcelAttribute(name = "是否有职业资格证书",isNotEmpty = true,errorInfo = "是否有职业资格证书不可为空",readConverterExp = "0=是,1=否")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="是否有职业资格证书")
private String haveQualification;
}
......@@ -186,6 +186,12 @@ public class PreUploadEmpImportTwoVo implements Serializable {
private Date validityStartValue;
@ExcelAttribute(name = "身份证截止日期-值")
private Date validityEndValue;
@ExcelAttribute(name = "是否有不良记录", isDataId = true, readConverterExp = "0=是,1=否")
private String badRecordFlag;
@ExcelAttribute(name = "是否有职业资格证书", isDataId = true, readConverterExp = "0=是,1=否")
private String haveQualification;
// 字典值结束
@TableField(exist = false)
......
......@@ -12,6 +12,7 @@ public class EmployeeConstants {
public static final String VALIDITY_START = "身份证开始日期必填";
public static final String VALIDITY_END = "身份证截止日期必填";
public static final String VALIDITY_END_FORMAT = "身份证截止日期只能为日期格式:yyyy-MM-dd或者固定值:长期";
public static final String EMP_VALIDITY_END_START_DATE = "身份证截止日期不能小于等于身份证开始日期";
public static final String EMP_NATIONAL = "民族必填";
public static final String ID_PROVINCE = "户籍所在地必填";
public static final String FILE_PROVINCE = "档案所在地(省市)必填";
......
......@@ -112,7 +112,7 @@ public class TEmpBadRecordController {
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_tempbadrecord_edit')" )
public R<Boolean> updateById(@Valid @RequestBody TEmpBadRecord tEmpBadRecord) {
return R.ok(tEmpBadRecordService.updateById(tEmpBadRecord));
return tEmpBadRecordService.updateDiy(tEmpBadRecord);
}
/**
......
......@@ -58,4 +58,12 @@ public interface TEmpBadRecordService extends IService<TEmpBadRecord> {
List<TEmpBadRecord> getBadByIdCard(List<String> idList);
/**
* 编辑不良记录
*
* @author chenyuxi
* @since mvp1.7.5
*/
R<Boolean> updateDiy(TEmpBadRecord tEmpBadRecord);
}
......@@ -26,6 +26,7 @@ import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -53,6 +54,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
......@@ -150,6 +152,17 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个
EmpBadRecordVo excel = excelVOList.get(i);
// 【是否有不良记录】为是,项目编码和描述必填
if(CommonConstants.ZERO_STRING.equals(excel.getBadRecordFlag())){
if (Common.isEmpty(excel.getProjectCode())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),"产生项目编码_字段不可为空"));
continue;
}
if (Common.isEmpty(excel.getRemark())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),"不良记录描述_字段不可为空"));
continue;
}
}
/*if (Common.isEmpty(excel.getLoseFee()) && Common.isEmpty(excel.getLoseFeeOther())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_EMP_LOSE_FEE_NOT_EMPTY)));
continue;
......@@ -164,17 +177,27 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
continue;
}
excel.setEmpName(emp.getEmpName());
exist = projectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo,excel.getProjectCode())
.eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getEmpIdcard,excel.getEmpIdcard())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(exist)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_EMP_NOT_EXIST)));
continue;
// mvp1.7.6-chenyuxi:有不良记录,再获取项目信息
if(CommonConstants.ZERO_STRING.equals(excel.getBadRecordFlag())){
if (Common.isEmpty(excel.getProjectCode())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_EMP_NOT_EXIST)));
continue;
}
exist = projectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo,excel.getProjectCode())
.eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getEmpIdcard,excel.getEmpIdcard())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(exist)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_EMP_NOT_EXIST)));
continue;
}
excel.setProjectCode(exist.getDeptNo());
excel.setProject(exist.getDeptName());
} else {
excel.setRemark("未曾经或正在追究与承担过刑事责任");
}
excel.setProjectCode(exist.getDeptNo());
excel.setProject(exist.getDeptName());
// 数据合法情况
insertExcel(excel,emp);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),CommonConstants.SAVE_SUCCESS));
......@@ -199,6 +222,15 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
insert.setEmpId(emp.getId());
insert.setEmpId(emp.getId());
insert.setSettleDomain(emp.getDeptId());
// mvp1.7.6-chenyuxi:无不良记录,置空部分信息
if(CommonConstants.ONE_STRING.equals(excel.getBadRecordFlag())) {
insert.setProjectCode(null);
insert.setProject(null);
insert.setHappenTime(null);
insert.setLoseFee(null);
insert.setLoseFeeOther(null);
}
this.save(insert);
}
......@@ -316,6 +348,10 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
if (Common.isNotNull(entity.getCreateName())){
wrapper.eq(TEmpBadRecord::getCreateName,entity.getCreateName());
}
// 1.9.6 加【是否有不良记录】标识查询
if (Common.isNotNull(entity.getBadRecordFlag())){
wrapper.eq(TEmpBadRecord::getBadRecordFlag,entity.getBadRecordFlag());
}
return wrapper;
}
......@@ -323,4 +359,24 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
public List<TEmpBadRecord> getBadByIdCard(List<String> idList) {
return baseMapper.getBadByIdCard(idList);
}
@Override
public R<Boolean> updateDiy(TEmpBadRecord tEmpBadRecord) {
if(CommonConstants.ONE_STRING.equals(tEmpBadRecord.getBadRecordFlag())){
LambdaUpdateWrapper<TEmpBadRecord> updateDiyInfoWrapper = new LambdaUpdateWrapper<>();
updateDiyInfoWrapper.eq(TEmpBadRecord::getId, tEmpBadRecord.getId())
.set(TEmpBadRecord::getBadRecordFlag, tEmpBadRecord.getBadRecordFlag())
.set(TEmpBadRecord::getRemark, tEmpBadRecord.getRemark())
.set(TEmpBadRecord::getHappenTime, null)
.set(TEmpBadRecord::getLoseFee, null)
.set(TEmpBadRecord::getLoseFeeOther, null)
.set(TEmpBadRecord::getProject, null)
.set(TEmpBadRecord::getProjectCode, null)
.set(TEmpBadRecord::getUpdateTime, LocalDateTime.now());
this.update(null, updateDiyInfoWrapper);
return R.ok(true);
}
return R.ok(this.updateById(tEmpBadRecord));
}
}
......@@ -24,10 +24,12 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpProfessionalQualification;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
......@@ -45,6 +47,7 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -111,6 +114,17 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
for (int i = 0; i < excelVOList.size(); i++) {
// 已有验证报错直接下一个
EmpCertificateExcelVO excel = excelVOList.get(i);
// 【是否有职业资格证书】为是,申报年度和职业资格名称必填
if(CommonConstants.ZERO_STRING.equals(excel.getHaveQualification())){
if (Common.isEmpty(excel.getDeclareYear())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),"申报年度_字段不可为空"));
continue;
}
if (Common.isEmpty(excel.getQualificationType())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),"职业资格名称_字段不可为空"));
continue;
}
}
if (Common.isNotNull(excel.getDeclareYear()) &&
Integer.parseInt(excel.getDeclareYear()) > DateUtil.getYearOfInt(new Date())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_CERTIFICATE_DECLARE_YEAR_ERROR)));
......@@ -151,6 +165,19 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
insert.setEmpCode(emp.getEmpCode());
insert.setEmpId(emp.getId());
insert.setSettleDomain(emp.getDeptId());
// mvp1.7.6-chenyuxi:无职业资格,置空部分信息
if(CommonConstants.ONE_STRING.equals(excel.getHaveQualification())) {
insert.setDeclareYear(null);
insert.setAssessmentUnit(null);
insert.setCertificationNo(null);
insert.setObtainType(null);
insert.setQualificationLevel(null);
insert.setQualificationType(null);
insert.setHeightIdentification(null);
insert.setRemark(null);
}
this.save(insert);
}
private ErrorMessage checkRes(List<TEmpProfessionalQualification> list, TEmployeeInfo emp, EmpCertificateExcelVO excel) {
......@@ -160,7 +187,7 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
if (CommonConstants.ONE_STRING.equals(Integer.toString(emp.getFileStatus()))){
return new ErrorMessage(excel.getRowIndex(),MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_REDUCED));
}
if (Common.isNotNull(list)){
if (Common.isNotNull(list) && CommonConstants.ZERO_STRING.equals(excel.getHaveQualification())){
// 检查添加是否已经存在
boolean match = list.stream().anyMatch(info ->
((Common.isEmpty(excel.getQualificationLevel()) && Common.isNotNull(info.getQualificationLevel()))
......@@ -261,6 +288,27 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
if (Common.isNotNull(exist)){
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_EMP_CERTIFICATE_NAME_EXISTING));
}
if(CommonConstants.ONE_STRING.equals(qualification.getHaveQualification())){
LambdaUpdateWrapper<TEmpProfessionalQualification> updateDiyInfoWrapper = new LambdaUpdateWrapper<>();
updateDiyInfoWrapper.eq(TEmpProfessionalQualification::getId, qualification.getId())
.set(TEmpProfessionalQualification::getHaveQualification, qualification.getHaveQualification())
.set(TEmpProfessionalQualification::getRemark, null)
.set(TEmpProfessionalQualification::getQualificationType, null)
.set(TEmpProfessionalQualification::getQualificationLevel, null)
.set(TEmpProfessionalQualification::getCertificationNo, null)
.set(TEmpProfessionalQualification::getObtainType, null)
.set(TEmpProfessionalQualification::getAssessmentUnit, null)
.set(TEmpProfessionalQualification::getDeclareYear, null)
.set(TEmpProfessionalQualification::getHeightIdentification, null)
.set(TEmpProfessionalQualification::getUpdateTime, LocalDateTime.now());
this.update(null, updateDiyInfoWrapper);
// 清除执业资格证书附件
attaInfoMapper.deleteByDomainIdAndType(qualification.getId(),"2");
return R.ok(true);
}
int res = baseMapper.updateById(qualification);
if (res < 0){
return R.failed();
......@@ -285,6 +333,10 @@ public class TEmpProfessionalQualificationServiceImpl extends ServiceImpl<TEmpPr
if (Common.isNotNull(entity.getCreateName())){
wrapper.eq(TEmpProfessionalQualification::getCreateName,entity.getCreateName());
}
// 1.9.6 加【是否有职业资格证书】标识查询
if (Common.isNotNull(entity.getHaveQualification())){
wrapper.eq(TEmpProfessionalQualification::getHaveQualification,entity.getHaveQualification());
}
return wrapper;
}
......
......@@ -27,6 +27,7 @@ import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -35,6 +36,7 @@ import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.vo.CheckBatchVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesExportLimitMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TArchivesLimitMapper;
......@@ -1466,7 +1468,32 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
tPreEmpBadRecordService.saveOrUpdate(tPreEmpBadRecord);
// todo 1.9.6 -chenyuxi:先根据备注文字判断
if(Common.isNotNull(tPreEmpBadRecord.getRemark())){
if(tPreEmpBadRecord.getRemark().contains("未曾经")){
tPreEmpBadRecord.setBadRecordFlag(CommonConstants.ONE_STRING);
} else {
tPreEmpBadRecord.setBadRecordFlag(CommonConstants.ZERO_STRING);
}
}
// 1.9.6 -chenyuxi: 新增和编辑分开,允许存null值
// 新增不良记录
if(Common.isEmpty(tPreEmpBadRecord.getId())){
tPreEmpBadRecordService.saveOrUpdate(tPreEmpBadRecord);
} else {
// 编辑不良记录
LambdaUpdateWrapper<TPreEmpBadRecord> updateDiyInfoWrapper = new LambdaUpdateWrapper<>();
updateDiyInfoWrapper.eq(TPreEmpBadRecord::getId, tPreEmpBadRecord.getId())
.set(TPreEmpBadRecord::getBadRecordFlag, tPreEmpBadRecord.getBadRecordFlag())
.set(TPreEmpBadRecord::getRemark, tPreEmpBadRecord.getRemark())
.set(TPreEmpBadRecord::getHappenTime, null)
.set(TPreEmpBadRecord::getLoseFee, null)
.set(TPreEmpBadRecord::getLoseFeeOther, null)
.set(TPreEmpBadRecord::getUpdateBy, user.getId())
.set(TPreEmpBadRecord::getUpdateTime, LocalDateTime.now());
tPreEmpBadRecordService.update(null, updateDiyInfoWrapper);
}
}
// 预入职-紧急联络人
TPreEmpContactInfo tPreEmpContactInfo = vo.getTpreEmpContactInfo();
......@@ -1566,7 +1593,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
// 预入职-员工职业资格信息表
List<TPreEmpProfessionalQualification> tPreEmpProfessionalQualification = vo.getTpreEmpProfessionalQualificationList();
if (tPreEmpProfessionalQualification != null) {
if (tPreEmpProfessionalQualification != null && tPreEmpProfessionalQualification.size()>0) {
// 先删除后增加
tPreEmpProfessionalService.deleteProfessionalByMainId(mainId);
for (TPreEmpProfessionalQualification info : tPreEmpProfessionalQualification) {
......@@ -1575,6 +1602,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
info.setCreateBy(user.getId());
info.setCreateName(user.getNickname());
info.setCreateTime(LocalDateTime.now());
// 1.9.6 -chenyuxi:增加标识
info.setHaveQualification(CommonConstants.ZERO_STRING);
tPreEmpProfessionalService.saveOrUpdate(info);
// 附件
if (info.getAttaList() != null && !info.getAttaList().isEmpty()) {
......@@ -3466,6 +3495,14 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
} else {
detail.setErrorInfo("身份证号不存在!");
}
// 身份证起止有效期 都有值 且 截止日期正常
if (Common.isNotNull(detail.getValidityStart())
&& Common.isNotNull(detail.getValidityEnd())
&& !"长期".equals(detail.getValidityEnd())
&& !DateUtil.stringToDate(detail.getValidityEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT)
.after(DateUtil.stringToDate(detail.getValidityStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT))){
detail.setErrorInfo(EmployeeConstants.EMP_VALIDITY_END_START_DATE);
}
excelList.add(detail);
}
......@@ -3852,14 +3889,22 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpBadRecord.setSettleDomain(deptId);
tPreEmpBadRecord.setProject(dept.getDepartName());
tPreEmpBadRecord.setProjectCode(dept.getDepartNo());
tPreEmpBadRecord.setEmpName(main.getEmpName());
tPreEmpBadRecord.setEmpId(empId);
tPreEmpBadRecord.setEmpIdcard(empIdCard);
tPreEmpBadRecord.setCreateBy(user.getId());
tPreEmpBadRecord.setCreateName(user.getNickname());
tPreEmpBadRecord.setCreateTime(LocalDateTime.now());
if ("是".equals(info.getRemark())) {
// 有不良记录,存项目信息
tPreEmpBadRecord.setRemark("曾经或正在追究与承担过刑事责任");
// 1.9.6-chenyuxi: 记录不良记录标识
tPreEmpBadRecord.setBadRecordFlag(CommonConstants.ZERO_STRING);
} else {
tPreEmpBadRecord.setRemark("未曾经或正在追究与承担过刑事责任");
// 1.9.6-chenyuxi: 记录不良记录标识
tPreEmpBadRecord.setBadRecordFlag(CommonConstants.ONE_STRING);
}
preEmpBadRecordList.add(tPreEmpBadRecord);
......@@ -3995,6 +4040,8 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
// 是否有职业资格证书 申报年度 职业资格名称
tPreEmpProfessionalQualification.setDeclareYear(info.getDeclareYearValue());
tPreEmpProfessionalQualification.setQualificationType(info.getQualificationTypeValue());
// 1.9.6-chenyuxi:增加标识
tPreEmpProfessionalQualification.setHaveQualification(CommonConstants.ZERO_STRING);
preEmpProfessionalQualificationList.add(tPreEmpProfessionalQualification);
}
}
......
......@@ -44,6 +44,7 @@
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="remark" column="REMARK"/>
<result property="haveQualification" column="HAVE_QUALIFICATION"/>
</resultMap>
<!--删除-->
<delete id="deleteProfessionalByEmpId">
......
......@@ -42,6 +42,7 @@
<result property="updateTime" column="UPDATE_TIME"/>
<result property="settleDomain" column="SETTLE_DOMAIN"/>
<result property="oldId" column="OLD_ID"/>
<result property="badRecordFlag" column="BAD_RECORD_FLAG"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -61,7 +62,8 @@
a.CREATE_TIME,
a.UPDATE_TIME,
a.OLD_ID,
a.SETTLE_DOMAIN
a.SETTLE_DOMAIN,
a.BAD_RECORD_FLAG
</sql>
<sql id="tPreEmpBadRecord_where">
<if test="tPreEmpBadRecord != null">
......
......@@ -46,6 +46,7 @@
<result property="updateTime" column="UPDATE_TIME"/>
<result property="remark" column="REMARK"/>
<result property="oldId" column="OLD_ID"/>
<result property="haveQualification" column="HAVE_QUALIFICATION"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -69,7 +70,8 @@
a.CREATE_TIME,
a.UPDATE_TIME,
a.OLD_ID,
a.REMARK
a.REMARK,
a.HAVE_QUALIFICATION
</sql>
<sql id="tPreEmpProfessionalQualification_where">
<if test="tPreEmpProfessionalQualification != null">
......
......@@ -363,7 +363,7 @@ public interface CommonConstants {
public static final String JAR_TYPE = "jar";
int BATCH_COUNT = 100;
int BATCH_COUNT1 = 2000;
String IMPORT_DATA_ANALYSIS_ERROR = "数据导入解析异常,请检查表数据格式(常见错误:1.日期格式:yyyy-MM-dd,2.比例为整数且不含%)";
String IMPORT_DATA_ANALYSIS_ERROR = "数据导入解析异常,请检查表数据格式(常见错误:1.日期格式:yyyy-MM-dd,2.比例为整数且不含%,3涉及金额相关的只能填数字)";
String IMPORT_DATA_ANALYSIS_ERROR_TWO = "数据导入解析异常,请检查表数据格式";
String CREATE_TIME = "CREATE_TIME";
......
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.common.mybatis.base;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
......@@ -50,6 +51,7 @@ public class BaseEntity implements Serializable {
@TableField(fill = FieldFill.INSERT)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
@ColumnWidth(18)
private LocalDateTime createTime;
/**
......
......@@ -200,6 +200,9 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
bizContent.setEndId(endId);
request.setBizContent(bizContent);
try {
// 请求报文:下次改 appBatserialno 即可
//{"bizContent":{"appBatserialno":"WX1737440304440","appId":"11000000000000028685","endId":"1","outVendorId":"020101190","startId":"0","type":"2"},"bizContentClass":"com.icbc.api.request.JftApiPayrollQueryDetailRequestV1$JftApiPayrollQueryDetailRequestV1Biz","extraParameters":{},"method":"POST","needEncrypt":false,"responseClass":"com.icbc.api.response.JftApiPayrollQueryDetailResponseV1","serviceUrl":"https://gw.open.icbc.com.cn/api/jft/api/payroll/querydetail/V1"}
JftApiPayrollQueryDetailResponseV1 responseV1 = client.execute(request);
if (Common.isNotNull(responseV1)) {
return responseV1;
......
# 数据源配置
spring:
shardingsphere:
datasource:
ds0:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.122:33306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: root
password: ll_mysql
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
pool-name: AmytangHikariCP
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
names: ds0
rules:
sharding:
key-generators:
snowflake:
type: SNOWFLAKE
sharding-algorithms:
t-payment-inline:
props:
strategy: standard
algorithmClassName: com.yifu.cloud.plus.v1.ekp.config.OTAStrategyShardingAlgorithm
type: CLASS_BASED
tables:
ekp_social_info:
actual-data-nodes: ds0.ekp_social_info_20$->{23..24}
key-generate-strategy:
column: fd_id
key-generator-name: snowflake
table-strategy:
standard:
sharding-column: fd_3adfe8cb96c41e
sharding-algorithm-name: t-payment-inline
mvc:
pathmatch:
matching-strategy: ant_path_matcher
......@@ -50,6 +8,24 @@ spring:
on-profile: dev
redis:
host: 127.0.0.1
port: 6379
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: ll_mysql
url: jdbc:mysql://192.168.1.122:33306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
## spring security 配置
security:
oauth2:
......@@ -64,7 +40,9 @@ security:
- /swagger-ui/**
entry:
entryUrl: http://36.7.147.29:27007/api/hro/modelingWebservice/addModel
entryFdModelId: 18050b5cee8b79c234bf64d412294f23
entryUrl: http://36.7.147.29:27007/api/sys-modeling/appModelRestService/addModel
entryFdModelId: 18050b5cee8b7f8e56879448e4f23aad
entryFdFlowId: 191919ae533d080b60e6e784c55a3c8b
entryDocStatus: 20
entryLoginName: admin
entryDocSubject: 入账明细推送ekp接口
\ No newline at end of file
......@@ -14,7 +14,7 @@
and a.fd_shiyebu = #{division}
</select>
<!--查询副总信息-->
<!--查询项目信息-->
<select id="getFuLoginNameList" resultType="string">
select fu.fd_login_name as loginName
from ekp_shenhepeizhi_table a
......@@ -24,7 +24,7 @@
and a.fd_shiyebu = #{division}
</select>
<!--查询事业部条线负责人-->
<!--查询项目信息-->
<select id="getLineLoginNameList" resultType="string">
select lu.fd_login_name as loginName
from ekp_shenhepeizhi_table a
......
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 = "项目编码")
private String fd_3adfe658c6229e;
@Schema(description = "项目名称")
private String fd_3adfe6592b4158;
@Schema(description = "单号")
private String fd_3adfe67a9f6364;
@Schema(description = "客户编码")
private String fd_3adfe6598281e8;
@Schema(description = "客户名称")
private String fd_3adfe7a2688902;
@Schema(description = "发生日期")
private Date fd_3adfe67c24dace;
@Schema(description = "姓名")
private String fd_3adfe65d759650;
@Schema(description = "身份证号")
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 = "医保")
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 = "收入结算单号")
private String fd_3adfe79fd04606;
@Schema(description = "收款认领单号")
private String fd_3adfe7a117f086;
@Schema(description = "应支出")
private Double fd_3adfe6e3911ffe;
@Schema(description = "支出结算状态")
private String fd_3adfe6eda67236;
@Schema(description = "付款状态")
private String fd_3adfe6f05531ec;
@Schema(description = "支出结算单号")
private String fd_3adfe7a035849c;
@Schema(description = "付款单号")
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 = "预估金额已收")
private Double fd_3af9d1662141a4;
@Schema(description = "商险ID")
private String fd_3b0a5743acab7e;
@Schema(description = "HRO结算月")
private Date fd_3b13b3076af5a0;
@Schema(description = "是否全部结算")
private String fd_3b13b2ecc164aa;
@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 = "派单客服姓名")
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);
//查询不为未结算的商险记录
List<EkpInsurancesInfo> getEkpInsurancesInfoNotSettle(@Param("detailId") String detailId);
//查询未结算的商险记录
List<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);
......
......@@ -6,17 +6,16 @@ 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.R;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettle;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsuranceEkpMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.ekp.EkpSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceEkpService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceSettleService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.DoJointInsuranceTask;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInteractiveParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.SettleVo;
import lombok.extern.slf4j.Slf4j;
......@@ -40,18 +39,15 @@ import java.util.List;
public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, TInsuranceEkp> implements TInsuranceEkpService {
@Resource
EkpInsuranceUtil ekpInsuranceUtil;
@Lazy
private DoJointInsuranceTask doJointInsuranceTask;
@Resource
TInsuranceSettleService tInsuranceSettleService;
@Resource
@Lazy
TInsuranceDetailService tInsuranceDetailService;
@Resource
@Lazy
EkpSettleService ekpSettleService;
TInsuranceDetailService tInsuranceDetailService;
@Override
public R resend() {
......@@ -113,7 +109,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
} else{
ekpParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
ekpParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
settleUpdate.set(TInsuranceSettle :: getEstimatePushTime,LocalDateTime.now())
.set(TInsuranceSettle ::getIsEstimatePush,CommonConstants.ONE_INT);
......@@ -145,7 +141,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
}else{
ekpParam.setInteractiveType(InsurancesConstants.NEW_SETTLE_BILL);
ekpParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
settleUpdate.set(TInsuranceSettle :: getActualPushTime,LocalDateTime.now())
.set(TInsuranceSettle ::getIsActualPush,CommonConstants.ONE_INT);
......@@ -187,7 +183,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
}else{
ekpParam.setInteractiveType(InsurancesConstants.UPDATE_SETTLE_BILL);
ekpParam.setSettleType(CommonConstants.EMPTY_STRING);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
ekpUpdate.set(TInsuranceEkp :: getResendFlag ,CommonConstants.ONE_INT)
.set(TInsuranceEkp :: getPushTime ,LocalDateTime.now());
......@@ -203,7 +199,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
if(eStatus && aStatus){
ekpParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
ekpParam.setInteractiveType(InsurancesConstants.ABOLISH_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
ekpUpdate.set(TInsuranceEkp :: getResendFlag ,CommonConstants.ONE_INT)
.set(TInsuranceEkp :: getPushTime ,LocalDateTime.now());
......@@ -219,7 +215,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
BigDecimal estimatePremium = ekpParam.getEstimatePremium();
ekpParam.setEstimatePremium(estimatePremium.negate());
ekpParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
ekpUpdate.set(TInsuranceEkp :: getResendFlag ,CommonConstants.ONE_INT)
.set(TInsuranceEkp :: getPushTime ,LocalDateTime.now());
......@@ -233,7 +229,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
ekpParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
BigDecimal actualPremium = ekpParam.getActualPremium();
ekpParam.setActualPremium(actualPremium.negate());
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
ekpUpdate.set(TInsuranceEkp :: getResendFlag ,CommonConstants.ONE_INT)
.set(TInsuranceEkp :: getPushTime ,LocalDateTime.now());
......@@ -248,7 +244,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
if(CommonConstants.FIVE_INT == pushType){
ekpParam.setSettleType(InsurancesConstants.ESTIMATE_SETTLE_BILL);
ekpParam.setInteractiveType(InsurancesConstants.CORRECT_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
ekpUpdate.set(TInsuranceEkp :: getResendFlag ,CommonConstants.ONE_INT)
.set(TInsuranceEkp :: getPushTime ,LocalDateTime.now());
......@@ -261,7 +257,7 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
if(CommonConstants.SIX_INT == pushType){
ekpParam.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
ekpParam.setInteractiveType(InsurancesConstants.CORRECT_SETTLE_BILL);
s = ekpInsuranceUtil.sendToEkp(ekpParam);
s = doJointInsuranceTask.insertInsrancesDetail(ekpParam);
if(StringUtils.isNotBlank(s)){
ekpUpdate.set(TInsuranceEkp :: getResendFlag ,CommonConstants.ONE_INT)
.set(TInsuranceEkp :: getPushTime ,LocalDateTime.now());
......
<?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_3b13b3076af5a0" column="fd_3b13b3076af5a0"/>
<result property="fd_3b13b2ecc164aa" column="fd_3b13b2ecc164aa"/>
<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}
</select>
<select id="getEkpInsurancesInfoSettle" resultMap="ekpInsurancesInfoMap">
SELECT
*
FROM ekp_insurances_info a
where fd_3adfe6eda67236 = '未结算'
and fd_3b0a5743acab7e = #{detailId}
</select>
</mapper>
......@@ -50,27 +50,31 @@
<select id="getSettle" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
fd_id,
fd_3b0a5743acab7e as fd_3b05ba46bb042e,
MAX(case when fd_3adfe6af71a1cc = '预估' THEN fd_3adfe6ec6a8cbe END) AS fd_3b05ba4808a3ca,
MAX(case when fd_3adfe6af71a1cc = '实缴' THEN fd_3adfe6ec6a8cbe END) AS fd_3b05bd5ed0b976
from
ekp_f80727b647a403b975ae
ekp_insurances_info
where
fd_3b05ba46bb042e = #{id}
fd_3b0a5743acab7e = #{id}
group by fd_3b0a5743acab7e
</select>
<select id="getSettleStatusFromEkpInsuranceDetail" resultType="java.lang.String">
select
fd_3adfe6ec6a8cbe
from
ekp_e96a0a28442447c81ec0
ekp_insurances_info
where
fd_3b0a5743acab7e = #{id} limit 1
fd_3b0a5743acab7e = #{id} and fd_3adfe6af71a1cc = '实缴' limit 1
</select>
<select id="getDeptSettle" resultMap="BaseDeptResultMap">
select
<include refid="Base_Column_Dept"></include>
from
ekp_e96a0a28442447c81ec0
ekp_insurances_info
where
fd_3b0a5743acab7e = #{id} and fd_3adfe6af71a1cc = '实缴' limit 1
</select>
......@@ -79,7 +83,7 @@
select
<include refid="Base_Column_Dept"></include>
from
ekp_e96a0a28442447c81ec0
ekp_insurances_info
where
fd_3b0a5743acab7e = #{id} and fd_3adfe6af71a1cc = '预估' limit 1
</select>
......@@ -191,6 +195,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_3b1480c328d7b2_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;
}
......@@ -169,4 +169,17 @@ public class SysMenu extends BaseEntity {
@Schema(description = "税务主体字段ID")
private String taxId;
/**
* 事业部权限id
*/
@Schema(description = "事业部权限id")
private String divisionId;
/**
* 事业部条线权限id
*/
@Schema(description = "事业部条线权限id")
private String divisionLineId;
}
......@@ -81,13 +81,13 @@ public class SysRoleInfo extends BaseEntity {
@Schema(description = "删除状态图:0:正常;1:删除")
private Integer deleteFlag;
/**
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;
*/
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能为空", maxLength = 50)
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能超过50个字符")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)不能为空", maxLength = 50)
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)不能超过50个字符")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)")
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)")
private String dataAuth;
}
......@@ -53,7 +53,7 @@ public class SysUserPermission extends BaseEntity {
/**
* 权限类型 客户、商机、报价单、
* 1客户权限;2商机;3报价单;4合同;5项目;6BU;7条线;8部门;9收入归属;10二级指标归属;11税务主体
* 1客户权限;2商机;3报价单;4合同;5项目;6BU;7条线;8部门;9收入归属;10二级指标归属;11(实际配置为12,历史原因)税务主体 13 事业部 14 事业部条线
*/
@Schema(description = "权限类型")
private String permissionType;
......
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 税务主体
* @author hgw
* @date 2024-1-10 18:05:30
*/
@Data
public class SysDivisionLineVo implements Serializable {
/**
* 名称
*/
@Schema(description = "名称")
private String name;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 税务主体
* @author hgw
* @date 2024-1-10 18:05:30
*/
@Data
public class SysDivisionVo implements Serializable {
/**
* 名称
*/
@Schema(description = "名称")
private String name;
}
\ No newline at end of file
......@@ -160,4 +160,22 @@ public class SysMenuVo extends RowIndex implements Serializable {
@ExcelProperty("部门权限id")
private String deptId;
/**
* 事业部权限id
*/
@Schema(description = "事业部权限id")
@Length(max = 20, message = "事业部权限id 不能超过20 个字符")
@ExcelAttribute(name = "事业部权限id", maxLength = 20)
@ExcelProperty("事业部权限id")
private String divisionId;
/**
* 事业部条线权限id
*/
@Schema(description = "事业部条线权限id")
@Length(max = 20, message = "事业部条线权限id 不能超过20 个字符")
@ExcelAttribute(name = "事业部条线权限id", maxLength = 20)
@ExcelProperty("事业部条线权限id")
private String divisionLineId;
}
......@@ -81,13 +81,13 @@ public class SysRoleInfoVo extends RowIndex implements Serializable {
@ExcelProperty("删除状态图:0:正常;1:删除")
private Integer deleteFlag;
/**
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)
* 数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;
*/
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能超过50 个字符")
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能为空", maxLength = 50)
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;)")
@NotBlank(message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;) 不能为空")
@Length(max = 50, message = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;) 不能超过50 个字符")
@ExcelAttribute(name = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)", isNotEmpty = true, errorInfo = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;) 不能为空", maxLength = 50)
@Schema(description = "数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)")
@ExcelProperty("数据权限(全量0;部分全量1;数据权限2;客户a;商机b;报价单c;合同d;项目e;BUf;条线g;收入归属h;事业部i;事业部条线j;)")
private String dataAuth;
/**
* 创建人id
......
......@@ -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();
}
}
......@@ -6,6 +6,8 @@ import com.yifu.cloud.plus.v1.permission.service.SysMenuService;
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.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionLineVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysTaxVo;
import io.swagger.v3.oas.annotations.Operation;
......@@ -14,6 +16,8 @@ import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 新权限-菜单表
......@@ -107,5 +111,28 @@ public class SysMenuController {
public R<IPage<SysTaxVo>> getSysTaxVoPage(Page<SysTaxVo> page, SysTaxVo vo) {
return new R<>(sysMenuService.getSysTaxVoPage(page, vo));
}
/**
* @Author fxj
* @Description 获取“事业部”信息
* @Date 9:52 2025/2/5
* @Param
* @return
**/
@Operation(description = "获取事业部信息")
@GetMapping("/getDivisions")
public R<List<SysDivisionVo>> getDivisions(Page<SysMenu> page, SysMenuSearchVo sysMenu) {
return new R<>(sysMenuService.getDivisions());
}
/**
* @Author fxj
* @Description 获取“事业部条线”信息
* @Date 9:52 2025/2/5
* @Param
* @return
**/
@Operation(description = "获取事业部条线信息")
@GetMapping("/getDivisionLines")
public R<List<SysDivisionLineVo>> getDivisionLines(Page<SysMenu> page, SysMenuSearchVo sysMenu) {
return new R<>(sysMenuService.getDivisionLines());
}
}
......@@ -19,11 +19,14 @@ public interface EkpQiweiChuchaiMapper extends BaseMapper<EkpQiwiChuchai> {
/**
* @param status 状态
* @Description: 获取全部的列表,用来: 拉取企业微信时,不覆盖数据
* 1.9.6版本优化:只查找:已被拉取的90天内的数据Map(定时任务最多拉取30天内的,手动执行是当天的。所以比对90天内的查重足够了。查全部数据对IO是浪费的)
* 用来: 拉取企E人事出差数据时,不覆盖数据
* @Author: hgw
* @Date: 2021/7/28 18:05
* @return: java.util.List<com.yifu.cloud.v1.hrms.api.entity.salary.TStatisticsProjectReimburse>
**/
List<EkpQiwiChuchai> getAllInfo(@Param("status") String status);
List<EkpQiwiChuchai> getAllInfo(@Param("status") String status,
@Param("queryStartTime") String queryStartTime,@Param("queryEndTime") String queryEndTime);
List<QiWeiUserVo> getQiYeWeiXinUserList();
}
......
/*
* 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);
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionLineVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysTaxVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -63,4 +65,8 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
* @return: com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu
**/
SysMenu getSysMenuByModelId(@Param("modelId") String modelId);
List<SysDivisionVo> getDivisions();
List<SysDivisionLineVo> getDivisionLines();
}
......@@ -230,5 +230,8 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
void deleteUserPermissionByIdAndType(@Param("code") String code, @Param("permissionType") String permissionType);
Integer selectDivitionCount(@Param("name")String name);
Integer selectDivitionLineCount(@Param("name")String name);
}
/*
* 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);
}
......@@ -5,9 +5,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionLineVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysTaxVo;
import java.util.List;
/**
* 新权限-菜单表
*
......@@ -44,4 +48,8 @@ public interface SysMenuService extends IService<SysMenu> {
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.permission.vo.SysTaxVo>
**/
IPage<SysTaxVo> getSysTaxVoPage(Page<SysTaxVo> page, SysTaxVo vo);
List<SysDivisionVo> getDivisions();
List<SysDivisionLineVo> getDivisionLines();
}
/*
* 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);
}
}
}
}
......@@ -10,6 +10,8 @@ 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.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysMenu;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionLineVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysMenuSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysTaxVo;
import lombok.RequiredArgsConstructor;
......@@ -159,5 +161,26 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
return false;
}
}
/**
* @Author fxj
* @Description 获取“事业部”信息
* @Date 9:50 2025/2/5
* @Param
* @return
**/
@Override
public List<SysDivisionVo> getDivisions() {
return baseMapper.getDivisions();
}
/**
* @Author fxj
* @Description 获取“事业部条线”信息
* @Date 9:50 2025/2/5
* @Param
* @return
**/
@Override
public List<SysDivisionLineVo> getDivisionLines() {
return baseMapper.getDivisionLines();
}
}
......@@ -73,7 +73,9 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
if (CommonConstants.SIX_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.SEVEN_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.TEN_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.TWELVE_STRING.equals(sysUserPermission.getPermissionType())) {
|| CommonConstants.TWELVE_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.THIRTEEN_STRING.equals(sysUserPermission.getPermissionType())
|| CommonConstants.FOURTEEN_STRING.equals(sysUserPermission.getPermissionType())) {
permission = this.getOne(Wrappers.<SysUserPermission>query().lambda()
.eq(SysUserPermission::getEmpLoginName, sysUserPermission.getEmpLoginName())
.eq(SysUserPermission::getPermissionType, sysUserPermission.getPermissionType())
......@@ -168,8 +170,10 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
} else if (CommonConstants.TEN_STRING.equals(searchVo.getType()) ) {
//二级指标归属权限
iPage = baseMapper.selectTwoGsVO(page, searchVo.getName());
} else if (CommonConstants.TWELVE_STRING.equals(searchVo.getType()) ) {
//税务主体
} else if (CommonConstants.TWELVE_STRING.equals(searchVo.getType())
||CommonConstants.THIRTEEN_STRING.equals(searchVo.getType())
||CommonConstants.FOURTEEN_STRING.equals(searchVo.getType()) ) {
//税务主体|事业部|事业部条线
iPage = baseMapper.selectTaxVO(page, searchVo.getName());
} else {
//项目权限
......@@ -315,7 +319,9 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType()) ||
CommonConstants.SEVEN_STRING.equals(insert.getPermissionType()) ||
CommonConstants.TEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())) {
|| CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())
|| CommonConstants.THIRTEEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.FOURTEEN_STRING.equals(insert.getPermissionType())) {
flag.append(excel.getName());
} else {
flag.append(excel.getCode());
......@@ -332,7 +338,9 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType())
|| CommonConstants.SEVEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.TEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())) {
|| CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())
|| CommonConstants.THIRTEEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.FOURTEEN_STRING.equals(insert.getPermissionType())) {
//判断对应维度的名称是否存在
Integer count;
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType())) {
......@@ -341,6 +349,10 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
count = baseMapper.selectTwoGsCount(excel.getName());
} else if (CommonConstants.TWELVE_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectTaxCount(excel.getName());
} else if (CommonConstants.THIRTEEN_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectDivitionCount(excel.getName());
} else if (CommonConstants.FOURTEEN_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectDivitionLineCount(excel.getName());
} else {
count = baseMapper.selectDictByName(excel.getName(), "line");
}
......
......@@ -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>
......@@ -59,6 +59,7 @@
<if test="status != null and status.trim() != ''">
AND a.FD_STATUS = #{status}
</if>
and a.FD_APPLY_DATE >= #{queryStartTime} and a.FD_APPLY_DATE <![CDATA[<=]]> #{queryEndTime}
</where>
</select>
......
<?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>
......@@ -32,6 +32,8 @@
<result property="tableName" column="TABLE_NAME"/>
<result property="queryFields" column="QUERY_FIELDS"/>
<result property="taxId" column="TAX_ID"/>
<result property="divisionId" column="DIVISION_ID"/>
<result property="divisionLineId" column="DIVISION_LINE_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -57,7 +59,9 @@
a.CREATE_TIME,
a.TABLE_NAME,
a.QUERY_FIELDS,
a.TAX_ID
a.TAX_ID,
a.DIVISION_ID,
a.DIVISION_LINE_ID
</sql>
<sql id="sysMenu_where">
<if test="sysMenu != null">
......@@ -130,5 +134,14 @@
</if>
GROUP BY a.fd_3afab4c6755286 ORDER BY a.fd_3afab4c6755286 desc
</select>
<!-- 获取事业部-->
<select id="getDivisions" resultType="com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionVo">
select DISTINCT(fd_shiyebu) as 'name' from ekp_shenhepeizhi_table
</select>
<!-- 获取事业部条线-->
<select id="getDivisionLines" resultType="com.yifu.cloud.plus.v1.yifu.permission.vo.SysDivisionLineVo">
select DISTINCT(fd_tiaoxian) as 'name' from ekp_shenhepeizhi_table
</select>
</mapper>
......@@ -127,7 +127,7 @@
WHEN a.PERMISSION_STATUS =1 THEN "禁用"
ELSE a.PERMISSION_STATUS END as PERMISSION_STATUS
FROM sys_user_permission a
LEFT JOIN permission_type c on a.PERMISSION_TYPE = c.id
LEFT JOIN permission_type c on a.PERMISSION_TYPE = c.dict_id and c.dict_type='permission'
LEFT JOIN sys_user_info b on a.user_id = b.fd_id
<where>
a.DELETE_FLAG = '1'
......@@ -481,5 +481,16 @@
delete from sys_user_permission p
where SOURCE_TYPE = 0 and CODE = #{code} and PERMISSION_TYPE = #{permissionType}
</delete>
<select id="selectDivitionCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_shenhepeizhi_table a
where a.fd_shiyebu = #{name}
</select>
<select id="selectDivitionLineCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_shenhepeizhi_table a
where a.fd_tiaoxian = #{name}
</select>
</mapper>
......@@ -487,4 +487,12 @@ public class SocialHandleExportVo implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("离职日期" )
private String leaveDate;
// 取 社保停缴日期
@ExcelAttribute(name = "社保停缴日期")
@ContentStyle(dataFormat = 49)
@Schema(description = "社保停缴日期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保停缴日期" )
private String socialReduceDate;
}
......@@ -1187,6 +1187,7 @@
<result property="firstPayTime" column="FIRST_PAY_TIME"/>
<result property="graduationTime" column="GRADUATION_TIME"/>
<result property="leaveDate" column="LEAVE_DATE"/>
<result property="socialReduceDate" column="SOCIAL_REDUCE_DATE"/>
</resultMap>
<resultMap id="fundHandleMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.FundHandleExportVo">
......@@ -1278,7 +1279,8 @@
a.MAJOR,
a.FIRST_PAY_TIME,
a.GRADUATION_TIME,
IF(a.LEAVE_DATE is not null,DATE_FORMAT(a.LEAVE_DATE,"%Y-%m-%d"),"") as "LEAVE_DATE"
IF(a.LEAVE_DATE is not null,DATE_FORMAT(a.LEAVE_DATE,"%Y-%m-%d"),"") as "LEAVE_DATE",
IF(a.SOCIAL_REDUCE_DATE is not null,DATE_FORMAT(a.SOCIAL_REDUCE_DATE,"%Y-%m-%d"),"") as "SOCIAL_REDUCE_DATE"
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......
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