|
|
|
@ -16,6 +16,7 @@ import com.hfkj.model.ResponseData; |
|
|
|
|
import com.hfkj.model.goods.JdGoodsModel; |
|
|
|
|
import com.hfkj.qianzhu.StarbucksService; |
|
|
|
|
import com.hfkj.service.card.BsUserCardService; |
|
|
|
|
import com.hfkj.service.cms.CmsContentService; |
|
|
|
|
import com.hfkj.service.coupon.channel.YouTuCouponService; |
|
|
|
|
import com.hfkj.service.goods.*; |
|
|
|
|
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl; |
|
|
|
@ -25,6 +26,7 @@ import com.hfkj.service.order.BsOrderRefundService; |
|
|
|
|
import com.hfkj.service.order.BsOrderService; |
|
|
|
|
import com.hfkj.service.order.OrderPayService; |
|
|
|
|
import com.hfkj.service.pay.huift.TradeService; |
|
|
|
|
import com.hfkj.sysenum.order.OrderLogisticsStatusEnum; |
|
|
|
|
import com.jd.open.api.sdk.domain.vopsp.CategoryInfoGoodsProvider.response.getCategoryInfoList.GetCategoryInfoGoodsResp; |
|
|
|
|
import com.jd.open.api.sdk.domain.vopsp.SkuInfoGoodsProvider.response.getSkuDetailInfo.GetSkuPoolInfoGoodsResp; |
|
|
|
|
import com.jd.open.api.sdk.domain.vopxx.MsgRecordProvider.response.queryTransByVopNormal.VopBizTransMessage; |
|
|
|
@ -45,6 +47,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Controller |
|
|
|
@ -65,6 +68,8 @@ public class TestController { |
|
|
|
|
@Resource |
|
|
|
|
private GoodsMsgService goodsMsgService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private CmsContentService cmsContentService; |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
@ -83,6 +88,48 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getLogisticsMsg",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "更新物流") |
|
|
|
|
public ResponseData getLogisticsMsg() { |
|
|
|
|
try { |
|
|
|
|
Map<String , Object> objectMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
objectMap.put("status" , 2); |
|
|
|
|
objectMap.put("createTime" , "createTime"); |
|
|
|
|
|
|
|
|
|
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList(objectMap); |
|
|
|
|
|
|
|
|
|
orderGoodsList = orderGoodsList.stream().filter(order -> order.getLogisticsNo() != null).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
for (BsOrderGoods goods : orderGoodsList) { |
|
|
|
|
|
|
|
|
|
if (goods.getLogisticsNo() != null) { |
|
|
|
|
GoodsLogistics logistics = (GoodsLogistics) orderGoodsService.getLogisticsMsgSchedule(goods.getLogisticsNo() , goods.getUserPhone()); |
|
|
|
|
if (logistics.getLogisticsStatus() != null) { |
|
|
|
|
goods.setLogisticsStatus(logistics.getLogisticsStatus()); |
|
|
|
|
goods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc()); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
goods.setLogisticsStatus(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getCode()); |
|
|
|
|
goods.setLogisticsStatusDesc(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
goods.setUpdateTime(new Date()); |
|
|
|
|
|
|
|
|
|
orderGoodsService.update(goods); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success("成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/refundMovieOrder",method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "refundMovieOrder") |
|
|
|
@ -224,23 +271,89 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/automaticData",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "自动数据") |
|
|
|
|
public ResponseData automaticData() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("automatic" , 1); |
|
|
|
|
map.put("status" , 1); |
|
|
|
|
List<CmsContent> list = cmsContentService.getList(map); |
|
|
|
|
goodsMsgService.updateAutomatic(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (CmsContent cmsContent : list) { |
|
|
|
|
List<JdGoodsModel> goodsModels = new ArrayList<>(); |
|
|
|
|
if (cmsContent.getAutomatic() == 2) { |
|
|
|
|
Map<String , Object> mapGoods = new HashMap<>(); |
|
|
|
|
mapGoods.put("automatic", 1); |
|
|
|
|
mapGoods.put("status", 1); |
|
|
|
|
mapGoods.put("rand", 1); |
|
|
|
|
map.put("type", 1); |
|
|
|
|
mapGoods.put("salePriceS", 10); |
|
|
|
|
mapGoods.put("salePriceE", 50); |
|
|
|
|
mapGoods.put("limit", 25); |
|
|
|
|
// 查询10-50价格商品
|
|
|
|
|
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods)); |
|
|
|
|
mapGoods.put("salePriceS", 50.01); |
|
|
|
|
mapGoods.put("salePriceE", 100); |
|
|
|
|
mapGoods.put("limit", 10); |
|
|
|
|
// 查询50.01-100价格商品
|
|
|
|
|
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods)); |
|
|
|
|
mapGoods.put("salePriceS", 100.01); |
|
|
|
|
mapGoods.put("salePriceE", 300); |
|
|
|
|
mapGoods.put("limit", 5); |
|
|
|
|
// 查询100.01 -300价格商品
|
|
|
|
|
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods)); |
|
|
|
|
mapGoods.put("salePriceS", 300.01); |
|
|
|
|
mapGoods.put("salePriceE", 500); |
|
|
|
|
mapGoods.put("limit", 5); |
|
|
|
|
// 查询300.001-500以上价格商品
|
|
|
|
|
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods)); |
|
|
|
|
mapGoods.put("salePriceS", 500); |
|
|
|
|
mapGoods.put("salePriceE", 100000); |
|
|
|
|
mapGoods.put("limit", 5); |
|
|
|
|
// 查询500以上价格商品
|
|
|
|
|
goodsModels.addAll(goodsMsgService.getListCrest(mapGoods)); |
|
|
|
|
|
|
|
|
|
for (JdGoodsModel jdGoodsModel : goodsModels) { |
|
|
|
|
GoodsMsg goodsMsg = goodsMsgService.queryDetail(Long.valueOf(jdGoodsModel.getId())); |
|
|
|
|
goodsMsg.setAutomaticCode(cmsContent.getId()); |
|
|
|
|
goodsMsg.setUpdateTime(new Date()); |
|
|
|
|
goodsMsgService.update(goodsMsg); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getGoodsJd",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "更新商品") |
|
|
|
|
public ResponseData getGoodsJd() { |
|
|
|
|
try { |
|
|
|
|
jdService.getGoodsJd(); |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
// @RequestMapping(value="/getGoodsJd",method = RequestMethod.GET)
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// @ApiOperation(value = "更新商品")
|
|
|
|
|
// public ResponseData getGoodsJd() {
|
|
|
|
|
// try {
|
|
|
|
|
// jdService.getGoodsJd();
|
|
|
|
|
// return ResponseMsgUtil.success("");
|
|
|
|
|
//
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// log.error("error!",e);
|
|
|
|
|
// return ResponseMsgUtil.exception(e);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/confirmOrder",method = RequestMethod.GET) |
|
|
|
|