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

袁野 4 weeks ago
parent e4c7af56fb
commit 2946b26df6
  1. 71
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 4
      bweb/src/main/java/com/bweb/controller/goods/GoodPresentController.java
  3. 6
      order/src/main/java/com/order/controller/business/BsOrderMeiTuanController.java
  4. 2
      order/src/main/java/com/order/controller/notify/MeiTuanController.java
  5. 55
      schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java
  6. 4
      service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java
  7. 32
      service/src/main/java/com/hfkj/dao/JdSkuMapperExt.java
  8. 29
      service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java
  9. 10
      service/src/main/java/com/hfkj/jd/JdService.java
  10. 5
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderMeiTuanServiceImpl.java

@ -6,19 +6,21 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.*;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.GoodsUserAddress;
import com.hfkj.entity.*;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
import com.hfkj.mer.BsMerPayConfigService;
import com.hfkj.model.ResponseData;
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.GoodsUserAddressService;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderRefundService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.OrderPayService;
@ -70,6 +72,16 @@ public class TestController {
@Resource
private BsOrderService orderService;
@Resource
private BsOrderStarbucksService orderStarbucksService;
@Resource
private BsOrderChildService orderChildService;
@Resource
private BsOrderStarbucksServiceImpl bsOrderStarbucksService;
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET)
@ResponseBody
@ -161,7 +173,7 @@ public class TestController {
public ResponseData getSkuDetailInfo() {
try {
GetSkuPoolInfoGoodsResp detail = JdPostService.getSkuDetailInfo(jdService.getToken() , 1235014L).getOpenRpcResult().getResult();
GetSkuPoolInfoGoodsResp detail = JdPostService.getSkuDetailInfo(jdService.getToken() , 100017491914L).getOpenRpcResult().getResult();
return ResponseMsgUtil.success(detail);
} catch (Exception e) {
@ -176,7 +188,7 @@ public class TestController {
public ResponseData getSkuImageList() {
try {
return ResponseMsgUtil.success(JdPostService.getSkuImageList(jdService.getToken() , "1235014"));
return ResponseMsgUtil.success(JdPostService.getSkuImageList(jdService.getToken() , "100017491914"));
} catch (Exception e) {
log.error("error!",e);
@ -190,7 +202,7 @@ public class TestController {
public ResponseData getSellPrice() {
try {
return ResponseMsgUtil.success(JdPostService.getSellPrice(jdService.getToken() , "1235014"));
return ResponseMsgUtil.success(JdPostService.getSellPrice(jdService.getToken() , "100017491914"));
} catch (Exception e) {
log.error("error!",e);
@ -226,6 +238,20 @@ public class TestController {
}
}
@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 = "消息消费")
@ -504,14 +530,33 @@ public class TestController {
public ResponseData phgSignLogin() {
try {
Map<String , Object> map = new HashMap<>();
map.put("appid" , "20241266600");
map.put("phone" , "18390580471");
map.put("sign" , SignatureUtil.createSign(map , "BCB83776BDA7F609FBE99BBB8AC33840"));
map.put("platform" , "HIGH");
map.put("type" , "HIGH_SIGN");
return ResponseMsgUtil.success( HttpsUtils.doPost("http://localhost:9704/user/client/phgSignLogin" , map , new HashMap<>()));
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);

@ -88,10 +88,10 @@ public class GoodPresentController {
}
@RequestMapping(value="/getListBrand",method = RequestMethod.GET)
@RequestMapping(value="/getLisPresent",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getListBrand(@RequestParam(value = "specsId" , required = false) Long specsId) {
public ResponseData getLisPresent(@RequestParam(value = "specsId" , required = false) Long specsId) {
try {
Map<String , Object> map = new HashMap<>();

@ -48,11 +48,11 @@ public class BsOrderMeiTuanController {
@Resource
private UserCenter userCenter;
@Resource
private BsOrderMeiTuanServiceImpl bsOrderMeiTuanService;
private static final Logger log = LoggerFactory.getLogger(BsOrderGoodsController.class);
@Autowired
private BsOrderMeiTuanServiceImpl bsOrderMeiTuanService;
@RequestMapping(value="/servicePrice",method = RequestMethod.GET)
@ResponseBody

@ -118,7 +118,7 @@ public class MeiTuanController {
"&outSidePhone=" + staffInfo.getString("staffPhone") +
"&outsidePlatform=" + "WXAPPLETS" +
"&outSideType=" + "SIGN"
);
);
log.info("美团下单-参数: {}", object);
data.put("status", 0);

@ -1,13 +1,17 @@
package com.hfkj.schedule;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
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.qianzhu.StarbucksService;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.BsOrderStarbucksService;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.goods.impl.BsOrderMeiTuanServiceImpl;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.sysenum.order.OrderLogisticsStatusEnum;
@ -39,7 +43,7 @@ public class OrderGoodsSchedule {
@Resource
private GoodsUserAddressService addressService;
private BsOrderStarbucksServiceImpl bsOrderStarbucksService;
@Resource
private BsOrderStarbucksService orderStarbucksService;
@ -49,7 +53,8 @@ public class OrderGoodsSchedule {
@Resource
private BsOrderService orderService;
@Resource
private BsOrderMeiTuanServiceImpl bsOrderMeiTuanService;
//每日凌晨12点5秒执行一次
@Scheduled(cron = "5 0 0 * * ?")
public void orderGoodsConfirmReceipt() {
@ -143,6 +148,52 @@ public class OrderGoodsSchedule {
}
}
}
@Scheduled(cron = "5 0 0 * * ?")
public void getMeiTuan() {
Map<String , Object> objectMap = new HashMap<>();
objectMap.put("status" , 2);
List<BsOrderMeituan> orderMeiTuan = bsOrderMeiTuanService.getOrderList(objectMap);
for (BsOrderMeituan meituan : orderMeiTuan) {
if (meituan != null) {
bsOrderMeiTuanService.orderFinish(meituan.getChildOrderNo());
}
}
}
@Scheduled(cron = "5 0 0 * * ?")
public void getStarbucksByCompleted() {
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"));
}
}
}
}
}

@ -29,7 +29,7 @@ public interface GoodsMsgMapperExt {
" FROM" +
" goods_msg a join goods_specs b on a.id = b.goods_id where a.type = 1 and a.child_type=1 and a.status = 1" +
" <if test='param.goodsTypeParent != null'> and a.goods_type_parent = #{param.goodsTypeParent} </if>" +
" <if test='param.title != null'> and b.title like concat('%',#{param.title},'%') </if>" +
" <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.goodsBrand != null'> and a.goods_brand = #{param.goodsBrand} </if>" +
" <if test='param.salePriceS != null'><![CDATA[ and b.sale_price >= #{param.salePriceS} ]]></if>" +
@ -46,7 +46,7 @@ public interface GoodsMsgMapperExt {
" third_id as thirdId," +
" sale_num as saleNum" +
" FROM" +
" goods_msg where status = 1 " +
" goods_msg where status = 1 and third_id is null " +
" <if test='param.goodsTypeParent != null'> and goods_type_parent = #{param.goodsTypeParent} </if>" +
" <if test='param.title != null'> and title like concat('%',#{param.title},'%') </if>" +
" <if test='param.goodsType != null'> and goods_type = #{param.goodsType} </if>" +

@ -1,7 +1,39 @@
package com.hfkj.dao;
import com.hfkj.entity.JdSku;
import com.hfkj.model.goods.JdGoodsModel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface JdSkuMapperExt {
@Insert({
"<script>",
"insert into jd_sku (sku_id, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values ",
"<foreach collection='list' item='item' index='index' separator=','>",
"(#{item.skuId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, ",
"#{item.updateTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER}, ",
"#{item.ext1,jdbcType=VARCHAR}, #{item.ext2,jdbcType=VARCHAR}, #{item.ext3,jdbcType=VARCHAR})" ,
"</foreach>",
"</script>"
})
void insertJdSkuBatch(@Param(value = "list") List<JdSku> list);
@Select("<script>" +
" SELECT third_id from goods_msg where third_id is not null;" +
"</script>")
List<Long> getJdList();
}

@ -3,6 +3,8 @@ package com.hfkj.jd.Impl;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.dao.JdSkuMapper;
import com.hfkj.dao.JdSkuMapperExt;
import com.hfkj.entity.*;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
@ -31,6 +33,7 @@ import com.jd.open.api.sdk.response.vopsp.VopGoodsGetSkuImageListResponse;
import com.jd.open.api.sdk.response.vopsp.VopGoodsGetSkuPoolInfoResponse;
import com.jd.open.api.sdk.response.vopsp.VopGoodsGetSkuStateListResponse;
import com.jd.open.api.sdk.response.vopxx.VopMessageQueryTransByVopNormalResponse;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -69,6 +72,9 @@ public class JdServiceImpl implements JdService {
@Resource
private BsOrderGoodsService bsOrderGoodsService;
@Resource
private JdSkuMapper jdSkuMapper;
private final List<Long> skuListIds = new ArrayList<>();
@ -107,7 +113,6 @@ public class JdServiceImpl implements JdService {
handleList.forEach(item->{
try {
for (Long aLong : handleList) {
// 根据skuId 查询商品详情
@ -134,7 +139,6 @@ public class JdServiceImpl implements JdService {
GoodsType goodsType1 = goodsTypeService.queryDetail(category1);
GoodsType goodsType2 = goodsTypeService.queryDetail(category2);
// 如果goodsType1为null,则创建一个新的GoodsType对象
if (goodsType1 == null) {
goodsType1 = new GoodsType();
@ -332,7 +336,6 @@ public class JdServiceImpl implements JdService {
// 获取京东商品池编码
List<GetSkuPoolInfoItemGoodsResp> skuPoolList = sku.getOpenRpcResult().getResult().getSkuPoolList();
skuListIds.clear();
BsProductConfig productConfig = productConfigService.queryDetail(OrderChildProductTypeEnum.type6.getCode());
@ -343,9 +346,16 @@ public class JdServiceImpl implements JdService {
getSkuList(token , skuPoolInfoItemGoodsResp.getBizPoolId() , 0L);
}
List<Long> sku1 = jdSkuMapper.getJdList();
List<Long> skuList = skuListIds.stream()
.filter(e -> !sku1.contains(e))
.collect(Collectors.toList());
System.out.println("=========================当前cpu核数:{}" + cpuCoreCnt);
//通过对核心数取余来计算每个线程需要处理的数据量大小
int size = skuListIds.size() % cpuCoreCnt > 0 ? skuListIds.size() / cpuCoreCnt +1 : skuListIds.size() / cpuCoreCnt;
int size = skuList.size() % cpuCoreCnt > 0 ? skuList.size() / cpuCoreCnt +1 : skuList.size() / cpuCoreCnt;
// 用于存储所有任务的Future
List<Future> futureList = new ArrayList<>();
@ -354,7 +364,7 @@ public class JdServiceImpl implements JdService {
for (int i = 0; i < cpuCoreCnt; i++) {
//获取每个线程要处理的数据集
List<Long> handleList = skuListIds.subList(i * size, Math.min(skuListIds.size(), i * size + size));
List<Long> handleList = skuList.subList(i * size, Math.min(skuList.size(), i * size + size));
//创建异步任务添加到线程池,这里使用jdk8的CompletableFuture
CompletableFuture<Void> completableFuture = CompletableFuture.runAsync(() -> {
//数据集处理任务
@ -372,11 +382,16 @@ public class JdServiceImpl implements JdService {
//关闭线程池
threadPool.shutdown();
}, threadPool);
System.out.println(skuListIds.size());
System.out.println(skuList.size());
}
@Override
public List<Long> skuList() {
return jdSkuMapper.getJdList();
}
/**
* @MethodName getSkuList
* @Description: 获取全量商品池

@ -1,13 +1,12 @@
package com.hfkj.jd;
import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.GoodsLogistics;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.*;
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.vopsh.VopAfsCreateAfsApplyResponse;
import java.util.List;
public interface JdService {
/**
@ -31,6 +30,9 @@ public interface JdService {
*/
void getGoodsJd() throws Exception;
List<Long> skuList();
/**
* @MethodName checkSkuSale
* @Description: 校验商品可售性

@ -202,7 +202,10 @@ public class BsOrderMeiTuanServiceImpl implements BsOrderMeiTuanService {
if (finish) {
// 子订单完成
orderService.childOrderComplete(childNo);
orderMeiTuan.setFinishTime(finshDate);
orderMeiTuan.setFinishTime(new Date());
if (finshDate != null) {
orderMeiTuan.setExt1(finshDate.toString());
}
orderMeiTuan.setUpdateTime(new Date());
orderMeiTuan.setStatus(OrderChildStatusEnum.status3.getCode());
update(orderMeiTuan);

Loading…
Cancel
Save