日志
This commit is contained in:
@@ -6,10 +6,12 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
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.BlackListLogDTO;
|
||||
import com.cool.store.dto.log.LineLogInfo;
|
||||
import com.cool.store.dto.log.WantInfoUpdateDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
@@ -19,6 +21,7 @@ import com.cool.store.request.PartnerBaseInfoRequest;
|
||||
import com.cool.store.service.HyPartnerBaseInfoService;
|
||||
import com.cool.store.service.HyPartnerLineInfoService;
|
||||
import com.cool.store.service.HyPhoneLocationService;
|
||||
import com.cool.store.service.LogService;
|
||||
import com.cool.store.utils.CoolDateUtils;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.vo.PartnerBaseInfoVO;
|
||||
@@ -26,6 +29,7 @@ import com.cool.store.vo.PartnerUserInfoVO;
|
||||
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;
|
||||
@@ -76,6 +80,9 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
@Resource
|
||||
HyPartnerCertificationInfoMapper hyPartnerCertificationInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private LogService logService;
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean addTags(LoginUserInfo user, AddTagsRequest addTagsRequest) {
|
||||
@@ -115,14 +122,20 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
redisUtilPool.setString(cacheKey, JSONObject.toJSONString(request), RedisConstant.ONE_DAY_SECONDS);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
WantInfoUpdateDTO.BaseInfoUpdate beforeBaseInfoUpdate = new WantInfoUpdateDTO.BaseInfoUpdate();
|
||||
WantInfoUpdateDTO.BaseInfoUpdate afterBaseInfoUpdate = new WantInfoUpdateDTO.BaseInfoUpdate();
|
||||
|
||||
HyPartnerBaseInfoDO baseInfoDO = hyPartnerBaseInfoDAO.getByPartnerIdAndLineId(request.getPartnerId(), request.getPartnerLineId());
|
||||
if(baseInfoDO == null){
|
||||
baseInfoDO = new HyPartnerBaseInfoDO();
|
||||
fillBaseInfo(baseInfoDO, request);
|
||||
hyPartnerBaseInfoDAO.insertSelective(baseInfoDO);
|
||||
BeanUtil.copyProperties(baseInfoDO, afterBaseInfoUpdate);
|
||||
}else {
|
||||
BeanUtil.copyProperties(baseInfoDO, beforeBaseInfoUpdate);
|
||||
fillBaseInfo(baseInfoDO, request);
|
||||
hyPartnerBaseInfoDAO.updateByPrimaryKeySelective(baseInfoDO);
|
||||
BeanUtil.copyProperties(baseInfoDO, afterBaseInfoUpdate);
|
||||
}
|
||||
if(request.getSubmitFlag()){
|
||||
// 更新线索表状态
|
||||
@@ -146,6 +159,12 @@ public class HyPartnerBaseInfoServiceImpl implements HyPartnerBaseInfoService {
|
||||
}
|
||||
// 清空暂存信息
|
||||
redisUtilPool.delKey(cacheKey);
|
||||
//记录日志
|
||||
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))
|
||||
.beforeBaseInfoUpdate(beforeBaseInfoUpdate).afterBaseInfoUpdate(afterBaseInfoUpdate).build();
|
||||
logService.recordPartnerBizLog(operator, baseInfoDO.getPartnerLineId(), OperateTypeEnum.INTENT_INFO_UPDATE,log);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
|
||||
intentInfoDO = new HyPartnerIntentInfoDO();
|
||||
fillIntentInfo(intentInfoDO, request);
|
||||
hyPartnerIntentInfoDAO.insertSelective(intentInfoDO);
|
||||
BeanUtil.copyProperties(intentInfoDO, beforeIntentInfoUpdate);
|
||||
BeanUtil.copyProperties(intentInfoDO, afterIntentInfoUpdate);
|
||||
}else {
|
||||
BeanUtil.copyProperties(intentInfoDO, beforeIntentInfoUpdate);
|
||||
fillIntentInfo(intentInfoDO, request);
|
||||
|
||||
Reference in New Issue
Block a user