|
@@ -15,6 +15,7 @@ import com.ejlchina.searcher.SearchResult;
|
|
|
import com.ejlchina.searcher.util.MapBuilder;
|
|
import com.ejlchina.searcher.util.MapBuilder;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -71,15 +72,22 @@ public class CmsGroupsRelationExpiryController {
|
|
|
* 客服进行跟进
|
|
* 客服进行跟进
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/reBuy")
|
|
@PostMapping("/reBuy")
|
|
|
|
|
+ @Transactional(rollbackFor = Throwable.class)
|
|
|
public Result<String> recordReBuy(@RequestBody GroupsRelationCustomerServiceFollowRecord record) {
|
|
public Result<String> recordReBuy(@RequestBody GroupsRelationCustomerServiceFollowRecord record) {
|
|
|
Long ecId = record.getEcId();
|
|
Long ecId = record.getEcId();
|
|
|
- if (ecId == null || groupsRelationExpiryRecordMapper.selectById(ecId) == null) {
|
|
|
|
|
|
|
+ if (ecId == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请选择对应的跟进车票");
|
|
|
|
|
+ }
|
|
|
|
|
+ GroupsRelationExpiryRecord groupsRelationExpiryRecord = groupsRelationExpiryRecordMapper.selectById(ecId);
|
|
|
|
|
+ if (groupsRelationExpiryRecord == null) {
|
|
|
throw BusinessRuntimeException.getInstance("请选择对应的跟进车票");
|
|
throw BusinessRuntimeException.getInstance("请选择对应的跟进车票");
|
|
|
}
|
|
}
|
|
|
if (StrUtil.isAllBlank(record.getContent(), record.getImgs())) {
|
|
if (StrUtil.isAllBlank(record.getContent(), record.getImgs())) {
|
|
|
throw BusinessRuntimeException.getInstance("请完善对应跟进信息");
|
|
throw BusinessRuntimeException.getInstance("请完善对应跟进信息");
|
|
|
}
|
|
}
|
|
|
relationCustomerServiceFollowRecordMapper.insert(record);
|
|
relationCustomerServiceFollowRecordMapper.insert(record);
|
|
|
|
|
+ groupsRelationExpiryRecord.setIsFollow(true);
|
|
|
|
|
+ groupsRelationExpiryRecordMapper.updateById(groupsRelationExpiryRecord);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|