Commit 997ae542 by 王祖波

转化后才清除建联

parent 0d509118
......@@ -14,7 +14,7 @@ public interface ContactOrderService {
*
* @param orderInfoResp
*/
void saveContactOrder(OrderInfoResp orderInfoResp);
boolean saveContactOrder(OrderInfoResp orderInfoResp);
/**
* 分页查询建联转化信息
......
......@@ -54,16 +54,16 @@ public class ContactOrderServiceImpl implements ContactOrderService {
private ClerkService clerkService;
@Override
public void saveContactOrder(OrderInfoResp orderInfoResp) {
public boolean saveContactOrder(OrderInfoResp orderInfoResp) {
Integer orderType = orderInfoResp.getOrderType();
PlatformChannelEnum platformChannelEnum = PlatformChannelEnum.getEnumByOldOrderType(orderType);
if (platformChannelEnum == null) {
return;
return false;
}
TabContactOrder oldContactOrder = contactOrderMapper.queryByOrderId(orderInfoResp.getOrderId());
if (oldContactOrder != null) {
logger.info("订单已处理,订单id:{}", orderInfoResp.getOrderId());
return;
return false;
}
logger.info("建联处理订单:{}", orderInfoResp.getOrderId());
Date receiptsDate = orderInfoResp.getReceiptsDate();
......@@ -81,7 +81,7 @@ public class ContactOrderServiceImpl implements ContactOrderService {
TabContactLog lastContactLog = contactLogService.getLastByTime(orderInfoResp.getMemberId(), contactBeginTime,receiptsDate);
if (lastContactLog == null) {
return;
return false;
}
logger.info("建联转化订单建联信息:{}", JSON.toJSONString(lastContactLog));
TabContactOrder contactOrder = new TabContactOrder();
......@@ -108,6 +108,7 @@ public class ContactOrderServiceImpl implements ContactOrderService {
contactOrder.setPotentialTime(lastContactLog.getPotentialTime());
contactOrder.setEnterpriseId(lastContactLog.getEnterpriseId());
contactOrderMapper.insert(contactOrder);
return true;
}
@Override
......
......@@ -39,8 +39,10 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService {
return ServiceResponse.success();
}
OrderInfoResp result = serviceResponse.getResult();
contactOrderService.saveContactOrder(result);
contactLogService.clearContactLog(memberId, 1);
boolean contactOrder = contactOrderService.saveContactOrder(result);
if (contactOrder) {
contactLogService.clearContactLog(memberId, 1);
}
return ServiceResponse.success();
}
......
......@@ -3,6 +3,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.content.PotentialCustomerDTO;
import com.gic.haoban.manage.api.dto.qdto.content.PotentialCustomerQDTO;
import com.gic.haoban.manage.api.service.content.InteractRecordApiService;
import com.gic.haoban.manage.api.service.content.MallOrderStatusChangeApiService;
import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService;
import com.gic.haoban.manage.service.pojo.bo.content.OrderEventMqBO;
......@@ -37,6 +38,8 @@ public class InteractRecordMessageServiceTest {
MallOrderStatusChangeApiService mallOrderStatusChangeApiService;
@Autowired
private PotentialCustomerApiService potentialCustomerApiService;
@Autowired
InteractRecordApiService interactRecordApiService;
String eid = "ff8080815dacd3a2015dacd3ef5c0000";
String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b";
......@@ -65,6 +68,11 @@ public class InteractRecordMessageServiceTest {
interactRecordMessageService.dealRecord(interactRecordMessageBO);
}
@Test
public void dealMemberOnlineOrder() {
interactRecordApiService.dealMemberOnlineOrder("{\"calculateFlag\":1,\"firstCreate\":1,\"orderType\":13,\"currMainStoreId\":\"ff8080817c2b4c55017c30a4482800d7\",\"orderId\":\"ff80808195db691a01960f0b35a001e3\",\"currMainClerkId\":\"d2b45c6e0af246c7bd62597b62a29127\",\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"onlineOrder\":1,\"cardNo\":\"S202502178000003\",\"mqTraceId\":\"52573625-1-1744009114.352-/cgi-api/order/add_online_store_order_channelOrderInfoParse-472410603_3_0\",\"dubboAttatchmentMap\":\"{\\\"key_dubbo_channel_entrance\\\":\\\"{\\\\\\\"carryInfo\\\\\\\":{\\\\\\\"appKey\\\\\\\":\\\\\\\"wnZ0V1XU\\\\\\\"},\\\\\\\"entranceCode\\\\\\\":\\\\\\\"op\\\\\\\"}\\\",\\\"key_dubbo_channel\\\":\\\"c_pos\\\"}\",\"memberId\":\"ff80808194fdf81b0195035d9d6d006d\"} ");
}
@Test
public void mallOrderStatusChangeTest(){
......@@ -101,4 +109,10 @@ public class InteractRecordMessageServiceTest {
String json = "{\"orderNumber\":\"0230823781099580\",\"toStatus\":2,\"fromStatus\":1,\"orderId\":\"0a84ff17893046e49839fa3c3542bffa\",\"deliveryChannel\":1,\"eventTime\":1692794627733,\"enterpriseId\":\"8a809083802bbf5201804af08b0d0095\",\"businessType\":1,\"mqTraceId\":\"60157-1-1692794627.506-/gic-thirdparty/wxmall_payment_result_notice\",\"memberId\":\"8a808d838995476c0189b55f0ab807f7\"}";
mallOrderStatusChangeApiServiceImpl.sendDelayMessage(JSONObject.parseObject(json, OrderEventMqBO.class));
}
@Test
public void dealWeimoOrder() {
String s = "{\"orderType\":9,\"orderTime\":1744005801000,\"orderId\":\"ff80808195db691a01960ed8d22801dc\",\"enterpriseId\":\"ff8080815dacd3a2015dacd3ef5c0000\",\"mqTraceId\":\"a5441fc6-01ad-4461-b9cb-d5c72f98ad5f\",\"memberId\":\"ff80808194fdf81b0195035d9d6d006d\",\"tableName\":\"tab_gic_eorder\"}";
mallOrderStatusChangeApiServiceImpl.dealWeimoOrder(s);
}
}
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