|
@@ -20,7 +20,10 @@ import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
|
|
import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
import com.zhongzheng.modules.user.bo.*;
|
|
|
|
+import com.zhongzheng.modules.user.domain.UserExamGoods;
|
|
|
|
+import com.zhongzheng.modules.user.service.IUserExamGoodsService;
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
import com.zhongzheng.modules.user.service.IUserService;
|
|
|
|
+import com.zhongzheng.modules.user.vo.UserExamGoodsVo;
|
|
import com.zhongzheng.modules.user.vo.UserSubscribeImport;
|
|
import com.zhongzheng.modules.user.vo.UserSubscribeImport;
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
import com.zhongzheng.modules.user.vo.UserVo;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -62,6 +65,9 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
@Autowired
|
|
@Autowired
|
|
private IInformUserService iInformUserService;
|
|
private IInformUserService iInformUserService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserExamGoodsService userExamGoodsService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IUserService iUserService;
|
|
private IUserService iUserService;
|
|
|
|
|
|
@@ -183,6 +189,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public Boolean updateByEditBo(UserSubscribeEditBo bo) {
|
|
public Boolean updateByEditBo(UserSubscribeEditBo bo) {
|
|
for (Long subscribe : bo.getSubscribeId()) {
|
|
for (Long subscribe : bo.getSubscribeId()) {
|
|
|
|
+ UserSubscribeVo userSubscribeVo = this.queryById(subscribe);
|
|
UserSubscribe update = new UserSubscribe();
|
|
UserSubscribe update = new UserSubscribe();
|
|
update.setSubscribeId(subscribe);
|
|
update.setSubscribeId(subscribe);
|
|
update.setSubscribeStatus(bo.getSubscribeStatus());
|
|
update.setSubscribeStatus(bo.getSubscribeStatus());
|
|
@@ -195,9 +202,33 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
update.setBeforeStatus(bo.getBeforeStatus());
|
|
update.setBeforeStatus(bo.getBeforeStatus());
|
|
if (bo.getBeforeStatus() != null && bo.getBeforeStatus().equals(1)){
|
|
if (bo.getBeforeStatus() != null && bo.getBeforeStatus().equals(1)){
|
|
update.setBeforeExpend(1);
|
|
update.setBeforeExpend(1);
|
|
|
|
+ UserExamGoodsQueryBo userExamGoodsQueryBo = new UserExamGoodsQueryBo();
|
|
|
|
+ userExamGoodsQueryBo.setGoodsId(userSubscribeVo.getGoodsId());
|
|
|
|
+ userExamGoodsQueryBo.setUserId(userSubscribeVo.getUserId());
|
|
|
|
+ List<UserExamGoodsVo> userExamGoodsVos = userExamGoodsService.queryList(userExamGoodsQueryBo);
|
|
|
|
+ if (!org.springframework.util.CollectionUtils.isEmpty(userExamGoodsVos)){
|
|
|
|
+ UserExamGoodsVo userExamGoodsVo = userExamGoodsVos.get(0);
|
|
|
|
+ UserExamGoods userExamGoods = new UserExamGoods();
|
|
|
|
+ userExamGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ userExamGoods.setUserExamGoodsId(userExamGoodsVo.getUserExamGoodsId());
|
|
|
|
+ userExamGoods.setExpendBefore(userExamGoodsVo.getExpendBefore()+1);
|
|
|
|
+ userExamGoodsService.updateById(userExamGoods);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else if (bo.getBeforeStatus() != null && bo.getBeforeStatus().equals(0)){
|
|
else if (bo.getBeforeStatus() != null && bo.getBeforeStatus().equals(0)){
|
|
update.setBeforeExpend(0);
|
|
update.setBeforeExpend(0);
|
|
|
|
+ UserExamGoodsQueryBo userExamGoodsQueryBo = new UserExamGoodsQueryBo();
|
|
|
|
+ userExamGoodsQueryBo.setGoodsId(userSubscribeVo.getGoodsId());
|
|
|
|
+ userExamGoodsQueryBo.setUserId(userSubscribeVo.getUserId());
|
|
|
|
+ List<UserExamGoodsVo> userExamGoodsVos = userExamGoodsService.queryList(userExamGoodsQueryBo);
|
|
|
|
+ if (!org.springframework.util.CollectionUtils.isEmpty(userExamGoodsVos)){
|
|
|
|
+ UserExamGoodsVo userExamGoodsVo = userExamGoodsVos.get(0);
|
|
|
|
+ UserExamGoods userExamGoods = new UserExamGoods();
|
|
|
|
+ userExamGoods.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
+ userExamGoods.setUserExamGoodsId(userExamGoodsVo.getUserExamGoodsId());
|
|
|
|
+ userExamGoods.setExpendBefore(userExamGoodsVo.getExpendBefore()-1);
|
|
|
|
+ userExamGoodsService.updateById(userExamGoods);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
boolean b = this.updateById(update);
|
|
boolean b = this.updateById(update);
|