|
|
@ -9,11 +9,11 @@ import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.pdf.DefaultOtptStng;
|
|
|
|
import cokr.xit.fims.cmmn.pdf.DefaultOtptArtclStng;
|
|
|
|
import cokr.xit.fims.cmmn.pdf.PDFFormat;
|
|
|
|
import cokr.xit.fims.cmmn.pdf.PDFFormat;
|
|
|
|
import cokr.xit.fims.cmmn.pdf.format.Advntce;
|
|
|
|
import cokr.xit.fims.cmmn.pdf.format.Advntce;
|
|
|
|
import cokr.xit.fims.sprt.OtptForm;
|
|
|
|
import cokr.xit.fims.sprt.OtptForm;
|
|
|
|
import cokr.xit.fims.sprt.OtptStng;
|
|
|
|
import cokr.xit.fims.sprt.OtptArtclStng;
|
|
|
|
import cokr.xit.fims.sprt.OtptStngQuery;
|
|
|
|
import cokr.xit.fims.sprt.OtptStngQuery;
|
|
|
|
import cokr.xit.fims.sprt.dao.OtptStngMapper;
|
|
|
|
import cokr.xit.fims.sprt.dao.OtptStngMapper;
|
|
|
|
import cokr.xit.foundation.AbstractComponent;
|
|
|
|
import cokr.xit.foundation.AbstractComponent;
|
|
|
@ -35,18 +35,18 @@ public class OtptStngBean extends AbstractComponent {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<DataObject> otptStngList = otptStngMapper.selectOtptArtclStngList(query);
|
|
|
|
List<DataObject> otptArtclStngList = otptStngMapper.selectOtptArtclStngList(query);
|
|
|
|
if(otptStngList == null) {
|
|
|
|
if(otptArtclStngList == null) {
|
|
|
|
otptStngList = new ArrayList<DataObject>();
|
|
|
|
otptArtclStngList = new ArrayList<DataObject>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pdfFormat.appendOtptAttribute(otptStngList);
|
|
|
|
pdfFormat.appendOtptAttribute(otptArtclStngList);
|
|
|
|
|
|
|
|
|
|
|
|
List<DefaultOtptStng> uniquePrototypeList = pdfFormat.getPrototypeStngs(true);
|
|
|
|
List<DefaultOtptArtclStng> uniquePrototypeList = pdfFormat.getPrototypeStngs(true);
|
|
|
|
List<DefaultOtptStng> multiplePrototypeList = pdfFormat.getPrototypeStngs(false);
|
|
|
|
List<DefaultOtptArtclStng> multiplePrototypeList = pdfFormat.getPrototypeStngs(false);
|
|
|
|
|
|
|
|
|
|
|
|
List<DataObject> uniqueDataList = otptStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("Y")).toList();
|
|
|
|
List<DataObject> uniqueDataList = otptArtclStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("Y")).toList();
|
|
|
|
List<DataObject> multipleDataList = otptStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("N")).toList();
|
|
|
|
List<DataObject> multipleDataList = otptArtclStngList.stream().filter(item -> item.string("UNIQUE_YN").equals("N")).toList();
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> unique = new HashMap<String,Object>();
|
|
|
|
Map<String, Object> unique = new HashMap<String,Object>();
|
|
|
|
unique.put("prototypeList", uniquePrototypeList);
|
|
|
|
unique.put("prototypeList", uniquePrototypeList);
|
|
|
@ -66,22 +66,22 @@ public class OtptStngBean extends AbstractComponent {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
String userId = currentUser().getId();
|
|
|
|
String userId = currentUser().getId();
|
|
|
|
List<OtptStng> otptStngList = otptForm.getOtptStngList();
|
|
|
|
List<OtptArtclStng> otptArtclStngList = otptForm.getOtptArtclStngList();
|
|
|
|
|
|
|
|
|
|
|
|
List<String> updateKeyList = new ArrayList<String>();
|
|
|
|
List<String> updateKeyList = new ArrayList<String>();
|
|
|
|
List<OtptStng> insertList = new ArrayList<OtptStng>();
|
|
|
|
List<OtptArtclStng> insertList = new ArrayList<OtptArtclStng>();
|
|
|
|
|
|
|
|
|
|
|
|
if(otptStngList != null && !otptStngList.isEmpty()) {
|
|
|
|
if(otptArtclStngList != null && !otptArtclStngList.isEmpty()) {
|
|
|
|
|
|
|
|
|
|
|
|
List<OtptStng> updateList = otptStngList.stream().filter(item -> !ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList();
|
|
|
|
List<OtptArtclStng> updateList = otptArtclStngList.stream().filter(item -> !ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList();
|
|
|
|
if(!updateList.isEmpty()) {
|
|
|
|
if(!updateList.isEmpty()) {
|
|
|
|
for(OtptStng update : updateList) {
|
|
|
|
for(OtptArtclStng update : updateList) {
|
|
|
|
update.setModifiedBy(userId);
|
|
|
|
update.setModifiedBy(userId);
|
|
|
|
int u = otptStngMapper.updateArtclStng(update);
|
|
|
|
int u = otptStngMapper.updateArtclStng(update);
|
|
|
|
updateKeyList.add(update.getOtptFormId());
|
|
|
|
updateKeyList.add(update.getOtptFormId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
insertList = otptStngList.stream().filter(item -> ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList();
|
|
|
|
insertList = otptArtclStngList.stream().filter(item -> ifEmpty(item.getOtptFormId(), () -> "").equals("")).toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!updateKeyList.isEmpty()) {
|
|
|
|
if(!updateKeyList.isEmpty()) {
|
|
|
@ -91,7 +91,7 @@ public class OtptStngBean extends AbstractComponent {
|
|
|
|
int d = otptStngMapper.deleteArtclStng(otptForm);
|
|
|
|
int d = otptStngMapper.deleteArtclStng(otptForm);
|
|
|
|
|
|
|
|
|
|
|
|
if(!insertList.isEmpty()) {
|
|
|
|
if(!insertList.isEmpty()) {
|
|
|
|
for(OtptStng insert : insertList) {
|
|
|
|
for(OtptArtclStng insert : insertList) {
|
|
|
|
insert.setCreatedBy(userId);
|
|
|
|
insert.setCreatedBy(userId);
|
|
|
|
int i = otptStngMapper.insertArtclStng(insert);
|
|
|
|
int i = otptStngMapper.insertArtclStng(insert);
|
|
|
|
}
|
|
|
|
}
|
|
|
|