Commit 2326044f authored by hongguangwu's avatar hongguangwu

Merge branch 'MVP-1.7.7-Friend' into MVP1.7.8

# Conflicts:
#	yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/config/SocialFriendConfig.java
#	yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/TSocialFriendPushServiceImpl.java
#	yifu-social/yifu-social-biz/src/main/resources/mapper/TSocialInfoMapper.xml
parents f0311785 afdf144b
...@@ -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>
......
/*
* 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;
/** /**
......
...@@ -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,93 @@ public class TSocialFriendController { ...@@ -63,4 +75,93 @@ 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) {
tSocialFriendPushService.pushFriendByAsync();
} else {
tSocialFriendService.getInfoByRequestIdByAsync();
}
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();
} }
/*
* 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);
}
...@@ -40,5 +40,13 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> { ...@@ -40,5 +40,13 @@ public interface TSocialFriendPushService extends IService<TSocialInfo> {
**/ **/
R<String> pushFriend(List<String> dispatchIdList); R<String> pushFriend(List<String> dispatchIdList);
/**
* @Description: 主动推送税友-异步
* @Author: hgw
* @Date: 2025/3/18 10:45
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
void pushFriendByAsync();
R<String> doExportRoster(String socialId, String type, String unitCreditCode); R<String> doExportRoster(String socialId, String type, String unitCreditCode);
} }
...@@ -37,4 +37,12 @@ public interface TSocialFriendService extends IService<TSocialInfo> { ...@@ -37,4 +37,12 @@ public interface TSocialFriendService extends IService<TSocialInfo> {
**/ **/
R<String> getInfoByRequestId(); R<String> getInfoByRequestId();
/**
* @Description: 主动获取税友-异步
* @Author: hgw
* @Date: 2025/3/18 10:45
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
void getInfoByRequestIdByAsync();
} }
...@@ -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);
......
/*
* 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);
}
}
...@@ -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();
}
/** /**
* 自动化日志批量导出 * 自动化日志批量导出
* *
......
...@@ -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);
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFreindPushAndGetMapper">
<resultMap id="tSocialFreindPushAndGetMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFreindPushAndGet">
<id property="id" column="ID"/>
<result property="type" column="TYPE"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="createUserName" column="CREATE_USER_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.TYPE,
a.CREATE_TIME,
a.CREATE_USER_NAME
</sql>
<sql id="tSocialFreindPushAndGet_where">
<if test="tSocialFreindPushAndGet != null">
<if test="tSocialFreindPushAndGet.id != null and tSocialFreindPushAndGet.id.trim() != ''">
AND a.ID = #{tSocialFreindPushAndGet.id}
</if>
<if test="tSocialFreindPushAndGet.type != null">
AND a.TYPE = #{tSocialFreindPushAndGet.type}
</if>
<if test="tSocialFreindPushAndGet.createTime != null">
AND a.CREATE_TIME = #{tSocialFreindPushAndGet.createTime}
</if>
<if test="tSocialFreindPushAndGet.createUserName != null and tSocialFreindPushAndGet.createUserName.trim() != ''">
AND a.CREATE_USER_NAME = #{tSocialFreindPushAndGet.createUserName}
</if>
</if>
</sql>
<!--获取当前类型最大的时间,用来判断10分钟内是否有操作过-->
<select id="getMaxTimeByType" resultType="java.time.LocalDateTime">
SELECT
max(a.CREATE_TIME)
FROM t_social_freind_push_and_get a
where a.TYPE = #{type}
</select>
</mapper>
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '0' if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '0'
) )
group by s.id group by s.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
<sql id="where_getSocialSoldier_base_handler"> <sql id="where_getSocialSoldier_base_handler">
...@@ -149,6 +150,7 @@ ...@@ -149,6 +150,7 @@
if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '5' if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) = '5'
) )
group by a.id group by a.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
<!-- 税友医生大增加模板--> <!-- 税友医生大增加模板-->
...@@ -165,6 +167,7 @@ ...@@ -165,6 +167,7 @@
if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '0' if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '0'
) )
group by s.id group by s.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
<!-- 税友医生大减少模板--> <!-- 税友医生大减少模板-->
...@@ -239,6 +242,7 @@ ...@@ -239,6 +242,7 @@
if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '5' if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) = '5'
) )
group by s.id group by s.id
order by a.SOCIAL_HOUSEHOLD_NAME asc
</select> </select>
</mapper> </mapper>
...@@ -611,7 +611,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -611,7 +611,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
left join t_dispatch_info d on d.SOCIAL_ID = a.id left join t_dispatch_info d on d.SOCIAL_ID = a.id
left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0' left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0'
and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN)) and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN))
where a.YGS_ADD_ID is not null and a.YGS_ADD_ID != '' and d.AUTO_FLAG='0' where a.YGS_ADD_ID is not null and a.YGS_ADD_ID != '' and a.YGS_REQUEST_ID is null and d.AUTO_FLAG='0'
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YGS_HANDLE_STATUS in ('1','2','3') and a.YGS_HANDLE_STATUS in ('1','2','3')
group by a.id group by a.id
...@@ -635,7 +635,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -635,7 +635,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
left join t_dispatch_info d on d.SOCIAL_ID = a.id left join t_dispatch_info d on d.SOCIAL_ID = a.id
left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0' left join t_social_deadline_info sd on sd.MONTH = DATE_FORMAT(d.AUDIT_TIME,'%Y%m') and sd.STATUS = '0'
and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN)) and sd.PROVINCE=a.SOCIAL_PROVINCE and sd.CITY=a.SOCIAL_CITY and ( (a.SOCIAL_TOWN is null and sd.TOWN is null) or (sd.TOWN=a.SOCIAL_TOWN))
where a.YSD_ADD_ID is not null and a.YSD_ADD_ID != '' and d.AUTO_FLAG='0' where a.YSD_ADD_ID is not null and a.YSD_ADD_ID != '' and a.YSD_REQUEST_ID is null and d.AUTO_FLAG='0'
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YSD_HANDLE_STATUS in ('1','2','3') and a.YSD_HANDLE_STATUS in ('1','2','3')
group by a.id group by a.id
...@@ -662,6 +662,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -662,6 +662,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YGS_HANDLE_STATUS in ('1','2') and a.YGS_HANDLE_STATUS in ('1','2')
group by a.id group by a.id
order by a.YGS_REQUEST_ID asc
</select> </select>
<!-- 获取所有需要自动办理的医生大 --> <!-- 获取所有需要自动办理的医生大 -->
...@@ -687,6 +688,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id ...@@ -687,6 +688,7 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')) and (DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m') or DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m'))
and a.YSD_HANDLE_STATUS in ('1','2') and a.YSD_HANDLE_STATUS in ('1','2')
group by a.id group by a.id
order by a.YSD_REQUEST_ID asc
</select> </select>
<!-- 获取所有需要社保局审核的养工失 --> <!-- 获取所有需要社保局审核的养工失 -->
......
...@@ -41,19 +41,19 @@ ...@@ -41,19 +41,19 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
a.ADD_ID, a.ADD_ID,
a.SOCIAL_ID, a.SOCIAL_ID,
a.EMP_IDCARD, a.EMP_IDCARD,
a.EMP_NAME, a.EMP_NAME,
a.DISPATCH_ITEM, a.DISPATCH_ITEM,
a.SOCIAL_HU_NAME, a.SOCIAL_HU_NAME,
a.TYPE, a.TYPE,
a.REMARK, a.REMARK,
a.CREATE_BY, a.CREATE_BY,
a.UPDATE_BY, a.UPDATE_BY,
a.CREATE_NAME, a.CREATE_NAME,
a.UPDATE_TIME, a.UPDATE_TIME,
a.CREATE_TIME a.CREATE_TIME
</sql> </sql>
<sql id="tSocialSoldierLog_where"> <sql id="tSocialSoldierLog_where">
<if test="tSocialSoldierLog != null"> <if test="tSocialSoldierLog != null">
...@@ -132,4 +132,13 @@ ...@@ -132,4 +132,13 @@
</if> </if>
</if> </if>
</select> </select>
<!--tSocialSoldierLog简单分页查询-->
<select id="getMaxTimeToLog" resultType="java.time.LocalDateTime">
SELECT
max(a.CREATE_TIME)
FROM t_social_soldier_log a
where a.TYPE = '拉取'
</select>
</mapper> </mapper>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao ,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and s.YGS_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '0' or
if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '0' or
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao ,'是' isAutoSubmit,'是' isAutoInsert,'是' isAutoUpload,'是' isDoShenBao,'' isDanShenBao
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and a.type = '1' and s.YGS_HANDLE_STATUS in ('0','1','2','3') and s.YGS_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) = '5' or
if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) = '5' or
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen ,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and s.YSD_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '0' or
if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '0' or if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '0' or
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen ,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3') and s.YSD_REQUEST_ID is null
and ( and (
if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) = '5' or
if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '5' or if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) = '5' or
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment