|
|
@@ -3,7 +3,6 @@ package com.style24.front.biz.service;
|
|
|
import java.io.File;
|
|
|
import java.util.Collection;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -18,7 +17,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import com.gagaframework.web.util.GagaDateUtil;
|
|
|
import com.gagaframework.web.util.GagaFileUtil;
|
|
|
-import com.gagaframework.web.util.GagaStringUtil;
|
|
|
|
|
|
/**
|
|
|
* 상담(1:1문의) Service
|
|
|
@@ -32,7 +30,7 @@ public class TsfCounselService {
|
|
|
|
|
|
@Autowired
|
|
|
private TsfCounselDao counselDao;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private Environment env;
|
|
|
|
|
|
@@ -52,12 +50,12 @@ public class TsfCounselService {
|
|
|
counsel.setRegNo(TsfSession.getInfo().getCustNo());
|
|
|
counsel.setUpdNo(TsfSession.getInfo().getCustNo());
|
|
|
counselDao.createOneToOneQna(counsel);
|
|
|
-
|
|
|
- if(counsel.getOrgFileNmArr() != null) {
|
|
|
+
|
|
|
+ if (counsel.getOrgFileNmArr() != null) {
|
|
|
int ind = 1;
|
|
|
String[] orgItem = counsel.getOrgFileNmArr();
|
|
|
String[] sysItem = counsel.getSysFileNmArr();
|
|
|
-
|
|
|
+
|
|
|
for (int i = 0; i < orgItem.length; i++) {
|
|
|
if (orgItem[i] != "") {
|
|
|
String imgInd = String.valueOf(ind);
|
|
|
@@ -77,11 +75,11 @@ public class TsfCounselService {
|
|
|
path.mkdir();
|
|
|
}
|
|
|
newFile.renameTo(uniqueFile);
|
|
|
-
|
|
|
+
|
|
|
if (i == 0) {
|
|
|
counsel.setOrgFileNm1(orgItem[i]);
|
|
|
counsel.setSysFileNm1("/counsel/" + yearMonth + "/" + newFilename);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
counsel.setOrgFileNm2(orgItem[i]);
|
|
|
counsel.setSysFileNm2("/counsel/" + yearMonth + "/" + newFilename);
|
|
|
}
|
|
|
@@ -124,15 +122,7 @@ public class TsfCounselService {
|
|
|
* @since 2020. 12. 28
|
|
|
*/
|
|
|
public Collection<Counsel> getOneToOneQnaList(Counsel counsel) {
|
|
|
- Collection<Counsel> counselList = counselDao.getOneToOneQnaList(counsel);
|
|
|
- if (counselList != null && !counselList.isEmpty()) {
|
|
|
- for (Counsel item : counselList) {
|
|
|
- item.setQuestContent(GagaStringUtil.replace(item.getQuestContent(), "\r\n", "<br/>"));
|
|
|
- item.setAnsContent(GagaStringUtil.replace(item.getAnsContent(), "\r\n", "<br/>"));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return counselList;
|
|
|
+ return counselDao.getOneToOneQnaList(counsel);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -200,7 +190,7 @@ public class TsfCounselService {
|
|
|
throw new IllegalStateException("답변이 완료되지 않아 삭제할 수 없습니다.");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 1:1문의 사진 리스트
|
|
|
* @param counsel -상담정보
|
|
|
@@ -208,7 +198,7 @@ public class TsfCounselService {
|
|
|
* @author sowon
|
|
|
* @since 2021. 06. 214
|
|
|
*/
|
|
|
- public Collection<Counsel> getOneToOneImgList(Counsel counsel){
|
|
|
+ public Collection<Counsel> getOneToOneImgList(Counsel counsel) {
|
|
|
return counselDao.getOneToOneImgList(counsel);
|
|
|
}
|
|
|
|
|
|
@@ -262,13 +252,7 @@ public class TsfCounselService {
|
|
|
* @since 2020. 12. 24
|
|
|
*/
|
|
|
public Collection<Counsel> getGoodsQnaList(Counsel counsel) {
|
|
|
- Collection<Counsel> counselList = counselDao.getGoodsQnaList(counsel);
|
|
|
- for (Counsel item : counselList) {
|
|
|
- item.setQuestContent(GagaStringUtil.replace(item.getQuestContent(), "\r\n", "<br/>"));
|
|
|
- item.setAnsContent(GagaStringUtil.replace(item.getAnsContent(), "\r\n", "<br/>"));
|
|
|
- }
|
|
|
-
|
|
|
- return counselList;
|
|
|
+ return counselDao.getGoodsQnaList(counsel);
|
|
|
}
|
|
|
|
|
|
/**
|