|
|
@ -144,6 +144,18 @@ public class CustomerService {
|
|
|
|
insertRelation.setUserId(sellerId);
|
|
|
|
insertRelation.setUserId(sellerId);
|
|
|
|
insertRelation.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
insertRelation.setCreateBy(Constants.SYS_OPERATION);
|
|
|
|
insertRelation.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
insertRelation.setUpdateBy(Constants.SYS_OPERATION);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否有效
|
|
|
|
|
|
|
|
QueryWrapper<OpSellerCustomerRelation> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
wrapper.eq("customer_id",opCustomer.getId()).last("limit 1");
|
|
|
|
|
|
|
|
OpSellerCustomerRelation op = opSellerCustomerRelationDOMapper.selectOne(wrapper);
|
|
|
|
|
|
|
|
if(op == null){
|
|
|
|
|
|
|
|
//有效
|
|
|
|
|
|
|
|
insertRelation.setType(1);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
//无效
|
|
|
|
|
|
|
|
insertRelation.setType(2);
|
|
|
|
|
|
|
|
}
|
|
|
|
opSellerCustomerRelationDOMapper.insert(insertRelation);
|
|
|
|
opSellerCustomerRelationDOMapper.insert(insertRelation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|