|
|
@@ -288,9 +288,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
if(bo.getGoodsPhotographExamConfig()!=null){
|
|
|
update.setGoodsPhotoExamConfig(JSON.toJSONString(bo.getGoodsPhotographExamConfig()));
|
|
|
}
|
|
|
- //学习服务期设置
|
|
|
- Goods edit= this.setStudyServiceTime(update);
|
|
|
- return this.updateById(edit);
|
|
|
+
|
|
|
+ return this.updateById(update);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -438,34 +437,4 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
return baseMapper.queryUpGoods();
|
|
|
}
|
|
|
|
|
|
- //设置学习服务期
|
|
|
- @Override
|
|
|
- public Goods setStudyServiceTime(Goods g){
|
|
|
- GoodsVo goodsVo = iGoodsService.queryById(g.getGoodsId());
|
|
|
- //商品设置学习服务有效期
|
|
|
- if(Validator.isNotEmpty(goodsVo.getServiceTimeType())){
|
|
|
- if(Validator.isNotEmpty(goodsVo.getServiceTimeNum())){
|
|
|
- if(goodsVo.getServiceTimeType()==1){ //年
|
|
|
- Calendar cal = new GregorianCalendar();
|
|
|
- cal.add(Calendar.YEAR,goodsVo.getServiceTimeNum().intValue());
|
|
|
- g.setStudyStartTime(DateUtils.getNowTime());
|
|
|
- g.setStudyEndTime(cal.getTimeInMillis()/1000);
|
|
|
- }
|
|
|
- else if(goodsVo.getServiceTimeType()==2){ //月
|
|
|
- Calendar cal = new GregorianCalendar();
|
|
|
- cal.add(Calendar.MONTH,goodsVo.getServiceTimeNum().intValue());
|
|
|
- g.setStudyStartTime(DateUtils.getNowTime());
|
|
|
- g.setStudyEndTime(cal.getTimeInMillis()/1000);
|
|
|
- }
|
|
|
- else if(goodsVo.getServiceTimeType()==3){ //天
|
|
|
- Calendar cal = new GregorianCalendar();
|
|
|
- cal.add(Calendar.DATE,goodsVo.getServiceTimeNum().intValue());
|
|
|
- g.setStudyStartTime(DateUtils.getNowTime());
|
|
|
- g.setStudyEndTime(cal.getTimeInMillis()/1000);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return g;
|
|
|
- }
|
|
|
}
|