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); initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
archivesDaprUtil.saveRegistPreInfo(preVo); 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); initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
archivesDaprUtil.saveRegistPreInfo(preVo); 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,9 +1088,10 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1060,9 +1088,10 @@ 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.setId(registration.getId());
preVo.setCustomerUsername(registration.getCustomerUsername()); preVo.setCustomerUsername(registration.getCustomerUsername());
preVo.setCustomerUserLoginname(registration.getCustomerUserLoginname()); preVo.setCustomerUserLoginname(registration.getCustomerUserLoginname());
preVo.setDeptName(registration.getDeptName()); preVo.setDeptName(registration.getDeptName());
...@@ -1070,7 +1099,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1070,7 +1099,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setDataSource(registration.getDataSource()); preVo.setDataSource(registration.getDataSource());
preVo.setPosition(registration.getPosition()); preVo.setPosition(registration.getPosition());
preVo.setJoinLeaveDate(registration.getJoinLeaveDate()); preVo.setJoinLeaveDate(registration.getJoinLeaveDate());
preVo.setProcessStatus(CommonConstants.ZERO_STRING);
preVo.setConfirmTime(DateUtil.getCurrentDateTime()); preVo.setConfirmTime(DateUtil.getCurrentDateTime());
preVo.setDeptNo(registration.getDeptNo()); preVo.setDeptNo(registration.getDeptNo());
preVo.setConfirmUser(user.getNickname()); preVo.setConfirmUser(user.getNickname());
...@@ -1082,12 +1110,34 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1082,12 +1110,34 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setCreateName(user.getNickname()); preVo.setCreateName(user.getNickname());
preVo.setUpdateBy(user.getId()); preVo.setUpdateBy(user.getId());
preVo.setEmpIdcard(registration.getEmpIdcard()); preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.setProcessStatus(status);
if (Common.isNotNull(preVo.getPushDate())) { if (Common.isNotNull(preVo.getPushDate())) {
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString( preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
registration.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " " + preVo.getPushDate(), DateUtil.DATETIME_PATTERN_MINUTE)); 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;
});
}
}
...@@ -8,30 +8,42 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -8,30 +8,42 @@ 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.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
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.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
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.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.ScheduleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreExportVo; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo; import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
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;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* 商险待办任务表 * 商险待办任务表
...@@ -47,6 +59,14 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -47,6 +59,14 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Autowired @Autowired
private ArchivesDaprUtil archivesDaprUtil; private ArchivesDaprUtil archivesDaprUtil;
@Autowired
@Lazy
private TInsuranceDetailService detailService;
@Autowired
@Lazy
private ScheduleService scheduleService;
/** /**
* 商险待办任务表简单分页查询 * 商险待办任务表简单分页查询
* *
...@@ -123,6 +143,159 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -123,6 +143,159 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
return R.ok(); return R.ok();
} }
@Override
public R batchDispatcherInsurance(List<String> idList) {
List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query()
.lambda().in(TEmployeeInsurancePre::getId, idList)
.in(TEmployeeInsurancePre::getProcessStatus, CommonConstants.processInsurancesStatus));
if (Common.isEmpty(insurancePreList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
List<InsuranceAddParam> addParamList = new ArrayList<>();
List<InsuranceBatchParam> batchAddParamList = new ArrayList<>();
List<InsuranceReplaceParam> replaceAddParamList = new ArrayList<>();
for (TEmployeeInsurancePre insurancePre : insurancePreList) {
//新增、批增、替换
if (CommonConstants.ONE_INT == insurancePre.getBuyType()) {
InsuranceAddParam addParam = new InsuranceAddParam();
addParam.setEmpName(insurancePre.getEmployeeName());
addParam.setEmpIdcardNo(insurancePre.getEmpIdcard());
addParam.setDeptNo(insurancePre.getDeptNo());
addParam.setInsuranceCompanyName(insurancePre.getInsuranceCompanyName());
addParam.setInsuranceTypeName(insurancePre.getInsuranceTypeName());
addParam.setPolicyStart(DateUtil.dateToString(insurancePre.getPolicyStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT));
addParam.setPolicyEnd(DateUtil.dateToString(insurancePre.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT));
addParam.setBuyStandard(insurancePre.getBuyStandard());
addParam.setInsuranceProvinceName(insurancePre.getFileProvince());
addParam.setInsuranceCityName(insurancePre.getFileCity());
addParam.setSettleMonth(CommonConstants.EMPTY_STRING);
addParam.setPost(insurancePre.getPosition());
addParam.setRemark(CommonConstants.EMPTY_STRING);
addParamList.add(addParam);
}
if (CommonConstants.TWO_INT == insurancePre.getBuyType()) {
InsuranceBatchParam addParam = new InsuranceBatchParam();
addParam.setEmpName(insurancePre.getEmployeeName());
addParam.setEmpIdcardNo(insurancePre.getEmpIdcard());
addParam.setDeptNo(insurancePre.getDeptNo());
addParam.setInsuranceCompanyName(insurancePre.getInsuranceCompanyName());
addParam.setInsuranceTypeName(insurancePre.getInsuranceTypeName());
addParam.setPolicyNo(insurancePre.getPolicyNo());
addParam.setBuyStandard(insurancePre.getBuyStandard());
addParam.setInsuranceProvinceName(insurancePre.getFileProvince());
addParam.setInsuranceCityName(insurancePre.getFileCity());
addParam.setSettleMonth(CommonConstants.EMPTY_STRING);
addParam.setPost(insurancePre.getPosition());
addParam.setRemark(CommonConstants.EMPTY_STRING);
batchAddParamList.add(addParam);
}
if (CommonConstants.THREE_INT == insurancePre.getBuyType()) {
InsuranceReplaceParam addParam = new InsuranceReplaceParam();
addParam.setEmpName(insurancePre.getEmployeeName());
addParam.setEmpIdcardNo(insurancePre.getEmpIdcard());
addParam.setDeptNo(insurancePre.getDeptNo());
addParam.setInsuranceCompanyName(insurancePre.getInsuranceCompanyName());
addParam.setInsuranceTypeName(insurancePre.getInsuranceTypeName());
addParam.setBuyStandard(insurancePre.getBuyStandard());
addParam.setPolicyStart(DateUtil.dateToString(insurancePre.getPolicyStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT));
addParam.setPolicyEnd(DateUtil.dateToString(insurancePre.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT));
addParam.setPost(insurancePre.getPosition());
addParam.setReplaceEmpName(insurancePre.getReplaceEmployeeName());
addParam.setReplaceDeptNo(insurancePre.getReplaceDeptNo());
addParam.setReplaceEmpIdcardNo(insurancePre.getReplaceEmpIdcard());
//todo
// addParam.setRemark(CommonConstants.EMPTY_STRING);
replaceAddParamList.add(addParam);
}
}
//组装返回给前端
List<InsuranceAddParam> paramList = new ArrayList<>();
List<InsuranceBatchParam> batchParamList = new ArrayList<>();
List<InsuranceReplaceParam> replaceParamList = new ArrayList<>();
if (!addParamList.isEmpty()) {
R<List<InsuranceAddParam>> listR = detailService.addInsurance(addParamList,null);
if (Common.isNotNull(listR) && !listR.getData().isEmpty()) {
paramList = listR.getData();
}
}
if (!batchAddParamList.isEmpty()) {
R<List<InsuranceBatchParam>> listR = detailService.batchInsurance(batchAddParamList,null);
if (Common.isNotNull(listR) && !listR.getData().isEmpty()) {
batchParamList = listR.getData();
}
}
if (!replaceAddParamList.isEmpty()) {
R<List<InsuranceReplaceParam>> listR = detailService.replaceInsurance(replaceAddParamList,null);
if (Common.isNotNull(listR) && !listR.getData().isEmpty()) {
replaceParamList = listR.getData();
}
}
// 使用Stream合并三个列表
List<InsuranceAutoParam> autoAddParamList = Stream.concat(
paramList.stream().map(this::convertAddParam),
Stream.concat(
batchParamList.stream().map(this::convertBatchParam),
replaceParamList.stream().map(this::convertReplaceParam)
)
).collect(Collectors.toList());
return R.ok(autoAddParamList);
}
@Override
@Transactional
public Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo registrationPreVo) {
List<TEmployeeInsurancePreVo> employeeInsurancePreVos = registrationPreVo.getEmployeeInsurancePreVos();
TEmployeeInsurancePre preExit;
if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) {
for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) {
//判断是否存在商险待购买信息
preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getEmpIdcard, preVo.getEmpIdcard())
.eq(TEmployeeInsurancePre::getDeptNo, preVo.getDeptNo())
.eq(TEmployeeInsurancePre::getBuyType, preVo.getBuyType())
.last(CommonConstants.LAST_ONE_SQL));
TEmployeeInsurancePre pre = new TEmployeeInsurancePre();
BeanUtils.copyProperties(preVo, pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
baseMapper.insert(pre);
baseMapper.deleteById(preExit);
//todo 操作记录
} else {
baseMapper.insert(pre);
if (Common.isNotNull(pre.getExpectedCollectionTime())) {
// 事务提交后触发调度
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
LocalDateTime now = LocalDateTime.now();
if (pre.getExpectedCollectionTime().isEqual(now)) {
scheduleService.executeTask(pre.getId());
} else if (preVo.getExpectedCollectionTime().compareTo(LocalDateTimeUtils.convertLDTToDate(now)) > 0){
scheduleService.scheduleTask(pre);
}
}
});
}
}
}
}
return true;
}
@Override
public void saveInsurancePreInfo(String id, String status) {
if (Common.isNotNull(id) && Common.isNotNull(status)) {
TEmployeeInsurancePre preExit = baseMapper.selectById(id);
if (Common.isNotNull(preExit)) {
preExit.setProcessStatus(status);
baseMapper.updateById(preExit);
}
}
}
/** /**
* @Description: 获取前端客服的所有项目权限 * @Description: 获取前端客服的所有项目权限
...@@ -160,4 +333,59 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -160,4 +333,59 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
return false; return false;
} }
private InsuranceAutoParam convertAddParam(InsuranceAddParam addParam) {
InsuranceAutoParam autoParam = new InsuranceAutoParam();
// 复制InsuranceAddParam的字段
autoParam.setEmpName(addParam.getEmpName());
autoParam.setEmpIdcardNo(addParam.getEmpIdcardNo());
autoParam.setDeptNo(addParam.getDeptNo());
autoParam.setInsuranceCompanyName(addParam.getInsuranceCompanyName());
autoParam.setInsuranceTypeName(addParam.getInsuranceTypeName());
autoParam.setPolicyStart(LocalDateUtil.parseLocalDate(addParam.getPolicyStart()));
autoParam.setPolicyEnd(LocalDateUtil.parseLocalDate(addParam.getPolicyEnd()));
autoParam.setBuyStandard(addParam.getBuyStandard());
autoParam.setInsuranceProvinceName(addParam.getInsuranceProvinceName());
autoParam.setInsuranceCityName(addParam.getInsuranceCityName());
autoParam.setSettleMonth(addParam.getSettleMonth());
autoParam.setPost(addParam.getPost());
autoParam.setRemark(addParam.getRemark());
return autoParam;
}
private InsuranceAutoParam convertBatchParam(InsuranceBatchParam batchParam) {
InsuranceAutoParam autoParam = new InsuranceAutoParam();
// 复制InsuranceBatchParam的字段
autoParam.setEmpName(batchParam.getEmpName());
autoParam.setEmpIdcardNo(batchParam.getEmpIdcardNo());
autoParam.setDeptNo(batchParam.getDeptNo());
autoParam.setInsuranceCompanyName(batchParam.getInsuranceCompanyName());
autoParam.setInsuranceTypeName(batchParam.getInsuranceTypeName());
autoParam.setPolicyNo(batchParam.getPolicyNo());
autoParam.setBuyStandard(batchParam.getBuyStandard());
autoParam.setInsuranceProvinceName(batchParam.getInsuranceProvinceName());
autoParam.setInsuranceCityName(batchParam.getInsuranceCityName());
autoParam.setSettleMonth(batchParam.getSettleMonth());
autoParam.setPost(batchParam.getPost());
autoParam.setRemark(batchParam.getRemark());
return autoParam;
}
private InsuranceAutoParam convertReplaceParam(InsuranceReplaceParam replaceParam) {
InsuranceAutoParam autoParam = new InsuranceAutoParam();
// 复制InsuranceReplaceParam的字段
autoParam.setEmpName(replaceParam.getEmpName());
autoParam.setEmpIdcardNo(replaceParam.getEmpIdcardNo());
autoParam.setDeptNo(replaceParam.getDeptNo());
autoParam.setInsuranceCompanyName(replaceParam.getInsuranceCompanyName());
autoParam.setInsuranceTypeName(replaceParam.getInsuranceTypeName());
autoParam.setBuyStandard(replaceParam.getBuyStandard());
autoParam.setPolicyStart(LocalDateUtil.parseLocalDate(replaceParam.getPolicyStart()));
autoParam.setPolicyEnd(LocalDateUtil.parseLocalDate(replaceParam.getPolicyEnd()));
autoParam.setPost(replaceParam.getPost());
autoParam.setReplaceEmpName(replaceParam.getReplaceEmpName());
autoParam.setReplaceDeptNo(replaceParam.getReplaceDeptNo());
autoParam.setReplaceEmpIdcardNo(replaceParam.getReplaceEmpIdcardNo());
return autoParam;
}
} }
...@@ -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;
}
...@@ -16,10 +16,12 @@ import lombok.extern.slf4j.Slf4j; ...@@ -16,10 +16,12 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.security.core.parameters.P;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.security.SignatureException; import java.security.SignatureException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.TreeMap; import java.util.TreeMap;
...@@ -67,13 +69,15 @@ public class SocialFriendConfig { ...@@ -67,13 +69,15 @@ public class SocialFriendConfig {
private static final String VERSION = "version"; private static final String VERSION = "version";
/** /**
* @param : listVo 同一类(户、增减)的前100个
* @param : vo 第一个,存账密等信息
* @param : type 1社保增 2社保减 3医保增 4医保减 * @param : type 1社保增 2社保减 3医保增 4医保减
* @Description: 推送任务接口 * @Description: 推送任务接口
* @Author: hgw * @Author: hgw
* @Date: 2024-12-9 16:54:31 * @Date: 2024-12-9 16:54:31
* @return: java.lang.String * @return: java.lang.String
**/ **/
public String pushFriendByInfo(RestTemplate restTemplate, SociaFriendYgsAddVo vo, int type, String thisTime public String pushFriendByInfo(RestTemplate restTemplate, SociaFriendYgsAddVo vo, List<SociaFriendYgsAddVo> listVo, int type, String thisTime
, List<TSocialFriendBackLog> backLogList) { , List<TSocialFriendBackLog> backLogList) {
String addId = ""; String addId = "";
String appAddUrl = urlPre; String appAddUrl = urlPre;
...@@ -137,23 +141,44 @@ public class SocialFriendConfig { ...@@ -137,23 +141,44 @@ public class SocialFriendConfig {
} }
json.put("ywblzhlb", ywblzhlbArr); json.put("ywblzhlb", ywblzhlbArr);
// type 1社保增 2社保减 3医保增 4医保减 // type 1社保增 2社保减 3医保增 4医保减
setEmpInfo(json, vo, type); setEmpInfo(json, listVo, type, vo.getQyzgjbylbxcbdjb());
if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgjbylbxcbdjb());
json.put("qyzgshbxzyhmclb", qyzgshbxzyhmclbArr);
}
HttpEntity<String> formEntity = new HttpEntity<>(json.toString(), headers); HttpEntity<String> formEntity = new HttpEntity<>(json.toString(), headers);
// 推的json // 推的json
TSocialFriendBackLog backLog = new TSocialFriendBackLog(); TSocialFriendBackLog backLogPush = new TSocialFriendBackLog();
backLog.setSocialId(vo.getSocialId()); backLogPush.setSocialId(vo.getSocialId());
backLog.setType(5); backLogPush.setType(5);
backLog.setLogInfo(json.toString()); backLogPush.setLogInfo(json.toString());
backLog.setCreateTime(LocalDateTime.now()); backLogPush.setCreateTime(LocalDateTime.now());
backLogList.add(backLog); backLogList.add(backLogPush);
String dataResultList = restTemplate.postForObject(appAddUrl, formEntity, String.class); String dataResultList = restTemplate.postForObject(appAddUrl, formEntity, String.class);
// {"head":{"code":"00000000","description":"成功","msg":"成功","time":"2024-12-06 17:10:26","status":"Y" // {"head":{"code":"00000000","description":"成功","msg":"成功","time":"2024-12-06 17:10:26","status":"Y"
// ,"body":{"requestId":"85440b327d71466abcd9c5c81d5bb172" // ,"body":{"requestId":"85440b327d71466abcd9c5c81d5bb172"
if (Common.isNotNull(dataResultList)) { if (Common.isNotNull(dataResultList)) {
// 拉取的数据日志 // 拉取的数据日志
backLog = new TSocialFriendBackLog(); TSocialFriendBackLog backLog = new TSocialFriendBackLog();
backLog.setSocialId(vo.getSocialId()); StringBuilder ids = new StringBuilder();
String idTemp;
for (SociaFriendYgsAddVo tempVo : listVo) {
if (Common.isNotNull(tempVo.getEmpIdcard())) {
idTemp = tempVo.getEmpIdcard();
} else if (Common.isNotNull(tempVo.getSocialId())) {
idTemp = tempVo.getSocialId();
} else {
idTemp = vo.getSocialId();
}
ids.append(idTemp).append(",");
}
backLogPush.setSocialId(ids.toString());
backLog.setSocialId(ids.toString());
backLog.setType(type); backLog.setType(type);
backLog.setLogInfo(dataResultList); backLog.setLogInfo(dataResultList);
backLog.setCreateTime(LocalDateTime.now()); backLog.setCreateTime(LocalDateTime.now());
...@@ -242,11 +267,11 @@ public class SocialFriendConfig { ...@@ -242,11 +267,11 @@ public class SocialFriendConfig {
* @Date: 2024/12/11 10:24 * @Date: 2024/12/11 10:24
* @return: void * @return: void
**/ **/
private void setEmpInfo(JSONObject json, SociaFriendYgsAddVo vo, int type) { private void setEmpInfo(JSONObject json, List<SociaFriendYgsAddVo> listVo, int type, String qyzgjbylbxcbdjb) {
if (type == 1 || type == 3) { if (type == 1 || type == 3) {
setEmpInfoAdd(json, vo, type); setEmpInfoAdd(json, listVo, type, qyzgjbylbxcbdjb);
} else { } else {
setEmpInfoReduce(json, vo, type); setEmpInfoReduce(json, listVo, type, qyzgjbylbxcbdjb);
} }
} }
...@@ -257,10 +282,29 @@ public class SocialFriendConfig { ...@@ -257,10 +282,29 @@ public class SocialFriendConfig {
* @Date: 2024/12/10 18:05 * @Date: 2024/12/10 18:05
* @return: void * @return: void
**/ **/
private void setEmpInfoAdd(JSONObject json, SociaFriendYgsAddVo vo, int type) { private void setEmpInfoAdd(JSONObject json, List<SociaFriendYgsAddVo> listVo, int type, String qyzgjbylbxcbdjb) {
// 参保人员名单 数组 // 参保人员名单 数组
JSONArray cbrymdArr = new JSONArray(); JSONArray cbrymdArr = new JSONArray();
JSONObject cbrymdOne = new JSONObject(); JSONObject cbrymdOne;
String areaName = "安徽省";
String gj = "中国";
String hkxz = "本地居民户口";
JSONObject jyxx;
String startDate;
JSONArray blxmlbArr;
JSONObject blxmlbOne;
String blxm = "社保";
// 险种类型 例如养老、工伤、医疗等
String xzlb;
if (type > 2) {
blxm = "医保";
}
JSONObject tszdxx;
// 企业职工基本医疗保险参保登记表 安徽非必填! 数组
String[] arr = {qyzgjbylbxcbdjb};
// 2025-3-14 15:44:32 单个改造为批量
for (SociaFriendYgsAddVo vo : listVo) {
cbrymdOne = new JSONObject();
// 姓名 // 姓名
cbrymdOne.put("xm", vo.getEmpName()); cbrymdOne.put("xm", vo.getEmpName());
// 证件类型 // 证件类型
...@@ -269,9 +313,8 @@ public class SocialFriendConfig { ...@@ -269,9 +313,8 @@ public class SocialFriendConfig {
cbrymdOne.put("zzhm", vo.getEmpIdcard()); cbrymdOne.put("zzhm", vo.getEmpIdcard());
// 国籍(地区) "中国" // 国籍(地区) "中国"
cbrymdOne.put("gj", "中国"); cbrymdOne.put("gj", gj);
// 性别 // 性别
//cbrymdOne.put("xb", "男")
cbrymdOne.put("xb", getSexName(vo.getEmpIdcard())); cbrymdOne.put("xb", getSexName(vo.getEmpIdcard()));
// 出生日期 // 出生日期
cbrymdOne.put("csrq", getBirthStr(vo.getEmpIdcard())); cbrymdOne.put("csrq", getBirthStr(vo.getEmpIdcard()));
...@@ -279,20 +322,19 @@ public class SocialFriendConfig { ...@@ -279,20 +322,19 @@ public class SocialFriendConfig {
cbrymdOne.put("mz", vo.getEmpNational()); cbrymdOne.put("mz", vo.getEmpNational());
// 手机号码 // 手机号码
cbrymdOne.put("sjhm", vo.getEmpMobile()); cbrymdOne.put("sjhm", vo.getEmpMobile());
String areaName = "安徽省";
// 户口地所在行政区 // 户口地所在行政区
cbrymdOne.put("hkszdxzq", areaName); cbrymdOne.put("hkszdxzq", areaName);
// 户口所在地地址 // 户口所在地地址
cbrymdOne.put("hkszddz", areaName); cbrymdOne.put("hkszddz", areaName);
// 户口性质 // 户口性质
//cbrymdOne.put("hkxz", "居民户口(含农业户口、非农业户口)") //cbrymdOne.put("hkxz", "居民户口(含农业户口、非农业户口)")
cbrymdOne.put("hkxz", "本地居民户口"); cbrymdOne.put("hkxz", hkxz);
// 居住地址 // 居住地址
cbrymdOne.put("jzdz", areaName); cbrymdOne.put("jzdz", areaName);
// 居住地行政区 // 居住地行政区
cbrymdOne.put("jzdzxzq", areaName); cbrymdOne.put("jzdzxzq", areaName);
// 社保起缴日期(养老起缴)yyyy-MM-dd // 社保起缴日期(养老起缴)yyyy-MM-dd
String startDate = vo.getSocialStartDate(); startDate = vo.getSocialStartDate();
// 参加工作日期 // 参加工作日期
cbrymdOne.put("cjgzrq", startDate); cbrymdOne.put("cjgzrq", startDate);
// 文化程度 见字典“受教育程度” 空的默认“大学专科” // 文化程度 见字典“受教育程度” 空的默认“大学专科”
...@@ -300,13 +342,11 @@ public class SocialFriendConfig { ...@@ -300,13 +342,11 @@ public class SocialFriendConfig {
cbrymdOne.put("whcd", vo.getEducationName()); cbrymdOne.put("whcd", vo.getEducationName());
// 办理项目列表 // 办理项目列表
JSONArray blxmlbArr = new JSONArray(); blxmlbArr = new JSONArray();
JSONObject blxmlbOne = new JSONObject(); blxmlbOne = new JSONObject();
String blxm = "社保";
// 险种类型 例如养老、工伤、医疗等 // 险种类型 例如养老、工伤、医疗等
String xzlb = "企业职工养老,工伤保险,失业保险"; xzlb = "企业职工养老,工伤保险,失业保险";
if (type > 2) { if (type > 2) {
blxm = "医保";
xzlb = null; xzlb = null;
if (Common.isNotNull(vo.getUnitMedicalMoney()) && CommonConstants.ONE_INTEGER.equals(vo.getUnitMedicalMoney())) { if (Common.isNotNull(vo.getUnitMedicalMoney()) && CommonConstants.ONE_INTEGER.equals(vo.getUnitMedicalMoney())) {
xzlb = "职工基本医疗保险"; xzlb = "职工基本医疗保险";
...@@ -326,7 +366,6 @@ public class SocialFriendConfig { ...@@ -326,7 +366,6 @@ public class SocialFriendConfig {
} }
} }
} }
String[] strArr = xzlb.split(",");
// 办理项目 // 办理项目
blxmlbOne.put("blxm", blxm); blxmlbOne.put("blxm", blxm);
// 本次参保日期 格式:yyyy-MM-dd // 本次参保日期 格式:yyyy-MM-dd
...@@ -335,12 +374,14 @@ public class SocialFriendConfig { ...@@ -335,12 +374,14 @@ public class SocialFriendConfig {
blxmlbOne.put("sbgz", vo.getRecordBase()); blxmlbOne.put("sbgz", vo.getRecordBase());
// 险种类型 例如养老、工伤、医疗等 // 险种类型 例如养老、工伤、医疗等
blxmlbOne.put("xzlb", strArr); if (Common.isNotNull(xzlb)) {
blxmlbOne.put("xzlb", xzlb.split(","));
}
blxmlbArr.add(blxmlbOne); blxmlbArr.add(blxmlbOne);
cbrymdOne.put("blxmlb", blxmlbArr); cbrymdOne.put("blxmlb", blxmlbArr);
// 特色字段信息 // 特色字段信息
JSONObject tszdxx = new JSONObject(); tszdxx = new JSONObject();
// 增员年月 社保必填;yyyyMM 社保起缴日期(养老起缴)到月 // 增员年月 社保必填;yyyyMM 社保起缴日期(养老起缴)到月
tszdxx.put("zyny", vo.getSocialStartMonth()); tszdxx.put("zyny", vo.getSocialStartMonth());
// 同步办理用工劳动备案 社保必填;是 // 同步办理用工劳动备案 社保必填;是
...@@ -377,15 +418,13 @@ public class SocialFriendConfig { ...@@ -377,15 +418,13 @@ public class SocialFriendConfig {
// 社保增员必填 // 社保增员必填
tszdxx.put("qyzgshbxzyhmc", vo.getQyzgshbxzyhmc()); tszdxx.put("qyzgshbxzyhmc", vo.getQyzgshbxzyhmc());
} else { } else {
// 企业职工基本医疗保险参保登记表 安徽非必填! 数组
String[] arr = {vo.getQyzgjbylbxcbdjb()};
// 增员、减员必填 // 增员、减员必填
tszdxx.put("qyzgjbylbxcbdjb", arr); tszdxx.put("qyzgjbylbxcbdjb", arr);
} }
cbrymdOne.put("tszdxx", tszdxx); cbrymdOne.put("tszdxx", tszdxx);
// 就业信息 社保必填; // 就业信息 社保必填;
JSONObject jyxx = new JSONObject(); jyxx = new JSONObject();
// 劳动合同类型 // 劳动合同类型
jyxx.put("ldhtlx", vo.getContractTypeTwo()); jyxx.put("ldhtlx", vo.getContractTypeTwo());
// 劳动合同起始日期 // 劳动合同起始日期
...@@ -394,6 +433,7 @@ public class SocialFriendConfig { ...@@ -394,6 +433,7 @@ public class SocialFriendConfig {
jyxx.put("ldhtjzrq", vo.getContractEnd()); jyxx.put("ldhtjzrq", vo.getContractEnd());
cbrymdOne.put("jyxx", jyxx); cbrymdOne.put("jyxx", jyxx);
cbrymdArr.add(cbrymdOne); cbrymdArr.add(cbrymdOne);
}
// 人员名单 // 人员名单
String buyType = "cbrymd"; String buyType = "cbrymd";
json.put(buyType, cbrymdArr); json.put(buyType, cbrymdArr);
...@@ -406,11 +446,22 @@ public class SocialFriendConfig { ...@@ -406,11 +446,22 @@ public class SocialFriendConfig {
* @Date: 2024/12/10 18:05 * @Date: 2024/12/10 18:05
* @return: void * @return: void
**/ **/
private void setEmpInfoReduce(JSONObject json, SociaFriendYgsAddVo vo, int type) { private void setEmpInfoReduce(JSONObject json, List<SociaFriendYgsAddVo> listVo, int type, String qyzgjbylbxcbdjb) {
// 参保人员名单 数组 // 参保人员名单 数组
// 参保人员名单 数组 // 参保人员名单 数组
JSONArray cbrymdArr = new JSONArray(); JSONArray cbrymdArr = new JSONArray();
JSONObject cbrymdOne = new JSONObject(); JSONObject cbrymdOne;
JSONArray blxmlbArr;
JSONObject blxmlbOne;
JSONObject tszdxx;
String blxm = "社保";
String[] arr = {qyzgjbylbxcbdjb};
if (type > 2) {
blxm = "医保";
}
// 2025-3-14 15:44:32 单个改造为批量
for (SociaFriendYgsAddVo vo : listVo) {
cbrymdOne = new JSONObject();
// 姓名 // 姓名
cbrymdOne.put("xm", vo.getEmpName()); cbrymdOne.put("xm", vo.getEmpName());
// 证件类型 // 证件类型
...@@ -418,12 +469,8 @@ public class SocialFriendConfig { ...@@ -418,12 +469,8 @@ public class SocialFriendConfig {
// 证件号码"828888200908213819" // 证件号码"828888200908213819"
cbrymdOne.put("zzhm", vo.getEmpIdcard()); cbrymdOne.put("zzhm", vo.getEmpIdcard());
// 办理项目列表 // 办理项目列表
JSONArray blxmlbArr = new JSONArray(); blxmlbArr = new JSONArray();
JSONObject blxmlbOne = new JSONObject(); blxmlbOne = new JSONObject();
String blxm = "社保";
if (type > 2) {
blxm = "医保";
}
// 办理项目 // 办理项目
blxmlbOne.put("blxm", blxm); blxmlbOne.put("blxm", blxm);
// 中断原因 除死亡以外,其他停保原因默认:“在职人员解除/终止劳动合同” 死亡对应“死亡或失踪” // 中断原因 除死亡以外,其他停保原因默认:“在职人员解除/终止劳动合同” 死亡对应“死亡或失踪”
...@@ -434,7 +481,7 @@ public class SocialFriendConfig { ...@@ -434,7 +481,7 @@ public class SocialFriendConfig {
cbrymdOne.put("blxmlb", blxmlbArr); cbrymdOne.put("blxmlb", blxmlbArr);
// 特色字段信息 // 特色字段信息
JSONObject tszdxx = new JSONObject(); tszdxx = new JSONObject();
// 劳动用工备案解除/终止原因 数据字典文档 法律依据 [社保]必填; // 劳动用工备案解除/终止原因 数据字典文档 法律依据 [社保]必填;
tszdxx.put("zzyy", vo.getZzyy()); tszdxx.put("zzyy", vo.getZzyy());
// 社保个人身份材料 无 // 社保个人身份材料 无
...@@ -445,11 +492,11 @@ public class SocialFriendConfig { ...@@ -445,11 +492,11 @@ public class SocialFriendConfig {
// tszdxx.put("zgshbxjshmc", ) // tszdxx.put("zgshbxjshmc", )
if (type > 2) { if (type > 2) {
// 职工基本医疗保险参保登记表 // 职工基本医疗保险参保登记表
String[] arr = {vo.getQyzgjbylbxcbdjb()};
tszdxx.put("zgjbylbxcbdjb", arr); tszdxx.put("zgjbylbxcbdjb", arr);
} }
cbrymdOne.put("tszdxx", tszdxx); cbrymdOne.put("tszdxx", tszdxx);
cbrymdArr.add(cbrymdOne); cbrymdArr.add(cbrymdOne);
}
// 人员名单 // 人员名单
String buyType = "tbrymd"; String buyType = "tbrymd";
json.put(buyType, cbrymdArr); json.put(buyType, cbrymdArr);
...@@ -463,9 +510,10 @@ public class SocialFriendConfig { ...@@ -463,9 +510,10 @@ public class SocialFriendConfig {
* @Date: 2024-12-9 16:54:22 * @Date: 2024-12-9 16:54:22
* @return: java.lang.String * @return: java.lang.String
**/ **/
public FriendResult getFriendByRequestId(RestTemplate restTemplate, String requestId, TSocialFriendBackLog backLog, String type) { public List<FriendResult> getFriendByRequestId(RestTemplate restTemplate, String requestId, TSocialFriendBackLog backLog, String type) {
List<FriendResult> resultList = new ArrayList<>();
if (Common.isEmpty(requestId)) { if (Common.isEmpty(requestId)) {
return null; return resultList;
} }
String appAddUrl = urlPre; String appAddUrl = urlPre;
if (CommonConstants.ZERO_STRING.equals(type)) { if (CommonConstants.ZERO_STRING.equals(type)) {
...@@ -486,7 +534,7 @@ public class SocialFriendConfig { ...@@ -486,7 +534,7 @@ public class SocialFriendConfig {
headers.add("signature", signature); headers.add("signature", signature);
} catch (SignatureException e) { } catch (SignatureException e) {
log.error("税友签名失败", e); log.error("税友签名失败", e);
return null; return resultList;
} }
headers.add(X_REQ_NONCE, xReqNonce); headers.add(X_REQ_NONCE, xReqNonce);
headers.add(VERSION, version); headers.add(VERSION, version);
...@@ -499,19 +547,18 @@ public class SocialFriendConfig { ...@@ -499,19 +547,18 @@ public class SocialFriendConfig {
if (statusCode != 200) { if (statusCode != 200) {
throw new CheckedException("获取税友结果失败,statusCode=" + statusCode); throw new CheckedException("获取税友结果失败,statusCode=" + statusCode);
} }
FriendResult result = new FriendResult();
String dataResultList = response.getBody(); String dataResultList = response.getBody();
backLog.setCreateTime(LocalDateTime.now()); backLog.setCreateTime(LocalDateTime.now());
backLog.setLogInfo(dataResultList); backLog.setLogInfo(dataResultList);
// 组装返回结果 // 组装返回结果
getResultToVo(dataResultList, result); getResultToVo(dataResultList, resultList);
return result; return resultList;
} }
// 组装返回结果 // 组装返回结果
private void getResultToVo(String dataResultList, FriendResult result) { private void getResultToVo(String dataResultList, List<FriendResult> resultList) {
if (Common.isNotNull(dataResultList)) { if (Common.isNotNull(dataResultList)) {
JSONObject dataObject = JSON.parseObject(dataResultList); JSONObject dataObject = JSON.parseObject(dataResultList);
String head = dataObject.getString("head"); String head = dataObject.getString("head");
...@@ -522,40 +569,51 @@ public class SocialFriendConfig { ...@@ -522,40 +569,51 @@ public class SocialFriendConfig {
String body = dataObject.getString("body"); String body = dataObject.getString("body");
JSONObject bodyObject = JSON.parseObject(body); JSONObject bodyObject = JSON.parseObject(body);
// 获取核心结果 // 获取核心结果
getResultToVoCore(result, bodyObject); getResultToVoCore(resultList, bodyObject);
} }
} }
} }
} }
// 提取方法,组装核心结果 // 提取方法,组装核心结果
private void getResultToVoCore(FriendResult result, JSONObject bodyObject) { private void getResultToVoCore(List<FriendResult> resultList, JSONObject bodyObject) {
if (Common.isNotNull(bodyObject)) { if (Common.isNotNull(bodyObject)) {
// 人员办理项目结果 // 人员办理项目结果
JSONArray ryywbljglbArr = (JSONArray) bodyObject.get("ryywbljglb"); JSONArray ryywbljglbArr = (JSONArray) bodyObject.get("ryywbljglb");
if (Common.isNotNull(ryywbljglbArr)) { if (Common.isNotNull(ryywbljglbArr)) {
// 注意:此处可以返回多条身份证,但是我们单条提交 // 注意:此处可以返回多条身份证,但是我们单条提交
JSONObject ryywbljglb = (JSONObject) ryywbljglbArr.get(0); JSONObject ryywbljglb;
FriendResult result;
String idCard;
JSONArray blxmjglbArr;
JSONObject blxmjglb;
String zt;
String cwxx;
for (int i=0; i<ryywbljglbArr.size(); i++) {
ryywbljglb = (JSONObject) ryywbljglbArr.get(i);
result = new FriendResult();
// 身份证 // 身份证
String idCard = ryywbljglb.getString("zzhm"); idCard = ryywbljglb.getString("zzhm");
result.setIdCard(idCard); result.setIdCard(idCard);
// 办理项目列表 // 办理项目列表
JSONArray blxmjglbArr = (JSONArray) ryywbljglb.get("blxmjglb"); blxmjglbArr = (JSONArray) ryywbljglb.get("blxmjglb");
if (Common.isNotNull(blxmjglbArr)) { if (Common.isNotNull(blxmjglbArr)) {
// 注意:此处可以返回多条办理,但是我们社保与医保分开提交 // 注意:此处可以返回多条办理,但是我们社保与医保分开提交
JSONObject blxmjglb = (JSONObject) blxmjglbArr.get(0); blxmjglb = (JSONObject) blxmjglbArr.get(0);
// 状态1-处理中,2-处理成功,3-处理失败,4-待办(提交成功,待网厅状态流转,上海特有) // 状态1-处理中,2-处理成功,3-处理失败,4-待办(提交成功,待网厅状态流转,上海特有)
String zt = blxmjglb.getString("zt"); zt = blxmjglb.getString("zt");
result.setZt(zt); result.setZt(zt);
// 明细状态:提交失败、审核失败、审核成功、待确认 // 明细状态:提交失败、审核失败、审核成功、待确认
//String mxzt = blxmjglb.getString("mxzt") //String mxzt = blxmjglb.getString("mxzt")
// 提示或者错误信息 SUCCESS // 提示或者错误信息 SUCCESS
String cwxx = blxmjglb.getString("cwxx"); cwxx = blxmjglb.getString("cwxx");
if (Common.isNotNull(cwxx) && cwxx.length()>100 ) { if (Common.isNotNull(cwxx) && cwxx.length() > 100) {
cwxx = cwxx.substring(0, 100); cwxx = cwxx.substring(0, 100);
} }
result.setCwxx(cwxx); result.setCwxx(cwxx);
} }
resultList.add(result);
}
} }
} }
} }
......
...@@ -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);
}
}
...@@ -46,6 +46,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -46,6 +46,7 @@ import org.springframework.web.client.RestTemplate;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* 税友-推送 * 税友-推送
...@@ -66,6 +67,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -66,6 +67,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
private final TSocialFriendBackLogService tSocialFriendBackLogService; private final TSocialFriendBackLogService tSocialFriendBackLogService;
private final TSocialFreindSetService tSocialFreindSetService; private final TSocialFreindSetService tSocialFreindSetService;
private final TSocialInfoMapper socialMapper; private final TSocialInfoMapper socialMapper;
private final AtomicInteger atomicPushFriend = new AtomicInteger(0);
@Autowired @Autowired
private ExcelMergeImage excelMergeImage; private ExcelMergeImage excelMergeImage;
@Autowired @Autowired
...@@ -90,6 +93,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -90,6 +93,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
**/ **/
@Override @Override
public R<String> pushFriend(List<String> dispatchIdList) { public R<String> pushFriend(List<String> dispatchIdList) {
if (atomicPushFriend.incrementAndGet() <= 1) {
try {
TSocialFreindSet set = tSocialFreindSetService.getById("1"); TSocialFreindSet set = tSocialFreindSetService.getById("1");
if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) { if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) {
...@@ -126,7 +131,14 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -126,7 +131,14 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
return R.failed("无数据,推送结束!"); return R.failed("无数据,推送结束!");
} }
} }
return R.ok("推送成功!!"); } finally {
atomicPushFriend.decrementAndGet();
}
return R.ok();
} else {
atomicPushFriend.decrementAndGet();
return R.failed("距离上一次推送任务时间间隔太短,请10分钟后再试!!!");
}
} }
/** /**
...@@ -142,35 +154,73 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -142,35 +154,73 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
String typeStr = "提交"; String typeStr = "提交";
List<TSocialSoldierLog> logList = new ArrayList<>(); List<TSocialSoldierLog> logList = new ArrayList<>();
TSocialSoldierLog socialLog; TSocialSoldierLog socialLog;
String remark; String remark = null;
List<TSocialInfo> renGongList = new ArrayList<>(); List<TSocialInfo> renGongList = new ArrayList<>();
String requestId; String requestId;
String thisTime = DateUtil.getThisTime(); String thisTime = DateUtil.getThisTime();
List<TSocialFriendBackLog> backLogList = new ArrayList<>(); List<TSocialFriendBackLog> backLogList = new ArrayList<>();
R<String> urlR; R<String> urlR;
for (SociaFriendYgsAddVo vo : ygsAddlist) { List<SociaFriendYgsAddVo> listVo = new ArrayList<>();
List<TSocialSoldierLog> logTemp = new ArrayList<>();
List<TSocialInfo> socialInfoTemp = new ArrayList<>();
List<TSocialInfo> socialInfoUpdate = new ArrayList<>();
String ygsHandleStatus;
String dispatchItem = "社保";
// 同一个户才一批次推送,因为账号密码不一样 ,不同户,则先推送一批
boolean nextFlag = false;
SociaFriendYgsAddVo vo;
int i=1;
for (int index = 0 ; index < ygsAddlist.size(); index++) {
vo = ygsAddlist.get(index);
// 0:未到时间不动; 1:推送; 2:转人工 // 0:未到时间不动; 1:推送; 2:转人工
canPushType = this.getCanPushType(socialSetMap, vo); canPushType = this.getCanPushType(socialSetMap, vo);
if (1 == canPushType) { if (1 == canPushType) {
try { try {
socialInfo = new TSocialInfo(); socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId()); socialInfo.setId(vo.getSocialId());
listVo.add(vo);
socialInfoTemp.add(socialInfo);
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
if (socialLog != null) {
logTemp.add(socialLog);
}
if (Common.isNotNull(vo.getSocialHouseholdName())
&& index+1 < ygsAddlist.size()
&& !vo.getSocialHouseholdName().equals(ygsAddlist.get(index+1).getSocialHouseholdName())) {
nextFlag = true;
}
if (nextFlag || i % 10 == 0 || index >= ygsAddlist.size()-1) {
// 房工接口,获取 企业职工社会保险增员花名册 url // 房工接口,获取 企业职工社会保险增员花名册 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode()); urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo);
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) { if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgshbxzyhmc(urlR.getData()); vo.setQyzgshbxzyhmc(urlR.getData());
} }
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, type, thisTime, backLogList); i=0;
nextFlag = false;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, thisTime, backLogList);
ygsHandleStatus = CommonConstants.TWO_STRING;
remark = "已推送提交任务!";
if (Common.isEmpty(requestId)) { if (Common.isEmpty(requestId)) {
socialInfo.setYgsRequestId("推送税友失败"); requestId = "推送税友失败";
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING); ygsHandleStatus = CommonConstants.FIVE_STRING;
remark = "推送税友失败,转人工处理!"; remark = "推送税友失败,转人工处理!";
} else {
socialInfo.setYgsRequestId(requestId);
socialInfo.setYgsHandleStatus(CommonConstants.TWO_STRING);
remark = "已推送提交任务!";
} }
tSocialInfoService.updateById(socialInfo); for (TSocialInfo s : socialInfoTemp) {
s.setYgsRequestId(requestId);
s.setYgsHandleStatus(ygsHandleStatus);
socialInfoUpdate.add(s);
}
for (TSocialSoldierLog sLog : logTemp) {
sLog.setRemark("【税友】" + remark);
logList.add(sLog);
}
// 重置
listVo = new ArrayList<>();
socialInfoTemp = new ArrayList<>();
logTemp = new ArrayList<>();
}
i++;
} catch (Exception e) { } catch (Exception e) {
remark = "提交社保士兵异常!"; remark = "提交社保士兵异常!";
} }
...@@ -184,13 +234,15 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -184,13 +234,15 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING); socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING);
renGongList.add(socialInfo); renGongList.add(socialInfo);
} }
} socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, "社保", remark);
if (socialLog != null) { if (socialLog != null) {
logList.add(socialLog); logList.add(socialLog);
} }
} }
}
if (!socialInfoUpdate.isEmpty()) {
tSocialInfoService.updateBatchById(socialInfoUpdate);
}
if (!backLogList.isEmpty()) { if (!backLogList.isEmpty()) {
tSocialFriendBackLogService.saveBatch(backLogList); tSocialFriendBackLogService.saveBatch(backLogList);
} }
...@@ -216,13 +268,24 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -216,13 +268,24 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
List<TSocialSoldierLog> logList = new ArrayList<>(); List<TSocialSoldierLog> logList = new ArrayList<>();
TSocialSoldierLog socialLog; TSocialSoldierLog socialLog;
List<TSocialInfo> renGongList = new ArrayList<>(); List<TSocialInfo> renGongList = new ArrayList<>();
String remark; String remark = null;
String requestId; String requestId;
String thisTime = DateUtil.getThisTime(); String thisTime = DateUtil.getThisTime();
List<TSocialFriendBackLog> backLogList = new ArrayList<>(); List<TSocialFriendBackLog> backLogList = new ArrayList<>();
R<String> urlR; R<String> urlR;
for (SociaFriendYgsAddVo vo : ysdAddlist) {
// List<SociaFriendYgsAddVo> listVo = new ArrayList<>();
List<TSocialSoldierLog> logTemp = new ArrayList<>();
List<TSocialInfo> socialInfoTemp = new ArrayList<>();
List<TSocialInfo> socialInfoUpdate = new ArrayList<>();
String ysdHandleStatus;
String dispatchItem = "医保";
// 同一个户才一批次推送,因为账号密码不一样 ,不同户,则先推送一批
boolean nextFlag = false;
SociaFriendYgsAddVo vo;
int i=1;
for (int index = 0 ; index < ysdAddlist.size(); index++) {
vo = ysdAddlist.get(index);
// 0:未到时间不动; 1:推送; 2:转人工 // 0:未到时间不动; 1:推送; 2:转人工
if ("劳动者死亡".equals(vo.getTbyy())) { if ("劳动者死亡".equals(vo.getTbyy())) {
remark = "劳动者死亡,转人工!"; remark = "劳动者死亡,转人工!";
...@@ -230,28 +293,59 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -230,28 +293,59 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
socialInfo.setId(vo.getSocialId()); socialInfo.setId(vo.getSocialId());
socialInfo.setYsdHandleStatus(CommonConstants.FIVE_STRING); socialInfo.setYsdHandleStatus(CommonConstants.FIVE_STRING);
renGongList.add(socialInfo); renGongList.add(socialInfo);
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
if (socialLog != null) {
logList.add(socialLog);
}
} else { } else {
canPushType = this.getCanPushTypeYsd(socialSetMap, vo); canPushType = this.getCanPushTypeYsd(socialSetMap, vo);
if (1 == canPushType) { if (1 == canPushType) {
try { try {
socialInfo = new TSocialInfo(); socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId()); socialInfo.setId(vo.getSocialId());
listVo.add(vo);
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialInfoTemp.add(socialInfo);
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
if (socialLog != null) {
logTemp.add(socialLog);
}
if (Common.isNotNull(vo.getSocialHouseholdName())
&& index+1 < ysdAddlist.size()
&& !vo.getSocialHouseholdName().equals(ysdAddlist.get(index+1).getSocialHouseholdName())) {
nextFlag = true;
}
if (nextFlag || i % 10 == 0 || index >= ysdAddlist.size()-1) {
// 房工接口,获取 企业职工基本医疗保险参保登记表 url // 房工接口,获取 企业职工基本医疗保险参保登记表 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode()); urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo);
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) { if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgjbylbxcbdjb(urlR.getData()); vo.setQyzgjbylbxcbdjb(urlR.getData());
} }
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, type, thisTime, backLogList); i=0;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, thisTime, backLogList);
ysdHandleStatus = CommonConstants.TWO_STRING;
remark = "已推送提交任务!";
if (Common.isEmpty(requestId)) { if (Common.isEmpty(requestId)) {
socialInfo.setYsdRequestId("推送税友失败"); requestId = "推送税友失败";
socialInfo.setYsdHandleStatus(CommonConstants.FIVE_STRING); ysdHandleStatus = CommonConstants.FIVE_STRING;
remark = "推送税友失败,转人工处理!"; remark = "推送税友失败,转人工处理!";
} else {
socialInfo.setYsdRequestId(requestId);
socialInfo.setYsdHandleStatus(CommonConstants.TWO_STRING);
remark = "已推送提交任务!";
} }
tSocialInfoService.updateById(socialInfo); for (TSocialInfo s : socialInfoTemp) {
s.setYsdRequestId(requestId);
s.setYsdHandleStatus(ysdHandleStatus);
socialInfoUpdate.add(s);
}
for (TSocialSoldierLog sLog : logTemp) {
sLog.setRemark("【税友】" + remark);
logList.add(sLog);
}
// 重置
listVo = new ArrayList<>();
socialInfoTemp = new ArrayList<>();
logTemp = new ArrayList<>();
}
i++;
} catch (Exception e) { } catch (Exception e) {
remark = "提交社保士兵异常!"; remark = "提交社保士兵异常!";
} }
...@@ -265,16 +359,19 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -265,16 +359,19 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
socialInfo.setYsdHandleStatus(CommonConstants.FIVE_STRING); socialInfo.setYsdHandleStatus(CommonConstants.FIVE_STRING);
renGongList.add(socialInfo); renGongList.add(socialInfo);
} }
} socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, dispatchItem, remark);
}
socialLog = tSocialSoldierLogService.getFriendLog(vo, typeStr, "医保", remark);
if (socialLog != null) { if (socialLog != null) {
logList.add(socialLog); logList.add(socialLog);
} }
} }
}
}
if (!backLogList.isEmpty()) { if (!backLogList.isEmpty()) {
tSocialFriendBackLogService.saveBatch(backLogList); tSocialFriendBackLogService.saveBatch(backLogList);
} }
if (!socialInfoUpdate.isEmpty()) {
tSocialInfoService.updateBatchById(socialInfoUpdate);
}
if (!renGongList.isEmpty()) { if (!renGongList.isEmpty()) {
tSocialInfoService.updateBatchById(renGongList); tSocialInfoService.updateBatchById(renGongList);
} }
...@@ -405,7 +502,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -405,7 +502,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
* @Param socialId:社保明细ID type: 1 社保增 2社保减 3 医保增 4 医保减 unitCreditCode:单位统一信用代码 * @Param socialId:社保明细ID type: 1 社保增 2社保减 3 医保增 4 医保减 unitCreditCode:单位统一信用代码
**/ **/
@Override @Override
public R<String> doExportRoster(String socialId, String type, String unitCreditCode) { public R<String> doExportRoster(String socialId, String type, String unitCreditCode, List<SociaFriendYgsAddVo> listVo) {
SocialHandleSearchVo searchVo = new SocialHandleSearchVo(); SocialHandleSearchVo searchVo = new SocialHandleSearchVo();
if (Common.isEmpty(socialId) || Common.isEmpty(type) || Common.isEmpty(unitCreditCode)) { if (Common.isEmpty(socialId) || Common.isEmpty(type) || Common.isEmpty(unitCreditCode)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR); return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
...@@ -433,7 +530,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -433,7 +530,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
searchVo.setSyFlag(CommonConstants.ONE_STRING); searchVo.setSyFlag(CommonConstants.ONE_STRING);
//税友特殊处理标识 //税友特殊处理标识
searchVo.setSocialId(socialId); List<String> socialIdList = new ArrayList<>();
for (SociaFriendYgsAddVo vo : listVo) {
socialIdList.add(vo.getSocialId());
}
searchVo.setSocialIdList(socialIdList);
String fileName = DispatchConstants.SOCIAL_MEDICAL_EXPORT + searchVo.getSocialHouseholdName() + "_" + socialId + CommonConstants.XLS; String fileName = DispatchConstants.SOCIAL_MEDICAL_EXPORT + searchVo.getSocialHouseholdName() + "_" + socialId + CommonConstants.XLS;
String projectRoot = System.getProperty(CommonConstants.USER_DIR); String projectRoot = System.getProperty(CommonConstants.USER_DIR);
String filePath = projectRoot + CommonConstants.DOUBLE_LINE + fileName; String filePath = projectRoot + CommonConstants.DOUBLE_LINE + fileName;
...@@ -630,7 +731,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -630,7 +731,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
inputStreamOut = new FileInputStream(outFile); inputStreamOut = new FileInputStream(outFile);
// 转换成图片 完成后清理流 // 转换成图片 完成后清理流
TSocialFriendBackLog backLog = new TSocialFriendBackLog(); TSocialFriendBackLog backLog = new TSocialFriendBackLog();
backLog.setType(Integer.parseInt(type)); backLog.setType(CommonConstants.SEVEN_INT);
backLog.setSocialId(searchVo.getSocialId());
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog); R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog); tSocialFriendBackLogService.save(backLog);
return ulrR; return ulrR;
...@@ -894,7 +996,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -894,7 +996,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
inputStreamOut = new FileInputStream(outFile); inputStreamOut = new FileInputStream(outFile);
// 转换成图片 完成后清理流 // 转换成图片 完成后清理流
TSocialFriendBackLog backLog = new TSocialFriendBackLog(); TSocialFriendBackLog backLog = new TSocialFriendBackLog();
backLog.setType(Integer.parseInt(type)); backLog.setSocialId(searchVo.getSocialId());
backLog.setType(CommonConstants.SIX_INT);
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog); R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog); tSocialFriendBackLogService.save(backLog);
return ulrR; return ulrR;
......
...@@ -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,6 +69,8 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -67,6 +69,8 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
**/ **/
@Override @Override
public R<String> getInfoByRequestId() { public R<String> getInfoByRequestId() {
if (atomicGetFriend.incrementAndGet() <= 1) {
try {
TSocialFreindSet set = tSocialFreindSetService.getById("1"); TSocialFreindSet set = tSocialFreindSetService.getById("1");
if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) { if (set != null && Common.isNotNull(set.getType()) && 1 == set.getType()) {
// true养工失 false 医生大 // true养工失 false 医生大
...@@ -86,20 +90,35 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -86,20 +90,35 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
// 获取所有需要反馈的任务id // 获取所有需要反馈的任务id
List<TSocialInfo> socialList = tSocialInfoService.getSocialFriendYgsAll(); List<TSocialInfo> socialList = tSocialInfoService.getSocialFriendYgsAll();
List<TSocialFriendBackLog> logList; List<TSocialFriendBackLog> logList;
TSocialFriendBackLog backLog; TSocialFriendBackLog backLog = new TSocialFriendBackLog();
if (socialList != null && !socialList.isEmpty()) {
FriendResult info; FriendResult info;
List<FriendResult> resultList;
Map<String, FriendResult> resultMap;
if (socialList != null && !socialList.isEmpty()) {
logList = new ArrayList<>(); logList = new ArrayList<>();
resultMap = new HashMap<>();
for (TSocialInfo socialInfo : socialList) { for (TSocialInfo socialInfo : socialList) {
info = resultMap.get(socialInfo.getEmpIdcard());
if (info == null) {
backLog = new TSocialFriendBackLog(); backLog = new TSocialFriendBackLog();
backLog.setSocialId(socialInfo.getId()); backLog.setSocialId(socialInfo.getEmpIdcard());
backLog.setRequestId(socialInfo.getYgsRequestId()); backLog.setRequestId(socialInfo.getYgsRequestId());
backLog.setType(1); backLog.setType(11);
if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) { if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) {
backLog.setType(2); backLog.setType(12);
} }
info = socialFriendConfig.getFriendByRequestId(restTemplate, socialInfo.getYgsRequestId(), backLog, socialInfo.getDispatchType()); resultList = socialFriendConfig.getFriendByRequestId(restTemplate, socialInfo.getYgsRequestId()
, backLog, socialInfo.getDispatchType());
logList.add(backLog); logList.add(backLog);
if (resultList != null && !resultList.isEmpty()) {
for (FriendResult result : resultList) {
resultMap.put(result.getIdCard(), result);
}
info = resultMap.get(socialInfo.getEmpIdcard());
}
} else {
backLog.setSocialId(backLog.getSocialId() + "," +socialInfo.getEmpIdcard());
}
if (info != null && Common.isNotNull(info.getZt())) { if (info != null && Common.isNotNull(info.getZt())) {
doCore(info, socialInfo, typeFlag, user, errorMap); doCore(info, socialInfo, typeFlag, user, errorMap);
} }
...@@ -112,18 +131,31 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -112,18 +131,31 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
typeFlag = false; typeFlag = false;
List<TSocialInfo> socialYsdList = tSocialInfoService.getSocialFriendYsdAll(); List<TSocialInfo> socialYsdList = tSocialInfoService.getSocialFriendYsdAll();
if (socialYsdList != null && !socialYsdList.isEmpty()) { if (socialYsdList != null && !socialYsdList.isEmpty()) {
FriendResult info;
logList = new ArrayList<>(); logList = new ArrayList<>();
resultMap = new HashMap<>();
backLog = new TSocialFriendBackLog();
for (TSocialInfo socialInfo : socialYsdList) { for (TSocialInfo socialInfo : socialYsdList) {
info = resultMap.get(socialInfo.getEmpIdcard());
if (info == null) {
backLog = new TSocialFriendBackLog(); backLog = new TSocialFriendBackLog();
backLog.setSocialId(socialInfo.getId()); backLog.setSocialId(socialInfo.getEmpIdcard());
backLog.setRequestId(socialInfo.getYsdRequestId()); backLog.setRequestId(socialInfo.getYsdRequestId());
backLog.setType(3); backLog.setType(13);
if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) { if (Common.isNotNull(socialInfo.getDispatchType()) && CommonConstants.ONE_STRING.equals(socialInfo.getDispatchType())) {
backLog.setType(4); 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());
} }
info = socialFriendConfig.getFriendByRequestId(restTemplate, socialInfo.getYsdRequestId(), backLog, socialInfo.getDispatchType());
logList.add(backLog); logList.add(backLog);
} else {
backLog.setSocialId(backLog.getSocialId() + "," +socialInfo.getEmpIdcard());
}
if (info != null && Common.isNotNull(info.getZt())) { if (info != null && Common.isNotNull(info.getZt())) {
doCore(info, socialInfo, typeFlag, user, errorMap); doCore(info, socialInfo, typeFlag, user, errorMap);
} }
...@@ -133,7 +165,14 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T ...@@ -133,7 +165,14 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
} }
} }
} }
} finally {
atomicGetFriend.decrementAndGet();
}
return R.ok(); return R.ok();
} else {
atomicGetFriend.decrementAndGet();
return R.failed("距离上一次获取任务时间间隔太短,请10分钟后再试!!!");
}
} }
/** /**
...@@ -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>
<!-- 获取所有需要社保局审核的养工失 --> <!-- 获取所有需要社保局审核的养工失 -->
......
...@@ -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