红圈通接口改造hqtShopId

This commit is contained in:
shuo.wang
2025-08-06 09:25:23 +08:00
parent b7c175c1a4
commit eb9d469833
12 changed files with 35 additions and 18 deletions

View File

@@ -376,7 +376,7 @@ public class DecorationServiceImpl implements DecorationService {
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(request.getShopId());
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122);
HqtPartnerAcceptanceRequest hqtPartnerAcceptanceRequest = new HqtPartnerAcceptanceRequest();
hqtPartnerAcceptanceRequest.setShopCode(shopInfoDO.getShopCode());
hqtPartnerAcceptanceRequest.setHqtShopId(shopInfoDO.getHqtShopId());
hqtPartnerAcceptanceRequest.setSatisfaction(request.getSatisfaction());
hqtPartnerAcceptanceRequest.setComment(request.getPartnerAcceptance().getRemark());
hqtAPIService.hqtPartnerAcceptance(hqtPartnerAcceptanceRequest);
@@ -761,7 +761,7 @@ public class DecorationServiceImpl implements DecorationService {
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
//推送给HQT
ConfirmQuotationRequest confirmQuotationRequest = new ConfirmQuotationRequest();
confirmQuotationRequest.setShopCode(shopInfo.getShopCode());
confirmQuotationRequest.setHqtShopId(shopInfo.getHqtShopId());
confirmQuotationRequest.setQuotationSheetId(decoration.getQuotationSheetId());
confirmQuotationRequest.setStatus(CommonConstants.ONE);
hqtAPIService.confirmQuotation(confirmQuotationRequest);

View File

@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dao.BigRegionDAO;
import com.cool.store.dao.ShopInfoDAO;
import com.cool.store.dto.HqtTokenDTO;
import com.cool.store.entity.BigRegionDO;
import com.cool.store.enums.ErrorCodeEnum;
@@ -57,8 +58,7 @@ public class HqtAPIServiceImpl implements HqtAPIService {
@Resource
OkHttpClient okHttpClient;
@Resource
ObjectMapper objectMapper;
private ShopInfoDAO shopInfoDAO;
@Resource
private BigRegionDAO bigRegionDAO;
@@ -85,7 +85,8 @@ public class HqtAPIServiceImpl implements HqtAPIService {
//资源服务URL
String url = hqtToken.getEndPoint();
String requestUrl = url + "/v1/data/objects/project3X";
sendPostRequest(JSONObject.toJSONString(hqtBuildAPIRequest), requestUrl, hqtToken);
HqtAPIResponse hqtAPIResponse = sendPostRequest(JSONObject.toJSONString(hqtBuildAPIRequest), requestUrl, hqtToken);
shopInfoDAO.updateHqtShopId(request.getShopId(), hqtAPIResponse.getData());
}
@@ -100,7 +101,7 @@ public class HqtAPIServiceImpl implements HqtAPIService {
}
//构建CRM系统门店编码红圈通门店id
HqtQuotationSheetAPIRequest.Field1__c field1__c = new HqtQuotationSheetAPIRequest.Field1__c();
field1__c.setCode(request.getShopCode());
field1__c.setCode(request.getHqtShopId());
HqtTokenDTO hqtToken = this.getHqtToken();
String requestUrl = hqtToken.getEndPoint() + "/v1/data/objects/CustomObject77__c";
@@ -140,9 +141,9 @@ public class HqtAPIServiceImpl implements HqtAPIService {
field1__c.setLabel(satisfactionEnum.getName());
field1__c.setName(satisfactionEnum.getHqtCode());
}
//门店编码
//红圈通门店id
HqtPartnerAcceptanceAPIRequest.Field13__c field13__c = new HqtPartnerAcceptanceAPIRequest.Field13__c();
field13__c.setCode(request.getShopCode());
field13__c.setCode(request.getHqtShopId());
apiRequest.setField1__c(field1__c);
apiRequest.setField13__c(field13__c);
@@ -183,7 +184,7 @@ public class HqtAPIServiceImpl implements HqtAPIService {
}
String responseBody = response.body().string();
log.info("请求成功responseBody:{}",JSONObject.toJSONString(responseBody));
HqtAPIResponse hqtAPIResponse = objectMapper.readValue(responseBody, HqtAPIResponse.class);
HqtAPIResponse hqtAPIResponse = JSONObject.parseObject(responseBody, HqtAPIResponse.class);
return hqtAPIResponse;
} catch (ServiceException e) {
throw e;
@@ -276,7 +277,7 @@ public class HqtAPIServiceImpl implements HqtAPIService {
"HTTP请求失败状态码: " + response.code());
}
String responseBody = response.body().string();
HqtTokenDTO hqtTokenDTO = objectMapper.readValue(responseBody, HqtTokenDTO.class);
HqtTokenDTO hqtTokenDTO = JSONObject.parseObject(responseBody, HqtTokenDTO.class);
return hqtTokenDTO;
} catch (ServiceException e) {
throw e;

View File

@@ -303,6 +303,7 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
bigRegionDO = hqtAPIService.pushHqtRegion(bigRegionDO);
}
HqtBuildRequest request = new HqtBuildRequest();
request.setShopId(shopId);
request.setShopCode(shopInfo.getShopCode());
request.setShopName(shopInfo.getShopName());
request.setShopDecorationAttributes(shopInfo.getShopDecorationAttributes());