Commit 03a3738e authored by huyuchen's avatar huyuchen

优化修改

parent 117f2673
......@@ -555,4 +555,16 @@ public interface ErrorCodes {
* 公积金办理:办理失败,失败原因必填
*/
String FUND_IMPORT_HANDLE_REASON_NOT_EMPY = "fund_import_handle_reason_not_empty";
/**
* 社保办理:任一险种办理失败,失败原因必填
*/
String SOCIAL_IMPORT_HANDLE_REASON_NOT_EMPY = "social_import_handle_reason_not_empty";
/**
* 社保办理失败,必须办理其中一个险种
*/
String SOCIAL_IMPORT_HANDLE_NOT_EMPY = "social_import_handle_not_empty";
/**
* 社保办理:无办理权限或无可需要办理的社保数据
*/
String SOCIAL_IMPORT_HANDLE_NOT_EXITS = "social.import.handle.not.exits";
}
......@@ -218,6 +218,10 @@ fund.import.handle.not.exits=\u65E0\u529E\u7406\u6743\u9650\u6216\u65E0\u53EF\u9
fund_import_handle_reason_not_empty=\u516C\u79EF\u91D1\u529E\u7406\uFF1A\u529E\u7406\u5931\u8D25\uFF0C\u5931\u8D25\u7C7B\u578B\u5FC5\u586B
social_import_handle_reason_not_empty=\u793E\u4FDD\u529E\u7406\uFF1A\u4EFB\u4E00\u9669\u79CD\u529E\u7406\u5931\u8D25\uFF0C\u5931\u8D25\u539F\u56E0\u5FC5\u586B
social_import_handle_not_empty=\u793E\u4FDD\u529E\u7406\u5931\u8D25\uFF0C\u5FC5\u987B\u529E\u7406\u5176\u4E2D\u4E00\u4E2A\u9669\u79CD
social.import.handle.not.exits=\u65E0\u529E\u7406\u6743\u9650\u6216\u65E0\u53EF\u9700\u8981\u529E\u7406\u7684\u793E\u4FDD\u6570\u636E
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 派单信息记录表
*
* @author huyc
* @date 2023-05-15 15:38:05
*/
@Data
public class SocialImportHandleVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名" )
@Schema(description = "员工姓名" )
@ExcelProperty("员工姓名" )
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号",isNotEmpty = true,errorInfo = "身份证不可为空")
@Schema(description = "身份证号" )
@ExcelProperty("身份证号" )
private String empIdcard;
/**
* 养老保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "养老保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "养老保险办理状态:0 成功,1失败" )
@ExcelProperty("养老保险" )
private String ylHandleStatus;
/**
* 医疗保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "医疗保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "医疗保险办理状态:0 成功,1失败" )
@ExcelProperty("医疗保险" )
private String ybHandleStatus;
/**
* 失业保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "失业保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "失业保险办理状态:0 成功,1失败" )
@ExcelProperty("失业保险" )
private String syHandleStatus;
/**
* 工伤保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "工伤保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "工伤保险办理状态:0 成功,1失败" )
@ExcelProperty("工伤保险" )
private String gsHandleStatus;
/**
* 生育保险办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "生育保险" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "生育保险办理状态:0 成功,1失败" )
@ExcelProperty("生育保险" )
private String sjHandleStatus;
/**
* 大病救助办理状态:0 成功,1失败
*/
@ExcelAttribute(name = "大病救助" ,isDataId = true,readConverterExp = "0=成功,1=失败")
@Schema(description = "大病救助办理状态:0 成功,1失败" )
@ExcelProperty("大病救助" )
private String dbHandleStatus;
/**
* 办理意见
*/
@ExcelAttribute(name = "办理意见")
@Schema(description = "办理意见" )
@ExcelProperty("办理意见" )
private String remark;
/**
* 失败类型
*/
@ExcelAttribute(name = "失败类型")
@Schema(description = "失败类型" )
@ExcelProperty("失败类型" )
private String reasonType;
}
......@@ -503,6 +503,41 @@ public class TDispatchInfoController {
return tDispatchInfoService.addApplyHandle(idList,typeSub,handleStatus,handleRemark,socialType,remark);
}
/**
* 社保批量办理导入
* @author huyc
* @date 2023-05-15 11:38:05
**/
@SneakyThrows
@Operation(description = "社保批量办理导入")
@SysLog("社保批量办理导入")
@PostMapping("/importSocialHandler")
public R<List<ErrorMessage>> importSocialHandler(@RequestBody MultipartFile file){
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
// 获取redis分布式事务锁
String key = CacheConstants.PAYMENT_DISPATCH_BATCH_ADD_IMPORT + 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 tDispatchInfoService.importSocialHandler(file.getInputStream());
} else {
return R.failed(ResultConstants.NO_GETLOCK_DATA);
}
}finally {
//主动释放锁
RedisDistributedLock.unlock(key, requestId);
}
}
/**
* @Author fxj
* @Description 导出 社保花名册
......
......@@ -284,8 +284,7 @@ public class TForecastLibraryController {
**/
@Operation(summary = "定时任务推送社保预估明细的数据", description = "定时任务推送社保预估明细的数据")
@SysLog("定时任务推送社保预估明细的数据")
@Inner
@PostMapping("/inner/createForecastInfo")
@PostMapping("/createForecastInfo")
public void createForecastInfo() {
tForecastLibraryService.createForecastInfo();
}
......
......@@ -38,6 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoNewVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
import io.swagger.v3.oas.annotations.Operation;
......@@ -78,6 +79,31 @@ public class TPaymentInfoController {
return new R<>(tPaymentInfoService.getTPaymentInfoPage(page, tPaymentInfo));
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param tPaymentInfo 缴费库
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/newPage")
public R<IPage<TPaymentInfoNewVo>> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
return new R<>(tPaymentInfoService.getTPaymentInfoNewPage(page, tPaymentInfo));
}
/**
* 实缴查询详情
*
* @param tPaymentInfo
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/newPageInfo")
public R<TPaymentInfoNewVo> getTPaymentInfoNewPageInfo(TPaymentInfoSearchVo tPaymentInfo) {
return R.ok(tPaymentInfoService.getTPaymentInfoNewPageInfo(tPaymentInfo));
}
/**
* 通过id查询缴费库
*
......
......@@ -20,7 +20,6 @@ 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.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import org.apache.ibatis.annotations.Mapper;
......@@ -103,6 +102,17 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
IPage<TDispatchInfo> getTDispatchSocialHandlePage(Page<TDispatchInfo> page,
@Param("tDispatchInfo") SocialHandleSearchVo tDispatchInfo,
@Param("idsStr") List<String> idsStr);
/**
* 社保页面查询
* @Author fxj
* @Date 2019-10-12
* @param tDispatchInfo
* @return
**/
List<TDispatchInfo> getTDispatchSocialHandleNoPage(@Param("tDispatchInfo")SocialHandleSearchVo tDispatchInfo,
@Param("idCards") List<String> idCards,
@Param("idsStr") List<String> idsStr);
/**
* 公积金办理页面查询
* @Author fxj
......
......@@ -46,6 +46,20 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
*/
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, @Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库分页查询
* @param tPaymentInfo 缴费库
* @return
*/
IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, @Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库查询详情
* @param tPaymentInfo
* @return
*/
TPaymentInfoNewVo getTPaymentInfoNewPageInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库简单分页查询
* @param searchVo 缴费库
......
......@@ -53,6 +53,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> importDiy(InputStream inputStream, String orderId);
R<List<ErrorMessage>> importSocialHandler(InputStream inputStream);
void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo);
void listAuditExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo);
......
......@@ -44,6 +44,20 @@ public interface TPaymentInfoService extends IService<TPaymentInfo> {
*/
IPage<TPaymentInfo> getTPaymentInfoPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库查询
* @param tPaymentInfo 缴费库
* @return
*/
IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库查询详情
* @param tPaymentInfo 缴费库
* @return
*/
TPaymentInfoNewVo getTPaymentInfoNewPageInfo(TPaymentInfoSearchVo tPaymentInfo);
/**
* 缴费库批量导入社保
* @param inputStream
......
......@@ -5129,6 +5129,194 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
/**
* @Author huyc
* @Description 社保批量导入办理
* @Date 15:46 2023/5/15
* @Param
* @return
**/
@Transactional(rollbackFor = Exception.class)
@ShardingTransactionType(TransactionType.BASE)
@Override
public R<List<ErrorMessage>> importSocialHandler(InputStream inputStream) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
R.failed(CommonConstants.USER_FAIL);
}
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<SocialImportHandleVo> util1 = new ExcelUtil<>(SocialImportHandleVo.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, SocialImportHandleVo.class, new ReadListener<SocialImportHandleVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<SocialImportHandleVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(SocialImportHandleVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessage.setData(data);
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
socialImportHandle(cachedDataList, errorMessageList,user);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return this.judgeAllMessage(errorMessageList);
}
/**
* @Author huych
* @Description 社保批量导入办理(1养老 2医疗 3失业 4工伤 5生育 6大病)
* @Date 16:45 2023/5/15
* @Param
* @return
**/
public void socialImportHandle(List<SocialImportHandleVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user) {
if (!Common.isNotNull(excelVOList)) {
return;
}
// 个性化校验逻辑
SocialImportHandleVo excel;
SocialHandleSearchVo tDispatchInfo = new SocialHandleSearchVo();
tDispatchInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
menuUtil.setAuthSql(user, tDispatchInfo);
if (Common.isNotNull(tDispatchInfo.getAuthSql()) && tDispatchInfo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDispatchInfo.setAuthSql(tDispatchInfo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN"));
}
tDispatchInfo.setCreateBy(user.getId());
List<TDispatchInfo> dispatchInfos = baseMapper.getTDispatchSocialHandleNoPage(tDispatchInfo, excelVOList.stream()
.map(SocialImportHandleVo::getEmpIdcard).collect(Collectors.toList()),null);
Map<String, TDispatchInfo> dispatchMap = new HashMap<>();
if (Common.isNotNull(dispatchInfos)) {
dispatchMap = dispatchInfos.stream().collect(Collectors.toMap(TDispatchInfo::getEmpIdcard, TDispatchInfo -> TDispatchInfo));
}
TDispatchInfo dispatch;
ErrorMessage errorMessage;
List<ErrorMessage> messageList = new ArrayList<>();
StringBuilder socialSucessType = new StringBuilder();
StringBuilder socialFailureType = new StringBuilder();
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
//身份证加任一险种必填
if (Common.isEmpty(excel.getDbHandleStatus()) && Common.isEmpty(excel.getGsHandleStatus())
&& Common.isEmpty(excel.getSjHandleStatus()) && Common.isEmpty(excel.getSyHandleStatus())
&& Common.isEmpty(excel.getYbHandleStatus()) && Common.isEmpty(excel.getYlHandleStatus())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_HANDLE_NOT_EMPY), excel));
continue;
}
// 任一险种办理失败,失败类型必填
if (Common.isEmpty(excel.getReasonType()) && (CommonConstants.ONE_STRING.equals(excel.getDbHandleStatus())
|| CommonConstants.ONE_STRING.equals(excel.getGsHandleStatus()) || CommonConstants.ONE_STRING.equals(excel.getSjHandleStatus())
|| CommonConstants.ONE_STRING.equals(excel.getSyHandleStatus()) || CommonConstants.ONE_STRING.equals(excel.getYbHandleStatus())
|| CommonConstants.ONE_STRING.equals(excel.getYlHandleStatus()))) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_HANDLE_REASON_NOT_EMPY), excel));
continue;
}
dispatch = dispatchMap.get(excel.getEmpIdcard());
if (Common.isEmpty(dispatch)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.SOCIAL_IMPORT_HANDLE_NOT_EMPY), excel));
continue;
}
//判断办理的险种
if (CommonConstants.ZERO_STRING.equals(excel.getYlHandleStatus())) {
socialSucessType.append("1,");
} else if (CommonConstants.ONE_STRING.equals(excel.getYlHandleStatus())) {
socialFailureType.append("1,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getYbHandleStatus())) {
socialSucessType.append("2,");
} else if (CommonConstants.ONE_STRING.equals(excel.getYbHandleStatus())) {
socialFailureType.append("2,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getSyHandleStatus())) {
socialSucessType.append("3,");
} else if (CommonConstants.ONE_STRING.equals(excel.getSyHandleStatus())) {
socialFailureType.append("3,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getGsHandleStatus())) {
socialSucessType.append("4,");
} else if (CommonConstants.ONE_STRING.equals(excel.getGsHandleStatus())) {
socialFailureType.append("4,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getSjHandleStatus())) {
socialSucessType.append("5,");
} else if (CommonConstants.ONE_STRING.equals(excel.getSjHandleStatus())) {
socialFailureType.append("5,");
}
if (CommonConstants.ZERO_STRING.equals(excel.getDbHandleStatus())) {
socialSucessType.append("6,");
} else if (CommonConstants.ONE_STRING.equals(excel.getDbHandleStatus())) {
socialFailureType.append("6,");
}
try {
//办理成功处理
if (socialSucessType.length() > 1) {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user
, 0, CommonConstants.ONE_STRING, "", socialSucessType.substring(0, socialSucessType.length() - 1), excel.getRemark());
}
//办理失败处理
if (socialFailureType.length() > 1) {
// 执行数据插入操作 组装
messageList = addBatchApplyHandle(Collections.singletonList(dispatch.getId()), CommonConstants.ZERO_STRING, user
, 1, CommonConstants.TWO_STRING, excel.getReasonType(), socialFailureType.substring(0, socialFailureType.length() - 1), excel.getReasonType() + CommonConstants.COLON_STRING + excel.getRemark());
}
if (Common.isNotNull(messageList)) {
errorMessage = messageList.get(CommonConstants.ZERO_INT);
errorMessage.setData(excel);
} else {
errorMessage = new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN, excel);
}
errorMessageList.add(errorMessage);
} catch (Exception e) {
log.error("批量导入办理异常:", e);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_FAILED, excel));
}
}
}
@Override
public R<Boolean> updateExportSocialFlagById(String id,String status) {
return R.ok(baseMapper.updateExportSocialFlagById(id,status) >= 0);
......
......@@ -149,6 +149,27 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return baseMapper.getTPaymentInfoPage(page, tPaymentInfo);
}
/**
* 缴费库查询详情
* @param tPaymentInfo
* @return
*/
@Override
public TPaymentInfoNewVo getTPaymentInfoNewPageInfo(TPaymentInfoSearchVo tPaymentInfo) {
return baseMapper.getTPaymentInfoNewPageInfo(tPaymentInfo);
}
/**
* 缴费库分页查询
*
* @param tPaymentInfo 缴费库
* @return
*/
@Override
public IPage<TPaymentInfoNewVo> getTPaymentInfoNewPage(Page<TPaymentInfo> page, TPaymentInfoSearchVo tPaymentInfo) {
return baseMapper.getTPaymentInfoNewPage(page, tPaymentInfo);
}
/**
* 缴费库批量导出
*
......@@ -991,8 +1012,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
if (!isTrueAdder) {
errorMessageMap.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "无对应员工" +
infoVo.getEmpIdcard() + "的社保数据(请查验社保缴纳地)"));
errorMessageMap.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的社保数据(请查验社保缴纳地)"));
continue;
}
} else {
......@@ -1727,9 +1748,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
if (!isTrueAdder) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(), "无对应员工" + infoVo.getEmpName() +
CommonConstants.DOWN_LINE_STRING + infoVo.getEmpIdcard()
+ "的公积金数据(请查验公积金缴纳地)!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的公积金数据(请查验公积金缴纳地)!"));
continue;
}
} else {
......@@ -1881,6 +1901,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ paymentInfo.getProvidentCreateMonth().trim()
+ CommonConstants.DOWN_LINE_STRING
+ BigDecimalUtils.safeAdd(paymentInfo.getProvidentSum()).doubleValue(), paymentInfo);
} else {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的公积金数据(请查验公积金缴纳地)!"));
}
}
}
......@@ -2193,11 +2216,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (socialThreeCheckBase(errorMessageList, infoVo, type)) {
continue;
}
//采用客服导入的地址
areaArray = infoVo.getSocialPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
infoVo = initAddressThree(areaArray, areaMap2, infoVo);
//无对应员工的社保数据
if (socialMap.size() > CommonConstants.ZERO_INT) {
//采用客服导入的地址
areaArray = infoVo.getSocialPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
infoVo = initAddressThree(areaArray, areaMap2, infoVo);
if (null == infoVo.getSocialProvince() || null == infoVo.getSocialCity()) {
errorMessageList.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "社保缴纳地填写错误,请核实后再次尝试!"));
continue;
......@@ -2237,8 +2260,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
if (!isTrueAdder) {
errorMessageList.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(), "无对应员工" + infoVo.getEmpIdcard() +
"的社保数据(请查验社保缴纳地)"));
errorMessageList.put(UUID.randomUUID().toString(),new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName(),
"无对应员工(身份证:" + infoVo.getEmpIdcard() + ")" + "的社保数据(请查验社保缴纳地)"));
continue;
}
} else {
......
......@@ -1065,6 +1065,17 @@
left join t_social_info s on a.SOCIAL_ID = s.id
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 社保办理数据查询-->
<select id="getTDispatchSocialHandleNoPage" resultMap="dispatchPageMap">
SELECT
<include refid="Base_Column_List"/>,
a.SOCIAL_HOUSEHOLD_NAME,a.EXPORT_SOCIAL_FLAG
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
<include refid="where_getSocialRecordNoPage"/>
</select>
<!--tDispatchInfo 公积金办理数据查询-->
<select id="getTDispatchFundHandlePage" resultMap="dispatchPageMap">
SELECT
......@@ -1298,6 +1309,114 @@
</where>
</sql>
<sql id="where_getSocialRecordNoPage">
<where>
s.DELETE_FLAG = 0
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
/** 社保办理状态:0待办理/1已办理2办理失败3已派减4 办理中 5 部分办理失败 派单社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3 部分办理成功 4 办理中 **/
/*社保代办理 1.派单审核通过 2.派增(type=0):待办理(social_handle_status='0') or 派减(type=1):已办理完成或部分办理失败 且已派减*/
AND a.social_id is not null
AND a.STATUS = "2"
and (( a.type = '0' AND (s.HANDLE_STATUS = "0" or s.HANDLE_STATUS = "4") ) or ( a.type ='1' AND s.HANDLE_STATUS in ('1','5','6','3','7') and s.REDUCE_CAN = '1'))
and a.SOCIAL_HANDLE_STATUS in ('0','4')
<if test="tDispatchInfo.empTypeList != null ">
AND a.EMP_TYPE IN
<foreach collection="tDispatchInfo.empTypeList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.dispatchItems != null and tDispatchInfo.dispatchItems.size >0">
AND
<foreach item="item" index="index" collection="tDispatchInfo.dispatchItems" open="(" separator="or" close=")">
INSTR(a.DISPATCH_ITEM,#{item})
</foreach>
</if>
<if test="tDispatchInfo.type != null and tDispatchInfo.type.trim() != ''">
AND a.TYPE = #{tDispatchInfo.type}
</if>
<if test="tDispatchInfo.socialProvince != null and tDispatchInfo.socialProvince!= null">
AND s.social_province = #{tDispatchInfo.socialProvince}
<if test="tDispatchInfo.socialCity != null and tDispatchInfo.socialCity!= null">
AND s.social_city = #{tDispatchInfo.socialCity}
</if>
<if test="tDispatchInfo.socialTown != null and tDispatchInfo.socialTown!= null">
AND s.social_town = #{tDispatchInfo.socialTown}
</if>
</if>
<if test="tDispatchInfo.empName != null and tDispatchInfo.empName.trim() != ''">
AND a.EMP_NAME like concat('%',#{tDispatchInfo.empName},'%')
</if>
<if test="tDispatchInfo.empIdcard != null and tDispatchInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD like concat('%',#{tDispatchInfo.empIdcard},'%')
</if>
<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
AND a.STATUS = #{tDispatchInfo.status}
</if>
<if test="tDispatchInfo.settleDomain != null and tDispatchInfo.settleDomain.trim() != ''">
AND a.SETTLE_DOMAIN = #{tDispatchInfo.settleDomain}
</if>
<if test="tDispatchInfo.settleDomainCode != null and tDispatchInfo.settleDomainCode.trim() != ''">
AND a.SETTLE_DOMAIN_CODE = #{tDispatchInfo.settleDomainCode}
</if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if>
<if test="tDispatchInfo.createName != null and tDispatchInfo.createName.trim() != ''">
AND a.CREATE_NAME = #{tDispatchInfo.createName}
</if>
<if test="tDispatchInfo.settleDomainName != null and tDispatchInfo.settleDomainName.trim() != ''">
AND a.SETTLE_DOMAIN_NAME like CONCAT(CONCAT(#{tDispatchInfo.settleDomainName}), '%')
</if>
<if test="tDispatchInfo.belongUnitName != null and tDispatchInfo.belongUnitName.trim() != ''">
AND a.BELONG_UNIT_NAME = #{tDispatchInfo.belongUnitName}
</if>
<if test="tDispatchInfo.createTimeEnd != null">
AND a.CREATE_TIME <![CDATA[<=]]> #{tDispatchInfo.createTimeEnd}
</if>
<if test="tDispatchInfo.createTimeStart != null">
AND a.CREATE_TIME <![CDATA[>=]]> #{tDispatchInfo.createTimeStart}
</if>
<if test="tDispatchInfo.auditTimeStart != null">
AND a.AUDIT_TIME <![CDATA[>=]]> #{tDispatchInfo.auditTimeStart}
</if>
<if test="tDispatchInfo.auditTimeEnd != null">
AND a.AUDIT_TIME <![CDATA[<=]]> #{tDispatchInfo.auditTimeEnd}
</if>
<if test="tDispatchInfo.auditUserName != null and tDispatchInfo.auditUserName.trim() != ''">
AND a.AUDIT_USER_NAME like concat('%',#{tDispatchInfo.auditUserName},'%')
</if>
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME like CONCAT(CONCAT(#{tDispatchInfo.socialHouseholdName}), '%')
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql}
</if>
<if test="tDispatchInfo.exportSocialFlag != null and tDispatchInfo.exportSocialFlag.trim() != ''">
AND a.EXPORT_SOCIAL_FLAG = ${tDispatchInfo.exportSocialFlag}
</if>
</if>
<if test="idCards != null and idCards.size > 0">
AND a.emp_idcard in
<foreach item="items" index="index" collection="idCards" open="(" separator="," close=")">
#{items}
</foreach>
</if>
group by a.id
order by a.APPLY_NO desc
</where>
</sql>
<sql id="where_getFundRecord">
a.DELETE_FLAG = 0
<if test="idsStr != null and idsStr.size > 0">
......
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