@Test public void testForPut() throws Exception { List<Map<String, Object>> list = service.selectOnLottery(1); System.out.println(list.size()); for (Map<String, Object> map : list){ System.out.println(map.get("roundTime")); } Assert.assertNotNull(list); }
public List<Map<String, Object>> forPut(List<Commoditys> list) { List<Map<String, Object>> listMap = new ArrayList<>(); for (Commoditys com : list) { Map<String, Object> map = new HashMap<>(); map.put("id", com.getId()); map.put("minNum", com.getMinimum()); map.put("typeId", com.getCommodityTypeId()); map.put("commodityName", com.getName()); map.put("totalNumber", com.getBuyTotalNumber()); map.put("currentNumber", com.getBuyTotalNumber() - com.getBuyCurrentNumber()); map.put("headerImg", com.getCoverImgUrl()); map.put("state", com.getStateId()); listMap.add(map); } return listMap; }
CommodityServiceImpl implements ICommodityService { public List<Map<String, Object>> forPut(List<Commoditys> list) { List<Map<String, Object>> listMap = new ArrayList<>(); for (Commoditys com : list) { Map<String, Object> map = new HashMap<>(); map.put("id", com.getId()); map.put("minNum", com.getMinimum()); map.put("typeId", com.getCommodityTypeId()); map.put("commodityName", com.getName()); map.put("totalNumber", com.getBuyTotalNumber()); map.put("currentNumber", com.getBuyTotalNumber() - com.getBuyCurrentNumber()); map.put("headerImg", com.getCoverImgUrl()); map.put("state", com.getStateId()); listMap.add(map); } return listMap; } }
CommodityServiceImpl implements ICommodityService { public List<Map<String, Object>> forPut(List<Commoditys> list) { List<Map<String, Object>> listMap = new ArrayList<>(); for (Commoditys com : list) { Map<String, Object> map = new HashMap<>(); map.put("id", com.getId()); map.put("minNum", com.getMinimum()); map.put("typeId", com.getCommodityTypeId()); map.put("commodityName", com.getName()); map.put("totalNumber", com.getBuyTotalNumber()); map.put("currentNumber", com.getBuyTotalNumber() - com.getBuyCurrentNumber()); map.put("headerImg", com.getCoverImgUrl()); map.put("state", com.getStateId()); listMap.add(map); } return listMap; }  }
CommodityServiceImpl implements ICommodityService { public List<Map<String, Object>> forPut(List<Commoditys> list) { List<Map<String, Object>> listMap = new ArrayList<>(); for (Commoditys com : list) { Map<String, Object> map = new HashMap<>(); map.put("id", com.getId()); map.put("minNum", com.getMinimum()); map.put("typeId", com.getCommodityTypeId()); map.put("commodityName", com.getName()); map.put("totalNumber", com.getBuyTotalNumber()); map.put("currentNumber", com.getBuyTotalNumber() - com.getBuyCurrentNumber()); map.put("headerImg", com.getCoverImgUrl()); map.put("state", com.getStateId()); listMap.add(map); } return listMap; }  @Override boolean addCommodity(Commoditys commod); @Override boolean delete(Long id); @Override Commoditys selectByid(Long id); @Override List<Commoditys> selectTypeAll(String commodType); @Override int selectCount(Integer commodityTypeId); @Override List<Commoditys> selectAll(); @Override List<Map<String, Object>> selectByStyle(Integer type, Long lastCommId); @Override List<Map<String, Object>> selectOnLottery(Integer page); @Override List<Map<String, Object>> selectOneOnLottery(Long commId); @Override Map<String, Object> selectCommodity(User user, Long commodId); List<Map<String, Object>> listMap3(); List<String> listUrl(Long commodId); Map<String, Object> mapBefore(Commoditys comh); List<Map<String, Object>> listPartake(Long commodId); Map<String, Object> map1(Long userAccountId); Map<String, Object> map2(Long commodId, Long userAccountId); @Override List<Map<String, Object>> selectPaging(Integer categoryId, String commName, Long lastCommId); List<Map<String, Object>> type1(Integer categoryId, String commName, Long lastCommId); List<Map<String, Object>> byType(Integer categoryId, Long lastCommId); List<Map<String, Object>> type4(String commName, Long lastCommId); List<Map<String, Object>> forPut(List<Commoditys> list); @Override List<Map<String, Object>> selectHeight(Long lastCommId); @Override Long generateNewRoundTime(); @Override List<Map<String, Object>> selectNewestAnnounceComm(Long lastCommId); @Override List<Map> selectThePastAnnouncedCommList(Long commId); @Override String getContent(Long commodityId); @Override long getMaxRoundTime(); @Override List<CommodityTemplate> getNotKeepRoundTemplate(long roundNum); @Override Commodity getNextCommodity(Long id); @Override Commodity groundNext(Long id); @Override Commoditys getDetails(Long id); @Override Commoditys selectOnSellCommodities(Long id); @Override List<CommodityAmount> selectAmounts(Long orderId); }
CommodityServiceImpl implements ICommodityService { public List<Map<String, Object>> forPut(List<Commoditys> list) { List<Map<String, Object>> listMap = new ArrayList<>(); for (Commoditys com : list) { Map<String, Object> map = new HashMap<>(); map.put("id", com.getId()); map.put("minNum", com.getMinimum()); map.put("typeId", com.getCommodityTypeId()); map.put("commodityName", com.getName()); map.put("totalNumber", com.getBuyTotalNumber()); map.put("currentNumber", com.getBuyTotalNumber() - com.getBuyCurrentNumber()); map.put("headerImg", com.getCoverImgUrl()); map.put("state", com.getStateId()); listMap.add(map); } return listMap; }  @Override boolean addCommodity(Commoditys commod); @Override boolean delete(Long id); @Override Commoditys selectByid(Long id); @Override List<Commoditys> selectTypeAll(String commodType); @Override int selectCount(Integer commodityTypeId); @Override List<Commoditys> selectAll(); @Override List<Map<String, Object>> selectByStyle(Integer type, Long lastCommId); @Override List<Map<String, Object>> selectOnLottery(Integer page); @Override List<Map<String, Object>> selectOneOnLottery(Long commId); @Override Map<String, Object> selectCommodity(User user, Long commodId); List<Map<String, Object>> listMap3(); List<String> listUrl(Long commodId); Map<String, Object> mapBefore(Commoditys comh); List<Map<String, Object>> listPartake(Long commodId); Map<String, Object> map1(Long userAccountId); Map<String, Object> map2(Long commodId, Long userAccountId); @Override List<Map<String, Object>> selectPaging(Integer categoryId, String commName, Long lastCommId); List<Map<String, Object>> type1(Integer categoryId, String commName, Long lastCommId); List<Map<String, Object>> byType(Integer categoryId, Long lastCommId); List<Map<String, Object>> type4(String commName, Long lastCommId); List<Map<String, Object>> forPut(List<Commoditys> list); @Override List<Map<String, Object>> selectHeight(Long lastCommId); @Override Long generateNewRoundTime(); @Override List<Map<String, Object>> selectNewestAnnounceComm(Long lastCommId); @Override List<Map> selectThePastAnnouncedCommList(Long commId); @Override String getContent(Long commodityId); @Override long getMaxRoundTime(); @Override List<CommodityTemplate> getNotKeepRoundTemplate(long roundNum); @Override Commodity getNextCommodity(Long id); @Override Commodity groundNext(Long id); @Override Commoditys getDetails(Long id); @Override Commoditys selectOnSellCommodities(Long id); @Override List<CommodityAmount> selectAmounts(Long orderId);  }