|
|
|
@@ -63,6 +63,7 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public int updateById(TtMerchantPoi record) { |
|
|
|
record.setUpdateDate(new Date()); |
|
|
|
return ttMerchantPoiMapper.updateById(record); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -145,6 +146,54 @@ public class TtMerchantPoiServiceImpl implements TtMerchantPoiService { |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<TtMerchantPoi> findTaskIdList(TtMerchantPoi merchantPoiQ) { |
|
|
|
return ttMerchantPoiMapper.findTaskIdList(merchantPoiQ); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void supplierQueryTask(TtMerchantPoi poi) { |
|
|
|
try { |
|
|
|
TtSupplierMatchList matchList = getTtWebService(poi).getShopMatchService().supplierQueryTask(poi.getTaskId()); |
|
|
|
if(matchList != null && matchList.getMatchDataList().size() > 0 ){ |
|
|
|
for (TtSupplierMatch match:matchList.getMatchDataList()) { |
|
|
|
Date now = new Date(); |
|
|
|
TtMerchantPoi poiUpd = new TtMerchantPoi(); |
|
|
|
poiUpd.setId(Long.parseLong(match.getSupplierExtId())); |
|
|
|
poiUpd.setMatchStatus(match.getMatchStatus()); |
|
|
|
poiUpd.setMismatchStatusDesc(match.getMismatchStatusDesc()); |
|
|
|
poiUpd.setUpdateDate(now); |
|
|
|
if(EnumSupplierMathStatus.match_success.getCode().equals(match.getMatchStatus())){ |
|
|
|
poiUpd.setPoiId(match.getPoiId()); |
|
|
|
poiUpd.setPoiName(match.getPoiName()); |
|
|
|
poiUpd.setProvince(match.getProvince()); |
|
|
|
poiUpd.setCity(match.getCity()); |
|
|
|
poiUpd.setAddress(match.getAddress()); |
|
|
|
ttMerchantPoiMapper.updateById(poiUpd); |
|
|
|
}else if(EnumSupplierMathStatus.match_fail.getCode().equals(match.getMatchStatus())){ |
|
|
|
ttMerchantPoiMapper.updateById(poiUpd); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (WxErrorException e) { |
|
|
|
logger.error("查询匹配任务error"+e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData merchantSync(TenantEntity tenantInfo, Long id) { |
|
|
|
TtMerchantPoi merchantPoi = ttMerchantPoiMapper.selectById(id); |
|
|
|
if(merchantPoi == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"未找到数据"); |
|
|
|
} |
|
|
|
if(!EnumSupplierMathStatus.match_success.getCode().equals(merchantPoi.getMatchStatus())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"该店铺未匹配成功,暂不能同步"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
private String supplierMatch(TenantEntity tenantInfo, List<TtMerchantPoi> merchantPoiList){ |
|
|
|
TtSupplierMatchList matchList = new TtSupplierMatchList(); |
|
|
|
for (TtMerchantPoi poi:merchantPoiList) { |
|
|
|
|