| | |
| | | import com.yeshi.fanli.entity.brand.BrandClass;
|
| | | import com.yeshi.fanli.entity.brand.BrandClassShop;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.exception.brand.BrandClassShopException;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | @Resource
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<BrandClassShop> getExistByShopIds(List<Long> list){
|
| | | return brandClassShopMapper.getExistByShopIds(list);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | return shopIds;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top) throws BrandClassShopException{
|
| | | public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top)
|
| | | throws BrandClassShopException {
|
| | |
|
| | | if (id == null) {
|
| | | throw new BrandClassShopException(1, "数据为空:请选择店铺");
|
| | |
| | | updateshop.setBrandClass(new BrandClass(cid));
|
| | | brandClassShopMapper.updateByPrimaryKeySelective(updateshop);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<BrandClassShop> listQuery(long start, int count, String key, Long cid, Integer state) {
|
| | |
| | | return listQuery;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Long cid, Integer state) {
|
| | | return brandClassShopMapper.countQuery(key, cid, state);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | |
| | | }
|
| | | brandClassShopMapper.deleteBatchByClassId(list);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public void updateOrder(Long id, Integer moveType) throws BrandClassShopException, Exception{
|
| | |
| | | data.put("listShop", JsonUtil.getApiCommonGson().toJson(listShop));
|
| | |
|
| | | long count = 0;
|
| | | List<TaoBaoShopVO> listInfo = taoBaoShopService.listBrandShopinfo((page-1)*Constant.PAGE_SIZE, Constant.PAGE_SIZE, cid);
|
| | | List<TaoBaoShopVO> listInfo = taoBaoShopService.listBrandShopinfo((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, cid);
|
| | | if (listInfo == null) {
|
| | | listInfo = new ArrayList<TaoBaoShopVO>();
|
| | | } else if (listInfo.size() > 0) {
|
| | |
| | | taoBaoShopVO.setShopIcon(shopIconCustom);
|
| | | }
|
| | |
|
| | | |
| | | List<TaoBaoGoodsBriefExtra> listGoods = new ArrayList<TaoBaoGoodsBriefExtra>();
|
| | | List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
|
| | |
| | |
|
| | | return data;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public void addClick(Long shopId) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateShopGoods() {
|
| | | // 查询店铺
|
| | | List<BrandClassShop> shopList = listQuery(0, 1000, "", null, BrandClassShop.STATE_VALID);
|
| | | if (shopList != null)
|
| | | for (BrandClassShop shop : shopList) {
|
| | | SearchFilter sf = new SearchFilter();
|
| | | sf.setKey(shop.getShop().getShopName().replace("官方旗舰店", "").replace("旗舰店", ""));
|
| | | sf.setPage(1);
|
| | | sf.setPageSize(100);
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.searchWuLiao(sf);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null)
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | if (goods.getSellerId().longValue() == shop.getShop().getId()) {
|
| | | if (taoBaoGoodsBriefService.queryByAuctionId(goods.getAuctionId()).size() == 0) {
|
| | | goods.setCreatetime(new Date());
|
| | | goods.setState(0);
|
| | | goods.setUpdatetime(new Date());
|
| | | goodsList.add(goods);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (goodsList.size() > 0)
|
| | | taoBaoGoodsBriefService.insertBatch(goodsList);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|