红圈通接口改造hqtShopId
This commit is contained in:
@@ -348,4 +348,11 @@ public class ShopInfoDAO {
|
|||||||
example.createCriteria().andEqualTo("shopCode", shopCode);
|
example.createCriteria().andEqualTo("shopCode", shopCode);
|
||||||
return shopInfoMapper.selectByExample(example);
|
return shopInfoMapper.selectByExample(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer updateHqtShopId (Long shopId,String hqtShopId){
|
||||||
|
if (shopId==null || StringUtils.isBlank(hqtShopId)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return shopInfoMapper.updateHqtShopId(shopId, hqtShopId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.cool.store.response.MiniShopsResponse;
|
|||||||
import com.cool.store.response.PlatformBuildListResponse;
|
import com.cool.store.response.PlatformBuildListResponse;
|
||||||
import com.cool.store.vo.shop.StageShopCountVO;
|
import com.cool.store.vo.shop.StageShopCountVO;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import tk.mybatis.mapper.common.Mapper;
|
import tk.mybatis.mapper.common.Mapper;
|
||||||
|
|
||||||
@@ -147,4 +148,6 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
|||||||
List<IsCreateStoreDTO> selectIsCreateStore();
|
List<IsCreateStoreDTO> selectIsCreateStore();
|
||||||
Integer updateManagerRegionId(@Param("list") List<ShopInfoDO> shopList);
|
Integer updateManagerRegionId(@Param("list") List<ShopInfoDO> shopList);
|
||||||
Integer getNumByShopCode(@Param("shopCode") String shopCode);
|
Integer getNumByShopCode(@Param("shopCode") String shopCode);
|
||||||
|
|
||||||
|
Integer updateHqtShopId(@Param("shopId") Long shopId,@Param("hqtShopId") String hqtShopId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
<result column="district_code" jdbcType="INTEGER" property="districtCode"/>
|
<result column="district_code" jdbcType="INTEGER" property="districtCode"/>
|
||||||
<result column="manager_region_id" jdbcType="BIGINT" property="managerRegionId"/>
|
<result column="manager_region_id" jdbcType="BIGINT" property="managerRegionId"/>
|
||||||
<result column="shop_decoration_attributes" jdbcType="INTEGER" property="shopDecorationAttributes"/>
|
<result column="shop_decoration_attributes" jdbcType="INTEGER" property="shopDecorationAttributes"/>
|
||||||
|
<result column="hqt_shop_id" jdbcType="VARCHAR" property="hqtShopId"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="allColumn">
|
<sql id="allColumn">
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
shop_code, store_num, shop_manager_user_id, supervisor_user_id,
|
shop_code, store_num, shop_manager_user_id, supervisor_user_id,
|
||||||
plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time,
|
plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time,
|
||||||
join_mode,detail_address,franchise_brand,development_manager,want_shop_area_id,investment_manager,shop_status,create_user_id,update_user_id,store_type
|
join_mode,detail_address,franchise_brand,development_manager,want_shop_area_id,investment_manager,shop_status,create_user_id,update_user_id,store_type
|
||||||
, province,province_code,city,city_code,district,district_code,manager_region_id,shop_decoration_attributes
|
, province,province_code,city,city_code,district,district_code,manager_region_id,shop_decoration_attributes,hqt_shop_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||||
@@ -590,4 +591,7 @@
|
|||||||
update xfsg_shop_info set manager_region_id = #{item.managerRegionId} where id = #{item.id}
|
update xfsg_shop_info set manager_region_id = #{item.managerRegionId} where id = #{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateHqtShopId">
|
||||||
|
update xfsg_shop_info set hqt_shop_id = #{hqtShopId} where id = #{shopId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -9,7 +9,6 @@ import lombok.Data;
|
|||||||
* @注释:
|
* @注释:
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
||||||
public class HqtTokenDTO {
|
public class HqtTokenDTO {
|
||||||
//访问令牌
|
//访问令牌
|
||||||
private String access_token;
|
private String access_token;
|
||||||
|
|||||||
@@ -155,4 +155,7 @@ public class ShopInfoDO {
|
|||||||
// 门店装修属性
|
// 门店装修属性
|
||||||
@Column(name = "shop_decoration_attributes")
|
@Column(name = "shop_decoration_attributes")
|
||||||
private Integer shopDecorationAttributes;
|
private Integer shopDecorationAttributes;
|
||||||
|
//红圈通门店id
|
||||||
|
@Column(name = "hqt_shop_id")
|
||||||
|
private String hqtShopId;
|
||||||
}
|
}
|
||||||
@@ -14,13 +14,13 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class ConfirmQuotationRequest {
|
public class ConfirmQuotationRequest {
|
||||||
private String shopCode;
|
private String hqtShopId;
|
||||||
private String quotationSheetId;
|
private String quotationSheetId;
|
||||||
@ApiModelProperty("0:拒绝,1:通过")
|
@ApiModelProperty("0:拒绝,1:通过")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
public Boolean check(){
|
public Boolean check(){
|
||||||
if (StringUtils.isAnyBlank(shopCode,quotationSheetId)){
|
if (StringUtils.isAnyBlank(hqtShopId,quotationSheetId)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Objects.isNull(status)){
|
if (Objects.isNull(status)){
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class HqtBuildRequest {
|
public class HqtBuildRequest {
|
||||||
|
private Long shopId;
|
||||||
//门店编码
|
//门店编码
|
||||||
private String shopCode;
|
private String shopCode;
|
||||||
//门店名称
|
//门店名称
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ import java.util.Objects;
|
|||||||
@Data
|
@Data
|
||||||
public class HqtPartnerAcceptanceRequest {
|
public class HqtPartnerAcceptanceRequest {
|
||||||
|
|
||||||
private String shopCode;
|
private String hqtShopId;
|
||||||
//加盟商满意度 3-差,4-一般,5-好,6-非常好 对应红圈通 回访结果分类
|
//加盟商满意度 3-差,4-一般,5-好,6-非常好 对应红圈通 回访结果分类
|
||||||
private Integer satisfaction;
|
private Integer satisfaction;
|
||||||
//加盟商评语
|
//加盟商评语
|
||||||
private String comment;
|
private String comment;
|
||||||
|
|
||||||
public Boolean check() {
|
public Boolean check() {
|
||||||
if (StringUtils.isAnyBlank(shopCode)){
|
if (StringUtils.isAnyBlank(hqtShopId)){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Objects.isNull(satisfaction)){
|
if (Objects.isNull(satisfaction)){
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.cool.store.response;
|
package com.cool.store.response;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,7 +9,6 @@ import lombok.Data;
|
|||||||
* @注释:
|
* @注释:
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
||||||
public class HqtAPIResponse {
|
public class HqtAPIResponse {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ public class DecorationServiceImpl implements DecorationService {
|
|||||||
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(request.getShopId());
|
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(request.getShopId());
|
||||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122);
|
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_122);
|
||||||
HqtPartnerAcceptanceRequest hqtPartnerAcceptanceRequest = new HqtPartnerAcceptanceRequest();
|
HqtPartnerAcceptanceRequest hqtPartnerAcceptanceRequest = new HqtPartnerAcceptanceRequest();
|
||||||
hqtPartnerAcceptanceRequest.setShopCode(shopInfoDO.getShopCode());
|
hqtPartnerAcceptanceRequest.setHqtShopId(shopInfoDO.getHqtShopId());
|
||||||
hqtPartnerAcceptanceRequest.setSatisfaction(request.getSatisfaction());
|
hqtPartnerAcceptanceRequest.setSatisfaction(request.getSatisfaction());
|
||||||
hqtPartnerAcceptanceRequest.setComment(request.getPartnerAcceptance().getRemark());
|
hqtPartnerAcceptanceRequest.setComment(request.getPartnerAcceptance().getRemark());
|
||||||
hqtAPIService.hqtPartnerAcceptance(hqtPartnerAcceptanceRequest);
|
hqtAPIService.hqtPartnerAcceptance(hqtPartnerAcceptanceRequest);
|
||||||
@@ -761,7 +761,7 @@ public class DecorationServiceImpl implements DecorationService {
|
|||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||||
//推送给HQT
|
//推送给HQT
|
||||||
ConfirmQuotationRequest confirmQuotationRequest = new ConfirmQuotationRequest();
|
ConfirmQuotationRequest confirmQuotationRequest = new ConfirmQuotationRequest();
|
||||||
confirmQuotationRequest.setShopCode(shopInfo.getShopCode());
|
confirmQuotationRequest.setHqtShopId(shopInfo.getHqtShopId());
|
||||||
confirmQuotationRequest.setQuotationSheetId(decoration.getQuotationSheetId());
|
confirmQuotationRequest.setQuotationSheetId(decoration.getQuotationSheetId());
|
||||||
confirmQuotationRequest.setStatus(CommonConstants.ONE);
|
confirmQuotationRequest.setStatus(CommonConstants.ONE);
|
||||||
hqtAPIService.confirmQuotation(confirmQuotationRequest);
|
hqtAPIService.confirmQuotation(confirmQuotationRequest);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.cool.store.service.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.dao.BigRegionDAO;
|
import com.cool.store.dao.BigRegionDAO;
|
||||||
|
import com.cool.store.dao.ShopInfoDAO;
|
||||||
import com.cool.store.dto.HqtTokenDTO;
|
import com.cool.store.dto.HqtTokenDTO;
|
||||||
import com.cool.store.entity.BigRegionDO;
|
import com.cool.store.entity.BigRegionDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
@@ -57,8 +58,7 @@ public class HqtAPIServiceImpl implements HqtAPIService {
|
|||||||
@Resource
|
@Resource
|
||||||
OkHttpClient okHttpClient;
|
OkHttpClient okHttpClient;
|
||||||
@Resource
|
@Resource
|
||||||
ObjectMapper objectMapper;
|
private ShopInfoDAO shopInfoDAO;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BigRegionDAO bigRegionDAO;
|
private BigRegionDAO bigRegionDAO;
|
||||||
|
|
||||||
@@ -85,7 +85,8 @@ public class HqtAPIServiceImpl implements HqtAPIService {
|
|||||||
//资源服务URL
|
//资源服务URL
|
||||||
String url = hqtToken.getEndPoint();
|
String url = hqtToken.getEndPoint();
|
||||||
String requestUrl = url + "/v1/data/objects/project3X";
|
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)
|
//构建CRM系统门店编码(红圈通门店id)
|
||||||
HqtQuotationSheetAPIRequest.Field1__c field1__c = new HqtQuotationSheetAPIRequest.Field1__c();
|
HqtQuotationSheetAPIRequest.Field1__c field1__c = new HqtQuotationSheetAPIRequest.Field1__c();
|
||||||
field1__c.setCode(request.getShopCode());
|
field1__c.setCode(request.getHqtShopId());
|
||||||
|
|
||||||
HqtTokenDTO hqtToken = this.getHqtToken();
|
HqtTokenDTO hqtToken = this.getHqtToken();
|
||||||
String requestUrl = hqtToken.getEndPoint() + "/v1/data/objects/CustomObject77__c";
|
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.setLabel(satisfactionEnum.getName());
|
||||||
field1__c.setName(satisfactionEnum.getHqtCode());
|
field1__c.setName(satisfactionEnum.getHqtCode());
|
||||||
}
|
}
|
||||||
//门店编码
|
//红圈通门店id
|
||||||
HqtPartnerAcceptanceAPIRequest.Field13__c field13__c = new HqtPartnerAcceptanceAPIRequest.Field13__c();
|
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.setField1__c(field1__c);
|
||||||
apiRequest.setField13__c(field13__c);
|
apiRequest.setField13__c(field13__c);
|
||||||
@@ -183,7 +184,7 @@ public class HqtAPIServiceImpl implements HqtAPIService {
|
|||||||
}
|
}
|
||||||
String responseBody = response.body().string();
|
String responseBody = response.body().string();
|
||||||
log.info("请求成功responseBody:{}",JSONObject.toJSONString(responseBody));
|
log.info("请求成功responseBody:{}",JSONObject.toJSONString(responseBody));
|
||||||
HqtAPIResponse hqtAPIResponse = objectMapper.readValue(responseBody, HqtAPIResponse.class);
|
HqtAPIResponse hqtAPIResponse = JSONObject.parseObject(responseBody, HqtAPIResponse.class);
|
||||||
return hqtAPIResponse;
|
return hqtAPIResponse;
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
@@ -276,7 +277,7 @@ public class HqtAPIServiceImpl implements HqtAPIService {
|
|||||||
"HTTP请求失败,状态码: " + response.code());
|
"HTTP请求失败,状态码: " + response.code());
|
||||||
}
|
}
|
||||||
String responseBody = response.body().string();
|
String responseBody = response.body().string();
|
||||||
HqtTokenDTO hqtTokenDTO = objectMapper.readValue(responseBody, HqtTokenDTO.class);
|
HqtTokenDTO hqtTokenDTO = JSONObject.parseObject(responseBody, HqtTokenDTO.class);
|
||||||
return hqtTokenDTO;
|
return hqtTokenDTO;
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
|
|||||||
bigRegionDO = hqtAPIService.pushHqtRegion(bigRegionDO);
|
bigRegionDO = hqtAPIService.pushHqtRegion(bigRegionDO);
|
||||||
}
|
}
|
||||||
HqtBuildRequest request = new HqtBuildRequest();
|
HqtBuildRequest request = new HqtBuildRequest();
|
||||||
|
request.setShopId(shopId);
|
||||||
request.setShopCode(shopInfo.getShopCode());
|
request.setShopCode(shopInfo.getShopCode());
|
||||||
request.setShopName(shopInfo.getShopName());
|
request.setShopName(shopInfo.getShopName());
|
||||||
request.setShopDecorationAttributes(shopInfo.getShopDecorationAttributes());
|
request.setShopDecorationAttributes(shopInfo.getShopDecorationAttributes());
|
||||||
|
|||||||
Reference in New Issue
Block a user