Commit 0b397ac1 authored by hongguangwu's avatar hongguangwu

报账薪资导出

parent 92542a7a
......@@ -42,9 +42,8 @@ import java.util.List;
*/
@Data
@TableName("t_salary_account")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "工资报账主表(工资条)")
public class TSalaryAccount extends BaseEntity {
public class TSalaryAccount {
/**
* 主键
......
......@@ -146,7 +146,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
wrapper.orderByDesc(TSalaryAccount::getSalaryMonth);
return baseMapper.selectList(wrapper);
}
......@@ -160,9 +160,6 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
private LambdaQueryWrapper buildQueryWrapper(TSalaryAccountSearchVo entity) {
LambdaQueryWrapper<TSalaryAccount> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(TSalaryAccount::getCreateName, entity.getCreateName());
}
return wrapper;
}
......
......@@ -281,7 +281,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
boolean isReduceFund = false;
// 核心刷新
R<String> coreR = this.doCore(payMonthList, socialInfoList, fundList, agentConfigHashMap, socialHistoryMap
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund);
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund, false);
if (coreR != null) return coreR;
boolean isSaveAndUpdate = false;
for (TForecastLibrary library : saveLibraryMap.values()) {
......@@ -1615,7 +1615,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
}
/**
* @param isOnly 是否仅更新传过来的社保公积金,true:是
* @param isOnly 是否仅更新传过来的社保公积金,true:是(同时,true时,是户调基,要判断断缴)
* @param socialFundInfo
* @Description: 根据社保公积金信息表更新预估库
* @Author: hgw
......@@ -1729,7 +1729,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
boolean isReduceFund = false;
// 核心刷新
R<String> coreR = this.doCore(payMonthList, socialInfoList, fundList, agentConfigHashMap, socialHistoryMap
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund);
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund, isOnly);
if (coreR != null) return coreR;
boolean isSaveAndUpdate = false;
YifuUser user = SecurityUtils.getUser();
......@@ -1839,7 +1839,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
, List<TSocialFundInfo> fundList, HashMap<String, TAgentConfig> agentConfigHashMap
, HashMap<String, TForecastLibrary> socialHistoryMap, HashMap<String, TForecastLibrary> fundHistoryMap
, HashMap<String, TForecastLibrary> socialPushMap, HashMap<String, TForecastLibrary> fundPushMap
, Map<String, TForecastLibrary> saveLibraryMap, boolean isReduceSocial, boolean isReduceFund) {
, Map<String, TForecastLibrary> saveLibraryMap, boolean isReduceSocial, boolean isReduceFund, boolean isOnly) {
// 预估历史,存储基数
TForecastLibrary historyLibrary;
boolean flag;
......@@ -1867,23 +1867,38 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 5 办理失败 10 审核不通过,且无推送数据,不新增
continue;
}
//起缴月份在要生成的月份前不处理 || 截止月份在要生成的月份后不处理
if (Integer.parseInt(payMonth) < DateUtil.formatDateInt(minStartDate)
|| (Common.isNotNull(tSocialInfo.getSocialReduceDate())
&& Integer.parseInt(payMonth) >= DateUtil.formatDateInt(tSocialInfo.getSocialReduceDate()))) {
continue;
}
flag = CommonConstants.ZERO_STRING.equals(tSocialInfo.getCanOverpay()) && (null == tSocialInfo.getOverpayNumber() || null == tSocialInfo.getHaveThisMonth() || null == minStartDate);
if (flag) {
return R.failed("员工" + tSocialInfo.getEmpName() + ":" + tSocialInfo.getEmpIdcard() + SocialConstants.SOCIAL_SET_ERROR);
} else {
// 户调基,值看预估库历史数据有没有
if (isOnly) {
historyLibrary = socialHistoryMap.get(sfMapKey);
// 初始化社保
initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
if (historyLibrary != null) {
// 初始化社保
initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
}
}
}
} else {
//起缴月份在要生成的月份前不处理 || 截止月份在要生成的月份后不处理
if (Integer.parseInt(payMonth) < DateUtil.formatDateInt(minStartDate)
|| (Common.isNotNull(tSocialInfo.getSocialReduceDate())
&& Integer.parseInt(payMonth) >= DateUtil.formatDateInt(tSocialInfo.getSocialReduceDate()))) {
continue;
}
flag = CommonConstants.ZERO_STRING.equals(tSocialInfo.getCanOverpay()) && (null == tSocialInfo.getOverpayNumber() || null == tSocialInfo.getHaveThisMonth() || null == minStartDate);
if (flag) {
return R.failed("员工" + tSocialInfo.getEmpName() + ":" + tSocialInfo.getEmpIdcard() + SocialConstants.SOCIAL_SET_ERROR);
} else {
historyLibrary = socialHistoryMap.get(sfMapKey);
// 初始化社保
initSocialLibary(diffType, payMonth, saveLibraryMap, tSocialInfo, isReduceFund, agentConfigHashMap, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
}
}
}
}
......@@ -1904,24 +1919,39 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
// 4办理失败9 审核不通过,且无推送数据,不新增
continue;
}
//起缴月份在要生成的月份后不处理 || 截止月份在要生成的月份后不处理
if (Common.isNotNull(providentFund.getProvidentStart())
&& Integer.parseInt(payMonth) < DateUtil.formatDateInt(providentFund.getProvidentStart())
|| (Common.isNotNull(providentFund.getFundReduceDate())
&& Integer.parseInt(payMonth) > DateUtil.formatDateInt(providentFund.getFundReduceDate()))) {
continue;
}
flag = CommonConstants.ZERO_STRING.equals(providentFund.getCanOverpay()) && (null == providentFund.getOverpayNumber() || null == providentFund.getHaveThisMonth() || null == providentFund.getProvidentStart());
if (flag) {
return R.failed("员工" + providentFund.getEmpName() + ":" + providentFund.getEmpIdcard() + SocialConstants.SOCIAL_SET_ERROR);
} else {
// 户调基,值看预估库历史数据有没有
if (isOnly) {
historyLibrary = fundHistoryMap.get(sfMapKey);
// 初始化公积金
initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
if (historyLibrary != null) {
// 初始化公积金
initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
}
}
}
} else {
//起缴月份在要生成的月份后不处理 || 截止月份在要生成的月份后不处理
if (Common.isNotNull(providentFund.getProvidentStart())
&& Integer.parseInt(payMonth) < DateUtil.formatDateInt(providentFund.getProvidentStart())
|| (Common.isNotNull(providentFund.getFundReduceDate())
&& Integer.parseInt(payMonth) > DateUtil.formatDateInt(providentFund.getFundReduceDate()))) {
continue;
}
flag = CommonConstants.ZERO_STRING.equals(providentFund.getCanOverpay()) && (null == providentFund.getOverpayNumber() || null == providentFund.getHaveThisMonth() || null == providentFund.getProvidentStart());
if (flag) {
return R.failed("员工" + providentFund.getEmpName() + ":" + providentFund.getEmpIdcard() + SocialConstants.SOCIAL_SET_ERROR);
} else {
historyLibrary = fundHistoryMap.get(sfMapKey);
// 初始化公积金
initFundLibary(diffType, payMonth, saveLibraryMap, providentFund, isReduceSocial, sfMapKey, historyLibrary);
if (null != tForecastLibrary) {
newForecastLibrary = saveLibraryMap.get(sfMapKey);
if (null != newForecastLibrary) {
this.getChangeReduceData(newForecastLibrary, tForecastLibrary);
}
}
}
}
......@@ -2025,7 +2055,7 @@ public class TForecastLibraryServiceImpl extends ServiceImpl<TForecastLibraryMap
boolean isReduceFund = false;
// 核心刷新
R<String> coreR = this.doCore(payMonthList, socialInfoList, fundList, agentConfigHashMap, socialHistoryMap
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund);
, fundHistoryMap, socialPushMap, fundPushMap, saveLibraryMap, isReduceSocial, isReduceFund, false);
if (coreR != null) return coreR;
boolean isSaveAndUpdate = false;
for (TForecastLibrary library : saveLibraryMap.values()) {
......
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