Просмотр исходного кода

//update test

release_toaliyun_real
xhxu 4 лет назад
Родитель
Сommit
57ee247a4e
3 измененных файлов: 89 добавлений и 15 удалений
  1. +40
    -0
      mallinkService/src/main/java/com/iformall/domain/po/TtMerchantPoi.java
  2. +36
    -14
      mallinkService/src/main/java/com/iformall/service/impl/TtMerchantPoiServiceImpl.java
  3. +13
    -1
      mallinkService/src/main/resources/mapper/TtMerchantPoiMapper.xml

+ 40
- 0
mallinkService/src/main/java/com/iformall/domain/po/TtMerchantPoi.java Просмотреть файл

@@ -1,7 +1,9 @@
package com.iformall.domain.po; package com.iformall.domain.po;


import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.google.gson.JsonObject;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import com.iformall.utils.Constant;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@@ -84,4 +86,42 @@ public class TtMerchantPoi extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="同步失败原因,抖音风控政策问题,该字段无法提供太多信息,目前审核不通过联系抖音运营做进一步处理",name="failReason") @io.swagger.annotations.ApiModelProperty(value="同步失败原因,抖音风控政策问题,该字段无法提供太多信息,目前审核不通过联系抖音运营做进一步处理",name="failReason")
private String failReason; private String failReason;



@io.swagger.annotations.ApiModelProperty(value="商铺营业执照路径",name="bizLicencePath")
private String bizLicencePath;
@io.swagger.annotations.ApiModelProperty(value="营业执照审核详细",name="bizLicenceStatus")
private String bizLicenceStatus;
@io.swagger.annotations.ApiModelProperty(value="商家授权函(或与小程序的合作协议)路径",name="contractPath")
private String contractPath;
@io.swagger.annotations.ApiModelProperty(value="商家授权函审核详细",name="contractStatus")
private String contractStatus;
@io.swagger.annotations.ApiModelProperty(value="商铺行业资质材料信息",name="qualMaterial")
private String qualMaterial;
@io.swagger.annotations.ApiModelProperty(value="商铺行业资质材料信息审核详细",name="qualMaterialStatus")
private String qualMaterialStatus;
@io.swagger.annotations.ApiModelProperty(value="其他补充资质",name="additionalQual")
private String additionalQual;
@io.swagger.annotations.ApiModelProperty(value="其他补充资质审核详细",name="additionalQualStatus")
private String additionalQualStatus;
@io.swagger.annotations.ApiModelProperty(value="所有资质的最早过期时间",name="expireTime")
private String expireTime;




public String getTtparams(){
return Constant.mainPageUrl;
}

public String getTtPath(){
JsonObject object = new JsonObject();
// if(!merchantPoi.getTenantId().equals(id.toString())){
if(getId() != 1038){
object.addProperty("type","md");
object.addProperty("id",id);
}
return object.toString();
}


} }

+ 36
- 14
mallinkService/src/main/java/com/iformall/service/impl/TtMerchantPoiServiceImpl.java Просмотреть файл

@@ -240,8 +240,31 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService {
if(!EnumSupplierMathStatus.match_success.getCode().equals(merchantPoi.getMatchStatus())){ if(!EnumSupplierMathStatus.match_success.getCode().equals(merchantPoi.getMatchStatus())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该店铺未匹配成功,暂不能同步"); return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该店铺未匹配成功,暂不能同步");
} }
WxMerchant merchant = wxMerchantMapper.selectById(id);
String supplierId = supplierSync(tenantInfo, merchantPoi, merchant);

String linkPhone = null;
String contactTel = null;
List<String> images = new ArrayList<>();
Integer status = EnumMerchantStatus.VALID.getCode();
String introduction = "";
Integer businessId = EnumBusiness.BUSINESS_ID1.getCode();

// if(merchantPoi.getTenantId().equals(id.toString())){
if(merchantPoi.getId() == 1038){
WxMall mall = wxMallMapper.getByTenantId(merchantPoi.getTenantId());
contactTel = mall.getServicePhone();
images.add(mall.getImg());
introduction = mall.getIntroduction();
}else{
WxMerchant merchant = wxMerchantMapper.selectById(id);
linkPhone = merchant.getLinkPhone();
images = JSONArray.parseArray(merchant.getCoverPicture(), String.class);
status = merchant.getStatus();
introduction = merchant.getIntroduction();
}


String supplierId = supplierSync(tenantInfo, merchantPoi, linkPhone,contactTel, images, status, introduction, businessId);

if(StringUtils.isBlank(supplierId)){ if(StringUtils.isBlank(supplierId)){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"同步失败"); return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"同步失败");
} }
@@ -254,19 +277,18 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService {
return new ResultData(); return new ResultData();
} }


