|
@@ -26,6 +26,7 @@ import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -126,11 +127,12 @@ public class CustomerFollowRecordsServiceImpl extends ServiceImpl<CustomerFollow
|
|
|
@DSTransactional
|
|
|
@Override
|
|
|
public void delete(Long id) {
|
|
|
+ CustomerFollowRecords customerFollowRecords = this.getById(id);
|
|
|
+
|
|
|
this.removeById(id);
|
|
|
ObsFileUtil.removeFile(id);
|
|
|
|
|
|
//更新最后一次跟进时间
|
|
|
- CustomerFollowRecords customerFollowRecords = this.getById(id);
|
|
|
if (ObjectUtil.isNotEmpty(customerFollowRecords)) {
|
|
|
updateLastFollowTime(customerFollowRecords.getCustomerId());
|
|
|
}
|
|
@@ -146,12 +148,12 @@ public class CustomerFollowRecordsServiceImpl extends ServiceImpl<CustomerFollow
|
|
|
.orderByDesc(CustomerFollowRecords::getDate)
|
|
|
.orderByDesc(CustomerFollowRecords::getId)
|
|
|
);
|
|
|
- if (ObjectUtil.isNotEmpty(customerFollowRecords)) {
|
|
|
- customerService.update(q -> q
|
|
|
- .eq(Customer::getId, customerId)
|
|
|
- .set(Customer::getLastFollowTime, customerFollowRecords.getDate())
|
|
|
- );
|
|
|
- }
|
|
|
+ Date lastFollowTime = ObjectUtil.isNotEmpty(customerFollowRecords) ? customerFollowRecords.getDate() : null;
|
|
|
+ customerService.update(q -> q
|
|
|
+ .eq(Customer::getId, customerId)
|
|
|
+ .set(Customer::getLastFollowTime, lastFollowTime)
|
|
|
+ );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|