提交意向日志
This commit is contained in:
@@ -6,10 +6,12 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.context.PartnerUserHolder;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.log.AddTagsDTO;
|
||||
import com.cool.store.dto.log.LineLogInfo;
|
||||
import com.cool.store.dto.log.UserInfoUpdateDTO;
|
||||
import com.cool.store.dto.log.WantInfoUpdateDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyOpenAreaInfoDO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
@@ -38,6 +40,7 @@ import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -72,6 +75,8 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
HyPhoneLocationService hyPhoneLocationService;
|
||||
@Resource
|
||||
HyPartnerTaskInfoLogDAO hyPartnerTaskInfoLogDAO;
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
@Override
|
||||
public PageInfo<PartnerIntentApplyInfoVO> getPartnerIntentApplyList(String userId, String type, Integer pageSize, Integer pageNumber) {
|
||||
@@ -186,14 +191,20 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
|
||||
return null;
|
||||
}
|
||||
WantInfoUpdateDTO.IntentInfoUpdate beforeIntentInfoUpdate = new WantInfoUpdateDTO.IntentInfoUpdate();
|
||||
WantInfoUpdateDTO.IntentInfoUpdate afterIntentInfoUpdate = new WantInfoUpdateDTO.IntentInfoUpdate();
|
||||
|
||||
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||
if(intentInfoDO == null){
|
||||
intentInfoDO = new HyPartnerIntentInfoDO();
|
||||
fillIntentInfo(intentInfoDO, request);
|
||||
hyPartnerIntentInfoDAO.insertSelective(intentInfoDO);
|
||||
BeanUtil.copyProperties(intentInfoDO, beforeIntentInfoUpdate);
|
||||
}else {
|
||||
BeanUtil.copyProperties(intentInfoDO, beforeIntentInfoUpdate);
|
||||
fillIntentInfo(intentInfoDO, request);
|
||||
hyPartnerIntentInfoDAO.updateByPrimaryKeySelective(intentInfoDO);
|
||||
BeanUtil.copyProperties(intentInfoDO, afterIntentInfoUpdate);
|
||||
}
|
||||
redisUtilPool.delKey(cacheKey);
|
||||
HyPartnerUserInfoDO hyPartnerUserInfoDO = hyPartnerUserInfoDAO.selectByPartnerId(request.getPartnerId());
|
||||
@@ -215,6 +226,12 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
}
|
||||
//记录日志
|
||||
PartnerUserInfoVO operator = PartnerUserHolder.getUser();
|
||||
WantInfoUpdateDTO log = WantInfoUpdateDTO.builder().mobile(operator.getMobile()).operateUserId(operator.getPartnerId()).operateUsername(operator.getUsername())
|
||||
.operateTime(DateUtil.format(new Date(), CoolDateUtils.DATE_FORMAT_SEC))
|
||||
.beforeIntentInfoUpdate(beforeIntentInfoUpdate).afterIntentInfoUpdate(afterIntentInfoUpdate).build();
|
||||
logService.recordPartnerBizLog(operator,hyPartnerLineInfoDO.getId(), OperateTypeEnum.INTENT_INFO_UPDATE,log);
|
||||
return hyPartnerLineInfoDO.getLineStatus();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user