|
|
|
@ -13,13 +13,11 @@ import com.hfkj.jd.JdService; |
|
|
|
|
import com.hfkj.mer.BsMerPayConfigService; |
|
|
|
|
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.coupon.channel.YouTuCouponService; |
|
|
|
|
import com.hfkj.service.goods.BsOrderGoodsService; |
|
|
|
|
import com.hfkj.service.goods.BsOrderStarbucksService; |
|
|
|
|
import com.hfkj.service.goods.GoodsSpecsService; |
|
|
|
|
import com.hfkj.service.goods.GoodsUserAddressService; |
|
|
|
|
import com.hfkj.service.goods.*; |
|
|
|
|
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl; |
|
|
|
|
import com.hfkj.service.hlt.HuiLianTongUnionCardService; |
|
|
|
|
import com.hfkj.service.order.BsOrderChildService; |
|
|
|
@ -30,6 +28,7 @@ import com.hfkj.service.pay.huift.TradeService; |
|
|
|
|
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; |
|
|
|
|
import com.jd.open.api.sdk.response.vopdd.VopOrderQueryDeliveryInfoResponse; |
|
|
|
|
import com.jd.open.api.sdk.response.vopdd.VopOrderQueryOrderDetailResponse; |
|
|
|
|
import com.jd.open.api.sdk.response.vopdz.VopAddressConvertFourAreaByDetailStrResponse; |
|
|
|
|
import com.jd.open.api.sdk.response.vopxx.VopMessageQueryTransByVopNormalResponse; |
|
|
|
@ -56,37 +55,14 @@ public class TestController { |
|
|
|
|
@Resource |
|
|
|
|
private TradeService huiftTradeService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderGoodsService orderGoodsService; |
|
|
|
|
@Resource |
|
|
|
|
private GoodsSpecsService goodsSpecsService; |
|
|
|
|
@Resource |
|
|
|
|
private JdService jdService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderGoodsService getOrderGoodsService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private GoodsUserAddressService goodsUserAddressService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderRefundService orderRefundService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderService orderService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderStarbucksService orderStarbucksService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderChildService orderChildService; |
|
|
|
|
|
|
|
|
|
private JdService jdService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderStarbucksServiceImpl bsOrderStarbucksService; |
|
|
|
|
@Resource |
|
|
|
|
private GoodsUserAddressService deliveryAddressService; |
|
|
|
|
private GoodsMsgService goodsMsgService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET) |
|
|
|
@ -105,29 +81,6 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/haiOilLogin",method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "嗨加油登陆参数") |
|
|
|
|
public ResponseData haiOilLogin(@RequestBody JSONObject body) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
if (body == null|| StringUtils.isBlank(body.getString("phone"))) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("appid" , CommonSysConst.getSysConfig().getHaiOilAppid()); |
|
|
|
|
map.put("phone" , body.getString("phone")); |
|
|
|
|
map.put("sign" , SignatureUtil.createSign(map , CommonSysConst.getSysConfig().getHaiOilAppSecret())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(map); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/refundMovieOrder",method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
@ -157,23 +110,10 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getSkuPoolInfo",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "getSkuPoolInfo") |
|
|
|
|
public ResponseData getSkuPoolInfo() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(JdPostService.getSkuPoolInfo(jdService.getToken())); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryOrderDetailByJd",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "queryOrderDetailByJd") |
|
|
|
|
@ApiOperation(value = "查询京东商品订单详情") |
|
|
|
|
public ResponseData queryOrderDetailByJd(@RequestParam(value = "childOrderNo" , required = true) String childOrderNo, |
|
|
|
|
@RequestParam(value = "thirdOrderNo" , required = true) Long thirdOrderNo) { |
|
|
|
|
try { |
|
|
|
@ -188,191 +128,18 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/sign",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "sign") |
|
|
|
|
public ResponseData sign(@RequestParam(value = "phone" , required = true) String phone, |
|
|
|
|
@RequestParam(value = "appid" , required = true) String appid, |
|
|
|
|
@RequestParam(value = "appSecret" , required = true) String appSecret) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("appid" , appid); |
|
|
|
|
map.put("phone" , phone); |
|
|
|
|
String sign = SignatureUtil.createSign(map , appSecret); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(sign); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询上游订单
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getSkuDetailInfo",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "getSkuDetailInfo") |
|
|
|
|
public ResponseData getSkuDetailInfo() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
GetSkuPoolInfoGoodsResp detail = JdPostService.getSkuDetailInfo(jdService.getToken() , 100017491914L).getOpenRpcResult().getResult(); |
|
|
|
|
return ResponseMsgUtil.success(detail); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getSkuImageList",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "getSkuImageList") |
|
|
|
|
public ResponseData getSkuImageList() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(JdPostService.getSkuImageList(jdService.getToken() , "100017491914")); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getSellPrice",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "批量查询商品售卖价") |
|
|
|
|
public ResponseData getSellPrice() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(JdPostService.getSellPrice(jdService.getToken() , "100017491914")); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getCategoryInfoList",method = RequestMethod.GET) |
|
|
|
|
@RequestMapping(value="/orderGoodsJd",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "获取分类") |
|
|
|
|
public ResponseData getCategoryInfoList() { |
|
|
|
|
@ApiOperation(value = "更新京东物流信息") |
|
|
|
|
public ResponseData orderGoodsJd() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(JdPostService.getCategoryInfoList(jdService.getToken() , "1235014")); |
|
|
|
|
|
|
|
|
|
} 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(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/querySkuFreight",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "querySkuFreight") |
|
|
|
|
public ResponseData querySkuFreight() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq skuInfo = new com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq(); |
|
|
|
|
|
|
|
|
|
skuInfo.setSkuId(627345); |
|
|
|
|
skuInfo.setSkuNum(1); |
|
|
|
|
skuInfoList.add(skuInfo); |
|
|
|
|
return ResponseMsgUtil.success( JdPostService.querySkuFreight(jdService.getToken() , skuInfoList , 24L ,2144L , 21037L , 58300L)); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/skuList",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "skuList") |
|
|
|
|
public ResponseData skuList() { |
|
|
|
|
try { |
|
|
|
|
return ResponseMsgUtil.success(jdService.skuList()); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryTransByVopNormal",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "消息消费") |
|
|
|
|
public ResponseData queryTransByVopNormal() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jdService.deleteMsg(); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("成功!"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/tradeOrderRefund",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "手动退款") |
|
|
|
|
public ResponseData tradeOrderRefund(@RequestParam(value = "orderNo" , required = true) String orderNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
orderRefundService.tradeOrderRefund(orderNo,"手动退款"); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("成功!"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/confirmReceipt",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "confirmReceipt") |
|
|
|
|
public ResponseData confirmReceipt() { |
|
|
|
|
try { |
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
map.put("logisticsStatus" , "AGENT_SIGN"); |
|
|
|
|
map.put("status" , 2); |
|
|
|
|
|
|
|
|
|
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList(map); |
|
|
|
|
List<BsOrderGoods> orderGoodsList = orderGoodsService.getListByJd(); |
|
|
|
|
|
|
|
|
|
for (BsOrderGoods goods : orderGoodsList) { |
|
|
|
|
|
|
|
|
|
// 判断时间是否是十天前
|
|
|
|
|
|
|
|
|
|
if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 10) { |
|
|
|
|
orderGoodsService.confirmReceipt(goods.getId()); |
|
|
|
|
} |
|
|
|
|
System.out.println(goods.toString()); |
|
|
|
|
System.out.println(goods.getGoodsId()); |
|
|
|
|
jdService.updateDeliveryInfo(goods); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
@ -382,37 +149,18 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/convertFourAreaByDetailStr",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "地址详情转换京东地址编码") |
|
|
|
|
public ResponseData convertFourAreaByDetailStr(@RequestParam(value = "address", required = false) String address |
|
|
|
|
) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , address); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(response.getOpenRpcResult().getResult()); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getYouTuCouponList",method = RequestMethod.GET) |
|
|
|
|
@RequestMapping(value="/checkSkuSale",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "获取卡券") |
|
|
|
|
public ResponseData getYouTuCouponList() { |
|
|
|
|
@ApiOperation(value = "京东商品价格更新") |
|
|
|
|
public ResponseData checkSkuSale() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
JSONObject object = new JSONObject(); |
|
|
|
|
object.put("time" , new Date().getTime()/1000); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = YouTuCouponService.getYouTuCouponList(object); |
|
|
|
|
List<GoodsMsg> list = goodsMsgService.getJdList(); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(jsonObject); |
|
|
|
|
for (GoodsMsg goods : list) { |
|
|
|
|
jdService.checkSkuSale(goods); |
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
@ -420,20 +168,16 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getMerchantCouponCode",method = RequestMethod.GET) |
|
|
|
|
@RequestMapping(value="/queryDeliveryInfoByjd",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "获取电子券码") |
|
|
|
|
public ResponseData getMerchantCouponCode() { |
|
|
|
|
@ApiOperation(value = "查询配送信息京东") |
|
|
|
|
public ResponseData queryDeliveryInfoByjd(@RequestParam(value = "childOrderNo" , required = true) String childOrderNo, |
|
|
|
|
@RequestParam(value = "thirdOrderNo" , required = true) Long thirdOrderNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
JSONObject object = new JSONObject(); |
|
|
|
|
object.put("id" , "759"); |
|
|
|
|
object.put("tradeId" , OrderUtil.generateOrderNo()); |
|
|
|
|
object.put("time" , new Date().getTime()/1000); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = YouTuCouponService.getMerchantCouponCode(object); |
|
|
|
|
VopOrderQueryDeliveryInfoResponse orderDetailResponse = JdPostService.queryDeliveryInfo(jdService.getToken(),thirdOrderNo, childOrderNo); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(jsonObject); |
|
|
|
|
return ResponseMsgUtil.success(orderDetailResponse); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
@ -441,21 +185,20 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/merchantCouponToMember",method = RequestMethod.GET) |
|
|
|
|
@RequestMapping(value="/sign",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "获取电子券码") |
|
|
|
|
public ResponseData merchantCouponToMember() { |
|
|
|
|
@ApiOperation(value = "sign") |
|
|
|
|
public ResponseData sign(@RequestParam(value = "phone" , required = true) String phone, |
|
|
|
|
@RequestParam(value = "appid" , required = true) String appid, |
|
|
|
|
@RequestParam(value = "appSecret" , required = true) String appSecret) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
JSONObject object = new JSONObject(); |
|
|
|
|
object.put("id" , "759"); |
|
|
|
|
object.put("telephone" , "18090580471"); |
|
|
|
|
object.put("tradeId" , OrderUtil.generateOrderNo()); |
|
|
|
|
object.put("time" , new Date().getTime()/1000); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = YouTuCouponService.merchantCouponToMember(object); |
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("appid" , appid); |
|
|
|
|
map.put("phone" , phone); |
|
|
|
|
String sign = SignatureUtil.createSign(map , appSecret); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(jsonObject); |
|
|
|
|
return ResponseMsgUtil.success(sign); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
@ -464,84 +207,43 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/checkGoods",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "校验商品是否正确") |
|
|
|
|
public ResponseData checkGoods(@RequestParam(value = "orderNo", required = false) String orderNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
BsOrder order = orderService.getOrder(orderNo); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(jdService.checkGoods(order)); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryOrderDetail",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询订单") |
|
|
|
|
public ResponseData queryOrderDetail(@RequestParam(value = "orderNo", required = false) String orderNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
BsOrderGoods order = getOrderGoodsService.findGoodsOrder(orderNo); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(jdService.queryOrderDetail(order)); |
|
|
|
|
// @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)
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// @ApiOperation(value = "确认订单")
|
|
|
|
|
// public ResponseData confirmOrder(@RequestParam(value = "childNo", required = false) String childNo) {
|
|
|
|
|
// try {
|
|
|
|
|
//
|
|
|
|
|
// BsOrderGoods order = getOrderGoodsService.findGoodsOrderByChild(childNo);
|
|
|
|
|
// jdService.confirmOrder(order);
|
|
|
|
|
// return ResponseMsgUtil.success("");
|
|
|
|
|
//
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// log.error("error!",e);
|
|
|
|
|
// return ResponseMsgUtil.exception(e);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/confirmOrder",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "确认订单") |
|
|
|
|
public ResponseData confirmOrder(@RequestParam(value = "orderNo", required = false) String orderNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
BsOrderGoods order = getOrderGoodsService.findGoodsOrder(orderNo); |
|
|
|
|
jdService.confirmOrder(order); |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryDeliveryInfo",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询物流信息") |
|
|
|
|
public ResponseData queryDeliveryInfo(@RequestParam(value = "orderNo", required = false) String orderNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
BsOrderGoods order = getOrderGoodsService.findGoodsOrder(orderNo); |
|
|
|
|
return ResponseMsgUtil.success(jdService.queryDeliveryInfo(order)); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/cancelOrder",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "取消订单") |
|
|
|
|
public ResponseData cancelOrder(@RequestParam(value = "childNo", required = false) String childNo) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
jdService.cancelOrder(childNo); |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryHltBalance",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
@ -561,130 +263,5 @@ public class TestController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/getGoodsUpdate",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "更新商品") |
|
|
|
|
public ResponseData getGoodsUpdate() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
map.put("status" , 3); |
|
|
|
|
List<BsOrderGoods> orderGoodsList = getOrderGoodsService.getList(map); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (BsOrderGoods orderGoods : orderGoodsList) { |
|
|
|
|
GoodsUserAddress address = goodsUserAddressService.queryDetail(orderGoods.getDeliveryAddressId()); |
|
|
|
|
|
|
|
|
|
if (address != null) { |
|
|
|
|
orderGoods.setDeliveryAddress(address.getRegionName() + "-" + address.getAddress() + "-" + address.getConsignee() + "-" + address.getPhone()); |
|
|
|
|
getOrderGoodsService.update(orderGoods); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/phgSignLogin",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "加密登陆") |
|
|
|
|
public ResponseData phgSignLogin() { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
Map<String , Object> objectMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
objectMap.put("status" , 10); |
|
|
|
|
|
|
|
|
|
List<BsOrderStarbucks> orderStarbucks = orderStarbucksService.getList(objectMap); |
|
|
|
|
|
|
|
|
|
for (BsOrderStarbucks starbucks : orderStarbucks) { |
|
|
|
|
|
|
|
|
|
if (starbucks != null) { |
|
|
|
|
// 查询星巴克订单详情
|
|
|
|
|
BsOrderChild child = orderChildService.getDetail(starbucks.getChildOrderNo()); |
|
|
|
|
|
|
|
|
|
// 查询星巴克订单详情
|
|
|
|
|
Map<String , Object> orderMap = new HashMap<>(); |
|
|
|
|
orderMap.put("orderNo" , child.getChannelOrderNo()); |
|
|
|
|
JSONObject objectOrder = StarbucksService.starbucksOrder(orderMap); |
|
|
|
|
if (objectOrder != null) { |
|
|
|
|
// 订单数据
|
|
|
|
|
JSONObject order = objectOrder.getJSONObject("data"); |
|
|
|
|
// 修改订单数据
|
|
|
|
|
bsOrderStarbucksService.updateOrderStatus(child.getOrderNo() , order.getInteger("status")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return ResponseMsgUtil.success(""); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/querySkuFreight",method = RequestMethod.POST) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询运费") |
|
|
|
|
public ResponseData querySkuFreight(@RequestBody JSONObject body) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
if (body == null || |
|
|
|
|
body.getJSONArray("skuInfoList") == null |
|
|
|
|
|| body.getLong("addressId") == null |
|
|
|
|
) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONArray array = body.getJSONArray("skuInfoList"); |
|
|
|
|
GoodsUserAddress userAddress = goodsUserAddressService.queryDetail(body.getLong("addressId")); |
|
|
|
|
if (userAddress.getProvinceId() == null) { |
|
|
|
|
VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress()); |
|
|
|
|
|
|
|
|
|
if (response != null && response.getOpenRpcResult().getSuccess()) { |
|
|
|
|
userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId()); |
|
|
|
|
userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName()); |
|
|
|
|
userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId()); |
|
|
|
|
userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName()); |
|
|
|
|
userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId()); |
|
|
|
|
userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName()); |
|
|
|
|
userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId()); |
|
|
|
|
userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName()); |
|
|
|
|
userAddress.setUpdateTime(new Date()); |
|
|
|
|
deliveryAddressService.update(userAddress); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>(); |
|
|
|
|
com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq skuInfo = new com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq(); |
|
|
|
|
|
|
|
|
|
for(Object object : array) { |
|
|
|
|
JSONObject json = (JSONObject)object; |
|
|
|
|
GoodsSpecs specs = goodsSpecsService.queryDetail(json.getLong("specsId")); |
|
|
|
|
if (specs.getThirdId() != null) { |
|
|
|
|
skuInfo.setSkuId(Long.parseLong(specs.getThirdId())); |
|
|
|
|
skuInfo.setSkuNum(json.getInteger("num")); |
|
|
|
|
skuInfoList.add(skuInfo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (skuInfoList.isEmpty()) { |
|
|
|
|
JSONObject object = new JSONObject(); |
|
|
|
|
object.put("totalFreight" , 0); |
|
|
|
|
return ResponseMsgUtil.success(object); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(JdPostService.querySkuFreight(jdService.getToken() , skuInfoList , userAddress.getProvinceId() ,userAddress.getCityId() , userAddress.getCountyId() , userAddress.getTownId()).getOpenRpcResult().getResult()); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|