优化
This commit is contained in:
@@ -568,10 +568,8 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
|
||||
public Long checkGenerateNewLineId(Long lineId) {
|
||||
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(lineId);
|
||||
// 15天之后可以继续填写意向信息,把之前的线索删除
|
||||
log.info("截止时间:{},截止时间:{}", DateUtil.offsetSecond(hyPartnerLineInfoDO.getDeadline(), -3), new Date());
|
||||
log.info("比较:{}", DateUtil.offsetSecond(hyPartnerLineInfoDO.getDeadline(), -3).before(new Date()));
|
||||
if(hyPartnerLineInfoDO != null && hyPartnerLineInfoDO.getDeadline() != null &&
|
||||
DateUtil.offsetSecond(hyPartnerLineInfoDO.getDeadline(), -3).before(new Date())){
|
||||
DateUtil.offsetSecond(hyPartnerLineInfoDO.getDeadline(), -2).before(new Date())){
|
||||
//将老的线索置为删除状态
|
||||
hyPartnerLineInfoDAO.batchDeleted(Collections.singletonList(hyPartnerLineInfoDO.getId()));
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(hyPartnerLineInfoDO.getPartnerId());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.service.impl;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.HyPartnerUserInfoDAO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
@@ -9,11 +10,14 @@ import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.PartnerUserInfoRequest;
|
||||
import com.cool.store.request.PartnerWantShopInfoRequest;
|
||||
import com.cool.store.service.HyPartnerBaseInfoService;
|
||||
import com.cool.store.service.HyPartnerLineInfoService;
|
||||
import com.cool.store.service.PartnerUserInfoService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.vo.ApplyBaseInfoVO;
|
||||
import com.cool.store.vo.InviteCodeDetailVO;
|
||||
import com.cool.store.vo.PartnerIntentInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -21,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -39,7 +44,8 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
|
||||
|
||||
@Resource
|
||||
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
|
||||
@Resource
|
||||
private RedisUtilPool redisUtilPool;
|
||||
|
||||
@Override
|
||||
public HyPartnerUserInfoDO selectByPartnerId(String partnerId) {
|
||||
@@ -106,6 +112,14 @@ public class PartnerUserInfoServiceImpl implements PartnerUserInfoService {
|
||||
applyBaseInfoVO.setProvinceHasOpenArea(true);
|
||||
}
|
||||
applyBaseInfoVO.setLineStatus(hyPartnerLineInfoDO.getLineStatus());
|
||||
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_WANTSHOPINFO_CACHE_KEY, partnerUserInfoRequest.getPartnerId(), hyPartnerLineInfoDO.getId());
|
||||
if (StringUtils.isNotBlank(redisUtilPool.getString(cacheKey))) {
|
||||
PartnerWantShopInfoRequest request = JSONObject.parseObject(redisUtilPool.getString(cacheKey), PartnerWantShopInfoRequest.class);
|
||||
if(!partnerUserInfoRequest.getWantShopArea().equals(request.getWantShopArea())){
|
||||
request.setWantShopArea(partnerUserInfoRequest.getWantShopArea());
|
||||
}
|
||||
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
|
||||
}
|
||||
return applyBaseInfoVO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user