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("提交数据异常"); result = ApiResult.fail("提交数据异常");
break; break;
} }
System.out.println("queues:" + queues);
Long startQueueId = null; Long startQueueId = null;
if (!queues.isEmpty()) { if (!queues.isEmpty()) {
startQueueId = queues.get(0).getDsMessageConsumerQueueId(); startQueueId = queues.get(0).getDsMessageConsumerQueueId();
} }
if (ObjectUtil.isNotNull(startQueueId)) { if (ObjectUtil.isNotNull(startQueueId)) {
int addQueueCount = queues.size(); int addQueueCount = queues.size();
int queueIdLoop = 0;
for (Long queueId = startQueueId; queueId < (addQueueCount + startQueueId); queueId++) { for (Long queueId = startQueueId; queueId < (addQueueCount + startQueueId); queueId++) {
String queueRedisKey = RedisKeyConst.getQueueRedisKey(TblConst.ds_message_consumer_queue, false); String queueRedisKey = RedisKeyConst.getQueueRedisKey(TblConst.ds_message_consumer_queue, false);
redisTemplate.opsForList().leftPush(queueRedisKey, queueId.toString()); System.out.println("in_queue[" + queueRedisKey + "]: " + queueId);
queueIdLoop++; 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.data.FreightTemplateListData;
import com.doudian.open.api.freightTemplate_list.param.FreightTemplateListParam; 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.BaseRequest;
import com.jinritemai.cloud.base.api.BaseResponse; import com.jinritemai.cloud.base.api.BaseResponse;
import com.jinritemai.cloud.base.api.ExtensionService; 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.Ret;
import com.ms.api.common.SPIBaseService; import com.ms.api.common.SPIBaseService;
import com.ms.api.dto.move.GetFreightTemplateListRequestDTO; 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 com.ms.api.util.DdRequestUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -38,7 +33,7 @@ public class GetFreightTemplateList extends SPIBaseService implements ExtensionS
// ----业务处理---- // ----业务处理----
FreightTemplateListParam param = new FreightTemplateListParam(); FreightTemplateListParam param = new FreightTemplateListParam();
param.setSize(fields.getSize()); param.setSize(fields.getSize());
FreightTemplateListData data = DdRequestUtil.FreightTemplateListDataRequest(param); FreightTemplateListData data = DdRequestUtil.freightTemplateListDataRequest(param);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
result.put("data", data.getList()); result.put("data", data.getList());
result.put("total", data.getCount()); result.put("total", data.getCount());

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

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

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

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

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

@ -84,14 +84,14 @@ public class SyncShopCategoryQueueTaskService extends TaskBaseService {
private List<DataItem> findChildShopCategory(Long cid) { private List<DataItem> findChildShopCategory(Long cid) {
List<DataItem> dataAll = new ArrayList<DataItem>(); List<DataItem> dataAll = new ArrayList<DataItem>();
List<DataItem> dataGet = DdRequestUtil.GetShopCategory(cid); List<DataItem> dataGet = DdRequestUtil.getShopCategory(cid);
if (dataGet.isEmpty()) { if (dataGet.isEmpty()) {
return dataGet; return dataGet;
} }
dataAll.addAll(dataGet); dataAll.addAll(dataGet);
for (DataItem datum : dataGet) { for (DataItem datum : dataGet) {
if (datum.getEnable() && !datum.getIsLeaf()) { if (datum.getEnable() && !datum.getIsLeaf()) {
List<DataItem> data1 = DdRequestUtil.GetShopCategory(datum.getId()); List<DataItem> data1 = DdRequestUtil.getShopCategory(datum.getId());
dataAll.addAll(data1); 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())); 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"); String activeProfile = System.getenv("sys-deploy-env");
if (!"Prod".equals(activeProfile)) { if (!"Prod".equals(activeProfile)) {
AuthThreadLocalUtil.set(AppConst.TEST_SHOP_ID); 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())); 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"); String activeProfile = System.getenv("sys-deploy-env");
if (!"Prod".equals(activeProfile)) { if (!"Prod".equals(activeProfile)) {
AuthThreadLocalUtil.set(AppConst.TEST_SHOP_ID); AuthThreadLocalUtil.set(AppConst.TEST_SHOP_ID);
@ -235,7 +235,7 @@ public class DdRequestUtil {
} }
///shop/getShopCategory ///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(); ShopGetShopCategoryRequest request = new ShopGetShopCategoryRequest();
ShopGetShopCategoryParam param = request.getParam(); ShopGetShopCategoryParam param = request.getParam();
param.setCid(cid); param.setCid(cid);

@ -1,21 +1,28 @@
package com.ms.web; package com.ms.web;
import com.alibaba.fastjson.JSON; 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.dsapi.response.GetPlatformShopPurchaseSettingResponseDTO;
import com.ms.api.dto.dsorder.DsMessageCallbackRequestDTO;
import com.ms.api.dto.dsorder.RemarkTplTagDTO; import com.ms.api.dto.dsorder.RemarkTplTagDTO;
import com.ms.api.service.DsApiService; import com.ms.api.dto.order.SearchDsOrderFilterDTO;
import com.ms.api.service.OpOrderService; import com.ms.api.dto.order.SearchDsOrderListRequestDTO;
import com.ms.api.service.PurchaseOrderItemService; import com.ms.api.service.*;
import com.ms.api.service.ShopService; import com.ms.api.tool.CommonTool;
import com.ms.api.tool.PurchaseTool; import com.ms.api.tool.PurchaseTool;
import com.ms.common.util.DsClient; import com.ms.common.util.DsClient;
import com.ms.common.util.HttpClient; import com.ms.common.util.HttpClient;
import com.ms.dal.entity.PurchaseOrderItem; import com.ms.dal.entity.PurchaseOrderItem;
import com.ms.dal.entity.Shop; import com.ms.dal.entity.Shop;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.crypto.Cipher; import javax.crypto.Cipher;
import javax.crypto.KeyGenerator; import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.SecretKeySpec;
@ -32,6 +39,7 @@ import java.util.regex.Pattern;
* @Author: laixw * @Author: laixw
* @Date: 2023/8/22 * @Date: 2023/8/22
*/ */
@Slf4j
@RestController @RestController
public class Test { public class Test {
@ -44,6 +52,9 @@ public class Test {
@Autowired @Autowired
private PurchaseOrderItemService purchaseOrderItemService; private PurchaseOrderItemService purchaseOrderItemService;
@Autowired
private DsMessageService dsMessageService;
@Autowired @Autowired
private DsApiService dsApiService; private DsApiService dsApiService;
@ -168,4 +179,15 @@ public class Test {
e.printStackTrace(); 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