IIM 연동이력 조회 화면
This commit is contained in:
+76
@@ -0,0 +1,76 @@
|
||||
package com.eactive.eai.rms.data.entity.onl.layoutsync.history;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Convert;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
import com.eactive.eai.data.converter.LocalDateTimeToStringConverter16;
|
||||
import com.eactive.eai.data.entity.AbstractEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NonNull;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = false)
|
||||
|
||||
@Entity
|
||||
@Table(name = "tseaitr10")
|
||||
@org.hibernate.annotations.Table(appliesTo = "tseaitr10", comment = "레이아웃 연동 이력")
|
||||
public class LayoutSyncHistoryEntity extends AbstractEntity<Long> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@EqualsAndHashCode.Include
|
||||
@Column(nullable = false)
|
||||
@Comment("일련번호")
|
||||
private Long seqno;
|
||||
|
||||
@Column(length = 36)
|
||||
@Comment("연동로그처리일련번호")
|
||||
private String logprcssseqno;
|
||||
|
||||
@Column(length = 100)
|
||||
@Comment("서비스명")
|
||||
private String servicename;
|
||||
|
||||
@Column(length = 20)
|
||||
@Comment("커맨드")
|
||||
private String command;
|
||||
|
||||
@Column(length = 50)
|
||||
@Comment("레이아웃 명")
|
||||
private String loutname;
|
||||
|
||||
@Lob
|
||||
@Comment("수신 데이터")
|
||||
private String recvdata;
|
||||
|
||||
@Column(length = 16)
|
||||
@Comment("연동 시각")
|
||||
@Convert(converter = LocalDateTimeToStringConverter16.class)
|
||||
private LocalDateTime recvamndhms;
|
||||
|
||||
@Column(length = 1)
|
||||
@Comment("처리 결과")
|
||||
private String prcssrslt;
|
||||
|
||||
@Column(length = 4000)
|
||||
@Comment("처리 결과 메세지")
|
||||
private String prcssrsltcmnt;
|
||||
|
||||
@Override
|
||||
public @NonNull Long getId() {
|
||||
return seqno;
|
||||
}
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package com.eactive.eai.rms.data.entity.onl.layoutsync.history;
|
||||
|
||||
import com.eactive.eai.data.jpa.BaseRepository;
|
||||
|
||||
interface LayoutSyncHistoryRepository extends BaseRepository<LayoutSyncHistoryEntity, Long> {
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package com.eactive.eai.rms.data.entity.onl.layoutsync.history;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.eactive.eai.data.jpa.AbstractDataService;
|
||||
import com.eactive.eai.rms.onl.manage.rule.layoutsync.history.ui.LayoutSyncHistoryUI;
|
||||
import com.eactive.eai.rms.onl.manage.rule.layoutsync.history.ui.LayoutSyncHistoryUISearch;
|
||||
import com.querydsl.jpa.impl.JPAQuery;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class LayoutSyncHistoryService extends AbstractDataService<LayoutSyncHistoryEntity, Long, LayoutSyncHistoryRepository> {
|
||||
|
||||
private static final DateTimeFormatter FMT_YYYYMMDD = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
private static final DateTimeFormatter FMT_DATETIME = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
public Page<LayoutSyncHistoryUI> selectList(Pageable pageable, LayoutSyncHistoryUISearch search) {
|
||||
QLayoutSyncHistoryEntity q = QLayoutSyncHistoryEntity.layoutSyncHistoryEntity;
|
||||
JPAQuery<?> query = getJPAQueryFactory().from(q);
|
||||
|
||||
if (StringUtils.isNotBlank(search.getSearchLoutName())) {
|
||||
query.where(q.loutname.containsIgnoreCase(search.getSearchLoutName()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(search.getSearchStartDate())) {
|
||||
query.where(q.recvamndhms.goe(parseYYYYMMDD(search.getSearchStartDate()).atStartOfDay()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(search.getSearchEndDate())) {
|
||||
query.where(q.recvamndhms.loe(parseYYYYMMDD(search.getSearchEndDate()).atTime(23, 59, 59)));
|
||||
}
|
||||
|
||||
long totalCount = query.select(q.count()).fetchOne();
|
||||
|
||||
if (pageable.isPaged()) {
|
||||
query.limit(pageable.getPageSize()).offset(pageable.getOffset());
|
||||
}
|
||||
|
||||
List<LayoutSyncHistoryEntity> entities = query.select(q)
|
||||
.orderBy(q.recvamndhms.desc(), q.seqno.desc())
|
||||
.fetch();
|
||||
|
||||
List<LayoutSyncHistoryUI> rows = entities.stream().map(this::convertToUI).collect(Collectors.toList());
|
||||
|
||||
return new PageImpl<>(rows, pageable, totalCount);
|
||||
}
|
||||
|
||||
public LayoutSyncHistoryUI selectDetail(Long seqno) {
|
||||
return convertToUI(getById(seqno));
|
||||
}
|
||||
|
||||
private static LocalDate parseYYYYMMDD(String yyyyMMdd) {
|
||||
return LocalDate.parse(yyyyMMdd, FMT_YYYYMMDD);
|
||||
}
|
||||
|
||||
private LayoutSyncHistoryUI convertToUI(LayoutSyncHistoryEntity e) {
|
||||
LayoutSyncHistoryUI ui = new LayoutSyncHistoryUI();
|
||||
ui.setSeqno(e.getSeqno());
|
||||
ui.setServiceName(e.getServicename());
|
||||
ui.setCommand(e.getCommand());
|
||||
ui.setLoutName(e.getLoutname());
|
||||
ui.setRecvAmndHms(e.getRecvamndhms() == null ? "" : e.getRecvamndhms().format(FMT_DATETIME));
|
||||
ui.setPrcssRslt(e.getPrcssrslt());
|
||||
ui.setPrcssRsltCmnt(e.getPrcssrsltcmnt());
|
||||
ui.setRecvData(e.getRecvdata());
|
||||
return ui;
|
||||
}
|
||||
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.eactive.eai.rms.onl.manage.rule.layoutsync.history;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import com.eactive.eai.rms.common.base.OnlBaseAnnotationController;
|
||||
import com.eactive.eai.rms.common.vo.GridResponse;
|
||||
import com.eactive.eai.rms.data.entity.onl.layoutsync.history.LayoutSyncHistoryService;
|
||||
import com.eactive.eai.rms.onl.manage.rule.layoutsync.history.ui.LayoutSyncHistoryUI;
|
||||
import com.eactive.eai.rms.onl.manage.rule.layoutsync.history.ui.LayoutSyncHistoryUISearch;
|
||||
|
||||
@Controller
|
||||
public class LayoutSyncHistoryController extends OnlBaseAnnotationController {
|
||||
|
||||
@Autowired
|
||||
private LayoutSyncHistoryService service;
|
||||
|
||||
@GetMapping(value = "/onl/admin/rule/layoutSyncHistoryMan.view")
|
||||
public void view() {
|
||||
// 목록 view
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/admin/rule/layoutSyncHistoryMan.view", params = "cmd=DETAIL")
|
||||
public String detailView() {
|
||||
return "/onl/admin/rule/layoutSyncHistoryManDetail";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/layoutSyncHistoryMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<LayoutSyncHistoryUI>> selectList(Pageable pageable,
|
||||
LayoutSyncHistoryUISearch search) {
|
||||
Page<LayoutSyncHistoryUI> page = service.selectList(pageable, search);
|
||||
return ResponseEntity.ok(new GridResponse<>(page));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/rule/layoutSyncHistoryMan.json", params = "cmd=DETAIL")
|
||||
public ResponseEntity<LayoutSyncHistoryUI> selectDetail(Long seqno) {
|
||||
return ResponseEntity.ok(service.selectDetail(seqno));
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.eactive.eai.rms.onl.manage.rule.layoutsync.history.ui;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LayoutSyncHistoryUI {
|
||||
|
||||
private Long seqno;
|
||||
private String serviceName;
|
||||
private String command;
|
||||
private String loutName;
|
||||
private String recvAmndHms;
|
||||
private String prcssRslt;
|
||||
private String prcssRsltCmnt;
|
||||
private String recvData;
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.eactive.eai.rms.onl.manage.rule.layoutsync.history.ui;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LayoutSyncHistoryUISearch {
|
||||
|
||||
private String searchLoutName;
|
||||
|
||||
/* 연동시간 기간 검색 (yyyyMMdd, 8자리) */
|
||||
private String searchStartDate;
|
||||
private String searchEndDate;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user