业务部门信息

This commit is contained in:
易焱
2019-07-31 01:49:55 +08:00
parent daa60cf523
commit 510b40573a
20 changed files with 93 additions and 53 deletions
@@ -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")
@@ -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);
}
@@ -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);
}
@@ -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;
}
}