Merge remote-tracking branch 'origin/master'

20230922-ljl-fixBug
qiushengjie 1 year ago
commit f2a178a4be

@ -122,18 +122,17 @@ public class DsMessageConsumerQueueServiceImpl implements DsMessageConsumerQueue
result = ApiResult.fail("提交数据异常");
break;
}
System.out.println("queues:" + queues);
Long startQueueId = null;
if (!queues.isEmpty()) {
startQueueId = queues.get(0).getDsMessageConsumerQueueId();
}
if (ObjectUtil.isNotNull(startQueueId)) {
int addQueueCount = queues.size();
int queueIdLoop = 0;
for (Long queueId = startQueueId; queueId < (addQueueCount + startQueueId); queueId++) {
String queueRedisKey = RedisKeyConst.getQueueRedisKey(TblConst.ds_message_consumer_queue, false);
redisTemplate.opsForList().leftPush(queueRedisKey, queueId.toString());
queueIdLoop++;
System.out.println("in_queue[" + queueRedisKey + "]: " + queueId);
redisTemplate.opsForList().leftPush(queueRedisKey, String.valueOf(queueId));
}
}

@ -2,8 +2,6 @@ package com.ms.api.spi.move;
import com.doudian.open.api.freightTemplate_list.data.FreightTemplateListData;
import com.doudian.open.api.freightTemplate_list.param.FreightTemplateListParam;
import com.doudian.open.api.product_isv_getClueList.data.ProductIsvGetClueListData;
import com.doudian.open.api.product_isv_getClueList.param.ProductIsvGetClueListParam;
import com.jinritemai.cloud.base.api.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.jinritemai.cloud.base.api.ExtensionService;
@ -12,11 +10,8 @@ import com.ms.api.common.R;
import com.ms.api.common.Ret;
import com.ms.api.common.SPIBaseService;
import com.ms.api.dto.move.GetFreightTemplateListRequestDTO;
import com.ms.api.dto.move.GetShopCloudHotProductsRequestDTO;
import com.ms.api.tool.DsJsonRequestTemplate;
import com.ms.api.util.DdRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
@ -38,7 +33,7 @@ public class GetFreightTemplateList extends SPIBaseService implements ExtensionS
// ----业务处理----
FreightTemplateListParam param = new FreightTemplateListParam();
param.setSize(fields.getSize());
FreightTemplateListData data = DdRequestUtil.FreightTemplateListDataRequest(param);
FreightTemplateListData data = DdRequestUtil.freightTemplateListDataRequest(param);
Map<String, Object> result = new HashMap<>();
result.put("data", data.getList());
result.put("total", data.getCount());

@ -1,7 +1,5 @@
package com.ms.api.spi.move;
import com.doudian.open.api.product_isv_getClueList.ProductIsvGetClueListRequest;
import com.doudian.open.api.product_isv_getClueList.ProductIsvGetClueListResponse;
import com.doudian.open.api.product_isv_getClueList.data.ProductIsvGetClueListData;
import com.doudian.open.api.product_isv_getClueList.param.ProductIsvGetClueListParam;
import com.jinritemai.cloud.base.api.BaseRequest;
@ -12,10 +10,8 @@ import com.ms.api.common.R;
import com.ms.api.common.Ret;
import com.ms.api.common.SPIBaseService;
import com.ms.api.dto.move.GetShopCloudHotProductsRequestDTO;
import com.ms.api.tool.DsJsonRequestTemplate;
import com.ms.api.util.DdRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
@ -41,7 +37,7 @@ public class GetShopCloudHotProductsService extends SPIBaseService implements Ex
param.setClueInfo(fields.getKeyword());
param.setCurrent(fields.getPageNo());
param.setPageSize(fields.getPageSize());
ProductIsvGetClueListData data = DdRequestUtil.ProductIsvGetClueListRequest(param);
ProductIsvGetClueListData data = DdRequestUtil.productIsvGetClueListRequest(param);
Map<String, Object> result = new HashMap<>();
result.put("data", data.getData());
result.put("total", data.getTotal());

