|
|
@ -15,9 +15,6 @@ import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
import net.minidev.json.JSONObject;
|
|
|
|
|
|
|
|
import net.minidev.json.parser.ParseException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
|
|
|
|
|
|
@ -45,6 +42,8 @@ import cokr.xit.base.web.ApplicationController;
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
import cokr.xit.foundation.data.JSON;
|
|
|
|
import cokr.xit.foundation.data.JSON;
|
|
|
|
import cokr.xit.foundation.web.WebClient;
|
|
|
|
import cokr.xit.foundation.web.WebClient;
|
|
|
|
|
|
|
|
import net.minidev.json.JSONObject;
|
|
|
|
|
|
|
|
import net.minidev.json.parser.ParseException;
|
|
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
@Controller
|
|
|
|
@RequestMapping(
|
|
|
|
@RequestMapping(
|
|
|
@ -87,6 +86,11 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
setCmmCode("ADDS04", mav);
|
|
|
|
setCmmCode("ADDS04", mav);
|
|
|
|
|
|
|
|
|
|
|
|
List<DataObject> fileInfo = new ArrayList<DataObject>();
|
|
|
|
List<DataObject> fileInfo = new ArrayList<DataObject>();
|
|
|
|
|
|
|
|
if(fileInfo == null) { fileInfo = new ArrayList<DataObject>();}
|
|
|
|
|
|
|
|
fileInfo = fileInfo.stream()
|
|
|
|
|
|
|
|
.filter((item) -> item.string("USE_YN").equals("Y"))
|
|
|
|
|
|
|
|
.sorted((item1, item2) -> item1.string("SUB_TYPE").compareTo(item2.string("SUB_TYPE")))
|
|
|
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
if(!isEmpty(dsuseReceptInfo) && !isEmpty(dsuseReceptInfo.getDscdmngId())){
|
|
|
|
if(!isEmpty(dsuseReceptInfo) && !isEmpty(dsuseReceptInfo.getDscdmngId())){
|
|
|
|
mav.addObject("dsuseReceptInfo", toJson(dsuseReceptInfo));
|
|
|
|
mav.addObject("dsuseReceptInfo", toJson(dsuseReceptInfo));
|
|
|
@ -144,6 +148,15 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
|
|
|
|
|
|
|
FileQuery fileQuery = new FileQuery().setInfoType("110").setInfoKeys(dsuseRsltInfo.getDscdmngId());
|
|
|
|
FileQuery fileQuery = new FileQuery().setInfoType("110").setInfoKeys(dsuseRsltInfo.getDscdmngId());
|
|
|
|
List<DataObject> fileInfos = fileService.getFileList(fileQuery);
|
|
|
|
List<DataObject> fileInfos = fileService.getFileList(fileQuery);
|
|
|
|
|
|
|
|
if(fileInfos == null) { fileInfos = new ArrayList<DataObject>(); }
|
|
|
|
|
|
|
|
fileInfos = fileInfos.stream()
|
|
|
|
|
|
|
|
.filter((item) -> item.string("USE_YN").equals("Y"))
|
|
|
|
|
|
|
|
.sorted((item1, item2) -> {
|
|
|
|
|
|
|
|
int a = item1.number("SRT_ORD").intValue();
|
|
|
|
|
|
|
|
int b = item2.number("SRT_ORD").intValue();
|
|
|
|
|
|
|
|
return (a < b) ? -1 : ((a == b) ? 0 : 1);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.toList();
|
|
|
|
mav.addObject("fileInfos", toJson(fileInfos));
|
|
|
|
mav.addObject("fileInfos", toJson(fileInfos));
|
|
|
|
|
|
|
|
|
|
|
|
return mav
|
|
|
|
return mav
|
|
|
@ -229,11 +242,17 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
List<DataObject> fileinfo = fileService.getFileList(
|
|
|
|
List<DataObject> fileinfo = fileService.getFileList(
|
|
|
|
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
|
|
|
|
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if(fileinfo == null || fileinfo.isEmpty()) {
|
|
|
|
if(fileinfo == null) { fileinfo = new ArrayList<DataObject>(); }
|
|
|
|
data.put("filePath", "");
|
|
|
|
fileinfo = fileinfo.stream()
|
|
|
|
} else {
|
|
|
|
.filter((item) -> item.string("USE_YN").equals("Y"))
|
|
|
|
data.put("filePath", fileinfo.get(0).string("FILE_PATH"));
|
|
|
|
.sorted((item1, item2) -> item1.string("FILE_ID").compareTo(item2.string("FILE_ID")))
|
|
|
|
}
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(fileinfo.isEmpty()) {
|
|
|
|
|
|
|
|
data.put("filePath", "");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
data.put("filePath", fileinfo.get(fileinfo.size()-1).string("FILE_PATH"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -277,6 +296,16 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
List<DataObject> dsuseimgs = fileService.getFileList(
|
|
|
|
List<DataObject> dsuseimgs = fileService.getFileList(
|
|
|
|
new FileQuery().setInfoType("110").setInfoKeys(dataForDoc.get(0).string("dscdmngId"))
|
|
|
|
new FileQuery().setInfoType("110").setInfoKeys(dataForDoc.get(0).string("dscdmngId"))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
if(dsuseimgs == null) { dsuseimgs = new ArrayList<DataObject>(); }
|
|
|
|
|
|
|
|
dsuseimgs = dsuseimgs.stream()
|
|
|
|
|
|
|
|
.filter((item) -> item.string("USE_YN").equals("Y"))
|
|
|
|
|
|
|
|
.sorted((item1, item2) -> {
|
|
|
|
|
|
|
|
int a = item1.number("SRT_ORD").intValue();
|
|
|
|
|
|
|
|
int b = item2.number("SRT_ORD").intValue();
|
|
|
|
|
|
|
|
return (a < b) ? -1 : ((a == b) ? 0 : 1);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
List<String> dsuseimgPaths = new ArrayList<>();
|
|
|
|
List<String> dsuseimgPaths = new ArrayList<>();
|
|
|
|
for(DataObject dsuseimg : dsuseimgs) {
|
|
|
|
for(DataObject dsuseimg : dsuseimgs) {
|
|
|
|
dsuseimgPaths.add(dsuseimg.string("FILE_PATH"));
|
|
|
|
dsuseimgPaths.add(dsuseimg.string("FILE_PATH"));
|
|
|
@ -289,11 +318,17 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
List<DataObject> fileinfo = fileService.getFileList(
|
|
|
|
List<DataObject> fileinfo = fileService.getFileList(
|
|
|
|
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
|
|
|
|
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if(fileinfo == null || fileinfo.isEmpty()) {
|
|
|
|
if(fileinfo == null) { fileinfo = new ArrayList<DataObject>(); }
|
|
|
|
data.put("filePath", "");
|
|
|
|
fileinfo = fileinfo.stream()
|
|
|
|
} else {
|
|
|
|
.filter((item) -> item.string("USE_YN").equals("Y"))
|
|
|
|
data.put("filePath", fileinfo.get(0).string("FILE_PATH"));
|
|
|
|
.sorted((item1, item2) -> item1.string("FILE_ID").compareTo(item2.string("FILE_ID")))
|
|
|
|
}
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(fileinfo.isEmpty()) {
|
|
|
|
|
|
|
|
data.put("filePath", "");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
data.put("filePath", fileinfo.get(fileinfo.size()-1).string("FILE_PATH"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|