|
|
|
@ -32,15 +32,13 @@ public class DocController extends AbstractController {
|
|
|
|
|
@Resource(name="fileService")
|
|
|
|
|
FileService fileService;
|
|
|
|
|
|
|
|
|
|
private String sggNm = "용인시";
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/makeDisposeResultReportHwp.do")
|
|
|
|
|
public ModelAndView makeDisposeResultReportHwp(String dscMngId) {
|
|
|
|
|
public ModelAndView makeDisposeResultReportHwp(String dscdmngId) {
|
|
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
mav.setViewName("jsonView");
|
|
|
|
|
|
|
|
|
|
if(dscMngId == null || dscMngId.equals("")) {
|
|
|
|
|
if(dscdmngId == null || dscdmngId.equals("")) {
|
|
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
@ -53,14 +51,11 @@ public class DocController extends AbstractController {
|
|
|
|
|
//개인정보표시여부,기관장 등
|
|
|
|
|
PrintOption printOption = new PrintOption();
|
|
|
|
|
Map<String,String> globalVariable = new HashMap<String,String>();
|
|
|
|
|
String gigwanjang = sggNm+"장";
|
|
|
|
|
gigwanjang = spreadBySpace(gigwanjang,4);
|
|
|
|
|
globalVariable.put("gigwanjang", gigwanjang);
|
|
|
|
|
printOption.setGlobalVariable(globalVariable);
|
|
|
|
|
|
|
|
|
|
//상품 사진 갯수 체크
|
|
|
|
|
List<DataObject> totalProduct = fileService.getFileList(
|
|
|
|
|
new FileQuery().setInfoKeys(dscMngId).setInfoType("100")
|
|
|
|
|
new FileQuery().setInfoKeys(dscdmngId).setInfoType("100")
|
|
|
|
|
);
|
|
|
|
|
int totalProductCnt = 0;
|
|
|
|
|
if(totalProduct != null && !totalProduct.isEmpty()) {
|
|
|
|
@ -68,11 +63,11 @@ public class DocController extends AbstractController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//샘플 데이터 생성
|
|
|
|
|
List<DataObject> dataobjectList = this.makeSample(dscMngId,totalProductCnt);
|
|
|
|
|
List<DataObject> dataobjectList = this.makeSample(dscdmngId,totalProductCnt);
|
|
|
|
|
|
|
|
|
|
for(DataObject data : dataobjectList) {
|
|
|
|
|
String infKey = data.string("dscMngId");
|
|
|
|
|
String subType = data.string("dscMngSn");
|
|
|
|
|
String infKey = data.string("dscdmngId");
|
|
|
|
|
String subType = data.string("dscdmngSn");
|
|
|
|
|
|
|
|
|
|
List<DataObject> fileinfo = fileService.getFileList(
|
|
|
|
|
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
|
|
|
|
@ -89,7 +84,7 @@ public class DocController extends AbstractController {
|
|
|
|
|
String resultFilePath = form.makeFile().andGetPath();
|
|
|
|
|
|
|
|
|
|
File file = new File(resultFilePath);
|
|
|
|
|
Relation rel = new Relation().setInfoType("200").setSubType("01").setInfoKey(dscMngId);
|
|
|
|
|
Relation rel = new Relation().setInfoType("200").setSubType("01").setInfoKey(dscdmngId);
|
|
|
|
|
FileInfo fileInfo = new FileInfo.Factory().create(rel, file);
|
|
|
|
|
fileInfo.setName(print.getFormatKorName()+".hwp");
|
|
|
|
|
int effected= fileService.create(fileInfo);
|
|
|
|
@ -100,30 +95,15 @@ public class DocController extends AbstractController {
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String spreadBySpace(String str, int spaceCnt) {
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
String spaces = "";
|
|
|
|
|
for(int i=1; i<=spaceCnt; i++) {
|
|
|
|
|
spaces += " ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char[] charArr = str.toCharArray();
|
|
|
|
|
result += Character.toString(charArr[0]);
|
|
|
|
|
for(int i=1; i<charArr.length; i++) {
|
|
|
|
|
result += spaces + Character.toString(charArr[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/makeDisposeProcessDetailsHwp.do")
|
|
|
|
|
public ModelAndView makeDisposeProcessDetailsHwp(String dscMngId) {
|
|
|
|
|
public ModelAndView makeDisposeProcessDetailsHwp(String dscdmngId) {
|
|
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
mav.setViewName("jsonView");
|
|
|
|
|
|
|
|
|
|
if(dscMngId == null || dscMngId.equals("")) {
|
|
|
|
|
if(dscdmngId == null || dscdmngId.equals("")) {
|
|
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
@ -135,14 +115,11 @@ public class DocController extends AbstractController {
|
|
|
|
|
//개인정보표시여부,기관장 등
|
|
|
|
|
PrintOption printOption = new PrintOption();
|
|
|
|
|
Map<String,String> globalVariable = new HashMap<String,String>();
|
|
|
|
|
String gigwanjang = sggNm+"장";
|
|
|
|
|
gigwanjang = spreadBySpace(gigwanjang,4);
|
|
|
|
|
globalVariable.put("gigwanjang", gigwanjang);
|
|
|
|
|
printOption.setGlobalVariable(globalVariable);
|
|
|
|
|
|
|
|
|
|
//폐기증거사진
|
|
|
|
|
List<DataObject> dsuseimgs = fileService.getFileList(
|
|
|
|
|
new FileQuery().setInfoType("110").setInfoKeys(dscMngId)
|
|
|
|
|
new FileQuery().setInfoType("110").setInfoKeys(dscdmngId)
|
|
|
|
|
);
|
|
|
|
|
List<String> dataobjectList2 = new ArrayList<>();
|
|
|
|
|
for(DataObject dsuseimg : dsuseimgs) {
|
|
|
|
@ -151,7 +128,7 @@ public class DocController extends AbstractController {
|
|
|
|
|
|
|
|
|
|
//상품사진갯수 체크
|
|
|
|
|
List<DataObject> totalProduct = fileService.getFileList(
|
|
|
|
|
new FileQuery().setInfoKeys(dscMngId).setInfoType("100").setOrderBy("SUB_TYPE")
|
|
|
|
|
new FileQuery().setInfoKeys(dscdmngId).setInfoType("100").setOrderBy("SUB_TYPE")
|
|
|
|
|
);
|
|
|
|
|
int totalProductCnt = 0;
|
|
|
|
|
if(totalProduct != null && !totalProduct.isEmpty()) {
|
|
|
|
@ -159,11 +136,11 @@ public class DocController extends AbstractController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//샘플 데이터 생성
|
|
|
|
|
List<DataObject> dataobjectList = this.makeSample(dscMngId,totalProductCnt);
|
|
|
|
|
List<DataObject> dataobjectList = this.makeSample(dscdmngId,totalProductCnt);
|
|
|
|
|
|
|
|
|
|
for(DataObject data : dataobjectList) {
|
|
|
|
|
String infKey = data.string("dscMngId");
|
|
|
|
|
String subType = data.string("dscMngSn");
|
|
|
|
|
String infKey = data.string("dscdmngId");
|
|
|
|
|
String subType = data.string("dscdmngSn");
|
|
|
|
|
|
|
|
|
|
List<DataObject> fileinfo = fileService.getFileList(
|
|
|
|
|
new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType)
|
|
|
|
@ -180,7 +157,7 @@ public class DocController extends AbstractController {
|
|
|
|
|
String resultFilePath = form.makeFile().andGetPath();
|
|
|
|
|
|
|
|
|
|
File file = new File(resultFilePath);
|
|
|
|
|
Relation rel = new Relation().setInfoType("200").setSubType("02").setInfoKey(dscMngId);
|
|
|
|
|
Relation rel = new Relation().setInfoType("200").setSubType("02").setInfoKey(dscdmngId);
|
|
|
|
|
FileInfo fileInfo = new FileInfo.Factory().create(rel, file);
|
|
|
|
|
fileInfo.setName(print.getFormatKorName()+".hwp");
|
|
|
|
|
int effected= fileService.create(fileInfo);
|
|
|
|
@ -192,14 +169,14 @@ public class DocController extends AbstractController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<DataObject> makeSample(String dscMngId, int totalProductCnt){
|
|
|
|
|
public List<DataObject> makeSample(String dscdmngId, int totalProductCnt){
|
|
|
|
|
List<DataObject> dataobjectList = new ArrayList<DataObject>();
|
|
|
|
|
|
|
|
|
|
for(int i=0; i<totalProductCnt; i++) {
|
|
|
|
|
|
|
|
|
|
DataObject newObj = this.getRandomObj();
|
|
|
|
|
newObj.set("dscMngId", dscMngId);
|
|
|
|
|
newObj.set("dscMngSn", EgovStringUtil.lPad(""+(i+1), 3, '0'));
|
|
|
|
|
newObj.set("dscdmngId", dscdmngId);
|
|
|
|
|
newObj.set("dscdmngSn", EgovStringUtil.lPad(""+(i+1), 3, '0'));
|
|
|
|
|
|
|
|
|
|
dataobjectList.add(newObj);
|
|
|
|
|
}
|
|
|
|
|