业务部门信息
This commit is contained in:
@@ -3,7 +3,9 @@ package com.cwhelp.modules.business.domain;
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.common.utils.StatusUtil;
|
||||
import com.cwhelp.modules.system.domain.User;
|
||||
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
@@ -56,6 +58,7 @@ public class BssPlatform implements Serializable {
|
||||
private Date updateDate;
|
||||
// 创建者
|
||||
@CreatedBy
|
||||
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class,property = "@id")
|
||||
@ManyToOne(fetch= FetchType.LAZY)
|
||||
@NotFound(action=NotFoundAction.IGNORE)
|
||||
@JoinColumn(name="create_by")
|
||||
@@ -63,6 +66,7 @@ public class BssPlatform implements Serializable {
|
||||
private User createBy;
|
||||
// 更新者
|
||||
@LastModifiedBy
|
||||
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class,property = "@id")
|
||||
@ManyToOne(fetch=FetchType.LAZY)
|
||||
@NotFound(action=NotFoundAction.IGNORE)
|
||||
@JoinColumn(name="update_by")
|
||||
|
||||
+5
-1
@@ -8,5 +8,9 @@ import com.cwhelp.modules.system.repository.BaseRepository;
|
||||
* @author yan.y
|
||||
* @date 2019/07/28
|
||||
*/
|
||||
public interface BssPlatformRepository extends BaseRepository<BssPlatform, Long> {
|
||||
public interface BssPlatformRepository extends BaseRepository<BssPlatform, Long>{
|
||||
|
||||
BssPlatform findByContactTelAndIdNot(String contactTel,Long id);
|
||||
BssPlatform findByContactCardAndIdNot(String contactCard,Long id);
|
||||
BssPlatform findByEmailAndIdNot(String email,Long id);
|
||||
}
|
||||
+5
@@ -47,4 +47,9 @@ public interface BssPlatformService {
|
||||
* @param sort 排序对象
|
||||
*/
|
||||
List<BssPlatform> getListByExample(Example<BssPlatform> example, Sort sort);
|
||||
|
||||
boolean repeatByContactTel(BssPlatform bssPlatform);
|
||||
boolean repeatByContactCard(BssPlatform bssPlatform);
|
||||
boolean repeatByEmail(BssPlatform bssPlatform);
|
||||
|
||||
}
|
||||
+18
@@ -75,4 +75,22 @@ public class BssPlatformServiceImpl implements BssPlatformService {
|
||||
public List<BssPlatform> getListByExample(Example<BssPlatform> example, Sort sort) {
|
||||
return bssPlatformRepository.findAll(example, sort);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean repeatByContactTel(BssPlatform bssPlatform) {
|
||||
Long id = bssPlatform.getId() != null ? bssPlatform.getId() : Long.MIN_VALUE;
|
||||
return bssPlatformRepository.findByContactTelAndIdNot(bssPlatform.getContactTel(), id) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean repeatByContactCard(BssPlatform bssPlatform) {
|
||||
Long id = bssPlatform.getId() != null ? bssPlatform.getId() : Long.MIN_VALUE;
|
||||
return bssPlatformRepository.findByContactCardAndIdNot(bssPlatform.getContactCard(), id) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean repeatByEmail(BssPlatform bssPlatform) {
|
||||
Long id = bssPlatform.getId() != null ? bssPlatform.getId() : Long.MIN_VALUE;
|
||||
return bssPlatformRepository.findByEmailAndIdNot(bssPlatform.getEmail(), id) != null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user