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

//tt coupon sync

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
a87f2ec390
3 измененных файлов: 22 добавлений и 5 удалений
  1. +6
    -4
      mallinkService/src/main/java/com/iformall/service/impl/TtCouponGoodsServiceImpl.java
  2. +0
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java
  3. +16
    -0
      mallinkService/src/main/java/com/iformall/utils/DateUtils.java

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

@@ -20,6 +20,7 @@ import com.iformall.enums.*;
import com.iformall.mapper.*;
import com.iformall.service.*;
import com.iformall.utils.Constant;
import com.iformall.utils.DateUtils;
import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@@ -178,7 +179,7 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService {
wxCouponChannel.setId(idWorker.nextId());
wxCouponChannel.updateTenantInfo(coupon);
wxCouponChannel.setShowBeginTime(new Date());
// wxCouponChannel.setBeginTime(new Date());
wxCouponChannel.setBeginTime(new Date());
wxCouponChannel.setEndTime(coupon.getValidEndDate());
wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_BEFORE.getCode());
wxCouponChannel.setCouponId(coupon.getId());
@@ -201,10 +202,11 @@ public class TtCouponGoodsServiceImpl implements TtCouponGoodsService {
prostruct.setProductType(ttattrs.getProductType());
prostruct.setBizLine(5);//默认小程序
prostruct.setAccountName(couponMerchantList.get(0).getMerchantName());
// prostruct.setSoldStartTime();
// prostruct.setSoldEndTime();
prostruct.setOutUrl(getGoodsEntrySchema(coupon,wxCouponChannel.getId()));

prostruct.setSoldStartTime((long) DateUtils.getSecondTimestamp(wxCouponChannel.getBeginTime()));
prostruct.setSoldEndTime((long) DateUtils.getSecondTimestamp(wxCouponChannel.getEndTime()));

prostruct.setOutUrl(getGoodsEntrySchema(coupon,wxCouponChannel.getId()));
prostruct.setPoiList(poiList);
Map<String, String> productAttrKeyValueMap = ttattrs.getProductAttrKeyValueMap();
productAttrKeyValueMap.put("trade_url",getUpOrderEntrySchema(coupon,wxCouponChannel.getId()));


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

@@ -817,7 +817,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
updChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode());
updChannel.setTtSpuId(ttCouponChannelPoi.getSpuId());
updChannel.setShowBeginTime(date);
updChannel.setBeginTime(date);
updChannel.setUpdateDate(date);
wxCouponChannelMapper.updateById(updChannel);
return new ResultData();


+ 16
- 0
mallinkService/src/main/java/com/iformall/utils/DateUtils.java Просмотреть файл

@@ -1426,4 +1426,20 @@ public class DateUtils {
return format.format(cale.getTime());
}

/**
2. * 获取精确到秒的时间戳
3. * @return
4. */
public static int getSecondTimestamp(Date date){
if (null == date) {
return 0;
}
String timestamp = String.valueOf(date.getTime());
int length = timestamp.length();
if (length > 3) {
return Integer.valueOf(timestamp.substring(0,length-3));
} else {
return 0;
}
}
}

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