@Test public void testAddUserLuckNotice() throws Exception { }
@Override public Map<String,Object> addUserLuckNotice(Long commodityId) { Commodity commodity = comMapper.selectByKey(commodityId); LotteryInfo lotteryInfo = lotteryInfoMapper.selectByComId(commodityId); User user = userMapper.selectById(lotteryInfo.getUserAccountId()); Map<String,Object> map = new HashMap<>(); map.put("userName",user.getNickname()); map.put("buyNum",commodity.getBuyNumber()); map.put("endTime",commodity.getEndTime()); if(commodity.getStateId()!=1){ Commodity com = new Commodity(); com.setId(commodityId); com.setStateId(1); comMapper.updateByPrimaryKeySelective(com); return map; } else { return map; } }
LuckNoticeServiceImpl implements ILuckNoticeService { @Override public Map<String,Object> addUserLuckNotice(Long commodityId) { Commodity commodity = comMapper.selectByKey(commodityId); LotteryInfo lotteryInfo = lotteryInfoMapper.selectByComId(commodityId); User user = userMapper.selectById(lotteryInfo.getUserAccountId()); Map<String,Object> map = new HashMap<>(); map.put("userName",user.getNickname()); map.put("buyNum",commodity.getBuyNumber()); map.put("endTime",commodity.getEndTime()); if(commodity.getStateId()!=1){ Commodity com = new Commodity(); com.setId(commodityId); com.setStateId(1); comMapper.updateByPrimaryKeySelective(com); return map; } else { return map; } } }
LuckNoticeServiceImpl implements ILuckNoticeService { @Override public Map<String,Object> addUserLuckNotice(Long commodityId) { Commodity commodity = comMapper.selectByKey(commodityId); LotteryInfo lotteryInfo = lotteryInfoMapper.selectByComId(commodityId); User user = userMapper.selectById(lotteryInfo.getUserAccountId()); Map<String,Object> map = new HashMap<>(); map.put("userName",user.getNickname()); map.put("buyNum",commodity.getBuyNumber()); map.put("endTime",commodity.getEndTime()); if(commodity.getStateId()!=1){ Commodity com = new Commodity(); com.setId(commodityId); com.setStateId(1); comMapper.updateByPrimaryKeySelective(com); return map; } else { return map; } }  }
LuckNoticeServiceImpl implements ILuckNoticeService { @Override public Map<String,Object> addUserLuckNotice(Long commodityId) { Commodity commodity = comMapper.selectByKey(commodityId); LotteryInfo lotteryInfo = lotteryInfoMapper.selectByComId(commodityId); User user = userMapper.selectById(lotteryInfo.getUserAccountId()); Map<String,Object> map = new HashMap<>(); map.put("userName",user.getNickname()); map.put("buyNum",commodity.getBuyNumber()); map.put("endTime",commodity.getEndTime()); if(commodity.getStateId()!=1){ Commodity com = new Commodity(); com.setId(commodityId); com.setStateId(1); comMapper.updateByPrimaryKeySelective(com); return map; } else { return map; } }  @Override Map<String,Object> addUserLuckNotice(Long commodityId); @Override boolean deleteUserLuckNotice(LuckNotice notice); @Override Map<String, Object> selectByCommodityId(Long commodityId); @Override boolean updateUserLuckNotice(LuckNotice notice); }
LuckNoticeServiceImpl implements ILuckNoticeService { @Override public Map<String,Object> addUserLuckNotice(Long commodityId) { Commodity commodity = comMapper.selectByKey(commodityId); LotteryInfo lotteryInfo = lotteryInfoMapper.selectByComId(commodityId); User user = userMapper.selectById(lotteryInfo.getUserAccountId()); Map<String,Object> map = new HashMap<>(); map.put("userName",user.getNickname()); map.put("buyNum",commodity.getBuyNumber()); map.put("endTime",commodity.getEndTime()); if(commodity.getStateId()!=1){ Commodity com = new Commodity(); com.setId(commodityId); com.setStateId(1); comMapper.updateByPrimaryKeySelective(com); return map; } else { return map; } }  @Override Map<String,Object> addUserLuckNotice(Long commodityId); @Override boolean deleteUserLuckNotice(LuckNotice notice); @Override Map<String, Object> selectByCommodityId(Long commodityId); @Override boolean updateUserLuckNotice(LuckNotice notice);  }