private String supplierSync(TenantEntity tenantInfo,TtMerchantPoi merchantPoi,WxMerchant merchant){
private String supplierSync(TenantEntity tenantInfo,TtMerchantPoi merchantPoi,
String linkPhone,String contactTel,List<String> images,Integer status,String introduction,Integer businessId){
TtSupplierSync supplierSync = new TtSupplierSync(); TtSupplierSync supplierSync = new TtSupplierSync();
supplierSync.setContactPhone(merchant.getLinkPhone());
// supplierSync.setContactTel();//联系座机号
List<String> images = new ArrayList<>();
images.add(merchant.getImgUrl());
supplierSync.setContactPhone(linkPhone);
supplierSync.setContactTel(contactTel);//联系座机号
supplierSync.setImages(images); supplierSync.setImages(images);
// supplierSync.setMerchantUid();//如果开启分账并且已进件 // supplierSync.setMerchantUid();//如果开启分账并且已进件
// supplierSync.setServiceProvider(getServiceProvider(merchant));//营业执照等 // supplierSync.setServiceProvider(getServiceProvider(merchant));//营业执照等
supplierSync.setSupplierExtId(merchant.getId().toString());
supplierSync.setSupplierExtId(merchantPoi.getSupplierExtId());


// supplierSync.setTags();//标签 [可停车 离地铁近] // supplierSync.setTags();//标签 [可停车 离地铁近]
supplierSync.setStatus(EnumMerchantStatus.VALID.getCode().equals(merchant.getStatus())?1:2);
supplierSync.setStatus(EnumMerchantStatus.VALID.getCode().equals(status)?1:2);
// todo POI品类编码 POI品类描述 eg. 美食;中式餐饮;小龙虾 // todo POI品类编码 POI品类描述 eg. 美食;中式餐饮;小龙虾
// supplierSync.setTypeCode(); // supplierSync.setTypeCode();
// supplierSync.setTypeName(); // supplierSync.setTypeName();
@@ -277,10 +299,10 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService {
//todo 商家资质信息 //todo 商家资质信息
// supplierSync.setCustomerInfo(getCustomerInfo(merchantPoi,merchant)); // supplierSync.setCustomerInfo(getCustomerInfo(merchantPoi,merchant));


supplierSync.setDescription(merchant.getIntroduction());
supplierSync.setName(merchant.getName());
supplierSync.setDescription(introduction);
supplierSync.setName(merchantPoi.getPoiName());
// supplierSync.setRecommends(getRecommends(merchant));//推荐 // supplierSync.setRecommends(getRecommends(merchant));//推荐
supplierSync.setServices(getServices(merchant));
supplierSync.setServices(getServices(merchantPoi));
// supplierSync.setAttributes();//不传 // supplierSync.setAttributes();//不传


// supplierSync.setLongitude();//经度 // supplierSync.setLongitude();//经度
@@ -293,7 +315,7 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService {
supplierSync.setPoiId(merchantPoi.getPoiId()); supplierSync.setPoiId(merchantPoi.getPoiId());


//todo 如果抖音没有这个类型怎么办 //todo 如果抖音没有这个类型怎么办
Integer ttType = EnumBusiness.getEnum(merchant.getBusinessId()).getTtType();
Integer ttType = EnumBusiness.getEnum(businessId).getTtType();
if(ttType == null){ if(ttType == null){
logger.error("未找到对应的店铺类型"); logger.error("未找到对应的店铺类型");
throw new MallinkException(ErrorCode.MSG_METHOD_REQUEST_ERROR.getCode(),"未找到对应的店铺类型"); throw new MallinkException(ErrorCode.MSG_METHOD_REQUEST_ERROR.getCode(),"未找到对应的店铺类型");
@@ -372,7 +394,7 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService {
} }


//团购券类型 services 中的 service_type 必须包含 9101,门票类型 services 中的 service_type 必须包含 9001 //团购券类型 services 中的 service_type 必须包含 9101,门票类型 services 中的 service_type 必须包含 9001
private JsonArray getServices(WxMerchant merchant){
private JsonArray getServices(TtMerchantPoi merchant){
JsonArray jsonArray = new JsonArray(); JsonArray jsonArray = new JsonArray();
JsonObject jsonObject = new JsonObject(); JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("enable",1); jsonObject.addProperty("enable",1);


+ 13
- 1
mallinkService/src/main/resources/mapper/TtMerchantPoiMapper.xml Просмотреть файл

@@ -34,6 +34,17 @@
<result column="last_sync_status" jdbcType="INTEGER" property="lastSyncStatus"/> <result column="last_sync_status" jdbcType="INTEGER" property="lastSyncStatus"/>
<result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/>



<result column="biz_licence_path" jdbcType="VARCHAR" property="bizLicencePath"/>
<result column="biz_licence_status" jdbcType="VARCHAR" property="bizLicenceStatus"/>
<result column="contract_path" jdbcType="VARCHAR" property="contractPath"/>
<result column="contract_status" jdbcType="VARCHAR" property="contractStatus"/>
<result column="qual_material" jdbcType="VARCHAR" property="qualMaterial"/>
<result column="qual_material_status" jdbcType="VARCHAR" property="qualMaterialStatus"/>
<result column="additional_qual" jdbcType="VARCHAR" property="additionalQual"/>
<result column="additional_qual_status" jdbcType="VARCHAR" property="additionalQualStatus"/>
<result column="expire_time" jdbcType="VARCHAR" property="expireTime"/>

</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
@@ -43,7 +54,8 @@
`poi_id`,`poi_name`,`province`,`city`,`address`, `poi_id`,`poi_name`,`province`,`city`,`address`,
`task_id`,`match_status`,`mismatch_status_desc`, `task_id`,`match_status`,`mismatch_status_desc`,
`create_date`,`update_date`, `create_date`,`update_date`,
`supplier_id`,`sync_status`,`last_sync_status`,`fail_reason`
`supplier_id`,`sync_status`,`last_sync_status`,`fail_reason`,
`biz_licence_path`,`biz_licence_status`,`contract_path`,`contract_status`,`qual_material`,`qual_material_status`,`additional_qual`,`additional_qual_status`,`expire_time`
</sql> </sql>
<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">


Загрузка…
Отмена
Сохранить