Commit 1a174203 authored by huyuchen's avatar huyuchen

明细接口改造

parent fab1c8fc
...@@ -44,11 +44,11 @@ public class EkpSocialInfo { ...@@ -44,11 +44,11 @@ public class EkpSocialInfo {
private String fd_3adfe8c7e4cf7a; private String fd_3adfe8c7e4cf7a;
private String fd_3adfe8cb96c41e; private Date fd_3adfe8cb96c41e;
private String fd_3adfe8cf632700; private Date fd_3adfe8cf632700;
private String fd_3adfe8cff746bc; private Date fd_3adfe8cff746bc;
private Double fd_3adfeb4e8064a8; private Double fd_3adfeb4e8064a8;
......
package com.yifu.cloud.plus.v1.ekp.service.impl; package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper; import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
...@@ -51,11 +52,18 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -51,11 +52,18 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
if (Optional.ofNullable(deptInfoVoList).isPresent()) { if (Optional.ofNullable(deptInfoVoList).isPresent()) {
map = deptInfoVoList.stream().collect(Collectors.toMap(EkpDeptInfoVo::getDeptNo, k->k)); map = deptInfoVoList.stream().collect(Collectors.toMap(EkpDeptInfoVo::getDeptNo, k->k));
} }
EkpSocialInfo socialCount;
for (EkpPushSocialParam socialParam : unPushList) { for (EkpPushSocialParam socialParam : unPushList) {
//去重 防止重复推送
socialCount = baseMapper.selectOne(Wrappers.<EkpSocialInfo>query().lambda()
.eq(EkpSocialInfo::getFd_3b0b716e771e06,socialParam.getFd_3b0afbe1f94a08())
.last(CommonConstants.LAST_ONE_SQL));
if(Optional.ofNullable(socialCount).isPresent()) {
continue;
}
EkpSocialInfo socialInfo = new EkpSocialInfo(); EkpSocialInfo socialInfo = new EkpSocialInfo();
//对象信息赋值 //对象信息赋值
copyProperties(socialParam,socialInfo); copySocialProperties(socialParam,socialInfo);
//社保信息 //社保信息
deptInfo = map.get(socialInfo.getFd_3adfe8c70d3fd4()); deptInfo = map.get(socialInfo.getFd_3adfe8c70d3fd4());
...@@ -65,9 +73,9 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -65,9 +73,9 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
if("生成月本月数据".equals(deptInfo.getSocialType())){ if("生成月本月数据".equals(deptInfo.getSocialType())){
socialInfo.setFd_3adfe8cff746bc(socialInfo.getFd_3adfe8cb96c41e()); socialInfo.setFd_3adfe8cff746bc(socialInfo.getFd_3adfe8cb96c41e());
}else if("生成月上月数据".equals(deptInfo.getSocialType())){ }else if("生成月上月数据".equals(deptInfo.getSocialType())){
socialInfo.setFd_3adfe8cff746bc(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.stringToDate(socialInfo.getFd_3adfe8cb96c41e(),"yyyy-MM"),-1))); socialInfo.setFd_3adfe8cff746bc(DateUtil.stringToDate(DateUtil.dateToString(DateUtil.addMonthByDate(socialInfo.getFd_3adfe8cb96c41e(),-1)),"yyyy-MM"));
}else if("生成月次月数据".equals(deptInfo.getSocialType())){ }else if("生成月次月数据".equals(deptInfo.getSocialType())){
socialInfo.setFd_3adfe8cff746bc(DateUtil.dateToString(DateUtil.addMonthByDate(DateUtil.stringToDate(socialInfo.getFd_3adfe8cb96c41e(),"yyyy-MM"),1))); socialInfo.setFd_3adfe8cff746bc(DateUtil.stringToDate(DateUtil.dateToString(DateUtil.addMonthByDate(socialInfo.getFd_3adfe8cb96c41e(),1)),"yyyy-MM"));
} }
//是否全部结算 //是否全部结算
if("全量未结算数据".equals(deptInfo.getSocialType())){ if("全量未结算数据".equals(deptInfo.getSocialType())){
...@@ -76,7 +84,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -76,7 +84,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
socialInfo.setFd_3b1354c3add8c2(CommonConstants.IS_FALSE); socialInfo.setFd_3b1354c3add8c2(CommonConstants.IS_FALSE);
} }
//获取社保订单明细合计 //获取社保订单明细合计
socialSumInfo = baseMapper.getCostSumInfo(socialInfo.getFd_3adfe8c7e4cf7a(),socialInfo.getFd_3adfe8cb96c41e()); socialSumInfo = baseMapper.getCostSumInfo(socialInfo.getFd_3adfe8c7e4cf7a(),DateUtil.dateToString(socialInfo.getFd_3adfe8cb96c41e(),"yyyy-MM"));
//预估合计 //预估合计
Double ygSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getYgSum(); Double ygSum = Common.isEmpty(socialSumInfo) ? 0: socialSumInfo.getYgSum();
//预估个人合计 //预估个人合计
...@@ -196,7 +204,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -196,7 +204,7 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
return null; return null;
} }
private void copyProperties(EkpPushSocialParam socialParam,EkpSocialInfo socialInfo) { private void copySocialProperties(EkpPushSocialParam socialParam,EkpSocialInfo socialInfo) {
//订单类型 //订单类型
socialInfo.setFd_3add9dd7833db8(socialParam.getFd_3add9dd7833db8()); socialInfo.setFd_3add9dd7833db8(socialParam.getFd_3add9dd7833db8());
//与工资合并结算 //与工资合并结算
...@@ -226,9 +234,9 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -226,9 +234,9 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
//我司到款单位 //我司到款单位
socialInfo.setFd_3b0194c7336de0(socialParam.getFd_3b01953871b8be()); socialInfo.setFd_3b0194c7336de0(socialParam.getFd_3b01953871b8be());
//生成月份 //生成月份
socialInfo.setFd_3adfe8cb96c41e(socialParam.getFd_3adfe8cb96c41e()); socialInfo.setFd_3adfe8cb96c41e(DateUtil.stringToDate(socialParam.getFd_3adfe8cb96c41e(),"yyyy-MM"));
//缴纳月份 //缴纳月份
socialInfo.setFd_3adfe8cf632700(socialParam.getFd_3adfe8cf632700()); socialInfo.setFd_3adfe8cf632700(DateUtil.stringToDate(socialParam.getFd_3adfe8cf632700(),"yyyy-MM"));
//社保ID //社保ID
socialInfo.setFd_3b0b716e771e06(socialParam.getFd_3b0afbe1f94a08()); socialInfo.setFd_3b0b716e771e06(socialParam.getFd_3b0afbe1f94a08());
//薪酬申请编号 //薪酬申请编号
......
...@@ -112,6 +112,6 @@ ...@@ -112,6 +112,6 @@
round(sum(ifnull(fd_3b35a5b03100c4,0)),2) as personYzc, round(sum(ifnull(fd_3b35a5b03100c4,0)),2) as personYzc,
round(sum(ifnull(fd_3b35a5b0b04d54,0)),2) as dwYzc round(sum(ifnull(fd_3b35a5b0b04d54,0)),2) as dwYzc
from ekp_social_info from ekp_social_info
where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month} where fd_3adfe8c7e4cf7a = #{card} and DATE_FORMAT(fd_3adfe8cb96c41e,'%Y-%m') = #{month}
</select> </select>
</mapper> </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