@ -33,7 +33,7 @@ public class DelayOutstorageMoveBufferTaskService extends TaskBaseService {
protected Executor taskPool;
@Async("delayOutstorageMoveBufferTaskPool")
@Scheduled(fixedRate = 10000)
// @Scheduled(fixedRate = 10000)
@Override
public void runTask() {
super.runTask();

@ -38,7 +38,7 @@ public class DelayOutstorageProcessTaskService extends TaskBaseService {
protected Executor taskPool;
@Async("delayOutstorageProcessTaskPool")
@Scheduled(fixedRate = 10000)
// @Scheduled(fixedRate = 10000)
@Override
public void runTask() {
super.runTask();

@ -45,7 +45,7 @@ public class DsMessageConsumeMsgTaskService extends TaskBaseService {
protected Executor taskPool;
@Async("dsMessageConsumeMsgTaskPool")
@Scheduled(fixedRate = 10000)
// @Scheduled(fixedRate = 10000)
@Override
public void runTask() {
super.runTask();

@ -33,7 +33,7 @@ public class DsMessageMoveBufferTaskService extends TaskBaseService {
protected Executor taskPool;
@Async("dsMessageMoveBufferTaskPool")
@Scheduled(fixedRate = 10000)
// @Scheduled(fixedRate = 10000)
@Override
public void runTask() {
super.runTask();

@ -182,7 +182,7 @@ public class MovePublishBufferTaskService extends TaskBaseService {
// 去重
shopIds = shopIds.stream().distinct().collect(Collectors.toList());
// 返回
StrObjMap result = new StrObjMap();
result.put("priorityShopsMap", priorityShopsMap);

@ -84,14 +84,14 @@ public class SyncShopCategoryQueueTaskService extends TaskBaseService {
private List<DataItem> findChildShopCategory(Long cid) {
List<DataItem> dataAll = new ArrayList<DataItem>();
List<DataItem> dataGet = DdRequestUtil.GetShopCategory(cid);
List<DataItem> dataGet = DdRequestUtil.getShopCategory(cid);
if (dataGet.isEmpty()) {
return dataGet;
}
dataAll.addAll(dataGet);
for (DataItem datum : dataGet) {
if (datum.getEnable() && !datum.getIsLeaf()) {
List<DataItem> data1 = DdRequestUtil.GetShopCategory(datum.getId());
List<DataItem> data1 = DdRequestUtil.getShopCategory(datum.getId());
dataAll.addAll(data1);
}
}

@ -200,7 +200,7 @@ public class DdRequestUtil {
throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg()));
}
public static ProductIsvGetClueListData ProductIsvGetClueListRequest(ProductIsvGetClueListParam param) {
public static ProductIsvGetClueListData productIsvGetClueListRequest(ProductIsvGetClueListParam param) {
String activeProfile = System.getenv("sys-deploy-env");
if (!"Prod".equals(activeProfile)) {
AuthThreadLocalUtil.set(AppConst.TEST_SHOP_ID);
@ -217,7 +217,7 @@ public class DdRequestUtil {
throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg()));
}
public static FreightTemplateListData FreightTemplateListDataRequest(FreightTemplateListParam param) {
public static FreightTemplateListData freightTemplateListDataRequest(FreightTemplateListParam param) {
String activeProfile = System.getenv("sys-deploy-env");
if (!"Prod".equals(activeProfile)) {
AuthThreadLocalUtil.set(AppConst.TEST_SHOP_ID);
@ -235,7 +235,7 @@ public class DdRequestUtil {
}
///shop/getShopCategory
public static List<com.doudian.open.api.shop_getShopCategory.data.DataItem> GetShopCategory(Long cid){
public static List<com.doudian.open.api.shop_getShopCategory.data.DataItem> getShopCategory(Long cid){
ShopGetShopCategoryRequest request = new ShopGetShopCategoryRequest();
ShopGetShopCategoryParam param = request.getParam();
param.setCid(cid);

@ -1,21 +1,28 @@
package com.ms.web;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jinritemai.cloud.base.api.BaseResponse;
import com.ms.api.common.Pager;
import com.ms.api.common.R;
import com.ms.api.common.Ret;
import com.ms.api.consts.AppConst;
import com.ms.api.dto.dsapi.response.GetPlatformShopPurchaseSettingResponseDTO;
import com.ms.api.dto.dsorder.DsMessageCallbackRequestDTO;
import com.ms.api.dto.dsorder.RemarkTplTagDTO;
import com.ms.api.service.DsApiService;
import com.ms.api.service.OpOrderService;
import com.ms.api.service.PurchaseOrderItemService;
import com.ms.api.service.ShopService;
import com.ms.api.dto.order.SearchDsOrderFilterDTO;
import com.ms.api.dto.order.SearchDsOrderListRequestDTO;
import com.ms.api.service.*;
import com.ms.api.tool.CommonTool;
import com.ms.api.tool.PurchaseTool;
import com.ms.common.util.DsClient;
import com.ms.common.util.HttpClient;
import com.ms.dal.entity.PurchaseOrderItem;
import com.ms.dal.entity.Shop;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
@ -32,6 +39,7 @@ import java.util.regex.Pattern;
* @Author: laixw
* @Date: 2023/8/22
*/
@Slf4j
@RestController
public class Test {
@ -44,6 +52,9 @@ public class Test {
@Autowired
private PurchaseOrderItemService purchaseOrderItemService;
@Autowired
private DsMessageService dsMessageService;
@Autowired
private DsApiService dsApiService;
@ -168,4 +179,15 @@ public class Test {
e.printStackTrace();
}
}
@PostMapping("/dsMessageCallback")
public BaseResponse<Ret> dsMessageCallback(@RequestBody DsMessageCallbackRequestDTO request) {
try {
log.info("receive callback: " + JSON.toJSONString(request));
dsMessageService.addDsMessage(request.getShopId(), request.getPlatformPushMsgId(), request.getBizId(), request.getBizType(), request.getData());
return R.ok(CommonTool.successResult());
} catch (RuntimeException e) {
return R.ok(Ret.fail(e.getMessage()));
}
}
}

@ -0,0 +1,30 @@
<settings>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>bytedance-isv</id>
<repositories>
<repository>
<id>bytedance-public-releases</id>
<url>https://artifact.bytedance.com/repository/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bytedance-isv</activeProfile>
</activeProfiles>
</settings>
Loading…
Cancel
Save