Commit 49debd0c authored by fangxinjiang's avatar fangxinjiang

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

parents 22f32959 e3e335cb
...@@ -211,4 +211,7 @@ public class DispatchEmpVo implements Serializable { ...@@ -211,4 +211,7 @@ public class DispatchEmpVo implements Serializable {
@ExcelProperty(value ="试用期") @ExcelProperty(value ="试用期")
private String tryPeriod; private String tryPeriod;
@ExcelProperty(value ="学校")
private String school;
} }
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -119,4 +120,7 @@ public class EmployeeRegistrationPreVo implements Serializable { ...@@ -119,4 +120,7 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "身份证合集") @Schema(description = "身份证合集")
private List<String> idcardList; private List<String> idcardList;
@Schema(description = "商险待派单信息集合")
private List<TEmployeeInsurancePreVo> employeeInsurancePreVos;
} }
...@@ -117,6 +117,12 @@ ...@@ -117,6 +117,12 @@
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-insurances-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<!-- 二维码生成JAR结束 --> <!-- 二维码生成JAR结束 -->
</dependencies> </dependencies>
......
...@@ -95,5 +95,6 @@ ...@@ -95,5 +95,6 @@
1=1 1=1
<include refid="tAutoRuleLog_where"/> <include refid="tAutoRuleLog_where"/>
</where> </where>
order by a.CREATE_TIME DESC
</select> </select>
</mapper> </mapper>
...@@ -198,6 +198,7 @@ ...@@ -198,6 +198,7 @@
<result property="post" column="POST"/> <result property="post" column="POST"/>
<result property="empNo" column="EMP_NO"/> <result property="empNo" column="EMP_NO"/>
<result property="tryPeriod" column="TRY_PERIOD"/> <result property="tryPeriod" column="TRY_PERIOD"/>
<result property="school" column="school"/>
</resultMap> </resultMap>
<sql id="baseParam"> <sql id="baseParam">
...@@ -970,9 +971,11 @@ ...@@ -970,9 +971,11 @@
c.UNIT_NAME, c.UNIT_NAME,
c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST,c.EMP_NO,c.PROJECT_STATUS,c.EMP_NATRUE,c.TRY_PERIOD c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST,c.EMP_NO,c.PROJECT_STATUS,c.EMP_NATRUE,c.TRY_PERIOD
,a.SCHOOL
from ( from (
select e.ID,e.EMP_CODE,e.EMP_NAME,e.EMP_IDCARD,e.EMP_NATIONAL,e.EMP_PHONE,e.ID_PROVINCE,e.ID_CITY, select e.ID,e.EMP_CODE,e.EMP_NAME,e.EMP_IDCARD,e.EMP_NATIONAL,e.EMP_PHONE,e.ID_PROVINCE,e.ID_CITY,
e.ID_TOWN,e.EMP_REGIS_TYPE,e.FILE_PROVINCE,e.FILE_CITY,e.FILE_TOWN,e.HIGN_EDUCATION,e.FILE_STATUS,e.CONTACT_ADDRESS e.ID_TOWN,e.EMP_REGIS_TYPE,e.FILE_PROVINCE,e.FILE_CITY,e.FILE_TOWN,e.HIGN_EDUCATION,e.FILE_STATUS,e.CONTACT_ADDRESS
,e.SCHOOL
from t_employee_info e from t_employee_info e
where 1=1 and e.DELETE_FLAG = '0' where 1=1 and e.DELETE_FLAG = '0'
<if test="checkVo != null"> <if test="checkVo != null">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>com.yifu.cloud.plus.v1</groupId> <groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu</artifactId> <artifactId>yifu-check</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
......
...@@ -648,6 +648,8 @@ public interface CommonConstants { ...@@ -648,6 +648,8 @@ public interface CommonConstants {
List<String> socialInfoStatus = Stream.of("1","3","5","7").collect(Collectors.toList()); List<String> socialInfoStatus = Stream.of("1","3","5","7").collect(Collectors.toList());
List<String> processInsurancesStatus = Stream.of("1","2","5").collect(Collectors.toList());
List<String> deptList = Stream.of("安徽一册档案管理有限公司","安徽顾合企业管理咨询有限公司","安徽赤道线数字传媒科技有限公司","劳务业务中心","易服智享&研究院").collect(Collectors.toList()); List<String> deptList = Stream.of("安徽一册档案管理有限公司","安徽顾合企业管理咨询有限公司","安徽赤道线数字传媒科技有限公司","劳务业务中心","易服智享&研究院").collect(Collectors.toList());
String USER_DIR = "user.dir"; String USER_DIR = "user.dir";
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.util; package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo; import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -31,4 +34,16 @@ public class InsuranceDaprUtil { ...@@ -31,4 +34,16 @@ public class InsuranceDaprUtil {
, Object.class, SecurityConstants.FROM_IN); , Object.class, SecurityConstants.FROM_IN);
} }
/**
* @Author huyc
* @Description 新增商险待购买信息
* @Date 14:34 2025/4/3
* @Param
* @return
**/
public R<Boolean> saveInsurancePreInfo(EmployeeRegistrationPreVo preVo) {
return HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),
"/temployeeinsurancepre/inner/saveInsurancePreInfo", JSON.toJSONString(preVo), Boolean.class, SecurityConstants.FROM_IN);
}
} }
...@@ -35,9 +35,11 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; ...@@ -35,9 +35,11 @@ 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.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; 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.UpmsDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil; import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -49,6 +51,7 @@ import javax.servlet.ServletOutputStream; ...@@ -49,6 +51,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.ParseException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -82,6 +85,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -82,6 +85,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
@Autowired @Autowired
private UpmsDaprUtils upmsDaprUtils; private UpmsDaprUtils upmsDaprUtils;
@Autowired
private InsuranceDaprUtil insuranceDaprUtil;
private final TOperationLogService logService; private final TOperationLogService logService;
/** /**
...@@ -557,9 +563,20 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -557,9 +563,20 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
baseMapper.updateById(registration); baseMapper.updateById(registration);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(), logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(), null); user.getNickname(), null);
//生成档案待建档数据 try {
initRegistPreInfo(registration,preVo, user); //生成档案待建档数据
archivesDaprUtil.saveRegistPreInfo(preVo); initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
archivesDaprUtil.saveRegistPreInfo(preVo);
if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) {
//生成商险待购买的数据
for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) {
initInsruancePreInfo(registration, insurancePreVo, user, CommonConstants.ZERO_STRING);
}
insuranceDaprUtil.saveInsurancePreInfo(preVo);
}
} catch (Exception e) {
log.error("执行异常", e);
}
return R.ok(); return R.ok();
} }
...@@ -612,9 +629,20 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -612,9 +629,20 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
baseMapper.updateById(registration); baseMapper.updateById(registration);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(), logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(), null); user.getNickname(), null);
//生成档案待建档数据 try {
initRegistPreInfo(registration, preVo, user); //生成档案待建档数据
archivesDaprUtil.saveRegistPreInfo(preVo); initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
archivesDaprUtil.saveRegistPreInfo(preVo);
if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) {
//生成商险待购买的数据
for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) {
initInsruancePreInfo(registration, insurancePreVo, user, CommonConstants.ZERO_STRING);
}
insuranceDaprUtil.saveInsurancePreInfo(preVo);
}
}catch (Exception e) {
log.error("执行异常", e);
}
} }
if (!receiveVoList.isEmpty() && Common.isNotNull(receiveVoList)) { if (!receiveVoList.isEmpty() && Common.isNotNull(receiveVoList)) {
return R.ok(receiveVoList); return R.ok(receiveVoList);
...@@ -1060,34 +1088,56 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1060,34 +1088,56 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return false; return false;
} }
//数据初始化 //入职待建档数据初始化
private void initRegistPreInfo(EmployeeRegistration registration,EmployeeRegistrationPreVo preVo,YifuUser user) { private void initRegistPreInfo(EmployeeRegistration registration,EmployeeRegistrationPreVo preVo,
try { YifuUser user,String status) throws ParseException {
preVo.setCustomerUsername(registration.getCustomerUsername()); preVo.setId(registration.getId());
preVo.setCustomerUserLoginname(registration.getCustomerUserLoginname()); preVo.setCustomerUsername(registration.getCustomerUsername());
preVo.setDeptName(registration.getDeptName()); preVo.setCustomerUserLoginname(registration.getCustomerUserLoginname());
preVo.setDeptId(registration.getDeptId()); preVo.setDeptName(registration.getDeptName());
preVo.setDataSource(registration.getDataSource()); preVo.setDeptId(registration.getDeptId());
preVo.setPosition(registration.getPosition()); preVo.setDataSource(registration.getDataSource());
preVo.setJoinLeaveDate(registration.getJoinLeaveDate()); preVo.setPosition(registration.getPosition());
preVo.setProcessStatus(CommonConstants.ZERO_STRING); preVo.setJoinLeaveDate(registration.getJoinLeaveDate());
preVo.setConfirmTime(DateUtil.getCurrentDateTime()); preVo.setConfirmTime(DateUtil.getCurrentDateTime());
preVo.setDeptNo(registration.getDeptNo()); preVo.setDeptNo(registration.getDeptNo());
preVo.setConfirmUser(user.getNickname()); preVo.setConfirmUser(user.getNickname());
preVo.setCustomerUsernameNew(registration.getCustomerUsername()); preVo.setCustomerUsernameNew(registration.getCustomerUsername());
preVo.setEmpPhone(registration.getEmpPhone()); preVo.setEmpPhone(registration.getEmpPhone());
preVo.setEmployeeName(registration.getEmployeeName()); preVo.setEmployeeName(registration.getEmployeeName());
preVo.setEmpIdcard(registration.getEmpIdcard()); preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.setCreateBy(user.getId()); preVo.setCreateBy(user.getId());
preVo.setCreateName(user.getNickname()); preVo.setCreateName(user.getNickname());
preVo.setUpdateBy(user.getId()); preVo.setUpdateBy(user.getId());
preVo.setEmpIdcard(registration.getEmpIdcard()); preVo.setEmpIdcard(registration.getEmpIdcard());
if (Common.isNotNull(preVo.getPushDate())) { preVo.setProcessStatus(status);
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString( if (Common.isNotNull(preVo.getPushDate())) {
registration.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " " + preVo.getPushDate(), DateUtil.DATETIME_PATTERN_MINUTE)); preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
} registration.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " " + preVo.getPushDate(), DateUtil.DATETIME_PATTERN_MINUTE));
}catch (Exception e) {
log.error("执行异常", e);
} }
} }
//商险待购买数据初始化
private void initInsruancePreInfo(EmployeeRegistration registration,TEmployeeInsurancePreVo preVo,
YifuUser user,String status) throws ParseException {
preVo.setRegisterId(registration.getId());
preVo.setCustomerUsername(registration.getCustomerUsername());
preVo.setCustomerUserLoginname(registration.getCustomerUserLoginname());
preVo.setDeptName(registration.getDeptName());
preVo.setDeptId(registration.getDeptId());
preVo.setDataSource(registration.getDataSource());
preVo.setPosition(registration.getPosition());
preVo.setJoinLeaveDate(registration.getJoinLeaveDate());
preVo.setDeptNo(registration.getDeptNo());
preVo.setEmpPhone(registration.getEmpPhone());
preVo.setEmployeeName(registration.getEmployeeName());
preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.setCreateBy(user.getId());
preVo.setCreateName(user.getNickname());
preVo.setUpdateBy(user.getId());
preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.setProcessStatus(status);
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
registration.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 14:00", DateUtil.DATETIME_PATTERN_MINUTE));
}
} }
...@@ -882,7 +882,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -882,7 +882,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
logDetail.setFdPayee(detailData.getFdPayeeName()); logDetail.setFdPayee(detailData.getFdPayeeName());
// 收款银行 // 收款银行
logDetail.setFdRecipientBank(detailData.getFdRecipientBank()); logDetail.setFdRecipientBank(detailData.getFdRecipientBank());
if ("02".equals(data.getResult())) { if ("02".equals(data.getResult()) || "5".equals(data.getResult())) {
moneySuccess = BigDecimalUtils.safeAdd(moneySuccess, money); moneySuccess = BigDecimalUtils.safeAdd(moneySuccess, money);
numSuccess++; numSuccess++;
detailData.setFdGrantStatus("发放成功"); detailData.setFdGrantStatus("发放成功");
...@@ -991,7 +991,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn ...@@ -991,7 +991,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
logs.setFdTransactionFailTotal(0); logs.setFdTransactionFailTotal(0);
// 成功总笔数 // 成功总笔数
logs.setFdTransactionSuccessTotal(0); logs.setFdTransactionSuccessTotal(0);
if ("02".equals(data.getResult())) { if ("02".equals(data.getResult()) || "5".equals(data.getResult())) {
// 失败总笔数 // 失败总笔数
logs.setFdTransactionSuccessTotal(1); logs.setFdTransactionSuccessTotal(1);
logs.setFdSuccessFee(money); logs.setFdSuccessFee(money);
......
...@@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
/** /**
...@@ -60,16 +61,13 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -60,16 +61,13 @@ public class TEmployeeInsurancePre extends BaseEntity {
private String deptId; private String deptId;
@Schema(description = "预计派单时间") @Schema(description = "预计派单时间")
private Date expectedCollectionTime; private LocalDateTime expectedCollectionTime;
@Schema(description = "登记人") @Schema(description = "登记人")
private String registUser; private String registUser;
@Schema(description = "登记时间") @Schema(description = "登记时间")
private Date registTime; private LocalDateTime registTime;
@Schema(description = "最新的客服名称")
private String customerUsernameNew;
@Schema(description = "保险公司名称") @Schema(description = "保险公司名称")
private String insuranceCompanyName; private String insuranceCompanyName;
...@@ -92,6 +90,9 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -92,6 +90,9 @@ public class TEmployeeInsurancePre extends BaseEntity {
@Schema(description = "保单结束时间") @Schema(description = "保单结束时间")
private Date policyEnd; private Date policyEnd;
@Schema(description = "保单号")
private String policyNo;
@Schema(description = "是否地市自购0是 1 否") @Schema(description = "是否地市自购0是 1 否")
private String isAddress; private String isAddress;
......
...@@ -207,5 +207,17 @@ public class TInsuranceAlert extends BaseEntity { ...@@ -207,5 +207,17 @@ public class TInsuranceAlert extends BaseEntity {
@Schema(description = "消息提醒备注") @Schema(description = "消息提醒备注")
private String expireRemark; private String expireRemark;
/**
* 消息提醒人
*/
@Schema(description = "消息提醒人")
private String alerter;
/**
* 消息提醒人ID
*/
@Schema(description = "消息提醒人ID")
private String alertId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author licancan
* @description 商险办理批增入参
* @date 2022-07-20 08:43:31
*/
@Data
@Schema(description = "商险办理单个/批量批增入参")
public class InsuranceAutoParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 项目id
*/
@Schema(description = "项目id")
private String deptId;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 岗位
*/
@Schema(description = "岗位")
private String post;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 商险购买地省名称
*/
@Schema(description = "商险购买地省名称")
private String insuranceProvinceName;
/**
* 商险购买地市名称
*/
@Schema(description = "商险购买地市名称")
private String insuranceCityName;
/**
* 商险办理省名称
*/
@Schema(description = "商险办理省名称")
private String insuranceHandleProvinceName;
/**
* 商险办理城市名称
*/
@Schema(description = "商险办理城市名称")
private String insuranceHandleCityName;
/**
* 结算月
*/
@Schema(description = "结算月")
private String settleMonth;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
/**
* 错误信息
*/
@Schema(description = "错误信息")
private String errorMessage;
/**
* 结算类型 (1、单独结算 2、合并结算-和工资一起结算)
*/
@Schema(description = "结算类型")
private Integer settleType;
/**
* 保单开始时间
*/
@Schema(description = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 替换员工姓名
*/
@Schema(description = "替换员工姓名")
private String replaceEmpName;
/**
* 替换员工身份证号
*/
@Schema(description = "替换员工身份证号")
private String replaceEmpIdcardNo;
/**
* 替换员工项目编码
*/
@Schema(description = "替换员工项目编码")
private String replaceDeptNo;
}
...@@ -42,4 +42,16 @@ public class InsuranceSearchVo extends TBusinessInsuranceVo{ ...@@ -42,4 +42,16 @@ public class InsuranceSearchVo extends TBusinessInsuranceVo{
* 导出选择的ID * 导出选择的ID
**/ **/
private String idStr; private String idStr;
/**
* @Author fxj
* 新增到期提醒人
**/
private String alerter;
/**
* 消息提醒人ID
*/
@Schema(description = "消息提醒人ID")
private String alertId;
} }
...@@ -363,4 +363,10 @@ public class TBusinessInsuranceVo implements Serializable { ...@@ -363,4 +363,10 @@ public class TBusinessInsuranceVo implements Serializable {
*/ */
@Schema(description = "有忽略提醒 0:忽略 1:不忽略") @Schema(description = "有忽略提醒 0:忽略 1:不忽略")
private String expireIgnoreFlag; private String expireIgnoreFlag;
/**
* @Author fxj
* 新增到期提醒人
**/
private String alerter;
} }
...@@ -112,14 +112,6 @@ public class TEmployeeInsurancePreVo implements Serializable { ...@@ -112,14 +112,6 @@ public class TEmployeeInsurancePreVo implements Serializable {
@ExcelProperty("登记时间") @ExcelProperty("登记时间")
private Date registTime; private Date registTime;
/**
* 最新的客服名称
*/
@ExcelAttribute(name = "最新的客服名称")
@Schema(description = "最新的客服名称")
@ExcelProperty("最新的客服名称")
private String customerUsernameNew;
/** /**
* 保险公司名称 * 保险公司名称
*/ */
...@@ -176,6 +168,14 @@ public class TEmployeeInsurancePreVo implements Serializable { ...@@ -176,6 +168,14 @@ public class TEmployeeInsurancePreVo implements Serializable {
@ExcelProperty("保单结束时间") @ExcelProperty("保单结束时间")
private Date policyEnd; private Date policyEnd;
/**
* 保单号
*/
@ExcelAttribute(name = "保单号")
@Schema(description = "保单号")
@ExcelProperty("保单号")
private String policyNo;
/** /**
* 是否地市自购0是 1 否 * 是否地市自购0是 1 否
*/ */
...@@ -264,4 +264,13 @@ public class TEmployeeInsurancePreVo implements Serializable { ...@@ -264,4 +264,13 @@ public class TEmployeeInsurancePreVo implements Serializable {
@ExcelProperty("替换项目编码") @ExcelProperty("替换项目编码")
private String replaceDeptNo; private String replaceDeptNo;
@Schema(description = "创建人-姓名")
private String createName;
@Schema(description = "创建人")
private String createBy;
@Schema(description = "更新人")
private String updateBy;
} }
package com.yifu.cloud.plus.v1.yifu.insurances.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
@Configuration
public class TaskSchedulerConfig {
@Bean
public TaskScheduler taskScheduler() {
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(10);
scheduler.setThreadNamePrefix("scheduled-task-insurances");
scheduler.initialize();
return scheduler;
}
}
...@@ -110,7 +110,7 @@ public class TEmployeeInsurancePreController { ...@@ -110,7 +110,7 @@ public class TEmployeeInsurancePreController {
} }
/** /**
* 商险待办任务表 批量导出 * 商险派单信息单个/批量确认
* @author huych * @author huych
* @date 2025-03-31 12:25:13 * @date 2025-03-31 12:25:13
**/ **/
...@@ -119,4 +119,17 @@ public class TEmployeeInsurancePreController { ...@@ -119,4 +119,17 @@ public class TEmployeeInsurancePreController {
public R confirm(@RequestBody List<String> idList) { public R confirm(@RequestBody List<String> idList) {
return tEmployeeInsurancePreService.confirm(idList); return tEmployeeInsurancePreService.confirm(idList);
} }
/**
* 商险派单信息批量派单
* @author huych
* @date 2025-03-31 12:25:13
**/
@Operation(description = "商险派单信息单个/批量派单")
@PostMapping("/batchDispatcherInsurance")
public R batchDispatcherInsurance(@RequestBody List<String> idList) {
return tEmployeeInsurancePreService.batchDispatcherInsurance(idList);
}
} }
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
public interface ScheduleService {
void scheduleTask(TEmployeeInsurancePre record);
void executeTask(String aId);
}
...@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance; ...@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
...@@ -49,10 +50,32 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc ...@@ -49,10 +50,32 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
void listExport(HttpServletResponse response, TEmployeeInsurancePreSearchVo searchVo); void listExport(HttpServletResponse response, TEmployeeInsurancePreSearchVo searchVo);
/** /**
* 商险待办任务表简单分页查询 * 商险派单信息单个/批量确认
* @param idList id集合 * @param idList id集合
* @return * @return
*/ */
R confirm(List<String> idList); R confirm(List<String> idList);
/**
* 商险派单信息批量派单
* @param idList id集合
* @return
*/
R batchDispatcherInsurance(List<String> idList);
/**
* 新增商险待购买信息
* @param preVo
* @return
*/
Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo preVo);
/**
* 更新商险待购买状态
* @param id
* @param status 状态
* @return
*/
void saveInsurancePreInfo(String id,String status);
} }
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.ScheduleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionTemplate;
import javax.annotation.PostConstruct;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
@Service
public class ScheduleServiceImpl implements ScheduleService {
@Autowired
private TEmployeeInsurancePreService insurancePreService;
@Autowired
private TaskScheduler taskScheduler;
@Autowired
private TransactionTemplate transactionTemplate;
// 应用启动时初始化未处理的任务
@PostConstruct
public void initSchedule() {
List<TEmployeeInsurancePre> records = insurancePreService.list(Wrappers.<TEmployeeInsurancePre>query()
.lambda().ge(TEmployeeInsurancePre::getExpectedCollectionTime,LocalDateTime.now())
.eq(TEmployeeInsurancePre::getProcessStatus,CommonConstants.ONE_STRING));
records.forEach(this::scheduleTask);
}
// 调度单个任务
@Override
public void scheduleTask(TEmployeeInsurancePre record) {
Instant triggerTime = record.getExpectedCollectionTime().atZone(ZoneId.systemDefault()).toInstant();
taskScheduler.schedule(() -> executeTask(record.getId()), triggerTime);
}
// 执行发送短信操作(事务内处理)
@Override
public void executeTask(String aId) {
transactionTemplate.execute(status -> {
List<String> idList = new ArrayList<>();
idList.add(aId);
insurancePreService.batchDispatcherInsurance(idList);
return null;
});
}
}
...@@ -7818,9 +7818,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -7818,9 +7818,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
long roleId = 1851541100126863362L; long roleId = 1851541100126863362L;
boolean isSsc = this.haveRole(user, roleId); boolean isSsc = this.haveRole(user, roleId);
if (isSsc) { if (isSsc) {
condition.setCreateBy(null); condition.setAlertId(null);
} else { } else {
condition.setCreateBy(user.getId()); condition.setAlertId(user.getId());
} }
// R<TSettleDomainListVo> sdRes = archivesDaprUtil.getPermissionByUserId(user.getId()); // R<TSettleDomainListVo> sdRes = archivesDaprUtil.getPermissionByUserId(user.getId());
// List<TInsuranceAreaRes> areaRes = insuranceAreaResMapper.selectList(Wrappers.<TInsuranceAreaRes>query().lambda() // List<TInsuranceAreaRes> areaRes = insuranceAreaResMapper.selectList(Wrappers.<TInsuranceAreaRes>query().lambda()
...@@ -8181,7 +8181,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8181,7 +8181,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
public R<Integer> getUserInsuranceMessageWarnCount(String userName) { public R<Integer> getUserInsuranceMessageWarnCount(String userName) {
InsuranceSearchVo searchVo = new InsuranceSearchVo(); InsuranceSearchVo searchVo = new InsuranceSearchVo();
searchVo.setCreateBy(SecurityUtils.getUser().getId()); searchVo.setAlertId(SecurityUtils.getUser().getId());
searchVo.setExpireIgnoreFlag(CommonConstants.ONE_STRING); searchVo.setExpireIgnoreFlag(CommonConstants.ONE_STRING);
return R.ok(baseMapper.noPageCountDiy(searchVo)); return R.ok(baseMapper.noPageCountDiy(searchVo));
} }
......
...@@ -155,6 +155,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper, ...@@ -155,6 +155,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
for (TInsuranceAlert alert: list){ for (TInsuranceAlert alert: list){
userId = null; userId = null;
nickName = null; nickName = null;
alert.setAlertId(alert.getCreateBy());
alert.setAlerter(alert.getCreateName());
if (Common.isNotNull(userMap.get(alert.getCreateBy()))){ if (Common.isNotNull(userMap.get(alert.getCreateBy()))){
domain = domainHashMap.get(alert.getDeptNo()); domain = domainHashMap.get(alert.getDeptNo());
if (Common.isNotNull(domain)){ if (Common.isNotNull(domain)){
...@@ -173,8 +175,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper, ...@@ -173,8 +175,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
nickName= sysConfig.getConfigValue1(); nickName= sysConfig.getConfigValue1();
} }
if (Common.isNotNull(nickName) && Common.isNotNull(userId)){ if (Common.isNotNull(nickName) && Common.isNotNull(userId)){
alert.setCreateBy(userId); alert.setAlerter(nickName);
alert.setCreateName(nickName); alert.setAlertId(userId);
} }
} }
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<result property="buyType" column="buy_type"/> <result property="buyType" column="buy_type"/>
<result property="policyStart" column="policy_start"/> <result property="policyStart" column="policy_start"/>
<result property="policyEnd" column="policy_end"/> <result property="policyEnd" column="policy_end"/>
<result property="policyNo" column="policy_no"/>
<result property="isAddress" column="is_address"/> <result property="isAddress" column="is_address"/>
<result property="position" column="position"/> <result property="position" column="position"/>
<result property="dataSource" column="data_source"/> <result property="dataSource" column="data_source"/>
...@@ -100,7 +101,7 @@ ...@@ -100,7 +101,7 @@
a.create_name, a.create_name,
a.create_time, a.create_time,
a.update_by, a.update_by,
a.update_time a.update_time,a.policy_no
</sql> </sql>
<sql id="tEmployeeInsurancePre_where"> <sql id="tEmployeeInsurancePre_where">
<if test="tEmployeeInsurancePre != null"> <if test="tEmployeeInsurancePre != null">
......
...@@ -1854,8 +1854,11 @@ ...@@ -1854,8 +1854,11 @@
<if test="param.isOverdue != null and param.isOverdue.trim() != ''"> <if test="param.isOverdue != null and param.isOverdue.trim() != ''">
AND a.IS_OVERDUE = #{param.isOverdue} AND a.IS_OVERDUE = #{param.isOverdue}
</if> </if>
<if test="param.createBy != null and param.createBy.trim() != ''"> <if test="param.alerter != null and param.alerter.trim() != ''">
and a.CREATE_BY = #{param.createBy} and a.ALERTER = #{param.alerter}
</if>
<if test="param.alertId != null and param.alertId.trim() != ''">
and a.ALERT_ID = #{param.alertId}
</if> </if>
<if test="param.idList != null and param.idList.size() > 0"> <if test="param.idList != null and param.idList.size() > 0">
and a.id in and a.id in
...@@ -2003,13 +2006,14 @@ ...@@ -2003,13 +2006,14 @@
<select id="pageDiy" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo"> <select id="pageDiy" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo">
<include refid="expire_sql_param"/> <include refid="expire_sql_param"/>
,a.INSURANCE_HANDLE_CITY_NAME ,a.INSURANCE_HANDLE_CITY_NAME,a.ALERTER
from from
t_insurance_alert a t_insurance_alert a
LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID LEFT JOIN view_insurance_replace r on a.id=r.TO_INSURANCE_DETAIL_ID
LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID LEFT JOIN view_insurance_replace r2 on a.id=r2.FROM_INSURANCE_DETAIL_ID
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
<include refid="expire_sql_where"/> <include refid="expire_sql_where"/>
group by a.id
order by a.POLICY_END asc order by a.POLICY_END asc
<if test="param != null and param.limitStart != null"> <if test="param != null and param.limitStart != null">
limit #{param.limitStart},#{param.limitEnd} limit #{param.limitStart},#{param.limitEnd}
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
<result property="unitNo" column="UNIT_NO" jdbcType="VARCHAR"/> <result property="unitNo" column="UNIT_NO" jdbcType="VARCHAR"/>
<result property="expireIgnoreFlag" column="EXPIRE_IGNORE_FLAG" jdbcType="VARCHAR"/> <result property="expireIgnoreFlag" column="EXPIRE_IGNORE_FLAG" jdbcType="VARCHAR"/>
<result property="expireRemark" column="EXPIRE_REMARK" jdbcType="VARCHAR"/> <result property="expireRemark" column="EXPIRE_REMARK" jdbcType="VARCHAR"/>
<result property="alerter" column="ALERTER" jdbcType="VARCHAR"/>
<result property="alertId" column="ALERT_ID" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
......
/*
* 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.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;
import java.time.LocalDateTime;
/**
* 税友推送和拉取的日志表,用于10分钟只能推拉一次
*
* @author hgw
* @date 2025-03-18 15:43:40
*/
@Data
@TableName("t_social_freind_push_and_get")
@Schema(description = "税友推送和拉取的日志表,用于10分钟只能推拉一次")
public class TSocialFreindPushAndGet {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 类型:1推送;2拉取
*/
@ExcelAttribute(name = "类型:1推送;2拉取", isNotEmpty = true, errorInfo = "类型:1推送;2拉取不能为空")
@NotBlank(message = "类型:1推送;2拉取不能为空")
@ExcelProperty("类型:1推送;2拉取")
@Schema(description = "类型:1推送;2拉取")
private Integer type;
/**
* 创建时间
*/
@ExcelAttribute(name = "创建时间", isNotEmpty = true, errorInfo = "创建时间不能为空", isDate = true)
@NotBlank(message = "创建时间不能为空")
@ExcelProperty("创建时间")
@Schema(description = "创建时间")
private LocalDateTime createTime;
/**
* 创建人姓名
*/
@ExcelAttribute(name = "创建人姓名", isNotEmpty = true, errorInfo = "创建人姓名不能为空", maxLength = 50)
@NotBlank(message = "创建人姓名不能为空")
@Length(max = 50, message = "创建人姓名不能超过50个字符")
@ExcelProperty("创建人姓名")
@Schema(description = "创建人姓名")
private String createUserName;
}
...@@ -47,10 +47,10 @@ public class TSocialFriendBackLog { ...@@ -47,10 +47,10 @@ public class TSocialFriendBackLog {
@Schema(description = "主键") @Schema(description = "主键")
private String id; private String id;
/** /**
* 社保ID * 社保ID,逗号拼接
*/ */
@ExcelAttribute(name = "社保ID", maxLength = 32) @ExcelAttribute(name = "社保ID", maxLength = 2000)
@Length(max = 32, message = "社保ID不能超过32个字符") @Length(max = 2000, message = "社保ID不能超过2000个字符")
@ExcelProperty("社保ID") @ExcelProperty("社保ID")
@Schema(description = "社保ID") @Schema(description = "社保ID")
private String socialId; private String socialId;
...@@ -65,7 +65,7 @@ public class TSocialFriendBackLog { ...@@ -65,7 +65,7 @@ public class TSocialFriendBackLog {
@ExcelAttribute(name = "类型") @ExcelAttribute(name = "类型")
@ExcelProperty("类型") @ExcelProperty("类型")
@Schema(description = "类型1社保增 2社保减 3医保增 4医保减 5推送的日志") @Schema(description = "类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取")
private Integer type; private Integer type;
/** /**
......
...@@ -153,6 +153,13 @@ public class SocialHandleSearchVo extends TDispatchInfo { ...@@ -153,6 +153,13 @@ public class SocialHandleSearchVo extends TDispatchInfo {
@Schema(description ="社保ID") @Schema(description ="社保ID")
@ExcelIgnore @ExcelIgnore
private String socialId; private String socialId;
/**
* 社保ID
*/
@TableField(exist = false)
@Schema(description ="社保IDList税友花名册使用")
@ExcelIgnore
private List<String> socialIdList;
/** /**
* 税友自动化办理,此标识区分于页面的导出功能,值为1 时 默认取值派单审核通过 且 未办理的派单数据 * 税友自动化办理,此标识区分于页面的导出功能,值为1 时 默认取值派单审核通过 且 未办理的派单数据
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 查询工作日vo
*
* @author huych
* @date 2025-04-07 10:30:13
*/
@Data
public class TEmployeeInsuranceWorkDayVo implements Serializable {
@Schema(description = "日期")
private Date registDate;
@Schema(description = "类型 1 前一个工作日 2 后一个工作日")
private String type;
}
...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; ...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.THolidayInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.THolidayInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -172,4 +173,14 @@ public class THolidayInfoController { ...@@ -172,4 +173,14 @@ public class THolidayInfoController {
public void createHolidayInfo() { public void createHolidayInfo() {
tHolidayInfoService.createHolidayInfo(); tHolidayInfoService.createHolidayInfo();
} }
/**
* @Author huyc
* @Description 查询日期的前一个/后一个工作日
* @Date 10:27 2025/4/7
**/
@PostMapping("/selectBeforeOrAfterWorkDay")
public R selectBeforeOrAfterWorkDay(@RequestBody TEmployeeInsuranceWorkDayVo vo) {
return tHolidayInfoService.selectBeforeOrAfterWorkDay(vo);
}
} }
...@@ -17,19 +17,27 @@ ...@@ -17,19 +17,27 @@
package com.yifu.cloud.plus.v1.yifu.social.controller; package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.alibaba.fastjson.JSONObject; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFreindPushAndGet;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFreindPushAndGetService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendPushService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendPushService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendService;
import com.yifu.cloud.plus.v1.yifu.social.vo.FriendResult;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.time.LocalDateTime;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
...@@ -44,8 +52,12 @@ import java.util.List; ...@@ -44,8 +52,12 @@ import java.util.List;
@Tag(name = "税友") @Tag(name = "税友")
public class TSocialFriendController { public class TSocialFriendController {
private AtomicInteger atomicPush = new AtomicInteger(0);
private AtomicInteger atomicGet = new AtomicInteger(0);
private final TSocialFriendService tSocialFriendService; private final TSocialFriendService tSocialFriendService;
private final TSocialFriendPushService tSocialFriendPushService; private final TSocialFriendPushService tSocialFriendPushService;
private final TSocialFreindPushAndGetService tSocialFreindPushAndGetService;
@Operation(description = "1定时任务推送税友") @Operation(description = "1定时任务推送税友")
@PostMapping("/inner/doPushFriend") @PostMapping("/inner/doPushFriend")
...@@ -63,4 +75,95 @@ public class TSocialFriendController { ...@@ -63,4 +75,95 @@ public class TSocialFriendController {
return tSocialFriendService.getInfoByRequestId(); return tSocialFriendService.getInfoByRequestId();
} }
/**
* @Description: 主动推送税友
* @Author: hgw
* @Date: 2025/3/18 10:44
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "主动推送税友")
@GetMapping("/doPushFriendByActive")
@SysLog("主动推送税友")
public R<String> doPushFriendActive() {
if (atomicPush.incrementAndGet() <= 1) {
try {
R<String> failed = getCore(CommonConstants.ONE_INT);
if (failed != null) return failed;
} finally {
atomicPush.decrementAndGet();
}
return R.ok();
} else {
atomicPush.decrementAndGet();
return R.failed("距离上一次推送任务时间间隔太短,请10分钟后再试!!");
}
}
/**
* @param type 1推送2拉取
* @Description: 核心处理
* @Author: hgw
* @Date: 2025/3/18 17:27
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private R<String> getCore(int type) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getNickname())) {
return R.failed("请先登录!");
}
// 先加限制 查有没有到10分钟
// 获取当前时间
LocalDateTime now = LocalDateTime.now();
// 计算10分钟前的时间
LocalDateTime tenMinutesAgo = now.minusMinutes(10);
LocalDateTime time = tSocialFreindPushAndGetService.getMaxTimeByType(type);
if (Common.isEmpty(time) || time.isBefore(tenMinutesAgo)) {
TSocialFreindPushAndGet info = new TSocialFreindPushAndGet();
info.setType(type);
info.setCreateTime(now);
info.setCreateUserName(user.getNickname());
tSocialFreindPushAndGetService.save(info);
if (type == CommonConstants.ONE_INT) {
//doJointFriendTask.pushFriendByAsync()
tSocialFriendPushService.pushFriend(null);
} else {
//doJointFriendTask.getInfoByRequestIdByAsync()
tSocialFriendService.getInfoByRequestId();
}
return R.ok();
}
if (Common.isNotNull(time) && time.isAfter(tenMinutesAgo)) {
if (type == CommonConstants.ONE_INT) {
return R.failed("距离上一次推送任务时间间隔太短,请10分钟后再试!");
} else {
return R.failed("距离上一次拉取任务时间间隔太短,请10分钟后再试!");
}
}
return null;
}
/**
* @Description: 主动获取税友
* @Author: hgw
* @Date: 2025/3/18 10:45
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "主动获取税友")
@GetMapping("/doGetFriendByActive")
@SysLog("主动获取税友")
public R<String> doGetFriendByActive() {
if (atomicGet.incrementAndGet() <= 1) {
try {
R<String> failed = getCore(CommonConstants.TWO_INT);
if (failed != null) return failed;
} finally {
atomicGet.decrementAndGet();
}
return R.ok();
} else {
atomicGet.decrementAndGet();
return R.failed("距离上一次推送任务时间间隔太短,请10分钟后再试!!");
}
}
} }
...@@ -31,6 +31,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -31,6 +31,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
...@@ -62,6 +63,18 @@ public class TSocialSoldierLogController { ...@@ -62,6 +63,18 @@ public class TSocialSoldierLogController {
return new R<>(tSocialSoldierLogService.getTSocialSoldierLogPage(page, tSocialSoldierLog)); return new R<>(tSocialSoldierLogService.getTSocialSoldierLogPage(page, tSocialSoldierLog));
} }
/**
* @Description: 获取最新的拉取时间
* @Author: hgw
* @Date: 2025/3/18 18:09
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.time.LocalDateTime>
**/
@Operation(description = "获取最新的拉取时间")
@GetMapping("/getMaxTimeToLog")
public R<LocalDateTime> getMaxTimeToLog() {
return R.ok(tSocialSoldierLogService.getMaxTimeToLog());
}
/** /**
* 不分页查询 * 不分页查询
* *
......
/*
* 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.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFreindPushAndGet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
/**
* 税友推送和拉取的日志表,用于10分钟只能推拉一次
*
* @author hgw
* @date 2025-03-18 15:43:40
*/
@Mapper
public interface TSocialFreindPushAndGetMapper extends BaseMapper<TSocialFreindPushAndGet> {
/**
* @param type 类型:1推送;2拉取
* @Description: 获取当前类型最大的时间,用来判断10分钟内是否有操作过
* @Author: hgw
* @Date: 2025/3/18 15:57
* @return: java.time.LocalDateTime
**/
LocalDateTime getMaxTimeByType(@Param("type") Integer type);
}
...@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo; ...@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
...@@ -46,4 +47,6 @@ public interface TSocialSoldierLogMapper extends BaseMapper<TSocialSoldierLog> { ...@@ -46,4 +47,6 @@ public interface TSocialSoldierLogMapper extends BaseMapper<TSocialSoldierLog> {
List<TSocialSoldierLogExportVo> getTSocialSoldierLogList(@Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog); List<TSocialSoldierLogExportVo> getTSocialSoldierLogList(@Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog);
LocalDateTime getMaxTimeToLog();
} }
...@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -23,6 +23,7 @@ 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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoSearchVo;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -49,4 +50,6 @@ public interface THolidayInfoService extends IService<THolidayInfo> { ...@@ -49,4 +50,6 @@ public interface THolidayInfoService extends IService<THolidayInfo> {
List<THolidayInfo> noPageDiy(THolidayInfoSearchVo searchVo); List<THolidayInfo> noPageDiy(THolidayInfoSearchVo searchVo);
void createHolidayInfo(); void createHolidayInfo();
R selectBeforeOrAfterWorkDay(TEmployeeInsuranceWorkDayVo vo);
} }
/*
* 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.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFreindPushAndGet;
import java.time.LocalDateTime;
/**
* 税友推送和拉取的日志表,用于10分钟只能推拉一次
*
* @author hgw
* @date 2025-03-18 15:43:40
*/
public interface TSocialFreindPushAndGetService extends IService<TSocialFreindPushAndGet> {
/**
* @param type 类型:1推送;2拉取
* @Description: 获取当前类型最大的时间,用来判断10分钟内是否有操作过
* @Author: hgw
* @Date: 2025/3/18 15:57
* @return: java.time.LocalDateTime
**/
LocalDateTime getMaxTimeByType(Integer type);
}
...@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service; ...@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo;
import java.util.List; import java.util.List;
...@@ -40,5 +41,5 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> { ...@@ -40,5 +41,5 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> {
**/ **/
R<String> pushFriend(List<String> dispatchIdList); R<String> pushFriend(List<String> dispatchIdList);
R<String> doExportRoster(String socialId, String type, String unitCreditCode); R<String> doExportRoster(String socialId, String type, String unitCreditCode, List<SociaFriendYgsAddVo> listVo);
} }
...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog; ...@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.vo.*; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
...@@ -42,6 +43,14 @@ public interface TSocialSoldierLogService extends IService<TSocialSoldierLog> { ...@@ -42,6 +43,14 @@ public interface TSocialSoldierLogService extends IService<TSocialSoldierLog> {
*/ */
IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog); IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog);
/**
* @Description: 获取最新的拉取时间
* @Author: hgw
* @Date: 2025/3/18 18:10
* @return: java.time.LocalDateTime
**/
LocalDateTime getMaxTimeToLog();
void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo); void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo);
List<TSocialSoldierLog> noPageDiy(TSocialSoldierLogSearchVo searchVo); List<TSocialSoldierLog> noPageDiy(TSocialSoldierLogSearchVo searchVo);
......
...@@ -1402,6 +1402,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1402,6 +1402,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity())); dispatch.setIdCardCity(Common.isNotNullToStr(empVo.getIdCity()));
dispatch.setIdCardTown(Common.isNotNullToStr(empVo.getIdTown())); dispatch.setIdCardTown(Common.isNotNullToStr(empVo.getIdTown()));
} }
if (Common.isEmpty(dispatch.getSchoolName())) {
dispatch.setSchoolName(empVo.getSchool());
}
} }
// 生成申请编码 // 生成申请编码
......
...@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
...@@ -2185,16 +2186,69 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2185,16 +2186,69 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
**/ **/
@Override @Override
public void everyMonthCreateForecastLibary() { public void everyMonthCreateForecastLibary() {
List<TSocialFundInfo> socialFundInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()); int pageSize = 5000; // 根据实际内存调整,建议从配置文件中读取
int page = 0;
String payMonth = DateUtil.addMonth(1);
Page<TSocialFundInfo> pageInfo;
List<TSocialFundInfo> batch;
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
try {
while (true) {
pageInfo = new Page<>(page, pageSize);
batch = socialFundInfoMapper.selectPage(pageInfo,
Wrappers.<TSocialFundInfo>query().lambda()
.and(obj -> obj.isNotNull(TSocialFundInfo::getSettleDomainCode)
.or()
.isNotNull(TSocialFundInfo::getSettleDomainCodeFund)
)
).getRecords();
if (batch == null || batch.isEmpty()) {
break; // 明确退出条件
}
// 并行处理,确保线程安全性
batch.parallelStream().forEach(socialFundInfo -> {
try {
// 异常场景:有公积金无社保数据,可通过身份证或结算主体页面重新生成数据
String deptNo = null == socialFundInfo.getSettleDomainCode()?socialFundInfo.getSettleDomainCodeFund():socialFundInfo.getSettleDomainCode();
if (Common.isNotNull(deptNo) && null != mapSelectVo.get(deptNo)){
everyMonthCreateForecastLibaryCore(payMonth, socialFundInfo,mapSelectVo);
}
} catch (Exception e) {
// 捕获并记录单个处理中的异常,避免影响其他数据
log.error("Error processing socialFundInfo: " + socialFundInfo.getId() + ", Exception: " + e.getMessage());
}
});
page++;
// 增加内存监控点
if((Runtime.getRuntime().freeMemory() * 100 / Runtime.getRuntime().totalMemory()) < 20) {
log.error("内存警戒值达到80%使用率=>"+"可用内存:"+(Runtime.getRuntime().freeMemory()));
}else {
log.info("本次可用内存:"+(Runtime.getRuntime().freeMemory()) + ",总内存:" + Runtime.getRuntime().totalMemory());
}
}
} catch (Exception e) {
// 捕获外部异常,防止程序崩溃
log.error("An error occurred during batch processing: " + e.getMessage());
}
// 移除强制GC,让JVM自动管理内存
/*List<TSocialFundInfo> socialFundInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda());
if (socialFundInfoList != null && !socialFundInfoList.isEmpty()) { if (socialFundInfoList != null && !socialFundInfoList.isEmpty()) {
String payMonth = DateUtil.addMonth(1); String payMonth = DateUtil.addMonth(1);
for (TSocialFundInfo socialFundInfo : socialFundInfoList) { for (TSocialFundInfo socialFundInfo : socialFundInfoList) {
everyMonthCreateForecastLibaryCore(payMonth, socialFundInfo); everyMonthCreateForecastLibaryCore(payMonth, socialFundInfo);
} }
} }*/
} }
private R<String> everyMonthCreateForecastLibaryCore(String payMonth, TSocialFundInfo socialFundInfo) { private R<String> everyMonthCreateForecastLibaryCore(String payMonth,
TSocialFundInfo socialFundInfo,
Map<String,TSettleDomainSelectVo> mapSelectVo) {
String empIdCard = socialFundInfo.getEmpIdcard(); String empIdCard = socialFundInfo.getEmpIdcard();
//定义未推送的按条件查询得到的预估数据 //定义未推送的按条件查询得到的预估数据
List<TForecastLibrary> librarySocialList = null; List<TForecastLibrary> librarySocialList = null;
...@@ -2295,7 +2349,6 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2295,7 +2349,6 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>(); List<TForecastLibrary> libraryFundInfoListSocial = new ArrayList<>();
List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>(); List<TForecastLibrary> libraryFundInfoListFund = new ArrayList<>();
//社保收入 //社保收入
Map<String,TSettleDomainSelectVo> mapSelectVo = this.getSelectVoMap();
String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush"; String redisKey = String.valueOf(UUID.randomUUID()).replaceAll("-", "") + "_incomePush";
if (Common.isNotNull(socialFundInfo.getSocialId()) if (Common.isNotNull(socialFundInfo.getSocialId())
&& CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus()) && CommonConstants.FOUR_STRING.equals(socialFundInfo.getSocialStatus())
...@@ -2453,6 +2506,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2453,6 +2506,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
return mapSelectVo; return mapSelectVo;
} }
@Override @Override
public void createForecastFundInfo() { public void createForecastFundInfo() {
long count = baseMapper.selectCount(Wrappers.<TForecastLibrary>query().lambda() long count = baseMapper.selectCount(Wrappers.<TForecastLibrary>query().lambda()
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.yifu.social.service.impl; package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
...@@ -33,12 +32,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -33,12 +32,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; 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.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.THolidayInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.THolidayInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.THolidayInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.THolidayInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoVo; import com.yifu.cloud.plus.v1.yifu.social.vo.THolidayInfoVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -50,10 +48,7 @@ import java.io.IOException; ...@@ -50,10 +48,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* @author fxj * @author fxj
...@@ -284,4 +279,31 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo ...@@ -284,4 +279,31 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
} }
log.info(DateUtil.getYear(new Date())+"年假期表初始化完成:"); log.info(DateUtil.getYear(new Date())+"年假期表初始化完成:");
} }
@Override
public R selectBeforeOrAfterWorkDay(TEmployeeInsuranceWorkDayVo vo) {
//获取当年所有假期配置表
Date date = new Date();
List<THolidayInfo> holidayInfos = baseMapper.selectList(Wrappers.<THolidayInfo>query().lambda()
.eq(THolidayInfo::getYear,DateUtil.getYear(date)));
Map<Date,String> holidayMap = new HashMap<>();
if (Common.isNotNull(holidayInfos)){
for (THolidayInfo h:holidayInfos){
holidayMap.put(h.getDate(),h.getDay());
}
}
getWorkDay(holidayMap,vo);
return R.ok(vo);
}
private void getWorkDay(Map<Date, String> holidayMap, TEmployeeInsuranceWorkDayVo vo) {
String day= holidayMap.get(vo.getRegistDate());
if (Common.isNotNull(day)){
vo.setRegistDate(DateUtil.addDayByDate(vo.getRegistDate(), vo.getType().equals(CommonConstants.ONE_STRING)
? CommonConstants.ONE_INT_NEGATE : CommonConstants.ONE_INT));
}else {
return;
}
getWorkDay(holidayMap,vo);
}
} }
/*
* 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.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFreindPushAndGet;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFreindPushAndGetMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFreindPushAndGetService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
/**
* 税友推送和拉取的日志表,用于10分钟只能推拉一次
*
* @author hgw
* @date 2025-03-18 15:43:40
*/
@Log4j2
@Service
public class TSocialFreindPushAndGetServiceImpl extends ServiceImpl<TSocialFreindPushAndGetMapper, TSocialFreindPushAndGet> implements TSocialFreindPushAndGetService {
/**
* @param type 类型:1推送;2拉取
* @Description: 获取当前类型最大的时间,用来判断10分钟内是否有操作过
* @Author: hgw
* @Date: 2025/3/18 15:57
* @return: java.time.LocalDateTime
**/
@Override
public LocalDateTime getMaxTimeByType(Integer type) {
return baseMapper.getMaxTimeByType(type);
}
}
...@@ -37,6 +37,7 @@ import org.springframework.stereotype.Service; ...@@ -37,6 +37,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* 税友 * 税友
...@@ -58,6 +59,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -58,6 +59,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
private final TSocialSoldierLogService tSocialSoldierLogService; private final TSocialSoldierLogService tSocialSoldierLogService;
private final TSocialFriendBackLogService tSocialFriendBackLogService; private final TSocialFriendBackLogService tSocialFriendBackLogService;
private final TSocialFreindSetService tSocialFreindSetService; private final TSocialFreindSetService tSocialFreindSetService;
private final AtomicInteger atomicGetFriend = new AtomicInteger(0);
/** /**
* @Description: 5 查看任务进度 * @Description: 5 查看任务进度
...@@ -67,73 +69,110 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -67,73 +69,110 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
**/ **/
@Override @Override
public R<String> getInfoByRequestId() { public R<String> getInfoByRequestId() {
TSocialFreindSet set = tSocialFreindSetService.getById("1"); if (atomicGetFriend.incrementAndGet() <= 1) {
if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) { try {
// true养工失 false 医生大 TSocialFreindSet set = tSocialFreindSetService.getById("1");
boolean typeFlag = true; if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) {
Set<String> dbAuthsSet = new HashSet<>(); // true养工失 false 医生大
Collection<? extends GrantedAuthority> authorities = AuthorityUtils boolean typeFlag = true;
.createAuthorityList(dbAuthsSet.toArray(new String[0])); Set<String> dbAuthsSet = new HashSet<>();
YifuUser user = new YifuUser("1", 1L, "", "税友", Collection<? extends GrantedAuthority> authorities = AuthorityUtils
"税友", "0", SecurityConstants.BCRYPT + "123456", .createAuthorityList(dbAuthsSet.toArray(new String[0]));
"12345678911", true, true, true, YifuUser user = new YifuUser("1", 1L, "", "税友",
true, "税友", "0", SecurityConstants.BCRYPT + "123456",
"1", authorities, "1", "12345678911", true, true, true,
null, null, true,
null, null); "1", authorities, "1",
// 失败原因配置 null, null,
Map<String, FailReasonConfig> errorMap = failReasonConfigService.getFailReasonMap(); null, null);
// 获取所有需要反馈的任务id // 失败原因配置
List<TSocialInfo> socialList = tSocialInfoService.getSocialFriendYgsAll(); Map<String, FailReasonConfig> errorMap = failReasonConfigService.getFailReasonMap();
List<TSocialFriendBackLog> logList; // 获取所有需要反馈的任务id
TSocialFriendBackLog backLog; List<TSocialInfo> socialList = tSocialInfoService.getSocialFriendYgsAll();
if (socialList != null && !socialList.isEmpty()) { List<TSocialFriendBackLog> logList;
FriendResult info; TSocialFriendBackLog backLog = new TSocialFriendBackLog();
logList = new ArrayList<>(); FriendResult info;
for (TSocialInfo socialInfo : socialList) { List<FriendResult> resultList;
backLog = new TSocialFriendBackLog(); Map<String, FriendResult> resultMap;
backLog.setSocialId(socialInfo.getId()); if (socialList != null && !socialList.isEmpty()) {
backLog.setRequestId(socialInfo.getYgsRequestId()); logList = new ArrayList<>();
backLog.setType(1); resultMap = new HashMap<>();
if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) { for (TSocialInfo socialInfo : socialList) {
backLog.setType(2); info = resultMap.get(socialInfo.getEmpIdcard());
} if (info == null) {
info = socialFriendConfig.getFriendByRequestId(restTemplate, socialInfo.getYgsRequestId(), backLog, socialInfo.getDispatchType()); backLog = new TSocialFriendBackLog();
logList.add(backLog); backLog.setSocialId(socialInfo.getEmpIdcard());
if (info != null && Common.isNotNull(info.getZt())) { backLog.setRequestId(socialInfo.getYgsRequestId());
doCore(info, socialInfo, typeFlag, user, errorMap); backLog.setType(11);
} if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) {
} backLog.setType(12);
if (!logList.isEmpty()) { }
tSocialFriendBackLogService.saveBatch(logList); resultList = socialFriendConfig.getFriendByRequestId(restTemplate, socialInfo.getYgsRequestId()
} , backLog, socialInfo.getDispatchType());
} logList.add(backLog);
// 医保 if (resultList != null && !resultList.isEmpty()) {
typeFlag = false; for (FriendResult result : resultList) {
List<TSocialInfo> socialYsdList = tSocialInfoService.getSocialFriendYsdAll(); resultMap.put(result.getIdCard(), result);
if (socialYsdList != null && !socialYsdList.isEmpty()) { }
FriendResult info; info = resultMap.get(socialInfo.getEmpIdcard());
logList = new ArrayList<>(); }
for (TSocialInfo socialInfo : socialYsdList) { } else {
backLog = new TSocialFriendBackLog(); backLog.setSocialId(backLog.getSocialId() + "," +socialInfo.getEmpIdcard());
backLog.setSocialId(socialInfo.getId()); }
backLog.setRequestId(socialInfo.getYsdRequestId()); if (info != null && Common.isNotNull(info.getZt())) {
backLog.setType(3); doCore(info, socialInfo, typeFlag, user, errorMap);
if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) { }
backLog.setType(4); }
if (!logList.isEmpty()) {
tSocialFriendBackLogService.saveBatch(logList);
}
} }
info = socialFriendConfig.getFriendByRequestId(restTemplate, socialInfo.getYsdRequestId(), backLog, socialInfo.getDispatchType()); // 医保
logList.add(backLog); typeFlag = false;
if (info != null && Common.isNotNull(info.getZt())) { List<TSocialInfo> socialYsdList = tSocialInfoService.getSocialFriendYsdAll();
doCore(info, socialInfo, typeFlag, user, errorMap); if (socialYsdList != null && !socialYsdList.isEmpty()) {
logList = new ArrayList<>();
resultMap = new HashMap<>();
backLog = new TSocialFriendBackLog();
for (TSocialInfo socialInfo : socialYsdList) {
info = resultMap.get(socialInfo.getEmpIdcard());
if (info == null) {
backLog = new TSocialFriendBackLog();
backLog.setSocialId(socialInfo.getEmpIdcard());
backLog.setRequestId(socialInfo.getYsdRequestId());
backLog.setType(13);
if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) {
backLog.setType(14);
}
resultList = socialFriendConfig.getFriendByRequestId(restTemplate, socialInfo.getYsdRequestId()
, backLog, socialInfo.getDispatchType());
if (resultList != null && !resultList.isEmpty()) {
for (FriendResult result : resultList) {
resultMap.put(result.getIdCard(), result);
}
info = resultMap.get(socialInfo.getEmpIdcard());
}
logList.add(backLog);
} else {
backLog.setSocialId(backLog.getSocialId() + "," +socialInfo.getEmpIdcard());
}
if (info != null && Common.isNotNull(info.getZt())) {
doCore(info, socialInfo, typeFlag, user, errorMap);
}
}
if (!logList.isEmpty()) {
tSocialFriendBackLogService.saveBatch(logList);
}
} }
} }
if (!logList.isEmpty()) { } finally {
tSocialFriendBackLogService.saveBatch(logList); atomicGetFriend.decrementAndGet();
}
} }
return R.ok();
} else {
atomicGetFriend.decrementAndGet();
return R.failed("距离上一次获取任务时间间隔太短,请10分钟后再试!!!");
} }
return R.ok();
} }
/** /**
...@@ -244,7 +283,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -244,7 +283,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
updateSocial.setYgsHandleStatus(ygsHandleStatus); updateSocial.setYgsHandleStatus(ygsHandleStatus);
// 拉取审核结果,加日志 // 拉取审核结果,加日志
if (Common.isNotNull(ygsHandleStatus)) { if (Common.isNotNull(ygsHandleStatus)) {
socialLog = tSocialSoldierLogService.getSocialFriendLog(socialInfo, "提交", "社保" socialLog = tSocialSoldierLogService.getSocialFriendLog(socialInfo, "拉取", "社保"
, getStatusName(Integer.parseInt(ygsHandleStatus))); , getStatusName(Integer.parseInt(ygsHandleStatus)));
tSocialSoldierLogService.save(socialLog); tSocialSoldierLogService.save(socialLog);
} }
...@@ -333,7 +372,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -333,7 +372,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
// 拉取审核结果,加日志 // 拉取审核结果,加日志
if (Common.isNotNull(ysdHandleStatus)) { if (Common.isNotNull(ysdHandleStatus)) {
socialLog = tSocialSoldierLogService.getSocialFriendLog(socialInfo, "提交", "医保" socialLog = tSocialSoldierLogService.getSocialFriendLog(socialInfo, "拉取", "医保"
, getStatusName(Integer.parseInt(ysdHandleStatus))); , getStatusName(Integer.parseInt(ysdHandleStatus)));
tSocialSoldierLogService.save(socialLog); tSocialSoldierLogService.save(socialLog);
} }
......
...@@ -41,6 +41,7 @@ import javax.servlet.ServletOutputStream; ...@@ -41,6 +41,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -64,6 +65,11 @@ public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogM ...@@ -64,6 +65,11 @@ public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogM
return baseMapper.getTSocialSoldierLogPage(page, tSocialSoldierLog); return baseMapper.getTSocialSoldierLogPage(page, tSocialSoldierLog);
} }
@Override
public LocalDateTime getMaxTimeToLog() {
return baseMapper.getMaxTimeToLog();
}
/** /**
* 自动化日志批量导出 * 自动化日志批量导出
* *
......
...@@ -11,9 +11,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; ...@@ -11,9 +11,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.EkpDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.EkpDaprUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpFundUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpIncomeUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamManage;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushFundParam;
...@@ -31,7 +28,10 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -31,7 +28,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 主要执行人员档案的员工类型同步更新 * 主要执行人员档案的员工类型同步更新
...@@ -43,15 +43,6 @@ import java.util.*; ...@@ -43,15 +43,6 @@ import java.util.*;
@Component @Component
public class DoJointSocialTask { public class DoJointSocialTask {
@Autowired
private EkpIncomeUtil ekpIncomeUtil;
@Autowired
private EkpSocialUtil ekpSocialUtil;
@Autowired
private EkpFundUtil ekpFundUtil;
@Autowired @Autowired
private TSendEkpErrorService tSendEkpErrorService; private TSendEkpErrorService tSendEkpErrorService;
...@@ -970,7 +961,10 @@ public class DoJointSocialTask { ...@@ -970,7 +961,10 @@ public class DoJointSocialTask {
//获取项目信息 //获取项目信息
settleDomain = selectVoMap.get(library.getDeptNo()); settleDomain = selectVoMap.get(library.getDeptNo());
if (Common.isEmpty(settleDomain)) { if (Common.isEmpty(settleDomain)) {
ServiceUtil.runTimeExceptionDiy("获取结算主体异常,请检查传参和档案服务状态!"); // 抛出异常错误,通过邮件提醒处理
log.error("获取结算主体("+library.getDeptNo()+")异常,请检查传参和档案服务状态!");
continue;
//ServiceUtil.runTimeExceptionDiy("获取结算主体异常,请检查传参和档案服务状态!");
} }
if (CommonConstants.ZERO_STRING.equals(settleDomain.getSocialType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getSocialType())) {
continue; continue;
...@@ -1264,7 +1258,10 @@ public class DoJointSocialTask { ...@@ -1264,7 +1258,10 @@ public class DoJointSocialTask {
//获取项目信息 //获取项目信息
settleDomain = selectVoMap.get(library.getDeptNo()); settleDomain = selectVoMap.get(library.getDeptNo());
if (Common.isEmpty(settleDomain)) { if (Common.isEmpty(settleDomain)) {
ServiceUtil.runTimeExceptionDiy("获取结算主体异常,请检查传参和档案服务状态!"); // 抛出异常错误,通过邮件提醒处理
log.error("获取结算主体("+library.getDeptNo()+")异常,请检查传参和档案服务状态!");
continue;
//ServiceUtil.runTimeExceptionDiy("获取结算主体异常,请检查传参和档案服务状态!");
} }
if (CommonConstants.ZERO_STRING.equals(settleDomain.getFundType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getFundType())) {
continue; continue;
...@@ -1587,4 +1584,5 @@ public class DoJointSocialTask { ...@@ -1587,4 +1584,5 @@ public class DoJointSocialTask {
sb.insert(4, "-"); sb.insert(4, "-");
return sb.toString(); return sb.toString();
} }
} }
...@@ -279,7 +279,8 @@ public class DoSocialTask { ...@@ -279,7 +279,8 @@ public class DoSocialTask {
} }
// 当前默认 安徽省 ,且开关是税友的,才可以税友推送办理 // 当前默认 安徽省 ,且开关是税友的,才可以税友推送办理
if (isFriend) { if (isFriend) {
tSocialFriendPushService.pushFriend(dispatchIdList); // 断开派单单条推送税友
// tSocialFriendPushService.pushFriend(dispatchIdList);
} else { } else {
tSocialSoldierPushService.pushSoldier(dispatchIdList); tSocialSoldierPushService.pushSoldier(dispatchIdList);
} }
......
...@@ -2373,6 +2373,12 @@ ...@@ -2373,6 +2373,12 @@
<if test="tDispatchInfo.socialId != null and tDispatchInfo.socialId.trim() != ''"> <if test="tDispatchInfo.socialId != null and tDispatchInfo.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tDispatchInfo.socialId} AND a.SOCIAL_ID = #{tDispatchInfo.socialId}
</if> </if>
<if test="tDispatchInfo.socialIdList != null and tDispatchInfo.socialIdList.size > 0 ">
AND a.SOCIAL_ID in
<foreach item="items" index="index" collection="tDispatchInfo.socialIdList" open="(" separator="," close=")">
#{items}
</foreach>
</if>
<if test="tDispatchInfo.syFlag != null and tDispatchInfo.syFlag.trim() == '1'"> <if test="tDispatchInfo.syFlag != null and tDispatchInfo.syFlag.trim() == '1'">
AND a.STATUS = '2' AND a.STATUS = '2'
</if> </if>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFreindPushAndGetMapper">
<resultMap id="tSocialFreindPushAndGetMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFreindPushAndGet">
<id property="id" column="ID"/>
<result property="type" column="TYPE"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="createUserName" column="CREATE_USER_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.TYPE,
a.CREATE_TIME,
a.CREATE_USER_NAME
</sql>
<sql id="tSocialFreindPushAndGet_where">
<if test="tSocialFreindPushAndGet != null">
<if test="tSocialFreindPushAndGet.id != null and tSocialFreindPushAndGet.id.trim() != ''">
AND a.ID = #{tSocialFreindPushAndGet.id}
</if>
<if test="tSocialFreindPushAndGet.type != null">
AND a.TYPE = #{tSocialFreindPushAndGet.type}
</if>
<if test="tSocialFreindPushAndGet.createTime != null">
AND a.CREATE_TIME = #{tSocialFreindPushAndGet.createTime}
</if>
<if test="tSocialFreindPushAndGet.createUserName != null and tSocialFreindPushAndGet.createUserName.trim() != ''">
AND a.CREATE_USER_NAME = #{tSocialFreindPushAndGet.createUserName}
</if>
</if>
</sql>
<!--获取当前类型最大的时间,用来判断10分钟内是否有操作过-->
<select id="getMaxTimeByType" resultType="java.time.LocalDateTime">
SELECT
max(a.CREATE_TIME)
FROM t_social_freind_push_and_get a
where a.TYPE = #{type}
</select>
</mapper>
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '0' if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '0'
) )
group by s.id group by s.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
<sql id="where_getSocialSoldier_base_handler"> <sql id="where_getSocialSoldier_base_handler">
...@@ -149,6 +150,7 @@ ...@@ -149,6 +150,7 @@
if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '5' if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '5'
) )
group by a.id group by a.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
<!-- 税友医生大增加模板--> <!-- 税友医生大增加模板-->
...@@ -165,6 +167,7 @@ ...@@ -165,6 +167,7 @@
if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '0' if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '0'
) )
group by s.id group by s.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
<!-- 税友医生大减少模板--> <!-- 税友医生大减少模板-->
...@@ -239,6 +242,7 @@ ...@@ -239,6 +242,7 @@
if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '5' if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '5'
) )
group by s.id group by s.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
</mapper> </mapper>
...@@ -611,7 +611,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -611,7 +611,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
left join t_dispatch_info d on d.SOCIAL_ID = a.id left join t_dispatch_info d on d.SOCIAL_ID = a.id
left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0' left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0'
and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN)) and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN))
where a.YGS_ADD_ID is not null and a.YGS_ADD_ID != '' and d.AUTO_FLAG='0' where a.YGS_ADD_ID is not null and a.YGS_ADD_ID != '' and a.YGS_REQUEST_ID is null and d.AUTO_FLAG='0'
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YGS_HANDLE_STATUS in ('1','2','3') and a.YGS_HANDLE_STATUS in ('1','2','3')
group by a.id group by a.id
...@@ -635,7 +635,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -635,7 +635,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
left join t_dispatch_info d on d.SOCIAL_ID = a.id left join t_dispatch_info d on d.SOCIAL_ID = a.id
left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0' left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0'
and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN)) and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN))
where a.YSD_ADD_ID is not null and a.YSD_ADD_ID != '' and d.AUTO_FLAG='0' where a.YSD_ADD_ID is not null and a.YSD_ADD_ID != '' and a.YSD_REQUEST_ID is null and d.AUTO_FLAG='0'
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YSD_HANDLE_STATUS in ('1','2','3') and a.YSD_HANDLE_STATUS in ('1','2','3')
group by a.id group by a.id
...@@ -662,6 +662,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -662,6 +662,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YGS_HANDLE_STATUS in ('1','2') and a.YGS_HANDLE_STATUS in ('1','2')
group by a.id group by a.id
order by a.YGS_REQUEST_ID asc
</select> </select>
<!-- 获取所有需要自动办理的医生大 --> <!-- 获取所有需要自动办理的医生大 -->
...@@ -687,6 +688,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -687,6 +688,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YSD_HANDLE_STATUS in ('1','2') and a.YSD_HANDLE_STATUS in ('1','2')
group by a.id group by a.id
order by a.YSD_REQUEST_ID asc
</select> </select>
<!-- 获取所有需要社保局审核的养工失 --> <!-- 获取所有需要社保局审核的养工失 -->
......
...@@ -41,19 +41,19 @@ ...@@ -41,19 +41,19 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
a.ADD_ID, a.ADD_ID,
a.SOCIAL_ID, a.SOCIAL_ID,
a.EMP_IDCARD, a.EMP_IDCARD,
a.EMP_NAME, a.EMP_NAME,
a.DISPATCH_ITEM, a.DISPATCH_ITEM,
a.SOCIAL_HU_NAME, a.SOCIAL_HU_NAME,
a.TYPE, a.TYPE,
a.REMARK, a.REMARK,
a.CREATE_BY, a.CREATE_BY,
a.UPDATE_BY, a.UPDATE_BY,
a.CREATE_NAME, a.CREATE_NAME,
a.UPDATE_TIME, a.UPDATE_TIME,
a.CREATE_TIME a.CREATE_TIME
</sql> </sql>
<sql id="tSocialSoldierLog_where"> <sql id="tSocialSoldierLog_where">
<if test="tSocialSoldierLog != null"> <if test="tSocialSoldierLog != null">
...@@ -132,4 +132,13 @@ ...@@ -132,4 +132,13 @@
</if> </if>
</if> </if>
</select> </select>
<!--tSocialSoldierLog简单分页查询-->
<select id="getMaxTimeToLog" resultType="java.time.LocalDateTime">
SELECT
max(a.CREATE_TIME)
FROM t_social_soldier_log a
where a.TYPE = '拉取'
</select>
</mapper> </mapper>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao ,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and s.YGS_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '0' or
if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '0' or
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao ,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and a.type = '1' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and s.YGS_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '5' or
if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '5' or
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen ,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and s.YSD_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '0' or
if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '0' or
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen ,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and s.YSD_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '5' or
if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '5' or
......
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