Commit 5df647e4 authored by fangxinjiang's avatar fangxinjiang

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

parents 88f90e51 f217aaf3
......@@ -1331,6 +1331,7 @@ public class DateUtil {
return cal.getTime();
}
// fxj编写的获取当前时间,并替换 日
public static Date getDayOfThisMonth(int day){
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
......@@ -1339,6 +1340,23 @@ public class DateUtil {
return cal.getTime();
}
/**
* @Description: 替换当前时间的 日+时+分
* @Author: hgw
* @Date: 2024/9/2 11:07
* @return: java.util.Date
**/
public static Date getDayOfThisMonthByHourAndMin(int day, Date dateHourAndMin){
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.set(Calendar.DAY_OF_MONTH, day);
cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(new SimpleDateFormat("HH").format(dateHourAndMin)));
cal.set(Calendar.MINUTE, Integer.parseInt(new SimpleDateFormat("mm").format(dateHourAndMin)));
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
}
/**
* @Description: 增减(日)
* @Author: hgw
......
......@@ -123,7 +123,7 @@
fd_3b573843db30ce
from ekp_79c234bf64d412294f23
where fd_3b62f3470beb30 = '1302010109024596014'
and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(fd_3aa4531d3b86e0, '%Y-%m-%d')
and DATE_FORMAT(fd_3aa4531d3b86e0, '%Y-%m-%d') between DATE_SUB(curdate(), INTERVAL 1 day) and DATE_ADD(now(), INTERVAL 1 day)
and fd_3b57f8de9df354 = '是'
</select>
</mapper>
......@@ -1855,7 +1855,7 @@
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
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
order by a.POLICY_END asc
</select>
<select id="pageDiyHistory" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.TBusinessInsuranceVo">
......@@ -1928,7 +1928,7 @@
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
<include refid="expire_sql_where"/>
order by a.CREATE_TIME desc
order by a.POLICY_END asc
<if test="param != null and param.limitStart != null">
limit #{param.limitStart},#{param.limitEnd}
</if>
......@@ -1944,11 +1944,10 @@
LEFT JOIN t_insurance_refund rf on rf.INS_DETAIL_ID=a.id
<include refid="expire_sql_where"/>
group by a.id
order by a.CREATE_TIME desc
order by a.POLICY_END asc
<if test="param != null and param.limitStart != null">
limit #{param.limitStart},#{param.limitEnd}
</if>
</select>
<select id="noPageCountDiy" resultType="java.lang.Integer">
select
......
/*
* 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 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 org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Data
@TableName("t_social_soldier_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化日志")
public class TSocialSoldierLog extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 社保ID
*/
@ExcelAttribute(name = "社保ID", maxLength = 32)
@Length(max = 32, message = "社保ID不能超过32个字符")
@ExcelProperty("社保ID")
@Schema(description = "社保ID")
private String socialId;
/**
* 推送的任务ID
*/
@ExcelAttribute(name = "推送的任务ID", maxLength = 32)
@Length(max = 32, message = "推送的任务ID不能超过32个字符")
@ExcelProperty("推送的任务ID")
@Schema(description = "推送的任务ID")
private String addId;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 20)
@NotBlank(message = "身份证号不能为空")
@Length(max = 20, message = "身份证号不能超过20个字符")
@ExcelProperty("身份证号")
@Schema(description = "身份证号")
private String empIdcard;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Length(max = 20, message = "员工姓名不能超过20个字符")
@ExcelProperty("员工姓名")
@Schema(description = "员工姓名")
private String empName;
/**
* 派单项:社保;医保
*/
@ExcelAttribute(name = "派单项:社保;医保", maxLength = 2)
@Length(max = 2, message = "派单项:社保;医保不能超过2个字符")
@ExcelProperty("派单项:社保;医保")
@Schema(description = "派单项:社保;医保")
private String dispatchItem;
@ExcelAttribute(name = "社保户", maxLength = 50)
@Length(max = 2, message = "社保户不能超过50个字符")
@ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialHuName;
/**
* 类型:提交;审核
*/
@ExcelAttribute(name = "类型:提交;审核", maxLength = 2)
@Length(max = 2, message = "类型:提交;审核不能超过2个字符")
@ExcelProperty("类型:提交;审核")
@Schema(description = "类型:提交;审核")
private String type;
/**
* 结果
*/
@ExcelAttribute(name = "结果", maxLength = 50)
@Length(max = 50, message = "结果不能超过50个字符")
@ExcelProperty("结果")
@Schema(description = "结果")
private String remark;
}
......@@ -84,7 +84,7 @@ public class SocialSoldierYgsAddVo implements Serializable {
private String socialTown;
@ExcelProperty("养老起缴日期")
private String pensionStart;
;
@ExcelProperty("养老基数")
private BigDecimal unitPensionCardinal;
@ExcelProperty("医疗起缴日期")
......
......@@ -16,7 +16,11 @@ public class SocialSoldierYgsAuditVo implements Serializable {
// 社保id,用于回写
@ExcelIgnore
private String socialId;
private String socialId;// 社保id,用于回写
@ExcelIgnore
private String empName;
@ExcelIgnore
private String empIdcard;
// #企业名称 业务类型 开始日期 结束日期 回传信息 回传信息1 回传信息2
@ExcelProperty("企业名称")
private String socialHouseholdName;
......
......@@ -17,6 +17,10 @@ public class SocialSoldierYsdAuditVo implements Serializable {
// 社保id,用于回写
@ExcelIgnore
private String socialId;
@ExcelIgnore
private String empName;
@ExcelIgnore
private String empIdcard;
// #企业名称 业务类型 申办日期起 申办日期止 回传信息 回传信息1 回传信息2
@ExcelProperty("企业名称")
private String socialHouseholdName;
......
/*
* 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 lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Data
public class TSocialSoldierLogExportVo implements Serializable {
@ExcelProperty("员工姓名")
private String empName;
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelProperty("日期")
private LocalDateTime createTime;
@ExcelProperty("派单项")
private String dispatchItem;
@ExcelProperty("社保户")
private String socialHuName;
@ExcelProperty("类型")
private String type;
@ExcelProperty("结果")
private String remark;
}
/*
* 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.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Data
public class TSocialSoldierLogSearchVo extends TSocialSoldierLog {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间起")
private LocalDateTime createTimeStart;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间止")
private LocalDateTime createTimeEnd;
/**
* @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.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.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialsoldierlog")
@Tag(name = "自动化日志管理")
public class TSocialSoldierLogController {
private final TSocialSoldierLogService tSocialSoldierLogService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tSocialSoldierLog 自动化日志
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSocialSoldierLog>> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog) {
return new R<>(tSocialSoldierLogService.getTSocialSoldierLogPage(page, tSocialSoldierLog));
}
/**
* 不分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<TSocialSoldierLog>> getTSocialSoldierLogNoPage(@RequestBody TSocialSoldierLogSearchVo tSocialSoldierLog) {
return R.ok(tSocialSoldierLogService.noPageDiy(tSocialSoldierLog));
}
/**
* 通过id查询自动化日志
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tsocialsoldierlog_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_get')")
public R<TSocialSoldierLog> getById(@PathVariable("id") String id) {
return R.ok(tSocialSoldierLogService.getById(id));
}
/**
* 新增自动化日志
*
* @param tSocialSoldierLog 自动化日志
* @return R
*/
@Operation(summary = "新增自动化日志", description = "新增自动化日志:hasPermission('social_tsocialsoldierlog_add')")
@SysLog("新增自动化日志")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_add')")
public R<Boolean> save(@RequestBody TSocialSoldierLog tSocialSoldierLog) {
return R.ok(tSocialSoldierLogService.save(tSocialSoldierLog));
}
/**
* 修改自动化日志
*
* @param tSocialSoldierLog 自动化日志
* @return R
*/
@Operation(summary = "修改自动化日志", description = "修改自动化日志:hasPermission('social_tsocialsoldierlog_edit')")
@SysLog("修改自动化日志")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_edit')")
public R<Boolean> updateById(@RequestBody TSocialSoldierLog tSocialSoldierLog) {
return R.ok(tSocialSoldierLogService.updateById(tSocialSoldierLog));
}
/**
* 通过id删除自动化日志
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除自动化日志", description = "通过id删除自动化日志:hasPermission('social_tsocialsoldierlog_del')")
@SysLog("通过id删除自动化日志")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialSoldierLogService.removeById(id));
}
/**
* 自动化日志 批量导出
*
* @author hgw
* @date 2024-08-30 10:27:16
**/
@Operation(description = "导出自动化日志 hasPermission('social_tsocialsoldierlog_export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_export')")
public void export(HttpServletResponse response, @RequestBody TSocialSoldierLogSearchVo searchVo) {
tSocialSoldierLogService.listExport(response, 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.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.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Mapper
public interface TSocialSoldierLogMapper extends BaseMapper<TSocialSoldierLog> {
/**
* 自动化日志简单分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, @Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog);
List<TSocialSoldierLogExportVo> getTSocialSoldierLogList(@Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog);
}
......@@ -72,6 +72,18 @@ public interface TSocialSoldierMapper extends BaseMapper<TSocialInfo> {
* @Date 2024-5-24 16:39:43
**/
List<SocialSoldierYsdAuditVo> getSocialSoldierYsdAuditVoList();
/**
* 社保士兵养工失审核模板——推送给社保士兵的归总模板
* @Author hgw
* @Date 2024-9-2 18:03:04
**/
List<SocialSoldierYgsAuditVo> getSocialSoldierYgsAuditVoListByGroupBy();
/**
* 社保士兵医生大审核续保模板——推送给社保士兵的归总模板
* @Author hgw
* @Date 2024-9-2 18:03:07
**/
List<SocialSoldierYsdAuditVo> getSocialSoldierYsdAuditVoListByGroupBy();
/**
* 社保士兵医生大审核新增模板
* @Author hgw
......@@ -86,6 +98,13 @@ public interface TSocialSoldierMapper extends BaseMapper<TSocialInfo> {
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo>
**/
List<SocialSoldierSalaryShenBaoVo> getSoldierSalaryByShenBaoList();
/**
* 社保士兵医生大审核新增模板
* @Author hgw
* @Date 2024-5-24 16:39:43
**/
List<SocialSoldierYsdAuditVo> getSocialSoldierYsdAddAuditVoListByGroupBy();
/**
* @Description: 工资调整
* @Author: hgw
......
......@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialDeadlineInfoSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
/**
* 社保医疗截止日配置
......@@ -55,4 +56,13 @@ public interface TSocialDeadlineInfoService extends IService<TSocialDeadlineInfo
R<Boolean> updateByIdAsso(TSocialDeadlineInfo tSocialDeadlineInfo);
R<Boolean> saveAsso(TSocialDeadlineInfo tSocialDeadlineInfo);
/**
* @Description: 获取 当月启用 的配置
* @Author: hgw
* @Date: 2024/9/2 15:26
* @return: java.util.Map<java.lang.String, com.yifu.cloud.plus.v1.yifu.social.entity.TSocialDeadlineInfo>
**/
Map<String, TSocialDeadlineInfo> getSocialSet();
}
/*
* 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
public interface TSocialSoldierLogService extends IService<TSocialSoldierLog> {
/**
* 自动化日志简单分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog);
void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo);
List<TSocialSoldierLog> noPageDiy(TSocialSoldierLogSearchVo searchVo);
/**
* @param vo 社保模板
* @param type 类型
* @param remark 备注结果
* @Description: 社保提交日志
* @Author: hgw
* @Date: 2024/9/2 16:33
* @return: void
**/
TSocialSoldierLog getYgsSoldierLog(SocialSoldierYgsAddVo vo, String type, String remark);
// 医保提交日志
TSocialSoldierLog getYsdSoldierLog(SocialSoldierYsdAddVo vo, String type, String remark);
// 审核社保提交日志
TSocialSoldierLog getYgsSoldierAuditLog(SocialSoldierYgsAuditVo vo, String type, String remark);
// 审核医保提交日志
TSocialSoldierLog getYsdSoldierAuditLog(SocialSoldierYsdAuditVo vo, String type, String remark);
// 拉取提交结果日志 dispatchItem 社保、医保
TSocialSoldierLog getSocialSoldierLog(TSocialInfo social, String type, String dispatchItem, String remark);
}
......@@ -27,7 +27,6 @@ import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -35,7 +34,6 @@ 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.util.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialDeadlineInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.THolidayInfoMapper;
......@@ -44,9 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TSocialDeadlineInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialDeadlineInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialDeadlineInfoVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.log4j.Log4j2;
import org.aspectj.weaver.patterns.ConcreteCflowPointcut;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -275,7 +271,7 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
.eq(TSocialDeadlineInfo::getStatus,CommonConstants.ZERO_STRING)
.eq(TSocialDeadlineInfo::getType,CommonConstants.ONE_STRING));
if (Common.isNotNull(baseLists)){
List<TSocialDeadlineInfo> saveList = new ArrayList<>();;
List<TSocialDeadlineInfo> saveList = new ArrayList<>();
//获取当前月份所有假期配置表
Date date = new Date();
List<THolidayInfo> holidayInfos = holidayInfoMapper.selectList(Wrappers.<THolidayInfo>query().lambda()
......@@ -289,10 +285,6 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
}
TSocialDeadlineInfo save;
LambdaQueryWrapper<TSocialDeadlineInfo> queryWrapper;
int medicalDay;
int socialDay;
int curlDay;
int setDay;
for (TSocialDeadlineInfo sd:baseLists){
queryWrapper= null;
save = new TSocialDeadlineInfo();
......@@ -300,22 +292,22 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
save.setId(null);
save.setMonth(Integer.parseInt(DateUtil.getThisMonth()));
save.setType(CommonConstants.ZERO_STRING);
//如果月份超出当前月 大概率是 日设置有问题这里做个优化
setDay = DateUtil.getDays(save.getMedicalEndDate());
curlDay = DateUtil.getLastDayOfDate(new Date());
if (setDay > curlDay){
medicalDay = curlDay;
}else {
medicalDay=setDay;
// 初始化 月日时分
if (Common.isNotNull(save.getMedicalStartDate())) {
save.setMedicalStartDate(this.getNewDateByOldDate(save.getMedicalStartDate()));
}
save.setMedicalEndDate(DateUtil.getDayOfThisMonth(medicalDay));
setDay = DateUtil.getDays(save.getSocialEndDate());
if (setDay > curlDay){
socialDay = curlDay;
}else {
socialDay=setDay;
if (Common.isNotNull(save.getMedicalEndDate())) {
save.setMedicalEndDate(this.getNewDateByOldDate(save.getMedicalEndDate()));
}
save.setSocialEndDate(DateUtil.getDayOfThisMonth(socialDay));
if (Common.isNotNull(save.getSocialStartDate())) {
save.setSocialStartDate(this.getNewDateByOldDate(save.getSocialStartDate()));
}
if (Common.isNotNull(save.getSocialEndDate())) {
save.setSocialEndDate(this.getNewDateByOldDate(save.getSocialEndDate()));
}
initSocialEndDate(holidayMap, save);
initMedicalEndDate(holidayMap, save);
save.setUpdateTime(null);
......@@ -333,6 +325,17 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
}
}
/**
* @param oldDate 原先的时间
* @Description: 传入老时间,返回新时间,将 月日时分 替换为新的,超过下个月的,返回当前时间
* @Author: hgw
* @Date: 2024/9/2 11:15
* @return: java.util.Date
**/
private Date getNewDateByOldDate(Date oldDate) {
return DateUtil.getDayOfThisMonthByHourAndMin(Math.min(DateUtil.getDays(oldDate), DateUtil.getLastDayOfDate(new Date())), oldDate);
}
private LambdaQueryWrapper<TSocialDeadlineInfo> initCountQuery(TSocialDeadlineInfo save,LambdaQueryWrapper<TSocialDeadlineInfo> queryWrapper) {
queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(TSocialDeadlineInfo::getMonth, save.getMonth());
......@@ -454,4 +457,41 @@ public class TSocialDeadlineInfoServiceImpl extends ServiceImpl<TSocialDeadlineI
}
initSocialEndDate(holidayMap,save);
}
/**
* @Description: 获取 当月启用 的配置
* @Author: hgw
* @Date: 2024/9/2 15:25
* @return: java.util.Map<java.lang.String, com.yifu.cloud.plus.v1.yifu.social.entity.TSocialDeadlineInfo>
**/
@Override
public Map<String, TSocialDeadlineInfo> getSocialSet() {
Map<String, TSocialDeadlineInfo> setMap = new HashMap<>();
List<TSocialDeadlineInfo> setlist = baseMapper.selectList(Wrappers.<TSocialDeadlineInfo>query().lambda()
.eq(TSocialDeadlineInfo::getMonth, DateUtil.getThisMonth())
.eq(TSocialDeadlineInfo::getStatus, CommonConstants.ZERO_STRING));
if (setlist != null && !setlist.isEmpty()) {
StringBuilder addressKey;
ExcelUtil<TSocialDeadlineInfo> util = new ExcelUtil<>(TSocialDeadlineInfo.class);
for (TSocialDeadlineInfo socialSet : setlist) {
if (Common.isNotNull(socialSet.getProvince())) {
util.convertEntity(socialSet, null, null, null);
addressKey = new StringBuilder(socialSet.getProvince()).append(CommonConstants.DOWN_LINE_STRING);
if (Common.isEmpty(socialSet.getCity())) {
addressKey.append(CommonConstants.CENTER_SPLIT_LINE_STRING);
} else {
addressKey.append(socialSet.getCity());
}
addressKey.append(CommonConstants.DOWN_LINE_STRING);
if (Common.isEmpty(socialSet.getTown())) {
addressKey.append(CommonConstants.CENTER_SPLIT_LINE_STRING);
} else {
addressKey.append(socialSet.getTown());
}
setMap.put(addressKey.toString(), socialSet);
}
}
}
return setMap;
}
}
/*
* 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 cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierLogMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 自动化日志
*
* @author hgw
* @date 2024-08-30 10:27:16
*/
@Log4j2
@Service
public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogMapper, TSocialSoldierLog> implements TSocialSoldierLogService {
/**
* 自动化日志简单分页查询
*
* @param tSocialSoldierLog 自动化日志
* @return
*/
@Override
public IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, TSocialSoldierLogSearchVo tSocialSoldierLog) {
return baseMapper.getTSocialSoldierLogPage(page, tSocialSoldierLog);
}
/**
* 自动化日志批量导出
*
* @return
*/
@Override
public void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo) {
String fileName = "自动化日志批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSocialSoldierLogExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcelFactory.write(out, TSocialSoldierLogExportVo.class).build();
int index = 0;
WriteSheet writeSheet;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getTSocialSoldierLogList(searchVo);
if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("自动化日志" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
writeSheet = EasyExcelFactory.writerSheet("自动化日志" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public List<TSocialSoldierLog> noPageDiy(TSocialSoldierLogSearchVo searchVo) {
LambdaQueryWrapper<TSocialSoldierLog> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TSocialSoldierLog::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
@Override
public TSocialSoldierLog getYgsSoldierLog(SocialSoldierYgsAddVo vo, String type, String remark) {
TSocialSoldierLog log = new TSocialSoldierLog();
log.setSocialId(vo.getSocialId());
log.setEmpName(vo.getEmpName());
log.setEmpIdcard(vo.getEmpIdcard());
log.setDispatchItem("社保");
log.setSocialHuName(vo.getSocialHouseholdName());
// type 类型:提交;审核
log.setType(type);
log.setRemark(remark);
return log;
}
@Override
public TSocialSoldierLog getYsdSoldierLog(SocialSoldierYsdAddVo vo, String type, String remark) {
TSocialSoldierLog log = new TSocialSoldierLog();
log.setSocialId(vo.getSocialId());
log.setEmpName(vo.getEmpName());
log.setEmpIdcard(vo.getEmpIdcard());
log.setDispatchItem("医保");
log.setSocialHuName(vo.getSocialHouseholdName());
// type 类型:提交;审核
log.setType(type);
log.setRemark(remark);
return log;
}
@Override
public TSocialSoldierLog getYgsSoldierAuditLog(SocialSoldierYgsAuditVo vo, String type, String remark) {
TSocialSoldierLog log = new TSocialSoldierLog();
log.setSocialId(vo.getSocialId());
log.setEmpName(vo.getEmpName());
log.setEmpIdcard(vo.getEmpIdcard());
log.setDispatchItem("社保");
log.setSocialHuName(vo.getSocialHouseholdName());
// type 类型:提交;审核
log.setType(type);
log.setRemark(remark);
return log;
}
@Override
public TSocialSoldierLog getYsdSoldierAuditLog(SocialSoldierYsdAuditVo vo, String type, String remark) {
TSocialSoldierLog log = new TSocialSoldierLog();
log.setSocialId(vo.getSocialId());
log.setEmpName(vo.getEmpName());
log.setEmpIdcard(vo.getEmpIdcard());
log.setDispatchItem("医保");
log.setSocialHuName(vo.getSocialHouseholdName());
// type 类型:提交;审核
log.setType(type);
log.setRemark(remark);
return log;
}
@Override
public TSocialSoldierLog getSocialSoldierLog(TSocialInfo social, String type, String dispatchItem, String remark) {
TSocialSoldierLog log = new TSocialSoldierLog();
log.setSocialId(social.getId());
log.setEmpName(social.getEmpName());
log.setEmpIdcard(social.getEmpIdcard());
log.setDispatchItem(dispatchItem);
log.setSocialHuName(social.getSocialHouseholdName());
// type 类型:提交;审核
log.setType(type);
log.setRemark(remark);
return log;
}
private Long noPageCountDiy(TSocialSoldierLogSearchVo searchVo) {
LambdaQueryWrapper<TSocialSoldierLog> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TSocialSoldierLog::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TSocialSoldierLogSearchVo entity) {
LambdaQueryWrapper<TSocialSoldierLog> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimeStart())) {
wrapper.ge(TSocialSoldierLog::getCreateTime, entity.getCreateTimeStart());
}
if (ArrayUtil.isNotEmpty(entity.getCreateTimeEnd())) {
wrapper.le(TSocialSoldierLog::getCreateTime, entity.getCreateTimeEnd());
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TSocialSoldierLog::getCreateName, entity.getCreateName());
}
return wrapper;
}
}
......@@ -25,7 +25,9 @@ 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.R;
import com.yifu.cloud.plus.v1.yifu.social.config.SocialConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialDeadlineInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierShenBaoTask;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialSoldierMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.*;
......@@ -42,7 +44,10 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 社保士兵-推送
......@@ -62,6 +67,8 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
private final TAutoPaymentInfoService tAutoPaymentInfoService;
private final TAutoPaymentErrorService tAutoPaymentErrorService;
private final TAutoPaymentDetailService tAutoPaymentDetailService;
private final TSocialDeadlineInfoService tSocialDeadlineInfoService;
private final TSocialSoldierLogService tSocialSoldierLogService;
/**
* @param socialList
......@@ -117,6 +124,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
return null;
}
/**
* @Description: 组装社保与医保的文件流
* @Author: hgw
......@@ -162,68 +170,32 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
**/
@Override
public R<String> pushSoldier(List<String> dispatchIdList) {
log.info("dispatchIdList="+dispatchIdList);
log.info("dispatchIdList=" + dispatchIdList);
// 获取时间限制配置(获取 当月启用 的配置)
Map<String, TSocialDeadlineInfo> socialsetMap = tSocialDeadlineInfoService.getSocialSet();
// 社保增员、社保减员、医保增员、医保减员
// 养工失新增列表
List<SocialSoldierYgsAddVo> ygsAddlist = baseMapper.getSocialSoldierYgsAddVoList(dispatchIdList);
log.info("ygsAddlist="+ygsAddlist);
if (ygsAddlist != null && !ygsAddlist.isEmpty()) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYgsAddVo vo : ygsAddlist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFileYgs(ygsAddlist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "社保增员");
}
this.doPushSocialAndLogYgs(socialsetMap, ygsAddlist, "社保增员");
}
// 养工失减少列表
List<SocialSoldierYgsAddVo> ygsReducelist = baseMapper.getSocialSoldierYgsReduceVoList(dispatchIdList);
if (ygsReducelist != null && !ygsReducelist.isEmpty()) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYgsAddVo vo : ygsReducelist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFileYgs(ygsReducelist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "社保减员");
}
this.doPushSocialAndLogYgs(socialsetMap, ygsReducelist, "社保减员");
}
// 医生大新增列表
List<SocialSoldierYsdAddVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddVoList(dispatchIdList);
if (ysdAddlist != null && !ysdAddlist.isEmpty()) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYsdAddVo vo : ysdAddlist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFileYsd(ysdAddlist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "医保增员");
}
this.doPushSocialAndLogYsd(socialsetMap, ysdAddlist, "医保增员");
}
// 医生大减少列表
List<SocialSoldierYsdAddVo> ysdReducelist = baseMapper.getSocialSoldierYsdReduceVoList(dispatchIdList);
if (ysdReducelist != null && !ysdReducelist.isEmpty()) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
for (SocialSoldierYsdAddVo vo : ysdReducelist) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
}
MultipartFile file = this.getFileYsd(ysdReducelist);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, "医保减员");
}
this.doPushSocialAndLogYsd(socialsetMap, ysdReducelist, "医保减员");
}
if ((ygsAddlist == null || ygsAddlist.isEmpty())
&& (ygsReducelist == null || ygsReducelist.isEmpty())
......@@ -235,6 +207,248 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
return R.ok("推送成功!!");
}
/**
* @Description: 推送社保和记录日志
* @Author: hgw
* @Date: 2024/9/2 17:21
* @return: void
**/
private void doPushSocialAndLogYgs(Map<String, TSocialDeadlineInfo> socialsetMap
, List<SocialSoldierYgsAddVo> ygsAddlist, String socialType) {
List<TSocialInfo> socialIdList = new ArrayList<>();
int canPushType;
TSocialInfo socialInfo;
List<SocialSoldierYgsAddVo> ygsAddlistCopy = new ArrayList<>();
String type = "提交";
List<TSocialSoldierLog> logList = new ArrayList<>();
TSocialSoldierLog socialLog;
String remark;
List<TSocialInfo> renGongList = new ArrayList<>();
for (SocialSoldierYgsAddVo vo : ygsAddlist) {
// 0:未到时间不动; 1:推送; 2:转人工
canPushType = this.getCanPushType(socialsetMap, vo);
if (1 == canPushType) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
ygsAddlistCopy.add(vo);
remark = "提交成功!";
} else {
ygsAddlist.remove(vo);
if (0 == canPushType) {
remark = "未到时间,不推送!";
} else {
remark = "无时间配置或超出办理截止时间,转人工!";
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING);
renGongList.add(socialInfo);
}
}
socialLog = tSocialSoldierLogService.getYgsSoldierLog(vo, type, remark);
if (socialLog != null) {
logList.add(socialLog);
}
}
if (!renGongList.isEmpty()) {
tSocialInfoService.updateBatchById(renGongList);
}
if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList);
}
// 3如果没有要办理的数据,就不需要推送
if (!socialIdList.isEmpty()) {
try {
MultipartFile file = this.getFileYgs(ygsAddlistCopy);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, socialType);
}
} catch (Exception e) {
if (!logList.isEmpty()) {
for (TSocialSoldierLog logTemp : logList) {
logTemp.setRemark("提交社保士兵异常!");
}
tSocialSoldierLogService.updateBatchById(logList);
}
}
}
}
/**
* @Description: 推送医保和记录日志
* @Author: hgw
* @Date: 2024/9/2 17:21
* @return: void
**/
private void doPushSocialAndLogYsd(Map<String, TSocialDeadlineInfo> socialsetMap
, List<SocialSoldierYsdAddVo> ysdAddlist, String socialType) {
List<TSocialInfo> socialIdList = new ArrayList<>();
int canPushType;
TSocialInfo socialInfo;
List<SocialSoldierYsdAddVo> ysdAddlistCopy = new ArrayList<>();
String type = "提交";
List<TSocialSoldierLog> logList = new ArrayList<>();
TSocialSoldierLog socialLog;
List<TSocialInfo> renGongList = new ArrayList<>();
String remark;
for (SocialSoldierYsdAddVo vo : ysdAddlist) {
// 0:未到时间不动; 1:推送; 2:转人工
canPushType = this.getCanPushTypeYsd(socialsetMap, vo);
if (1 == canPushType) {
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
ysdAddlistCopy.add(vo);
remark = "提交成功!";
} else {
ysdAddlist.remove(vo);
if (0 == canPushType) {
remark = "未到时间,不推送!";
} else {
remark = "无时间配置或超出办理截止时间,转人工!";
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING);
renGongList.add(socialInfo);
}
}
socialLog = tSocialSoldierLogService.getYsdSoldierLog(vo, type, remark);
if (socialLog != null) {
logList.add(socialLog);
}
}
if (!renGongList.isEmpty()) {
tSocialInfoService.updateBatchById(renGongList);
}
if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList);
}
// 3如果没有要办理的数据,就不需要推送
if (!socialIdList.isEmpty()) {
try {
MultipartFile file = this.getFileYsd(ysdAddlistCopy);
if (Common.isNotNull(file)) {
this.getOneAppGetModuleDetail(socialIdList, file, socialType);
}
} catch (Exception e) {
if (!logList.isEmpty()) {
for (TSocialSoldierLog logTemp : logList) {
logTemp.setRemark("提交社保士兵异常!");
}
tSocialSoldierLogService.updateBatchById(logList);
}
}
}
}
/**
* @param socialsetMap 时间限制配置Map
* @param vo 社保或医保
* @Description:
* @Author: hgw
* @Date: 2024/9/2 16:00
* @return: int
**/
private int getCanPushType(Map<String, TSocialDeadlineInfo> socialsetMap, SocialSoldierYgsAddVo vo) {
// 0:未到时间不动; 1:推送; 2:转人工
int canPushType = 0;
if (socialsetMap != null) {
TSocialDeadlineInfo socialSet;
StringBuilder addressKey;
Date nowTime = new Date();
if (Common.isNotNull(vo.getSocialProvince())) {
addressKey = new StringBuilder(vo.getSocialProvince()).append(CommonConstants.DOWN_LINE_STRING);
if (Common.isEmpty(vo.getSocialCity())) {
addressKey.append(CommonConstants.CENTER_SPLIT_LINE_STRING);
} else {
addressKey.append(vo.getSocialCity());
}
addressKey.append(CommonConstants.DOWN_LINE_STRING);
if (Common.isEmpty(vo.getSocialTown())) {
addressKey.append(CommonConstants.CENTER_SPLIT_LINE_STRING);
} else {
addressKey.append(vo.getSocialTown());
}
socialSet = socialsetMap.get(addressKey.toString());
if (socialSet != null) {
Date start = socialSet.getSocialStartDate();
Date end = socialSet.getSocialEndDate();
if (Common.isNotNull(start) && Common.isNotNull(end)) {
if (nowTime.before(start)) {
canPushType = 0;
} else if (nowTime.after(end)) {
canPushType = 2;
} else {
canPushType = 1;
}
} else {
// 无配置或配置时间为空
canPushType = 2;
}
} else {
// 无配置或配置时间为空
canPushType = 2;
}
}
} else {
// 2无时间限制的转人工
canPushType = 2;
}
return canPushType;
}
private int getCanPushTypeYsd(Map<String, TSocialDeadlineInfo> socialsetMap, SocialSoldierYsdAddVo vo) {
// 0:未到时间不动; 1:推送; 2:转人工
int canPushType = 0;
if (socialsetMap != null) {
TSocialDeadlineInfo socialSet;
StringBuilder addressKey;
Date nowTime = new Date();
if (Common.isNotNull(vo.getSocialProvince())) {
addressKey = new StringBuilder(vo.getSocialProvince()).append(CommonConstants.DOWN_LINE_STRING);
if (Common.isEmpty(vo.getSocialCity())) {
addressKey.append(CommonConstants.CENTER_SPLIT_LINE_STRING);
} else {
addressKey.append(vo.getSocialCity());
}
addressKey.append(CommonConstants.DOWN_LINE_STRING);
if (Common.isEmpty(vo.getSocialTown())) {
addressKey.append(CommonConstants.CENTER_SPLIT_LINE_STRING);
} else {
addressKey.append(vo.getSocialTown());
}
socialSet = socialsetMap.get(addressKey.toString());
if (socialSet != null) {
Date start = socialSet.getMedicalStartDate();
Date end = socialSet.getMedicalEndDate();
if (Common.isNotNull(start) && Common.isNotNull(end)) {
if (nowTime.before(start)) {
canPushType = 0;
} else if (nowTime.after(end)) {
canPushType = 2;
} else {
canPushType = 1;
}
} else {
// 无配置或配置时间为空
canPushType = 2;
}
} else {
// 无配置或配置时间为空
canPushType = 2;
}
}
} else {
// 2无时间限制的转人工
canPushType = 2;
}
return canPushType;
}
/**
* @Description: 推送社保士兵审核结果查询文件
* @Author: hgw
......@@ -245,10 +459,15 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
public R<String> pushSoldierByAudit() {
// 养工失待审核列表
List<SocialSoldierYgsAuditVo> ygsAddlist = baseMapper.getSocialSoldierYgsAuditVoList();
log.info("养工失待审核列表="+ygsAddlist);
List<SocialSoldierYgsAuditVo> ygsAddByGroupBylist = baseMapper.getSocialSoldierYgsAuditVoListByGroupBy();
String sheetName = "审核数据查询";
String type = "审核";
String remark = "推送审核成功!";
String errorRemark = "推送社保士兵审核异常!";
TSocialSoldierLog socialLog;
List<TSocialSoldierLog> logList = new ArrayList<>();
if (ygsAddlist != null && !ygsAddlist.isEmpty()) {
MultipartFile file = this.getFileByAudit(ygsAddlist, null, sheetName);
MultipartFile file = this.getFileByAudit(ygsAddByGroupBylist, null, sheetName);
if (Common.isNotNull(file)) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
......@@ -256,16 +475,37 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
// 组装日志
socialLog = tSocialSoldierLogService.getYgsSoldierAuditLog(vo, type, remark);
if (socialLog != null) {
logList.add(socialLog);
}
}
// 保存
if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList);
}
try {
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
} catch (Exception e) {
if (!logList.isEmpty()) {
// 异常时,更新日志
for (TSocialSoldierLog logTemp : logList) {
logTemp.setRemark(errorRemark);
}
tSocialSoldierLogService.updateBatchById(logList);
}
}
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
}
}
// 医生大【续保】待审核列表
List<SocialSoldierYsdAuditVo> ysdXuBaolist = baseMapper.getSocialSoldierYsdAuditVoList();
log.info("医生大【续保】待审核列表="+ysdXuBaolist);
List<SocialSoldierYsdAuditVo> ysdXuBaoByGroupBylist = baseMapper.getSocialSoldierYsdAuditVoListByGroupBy();
sheetName = "审核数据信息查询";
logList = new ArrayList<>();
if (ysdXuBaolist != null && !ysdXuBaolist.isEmpty()) {
MultipartFile file = this.getFileByAudit(null, ysdXuBaolist, sheetName);
MultipartFile file = this.getFileByAudit(null, ysdXuBaoByGroupBylist, sheetName);
if (Common.isNotNull(file)) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
......@@ -273,15 +513,37 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
// 组装日志
socialLog = tSocialSoldierLogService.getYsdSoldierAuditLog(vo, type, remark);
if (socialLog != null) {
logList.add(socialLog);
}
}
// 保存
if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList);
}
try {
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
} catch (Exception e) {
if (!logList.isEmpty()) {
// 异常时,更新日志
for (TSocialSoldierLog logTemp : logList) {
logTemp.setRemark(errorRemark);
}
tSocialSoldierLogService.updateBatchById(logList);
}
}
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
}
}
// 医生大【新增】待审核列表
List<SocialSoldierYsdAuditVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddAuditVoList();
log.info("医生大【新增】待审核列表="+ysdAddlist);
List<SocialSoldierYsdAuditVo> ysdAddByGroupBylist = baseMapper.getSocialSoldierYsdAddAuditVoListByGroupBy();
logList = new ArrayList<>();
if (ysdAddlist != null && !ysdAddlist.isEmpty()) {
MultipartFile file = this.getFileByAudit(null, ysdAddlist, sheetName);
MultipartFile file = this.getFileByAudit(null, ysdAddByGroupBylist, sheetName);
if (Common.isNotNull(file)) {
List<TSocialInfo> socialIdList = new ArrayList<>();
TSocialInfo socialInfo;
......@@ -289,8 +551,29 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId());
socialIdList.add(socialInfo);
// 组装日志
socialLog = tSocialSoldierLogService.getYsdSoldierAuditLog(vo, type, remark);
if (socialLog != null) {
logList.add(socialLog);
}
}
// 保存
if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList);
}
try {
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
} catch (Exception e) {
if (!logList.isEmpty()) {
// 异常时,更新日志
for (TSocialSoldierLog logTemp : logList) {
logTemp.setRemark(errorRemark);
}
tSocialSoldierLogService.updateBatchById(logList);
}
}
this.getOneAppGetModuleDetailByAudit(socialIdList, file, sheetName);
}
}
if (ygsAddlist == null && ysdXuBaolist == null && ysdAddlist == null) {
......@@ -322,6 +605,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
return R.ok("推送成功!");
}
/**
* @Description: 推送审核结果的查询
* @Author: hgw
......@@ -395,7 +679,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
public R<String> pushSalaryByShenBao() {
// 工资申报
List<SocialSoldierSalaryShenBaoVo> shenBaolist = baseMapper.getSoldierSalaryByShenBaoList();
log.info("工资申报列表="+shenBaolist);
log.info("工资申报列表=" + shenBaolist);
String sheetName = "年度缴费工资申报";
if (shenBaolist != null && !shenBaolist.isEmpty()) {
MultipartFile file = this.getFile(shenBaolist, SocialSoldierSalaryShenBaoVo.class, sheetName);
......@@ -408,7 +692,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
// 工资调整
List<SocialSoldierSalaryTiaoZhengVo> tiaoZhenglist = baseMapper.getSoldierSalaryByTiaoZhengList();
log.info("工资调整列表="+tiaoZhenglist);
log.info("工资调整列表=" + tiaoZhenglist);
sheetName = "年度缴费工资调整";
if (tiaoZhenglist != null && !tiaoZhenglist.isEmpty()) {
MultipartFile file = this.getFile(tiaoZhenglist, SocialSoldierSalaryTiaoZhengVo.class, sheetName);
......@@ -424,6 +708,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
return R.ok("推送成功!!");
}
/**
* @param : isReHandle true:是重新办理
* @Description: 6每月6号推送实缴3张表查询
......@@ -472,7 +757,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
// 实缴3张表之1:日常申报
List<SocialSoldierPaymentSelectOneVo> shenBaolist = baseMapper.getSoldierPaymentSelectOneList();
log.info("实缴3张表之1:日常申报list="+shenBaolist);
log.info("实缴3张表之1:日常申报list=" + shenBaolist);
String sheetName = "日常申报导出";
if (shenBaolist != null && !shenBaolist.isEmpty()) {
MultipartFile file = this.getFile(shenBaolist, SocialSoldierPaymentSelectOneVo.class, sheetName);
......@@ -487,7 +772,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
// 实缴3张表之2:人员缴费明细打印
List<SocialSoldierPaymentSelectTwoVo> shenBaoTwolist = baseMapper.getSoldierPaymentSelectTwoList();
log.info("实缴3张表之2:单位个人缴费信息查询list="+shenBaoTwolist);
log.info("实缴3张表之2:单位个人缴费信息查询list=" + shenBaoTwolist);
sheetName = "单位个人缴费信息查询";
if (shenBaoTwolist != null && !shenBaoTwolist.isEmpty()) {
MultipartFile file = this.getFile(shenBaoTwolist, SocialSoldierPaymentSelectTwoVo.class, sheetName);
......@@ -502,7 +787,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
// 实缴3张表之3:单位缴费明细查询
List<SocialSoldierPaymentSelectThreeVo> shenBaoThreelist = baseMapper.getSoldierPaymentSelectThreeList();
log.info("实缴3张表之3:单位缴费明细查询list="+shenBaoThreelist);
log.info("实缴3张表之3:单位缴费明细查询list=" + shenBaoThreelist);
sheetName = "单位缴费明细查询";
if (shenBaoThreelist != null && !shenBaoThreelist.isEmpty()) {
MultipartFile file = this.getFile(shenBaoThreelist, SocialSoldierPaymentSelectThreeVo.class, sheetName);
......@@ -517,7 +802,7 @@ public class TSocialSoldierPushServiceImpl extends ServiceImpl<TSocialSoldierMap
}
// 实缴3张表之3-2:单位缴费明细下载
List<SocialSoldierPaymentSelectThreeVo> shenBaoFourlist = baseMapper.getSoldierPaymentSelectThreeList();
log.info("实缴3张表之3-2:单位缴费明细下载list="+shenBaoFourlist);
log.info("实缴3张表之3-2:单位缴费明细下载list=" + shenBaoFourlist);
sheetName = "单位缴费明细下载";
if (shenBaoFourlist != null && !shenBaoFourlist.isEmpty()) {
MultipartFile file = this.getFile(shenBaoFourlist, SocialSoldierPaymentSelectThreeVo.class, sheetName);
......
......@@ -82,6 +82,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
private final TAutoPaymentInfoService tAutoPaymentInfoService;
private final TAutoPaymentDetailService tAutoPaymentDetailService;
private final TAutoPaymentErrorService tAutoPaymentErrorService;
private final TSocialSoldierLogService tSocialSoldierLogService;
private final OSSUtil ossUtil;
// 附件
......@@ -1811,6 +1812,11 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
"1", authorities, "1",
null, null,
null);
// 记录日志
List<TSocialSoldierLog> logList = new ArrayList<>();
TSocialSoldierLog socialLog;
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
empIdCard = excel.getIdCard();
......@@ -1875,6 +1881,13 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial.setYgsHandleStatus(ygsHandleStatus);
updateSocialList.add(updateSocial);
socialMap.put(updateSocial.getId(), updateSocial);
// 拉取审核结果,加日志
if (Common.isNotNull(ygsHandleStatus)) {
socialLog = tSocialSoldierLogService.getSocialSoldierLog(socialInfo, "审核", "社保"
, getStatusName(Integer.parseInt(ygsHandleStatus)));
logList.add(socialLog);
}
} else if (!typeFlag && CommonConstants.SEVEN_STRING.equals(socialInfo.getYsdHandleStatus())) {
updateSocial = socialMap.get(socialInfo.getId());
if (updateSocial == null) {
......@@ -1927,6 +1940,13 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial.setYsdHandleStatus(ysdHandleStatus);
updateSocialList.add(updateSocial);
socialMap.put(updateSocial.getId(), updateSocial);
// 拉取审核结果,加日志
if (Common.isNotNull(ysdHandleStatus)) {
socialLog = tSocialSoldierLogService.getSocialSoldierLog(socialInfo, "审核", "医保"
, getStatusName(Integer.parseInt(ysdHandleStatus)));
logList.add(socialLog);
}
}
// 处理社保办理成功或失败,
if (!updateSocialList.isEmpty()) {
......@@ -1957,6 +1977,9 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}
}
if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList);
}
}
/**
......@@ -2006,11 +2029,15 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
"1", authorities, "1",
null, null,
null);
// 记录日志
List<TSocialSoldierLog> logList = new ArrayList<>();
TSocialSoldierLog socialLog;
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
if ("是".equals(excel.getIsDoCompleted())) {
// 插入
log.info(excel.getErrorInfo());
empIdCard = excel.getIdCard();
if (Common.isEmpty(empIdCard)) {
empIdCard = excel.getEmpIdCard();
......@@ -2028,6 +2055,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
(CommonConstants.ONE_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.TWO_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.THREE_STRING.equals(socialInfo.getYgsHandleStatus()))) {
updateSocial = socialMap.get(socialInfo.getId());
if (updateSocial == null) {
updateSocial = new TSocialInfo();
......@@ -2126,6 +2154,13 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial.setYgsHandleStatus(ygsHandleStatus);
updateSocialList.add(updateSocial);
socialMap.put(updateSocial.getId(), updateSocial);
// 拉取提交结果,加日志
if (Common.isNotNull(ygsHandleStatus)) {
socialLog = tSocialSoldierLogService.getSocialSoldierLog(socialInfo, "提交", "社保"
, getStatusName(Integer.parseInt(ygsHandleStatus)));
logList.add(socialLog);
}
} else if (!typeFlag &&
(CommonConstants.ONE_STRING.equals(socialInfo.getYsdHandleStatus())
|| CommonConstants.TWO_STRING.equals(socialInfo.getYsdHandleStatus())
......@@ -2231,6 +2266,13 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
updateSocial.setYsdHandleStatus(ysdHandleStatus);
updateSocialList.add(updateSocial);
socialMap.put(updateSocial.getId(), updateSocial);
// 拉取提交结果,加日志
if (Common.isNotNull(ysdHandleStatus)) {
socialLog = tSocialSoldierLogService.getSocialSoldierLog(socialInfo, "提交", "医保"
, getStatusName(Integer.parseInt(ysdHandleStatus)));
logList.add(socialLog);
}
}
// 处理社保办理成功或失败,
......@@ -2263,6 +2305,21 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}
}
if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList);
}
}
/**
* @param status
* @Description: 返回对应文字
* @Author: hgw
* @Date: 2024/9/2 19:38
* @return: java.lang.String
**/
private String getStatusName(int status) {
String[] arr = {"空","待办理","自动办理中","继续办理","终止办理","人工处理","成功","提交成功"};
return arr[status];
}
/**
......
<?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.TSocialSoldierLogMapper">
<resultMap id="tSocialSoldierLogMap" type="com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog">
<id property="id" column="ID"/>
<result property="addId" column="ADD_ID"/>
<result property="socialId" column="SOCIAL_ID"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empName" column="EMP_NAME"/>
<result property="dispatchItem" column="DISPATCH_ITEM"/>
<result property="socialHuName" column="SOCIAL_HU_NAME"/>
<result property="type" column="TYPE"/>
<result property="remark" column="REMARK"/>
<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"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.ADD_ID,
a.SOCIAL_ID,
a.EMP_IDCARD,
a.EMP_NAME,
a.DISPATCH_ITEM,
a.SOCIAL_HU_NAME,
a.TYPE,
a.REMARK,
a.CREATE_BY,
a.UPDATE_BY,
a.CREATE_NAME,
a.UPDATE_TIME,
a.CREATE_TIME
</sql>
<sql id="tSocialSoldierLog_where">
<if test="tSocialSoldierLog != null">
<if test="tSocialSoldierLog.id != null and tSocialSoldierLog.id.trim() != ''">
AND a.ID = #{tSocialSoldierLog.id}
</if>
<if test="tSocialSoldierLog.addId != null and tSocialSoldierLog.addId.trim() != ''">
AND a.ADD_ID = #{tSocialSoldierLog.addId}
</if>
<if test="tSocialSoldierLog.socialId != null and tSocialSoldierLog.socialId.trim() != ''">
AND a.SOCIAL_ID = #{tSocialSoldierLog.socialId}
</if>
<if test="tSocialSoldierLog.empIdcard != null and tSocialSoldierLog.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tSocialSoldierLog.empIdcard}
</if>
<if test="tSocialSoldierLog.empName != null and tSocialSoldierLog.empName.trim() != ''">
AND a.EMP_NAME = #{tSocialSoldierLog.empName}
</if>
<if test="tSocialSoldierLog.dispatchItem != null and tSocialSoldierLog.dispatchItem.trim() != ''">
AND a.DISPATCH_ITEM = #{tSocialSoldierLog.dispatchItem}
</if>
<if test="tSocialSoldierLog.socialHuName != null and tSocialSoldierLog.socialHuName.trim() != ''">
AND a.SOCIAL_HU_NAME = #{tSocialSoldierLog.socialHuName}
</if>
<if test="tSocialSoldierLog.type != null and tSocialSoldierLog.type.trim() != ''">
AND a.TYPE = #{tSocialSoldierLog.type}
</if>
<if test="tSocialSoldierLog.remark != null and tSocialSoldierLog.remark.trim() != ''">
AND a.REMARK = #{tSocialSoldierLog.remark}
</if>
<if test="tSocialSoldierLog.createBy != null and tSocialSoldierLog.createBy.trim() != ''">
AND a.CREATE_BY = #{tSocialSoldierLog.createBy}
</if>
<if test="tSocialSoldierLog.updateBy != null and tSocialSoldierLog.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tSocialSoldierLog.updateBy}
</if>
<if test="tSocialSoldierLog.createName != null and tSocialSoldierLog.createName.trim() != ''">
AND a.CREATE_NAME = #{tSocialSoldierLog.createName}
</if>
<if test="tSocialSoldierLog.updateTime != null">
AND a.UPDATE_TIME = #{tSocialSoldierLog.updateTime}
</if>
<if test="tSocialSoldierLog.createTimeStart != null">
AND a.CREATE_TIME >= #{tSocialSoldierLog.createTimeStart}
</if>
<if test="tSocialSoldierLog.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[ <= ]]> #{tSocialSoldierLog.createTimeEnd}
</if>
</if>
</sql>
<!--tSocialSoldierLog简单分页查询-->
<select id="getTSocialSoldierLogPage" resultMap="tSocialSoldierLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_soldier_log a
<where>
1=1
<include refid="tSocialSoldierLog_where"/>
</where>
order by a.CREATE_TIME desc
</select>
<!--tSocialSoldierLog简单分页查询-->
<select id="getTSocialSoldierLogList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogExportVo">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_soldier_log a
<where>
1=1
<include refid="tSocialSoldierLog_where"/>
</where>
order by a.CREATE_TIME desc
<if test="tSocialSoldierLog != null">
<if test="tSocialSoldierLog.limitStart != null">
limit #{tSocialSoldierLog.limitStart},#{tSocialSoldierLog.limitEnd}
</if>
</if>
</select>
</mapper>
......@@ -188,6 +188,8 @@
<select id="getSocialSoldierYgsAuditVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAuditVo">
SELECT
s.id as socialId,
a.EMP_NAME empName,
a.EMP_IDCARD empIdcard,
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','增员','减员') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m%d') startDate,
......@@ -204,6 +206,8 @@
<select id="getSocialSoldierYsdAuditVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo">
SELECT
s.id as socialId,
a.EMP_NAME empName,
a.EMP_IDCARD empIdcard,
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','参保人员增员申报','参保人员减员申报') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m%d') startDate,
......@@ -217,6 +221,37 @@
group by s.id
</select>
<!-- 社保士兵养工失审核结果查询的模板-->
<select id="getSocialSoldierYgsAuditVoListByGroupBy" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYgsAuditVo">
SELECT
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','增员','减员') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m01') startDate,
DATE_FORMAT(now(),'%Y%m%d') endDate,
'' backInfo,'' backInfoOne,'' backInfoTwo
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
where a.DELETE_FLAG = '0' AND a.social_id is not null AND a.STATUS = "2" AND s.YGS_HANDLE_STATUS = '7'
and a.AUTO_FLAG = '0' and DATE_FORMAT(a.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')
group by a.SOCIAL_HOUSEHOLD_NAME,a.TYPE
</select>
<!-- 社保士兵医生大审核结果【续保】查询的模板-->
<select id="getSocialSoldierYsdAuditVoListByGroupBy" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo">
SELECT
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','参保人员增员申报','参保人员减员申报') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m01') startDate,
DATE_FORMAT(now(),'%Y%m%d') endDate,
'' backInfo,'' backInfoOne,'' backInfoTwo
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
where a.DELETE_FLAG = '0' AND a.social_id is not null AND a.STATUS = "2" AND s.YSD_HANDLE_STATUS = '7'
and a.AUTO_FLAG = '0' and DATE_FORMAT(a.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')
and s.YSD_REMARK_OLD != "新增"
group by a.SOCIAL_HOUSEHOLD_NAME,a.TYPE
</select>
<!-- 社保士兵医生大审核结果【新增】查询的模板-->
<select id="getSocialSoldierYsdAddAuditVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo">
SELECT
......@@ -234,6 +269,22 @@
group by s.id
</select>
<!-- 社保士兵医生大审核结果【新增】查询的模板-->
<select id="getSocialSoldierYsdAddAuditVoListByGroupBy" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAuditVo">
SELECT
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
if(a.TYPE='0','职工新参保登记','参保人员减员申报') type,
DATE_FORMAT(a.AUDIT_TIME,'%Y%m01') startDate,
DATE_FORMAT(now(),'%Y%m%d') endDate,
'' backInfo,'' backInfoOne,'' backInfoTwo
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
where a.DELETE_FLAG = '0' AND a.social_id is not null AND a.STATUS = "2" AND s.YSD_HANDLE_STATUS = '7'
and a.AUTO_FLAG = '0' and DATE_FORMAT(a.AUDIT_TIME,'%Y%m') = DATE_FORMAT(now(),'%Y%m')
and s.YSD_REMARK_OLD = "新增"
group by a.SOCIAL_HOUSEHOLD_NAME,a.TYPE
</select>
<!-- 工资申报 -->
<select id="getSoldierSalaryByShenBaoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierSalaryShenBaoVo">
select
......
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