回调接口日志跟随

master
Caps 6 years ago
parent 314a75daa8
commit 895c7556f0

@ -32,6 +32,7 @@ import com.kiisoo.ic.synchronous.entity.TurnBackDTO;
import com.kiisoo.ic.synchronous.entity.VipDataDTO; import com.kiisoo.ic.synchronous.entity.VipDataDTO;
import com.kiisoo.ic.system.enums.RoleEnum; import com.kiisoo.ic.system.enums.RoleEnum;
import com.kiisoo.ic.webappmy.vo.StafferInfoVO; import com.kiisoo.ic.webappmy.vo.StafferInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -51,6 +52,7 @@ import java.util.stream.Collectors;
* @Version: v1 * @Version: v1
*/ */
@Service @Service
@Slf4j
public class CustomerService { public class CustomerService {
@Autowired @Autowired
@ -159,6 +161,7 @@ public class CustomerService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void turnBack(TurnBackDTO turnBackDTOS){ public void turnBack(TurnBackDTO turnBackDTOS){
if(turnBackDTOS.getWxData().getUnionId() == null || turnBackDTOS.getUserId() == null){ if(turnBackDTOS.getWxData().getUnionId() == null || turnBackDTOS.getUserId() == null){
log.info("unionId 是空不操作");
return; return;
} }
//客户信息 //客户信息
@ -170,10 +173,12 @@ public class CustomerService {
poiWrapper.eq("cp_user_id",turnBackDTOS.getUserId()).last("limit 1"); poiWrapper.eq("cp_user_id",turnBackDTOS.getUserId()).last("limit 1");
PrivilageCpUserStoreDO poiStore = privilageCpUserStoreDOMapper.selectOne(poiWrapper); PrivilageCpUserStoreDO poiStore = privilageCpUserStoreDOMapper.selectOne(poiWrapper);
if(poiStore == null){ if(poiStore == null){
log.info("店铺信息是空的不操作");
return; return;
} }
PoiStoreStaff poiStoreStaff = null; PoiStoreStaff poiStoreStaff = null;
if(!turnBackDTOS.getEaCode().equals("0")){ if(turnBackDTOS.getEaCode() == null || !turnBackDTOS.getEaCode().equals("0")){
log.info("导购code如果是0或者是空,不处理导购信息");
//导购信息 //导购信息
QueryWrapper<PoiStoreStaff> wrapper = new QueryWrapper<>(); QueryWrapper<PoiStoreStaff> wrapper = new QueryWrapper<>();
wrapper.eq("staff_code",turnBackDTOS.getEaCode()).eq("store_id",poiStore.getStoreId()).last("limit 1"); wrapper.eq("staff_code",turnBackDTOS.getEaCode()).eq("store_id",poiStore.getStoreId()).last("limit 1");
@ -187,6 +192,7 @@ public class CustomerService {
insertCustomer.setAvatarUrl(turnBackDTOS.getWxData().getAvatarUrl()); insertCustomer.setAvatarUrl(turnBackDTOS.getWxData().getAvatarUrl());
insertCustomer.setPhone(turnBackDTOS.getPhone()); insertCustomer.setPhone(turnBackDTOS.getPhone());
if(null != opCustomer){ if(null != opCustomer){
log.info("客户信息存在就修改");
//更新一下 //更新一下
insertCustomer.setId(opCustomer.getId()); insertCustomer.setId(opCustomer.getId());
opCustomerDOMapper.updateById(insertCustomer); opCustomerDOMapper.updateById(insertCustomer);
@ -195,10 +201,12 @@ public class CustomerService {
sellerCustomerRelation(opCustomer,turnBackDTOS.getEaCode(),poiStore.getId(),poiStoreStaff.getUserId()); sellerCustomerRelation(opCustomer,turnBackDTOS.getEaCode(),poiStore.getId(),poiStoreStaff.getUserId());
} }
}else { }else {
log.info("客户信息不存在在就新增");
insertCustomer.setCreateBy(Constants.SYS_OPERATION); insertCustomer.setCreateBy(Constants.SYS_OPERATION);
//不存在 //不存在
opCustomerDOMapper.insert(insertCustomer); opCustomerDOMapper.insert(insertCustomer);
if(poiStoreStaff != null) { if(poiStoreStaff != null) {
log.info("导购的信息没有就不添加导购客户的关系");
//添加关系 //添加关系
sellerCustomerRelation(insertCustomer, turnBackDTOS.getEaCode(), poiStore.getId(), poiStoreStaff.getUserId()); sellerCustomerRelation(insertCustomer, turnBackDTOS.getEaCode(), poiStore.getId(), poiStoreStaff.getUserId());
} }
@ -206,6 +214,7 @@ public class CustomerService {
//处理客户vip的关系 //处理客户vip的关系
if(turnBackDTOS.getVipData() != null){ if(turnBackDTOS.getVipData() != null){
log.info("如果有vip数据就认为是vip客户然后绑定客户vip关系");
//有vip数据就不需要重新请求bsd的vip接口 //有vip数据就不需要重新请求bsd的vip接口
vipCheck(turnBackDTOS); vipCheck(turnBackDTOS);
} }

Loading…
Cancel
Save