Browse Source

fix 商品学习服务期

tanzh 3 years ago
parent
commit
9ed58f7e6f

+ 0 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -75,6 +75,4 @@ public interface IGoodsService extends IService<Goods> {
 
 	int queryUpGoods();
 
-	Goods setStudyServiceTime(Goods g);
-
 }

+ 2 - 33
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -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;
-    }
 }