| | |
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.core.task.TaskExecutor;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserGoodsStorageMapper;
|
| | | import com.yeshi.fanli.entity.bus.share.UserShareGoodsRecord.ShareSourceTypeEnum;
|
| | | import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Service
|
| | | public class UserGoodsStorageServiceImpl implements UserGoodsStorageService {
|
| | |
| | | return userGoodsStorageMapper.countQueryByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateShareState(Long shareId) {
|
| | | userGoodsStorageMapper.updateShareState(shareId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void save(Long uid, Set<Long> auctionIds) throws UserGoodsStorageException {
|
| | |
|
| | |
| | | totalMoney = MoneyBigDecimalUtil.add(totalMoney, money);
|
| | | }
|
| | |
|
| | | String revenue = listGoodsBrief.size() + "个商品预估分享奖金:¥"+totalMoney;
|
| | | |
| | | Map<String,Object> map = userShareGoodsRecordService.save(uid, ShareSourceTypeEnum.storage, |
| | | null, listGoodsBrief);
|
| | | ShareGoodsRecordDTO shareRecord = userShareGoodsRecordService.addRecordGoodsStorage(uid, listGoodsBrief, listStorageID);
|
| | | FileUploadResult uploadResult = new FileUploadResult();
|
| | | uploadResult.setUrl(shareRecord.getSharePictureUrl());
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("revenue", revenue);
|
| | | data.put("shareId", map.get("shareId"));
|
| | | data.put("shareImg", map.get("loadResult"));
|
| | | data.put("revenue", listGoodsBrief.size() + "个商品预估分享奖金:¥"+totalMoney);
|
| | | data.put("shareId", shareRecord.getRedisKey());
|
| | | data.put("shareImg", uploadResult);
|
| | | data.put("notifyDesc", configService.get("goods_share_multiple_notify"));
|
| | |
|
| | | return data;
|