修改汇联通distributorId 原参数aNId4A3X修改为orjuOND7

dev
袁野 3 weeks ago
parent 1452fce850
commit 58a428b213
  1. 553
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 26
      bweb/src/main/java/com/bweb/controller/goods/GoodsController.java
  3. 2
      cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java
  4. 22
      cweb/src/main/java/com/cweb/controller/goods/GoodsController.java
  5. 21
      schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java
  6. 9
      service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java
  7. 8
      service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java
  8. 7
      service/src/main/java/com/hfkj/jd/JdPostService.java
  9. 4
      service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java
  10. 2
      service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java
  11. 8
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java
  12. 8
      service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java
  13. 12
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java

@ -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);
}
}
}

@ -13,6 +13,8 @@ import com.hfkj.common.utils.OrderUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
import com.hfkj.model.goods.GoodsModelSpecs;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
@ -26,6 +28,7 @@ import com.hfkj.sysenum.fileRecords.FileRecordsEnum;
import com.hfkj.sysenum.order.OrderChildStatusEnum;
import com.hfkj.sysenum.order.OrderPayChannelEnum;
import com.hfkj.sysenum.order.OrderPayTypeEnum;
import com.jd.open.api.sdk.response.vopdd.VopOrderCheckAccountBalanceResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -77,7 +80,8 @@ public class GoodsController {
@Resource
private GoodsJumpService goodsJumpService;
@Resource
private JdService jdService;
@Resource
private FileRecordsService fileRecordsService;
@ -500,6 +504,26 @@ public class GoodsController {
}
}
@RequestMapping(value = "/checkAccountBalance", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询账户余额")
public ResponseData checkAccountBalance( ) {
try {
VopOrderCheckAccountBalanceResponse balanceResponse = JdPostService.checkAccountBalance(jdService.getToken());
if (balanceResponse == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额查询错误!");
}
return ResponseMsgUtil.success(balanceResponse.getOpenRpcResult().getResult().getBalanceInfo().getRemainLimit());
} catch (Exception e) {
log.error("GoodsDetailController --> findGoodsDetailById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getJdGoodsList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询京东商品")

@ -82,11 +82,13 @@ public class CmsContentController {
if (cmsContent.getShowType() == 2) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
goodsMap.put("limit" , 4);
goodsMap.put("saleNum" , 2);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}
if (cmsContent.getShowType() == 3) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
goodsMap.put("limit" , 10);
goodsMap.put("type" , 1);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}

@ -88,18 +88,14 @@ public class GoodsController {
@ResponseBody
@ApiOperation(value = "查询品牌列表")
public ResponseData getListBrand(@RequestParam(value = "title" , required = false) String title,
@RequestParam(value = "ext1" , required = false) String ext1) {
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
Map<String , Object> map = new HashMap<>();
map.put("title", title);
JSONObject object = new JSONObject();
object.put("list", goodsBrandService.getList(map));
map.put("ext1", "热门");
object.put("listExt", goodsBrandService.getList(map));
return ResponseMsgUtil.success(object);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(goodsBrandService.getList(map)));
} catch (Exception e) {
log.error("error!",e);
@ -107,6 +103,8 @@ public class GoodsController {
}
}
@RequestMapping(value = "/getListGoods", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商品列表")
@ -118,9 +116,12 @@ public class GoodsController {
@RequestParam(value = "discountId", required = false) Integer discountId,
@RequestParam(value = "goodsBrand", required = false) Long goodsBrand,
@RequestParam(value = "price", required = false) Integer price,
@RequestParam(value = "type", required = false) Integer type,
@RequestParam(value = "saleNum", required = false) Integer saleNum,
@RequestParam(value = "limit", required = false) Integer limit,
@RequestParam(value = "time", required = false) Integer time,
@RequestParam(value = "salePriceS" , required = false) BigDecimal salePriceS,
@RequestParam(value = "salePriceE" , required = false) BigDecimal salePriceE,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize
) {
@ -136,6 +137,8 @@ public class GoodsController {
map.put("goodsTypeParent", goodsTypeParent);
map.put("goodsBrand", goodsBrand);
map.put("saleNum", saleNum);
map.put("salePriceS", salePriceS);
map.put("salePriceE", salePriceE);
if (limit == null && title == null && goodsType == null && goodsTypeParent == null && goodsBrand == null) {
map.put("limit", 500);
} else {
@ -144,6 +147,7 @@ public class GoodsController {
map.put("time", time);
map.put("status", 1);
map.put("type", type);
if (discountId != null) {
// 查询优惠券可以用规格
@ -156,7 +160,7 @@ public class GoodsController {
List<Long> sp = couponDiscountGoodsRel.stream().map(CouponDiscountGoodsRel::getSpecsId).collect(Collectors.toList());
map.put("specsId", sp);
}
System.out.println("=========================参数+" + map);
List<JdGoodsModel> list = goodsMsgService.getListCrest(map);

@ -6,6 +6,7 @@ import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.entity.*;
import com.hfkj.jd.JdService;
import com.hfkj.qianzhu.StarbucksService;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.BsOrderStarbucksService;
@ -55,6 +56,10 @@ public class OrderGoodsSchedule {
private BsOrderService orderService;
@Resource
private BsOrderMeiTuanServiceImpl bsOrderMeiTuanService;
@Resource
private JdService jdService;
//每日凌晨12点5秒执行一次
@Scheduled(cron = "5 0 0 * * ?")
public void orderGoodsConfirmReceipt() {
@ -196,4 +201,20 @@ public class OrderGoodsSchedule {
}
}
//每55分钟执行一次
@Scheduled(cron = "0 0/55 * * * ?")
public void orderGoodsJd() {
try {
List<BsOrderGoods> orderGoodsList = orderGoodsService.getListByJd();
for (BsOrderGoods goods : orderGoodsList) {
jdService.updateDeliveryInfo(goods);
}
} catch (Exception e) {
log.error("HighUserController --> orderGoodsJd() error!", e);
}
}
}

@ -68,14 +68,13 @@ public interface GoodsMsgMapperExt {
" a.title as title," +
" a.list_img as listImg," +
" a.sale_num as saleNum," +
" b.sale_price as salePrice, " +
" b.sale_price as price, " +
" b.third_price as thirdPrice," +
" b.original_price as originalPrice," +
" a.third_id as thirdId," +
" b.id as specsId ," +
" a.id as id," +
" MIN(b.sale_price) , " +
" MIN(b.sale_price) as salePrice , " +
" MIN(b.sale_price) as price , " +
"a.create_time as createtime ," +
"a.update_time as updateTime" +
" FROM" +
@ -84,9 +83,11 @@ public interface GoodsMsgMapperExt {
" <if test='param.title != null'> and a.title like concat('%',#{param.title},'%') </if>" +
" <if test='param.goodsType != null'> and a.goods_type = #{param.goodsType} </if>" +
" <if test='param.showType != null'> and a.show_type = #{param.showType} </if>" +
" <if test='param.type != null'> and a.third_id is not null </if>" +
" <if test='param.specsId != null'> and b.id in <foreach collection='param.specsId' item='item' index='index' open='(' separator=',' close=')'>#{item}</foreach> </if>" +
" <if test='param.goodsBrand != null'> and a.goods_brand = #{param.goodsBrand} </if>" +
" <if test='param.salePriceS != null'><![CDATA[ and b.sale_price >= #{param.salePriceS} ]]></if>" +
" <if test='param.salePriceE != null'><![CDATA[ and b.sale_price <= #{param.salePriceE} ]]></if>" +
" group by a.id) c" +
" <if test='param.time == 1'>ORDER BY c.updateTime desc</if>" +
" <if test='param.time == 2'>ORDER BY c.createtime asc</if>" +

@ -540,6 +540,7 @@ public class JdServiceImpl implements JdService {
// 设置原价
specs.setOriginalPrice(price.getMarketPrice());
specs.setThirdPrice(price.getJdPrice());
specs.setExt3(price.getSalePrice().toString());
// 设置展示图片
goodsSpecsService.update(specs);
}
@ -623,7 +624,12 @@ public class JdServiceImpl implements JdService {
if (!deliveryInfo.getTrackInfoList().isEmpty()) {
LogisticInfoOrderOpenResp logisticInfo = deliveryInfo.getLogisticInfoList().get(0);
// 查询物流信息
GoodsLogistics logistics = bsOrderGoodsService.findGoodsLogisticsByNum(logisticInfo.getDeliveryOrderId());
GoodsLogistics logistics = new GoodsLogistics();
if (logisticInfo.getDeliveryOrderId() != null) {
// 查询物流信息
logistics = bsOrderGoodsService.findGoodsLogisticsByNum(logisticInfo.getDeliveryOrderId());
}
// 获取物流信息列表
List<TrackInfoOrderOpenResp> trackInfoList = deliveryInfo.getTrackInfoList();
// 创建一个JSON对象列表

@ -384,6 +384,13 @@ public class JdPostService {
return client.execute(request);
}
//查询账户余额
public static VopOrderCheckAccountBalanceResponse checkAccountBalance(String token ) throws Exception {
JdClient client=new DefaultJdClient(SERVER_URL,token,CommonSysConst.getSysConfig().getJDAppKey(),CommonSysConst.getSysConfig().getJDAppSecret());
VopOrderCheckAccountBalanceRequest request=new VopOrderCheckAccountBalanceRequest();
return client.execute(request);
}
// 申请售后
public static VopAfsCreateAfsApplyResponse createAfsApply(
String token , String thirdApplyId , Integer customerExpect , Long wareId ,

@ -98,6 +98,10 @@ public interface BsOrderGoodsService {
* @return java.util.List<com.hfkj.entity.GoodsBrand>
*/
List<BsOrderGoods> getList(Map<String , Object> map);
List<BsOrderGoods> getListByJd();
List<BsOrderGoods> getListFinish(Map<String , Object> map);
/**

@ -91,6 +91,8 @@ public interface GoodsMsgService {
List<JdGoodsModel> getJdGoodsList(Map<String,Object> param);
List<GoodsMsg> getJdList();
/**
* 编辑商品库存
* @param goodsId

@ -198,6 +198,14 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
return bsOrderGoodsMapper.selectByExample(example);
}
@Override
public List<BsOrderGoods> getListByJd() {
BsOrderGoodsExample example = new BsOrderGoodsExample();
BsOrderGoodsExample.Criteria criteria = example.createCriteria();
criteria.andStatusEqualTo(2).andThirdOrderNoIsNotNull().andLogisticsNoIsNull();
return bsOrderGoodsMapper.selectByExample(example);
}
@Override
public List<BsOrderGoods> getListFinish(Map<String , Object> map) {
BsOrderGoodsExample example = new BsOrderGoodsExample();

@ -154,6 +154,14 @@ public class GoodsMsgServiceImpl implements GoodsMsgService {
return goodsMsgMapper.getJdGoodsList(param);
}
@Override
public List<GoodsMsg> getJdList() {
GoodsMsgExample example = new GoodsMsgExample();
GoodsMsgExample.Criteria criteria = example.createCriteria();
criteria.andThirdIdIsNotNull().andStatusEqualTo(1);
return goodsMsgMapper.selectByExample(example);
}
@Override
public void editSaleNum(Long goodsId, Integer num , Integer type) {

@ -23,6 +23,7 @@ import com.hfkj.service.coupon.channel.HuiLianTongCouponService;
import com.hfkj.service.goods.*;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.sysenum.GoodsVpdSourceEnum;
import com.hfkj.sysenum.UserLoginPlatform;
import com.hfkj.sysenum.order.*;
import com.jd.open.api.sdk.domain.vopsp.SkuInfoGoodsProvider.response.getSellPrice.OpenRpcResult;
import com.jd.open.api.sdk.response.vopdd.VopOrderSubmitOrderResponse;
@ -179,7 +180,16 @@ public class OrderCreateService {
orderCoupon.setMerId(orderChild.getMerId());
orderCoupon.setPlatformCode(businessObj.getString("platformCode"));
orderCoupon.setUserId(order.getUserId());
orderCoupon.setUserPhone(order.getUserPhone());
if (businessObj.getString("platformCode").equals(UserLoginPlatform.VFAMILY.getCode()) || businessObj.getString("platformCode").equals(UserLoginPlatform.GZGOV.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前产品暂不支付购买!");
}
if (goodsVpd.getSource().equals(GoodsVpdSourceEnum.type1.getCode()) || goodsVpd.getSource().equals(GoodsVpdSourceEnum.type3.getCode())) {
orderCoupon.setUserPhone(businessObj.getString("userPhone"));
} else {
orderCoupon.setUserPhone(order.getUserPhone());
}
orderCoupon.setGoodsId(goodsMsg.getId());
orderCoupon.setGoodsName(goodsMsg.getTitle());
orderCoupon.setGoodsTypeId(goodsMsg.getGoodsType());

Loading…
Cancel
Save