门店号管理

master
LegnaYet 6 years ago
parent 0a7781860a
commit b90b8ee452

@ -38,7 +38,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -162,6 +161,7 @@ public class CustomerService {
* @param turnBackDTOS * @param turnBackDTOS
* @return * @return
*/ */
@Transactional(rollbackFor = Exception.class)
public void turnBack(TurnBackDTO turnBackDTOS) throws Exception { public void turnBack(TurnBackDTO turnBackDTOS) throws Exception {
if (turnBackDTOS.getWxData().getUnionId() == null || turnBackDTOS.getUserId() == null) { if (turnBackDTOS.getWxData().getUnionId() == null || turnBackDTOS.getUserId() == null) {
return; return;
@ -189,13 +189,6 @@ public class CustomerService {
} }
//做插入使用 --如果没有客户信息就先创建客户信息如果有就判断是否有客户导购得关系,如果没有就添加有就不管 //做插入使用 --如果没有客户信息就先创建客户信息如果有就判断是否有客户导购得关系,如果没有就添加有就不管
vipDataUpdate(turnBackDTOS, shop, opCustomer, poiStoreStaff, poiStore);
//todo 发送websocket放开
// WebSocketController.sendInfo(new Gson().toJson(insertCustomer));
}
@Transactional(rollbackFor = Exception.class)
public void vipDataUpdate(TurnBackDTO turnBackDTOS, PoiStore shop, OpCustomer opCustomer, PoiStoreStaff poiStoreStaff, PrivilageCpUserStoreDO poiStore) throws Exception {
OpCustomer insertCustomer = new OpCustomer(); OpCustomer insertCustomer = new OpCustomer();
insertCustomer.setWechatUniId(turnBackDTOS.getWxData().getUnionId()); insertCustomer.setWechatUniId(turnBackDTOS.getWxData().getUnionId());
insertCustomer.setName(turnBackDTOS.getName()); insertCustomer.setName(turnBackDTOS.getName());
@ -212,23 +205,22 @@ public class CustomerService {
try { try {
opCustomerDOMapper.updateById(insertCustomer); opCustomerDOMapper.updateById(insertCustomer);
}catch (Exception e) { }catch (Exception e) {
System.out.println(insertCustomer.toString()); log.error(insertCustomer.toString(),e);
return; return;
} }
if (poiStoreStaff != null) { if (poiStoreStaff != null) {
//存在--1.处理客户导购关系。 //存在--1.处理客户导购关系。
try { try {
sellerCustomerRelation(opCustomer, turnBackDTOS.getEaCode(),sdf.parse(turnBackDTOS.getJoinTime()), poiStore.getStoreId(), poiStoreStaff.getId()); sellerCustomerRelation(opCustomer, turnBackDTOS.getEaCode(),sdf.parse(turnBackDTOS.getJoinTime()), poiStore.getStoreId(), poiStoreStaff.getId());
}catch (Exception e) { }catch (Exception e) {
System.out.println(opCustomer.toString()); log.error(opCustomer.toString(),e);
return; return;
} }
} else { } else {
try { try {
storeCustomerRelation(opCustomer,sdf.parse(turnBackDTOS.getJoinTime()), poiStore.getStoreId()); storeCustomerRelation(opCustomer,sdf.parse(turnBackDTOS.getJoinTime()), poiStore.getStoreId());
}catch (Exception e) { }catch (Exception e) {
System.out.println(opCustomer.toString()); log.error(opCustomer.toString(),e);
return; return;
} }
} }
@ -238,7 +230,7 @@ public class CustomerService {
try { try {
opCustomerDOMapper.insert(insertCustomer); opCustomerDOMapper.insert(insertCustomer);
}catch (Exception e) { }catch (Exception e) {
System.out.println(insertCustomer.toString()); log.error(insertCustomer.toString(),e);
return; return;
} }
@ -247,14 +239,14 @@ public class CustomerService {
try { try {
sellerCustomerRelation(insertCustomer, turnBackDTOS.getEaCode(),sdf.parse(turnBackDTOS.getJoinTime()), poiStore.getStoreId(), poiStoreStaff.getId()); sellerCustomerRelation(insertCustomer, turnBackDTOS.getEaCode(),sdf.parse(turnBackDTOS.getJoinTime()), poiStore.getStoreId(), poiStoreStaff.getId());
}catch (Exception e) { }catch (Exception e) {
System.out.println(insertCustomer.toString()); log.error(insertCustomer.toString(),e);
return; return;
} }
} else { } else {
try { try {
storeCustomerRelation(insertCustomer, sdf.parse(turnBackDTOS.getJoinTime()),poiStore.getStoreId()); storeCustomerRelation(insertCustomer, sdf.parse(turnBackDTOS.getJoinTime()),poiStore.getStoreId());
}catch (Exception e) { }catch (Exception e) {
System.out.println(insertCustomer.toString()); log.error(insertCustomer.toString(),e);
return; return;
} }
} }
@ -265,6 +257,8 @@ public class CustomerService {
//有vip数据就不需要重新请求bsd的vip接口 //有vip数据就不需要重新请求bsd的vip接口
vipCheck(turnBackDTOS); vipCheck(turnBackDTOS);
} }
//todo 发送websocket放开
// WebSocketController.sendInfo(new Gson().toJson(insertCustomer));
} }
/** /**

Loading…
Cancel
Save