|
@@ -88,7 +88,6 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
|
|
|
@Override
|
|
|
public Boolean updateByEditBo(UserPeriodEditBo bo) {
|
|
|
- if (bo.getCompleteAudit() == 1){
|
|
|
for (Long aLong : bo.getId()) {
|
|
|
UserPeriodStatus userPeriodStatus = new UserPeriodStatus();
|
|
|
userPeriodStatus.setPeriodStatus(1);
|
|
@@ -98,23 +97,6 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
lqw.eq( UserPeriodStatus::getPeriodStatus, 1);
|
|
|
userPeriodStatusService.update(userPeriodStatus,lqw);
|
|
|
}
|
|
|
- }
|
|
|
- if (bo.getCompleteAudit() == 2){
|
|
|
- LambdaQueryWrapper<UserPeriod> lqw = Wrappers.lambdaQuery();
|
|
|
- lqw.eq(bo.getUserId() != null, UserPeriod::getUserId, bo.getUserId());
|
|
|
- lqw.eq(bo.getGoodsId() != null, UserPeriod::getGoodsId, bo.getGoodsId());
|
|
|
- List<UserPeriod> list = this.list(lqw);
|
|
|
- for (UserPeriod userPeriod : list) {
|
|
|
- UserPeriodStatus userPeriodStatus = new UserPeriodStatus();
|
|
|
- userPeriodStatus.setPeriodStatus(1);
|
|
|
- userPeriodStatus.setStatus(bo.getStatus());
|
|
|
- LambdaQueryWrapper<UserPeriodStatus> userPeriods = Wrappers.lambdaQuery();
|
|
|
- userPeriods.eq( UserPeriodStatus::getPeriodId, userPeriod.getId());
|
|
|
- userPeriods.eq( UserPeriodStatus::getPeriodStatus, 1);
|
|
|
- userPeriods.eq( UserPeriodStatus::getStatus, 2);
|
|
|
- userPeriodStatusService.update(userPeriodStatus,userPeriods);
|
|
|
- }
|
|
|
- }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -134,4 +116,23 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
|
|
|
}
|
|
|
return this.removeByIds(ids);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean editPeriodAll(UserPeriodEditBo bo) {
|
|
|
+ LambdaQueryWrapper<UserPeriod> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.eq(bo.getUserId() != null, UserPeriod::getUserId, bo.getUserId());
|
|
|
+ lqw.eq(bo.getGoodsId() != null, UserPeriod::getGoodsId, bo.getGoodsId());
|
|
|
+ List<UserPeriod> list = this.list(lqw);
|
|
|
+ for (UserPeriod userPeriod : list) {
|
|
|
+ UserPeriodStatus userPeriodStatus = new UserPeriodStatus();
|
|
|
+ userPeriodStatus.setPeriodStatus(1);
|
|
|
+ userPeriodStatus.setStatus(bo.getStatus());
|
|
|
+ LambdaQueryWrapper<UserPeriodStatus> userPeriods = Wrappers.lambdaQuery();
|
|
|
+ userPeriods.eq( UserPeriodStatus::getPeriodId, userPeriod.getId());
|
|
|
+ userPeriods.eq( UserPeriodStatus::getPeriodStatus, 1);
|
|
|
+ userPeriods.eq( UserPeriodStatus::getStatus, 2);
|
|
|
+ userPeriodStatusService.update(userPeriodStatus,userPeriods);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|