Commit 2cfe6eeb authored by fangxinjiang's avatar fangxinjiang

社保办理失败推送微信-fxj

parent 63c5f79b
...@@ -314,4 +314,17 @@ public class SocialTask { ...@@ -314,4 +314,17 @@ public class SocialTask {
"/tdispatchinfopre/inner/pushDisConfrimSocial","", Void.class, SecurityConstants.FROM_IN); "/tdispatchinfopre/inner/pushDisConfrimSocial","", Void.class, SecurityConstants.FROM_IN);
log.info("-------------每天三点二十批量派单社保-定时任务开始------------"); log.info("-------------每天三点二十批量派单社保-定时任务开始------------");
} }
/**
* 每天10点推送社保办理失败的信息给申请人,异常给地址办理人员
* @author fangxj
* @param
* @return void
*/
public void pushSocialhandleFailMessage() {
log.info("-------------每天10点推送社保办理失败的信息给申请人,异常给地址办理人员开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(), daprProperties.getAppId(),
"/tsocialalertinfo/inner/createAndSendSocialAlert","", Void.class, SecurityConstants.FROM_IN);
log.info("-------------每天10点推送社保办理失败的信息给申请人,异常给地址办理人员结束------------");
}
} }
/*
* 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.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* @author fxj
* @Description 社保办理失败通知信息
* @date 2025-10-15 14:50:53
*/
@Data
@TableName("t_social_alert_info")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "社保办理失败通知信息")
public class TSocialAlertInfo extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Length(max = 50, message = "项目编码不能超过50个字符")
@ExcelProperty("项目编码")
@Schema(description = "项目编码")
private String deptNo;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称", maxLength = 100)
@Length(max = 100, message = "项目名称不能超过100个字符")
@ExcelProperty("项目名称")
@Schema(description = "项目名称")
private String deptName;
/**
* 类型:0社保1公积金
*/
@ExcelAttribute(name = "类型:0社保1公积金", maxLength = 255)
@Length(max = 255, message = "类型:0社保1公积金不能超过255个字符")
@ExcelProperty("类型:0社保1公积金")
@Schema(description = "类型:0社保1公积金")
private String type;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Length(max = 20, message = "员工姓名不能超过20个字符")
@ExcelProperty("员工姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证
*/
@ExcelAttribute(name = "员工身份证", maxLength = 30)
@Length(max = 30, message = "员工身份证不能超过30个字符")
@ExcelProperty("员工身份证")
@Schema(description = "员工身份证")
private String empIdcard;
/**
* 失败原因
*/
@ExcelAttribute(name = "失败原因", maxLength = 200)
@Length(max = 200, message = "失败原因不能超过200个字符")
@ExcelProperty("失败原因")
@Schema(description = "失败原因")
private String reason;
/**
* 接收人
*/
@ExcelAttribute(name = "接收人", maxLength = 36)
@Length(max = 36, message = "接收人不能超过36个字符")
@ExcelProperty("接收人")
@Schema(description = "接收人")
private String receiveUser;
/**
* 办理事时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "办理事时间")
private LocalDateTime handleTime;
/**
* 户名称
*/
@ExcelAttribute(name = "户名称", maxLength = 20)
@Length(max = 20, message = "户名称不能超过20个字符")
@ExcelProperty("户名称")
@Schema(description = "户名称")
private String houseHoldName;
/**
* 缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地-省", maxLength = 32,isArea = true,needExport = true)
@Schema(description = "社保缴纳地-省")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-省" )
private String socialProvince;
/**
* 缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市", maxLength = 32, isArea = true, parentField = "socialProvince",needExport = true)
@Schema(description = "社保缴纳地-市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-市" )
private String socialCity;
/**
* 缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县", maxLength = 32, isArea = true, parentField = "socialCity",needExport = true)
@Schema(description = "社保缴纳地-县")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保缴纳地-县" )
private String socialTown;
/**
* 公积金缴纳地-省
*/
@ExcelAttribute(name = "公积金缴纳地-省", maxLength = 32, isArea = true, needExport = true)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-省" )
private String fundProvince;
/**
* 公积金缴纳地-市
*/
@ExcelAttribute(name = "公积金缴纳地-市", maxLength = 32, isArea = true, parentField = "fundProvince",needExport = true)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-市" )
private String fundCity;
/**
* 公积金缴纳地-县
*/
@ExcelAttribute(name = "公积金缴纳地-县", maxLength = 32, isArea = true, parentField = "fundCity",needExport = true)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("公积金缴纳地-县" )
private String fundTown;
/**
* 派单ID
*/
@ExcelAttribute(name = "派单ID", maxLength = 32)
@ExcelProperty("派单ID" )
private String dispatchId;
/**
* 申请人
*/
@ExcelAttribute(name = "申请人", maxLength = 32)
@ExcelProperty("申请人" )
private String applyName;
}
/*
* 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.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAlertInfo;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author fxj
* @date 2025-10-15 14:50:53
*/
@Data
public class TSocialAlertInfoSearchVo extends TSocialAlertInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
/*
* 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.vo;
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.vo.RowIndex;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author fxj
* @date 2025-10-15 14:50:53
*/
@Data
public class TSocialAlertInfoVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 32, message = "id 不能超过32 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 32)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 项目编码
*/
@Length(max = 50, message = "项目编码 不能超过50 个字符")
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 项目名称
*/
@Length(max = 100, message = "项目名称 不能超过100 个字符")
@ExcelAttribute(name = "项目名称", maxLength = 100)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 类型:0社保1公积金
*/
@Length(max = 255, message = "类型:0社保1公积金 不能超过255 个字符")
@ExcelAttribute(name = "类型:0社保1公积金", maxLength = 255)
@Schema(description = "类型:0社保1公积金")
@ExcelProperty("类型:0社保1公积金")
private String type;
/**
* 员工姓名
*/
@Length(max = 20, message = "员工姓名 不能超过20 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 员工身份证
*/
@Length(max = 30, message = "员工身份证 不能超过30 个字符")
@ExcelAttribute(name = "员工身份证", maxLength = 30)
@Schema(description = "员工身份证")
@ExcelProperty("员工身份证")
private String empIdcard;
/**
* 失败原因
*/
@Length(max = 200, message = "失败原因 不能超过200 个字符")
@ExcelAttribute(name = "失败原因", maxLength = 200)
@Schema(description = "失败原因")
@ExcelProperty("失败原因")
private String reason;
/**
* 接收人
*/
@Length(max = 36, message = "接收人 不能超过36 个字符")
@ExcelAttribute(name = "接收人", maxLength = 36)
@Schema(description = "接收人")
@ExcelProperty("接收人")
private String receiveUser;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.vo.YifuUser;
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.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAlertInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialAlertInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialAlertInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author fxj
* @date 2025-10-15 14:50:53
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialalertinfo")
@Tag(name = "社保办理失败通知信息")
public class TSocialAlertInfoController {
private final TSocialAlertInfoService tSocialAlertInfoService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tSocialAlertInfo
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSocialAlertInfo>> getTSocialAlertInfoPage(Page<TSocialAlertInfo> page, TSocialAlertInfoSearchVo tSocialAlertInfo) {
return new R<>(tSocialAlertInfoService.getTSocialAlertInfoPage(page, tSocialAlertInfo));
}
/**
* 不分页查询
*
* @param tSocialAlertInfo
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TSocialAlertInfo>> getTSocialAlertInfoNoPage(@RequestBody TSocialAlertInfoSearchVo tSocialAlertInfo) {
YifuUser user = SecurityUtils.getUser();
if (null == user || null == user.getId()){
return R.failed(CommonConstants.USER_FAIL);
}
tSocialAlertInfo.setReceiveUser(user.getId());
return R.ok(tSocialAlertInfoService.noPageDiy(tSocialAlertInfo));
}
/**
* 通过id查询
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tsocialalertinfo_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsocialalertinfo_get')")
public R<TSocialAlertInfo> getById(@PathVariable("id") String id) {
return R.ok(tSocialAlertInfoService.getById(id));
}
/**
* 新增
*
* @param tSocialAlertInfo
* @return R
*/
@Operation(summary = "新增", description = "新增:hasPermission('social_tsocialalertinfo_add')")
@SysLog("新增")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tsocialalertinfo_add')")
public R<Boolean> save(@RequestBody TSocialAlertInfo tSocialAlertInfo) {
return R.ok(tSocialAlertInfoService.save(tSocialAlertInfo));
}
/**
* 修改
*
* @param tSocialAlertInfo
* @return R
*/
@Operation(summary = "修改", description = "修改:hasPermission('social_tsocialalertinfo_edit')")
@SysLog("修改")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tsocialalertinfo_edit')")
public R<Boolean> updateById(@RequestBody TSocialAlertInfo tSocialAlertInfo) {
return R.ok(tSocialAlertInfoService.updateById(tSocialAlertInfo));
}
/**
* 通过id删除
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除", description = "通过id删除:hasPermission('social_tsocialalertinfo_del')")
@SysLog("通过id删除")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsocialalertinfo_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialAlertInfoService.removeById(id));
}
/**
* 批量导入
*
* @author fxj
* @date 2025-10-15 14:50:53
**/
@SneakyThrows
@Operation(description = "批量新增 hasPermission('social_tsocialalertinfo-batch-import')")
@SysLog("批量新增")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('social_tsocialalertinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tSocialAlertInfoService.importDiy(file.getInputStream());
}
/**
* 批量导出
*
* @author fxj
* @date 2025-10-15 14:50:53
**/
@Operation(description = "导出 hasPermission('social_tsocialalertinfo-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tsocialalertinfo-export')")
public void export(HttpServletResponse response, @RequestBody TSocialAlertInfoSearchVo searchVo) {
tSocialAlertInfoService.listExport(response, searchVo);
}
/**
* @Author fxj
* @Description 每天刷新办理失败的数据 并发送给申请人,如果申请人异常发给地市办理人,如果地市办理人异常 不处理
* @Date 15:14 2025/10/15
* @Param
* @return
**/
@Operation(description = "每天刷新办理失败的数据")
@Inner
@PostMapping("/inner/createAndSendSocialAlert")
public void createAndSendSocialAlert() {
tSocialAlertInfoService.createAndSendSocialAlert();
}
@Operation(description = "每天刷新办理失败的数据")
@PostMapping("/createAndSendSocialAlert2")
public void createAndSendSocialAlert2() {
tSocialAlertInfoService.createAndSendSocialAlert();
}
}
/*
* 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.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAlertInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author fxj
* @date 2025-10-15 14:50:53
*/
@Mapper
public interface TSocialAlertInfoMapper extends BaseMapper<TSocialAlertInfo> {
/**
* 简单分页查询
*
* @param tSocialAlertInfo
* @return
*/
IPage<TSocialAlertInfo> getTSocialAlertInfoPage(Page<TSocialAlertInfo> page, @Param("tSocialAlertInfo") TSocialAlertInfo tSocialAlertInfo);
List<TSocialAlertInfo> getTSocialAlertInfoList();
List<TSocialAlertInfo> getTFundAlertInfoList();
void deleteCUrrentDayData();
}
...@@ -21,10 +21,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,10 +21,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialfundHouseRes;
import org.apache.ibatis.annotations.MapKey;
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.util.List; import java.util.List;
import java.util.Map;
/** /**
* 社保公积金户权限配置表 * 社保公积金户权限配置表
...@@ -58,4 +60,11 @@ public interface TSocialfundHouseResMapper extends BaseMapper<TSocialfundHouseRe ...@@ -58,4 +60,11 @@ public interface TSocialfundHouseResMapper extends BaseMapper<TSocialfundHouseRe
List<String> getSocialListByUserId(@Param("userId") String userId); List<String> getSocialListByUserId(@Param("userId") String userId);
/**
* 获取户名称与用户ID的映射关系
* key: 户名称(HOUSEHOLD)
* value: 用户ID列表,多个ID使用逗号分隔
* @return 户名称与用户ID的映射关系Map
*/
List<Map<String, String>> getHouseHoldUserMap();
} }
/*
* 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.TSocialAlertInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.social.vo.TSocialAlertInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
/**
*
*
* @author fxj
* @date 2025-10-15 14:50:53
*/
public interface TSocialAlertInfoService extends IService<TSocialAlertInfo> {
/**
* 简单分页查询
* @param tSocialAlertInfo
* @return
*/
IPage<TSocialAlertInfo> getTSocialAlertInfoPage(Page<TSocialAlertInfo> page, TSocialAlertInfoSearchVo tSocialAlertInfo);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TSocialAlertInfoSearchVo searchVo);
List<TSocialAlertInfo> noPageDiy(TSocialAlertInfoSearchVo searchVo);
void createAndSendSocialAlert();
}
<?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.TSocialAlertInfoMapper">
<resultMap id="tSocialAlertInfoMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAlertInfo">
<id property="id" column="ID"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="type" column="TYPE"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="reason" column="REASON"/>
<result property="receiveUser" column="RECEIVE_USER"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="handleTime" column="HANDLE_TIME"/>
<result property="houseHoldName" column="HOUSE_HOLD_NAME"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="fundProvince" column="FUND_PROVINCE"/>
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
<result property="dispatchId" column="DISPATCH_ID"/>
<result property="applyName" column="APPLY_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.DEPT_NO,
a.DEPT_NAME,
a.TYPE,
a.EMP_NAME,
a.EMP_IDCARD,
a.REASON,
a.RECEIVE_USER,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME,
a.HOUSE_HOLD_NAME,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.FUND_PROVINCE,
a.FUND_CITY,
a.FUND_TOWN,
a.HANDLE_TIME,
a.DISPATCH_ID,a.APPLY_NAME
</sql>
<sql id="tSocialAlertInfo_where">
<if test="tSocialAlertInfo != null">
<if test="tSocialAlertInfo.id != null and tSocialAlertInfo.id.trim() != ''">
AND a.ID = #{tSocialAlertInfo.id}
</if>
<if test="tSocialAlertInfo.deptNo != null and tSocialAlertInfo.deptNo.trim() != ''">
AND a.DEPT_NO = #{tSocialAlertInfo.deptNo}
</if>
<if test="tSocialAlertInfo.deptName != null and tSocialAlertInfo.deptName.trim() != ''">
AND a.DEPT_NAME = #{tSocialAlertInfo.deptName}
</if>
<if test="tSocialAlertInfo.type != null and tSocialAlertInfo.type.trim() != ''">
AND a.TYPE = #{tSocialAlertInfo.type}
</if>
<if test="tSocialAlertInfo.empName != null and tSocialAlertInfo.empName.trim() != ''">
AND a.EMP_NAME = #{tSocialAlertInfo.empName}
</if>
<if test="tSocialAlertInfo.empIdcard != null and tSocialAlertInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tSocialAlertInfo.empIdcard}
</if>
<if test="tSocialAlertInfo.reason != null and tSocialAlertInfo.reason.trim() != ''">
AND a.REASON = #{tSocialAlertInfo.reason}
</if>
<if test="tSocialAlertInfo.receiveUser != null and tSocialAlertInfo.receiveUser.trim() != ''">
AND a.RECEIVE_USER = #{tSocialAlertInfo.receiveUser}
</if>
<if test="tSocialAlertInfo.createBy != null and tSocialAlertInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tSocialAlertInfo.createBy}
</if>
<if test="tSocialAlertInfo.updateBy != null and tSocialAlertInfo.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tSocialAlertInfo.updateBy}
</if>
<if test="tSocialAlertInfo.createName != null and tSocialAlertInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tSocialAlertInfo.createName}
</if>
<if test="tSocialAlertInfo.updateTime != null">
AND a.UPDATE_TIME = #{tSocialAlertInfo.updateTime}
</if>
<if test="tSocialAlertInfo.createTime != null">
AND a.CREATE_TIME = #{tSocialAlertInfo.createTime}
</if>
</if>
</sql>
<!--tSocialAlertInfo简单分页查询-->
<select id="getTSocialAlertInfoPage" resultMap="tSocialAlertInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_alert_info a
<where>
1=1
<include refid="tSocialAlertInfo_where"/>
</where>
</select>
<!--tSocialAlertInfo数据获取-->
<select id="getTSocialAlertInfoList" resultMap="tSocialAlertInfoMap">
SELECT
di.SETTLE_DOMAIN_CODE as DEPT_NO,
di.SETTLE_DOMAIN_NAME as DEPT_NAME,
di.TYPE AS TYPE,
di.EMP_NAME AS EMP_NAME,
di.EMP_IDCARD AS EMP_IDCARD,
di.CREATE_NAME AS APPLY_NAME,
di.CREATE_BY AS CREATE_BY,
di.CREATE_BY AS RECEIVE_USER,
di.SOCIAL_HOUSEHOLD_NAME as HOUSE_HOLD_NAME,
di.SOCIAL_PROVINCE as SOCIAL_PROVINCE,
di.SOCIAL_CITY as SOCIAL_CITY,
di.SOCIAL_TOWN as SOCIAL_TOWN,
NULL as FUND_PROVINCE,
NULL as FUND_CITY,
NULL as FUND_TOWN,
di.id as DISPATCH_ID,
CASE
WHEN di.TYPE =0 THEN si.HANDLE_TIME
WHEN di.TYPE =1 THEN si.REDUCE_HANDLE_TIME
ELSE NULL
END AS HANDLE_TIME,
CASE
WHEN di.SOCIAL_HANDLE_STATUS IN ('2', '3') THEN di.SOCIAL_HANDLE_REMARK
ELSE NULL
END AS REASON
FROM
t_dispatch_info as di
LEFT JOIN
(
SELECT
ID,
HANDLE_TIME,
REDUCE_HANDLE_TIME
FROM t_social_info
WHERE
CREATE_TIME > DATE_SUB(CURDATE(), INTERVAL 4 MONTH)
) AS si ON di.SOCIAL_ID = si.ID
WHERE
(
(si.HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY)
AND si.HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
OR
(si.REDUCE_HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY)
AND si.REDUCE_HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
)
AND di.SOCIAL_HANDLE_STATUS IN ('2', '3')
AND di.DELETE_FLAG = '0' AND di.TYPE=0
</select>
<!--tSocialAlertInfo数据获取-->
<select id="getTFundAlertInfoList" resultMap="tSocialAlertInfoMap">
SELECT
di.SETTLE_DOMAIN_CODE as DEPT_NO,
di.SETTLE_DOMAIN_NAME as DEPT_NAME,
di.TYPE AS TYPE,
di.EMP_NAME AS EMP_NAME,
di.EMP_IDCARD AS EMP_IDCARD,
di.CREATE_NAME AS APPLY_NAME,
di.CREATE_BY AS CREATE_BY,
di.CREATE_BY AS RECEIVE_USER,
di.PROVIDENT_HOUSEHOLD_NAME as HOUSE_HOLD_NAME,
NULL as SOCIAL_PROVINCE,
NULL as SOCIAL_CITY,
NULL as SOCIAL_TOWN,
di.FUND_PROVINCE as FUND_PROVINCE,
di.FUND_CITY as FUND_CITY,
di.FUND_TOWN as FUND_TOWN,
di.id as DISPATCH_ID,
CASE
WHEN di.TYPE =0 THEN pf.HANDLE_TIME
WHEN di.TYPE =1 THEN pf.REDUCE_HANDLE_TIME
ELSE NULL
END AS HANDLE_TIME,
CASE
WHEN di.FUND_HANDLE_STATUS = '2' THEN di.FUND_HANDLE_REMARK
ELSE NULL
END AS REASON
FROM
t_dispatch_info as di
LEFT JOIN
(
SELECT
HANDLE_TIME,
ID,
REDUCE_HANDLE_TIME
FROM t_provident_fund
WHERE
CREATE_TIME > DATE_SUB(CURDATE(), INTERVAL 4 MONTH )
) AS pf ON di.FUND_ID = pf.ID
WHERE
(
(pf.HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY)
AND pf.HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
OR
(pf.REDUCE_HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY)
AND pf.REDUCE_HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
)
AND di.FUND_HANDLE_STATUS = '2'
AND di.DELETE_FLAG = '0' AND di.TYPE=1
</select>
<delete id="deleteCUrrentDayData">
delete from t_social_alert_info where CREATE_TIME >= CONCAT(CURDATE(), ' 10:00:00')
</delete>
</mapper>
\ No newline at end of file
...@@ -129,5 +129,28 @@ ...@@ -129,5 +129,28 @@
<select id="getSocialListByUserId" resultType="java.lang.String"> <select id="getSocialListByUserId" resultType="java.lang.String">
SELECT a.SOCIAL_HOUSEHOLD FROM t_socialfund_house_res a WHERE user_id = #{userId} AND STATUS = '0' AND AUTH_TYPE = '1' AND HOUSE_NAME_TYPE = '0' SELECT a.SOCIAL_HOUSEHOLD FROM t_socialfund_house_res a WHERE user_id = #{userId} AND STATUS = '0' AND AUTH_TYPE = '1' AND HOUSE_NAME_TYPE = '0'
</select> </select>
<select id="getHouseHoldUserMap" resultType="java.util.Map">
<!--
查询各个户籍/公积金账户对应的用户ID列表
条件:
- STATUS = '0': 有效状态
- AUTH_TYPE = '1': 授权类型为1
- HOUSE_NAME_TYPE = '0': 社保户籍类型 或 HOUSE_NAME_TYPE = '1': 公积金户籍类型
-->
SELECT x.HOUSEHOLD as 'key',GROUP_CONCAT(DISTINCT x.USER_ID) as 'value'
FROM
(
SELECT a.SOCIAL_HOUSEHOLD as HOUSEHOLD,a.USER_ID
FROM t_socialfund_house_res a
WHERE STATUS = '0' AND AUTH_TYPE = '1' AND HOUSE_NAME_TYPE = '0'
UNION ALL
SELECT a.FUND_HOUSEHOLD as HOUSEHOLD,a.USER_ID
FROM t_socialfund_house_res a
WHERE STATUS = '0' AND AUTH_TYPE = '1' AND HOUSE_NAME_TYPE = '1'
) AS x
WHERE x.HOUSEHOLD IS NOT NULL
GROUP BY x.HOUSEHOLD
</select>
</mapper> </mapper>
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