Commit 39ce7607 authored by zhengyi's avatar zhengyi

跟进记录单号处理逻辑修正

parent 4f0942f9
...@@ -90,30 +90,23 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -90,30 +90,23 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Long createFollowup(CustomerFollowupCreateReqVO createReqVO) { public Long createFollowup(CustomerFollowupCreateReqVO createReqVO) {
// 获取新编号
String newNumber = createReqVO.getNumber();
Long numberId = createReqVO.getNumberId();
Integer numberVersion = createReqVO.getNumberVersion();
// 编号不存在,报异常
if (StringUtils.isBlank(newNumber)) {
throw exception(ErrorCodeConstants.FOLLOWUP_NUMBER_NOT_NULL);
}
// 更新编号,内部会判断冲突 // 更新编号,内部会判断冲突
//OrderNumberLogListener
OrderNumberLogEvent event = new OrderNumberLogEvent(); OrderNumberLogEvent event = new OrderNumberLogEvent();
event.setId(numberId); event.setType(3);
event.setVersion(numberVersion);
event.setNewNumber(newNumber);
event.setType(6);
event.setNumberKey(FOLLOWUP_NEW_NUMBER); event.setNumberKey(FOLLOWUP_NEW_NUMBER);
applicationContext.publishEvent(event); applicationContext.publishEvent(event);
String newNumber = CodeUtils.getOddReceiptNumbers(event.getNumber());
// 更新跟进记录编号最新缓存
// 待将最新单号持久化
event.setNewNumber(newNumber);
applicationContext.publishEvent(event);
// 插入 // 插入
CustomerFollowupDO followup = CustomerFollowupConvert.INSTANCE.convert(createReqVO); CustomerFollowupDO followup = CustomerFollowupConvert.INSTANCE.convert(createReqVO);
// 设置联系人名称 // 设置联系人名称
setContactName(followup); setContactName(followup);
followup.setNumber(newNumber);
followupMapper.insert(followup); followupMapper.insert(followup);
Long customerId = createReqVO.getCustomerId(); Long customerId = createReqVO.getCustomerId();
...@@ -208,10 +201,10 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -208,10 +201,10 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
if (customerFollowupDO == null) { if (customerFollowupDO == null) {
throw exception(FOLLOWUP_NOT_EXISTS); throw exception(FOLLOWUP_NOT_EXISTS);
} }
//
if (CustomerFollowupStatusEnum.Commited.getValue().equals(customerFollowupDO.getStatus())) { // if (CustomerFollowupStatusEnum.Commited.getValue().equals(customerFollowupDO.getStatus())) {
throw exception(FOLLOWUP_ALREADY_SUBMITTED); // throw exception(FOLLOWUP_ALREADY_SUBMITTED);
} // }
} }
for (Long id : ids) { for (Long id : ids) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment