| | |
| | | package com.yeshi.fanli.service.impl.lable;
|
| | |
|
| | | import java.util.Calendar;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.lable.QualityFlashSaleMapper;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFlashSale;
|
| | | import com.yeshi.fanli.exception.goods.quality.QualityFlashSaleException;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
|
| | |
|
| | | @Service
|
| | | public class QualityFlashSaleServiceImpl implements QualityFlashSaleService {
|
| | |
|
| | | @Resource
|
| | | private QualityFlashSaleMapper qualityFlashSaleMapper;
|
| | |
|
| | | @Override
|
| | | public int insertSelective(QualityFlashSale record) throws QualityFlashSaleException{
|
| | | return qualityFlashSaleMapper.insertSelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKey(QualityFlashSale record) throws QualityFlashSaleException {
|
| | | return qualityFlashSaleMapper.updateByPrimaryKey(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public int updateByPrimaryKeySelective(QualityFlashSale record) throws QualityFlashSaleException {
|
| | | return qualityFlashSaleMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | |
| | | @Override
|
| | | public int insertBatch(List<QualityFlashSale> list){
|
| | | return qualityFlashSaleMapper.insertBatch(list);
|
| | | }
|
| | | |
| | | @Override
|
| | | public int updateBatchSelective(List<QualityFlashSale> list){
|
| | | return qualityFlashSaleMapper.updateBatchSelective(list);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void deleteBatchByPrimaryKey(List<Long> list) throws QualityFlashSaleException{
|
| | | qualityFlashSaleMapper.deleteBatchByPrimaryKey(list);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public int getNowType() {
|
| | | int type = 0;
|
| | | Calendar now = Calendar.getInstance();
|
| | | int hour = now.get(Calendar.HOUR_OF_DAY);
|
| | | |
| | | if (hour < 9) {
|
| | | type = 1;
|
| | | } else if (hour >= 9 && hour < 12){
|
| | | type = 2;
|
| | | } else if (hour >= 12 && hour < 14){
|
| | | type = 3;
|
| | | } else if (hour >= 14 && hour < 16){
|
| | | type = 4;
|
| | | } else if (hour >= 16 && hour < 20){
|
| | | type = 5;
|
| | | } else if (hour >= 20 && hour < 22){
|
| | | type = 6;
|
| | | } else if (hour >= 22){
|
| | | type = 7;
|
| | | }
|
| | | |
| | | return type;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<QualityFlashSale> listQueryByQualityID(List<Long> list) {
|
| | | return qualityFlashSaleMapper.listQueryByQualityID(list);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<Long> queryNeedRemove (long start, int count, int hour) throws QualityFlashSaleException {
|
| | | return qualityFlashSaleMapper.queryNeedRemove(start, count, hour);
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
| | |
|
| | | package com.yeshi.fanli.service.impl.lable; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.mybatis.lable.QualityFlashSaleMapper; |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFlashSale; |
| | | import com.yeshi.fanli.exception.goods.quality.QualityFlashSaleException; |
| | | import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService; |
| | | |
| | | @Service |
| | | public class QualityFlashSaleServiceImpl implements QualityFlashSaleService { |
| | | |
| | | @Resource |
| | | private QualityFlashSaleMapper qualityFlashSaleMapper; |
| | | |
| | | @Override |
| | | public int insertSelective(QualityFlashSale record) throws QualityFlashSaleException{ |
| | | return qualityFlashSaleMapper.insertSelective(record); |
| | | } |
| | | |
| | | @Override |
| | | public int updateByPrimaryKey(QualityFlashSale record) throws QualityFlashSaleException { |
| | | return qualityFlashSaleMapper.updateByPrimaryKey(record); |
| | | } |
| | | |
| | | @Override |
| | | public int updateByPrimaryKeySelective(QualityFlashSale record) throws QualityFlashSaleException { |
| | | return qualityFlashSaleMapper.updateByPrimaryKeySelective(record); |
| | | } |
| | | |
| | | @Override |
| | | public int insertBatch(List<QualityFlashSale> list){ |
| | | return qualityFlashSaleMapper.insertBatch(list); |
| | | } |
| | | |
| | | @Override |
| | | public int updateBatchSelective(List<QualityFlashSale> list){ |
| | | return qualityFlashSaleMapper.updateBatchSelective(list); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void deleteBatchByPrimaryKey(List<Long> list) throws QualityFlashSaleException{ |
| | | qualityFlashSaleMapper.deleteBatchByPrimaryKey(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int getNowType() { |
| | | int type = 0; |
| | | Calendar now = Calendar.getInstance(); |
| | | int hour = now.get(Calendar.HOUR_OF_DAY); |
| | | |
| | | if (hour < 9) { |
| | | type = 1; |
| | | } else if (hour >= 9 && hour < 12){ |
| | | type = 2; |
| | | } else if (hour >= 12 && hour < 14){ |
| | | type = 3; |
| | | } else if (hour >= 14 && hour < 16){ |
| | | type = 4; |
| | | } else if (hour >= 16 && hour < 20){ |
| | | type = 5; |
| | | } else if (hour >= 20 && hour < 22){ |
| | | type = 6; |
| | | } else if (hour >= 22){ |
| | | type = 7; |
| | | } |
| | | |
| | | return type; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<QualityFlashSale> listQueryByQualityID(List<Long> list) { |
| | | return qualityFlashSaleMapper.listQueryByQualityID(list); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> queryNeedRemove (long start, int count, int hour) throws QualityFlashSaleException { |
| | | return qualityFlashSaleMapper.queryNeedRemove(start, count, hour); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |