Commit aad22092 authored by fangxinjiang's avatar fangxinjiang

代码优化-fxj

parent b66129c2
...@@ -573,60 +573,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -573,60 +573,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
if (newInfo.getServerItem().contains("公积金") && dispatchInfoFundPreOldVo != null && dispatchInfoFundPreVo != null) { if (newInfo.getServerItem().contains("公积金") && dispatchInfoFundPreOldVo != null && dispatchInfoFundPreVo != null) {
Date expectedCollectionTime = dispatchInfoFundPreVo.getExpectedCollectionTime();
Date expectedConfirmTime = dispatchInfoFundPreVo.getExpectedConfirmTime();
//如果自动触发派增为是,计算派单发起时间和派单确认时间
initFundTime(dispatchInfoFundPreVo);
differenceFundKey = HrEquator.comparisonValueIgnoreField(dispatchInfoFundPreOldVo differenceFundKey = HrEquator.comparisonValueIgnoreField(dispatchInfoFundPreOldVo
, dispatchInfoFundPreVo, SOCIAL_IGNORE_FIELD); , dispatchInfoFundPreVo, SOCIAL_IGNORE_FIELD);
//如果自动触发派增为是,计算派单发起时间和派单确认时间
//如果自动触发派增为是,计算派单发起时间和派单确认时间
/*if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
&& Common.isNotNull(preVo.getExpectedCollectionType())) {
TEmployeeContractDateVo vo = new TEmployeeContractDateVo();
//接收方式 0项目配置 1自定义
if (CommonConstants.ONE_STRING.equals(preVo.getReceiveType())){
vo.setMonthAfter(CommonConstants.ZERO_INT);
vo.setYearAfter(0);
vo.setRegistDate(preVo.getFundStartDate());
}else {
if (null == preVo.getFundStartDate()){
//先计算起缴日期
if (CommonConstants.ZERO_STRING.equals(preVo.getFundDateType())){
//用户选择起缴日期类型为入职日期,以入职日期为基准
vo.setMonthAfter(CommonConstants.ZERO_INT);
vo.setYearAfter(0);
vo.setRegistDate(preVo.getJoinLeaveDate());
}else if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){
//用户选择起缴日期类型为入职满一年次月,以入职日期为基准 加上年月调整
vo.setMonthAfter(CommonConstants.ONE_INT);
vo.setYearAfter(CommonConstants.ONE_INT);
vo.setRegistDate(preVo.getJoinLeaveDate());
}else if (CommonConstants.TWO_STRING.equals(preVo.getFundDateType())){
//用户自定义取值用户填写的起缴日期为基准
vo.setMonthAfter(CommonConstants.ZERO_INT);
vo.setYearAfter(0);
vo.setRegistDate(preVo.getFundStartDate());
}
}else {
vo.setMonthAfter(CommonConstants.ZERO_INT);
vo.setYearAfter(0);
vo.setRegistDate(preVo.getFundStartDate());
}
}
Date date = this.addYearsMonths(vo);
if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){
date = DateUtil.getFirstDay(date);
}
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(date);
dayVo.setRegistType(0);
TEmployeeInsuranceWorkDayVo dataR = tHolidayInfoService.selectBeforeOrAfterWorkDayCommon(dayVo);
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getRegistDate())) {
preVo.setExpectedCollectionTime(dataR.getRegistDate());
preVo.setExpectedConfirmTime(dataR.getRegistDate());
} else {
preVo.setExpectedCollectionTime(date);
preVo.setExpectedConfirmTime(date);
}*/
if (differenceFundKey.length() > 0) { if (differenceFundKey.length() > 0) {
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
diffTitle += "、公积金信息"; diffTitle += "、公积金信息";
...@@ -640,6 +592,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -640,6 +592,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
differenceFundKey, logId, detailEmpLog); differenceFundKey, logId, detailEmpLog);
detailList.add(detailEmpLog); detailList.add(detailEmpLog);
} }
dispatchInfoFundPreVo.setExpectedCollectionTime(expectedCollectionTime);
dispatchInfoFundPreVo.setExpectedConfirmTime(expectedConfirmTime);
} }
// 有修改,则加日志 // 有修改,则加日志
...@@ -711,7 +665,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -711,7 +665,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
} }
private TDispatchInfoPreVo initFundTime(TDispatchInfoPreVo preVo ,Date joinLeaveDate) { private TDispatchInfoPreVo initFundTime(TDispatchInfoPreVo preVo) {
if (null == preVo){ if (null == preVo){
preVo = new TDispatchInfoPreVo(); preVo = new TDispatchInfoPreVo();
} }
...@@ -729,12 +683,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -729,12 +683,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
//用户选择起缴日期类型为入职日期,以入职日期为基准 //用户选择起缴日期类型为入职日期,以入职日期为基准
vo.setMonthAfter(CommonConstants.ZERO_INT); vo.setMonthAfter(CommonConstants.ZERO_INT);
vo.setYearAfter(0); vo.setYearAfter(0);
vo.setRegistDate(joinLeaveDate); vo.setRegistDate(preVo.getFundStartDate());
}else if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){ }else if (CommonConstants.ONE_STRING.equals(preVo.getFundDateType())){
//用户选择起缴日期类型为入职满一年次月,以入职日期为基准 加上年月调整 //用户选择起缴日期类型为入职满一年次月,以入职日期为基准 加上年月调整
vo.setMonthAfter(CommonConstants.ONE_INT); vo.setMonthAfter(CommonConstants.ONE_INT);
vo.setYearAfter(CommonConstants.ONE_INT); vo.setYearAfter(CommonConstants.ONE_INT);
vo.setRegistDate(joinLeaveDate); vo.setRegistDate(preVo.getFundStartDate());
}else if (CommonConstants.TWO_STRING.equals(preVo.getFundDateType())){ }else if (CommonConstants.TWO_STRING.equals(preVo.getFundDateType())){
//用户自定义取值用户填写的起缴日期为基准 //用户自定义取值用户填写的起缴日期为基准
vo.setMonthAfter(CommonConstants.ZERO_INT); vo.setMonthAfter(CommonConstants.ZERO_INT);
......
...@@ -50,4 +50,6 @@ public interface TDispatchInfoPreMapper extends BaseMapper<TDispatchInfoPre> { ...@@ -50,4 +50,6 @@ public interface TDispatchInfoPreMapper extends BaseMapper<TDispatchInfoPre> {
long selectFundExportCount(@Param("tDispatchInfoPre") TDispatchInfoPreSearchVo searchVo); long selectFundExportCount(@Param("tDispatchInfoPre") TDispatchInfoPreSearchVo searchVo);
long selectFundCount(@Param("tDispatchInfoPre") TDispatchInfoPreSearchVo searchVo);
} }
...@@ -183,8 +183,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -183,8 +183,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
@Override @Override
public long getDispatchInfoFundCount(TDispatchInfoPreSearchVo searchVo) { public long getDispatchInfoFundCount(TDispatchInfoPreSearchVo searchVo) {
searchVo.setType(CommonConstants.ONE_STRING);
initSearchVo(searchVo); initSearchVo(searchVo);
return baseMapper.selectFundExportCount(searchVo); return baseMapper.selectFundCount(searchVo);
} }
@Override @Override
......
...@@ -402,10 +402,23 @@ ...@@ -402,10 +402,23 @@
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where> <where>
1=1 and a.type_sub = '1' 1=1 and a.type_sub = '1'
and a.DELETE_FLAG = '0'
<include refid="tDispatchInfoPre_where"/> <include refid="tDispatchInfoPre_where"/>
</where> </where>
</select> </select>
<select id="selectFundCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_dispatch_info_pre a
left join view_contract b on a.EMP_IDCARD = b.EMP_IDCARD and a.DEPT_NO = b.DEPT_NO
<where>
1=1 and a.type_sub = '1'
and a.DELETE_FLAG = '0'
<include refid="tDispatchInfoPre_other_where"/>
</where>
</select>
<select id="selectExportList" resultMap="tDispatchInfoPreExportMap"> <select id="selectExportList" resultMap="tDispatchInfoPreExportMap">
SELECT SELECT
a.dept_name, a.dept_name,
...@@ -518,7 +531,7 @@ ...@@ -518,7 +531,7 @@
a.id preId, a.id preId,
a.TRUST_REMARK trustRemark, a.TRUST_REMARK trustRemark,
a.CUSTOMER_USER_LOGIN_NAME as preLoginName, a.CUSTOMER_USER_LOGIN_NAME as preLoginName,
if(#{type} = '1',concat('手动派单-',a.customer_username),concat('自动化派单-',a.customer_username)) preName if(#{type} = '1',concat('自动化手动-',a.customer_username),concat('自动化自动-',a.customer_username)) preName
FROM t_dispatch_info_pre a,(select @i:=0) as itable FROM t_dispatch_info_pre a,(select @i:=0) as itable
<where> <where>
1=1 1=1
...@@ -541,7 +554,9 @@ ...@@ -541,7 +554,9 @@
a.dept_no settleDomainCode, a.dept_no settleDomainCode,
a.RECORD_BASE recordBase, a.RECORD_BASE recordBase,
a.PROVIDENT_HOUSEHOLD_NAME providentHousehold, a.PROVIDENT_HOUSEHOLD_NAME providentHousehold,
a.PROVIDENT_CARDINAL providentCardinal, CASE WHEN a.PAYMENT_TYPE ='0' THEN c.LOWER_LIMIT
WHEN a.PAYMENT_TYPE ='2' THEN c.UPPER_LIMIT
ELSE a.PROVIDENT_CARDINAL END as 'providentCardinal',
a.FUND_START_DATE providentStart, a.FUND_START_DATE providentStart,
a.FUND_PER_FLAG perFlag, a.FUND_PER_FLAG perFlag,
a.UNIT_PROVIDENT_PER providentPer, a.UNIT_PROVIDENT_PER providentPer,
...@@ -549,8 +564,13 @@ ...@@ -549,8 +564,13 @@
a.id preId, a.id preId,
a.TRUST_REMARK trustRemark, a.TRUST_REMARK trustRemark,
a.CUSTOMER_USER_LOGIN_NAME as preLoginName, a.CUSTOMER_USER_LOGIN_NAME as preLoginName,
if(#{type} = '1',concat('手动派单-',a.customer_username),concat('自动化派单-',a.customer_username)) preName if(#{type} = '1',concat('自动化手动-',a.customer_username),concat('自动化自动-',a.customer_username)) preName
FROM t_dispatch_info_pre a,(select @i:=0) as itable FROM t_dispatch_info_pre a
LEFT JOIN sys_base_set_info b ON a.CONFIG_HOUSE_ID = b.ID
LEFT JOIN (select * from sys_base_set_info t where
DATE_FORMAT(t.APPLY_START_DATE,'%Y%m%d') <![CDATA[ <= ]]> DATE_FORMAT(CURDATE(),'%Y%m%d') and DATE_FORMAT(CURDATE(),'%Y%m%d') <![CDATA[ <= ]]> IFNULL(t.APPLY_END_DATE,DATE_FORMAT(CURDATE(),'%Y%m%d'))
) c ON c.DEPART_NAME = b.DEPART_NAME
,(select @i:=0) as itable
<where> <where>
1=1 1=1
AND a.id in AND a.id in
...@@ -562,6 +582,7 @@ ...@@ -562,6 +582,7 @@
#{status} #{status}
</foreach> </foreach>
</where> </where>
group by a.id
</select> </select>
<select id="getAllUnDisSocialData" resultMap="tDispatchInfoPreMap"> <select id="getAllUnDisSocialData" resultMap="tDispatchInfoPreMap">
SELECT SELECT
......
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