Commit 97a278ba authored by fangxinjiang's avatar fangxinjiang

MVP1.2:推送优化--预估

parent e3f29ac5
...@@ -14,7 +14,7 @@ public class TSettleDomainListVo { ...@@ -14,7 +14,7 @@ public class TSettleDomainListVo {
*/ */
private List<TSettleDomainSelectVo> listSelectVO; private List<TSettleDomainSelectVo> listSelectVO;
private Map<String,TSettleDomainSelectVo> mapSlectVo; private Map<String,TSettleDomainSelectVo> mapSelectVo;
private Map<String,TSettleDomain> mapVO; private Map<String,TSettleDomain> mapVO;
......
...@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TDepartSettlementInfoService ...@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TDepartSettlementInfoService
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService; import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
...@@ -42,6 +43,7 @@ import java.io.UnsupportedEncodingException; ...@@ -42,6 +43,7 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
...@@ -169,6 +171,9 @@ public class TSettleDomainController { ...@@ -169,6 +171,9 @@ public class TSettleDomainController {
List<TSettleDomainSelectVo> list = tSettleDomainService.selectAllSettleDomainSelectVos(); List<TSettleDomainSelectVo> list = tSettleDomainService.selectAllSettleDomainSelectVos();
TSettleDomainListVo listVo = new TSettleDomainListVo(); TSettleDomainListVo listVo = new TSettleDomainListVo();
listVo.setListSelectVO(list); listVo.setListSelectVO(list);
if (Common.isNotNull(list)){
listVo.setMapSelectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getDepartNo, k->k)));
}
return listVo; return listVo;
} }
......
...@@ -505,4 +505,5 @@ public interface CommonConstants { ...@@ -505,4 +505,5 @@ public interface CommonConstants {
// 权限使用的 // 权限使用的
public static final String A_DEPT_ID = "a.dept_id"; public static final String A_DEPT_ID = "a.dept_id";
public static final String A_CREATE_BY = "a.CREATE_BY"; public static final String A_CREATE_BY = "a.CREATE_BY";
String SETTLE_DOMAIN_GET_ERROR = "获取结算主体信息失败!";
} }
...@@ -62,6 +62,10 @@ public class Common { ...@@ -62,6 +62,10 @@ public class Common {
return null == obj || "".equals(obj) || "null".equals(obj); return null == obj || "".equals(obj) || "null".equals(obj);
} }
public static boolean isEmpty(Map obj) {
return (null == obj || obj.size() == 0);
}
public static boolean isEmpty(List obj) { public static boolean isEmpty(List obj) {
return (null == obj || obj.size() == 0); return (null == obj || obj.size() == 0);
} }
......
...@@ -2337,25 +2337,63 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2337,25 +2337,63 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
@Override @Override
public void createForecastInfo() { public void createForecastInfo() {
//获取所有未推送的社保预估明细数据 long count = baseMapper.selectCount(Wrappers.<TForecastLibrary>query().lambda()
List<TForecastLibrary> unPushInfo = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT) .eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)); .eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT));
if (Common.isNotNull(unPushInfo)) { if (count > 0) {
//推送数据封装并推送 Map<String,TSettleDomainSelectVo> selectVoMap = this.getSelectVoMap();
initEkpPushSocialParam(unPushInfo,true); //获取所有未推送的社保预估明细数据
List<TForecastLibrary> unPushInfo = null;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
for (int j = 0; j < i; j++) {
unPushInfo= baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getDataType, CommonConstants.ZERO_INT)
.last(" limit 0, 10000"));
if (Common.isNotNull(unPushInfo)){
//推送数据封装并推送
initEkpPushSocialParam(unPushInfo,true,selectVoMap);
}
}
unPushInfo.clear();
selectVoMap.clear();
}
}
private Map<String, TSettleDomainSelectVo> getSelectVoMap() {
R<TSettleDomainListVo> settleDomainR = archivesDaprUtil.selectAllSettleDomainSelectVos();
Map<String,TSettleDomainSelectVo> mapSelectVo = null;
if (Common.isNotNull(settleDomainR) && Common.isNotNull(settleDomainR.getData())){
mapSelectVo = settleDomainR.getData().getMapSelectVo();
}
if (Common.isEmpty(mapSelectVo)){
ServiceUtil.runTimeExceptionDiy(CommonConstants.SETTLE_DOMAIN_GET_ERROR);
} }
return mapSelectVo;
} }
@Override @Override
public void createForecastFundInfo() { public void createForecastFundInfo() {
//获取所有未推送的公积金预估明细数据 long count = baseMapper.selectCount(Wrappers.<TForecastLibrary>query().lambda()
List<TForecastLibrary> unPushInfo = baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT) .eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)); .eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT));
if (Common.isNotNull(unPushInfo)) { if (count > 0) {
//推送数据封装并推送 Map<String,TSettleDomainSelectVo> selectVoMap = this.getSelectVoMap();
initEkpPushFundParam(unPushInfo,true); //获取所有未推送的公积金预估明细数据
List<TForecastLibrary> unPushInfo = null;
int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
for (int j = 0; j < i; j++) {
unPushInfo= baseMapper.selectList(Wrappers.<TForecastLibrary>query().lambda()
.eq(TForecastLibrary::getDataPush, CommonConstants.ZERO_INT)
.eq(TForecastLibrary::getDataType, CommonConstants.ONE_INT)
.last(" limit 0, 10000"));
if (Common.isNotNull(unPushInfo)){
//推送数据封装并推送
initEkpPushFundParam(unPushInfo,true,selectVoMap);
}
}
unPushInfo.clear();
selectVoMap.clear();
} }
} }
...@@ -2363,7 +2401,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2363,7 +2401,9 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void pushForecastInfo(List<TForecastLibrary> library, boolean synFlag) { public void pushForecastInfo(List<TForecastLibrary> library, boolean synFlag) {
if (Common.isNotNull(library)) { if (Common.isNotNull(library)) {
//推送数据封装并推送 //推送数据封装并推送
initEkpPushSocialParam(library,synFlag); Map<String,TSettleDomainSelectVo> selectVoMap = this.getSelectVoMap();
initEkpPushSocialParam(library,synFlag, selectVoMap);
selectVoMap.clear();
} }
} }
...@@ -2371,33 +2411,26 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2371,33 +2411,26 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
public void pushForecastFundInfo(List<TForecastLibrary> library,boolean synFlag) { public void pushForecastFundInfo(List<TForecastLibrary> library,boolean synFlag) {
if (Common.isNotNull(library)) { if (Common.isNotNull(library)) {
//推送数据封装并推送 //推送数据封装并推送
initEkpPushFundParam(library,synFlag); Map<String,TSettleDomainSelectVo> selectVoMap = this.getSelectVoMap();
initEkpPushFundParam(library,synFlag, selectVoMap);
selectVoMap.clear();
} }
} }
public void initEkpPushSocialParam(List<TForecastLibrary> unPushInfo, boolean synFlag) { public void initEkpPushSocialParam(List<TForecastLibrary> unPushInfo, boolean synFlag,
R<TSettleDomainListVo> listVo; Map<String, TSettleDomainSelectVo> selectVoMap) {
List<TSettleDomainSelectVo> settleDomainR; TSettleDomain settleDomain;
EkpPushSocialParam socialParam;
for (TForecastLibrary library : unPushInfo) { for (TForecastLibrary library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); settleDomain = selectVoMap.get(library.getDeptNo());
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId()); if (Common.isEmpty(settleDomain)){
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo : settleDomainR) {
BeanUtils.copyProperties(vo, settleDomain);
}
}
}
if (Common.isEmpty(listVo) || CommonConstants.SUCCESS != listVo.getCode()){
ServiceUtil.runTimeExceptionDiy("获取结算主体异常,请检查传参和档案服务状态!"); ServiceUtil.runTimeExceptionDiy("获取结算主体异常,请检查传参和档案服务状态!");
} }
if (CommonConstants.ZERO_STRING.equals(settleDomain.getSocialType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getSocialType())) {
continue; continue;
} }
EkpPushSocialParam socialParam = new EkpPushSocialParam(); socialParam = new EkpPushSocialParam();
//员工姓名 //员工姓名
socialParam.setFd_3adfe8c79989d4(library.getEmpName()); socialParam.setFd_3adfe8c79989d4(library.getEmpName());
//员工身份证 //员工身份证
...@@ -2619,26 +2652,20 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap ...@@ -2619,26 +2652,20 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
} }
} }
public void initEkpPushFundParam(List<TForecastLibrary> unPushInfo,boolean synFlag) { public void initEkpPushFundParam(List<TForecastLibrary> unPushInfo, boolean synFlag,
R<TSettleDomainListVo> listVo; Map<String, TSettleDomainSelectVo> selectVoMap) {
List<TSettleDomainSelectVo> settleDomainR; TSettleDomain settleDomain;
EkpPushFundParam fundParam;
for (TForecastLibrary library : unPushInfo) { for (TForecastLibrary library : unPushInfo) {
//获取项目信息 //获取项目信息
TSettleDomain settleDomain = new TSettleDomain(); settleDomain = selectVoMap.get(library.getDeptNo());
listVo = archivesDaprUtil.selectSettleDomainSelectVoById(library.getSettleDomainId()); if (Common.isEmpty(settleDomain)){
if (Common.isNotNull(listVo)) { ServiceUtil.runTimeExceptionDiy("获取结算主体异常,请检查传参和档案服务状态!");
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
for (TSettleDomainSelectVo vo : settleDomainR) {
BeanUtils.copyProperties(vo, settleDomain);
}
}
} }
if (CommonConstants.ZERO_STRING.equals(settleDomain.getFundType())) { if (CommonConstants.ZERO_STRING.equals(settleDomain.getFundType())) {
continue; continue;
} }
EkpPushFundParam fundParam = new EkpPushFundParam(); fundParam = new EkpPushFundParam();
//员工姓名 //员工姓名
fundParam.setFd_3adfe8c79989d4(library.getEmpName()); fundParam.setFd_3adfe8c79989d4(library.getEmpName());
//员工身份证 //员工身份证
......
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