|
@@ -163,7 +163,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
wrapper.orderByDesc("c.id IN ( " + join + " )");
|
|
wrapper.orderByDesc("c.id IN ( " + join + " )");
|
|
}
|
|
}
|
|
|
|
|
|
- wrapper.orderByDesc("c", Customer::getUpdateTime);
|
|
|
|
|
|
+ wrapper.orderByDesc("c", Customer::getAllocationTime);
|
|
wrapper.orderByDesc("c", Customer::getCreateTime);
|
|
wrapper.orderByDesc("c", Customer::getCreateTime);
|
|
|
|
|
|
Page<CustomerVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
Page<CustomerVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
@@ -229,6 +229,11 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
@Override
|
|
@Override
|
|
@DSTransactional
|
|
@DSTransactional
|
|
public void add(CustomerDto customerDto) {
|
|
public void add(CustomerDto customerDto) {
|
|
|
|
+ //赋值业务员分配时间
|
|
|
|
+ if (ObjectUtil.isNotEmpty(customerDto.getUserId())) {
|
|
|
|
+ customerDto.setAllocationTime(new Date());
|
|
|
|
+ }
|
|
|
|
+
|
|
//客户名称 唯一检查
|
|
//客户名称 唯一检查
|
|
Customer repeatCustomer = this.getOne(q -> q.eq(Customer::getName, customerDto.getName()));
|
|
Customer repeatCustomer = this.getOne(q -> q.eq(Customer::getName, customerDto.getName()));
|
|
if (ObjectUtil.isNotEmpty(repeatCustomer)) {
|
|
if (ObjectUtil.isNotEmpty(repeatCustomer)) {
|
|
@@ -253,6 +258,13 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|
@DSTransactional
|
|
@DSTransactional
|
|
@Override
|
|
@Override
|
|
public void edit(CustomerDto customerDto) {
|
|
public void edit(CustomerDto customerDto) {
|
|
|
|
+
|
|
|
|
+ //修改业务员时 重新赋值分配时间
|
|
|
|
+ Customer oldCustomer = this.getById(customerDto.getId());
|
|
|
|
+ if (!Objects.equals(oldCustomer.getUserId(), customerDto.getUserId())) {
|
|
|
|
+ customerDto.setAllocationTime(new Date());
|
|
|
|
+ }
|
|
|
|
+
|
|
//客户名称 唯一检查
|
|
//客户名称 唯一检查
|
|
Customer repeatCustomer = this.getOne(q -> q.eq(Customer::getName, customerDto.getName()).ne(Customer::getId, customerDto.getId()));
|
|
Customer repeatCustomer = this.getOne(q -> q.eq(Customer::getName, customerDto.getName()).ne(Customer::getId, customerDto.getId()));
|
|
if (ObjectUtil.isNotEmpty(repeatCustomer)) {
|
|
if (ObjectUtil.isNotEmpty(repeatCustomer)) {
|