@Test public void testSelectUserRechargeCardExchangeProcess() throws Exception { Map<String, Object> map = service.selectUserRechargeCardExchangeProcess(10000l, 45l); System.out.println(map.get("commodityName")); }
@Override public Map<String, Object> selectUserRechargeCardExchangeProcess(Long accountId, Long commodityId) { Map<String, Object> map = new HashMap<>(); Commodity history = commMapper.selectByPrimaryKey(commodityId); ExchangeWay way = ewMapper.selectById(history.getExchangeWay()); CommodityTemplate template = templateMapper.selectById(history.getTempId()); Share share = shareMapper.selectByCommId(commodityId); map.put("commodityName", template.getName()); map.put("coverImgUrl", template.getCoverImgUrl()); map.put("exchangeState", history.getExchangeState()); map.put("userBuyNumber", history.getBuyNumber()); map.put("genre", template.getGenre()); map.put("commodityId", commodityId); map.put("prizeState", "正在兑奖中"); map.put("size", 0); map.put("worth", 0); map.put("cardNumberList", new ArrayList<>()); map.put("expressNumber", null); map.put("expressName", null); map.put("expressState", 0); map.put("ContactName", null); map.put("ContactPhone", null); map.put("ContactAddress", null); map.put("state", 2); map.put("exchangeWay", history.getExchangeWay()); if (share != null) { map.put("shareState", 1); } else { map.put("shareState", 0); } if (way != null) { map.put("exchangeName", way.getName()); } else { map.put("exchangeName", "未选择兑换方式"); } int f = history.getExchangeState(); if (f == 1) { int g = history.getExchangeWay(); if (g == 1) { map.putAll(demo2(commodityId)); } else if (g == 2) { map.putAll(demo3(accountId, commodityId)); } else if (g == 5) { map.put("ContactName", template.getContactName()); map.put("ContactPhone", template.getContactPhone()); map.put("ContactAddress", template.getContactAddress()); map.put("state", 3); } } System.out.println(map); return map; }
ExchangeMethodServiceImpl implements IExchangeMethodService { @Override public Map<String, Object> selectUserRechargeCardExchangeProcess(Long accountId, Long commodityId) { Map<String, Object> map = new HashMap<>(); Commodity history = commMapper.selectByPrimaryKey(commodityId); ExchangeWay way = ewMapper.selectById(history.getExchangeWay()); CommodityTemplate template = templateMapper.selectById(history.getTempId()); Share share = shareMapper.selectByCommId(commodityId); map.put("commodityName", template.getName()); map.put("coverImgUrl", template.getCoverImgUrl()); map.put("exchangeState", history.getExchangeState()); map.put("userBuyNumber", history.getBuyNumber()); map.put("genre", template.getGenre()); map.put("commodityId", commodityId); map.put("prizeState", "正在兑奖中"); map.put("size", 0); map.put("worth", 0); map.put("cardNumberList", new ArrayList<>()); map.put("expressNumber", null); map.put("expressName", null); map.put("expressState", 0); map.put("ContactName", null); map.put("ContactPhone", null); map.put("ContactAddress", null); map.put("state", 2); map.put("exchangeWay", history.getExchangeWay()); if (share != null) { map.put("shareState", 1); } else { map.put("shareState", 0); } if (way != null) { map.put("exchangeName", way.getName()); } else { map.put("exchangeName", "未选择兑换方式"); } int f = history.getExchangeState(); if (f == 1) { int g = history.getExchangeWay(); if (g == 1) { map.putAll(demo2(commodityId)); } else if (g == 2) { map.putAll(demo3(accountId, commodityId)); } else if (g == 5) { map.put("ContactName", template.getContactName()); map.put("ContactPhone", template.getContactPhone()); map.put("ContactAddress", template.getContactAddress()); map.put("state", 3); } } System.out.println(map); return map; } }
ExchangeMethodServiceImpl implements IExchangeMethodService { @Override public Map<String, Object> selectUserRechargeCardExchangeProcess(Long accountId, Long commodityId) { Map<String, Object> map = new HashMap<>(); Commodity history = commMapper.selectByPrimaryKey(commodityId); ExchangeWay way = ewMapper.selectById(history.getExchangeWay()); CommodityTemplate template = templateMapper.selectById(history.getTempId()); Share share = shareMapper.selectByCommId(commodityId); map.put("commodityName", template.getName()); map.put("coverImgUrl", template.getCoverImgUrl()); map.put("exchangeState", history.getExchangeState()); map.put("userBuyNumber", history.getBuyNumber()); map.put("genre", template.getGenre()); map.put("commodityId", commodityId); map.put("prizeState", "正在兑奖中"); map.put("size", 0); map.put("worth", 0); map.put("cardNumberList", new ArrayList<>()); map.put("expressNumber", null); map.put("expressName", null); map.put("expressState", 0); map.put("ContactName", null); map.put("ContactPhone", null); map.put("ContactAddress", null); map.put("state", 2); map.put("exchangeWay", history.getExchangeWay()); if (share != null) { map.put("shareState", 1); } else { map.put("shareState", 0); } if (way != null) { map.put("exchangeName", way.getName()); } else { map.put("exchangeName", "未选择兑换方式"); } int f = history.getExchangeState(); if (f == 1) { int g = history.getExchangeWay(); if (g == 1) { map.putAll(demo2(commodityId)); } else if (g == 2) { map.putAll(demo3(accountId, commodityId)); } else if (g == 5) { map.put("ContactName", template.getContactName()); map.put("ContactPhone", template.getContactPhone()); map.put("ContactAddress", template.getContactAddress()); map.put("state", 3); } } System.out.println(map); return map; }  }
ExchangeMethodServiceImpl implements IExchangeMethodService { @Override public Map<String, Object> selectUserRechargeCardExchangeProcess(Long accountId, Long commodityId) { Map<String, Object> map = new HashMap<>(); Commodity history = commMapper.selectByPrimaryKey(commodityId); ExchangeWay way = ewMapper.selectById(history.getExchangeWay()); CommodityTemplate template = templateMapper.selectById(history.getTempId()); Share share = shareMapper.selectByCommId(commodityId); map.put("commodityName", template.getName()); map.put("coverImgUrl", template.getCoverImgUrl()); map.put("exchangeState", history.getExchangeState()); map.put("userBuyNumber", history.getBuyNumber()); map.put("genre", template.getGenre()); map.put("commodityId", commodityId); map.put("prizeState", "正在兑奖中"); map.put("size", 0); map.put("worth", 0); map.put("cardNumberList", new ArrayList<>()); map.put("expressNumber", null); map.put("expressName", null); map.put("expressState", 0); map.put("ContactName", null); map.put("ContactPhone", null); map.put("ContactAddress", null); map.put("state", 2); map.put("exchangeWay", history.getExchangeWay()); if (share != null) { map.put("shareState", 1); } else { map.put("shareState", 0); } if (way != null) { map.put("exchangeName", way.getName()); } else { map.put("exchangeName", "未选择兑换方式"); } int f = history.getExchangeState(); if (f == 1) { int g = history.getExchangeWay(); if (g == 1) { map.putAll(demo2(commodityId)); } else if (g == 2) { map.putAll(demo3(accountId, commodityId)); } else if (g == 5) { map.put("ContactName", template.getContactName()); map.put("ContactPhone", template.getContactPhone()); map.put("ContactAddress", template.getContactAddress()); map.put("state", 3); } } System.out.println(map); return map; }  @Override boolean exchangeToCash(String exchangeTerraceName, String terraceAccount, Long commodityId, Long accountId); @Override List<Map<String, Object>> selectUserRechargeCardPrize(Long accountId, Long commodityId); @Override boolean orTrue(Long accountId, Long commodityId); @Override Map<String, Object> selectUserRechargeCardExchangeProcess(Long accountId, Long commodityId); Map<String, Object> demo2(Long commodityId); Map<String, Object> demo3(Long accountId, Long commodityId); @Override Map<String, Object> temp1(Long accountId, Long commodityId); @Override Map<String, Object> temp2(Long accountId, Long commodityId, Long addressId); @Override Map<String, Object> temp3(Long accountId, Long commodityId); @Override boolean temp4(Long accountId, Long commodityId); @Override Map<String, Object> temp5(Long accountId, Long commodityId); @Override String cardPassword(String card); }
ExchangeMethodServiceImpl implements IExchangeMethodService { @Override public Map<String, Object> selectUserRechargeCardExchangeProcess(Long accountId, Long commodityId) { Map<String, Object> map = new HashMap<>(); Commodity history = commMapper.selectByPrimaryKey(commodityId); ExchangeWay way = ewMapper.selectById(history.getExchangeWay()); CommodityTemplate template = templateMapper.selectById(history.getTempId()); Share share = shareMapper.selectByCommId(commodityId); map.put("commodityName", template.getName()); map.put("coverImgUrl", template.getCoverImgUrl()); map.put("exchangeState", history.getExchangeState()); map.put("userBuyNumber", history.getBuyNumber()); map.put("genre", template.getGenre()); map.put("commodityId", commodityId); map.put("prizeState", "正在兑奖中"); map.put("size", 0); map.put("worth", 0); map.put("cardNumberList", new ArrayList<>()); map.put("expressNumber", null); map.put("expressName", null); map.put("expressState", 0); map.put("ContactName", null); map.put("ContactPhone", null); map.put("ContactAddress", null); map.put("state", 2); map.put("exchangeWay", history.getExchangeWay()); if (share != null) { map.put("shareState", 1); } else { map.put("shareState", 0); } if (way != null) { map.put("exchangeName", way.getName()); } else { map.put("exchangeName", "未选择兑换方式"); } int f = history.getExchangeState(); if (f == 1) { int g = history.getExchangeWay(); if (g == 1) { map.putAll(demo2(commodityId)); } else if (g == 2) { map.putAll(demo3(accountId, commodityId)); } else if (g == 5) { map.put("ContactName", template.getContactName()); map.put("ContactPhone", template.getContactPhone()); map.put("ContactAddress", template.getContactAddress()); map.put("state", 3); } } System.out.println(map); return map; }  @Override boolean exchangeToCash(String exchangeTerraceName, String terraceAccount, Long commodityId, Long accountId); @Override List<Map<String, Object>> selectUserRechargeCardPrize(Long accountId, Long commodityId); @Override boolean orTrue(Long accountId, Long commodityId); @Override Map<String, Object> selectUserRechargeCardExchangeProcess(Long accountId, Long commodityId); Map<String, Object> demo2(Long commodityId); Map<String, Object> demo3(Long accountId, Long commodityId); @Override Map<String, Object> temp1(Long accountId, Long commodityId); @Override Map<String, Object> temp2(Long accountId, Long commodityId, Long addressId); @Override Map<String, Object> temp3(Long accountId, Long commodityId); @Override boolean temp4(Long accountId, Long commodityId); @Override Map<String, Object> temp5(Long accountId, Long commodityId); @Override String cardPassword(String card);  }