Commit 0d8cac20 authored by hongguangwu's avatar hongguangwu

MVP1.4-缴费库删除

parent 437a466e
...@@ -343,26 +343,33 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -343,26 +343,33 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
LambdaQueryWrapper<TPaymentInfo> wrapper = buildQueryWrapper(empIdCard, socialHouseId, fundHouseId, LambdaQueryWrapper<TPaymentInfo> wrapper = buildQueryWrapper(empIdCard, socialHouseId, fundHouseId,
socialCreateMonth, socialPayMonth); socialCreateMonth, socialPayMonth);
List<TPaymentInfo> list = baseMapper.selectList(wrapper); List<TPaymentInfo> list;
List<String> idList = new ArrayList<>();
boolean delFlag = false; boolean delFlag = false;
if (Common.isNotNull(list)) { if (CommonConstants.ONE_STRING.equals(user.getId())) {
for (TPaymentInfo paymentInfo : list) { list = baseMapper.selectList(wrapper.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
if ((!user.getId().equals(paymentInfo.getCreateBy()) && .eq(TPaymentInfo::getSalarySocialFlag, CommonConstants.ZERO_STRING)
!CommonConstants.ONE_STRING.equals(user.getId())) || .eq(TPaymentInfo::getSalaryFundFlag, CommonConstants.ZERO_STRING)
CommonConstants.ZERO_STRING.equals(paymentInfo.getPushStatus()) || );
CommonConstants.ONE_STRING.equals(paymentInfo.getSalaryFundFlag()) ||
CommonConstants.ONE_STRING.equals(paymentInfo.getSalarySocialFlag())) {
delFlag = true;
} else {
idList.add(paymentInfo.getId());
}
}
} else { } else {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); list = baseMapper.selectList(wrapper.eq(TPaymentInfo::getPushStatus, CommonConstants.ONE_STRING)
.eq(TPaymentInfo::getSalarySocialFlag, CommonConstants.ZERO_STRING)
.eq(TPaymentInfo::getSalaryFundFlag, CommonConstants.ZERO_STRING)
.eq(TPaymentInfo::getCreateBy, user.getId())
);
long count = baseMapper.selectCount(wrapper.and(obj->obj.eq(TPaymentInfo::getPushStatus,CommonConstants.ZERO_STRING)
.or().eq(TPaymentInfo::getSalarySocialFlag, CommonConstants.ONE_STRING)
.or().eq(TPaymentInfo::getSalaryFundFlag, CommonConstants.ONE_STRING)
.or().ne(TPaymentInfo::getCreateBy, user.getId())
)
);
if (count > 0) {
delFlag = true;
}
} }
if (Common.isNotNull(idList)) { if (Common.isNotNull(list)) {
baseMapper.deleteBatchIds(idList); baseMapper.deleteBatchIds(list);
} else if (!delFlag) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} }
if (delFlag) { if (delFlag) {
return R.ok(null, "存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!"); return R.ok(null, "存在不符合条件的数据(已推送至结算平台或非本人创建),禁止删除!");
......
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