public List<PromotionDto> getListPromotionDto(Map map) {
   PromotionPriceMapper promotionPriceMapper =
       (PromotionPriceMapper) SpringContextUtil.getBean("promotionPriceMapper");
   List<PromotionPrice> list = promotionPriceMapper.getPromotionPriceList(map);
   List<PromotionDto> dtoList = new ArrayList<PromotionDto>();
   if (map == null) {
     map = new HashMap();
   }
   for (PromotionPrice temp : list) {
     PromotionDto dto = BeanMapper.map(temp, PromotionDto.class);
     map.clear();
     map.put("commodityid", dto.getPromotionid());
     dto.setCommodity(mapper.getSimpleCommodityDtoList(map).get(0));
     dtoList.add(dto);
   }
   return dtoList;
 }
 public List<UserDiscountDto> getListUserDiscountDto(Map map) {
   UserDiscountMapper userDiscountMapper =
       (UserDiscountMapper) SpringContextUtil.getBean("userDiscountMapper");
   CommodityTypeMapper commodityTypeMapper =
       (CommodityTypeMapper) SpringContextUtil.getBean("commodityTypeMapper");
   List<UserDiscount> list = userDiscountMapper.getUserDiscountList(map);
   List<UserDiscountDto> dtoList = new ArrayList<UserDiscountDto>();
   if (map == null) {
     map = new HashMap();
   }
   for (UserDiscount temp : list) {
     UserDiscountDto dto = BeanMapper.map(temp, UserDiscountDto.class);
     map.clear();
     map.put("commodityid", temp.getCommodityid());
     List<SimpleCommodityDto> SimpleCommoditydtolist = mapper.getSimpleCommodityDtoList(map);
     if (!SimpleCommoditydtolist.isEmpty()) {
       dto.setCommodity(SimpleCommoditydtolist.get(0));
       dto.setType(commodityTypeMapper.getCommodityTypeById(temp.getTypeid()));
       dtoList.add(dto);
     }
   }
   return dtoList;
 }
 public List<SimpleCommodityDto> getListSimpleCommodityDto(Map map) {
   return mapper.getSimpleCommodityDtoList(map);
 }