Merge branch 'jenkins_with_weblogic' of ssh://192.168.240.178:18081/eapim/eapim-admin into jenkins_with_weblogic
This commit is contained in:
@@ -20,6 +20,7 @@ import com.eactive.eai.data.entity.onl.unifbwk.UnifBwkTp;
|
||||
import com.eactive.eai.data.jpa.AbstractDataService;
|
||||
import com.eactive.eai.rms.data.entity.onl.bzwkdstcd.QUserBusiness;
|
||||
import com.eactive.eai.rms.onl.manage.comm.unifbwk.UnifbwkUISearch;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
|
||||
@@ -54,12 +55,27 @@ public class UnifBwkTpService extends AbstractDataService<UnifBwkTp, String, Uni
|
||||
|
||||
public Iterable<UnifBwkTp> findAllwithSearch(String searchBzwkName) {
|
||||
QUnifBwkTp qUnifBwkTp = QUnifBwkTp.unifBwkTp;
|
||||
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
|
||||
if(StringUtils.isNotBlank(searchBzwkName)) {
|
||||
|
||||
String[] keywords = searchBzwkName.split(",");
|
||||
|
||||
for(String keyword : keywords) {
|
||||
|
||||
String param = keyword.trim();
|
||||
|
||||
BooleanExpression predicate = QUnifBwkTp.unifBwkTp.bzwkdsticname
|
||||
.containsIgnoreCase(param)
|
||||
.or(qUnifBwkTp.eaibzwkdstcd.containsIgnoreCase(param));
|
||||
|
||||
builder.or(predicate);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BooleanExpression predicate = QUnifBwkTp.unifBwkTp.bzwkdsticname
|
||||
.containsIgnoreCase(searchBzwkName)
|
||||
.or(qUnifBwkTp.eaibzwkdstcd.containsIgnoreCase(searchBzwkName));
|
||||
|
||||
return repository.findAll(predicate, qUnifBwkTp.eaibzwkdstcd.asc());
|
||||
return repository.findAll(builder, qUnifBwkTp.eaibzwkdstcd.asc());
|
||||
}
|
||||
|
||||
public Page<UnifBwkTp> findPageWithSearch(Pageable pageable, UnifbwkUISearch unifbwkUISearch) {
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ public class HttpStatusController extends BaseController {
|
||||
list.removeIf(m -> m.get("adapterGroupSimple") == null || m.get("adapterGroupSimple") == "");
|
||||
|
||||
// 어댑터 업무그룹별 정렬
|
||||
String[] compareParam = { "adapterGroupName", "eaiSvrInstNm" };
|
||||
String[] compareParam = { "adapterStatus", "adapterGroupName", "eaiSvrInstNm" };
|
||||
MapComparator comp = new MapComparator(compareParam);
|
||||
Collections.sort(list, comp);
|
||||
return ResponseEntity.ok(new GridResponse<>(list));
|
||||
|
||||
@@ -129,8 +129,8 @@ public class SocketProcessController extends BaseController{
|
||||
pageVo.setTotalCount(list.size());
|
||||
|
||||
//어댑터 업무그룹별 정렬
|
||||
String[] compareParam = {"AdptrBzwkGroupName","EaiSevrInstncName"};
|
||||
|
||||
String[] compareParam = {"Status","AdptrBzwkGroupName","EaiSevrInstncName"};
|
||||
|
||||
MapComparator comp = new MapComparator(compareParam);
|
||||
Collections.sort(list,comp);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SocketStatusController extends BaseController {
|
||||
List<String> urls = new ArrayList<>();
|
||||
for (EAIServer serverMap : serverList) {
|
||||
String url = "http://" + serverMap.getEaisevrip() + ":" + serverMap.getSevrlsnportname()
|
||||
+ HostInfomationForm.WEB_AGENT_CONTEXT_PATH + AGENT_PAGE_STATUS + "?adapterType=SOC"
|
||||
+ HostInfomationForm.WEB_AGENT_CONTEXT_PATH + AGENT_PAGE_STATUS + "?adapterType=NET"
|
||||
+ "&eaiSvrInstNm=" + serverMap.getEaisevrinstncname();
|
||||
urls.add(url);
|
||||
logger.debug(url);
|
||||
@@ -120,7 +120,7 @@ public class SocketStatusController extends BaseController {
|
||||
List<HashMap<String, Object>> list = gUtil.flushXmlToClient(urls);
|
||||
|
||||
// 어댑터 업무그룹별 정렬
|
||||
String[] compareParam = { "AdptrBzwkGroupName", "EaiSevrInstncName", "AdptrBzwkName" };
|
||||
String[] compareParam = { "Status", "AdptrBzwkGroupName", "EaiSevrInstncName", "AdptrBzwkName" };
|
||||
|
||||
MapComparator comp = new MapComparator(compareParam);
|
||||
Collections.sort(list, comp);
|
||||
|
||||
+12
-10
@@ -21,6 +21,7 @@ import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -208,7 +209,6 @@ public class ApiInterfaceController extends OnlBaseAnnotationController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/onl/transaction/apim/apiInterfaceMan.excel", params = "cmd=DETAIL_EXPORT_TO_EXCEL")
|
||||
public ResponseEntity<byte[]> detailExportToExcel(@RequestParam(name = "eaiSvcName") String eaiSvcName) throws Exception {
|
||||
// 단일 파일 처리
|
||||
@@ -228,20 +228,22 @@ public class ApiInterfaceController extends OnlBaseAnnotationController {
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/transaction/apim/apiInterfaceMan.file", params = "cmd=LIST_IMPORT_FILE")
|
||||
public ResponseEntity<?> listImportFromExcel(@RequestParam("file") MultipartFile file) {
|
||||
public ResponseEntity<?> listImportFromJson(@RequestParam("file") MultipartFile file, boolean importDupliCheck) {
|
||||
try {
|
||||
if (file != null) {
|
||||
String extension = FilenameUtils.getExtension(file.getOriginalFilename()).toLowerCase();
|
||||
if("xls".equals(extension) || "xlsx".equals(extension)){
|
||||
ApiInterfaceReloadSyncSet apiInterfaceExportSetUI = service.importInterfaceFromExcel(file);
|
||||
reloadSync(apiInterfaceExportSetUI.getApiInterfaceUI());
|
||||
return ResponseEntity.ok().body("File successfully imported");
|
||||
} else if("json".equals(extension)) {
|
||||
ApiInterfaceReloadSyncSet apiInterfaceExportSetUI = service.importInterfaceFromJson(file);
|
||||
if("json".equals(extension)) {
|
||||
ApiInterfaceReloadSyncSet apiInterfaceExportSetUI = service.importInterfaceFromJson(file, importDupliCheck);
|
||||
reloadSync(apiInterfaceExportSetUI.getApiInterfaceUI());
|
||||
return ResponseEntity.ok().body("File successfully imported");
|
||||
} else {
|
||||
throw new IllegalStateException("파일 [ " + file.getOriginalFilename() + " ] 의 확장자가 JSON 이 아닙니다. 다시 시도하세요.");
|
||||
}
|
||||
}
|
||||
} catch (IllegalStateException dupEx) {
|
||||
return ResponseEntity
|
||||
.status(HttpStatus.CONFLICT)
|
||||
.body(dupEx.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("Error processing file", e);
|
||||
return ResponseEntity.internalServerError().body("Error processing file - "+e.getMessage() );
|
||||
@@ -269,10 +271,10 @@ public class ApiInterfaceController extends OnlBaseAnnotationController {
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/transaction/apim/apiInterfaceMan.json", params = "cmd=CLONE")
|
||||
public ResponseEntity<?> cloneApiInterface(String orgApiInterfaceId, String newBizCode, String newApiInterfaceId, String newInboundHttpMethod, String newInboundRestPath) throws BizException {
|
||||
public ResponseEntity<?> cloneApiInterface(String orgApiInterfaceId, String newBizCode, String newApiInterfaceId, String newInboundHttpMethod, String newInboundRestPath, boolean importDupliCheck) throws BizException {
|
||||
try {
|
||||
ApiInterfaceUI orgApiInterfaceUI = service.selectDetail(orgApiInterfaceId);
|
||||
ApiInterfaceUI apiInterfaceUI = service.cloneApiInterface(orgApiInterfaceUI, newBizCode, newApiInterfaceId, newInboundHttpMethod, newInboundRestPath);
|
||||
ApiInterfaceUI apiInterfaceUI = service.cloneApiInterface(orgApiInterfaceUI, newBizCode, newApiInterfaceId, newInboundHttpMethod, newInboundRestPath, importDupliCheck);
|
||||
Map<String, Object> resultMap = reloadSync(apiInterfaceUI);
|
||||
return ResponseEntity.ok(resultMap);
|
||||
} catch(Exception e) {
|
||||
|
||||
@@ -588,6 +588,31 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
// 비표준에서 표준으로 가는 경우 표준으로 전환하기 위한 정보 이므로 내부로 갈 때만 처리
|
||||
|
||||
String eaiServiceName = vo.getEaiSvcName();
|
||||
|
||||
// 25.11.25 HS04 APIFULLPATH 추가.
|
||||
List<AdapterUI> adapters = adapterGroup.getAdapters();
|
||||
|
||||
for (AdapterUI adapter : adapters) {
|
||||
|
||||
// propGroup NULL 체크
|
||||
if(adapter.getAdapterPropGroup() == null) continue;
|
||||
|
||||
List<AdapterPropUI> props = adapter.getAdapterPropGroup().getAdapterProps();
|
||||
|
||||
if (props != null) {
|
||||
for (AdapterPropUI prop : props) {
|
||||
if("API_PATH".equals(prop.getPrptyname())) {
|
||||
|
||||
String fullPath = prop.getPrpty2val() + "/" + vo.getInboundRestPath();
|
||||
vo.setApiFullPath(fullPath);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!"RST".equals(adapterGroup.getAdptrcd())) {
|
||||
throw new RuntimeException("인바운드 어댑터가 타입이 REST가 아닙니다. 타입을 확인하세요");
|
||||
@@ -836,7 +861,8 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
apiInterfaceUI.setSendRecvType(sendRecvType);
|
||||
apiInterfaceUI.setInOutType(inOutType);
|
||||
}
|
||||
|
||||
|
||||
/* 25.11.25 광주은행 엑셀 가져오기 기능 사용안함.
|
||||
public ApiInterfaceUI importInterfaceExcelSheet(Sheet sheet) throws Exception {
|
||||
String bizCode = PoiUtils.getCellValue(sheet, 1, 3);
|
||||
String elinkServiceId = PoiUtils.getCellValue(sheet, 1, 5);
|
||||
@@ -910,16 +936,27 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
|
||||
return apiInterfaceUI;
|
||||
}
|
||||
*/
|
||||
|
||||
private void importApiInterfaceUi(ApiInterfaceUI apiInterfaceUI) throws Exception {
|
||||
private void importApiInterfaceUi(ApiInterfaceUI apiInterfaceUI, boolean importDupliCheck) throws Exception {
|
||||
String elinkServiceId = apiInterfaceUI.getEaiSvcName();
|
||||
if (!eaiMessageQueryService.existsById(elinkServiceId)) {
|
||||
insert(apiInterfaceUI);
|
||||
|
||||
// 중복검사 실시
|
||||
boolean elinkServiceIdExists = eaiMessageQueryService.existsById(elinkServiceId);
|
||||
|
||||
// 아이디가 중복 일 경우, 중복검사 체크여부에 따라 업데이트 진행.
|
||||
if (elinkServiceIdExists) {
|
||||
// 중복검사 체크시 반환시킴
|
||||
if (importDupliCheck) {
|
||||
throw new IllegalStateException("ApiInterfaceId already exists [ " + elinkServiceId + " ]" );
|
||||
} else {
|
||||
update(apiInterfaceUI);
|
||||
}
|
||||
} else {
|
||||
update(apiInterfaceUI);
|
||||
insert(apiInterfaceUI);
|
||||
}
|
||||
}
|
||||
|
||||
/* 25.11.25 광주은행 엑셀 가져오기 기능 사용안함.
|
||||
public ApiInterfaceReloadSyncSet importInterfaceFromExcel(MultipartFile file) throws Exception {
|
||||
if (file.isEmpty()) {
|
||||
throw new IOException("File is empty");
|
||||
@@ -958,8 +995,9 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
}
|
||||
return apiInterfaceReloadSyncSet;
|
||||
}
|
||||
*/
|
||||
|
||||
public ApiInterfaceReloadSyncSet importInterfaceFromJson(MultipartFile file) throws Exception {
|
||||
public ApiInterfaceReloadSyncSet importInterfaceFromJson(MultipartFile file, boolean importDupliCheck) throws Exception {
|
||||
if (file.isEmpty()) {
|
||||
throw new IOException("File is empty");
|
||||
}
|
||||
@@ -983,7 +1021,7 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
importAndAddReloadSetTransform(transformUIList, apiInterfaceExportSetUI.getRequestTransform());
|
||||
importAndAddReloadSetTransform(transformUIList, apiInterfaceExportSetUI.getResponseTransform());
|
||||
|
||||
importApiInterfaceUi(apiInterfaceExportSetUI.getApiInterfaceUI());
|
||||
importApiInterfaceUi(apiInterfaceExportSetUI.getApiInterfaceUI(), importDupliCheck);
|
||||
apiInterfaceReloadSyncSet.setApiInterfaceUI(apiInterfaceExportSetUI.getApiInterfaceUI());
|
||||
|
||||
return apiInterfaceReloadSyncSet;
|
||||
@@ -1108,12 +1146,17 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
return updatedString;
|
||||
}
|
||||
|
||||
public ApiInterfaceUI cloneApiInterface(ApiInterfaceUI orgApiInterfaceUI, String newBizCd, String newApiInterfaceId, String newInboundHttpMethod, String newInboundRestPath) throws Exception {
|
||||
public ApiInterfaceUI cloneApiInterface(ApiInterfaceUI orgApiInterfaceUI, String newBizCd,
|
||||
String newApiInterfaceId, String newInboundHttpMethod,
|
||||
String newInboundRestPath, boolean importDupliCheck) throws Exception {
|
||||
|
||||
Optional<EAIMessageEntity> optional = eaiMessageQueryService.findById(newApiInterfaceId);
|
||||
if (optional.isPresent()) {
|
||||
String bzwkDstcd = optional.get().getEaibzwkdstcd();
|
||||
throw new BizException("[" + bzwkDstcd + "][" + newApiInterfaceId + "]로 이미 등록된 인터페이스입니다.\n조회가 되지 않을 시 담당자에게 문의바랍니다.");
|
||||
}
|
||||
|
||||
importDupliCheck = false; // 중복검사 완료.
|
||||
|
||||
ApiInterfaceUI apiInterfaceUI = orgApiInterfaceUI;
|
||||
apiInterfaceUI.setEaiBzwkDstcd(newBizCd);
|
||||
@@ -1132,7 +1175,7 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
apiInterfaceUI.setResponseTransform(changeToTargetTransformUI(transform2Service.getTransformUiToExport(apiInterfaceUI.getResponseTransform()), newBizCd, newApiInterfaceId, apiInterfaceUI.getOutboundResponseLayout(), apiInterfaceUI.getInboundResponseLayout()));
|
||||
}
|
||||
|
||||
importApiInterfaceUi(apiInterfaceUI);
|
||||
importApiInterfaceUi(apiInterfaceUI, importDupliCheck);
|
||||
|
||||
return apiInterfaceUI;
|
||||
}
|
||||
|
||||
+1
@@ -148,6 +148,7 @@ public interface ApiInterfaceUIMapper {
|
||||
@Mapping(target = "eaisendrecv", source = "sendRecvType")
|
||||
@Mapping(target = "eaidirection", source = "inOutType")
|
||||
@Mapping(target = "standardMessageItems", source = "standardMessageItems")
|
||||
@Mapping(target = "apiFullPath", source = "apiFullPath")
|
||||
StandardMessageInfo toStandardMessageInfo(ApiInterfaceUI vo);
|
||||
|
||||
@AfterMapping
|
||||
|
||||
@@ -49,6 +49,8 @@ public class ApiInterfaceUI {
|
||||
private List<String> headerValues;
|
||||
private List<StdMessageItemUI> standardMessageItems;
|
||||
private List<StdMessageItemUI> inboundResponseStandardMessageItems ;
|
||||
|
||||
private String apiFullPath;
|
||||
|
||||
//ASYNC-SYNC 용
|
||||
private String inboundResponseHttpMethod;
|
||||
|
||||
Reference in New Issue
Block a user