Commit e689122c authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents d38aa048 a1172bf7
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
......@@ -12,9 +13,10 @@ import java.io.Serializable;
*/
@Data
public class UpProjectSocialFundVo implements Serializable {
// 社保状态
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
@Schema(name = "社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减")
String socialStatus;
// 公积金状态
// 公积金状态 社保状态(字典): 0 无社保 1 处理中 2.正常 3.已派减
String fundStatus;
// 项目编码
String departNo;
......
......@@ -484,4 +484,8 @@ public interface ErrorCodes {
* 派增异常: 已存在对应手机号码的在用员工档案
*/
String EMP_DISPATCH_EMP_MOBILE_REPEAT = "emp.dispatch.emp.mobile.repeat";
/**
* 派增异常: 同一身份证不可分多行派单
*/
String EMP_DISPATCH_EXIST = "emp_dispatch_exist";
}
......@@ -185,6 +185,8 @@ emp.dispatch.social.diy.injury.error=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5355\u6D3E
emp.dispatch.emp.mobile.repeat=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5DF2\u5B58\u5728\u5BF9\u5E94\u624B\u673A\u53F7\u7801\u7684\u5728\u7528\u5458\u5DE5\u6863\u6848
emp_dispatch_exist=\u6D3E\u589E\u5F02\u5E38\uFF1A \u540C\u4E00\u8EAB\u4EFD\u8BC1\u4E0D\u53EF\u5206\u591A\u884C\u6D3E\u5355
......
......@@ -365,7 +365,7 @@ public class TInsuranceDetailController {
@Operation(summary = "导出减员列表", description = "导出减员列表")
@PostMapping("/getInsuranceRefundHandlingList")
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(@RequestBody RefundExportListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingList(param));
return tInsuranceDetailService.getInsuranceRefundHandlingList(param);
}
/**
......
......@@ -189,4 +189,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo);
TInsuranceDetail selectByregionSQL(@Param("regionSql") String regionSQL,@Param("id") String id);
}
......@@ -231,7 +231,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param param 查询参数
* @return {@link List< RefundExportListVo >}
*/
List<RefundExportListVo> getInsuranceRefundHandlingList(RefundExportListParam param);
R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param);
/**
* 减员办理
......
......@@ -2406,17 +2406,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}else {
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.last(regionSQL+CommonConstants.LAST_ONE_SQL)
);
//查数据是否存在权限范围内
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByregionSQL(regionSQL, detail.getId());
if (!Optional.ofNullable(detailByRegionSQL).isPresent()){
param.setErrorMessage(InsurancesConstants.NO_UPDATE_DETAIL_JURISDICTION);
listResult.add(param);
......@@ -2866,7 +2857,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(rollbackFor = Exception.class)
public List<RefundExportListVo> getInsuranceRefundHandlingList(RefundExportListParam param){
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList;
......@@ -2876,6 +2867,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待减员」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){
refundExportList = baseMapper.getRefundExportListBySelect(param.getIdList());
for (RefundExportListVo refundExportListVo : refundExportList) {
if(null != refundExportListVo.getReduceHandleStatus() && CommonConstants.ONE_INT != refundExportListVo.getReduceHandleStatus()){
return R.failed(InsurancesConstants.CHANGE_ERROR);
}
}
}else {
refundExportList = baseMapper.getRefundExportList(param);
}
......@@ -2913,7 +2909,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//批量更新
if (CollectionUtils.isNotEmpty(detailList)){
this.saveOrUpdateBatch(detailList);
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
for (TInsuranceDetail s : detailList) {
updateWrapper.eq(TInsuranceDetail :: getId,s.getId())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT)
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
}
}
//批量更新
if (CollectionUtils.isNotEmpty(refundList)){
......@@ -2924,7 +2927,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//操作记录
addOperate(detailList,user,InsurancesConstants.INSURANCE_REFUND_EXPORT);
}
return refundExportList;
return R.ok(refundExportList);
}
/**
......@@ -2943,6 +2946,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
YifuUser user = SecurityUtils.getUser();
List<String> insuranceDetailList = insuranceDetail.getInsuranceDetailList();
if (CollectionUtils.isEmpty(insuranceDetailList)){
return R.failed("减员办理列表为空");
}
List<RefundErrorVo> errorList = new ArrayList<>();
List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
......@@ -2967,6 +2973,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setReduceHandleStatus(refundType);
if(CommonConstants.FOUR_INT == refundType){
tInsuranceDetail.setIsOverdue(null);
tInsuranceDetail.setIsEffect(null);
tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT);
}else {
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
......
......@@ -803,6 +803,7 @@
detail.SETTLE_MONTH as settleMonth,
detail.SETTLE_TYPE as settleType,
detail.CREATE_NAME as createName,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus,
detail.REMARK as remark
from
t_insurance_detail detail
......@@ -903,4 +904,17 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<select id="selectByregionSQL" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM
t_insurance_detail detail
<where>
detail.ID = #{id}
<if test="regionSql != null and regionSql.trim() != ''">
and ${regionSql}
</if>
</where>
ORDER BY CREATE_TIME desc
</select>
</mapper>
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.salary.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......@@ -46,6 +47,7 @@ public class TSalaryEmployee extends BaseEntity {
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelIgnore
@ExcelProperty("主键")
private String id;
/**
......@@ -70,7 +72,15 @@ public class TSalaryEmployee extends BaseEntity {
@ExcelAttribute(name = "客户id", maxLength = 32)
@Length(max = 32, message = "客户id不能超过32个字符")
@ExcelProperty("客户id")
@ExcelIgnore
private String unitId;
/**
* 封面抬头
*/
@ExcelAttribute(name = "封面抬头", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
private String invoiceTitle;
/**
* 客户名称
*/
......@@ -84,6 +94,7 @@ public class TSalaryEmployee extends BaseEntity {
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Length(max = 32, message = "客户编码不能超过32个字符")
@ExcelProperty("客户编码")
@ExcelIgnore
private String unitNo;
/**
* 项目id
......@@ -91,6 +102,7 @@ public class TSalaryEmployee extends BaseEntity {
@ExcelAttribute(name = "项目id", maxLength = 32)
@Length(max = 32, message = "项目id不能超过32个字符")
@ExcelProperty("项目id")
@ExcelIgnore
private String deptId;
/**
* 项目名称
......@@ -113,6 +125,18 @@ public class TSalaryEmployee extends BaseEntity {
@Length(max = 50, message = "开户行总行不能超过50个字符")
@ExcelProperty("开户行总行")
private String bankName;
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省")
@ExcelProperty("开户行省")
private Integer bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市")
@ExcelProperty("开户行市")
private Integer bankCity;
/**
* 开户行支行
*/
......@@ -127,25 +151,6 @@ public class TSalaryEmployee extends BaseEntity {
@Length(max = 50, message = "银行卡号不能超过50个字符")
@ExcelProperty("银行卡号")
private String bankNo;
/**
* 封面抬头
*/
@ExcelAttribute(name = "封面抬头", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
private String invoiceTitle;
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省")
@ExcelProperty("开户行省")
private Integer bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市")
@ExcelProperty("开户行市")
private Integer bankCity;
/**
* 手机号码
*/
......
......@@ -255,5 +255,11 @@ public class TSalaryStandard extends BaseEntity {
@Length(max = 6, message = "推送月份(YYYYMM)不能超过6个字符")
@ExcelProperty("推送月份(YYYYMM)")
private String sendMonth;
/**
* 封面抬头
*/
@ExcelAttribute(name = "封面抬头", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
private String invoiceTitle;
}
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @Author fxj
* @Date 2022/8/8
* @Description
* @Version 1.0
*/
@Data
public class TSalaryStandardExportVo implements Serializable {
/**
* 状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)
*/
@ExcelAttribute(name = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)")
@NotBlank(message = "状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)不能为空")
@ExcelProperty("状态(0待提交1待审核2:待推送3已推送待发放4已发放5审核不通过6确认不通过7财务退回8:结算单调整待审核 9: 结算单调整待打印)")
private Integer status;
/**
* 推送月份(YYYYMM)
*/
@ExcelAttribute(name = "推送月份", isNotEmpty = true, errorInfo = "推送月份(YYYYMM)不能为空", maxLength = 6)
@NotBlank(message = "推送月份(YYYYMM)不能为空")
@Length(max = 6, message = "推送月份(YYYYMM)不能超过6个字符")
@ExcelProperty("推送月份")
private String sendMonth;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称",errorInfo = "项目名称不能为空", maxLength = 50)
@NotBlank(message = "项目名称不能为空")
@Length(max = 50, message = "部门名称不能超过50个字符")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 32)
@Length(max = 32, message = "项目编码不能超过32个字符")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 项目金额
*/
@ExcelAttribute(name = "项目金额")
@ExcelProperty("项目金额")
private BigDecimal settlementAmount;
/**
* 封面抬头
*/
@ExcelAttribute(name = "封面抬头", maxLength = 50)
@Length(max = 50, message = "封面抬头不能超过50个字符")
@ExcelProperty("封面抬头")
private String invoiceTitle;
/**
* 创建者-姓名
*/
@Schema(description = "创建人-姓名")
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建人")
private String createName;
/**
* 工资月份(YYYYMM)
*/
@ExcelAttribute(name = "工资月份(YYYYMM)", isNotEmpty = true, errorInfo = "工资月份(YYYYMM)不能为空", maxLength = 6)
@NotBlank(message = "工资月份(YYYYMM)不能为空")
@Length(max = 6, message = "工资月份(YYYYMM)不能超过6个字符")
@ExcelProperty("薪酬月份")
private String salaryMonth;
/**
* 表单类型0:薪资;1:绩效;2:其他;3:劳务费;4:稿酬
*/
@ExcelAttribute(name = "表单类型", isDataId = true, readConverterExp = "0=薪资,1=绩效,2=其他,3=劳务费,4=稿酬")
@NotBlank(message = "表单类型0:薪资;1:绩效;2:其他;3:劳务费;4:稿酬不能为空")
@Length(max = 32, message = "表单类型0:薪资;1:绩效;2:其他;3:劳务费;4:稿酬不能超过32个字符")
@ExcelProperty("表单类型")
private String formType;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
@TableField(fill = FieldFill.INSERT)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}
......@@ -132,7 +132,7 @@ public class TSalaryEmployeeController {
/**
* 薪酬人员表 批量导出
*
* @author hgw
* @author fxj
* @date 2022-08-05 11:40:14
**/
@Operation(description = "导出薪酬人员表 hasPermission('salary_tsalaryemployee-export')")
......
......@@ -118,7 +118,7 @@ public class TSalaryStandardController {
/**
* 标准薪酬工资表 批量导出
*
* @author hgw
* @author fxj
* @date 2022-08-05 11:40:14
**/
@Operation(description = "导出标准薪酬工资表 hasPermission('salary_tsalarystandard-export')")
......
......@@ -19,10 +19,15 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 标准薪酬工资表
*
......@@ -44,4 +49,8 @@ public interface TSalaryStandardMapper extends BaseMapper<TSalaryStandard> {
* @return
*/
IPage<TSalaryStandard> getTSalaryStandardAuditPage(Page<TSalaryStandard> page, @Param("tSalaryStandard") TSalaryStandard tSalaryStandard);
List<TSalaryStandardExportVo> getSalaryStandardExport( @Param("tSalaryStandard") TSalaryStandardSearchVo searchVo);
int getSalaryStandardExportCount(TSalaryStandardSearchVo searchVo);
}
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import javax.servlet.http.HttpServletResponse;
......@@ -47,7 +48,7 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
void listExport(HttpServletResponse response, TSalaryStandardSearchVo searchVo);
List<TSalaryStandard> noPageDiy(TSalaryStandardSearchVo searchVo);
List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo);
/**
* 标准薪酬工资表审核页面简单分页查询
......
......@@ -76,7 +76,7 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
*/
@Override
public void listExport(HttpServletResponse response, TSalaryEmployeeSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "薪酬人员表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSalaryEmployee> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -167,6 +167,12 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TSalaryEmployee::getCreateName, entity.getCreateName());
}
if (Common.isNotNull(entity.getEmpName())) {
wrapper.eq(TSalaryEmployee::getEmpName, entity.getEmpName());
}
if (Common.isNotNull(entity.getEmpIdcard())) {
wrapper.eq(TSalaryEmployee::getEmpIdcard, entity.getEmpIdcard());
}
return wrapper;
}
......
......@@ -36,6 +36,7 @@ import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2;
......@@ -76,9 +77,9 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
*/
@Override
public void listExport(HttpServletResponse response, TSalaryStandardSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "标准薪酬工资表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TSalaryStandard> list = new ArrayList<>();
List<TSalaryStandardExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
try {
......@@ -88,7 +89,7 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TSalaryStandard.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TSalaryStandardExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
......@@ -97,8 +98,8 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
ExcelUtil<TSalaryStandard> util = new ExcelUtil<>(TSalaryStandard.class);
for (TSalaryStandard vo : list) {
ExcelUtil<TSalaryStandardExportVo> util = new ExcelUtil<>(TSalaryStandardExportVo.class);
for (TSalaryStandardExportVo vo : list) {
util.convertEntity(vo, null, null, null);
}
}
......@@ -135,39 +136,12 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
}
@Override
public List<TSalaryStandard> noPageDiy(TSalaryStandardSearchVo searchVo) {
LambdaQueryWrapper<TSalaryStandard> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TSalaryStandard::getId, idList);
}
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
public List<TSalaryStandardExportVo> noPageDiy(TSalaryStandardSearchVo searchVo) {
return baseMapper.getSalaryStandardExport(searchVo);
}
private Long noPageCountDiy(TSalaryStandardSearchVo searchVo) {
LambdaQueryWrapper<TSalaryStandard> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)) {
wrapper.in(TSalaryStandard::getId, idList);
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TSalaryStandardSearchVo entity) {
LambdaQueryWrapper<TSalaryStandard> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TSalaryStandard::getCreateTime, entity.getCreateTimes()[0])
.le(TSalaryStandard::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TSalaryStandard::getCreateName, entity.getCreateName());
}
return wrapper;
private int noPageCountDiy(TSalaryStandardSearchVo searchVo) {
return baseMapper.getSalaryStandardExportCount(searchVo);
}
@Override
......
......@@ -58,6 +58,7 @@
<result property="unitName" column="UNIT_NAME"/>
<result property="sendTime" column="SEND_TIME"/>
<result property="sendMonth" column="SEND_MONTH"/>
<result property="invoiceTitle" column="INVOICE_TITLE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -94,7 +95,8 @@
a.UNIT_NAME,
a.UNIT_NO,
a.SEND_TIME,
a.SEND_MONTH
a.SEND_MONTH,
a.INVOICE_TITLE
</sql>
<sql id="tSalaryStandard_where">
<if test="tSalaryStandard != null">
......@@ -219,6 +221,44 @@
FROM t_salary_standard a
<where>
1=1
<include refid="where_page"/>
</where>
</select>
<!--tSalaryStandard简单分页查询-->
<select id="getSalaryStandardExport" resultType="com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo">
SELECT
a.STATUS,
a.SEND_MONTH,
a.DEPT_NAME,
a.DEPT_NO,
a.SETTLEMENT_AMOUNT,
a.ID,
a.DEPT_ID,
a.BELONG_DEPT_ID,
a.BELONG_DEPT_CODE,
a.SETTLEMENT_MONTH,
a.INVOICE_TITLE,
a.CREATE_NAME,
a.SALARY_MONTH,
a.FORM_TYPE,
a.CREATE_TIME
FROM t_salary_standard a
<where>
1=1
<include refid="where_page"/>
</where>
</select>
<!--tSalaryStandard简单分页查询-->
<select id="getSalaryStandardExportCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_salary_standard a
<where>
1=1
<include refid="where_page"/>
</where>
</select>
<sql id="where_page">
<if test="tSalaryStandard != null">
<if test="tSalaryStandard.deptName != null and tSalaryStandard.deptName.trim() != ''">
AND a.DEPT_NAME like concat(#{'%',#{tSalaryStandard.deptName},'%')
......@@ -236,6 +276,5 @@
AND a.STATUS = #{tSalaryStandard.status}
</if>
</if>
</where>
</select>
</sql>
</mapper>
......@@ -100,7 +100,7 @@ public class TDispatchReduceVo extends RowIndex implements Serializable {
/**
* 委托备注
*/
@ExcelAttribute(name = "委托备注")
@ExcelAttribute(name = "委托备注" , maxLength = 200)
@Schema(description = "委托备注" )
@ExcelProperty("委托备注" )
private String trustRemark;
......
......@@ -58,6 +58,7 @@ import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
......@@ -293,7 +294,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return R.ok(errorMessageList);
}
@Override
@GlobalTransactional
@GlobalTransactional(rollbackFor = Exception.class)
@Transactional(rollbackFor = Exception.class)
public void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList,
YifuUser user) {
......@@ -354,25 +356,30 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isEmpty(socialSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST)));
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
}
if (Common.isNotNull(excel.getProvidentHousehold())){
if (Common.isEmpty(fundSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_HOLD_NOT_EXIST)));
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
}
if (Common.isNotNull(dispatchMap) && Common.isNotNull(dispatchMap.get(excel.getEmpIdcard()))){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EXIST)));
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
// 数据合法情况
if (validImport(errorMessageList, excel,setInfoVo,socialFundMap,empVo,socialSet,fundSet)) {
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
// 是否可以派单: 派单状态、兼职工伤处理
if (validDdispatchStatus(errorMessageList, socialFundMap, excel)) {
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
// 初始化新增信息:档案、项目档案、员工合同
......@@ -381,7 +388,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
initSocialAddInfo(socialsMap, empVo, socialSet, excel,socialFundMap);
// 新增公积金
if (initFundAddInfo(errorMessageList, fundsMap, empVo, fundSet, excel)){
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
// 新增派单信息
......@@ -452,7 +459,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
project = null;
fund = null;
excel = excelVOList.get(i);
if (Common.isNotNull(excelVOTemp) && Common.isNotNull(excelVOTemp.get(excel.getEmpIdcard()))){
if (Common.isNotNull(excelVOTemp) && Common.isNotNull(excelVOTemp.get(excel.getRowIndex().toString()))){
continue;
}
// 验证档案是否插入成功 如果MAP 无数据直接不处理
......@@ -546,6 +553,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
vo.setFundStatus(CommonConstants.ONE_STRING);
vo.setDepartNo(socialFund.getSettleDomainCodeFund());
}
// 有一个办理成功重新派单的 即为办理中
if (Common.isNotNull(socialFund) &&
(CommonConstants.ONE_STRING.equals(socialFund.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(socialFund.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(socialFund.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(socialFund.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialFund.getIsIllness())))
){
vo.setSocialStatus(CommonConstants.ONE_STRING);
}
vo.setEmpIdCard(socialFund.getEmpIdcard());
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){
......@@ -554,7 +573,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
private void insertSocial(EmpAddDispatchVo emp, TSocialInfo social) {
if (Common.isNotNull(social)){
if (Common.isNotNull(social) && Common.isEmpty(social.getId())){
if (Common.isNotNull(emp)){
social.setEmpNo(emp.getEmpCode());
social.setEmpId(emp.getId());
......@@ -564,7 +583,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
private void insertFund(EmpAddDispatchVo emp, TProvidentFund fund) {
if (Common.isNotNull(fund)){
if (Common.isNotNull(fund) && Common.isEmpty(fund.getId())){
if (Common.isNotNull(emp)){
fund.setEmpNo(emp.getEmpCode());
fund.setEmpId(emp.getId());
......@@ -605,7 +624,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
if (Common.isNotNull(social)){
socialFund.setSocialStartDate(social.getSocialStartDate());
socialFund.setSocialAddStatus(CommonConstants.ZERO_STRING);
socialFund.setSocialReduceDate(null);
socialFund.setSocialReduceStatus(CommonConstants.ONE_STRING_NEGATE);
socialFund.setSocialId(social.getId());
......@@ -617,7 +635,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setUnitUnemploymentMoney(BigDecimal.ZERO);
socialFund.setUnitInjuryMoney(BigDecimal.ZERO);
socialFund.setUnitBirthMoney(BigDecimal.ZERO);
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialFund.getIsIllness())){
socialFund.setUnitBigailmentMoney(social.getUnitBigailmentMoney());
socialFund.setPersonalBigailmentMoney(social.getPersonalBigailmentMoney());
}
......@@ -628,6 +647,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalPensionPer(social.getPersonalPensionPer());
socialFund.setUnitPersionMoney(BigDecimalUtils.safeMultiply(social.getUnitPensionCardinal(), social.getUnitPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setPersonalPersionMoney(BigDecimalUtils.safeMultiply(social.getPersonalPensionCardinal(), social.getPersonalPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setPensionHandle(social.getPensionHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getMedicalHandle())){
socialFund.setUnitMedicalCardinal(social.getUnitMedicalCardinal());
......@@ -636,6 +656,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalMedicalPer(social.getPersonalMedicalPer());
socialFund.setUnitMedicalMoney(BigDecimalUtils.safeMultiply(social.getUnitMedicalCardinal(), social.getUnitMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setPersonalMedicalMoney(BigDecimalUtils.safeMultiply(social.getPersonalMedicalCardinal(), social.getPersonalMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setMedicalHandle(social.getMedicalHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getUnemployHandle())){
socialFund.setUnitUnemploymentCardinal(social.getUnitUnemploymentCardinal());
......@@ -644,24 +665,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setUnitUnemploymentPer(social.getUnitUnemploymentPer());
socialFund.setUnitUnemploymentMoney(BigDecimalUtils.safeMultiply(social.getUnitUnemploymentCardinal(), social.getUnitUnemploymentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setPersonalUnemploymentMoney(BigDecimalUtils.safeMultiply(social.getPersonalUnemploymentCardinal(), social.getPersonalUnemploymentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setUnemployHandle(social.getUnemployHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialFund.getIsIllness())){
socialFund.setUnitBigailmentCardinal(social.getUnitBigailmentCardinal());
socialFund.setPersonalBigailmentCardinal(social.getPersonalBigailmentCardinal());
socialFund.setUnitBigailmentPer(social.getUnitBigailmentPer());
socialFund.setPersonalBigailmentPer(social.getPersonalBigailmentPer());
socialFund.setUnitBigailmentMoney(social.getUnitBigailmentMoney());
socialFund.setPersonalBigailmentMoney(social.getPersonalBigailmentMoney());
socialFund.setBigailmentHandle(social.getBigailmentHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getWorkInjuryHandle())){
socialFund.setUnitWorkInjuryCardinal(social.getUnitWorkInjuryCardinal());
socialFund.setUnitWorkUnjuryPer(social.getUnitWorkUnjuryPer());
socialFund.setUnitInjuryMoney(BigDecimalUtils.safeMultiply(social.getUnitWorkInjuryCardinal(), social.getUnitWorkUnjuryPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setWorkInjuryHandle(social.getWorkInjuryHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBirthHandle())){
socialFund.setUnitBirthCardinal(social.getUnitBirthCardinal());
socialFund.setUnitBirthPer(social.getUnitBirthPer());
socialFund.setUnitBirthMoney(BigDecimalUtils.safeMultiply(social.getUnitBirthCardinal(), social.getUnitBirthPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setBirthHandle(social.getBirthHandle());
}
socialFund.setCanOverpay(social.getCanOverpay());
......@@ -687,12 +713,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setWorkInjuryStart(social.getWorkInjuryStart());
socialFund.setBirthStart(social.getBirthStart());
socialFund.setBigailmentStart(social.getBigailmentStart());
socialFund.setPensionHandle(social.getPensionHandle());
socialFund.setMedicalHandle(social.getMedicalHandle());
socialFund.setUnemployHandle(social.getUnemployHandle());
socialFund.setWorkInjuryHandle(social.getWorkInjuryHandle());
socialFund.setBirthHandle(social.getBirthHandle());
socialFund.setBigailmentHandle(social.getBigailmentHandle());
socialFund.setUnitSocialSum(BigDecimalUtils.safeAdd(socialFund.getUnitPersionMoney()
, socialFund.getUnitMedicalMoney(), socialFund.getUnitBirthMoney()
......@@ -722,7 +742,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 设置公积金信息派增 派减状态
socialFund.setLatestCardinalityFund(fund.getInsuranceIsLatestCardinality());
socialFund.setFundReduceDate(null);
socialFund.setFundAddStatus(CommonConstants.ZERO_STRING);
socialFund.setFundReduceStatus(CommonConstants.ONE_STRING_NEGATE);
//单边小数点处理逻辑
if (Common.isNotNull(fund.getFundPayPoint())){
......@@ -770,6 +789,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setUnitNameFund(setInfoVo.getCustomerName());
socialFund.setSocialStatus(CommonConstants.ZERO_STRING);
socialFund.setSocialAddStatus(CommonConstants.ZERO_STRING);
/*if (!CommonConstants.FOUR_STRING.equals(socialFund.getSocialStatus())){
}*/
socialFund.setSocialReduceStatus(CommonConstants.ONE_STRING_NEGATE);
socialFund.setSocialReduceDate(null);
socialFund.setSocialStartDate(excel.getPensionStart());
......@@ -1668,7 +1689,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
|| CommonConstants.ZERO_STRING.equals(sf.getUnemployHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| CommonConstants.ZERO_STRING.equals(sf.getBigailmentHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle());
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness()));
if (flag) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_REDUCE)));
return true;
......@@ -2169,7 +2191,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return R.ok(errorMessageList);
}
@GlobalTransactional
@GlobalTransactional(rollbackFor = Exception.class)
@Transactional(rollbackFor = Exception.class)
@Override
public void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user) {
if (!Common.isNotNull(excelVOList)){
......@@ -2218,7 +2241,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVoMap)) {
empVo = empVoMap.get(excel.getEmpIdcard());
}
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
// 初始化派单 和 社保公积金查询信息
dispatch = getDispatchInfo(empVo, excel, socialFund,setInfoVo,user);
try {
......@@ -2482,7 +2505,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Param
* @return
**/
@GlobalTransactional
@GlobalTransactional(rollbackFor = Exception.class)
@Transactional(rollbackFor = Exception.class)
@Override
public List<ErrorMessage> addBatchApplyAudit(List<String> idsList, YifuUser user, Integer flag, String auditStatus, String auditRemark, String remark) {
List<ErrorMessage> errorList = new ArrayList<>();
......@@ -2664,7 +2688,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
&& CommonConstants.ONE_INT == flag.intValue()){
// 更新预估数据
forecastLibraryService.updateForecastLibaryByDispatch(sf);
}
// 更新人员档案和项目档案的社保公积金状态
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
if (Common.isNotNull(dis.getSocialId())){
vo.setSocialStatus(CommonConstants.ZERO_STRING);
......@@ -2674,11 +2698,23 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
vo.setEmpIdCard(dis.getEmpIdcard());
vo.setDepartNo(dis.getSettleDomainCode());
if (Common.isNotNull(sf) && Common.isNotNull(dis.getSocialId())
&& (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){
ServiceUtil.runTimeExceptionDiy("同步人员档案、项目档案的社保公积金状态失败!");
}
}
}
} catch (Exception e) {
log.error(DispatchConstants.DISPATCH_AUDIT_ERROR , e);
errorList.add(new ErrorMessage(-1, DispatchConstants.DISPATCH_AUDIT_ERROR + e.getMessage()));
......@@ -2777,7 +2813,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
* @Author fxj
* @Date 2022-07-26
**/
@GlobalTransactional
@GlobalTransactional(rollbackFor = Exception.class)
@Transactional(rollbackFor = Exception.class)
public List<ErrorMessage> addBatchApplyHandle(List<String> idsList, String typeSub, YifuUser user
, int flag, String handleStatus, String handleRemark, String socialType, String remark) {
List<ErrorMessage> errorList = new ArrayList<>();
......@@ -3044,61 +3081,24 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
auditInfoMapper.insert(auditInfo);
baseMapper.updateById(dis);
socialFundMapper.updateById(sf);
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
//1.派增办理失败 刷新预估数据
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
// 办理失败
if (CommonConstants.ONE_INT == flag){
// 派增办理,全部失败 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatch(sf);
if (Common.isNotNull(socialInfo)){
if (typeSub.equals(CommonConstants.ZERO_STRING)
&& CommonConstants.TWO_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.ZERO_STRING);
}
if (typeSub.equals(CommonConstants.ZERO_STRING)
&& CommonConstants.FIVE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
}
if (typeSub.equals(CommonConstants.ONE_STRING)
&& Common.isNotNull(providentFund)
&& CommonConstants.TWO_STRING.equals(providentFund.getHandleStatus())){
vo.setFundStatus(CommonConstants.ZERO_STRING);
}
}
if (CommonConstants.ZERO_INT == flag){
if (Common.isNotNull(socialInfo)){
if (typeSub.equals(CommonConstants.ZERO_STRING)
&& CommonConstants.ONE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.THREE_STRING);
}
if (typeSub.equals(CommonConstants.ZERO_STRING)
&& CommonConstants.FIVE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
}
if (typeSub.equals(CommonConstants.ONE_STRING)
&& Common.isNotNull(providentFund)
&& CommonConstants.ONE_STRING.equals(providentFund.getHandleStatus())){
vo.setFundStatus(CommonConstants.THREE_STRING);
}
}
}
// 2.派减办理成功 处理预估
if (CommonConstants.ONE_STRING.equals(dis.getType())
&& CommonConstants.ZERO_INT == flag){
// 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf);
if (typeSub.equals(CommonConstants.ZERO_STRING)
&& Common.isNotNull(socialInfo)){
vo.setSocialStatus(CommonConstants.FOUR_STRING);
}
if (typeSub.equals(CommonConstants.ONE_STRING)
&& Common.isNotNull(providentFund)){
vo.setFundStatus(CommonConstants.FOUR_STRING);
}
}
UpProjectSocialFundVo vo = new UpProjectSocialFundVo();
// 社保状态 社保状态(字典): 0 无社保 1 处理中 2.部分购买 3.正常 4.已派减
initSocialFundStatus(socialInfo, providentFund, vo,sf);
vo.setEmpIdCard(dis.getEmpIdcard());
vo.setDepartNo(dis.getSettleDomainCode());
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
......@@ -3120,6 +3120,65 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
return errorList;
}
private void initSocialFundStatus(TSocialInfo socialInfo, TProvidentFund providentFund, UpProjectSocialFundVo vo, TSocialFundInfo sf) {
if (Common.isNotNull(socialInfo)){
// 办理失败或审核不通过
if (CommonConstants.TWO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.TWO_STRING.equals(socialInfo.getAuditStatus())){
vo.setSocialStatus(CommonConstants.ZERO_STRING);
}
// 待办理或办理中为 处理中
if (CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.ONE_STRING);
}
if (CommonConstants.FIVE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
if (CommonConstants.ONE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.THREE_STRING);
}
if (CommonConstants.THREE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.FOUR_STRING);
}
if ((CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
&&
(!CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (!CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
}
// 公积金状态 社保状态(字典): 0 无社保 1 处理中 2.正常 3.已派减
if (Common.isNotNull(providentFund)){
if (CommonConstants.TWO_STRING.equals(providentFund.getHandleStatus())
|| CommonConstants.TWO_STRING.equals(providentFund.getAuditStatus())){
vo.setFundStatus(CommonConstants.ZERO_STRING);
}
if (CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus())){
vo.setFundStatus(CommonConstants.ONE_STRING);
}
if (CommonConstants.ONE_STRING.equals(providentFund.getHandleStatus())){
vo.setFundStatus(CommonConstants.TWO_STRING);
}
if (CommonConstants.THREE_STRING.equals(providentFund.getHandleStatus())){
vo.setFundStatus(CommonConstants.THREE_STRING);
}
}
}
private StringBuilder getHandleRemark(String socialType, TSocialInfo socialInfo) {
StringBuilder socialTypeRemark;
socialTypeRemark = new StringBuilder();
......@@ -3209,12 +3268,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.ZERO_STRING.equals(dis.getType()) && Common.isNotNull(dis.getSocialId())){
//办理成功 flag=0 办理失败 flag=1
// 派增:
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()))) {
if ((Common.isEmpty(sf.getPensionHandle()) || CommonConstants.ONE_STRING.equals(sf.getPensionHandle()))
&& (Common.isEmpty(sf.getMedicalHandle()) || CommonConstants.ONE_STRING.equals(sf.getMedicalHandle()))
&& (Common.isEmpty(sf.getUnemployHandle()) || CommonConstants.ONE_STRING.equals(sf.getUnemployHandle()))
&& (Common.isEmpty(sf.getWorkInjuryHandle()) || CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle()))
&& (Common.isEmpty(sf.getBirthHandle()) || CommonConstants.ONE_STRING.equals(sf.getBirthHandle()))
&& (Common.isEmpty(sf.getBigailmentHandle()) || CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle()))) {
// 全部成功(或者为空--兼容历史数据问题):全部成功
socialInfo.setHandleStatus(CommonConstants.ONE_STRING);
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[0]);//改成可派减状态
......@@ -3223,24 +3282,25 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
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()))) {
} else if ((Common.isEmpty(sf.getPensionHandle()) || CommonConstants.TWO_STRING.equals(sf.getPensionHandle()))
&& (Common.isEmpty(sf.getMedicalHandle()) || CommonConstants.TWO_STRING.equals(sf.getMedicalHandle()))
&& (Common.isEmpty(sf.getUnemployHandle()) || CommonConstants.TWO_STRING.equals(sf.getUnemployHandle()))
&& (Common.isEmpty(sf.getWorkInjuryHandle()) || CommonConstants.TWO_STRING.equals(sf.getWorkInjuryHandle()))
&& (Common.isEmpty(sf.getBirthHandle()) || CommonConstants.TWO_STRING.equals(sf.getBirthHandle()))
&& (Common.isEmpty(sf.getBigailmentHandle()) || CommonConstants.TWO_STRING.equals(sf.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()))) {
} else if ((Common.isEmpty(sf.getPensionHandle()) || CommonConstants.ZERO_STRING.equals(sf.getPensionHandle()))
|| (Common.isEmpty(sf.getMedicalHandle()) || CommonConstants.ZERO_STRING.equals(sf.getMedicalHandle()))
|| (Common.isEmpty(sf.getUnemployHandle()) || CommonConstants.ZERO_STRING.equals(sf.getUnemployHandle()))
|| (Common.isEmpty(sf.getWorkInjuryHandle()) || CommonConstants.ZERO_STRING.equals(sf.getWorkInjuryHandle()))
|| (Common.isEmpty(sf.getBirthHandle()) || CommonConstants.ZERO_STRING.equals(sf.getBirthHandle()))
|| (Common.isNotNull(sf.getBigailmentHandle()) && CommonConstants.ZERO_STRING.equals(sf.getBigailmentHandle())
)) {
// 含有办理中的:办理中
socialInfo.setHandleStatus(CommonConstants.FOUR_STRING);
socialInfo.setReduceCan(CommonConstants.dingleDigitStrArray[1]);//改成不可派减状态
......@@ -3281,37 +3341,44 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private void setSocialSixStatus(String handleStatus, String socialType, TSocialInfo socialInfo, TSocialFundInfo sf) {
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.ONE_STRING))
&& Common.isNotNull(socialInfo.getPensionHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle())) {
&& CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getPensionHandle())) {
socialInfo.setPensionHandle(handleStatus);
sf.setPensionHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.TWO_STRING))
&& Common.isNotNull(socialInfo.getMedicalHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle())) {
&& CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())) {
socialInfo.setMedicalHandle(handleStatus);
sf.setMedicalHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.THREE_STRING))
&& Common.isNotNull(socialInfo.getUnemployHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle())) {
&& CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())) {
socialInfo.setUnemployHandle(handleStatus);
sf.setUnemployHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.FOUR_STRING))
&& Common.isNotNull(socialInfo.getWorkInjuryHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle())) {
&& CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())) {
socialInfo.setWorkInjuryHandle(handleStatus);
sf.setWorkInjuryHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.FIVE_STRING))
&& Common.isNotNull(socialInfo.getBirthHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle())) {
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getBirthHandle())) {
socialInfo.setBirthHandle(handleStatus);
sf.setBirthHandle(handleStatus);
}
if ((Common.isEmpty(socialType) || socialType.contains(CommonConstants.SIX_STRING))
&& Common.isNotNull(socialInfo.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())) {
&& CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())) {
socialInfo.setBigailmentHandle(handleStatus);
sf.setBigailmentHandle(handleStatus);
}
......
......@@ -1693,12 +1693,16 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
if (Common.isNotNull(library.getId())) {
baseMapper.updateById(library);
isSaveAndUpdate = true;
} else {
if (BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitSocialSum())) != CommonConstants.ZERO_INT
|| BigDecimal.ZERO.compareTo(BigDecimalUtils.isNullToZero(library.getUnitFundSum())) != CommonConstants.ZERO_INT) {
library.setCreateTime(LocalDateTime.now());
baseMapper.insert(library);
}
isSaveAndUpdate = true;
}
}
}
if (isSaveAndUpdate) {
return R.ok(null, "执行成功!");
} else {
......@@ -1810,7 +1814,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
//起缴月份在要生成的月份前不处理 || 截止月份在要生成的月份后不处理
if (Integer.parseInt(payMonth) < DateUtil.formatDateInt(minStartDate)
|| (Common.isNotNull(tSocialInfo.getSocialReduceDate())
&& Integer.parseInt(payMonth) > DateUtil.formatDateInt(tSocialInfo.getSocialReduceDate()))) {
&& Integer.parseInt(payMonth) >= DateUtil.formatDateInt(tSocialInfo.getSocialReduceDate()))) {
continue;
}
flag = CommonConstants.ZERO_STRING.equals(tSocialInfo.getCanOverpay()) && (null == tSocialInfo.getOverpayNumber() || null == tSocialInfo.getHaveThisMonth() || null == minStartDate);
......
......@@ -551,10 +551,10 @@
AND a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain}
</if>
<if test="tSocialFundInfo.settleDomainName != null and tSocialFundInfo.settleDomainName.trim() != ''">
AND (a.SETTLE_DOMAIN_NAME = #{tSocialFundInfo.settleDomainName} or a.SETTLE_DOMAIN_NAME_FUND = #{tSocialFundInfo.settleDomainName})
AND (a.SETTLE_DOMAIN_NAME like concat('%',#{tSocialFundInfo.settleDomainName},'%') or a.SETTLE_DOMAIN_NAME_FUND like concat('%',#{tSocialFundInfo.settleDomainName},'%'))
</if>
<if test="tSocialFundInfo.unitName != null and tSocialFundInfo.unitName.trim() != ''">
AND (a.UNIT_NAME = #{tSocialFundInfo.unitName} or a.UNIT_NAME_FUND = #{tSocialFundInfo.unitName})
AND (a.UNIT_NAME like concat('%',#{tSocialFundInfo.unitName},'%') or a.UNIT_NAME_FUND like concat('%',#{tSocialFundInfo.unitName},'%'))
</if>
<if test="tSocialFundInfo.unitId != null and tSocialFundInfo.unitId.trim() != ''">
AND a.UNIT_ID = #{tSocialFundInfo.unitId}
......@@ -563,7 +563,7 @@
AND a.SOCIAL_HOUSEHOLD = #{tSocialFundInfo.socialHousehold}
</if>
<if test="tSocialFundInfo.socialHouseholdName != null and tSocialFundInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME = #{tSocialFundInfo.socialHouseholdName}
AND a.SOCIAL_HOUSEHOLD_NAME like concat('%',#{tSocialFundInfo.socialHouseholdName},'%')
</if>
<if test="tSocialFundInfo.socialProvince != null and tSocialFundInfo.socialProvince.trim() != ''">
AND a.SOCIAL_PROVINCE = #{tSocialFundInfo.socialProvince}
......@@ -578,7 +578,7 @@
AND a.PROVIDENT_HOUSEHOLD = #{tSocialFundInfo.providentHousehold}
</if>
<if test="tSocialFundInfo.providentHouseholdName != null and tSocialFundInfo.providentHouseholdName.trim() != ''">
AND a.PROVIDENT_HOUSEHOLD_NAME = #{tSocialFundInfo.providentHouseholdName}
AND a.PROVIDENT_HOUSEHOLD_NAME like concat('%',#{tSocialFundInfo.providentHouseholdName},'%')
</if>
<if test="tSocialFundInfo.fundProvince != null and tSocialFundInfo.fundProvince.trim() != ''">
AND a.FUND_PROVINCE = #{tSocialFundInfo.fundProvince}
......@@ -865,6 +865,12 @@
<if test="tSocialFundInfo.latestCardinalityFund != null and tSocialFundInfo.latestCardinalityFund.trim() != ''">
AND a.LATEST_CARDINALITY_FUND = #{tSocialFundInfo.latestCardinalityFund}
</if>
<if test="tSocialFundInfo.socialStatus != null and tSocialFundInfo.socialStatus.trim() != ''">
AND a.SOCIAL_STATUS = #{tSocialFundInfo.socialStatus}
</if>
<if test="tSocialFundInfo.fundStatus != null and tSocialFundInfo.fundStatus.trim() != ''">
AND a.FUND_STATUS = #{tSocialFundInfo.fundStatus}
</if>
</if>
</sql>
<!--tSocialFundInfo简单分页查询-->
......@@ -876,15 +882,16 @@
1=1
<include refid="tSocialFundInfo_where"/>
</where>
order by a.CREATE_TIME desc
</select>
<!--获取在用社保-->
<!--获取在用社保 #a.SOCIAL_ADD_STATUS != '4' and a.SOCIAL_REDUCE_STATUS != '2' -->
<select id="getSocialList" resultMap="tSocialFundInfoMap">
SELECT
<include refid="Other_Base_Column_List"/>
FROM t_social_fund_info a
<where>
a.SOCIAL_ADD_STATUS != '4' and a.SOCIAL_REDUCE_STATUS != '2'
1=1
<if test="empIdCard != null">
and a.EMP_IDCARD = #{empIdCard}
</if>
......@@ -896,13 +903,13 @@
</if>
</where>
</select>
<!--获取在用公积金-->
<!--获取在用公积金 a.FUND_ADD_STATUS != '4' and a.FUND_REDUCE_STATUS != '2' -->
<select id="getFundList" resultMap="tSocialFundInfoMap">
SELECT
<include refid="Other_Base_Column_List"/>
FROM t_social_fund_info a
<where>
a.FUND_ADD_STATUS != '4' and a.FUND_REDUCE_STATUS != '2'
1=1
<if test="empIdCard != null">
and a.EMP_IDCARD = #{empIdCard}
</if>
......
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