- 유량제어 이력 그룹ID -> 그룹명 표시

This commit is contained in:
daekuk
2026-01-02 15:13:50 +09:00
parent 4a2d774b2a
commit eb55e410f0
6 changed files with 124 additions and 7 deletions
@@ -31,6 +31,22 @@ function timeStampFormat2(cellvalue, options, rowObject){
}
function groupNameFormat(cellvalue, options, rowObject) {
if (!cellvalue) return "";
var strVal = cellvalue.toString().trim();
if (strVal.length === 36) {
// 그룹ID의 경우 GROUPNAME 으로 보여줌
var groupName = rowObject.GROUPNAME;
// 비어있다면 원래 값을 반환
return groupName ? groupName : strVal;
}
return strVal;
}
$(document).ready(function() {
$("input[name=searchStartYYYYMMDD],input[name=searchEndYYYYMMDD]").inputmask("yyyy-mm-dd",{'autoUnmask':true});
@@ -66,10 +82,11 @@ $(document).ready(function() {
'<%= localeMessage.getString("infConHstMan.eaiSvcSrlNum") %>',
'<%= localeMessage.getString("infConHstMan.instNm") %>',
'<%= localeMessage.getString("infConHstMan.eaiSvcCd") %>',
'<%= localeMessage.getString("infConHstMan.adpGrpNm") %>',
'그룹별 / <%= localeMessage.getString("infConHstMan.adpGrpNm") %>',
'<%= localeMessage.getString("infAdpConMan.thrPerSecond") %>',
'<%= localeMessage.getString("infAdpConMan.thr") %>',
'<%= localeMessage.getString("infAdpConMan.thrTimeUnit") %>'
'<%= localeMessage.getString("infAdpConMan.thrTimeUnit") %>',
'그룹별'
],
colModel:[
{ name : 'EAIBZWKDSTCD' , width:'50' , align:'center' , sortable:false },
@@ -77,10 +94,11 @@ $(document).ready(function() {
{ name : 'EAISVCSERNO' , width:'150', align:'left' },
{ name : 'EAISEVRINSTNCNAME' , width:'50' , align:'center' },
{ name : 'EAISVCNAME' , width:'70' , align:'center' },
{ name : 'ADPTRBZWKGROUPNAME' , width:'70' , align:'center' },
{ name : 'THRESHOLDPERSECOND' , width:'40' , align:'right' },
{ name : 'THRESHOLD' , width:'40' , align:'right' },
{ name : 'THRESHOLDTIMEUNIT' , width:'70' , align:'center' }
{ name : 'ADPTRBZWKGROUPNAME' , width:'100' , align:'center' , formatter: groupNameFormat },
{ name : 'THRESHOLDPERSECOND' , width:'30' , align:'right' },
{ name : 'THRESHOLD' , width:'30' , align:'right' },
{ name : 'THRESHOLDTIMEUNIT' , width:'50' , align:'center' },
{ name : 'GROUPNAME' , width:'70' , hidden:true }
],
jsonReader: {
repeatitems:false
@@ -1,19 +1,33 @@
package com.eactive.eai.rms.data.entity.onl.inflow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import com.eactive.eai.data.entity.onl.inflow.InflowControlLog;
import com.eactive.eai.data.entity.onl.inflow.InflowControlLogId;
import com.eactive.eai.data.entity.onl.inflow.QInflowControlGroup;
import com.eactive.eai.data.entity.onl.inflow.QInflowControlLog;
import com.eactive.eai.data.jpa.AbstractDataService;
import com.eactive.eai.rms.onl.manage.inflow.history.InflowControlHistoryManMapper;
import com.eactive.eai.rms.onl.manage.inflow.history.InflowControlHistoryManUI;
import com.eactive.eai.rms.onl.manage.inflow.history.InflowControlHistoryManUISearch;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.Tuple;
@Service
public class InflowControlLogService
extends AbstractDataService<InflowControlLog, InflowControlLogId, InflowControlLogRepository> {
private final InflowControlService inflowControlService;
private final InflowControlHistoryManMapper inflowControlHistoryManMapper;
@Autowired
public InflowControlLogService(InflowControlService inflowControlService, InflowControlHistoryManMapper inflowControlHistoryManMapper) {
this.inflowControlService = inflowControlService;
this.inflowControlHistoryManMapper = inflowControlHistoryManMapper;
}
public Page<InflowControlLog> findAll(Pageable pageable, InflowControlHistoryManUISearch uiSearch) {
QInflowControlLog qInflowConfrolLog = QInflowControlLog.inflowControlLog;
@@ -25,6 +39,28 @@ public class InflowControlLogService
return super.repository.findAll(booleanBuilder, pageable);
}
public Page<InflowControlHistoryManUI> selectList(Pageable pageable, InflowControlHistoryManUISearch uiSearch) {
Page<Tuple> tuples = inflowControlService.selectLogList(pageable, uiSearch);
return tuples.map(tuple -> {
InflowControlLog inflowControlLog = tuple.get(QInflowControlLog.inflowControlLog);
String groupName = tuple.get(QInflowControlGroup.inflowControlGroup.groupName);
InflowControlHistoryManUI inflowControlHistoryManUI;
inflowControlHistoryManUI = inflowControlHistoryManMapper.toVo(inflowControlLog);
inflowControlHistoryManUI.setGroupname(groupName);
return inflowControlHistoryManUI;
});
}
public Iterable<InflowControlLog> findAll(InflowControlHistoryManUISearch uiSearch) {
QInflowControlLog qInflowConfrolLog = QInflowControlLog.inflowControlLog;
BooleanBuilder booleanBuilder = new BooleanBuilder();
@@ -17,11 +17,16 @@ import com.eactive.eai.data.entity.onl.adapter.QAdapterGroup;
import com.eactive.eai.data.entity.onl.inflow.InflowControl;
import com.eactive.eai.data.entity.onl.inflow.InflowControlId;
import com.eactive.eai.data.entity.onl.inflow.QInflowControl;
import com.eactive.eai.data.entity.onl.inflow.QInflowControlGroup;
import com.eactive.eai.data.entity.onl.inflow.QInflowControlLog;
import com.eactive.eai.data.entity.onl.message.QEAIMessageEntity;
import com.eactive.eai.data.jpa.AbstractDataService;
import com.eactive.eai.rms.onl.manage.inflow.history.InflowControlHistoryManUISearch;
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.OrderSpecifier;
import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
@Service
@@ -168,5 +173,45 @@ public class InflowControlService extends AbstractDataService<InflowControl, Inf
return toDto(qEAIMessageEntity, qInflowControl, tuple);
}
public Page<Tuple> selectLogList(Pageable pageable, InflowControlHistoryManUISearch uiSearch) {
QInflowControlLog qlog = QInflowControlLog.inflowControlLog;
QInflowControlGroup qgroup = QInflowControlGroup.inflowControlGroup;
JPAQuery<Tuple> jpaQuery = createBaseQuery(uiSearch);
long totalCount = jpaQuery.select(QInflowControlLog.inflowControlLog.count()).fetchOne();
List<Tuple> inflowControlLog = jpaQuery
.select(qlog, qgroup.groupName)
.limit(pageable.getPageSize())
.offset(pageable.getOffset())
.orderBy(qlog.id.msgdpstyms.desc())
.fetch();
return new PageImpl<>(inflowControlLog, pageable, totalCount);
}
private JPAQuery<Tuple> createBaseQuery(InflowControlHistoryManUISearch uiSearch) {
QInflowControlLog qInflowConfrolLog = QInflowControlLog.inflowControlLog;
QInflowControlGroup qinflowControlGroup = QInflowControlGroup.inflowControlGroup;
BooleanBuilder predicate = new BooleanBuilder();
predicate
.and(qInflowConfrolLog.id.msgdpstyms
.between(uiSearch.getSearchStartDate() + "000000000",
uiSearch.getSearchEndDate() + "235959999"));
return getJPAQueryFactory()
.select(
qInflowConfrolLog,
qinflowControlGroup.groupName
)
.from(qInflowConfrolLog)
.leftJoin(qinflowControlGroup)
.on(qInflowConfrolLog.adptrbzwkgroupname.eq(qinflowControlGroup.groupId))
.where(predicate);
}
}
@@ -31,6 +31,13 @@ public class InflowControlHistoryManController extends OnlBaseAnnotationControll
return "/onl/admin/inflow/inflowControlHistoryMan";
}
// @RequestMapping(value = "/onl/admin/inflow/inflowControlHistoryMan.json", params = "cmd=LIST")
// public ResponseEntity<GridResponse<InflowControlHistoryManUI>> selectList(HttpServletRequest request,
// Pageable pageable, InflowControlHistoryManUISearch uiSearch) {
// Page<InflowControlHistoryManUI> uiPage = service.selectList(pageable, uiSearch);
// return ResponseEntity.ok(new GridResponse<>(uiPage));
// }
@RequestMapping(value = "/onl/admin/inflow/inflowControlHistoryMan.json", params = "cmd=LIST")
public ResponseEntity<GridResponse<InflowControlHistoryManUI>> selectList(HttpServletRequest request,
Pageable pageable, InflowControlHistoryManUISearch uiSearch) {
@@ -23,8 +23,13 @@ public class InflowControlHistoryManService extends BaseService {
@Autowired
InflowControlHistoryManMapper mapper;
// public Page<InflowControlHistoryManUI> selectList(Pageable pageable, InflowControlHistoryManUISearch uiSearch) {
// return service.findAll(pageable, uiSearch).map(mapper::toVo);
// }
public Page<InflowControlHistoryManUI> selectList(Pageable pageable, InflowControlHistoryManUISearch uiSearch) {
return service.findAll(pageable, uiSearch).map(mapper::toVo);
return service.selectList(pageable, uiSearch);
}
public List<HashMap<String, Object>> selectListToExcel(InflowControlHistoryManUISearch uiSearch) {
@@ -66,6 +66,12 @@ public class InflowControlHistoryManUI {
*/
@JsonProperty("THRESHOLDTIMEUNIT")
private String thresholdtimeunit;
/**
* 그룹명
*/
@JsonProperty("GROUPNAME")
private String groupname;
}