Commit 798adb29 authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents 6ad058e5 460b6c68
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -116,6 +117,7 @@ public class TSettleDomain extends BaseEntity { ...@@ -116,6 +117,7 @@ public class TSettleDomain extends BaseEntity {
* 最后审核时间 * 最后审核时间
*/ */
@Schema(description = "最后审核时间") @Schema(description = "最后审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime lastAuditDate; private LocalDateTime lastAuditDate;
/** /**
...@@ -182,6 +184,7 @@ public class TSettleDomain extends BaseEntity { ...@@ -182,6 +184,7 @@ public class TSettleDomain extends BaseEntity {
* 首次审核通过时间 * 首次审核通过时间
*/ */
@Schema(description = "首次审核通过时间") @Schema(description = "首次审核通过时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime firstPassTime; private LocalDateTime firstPassTime;
/** /**
...@@ -218,6 +221,7 @@ public class TSettleDomain extends BaseEntity { ...@@ -218,6 +221,7 @@ public class TSettleDomain extends BaseEntity {
* 停止时间 * 停止时间
*/ */
@Schema(description = "停止时间") @Schema(description = "停止时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime stopDate; private LocalDateTime stopDate;
/** /**
...@@ -284,12 +288,14 @@ public class TSettleDomain extends BaseEntity { ...@@ -284,12 +288,14 @@ public class TSettleDomain extends BaseEntity {
* 审核人审核的时间 * 审核人审核的时间
*/ */
@Schema(description = "审核人审核的时间") @Schema(description = "审核人审核的时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime auditTime; private LocalDateTime auditTime;
/** /**
* 经理审核时间 * 经理审核时间
*/ */
@Schema(description = "经理审核时间") @Schema(description = "经理审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime managerAuditTime; private LocalDateTime managerAuditTime;
/** /**
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
public class TSettleDomainListVo { public class TSettleDomainListVo {
...@@ -12,4 +13,6 @@ public class TSettleDomainListVo { ...@@ -12,4 +13,6 @@ public class TSettleDomainListVo {
*/ */
private List<TSettleDomainSelectVo> listSelectVO; private List<TSettleDomainSelectVo> listSelectVO;
private Map<String,TSettleDomainSelectVo> mapSlectVo;
} }
...@@ -35,7 +35,6 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -35,7 +35,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
...@@ -149,8 +148,8 @@ public class TSettleDomainController { ...@@ -149,8 +148,8 @@ public class TSettleDomainController {
**/ **/
@Inner @Inner
@PostMapping("/getSettleDomainSelectVoById") @PostMapping("/getSettleDomainSelectVoById")
public TSettleDomainSelectVo getInnerSettleDomainSelectVoByUserId(@RequestParam String id) { public TSettleDomainSelectVo getInnerSettleDomainSelectVoByUserId(@RequestBody TSettleDomainSelectVo settleDomainSelectVo) {
return tSettleDomainService.selectSettleDomainSelectVosById(id); return tSettleDomainService.selectSettleDomainSelectVosById(settleDomainSelectVo);
} }
/** /**
......
...@@ -55,7 +55,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> { ...@@ -55,7 +55,7 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
* @Author fxj * @Author fxj
* @Date 2019-12-24 * @Date 2019-12-24
**/ **/
TSettleDomainSelectVo selectSettleDomainSelectVosById(String id); TSettleDomainSelectVo selectSettleDomainSelectVosById(TSettleDomainSelectVo settleDomainSelectVo);
/** /**
* 获取所有客户单位的结算主体信息 * 获取所有客户单位的结算主体信息
......
...@@ -1196,7 +1196,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1196,7 +1196,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
list = gettEmpProInfoExportVos(idstr, projectDTO); list = gettEmpProInfoExportVos(idstr, projectDTO);
ServletOutputStream out = null; ServletOutputStream out = null;
if (list != null && !list.isEmpty()) { if (list == null || list.isEmpty()) {
list = new ArrayList<>(); list = new ArrayList<>();
} }
try { try {
......
...@@ -87,15 +87,15 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -87,15 +87,15 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
} }
/** /**
* @param id * @param settleDomainSelectVo
* @Author: wangan * @Author: wangan
* @Date: 2019/10/18 * @Date: 2019/10/18
* @Description: dataCheckDepart * @Description: dataCheckDepart
* @return: com.yifu.cloud.v1.hrms.api.vo.TSettleDomainSelectVo * @return: com.yifu.cloud.v1.hrms.api.vo.TSettleDomainSelectVo
**/ **/
@Override @Override
public TSettleDomainSelectVo selectSettleDomainSelectVosById(String id) { public TSettleDomainSelectVo selectSettleDomainSelectVosById(TSettleDomainSelectVo settleDomainSelectVo) {
return baseMapper.selectSettleDomainSelectVosById(id); return baseMapper.selectSettleDomainSelectVosById(settleDomainSelectVo.getId());
} }
@Override @Override
......
...@@ -422,5 +422,8 @@ public interface CommonConstants { ...@@ -422,5 +422,8 @@ public interface CommonConstants {
public static final String SUCCESS_MSG_PREFIX = "success="; public static final String SUCCESS_MSG_PREFIX = "success=";
// 社保细分类型 hgw 2021-6-9 17:54:08
public static final String[] SOCIAL_HANDLE_TYPE = {"0","养老", "医疗", "失业", "工伤", "生育", "大病"};
public static final int SIXTY_INT = 60; public static final int SIXTY_INT = 60;
} }
...@@ -1247,6 +1247,15 @@ public class DateUtil { ...@@ -1247,6 +1247,15 @@ public class DateUtil {
return sdf.format(cal.getTime()); return sdf.format(cal.getTime());
} }
public static Date addMonthByDate(Date date, int mnt) {
Calendar cal = Calendar.getInstance();
if (date != null) {
cal.setTime(date);
}
cal.add(Calendar.MONTH, mnt);
return cal.getTime();
}
/** /**
* @param mnt 增减日的 值 * @param mnt 增减日的 值
* @Description: 增减日 * @Description: 增减日
......
...@@ -11,7 +11,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; ...@@ -11,7 +11,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
...@@ -82,7 +81,9 @@ public class ArchivesDaprUtil { ...@@ -82,7 +81,9 @@ public class ArchivesDaprUtil {
* @return * @return
**/ **/
public R<TSettleDomainSelectVo> getSettleDomainSelectVoById(String departId){ public R<TSettleDomainSelectVo> getSettleDomainSelectVoById(String departId){
R<TSettleDomainSelectVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainSelectVoById",departId, Map.class, SecurityConstants.FROM_IN); TSettleDomainSelectVo settleDomainSelectVo = new TSettleDomainSelectVo();
settleDomainSelectVo.setId(departId);
R<TSettleDomainSelectVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/getSettleDomainSelectVoById",settleDomainSelectVo, TSettleDomainSelectVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取派单校验需要的档案信息失败!"); return R.failed("获取派单校验需要的档案信息失败!");
} }
...@@ -97,7 +98,7 @@ public class ArchivesDaprUtil { ...@@ -97,7 +98,7 @@ public class ArchivesDaprUtil {
* @return * @return
**/ **/
public R<TSettleDomainListVo> selectAllSettleDomainSelectVos(){ public R<TSettleDomainListVo> selectAllSettleDomainSelectVos(){
R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/selectAllSettleDomainSelectVos","", Map.class, SecurityConstants.FROM_IN); R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/tsettledomain/selectAllSettleDomainSelectVos","", TSettleDomainListVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("获取所有客户单位的结算主体信息失败!"); return R.failed("获取所有客户单位的结算主体信息失败!");
} }
......
...@@ -23,9 +23,16 @@ public class DispatchConstants { ...@@ -23,9 +23,16 @@ public class DispatchConstants {
public static final String EMP_PHONE_INVALID = "档案手机号无效,请更新档案或模板的手机号码!"; public static final String EMP_PHONE_INVALID = "档案手机号无效,请更新档案或模板的手机号码!";
public static final String DISPATCH_PHONE_NOT_EMPTY = "派单手机号不可为空,请更新档案或模板的手机号码!"; public static final String DISPATCH_PHONE_NOT_EMPTY = "派单手机号不可为空,请更新档案或模板的手机号码!";
public static final String DISPATCH_ADD = "派增";
public static final String DISPATCH_REDUCE = "派减";
public static final String DISPATCH_SOCIAL_ADD = "社保派增";
public static final String DISPATCH_SOCIAL_HANDLE_SUCCESS = "办理成功:";
public static final String DISPATCH_SOCIAL_HANDLE_FAIL = "办理失败:";
public static final String DISPATCH_FUND_ADD_SUCCESS = "公积金派增办理成功:";
public static final String DISPATCH_FUND_ADD_FAIL = "公积金派增办理失败:";
/** /**
* 社保派单 * 社保派单
* '缴纳类型(0最低缴纳、1自定义缴纳、2最高缴纳) PAYMENT_TYPE * '缴纳类型(0最低缴纳、1自定义缴纳、2最高缴纳) PAYMENT_TYPE
*/ */
...@@ -56,7 +63,6 @@ public class DispatchConstants { ...@@ -56,7 +63,6 @@ public class DispatchConstants {
* @Date 2020-10-13 * @Date 2020-10-13
* @param null * @param null
* @return * @return
* @see com.yifu.cloud.v1.common.core.constant
**/ **/
public static final String SOCIAL_INFO= "tSocialInfo"; public static final String SOCIAL_INFO= "tSocialInfo";
/** /**
...@@ -65,7 +71,6 @@ public class DispatchConstants { ...@@ -65,7 +71,6 @@ public class DispatchConstants {
* @Date 2020-10-13 * @Date 2020-10-13
* @param null * @param null
* @return * @return
* @see com.yifu.cloud.v1.common.core.constant
**/ **/
public static final String PROVIDENT_INFO= "tProvidentFund"; public static final String PROVIDENT_INFO= "tProvidentFund";
......
...@@ -457,6 +457,11 @@ public class SysBaseSetInfo extends BaseEntity { ...@@ -457,6 +457,11 @@ public class SysBaseSetInfo extends BaseEntity {
@ExcelProperty("执行月份") @ExcelProperty("执行月份")
private String doMonth; private String doMonth;
@ExcelAttribute(name = "是否新数据:0否1是。为1,将同步社保公积金查询、预估库。其余值,不同步")
@Schema(description = "是否新数据:0否1是。为1,将同步社保公积金查询、预估库。其余值,不同步")
@ExcelProperty("是否新数据:0否1是。为1,将同步社保公积金查询、预估库。其余值,不同步")
private String isNew;
@Schema(description = "适用月") @Schema(description = "适用月")
@TableField(exist = false) @TableField(exist = false)
private String applyDate; private String applyDate;
......
...@@ -357,19 +357,19 @@ public class TDispatchInfo extends BaseEntity { ...@@ -357,19 +357,19 @@ public class TDispatchInfo extends BaseEntity {
/** /**
* 社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减(已废弃) * 社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3 部分办理成功 4 办理中
*/ */
@Length(max = 1, message = "社保办理状态 不能超过1个字符" ) @Length(max = 1, message = "社保办理状态 不能超过1个字符" )
@ExcelAttribute(name = "社保办理状态", maxLength = 1) @ExcelAttribute(name = "社保办理状态", maxLength = 1)
@Schema(description = "社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3 部分办理成功 " ) @Schema(description = "社保办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3 部分办理成功 4 办理中" )
@ExcelProperty("社保办理状态" ) @ExcelProperty("社保办理状态" )
private String socialHandleStatus; private String socialHandleStatus;
/** /**
* 公积金办理状态:0 未办理 1办理成功 2 办理失败 * 公积金办理状态:0 未办理 1办理成功 2 办理失败 3 已派减
*/ */
@Length(max = 1, message = "公积金办理状态 不能超过1个字符" ) @Length(max = 1, message = "公积金办理状态 不能超过1个字符" )
@ExcelAttribute(name = "公积金办理状态", maxLength = 1) @ExcelAttribute(name = "公积金办理状态", maxLength = 1)
@Schema(description = "公积金办理状态:0 未办理 1办理成功 2 办理失败" ) @Schema(description = "公积金办理状态:0 未办理 1办理成功 2 办理失败 3 已派减" )
@ExcelProperty("公积金办理状态" ) @ExcelProperty("公积金办理状态" )
private String fundHandleStatus; private String fundHandleStatus;
/** /**
......
...@@ -493,6 +493,12 @@ public class TForecastLibrary extends BaseEntity { ...@@ -493,6 +493,12 @@ public class TForecastLibrary extends BaseEntity {
@ExcelAttribute(name = "类型:0社保;1公积金") @ExcelAttribute(name = "类型:0社保;1公积金")
@ExcelProperty("类型:0社保;1公积金") @ExcelProperty("类型:0社保;1公积金")
private Integer dataType; private Integer dataType;
/**
* 数据类型:预估/差额(汉字)
*/
@ExcelAttribute(name = "数据类型:预估/差额")
@ExcelProperty("数据类型:预估/差额")
private String diffType;
@TableField(exist = false) @TableField(exist = false)
private List<String> idList; private List<String> idList;
......
...@@ -130,10 +130,10 @@ public class TProvidentFund extends BaseEntity { ...@@ -130,10 +130,10 @@ public class TProvidentFund extends BaseEntity {
* 办理状态(0待办理/1已办理2办理失败3已派减) * 办理状态(0待办理/1已办理2办理失败3已派减)
*/ */
@NotBlank(message = "办理状态(0待办理/1已办理)不能为空" ) @NotBlank(message = "办理状态(0待办理/1已办理)不能为空" )
@Length(max = 32, message = "办理状态(0待办理/1已办理) 不能超过32个字符" ) @Length(max = 32, message = "办理状态不能超过32个字符" )
@ExcelAttribute(name = "办理状态(0待办理/1已办理)", isNotEmpty = true, errorInfo = "办理状态(0待办理/1已办理)不能为空", maxLength = 32) @ExcelAttribute(name = "办理状态", isNotEmpty = true, errorInfo = "办理状态不能为空", maxLength = 32)
@Schema(description = "办理状态(0待办理/1已办理2办理失败3已派减)" ) @Schema(description = "办理状态(0待办理/1已办理2办理失败3已派减)" )
@ExcelProperty("办理状态(0待办理/1已办理)" ) @ExcelProperty("办理状态" )
private String handleStatus; private String handleStatus;
/** /**
* 废弃状态(0正常/1已废弃) * 废弃状态(0正常/1已废弃)
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.social.entity; package com.yifu.cloud.plus.v1.yifu.social.entity;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
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.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
...@@ -249,11 +247,11 @@ public class TSocialFundInfo extends BaseEntity { ...@@ -249,11 +247,11 @@ public class TSocialFundInfo extends BaseEntity {
@ExcelProperty("公积金缴纳地-县" ) @ExcelProperty("公积金缴纳地-县" )
private String fundTown; private String fundTown;
/** /**
* 社保派增状态:0待审核、1待办理、2办理成功、3部分办理失败、4办理失败 5 审核不通过 * 社保派增状态:0待审核、1待办理、2办理成功、3部分办理失败、4办理失败 5 审核不通过 6 办理中
*/ */
@Length(max = 1, message = "社保派增状态 不能超过1个字符" ) @Length(max = 1, message = "社保派增状态 不能超过1个字符" )
@ExcelAttribute(name = "社保派增状态", maxLength = 1) @ExcelAttribute(name = "社保派增状态", maxLength = 1)
@Schema(description = "社保派增状态:0待审核、1待办理、2办理成功、3部分办理失败、4办理失败 、5审核不通过" ) @Schema(description = "社保派增状态:0待审核、1待办理、2办理成功、3部分办理失败、4办理失败 、5审核不通过6 办理中" )
@ExcelProperty("社保派增状态" ) @ExcelProperty("社保派增状态" )
private String socialAddStatus; private String socialAddStatus;
/** /**
...@@ -465,6 +463,7 @@ public class TSocialFundInfo extends BaseEntity { ...@@ -465,6 +463,7 @@ public class TSocialFundInfo extends BaseEntity {
@ExcelAttribute(name = "社保停缴日期", isDate = true) @ExcelAttribute(name = "社保停缴日期", isDate = true)
@Schema(description = "社保停缴日期" ) @Schema(description = "社保停缴日期" )
@ExcelProperty("社保停缴日期" ) @ExcelProperty("社保停缴日期" )
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date socialReduceDate; private Date socialReduceDate;
/** /**
* 是否可补缴 0:是,1:否 * 是否可补缴 0:是,1:否
......
...@@ -234,12 +234,12 @@ public class TSocialInfo extends BaseEntity { ...@@ -234,12 +234,12 @@ public class TSocialInfo extends BaseEntity {
@ExcelProperty("审核状态" ) @ExcelProperty("审核状态" )
private String auditStatus; private String auditStatus;
/** /**
* 办理状态 * 办理状态:0待办理/1已办理2办理失败3已派减 4 办理中 5 部分办理失败
*/ */
@NotBlank(message = "办理状态不能为空" ) @NotBlank(message = "办理状态不能为空" )
@Length(max = 32, message = "办理状态 不能超过32个字符" ) @Length(max = 32, message = "办理状态 不能超过32个字符" )
@ExcelAttribute(name = "办理状态", isNotEmpty = true, errorInfo = "办理状态不能为空", maxLength = 32) @ExcelAttribute(name = "办理状态", isNotEmpty = true, errorInfo = "办理状态不能为空", maxLength = 32)
@Schema(description = "办理状态:0待办理/1已办理2办理失败3已派减" ) @Schema(description = "办理状态:0待办理/1已办理2办理失败3已派减4 办理中 5 部分办理失败" )
@ExcelProperty("办理状态" ) @ExcelProperty("办理状态" )
private String handleStatus; private String handleStatus;
/** /**
......
...@@ -17,6 +17,9 @@ import java.time.LocalDateTime; ...@@ -17,6 +17,9 @@ import java.time.LocalDateTime;
@Data @Data
public class TPreDispatchExportVo implements Serializable { public class TPreDispatchExportVo implements Serializable {
@ExcelAttribute(name = "主键", needExport = true)
private String id;
/** /**
* 0 派增 1 派减 * 0 派增 1 派减
*/ */
......
...@@ -9,4 +9,6 @@ public class SocialConstants { ...@@ -9,4 +9,6 @@ public class SocialConstants {
// 社保补缴配置有误! // 社保补缴配置有误!
public static final String SOCIAL_SET_ERROR = "社保补缴配置有误!"; public static final String SOCIAL_SET_ERROR = "社保补缴配置有误!";
public static final String EMP_NAME_ERROR = "员工姓名错误!"; public static final String EMP_NAME_ERROR = "员工姓名错误!";
public static final String DIFF_TYPE_ONE = "预估";
public static final String DIFF_TYPE_TWO = "差额";
} }
...@@ -244,29 +244,29 @@ public class TDispatchInfoController { ...@@ -244,29 +244,29 @@ public class TDispatchInfoController {
public R<List<ErrorMessage>> addApplyAudit(@RequestParam(name = "ids", required = true) String ids, public R<List<ErrorMessage>> addApplyAudit(@RequestParam(name = "ids", required = true) String ids,
@RequestParam(name = "auditStatus", required = true) String auditStatus, @RequestParam(name = "auditStatus", required = true) String auditStatus,
@RequestParam(name = "auditRemark", required = false) String auditRemark) { @RequestParam(name = "auditRemark", required = false) String auditRemark) {
YifuUser user = SecurityUtils.getUser(); return tDispatchInfoService.addApplyAudit(ids,auditStatus,auditRemark);
if (null == user) { }
return R.failed(CommonConstants.USER_FAIL);
} /**
try { * 派单申请办理
if (!Common.isNotNull(ids)) { * hgw社保办理
return R.failed(DispatchConstants.DISPATCH_ID_NOT_EMPTY); * @param ids
} * @param handleStatus 1 办理成功 2 办理失败
Integer flag = 1; * @param handleRemark
if (CommonConstants.ONE_STRING.equals(auditStatus)) { * @param typeSub 0 社保 1 公积金
//审核通过 * @param socialType (1养老 2医疗 3失业 4工伤 5生育 6大病)
flag = CommonConstants.ZERO_INT; * @return
} else if (CommonConstants.TWO_STRING.equals(auditStatus)) { * @Author fxj
//审核不通过 * @Date 2019-09-27
flag = CommonConstants.ONE_INT; **/
} else { @Operation(description = "派单批量办理,传参派单ID hasPermission('wxhr:tdispatchinfo_addApplyHandle')")
return R.failed("派单审核状态参数异常:0待审核 1审核通过 2审核不通过"); @PostMapping("/addApplyHandle")
} @PreAuthorize("@pms.hasPermission('wxhr:tdispatchinfo_addApplyHandle')")
List<ErrorMessage> errorInfo = tDispatchInfoService.addBatchApplyAudit(Common.initStrToList(ids, CommonConstants.COMMA_STRING), user, flag, auditStatus, null==auditRemark?"":auditRemark); public R<List<ErrorMessage>> addApplyHandle(@RequestParam(name = "ids", required = true) String ids,
return R.ok(errorInfo,"派单审核结果:"); @RequestParam(name = "typeSub", required = true) String typeSub,
} catch (Exception e) { @RequestParam(name = "auditStatus", required = true) String handleStatus,
log.error("派单审核异常:" + e.getMessage()); @RequestParam(name = "auditRemark", required = false) String handleRemark,
return R.failed("数据异常,派单审核失败!"); @RequestParam(name = "socialType", required = false) String socialType) {
} return tDispatchInfoService.addApplyHandle(ids,typeSub,handleStatus,handleRemark,socialType);
} }
} }
...@@ -56,4 +56,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> { ...@@ -56,4 +56,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
DispatchDetailVo getSocialAndFundInfoById(String id); DispatchDetailVo getSocialAndFundInfoById(String id);
List<ErrorMessage> addBatchApplyAudit(List<String> initStrToList, YifuUser user, Integer flag, String auditStatus, String auditRemark); List<ErrorMessage> addBatchApplyAudit(List<String> initStrToList, YifuUser user, Integer flag, String auditStatus, String auditRemark);
R<List<ErrorMessage>> addApplyAudit(String ids,String auditStatus,String auditRemark);
R<List<ErrorMessage>> addApplyHandle(String ids,String typeSub,String handleStatus,String handleRemark,String socialType);
} }
...@@ -68,4 +68,29 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> { ...@@ -68,4 +68,29 @@ public interface TForecastLibraryService extends IService<TForecastLibrary> {
**/ **/
R<String> updateToneForecastLibary(TSocialFundInfo socialFundInfo); R<String> updateToneForecastLibary(TSocialFundInfo socialFundInfo);
/**
* @param socialFundInfo
* @Description: 派单变更预估库
* @Author: hgw
* @Date: 2022/7/26 19:02
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> updateForecastLibaryByDispatch(TSocialFundInfo socialFundInfo);
/**
* @Description: 基数变更,同步社保公积金查询、预估库 TODO-加定时器
* @Author: hgw
* @Date: 2022/7/26 19:09
* @return: void
**/
void updateForecastLibaryBySysBase();
/**
* @Description: 每月定时预估库 TODO-加定时器
* @Author: hgw
* @Date: 2022/7/26 19:09
* @return: void
**/
void everyMonthCreateForecastLibary();
} }
...@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; 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.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
...@@ -150,9 +151,9 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -150,9 +151,9 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
return R.failed("对应户、地市、有效期的基数配置已存在!"); return R.failed("对应户、地市、有效期的基数配置已存在!");
} }
// 将上一个无截止月的增加截止月 // 将上一个无截止月的增加截止月(本次起始月的上一个月)
if (lastBase != null) { if (lastBase != null) {
lastBase.setApplyEndDate(sysBaseSetInfo.getApplyStartDate()); lastBase.setApplyEndDate(DateUtil.addMonthByDate(sysBaseSetInfo.getApplyStartDate(), -1));
this.updateById(lastBase); this.updateById(lastBase);
} }
this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo); this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo);
......
...@@ -45,6 +45,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants; ...@@ -45,6 +45,7 @@ import com.yifu.cloud.plus.v1.yifu.social.constants.DispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*; import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*; import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo; import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
...@@ -56,15 +57,15 @@ import org.springframework.stereotype.Service; ...@@ -56,15 +57,15 @@ import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.sql.CommonDataSource;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.time.format.DateTimeFormatter.ofPattern;
/** /**
* 派单信息记录表 * 派单信息记录表
* *
...@@ -937,11 +938,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -937,11 +938,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
social.setPaymentType(excel.getPaymentType()); social.setPaymentType(excel.getPaymentType());
social.setRecordBase(excel.getRecordBase()); social.setRecordBase(excel.getRecordBase());
social.setPensionStart(excel.getPensionStart()); social.setPensionStart(excel.getPensionStart());
social.setMedicalStart(ifNull(excel.getMedicalStart(), excel.getPensionStart())); social.setMedicalStart(ServiceUtil.ifNull(excel.getMedicalStart(), excel.getPensionStart()));
social.setUnemployStart(ifNull(excel.getUnemployStart(), excel.getPensionStart())); social.setUnemployStart(ServiceUtil.ifNull(excel.getUnemployStart(), excel.getPensionStart()));
social.setBigailmentStart(ifNull(excel.getBigailmentStart(), excel.getPensionStart())); social.setBigailmentStart(ServiceUtil.ifNull(excel.getBigailmentStart(), excel.getPensionStart()));
social.setWorkInjuryStart(ifNull(excel.getWorkInjuryStart(), excel.getPensionStart())); social.setWorkInjuryStart(ServiceUtil.ifNull(excel.getWorkInjuryStart(), excel.getPensionStart()));
social.setBirthStart(ifNull(excel.getBirthStart(), excel.getPensionStart())); social.setBirthStart(ServiceUtil.ifNull(excel.getBirthStart(), excel.getPensionStart()));
if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())){ if (CommonConstants.ONE_STRING.equals(excel.getPaymentType())){
if (Common.isNotNull(socialSet.getProvince())){ if (Common.isNotNull(socialSet.getProvince())){
social.setSocialProvince(Integer.toString(socialSet.getProvince())); social.setSocialProvince(Integer.toString(socialSet.getProvince()));
...@@ -954,16 +955,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -954,16 +955,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
// 自定义各个基数起缴时间初试化 // 自定义各个基数起缴时间初试化
social.setPersonalPensionCardinal(excel.getPensionCardinal()); social.setPersonalPensionCardinal(excel.getPensionCardinal());
social.setPersonalMedicalCardinal(ifNull(excel.getMedicalCardinal(), excel.getPensionCardinal())); social.setPersonalMedicalCardinal(ServiceUtil.ifNull(excel.getMedicalCardinal(), excel.getPensionCardinal()));
social.setPersonalUnemploymentCardinal(ifNull(excel.getUnemploymentCardinal(), excel.getPensionCardinal())); social.setPersonalUnemploymentCardinal(ServiceUtil.ifNull(excel.getUnemploymentCardinal(), excel.getPensionCardinal()));
social.setPersonalBigailmentCardinal(ifNull(excel.getBigailmentCardinal(), excel.getPensionCardinal())); social.setPersonalBigailmentCardinal(ServiceUtil.ifNull(excel.getBigailmentCardinal(), excel.getPensionCardinal()));
social.setUnitPensionCardinal(excel.getPensionCardinal()); social.setUnitPensionCardinal(excel.getPensionCardinal());
social.setUnitMedicalCardinal(ifNull(excel.getMedicalCardinal(), excel.getPensionCardinal())); social.setUnitMedicalCardinal(ServiceUtil.ifNull(excel.getMedicalCardinal(), excel.getPensionCardinal()));
social.setUnitUnemploymentCardinal(ifNull(excel.getUnemploymentCardinal(), excel.getPensionCardinal())); social.setUnitUnemploymentCardinal(ServiceUtil.ifNull(excel.getUnemploymentCardinal(), excel.getPensionCardinal()));
social.setUnitWorkInjuryCardinal(ifNull(excel.getWorkInjuryCardinal(), excel.getPensionCardinal())); social.setUnitWorkInjuryCardinal(ServiceUtil.ifNull(excel.getWorkInjuryCardinal(), excel.getPensionCardinal()));
social.setUnitBigailmentCardinal(ifNull(excel.getBigailmentCardinal(), excel.getPensionCardinal())); social.setUnitBigailmentCardinal(ServiceUtil.ifNull(excel.getBigailmentCardinal(), excel.getPensionCardinal()));
social.setUnitBirthCardinal(ifNull(excel.getBirthCardinal(), excel.getPensionCardinal())); social.setUnitBirthCardinal(ServiceUtil.ifNull(excel.getBirthCardinal(), excel.getPensionCardinal()));
} }
// 获取到政策后封装相关数据 // 获取到政策后封装相关数据
if (Common.isNotNull(socialSet)){ if (Common.isNotNull(socialSet)){
...@@ -1107,20 +1108,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1107,20 +1108,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFundMap.put(excel.getEmpIdcard(),socialFund); socialFundMap.put(excel.getEmpIdcard(),socialFund);
} }
} }
private BigDecimal ifNull(BigDecimal old,BigDecimal last){
if (Common.isEmpty(old)){
return last;
}
return old;
}
private Date ifNull(Date old,Date last){
if (Common.isEmpty(old)){
return last;
}
return old;
}
private void initHoldInfo(List<String> socialholds, private void initHoldInfo(List<String> socialholds,
List<String> fundHolds, List<String> fundHolds,
Map<String, SysBaseSetInfo> socialHoldMap, Map<String, SysBaseSetInfo> socialHoldMap,
...@@ -1717,17 +1704,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1717,17 +1704,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
List<TDispatchInfo> dispatchs = baseMapper.selectList(Wrappers.<TDispatchInfo>query().lambda().in(TDispatchInfo::getId, idsList)); List<TDispatchInfo> dispatchs = baseMapper.selectList(Wrappers.<TDispatchInfo>query().lambda().in(TDispatchInfo::getId, idsList));
if (Common.isNotNull(dispatchs)) { if (Common.isNotNull(dispatchs)) {
// 获取所有派单查询信息 // 获取所有派单查询信息
Map<String,TSocialFundInfo> socialFundMap = new HashMap<>(); Map<String,TSocialFundInfo> socialFundMap = initSocialFundMap(dispatchs);
initSocialFundMap(dispatchs,socialFundMap);
try { try {
TSocialInfo socialInfo; TSocialInfo socialInfo;
TProvidentFund providentFund; TProvidentFund providentFund;
String remark; String remark;
TAuditInfo auditInfo = null; TAuditInfo auditInfo = null;
TSocialFundInfo sf; TSocialFundInfo sf = null;
Date now = new Date();
for (TDispatchInfo dis : dispatchs) { for (TDispatchInfo dis : dispatchs) {
remark = ""; remark = "";
sf = socialFundMap.get(dis.getEmpIdcard()); if (Common.isNotNull(socialFundMap)){
sf = socialFundMap.get(dis.getEmpIdcard());
}
if (Common.isEmpty(sf)){ if (Common.isEmpty(sf)){
errorList.add(new ErrorMessage(-1, "找不到员工社保公积金查询数据:" + dis.getEmpName())); errorList.add(new ErrorMessage(-1, "找不到员工社保公积金查询数据:" + dis.getEmpName()));
continue; continue;
...@@ -1757,7 +1746,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1757,7 +1746,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setSocialAddStatus(CommonConstants.FOUR_STRING); sf.setSocialAddStatus(CommonConstants.FOUR_STRING);
sf.setSocialStatus(CommonConstants.TEN_STRING); sf.setSocialStatus(CommonConstants.TEN_STRING);
} }
socialInfo.setAuditTime(new Date()); socialInfo.setAuditTime(now);
socialInfo.setAuditUser(user.getId()); socialInfo.setAuditUser(user.getId());
} }
// 派减审核 // 派减审核
...@@ -1805,7 +1794,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1805,7 +1794,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setFundAddStatus(CommonConstants.FOUR_STRING); sf.setFundAddStatus(CommonConstants.FOUR_STRING);
sf.setFundStatus(CommonConstants.NINE_STRING); sf.setFundStatus(CommonConstants.NINE_STRING);
} }
providentFund.setAuditTime(new Date()); providentFund.setAuditTime(now);
providentFund.setAuditUser(user.getId()); providentFund.setAuditUser(user.getId());
} }
//派减 //派减
...@@ -1831,9 +1820,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1831,9 +1820,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
//派单类型信息拼接 //派单类型信息拼接
if (CommonConstants.ZERO_STRING.equals(dis.getType())) { if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
remark += "派增"; remark += DispatchConstants.DISPATCH_ADD;
} else { } else {
remark += "派减"; remark += DispatchConstants.DISPATCH_REDUCE;
} }
// 派单状态信息拼接 // 派单状态信息拼接
if (CommonConstants.ZERO_INT == flag.intValue()) { if (CommonConstants.ZERO_INT == flag.intValue()) {
...@@ -1842,8 +1831,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1842,8 +1831,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
remark += "审核不通过:" + auditRemark; remark += "审核不通过:" + auditRemark;
} }
//记录处理意见到派单 最新的意见会覆盖之前的,详情 到流程中查询 //记录处理意见到派单 最新的意见会覆盖之前的,详情 到流程中查询
dis.setHandleRemark(null == auditRemark ? "" : auditRemark); dis.setHandleRemark(ServiceUtil.ifNullToEmpty(auditRemark));
dis.setAuditRemark(null == auditRemark ? "" : auditRemark); dis.setAuditRemark(ServiceUtil.ifNullToEmpty(auditRemark));
initAuditInfo(auditInfo, remark, auditStatus, user,remark); initAuditInfo(auditInfo, remark, auditStatus, user,remark);
auditInfo.setDispatchInfoId(dis.getId()); auditInfo.setDispatchInfoId(dis.getId());
//更新派单状态 //更新派单状态
...@@ -1859,7 +1848,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1859,7 +1848,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//新增审核记录信息 //新增审核记录信息
auditInfoMapper.insert(auditInfo); auditInfoMapper.insert(auditInfo);
dis.setAuditUser(user.getId()); dis.setAuditUser(user.getId());
dis.setAuditTime(new Date()); dis.setAuditTime(now);
baseMapper.updateById(dis); baseMapper.updateById(dis);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -1873,14 +1862,569 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1873,14 +1862,569 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
return errorList; return errorList;
} }
private void initSocialFundMap(List<TDispatchInfo> dispatchs,Map<String, TSocialFundInfo> socialFundMap) {
@Override
public R<List<ErrorMessage>> addApplyAudit(String ids, String auditStatus, String auditRemark) {
YifuUser user = SecurityUtils.getUser();
if (null == user) {
return R.failed(CommonConstants.USER_FAIL);
}
try {
if (!Common.isNotNull(ids)) {
return R.failed(DispatchConstants.DISPATCH_ID_NOT_EMPTY);
}
Integer flag = 1;
if (CommonConstants.ONE_STRING.equals(auditStatus)) {
//审核通过
flag = CommonConstants.ZERO_INT;
} else if (CommonConstants.TWO_STRING.equals(auditStatus)) {
//审核不通过
flag = CommonConstants.ONE_INT;
} else {
return R.failed("派单审核状态参数异常:0待审核 1审核通过 2审核不通过");
}
List<ErrorMessage> errorInfo = addBatchApplyAudit(Common.initStrToList(ids, CommonConstants.COMMA_STRING), user, flag, auditStatus, null==auditRemark?"":auditRemark);
return R.ok(errorInfo,"派单审核结果:");
} catch (Exception e) {
log.error("派单审核异常:" + e.getMessage());
return R.failed("数据异常,派单审核失败!");
}
}
@Override
public R<List<ErrorMessage>> addApplyHandle(String ids, String typeSub, String handleStatus, String handleRemark, String socialType) {
try {
YifuUser user = SecurityUtils.getUser();
if (null == user) {
return R.failed(CommonConstants.USER_FAIL);
}
if (!Common.isNotNull(ids)) {
return R.failed(DispatchConstants.DISPATCH_ID_NOT_EMPTY);
}
int flag = 1;
if (CommonConstants.ONE_STRING.equals(handleStatus)) {
//办理成功
flag = CommonConstants.ZERO_INT;
} else if (CommonConstants.TWO_STRING.equals(handleStatus)) {
//办理失败
flag = CommonConstants.ONE_INT;
} else {
return R.failed("派单办理状态参数异常:0待办理 1办理通过 2办理不通过");
}
List<ErrorMessage> errorInfo = addBatchApplyHandle(Common.initStrToList(ids, CommonConstants.COMMA_STRING)
, typeSub, user, flag, handleStatus, null==handleRemark?"":handleRemark, socialType);
if (errorInfo == null || errorInfo.isEmpty()) {
return R.ok(null,"办理成功!");
} else {
return R.ok(errorInfo,"派单办理结果:");
}
} catch (Exception e) {
log.error("派单办理异常:" + e.getMessage());
return R.failed("数据异常,办理失败!");
}
}
private Map<String, TSocialFundInfo> initSocialFundMap(List<TDispatchInfo> dispatchs) {
List<String> idCards = dispatchs.stream().map(TDispatchInfo::getEmpIdcard).collect(Collectors.toList()); List<String> idCards = dispatchs.stream().map(TDispatchInfo::getEmpIdcard).collect(Collectors.toList());
if (Common.isNotNull(idCards)){ if (Common.isNotNull(idCards)){
List<TSocialFundInfo> socialFunds = socialFundMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda() List<TSocialFundInfo> socialFunds = socialFundMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard,idCards)); .in(TSocialFundInfo::getEmpIdcard,idCards));
if (Common.isNotNull(socialFunds)){ if (Common.isNotNull(socialFunds)){
socialFundMap = socialFunds.stream().collect(Collectors.toMap(k->k.getEmpIdcard(),k->k)); return socialFunds.stream().collect(Collectors.toMap(k->k.getEmpIdcard(),k->k));
}
}
return new HashMap<>();
}
/**
* 社保派单批量办理
* @param idsList
* @param user
* @param flag 0审核通过; 1审核不通过
* @param handleStatus 1 办理成功 2 办理失败
* @param handleRemark
* @param socialType 社保拆分的每一项(1养老 2医疗 3失业 4工伤 5生育 6大病)
* @return
* @Author fxj
* @Date 2022-07-26
**/
public List<ErrorMessage> addBatchApplyHandle(List<String> idsList, String typeSub, YifuUser user
, int flag, String handleStatus, String handleRemark, String socialType) {
List<ErrorMessage> errorList = new ArrayList<>();
if (!Common.isNotNull(idsList)) {
errorList.add(new ErrorMessage(-1, CommonConstants.PARAM_IS_NOT_ERROR));
return errorList;
}
List<TDispatchInfo> disList = baseMapper.selectList(Wrappers.<TDispatchInfo>query().lambda().in(TDispatchInfo::getId, idsList));
if (Common.isNotNull(disList)) {
// 获取所有派单查询信息
Map<String,TSocialFundInfo> socialFundMap = initSocialFundMap(disList);
try {
TSocialInfo socialInfo = null;
TProvidentFund providentFund = null;
TAuditInfo auditInfo = null;
StringBuilder socialTypeRemark = null;
TSocialFundInfo sf = null;
Date now = new Date();
StringBuffer temp = new StringBuffer();
for (TDispatchInfo dis : disList) {
if (Common.isNotNull(socialFundMap)){
sf = socialFundMap.get(dis.getEmpIdcard());
}
if (Common.isEmpty(sf)){
errorList.add(new ErrorMessage(-1, "找不到员工社保公积金查询数据:" + dis.getEmpName()));
continue;
}
if (!CommonConstants.TWO_STRING.equals(dis.getStatus())) {
errorList.add(new ErrorMessage(-1, "派单审核通过后才可以办理:" + dis.getEmpName()));
continue;
}
if (Common.isNotNull(dis.getSocialId())) {
// 无更新直接跳过
if (Common.isEmpty(socialTypeRemark.toString())
&& CommonConstants.ZERO_STRING.equals(typeSub)
&& CommonConstants.ZERO_STRING.equals(dis.getType())
&& Common.isNotNull(socialType)) {
continue;
}
socialInfo = socialMapper.selectById(dis.getSocialId());
socialTypeRemark = getHandleRemark(socialType, socialInfo);
} else {
socialInfo = null;
}
if (Common.isNotNull(dis.getFundId())) {
providentFund = fundMapper.selectById(dis.getFundId());
} else {
providentFund = null;
}
//派增处理
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
//社保派增办理
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (Common.isNotNull(socialInfo) && Common.isNotNull(socialInfo.getId())) {
socialInfo.setHandleStatus(handleStatus);
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId());
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf);
// 派增办理,全部失败,清空社保状态
if (CommonConstants.TWO_STRING.equals(socialInfo.getHandleStatus())) {
// 同步预估库数据 TODO
}
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
auditInfo = new TAuditInfo();
auditInfo.setType(CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_INT == flag) {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(socialTypeRemark.toString());
temp.append(DispatchConstants.DISPATCH_SOCIAL_HANDLE_SUCCESS);
initAuditInfo(auditInfo, ( temp + handleRemark), handleStatus, user, temp.toString());
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(socialTypeRemark.toString());
temp.append(DispatchConstants.DISPATCH_SOCIAL_HANDLE_FAIL);
initAuditInfo(auditInfo, ( temp + handleRemark), handleStatus, user, temp.toString());
}
dis.setSocialHandleStatus(socialInfo.getHandleStatus());
auditInfo.setSocialId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保派增派单数据:" + dis.getEmpName()));
continue;
}
//公积金办理
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
if (null != providentFund && Common.isNotNull(providentFund.getId())) {
// 办理状态(0待办理/1已办理2办理失败3已派减)
providentFund.setHandleStatus(handleStatus);
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId());
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ZERO_INT == flag) {
//派增办理通过 改成可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);
} else if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType()) && CommonConstants.ONE_INT == flag) {
//派增办理不通过 改成不可派减状态
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[1]);
// 同步预估库数据 TODO
}
fundMapper.updateById(providentFund);
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_ADD_SUCCESS + handleRemark), handleStatus, user, DispatchConstants.DISPATCH_FUND_ADD_SUCCESS);
} else {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_ADD_FAIL + handleRemark), handleStatus, user, DispatchConstants.DISPATCH_FUND_ADD_FAIL);
}
auditInfo.setProvidentId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工公积金派增派单数据:" + dis.getEmpName()));
continue;
}
}
//派减处理
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
//社保派减办理
if (CommonConstants.ZERO_STRING.equals(typeSub)) {
if (null != socialInfo && Common.isNotNull(socialInfo.getId())) {
// 社保办理状态补充判断:
this.setSocialHandleStatus(handleStatus, socialType, flag, socialInfo, dis,sf);
//社保派减办理成功才变更社保的办理状态
if (CommonConstants.ZERO_INT == flag) {
socialInfo.setHandleStatus(CommonConstants.THREE_STRING);
socialInfo.setReduceHandleUser(user.getId());
socialInfo.setReduceHandleTime(now);
if (Common.isNotNull(dis.getSocialReduceDate())) {
socialInfo.setSocialReduceDate(dis.getSocialReduceDate());
}
}
socialInfo.setHandleTime(now);
socialInfo.setHandleUser(user.getId().toString());
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType()) && CommonConstants.ONE_INT == flag) {
//派减办理不通过
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
// 同步预估库数据
}
socialMapper.updateById(socialInfo);
dis.setSocialHandleRemark(null == handleRemark ? "" : handleRemark);
auditInfo = new TAuditInfo();
auditInfo.setType(CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, ("社保派减" + socialTypeRemark.toString() + "办理成功:" + handleRemark), handleStatus, user, "");
} else {
initAuditInfo(auditInfo, ("社保派减" + socialTypeRemark.toString() + "办理失败:" + handleRemark), handleStatus, user, "");
}
dis.setSocialHandleStatus(handleStatus);
auditInfo.setSocialId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保数据:" + dis.getEmpName()));
continue;
}
//公积金派减办理
} else if (CommonConstants.ONE_STRING.equals(typeSub)) {
if (null != providentFund && Common.isNotNull(providentFund.getId())) {
//公积金派减办理成功才变更公积金的办理状态
if (CommonConstants.ZERO_INT == flag) {
providentFund.setHandleStatus(CommonConstants.THREE_STRING);
providentFund.setReduceHandleTime(now);
providentFund.setReduceHandleUser(user.getId().toString());
if (Common.isNotNull(dis.getFundReduceDate())) {
providentFund.setFundReduceDate(dis.getFundReduceDate());
}
// 派减办理成功后,同步预估库数据清理
}
providentFund.setHandleTime(now);
providentFund.setHandleUser(user.getId().toString());
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType()) && CommonConstants.ONE_INT == flag) {
//派减办理不通过
providentFund.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
// 同步预估库数据
}
fundMapper.updateById(providentFund);
dis.setFundHandleRemark(ServiceUtil.ifNullToEmpty(handleRemark));
if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, ("公积金派减办理成功:" + handleRemark), handleStatus, user, "");
dis.setFundHandleStatus(CommonConstants.ONE_STRING);
} else {
initAuditInfo(auditInfo, ("公积金派减办理失败:" + handleRemark), handleStatus, user, "");
dis.setFundHandleStatus(CommonConstants.TWO_STRING);
}
auditInfo.setProvidentId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工公积金数据:" + dis.getEmpName()));
continue;
}
}
//更新派单状态
if (null != auditInfo) {
//派增判断
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
if (null != socialInfo && null != providentFund
&& (
CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus())
)) {
//同时有社保和公积金的只要有一条没办理就不改派单状态
} else {
if ((CommonConstants.ZERO_INT == flag || CommonConstants.ONE_INT == flag)
&& (socialInfo == null
|| (!CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
&& !CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())))) {
//办理成功 更新为办理完结 2020-05-26 办理失败 更新为办理完结 2020-05-26
dis.setStatus(CommonConstants.FOUR_STRING);
}
}
//派减判断
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
if (null != socialInfo && null != providentFund && (
((CommonConstants.ONE_STRING.equals(socialInfo.getHandleStatus()) || CommonConstants.FIVE_STRING.equals(socialInfo.getHandleStatus())) && CommonConstants.ONE_STRING.equals(socialInfo.getReduceCan()))
|| (CommonConstants.ONE_STRING.equals(providentFund.getHandleStatus()) && CommonConstants.ONE_STRING.equals(providentFund.getReduceCan()))
)) {
//同时有社保和公积金的只要有一条没办理就不改派单状态
} else {
if (CommonConstants.ZERO_INT == flag || CommonConstants.ONE_INT == flag) {
//办理成功或失败 更新为办理完结 2020-05-26
dis.setStatus(CommonConstants.FOUR_STRING);
}
}
}
if (CommonConstants.ZERO_INT == flag) {
auditInfo.setAuditStatus(CommonConstants.SIX_STRING);
} else if (CommonConstants.ONE_INT == flag) {
auditInfo.setAuditStatus(CommonConstants.FIVE_STRING);
}
dis.setHandleRemark(null == handleRemark ? "" : handleRemark);
//新增办理记录信息
auditInfo.setDispatchInfoId(dis.getId());
auditInfo.setEmpIdcard(dis.getEmpIdcard());
auditInfoMapper.insert(auditInfo);
baseMapper.updateById(dis);
} else {
errorList.add(new ErrorMessage(-1, "派单数据错误!"));
}
}
}
} catch(Exception e){
log.error("派单办理异常:", e);
errorList.add(new ErrorMessage(-1, "派单办理异常:" + e.getMessage()));
return errorList;
}
} else{
errorList.add(new ErrorMessage(-1, DispatchConstants.NO_OPERATOR_DATA));
return errorList;
}
return errorList;
}
private StringBuilder getHandleRemark(String socialType, TSocialInfo socialInfo) {
StringBuilder socialTypeRemark;
socialTypeRemark = new StringBuilder();
if (Common.isNotNull(socialType)) {
String[] stArr = socialType.split(",");
for (String st : stArr) {
// socialType (1养老 2医疗 3失业 4工伤 5生育 6大病)
if (Integer.parseInt(st) == CommonConstants.ONE_INT
&& CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle())){
socialTypeRemark.append(CommonConstants.SOCIAL_HANDLE_TYPE[Integer.parseInt(st)]).append("、");
}
if (Integer.parseInt(st) == CommonConstants.TWO_INT
&& CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle())){
socialTypeRemark.append(CommonConstants.SOCIAL_HANDLE_TYPE[Integer.parseInt(st)]).append("、");
}
if (Integer.parseInt(st) == CommonConstants.THREE_INT
&& CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle())){
socialTypeRemark.append(CommonConstants.SOCIAL_HANDLE_TYPE[Integer.parseInt(st)]).append("、");
}
if (Integer.parseInt(st) == CommonConstants.FOUR_INT
&& CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle())){
socialTypeRemark.append(CommonConstants.SOCIAL_HANDLE_TYPE[Integer.parseInt(st)]).append("、");
}
if (Integer.parseInt(st) == CommonConstants.FIVE_INT
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle())){
socialTypeRemark.append(CommonConstants.SOCIAL_HANDLE_TYPE[Integer.parseInt(st)]).append("、");
}
if (Integer.parseInt(st) == CommonConstants.SIX_INT
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getIsIllness())){
socialTypeRemark.append(CommonConstants.SOCIAL_HANDLE_TYPE[Integer.parseInt(st)]).append("、");
}
}
if (Common.isNotNull(socialTypeRemark.toString())){
socialTypeRemark.deleteCharAt(socialTypeRemark.length()-1);
}
}
return socialTypeRemark;
}
/**
* @param flag 0审核通过; 1审核不通过
* @param socialInfo
* @param dis
* @param socialType 社保拆分的每一项(1养老 2医疗 3失业 4工伤 5生育 6大病)
* @Description: 判断社保状态并塞值
* @Author: fxj
* @Date: 2022-07-26
* @return: void
**/
private void setSocialHandleStatus(String handleStatus, String socialType, int flag, TSocialInfo socialInfo
, TDispatchInfo dis, TSocialFundInfo sf) {
// 批量办理,或者办理选择对应的类型,修改对应的办理状态
this.setSocialSixStatus(handleStatus, socialType, socialInfo);
// HandleStatus办理状态 0 未办理 1 全部办理成功(原-已办理) 2 全部办理失败(原-办理失败) 3已派减 4办理中 5部分办理失败
// 派减,审核不通过,社保状态不变更
// 1.派减处理
if (CommonConstants.ONE_STRING.equals(dis.getType())){
//办理成功 (办理失败不做处理,预估在另外的地方处理)
if (CommonConstants.ZERO_INT == flag){
// 同步社保分项办理状态
socialInfo.setPensionHandle(CommonConstants.THREE_STRING);
socialInfo.setMedicalHandle(CommonConstants.THREE_STRING);
socialInfo.setUnemployHandle(CommonConstants.THREE_STRING);
socialInfo.setWorkInjuryHandle(CommonConstants.THREE_STRING);
socialInfo.setBirthHandle(CommonConstants.THREE_STRING);
socialInfo.setBigailmentHandle(CommonConstants.THREE_STRING);
socialInfo.setHandleStatus(CommonConstants.THREE_STRING);
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[1]);//改成不可派减状态
sf.setSocialReduceStatus(CommonConstants.TWO_STRING);
sf.setSocialStatus(CommonConstants.EIGHT_STRING);
sf.setPensionHandle(CommonConstants.THREE_STRING);
sf.setMedicalHandle(CommonConstants.THREE_STRING);
sf.setUnemployHandle(CommonConstants.THREE_STRING);
sf.setWorkInjuryHandle(CommonConstants.THREE_STRING);
sf.setBirthHandle(CommonConstants.THREE_STRING);
sf.setBigailmentHandle(CommonConstants.THREE_STRING);
sf.setHandleStatus(CommonConstants.THREE_STRING);
}
//办理失败不做处理,只更新社保公积金查询状态
if (CommonConstants.ONE_INT == flag){
sf.setSocialReduceStatus(CommonConstants.THREE_STRING);
sf.setSocialStatus(CommonConstants.NINE_STRING);
} }
} }
// 2.派增处理 socialType 社保拆分的每一项(1养老 2医疗 3失业 4工伤 5生育 6大病)
if (CommonConstants.ZERO_STRING.equals(dis.getType())){
//办理成功 flag=0 办理失败 flag=1
// 有对应办理项且 对应项为待办理或者空时更新 下同
if (socialType.indexOf(CommonConstants.ONE_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getPensionHandle()))){
socialInfo.setPensionHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setPensionHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.TEN_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getMedicalHandle()))){
socialInfo.setMedicalHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setMedicalHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.THREE_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getUnemployHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getUnemployHandle()))){
socialInfo.setUnemployHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setUnemployHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.FOUR_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getWorkInjuryHandle()))){
socialInfo.setWorkInjuryHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setWorkInjuryHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.FIVE_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getBirthHandle()))){
socialInfo.setBirthHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setBirthHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
if (socialType.indexOf(CommonConstants.SIX_STRING) > CommonConstants.ZERO_INT
&& (Common.isEmpty(socialInfo.getBigailmentHandle())
|| CommonConstants.ONE_STRING.equals(socialInfo.getBigailmentHandle()))){
socialInfo.setBigailmentHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
sf.setBigailmentHandle(ifNotEquals(CommonConstants.ZERO_INT,flag,CommonConstants.ONE_STRING,CommonConstants.TWO_STRING));
}
// 派增:
if ((Common.isEmpty(socialInfo.getPensionHandle()) || CommonConstants.ONE_STRING.equals(socialInfo.getPensionHandle()))
&& (Common.isEmpty(socialInfo.getMedicalHandle()) || CommonConstants.ONE_STRING.equals(socialInfo.getMedicalHandle()))
&& (Common.isEmpty(socialInfo.getUnemployHandle()) || CommonConstants.ONE_STRING.equals(socialInfo.getUnemployHandle()))
&& (Common.isEmpty(socialInfo.getWorkInjuryHandle()) || CommonConstants.ONE_STRING.equals(socialInfo.getWorkInjuryHandle()))
&& (Common.isEmpty(socialInfo.getBirthHandle()) || CommonConstants.ONE_STRING.equals(socialInfo.getBirthHandle()))
&& (Common.isEmpty(socialInfo.getBigailmentHandle()) || CommonConstants.ONE_STRING.equals(socialInfo.getBigailmentHandle()))) {
// 全部成功(或者为空--兼容历史数据问题):全部成功
socialInfo.setHandleStatus(CommonConstants.ONE_STRING);
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
sf.setSocialStatus(CommonConstants.THREE_STRING);
sf.setSocialAddStatus(CommonConstants.TWO_STRING);
sf.setSocialReduceStatus(CommonConstants.ONE_STRING_NEGATE);
sf.setSocialReduceDate(null);
dis.setSocialHandleStatus(CommonConstants.ONE_STRING);
} else if ((Common.isEmpty(socialInfo.getPensionHandle()) || CommonConstants.TWO_STRING.equals(socialInfo.getPensionHandle()))
&& (Common.isEmpty(socialInfo.getMedicalHandle()) || CommonConstants.TWO_STRING.equals(socialInfo.getMedicalHandle()))
&& (Common.isEmpty(socialInfo.getUnemployHandle()) || CommonConstants.TWO_STRING.equals(socialInfo.getUnemployHandle()))
&& (Common.isEmpty(socialInfo.getWorkInjuryHandle()) || CommonConstants.TWO_STRING.equals(socialInfo.getWorkInjuryHandle()))
&& (Common.isEmpty(socialInfo.getBirthHandle()) || CommonConstants.TWO_STRING.equals(socialInfo.getBirthHandle()))
&& (Common.isEmpty(socialInfo.getBigailmentHandle()) || CommonConstants.TWO_STRING.equals(socialInfo.getBigailmentHandle()))) {
// 全部失败(或者为空):全部失败
socialInfo.setHandleStatus(CommonConstants.TWO_STRING);
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[1]);//改成不可派减状态
sf.setSocialStatus(CommonConstants.FIVE_STRING);
sf.setSocialAddStatus(CommonConstants.FOUR_STRING);
dis.setSocialHandleStatus(CommonConstants.TWO_STRING);
} else if ((Common.isEmpty(socialInfo.getPensionHandle()) || CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle()))
|| (Common.isEmpty(socialInfo.getMedicalHandle()) || CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle()))
|| (Common.isEmpty(socialInfo.getUnemployHandle()) || CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle()))
|| (Common.isEmpty(socialInfo.getWorkInjuryHandle()) || CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle()))
|| (Common.isEmpty(socialInfo.getBirthHandle()) || CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle()))
|| (Common.isNotNull(socialInfo.getBigailmentHandle()) && CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle()))) {
// 含有办理中的:办理中
socialInfo.setHandleStatus(CommonConstants.FOUR_STRING);
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[1]);//改成不可派减状态
sf.setSocialStatus(CommonConstants.TWO_STRING);
sf.setSocialAddStatus(CommonConstants.SIX_STRING);
dis.setSocialHandleStatus(CommonConstants.FOUR_STRING);
} else {
// 其他:部分办理失败
socialInfo.setHandleStatus(CommonConstants.FIVE_STRING);
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
sf.setSocialStatus(CommonConstants.FOUR_STRING);
sf.setSocialAddStatus(CommonConstants.THREE_STRING);
dis.setSocialHandleStatus(CommonConstants.THREE_STRING);
}
}
}
/**
* @Author fxj
* @Description if flag=obj return value1 else return value2
* @Date 18:02 2022/7/26
**/
private String ifNotEquals(int flag, int obj, String value1, String value2){
if (flag==obj){
return value1;
}
return value2;
}
/**
* @param handleStatus
* @param socialType
* @param socialInfo
* @Description: 填充社保的新的六个状态字段
* @Author: hgw
* @Date: 2021/6/9 17:12
* @return: void
**/
private void setSocialSixStatus(String handleStatus, String socialType, TSocialInfo socialInfo) {
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.ONE_STRING))
&& Common.isNotNull(socialInfo.getPensionHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle())) {
socialInfo.setPensionHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.TWO_STRING))
&& Common.isNotNull(socialInfo.getMedicalHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle())) {
socialInfo.setMedicalHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.THREE_STRING))
&& Common.isNotNull(socialInfo.getUnemployHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle())) {
socialInfo.setUnemployHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.FOUR_STRING))
&& Common.isNotNull(socialInfo.getWorkInjuryHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle())) {
socialInfo.setWorkInjuryHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.FIVE_STRING))
&& Common.isNotNull(socialInfo.getBirthHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle())) {
socialInfo.setBirthHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.SIX_STRING))
&& Common.isNotNull(socialInfo.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())) {
socialInfo.setBigailmentHandle(handleStatus);
}
} }
} }
...@@ -37,6 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.TAgentConfigMapper; ...@@ -37,6 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.TAgentConfigMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TForecastLibraryMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TForecastLibraryMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialFundInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService; import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFundInfoService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil; import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -466,12 +467,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -466,12 +467,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
} }
private void initSocialLibary(String payMonth, Map<String, TForecastLibrary> saveLibraryMap private void initSocialLibary(String diffType,String payMonth, Map<String, TForecastLibrary> saveLibraryMap
, TSocialFundInfo tSocialInfo, boolean isReduceFund, HashMap<String, TAgentConfig> agentConfigMap , TSocialFundInfo tSocialInfo, boolean isReduceFund, HashMap<String, TAgentConfig> agentConfigMap
, TForecastLibrary lib, String sfMapKey, TForecastLibrary historyLibrary) { , TForecastLibrary lib, String sfMapKey, TForecastLibrary historyLibrary) {
if (null == lib) { if (null == lib) {
lib = new TForecastLibrary(); lib = new TForecastLibrary();
} }
lib.setDiffType(diffType);
lib.setDataType(CommonConstants.ZERO_INT); lib.setDataType(CommonConstants.ZERO_INT);
lib.setEmpId(tSocialInfo.getEmpId()); lib.setEmpId(tSocialInfo.getEmpId());
lib.setEmpIdcard(tSocialInfo.getEmpIdcard()); lib.setEmpIdcard(tSocialInfo.getEmpIdcard());
...@@ -1125,12 +1127,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1125,12 +1127,13 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
* @Author fxj * @Author fxj
* @Date 2020-07-21 * @Date 2020-07-21
**/ **/
private void initFundLibary(String payMonth, Map<String, TForecastLibrary> saveLibraryMap private void initFundLibary(String diffType, String payMonth, Map<String, TForecastLibrary> saveLibraryMap
, TSocialFundInfo providentFund, boolean isReduceSocial, TForecastLibrary lib, String mapKeyStr , TSocialFundInfo providentFund, boolean isReduceSocial, TForecastLibrary lib, String mapKeyStr
, TForecastLibrary historyLibrary) { , TForecastLibrary historyLibrary) {
if (lib == null) { if (lib == null) {
lib = new TForecastLibrary(); lib = new TForecastLibrary();
} }
lib.setDiffType(diffType);
lib.setDataType(CommonConstants.ONE_INT); lib.setDataType(CommonConstants.ONE_INT);
lib.setEmpId(providentFund.getEmpId()); lib.setEmpId(providentFund.getEmpId());
lib.setEmpIdcard(providentFund.getEmpIdcard()); lib.setEmpIdcard(providentFund.getEmpIdcard());
...@@ -1170,6 +1173,44 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1170,6 +1173,44 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
saveLibraryMap.put(mapKeyStr, lib); saveLibraryMap.put(mapKeyStr, lib);
} }
/**
* @Description: 基数新增,同步社保公积金查询表,同步预估库
* @Author: hgw
* @Date: 2022/7/25 17:37
* @return: void
**/
@Override
public void updateForecastLibaryBySysBase() {
List<SysBaseSetInfo> sysBaseSetInfoList = sysBaseSetInfoMapper.selectList(
Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getIsNew, CommonConstants.ONE_INT));
if (sysBaseSetInfoList != null && !sysBaseSetInfoList.isEmpty()) {
Map<String, TSocialFundInfo> socialFundInfoMap = new HashMap<>();
List<TSocialFundInfo> socialFundInfoList;
for (SysBaseSetInfo sysBaseSetInfo : sysBaseSetInfoList) {
// 社保
if (CommonConstants.ZERO_STRING.equals(sysBaseSetInfo.getBaseType())) {
socialFundInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getSocialHousehold, sysBaseSetInfo.getDepartId()));
for (TSocialFundInfo socialFundInfo : socialFundInfoList) {
socialFundInfoMap.put(socialFundInfo.getId(), socialFundInfo);
}
}
// 公积金
if (CommonConstants.ONE_STRING.equals(sysBaseSetInfo.getBaseType())) {
socialFundInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.eq(TSocialFundInfo::getProvidentHousehold, sysBaseSetInfo.getDepartId()));
for (TSocialFundInfo socialFundInfo : socialFundInfoList) {
socialFundInfoMap.put(socialFundInfo.getId(), socialFundInfo);
}
}
}
for (TSocialFundInfo socialFundInfo : socialFundInfoMap.values()) {
this.updateForecastLibaryCore(socialFundInfo);
}
}
}
/** /**
* @param socialFundInfo * @param socialFundInfo
* @Description: 批量调基,同步预估库 * @Description: 批量调基,同步预估库
...@@ -1179,6 +1220,29 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1179,6 +1220,29 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
**/ **/
@Override @Override
public R<String> updateToneForecastLibary(TSocialFundInfo socialFundInfo) { public R<String> updateToneForecastLibary(TSocialFundInfo socialFundInfo) {
return this.updateForecastLibaryCore(socialFundInfo);
}
/**
* @param socialFundInfo
* @Description: 派单,同步预估库
* @Author: hgw
* @Date: 2022/7/25 17:37
* @return: void
**/
@Override
public R<String> updateForecastLibaryByDispatch(TSocialFundInfo socialFundInfo) {
return this.updateForecastLibaryCore(socialFundInfo);
}
/**
* @param socialFundInfo
* @Description: 根据社保公积金信息表更新预估库
* @Author: hgw
* @Date: 2022/7/26 19:01
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
private R<String> updateForecastLibaryCore(TSocialFundInfo socialFundInfo) {
String empIdCard = socialFundInfo.getEmpIdcard(); String empIdCard = socialFundInfo.getEmpIdcard();
//定义未推送的按条件查询得到的预估数据 //定义未推送的按条件查询得到的预估数据
List<TForecastLibrary> librarySocialList = null; List<TForecastLibrary> librarySocialList = null;
...@@ -1295,6 +1359,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1295,6 +1359,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
String createMonth; String createMonth;
String sfMapKey; String sfMapKey;
TForecastLibrary tForecastLibrary; TForecastLibrary tForecastLibrary;
String diffType;
for (String payMonth : payMonthList) { for (String payMonth : payMonthList) {
//封装社保预估数据 //封装社保预估数据
if (Common.isNotNull(socialInfoList)) { if (Common.isNotNull(socialInfoList)) {
...@@ -1304,12 +1369,19 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1304,12 +1369,19 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 变更:已推送的,计算变更值 // 变更:已推送的,计算变更值
tForecastLibrary = socialPushMap.get(sfMapKey); tForecastLibrary = socialPushMap.get(sfMapKey);
diffType = SocialConstants.DIFF_TYPE_ONE;
if (null != tForecastLibrary) { if (null != tForecastLibrary) {
diffType = SocialConstants.DIFF_TYPE_TWO;
this.getChangeReduceData(tSocialInfo, tForecastLibrary); this.getChangeReduceData(tSocialInfo, tForecastLibrary);
} else if (CommonConstants.dingleDigitStrArray[5].equals(tSocialInfo.getSocialStatus())
|| CommonConstants.dingleDigitStrArray[10].equals(tSocialInfo.getSocialStatus())) {
// 5 办理失败 10 审核不通过,且无推送数据,不新增
continue;
} }
//起缴月份在要生成的月份前不处理 || 截止月份在要生成的月份后不处理 //起缴月份在要生成的月份前不处理 || 截止月份在要生成的月份后不处理
if (Integer.parseInt(payMonth) < DateUtil.formatDateInt(tSocialInfo.getSocialStartDate()) if (Integer.parseInt(payMonth) < DateUtil.formatDateInt(tSocialInfo.getSocialStartDate())
|| Integer.parseInt(payMonth) > DateUtil.formatDateInt(tSocialInfo.getSocialReduceDate())) { || (Common.isNotNull(tSocialInfo.getSocialReduceDate())
&& Integer.parseInt(payMonth) > DateUtil.formatDateInt(tSocialInfo.getSocialReduceDate()))) {
continue; continue;
} }
flag = CommonConstants.ZERO_STRING.equals(tSocialInfo.getCanOverpay()) && (null == tSocialInfo.getOverpayNumber() || null == tSocialInfo.getHaveThisMonth() || null == tSocialInfo.getSocialStartDate()); flag = CommonConstants.ZERO_STRING.equals(tSocialInfo.getCanOverpay()) && (null == tSocialInfo.getOverpayNumber() || null == tSocialInfo.getHaveThisMonth() || null == tSocialInfo.getSocialStartDate());
...@@ -1318,7 +1390,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1318,7 +1390,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else { } else {
historyLibrary = socialHistoryMap.get(sfMapKey); historyLibrary = socialHistoryMap.get(sfMapKey);
// 初始化社保 // 初始化社保
initSocialLibary(payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, tForecastLibrary, sfMapKey, historyLibrary); initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, tForecastLibrary, sfMapKey, historyLibrary);
} }
} }
} }
...@@ -1329,12 +1401,19 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1329,12 +1401,19 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
sfMapKey = this.getMapKey(providentFund.getEmpIdcard(), providentFund.getSettleDomainFund(), payMonth, createMonth); sfMapKey = this.getMapKey(providentFund.getEmpIdcard(), providentFund.getSettleDomainFund(), payMonth, createMonth);
// 变更:已推送的,计算变更值 // 变更:已推送的,计算变更值
tForecastLibrary = fundPushMap.get(sfMapKey); tForecastLibrary = fundPushMap.get(sfMapKey);
diffType = SocialConstants.DIFF_TYPE_ONE;
if (null != tForecastLibrary) { if (null != tForecastLibrary) {
diffType = SocialConstants.DIFF_TYPE_TWO;
this.getChangeReduceData(providentFund, tForecastLibrary); this.getChangeReduceData(providentFund, tForecastLibrary);
} else if (CommonConstants.dingleDigitStrArray[4].equals(providentFund.getFundStatus())
|| CommonConstants.dingleDigitStrArray[9].equals(providentFund.getFundStatus())) {
// 4办理失败9 审核不通过,且无推送数据,不新增
continue;
} }
//起缴月份在要生成的月份后不处理 || 截止月份在要生成的月份后不处理 //起缴月份在要生成的月份后不处理 || 截止月份在要生成的月份后不处理
if (Integer.parseInt(payMonth) < DateUtil.formatDateInt(providentFund.getProvidentStart()) if (Integer.parseInt(payMonth) < DateUtil.formatDateInt(providentFund.getProvidentStart())
|| Integer.parseInt(payMonth) > DateUtil.formatDateInt(providentFund.getFundReduceDate())) { || (Common.isNotNull(providentFund.getFundReduceDate())
&& Integer.parseInt(payMonth) > DateUtil.formatDateInt(providentFund.getFundReduceDate()))) {
continue; continue;
} }
flag = CommonConstants.ZERO_STRING.equals(providentFund.getCanOverpay()) && (null == providentFund.getOverpayNumber() || null == providentFund.getHaveThisMonth() || null == providentFund.getProvidentStart()); flag = CommonConstants.ZERO_STRING.equals(providentFund.getCanOverpay()) && (null == providentFund.getOverpayNumber() || null == providentFund.getHaveThisMonth() || null == providentFund.getProvidentStart());
...@@ -1343,7 +1422,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1343,7 +1422,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} else { } else {
historyLibrary = fundHistoryMap.get(sfMapKey); historyLibrary = fundHistoryMap.get(sfMapKey);
// 初始化公积金 // 初始化公积金
initFundLibary(payMonth, saveLibraryMap, providentFund, isReduceSocial, tForecastLibrary, sfMapKey, historyLibrary); initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, tForecastLibrary, sfMapKey, historyLibrary);
} }
} }
...@@ -1352,4 +1431,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -1352,4 +1431,15 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
return null; return null;
} }
@Override
public void everyMonthCreateForecastLibary() {
List<TSocialFundInfo> socialFundInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda());
if (socialFundInfoList != null && !socialFundInfoList.isEmpty()) {
for (TSocialFundInfo socialFundInfo : socialFundInfoList) {
// TODO-生成新的社保公积金数据
}
}
}
} }
...@@ -772,7 +772,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -772,7 +772,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
list = baseMapper.getListForExport(tPreDispatchInfo); list = baseMapper.getListForExport(tPreDispatchInfo);
ServletOutputStream out = null; ServletOutputStream out = null;
if (list != null && !list.isEmpty()) { if (list == null || list.isEmpty()) {
list = new ArrayList<>(); list = new ArrayList<>();
} }
try { try {
......
package com.yifu.cloud.plus.v1.yifu.social.util; package com.yifu.cloud.plus.v1.yifu.social.util;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException; import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; 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.DateUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
...@@ -94,4 +96,23 @@ public class ServiceUtil { ...@@ -94,4 +96,23 @@ public class ServiceUtil {
} }
return false; return false;
} }
public static BigDecimal ifNull(BigDecimal old, BigDecimal last){
if (Common.isEmpty(old)){
return last;
}
return old;
}
public static Date ifNull(Date old,Date last){
if (Common.isEmpty(old)){
return last;
}
return old;
}
public static String ifNullToEmpty(String str){
if (Common.isEmpty(str)){
return CommonConstants.EMPTY_STRING;
}
return str;
}
} }
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/> <result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
<result property="dataPush" column="DATA_PUSH"/> <result property="dataPush" column="DATA_PUSH"/>
<result property="dataType" column="DATA_TYPE"/> <result property="dataType" column="DATA_TYPE"/>
<result property="diffType" column="DIFF_TYPE"/>
<result property="createBy" column="CREATE_BY"/> <result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/> <result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
...@@ -171,6 +172,7 @@ ...@@ -171,6 +172,7 @@
a.PROVIDENT_HOUSEHOLD_NAME, a.PROVIDENT_HOUSEHOLD_NAME,
a.DATA_PUSH, a.DATA_PUSH,
a.DATA_TYPE, a.DATA_TYPE,
a.DIFF_TYPE,
a.CREATE_BY, a.CREATE_BY,
a.CREATE_NAME, a.CREATE_NAME,
a.CREATE_TIME, a.CREATE_TIME,
...@@ -395,6 +397,9 @@ ...@@ -395,6 +397,9 @@
<if test="tForecastLibrary.dataType != null"> <if test="tForecastLibrary.dataType != null">
AND a.DATA_TYPE = #{tForecastLibrary.dataType} AND a.DATA_TYPE = #{tForecastLibrary.dataType}
</if> </if>
<if test="tForecastLibrary.diffType != null and tForecastLibrary.diffType.trim() != ''">
AND a.DIFF_TYPE = #{tForecastLibrary.diffType}
</if>
<if test="tForecastLibrary.createBy != null and tForecastLibrary.createBy.trim() != ''"> <if test="tForecastLibrary.createBy != null and tForecastLibrary.createBy.trim() != ''">
AND a.CREATE_BY = #{tForecastLibrary.createBy} AND a.CREATE_BY = #{tForecastLibrary.createBy}
</if> </if>
......
...@@ -233,12 +233,12 @@ ...@@ -233,12 +233,12 @@
</sql> </sql>
<sql id="tPreDispatchInfo_where"> <sql id="tPreDispatchInfo_where">
<if test="tPreDispatchInfo != null"> <if test="tPreDispatchInfo != null">
<if test="tPreDispatchInfo.idList != null"> <if test="tPreDispatchInfo.idList != null">
AND a.id in AND a.id in
<foreach item="idStr" index="index" collection="tPreDispatchInfo.idList" open="(" separator="," close=")"> <foreach item="idStr" index="index" collection="tPreDispatchInfo.idList" open="(" separator="," close=")">
#{idStr} #{idStr}
</foreach> </foreach>
</if> </if>
<if test="tPreDispatchInfo.idList == null"> <if test="tPreDispatchInfo.idList == null">
<if test="tPreDispatchInfo.id != null and tPreDispatchInfo.id.trim() != ''"> <if test="tPreDispatchInfo.id != null and tPreDispatchInfo.id.trim() != ''">
AND a.ID = #{tPreDispatchInfo.id} AND a.ID = #{tPreDispatchInfo.id}
......
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