Commit 2e410ae3 authored by hongguangwu's avatar hongguangwu

MVP1.5-薪资导入优化(社保基数)

parent 332bba9f
......@@ -62,4 +62,13 @@ public interface SysBaseSetInfoMapper extends BaseMapper<SysBaseSetInfo> {
* @return
**/
List<SysBaseSetInfo> getFundBaseSet(@Param("fundHolds")List<String> fundHolds);
/**
* @param sysBaseSetInfo
* @Description: 编辑时查询有没有已存在的配置
* @Author: hgw
* @Date: 2023/2/15 18:15
* @return: int
**/
int getCountByEdit(@Param("sysBaseSetInfo") SysBaseSetInfo sysBaseSetInfo);
}
......@@ -161,52 +161,11 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
List<SysPayProportion> payProportionList = sysPayProportionService.getSysPayProportionByBaseId(sysBaseSetInfo.getId());
old.setFundProList(payProportionList);
}
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()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown())
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.and(obj -> obj
.ge(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysBaseSetInfo.getCity() && null == sysBaseSetInfo.getTown()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity())
.isNull(SysBaseSetInfo::getTown)
.and(obj -> obj
.ge(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysBaseSetInfo.getProvince() && null == sysBaseSetInfo.getCity()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince())
.isNull(SysBaseSetInfo::getCity)
.and(obj -> obj
.ge(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.or()
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate()))
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != baseSetInfo) {
return R.failed("对应户、地市、有效期的基数配置已存在!");
}
// 2023-2-16 09:38:24 晨会上产品经理倩倩确认,编辑时,时间日期不可编辑。
/*int count = baseMapper.getCountByEdit(sysBaseSetInfo)
if count > CommonConstants.ZERO_INT)
return R.failed("对应户、地市、有效期的基数配置已存在!")
*/
this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo, old);
int type = CommonConstants.ONE_INT;
......
......@@ -387,4 +387,55 @@
</where>
ORDER BY a.apply_start_date desc
</select>
<!-- 获取条数-->
<select id="getCountByEdit" resultType="java.lang.Integer">
SELECT
count(1)
FROM sys_base_set_info a
<where>
a.STATUS = 0 and a.ID != #{sysBaseSetInfo.id}
<if test="sysBaseSetInfo.baseType != null and sysBaseSetInfo.baseType.trim() != ''">
AND a.BASE_TYPE = #{sysBaseSetInfo.baseType}
</if>
<if test="sysBaseSetInfo.departId != null and sysBaseSetInfo.departId.trim() != ''">
AND a.DEPART_ID = #{sysBaseSetInfo.departId}
</if>
<if test="sysBaseSetInfo.province != null">
AND a.PROVINCE = #{sysBaseSetInfo.province}
</if>
<if test="sysBaseSetInfo.city != null">
AND a.CITY = #{sysBaseSetInfo.city}
</if>
<if test="sysBaseSetInfo.city == null">
AND a.CITY is null
</if>
<if test="sysBaseSetInfo.town != null">
AND a.TOWN = #{sysBaseSetInfo.town}
</if>
<if test="sysBaseSetInfo.town == null">
AND a.TOWN is null
</if>
<if test="sysBaseSetInfo.applyEndDate == null">
AND a.APPLY_END_DATE <![CDATA[ >= ]]> #{sysBaseSetInfo.applyStartDate}
</if>
<if test="sysBaseSetInfo.applyEndDate != null">
AND (
(apply_end_date is not null and (
(
apply_start_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyEndDate}
and apply_end_date >= #{sysBaseSetInfo.applyEndDate}
) or (
apply_start_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyStartDate}
and apply_end_date >= #{sysBaseSetInfo.applyStartDate}
) or (
apply_start_date >= #{sysBaseSetInfo.applyStartDate}
and apply_end_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyEndDate}
)
)) or (apply_end_date is null and apply_start_date <![CDATA[ <= ]]> #{sysBaseSetInfo.applyEndDate})
)
</if>
</where>
limit 1
</select>
</mapper>
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