This commit is contained in:
@@ -27,6 +27,8 @@ import com.eactive.eai.rms.onl.manage.inflow.history.InflowControlHistoryManUISe
|
||||
import com.eactive.eai.rms.onl.manage.inflow.inflow.InflowControlManMapper;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.Tuple;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.StringPath;
|
||||
import com.querydsl.jpa.impl.JPAQuery;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
|
||||
@@ -46,7 +48,12 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
|
||||
@Autowired
|
||||
InflowControlManMapper mapper;
|
||||
|
||||
public Page<InflowControlServiceDto> findAllForAdapter(Pageable pageable, String searchName) {
|
||||
// 유량제어 미설정(useyn null)은 "사용안함" 검색 시 함께 조회되도록 처리
|
||||
private static BooleanExpression useYnCondition(StringPath useYnPath, String searchUseYn) {
|
||||
return "0".equals(searchUseYn) ? useYnPath.eq(searchUseYn).or(useYnPath.isNull()) : useYnPath.eq(searchUseYn);
|
||||
}
|
||||
|
||||
public Page<InflowControlServiceDto> findAllForAdapter(Pageable pageable, String searchName, String searchUseYn) {
|
||||
JPAQueryFactory jpaQueryFactory = new JPAQueryFactory(entityManager);
|
||||
QAdapterGroup qAdapterGroup = QAdapterGroup.adapterGroup;
|
||||
QInflowControl qInflowControl = QInflowControl.inflowControl;
|
||||
@@ -54,6 +61,8 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
|
||||
BooleanBuilder boolBuilder = new BooleanBuilder();
|
||||
if (!StringUtils.isEmpty(searchName))
|
||||
boolBuilder.and(qAdapterGroup.adptrbzwkgroupname.contains(searchName));
|
||||
if (!StringUtils.isEmpty(searchUseYn))
|
||||
boolBuilder.and(useYnCondition(qInflowControl.useyn, searchUseYn));
|
||||
|
||||
BooleanBuilder adapterWherePredicate = new BooleanBuilder(qAdapterGroup.adptriodstcd
|
||||
.eq("I")
|
||||
@@ -84,6 +93,10 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
|
||||
long totalCount = jpaQueryFactory
|
||||
.select(qAdapterGroup.adptrbzwkgroupname.count())
|
||||
.from(qAdapterGroup)
|
||||
.leftJoin(qInflowControl)
|
||||
.on(qAdapterGroup.adptrbzwkgroupname
|
||||
.eq(qInflowControl.id.name)
|
||||
.and(qInflowControl.id.type.eq(ADAPTER_TYPE_INFLOW)))
|
||||
.where(boolBuilder)
|
||||
.fetchOne();
|
||||
|
||||
@@ -121,17 +134,22 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
|
||||
return toDto(qAdapterGroup, qInflowControl, tuple);
|
||||
}
|
||||
|
||||
public Page<InflowControlServiceDto> findAllForInterface(Pageable pageable, String searchName) {
|
||||
public Page<InflowControlServiceDto> findAllForInterface(Pageable pageable, String searchName, String searchUseYn) {
|
||||
JPAQueryFactory jpaQueryFactory = new JPAQueryFactory(entityManager);
|
||||
QInflowControl qInflowControl = QInflowControl.inflowControl;
|
||||
QEAIMessageEntity qEAIMessageEntity = QEAIMessageEntity.eAIMessageEntity;
|
||||
|
||||
BooleanBuilder boolBuilder = new BooleanBuilder();
|
||||
boolBuilder.and(qEAIMessageEntity.eaisvcname.contains(searchName));
|
||||
if (!StringUtils.isEmpty(searchUseYn))
|
||||
boolBuilder.and(useYnCondition(qInflowControl.useyn, searchUseYn));
|
||||
|
||||
List<Tuple> tupleList = jpaQueryFactory
|
||||
.select(qInflowControl, qEAIMessageEntity.eaisvcname, qEAIMessageEntity.eaisvcdesc)
|
||||
.from(qEAIMessageEntity)
|
||||
.leftJoin(qInflowControl)
|
||||
.on(qInflowControl.id.type.eq(INTERFACE_TYPE_INFLOW).and(qInflowControl.id.name.eq(qEAIMessageEntity.eaisvcname)))
|
||||
.where(qEAIMessageEntity.eaisvcname.contains(searchName))
|
||||
.where(boolBuilder)
|
||||
.orderBy(qEAIMessageEntity.eaisvcname.asc())
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
@@ -145,7 +163,9 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
|
||||
long totalCount = jpaQueryFactory
|
||||
.select(qEAIMessageEntity.eaisvcname.count())
|
||||
.from(qEAIMessageEntity)
|
||||
.where(qEAIMessageEntity.eaisvcname.contains(searchName))
|
||||
.leftJoin(qInflowControl)
|
||||
.on(qInflowControl.id.type.eq(INTERFACE_TYPE_INFLOW).and(qInflowControl.id.name.eq(qEAIMessageEntity.eaisvcname)))
|
||||
.where(boolBuilder)
|
||||
.fetchOne();
|
||||
return new PageImpl<>(dtoList, pageable, totalCount);
|
||||
}
|
||||
@@ -199,19 +219,24 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
|
||||
return toDto(qClientEntity, qInflowControl, tuple);
|
||||
}
|
||||
|
||||
public Page<InflowControlServiceDto> findAllForClient(Pageable pageable, String searchName) {
|
||||
|
||||
public Page<InflowControlServiceDto> findAllForClient(Pageable pageable, String searchName, String searchUseYn) {
|
||||
|
||||
JPAQueryFactory jpaQueryFactory = new JPAQueryFactory(entityManager);
|
||||
QInflowControl qInflowControl = QInflowControl.inflowControl;
|
||||
QClientEntity qClientEntity = QClientEntity.clientEntity;
|
||||
|
||||
BooleanBuilder boolBuilder = new BooleanBuilder();
|
||||
boolBuilder.and(qClientEntity.clientname.contains(searchName));
|
||||
if (!StringUtils.isEmpty(searchUseYn))
|
||||
boolBuilder.and(useYnCondition(qInflowControl.useyn, searchUseYn));
|
||||
|
||||
List<Tuple> tupleList = jpaQueryFactory
|
||||
.select(qInflowControl, qClientEntity.clientid, qClientEntity.clientname)
|
||||
.from(qClientEntity)
|
||||
.leftJoin(qInflowControl)
|
||||
.on(qInflowControl.id.type.eq(CLIENT_TYPE_INFLOW)
|
||||
.and(qInflowControl.id.name.eq(qClientEntity.clientid)))
|
||||
.where(qClientEntity.clientname.contains(searchName))
|
||||
.where(boolBuilder)
|
||||
.orderBy(qClientEntity.clientname.asc())
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
@@ -225,7 +250,10 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
|
||||
long totalCount = jpaQueryFactory
|
||||
.select(qClientEntity.clientname.count())
|
||||
.from(qClientEntity)
|
||||
.where(qClientEntity.clientname.contains(searchName))
|
||||
.leftJoin(qInflowControl)
|
||||
.on(qInflowControl.id.type.eq(CLIENT_TYPE_INFLOW)
|
||||
.and(qInflowControl.id.name.eq(qClientEntity.clientid)))
|
||||
.where(boolBuilder)
|
||||
.fetchOne();
|
||||
return new PageImpl<>(dtoList, pageable, totalCount);
|
||||
}
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ public class InflowGroupControlManController extends OnlBaseAnnotationController
|
||||
*/
|
||||
@RequestMapping(value = "/onl/admin/inflow/inflowGroupControlMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<InflowGroupControlManUI>> selectList(HttpServletRequest request,
|
||||
Pageable pageVo, String searchGroupName) {
|
||||
Page<InflowGroupControlManUI> uiPage = service.selectGroupList(pageVo, searchGroupName);
|
||||
Pageable pageVo, String searchGroupName, String searchUseYn) {
|
||||
Page<InflowGroupControlManUI> uiPage = service.selectGroupList(pageVo, searchGroupName, searchUseYn);
|
||||
return ResponseEntity.ok(new GridResponse<>(uiPage));
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -61,7 +61,7 @@ public class InflowGroupControlManService extends BaseService {
|
||||
/**
|
||||
* 그룹 목록 조회
|
||||
*/
|
||||
public Page<InflowGroupControlManUI> selectGroupList(Pageable pageable, String searchGroupName) {
|
||||
public Page<InflowGroupControlManUI> selectGroupList(Pageable pageable, String searchGroupName, String searchUseYn) {
|
||||
JPAQueryFactory jpaQueryFactory = new JPAQueryFactory(entityManager);
|
||||
QInflowControlGroup qGroup = QInflowControlGroup.inflowControlGroup;
|
||||
|
||||
@@ -69,6 +69,10 @@ public class InflowGroupControlManService extends BaseService {
|
||||
if (!StringUtils.isEmpty(searchGroupName)) {
|
||||
boolBuilder.and(qGroup.groupName.contains(searchGroupName));
|
||||
}
|
||||
if (!StringUtils.isEmpty(searchUseYn)) {
|
||||
// 유량제어 미설정(useYn null)은 "사용안함" 검색 시 함께 조회되도록 처리
|
||||
boolBuilder.and("0".equals(searchUseYn) ? qGroup.useYn.eq(searchUseYn).or(qGroup.useYn.isNull()) : qGroup.useYn.eq(searchUseYn));
|
||||
}
|
||||
|
||||
List<InflowControlGroup> groupList = jpaQueryFactory
|
||||
.selectFrom(qGroup)
|
||||
|
||||
+2
-2
@@ -42,8 +42,8 @@ public class InflowAdapterControlManController extends OnlBaseAnnotationControll
|
||||
|
||||
@RequestMapping(value = "/onl/admin/inflow/inflowAdapterControlMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<InflowControlManUI>> selectList(HttpServletRequest request, Pageable pageVo,
|
||||
String searchName) {
|
||||
Page<InflowControlManUI> uiPage = service.selectAdapterList(pageVo, searchName);
|
||||
String searchName, String searchUseYn) {
|
||||
Page<InflowControlManUI> uiPage = service.selectAdapterList(pageVo, searchName, searchUseYn);
|
||||
return ResponseEntity.ok(new GridResponse<>(uiPage));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public class InflowClientControlManController extends OnlBaseAnnotationControlle
|
||||
|
||||
@RequestMapping(value = "/onl/admin/inflow/inflowClientControlMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<InflowControlManUI>> selectList(HttpServletRequest request, Pageable pageVo,
|
||||
String searchName) {
|
||||
Page<InflowControlManUI> uiPage = service.selectClientList(pageVo, searchName);
|
||||
String searchName, String searchUseYn) {
|
||||
Page<InflowControlManUI> uiPage = service.selectClientList(pageVo, searchName, searchUseYn);
|
||||
return ResponseEntity.ok(new GridResponse<>(uiPage));
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -52,8 +52,8 @@ public class InflowControlManService extends BaseService {
|
||||
private RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
// 어댑터 유량제어
|
||||
public Page<InflowControlManUI> selectAdapterList(Pageable pageable, String searchName) {
|
||||
Page<InflowControlServiceDto> dtoList = service.findAllForAdapter(pageable, searchName);
|
||||
public Page<InflowControlManUI> selectAdapterList(Pageable pageable, String searchName, String searchUseYn) {
|
||||
Page<InflowControlServiceDto> dtoList = service.findAllForAdapter(pageable, searchName, searchUseYn);
|
||||
return dtoList.map(mapper::toVo);
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ public class InflowControlManService extends BaseService {
|
||||
}
|
||||
|
||||
// 인터페이스 유량제어
|
||||
public Page<InflowControlManUI> selectInterfaceList(Pageable pageable, String searchName) {
|
||||
Page<InflowControlServiceDto> dtoList = service.findAllForInterface(pageable, searchName);
|
||||
public Page<InflowControlManUI> selectInterfaceList(Pageable pageable, String searchName, String searchUseYn) {
|
||||
Page<InflowControlServiceDto> dtoList = service.findAllForInterface(pageable, searchName, searchUseYn);
|
||||
return dtoList.map(mapper::toVo);
|
||||
}
|
||||
|
||||
@@ -120,8 +120,8 @@ public class InflowControlManService extends BaseService {
|
||||
|
||||
|
||||
// 클라이언트 유량제어
|
||||
public Page<InflowControlManUI> selectClientList(Pageable pageable, String searchName) {
|
||||
Page<InflowControlServiceDto> dtoList = service.findAllForClient(pageable, searchName);
|
||||
public Page<InflowControlManUI> selectClientList(Pageable pageable, String searchName, String searchUseYn) {
|
||||
Page<InflowControlServiceDto> dtoList = service.findAllForClient(pageable, searchName, searchUseYn);
|
||||
return dtoList.map(mapper::toVo);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -42,8 +42,8 @@ public class InflowInterfaceControlManController extends OnlBaseAnnotationContro
|
||||
|
||||
@RequestMapping(value = "/onl/admin/inflow/inflowInterfaceControlMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<InflowControlManUI>> selectList(HttpServletRequest request, Pageable pageVo,
|
||||
String searchName) {
|
||||
Page<InflowControlManUI> uiPage = service.selectInterfaceList(pageVo, searchName);
|
||||
String searchName, String searchUseYn) {
|
||||
Page<InflowControlManUI> uiPage = service.selectInterfaceList(pageVo, searchName, searchUseYn);
|
||||
return ResponseEntity.ok(new GridResponse<>(uiPage));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user