红圈通接口
This commit is contained in:
@@ -62,7 +62,9 @@ public enum ErrorCodeEnum {
|
||||
DATA_CONVERT_ERROR(400002, "日期转换异常!", null),
|
||||
PARENT_NODE_NOT_EXIST(400002, "父节点不存在", null),
|
||||
LOGIN_ERROR_MOBILE_ERROR(418, "登录失败 获取手机号失败!!", null),
|
||||
|
||||
//红圈通
|
||||
HQT_SHOP_DECORATION_ATTRIBUTES(1022000, "获取红圈通装修属性错误", null),
|
||||
HQT_PARAMS_ERROR(1022001, "构建红圈通请求参数错误", null),
|
||||
|
||||
LINE_ID_IS_NOT_EXIST(500001, "线索信息不存在!", null),
|
||||
WORK_FLOW_STAGE_PASS_ERROR(500002, "审核失败,非对应阶段!", null),
|
||||
|
||||
@@ -14,17 +14,20 @@ import java.util.stream.Collectors;
|
||||
* @注释:
|
||||
*/
|
||||
public enum FranchiseBrandEnum {
|
||||
ZXJP(1,"正新鸡排"),
|
||||
ZXSMZ(2,"正新三明治"),
|
||||
ZJS(3,"正烧记"),
|
||||
DGMX(4,"大鼓米线"),
|
||||
CXM(5,"串小妹"),
|
||||
MZG(6,"茂掌柜");
|
||||
ZXJP(1,"正新鸡排","option486"),
|
||||
ZXSMZ(2,"正新三明治","option622"),
|
||||
ZJS(3,"正烧记","option488"),
|
||||
DGMX(4,"大鼓米线","option624"),
|
||||
CXM(5,"串小妹","option626"),
|
||||
MZG(6,"茂掌柜","option490");
|
||||
private int code;
|
||||
private String desc;
|
||||
FranchiseBrandEnum(int code, String desc) {
|
||||
//红圈通code
|
||||
private String hqtCode;
|
||||
FranchiseBrandEnum(int code, String desc,String hqtCode) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
this.hqtCode = hqtCode;
|
||||
}
|
||||
public int getCode() {
|
||||
return code;
|
||||
@@ -32,6 +35,11 @@ public enum FranchiseBrandEnum {
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getHqtCode() {
|
||||
return hqtCode;
|
||||
}
|
||||
|
||||
public static String getDescByCode(String code) {
|
||||
if (StringUtils.isBlank(code)){
|
||||
return null;
|
||||
@@ -44,4 +52,16 @@ public enum FranchiseBrandEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static FranchiseBrandEnum getEnumByCode(Integer code) {
|
||||
if (code == null){
|
||||
return null;
|
||||
}
|
||||
for (FranchiseBrandEnum e : FranchiseBrandEnum.values()) {
|
||||
if (code == e.getCode()) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.cool.store.enums.HqtEnum;
|
||||
|
||||
import com.cool.store.enums.ShopDecorationAttributesEnum;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/07/29/15:34
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum HqtShopDecorationAttributesEnum {
|
||||
NEW_OPEN(ShopDecorationAttributesEnum.NEW_OPEN,"o1","新开店"),
|
||||
RENEWAL(ShopDecorationAttributesEnum.RENEWAL,"o2","老店翻新"),
|
||||
RELOCATION(ShopDecorationAttributesEnum.RELOCATION,"option46","迁址");
|
||||
private ShopDecorationAttributesEnum shopDecorationAttributesEnum;
|
||||
private String code;
|
||||
private String msg;
|
||||
|
||||
HqtShopDecorationAttributesEnum(ShopDecorationAttributesEnum shopDecorationAttributesEnum, String code, String msg) {
|
||||
this.shopDecorationAttributesEnum = shopDecorationAttributesEnum;
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
public static HqtShopDecorationAttributesEnum getHqtShopDecorationAttributesEnumByShopDecorationAttributesEnum(ShopDecorationAttributesEnum shopDecorationAttributesEnum){
|
||||
if (shopDecorationAttributesEnum == null){
|
||||
return null;
|
||||
}
|
||||
for (HqtShopDecorationAttributesEnum value : HqtShopDecorationAttributesEnum.values()) {
|
||||
if (value.shopDecorationAttributesEnum.equals(shopDecorationAttributesEnum)){
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ShopDecorationAttributesEnum getShopDecorationAttributesEnum() {
|
||||
return shopDecorationAttributesEnum;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.cool.store.enums.HqtEnum;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/07/31/10:15
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum HqtSignFeeEnum {
|
||||
/**
|
||||
* field8__c 是否已收设计费
|
||||
* 是:option44
|
||||
* 否:option45
|
||||
*/
|
||||
YES("option44", "是", 1),
|
||||
NO("option45", "否", 0);
|
||||
private String code;
|
||||
private String msg;
|
||||
private Integer value;
|
||||
|
||||
HqtSignFeeEnum(String code, String msg, Integer value) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getMsgByCode(String code) {
|
||||
for (HqtSignFeeEnum value : HqtSignFeeEnum.values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value.getMsg();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static HqtSignFeeEnum getCodeByValue(Integer value) {
|
||||
for (HqtSignFeeEnum hqtSignFeeEnum : HqtSignFeeEnum.values()) {
|
||||
if (hqtSignFeeEnum.getValue().equals(value)) {
|
||||
return hqtSignFeeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/07/31/14:46
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
public enum SatisfactionEnum {
|
||||
//满意度0-低,1-中,2-高', 3-差,4-一般,5-好,6-非常好
|
||||
LOW(0, "低",""),
|
||||
MIDDLE(1, "中",""),
|
||||
HIGH(2, "高",""),
|
||||
BAD(3, "差","option142"),
|
||||
NORMAL(4, "一般","option141"),
|
||||
GOOD(5, "好","option140"),
|
||||
EXCELLENT(6, "非常好","option139");
|
||||
private Integer code;
|
||||
private String name;
|
||||
//红圈通code
|
||||
private String hqtCode;
|
||||
SatisfactionEnum(Integer code, String name, String hqtCode) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
this.hqtCode = hqtCode;
|
||||
}
|
||||
public static SatisfactionEnum getEnumByCode(Integer code) {
|
||||
for (SatisfactionEnum satisfactionEnum : SatisfactionEnum.values()) {
|
||||
if (satisfactionEnum.code.equals(code)) {
|
||||
return satisfactionEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getHqtCode() {
|
||||
return hqtCode;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,12 @@ public enum ShopDecorationAttributesEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static ShopDecorationAttributesEnum getShopDecorationAttributesEnumByCode(Integer code) {
|
||||
for (ShopDecorationAttributesEnum value : ShopDecorationAttributesEnum.values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,5 +74,8 @@ public class BigRegionDAO {
|
||||
example.setOrderByClause("id ASC limit 1");
|
||||
return bigRegionMapper.selectOneByExample(example);
|
||||
}
|
||||
public Integer updateHqtDate(BigRegionDO bigRegionDO){
|
||||
return bigRegionMapper.updateHqtDate(bigRegionDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,4 +27,6 @@ public interface BigRegionMapper extends Mapper<BigRegionDO> {
|
||||
BigRegionDO queryOrgInfoByBigRegionAndJoinMode(Long regionId,Integer joinMode);
|
||||
|
||||
List<BigRegionDTO> queryBigRegion(@Param("request") QueryBigRegionRequest queryBigRegionRequest);
|
||||
|
||||
Integer updateHqtDate(BigRegionDO bigRegionDO);
|
||||
}
|
||||
@@ -16,7 +16,15 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="store_manage_region_id" jdbcType="BIGINT" property="storeManageRegionId" />
|
||||
<result column="hqt_region_code" jdbcType="VARCHAR" property="hqtRegionCode" />
|
||||
<result column="hqt_region_name" jdbcType="VARCHAR" property="hqtRegionName" />
|
||||
</resultMap>
|
||||
<update id="updateHqtDate">
|
||||
update xfsg_big_region
|
||||
set hqt_region_code = #{hqtRegionCode},
|
||||
hqt_region_name = #{hqtRegionName}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="queryAllBigRegion" resultType="com.cool.store.dto.region.BigRegionDTO">
|
||||
|
||||
@@ -10,11 +10,14 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class HqtTokenDTO {
|
||||
|
||||
//访问令牌
|
||||
private String access_token;
|
||||
//令牌类型
|
||||
private String token_type;
|
||||
//过期时间,单位为秒
|
||||
private Long expires_in;
|
||||
private String scope;
|
||||
//资源服务URL
|
||||
private String endPoint;
|
||||
private String client_id;
|
||||
|
||||
|
||||
@@ -63,9 +63,20 @@ public class BigRegionDO {
|
||||
//区域对应的管理区域
|
||||
@Column(name = "store_manage_region_id")
|
||||
private Long storeManageRegionId;
|
||||
|
||||
// 红圈通区域编码
|
||||
@Column(name ="hqt_region_code")
|
||||
private String hqtRegionCode;
|
||||
// 红圈通区域名称
|
||||
@Column(name = "hqt_region_name")
|
||||
private String hqtRegionName;
|
||||
|
||||
public String getHqtRegionName() {
|
||||
return hqtRegionName;
|
||||
}
|
||||
|
||||
public void setHqtRegionName(String hqtRegionName) {
|
||||
this.hqtRegionName = hqtRegionName;
|
||||
}
|
||||
|
||||
public String getHqtRegionCode() {
|
||||
return hqtRegionCode;
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Project3XEntity {
|
||||
|
||||
/**
|
||||
* projectNo 门店编码
|
||||
*/
|
||||
@JsonProperty("projectNo")
|
||||
private String projectNo;
|
||||
|
||||
/**
|
||||
* name 店名
|
||||
*/
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* field13__c 门店属性
|
||||
* 新开店:o1
|
||||
* 老店翻新:o2
|
||||
* 老店新开:o5
|
||||
* 迁址:option46
|
||||
* 二次设计:o3
|
||||
* 维修改造: o4
|
||||
*/
|
||||
@JsonProperty("field13__c")
|
||||
private Field13__c field13__c;
|
||||
|
||||
/**
|
||||
* field124__c 所属片区
|
||||
*/
|
||||
@JsonProperty("field124__c")
|
||||
private Field124__c field124__c;
|
||||
|
||||
|
||||
/**
|
||||
* field94__c 所属督导
|
||||
*/
|
||||
@JsonProperty("field94__c")
|
||||
private String field94__c;
|
||||
|
||||
|
||||
/**
|
||||
* field5__c 联系人 (老板)
|
||||
*/
|
||||
@JsonProperty("field5__c")
|
||||
private String field5__c;
|
||||
|
||||
/**
|
||||
* field62__c 联系人手机号
|
||||
*/
|
||||
@JsonProperty("field62__c")
|
||||
private String field62__c;
|
||||
|
||||
/**
|
||||
* field123__c 品牌
|
||||
* 正新鸡排:option486
|
||||
* 正烧记:option488
|
||||
* 茂掌柜:option490
|
||||
* 正新三明治:option622
|
||||
* 大鼓米线:option624
|
||||
* 串小妹:option626
|
||||
*/
|
||||
@JsonProperty("field123__c")
|
||||
private Field123__c field123__c;
|
||||
|
||||
|
||||
/**
|
||||
* field4__c 督导手机号
|
||||
*/
|
||||
@JsonProperty("field4__c")
|
||||
private String field4__c;
|
||||
|
||||
/**
|
||||
* street 详细地址
|
||||
*/
|
||||
@JsonProperty("street")
|
||||
private String street;
|
||||
|
||||
|
||||
/**
|
||||
* field8__c 是否已收设计费
|
||||
* 是:option44
|
||||
* 否:option45
|
||||
*/
|
||||
@JsonProperty("field8__c")
|
||||
private Field8__c field8__c;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* field123__c 对象
|
||||
*/
|
||||
@Data
|
||||
class Field123__c {
|
||||
@JsonProperty("defaultItem")
|
||||
private Boolean defaultItem;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("label")
|
||||
private String label;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("path")
|
||||
private String path;
|
||||
}
|
||||
|
||||
/**
|
||||
* field124__c 对象
|
||||
*/
|
||||
@Data
|
||||
class Field124__c {
|
||||
@JsonProperty("code")
|
||||
private String code;
|
||||
|
||||
@JsonProperty("bizType")
|
||||
private String bizType;
|
||||
|
||||
@JsonProperty("metaName")
|
||||
private String metaName;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
}
|
||||
|
||||
/**
|
||||
* field8__c 对象
|
||||
*/
|
||||
@Data
|
||||
class Field8__c {
|
||||
@JsonProperty("defaultItem")
|
||||
private Boolean defaultItem;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("label")
|
||||
private String label;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
}
|
||||
|
||||
/**
|
||||
* field13__c 对象
|
||||
*/
|
||||
@Data
|
||||
class Field13__c {
|
||||
@JsonProperty("defaultItem")
|
||||
private Boolean defaultItem;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("label")
|
||||
private String label;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class ShopInfoDO {
|
||||
//所属管理区域
|
||||
@Column(name = "manager_region_id")
|
||||
private Long managerRegionId;
|
||||
|
||||
// 门店装修属性
|
||||
@Column(name = "shop_decoration_attributes")
|
||||
private Integer shopDecorationAttributes;
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/07/23/18:40
|
||||
@@ -15,4 +18,14 @@ public class ConfirmQuotationRequest {
|
||||
private String quotationSheetId;
|
||||
@ApiModelProperty("0:拒绝,1:通过")
|
||||
private Integer status;
|
||||
|
||||
public Boolean check(){
|
||||
if (StringUtils.isAnyBlank(shopCode,quotationSheetId)){
|
||||
return false;
|
||||
}
|
||||
if (Objects.isNull(status)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
@@ -10,15 +13,40 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class HqtBuildRequest {
|
||||
//门店编码
|
||||
private String shopCode;
|
||||
//门店名称
|
||||
private String shopName;
|
||||
// 门店装修属性
|
||||
private Integer shopDecorationAttributes;
|
||||
//红圈通区域编码
|
||||
private String hqtRegionCode;
|
||||
//红 圈通区域名称
|
||||
private String hqtRegionName;
|
||||
//督导名称
|
||||
private String supervisorName;
|
||||
private String partnershipSignatoryFirst;
|
||||
private String partnershipSignatoryFirstMobile;
|
||||
private String shopAddress;
|
||||
private Integer isPayDesignFee;
|
||||
private Integer franchiseBrand;
|
||||
//督导手机号
|
||||
private String supervisorMobile;
|
||||
//签约人1
|
||||
private String partnershipSignatoryFirst;
|
||||
//签约人1手机号
|
||||
private String partnershipSignatoryFirstMobile;
|
||||
//门店地址
|
||||
private String shopAddress;
|
||||
//是否已收设计费 0-否 1- 是
|
||||
private Integer isPayDesignFee;
|
||||
//加盟品牌
|
||||
private Integer franchiseBrand;
|
||||
|
||||
public Boolean check(){
|
||||
if (StringUtils.isAnyBlank(shopCode,shopName,hqtRegionCode,hqtRegionName,supervisorName,
|
||||
supervisorMobile,partnershipSignatoryFirst,partnershipSignatoryFirstMobile,shopAddress)){
|
||||
return false;
|
||||
}
|
||||
if (Objects.isNull(isPayDesignFee)|| Objects.isNull(franchiseBrand)|| Objects.isNull(shopDecorationAttributes)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
@@ -12,6 +15,18 @@ import lombok.Data;
|
||||
public class HqtPartnerAcceptanceRequest {
|
||||
|
||||
private String shopCode;
|
||||
//加盟商满意度 3-差,4-一般,5-好,6-非常好 对应红圈通 回访结果分类
|
||||
private Integer satisfaction;
|
||||
//加盟商评语
|
||||
private String comment;
|
||||
|
||||
public Boolean check() {
|
||||
if (StringUtils.isAnyBlank(shopCode)){
|
||||
return false;
|
||||
}
|
||||
if (Objects.isNull(satisfaction)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
package com.cool.store.request.hqt;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HqtBuildAPIRequest {
|
||||
|
||||
/**
|
||||
* projectNo 门店编码
|
||||
*/
|
||||
@JsonProperty("projectNo")
|
||||
private String projectNo;
|
||||
|
||||
/**
|
||||
* name 店名
|
||||
*/
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* field13__c 门店属性
|
||||
* 新开店:o1
|
||||
* 老店翻新:o2
|
||||
* 老店新开:o5
|
||||
* 迁址:option46
|
||||
* 二次设计:o3
|
||||
* 维修改造: o4
|
||||
*/
|
||||
@JsonProperty("field13__c")
|
||||
private Field13__c field13__c;
|
||||
|
||||
/**
|
||||
* field124__c 所属片区
|
||||
*/
|
||||
@JsonProperty("field124__c")
|
||||
private Field124__c field124__c;
|
||||
|
||||
|
||||
/**
|
||||
* field94__c 所属督导
|
||||
*/
|
||||
@JsonProperty("field94__c")
|
||||
private String field94__c;
|
||||
|
||||
|
||||
/**
|
||||
* field5__c 联系人 (老板)
|
||||
*/
|
||||
@JsonProperty("field5__c")
|
||||
private String field5__c;
|
||||
|
||||
/**
|
||||
* field62__c 联系人(老板)手机号
|
||||
*/
|
||||
@JsonProperty("field62__c")
|
||||
private String field62__c;
|
||||
|
||||
|
||||
/**
|
||||
* street 详细地址
|
||||
*/
|
||||
@JsonProperty("street")
|
||||
private String street;
|
||||
|
||||
|
||||
/**
|
||||
* field8__c 是否已收设计费
|
||||
* 是:option44
|
||||
* 否:option45
|
||||
*/
|
||||
@JsonProperty("field8__c")
|
||||
private Field8__c field8__c;
|
||||
/**
|
||||
* field123__c 品牌
|
||||
* 正新鸡排:option486
|
||||
* 正烧记:option488
|
||||
* 茂掌柜:option490
|
||||
* 正新三明治:option622
|
||||
* 大鼓米线:option624
|
||||
* 串小妹:option626
|
||||
*/
|
||||
@JsonProperty("field123__c")
|
||||
private Field123__c field123__c;
|
||||
|
||||
|
||||
/**
|
||||
* field4__c 督导手机号
|
||||
*/
|
||||
@JsonProperty("field4__c")
|
||||
private String field4__c;
|
||||
|
||||
@Data
|
||||
public static class Field124__c {
|
||||
/**
|
||||
* @description: 红圈通 区域编码
|
||||
*/
|
||||
@JsonProperty("code")
|
||||
private String code;
|
||||
|
||||
@JsonProperty("bizType")
|
||||
/**
|
||||
* @description:默认值
|
||||
*/
|
||||
private String bizType = "202684487985";
|
||||
/**
|
||||
* @description:默认值
|
||||
*/
|
||||
@JsonProperty("metaName")
|
||||
private String metaName = "CustomObject494__c";
|
||||
/**
|
||||
* @description: 红圈通 区域名称
|
||||
*/
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Field123__c {
|
||||
@JsonProperty("defaultItem")
|
||||
/**
|
||||
* @description: 默认值
|
||||
*/
|
||||
private Boolean defaultItem = false;
|
||||
/**
|
||||
* field123__c 品牌
|
||||
* 正新鸡排:option486
|
||||
* 正烧记:option488
|
||||
* 茂掌柜:option490
|
||||
* 正新三明治:option622
|
||||
* 大鼓米线:option624
|
||||
* 串小妹:option626
|
||||
*/
|
||||
@JsonProperty("id")
|
||||
/**
|
||||
* @description: 如该值=ConstantGroup485/option486
|
||||
* 默认设置了前缀ConstantGroup485/
|
||||
*/
|
||||
private String id = "ConstantGroup485/";
|
||||
|
||||
@JsonProperty("label")
|
||||
/**
|
||||
* @description: 品牌名称:如正新鸡排
|
||||
*/
|
||||
private String label;
|
||||
|
||||
@JsonProperty("name")
|
||||
/**
|
||||
* @description: 对应红圈通品牌编码如:ption486
|
||||
*/
|
||||
private String name;
|
||||
|
||||
@JsonProperty("path")
|
||||
/**
|
||||
* @description: 如该值=ConstantGroup485/option486
|
||||
* 默认设置了前缀ConstantGroup485/
|
||||
* path = id
|
||||
*/
|
||||
private String path = "ConstantGroup485/";
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Field13__c {
|
||||
@JsonProperty("defaultItem")
|
||||
/**
|
||||
* @description: 默认值
|
||||
*/
|
||||
private Boolean defaultItem = false;
|
||||
|
||||
/**
|
||||
* field13__c 门店装修属性
|
||||
* 新开店:o1
|
||||
* 老店翻新:o2
|
||||
* 老店新开:o5
|
||||
* 迁址:option46
|
||||
* 二次设计:o3
|
||||
* 维修改造: o4
|
||||
*/
|
||||
@JsonProperty("id")
|
||||
/**
|
||||
* @description: 如:o1
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* @description: 如:新开店
|
||||
*/
|
||||
@JsonProperty("label")
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* @description: 如:如:o1 name = id
|
||||
*/
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Field8__c {
|
||||
@JsonProperty("defaultItem")
|
||||
/**
|
||||
* @description: 默认值
|
||||
*/
|
||||
private Boolean defaultItem = false;
|
||||
/**
|
||||
* field8__c 是否已收设计费
|
||||
* 是:option44
|
||||
* 否:option45
|
||||
*/
|
||||
@JsonProperty("id")
|
||||
/**
|
||||
* @description: 如:option44
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* @description: 如:是
|
||||
*/
|
||||
@JsonProperty("label")
|
||||
private String label;
|
||||
/**
|
||||
* @description: 如:option44 name = id
|
||||
*/
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.cool.store.request.hqt;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/07/31/14:36
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class HqtPartnerAcceptanceAPIRequest {
|
||||
//是 CRM系统门店编码(红圈通门店id)
|
||||
private Field13__c field13__c;
|
||||
|
||||
/**
|
||||
* @description: 加盟商满意度
|
||||
* 非常好:option139
|
||||
* 好:option140
|
||||
* 一般:ption141
|
||||
* 差:option142
|
||||
*/
|
||||
private Field1__c field1__c;
|
||||
//加盟商评价
|
||||
private String field14__c;
|
||||
|
||||
|
||||
@Data
|
||||
public static class Field13__c{
|
||||
//crm门店编码
|
||||
private String code;
|
||||
//固定值
|
||||
private String bizType = "2148799018";
|
||||
//固定值
|
||||
private String metaName = "project3X";
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Field1__c{
|
||||
//默认值
|
||||
private Boolean defaultItem = false;
|
||||
//加盟商满意度 编码 如option139
|
||||
private String id;
|
||||
//加盟商满意度 名称 如非常好
|
||||
private String label;
|
||||
//加盟商满意度 编码 如option139 name = id
|
||||
private String name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.cool.store.request.hqt;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/07/31/14:24
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class HqtQuotationSheetAPIRequest {
|
||||
/**
|
||||
* @description:CRM系统门店编码(红圈通门店id)
|
||||
*/
|
||||
private Field1__c field1__c;
|
||||
/**
|
||||
* @description:报价编号
|
||||
*/
|
||||
private String name;
|
||||
|
||||
@Data
|
||||
public static class Field1__c {
|
||||
/**
|
||||
* @description: 动态入参 CRM系统门店编码(红圈通门店id)
|
||||
*/
|
||||
private String code;
|
||||
//固定值
|
||||
private String bizType = "2148799018";
|
||||
//固定值
|
||||
private String metaName = "project3X";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/07/31/15:35
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class HqtAPIResponse {
|
||||
|
||||
/**
|
||||
{
|
||||
"data": "1111992914",
|
||||
"desc": "success",
|
||||
"result": "0",
|
||||
"time": 1546272000000
|
||||
}
|
||||
* @description:
|
||||
*/
|
||||
private String data;
|
||||
private String desc;
|
||||
private String result;
|
||||
private Long time;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
|
||||
import com.cool.store.entity.BigRegionDO;
|
||||
import com.cool.store.request.ConfirmQuotationRequest;
|
||||
import com.cool.store.request.HqtBuildRequest;
|
||||
import com.cool.store.request.HqtPartnerAcceptanceRequest;
|
||||
@@ -31,4 +32,11 @@ public interface HqtAPIService {
|
||||
* @description: 加盟商验收、评价
|
||||
*/
|
||||
void hqtPartnerAcceptance(HqtPartnerAcceptanceRequest request);
|
||||
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/7/31
|
||||
* @description: 推送加盟片区 并且返回红圈通加盟片区ID
|
||||
*/
|
||||
BigRegionDO pushHqtRegion( BigRegionDO bigRegionDO);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.BigRegionDAO;
|
||||
import com.cool.store.dto.HqtTokenDTO;
|
||||
import com.cool.store.entity.BigRegionDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.FranchiseBrandEnum;
|
||||
import com.cool.store.enums.HqtEnum.HqtShopDecorationAttributesEnum;
|
||||
import com.cool.store.enums.HqtEnum.HqtSignFeeEnum;
|
||||
import com.cool.store.enums.SatisfactionEnum;
|
||||
import com.cool.store.enums.ShopDecorationAttributesEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.ConfirmQuotationRequest;
|
||||
import com.cool.store.request.HqtBuildRequest;
|
||||
import com.cool.store.request.HqtPartnerAcceptanceRequest;
|
||||
import com.cool.store.request.hqt.*;
|
||||
import com.cool.store.response.HqtAPIResponse;
|
||||
import com.cool.store.service.HqtAPIService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -17,6 +28,8 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
@@ -45,23 +58,203 @@ public class HqtAPIServiceImpl implements HqtAPIService {
|
||||
OkHttpClient okHttpClient;
|
||||
@Resource
|
||||
ObjectMapper objectMapper;
|
||||
|
||||
@Resource
|
||||
private BigRegionDAO bigRegionDAO;
|
||||
|
||||
@Override
|
||||
//@Async
|
||||
public void pushHqtBuild(HqtBuildRequest request) {
|
||||
HqtTokenDTO hqtToken = this.getHqtToken();
|
||||
log.info("开始推送门店信息request:{}",JSONObject.toJSONString(request));
|
||||
Boolean check = request.check();
|
||||
if (!check) {
|
||||
throw new ServiceException(ErrorCodeEnum.HQT_PARAMS_ERROR);
|
||||
}
|
||||
HqtTokenDTO hqtToken = this.getHqtToken();
|
||||
//构建门店装修属性
|
||||
HqtBuildAPIRequest.Field13__c field13__c = getField13__c(request);
|
||||
//构建所属片区
|
||||
HqtBuildAPIRequest.Field124__c field124__c = getField124__c(request);
|
||||
//构建是否已收设计费
|
||||
HqtBuildAPIRequest.Field8__c field8__c = getField8__c(request);
|
||||
//构建加盟品牌
|
||||
HqtBuildAPIRequest.Field123__c field123__c = getField123__c(request);
|
||||
|
||||
HqtBuildAPIRequest hqtBuildAPIRequest = new HqtBuildAPIRequest();
|
||||
getHqtBuildAPIRequest(request, hqtBuildAPIRequest, field13__c, field124__c, field8__c, field123__c);
|
||||
//资源服务URL
|
||||
String url = hqtToken.getEndPoint();
|
||||
String requestUrl = url + "/v1/data/objects/project3X";
|
||||
sendPostRequest(JSONObject.toJSONString(hqtBuildAPIRequest), requestUrl, hqtToken);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
// @Async
|
||||
public void confirmQuotation(ConfirmQuotationRequest request) {
|
||||
HqtTokenDTO hqtToken = this.getHqtToken();
|
||||
log.info("开始推送加盟商确认报价单信息request:{}",JSONObject.toJSONString(request));
|
||||
Boolean check = request.check();
|
||||
if (!check) {
|
||||
log.info("参数错误");
|
||||
throw new ServiceException(ErrorCodeEnum.HQT_PARAMS_ERROR);
|
||||
}
|
||||
//构建CRM系统门店编码(红圈通门店id)
|
||||
HqtQuotationSheetAPIRequest.Field1__c field1__c = new HqtQuotationSheetAPIRequest.Field1__c();
|
||||
field1__c.setCode(request.getShopCode());
|
||||
|
||||
HqtTokenDTO hqtToken = this.getHqtToken();
|
||||
String requestUrl = hqtToken.getEndPoint() + "/v1/data/objects/CustomObject77__c";
|
||||
|
||||
HqtQuotationSheetAPIRequest apiRequest = new HqtQuotationSheetAPIRequest();
|
||||
apiRequest.setField1__c(field1__c);
|
||||
apiRequest.setName(request.getQuotationSheetId());
|
||||
|
||||
sendPostRequest(JSONObject.toJSONString(apiRequest), requestUrl, hqtToken);
|
||||
}
|
||||
|
||||
//@Async
|
||||
@Override
|
||||
public void hqtPartnerAcceptance(HqtPartnerAcceptanceRequest request) {
|
||||
log.info("开始推送加盟商验收信息request:{}",JSONObject.toJSONString(request));
|
||||
if (!request.check()){
|
||||
log.info("参数错误");
|
||||
throw new ServiceException(ErrorCodeEnum.HQT_PARAMS_ERROR);
|
||||
}
|
||||
SatisfactionEnum satisfactionEnum = SatisfactionEnum.getEnumByCode(request.getSatisfaction());
|
||||
|
||||
HqtTokenDTO hqtToken = this.getHqtToken();
|
||||
String requestUrl = hqtToken.getEndPoint() + "/v1/data/objects/CustomObject138__c";
|
||||
|
||||
HqtPartnerAcceptanceAPIRequest apiRequest = getHqtPartnerAcceptanceAPIRequest(request, satisfactionEnum);
|
||||
|
||||
sendPostRequest(JSONObject.toJSONString(apiRequest), requestUrl, hqtToken);
|
||||
}
|
||||
|
||||
private static @NotNull HqtPartnerAcceptanceAPIRequest getHqtPartnerAcceptanceAPIRequest(HqtPartnerAcceptanceRequest request, SatisfactionEnum satisfactionEnum) {
|
||||
HqtPartnerAcceptanceAPIRequest apiRequest = new HqtPartnerAcceptanceAPIRequest();
|
||||
|
||||
//加盟商满意度
|
||||
HqtPartnerAcceptanceAPIRequest.Field1__c field1__c = new HqtPartnerAcceptanceAPIRequest.Field1__c();
|
||||
if (satisfactionEnum != null){
|
||||
field1__c.setId(satisfactionEnum.getHqtCode());
|
||||
field1__c.setLabel(satisfactionEnum.getName());
|
||||
field1__c.setName(satisfactionEnum.getHqtCode());
|
||||
}
|
||||
//门店编码
|
||||
HqtPartnerAcceptanceAPIRequest.Field13__c field13__c = new HqtPartnerAcceptanceAPIRequest.Field13__c();
|
||||
field13__c.setCode(request.getShopCode());
|
||||
|
||||
apiRequest.setField1__c(field1__c);
|
||||
apiRequest.setField13__c(field13__c);
|
||||
apiRequest.setField14__c(request.getComment());
|
||||
return apiRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigRegionDO pushHqtRegion(BigRegionDO bigRegionDO) {
|
||||
HqtTokenDTO hqtToken = this.getHqtToken();
|
||||
String requestUrl = hqtToken.getEndPoint() + "/v1/data/objects/CustomObject494__c";
|
||||
|
||||
Map<String, String> requestBody = new HashMap<>();
|
||||
requestBody.put("name",bigRegionDO.getRegionName());
|
||||
HqtAPIResponse responseBody = sendPostRequest(JSONObject.toJSONString(requestBody), requestUrl, hqtToken);
|
||||
String hqtRegionCode = responseBody.getData();
|
||||
|
||||
bigRegionDO.setHqtRegionCode(hqtRegionCode);
|
||||
bigRegionDO.setHqtRegionName(bigRegionDO.getRegionName());
|
||||
bigRegionDAO.updateHqtDate(bigRegionDO);
|
||||
return bigRegionDO;
|
||||
}
|
||||
|
||||
private HqtAPIResponse sendPostRequest(String requestBody, String requestUrl,HqtTokenDTO hqtToken ){
|
||||
log.info("开始发送请求,url:{},requestBody:{}",requestUrl,requestBody);
|
||||
Request request = new Request.Builder()
|
||||
.url(requestUrl)
|
||||
.post(RequestBody.create(MediaType.parse( "application/json"),requestBody))
|
||||
.addHeader("Authorization", "Bearer " + hqtToken.getAccess_token())
|
||||
.addHeader("Content-Type", "application/json")
|
||||
.build();
|
||||
try (Response response = okHttpClient.newCall(request).execute()) {
|
||||
log.info("发起请求 time:{}",System.currentTimeMillis());
|
||||
if (!response.isSuccessful()) {
|
||||
log.info("HTTP请求失败,msg: " + response.message());
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
|
||||
"HTTP请求失败,状态码: " + response.code());
|
||||
}
|
||||
|
||||
log.info("请求成功responseBody:{}",JSONObject.toJSONString(response.body().string()));
|
||||
HqtAPIResponse hqtAPIResponse = objectMapper.readValue(response.body().string(), HqtAPIResponse.class);
|
||||
return hqtAPIResponse;
|
||||
} catch (ServiceException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("API调用异常 - URL: {}, 错误: {}", requestUrl, e.getMessage(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR, "接口调用异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void getHqtBuildAPIRequest(HqtBuildRequest request, HqtBuildAPIRequest hqtBuildAPIRequest, HqtBuildAPIRequest.Field13__c field13__c, HqtBuildAPIRequest.Field124__c field124__c, HqtBuildAPIRequest.Field8__c field8__c, HqtBuildAPIRequest.Field123__c field123__c) {
|
||||
hqtBuildAPIRequest.setProjectNo(request.getShopCode());
|
||||
hqtBuildAPIRequest.setName(request.getShopName());
|
||||
hqtBuildAPIRequest.setField13__c(field13__c);
|
||||
hqtBuildAPIRequest.setField124__c(field124__c);
|
||||
hqtBuildAPIRequest.setField94__c(request.getSupervisorName());
|
||||
hqtBuildAPIRequest.setField4__c(request.getSupervisorMobile());
|
||||
hqtBuildAPIRequest.setField5__c(request.getPartnershipSignatoryFirst());
|
||||
hqtBuildAPIRequest.setField62__c(request.getPartnershipSignatoryFirstMobile());
|
||||
hqtBuildAPIRequest.setStreet(request.getShopAddress());
|
||||
hqtBuildAPIRequest.setField8__c(field8__c);
|
||||
hqtBuildAPIRequest.setField123__c(field123__c);
|
||||
hqtBuildAPIRequest.setField4__c(request.getSupervisorMobile());
|
||||
}
|
||||
|
||||
private HqtBuildAPIRequest.Field123__c getField123__c(HqtBuildRequest request) {
|
||||
FranchiseBrandEnum franchiseBrand = FranchiseBrandEnum.getEnumByCode(request.getFranchiseBrand());
|
||||
if (franchiseBrand != null) {
|
||||
HqtBuildAPIRequest.Field123__c field123__c = new HqtBuildAPIRequest.Field123__c();
|
||||
field123__c.setId(field123__c.getId() + franchiseBrand.getHqtCode());
|
||||
field123__c.setLabel(franchiseBrand.getDesc());
|
||||
field123__c.setName(franchiseBrand.getHqtCode());
|
||||
field123__c.setPath(field123__c.getPath() + franchiseBrand.getHqtCode());
|
||||
return field123__c;
|
||||
}
|
||||
return new HqtBuildAPIRequest.Field123__c();
|
||||
}
|
||||
|
||||
private HqtBuildAPIRequest.Field13__c getField13__c(HqtBuildRequest request) {
|
||||
HqtBuildAPIRequest.Field13__c field13__c = new HqtBuildAPIRequest.Field13__c();
|
||||
//获取门店装修属性
|
||||
ShopDecorationAttributesEnum shopDecorationAttributesEnum = ShopDecorationAttributesEnum.getShopDecorationAttributesEnumByCode(request.getShopDecorationAttributes());
|
||||
HqtShopDecorationAttributesEnum hqtShopDecorationAttributesEnum = HqtShopDecorationAttributesEnum.getHqtShopDecorationAttributesEnumByShopDecorationAttributesEnum(shopDecorationAttributesEnum);
|
||||
if (hqtShopDecorationAttributesEnum == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.HQT_SHOP_DECORATION_ATTRIBUTES);
|
||||
}
|
||||
field13__c.setId(hqtShopDecorationAttributesEnum.getCode());
|
||||
field13__c.setLabel(hqtShopDecorationAttributesEnum.getMsg());
|
||||
field13__c.setName(hqtShopDecorationAttributesEnum.getCode());
|
||||
return field13__c;
|
||||
}
|
||||
|
||||
private HqtBuildAPIRequest.Field124__c getField124__c(HqtBuildRequest request) {
|
||||
HqtBuildAPIRequest.Field124__c field124__c = new HqtBuildAPIRequest.Field124__c();
|
||||
field124__c.setCode(request.getHqtRegionCode());
|
||||
field124__c.setName(request.getHqtRegionName());
|
||||
return field124__c;
|
||||
}
|
||||
|
||||
private HqtBuildAPIRequest.Field8__c getField8__c(HqtBuildRequest request) {
|
||||
HqtSignFeeEnum hqtSignFee = HqtSignFeeEnum.getCodeByValue(request.getIsPayDesignFee());
|
||||
if (hqtSignFee != null) {
|
||||
HqtBuildAPIRequest.Field8__c field8__c = new HqtBuildAPIRequest.Field8__c();
|
||||
field8__c.setId(hqtSignFee.getCode());
|
||||
field8__c.setLabel(hqtSignFee.getMsg());
|
||||
field8__c.setName(hqtSignFee.getCode());
|
||||
return field8__c;
|
||||
}
|
||||
return new HqtBuildAPIRequest.Field8__c();
|
||||
|
||||
}
|
||||
public HqtTokenDTO getHqtToken() {
|
||||
String url = hqtTokenUrl + "/hecom-tenancy/oauth/token";
|
||||
String auth = hqtClientId + ":" + hqtClientSecret;
|
||||
|
||||
@@ -293,11 +293,15 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
|
||||
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
EnterpriseUserDO userInfoById = enterpriseUserDAO.getUserInfoById(shopInfo.getInvestmentManager());
|
||||
BigRegionDO bigRegionDO = bigRegionDAO.getByRegionId(shopInfo.getRegionId());
|
||||
if (StringUtils.isBlank(bigRegionDO.getHqtRegionCode())){
|
||||
bigRegionDO = hqtAPIService.pushHqtRegion(bigRegionDO);
|
||||
}
|
||||
HqtBuildRequest request = new HqtBuildRequest();
|
||||
request.setShopCode(shopInfo.getShopCode());
|
||||
request.setShopName(shopInfo.getShopName());
|
||||
request.setShopDecorationAttributes(shopInfo.getShopDecorationAttributes());
|
||||
request.setHqtRegionCode(bigRegionDO.getHqtRegionCode());
|
||||
request.setHqtRegionName(bigRegionDO.getHqtRegionName());
|
||||
request.setSupervisorName(userInfoById.getName());
|
||||
request.setSupervisorMobile(userInfoById.getMobile());
|
||||
request.setPartnershipSignatoryFirst(lineInfoDO.getUsername());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.controller.webb;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.FoodTokenDTO;
|
||||
@@ -33,10 +34,12 @@ import com.cool.store.response.oppty.OpportunityDetailResponse;
|
||||
import com.cool.store.response.oppty.OpportunityInfoPageResponse;
|
||||
import com.cool.store.service.*;
|
||||
import com.cool.store.service.impl.CommonService;
|
||||
import com.cool.store.service.impl.OrderSysInfoServiceImpl;
|
||||
import com.cool.store.service.impl.UserAuthMappingServiceImpl;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.RedisConstantUtil;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.poi.StringUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -53,6 +56,14 @@ import java.util.stream.Collectors;
|
||||
@RequestMapping("/pc/test")
|
||||
public class PCTestController {
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
private BigRegionDAO bigRegionDAO;
|
||||
@Resource
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
private HqtAPIService hqtAPIService;
|
||||
@Resource
|
||||
private DecorationDesignInfoService decorationDesignInfoService;
|
||||
@Resource
|
||||
@@ -501,4 +512,47 @@ public class PCTestController {
|
||||
return ApiResponse.success(decorationDesignInfoService.decorationAcceptance(request));
|
||||
}
|
||||
|
||||
@ApiOperation("测试红圈通建店")
|
||||
@GetMapping("/testHqtBuild")
|
||||
public ApiResponse<Boolean> testHqtBuild(@RequestParam("shopId")Long shopId) {
|
||||
HqtBuildRequest hqtBuildRequest = getHqtBuildRequest(shopId);
|
||||
hqtAPIService.pushHqtBuild(hqtBuildRequest);
|
||||
return ApiResponse.success(true);
|
||||
}
|
||||
|
||||
@ApiOperation("测试红圈推送片区")
|
||||
@GetMapping("/testHqtRegion")
|
||||
public ApiResponse<Boolean> testHqtRegion() {
|
||||
hqtAPIService.pushHqtRegion(null);
|
||||
return ApiResponse.success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public HqtBuildRequest getHqtBuildRequest(Long shopId) {
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
EnterpriseUserDO userInfoById = enterpriseUserDAO.getUserInfoById(shopInfo.getInvestmentManager());
|
||||
BigRegionDO bigRegionDO = bigRegionDAO.getByRegionId(shopInfo.getRegionId());
|
||||
HqtBuildRequest request = new HqtBuildRequest();
|
||||
request.setShopCode(shopInfo.getShopCode());
|
||||
request.setShopName(shopInfo.getShopName());
|
||||
request.setShopDecorationAttributes(shopInfo.getShopDecorationAttributes());
|
||||
request.setHqtRegionCode(bigRegionDO.getHqtRegionCode());
|
||||
request.setHqtRegionName(bigRegionDO.getHqtRegionName());
|
||||
request.setSupervisorName(userInfoById.getName());
|
||||
request.setSupervisorMobile(userInfoById.getMobile());
|
||||
request.setPartnershipSignatoryFirst(lineInfoDO.getUsername());
|
||||
request.setPartnershipSignatoryFirstMobile(lineInfoDO.getMobile());
|
||||
request.setShopAddress(shopInfo.getDetailAddress());
|
||||
request.setIsPayDesignFee(CommonConstants.ONE);
|
||||
if (StringUtils.isNotBlank(shopInfo.getFranchiseBrand())) {
|
||||
request.setFranchiseBrand(Integer.valueOf(shopInfo.getFranchiseBrand()));
|
||||
}
|
||||
return request;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user