Commit bfa5c956 authored by hongguangwu's avatar hongguangwu

Merge branch 'develop'

parents 62122141 0aface2d
......@@ -42,5 +42,5 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencies>
</project>
......@@ -122,4 +122,14 @@ public class EmployeeRegistrationPre extends BaseEntity {
@TableField(exist = false)
private List<TEmployeeInsurancePre> insurancePreList;
@Schema(description = "附件集合")
@TableField(exist = false)
private List<TAttaInfo> attaList;
/**
* 附件Id
*/
@TableField(exist = false)
private List<String> attaIdList;
}
......@@ -59,11 +59,11 @@ public class TAttaInfo extends BaseEntity {
/**
* 关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本
* ;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽
* 25 户口本本人页26学信27预入职其他附件28户配置
* 25 户口本本人页26学信27预入职其他附件28户配置 31入离职登记身份证正面 32入离职登记身份证反面
*/
@NotBlank(message = "关系类型不能为空")
@Length(max = 2, message = "关系类型不能超过2个字符")
@Schema(description = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽 25 户口本本人页26学信28户配置)")
@Schema(description = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽 25 户口本本人页26学信28户配置 31入离职登记身份证正面 32入离职登记身份证反面)")
private String relationType;
/**
* 实体id和关系类型共同确定附件所属(9、10、21、22、23、24、25存项目档案id,0、2、26存附属表id)
......
......@@ -120,4 +120,31 @@ public class IdCardUtil {
}
return sex;
}
/**
* 获取性别名称
* @param idNum
* @return
*/
public static String getSexName(String idNum) {
String sex = "男";
if (idNum != null) {
String sexString = "";
if (idNum.length() == 18) {
sexString = idNum.substring(16, 17);
} else if (idNum.length() == 15) {
sexString = idNum.substring(14, 15);
}
try {
// 判断性别
if (Integer.parseInt(sexString) % 2 == 0) {
sex = "女";
}
} catch (Exception e) {
sex = "男";
}
}
return sex;
}
}
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
......@@ -123,4 +124,7 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "商险待派单信息集合")
private List<TEmployeeInsurancePreVo> employeeInsurancePreVos;
@Schema(description = "附件集合")
private List<TAttaInfoSaveVo> attaList;
}
......@@ -107,4 +107,11 @@ public class ProjectSetInfoVo implements Serializable {
@Schema(description = "是否BPO", name = "bpoFlag")
@ExcelIgnore
private String bpoFlag;
/**
* MVP1.7.11 增加: 服务项目
*/
@Schema(description = "服务项目", name = "serverItem")
@ExcelIgnore
private String serverItem;
}
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @Author fxj
* @Description 附件信息表
* @Date 11:07 2022/6/22
**/
@Data
public class TAttaInfoSaveVo {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 资源名称
*/
@NotBlank(message = "资源名称不能为空")
@Length(max = 50, message = "资源名称不能超过50个字符")
@Schema(description = "资源名称")
private String attaName;
/**
* 资源地址
*/
@NotBlank(message = "资源地址不能为空")
@Length(max = 100, message = "资源地址不能超过100个字符")
@Schema(description = "资源地址")
private String attaSrc;
/**
* 资源大小
*/
@Schema(description = "资源大小")
private Long attaSize;
/**
* 资源类型
*/
@Length(max = 10, message = "资源类型不能超过10个字符")
@Schema(description = "资源类型")
private String attaType;
/**
* 关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本
* ;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽
* 25 户口本本人页26学信27预入职其他附件28户配置 31入离职登记身份证正面 32入离职登记身份证反面
*/
@NotBlank(message = "关系类型不能为空")
@Length(max = 2, message = "关系类型不能超过2个字符")
@Schema(description = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招投标7业务评估8二维码9身份证 10 户口本;21(预入职申明签名);22(预入职确认签名);23(预入职pdf文件);0(最高教育经历);2(执业资格证书);24 身份证国徽 25 户口本本人页26学信28户配置 31入离职登记身份证正面 32入离职登记身份证反面)")
private String relationType;
/**
* 实体id和关系类型共同确定附件所属(9、10、21、22、23、24、25存项目档案id,0、2、26存附属表id)
*/
@NotBlank(message = "实体id和关系类型共同确定附件所属不能为空")
@Length(max = 32, message = "实体id和关系类型共同确定附件所属不能超过32个字符")
@Schema(description = "实体id和关系类型共同确定附件所属")
private String domainId;
/**
* 地址URL
*/
@Length(max = 100, message = "地址URL不能超过100个字符")
@Schema(description = "地址URL")
@TableField(exist = false)
private String attaUrl;
/**
* 附件变更类型:0 新增 1 更新 2 删除 3 不变 档案编辑附件时需要告知后端是增加还是减少
*/
private String handleType;
/**
* 其他分租名称
*/
private String groupName;
}
......@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractAuditVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ErrorVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.IdNameNoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -399,4 +400,17 @@ public class TEmployeeContractInfoController {
return tEmployeeContractInfoService.getContractByEmpIdCardAndDeptId(empIdCard, deptId);
}
/**
* @Description: 获取项目下人员最小的合同起始日期
* @Author: hgw
* @Date: 2025/5/26 19:06
* @return: java.lang.String
**/
@Operation(summary = "获取项目下人员最小的合同起始日期", description = "获取项目下人员最小的合同起始日期")
@Inner
@PostMapping("/getMinDateByCardAndDeptId")
public String getMinDateByCardAndDeptId(@RequestBody IdNameNoVo idVo) {
return tEmployeeContractInfoService.getMinDateByCardAndDeptId(idVo);
}
}
......@@ -360,6 +360,18 @@ public class TSettleDomainController {
public TSettleDomainSelectVo getSettleDomainVoById(@RequestBody String id) {
return tSettleDomainService.getSettleDomainVoById(id);
}
/**
* @param deptNo 项目主键
* @Description: 通过id获取结算主体及单位部分信息
* @Author: hgw
* @Date: 2022/8/10 17:01
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo>
**/
@Inner
@PostMapping("/inner/getSettleDomainVoByNo")
public TSettleDomainSelectVo getSettleDomainVoByNo(@RequestBody String deptNo) {
return tSettleDomainService.getSettleDomainVoByNo(deptNo);
}
/**
* @param deptId 结算主体id
......
......@@ -21,10 +21,7 @@ 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.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpContractBusinessPageVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportAuditVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeContractExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -110,5 +107,7 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
String getContractByEmpIdCardAndDeptId(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
String getMinDateByCardAndDeptId(@Param("vo") IdNameNoVo vo);
void updateContractEnd( @Param("tEmployeeContractInfo")TEmployeeContractInfo tEmployeeContractInfo);
}
......@@ -74,6 +74,7 @@ public interface TSettleDomainMapper extends BaseMapper<TSettleDomain> {
* @return: com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo
**/
TSettleDomainSelectVo getSettleDomainVoById(@Param("id") String id);
TSettleDomainSelectVo getSettleDomainVoByNo(@Param("deptNo") String deptNo);
/**
* 获取所有客户单位的项目信息
......
......@@ -184,6 +184,8 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
List<EmpContractBusinessPageVo> getOtherContractBusinessInfo(String empId, String contractId);
R<String> getContractByEmpIdCardAndDeptId(String mpIdCard, String deptId);
R<String> getContractByEmpIdCardAndDeptId(String empIdCard, String deptId);
String getMinDateByCardAndDeptId(IdNameNoVo vo);
}
......@@ -109,6 +109,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
TSettleDomainSelectVo getSettleDomainVoById(String id);
TSettleDomainSelectVo getSettleDomainVoByNo(String deptNo);
/**
* 获取所有客户单位的项目信息
......
......@@ -3,10 +3,13 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
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.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.EmployeeRegistrationPreMapper;
......@@ -24,11 +27,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.AliSmsResult;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.RegistParamVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CspDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
......@@ -49,6 +50,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
......@@ -62,7 +64,7 @@ import java.util.*;
@Log4j2
@Service
@RequiredArgsConstructor
@EnableConfigurationProperties(DaprInsurancesProperties.class)
@EnableConfigurationProperties({DaprInsurancesProperties.class,DaprCheckProperties.class})
public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegistrationPreMapper, EmployeeRegistrationPre> implements EmployeeRegistrationPreService {
private final DaprInsurancesProperties daprInsurancesProperties;
......@@ -73,6 +75,12 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Autowired
private CspDaprUtils cspDaprUtils;
@Autowired
private OSSUtil ossUtil;
@Autowired
private DaprCheckProperties daprCheckProperties;
private final TEmployeePreLogService tEmployeePreLogService;
private final TCompleteMonitorMapper completeMonitorMapper;
......@@ -87,6 +95,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
private final MenuUtil menuUtil;
private final TAttaInfoService attaInfoService;
@Autowired
@Lazy
private ScheduleService scheduleService;
......@@ -250,8 +260,26 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
baseMapper.deleteById(preExit);
// 创建更新条件构造器
LambdaUpdateWrapper<TAttaInfo> updateWrapper = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapper.eq(TAttaInfo::getDomainId, pre.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的关联ID
attaInfoService.update(updateWrapper);
}
baseMapper.insert(pre);
//附件赋值
if (Common.isNotNull(preVo.getAttaList())) {
for (TAttaInfoSaveVo attaInfoVo : preVo.getAttaList()) {
TAttaInfo attaInfo = new TAttaInfo();
BeanUtils.copyProperties(attaInfoVo, attaInfo);
attaInfo.setDomainId(pre.getId());
attaInfo.setCreateName("确认接收同步");
attaInfoService.save(attaInfo);
}
}
Map<String, TEmployeeInsurancePre> oldMap = new HashMap<>();
if (Common.isNotNull(preExit)) {
if (Common.isNotNull(preVo.getServerItem()) && preVo.getServerItem().contains("商险")) {
......@@ -444,6 +472,42 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
if (Common.isEmpty(comparePre)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
//1.9.11 huyc 信息修改手机号真实性校验
if (Common.isNotNull(employeeRegistrationPre.getEmpPhone()) &&
!employeeRegistrationPre.getEmpPhone().equals(comparePre.getEmpPhone())) {
//手机号真实性校验
TCheckMobile checkMobile = new TCheckMobile();
checkMobile.setMobile(employeeRegistrationPre.getEmpPhone());
R<TCheckMobile> res = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(),daprCheckProperties.getAppId(),"/tcheckmobile/inner/checkOneMobile", JSON.toJSONString(checkMobile), TCheckMobile.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res) || Common.isEmpty(res.getData())){
return R.failed("校验手机号码信息失败!");
}
TCheckMobile cm = res.getData();
if (Common.isEmpty(cm.getStatus()) || !CommonConstants.ONE_STRING.equals(cm.getStatus())){
return R.failed(cm.getMessage());
}
}
// 创建更新条件构造器
LambdaUpdateWrapper<TAttaInfo> updateWrapper = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapper.eq(TAttaInfo::getDomainId, employeeRegistrationPre.getId())
.set(TAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的域名ID
attaInfoService.update(updateWrapper);
// 检查附件ID列表是否不为空、更新附件
if (Common.isNotNull(employeeRegistrationPre.getAttaIdList())) {
// 遍历员工注册记录中的附件ID列表
TAttaInfo atta;
for (String attaId : employeeRegistrationPre.getAttaIdList()) {
// 根据ID获取附件信息
atta = attaInfoService.getById(attaId);
// 更新附件的域名ID为当前员工的注册ID
atta.setDomainId(employeeRegistrationPre.getId());
// 保存更新后的附件信息
attaInfoService.updateById(atta);
}
}
Map<String, TEmployeeInsurancePre> oldMap = new HashMap<>();
// 查原商险,来对比
......@@ -1154,6 +1218,18 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
}
pre.setInsurancePreList(oldList);
}
// 查询与员工相关的附件信息
List<TAttaInfo> attaInfo = attaInfoService.list(Wrappers.<TAttaInfo>query().lambda().eq(TAttaInfo::getDomainId, id));
// 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中
if (attaInfo != null && !attaInfo.isEmpty()) {
URL url;
for (TAttaInfo a: attaInfo) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
a.setAttaUrl(null != url ? url.toString(): "");
}
pre.setAttaList(attaInfo);
}
}
return pre;
}
......
......@@ -1957,8 +1957,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
@Override
public R<String> getContractByEmpIdCardAndDeptId(String mpIdCard, String deptId) {
String contractStart = baseMapper.getContractByEmpIdCardAndDeptId(mpIdCard, deptId);
public R<String> getContractByEmpIdCardAndDeptId(String empIdCard, String deptId) {
String contractStart = baseMapper.getContractByEmpIdCardAndDeptId(empIdCard, deptId);
if (Common.isNotNull(contractStart)) {
return R.ok(contractStart);
} else {
......@@ -1966,6 +1966,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
@Override
public String getMinDateByCardAndDeptId(IdNameNoVo vo) {
return baseMapper.getMinDateByCardAndDeptId(vo);
}
//是否同步终止合同、减项、减档为是的时候 单独写逻辑
public void changeStatus(TEmployeeContractInfo contractInfo,YifuUser user) {
//同步任务处理清单执行详情
......
......@@ -169,6 +169,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
public void saveModifyAndUpdateInsurance(String empPreId, EmployeeRegistrationPre oldInfo
, EmployeeRegistrationPre newInfo, YifuUser user, Map<String, TEmployeeInsurancePre> oldMap) {
try {
//1.9.11 huych 附件类型不比较差异
oldInfo.setAttaIdList(null);
newInfo.setAttaIdList(null);
oldInfo.setAttaList(null);
newInfo.setAttaList(null);
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
......@@ -298,6 +303,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
public void saveUpdateInsurance(String empPreId, EmployeeRegistrationPre oldInfo
, EmployeeRegistrationPre newInfo, String userId, String nickName, Map<String, TEmployeeInsurancePre> oldMap) {
try {
//1.9.11 huych 附件类型不比较差异
oldInfo.setAttaIdList(null);
newInfo.setAttaIdList(null);
oldInfo.setAttaList(null);
newInfo.setAttaList(null);
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
......@@ -309,7 +319,9 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
List<TEmployeePreLogDetail> detailList = new ArrayList<>();
// 档案信息修改
TEmployeePreLogDetail detailEmpLog = null;
if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey)) {
if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey)
&& !"attaIdList".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList","");
diffTitle = "档案信息二次确认";
detailEmpLog = new TEmployeePreLogDetail();
......
......@@ -189,6 +189,11 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
return baseMapper.getSettleDomainVoById(id);
}
@Override
public TSettleDomainSelectVo getSettleDomainVoByNo(String deptNo) {
return baseMapper.getSettleDomainVoByNo(deptNo);
}
@Override
public List<TSettleDomainSelectVo> selectAllSettleDomainSelectVos() {
return baseMapper.selectAllSettleDomainSelectVos();
......
......@@ -843,4 +843,12 @@
)
limit 1
</select>
<!-- 获取最小的审核通过的合同,税友自动生成 离职证明书使用 -->
<select id="getMinDateByCardAndDeptId" resultType="java.lang.String">
select
DATE_FORMAT(min(e.CONTRACT_START),'%Y年%m月%d日') CONTRACT_START
from t_employee_contract_info e
where e.EMP_IDCARD = #{vo.no} and e.SETTLE_DOMAIN = #{vo.id} and e.DELETE_FLAG = '0' and e.AUDIT_STATUS = '2'
</select>
</mapper>
......@@ -357,6 +357,19 @@
WHERE a.id=#{id} GROUP BY a.id
</select>
<select id="getSettleDomainVoByNo"
resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo">
SELECT
<include refid="Base_Column_List"/>,
a.CUSTOMER_ID AS 'customerId',
a.CUSTOMER_NAME as 'customerName',
a.CUSTOMER_NO as 'customerCode',
a.INVOICE_TITLE_SALARY as 'businessSubjectName'
FROM
t_settle_domain a
WHERE a.DEPART_NO = #{deptNo} GROUP BY a.id
</select>
<select id="getPagePerMission" resultMap="tSettleDomainMap">
SELECT
......@@ -492,7 +505,8 @@
a.STOP_FLAG,
a.INVOICE_TITLE_SALARY,
a.INVOICE_TITLE_INSURANCE,
a.BPO_FLAG
a.BPO_FLAG,
a.SERVER_ITEM
FROM t_settle_domain a
where a.DELETE_FLAG = '0'
<if test="codes != null and codes.size() > 0">
......
......@@ -187,8 +187,18 @@ public class ChecksUtil {
return R.ok(checkBankNo);
}
private static String getJsonElementValue(JsonElement temp){
return Common.isNotNull(temp)?temp.getAsString():CommonConstants.EMPTY_STRING;
private static String getJsonElementValue(JsonElement temp) {
String msg = "";
if (Common.isNotNull(temp)) {
try {
msg = temp.toString().substring(0, 10);
return temp.getAsString();
} catch (Exception e) {
return "创蓝云智返回异常:" + msg;
}
} else {
return CommonConstants.EMPTY_STRING;
}
}
/**
......
......@@ -492,7 +492,6 @@ public class Common {
* @Date 2019-09-26
**/
public static BigDecimal formatMoneyForFund(BigDecimal money, int type) {
DecimalFormat formater = new DecimalFormat("#0.#");
if (type == 1) {//四舍五入取整
return BigDecimal.valueOf(money.doubleValue()).setScale(0, RoundingMode.HALF_UP);
}
......@@ -508,6 +507,11 @@ public class Common {
if (type == 5) {//保留一位小数
return BigDecimal.valueOf(money.doubleValue()).setScale(1, RoundingMode.HALF_UP);
}
if (type == 6) {//见分进元
return BigDecimal.valueOf(Math.ceil(BigDecimal.valueOf(money.doubleValue())
.setScale(2, RoundingMode.HALF_DOWN).doubleValue()))
.setScale(0, BigDecimal.ROUND_UP);
}
return money;
}
......
......@@ -84,6 +84,7 @@ public class DateUtil {
*/
public static final String DATE_PATTERN = "yyyyMMddHHmmss";
public static final String EXPORT_PATTERN = "yyyyMMdd-HHmmss";
public static final String CHINA_PATTEN_YMD = "yyyy年MM月dd日";
protected static final float normalizedJulian(float jd) {
......
......@@ -589,4 +589,26 @@ public class ArchivesDaprUtil {
Set<String> map = JSON.parseObject(JSON.toJSONString(res.getData()),new TypeReference<Set<String>>(){});
return R.ok(map);
}
/**
* @param idCard 身份证
* @param deptId 项目Id
* @Description: 获取项目下人员最小的合同起始日期
* @Author: hgw
* @Date: 2025/5/26 18:39
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo>
**/
public R<String> getMinDateByCardAndDeptId(String idCard, String deptId) {
IdNameNoVo idVo = new IdNameNoVo();
idVo.setId(deptId);
idVo.setNo(idCard);
R<String> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId()
,"/temployeecontractinfo/getMinDateByCardAndDeptId", idVo
, String.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res) || Common.isEmpty(res.getData())){
return new R<>("--");
}
return res;
}
}
......@@ -32,6 +32,14 @@ public class EkpPushFundParam implements Serializable {
* 项目名称
**/
private String fd_3adfe8c8468e54;
/**
* 项目编码-原
**/
private String fd_3cfe2da7e35daa;
/**
* 项目名称-原
**/
private String fd_3cfe2db5015d6e;
/**
* 单号
**/
......
......@@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
* 入离职登记表
......@@ -108,6 +109,18 @@ public class EmployeeRegistration extends BaseEntity {
@TableField(exist = false)
private String empProjectId;
/**
* 附件Id
*/
@TableField(exist = false)
private List<String> attaIdList;
/**
* 印章附件
*/
@TableField(exist = false)
private List<TCspAttaInfo> attaInfoList;
}
package com.yifu.cloud.plus.v1.csp.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 系统限制配置表
*
* @author huych
* @date 2025-05-16 11:39:57
*/
@Data
@TableName("sys_config_limit")
@Schema(description = "系统限制配置表")
public class SysConfigLimit {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 限制键
*/
@ExcelAttribute(name = "限制键", isNotEmpty = true, errorInfo = "限制键不能为空", maxLength = 32)
@NotBlank(message = "限制键不能为空")
@Length(max = 32, message = "限制键不能超过32个字符")
@ExcelProperty("限制键")
@Schema(description = "限制键")
private String configKey;
/**
* 限制值
*/
@ExcelAttribute(name = "限制值", isNotEmpty = true, errorInfo = "限制值不能为空")
@NotBlank(message = "限制值不能为空")
@ExcelProperty("限制值")
@Schema(description = "限制值")
private Integer configValue;
/**
* 备注
*/
@ExcelAttribute(name = "备注", maxLength = 255)
@Length(max = 255, message = "备注不能超过255个字符")
@ExcelProperty("备注")
@Schema(description = "备注")
private String remark;
}
package com.yifu.cloud.plus.v1.csp.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 com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* @Author huych
* @Description 附件信息表
* @Date 11:07 2025/5/16
**/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("t_csp_atta_info")
@Tag(name = "附件信息表")
public class TCspAttaInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 资源名称
*/
@NotBlank(message = "资源名称不能为空")
@Length(max = 50, message = "资源名称不能超过50个字符")
@Schema(description = "资源名称")
private String attaName;
/**
* 资源地址
*/
@NotBlank(message = "资源地址不能为空")
@Length(max = 100, message = "资源地址不能超过100个字符")
@Schema(description = "资源地址")
private String attaSrc;
/**
* 资源大小
*/
@Schema(description = "资源大小")
private Long attaSize;
/**
* 资源类型
*/
@Length(max = 10, message = "资源类型不能超过10个字符")
@Schema(description = "资源类型")
private String attaType;
/**
* 关系类型(1 入离职登记身份证正面 2.入离职登记身份证反面 3.离职登记)
*/
@NotBlank(message = "关系类型不能为空")
@Length(max = 2, message = "关系类型不能超过2个字符")
@Schema(description = "关系类型(1 入离职登记身份证正面 2.入离职登记身份证反面 3.离职登记)")
private String relationType;
/**
* 实体id和关系类型共同确定附件所属(9、10、21、22、23、24、25存项目档案id,0、2、26存附属表id)
*/
@NotBlank(message = "实体id和关系类型共同确定附件所属不能为空")
@Length(max = 32, message = "实体id和关系类型共同确定附件所属不能超过32个字符")
@Schema(description = "实体id和关系类型共同确定附件所属")
private String domainId;
/**
* 地址URL
*/
@Length(max = 100, message = "地址URL不能超过100个字符")
@Schema(description = "地址URL")
@TableField(exist = false)
private String attaUrl;
/**
* 附件变更类型:0 新增 1 更新 2 删除 3 不变 档案编辑附件时需要告知后端是增加还是减少
*/
@TableField(exist = false)
private String handleType;
/**
* 其他分组名称
*/
@TableField(exist = false)
private String groupName;
}
package com.yifu.cloud.plus.v1.csp.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @Author fxj
* @Description 附件信息表
* @Date 11:07 2022/6/22
**/
@Data
public class TAttaInfoVo extends TAttaInfo {
private static final long serialVersionUID = 1L;
/**
* 其他分租名称
*/
@TableField(exist = false)
private String groupName;
/**
* 姓名
*/
@Schema(description = "姓名")
private String empName;
/**
* 身份证
*/
@Schema(description = "身份证")
private String empIdcard;
}
......@@ -105,7 +105,7 @@ public class EmployeeRegistrationController {
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission(' ')")
@GetMapping("/{id}")
public R<EmployeeRegistration> getById(@PathVariable("id") String id) {
return R.ok(employeeRegistrationService.getById(id));
return employeeRegistrationService.getDetailInfoById(id);
}
/**
......
package com.yifu.cloud.plus.v1.csp.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.csp.service.FileUploadService;
import com.yifu.cloud.plus.v1.csp.service.TAttaInfoService;
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.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.net.URL;
import java.util.List;
/**
* @author huych
* 文件上传接口
*/
@RestController
@RequestMapping("/fileUpload")
@Tag(name = "文件上传接口")
@Slf4j
public class FileUploadController {
@Autowired
private OSSUtil ossUtil;
@Autowired
private TAttaInfoService tAttaInfoService;
@Autowired
private FileUploadService fileUploadService;
/**
* @Author fxj
* @Description
* @Date 13:49 2022/6/17
* @Param
* @return
**/
@Operation(description = "OSS文件上传接口" +
"@ApiImplicitParam(name = \"file\", value = \"Form文件上传\", required = true, dataType = \"__file\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"filePath\", value = \"文件上传路径\", required = false, dataType = \"String\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"type\", value = \"关系类型(1 入离职登记身份证正面 2.入离职登记身份证反面 3.离职登记\", required = true, dataType = \"int\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"domain\", value = \"实体id(传入就插入对应关系,用于编辑)\", required = false, paramType = \"form\")\n" +
"\t")
/*@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "Form文件上传", required = true, dataType = "__file", paramType = "form"),
@ApiImplicitParam(name = "filePath", value = "文件上传路径", required = false, dataType = "String", paramType = "form"),
@ApiImplicitParam(name = "type", value = "关系类型(0客户附件1联系人附件2跟进记录附件3合同附件4合同归档附件5报价单6招标信息7业务评估8电子档案)", required = true, dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "domain", value = "实体id(传入就插入对应关系,用于编辑)", required = false, paramType = "form")
})*/
@PostMapping(value = "/ossUploadFile")
public R<T> uploadImg(@RequestBody MultipartFile file, String filePath, Integer type, String domain) throws IOException {
return fileUploadService.uploadAsso(file,filePath,type,domain,CommonConstants.ZERO_STRING);
}
/**
* @Author hgw
* @Description 改编自ossUploadFile接口,改变了回传信息——专为预入职微信端使用——忽略了token,其余人慎用
* @Date 13:49 2022/6/17
* @Param relationTypeSub 预入职其他附件的子类型
* @return
**/
@Operation(description = "OSS文件上传接口" +
"@ApiImplicitParam(name = \"file\", value = \"Form文件上传\", required = true, dataType = \"__file\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"filePath\", value = \"文件上传路径\", required = false, dataType = \"String\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"type\", value = \"关系类型(1 入离职登记身份证正面 2.入离职登记身份证反面 3.离职登记 \", required = true, dataType = \"int\", paramType = \"form\"),\n" +
"\t\t\t@ApiImplicitParam(name = \"domain\", value = \"实体id(传入就插入对应关系,用于编辑)\", required = false, paramType = \"form\")\n" +
"\t")
@PostMapping(value = "/uploadFileReturnAtta")
public R<T> uploadFileReturnAtta(@RequestBody MultipartFile file, String filePath, Integer type, String domainId) throws IOException {
return fileUploadService.uploadAsso(file,filePath,type,domainId,CommonConstants.ONE_STRING);
}
/**
* @Author fxj
* @Description
* @Date 13:51 2022/6/17
* @Param
* @return
**/
@Operation(description = "附件删除")
@SysLog("附件删除")
@DeleteMapping("/ossFileDelete/{id}")
public R<Boolean> ossFileDelete(@PathVariable String id) {
try {
TCspAttaInfo attaInfo = tAttaInfoService.getById(id);
if (null == attaInfo) {
return R.failed("无对应附件信息");
}
if (tAttaInfoService.removeById(id)) {
ossUtil.deleteObject(null, attaInfo.getAttaSrc());
return R.ok(null,"删除成功!");
}
} catch (Exception e) {
log.error("附件删除异常:" + e.getMessage());
return R.failed("附件删除异常!");
}
return R.ok(null,"删除失败!");
}
/**
* 获取附件下载地址
*
* @param id
* @return
* @Author fxj
* @Date 2019-08-16
* @param id domainId
**/
@Operation(description = "附件预览下载地址 type:关系类型(1 入离职登记身份证正面 2.入离职登记身份证反面 3.离职登记")
@GetMapping("/ossFileUrl/{id}")
public R<List<TCspAttaInfo>> ossFileUrl(@PathVariable String id) {
List<TCspAttaInfo> attas = tAttaInfoService.list(Wrappers.<TCspAttaInfo>query().lambda().eq(TCspAttaInfo::getDomainId,id));
if (Common.isEmpty(attas)) {
return new R<>(attas);
}
for (TCspAttaInfo atta:attas){
URL url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(url.toString().replace("http","https"));
}
return new R<>(attas);
}
}
package com.yifu.cloud.plus.v1.csp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.SysConfigLimit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 系统限制配置表
*
* @author huych
* @date 2025-05-16 11:39:57
*/
@Mapper
public interface SysConfigLimitMapper extends BaseMapper<SysConfigLimit> {
/**
* 系统限制配置表简单分页查询
*
* @param configKey 键
* @return
*/
Integer getSysConfigLimitByKey(@Param("configKey") String configKey);
}
package com.yifu.cloud.plus.v1.csp.mapper;
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.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.csp.vo.TAttaInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
/**
* 附件信息表
*
* @author pwang
* @date 2021-02-19 16:16:07
*/
@Mapper
public interface TAttaInfoMapper extends BaseMapper<TCspAttaInfo> {
/**
* 附件信息表简单分页查询
*
* @param tAttaInfo 附件信息表
* @return
*/
IPage<TCspAttaInfo> getTAttaInfoPage(Page<TCspAttaInfo> page, @Param("tAttaInfo") TCspAttaInfo tAttaInfo);
/**
* @param tAttaInfo
* @Description: 获取list
* @Author: hgw
* @Date: 2021/5/28 16:02
* @return: java.util.List<com.yifu.cloud.v1.crm.api.entity.TAttaInfo>
**/
List<TCspAttaInfo> getTAttaInfoList(@Param("tAttaInfo") TCspAttaInfo tAttaInfo);
List<TCspAttaInfo> getTAttaInfoListByDoMainId(@Param("domainId") String domainId);
List<TCspAttaInfo> getKeenAtta(@Param("dayStart")LocalDateTime dayStart, @Param("values")Collection<String> values);
int updateDomainId(@Param("domainId")String domainId, @Param("ids")List<String> ids);
List<TCspAttaInfo> getAttaByApplyId(@Param("applyId")String applyId);
void deleteByDomainId(@Param("domainId") String domainId);
// 详档变简档,删除身份证、其他附件、签名之外的附件
void deleteByDomainIdExceptionCard(@Param("domainId") String domainId);
void deleteByDomainIdAndType(@Param("domainId") String domainId, @Param("relationType") String relationType);
// 删除学历与职业资格之外的附件
void deleteByDomainIdAndOther(@Param("domainId") String domainId);
// 简档,仅删除身份证附件和(21(预入职申明签名);22(预入职确认签名);23(预入职pdf文)
void deleteByDomainIdCard(@Param("domainId") String domainId);
List<TAttaInfoVo> getAttInfoByParam(@Param("departNo")String departNo, @Param("startDate")String startDate, @Param("endDate")String endDate);
int getAttInfoCountByParam(@Param("departNo")String departNo, @Param("startDate")String startDate, @Param("endDate")String endDate);
}
......@@ -169,4 +169,6 @@ public interface EmployeeRegistrationService extends IService<EmployeeRegistrati
**/
TEmployeeProjectBelongDept getZeroRegistrationAndUpdateTwo(TEmployeeProjectBelongDeptSearchCspVo searchCspVo);
R<EmployeeRegistration> getDetailInfoById(String id);
}
package com.yifu.cloud.plus.v1.csp.service;
import com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
/**
* 文件上传
*
* @author huych
* @date 2025-05-16 11:16:07
*/
public interface FileUploadService {
R<FileVo> uploadImg(MultipartFile file, String filePath, Integer type, String domain) throws IOException;
R<TCspAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domainId) throws IOException;
R<T> uploadAsso(MultipartFile file, String filePath, Integer type, String domain, String uploadType);
}
package com.yifu.cloud.plus.v1.csp.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.csp.vo.TAttaInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
/**
* 附件信息表
*
* @author huych
* @date 2025-05-16 11:16:07
*/
public interface TAttaInfoService extends IService<TCspAttaInfo> {
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
IPage<TCspAttaInfo> getTAttaInfoPage(Page<TCspAttaInfo> page, TCspAttaInfo tAttaInfo);
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
List<TCspAttaInfo> getTAttaInfoList(TCspAttaInfo tAttaInfo);
/**
* @param domainId 关联id
* @Description: 根据domainId获取附件
* @Author: hgw
* @Date: 2024/6/17 18:23
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo>
**/
List<TCspAttaInfo> getTAttaInfoListByDoMainId(String domainId);
TCspAttaInfo add(TCspAttaInfo attaInfo);
void update(List<TCspAttaInfo> attaList, String domainId, String relationType);
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
Boolean batchOssFileDelete(List<TCspAttaInfo> delAttaList);
List<TCspAttaInfo> getKeenAtta(LocalDateTime dayStart, Collection<String> values);
Boolean updateDomainId(String domainId, List<String> ids);
/**
* @param applyId
* @Description: 收入证明使用
* @Author: hgw
* @Date: 2023/2/22 10:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo>>
**/
R<List<TCspAttaInfo>> getAttaByApplyId(String applyId);
/**
* @param domainId 关联id
* @Description: 删除附件
* @Author: hgw
* @Date: 2024/6/20 14:50
* @return: void
**/
void deleteByDomainId(String domainId);
/**
* @Description: 详档变简档,删除身份证、其他附件、签名之外的附件
* @Author: hgw
* @Date: 2025/3/21 17:06
* @return: void
**/
void deleteByDomainIdExceptionCard(String domainId);
void deleteByDomainIdAndOther(String domainId);
// 简档,仅删除身份证附件和(21(预入职申明签名);22(预入职确认签名);23(预入职pdf文)
void deleteByDomainIdCard(String domainId);
void deleteByDomainIdAndType(String domainId, int relationType);
List<TAttaInfoVo> getAttInfoByParam(String departNo, String startDate, String endDate);
int getAttInfoCountByParam(String departNo, String startDate, String endDate);
}
......@@ -16,9 +16,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.csp.config.WxConfig;
import com.yifu.cloud.plus.v1.csp.constants.RegistConstants;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.csp.entity.TOperationLog;
import com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationMapper;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationService;
import com.yifu.cloud.plus.v1.csp.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.csp.service.TOperationLogService;
import com.yifu.cloud.plus.v1.csp.vo.*;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
......@@ -44,6 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
......@@ -52,6 +55,7 @@ import org.springframework.web.client.RestTemplate;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.text.ParseException;
import java.time.LocalDateTime;
......@@ -93,6 +97,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
@Autowired
private InsuranceDaprUtil insuranceDaprUtil;
@Autowired
private OSSUtil ossUtil;
@Autowired
private final CheckDaprUtil checkDaprUtil;
private final TAttaInfoService tAttaInfoService;
private final TOperationLogService logService;
/**
......@@ -777,6 +789,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
// 1.9.8: 赋值【最新的客服名称】
registration.setCustomerUsernameNew(registration.getCustomerUsername());
baseMapper.insert(registration);
//更新附件
updateFileId(registration);
}
//企业微信消息提醒
sendMessageToWx(registration, registration.getFeedbackType());
......@@ -939,6 +953,12 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (!ValidityUtil.validateEmpPhone(registration.getEmpPhone())) {
return RegistConstants.PHONE_FORMAT_ERROR;
}
//姓名、身份证+手机号真实性校验
R<Boolean> checkRes = checkDaprUtil.checkIdCardAndMobile(registration.getEmployeeName(),
registration.getEmpIdcard(),registration.getEmpPhone());
if (Common.isEmpty(checkRes) || checkRes.getCode() != CommonConstants.SUCCESS){
return checkRes.getMsg();
}
EmployeeRegistration exit = baseMapper.selectOne(Wrappers.<EmployeeRegistration>query().lambda()
.eq(EmployeeRegistration::getEmpIdcard, registration.getEmpIdcard())
.eq(EmployeeRegistration::getDeptNo, registration.getDeptNo())
......@@ -1100,6 +1120,37 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
}
/**
* 根据ID获取员工注册的详细信息
* 此方法首先通过ID从数据库中获取员工注册信息,然后查询与该员工相关的附件信息,
* 并为每个附件生成可访问的URL,最后将这些信息一起封装返回
* @Author: huych
* @param id 员工注册信息的唯一标识符
* @return 返回一个封装了员工注册详细信息的结果对象,包括附件信息
*/
@Override
public R<EmployeeRegistration> getDetailInfoById(String id) {
// 根据ID从数据库中获取员工注册信息
EmployeeRegistration employeeRegistration = baseMapper.selectById(id);
// 如果员工注册信息为空,则返回失败结果
if (Common.isEmpty(employeeRegistration)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
// 查询与员工相关的附件信息
List<TCspAttaInfo> attaInfo = tAttaInfoService.list(Wrappers.<TCspAttaInfo>query().lambda().eq(TCspAttaInfo::getDomainId, id));
// 如果附件信息非空,则为每个附件生成可访问的URL,并将其添加到员工注册信息中
if (attaInfo != null && !attaInfo.isEmpty()) {
URL url;
for (TCspAttaInfo a: attaInfo) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
a.setAttaUrl(url.toString());
}
employeeRegistration.setAttaInfoList(attaInfo);
}
// 返回封装了员工注册详细信息的成功结果
return R.ok(employeeRegistration);
}
/**
* @Description: 批量处理日志
* @Author: hgw
......@@ -1227,6 +1278,24 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
registration.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " " + preVo.getPushDate(), DateUtil.DATETIME_PATTERN_MINUTE));
}
//附件赋值
List<TCspAttaInfo> attaInfoList = tAttaInfoService.list(Wrappers.<TCspAttaInfo>query().lambda().eq(TCspAttaInfo::getDomainId, registration.getId()));
if (attaInfoList != null && !attaInfoList.isEmpty()) {
List<TAttaInfoSaveVo> attaInfos = new ArrayList<>();
for (TCspAttaInfo cspAttaInfo : attaInfoList) {
TAttaInfoSaveVo attaInfo = new TAttaInfoSaveVo();
BeanUtils.copyProperties(cspAttaInfo,attaInfo);
if (CommonConstants.ONE_STRING.equals(cspAttaInfo.getRelationType())) {
attaInfo.setRelationType("31");
} else if (CommonConstants.TWO_STRING.equals(cspAttaInfo.getRelationType())) {
attaInfo.setRelationType("32");
}
attaInfo.setDomainId(preVo.getId());
attaInfos.add(attaInfo);
}
preVo.setAttaList(attaInfos);
}
}
//商险待购买数据初始化
......@@ -1379,4 +1448,38 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
private String isNullToEmpty(Object str) {
return null == str ? "" : str.toString();
}
/**
* 更新附件的ID
* 当员工注册时,此方法会更新附件信息表中相关记录的ID
* 首先,它会将所有与当前员工注册记录关联的附件的ID清空
* 然后,对于员工注册记录中的每个附件ID,它会更新附件信息表中对应记录的ID为当前员工的注册ID
* @Author: huych
* @param registration 员工注册对象,包含附件ID列表
*/
private void updateFileId(EmployeeRegistration registration) {
// 创建更新条件构造器
LambdaUpdateWrapper<TCspAttaInfo> updateWrapper = new LambdaUpdateWrapper<>();
// 设置更新条件和新值
updateWrapper.eq(TCspAttaInfo::getDomainId, registration.getId())
.set(TCspAttaInfo::getDomainId, CommonConstants.EMPTY_STRING);
// 执行更新操作,清空附件的域名ID
tAttaInfoService.update(updateWrapper);
// 检查附件ID列表是否不为空
if (Common.isNotNull(registration.getAttaIdList()) && !registration.getAttaIdList().isEmpty()) {
// 遍历员工注册记录中的附件ID列表
TCspAttaInfo atta;
for (String id : registration.getAttaIdList()) {
// 根据ID获取附件信息
atta = tAttaInfoService.getById(id);
// 更新附件的域名ID为当前员工的注册ID
if (Common.isNotNull(atta)) {
atta.setDomainId(registration.getId());
// 保存更新后的附件信息
tAttaInfoService.updateById(atta);
}
}
}
}
}
package com.yifu.cloud.plus.v1.csp.service.impl;
import com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.csp.mapper.SysConfigLimitMapper;
import com.yifu.cloud.plus.v1.csp.service.FileUploadService;
import com.yifu.cloud.plus.v1.csp.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
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.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@Service
@RequiredArgsConstructor
@Slf4j
public class FileUploadServiceImpl implements FileUploadService {
private final OSSUtil ossUtil;
private final TAttaInfoService tAttaInfoService;
private AtomicInteger atomicInteger = new AtomicInteger(0);
//初始化附件上传队列上限值
private int maxLimit = 1;
private final SysConfigLimitMapper configLimitMapper;
@Override
public R<TCspAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domainId) throws IOException {
if (null == file) {
return R.failed("文件删除异常,请重新上传!");
}
String fileName = file.getOriginalFilename();
if (fileName == null || Common.isEmpty(fileName)) {
return R.failed("文件名不能为空!!");
}
if (fileName.length() > 100) {
return R.failed("文件名不能超过100个字符!");
}
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String key = "";
if (Common.isNotNull(filePath)) {
key = filePath + "/" + System.currentTimeMillis() + fileName;
} else {
key = System.currentTimeMillis() + fileName;
}
if (!Common.checkFile(key)) {
return R.failed("非法上传类型:"+fileName);
}
boolean flag = ossUtil.uploadFileByStream(file.getInputStream(), key, null);
TCspAttaInfo attaInfo;
URL url;
if (flag) {
log.info("文件:" + fileName + "上传到存储空间" + ossUtil.getBucketName() + "成功!");
attaInfo = initUnitAttaForInsert(fileName, key, file.getSize());
attaInfo.setRelationType(String.valueOf(type));
try {
attaInfo.setDomainId(domainId);
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("2", 1L, "", "预入职扫码",
"预入职扫码", "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null,null);
attaInfo.setCreateBy(user.getId());
attaInfo.setCreateName(user.getNickname());
attaInfo = tAttaInfoService.add(attaInfo);
} catch (Exception e) {
log.error("OSS文件上传异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
return R.failed("上传异常:" + e.getMessage());
}
url = ossUtil.getObjectUrl(null, attaInfo.getAttaSrc());
attaInfo.setAttaUrl(String.valueOf(url));
return R.ok(attaInfo);
} else {
return R.failed("fail:上传异常");
}
}
@Override
public R<FileVo> uploadImg(MultipartFile file, String filePath, Integer type, String domain) throws IOException {
if (null == file) {
return R.failed("文件删除异常,请重新上传!");
}
String fileName = file.getOriginalFilename();
if (Common.isEmpty(fileName)) {
return R.failed("文件名不能为空!");
}
if (fileName.length() > 100) {
return R.failed("文件名不能超过100个字符!");
}
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String key = "";
if (Common.isNotNull(filePath)) {
key = filePath + "/" + System.currentTimeMillis() + fileName;
} else {
key = System.currentTimeMillis() + fileName;
}
if (!Common.checkFile(key)) {
return R.failed("非法上传类型!");
}
boolean flag = ossUtil.uploadFileByStream(file.getInputStream(), key, null);
FileVo fileVo;
TCspAttaInfo attaInfo;
URL url;
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
attaInfo = initUnitAttaForInsert(fileName, key, file.getSize());
attaInfo.setRelationType(String.valueOf(type));
try {
attaInfo.setDomainId(domain);
attaInfo = tAttaInfoService.add(attaInfo);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
return R.failed("fail:" + e.getMessage());
}
//有实体id则插入关系,用于编辑
if (Common.isNotNull(domain)) {
url = ossUtil.getObjectUrl(null, attaInfo.getAttaSrc());
fileVo = new FileVo(attaInfo.getId(), attaInfo.getAttaName(), url.toString());
return R.ok(fileVo, "success");
}
url = ossUtil.getObjectUrl(null, attaInfo.getAttaSrc());
fileVo = new FileVo(attaInfo.getId(), attaInfo.getAttaName(), url.toString());
return R.ok(fileVo, "success");
} else {
return R.failed("fail:上传失败");
}
}
private R<FileVo> uploadImg2(InputStream fileIn, String filePath, Integer type, String domain,String fileName) throws IOException {
if (null == fileIn) {
return R.failed("文件上传异常,请重新上传!");
}
if (Common.isEmpty(fileName)) {
return R.failed("文件名不能为空!");
}
//filePath不传默认存储空间的根目录
//jpg,jpeg,png,bmp
String key = System.currentTimeMillis() + fileName;
boolean flag = ossUtil.uploadFileByStream(fileIn, key, null);
FileVo fileVo;
TCspAttaInfo attaInfo;
URL url;
if (flag) {
attaInfo = initUnitAttaForInsert(fileName, key, 0);
attaInfo.setRelationType(String.valueOf(type));
try {
attaInfo.setDomainId(domain);
attaInfo = tAttaInfoService.add(attaInfo);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
return R.failed("fail:" + e.getMessage());
}
//有实体id则插入关系,用于编辑
if (Common.isNotNull(domain)) {
url = ossUtil.getObjectUrl(null, attaInfo.getAttaSrc());
fileVo = new FileVo(attaInfo.getId(), attaInfo.getAttaName(), url.toString());
return R.ok(fileVo, "success");
}
url = ossUtil.getObjectUrl(null, attaInfo.getAttaSrc());
fileVo = new FileVo(attaInfo.getId(), attaInfo.getAttaName(), url.toString());
return R.ok(fileVo, "success");
} else {
return R.failed("fail:上传失败");
}
}
/**
* 对象初始化
* @param fileName
* @param key
* @param fileSize
* @return
*/
private TCspAttaInfo initUnitAttaForInsert(String fileName, String key, long fileSize) {
TCspAttaInfo unitAtta = new TCspAttaInfo();
char slash = '/';
char point = '.';
if (fileName.lastIndexOf(slash) >= 0) {
unitAtta.setAttaName(fileName.substring(fileName.lastIndexOf(slash)));
} else {
unitAtta.setAttaName(fileName);
}
unitAtta.setAttaSize(fileSize);
unitAtta.setAttaSrc(key);
if (key.lastIndexOf(point) >= 0) {
unitAtta.setAttaType(key.substring(key.lastIndexOf(point)));
}
unitAtta.setCreateTime(LocalDateTime.now());
return unitAtta;
}
/**
* @Author fxj
* @Description 整合接口
* @Date 15:24 2024/9/24
* @Param
* @return
**/
@Override
public R uploadAsso(MultipartFile file, String filePath, Integer type, String domain, String uploadType){
return getR(file, filePath, type, domain, uploadType);
}
public R getR(MultipartFile file, String filePath, Integer type, String domain, String uploadType) {
maxLimit = configLimitMapper.getSysConfigLimitByKey("UPLOAD_MAX_LIMIT");
if (atomicInteger.incrementAndGet() <= maxLimit){
try {
if (CommonConstants.ZERO_STRING.equals(uploadType)){
return uploadImg(file, filePath, type, domain);
}else if (CommonConstants.ONE_STRING.equals(uploadType)){
return uploadFileReturnAtta(file, filePath, type, domain);
}
}catch (Exception e){
log.error("附件上传异常:",e);
}finally {
atomicInteger.decrementAndGet();
}
}else {
atomicInteger.decrementAndGet();
log.error("超出阈值:"+ResultConstants.FILE_UPLOADING_DATA);
return R.failed(ResultConstants.FILE_UPLOADING_DATA);
}
return null;
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.csp.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.csp.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.csp.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.csp.vo.TAttaInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
/**
* 附件信息表
*
* @author pwang
* @date 2021-02-19 16:16:07
*/
@Service
public class TAttaInfoServiceImpl extends ServiceImpl<TAttaInfoMapper, TCspAttaInfo> implements TAttaInfoService {
@Autowired
private OSSUtil ossUtil;
/**
* 附件信息表简单分页查询
*
* @param tAttaInfo 附件信息表
* @return
*/
@Override
public IPage<TCspAttaInfo> getTAttaInfoPage(Page<TCspAttaInfo> page, TCspAttaInfo tAttaInfo) {
return baseMapper.getTAttaInfoPage(page, tAttaInfo);
}
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
@Override
public List<TCspAttaInfo> getTAttaInfoList(TCspAttaInfo tAttaInfo) {
return baseMapper.getTAttaInfoList(tAttaInfo);
}
@Override
public List<TCspAttaInfo> getTAttaInfoListByDoMainId(String domainId) {
return baseMapper.getTAttaInfoListByDoMainId(domainId);
}
@Override
public TCspAttaInfo add(TCspAttaInfo attaInfo) {
this.save(attaInfo);
return attaInfo;
}
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
@Override
public void update(List<TCspAttaInfo> attaInfoList, String domainId, String relationType) {
if (attaInfoList != null) {
for (TCspAttaInfo attaInfo : attaInfoList) {
attaInfo.setDomainId(domainId);
attaInfo.setRelationType(relationType);
this.updateById(attaInfo);
}
}
}
/**
* @Author fxj
* @Description
* @Date 13:48 2022/6/17
* @Param
* @return
**/
@Override
public Boolean batchOssFileDelete(List<TCspAttaInfo> delAttaList) {
try {
for (TCspAttaInfo delAtta : delAttaList) {
if (this.removeById(delAtta.getId())) {
ossUtil.deleteObject(null, delAtta.getAttaSrc());
}
}
return true;
} catch (Exception e) {
log.error("附件删除异常:" + e.getMessage());
return false;
}
}
@Override
public List<TCspAttaInfo> getKeenAtta(LocalDateTime dayStart, Collection<String> values) {
return baseMapper.getKeenAtta(dayStart,values);
}
@Override
public Boolean updateDomainId(String domainId, List<String> ids){
if (Common.isEmpty(domainId) || !Common.isNotEmpty(ids)){
return false;
}
return baseMapper.updateDomainId(domainId,ids) > 0;
}
@Override
public R<List<TCspAttaInfo>> getAttaByApplyId(String applyId) {
List<TCspAttaInfo> list = baseMapper.getAttaByApplyId(applyId);
if (Common.isNotNull(list)) {
URL url;
for (TCspAttaInfo atta:list) {
url = ossUtil.getObjectUrl(null, atta.getAttaSrc());
atta.setAttaUrl(url.toString());
}
return R.ok(list);
}else{
return R.failed("没有附件");
}
}
@Override
public void deleteByDomainId(String domainId) {
baseMapper.deleteByDomainId(domainId);
}
@Override
public void deleteByDomainIdExceptionCard(String domainId) {
baseMapper.deleteByDomainIdExceptionCard(domainId);
}
@Override
public void deleteByDomainIdAndOther(String domainId) {
baseMapper.deleteByDomainIdAndOther(domainId);
}
@Override
public void deleteByDomainIdCard(String domainId) {
baseMapper.deleteByDomainIdCard(domainId);
}
@Override
public void deleteByDomainIdAndType(String domainId, int relationType) {
// 学历
if (relationType == 0) {
baseMapper.deleteByDomainIdAndType(domainId, "0");
baseMapper.deleteByDomainIdAndType(domainId, "26");
} else if (relationType == 1) {
// 执业资格证书
baseMapper.deleteByDomainIdAndType(domainId, "2");
} else if (relationType == 2) {
// 其他附件
baseMapper.deleteByDomainIdAndType(domainId, "27");
}
}
@Override
public List<TAttaInfoVo> getAttInfoByParam(String departNo, String startDate, String endDate) {
return baseMapper.getAttInfoByParam(departNo,startDate,endDate);
}
@Override
public int getAttInfoCountByParam(String departNo, String startDate, String endDate) {
return baseMapper.getAttInfoCountByParam(departNo,startDate,endDate);
}
}
<?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.csp.mapper.SysConfigLimitMapper">
<resultMap id="sysConfigLimitMap" type="com.yifu.cloud.plus.v1.csp.entity.SysConfigLimit">
<id property="id" column="ID"/>
<result property="configKey" column="CONFIG_KEY"/>
<result property="configValue" column="CONFIG_VALUE"/>
<result property="remark" column="REMARK"/>
</resultMap>
<!-- 根据key获取value -->
<select id="getSysConfigLimitByKey" resultType="java.lang.Integer">
SELECT a.CONFIG_VALUE
FROM sys_config_limit a
where a.CONFIG_KEY = #{configKey} limit 1
</select>
</mapper>
<?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.csp.mapper.TAttaInfoMapper">
<resultMap id="tAttaInfoMap" type="com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo">
<id property="id" column="id"/>
<result property="attaName" column="atta_name"/>
<result property="attaSrc" column="atta_src"/>
<result property="attaSize" column="atta_size"/>
<result property="attaType" column="atta_type"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="relationType" column="relation_type"/>
<result property="domainId" column="domain_id"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.atta_name,
a.atta_src,
a.atta_size,
a.atta_type,
a.create_by,
a.create_time,
a.relation_type,
a.domain_id
</sql>
<sql id="tAttaInfo_where">
<if test="tAttaInfo != null">
<if test="tAttaInfo.id != null and tAttaInfo.id.trim() != ''">
AND a.id = #{tAttaInfo.id}
</if>
<if test="tAttaInfo.attaName != null and tAttaInfo.attaName.trim() != ''">
AND a.atta_name = #{tAttaInfo.attaName}
</if>
<if test="tAttaInfo.attaSrc != null and tAttaInfo.attaSrc.trim() != ''">
AND a.atta_src = #{tAttaInfo.attaSrc}
</if>
<if test="tAttaInfo.attaSize != null">
AND a.atta_size = #{tAttaInfo.attaSize}
</if>
<if test="tAttaInfo.attaType != null and tAttaInfo.attaType.trim() != ''">
AND a.atta_type = #{tAttaInfo.attaType}
</if>
<if test="tAttaInfo.createBy != null and tAttaInfo.createBy.trim() != ''">
AND a.create_by = #{tAttaInfo.createBy}
</if>
<if test="tAttaInfo.createTime != null">
AND a.create_time = #{tAttaInfo.createTime}
</if>
<if test="tAttaInfo.relationType != null and tAttaInfo.relationType.trim() != ''">
AND a.relation_type = #{tAttaInfo.relationType}
</if>
<if test="tAttaInfo.domainId != null and tAttaInfo.domainId.trim() != ''">
AND a.domain_id = #{tAttaInfo.domainId}
</if>
</if>
</sql>
<!--tAttaInfo简单分页查询-->
<select id="getTAttaInfoPage" resultMap="tAttaInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_atta_info a
<where>
1=1
<include refid="tAttaInfo_where"/>
</where>
</select>
<!--tAttaInfo 获取list-->
<select id="getTAttaInfoList" resultMap="tAttaInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_atta_info a
<where>
1=1
<include refid="tAttaInfo_where"/>
</where>
</select>
<!--根据domainId 获取list-->
<select id="getTAttaInfoListByDoMainId" resultMap="tAttaInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_atta_info a
where a.domain_id = #{domainId}
</select>
<select id="getKeenAtta" resultMap="tAttaInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_atta_info a
<where>
1=1
<if test="values != null and values.size() > 0">
and a.domain_id in
<foreach collection="values" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
and a.create_time >= #{dayStart}
and a.relation_type in ("3","4")
</where>
</select>
<update id="updateDomainId">
update t_atta_info
<trim prefix="set" suffixOverrides=",">
domain_id=#{domainId}
</trim>
WHERE
<if test="ids != null and ids.size() > 0">
id in
<foreach collection="ids" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
</update>
<select id="getAttaByApplyId" resultMap="tAttaInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_atta_info a
where EXISTS (select 1 from m_salary_prova_atta b where b.SALARY_PROVA_ID = #{applyId} and a.id = b.ATTA_ID);
</select>
<delete id="deleteByDomainId">
delete from t_atta_info where domain_id=#{domainId}
</delete>
<!-- 详档变简档,删除身份证、其他附件、签名之外的附件 -->
<delete id="deleteByDomainIdExceptionCard">
delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('9','24','27','21','22')
</delete>
<delete id="deleteByDomainIdAndType">
delete from t_atta_info where domain_id=#{domainId} and relation_type = #{relationType}
</delete>
<delete id="deleteByDomainIdAndOther">
delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('0','2','26','27')
</delete>
<!-- 简档,仅删除身份证附件和(21(预入职申明签名);22(预入职确认签名);23(预入职pdf文) -->
<delete id="deleteByDomainIdCard">
delete from t_atta_info where domain_id=#{domainId} and relation_type in ('9','24','21','22','23')
</delete>
<select id="getAttInfoByParam" resultType="com.yifu.cloud.plus.v1.csp.vo.TAttaInfoVo">
SELECT
b.id,
b.atta_name,
b.atta_src,
b.atta_size,
b.atta_type,
b.create_by,
b.create_time,
b.relation_type,
b.domain_id, a.EMP_NAME,a.EMP_IDCARD
from (select id,EMP_NAME,EMP_IDCARD from t_pre_emp_main where `STATUS`='4' and SOUR_TYPE='0'
and DEPT_NO=#{departNo}
and AUDIT_TIME >= #{startDate}
and AUDIT_TIME <![CDATA[ <= ]]> #{endDate}) a
LEFT JOIN (select * from t_atta_info where RELATION_TYPE ='23' GROUP BY DOMAIN_ID ) b on a.id=b.DOMAIN_ID
where b.DOMAIN_ID is not null
</select>
<select id="getAttInfoCountByParam" resultType="java.lang.Integer">
SELECT
count(1)
from (select id from t_pre_emp_main where `STATUS`='4' and SOUR_TYPE='0'
and DEPT_NO = #{departNo}
and AUDIT_TIME >= #{startDate}
and AUDIT_TIME <![CDATA[ <= ]]> #{endDate}) a
LEFT JOIN (select * from t_atta_info where RELATION_TYPE ='23' GROUP BY DOMAIN_ID ) b on a.id=b.DOMAIN_ID
where b.DOMAIN_ID is not null
</select>
</mapper>
......@@ -91,7 +91,7 @@ public class EkpBankAtta {
@ExcelProperty("链接ID")
private String fdLinkId;
/**
* 类型:1:银企付款主表;2:银企付款明细表
* 类型:1:银企付款主表;2:银企付款明细表 3:银企付款回单
*/
@ExcelAttribute(name = "类型")
@HeadFontStyle(fontHeightInPoints = 11)
......
......@@ -56,6 +56,15 @@ public class EkpFundInfo {
@Schema(description ="项目名称")
private String fd_3adfe8c8468e54;
/**
* 项目编码-原
**/
private String fd_3cfe2da7e35daa;
/**
* 项目名称-原
**/
private String fd_3cfe2db5015d6e;
@Schema(description ="单号")
private String fd_3adfe95c169c48;
......
package com.yifu.cloud.plus.v1.ekp.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBankAtta;
import com.yifu.cloud.plus.v1.ekp.service.EkpBankAttaService;
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.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.net.URL;
/**
* @author hgw拷贝自档案的附件
* 文件上传接口
*/
@RestController
@RequestMapping("/fileUpload")
@Tag(name = "文件上传下载接口")
@Slf4j
public class FileUploadController {
@Autowired
private OSSUtil ossUtil;
@Autowired
private EkpBankAttaService ekpBankAttaService;
/**
* 根据wxNo(皖信编号)获取银企付款的回单:
*
* @return R
* @author hgw
*/
@Operation(summary = "根据wxNo(皖信编号)获取银企付款的回单:--EKP调用接口", description = "根据wxNo(皖信编号)获取银企付款的回单:--EKP调用接口")
@SysLog("根据wxNo(皖信编号)获取银企付款的回单:--EKP调用接口")
@GetMapping("/getAttaListBySalaryId")
public R<String> getAttaListBySalaryId(@RequestParam String wxNo) {
String returnUrl = null;
EkpBankAtta atta = ekpBankAttaService.getOne(Wrappers.<EkpBankAtta>query().lambda()
.eq(EkpBankAtta::getFdLinkId, wxNo).last(CommonConstants.LAST_ONE_SQL));
if (atta != null && Common.isNotNull(atta.getFdAttaSrc())) {
URL url = ossUtil.getObjectUrl(null, atta.getFdAttaSrc());
returnUrl = String.valueOf(url).replace("http", "https");
}
return R.ok(returnUrl);
}
}
......@@ -15,6 +15,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URISyntaxException;
/**
* 聚富通代发工资相关
......@@ -136,9 +138,16 @@ public class IcbcTransactionFlowIssueController {
return icbcTransactionFlowIssueService.doGetEkpBankStatus();
}
@Operation(summary = "获取回单文件", description = "获取回单文件")
@PostMapping("/getPdfFile")
public void getPdfFile() {
icbcTransactionFlowIssueService.getPdfFile();
@Operation(summary = "定时任务获取回单文件", description = "定时任务获取回单文件")
@Inner
@PostMapping("/inner/getPdfFile")
public R getPdfFile() throws IOException {
return icbcTransactionFlowIssueService.getPdfFile();
}
@Operation(summary = "定时任务获取回单文件", description = "定时任务获取回单文件")
@PostMapping("/getTestPdfFile")
public R getPdfFileTest() throws IOException {
return icbcTransactionFlowIssueService.getPdfFile();
}
}
......@@ -8,6 +8,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 聚富通代发工资相关
......@@ -75,6 +76,6 @@ public interface IcbcTransactionFlowIssueService extends IService<EkpSocialInfo>
**/
R<String> doGetEkpBankStatus();
void getPdfFile();
R getPdfFile() throws IOException;
}
......@@ -229,6 +229,10 @@ public class EkpFundInfoServiceImpl extends ServiceImpl<EkpFundInfoMapper, EkpFu
socialInfo.setFd_3adfe8c70d3fd4(socialParam.getFd_3adfe8c70d3fd4());
//项目名称
socialInfo.setFd_3adfe8c8468e54(socialParam.getFd_3adfe8c8468e54());
//项目编码-原 fxj 20240527 add
socialInfo.setFd_3cfe2da7e35daa(socialParam.getFd_3adfe8c70d3fd4());
//项目名称-原 fxj 20240527 add
socialInfo.setFd_3cfe2db5015d6e(socialParam.getFd_3adfe8c8468e54());
//单号
socialInfo.setFd_3adfe95c169c48(socialParam.getFd_3adfe95c169c48());
//客户编码
......
-----BEGIN RSA PRIVATE KEY-----
MIIG4gIBAAKCAYEAs3PHK4rFlPFJnJ2COJV7HyrgP0aVxaFPyKKqjy9zapcuHCF4
4cQE7GEe90kG5esFCjenuRZphgaVbCLrA2XdXlMl/94i6r5P1WkVEfWnH7Jf0Ljv
TRKJJ2MVQaiI4wTWay6Sj7CDEZAUH73VZyr+XOreBZEwIXPanV7TJpslrHf3fb5Z
gIBhCETHWikpiI2ZLZrs9yzBQYUlshRXtNpMEeGGK+m+aKyYi7xduGzjGJg2f+xd
yS0981lhAQMu8Q/XNZPCpA2keQhQ7GmzEe2ZnqfFvRd2Nwn0tAgv5N8Zsi3WdGyt
ro4OW9n09SOS4nr95dOtsOzx1267B8ApKjeUXZL7sxKxH//S/WLIdG4NFjLvmlZX
2joq5zvaqjCtormQliDjT8YY/tI88r2leaW6lag4dJtbyj8ju+El8RtYXRK3auS0
ZBdHQSJqbFi8wKLN0vm/cIX3OdKkqFGvSL2SGuifXUPEh/s6rPILdGUbDH3h+tAv
3zXcEzZjAKopgK+fAgMBAAECggGAH5zAtFnw7okG97EDlKY4l0f9UwhDMBp3rJeD
RlAMm/Vf6RK4ccUPPPjq9JMHxQ7+x0sAn+lj03lrby5Dikiyk4BATG+8ZO/7rlOh
o5VLyJiqqmE5vrEKOkcJIpTm8F8UyrLcnLVykXB5KxJM+qynPIUfcYmfGfWHyHtA
5SclntlPXvZeW/XBoixDlg10RJr1JgSJxA09SiaDenh87t4Z0niRI0E9CsGE6fDX
7bo400dVKnngF6WBqVHQddYyucKZUjLGKTeF0gkPlCLhSxYUxO7AclL5z2noNy7E
StRNmuVVr9uur6HUhLIlnsPbilBF60MUDN6SWyGaveX7DyXlBla1vPx2J7NG7waw
/pYZZ+gamLEjRpfS2nsOl3jgRZLlh+6hErJnPioF8/cGoridhAGjgcF07Bf1xXyj
EjCMVqcI/qW2i20cJ0rIvEIpjvUOgq0ptxiRgmYwPBQSO04Gb91gWEyQdAh7z8vC
cHrsH036DgnW6Vo8iWrrNRJsVVF5AoHBAOLUiTfE30cKtlfuO1hAQUOWeodoM9zi
mgaqjrK6p+d4D2FcZnW2gDyzUdrP1Jo3YefJq2Mcurmh/0DeaNcdr9VptLM5OI5m
6rgreZtaAD+dihyrMhRXBLrlslWSrv717qvfGR6LVAP73Leasdtevi8dqSwK83ir
E9VOtPDjIsUgxd2UAlAwPWZy3HPfDU1Cu25kbJWKLU4akLaCee8XnC6MXX3jI9+G
5+jaNx20jtDKNrPUy72igrtqsmA3ixzqDQKBwQDKh4PW54OMLOM3znpdYVXk4+Ue
U27p2SHXzq9UaQqiLVmCCWoSn+UTrBLoF5mw88FYBYuKZsAR+1ilwof0h5WK5QBn
YD31gRQJCzm1uxDOp/eZvzGTWa6U3gRDgrQ8UXpWjT+HyWUFGR4KpGmzcq+TX7U8
nPFor7dZfcjyeuW3zQ2+CcdRRBFzd3nE4OM/Ke87DvZLgsVxPGvK3WpFfIA0E1ge
0c9G48YWWKlLG1MsmVzTMPFU4hd4q3UF4VjhMVsCgcAWDPlF7aKTAmyVgbhNLPnr
Ox6wOSYJjBHTIhN7NoAKFXbRTS08tkAjJn+HmPqe/1FKOiWqHendD+2DfduNRfqI
8Zy6a46e8UxSGQ/aVVZ+2K7LeK0Goyr3jErY3MicSoYoOSj0+jBxrrNXOfeeTsiI
RgbjHDFtApyL+PnIDRydM0Fo9/F9oCLn6bSaow1k/F7CLYsMwoEC/bwhse9umcn6
EHUqPsGHAlNbJJOFFL9pdq74rnAcAEdbNtUeW2fvqKUCgcBhvxHEUKxOpQNs1bx9
ARNBizPzdPUc6+zHiTtZk/DL4PNILV8CaiVXXz8owOsuWhbAcrysKXcdtp9MMR0I
yb9E781IF00QBiIzUzWhHg24j5ySmZJFuYzm0FhidNykF/bhev5kfLDCyyKSpFNX
hkxy5khEXsKscdId4PVxAhuIn/C3/WQzNpTtk4YznQ5QV97cNBZuz0iXpD+qAz7d
Fn+RopxvE3fkkN3zvwrF8wQrjEEetIplG1GUrbunAOGyne0CgcAfcne0tzujrxDX
a9sZEbllAa9j2b/SL427omCshgcYXwb529+78HAJ+RQ4d8TJNqzPnyTdfqxfXiUs
HwA4Vj6IbkCHbHyQGxkw/+b5mcbSOoEEsORJ7x0Z0c3bYNZ7h+KVqT7+Gq4qTrrL
eYRwkb0L5crDcneu6N35cI0w7wzBjfAUFxhCrtgcSaPF8yFfKdCF4foxwms4uFtg
zf7Ipcf7jd20uJkZ5tlFIWmbZtc0v9ulYkKD8eS5ilH+hy56C3U=
-----END RSA PRIVATE KEY-----
......@@ -124,6 +124,12 @@ public class InsuranceAddParam implements Serializable {
@Schema(description = "商险待购买id")
private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
......
......@@ -151,4 +151,9 @@ public class InsuranceAutoParam implements Serializable {
@Schema(description = "商险待购买id")
private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
}
......@@ -119,6 +119,12 @@ public class InsuranceBatchParam implements Serializable {
@Schema(description = "商险待购买id")
private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
......
......@@ -107,6 +107,12 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "商险待购买id")
private String insurancePreId;
/**
* 前端客服姓名
*/
@Schema(description = "前端客服姓名")
private String customerUserName;
/**
* 数据传递对象
*/
......
......@@ -54,4 +54,11 @@ public class InsuranceSearchVo extends TBusinessInsuranceVo{
*/
@Schema(description = "消息提醒人ID")
private String alertId;
/**
* 项目权限NO
*/
@Schema(description = "项目权限ID")
private List<String> settleDomainIds;
}
......@@ -26,4 +26,6 @@ public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
List<InsuranceAlertWx> getInsuranceAlertToWx();
List<TInsuranceAlert> selectInsuranceAlertIgnore();
}
......@@ -207,6 +207,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setPost(insurancePre.getPosition());
addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParamList.add(addParam);
}
if (CommonConstants.THREE_INT == insurancePre.getBuyType()) {
......@@ -224,6 +225,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setPost(insurancePre.getPosition());
addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
batchAddParamList.add(addParam);
}
if (CommonConstants.FOUR_INT == insurancePre.getBuyType()) {
......@@ -242,6 +244,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setReplaceEmpIdcardNo(insurancePre.getEmpIdcard());
addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
replaceAddParamList.add(addParam);
}
}
......@@ -488,6 +491,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setRemark(addParam.getRemark());
autoParam.setErrorMessage(addParam.getErrorMessage());
autoParam.setInsurancePreId(addParam.getInsurancePreId());
autoParam.setCustomerUserName(addParam.getCustomerUserName());
return autoParam;
}
......@@ -508,6 +512,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setRemark(batchParam.getRemark());
autoParam.setErrorMessage(batchParam.getErrorMessage());
autoParam.setInsurancePreId(batchParam.getInsurancePreId());
autoParam.setCustomerUserName(batchParam.getCustomerUserName());
return autoParam;
}
......@@ -528,6 +533,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setReplaceEmpIdcardNo(replaceParam.getReplaceEmpIdcardNo());
autoParam.setErrorMessage(replaceParam.getErrorMessage());
autoParam.setInsurancePreId(replaceParam.getInsurancePreId());
autoParam.setCustomerUserName(replaceParam.getCustomerUserName());
return autoParam;
}
......
......@@ -60,6 +60,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
List<TInsuranceAlert> list = baseMapper.selectInsuranceAlert();
//获取所有在用的(未删除未锁定)MVP的用户信息
String userIds;
R<Set<String>> onlineSetTemp;
if (Common.isNotKong(list)){
try {
SysConfig sysConfig = sysConfigMapper.getSysConfigLimitByKey(InsurancesConstants.INSURANCE_ALERT_DEFAULT_PERSON);
......@@ -96,46 +97,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
log.error("商险不购买提醒初始化停用客服异常:",e);
}
//处理已经离职数据,分批请求,每次请求1000条数据,返回在职人员信息
R<Set<String>> onlineSetTemp = new R<>();
if (list.size() <= 2000){
onlineSetTemp = archivesDaprUtil.getEmpOnlineMap(list.stream().map(TInsuranceAlert::getEmpIdcardNo).collect(Collectors.toList()));
}else {
// 提前提取身份证号列表,避免重复 stream 操作
List<String> idCardNoList = list.stream()
.map(TInsuranceAlert::getEmpIdcardNo)
.collect(Collectors.toList());
int batchSize = 2000;
int totalSize = idCardNoList.size();
// 初始化 onlineSetTemp,防止 NullPointerException
if (onlineSetTemp == null) {
onlineSetTemp = new R<>(); // 替换为实际类型
}
R<Set<String>> onlineSet;
Set<String> temp = new HashSet<>();
for (int i = 0; i < totalSize; i++) {
if (i % batchSize == 0) {
// 计算当前批次的结束索引
int end = Math.min(i + batchSize, totalSize);
// 获取当前批次的数据
List<String> subList = idCardNoList.subList(i, end);
// 调用接口获取在职人员信息
onlineSet = archivesDaprUtil.getEmpOnlineMap(subList);
// 判空处理
if (onlineSet != null && onlineSet.getData() != null && Common.isNotNull(onlineSet.getData())) {
temp.addAll(onlineSet.getData());
}
}
}
if (temp != null){
onlineSetTemp.setData(temp);
}
}
onlineSetTemp = new R<>();
onlineSetTemp = getSetR(list, onlineSetTemp);
//如果不存在离职人员直接走生成逻辑
if (Common.isNotKong(onlineSetTemp.getData())){
// 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
......@@ -147,6 +110,59 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
this.saveOrUpdateBatch(list);
}
}
//批量删除已忽略且人员离职的数据
List<TInsuranceAlert> listIgnore = baseMapper.selectInsuranceAlertIgnore();
onlineSetTemp = new R<>();
onlineSetTemp = getSetR(listIgnore, onlineSetTemp);
if (Common.isNotKong(onlineSetTemp.getData())){
//批量删除已忽略且人员离职的数据
baseMapper.delete(Wrappers.<TInsuranceAlert>query().lambda()
.in(TInsuranceAlert::getEmpIdcardNo, onlineSetTemp.getData()));
}
}
private R<Set<String>> getSetR(List<TInsuranceAlert> list, R<Set<String>> onlineSetTemp) {
if (list.size() <= 2000){
onlineSetTemp = archivesDaprUtil.getEmpOnlineMap(list.stream().map(TInsuranceAlert::getEmpIdcardNo).collect(Collectors.toList()));
}else {
// 提前提取身份证号列表,避免重复 stream 操作
List<String> idCardNoList = list.stream()
.map(TInsuranceAlert::getEmpIdcardNo)
.collect(Collectors.toList());
int batchSize = 2000;
int totalSize = idCardNoList.size();
// 初始化 onlineSetTemp,防止 NullPointerException
if (onlineSetTemp == null) {
onlineSetTemp = new R<>(); // 替换为实际类型
}
R<Set<String>> onlineSet;
Set<String> temp = new HashSet<>();
for (int i = 0; i < totalSize; i++) {
if (i % batchSize == 0) {
// 计算当前批次的结束索引
int end = Math.min(i + batchSize, totalSize);
// 获取当前批次的数据
List<String> subList = idCardNoList.subList(i, end);
// 调用接口获取在职人员信息
onlineSet = archivesDaprUtil.getEmpOnlineMap(subList);
// 判空处理
if (onlineSet != null && onlineSet.getData() != null && Common.isNotNull(onlineSet.getData())) {
temp.addAll(onlineSet.getData());
}
}
}
if (temp != null){
onlineSetTemp.setData(temp);
}
}
return onlineSetTemp;
}
/**
......
......@@ -1867,6 +1867,13 @@
#{param}
</foreach>
</if>
<if test="param.settleDomainIds != null and param.settleDomainIds.size() > 0">
and a.DEPT_NO in
<foreach collection="param.settleDomainIds" item="param" index="index" open="(" close=")"
separator=",">
#{param}
</foreach>
</if>
</if>
</where>
......
......@@ -154,6 +154,16 @@
select a.DEPT_NAME,a.DEPT_NO,
SUM(case when a.IS_OVERDUE='0' THEN 1 ELSE 0 END) as 'lq',
SUM(CASE WHEN a.IS_OVERDUE='1' THEN 1 ELSE 0 END) as 'gq'
from t_insurance_alert a GROUP BY a.DEPT_NO
from t_insurance_alert a where a.EXPIRE_IGNORE_FLAG = '1' and a.DELETE_FLAG='0' GROUP BY a.DEPT_NO
</select>
<select id="selectInsuranceAlertIgnore" resultMap="BaseResultMap">
SELECT
a.ID,
a.EMP_NAME,
a.EMP_IDCARD_NO
FROM
t_insurance_alert a
where a.DELETE_FLAG = '0' and a.EXPIRE_IGNORE_FLAG = '0'
</select>
</mapper>
......@@ -60,5 +60,16 @@ public class EkpTask {
log.info("------------每小时获取银企付款结果-定时任务结束------------");
}
/**
* @Author huyc
* @Description 生成昨日的回单文件
* @Date 2025-5-19 15:21:28
* @Param
* @return
**/
public void doCreateYesterdayPdfFile() {
log.info("------------定时生成生成昨日的回单文件-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprEkpProperties.getAppUrl(),daprEkpProperties.getAppId(),"/icbcIssue/inner/getPdfFile","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成生成昨日的回单文件-定时任务结束------------");
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* Hcm查询工资表的入参
*
* @author hgw
* @date 2019-07-30 15:00:05
*/
@Data
public class HcmSalarySearchVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "身份证集合")
List<String> idCardList;
@Schema(description = "工资月份")
String salaryMonth;
}
......@@ -20,6 +20,10 @@ public class SalaryUploadParamVo {
// 结算主体id;必填
String settleDepart;
// HCM使用的
String settleDepartNo;
// HCM使用的
String createUserLoginName;
// 工资配置结算月等信息的id
String configId;
......
package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.service.SalaryUploadService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.HcmSalarySearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryUploadParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryDetailVo;
import io.swagger.v3.oas.annotations.Operation;
......@@ -29,11 +32,8 @@ public class SalaryUploadController {
private final SalaryUploadService salaryUploadService;
/**
* @param jsonString Excel表-JsonString
* @param settleDepart 结算主体id
* @param configId 配置方案id
* @param salaryType 报表类型id
* @Description:
* @param vo : jsonString Excel表-JsonString;settleDepart 结算主体id;configId 配置方案id;salaryType 报表类型id
* @Description: 上传薪资表
* @Author: hgw
* @Date: 2019/9/11 15:21
* @return: com.yifu.cloud.v1.common.core.util.R
......@@ -52,4 +52,27 @@ public class SalaryUploadController {
return salaryUploadService.getBill(salaryFormId);
}
/**
* @param vo : idCardList 身份证list; salaryMonth 工资月
* @Description: HCM查询工资
* @Author: hgw
* @Date: 2025/5/20 20:26
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.baomidou.mybatisplus.core.metadata.IPage < com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>>
**/
@Operation(description = "HCM查询工资")
@PostMapping("/getHcmSalaryByIdCardListAndMonth")
public R<List<TSalaryAccount>> getSalaryByIdCardList(@RequestBody HcmSalarySearchVo vo) {
List<String> idCardList = vo.getIdCardList();
String salaryMonth = vo.getSalaryMonth();
if (Common.isEmpty(salaryMonth)) {
return R.failed("工资月不可为空");
}
if (Common.isEmpty(idCardList) || idCardList.isEmpty()) {
return R.failed("身份证不可为空");
} else if (idCardList.size() > 3000) {
return R.failed("身份证数不可大于3000!");
}
return new R<>(salaryUploadService.getSalaryByIdCardList(idCardList, salaryMonth));
}
}
......@@ -131,6 +131,20 @@ public class TSalaryStandardController {
return tSalaryStandardService.deleteSalaryById(id);
}
/**
* @param id 工资主表ID
* @Description: HCM通过id删除标准薪酬工资表
* @Author: hgw
* @Date: 2025/5/20 19:59
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "HCM通过id删除标准薪酬工资表", description = "通过id删除标准薪酬工资表")
@SysLog("HCM通过id删除标准薪酬工资表")
@GetMapping("/deleteById")
public R<String> deleteById(@RequestParam String id) {
return tSalaryStandardService.deleteSalaryById(id);
}
/**
* 标准薪酬工资表 批量导出
*
......
......@@ -68,6 +68,9 @@ public interface TSalaryAccountItemMapper extends BaseMapper<TSalaryAccountItem>
**/
List<TSalaryAccountItem> getSalaryItemVoList(@Param("idCardList") List<String> idCardList, @Param("invoiceTitle") String invoiceTitle);
// HCM使用
List<TSalaryAccountItem> getSalaryItemVoListByHcm(@Param("accIdList") List<String> accIdList);
/**
* @param deptId 结算主体id
* @param javaFiedName 属性名
......
......@@ -49,6 +49,16 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
IPage<TSalaryAccount> getEmpAccountPage(Page<TSalaryAccount> page, @Param("tSalaryAccount") TSalaryAccountSearchVo tSalaryAccount);
/**
* @param idCardList
* @param salaryMonth
* @Description: 给HCM使用的,按身份证与工资月查询
* @Author: hgw
* @Date: 2025/5/20 20:36
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>
**/
List<TSalaryAccount> getSalaryByIdCardList(@Param("idCardList") List<String> idCardList, @Param("salaryMonth") String salaryMonth);
int getEmpAccountCount(@Param("tSalaryAccount") TSalaryAccountSearchVo tSalaryAccount);
List<TSalaryAccountExportSpecialVo> getEmpAccountExport(@Param("tSalaryAccount") TSalaryAccountSearchVo tSalaryAccount);
......@@ -135,6 +145,10 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
List<SalaryAccountExportVo> noPageDiyLastByIds(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList") List<String> idList);
List<SalaryAccountExportVo> noPageDiyLastNew(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList") List<String> idList,
@Param("deptNos") List<String> deptNos);
List<String> noPageDiyLastIds(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList") List<String> idList,
@Param("deptNos") List<String> deptNos);
......@@ -185,6 +199,10 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
@Param("idList") List<String> idList,
@Param("deptNos")List<String> deptNos);
int noPageCountDiyLastNew(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList") List<String> idList,
@Param("deptNos")List<String> deptNos);
int auditExportCount(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList") List<String> idList);
......
package com.yifu.cloud.plus.v1.yifu.salary.service;
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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryUploadParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryDetailVo;
import java.util.List;
......@@ -28,4 +31,6 @@ public interface SalaryUploadService extends IService<TSalaryStandard> {
R<TSalaryDetailVo> getBill(String salaryFormId);
List<TSalaryAccount> getSalaryByIdCardList(List<String> idCardList, String salaryMonth);
}
......@@ -51,6 +51,9 @@ public interface TSalaryAccountItemService extends IService<TSalaryAccountItem>
**/
Map<String, List<TSalaryAccountItem>> getSalaryItemVoList(List<String> idCardList, String invoiceTitle);
// HCM查明细使用
Map<String, List<TSalaryAccountItem>> getSalaryItemVoListByHcm(List<String> accIdList);
/**
* 工资报账表附加-工资明细简单分页查询
*
......
......@@ -53,6 +53,8 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
**/
IPage<TSalaryAccount> getEmpAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo searchVo);
List<TSalaryAccount> getSalaryByIdCardList(List<String> idCardList, String salaryMonth);
/**
* @Author fxj
* @Description 薪资报账导出统一导出限制
......
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -12,6 +13,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.*;
......@@ -27,6 +29,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -46,13 +50,15 @@ import java.util.concurrent.atomic.AtomicInteger;
@Log4j2
@AllArgsConstructor
@Service("salaryUploadService")
@EnableConfigurationProperties({DaprArchivesProperties.class, DaprSocialProperties.class})
@EnableConfigurationProperties({DaprArchivesProperties.class, DaprSocialProperties.class, DaprUpmsProperties.class})
public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements SalaryUploadService {
private final DaprArchivesProperties archivesProperties;
private final DaprSocialProperties socialProperties;
private final DaprUpmsProperties daprUpmsProperties;
private final TSalaryStandardService tSalaryStandardService;
private final MSalaryEstimateService mSalaryEstimateService;
......@@ -131,13 +137,21 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
// R<List<ErrorMessage>> salaryUpload(String jsonString, String settleDepart, String configId, String salaryType, String orderId)
String jsonString = vo.getJsonString();
String settleDepart = vo.getSettleDepart();
String settleDepartNo = vo.getSettleDepartNo();
String configId = vo.getConfigId();
String salaryType = vo.getSalaryType();
String orderId = vo.getOrderId();
if (Common.isNotNull(jsonString) && Common.isNotNull(settleDepart) && Common.isNotNull(salaryType)) {
R<TSettleDomainSelectVo> sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", settleDepart, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
//String orderId = vo.getOrderId()
if (Common.isNotNull(jsonString) && Common.isNotNull(salaryType)
&& (Common.isNotNull(settleDepart)||Common.isNotNull(settleDepartNo)) ) {
R<TSettleDomainSelectVo> sdr = null;
if (Common.isNotNull(settleDepart)) {
sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoById", settleDepart, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
} else if (Common.isNotNull(settleDepartNo)) {
sdr = HttpDaprUtil.invokeMethodPost(archivesProperties.getAppUrl(), archivesProperties.getAppId()
, "/tsettledomain/inner/getSettleDomainVoByNo", settleDepartNo, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
}
// 结算主体
TSettleDomainSelectVo dept = null;
if (sdr != null && sdr.getData() != null) {
......@@ -168,6 +182,17 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (null == user || null == user.getId()) {
return R.failed("获取登录用户信息失败!");
}
String createUserLoginName = vo.getCreateUserLoginName();
if (Common.isNotNull(createUserLoginName)) {
R<SysUser> userR = HttpDaprUtil.invokeMethodGet(daprUpmsProperties.getAppUrl()
,daprUpmsProperties.getAppId(), "/user/inner/getSysUserByUsername", "?username="
+ createUserLoginName, SysUser.class, SecurityConstants.FROM_IN);
if (null != userR && Common.isNotNull(userR.getData())) {
user = getNewUser(userR.getData());
} else {
return R.failed("获取用户信息失败!登录名:" + createUserLoginName);
}
}
TConfigSalary configSalary;
......@@ -274,6 +299,19 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return R.failed("导入数据不可为空");
}
private YifuUser getNewUser(SysUser user) {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser(user.getUserId(), 1L, "", user.getUsername(),
user.getNickname(), "0", SecurityConstants.BCRYPT + "123456",
user.getPhone(), true, true, true,
true,
"1", authorities, "1",
null, null,
null,null);
}
/**
* @param sav 报账表vo
* @param dept 结算主体
......@@ -2159,5 +2197,25 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
return zeroArr[num] + nowNums;
}
@Override
public List<TSalaryAccount> getSalaryByIdCardList(List<String> idCardList, String salaryMonth) {
List<TSalaryAccount> list = tSalaryAccountService.getSalaryByIdCardList(idCardList, salaryMonth);
if (list != null && !list.isEmpty()) {
List<String> accountIdList = new ArrayList<>();
for (TSalaryAccount a : list) {
accountIdList.add(a.getId());
}
Map<String, List<TSalaryAccountItem>> itemMap = tSalaryAccountItemService.getSalaryItemVoListByHcm(accountIdList);
List<TSalaryAccountItem> itemList;
for (TSalaryAccount a : list) {
itemList = itemMap.get(a.getId());
if (itemList != null) {
a.setSaiList(itemList);
}
}
}
return list;
}
}
......@@ -126,6 +126,24 @@ public class TSalaryAccountItemServiceImpl extends ServiceImpl<TSalaryAccountIte
return itemMap;
}
@Override
public Map<String, List<TSalaryAccountItem>> getSalaryItemVoListByHcm(List<String> accIdList) {
List<TSalaryAccountItem> list = baseMapper.getSalaryItemVoListByHcm(accIdList);
Map<String, List<TSalaryAccountItem>> itemMap = new HashMap<>();
if (list != null && !list.isEmpty()) {
List<TSalaryAccountItem> voList;
for (TSalaryAccountItem item : list) {
voList = itemMap.get(item.getSalaryAccountId());
if (voList == null) {
voList = new ArrayList<>();
}
voList.add(item);
itemMap.put(item.getSalaryAccountId(), voList);
}
}
return itemMap;
}
/**
* @param settleDepartId 结算主体id
* @param javaFiedName 属性名
......
......@@ -16,9 +16,14 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -41,6 +46,8 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.compress.utils.Lists;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -115,6 +122,17 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
return baseMapper.getEmpAccountPage(page, searchVo);
}
/**
* @Description: HCM查询
* @Author: hgw
* @Date: 2025-5-20 20:37:48
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount>
**/
@Override
public List<TSalaryAccount> getSalaryByIdCardList(@Param("idCardList") List<String> idCardList, @Param("salaryMonth") String salaryMonth) {
return baseMapper.getSalaryByIdCardList(idCardList, salaryMonth);
}
/**
* @Author fxj
* @Description
......@@ -128,7 +146,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
if (atomicInteger.incrementAndGet() <= maxLimit){
try {
if (CommonConstants.ZERO_INT == type){
listExport(response, searchVo);
listExportNew(response, searchVo);
}else if (CommonConstants.ONE_INT == type){
auditExport(response, searchVo);
} else if (CommonConstants.TWO_INT == type){
......@@ -231,6 +249,95 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
}
}
/**
* 导出员工报账查询结果到Excel
*
* @param response HTTP响应对象,用于输出Excel文件
* @param searchVo 搜索条件对象,用于查询工资账户信息
*/
public void listExportNew(HttpServletResponse response, TSalaryAccountSearchVo searchVo) {
// 生成文件名,包含当前时间戳和文件扩展名
String fileName = "员工报账查询批量导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
// 不可查询项目合集
List<TDeptSee> depts = deptSeeMapper.selectList(Wrappers.<TDeptSee>query().lambda()
.eq(TDeptSee::getCanSee, CommonConstants.ONE_INT));
List<String> deptNos = null;
if (Common.isNotNull(depts)) {
deptNos = depts.stream().map(TDeptSee::getDeptNo).collect(Collectors.toList());
}
// 计算符合条件的记录总数
long count = baseMapper.noPageCountDiyLastNew(searchVo,searchVo.getIdList(), deptNos);
try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION,
CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 非管理员导出大于100W提示
if (count > 1000000) {
out.write(CommonConstants.SOCIAL_EXPORT_LIMIT.getBytes("GBK"));
return;
}
// 使用SXSSF模式,设置缓存行数为100,减少内存占用
ExcelWriterBuilder writerBuilder = EasyExcel.write(out, TSalaryAccount.class)
.registerWriteHandler(new SheetWriteHandler() {
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder,
WriteSheetHolder writeSheetHolder) {
// 启用SXSSF模式
if (writeWorkbookHolder.getWorkbook() instanceof SXSSFWorkbook) {
((SXSSFWorkbook) writeWorkbookHolder.getWorkbook()).setCompressTempFiles(true);
}
}
})
.autoCloseStream(true)
.inMemory(false) // 设置为false以启用磁盘缓存
.includeColumnFiledNames(searchVo.getExportFields());
ExcelWriter excelWriter = writerBuilder.build();
int sheetIndex = 0;
WriteSheet writeSheet = EasyExcel.writerSheet("工资报账主表(工资条)" + sheetIndex).build();
// 分批查询和写入
if (count > CommonConstants.ZERO_INT) {
int batchSize = 100000;
int totalPages = (int) Math.ceil((double) count / batchSize);
List<SalaryAccountExportVo> batchList;
for (int page = 1; page <= totalPages; page++) {
// 每10万条数据切换一个新sheet,防止单个sheet过大
if ((page - 1) * batchSize % 100000 == 0 && (page - 1) * batchSize > 0) {
sheetIndex++;
writeSheet = EasyExcel.writerSheet("工资报账主表(工资条)" + sheetIndex).build();
}
// 设置分页参数
searchVo.setLimitStart((page - 1) * batchSize);
searchVo.setLimitEnd(batchSize);
batchList = baseMapper.noPageDiyLastNew(searchVo,searchVo.getIdList(),deptNos);
if (Common.isNotNull(batchList)) {
excelWriter.write(batchList, writeSheet);
// 及时清空批次数据
batchList.clear();
}
}
} else {
excelWriter.write(new ArrayList<>(), writeSheet);
}
excelWriter.finish();
out.flush();
} catch (Exception e) {
log.error("执行异常", e);
throw new RuntimeException("导出失败", e);
}
}
/**
* 审核人导出
*
......
......@@ -845,6 +845,10 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
socialParam.setFd_3adfe8c70d3fd4(account.getFd_3adfedf98ccba2());
//项目名称
socialParam.setFd_3adfe8c8468e54(account.getFd_3adfedf9d2bf1c());
//项目编码-原 fxj 20240527 add
socialParam.setFd_3cfe2da7e35daa(account.getFd_3adfedf98ccba2());
//项目名称-原 fxj 20240527 add
socialParam.setFd_3cfe2db5015d6e(account.getFd_3adfedf9d2bf1c());
//单号
socialParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......
......@@ -475,6 +475,18 @@
AND a.DELETE_FLAG = 0 and a.FORM_TYPE in ('0','1','2')
</where>
</select>
<!-- 获取所有数据,组装map,HCM使用 -->
<select id="getSalaryItemVoListByHcm" resultMap="tSalaryAccountItemMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_account_item a
where a.SALARY_ACCOUNT_ID in
<foreach item="item" index="index" collection="accIdList" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getSumByAccountId" resultType="java.util.Map">
SELECT
a.SALARY_ACCOUNT_ID as 'key',
......
......@@ -669,6 +669,17 @@
where a.DELETE_FLAG = 0
<include refid="tSalaryAccount_where"/>
</select>
<!--项目薪酬查询-工资条查询-->
<select id="getSalaryByIdCardList" resultMap="tSalaryAccountMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_salary_account a
where a.DELETE_FLAG = 0 and a.salary_month = #{salaryMonth} and a.EMP_IDCARD in
<foreach item="id" index="index" collection="idCardList" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!--tSalaryAccount简单分页查询-->
<select id="getTSalaryAccountPageDataByIds" resultMap="tSalaryAccountMap">
SELECT
......@@ -1737,6 +1748,91 @@
</if>
</where>
</select>
<!-- 员工报账导出数量查询 huych1.7.11-->
<select id="noPageCountDiyLastNew" resultType="java.lang.Integer">
SELECT
count(1)
FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201' ">
t_salary_account a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
<where>
a.DELETE_FLAG = 0
<include refid="where_export"/>
<if test="deptNos != null and deptNos.size>0">
AND a.DEPT_NO not in
<foreach item="no" index="index" collection="deptNos" open="(" separator="," close=")">
#{no}
</foreach>
</if>
<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
${searchVo.authSql}
</if>
</where>
</select>
<!-- 员工报账导出查询 huych1.7.11-->
<select id="noPageDiyLastNew" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAccountExportVo">
SELECT
a.DEPT_NAME,
a.DEPT_NO,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_PHONE,
a.BANK_NO,
a.BANK_NAME,
ap.AREA_NAME BANK_PROVINCE,
ac.AREA_NAME BANK_CITY,
a.BANK_SUB_NAME,
case a.FORM_TYPE when '0' then '薪资' when '1' then '绩效' when '3' then '劳务费' when '4' then '稿酬' else '其他' end as FORM_TYPE,
a.SALARY_MONTH,
if(ifnull(a.RELAY_SALARY_UNIT,-1) != -1 and a.RELAY_SALARY_UNIT != 0,a.RELAY_SALARY_UNIT,ifnull(a.RELAY_SALARY,0)) RELAY_SALARY,
a.ACTUAL_SALARY,a.SALARY_TAX
FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201'">
t_salary_account a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
inner join (
SELECT
a.id,a.CREATE_TIME
FROM
<if test="searchVo.salaryMonthStart == null or searchVo.salaryMonthStart.trim() >= '202201'">
t_salary_account a
</if>
<if test="searchVo.salaryMonthStart != null and searchVo.salaryMonthStart.trim() &lt; '202201' ">
t_salary_account_hro_2021 a
</if>
<where>
a.DELETE_FLAG = 0
<include refid="where_export"/>
<if test="deptNos != null and deptNos.size>0">
AND a.DEPT_NO not in
<foreach item="no" index="index" collection="deptNos" open="(" separator="," close=")">
#{no}
</foreach>
</if>
<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
${searchVo.authSql}
</if>
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
limit #{searchVo.limitStart},#{searchVo.limitEnd}
</if>
</if>
</where>
) tmp ON a.id = tmp.id
left join sys_area ap on ap.id=a.BANK_PROVINCE
left join sys_area ac on ac.id=a.BANK_CITY
ORDER BY tmp.CREATE_TIME desc
</select>
<!-- 员工报账导出查询 -->
<select id="noPageDiyLast" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryAccountExportVo">
SELECT
......@@ -1784,6 +1880,7 @@
</if>
</where>
</select>
<select id="noPageCountDiyLast" resultType="java.lang.Integer">
SELECT
count(1)
......
......@@ -249,7 +249,7 @@ public class SysHouseHoldInfo extends BaseEntity {
private String mediclPassword;
/**
* 是否配置公章
* 是否配置公章 0有1无
*/
@ExcelAttribute(name = "是否配置公章" )
@Schema(description ="是否配置公章")
......@@ -287,6 +287,15 @@ public class SysHouseHoldInfo extends BaseEntity {
@ExcelProperty("是否单个接口")
private String isSingle;
/**
* 是否自动生成解除劳动合同书 0否1是(是的话,走单个推送,因为税友的减员接口没有批量附件的字段)
*/
@ExcelAttribute(name = "是否自动生成解除劳动合同书" )
@Schema(description ="是否自动生成解除劳动合同书")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否自动生成解除劳动合同书 0否1是")
private String isAutoLeaveDoc;
/**
* 审核人部门
*/
......
......@@ -837,4 +837,13 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("是否单个接口")
private String isSingle;
/**
* 是否自动生成解除劳动合同书 0否1是(是的话,走单个推送,因为税友的减员接口没有批量附件的字段)
*/
@ExcelAttribute(name = "是否自动生成解除劳动合同书" )
@Schema(description ="是否自动生成解除劳动合同书")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("是否自动生成解除劳动合同书 0否1是")
private String isAutoLeaveDoc;
}
......@@ -63,9 +63,15 @@ public class TSocialFriendBackLog {
@Schema(description = "请求ID")
private String requestId;
/**
* @Description: 类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径
* 8社保解除劳动合同9医保解除劳动合同11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取16社保单个图片17医保单个图片
* @Author: hgw
* @Date: 2025/5/27 10:15
**/
@ExcelAttribute(name = "类型")
@ExcelProperty("类型")
@Schema(description = "类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取")
@Schema(description = "类型")
private Integer type;
/**
......
......@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author hgw
......@@ -82,6 +83,10 @@ public class SociaFriendYgsAddVo implements Serializable {
// 企业职工社会保险增员花名册 qyzgshbxzyhmc
private String qyzgshbxzyhmc;
// 单个附件list
private List<String> imgList;
// 自动生成解除劳动证明
private String autoLeaveDoc;
// 当前行政经办区——2025-3-31 10:23:02 盛宇与税友沟通,可以默认安徽省,暂时不用这个字段了,后面有特殊要求再加
/*@ExcelProperty("当前行政经办区
private String dqxzjbq*/
......@@ -109,4 +114,19 @@ public class SociaFriendYgsAddVo implements Serializable {
@ExcelProperty("备案解除二级原因")
private String bajcejyy;
@ExcelProperty("是否单个")
private String isSingle;
@ExcelProperty("是否自动生成解除劳动合同书0否1是")
private String isAutoLeaveDoc;
// 自动生成解除劳动合同书使用的
@ExcelProperty("离职日期")
private String leaveDate;
@ExcelProperty("派单日期")
private String dispatchDate;
@ExcelProperty("项目Id")
private String deptId;
// 用来获取单个推送的附件
@ExcelProperty("派单ID")
private String dispatchId;
}
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -559,6 +560,7 @@ public class TPreDispatchExportVo implements Serializable {
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="创建时间")
@ExcelAttribute(name = "创建时间", needExport = true, isDate = true, dateFormatExport = LocalDateTimeUtils.DATE_TIME_PATTERN)
......
......@@ -106,6 +106,18 @@
<version>5.3.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>com.luhuiguo</groupId>
<artifactId>aspose-words</artifactId>
<version>23.1</version>
</dependency>
</dependencies>
<build>
......
......@@ -152,12 +152,20 @@ public class SocialFriendConfig {
if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
if (vo.getImgList() != null && !vo.getImgList().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgList());
}
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgjbylbxcbdjb());
if (vo.getImgList() != null && !vo.getImgList().isEmpty()) {
qyzgshbxzyhmclbArr.addAll(vo.getImgList());
}
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
}
HttpEntity<String> formEntity = new HttpEntity<>(json.toString(), headers);
// 推的json
TSocialFriendBackLog backLogPush = new TSocialFriendBackLog();
......@@ -245,12 +253,13 @@ public class SocialFriendConfig {
// 行政区划代码 户里的缴纳地,精确到市 "340100"
HttpEntity<String> formEntity = new HttpEntity<>(json.toString(), headers);
backLog.setLogInfo(String.valueOf(formEntity));
backLog.setCreateTime(LocalDateTime.now());
String dataResultList = restTemplate.postForObject(appAddUrl, formEntity, String.class);
// {"head":{"code":"00000000","description":"成功","msg":"成功","time":"2024-12-06 17:10:26","status":"Y"
// ,"body":{"requestId":"85440b327d71466abcd9c5c81d5bb172"
if (Common.isNotNull(dataResultList)) {
backLog.setLogInfo(dataResultList);
backLog.setCreateTime(LocalDateTime.now());
JSONObject dataObject = JSON.parseObject(dataResultList);
String head = dataObject.getString("head");
if (Common.isNotNull(head)) {
......@@ -262,6 +271,8 @@ public class SocialFriendConfig {
urlStr = bodyObject.getString("wjlj");
}
}
} else {
backLog.setSocialId(appAddUrl+"返回dataResultList为空");
}
return urlStr;
}
......@@ -420,6 +431,9 @@ public class SocialFriendConfig {
tszdxx.put("ybygxs", "原固定职工");
// 毕业院校
tszdxx.put("byyx", vo.getByyx());
if (Common.isNotNull(vo.getIsSingle()) && CommonConstants.ONE_STRING.equals(vo.getIsSingle())) {
tszdxx.put("sfpl", "否");
}
if (type < 3) {
// 企业职工社会保险增员花名册 安徽非必填!
// 社保增员必填
......@@ -499,9 +513,13 @@ public class SocialFriendConfig {
// tszdxx.put("ybjycl", )
// 职工社会保险减少花名册 无
// tszdxx.put("zgshbxjshmc", )
if (type > 2) {
// 职工基本医疗保险参保登记表
tszdxx.put("zgjbylbxcbdjb", arr);
tszdxx.put("ybjycl", vo.getAutoLeaveDoc());
} else {
tszdxx.put("shjycl", vo.getAutoLeaveDoc());
}
cbrymdOne.put("tszdxx", tszdxx);
cbrymdArr.add(cbrymdOne);
......
......@@ -7,6 +7,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
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.salary.vo.SalaryAttaVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.social.service.TAttaInfoService;
......@@ -99,6 +100,10 @@ public class FileUploadController {
TAttaInfo attaInfo = tAttaInfoService.getById(id);
if (null == attaInfo) {
return R.failed("无对应附件信息");
} else if (CommonConstants.ONE_STRING.equals(attaInfo.getRelationType())
&& Common.isNotNull(attaInfo.getDomainId())) {
// 删除后解除户的章是否有为否
fileUploadService.updateSysHouseHoldInfoIsSign(attaInfo.getDomainId(), CommonConstants.ONE_STRING);
}
if (tAttaInfoService.removeById(id)) {
ossUtil.deleteObject(null, attaInfo.getAttaSrc());
......
......@@ -531,7 +531,7 @@ public class TDispatchInfoController {
try {
if (Common.isNotNull(requestId)) {
//主动释放锁
return tDispatchInfoService.addApplyAudit(idList,auditStatus,auditRemark,remark);
return tDispatchInfoService.addApplyAudit(idList,auditStatus,auditRemark,remark, isSingleAudit);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
......
......@@ -68,6 +68,10 @@ public class TForecastLibraryController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TForecastLibrary>> getTForecastLibraryPage(Page<TForecastLibrary> page, TForecastLibrary tForecastLibrary) {
//Ekp1.9.11查询条件 社保生成月和公积金生成月必填其一
if (Common.isEmpty(tForecastLibrary.getSocialCreateMonth()) && Common.isEmpty(tForecastLibrary.getProvidentCreateMonth())) {
return null;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tForecastLibrary);
if (Common.isNotNull(tForecastLibrary.getAuthSql()) && tForecastLibrary.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
......@@ -140,6 +144,10 @@ public class TForecastLibraryController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tforecastlibrary-export')")
public void export(HttpServletResponse response, @RequestBody TForecastLibrary searchVo) {
//Ekp1.9.11查询条件 社保生成月和公积金生成月必填其一
if (Common.isEmpty(searchVo.getSocialCreateMonth()) && Common.isEmpty(searchVo.getProvidentCreateMonth())) {
return;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
......
......@@ -70,6 +70,10 @@ public class TIncomeController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TIncome>> getTIncomePage(Page<TIncome> page, TIncomeSearchVo tIncome) {
//Ekp1.9.11查询条件 数据生成时间必填
if (Common.isEmpty(tIncome.getDataCreateMonth())) {
return null;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tIncome);
return new R<>(tIncomeService.getTIncomePage(page, tIncome));
......@@ -155,6 +159,10 @@ public class TIncomeController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tincome-export')")
public void export(HttpServletResponse response, @RequestBody TIncomeSearchVo searchVo) {
//Ekp1.9.11查询条件 数据生成时间必填
if (Common.isEmpty(searchVo.getDataCreateMonth())) {
return;
}
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
tIncomeService.listExport(response, searchVo);
......
/*
* 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.yifu.social.controller;
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.OSSUtil;
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.social.config.SocialFriendConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.util.WordToImageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 税友word文档离职证明
*
* @author hgw
* @date 2025-5-14 18:24:58
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialfriendword")
@Tag(name = "税友word文档离职证明")
public class TSocialFriendWordController {
@Operation(description = "生成新word")
@GetMapping("/updateNewFileTest")
@SysLog("生成新word")
public R<String> updateNewFileTest() throws Exception{
// 1:将劳动合同解除证明书.doc某些文字替换
// 2:盖章
// 3:生成新文件
String inputPath = "D:/test126.docx";
String outputPath = "D:/test126666.docx";
String outputImagePath = "D:/document_with_seal.png"; // 可以从配置中获取
return wordToImage(inputPath, outputPath, outputImagePath);
}
@Autowired
private OSSUtil ossUtil;
@Autowired
private WordToImageUtil wordToImageUtil;
@Autowired
private TAttaInfoMapper attaInfoMapper;
private final RestTemplate restTemplate;
private final SocialFriendConfig socialFriendConfig;
public R<String> wordToImage(String inputPath, String outputPath, String outputImagePath) throws Exception {
String src = "1735185038602皖信.png";
URL url = ossUtil.getObjectUrl(null, src);
if (Common.isEmpty(url)) {
throw new RuntimeException("获取印章图片失败");
}
try (InputStream imageStream = url.openStream()) {
// 准备替换参数
Map<String, String> replacements = new HashMap<>();
replacements.put("empName", "张三丰");
replacements.put("empSex", "女");
replacements.put("empAge", "33");
replacements.put("idCard", "340826199012121212");
replacements.put("startDate", "2023年11月28日");
replacements.put("leaveReason", "个人原因");
replacements.put("leaveDate", "2025年01月20日");
replacements.put("nowDate", DateUtil.formatDatePatten(new Date(), DateUtil.CHINA_PATTEN_YMD));
// 离职证明模板
String templateSrc = attaInfoMapper.getLeaveDocTemplate();
URL templateUrl = null;
if (Common.isNotNull(templateSrc)) {
templateUrl = ossUtil.getObjectUrl(null, templateSrc);
}
if (templateUrl != null) {
// 执行替换 + 插入印章
TSocialFriendBackLog backLog = new TSocialFriendBackLog();
backLog.setSocialId("test");
backLog.setType(CommonConstants.EIGHT_INT);
backLog.setCreateTime(LocalDateTime.now());
String friendUrl = wordToImageUtil.replaceTextInWord(templateUrl.openStream()
, replacements, imageStream, restTemplate, socialFriendConfig, backLog);
return R.ok(friendUrl);
}
}
return R.ok();
}
}
......@@ -62,4 +62,12 @@ public interface SysHouseHoldInfoMapper extends BaseMapper<SysHouseHoldInfo> {
* @return
*/
List<TSocialHouseholdExportVo> selectExportList(@Param("sysHouseHoldInfo") SysHouseHoldInfo sysHouseHoldInfo);
/**
* @Description: 获取自动生成解除劳动合同的户与公章
* @Author: hgw
* @Date: 2025/5/26 17:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo>
**/
List<SysHouseHoldInfo> getAttaSrcByAutoDoc();
}
......@@ -51,4 +51,7 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> {
// 删除学历与职业资格之外的附件
void deleteByDomainIdAndOther(@Param("domainId") String domainId);
// 获取离职证明模板
String getLeaveDocTemplate();
}
......@@ -295,4 +295,15 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
HouseNameConfigVo getFundSumExportVoTwo(@Param("houseName") String houseName,@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
List<AutoFlagVo> getAutoFlag(@Param("idsList")List<String> idsList);
/**
* @param idsList 派单IDlist
* @Description: 获取单个的推送的户的派单ID
* @Author: hgw
* @Date: 2025/5/12 18:31
* @return: java.util.List<java.lang.String>
**/
List<String> getSingleFlagMap(@Param("idsList")List<String> idsList);
// 获取自动生成减员离职证明的派单ID
List<String> getAutoDocFlagMap(@Param("idsList")List<String> idsList);
}
......@@ -21,4 +21,8 @@ public interface FileUploadService {
R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domainId) throws IOException;
R<T> uploadAsso(MultipartFile file, String filePath, Integer type, String domain, String uploadType);
// 更新户的章是否有
void updateSysHouseHoldInfoIsSign(String domainId, String isSign);
}
......@@ -80,9 +80,11 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
DispatchDetailVo getSocialAndFundInfoById(String id);
List<ErrorMessage> addBatchApplyAudit(List<String> idsList, YifuUser user, int flag, String auditStatus, String auditRemark, String remark);
List<ErrorMessage> addBatchApplyAudit(List<String> idsList, YifuUser user, int flag, String auditStatus
, String auditRemark, String remark, String isSingleAudit);
R<List<ErrorMessage>> addApplyAudit(List<String> ids, String auditStatus, String auditRemark, String remark);
R<List<ErrorMessage>> addApplyAudit(List<String> ids, String auditStatus, String auditRemark, String remark
, String isSingleAudit);
// isAutoFlag:是否社保士兵的自动办理,true :是
R<List<ErrorMessage>> addApplyHandle(List<String> ids, String typeSub, String handleStatus, String handleRemark, String socialType, String remark, YifuUser user, boolean isAutoHandle);
......
......@@ -8,9 +8,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysConfigLimitMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.social.service.SysHouseHoldInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TAttaInfoService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
......@@ -36,6 +38,7 @@ public class FileUploadServiceImpl implements FileUploadService {
private final OSSUtil ossUtil;
private final TAttaInfoService tAttaInfoService;
private final SysHouseHoldInfoService sysHouseHoldInfoService;
private AtomicInteger atomicInteger = new AtomicInteger(0);
//初始化附件上传队列上限值
......@@ -143,6 +146,10 @@ public class FileUploadServiceImpl implements FileUploadService {
}
//有实体id则插入关系,用于编辑
if (Common.isNotNull(domain)) {
if (type == 1) {
// 户配置上传公章,将户配置变为 有章
this.updateSysHouseHoldInfoIsSign(domain, CommonConstants.ZERO_STRING);
}
url = ossUtil.getObjectUrl(null, attaInfo.getAttaSrc());
fileVo = new FileVo(attaInfo.getId(), attaInfo.getAttaName(), url.toString());
return R.ok(fileVo, "success");
......@@ -155,6 +162,23 @@ public class FileUploadServiceImpl implements FileUploadService {
}
}
/**
* @param domainId 主键
* @param isSign 0是1否
* @Description: 更新户的章是否有
* @Author: hgw
* @Date: 2025/5/19 10:59
* @return: void
**/
public void updateSysHouseHoldInfoIsSign(String domainId, String isSign) {
// 户配置上传公章,将户配置变为 有章
SysHouseHoldInfo sysHouseHoldInfo = sysHouseHoldInfoService.getById(domainId);
if (sysHouseHoldInfo != null) {
sysHouseHoldInfo.setIsSign(isSign);
sysHouseHoldInfoService.updateById(sysHouseHoldInfo);
}
}
private R<FileVo> uploadImg2(InputStream fileIn, String filePath, Integer type, String domain, String fileName) throws IOException {
if (null == fileIn) {
return R.failed("文件上传异常,请重新上传!");
......
......@@ -94,11 +94,13 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
FriendResult info;
List<FriendResult> resultList;
Map<String, FriendResult> resultMap;
String key;
if (socialList != null && !socialList.isEmpty()) {
logList = new ArrayList<>();
resultMap = new HashMap<>();
for (TSocialInfo socialInfo : socialList) {
info = resultMap.get(socialInfo.getEmpIdcard());
key = socialInfo.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+socialInfo.getYgsRequestId();
info = resultMap.get(key);
if (info == null) {
backLog = new TSocialFriendBackLog();
backLog.setSocialId(socialInfo.getEmpIdcard());
......@@ -112,9 +114,9 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
logList.add(backLog);
if (resultList != null && !resultList.isEmpty()) {
for (FriendResult result : resultList) {
resultMap.put(result.getIdCard(), result);
resultMap.put(result.getIdCard()+CommonConstants.DOWN_LINE_STRING+socialInfo.getYgsRequestId(), result);
}
info = resultMap.get(socialInfo.getEmpIdcard());
info = resultMap.get(key);
}
} else {
backLog.setSocialId(backLog.getSocialId() + "," +socialInfo.getEmpIdcard());
......@@ -135,7 +137,8 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
resultMap = new HashMap<>();
backLog = new TSocialFriendBackLog();
for (TSocialInfo socialInfo : socialYsdList) {
info = resultMap.get(socialInfo.getEmpIdcard());
key = socialInfo.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+socialInfo.getYsdRequestId();
info = resultMap.get(key);
if (info == null) {
backLog = new TSocialFriendBackLog();
backLog.setSocialId(socialInfo.getEmpIdcard());
......@@ -148,9 +151,9 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
, backLog, socialInfo.getDispatchType());
if (resultList != null && !resultList.isEmpty()) {
for (FriendResult result : resultList) {
resultMap.put(result.getIdCard(), result);
resultMap.put(result.getIdCard()+CommonConstants.DOWN_LINE_STRING+socialInfo.getYsdRequestId(), result);
}
info = resultMap.get(socialInfo.getEmpIdcard());
info = resultMap.get(key);
}
logList.add(backLog);
} else {
......
......@@ -825,6 +825,10 @@ public class DoJointSocialTask {
fundParam.setFd_3adfe8c70d3fd4(library.getSettleDomainCode());
//项目名称
fundParam.setFd_3adfe8c8468e54(library.getSettleDomainName());
//项目编码-原 fxj 20240527 add
fundParam.setFd_3cfe2da7e35daa(library.getSettleDomainCode());
//项目名称-原 fxj 20240527 add
fundParam.setFd_3cfe2db5015d6e(library.getSettleDomainName());
//单号
fundParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......@@ -1317,6 +1321,10 @@ public class DoJointSocialTask {
fundParam.setFd_3adfe8c70d3fd4(library.getDeptNo());
//项目名称
fundParam.setFd_3adfe8c8468e54(library.getDeptName());
//项目编码-原 fxj 20240527 add
fundParam.setFd_3cfe2da7e35daa(library.getDeptNo());
//项目名称-原 fxj 20240527 add
fundParam.setFd_3cfe2db5015d6e(library.getDeptName());
//单号
fundParam.setFd_3adfe95c169c48(CommonConstants.EMPTY_STRING);
//客户编码
......
......@@ -269,7 +269,7 @@ public class DoSocialTask {
* @return
**/
@Async
public void pushSoldier(String dispatchId, boolean isFriend) {
public void pushSoldier(String dispatchId, boolean isFriend, String isSingleAudit) {
List<String> dispatchIdList = new ArrayList<>();
dispatchIdList.add(dispatchId);
try {
......@@ -280,7 +280,10 @@ public class DoSocialTask {
// 当前默认 安徽省 ,且开关是税友的,才可以税友推送办理
if (isFriend) {
// 断开派单单条推送税友
// tSocialFriendPushService.pushFriend(dispatchIdList);
// 单个审核接口并且户类型为单个,即时推送税友
if (CommonConstants.ONE_STRING.equals(isSingleAudit)) {
tSocialFriendPushService.pushFriend(dispatchIdList);
}
} else {
tSocialSoldierPushService.pushSoldier(dispatchIdList);
}
......
......@@ -19,7 +19,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Base64;
/**
......@@ -43,6 +42,7 @@ public class ExcelToImage {
public R<String> excelToImg(InputStream inputStream , SocialFriendConfig socialFriendConfig
, RestTemplate restTemplate, TSocialFriendBackLog backLog){
backLog.setLogInfo("开始转换excel为图片");
if (null == inputStream || null == socialFriendConfig){
return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagParamError);
}
......@@ -61,10 +61,13 @@ public class ExcelToImage {
file = new File(projectRoot+toImag);
if (file.exists()){
// file 压缩到1M以内
file = compressImage(projectRoot, toImag, 1024 * 1024);
backLog.setLogInfo("压缩大小前");
file = compressImage(file, projectRoot);
backLog.setLogInfo("压缩大小后");
String key = System.currentTimeMillis() + file.getName();
byte[] fileContent = Files.readAllBytes(file.toPath());
String base64String = Base64.getEncoder().encodeToString(fileContent);
backLog.setLogInfo("转化为base64String");
String url = socialFriendConfig.uploadPng(restTemplate, key, base64String, backLog);
if (Common.isEmpty(url)){
return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagOSSError);
......@@ -72,6 +75,7 @@ public class ExcelToImage {
return R.ok(url);
}
} catch (Exception e) {
e.printStackTrace();
return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagConvertError+e.getMessage());
} finally {
if (file.exists()){
......@@ -88,11 +92,11 @@ public class ExcelToImage {
return R.failed(CommonConstants.RESULT_DATA_FAIL);
}
//压缩文件到指定大小
private File compressImage(String projectRoot, String toImag, int maxSize) throws IOException {
File originalFile = Paths.get(projectRoot, toImag).toFile();
private File compressImage(File originalFile, String projectRoot) throws IOException {
BufferedImage image = ImageIO.read(originalFile);
int quality = 100; // 从100%开始
File compressedFile = new File(projectRoot, TO_IMAGE_TEMP);
int maxSize = 1024 * 1024;
while (originalFile.length() > maxSize && quality > 10) {
quality -= 5;
ImageIO.write(image, "png", compressedFile);
......@@ -105,6 +109,7 @@ public class ExcelToImage {
}
return originalFile;
}
public R<URL> excelToImg(InputStream inputStream ,OSSUtil ossUtil){
if (null == inputStream || null == ossUtil){
return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagParamError);
......
package com.yifu.cloud.plus.v1.yifu.social.util;
import com.aspose.words.Document;
import com.aspose.words.SaveFormat;
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.social.config.SocialFriendConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog;
import org.apache.poi.xwpf.usermodel.*;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.nio.file.Files;
import java.util.Base64;
import java.util.Map;
/**
* @author hgw
* @description word工具类
* @date 2025-5-26 16:03:05
*/
@Component
public class WordToImageUtil {
private static final String PDF_TEMP ="\\test126666.docx";
private static final String IMAGE_TEMP ="\\document_with_seal.png";
private static final String TO_IMAGE_TEMP ="\\ToImgTemp.png";
public String replaceTextInWord(InputStream templateFile, Map<String, String> replacements
, InputStream imageStream, RestTemplate restTemplate, SocialFriendConfig socialFriendConfig
, TSocialFriendBackLog backLog) {
String projectRoot = System.getProperty(CommonConstants.USER_DIR);
String outputFilePath = projectRoot + PDF_TEMP;
String outputImagePath = projectRoot + IMAGE_TEMP;
try (XWPFDocument document = new XWPFDocument(templateFile)) {
// 替换段落中的文本
for (XWPFParagraph paragraph : document.getParagraphs()) {
for (String key : replacements.keySet()) {
if (paragraph.getText().contains(key)) {
String newText = paragraph.getText().replace(key, replacements.get(key));
paragraph.getRuns().clear();
XWPFRun newRun = paragraph.createRun();
newRun.setText(newText);
}
}
}
String text;
// 替换表格中的文本
for (XWPFTable table : document.getTables()) {
for (XWPFTableRow row : table.getRows()) {
for (XWPFTableCell cell : row.getTableCells()) {
for (XWPFParagraph p : cell.getParagraphs()) {
for (XWPFRun run : p.getRuns()) {
text = run.getText(0);
if (Common.isNotNull(text) && replacements.get(text) != null) {
run.setText(replacements.get(text), 0);
}
}
}
}
}
}
// 保存输出文件
try (FileOutputStream fos = new FileOutputStream(outputFilePath)) {
document.write(fos);
}
return convertAndAddSeal(outputFilePath, imageStream, outputImagePath, projectRoot, restTemplate
, socialFriendConfig, backLog);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (imageStream != null) {
try {
imageStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return "-";
}
public String convertAndAddSeal(String inputDocx, InputStream sealImagePath, String outputImagePath
, String projectRoot, RestTemplate restTemplate, SocialFriendConfig socialFriendConfig
, TSocialFriendBackLog backLog) throws Exception {
File pdfFile = null;
Document doc = null;
File tempImgFile = null;
File imgFile = null;
try {
pdfFile = new File(inputDocx);
String filename = pdfFile.getName();
// 打开生成的 Word 文件
doc = new Document(new FileInputStream(pdfFile));
String pathPre = filename.substring(0, filename.lastIndexOf("."));
// 逐页将 Word 文件保存为图片(PNG格式)
String path = pathPre + ".png";
if (doc.getPageCount() > 0) {
Document extractedPage = doc.extractPages(0,1);
// 拼接上文件名 test1.png
// 将 Word 文件保存为图片PNG格式
extractedPage.save(path, SaveFormat.PNG);
}
tempImgFile = new File(path);
BufferedImage pageImage = ImageIO.read(tempImgFile);
// Step 3: 加盖公章
BufferedImage sealedImage = addSealToImage(pageImage, sealImagePath);
imgFile = new File(outputImagePath);
// Step 4: 输出图片
ImageIO.write(sealedImage, "png", imgFile);
if (imgFile.exists()) {
// file 压缩到1M以内
imgFile = compressImage(projectRoot, imgFile);
String key = System.currentTimeMillis() + imgFile.getName();
byte[] fileContent = Files.readAllBytes(imgFile.toPath());
String base64String = Base64.getEncoder().encodeToString(fileContent);
String url = socialFriendConfig.uploadPng(restTemplate, key, base64String, backLog);
if (Common.isEmpty(url)){
return "--";
}
return url;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (tempImgFile != null) {
tempImgFile.delete();
}
if (doc != null) {
doc.cleanup();
}
if (pdfFile != null) {
pdfFile.delete();
}
if (imgFile != null) {
imgFile.delete();
}
}
return "---";
}
private File compressImage(String projectRoot, File originalFile) throws IOException {
BufferedImage image = ImageIO.read(originalFile);
int quality = 100; // 从100%开始
File compressedFile = new File(projectRoot, TO_IMAGE_TEMP);
int maxSize = 1024 * 1024;
while (originalFile.length() > maxSize && quality > 10) {
quality -= 5;
ImageIO.write(image, "png", compressedFile);
if (compressedFile.length() < maxSize) {
originalFile.delete();
compressedFile.renameTo(originalFile);
break;
}
compressedFile.delete();
}
return originalFile;
}
private BufferedImage addSealToImage(BufferedImage image, InputStream sealImagePath) throws IOException {
BufferedImage seal = ImageIO.read(sealImagePath);
// 设置公章目标大小
int targetWidth = 200; // 宽度
int targetHeight = 200; // 高度
// 创建缩放后的公章图像
Image scaledSeal = seal.getScaledInstance(targetWidth, targetHeight, Image.SCALE_SMOOTH);
BufferedImage resizedSeal = new BufferedImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = resizedSeal.createGraphics();
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2d.drawImage(scaledSeal, 0, 0, null);
g2d.dispose();
// 合成最终图像
BufferedImage combined = new BufferedImage(
image.getWidth(),
image.getHeight(),
BufferedImage.TYPE_INT_ARGB);
Graphics2D g = combined.createGraphics();
g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g.drawImage(image, 0, 0, null);
// 设置公章位置(右下角)
int x = 550;
int y = 400;
g.drawImage(resizedSeal, x, y, null);
g.dispose();
return combined;
}
}
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