Commit 997ae542 by 王祖波

转化后才清除建联

parent 0d509118
...@@ -14,7 +14,7 @@ public interface ContactOrderService { ...@@ -14,7 +14,7 @@ public interface ContactOrderService {
* *
* @param orderInfoResp * @param orderInfoResp
*/ */
void saveContactOrder(OrderInfoResp orderInfoResp); boolean saveContactOrder(OrderInfoResp orderInfoResp);
/** /**
* 分页查询建联转化信息 * 分页查询建联转化信息
......
...@@ -54,16 +54,16 @@ public class ContactOrderServiceImpl implements ContactOrderService { ...@@ -54,16 +54,16 @@ public class ContactOrderServiceImpl implements ContactOrderService {
private ClerkService clerkService; private ClerkService clerkService;
@Override @Override
public void saveContactOrder(OrderInfoResp orderInfoResp) { public boolean saveContactOrder(OrderInfoResp orderInfoResp) {
Integer orderType = orderInfoResp.getOrderType(); Integer orderType = orderInfoResp.getOrderType();
PlatformChannelEnum platformChannelEnum = PlatformChannelEnum.getEnumByOldOrderType(orderType); PlatformChannelEnum platformChannelEnum = PlatformChannelEnum.getEnumByOldOrderType(orderType);
if (platformChannelEnum == null) { if (platformChannelEnum == null) {
return; return false;
} }
TabContactOrder oldContactOrder = contactOrderMapper.queryByOrderId(orderInfoResp.getOrderId()); TabContactOrder oldContactOrder = contactOrderMapper.queryByOrderId(orderInfoResp.getOrderId());
if (oldContactOrder != null) { if (oldContactOrder != null) {
logger.info("订单已处理,订单id:{}", orderInfoResp.getOrderId()); logger.info("订单已处理,订单id:{}", orderInfoResp.getOrderId());
return; return false;
} }
logger.info("建联处理订单:{}", orderInfoResp.getOrderId()); logger.info("建联处理订单:{}", orderInfoResp.getOrderId());
Date receiptsDate = orderInfoResp.getReceiptsDate(); Date receiptsDate = orderInfoResp.getReceiptsDate();
...@@ -81,7 +81,7 @@ public class ContactOrderServiceImpl implements ContactOrderService { ...@@ -81,7 +81,7 @@ public class ContactOrderServiceImpl implements ContactOrderService {
TabContactLog lastContactLog = contactLogService.getLastByTime(orderInfoResp.getMemberId(), contactBeginTime,receiptsDate); TabContactLog lastContactLog = contactLogService.getLastByTime(orderInfoResp.getMemberId(), contactBeginTime,receiptsDate);
if (lastContactLog == null) { if (lastContactLog == null) {
return; return false;
} }
logger.info("建联转化订单建联信息:{}", JSON.toJSONString(lastContactLog)); logger.info("建联转化订单建联信息:{}", JSON.toJSONString(lastContactLog));
TabContactOrder contactOrder = new TabContactOrder(); TabContactOrder contactOrder = new TabContactOrder();
...@@ -108,6 +108,7 @@ public class ContactOrderServiceImpl implements ContactOrderService { ...@@ -108,6 +108,7 @@ public class ContactOrderServiceImpl implements ContactOrderService {
contactOrder.setPotentialTime(lastContactLog.getPotentialTime()); contactOrder.setPotentialTime(lastContactLog.getPotentialTime());
contactOrder.setEnterpriseId(lastContactLog.getEnterpriseId()); contactOrder.setEnterpriseId(lastContactLog.getEnterpriseId());
contactOrderMapper.insert(contactOrder); contactOrderMapper.insert(contactOrder);
return true;
} }
@Override @Override
......
...@@ -39,8 +39,10 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService { ...@@ -39,8 +39,10 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService {
return ServiceResponse.success(); return ServiceResponse.success();
} }
OrderInfoResp result = serviceResponse.getResult(); OrderInfoResp result = serviceResponse.getResult();
contactOrderService.saveContactOrder(result); boolean contactOrder = contactOrderService.saveContactOrder(result);
contactLogService.clearContactLog(memberId, 1); if (contactOrder) {
contactLogService.clearContactLog(memberId, 1);
}
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -3,6 +3,7 @@ import com.gic.api.base.commons.Page; ...@@ -3,6 +3,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.content.PotentialCustomerDTO; 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.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.MallOrderStatusChangeApiService;
import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService; import com.gic.haoban.manage.api.service.content.PotentialCustomerApiService;
import com.gic.haoban.manage.service.pojo.bo.content.OrderEventMqBO; import com.gic.haoban.manage.service.pojo.bo.content.OrderEventMqBO;
...@@ -37,6 +38,8 @@ public class InteractRecordMessageServiceTest { ...@@ -37,6 +38,8 @@ public class InteractRecordMessageServiceTest {
MallOrderStatusChangeApiService mallOrderStatusChangeApiService; MallOrderStatusChangeApiService mallOrderStatusChangeApiService;
@Autowired @Autowired
private PotentialCustomerApiService potentialCustomerApiService; private PotentialCustomerApiService potentialCustomerApiService;
@Autowired
InteractRecordApiService interactRecordApiService;
String eid = "ff8080815dacd3a2015dacd3ef5c0000"; String eid = "ff8080815dacd3a2015dacd3ef5c0000";
String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b"; String wxEid = "ca66a01b79474c40b3e7c7f93daf1a3b";
...@@ -65,6 +68,11 @@ public class InteractRecordMessageServiceTest { ...@@ -65,6 +68,11 @@ public class InteractRecordMessageServiceTest {
interactRecordMessageService.dealRecord(interactRecordMessageBO); 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 @Test
public void mallOrderStatusChangeTest(){ public void mallOrderStatusChangeTest(){
...@@ -101,4 +109,10 @@ public class InteractRecordMessageServiceTest { ...@@ -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\"}"; 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)); 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