记得上下班打卡 | git大法好,push需谨慎

Commit e0fa12dc authored by 胡佳晨's avatar 胡佳晨

测试 nft 同步订单

parent 88b1bf88
......@@ -37,9 +37,9 @@ public class WdtController {
@ApiOperation("推送订单")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "orderId", value = "orderId"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderId", value = "orderId"),
})
public ResponseDto<Boolean> pushTrade(@RequestParam(value = "orderId") String orderId) {
public ResponseDto<Boolean> pushTrade(@RequestParam(value = "orderId",required = false) String orderId) {
return goblinErpService.pushTrade(orderId);
}
......
......@@ -93,7 +93,9 @@ public class WdtServiceImpl implements IGoblinErpService {
}
} else {
int pageSize = 40;
int allCount = (int) mongoTemplate.count(Query.query(Criteria.where("erpHosting").is(1)), GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());//总条数
int allCount = (int) mongoTemplate.count(Query.query(Criteria.where("erpHosting").is(1)
// .and("skuType").is("0")
), GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());//总条数
int pageCount = (allCount / pageSize) + 1;
param.put("page_size", pageSize + "");
for (int i = 0; i < pageCount; i++) {
......@@ -181,6 +183,13 @@ public class WdtServiceImpl implements IGoblinErpService {
orderIdList.add(list);
//todo 删除redis key
}
// List<String> list = CollectionUtil.arrayListString();
// for (int i = 0; i < contentSize; i++) {
// String orderId = goblinRedisUtils.erpLeftPop(i);
// list.add(orderId);
// }
// orderIdList.add(list);
} else {
List<String> a = CollectionUtil.arrayListString();
a.add(singleId);
......@@ -199,6 +208,10 @@ public class WdtServiceImpl implements IGoblinErpService {
param.put("trade_list", JSON.toJSONString(listOrder));
String json = erpWdtClient.execute(ErpEnum.WdtAPI.TRADE_PUSH.getUri(), param);
TradePushVo data = JsonUtils.fromJson(json, TradePushVo.class);
int newCount = data.getNew_count();
if(listOrder.size()<newCount){
log.error("同步 erp 失败 ");
}
}
return ResponseDto.success();
}
......
......@@ -401,7 +401,7 @@ public class GoblinRedisUtils {
}
//移除erp订单
//获取erp订单
public List<String> getRange(int index) {
String rdk = GoblinRedisConst.ERP_GOBLIN_GOODS_LIST.concat(index + "");
List<Object> list = getRedis().getRange(rdk);
......@@ -412,6 +412,16 @@ public class GoblinRedisUtils {
return data;
}
public String erpLeftPop(int index) {
String rdk = GoblinRedisConst.ERP_GOBLIN_GOODS_LIST.concat(index + "");
Object obj = getRedis().leftPop(rdk);
if(obj==null){
return null;
}else{
return (String) obj;
}
}
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
/* ---------------------------------------- ---------------------------------------- */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment