|
|
|
@ -533,6 +533,7 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public List getTypeGoods(String type, String createtime, String goods_type) { |
|
|
|
// 商品列表
|
|
|
|
List<Goods> glist = new ArrayList<>(); |
|
|
|
String where = "";//查询条件
|
|
|
|
if ("1".equals(type)) { |
|
|
|
@ -725,18 +726,20 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> getShoppingCar(String userIsli) { |
|
|
|
Map<String, Object> retmap = new HashMap<>(); |
|
|
|
public List getShoppingCar(String userIsli) { |
|
|
|
// wait for result
|
|
|
|
List retlist =new ArrayList(); |
|
|
|
|
|
|
|
String shopRedisKey = "car_" + userIsli; |
|
|
|
// get shopping car from redis
|
|
|
|
Object shopCar = RedisUtil.get(shopRedisKey); |
|
|
|
JSONObject shopCarJson = JSONObject.parseObject(shopCar.toString()); |
|
|
|
JSONArray jsonArray = shopCarJson.getJSONArray("data"); |
|
|
|
//JSONObject carjson =JSONObject.parseObject(shopCar.toString());
|
|
|
|
if (shopCar == null) { |
|
|
|
//null
|
|
|
|
return retmap; |
|
|
|
return null; |
|
|
|
} |
|
|
|
//fenpei
|
|
|
|
//分配比例
|
|
|
|
Map acrmap = new HashMap(); |
|
|
|
acrmap.put("is_deleted", 0); |
|
|
|
acrmap.put("status", 1); |
|
|
|
@ -744,15 +747,18 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
AccountRatioSetting accountRatioSetting = acrlist.get(0); |
|
|
|
AccountRatioDetail accountRatioDetail = accountRatioDetailMapper.getAccRatioDetailByIdRole(accountRatioSetting.getId(), 2); |
|
|
|
|
|
|
|
//循环枚举
|
|
|
|
if (jsonArray.size() > 0) { |
|
|
|
//goods information
|
|
|
|
for (int x = 0; x < jsonArray.size(); x++) { |
|
|
|
for (int x =0; x<jsonArray.size(); x++) { |
|
|
|
Map<String, Object> retmap = new HashMap<>(); |
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(x); |
|
|
|
String goodsIsli = jsonObject.getString("goods_isli"); |
|
|
|
Goods goods = goodsMapper.getGoodsFuelByIsLi(goodsIsli); |
|
|
|
//
|
|
|
|
//goods
|
|
|
|
Goods goods = goodsMapper.getGoodsByIsli(goodsIsli); |
|
|
|
//goods detail
|
|
|
|
GoodsDetail goodsDetail = goodsDetailMapper.getGoodsDetailBygid(goods.getGoodsDetailId()); |
|
|
|
retmap.put("detial", goodsDetail); |
|
|
|
retmap.put("detail", goodsDetail); |
|
|
|
// 计算服务费
|
|
|
|
Integer count = jsonObject.getInteger("use_years"); |
|
|
|
if (goodsDetail.getGoodsEntrust() == 1) { |
|
|
|
@ -792,9 +798,11 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
retmap.put("user", umap); |
|
|
|
//
|
|
|
|
retmap.put("goods", goods); |
|
|
|
// add retlist
|
|
|
|
retlist.add(retmap); |
|
|
|
} |
|
|
|
} |
|
|
|
return retmap; |
|
|
|
return retlist; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|