Commit 45da142f authored by hongguangwu's avatar hongguangwu

1.7.19-税友相关

parent 986dddd3
......@@ -437,6 +437,16 @@ public class SysHouseHoldInfo extends BaseEntity {
@ExcelProperty("医保推送类型")
private String isSingleYsdPush;
/**
* 推送时,医保完成后才推送社保,默认0否
*/
@ExcelAttribute(name = "根据医保结果办理养工失" )
@Schema(description ="根据医保结果办理养工失")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("根据医保结果办理养工失")
private String isYsdOkPushYgs;
/**
* 户与失败原因关联list
*/
......
......@@ -72,5 +72,14 @@ public class TSocialFreindPushAndGet {
@ExcelProperty("创建人姓名")
@Schema(description = "创建人姓名")
private String createUserName;
/**
* 创建人ID
*/
@ExcelAttribute(name = "创建人ID", isNotEmpty = true, errorInfo = "创建人ID不能为空", maxLength = 64)
@NotBlank(message = "创建人ID不能为空")
@Length(max = 64, message = "创建人ID不能超过64个字符")
@ExcelProperty("创建人ID")
@Schema(description = "创建人ID")
private String createBy;
}
......@@ -84,7 +84,7 @@ public class TSocialFriendController {
@SysLog("1定时任务推送税友")
@Inner
public R<String> doPushFriendTest() {
return tSocialFriendPushService.pushFriend(null);
return tSocialFriendPushService.pushFriend(null, CommonConstants.ONE_INT);
}
@Operation(description = "2定时任务获取税友")
......@@ -102,12 +102,12 @@ public class TSocialFriendController {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "主动推送税友")
@GetMapping("/doPushFriendByActive")
@PostMapping("/doPushFriendByActive")
@SysLog("主动推送税友")
public R<String> doPushFriendActive() {
public R<String> doPushFriendActive(@RequestBody List<String> dispatchIdList) {
if (atomicPush.incrementAndGet() <= 1) {
try {
R<String> failed = getCore(CommonConstants.ONE_INT);
R<String> failed = getCore(CommonConstants.ONE_INT, dispatchIdList);
if (failed != null) return failed;
} finally {
atomicPush.decrementAndGet();
......@@ -126,7 +126,7 @@ public class TSocialFriendController {
* @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) {
private R<String> getCore(int type, List<String> dispatchIdList) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getNickname())) {
return R.failed("请先登录!");
......@@ -136,16 +136,18 @@ public class TSocialFriendController {
LocalDateTime now = LocalDateTime.now();
// 计算10分钟前的时间
LocalDateTime tenMinutesAgo = now.minusMinutes(10);
LocalDateTime time = tSocialFreindPushAndGetService.getMaxTimeByType(type);
LocalDateTime time = tSocialFreindPushAndGetService.getMaxTimeByType(type, user.getId());
if (Common.isEmpty(time) || time.isBefore(tenMinutesAgo)) {
TSocialFreindPushAndGet info = new TSocialFreindPushAndGet();
info.setType(type);
info.setCreateTime(now);
info.setCreateUserName(user.getNickname());
info.setCreateBy(user.getId());
tSocialFreindPushAndGetService.save(info);
if (type == CommonConstants.ONE_INT) {
// isAuto 参数:是否自动,自动要查户配置。手动可推送养工失。 手动的都推送(大部分都是推送,芜湖要先推送医保办理成功后才推送社保)
//doJointFriendTask.pushFriendByAsync()
tSocialFriendPushService.pushFriend(null);
tSocialFriendPushService.pushFriend(dispatchIdList, CommonConstants.ZERO_INT);
} else {
//doJointFriendTask.getInfoByRequestIdByAsync()
tSocialFriendService.getInfoByRequestId();
......@@ -174,7 +176,7 @@ public class TSocialFriendController {
public R<String> doGetFriendByActive() {
if (atomicGet.incrementAndGet() <= 1) {
try {
R<String> failed = getCore(CommonConstants.TWO_INT);
R<String> failed = getCore(CommonConstants.TWO_INT, null);
if (failed != null) return failed;
} finally {
atomicGet.decrementAndGet();
......
......@@ -39,5 +39,5 @@ public interface TSocialFreindPushAndGetMapper extends BaseMapper<TSocialFreindP
* @Date: 2025/3/18 15:57
* @return: java.time.LocalDateTime
**/
LocalDateTime getMaxTimeByType(@Param("type") Integer type);
LocalDateTime getMaxTimeByType(@Param("type") Integer type, @Param("createUserId") String createUserId);
}
......@@ -39,7 +39,7 @@ public interface TSocialFriendMapper extends BaseMapper<TSocialInfo> {
* @Author hgw
* @Date 2024-5-10 21:16:41
**/
List<SociaFriendYgsAddVo> getSocialSoldierYgsAddVoList(@Param("idsStr") List<String> idsStr);
List<SociaFriendYgsAddVo> getSocialSoldierYgsAddVoList(@Param("idsStr") List<String> idsStr, @Param("isAuto") Integer isAuto);
/**
* 社保士兵养工失减少模板
......@@ -47,7 +47,7 @@ public interface TSocialFriendMapper extends BaseMapper<TSocialInfo> {
* @Author hgw
* @Date 2024-5-10 21:16:41
**/
List<SociaFriendYgsAddVo> getSocialSoldierYgsReduceVoList(@Param("idsStr") List<String> idsStr);
List<SociaFriendYgsAddVo> getSocialSoldierYgsReduceVoList(@Param("idsStr") List<String> idsStr, @Param("isAuto") Integer isAuto);
/**
* 社保士兵医生大增加模板
......
......@@ -37,5 +37,5 @@ public interface TSocialFreindPushAndGetService extends IService<TSocialFreindPu
* @Date: 2025/3/18 15:57
* @return: java.time.LocalDateTime
**/
LocalDateTime getMaxTimeByType(Integer type);
LocalDateTime getMaxTimeByType(Integer type, String createUserId);
}
......@@ -33,13 +33,15 @@ import java.util.List;
public interface TSocialFriendPushService extends IService<TSocialInfo> {
/**
* @param isAuto 1是,0否。是否自动,自动要查户配置。手动可推送养工失。
* 手动的都推送(大部分都是推送,芜湖要先推送医保办理成功后才推送社保)
* @param dispatchIdList
* @Description: 根据派单id,获取要派增派减的社保、医保数据,生成文件,推送到社保士兵
* @Author: hgw
* @Date: 2024/5/10 17:52
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> pushFriend(List<String> dispatchIdList);
R<String> pushFriend(List<String> dispatchIdList, Integer isAuto);
R<String> doExportRoster(String socialId, String type, String unitCreditCode, List<SociaFriendYgsAddVo> listVo);
......
......@@ -43,8 +43,8 @@ public class TSocialFreindPushAndGetServiceImpl extends ServiceImpl<TSocialFrein
* @return: java.time.LocalDateTime
**/
@Override
public LocalDateTime getMaxTimeByType(Integer type) {
return baseMapper.getMaxTimeByType(type);
public LocalDateTime getMaxTimeByType(Integer type, String createUserId) {
return baseMapper.getMaxTimeByType(type, createUserId);
}
}
......@@ -103,14 +103,17 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
private TDispatchInfoMapper dispatchInfoMapper;
private final static String AND_STR = "&";
/**
* @param isAuto 1是,0否。是否自动推送的,自动要查户配置。手动可推送养工失。
* 手动的都推送(大部分都是推送,芜湖要先推送医保办理成功后才推送社保)
* @Description: 推送到税友
* @Author: hgw
* @Date: 2024-12-12 10:03:59
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Override
public R<String> pushFriend(List<String> dispatchIdList) {
public R<String> pushFriend(List<String> dispatchIdList, Integer isAuto) {
if (atomicPushFriend.incrementAndGet() <= 1) {
try {
TSocialFreindSet set = tSocialFreindSetService.getById("1");
......@@ -150,18 +153,22 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (Common.isNotNull(templateSrc)) {
templateUrl = ossUtil.getObjectUrl(null, templateSrc);
}
// TODO- 缺少手动推送,判断是勾选的还是查权限内的
// TODO- 缺少手动推送查权限内的接口
// 社保增员、社保减员、医保增员、医保减员
// 养工失新增列表
List<SociaFriendYgsAddVo> ygsAddlist = baseMapper.getSocialSoldierYgsAddVoList(dispatchIdList);
List<SociaFriendYgsAddVo> ygsAddlist = baseMapper.getSocialSoldierYgsAddVoList(dispatchIdList, isAuto);
if (ygsAddlist != null && !ygsAddlist.isEmpty()) {
this.doPushSocialAndLogYgs(socialSetMap, ygsAddlist, 1, reduceYgsMap, zhangMap, templateUrl, templateSrcMap, reduceChiZhouMap);
}
// 养工失减少列表
List<SociaFriendYgsAddVo> ygsReducelist = baseMapper.getSocialSoldierYgsReduceVoList(dispatchIdList);
List<SociaFriendYgsAddVo> ygsReducelist = baseMapper.getSocialSoldierYgsReduceVoList(dispatchIdList, isAuto);
if (ygsReducelist != null && !ygsReducelist.isEmpty()) {
this.doPushSocialAndLogYgs(socialSetMap, ygsReducelist, 2, reduceYgsMap, zhangMap, templateUrl, templateSrcMap, reduceChiZhouMap);
}
// 医生大新增列表
List<SociaFriendYgsAddVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddVoList(dispatchIdList);
if (ysdAddlist != null && !ysdAddlist.isEmpty()) {
......
......@@ -270,7 +270,7 @@ public class DoSocialTask {
**/
@Async
public void pushFriend(List<String> dispatchIdList) {
tSocialFriendPushService.pushFriend(dispatchIdList);
tSocialFriendPushService.pushFriend(dispatchIdList, CommonConstants.ONE_INT);
}
@Async
......
......@@ -73,6 +73,8 @@
<result property="ybsfqzcb" column="YBSFQZCB"/>
<result property="isSingleYgsPush" column="IS_SINGLE_YGS_PUSH"/>
<result property="isSingleYsdPush" column="IS_SINGLE_YSD_PUSH"/>
<!--MVP1.7.19 2026-01-20是否办理医保完成后才允许推送社保-->
<result property="isYsdOkPushYgs" column="IS_YSD_OK_PUSH_YGS"/>
</resultMap>
<resultMap id="sysHouseHoldSingleInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo">
......@@ -130,6 +132,7 @@
,a.YBSFQZCB
,a.IS_SINGLE_YGS_PUSH
,a.IS_SINGLE_YSD_PUSH
,a.IS_YSD_OK_PUSH_YGS
</sql>
<sql id="sysHouseHoldInfo_where">
......@@ -191,6 +194,9 @@
<if test="sysHouseHoldInfo.isSign != null and sysHouseHoldInfo.isSign.trim() != ''">
AND a.IS_SIGN = #{sysHouseHoldInfo.isSign}
</if>
<if test="sysHouseHoldInfo.isYsdOkPushYgs != null and sysHouseHoldInfo.isYsdOkPushYgs.trim() != ''">
AND a.IS_YSD_OK_PUSH_YGS = #{sysHouseHoldInfo.isYsdOkPushYgs}
</if>
</if>
</sql>
<!--sysHouseHoldInfo简单分页查询-->
......
......@@ -56,7 +56,7 @@
SELECT
max(a.CREATE_TIME)
FROM t_social_freind_push_and_get a
where a.TYPE = #{type}
where a.TYPE = #{type} and a.create_by = #{createUserId}
</select>
</mapper>
......@@ -144,6 +144,10 @@
/*派单推的,有ID,则查单个推送的,立即推*/
and a.IS_SINGLE = '1'
</if>
<if test="isAuto != null and isAuto == 1">
/*自动推送时,查开关关闭,或者医保完成后才推送社保*/
and (shh.IS_YSD_OK_PUSH_YGS = '0' or s.YSD_HANDLE_STATUS = '6')
</if>
and a.AUTO_FLAG = '0'
and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','3')
and (
......
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