Commit 080f6f0f authored by hongguangwu's avatar hongguangwu

档案、社保基数

parent 72304b6c
...@@ -214,4 +214,8 @@ public class EmployeeExportVO extends BaseEntity { ...@@ -214,4 +214,8 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty(value = "单位编码") @ExcelProperty(value = "单位编码")
private String unitNo; private String unitNo;
@ExcelAttribute(name = "人员档案状态", readConverterExp = "0=草稿,1=已审核")
@ExcelProperty(value = "人员档案状态")
private String status;
} }
...@@ -123,6 +123,7 @@ ...@@ -123,6 +123,7 @@
<result property="leaveTime" column="LEAVE_TIME"/> <result property="leaveTime" column="LEAVE_TIME"/>
<result property="leaveReason" column="LEAVE_REASON"/> <result property="leaveReason" column="LEAVE_REASON"/>
<result property="leaveRemark" column="LEAVE_REMARK"/> <result property="leaveRemark" column="LEAVE_REMARK"/>
<result property="status" column="STATUS"/>
</resultMap> </resultMap>
<sql id="baseParam"> <sql id="baseParam">
...@@ -216,6 +217,7 @@ ...@@ -216,6 +217,7 @@
a.SALARY_STATUS, a.SALARY_STATUS,
a.CREATE_NAME, a.CREATE_NAME,
a.CREATE_TIME, a.CREATE_TIME,
a.STATUS,
a.CONTACT_ADDRESS a.CONTACT_ADDRESS
</sql> </sql>
......
...@@ -452,6 +452,15 @@ public class SysBaseSetInfo extends BaseEntity { ...@@ -452,6 +452,15 @@ public class SysBaseSetInfo extends BaseEntity {
@ExcelProperty("社保户名称") @ExcelProperty("社保户名称")
private String departName; private String departName;
@ExcelAttribute(name = "执行月份")
@Schema(description = "执行月份")
@ExcelProperty("执行月份")
private String doMonth;
@Schema(description = "适用月")
@TableField(exist = false)
private String applyDate;
@Schema(description = "公积金比例List(保存时前端传参用)") @Schema(description = "公积金比例List(保存时前端传参用)")
@TableField(exist = false) @TableField(exist = false)
private List<SysPayProportion> fundProList; private List<SysPayProportion> fundProList;
......
...@@ -34,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService; ...@@ -34,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -68,13 +69,28 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -68,13 +69,28 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
return R.failed("获取用户登录信息失败!"); return R.failed("获取用户登录信息失败!");
} }
SysBaseSetInfo baseSetInfo = null; SysBaseSetInfo baseSetInfo = null;
SysBaseSetInfo lastBase = null;
if (null != sysBaseSetInfo.getTown()) { if (null != sysBaseSetInfo.getTown()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda() baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType()) .eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId()) .eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown()) .eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown())
.and(obj -> obj
.and(obj1 -> obj1
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate()) .le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.and(obj2 -> obj2
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()) .ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.or()
.isNull(SysBaseSetInfo::getApplyEndDate)))
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.last(CommonConstants.LAST_ONE_SQL));
lastBase = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown())
.isNull(SysBaseSetInfo::getApplyEndDate)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
} }
if (null != sysBaseSetInfo.getCity() && null == sysBaseSetInfo.getTown()) { if (null != sysBaseSetInfo.getCity() && null == sysBaseSetInfo.getTown()) {
...@@ -83,8 +99,23 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -83,8 +99,23 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId()) .eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity()) .eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity())
.isNull(SysBaseSetInfo::getTown) .isNull(SysBaseSetInfo::getTown)
.and(obj -> obj
.and(obj1 -> obj1
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate()) .le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.and(obj2 -> obj2
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()) .ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.or()
.isNull(SysBaseSetInfo::getApplyEndDate)))
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.last(CommonConstants.LAST_ONE_SQL));
lastBase = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity())
.isNull(SysBaseSetInfo::getTown)
.isNull(SysBaseSetInfo::getApplyEndDate)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
} }
if (null != sysBaseSetInfo.getProvince() && null == sysBaseSetInfo.getCity()) { if (null != sysBaseSetInfo.getProvince() && null == sysBaseSetInfo.getCity()) {
...@@ -93,14 +124,34 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -93,14 +124,34 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId()) .eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince()) .eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince())
.isNull(SysBaseSetInfo::getCity) .isNull(SysBaseSetInfo::getCity)
.and(obj -> obj
.and(obj1 -> obj1
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate()) .le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.and(obj2 -> obj2
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()) .ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.or()
.isNull(SysBaseSetInfo::getApplyEndDate)))
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.last(CommonConstants.LAST_ONE_SQL));
lastBase = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince())
.isNull(SysBaseSetInfo::getCity)
.isNull(SysBaseSetInfo::getApplyEndDate)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
} }
if (null != baseSetInfo) { if (null != baseSetInfo) {
return R.failed("对应户、地市、有效期的基数配置已存在!"); return R.failed("对应户、地市、有效期的基数配置已存在!");
} }
// 将上一个无截止月的增加截止月
if (lastBase != null) {
lastBase.setApplyEndDate(sysBaseSetInfo.getApplyStartDate());
this.updateById(lastBase);
}
this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo); this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo);
return R.ok(); return R.ok();
} }
...@@ -116,15 +167,23 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -116,15 +167,23 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
return R.failed("根据id未找到基数配置!" + sysBaseSetInfo.getId()); return R.failed("根据id未找到基数配置!" + sysBaseSetInfo.getId());
} }
SysBaseSetInfo baseSetInfo = null; SysBaseSetInfo baseSetInfo = null;
// where (b.apply_start_date < '2023-01' and ( b.apply_end_date > '2023-01' or b.apply_end_date is null) ) or b.apply_start_date > '2023-01'
if (null != sysBaseSetInfo.getTown()) { if (null != sysBaseSetInfo.getTown()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda() baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType()) .eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId()) .eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown()) .eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown())
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId()) .ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT) .eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.and(obj -> obj
.and(obj1 -> obj1
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.and(obj2 -> obj2
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.or()
.isNull(SysBaseSetInfo::getApplyEndDate)))
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
} }
if (null != sysBaseSetInfo.getCity() && null == sysBaseSetInfo.getTown()) { if (null != sysBaseSetInfo.getCity() && null == sysBaseSetInfo.getTown()) {
...@@ -133,8 +192,15 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -133,8 +192,15 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId()) .eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity()) .eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity())
.isNull(SysBaseSetInfo::getTown) .isNull(SysBaseSetInfo::getTown)
.and(obj -> obj
.and(obj1 -> obj1
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate()) .le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.and(obj2 -> obj2
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()) .ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.or()
.isNull(SysBaseSetInfo::getApplyEndDate)))
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId()) .ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT) .eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
...@@ -145,8 +211,15 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -145,8 +211,15 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId()) .eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince()) .eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince())
.isNull(SysBaseSetInfo::getCity) .isNull(SysBaseSetInfo::getCity)
.and(obj -> obj
.and(obj1 -> obj1
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate()) .le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.and(obj2 -> obj2
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()) .ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.or()
.isNull(SysBaseSetInfo::getApplyEndDate)))
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId()) .ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT) .eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
<result property="insuranceIsLatestCardinality" column="INSURANCE_IS_LATEST_CARDINALITY"/> <result property="insuranceIsLatestCardinality" column="INSURANCE_IS_LATEST_CARDINALITY"/>
<result property="deleteFlag" column="DELETE_FLAG"/> <result property="deleteFlag" column="DELETE_FLAG"/>
<result property="departName" column="DEPART_NAME"/> <result property="departName" column="DEPART_NAME"/>
<result property="doMonth" column="DO_MONTH"/>
<result property="createBy" column="CREATE_BY"/> <result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/> <result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/> <result property="createName" column="CREATE_NAME"/>
...@@ -82,10 +83,7 @@ ...@@ -82,10 +83,7 @@
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a a.ID,
.
ID
,
a.PROVINCE, a.PROVINCE,
a.CITY, a.CITY,
a.TOWN, a.TOWN,
...@@ -136,6 +134,7 @@ ...@@ -136,6 +134,7 @@
a.INSURANCE_IS_LATEST_CARDINALITY, a.INSURANCE_IS_LATEST_CARDINALITY,
a.DELETE_FLAG, a.DELETE_FLAG,
a.DEPART_NAME, a.DEPART_NAME,
a.DO_MONTH,
a.CREATE_BY, a.CREATE_BY,
a.UPDATE_BY, a.UPDATE_BY,
a.CREATE_NAME, a.CREATE_NAME,
...@@ -295,7 +294,13 @@ ...@@ -295,7 +294,13 @@
AND a.DELETE_FLAG = #{sysBaseSetInfo.deleteFlag} AND a.DELETE_FLAG = #{sysBaseSetInfo.deleteFlag}
</if> </if>
<if test="sysBaseSetInfo.departName != null and sysBaseSetInfo.departName.trim() != ''"> <if test="sysBaseSetInfo.departName != null and sysBaseSetInfo.departName.trim() != ''">
AND a.DEPART_NAME = #{sysBaseSetInfo.departName} AND a.DEPART_NAME like concat('%',#{sysBaseSetInfo.departName},'%')
</if>
<if test="sysBaseSetInfo.applyDate != null and sysBaseSetInfo.applyDate.trim() != ''">
AND (
a.APPLY_START_DATE <![CDATA[ <= ]]> #{sysBaseSetInfo.applyDate}
and (a.APPLY_END_DATE is null or a.APPLY_END_DATE >= #{sysBaseSetInfo.applyDate})
)
</if> </if>
<if test="sysBaseSetInfo.createBy != null and sysBaseSetInfo.createBy.trim() != ''"> <if test="sysBaseSetInfo.createBy != null and sysBaseSetInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{sysBaseSetInfo.createBy} AND a.CREATE_BY = #{sysBaseSetInfo.createBy}
......
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