Commit d272a746 authored by hongguangwu's avatar hongguangwu

Merge branch 'MVP1.6.8' into develop

parents 3aa4ba25 0068671f
......@@ -59,11 +59,11 @@ spec: # 资源规范字段
value: Asia/Shanghai
resources: #资源配置限制
limits: # 最大使用
memory: "4096Mi"
memory: "8096Mi"
#cpu: 300m # CPU,1核心 = 1000m
requests: # 容器运行时,最低资源需求,也就是说最少需要多少资源容器才能正常运行
#cpu: 100m
memory: "500Mi"
memory: "1024Mi"
#livenessProbe: # pod 内部健康检查的设置
# httpGet: # 通过httpget检查健康,返回200-399之间,则认为容器正常
# path: /healthCheck # URI地址
......
......@@ -58,7 +58,7 @@ spec: # 资源规范字段
value: Asia/Shanghai
resources: #资源配置限制
limits: # 最大使用
memory: "4048Mi"
memory: "8048Mi"
#cpu: 300m # CPU,1核心 = 1000m
requests: # 容器运行时,最低资源需求,也就是说最少需要多少资源容器才能正常运行
#cpu: 100m
......
......@@ -76,6 +76,7 @@ public class TEmpEducation extends BaseEntity {
/**
* 入学时间
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "入学时间")
private Date entryDate;
......@@ -90,6 +91,7 @@ public class TEmpEducation extends BaseEntity {
/**
* 结业日期
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "结业日期")
private Date gradutionDate;
......@@ -97,6 +99,7 @@ public class TEmpEducation extends BaseEntity {
/**
* 学校名称
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@Max(value = 50)
@Schema(description = "学校名称")
private String school;
......@@ -162,6 +165,7 @@ public class TEmpEducation extends BaseEntity {
/**
* 专业
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@Max(value = 50)
@Schema(description = "专业")
private String major;
......
......@@ -19,10 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
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;
......@@ -108,6 +105,7 @@ public class TPreEmpEducation extends BaseEntity {
/**
* 入学日期
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "入学日期", isDate = true)
@ExcelProperty("入学日期")
@Schema(description = "入学日期")
......@@ -123,6 +121,7 @@ public class TPreEmpEducation extends BaseEntity {
/**
* 结业日期
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "结业日期", isDate = true)
@ExcelProperty("结业日期")
@Schema(description = "结业日期")
......@@ -130,6 +129,7 @@ public class TPreEmpEducation extends BaseEntity {
/**
* 学校名称
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "学校名称", maxLength = 64)
@Length(max = 64, message = "学校名称不能超过64个字符")
@ExcelProperty("学校名称")
......@@ -210,6 +210,7 @@ public class TPreEmpEducation extends BaseEntity {
/**
* 专业
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "专业", maxLength = 64)
@Length(max = 64, message = "专业不能超过64个字符")
@ExcelProperty("专业")
......
......@@ -246,6 +246,7 @@ public class TPreEmployeeInfo extends BaseEntity {
/**
* 学校
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "学校", maxLength = 50)
@Length(max = 50, message = "学校不能超过50个字符")
@ExcelProperty("学校")
......@@ -254,6 +255,7 @@ public class TPreEmployeeInfo extends BaseEntity {
/**
* 专业
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "专业", maxLength = 50)
@Length(max = 50, message = "专业不能超过50个字符")
@ExcelProperty("专业")
......@@ -262,6 +264,7 @@ public class TPreEmployeeInfo extends BaseEntity {
/**
* 入学时间
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "入学时间", isDate = true)
@ExcelProperty("入学时间")
@Schema(description = "入学时间")
......@@ -269,6 +272,7 @@ public class TPreEmployeeInfo extends BaseEntity {
/**
* 毕业时间
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
@ExcelAttribute(name = "毕业时间", isDate = true)
@ExcelProperty("毕业时间")
@Schema(description = "毕业时间")
......
......@@ -151,25 +151,16 @@ public class EmployeeInsertVO extends RowIndex implements Serializable {
@ExcelProperty(value = "户口性质")
private String empRegisType;
/**
* 档案-省
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "档案所在省")
@ExcelAttribute(name = "档案所在省", isArea = true, isNotEmpty = true, errorInfo = "档案所在省不能为空")
@ExcelProperty("档案所在省")
private String fileProvince;
/**
* 档案-市
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "档案所在市")
@ExcelAttribute(name = "档案所在市", isArea = true, parentField = "fileProvince", isNotEmpty = true, errorInfo = "档案所在市不能为空")
@ExcelProperty("档案所在市")
private String fileCity;
/**
* 档案-县
*/
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "档案所在县")
@ExcelAttribute(name = "档案所在县", isArea = true, parentField = "fileCity", isNotEmpty = true, errorInfo = "档案所在县不能为空")
@ExcelProperty("档案所在县")
private String fileTown;
/**
......
......@@ -48,13 +48,13 @@ public class TPreEmpMainVo extends RowIndex implements Serializable {
@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
@ExcelProperty("员工类型")
private String empNatrue;
@ExcelAttribute(name = "档案所在地省", isArea = true)
@ExcelAttribute(name = "档案所在地省", isArea = true, isNotEmpty = true, errorInfo = "档案所在地省不能为空")
@ExcelProperty("档案所在地省")
private String fileProvince;
@ExcelAttribute(name = "档案所在地市", isArea = true, parentField = "fileProvince")
@ExcelAttribute(name = "档案所在地市", isArea = true, parentField = "fileProvince", isNotEmpty = true, errorInfo = "档案所在地市不能为空")
@ExcelProperty("档案所在地市")
private String fileCity;
@ExcelAttribute(name = "档案所在地县", isArea = true, parentField = "fileCity")
@ExcelAttribute(name = "档案所在地县", isArea = true, parentField = "fileCity", isNotEmpty = true, errorInfo = "档案所在地县不能为空")
@ExcelProperty("档案所在地县")
private String fileTown;
@ExcelAttribute(name = "计税月份")
......
......@@ -1265,28 +1265,13 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
// 档案所在地
if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileProvince(Integer.parseInt(areaStr));
}
saveEmp.setFileProvince(Integer.parseInt(excel.getFileProvince()));
}
if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileCity(Integer.parseInt(areaStr));
}
saveEmp.setFileCity(Integer.parseInt(excel.getFileCity()));
}
if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileTown(Integer.parseInt(areaStr));
}
saveEmp.setFileTown(Integer.parseInt(excel.getFileTown()));
}
if (Common.isNotNull(excel.getIsCollege())) {
if (CommonConstants.IS_TRUE.equals(excel.getIsCollege())) {
......@@ -1780,31 +1765,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
saveEmp.setIdTown(Integer.parseInt(areaStr));
}
}
// 档案所在地
if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileProvince(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileCity(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown().trim() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else {
saveEmp.setFileTown(Integer.parseInt(areaStr));
}
}
if (Common.isNotNull(excel.getIsCollege())) {
if (CommonConstants.IS_TRUE.equals(excel.getIsCollege())) {
saveEmp.setIsCollege(CommonConstants.ONE_INT);
......@@ -1831,6 +1791,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
}
}
// 档案所在地
if (Common.isNotNull(excel.getFileProvince())) {
saveEmp.setFileProvince(Integer.parseInt(excel.getFileProvince()));
}
if (Common.isNotNull(excel.getFileCity())) {
saveEmp.setFileCity(Integer.parseInt(excel.getFileCity()));
}
if (Common.isNotNull(excel.getFileTown())) {
saveEmp.setFileTown(Integer.parseInt(excel.getFileTown()));
}
// 邮箱
if (Common.isNotNull(excel.getEmpEmail())) {
if (excel.getEmpEmail().contains("@")) {
......
......@@ -896,6 +896,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
}
}
tPreEmployee.setMajor(oldPreEmployee.getMajor());
tPreEmployee.setSchool(oldPreEmployee.getSchool());
tPreEmployee.setAdmissionDate(oldPreEmployee.getAdmissionDate());
tPreEmployee.setGradutionDate(oldPreEmployee.getGradutionDate());
tPreEmployeeInfoService.updateById(tPreEmployee);
project.setEmpNatrue(tPreEmployee.getEmpNatrue());
tPreEmployeeProjectService.updateById(project);
......@@ -999,10 +1004,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmpEducation.setCreateTime(LocalDateTime.now());
tPreEmpEducationService.saveOrUpdate(tPreEmpEducation);
// 附件
tAttaInfoService.deleteByDomainIdAndType(tPreEmpEducation.getId(), 0);
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) {
tAttaInfoService.deleteByDomainIdAndType(tPreEmpEducation.getId(), 0);
for (TAttaInfo atta : attaList) {
atta.setId(null);
atta.setDomainId(tPreEmpEducation.getId());
......@@ -1386,13 +1391,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tEmpEducation.setCreateTime(LocalDateTime.now());
}
tEmpEducationService.saveOrUpdate(tEmpEducation);
String attaId = tPreEmpEducation.getOldId();
tAttaInfoService.deleteByDomainIdAndType(attaId, 0);
if (tPreEmpEducation.getAttaList() != null && !tPreEmpEducation.getAttaList().isEmpty()) {
List<TAttaInfo> attaList = tPreEmpEducation.getAttaList();
if (attaList != null) {
String attaId = tPreEmpEducation.getOldId();
tAttaInfoService.deleteByDomainIdAndType(attaId, 0);
TAttaInfo newEmpAtta;
for (TAttaInfo atta : attaList) {
newEmpAtta = new TAttaInfo();
......
package com.yifu.cloud.plus.v1.yifu.archives.utils;
import cn.hutool.core.net.multipart.MultipartRequestInputStream;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
......
......@@ -207,10 +207,10 @@
e.FILE_PROVINCE fileProvince,
e.IS_COLLEGE isCollege,
e.HIGN_EDUCATION hignEducation,
e.SCHOOL,
e.MAJOR,
e.ADMISSION_DATE admissionDate,
e.GRADUTION_DATE gradutionDate,
if(e.HIGN_EDUCATION != '5' and e.HIGN_EDUCATION != '6' and e.HIGN_EDUCATION != '7' and e.HIGN_EDUCATION != '8','1',e.SCHOOL) SCHOOL,
if(e.HIGN_EDUCATION != '5' and e.HIGN_EDUCATION != '6' and e.HIGN_EDUCATION != '7' and e.HIGN_EDUCATION != '8','1',e.MAJOR) MAJOR,
if(e.HIGN_EDUCATION != '5' and e.HIGN_EDUCATION != '6' and e.HIGN_EDUCATION != '7' and e.HIGN_EDUCATION != '8','2022-05-13',e.ADMISSION_DATE) admissionDate,
if(e.HIGN_EDUCATION != '5' and e.HIGN_EDUCATION != '6' and e.HIGN_EDUCATION != '7' and e.HIGN_EDUCATION != '8','2022-05-13',e.GRADUTION_DATE) gradutionDate,
e.CONTACT_ADDRESS contactAddress,
e.FIRST_WORK_FLAG firstWorkFlag,
e.HAVE_QUALIFICATION haveQualification,
......@@ -232,7 +232,7 @@
if(ifnull(b.REMARK,1) != 1,'1',null) as badRecordFlag,
if(c.count >0,'1',null) as educationFlag,
if(e.HIGN_EDUCATION != '5' and e.HIGN_EDUCATION != '6' and e.HIGN_EDUCATION != '7' and e.HIGN_EDUCATION != '8','1',if(c.count >0,'1',null)) as educationFlag,
if(g.count >0,'1',null) as familyFlag
......
......@@ -150,6 +150,10 @@ public interface CacheConstants {
String PAYMENT_DISPATCH_BATCH_ADD_IMPORT = "payment_dispatch_batch_add_import";
String PAYMENT_SEARCH_REPEAT = "payment_search_repeat";
String PAYMENT_EXPORT_REPEAT = "payment_export_repeat";
String PAYMENT_DISPATCH_BATCH_REDUCE_IMPORT = "payment_dispatch_batch_reduce_import";
String PAYMENT_PRE_DISPATCH_BATCH_ADD_IMPORT = "payment_pre_dispatch_batch_add_import";
......
......@@ -20,5 +20,7 @@ public class ResultConstants {
public static final String DATA_IMPORT_PARSING_RESULT = "数据导入解析!数据行数:";
public static final String NO_SELECT_DATA = "请选择数据";
public static final String NO_GETLOCK_DATA = "当前用户操作处理中,请稍后重试!";
public static final String NO_GETLOCK_DATA_SEARCH = "多用户同时请求中,请稍后重试!";
public static final String NO_ID = "操作失败,id不能为空!";
}
......@@ -482,7 +482,7 @@ public class ExcelUtil <T> implements Serializable {
private String getAreaValue(String c, String tempStr, ExcelAttribute attr,Integer rowNum, ErrorMessage errorTemp) {
tempStr = String.valueOf(RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE + c));
if (Common.isEmpty(tempStr)){
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常,请联系管理人员"), errorTemp);
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常"), errorTemp);
return CommonConstants.EMPTY_STRING;
}
return tempStr;
......
......@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -476,4 +477,14 @@ public class SocialHandleExportVo implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="首次至缴纳地时间")
private Date firstPayTime;
/**
* 离职时间
*/
@ExcelAttribute(name = "离职日期")
@ContentStyle(dataFormat = 49)
@Schema(description = "离职日期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("离职日期" )
private String leaveDate;
}
......@@ -124,7 +124,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-省
*/
@ExcelAttribute(name = "档案-省" ,isArea = true)
@ExcelAttribute(name = "档案-省" ,isArea = true, isNotEmpty = true, errorInfo = "档案-省不能为空")
@Schema(description = "档案-省" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-省" )
......@@ -132,7 +132,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-市
*/
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince")
@ExcelAttribute(name = "档案-市" ,isArea = true,parentField = "fileProvince", isNotEmpty = true, errorInfo = "档案-市不能为空")
@Schema(description = "档案-市" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-市" )
......@@ -140,7 +140,7 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
/**
* 档案-县
*/
@ExcelAttribute(name = "档案-县" ,isArea = true,parentField = "fileCity")
@ExcelAttribute(name = "档案-县" ,isArea = true,parentField = "fileCity", isNotEmpty = true, errorInfo = "档案-县不能为空")
@Schema(description = "档案-县" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("档案-县" )
......
......@@ -15,6 +15,7 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;/*
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.date.LocalDateTimeUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -52,6 +53,8 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.util.List;
......@@ -80,6 +83,16 @@ public class TPaymentInfoController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TPaymentInfo>> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
//特殊条件如社保户、缴纳地的查询做限制处理,限制到所用用户,因为此部分数据量较大
R<IPage<TPaymentInfo>> res = tPaymentInfoService.specialHandle(page,tPaymentInfo);
if (null != res){
return res;
}
//查询数据
return new R<>(tPaymentInfoService.getTPaymentInfoPage(page, tPaymentInfo));
}
......@@ -93,19 +106,13 @@ public class TPaymentInfoController {
@Operation(description = "简单分页查询")
@GetMapping("/newPage")
public R<IPage<TPaymentInfoNewVo>> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tPaymentInfo);
if (Common.isNotNull(tPaymentInfo.getAuthSql())) {
if (tPaymentInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tPaymentInfo.setAuthSql(tPaymentInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN_ID"));
}
if (tPaymentInfo.getAuthSql().contains("1=2 EXISTS")) {
tPaymentInfo.setAuthSql(tPaymentInfo.getAuthSql().replace("1=2 EXISTS", "EXISTS"));
}
//特殊条件如社保户、缴纳地的查询做限制处理,限制到所用用户,因为此部分数据量较大
R<IPage<TPaymentInfoNewVo>> res = tPaymentInfoService.specialHandleNew(page,tPaymentInfo);
if (null != res){
return res;
}
return new R<>(tPaymentInfoService.getTPaymentInfoNewPage(page, tPaymentInfo));
}
/**
* 实缴查询详情
*
......@@ -307,7 +314,7 @@ public class TPaymentInfoController {
* @author huyc
* @date 2022-07-22
**/
@SysLog("实缴导列表不合并导出")
@SysLog("实缴导列表不合并导出")
@Operation(description = "导出缴费库 hasPermission('social_tpaymentinfo_export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tpaymentinfo_export')")
......@@ -315,6 +322,43 @@ public class TPaymentInfoController {
tPaymentInfoService.listExport(response, searchVo);
}
/**
* @Author fxj
* @Description 实缴导入列表导出不合并数据校验,生成月份为空时 数据量超出2W 前端提示
* @Date 14:57 2024/8/5
* @Param
* @return
**/
@SysLog("实缴导出列表不合并导出--检测")
@Operation(description = "导出缴费库检测 ")
@PostMapping("/exportCheck")
public R<Integer> exportCheck(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.PAYMENT_EXPORT_REPEAT + CommonConstants.DOWN_LINE_STRING + user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}
try {
if (Common.isNotNull(requestId)) {
//查询数据
return tPaymentInfoService.listExportCheck(response, searchVo);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
}finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
/**
* 缴费库合并导出
*
......@@ -329,6 +373,43 @@ public class TPaymentInfoController {
tPaymentInfoService.listSumExport(response, searchVo);
}
/**
* @Author fxj
* @Description 缴费库合并导出 检车 生成月份为空 数据条数超出2W条后 前端给提示
* @Date 15:09 2024/8/5
* @Param
* @return
**/
@SysLog("缴费库合并导出检测")
@Operation(description = "合并导出缴费库检测")
@PostMapping("/sumExportCheck")
public R<Integer> sumExportCheck(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.PAYMENT_EXPORT_REPEAT + CommonConstants.DOWN_LINE_STRING+user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}
try {
if (Common.isNotNull(requestId)) {
//查询数据
return tPaymentInfoService.listSumExportCheck(response, searchVo);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
}finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
/**
* 缴费库查询合并导出
*
......@@ -353,6 +434,52 @@ public class TPaymentInfoController {
tPaymentInfoService.sumSearchExport(response, searchVo);
}
/**
* @Author fxj
* @Description 缴费库查询合并导出 校验, 生成月份为空时 导出条数超出2W 前端给提示
* @Date 15:13 2024/8/5
* @Param
* @return
**/
@Operation(description = "缴费库查询合并导出检测")
@PostMapping("/sumSearchExportCheck")
@SysLog("实缴查询列表合并导出检测")
public R<Integer> sumSearchExportCheck(HttpServletResponse response, @RequestBody TPaymentInfoSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.PAYMENT_EXPORT_REPEAT + CommonConstants.DOWN_LINE_STRING + user.getId();
String requestId;
try {
requestId = RedisDistributedLock.getLock(key,"10");
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}
try {
if (Common.isNotNull(requestId)) {
//查询数据
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql())) {
if (searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN_ID"));
}
if (searchVo.getAuthSql().contains("1=2 EXISTS")) {
searchVo.setAuthSql(searchVo.getAuthSql().replace("1=2 EXISTS", "EXISTS"));
}
}
return tPaymentInfoService.sumSearchExportCheck(response, searchVo);
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
}finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
/**
* 根据条件批量删除
*
......
......@@ -24,9 +24,12 @@ 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.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.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -54,6 +57,8 @@ public class TSocialInfoController {
private final TSocialInfoService tSocialInfoService;
private final TSocialSoldierService tSocialSoldierService;
/**
* 简单分页查询
......@@ -181,4 +186,55 @@ public class TSocialInfoController {
}
return R.ok(socialInfo);
}
/**
* @param id
* @param isSocial 1 社保 2 医保
* @Description:
* @Author: hgw
* @Date: 2024/8/1 18:12
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "转人工", description = "转人工")
@GetMapping("/doRenGong" )
public R<String> doRenGong(@RequestParam String id, @RequestParam String isSocial) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed("请登录!");
}
TSocialInfo socialInfo = tSocialInfoService.getById(id);
if (socialInfo == null || Common.isEmpty(socialInfo.getId())) {
return R.failed("未找到社保");
}
String handleRemark;
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
handleRemark = "派增";
} else {
handleRemark = "派减";
}
if (CommonConstants.ONE_STRING.equals(isSocial) && Common.isNotNull(socialInfo.getYgsHandleStatus())) {
if (CommonConstants.ZERO_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.FIVE_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.SIX_STRING.equals(socialInfo.getYgsHandleStatus())) {
return R.failed("当前养老工伤失业-办理状态不可以转人工!");
}
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING);
tSocialInfoService.updateById(socialInfo);
handleRemark += "养老、工伤、失业手动转人工";
} else if (CommonConstants.TWO_STRING.equals(isSocial) && Common.isNotNull(socialInfo.getYsdHandleStatus())) {
if (CommonConstants.ZERO_STRING.equals(socialInfo.getYsdHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getYsdHandleStatus())
|| CommonConstants.FIVE_STRING.equals(socialInfo.getYsdHandleStatus())
|| CommonConstants.SIX_STRING.equals(socialInfo.getYsdHandleStatus())) {
return R.failed("当前医疗生育大病-办理状态不可以转人工!");
}
socialInfo.setYsdHandleStatus(CommonConstants.FIVE_STRING);
tSocialInfoService.updateById(socialInfo);
handleRemark += "医疗、生育、大病手动转人工";
}
// 加记录
tSocialSoldierService.doSocialTAuditInfo(socialInfo, handleRemark, handleRemark, handleRemark, user);
return R.ok("成功!");
}
}
......@@ -53,6 +53,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, @Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库分页查询
* @param tPaymentInfo 缴费库
* @return
*/
List<TPaymentInfoNewVo> getTPaymentInfoNewPageDiy(@Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo,@Param("page") Long page, @Param("size") Long size);
/**
* 缴费库分页查询
* @param tPaymentInfo 缴费库
* @return
*/
List<TPaymentInfoNewVo> getTPaymentInfoNewPageSocial(@Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo,@Param("page") Long page, @Param("size") Long size);
/**
* 缴费库查询详情
* @param tPaymentInfo
......@@ -74,6 +88,27 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
Integer selectCountPaymentSearchInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
* @return
*/
Integer selectCountPaymentSearchInfoSocial(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
* @return
*/
Integer selectCountPaymentSearchInfoSocialByLimit(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
* @return
*/
Integer selectCountPaymentSearchInfoFund(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
......@@ -364,4 +399,16 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
IPage<SocialAndFundReduceBusinessVo> getSocialAndFundReduceInfo(Page page, @Param("month")String month
, @Param("settleDomainId")String settleDomainId, @Param("settleDomainIds")List<String> settleDomainIds);
/**
* 实缴查询社保合计查询
* @return
*/
TPaymentInfoExportVo getSumByKeyGroupSocial(@Param("empIdcard") String empIdcard,@Param("payMonth") String payMonth,@Param("createMonth") String createMonth);
/**
* 实缴查询公积金合计查询
* @return
*/
TPaymentInfoExportVo getSumByKeyGroupFund(@Param("empIdcard") String empIdcard,@Param("payMonth") String payMonth,@Param("createMonth") String createMonth);
}
......@@ -258,6 +258,14 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
* @return
**/
IPage<SocialAndFundReduceBusinessVo> getSocialAndFundReduceInfo(Page<SocialAndFundReduceBusinessVo> page, String month, String settleDomainId, List<String> settleDomainIds);
// hgw2023-1-6 10:42:06:以上:B端相关接口
R<Integer> listExportCheck(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
R<Integer> listSumExportCheck(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
R<Integer> sumSearchExportCheck(HttpServletResponse response, TPaymentInfoSearchVo searchVo);
R<IPage<TPaymentInfo>> specialHandle(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
R<IPage<TPaymentInfoNewVo>> specialHandleNew(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
}
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import org.springframework.web.multipart.MultipartFile;
......@@ -65,5 +66,12 @@ public interface TSocialSoldierService extends IService<TSocialInfo> {
R<String> getZip(MultipartFile zipFile);
/**
* @Description: 加办理记录
* @Author: hgw
* @Date: 2024/8/2 9:40
* @return: void
**/
void doSocialTAuditInfo(TSocialInfo social, String title, String handleRemark, String remark, YifuUser user);
}
......@@ -5106,16 +5106,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (count > CommonConstants.ZERO_INT){
WriteSheet writeSheet;
ExcelUtil<SocialSoldierExportVo> util;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = getSocialSoldierList(searchVo,idStr);
if (Common.isNotNull(list)){
util = new ExcelUtil<>(SocialSoldierExportVo.class);
for (SocialSoldierExportVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
writeSheet = EasyExcelFactory.writerSheet(DispatchConstants.SOCIAL_SOLDIER_EXPORT+index).build();
excelWriter.write(list,writeSheet);
index++;
i += CommonConstants.EXCEL_EXPORT_LIMIT;
}
if (Common.isNotNull(list)){
list.clear();
......
......@@ -180,9 +180,81 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
@Override
public IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
//如果是含身份证查询直接查询走索引,无需走特殊处理逻辑,身份证查询量不会大
if (Common.isNotNull(tPaymentInfo.getEmpIdcard())){
return baseMapper.getTPaymentInfoNewPage(page, tPaymentInfo);
}
Page<TPaymentInfoNewVo> pageNew = new Page<>();
pageNew.setSize(page.getSize());
pageNew.setCurrent(page.getCurrent());
long totalCount = baseMapper.selectCountPaymentSearchInfoSocial(tPaymentInfo);
pageNew.setTotal(totalCount);
if (totalCount > 0L) {
pageNew.setPages(totalCount / pageNew.getSize());
}
if (pageNew.getCurrent() < 1) {
pageNew.setCurrent(1L);
}
if (pageNew.getSize() < 1) {
pageNew.setSize(10L);
}
if (totalCount > ((page.getCurrent() - 1) * page.getSize())) {
pageNew.setRecords(getPageData(tPaymentInfo,pageNew,totalCount));
}
return pageNew;
}
/**
* @Author fxj
* @Description 数据量大的统计查询 走特殊处理 分步查询
* @Date 11:58 2024/8/9
* @Param
* @return
**/
private List<TPaymentInfoNewVo> getPageData(TPaymentInfoSearchVo searchVo,Page<TPaymentInfoNewVo> pageNew ,long totalCount){
List<TPaymentInfoNewVo> pageData;
// 非大批量数据统计查询时走原逻辑
if (totalCount < 20000){
return baseMapper.getTPaymentInfoNewPageDiy(searchVo, (pageNew.getCurrent() - 1) * pageNew.getSize(), pageNew.getSize());
}
// 社保户、生成月、缴纳月、缴纳地、二级指标归属、单位、公积金户 走优化查询 先查询数据在封装合计金额
if ((Common.isNotNull(searchVo.getSocialHousehold())
|| Common.isNotNull(searchVo.getSocialCreateMonth())
|| Common.isNotNull(searchVo.getSocialPayMonth())
|| Common.isNotNull(searchVo.getSocialProvince())
|| Common.isNotNull(searchVo.getSecondIndicatorBelong())
|| Common.isNotNull(searchVo.getUnitName())
|| Common.isNotNull(searchVo.getProvidentHousehold()))
&& Common.isEmpty(searchVo.getEmpIdcard())
&& Common.isEmpty(searchVo.getSettleDomainName())){
//批量查询太慢 只能缓存单个查询 走字段索引
pageData = baseMapper.getTPaymentInfoNewPageSocial(searchVo, (pageNew.getCurrent() - 1) * pageNew.getSize(), pageNew.getSize());
//封装对应的社保及公积金的合计数据处理
if (Common.isNotNull(pageData)){
TPaymentInfoExportVo newVo;
for (TPaymentInfoNewVo vo:pageData){
newVo = baseMapper.getSumByKeyGroupSocial(vo.getEmpIdcard(),vo.getSocialPayMonth(),vo.getSocialCreateMonth());
if (null != newVo){
vo.setSumAll(BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(newVo.getSumAll()),BigDecimalUtils.isNullToZero(newVo.getSocialSum())));
vo.setSocialSum(newVo.getSocialSum());
vo.setSocialPayAddr(newVo.getSocialPayAddr());
vo.setSocialHousehold(newVo.getSocialHousehold());
}
newVo = baseMapper.getSumByKeyGroupFund(vo.getEmpIdcard(),vo.getSocialPayMonth(),vo.getSocialCreateMonth());
if (null != newVo){
vo.setSumAll(BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(newVo.getSumAll()),BigDecimalUtils.isNullToZero(newVo.getProvidentSum())));
vo.setProvidentSum(newVo.getProvidentSum());
vo.setProvidentHousehold(newVo.getProvidentHousehold());
vo.setProvidentPayAddr(newVo.getProvidentPayAddr());
}
return pageData;
}
}
// 身份证查询 项目查询直接走原查询逻辑,因为此处数据量不会很大
}else {
pageData = baseMapper.getTPaymentInfoNewPageDiy(searchVo, (pageNew.getCurrent() - 1) * pageNew.getSize(), pageNew.getSize());
}
return pageData;
}
/**
* 缴费库批量导出
*
......@@ -5067,4 +5139,157 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
/**
* @Author fxj
* @Description 实缴导入列表导出不合并数据校验,生成月份为空时 数据量超出2W 前端提示
* @Date 14:57 2024/8/5
* @Param
* @return
**/
@Override
public R<Integer> listExportCheck(HttpServletResponse response, TPaymentInfoSearchVo searchVo) {
return R.ok(baseMapper.selectCountTPaymentInfo(searchVo));
}
/**
* @Author fxj
* @Description 缴费库合并导出 检车 生成月份为空 数据条数超出2W条后 前端给提示
* @Date 15:09 2024/8/5
* @Param
* @return
**/
@Override
public R<Integer> listSumExportCheck(HttpServletResponse response, TPaymentInfoSearchVo searchVo){
if (Common.isEmpty(searchVo.getEmpIdcard())
&& Common.isEmpty(searchVo.getUnitName())
&& Common.isEmpty(searchVo.getSettleDomainName())
&& Common.isEmpty(searchVo.getSocialCreateMonth())
&& Common.isEmpty(searchVo.getSocialPayMonth())
&& Common.isEmpty(searchVo.getSocialProvince())
&& Common.isEmpty(searchVo.getSecondIndicatorBelong())){
// 只有社保户
if (Common.isNotNull(searchVo.getSocialHousehold())){
return R.ok(baseMapper.selectCountPaymentSearchInfoSocialByLimit(searchVo));
}
//只有公积金户
if (Common.isNotNull(searchVo.getProvidentHousehold())){
return R.ok(baseMapper.selectCountPaymentSearchInfoSocialByLimit(searchVo));
}
}
return R.ok(baseMapper.selectCountSumPaymentInfo(searchVo));
}
/**
* @Author fxj
* @Description 缴费库查询合并导出 校验, 生成月份为空时 导出条数超出2W 前端给提示
* @Date 15:13 2024/8/5
* @Param
* @return
**/
@Override
public R<Integer> sumSearchExportCheck(HttpServletResponse response, TPaymentInfoSearchVo searchVo){
if (Common.isEmpty(searchVo.getEmpIdcard())
&& Common.isEmpty(searchVo.getUnitName())
&& Common.isEmpty(searchVo.getSettleDomainName())
&& Common.isEmpty(searchVo.getSocialCreateMonth())
&& Common.isEmpty(searchVo.getSocialPayMonth())
&& Common.isEmpty(searchVo.getSocialProvince())
&& Common.isEmpty(searchVo.getSecondIndicatorBelong())){
// 只有社保户
if (Common.isNotNull(searchVo.getSocialHousehold())){
return R.ok(baseMapper.selectCountPaymentSearchInfoSocialByLimit(searchVo));
}
//只有公积金户
if (Common.isNotNull(searchVo.getProvidentHousehold())){
return R.ok(baseMapper.selectCountPaymentSearchInfoSocialByLimit(searchVo));
}
}
return R.ok(baseMapper.selectCountPaymentSearchInfo(searchVo));
}
private boolean socialFlag(TPaymentInfoSearchVo tPaymentInfo){
return ("安徽皖信人力资源管理有限公司".equals(tPaymentInfo.getSocialHousehold())
|| "安徽皖信人力资源管理有限公司肥东分公司".equals(tPaymentInfo.getSocialHousehold())) && Common.isEmpty(tPaymentInfo.getEmpIdcard())
&& Common.isEmpty(tPaymentInfo.getUnitName())
&& Common.isEmpty(tPaymentInfo.getSettleDomainName())
&& Common.isEmpty(tPaymentInfo.getSocialCreateMonth())
&& Common.isEmpty(tPaymentInfo.getSocialPayMonth())
&& Common.isEmpty(tPaymentInfo.getSocialProvince())
&& Common.isEmpty(tPaymentInfo.getSecondIndicatorBelong())
&& Common.isEmpty(tPaymentInfo.getProvidentHousehold());
}
private boolean cityFlag(TPaymentInfoSearchVo tPaymentInfo){
return (("135".equals(tPaymentInfo.getSocialCity()) && Common.isEmpty(tPaymentInfo.getSocialTown()))
|| ("12".equals(tPaymentInfo.getSocialProvince()) && Common.isEmpty(tPaymentInfo.getSocialCity())))
&& Common.isEmpty(tPaymentInfo.getEmpIdcard())
&& Common.isEmpty(tPaymentInfo.getUnitName())
&& Common.isEmpty(tPaymentInfo.getSettleDomainName())
&& Common.isEmpty(tPaymentInfo.getSocialCreateMonth())
&& Common.isEmpty(tPaymentInfo.getSocialPayMonth())
&& Common.isEmpty(tPaymentInfo.getSecondIndicatorBelong())
&& Common.isEmpty(tPaymentInfo.getProvidentHousehold())
&& Common.isEmpty(tPaymentInfo.getSocialHousehold());
}
@Override
public R<IPage<TPaymentInfo>> specialHandle(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
//判断社保户
if (socialFlag(tPaymentInfo)){
return getLock(page, tPaymentInfo);
}
//判断缴纳地
if (cityFlag(tPaymentInfo)){
return getLock(page, tPaymentInfo);
}
return null;
}
@Override
public R<IPage<TPaymentInfoNewVo>> specialHandleNew(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
//判断社保户
if (socialFlag(tPaymentInfo)){
return getLockNew(page, tPaymentInfo);
}
//判断缴纳地
if (cityFlag(tPaymentInfo)){
return getLockNew(page, tPaymentInfo);
}
return null;
}
private R<IPage<TPaymentInfoNewVo>> getLockNew(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
String keyTemp = CacheConstants.PAYMENT_SEARCH_REPEAT;
String requestId = null;
try {
requestId = RedisDistributedLock.getLock(keyTemp,"120");
if (Common.isNotNull(requestId)) {
//查询数据
return new R<>(this.getTPaymentInfoNewPage(page, tPaymentInfo));
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA_SEARCH);
}
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}finally {
//主动释放锁
RedisDistributedLock.unlock(keyTemp, requestId);
}
}
private R<IPage<TPaymentInfo>> getLock(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
String keyTemp = CacheConstants.PAYMENT_SEARCH_REPEAT;
String requestId = null;
try {
requestId = RedisDistributedLock.getLock(keyTemp,"120");
if (Common.isNotNull(requestId)) {
//查询数据
return new R<>(this.getTPaymentInfoPage(page, tPaymentInfo));
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA_SEARCH);
}
} catch (Exception e) {
throw new RuntimeException(ResultConstants.NO_GETLOCK_DATA+CommonConstants.DOWN_LINE_STRING+e.getMessage());
}finally {
//主动释放锁
RedisDistributedLock.unlock(keyTemp, requestId);
}
}
}
......@@ -1241,25 +1241,35 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
@Override
public R<String> getSixJobByAudit() {
// 获取所有需要反馈的任务id
// 社保 type 1:社保;2:医保
List<TSocialInfo> socialList = tSocialInfoService.getSocialSoldierYgsByAudit();
if (socialList != null && !socialList.isEmpty()) {
this.doAuditCoreByType(socialList, CommonConstants.ONE_INT);
}
// 医保
List<TSocialInfo> socialYsdList = tSocialInfoService.getSocialSoldierYsdByAudit();
if (socialYsdList != null && !socialYsdList.isEmpty()) {
if (socialList != null && !socialList.isEmpty()) {
socialList.addAll(socialYsdList);
} else {
socialList = socialYsdList;
this.doAuditCoreByType(socialYsdList, CommonConstants.TWO_INT);
}
return R.ok();
}
if (socialList != null && !socialList.isEmpty()) {
/**
* @param socialList
* @param type 1:社保;2:医保
* @Description: 整合社保与医保
* @Author: hgw
* @Date: 2024/8/16 17:43
* @return: void
**/
private void doAuditCoreByType(List<TSocialInfo> socialList, int type) {
Map<String, TSocialInfo> idCardMap = new HashMap<>();
Set<String> addIdSet = new HashSet<>();
for (TSocialInfo socialInfo : socialList) {
if (Common.isNotNull(socialInfo.getYgsAddId())) {
if (type ==1 && Common.isNotNull(socialInfo.getYgsAddId())) {
addIdSet.add(socialInfo.getYgsAddId());
idCardMap.put(socialInfo.getYgsAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
}
if (Common.isNotNull(socialInfo.getYsdAddId())) {
} else if(type ==2 && Common.isNotNull(socialInfo.getYsdAddId())) {
addIdSet.add(socialInfo.getYsdAddId());
idCardMap.put(socialInfo.getYsdAddId() + CommonConstants.DOWN_LINE_STRING + socialInfo.getEmpIdcard(), socialInfo);
}
......@@ -1282,7 +1292,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
conn.setConnectTimeout(30 * 1000);
in = conn.getInputStream();
// 实际读取文件内容
this.readZip(in, idCardMap, errorMap, doAddId);
this.readZip(in, idCardMap, errorMap, doAddId, type);
}
} catch (Exception e) {
e.printStackTrace();
......@@ -1298,11 +1308,9 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}
}
return R.ok();
}
public R<List<TSocialSoldierReturnAuditErrorVo>> readZip(InputStream inputStream, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) {
, Map<String, FailReasonConfig> errorMap, String doAddId, int type) {
TSocialSoldierReturnAuditErrorVo vo;
List<TSocialSoldierReturnAuditErrorVo> voList = new ArrayList<>();
XSSFWorkbook sheets = null;
......@@ -1461,7 +1469,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
}
}
if (!voList.isEmpty()) {
importTSocialSoldierByAudit(voList, idCardMap, errorMap, doAddId);
importTSocialSoldierByAudit(voList, idCardMap, errorMap, doAddId, type);
}
return R.ok(voList);
}
......@@ -1759,7 +1767,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
* @return: void
**/
private void importTSocialSoldierByAudit(List<TSocialSoldierReturnAuditErrorVo> excelVOList, Map<String, TSocialInfo> idCardMap
, Map<String, FailReasonConfig> errorMap, String doAddId) {
, Map<String, FailReasonConfig> errorMap, String doAddId, int type) {
// 个性化校验逻辑
// 执行数据插入操作 组装
TSocialSoldierReturnAuditErrorVo excel;
......@@ -1770,6 +1778,9 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
TSocialInfo updateSocial;
// true养工失 false 医生大
boolean typeFlag = true;
if (type == 2) {
typeFlag = false;
}
FailReasonConfig failConfig;
String ygsHandleStatus;
String ysdHandleStatus;
......@@ -1806,7 +1817,6 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
auditRemark = excel.getYgsOperation();
if (Common.isEmpty(auditRemark)) {
auditRemark = excel.getYsdRemark();
typeFlag = false;
}
if (Common.isNotNull(empIdCard)) {
title = "社保";
......@@ -2295,6 +2305,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
* @Author hgw
* @Date 2024-5-16 11:43:33
**/
@Override
public void doSocialTAuditInfo(TSocialInfo social, String title, String handleRemark, String remark, YifuUser user) {
TAuditInfo auditInfo = new TAuditInfo();
auditInfo.setType(CommonConstants.ONE_STRING);
......
......@@ -55,3 +55,6 @@ spring:
soldier:
authorizations : Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmODA2ZjRlYzYzZjY0NjVlOGFlZjRmZmVlOTYwMzcxNiIsInN1YiI6IjIiLCJ1c2VyX3Bob25lIjoiIiwidXNlcl90eXBlIjoiMTAiLCJ1c2VyX25hbWUiOiLmtYvor5UiLCJpc19hcHAiOiIxIiwiVXNlcklkIjoiMiIsIm5iZiI6MTcxMjg5Mjk1OCwiZXhwIjoxNzIzMjYwOTU4LCJpYXQiOjE3MTI4OTI5NTh9.oTmhLfv1tLq8aPOfO3LeqM1IDYT76YGXkqpz3dwBX4M
urlPre : http://172.16.24.66:55555
#线上社保士兵,一般不允许用,用之前要清理测试环境当月的社保自动化数据,否则有可能产生费用
#authorizations: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MzcwYWIyZDRhZTI0NjQ2YTg0MTE0Mzk1Y2M2MTkzMiIsInN1YiI6IjQiLCJ1c2VyX3Bob25lIjoiIiwidXNlcl90eXBlIjoiMTAiLCJ1c2VyX25hbWUiOiLlkIjogqXnpL7kv53lo6vlhbVBUEkiLCJpc19hcHAiOiIxIiwiVXNlcklkIjoiNCIsIm5iZiI6MTcxNjE3OTIxOSwiZXhwIjoxNzI2NTQ3MjE5LCJpYXQiOjE3MTYxNzkyMTl9.Ei-52hRlfMLXLzpzmbP2xCVFZKE5sHHexzfX5PtmZ_M
#urlPre: http://60.168.131.18:55555
\ No newline at end of file
......@@ -26,7 +26,7 @@ mybatis-plus:
logic-not-delete-value: 0
configuration:
map-underscore-to-camel-case: true
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# spring security 配置
security:
......
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