3118 lines
93 KiB
Java
3118 lines
93 KiB
Java
|
|
package com.pms.service;
|
||
|
|
|
||
|
|
import java.io.File;
|
||
|
|
import java.io.FileInputStream;
|
||
|
|
import java.net.URLDecoder;
|
||
|
|
import java.sql.Clob;
|
||
|
|
import java.util.ArrayList;
|
||
|
|
import java.util.HashMap;
|
||
|
|
import java.util.Iterator;
|
||
|
|
import java.util.List;
|
||
|
|
import java.util.Map;
|
||
|
|
import java.util.zip.ZipEntry;
|
||
|
|
|
||
|
|
import javax.servlet.http.HttpServletRequest;
|
||
|
|
import javax.servlet.http.HttpSession;
|
||
|
|
|
||
|
|
import org.apache.ibatis.session.SqlSession;
|
||
|
|
import org.apache.poi.ss.usermodel.CellValue;
|
||
|
|
import org.apache.poi.ss.usermodel.DataFormatter;
|
||
|
|
import org.apache.poi.ss.usermodel.FormulaEvaluator;
|
||
|
|
import org.apache.poi.xssf.usermodel.XSSFCell;
|
||
|
|
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.stereotype.Service;
|
||
|
|
|
||
|
|
import com.pms.common.JsonUtil;
|
||
|
|
import com.pms.common.Message;
|
||
|
|
import com.pms.common.SqlMapConfig;
|
||
|
|
import com.pms.common.bean.PersonBean;
|
||
|
|
import com.pms.common.utils.CommonUtils;
|
||
|
|
import com.pms.common.utils.Constants;
|
||
|
|
import com.pms.common.utils.MailUtil;
|
||
|
|
import java.net.URLDecoder;
|
||
|
|
|
||
|
|
@Service
|
||
|
|
public class PartMgmtService {
|
||
|
|
|
||
|
|
CommonService commonService = null;
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
ProjectService projectService;
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
ProductionMngService productionMngService;
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
public void setCommonService(CommonService commonService){
|
||
|
|
this.commonService = commonService;
|
||
|
|
}
|
||
|
|
|
||
|
|
public boolean saveProjectConceptBasicInfo(Map paramMap){
|
||
|
|
boolean result = false;
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
int cnt = sqlSession.update("common.getMilestoneList", paramMap);
|
||
|
|
if(cnt > 0) result = true;
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
/*************************************************************************************************************************/
|
||
|
|
/*jmpark start*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 부서정보 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List searchDeptList(Map paramMap){
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = sqlSession.selectList("projectConcept.searchDeptList", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 제품별 협조부서 등록
|
||
|
|
* @param paramMap
|
||
|
|
* @param checkedDeptList
|
||
|
|
*/
|
||
|
|
public int saveProjectConceptProductDeptInfo(Map paramMap, List<String> checkedDeptList){
|
||
|
|
int resultCnt = 0;
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
if(checkedDeptList != null){
|
||
|
|
for(String deptCode : checkedDeptList){
|
||
|
|
String objId = CommonUtils.createObjId();
|
||
|
|
|
||
|
|
//set parameter
|
||
|
|
paramMap.put("deptCode", deptCode);
|
||
|
|
paramMap.put("objId", objId);
|
||
|
|
|
||
|
|
resultCnt += (int)sqlSession.update("projectConcept.mergeProjectConceptProductDeptInfo", paramMap);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultCnt;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 제품별 협조부서 목록 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getProjectConceptProductDeptList(Map paramMap){
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = sqlSession.selectList("projectConcept.getProjectConceptProductDeptList", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 주주현황 담당자 분기별 실적
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public ArrayList<HashMap> makeGoalList(Map paramMap){
|
||
|
|
ArrayList resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getmakeGoalList", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 제품 정보 저장
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map saveProjectConceptProductInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
HttpSession session = request.getSession();
|
||
|
|
|
||
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||
|
|
Map info = person.getLoginInfo();
|
||
|
|
|
||
|
|
System.out.println("paramMap : "+paramMap);
|
||
|
|
|
||
|
|
//접속자
|
||
|
|
String userId = CommonUtils.checkNull(info.get("userId"));
|
||
|
|
|
||
|
|
paramMap.put("userId", userId);
|
||
|
|
int cnt = sqlSession.update("projectConcept.mergeProjectConceptProductInfo", paramMap);
|
||
|
|
|
||
|
|
//수주활동 제품별 협조부서별 자료회신요청일 수정.
|
||
|
|
Iterator it = paramMap.keySet().iterator();
|
||
|
|
while(it.hasNext()){
|
||
|
|
String key = (String)it.next();
|
||
|
|
if(key.startsWith("replyReqDate")){
|
||
|
|
if(key.contains("_")){
|
||
|
|
String deptCode = key.substring(key.indexOf("_")+1);
|
||
|
|
String replyReqDate = CommonUtils.checkNull(paramMap.get(key));
|
||
|
|
|
||
|
|
Map deptInfoParamMap = new HashMap();
|
||
|
|
deptInfoParamMap.put("targetObjId", CommonUtils.checkNull(paramMap.get("objId")));
|
||
|
|
deptInfoParamMap.put("deptCode", deptCode);
|
||
|
|
deptInfoParamMap.put("replyReqDate", replyReqDate);
|
||
|
|
|
||
|
|
System.out.println("deptInfoParamMap : "+deptInfoParamMap);
|
||
|
|
|
||
|
|
sqlSession.update("projectConcept.updateProjectConceptProductDeptReplyReqDate", deptInfoParamMap);
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동별 입찰품목 목록 조회(수주활동 상세팝업 內)
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getProjectConceptProductList_forProjectConcept(Map paramMap){
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
resultList = sqlSession.selectList("projectConcept.getProjectConceptProductList_forProjectConcept", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 정보 저장
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map saveProjectConceptInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
PersonBean person = (PersonBean)request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||
|
|
paramMap.put("userId", person.getUserId());
|
||
|
|
|
||
|
|
System.out.println("paramMap : "+paramMap);
|
||
|
|
int cnt = sqlSession.update("projectConcept.mergeProjectConceptInfo", paramMap);
|
||
|
|
|
||
|
|
//기존에 등록된 milestone 정보 삭제
|
||
|
|
sqlSession.delete("projectConcept.deleteProjectConceptMilestoneInfo", paramMap);
|
||
|
|
|
||
|
|
//수주활동 Milestone별 날짜 저장
|
||
|
|
Iterator it = paramMap.keySet().iterator();
|
||
|
|
while(it.hasNext()){
|
||
|
|
String key = (String)it.next();
|
||
|
|
if(key.startsWith("milestoneDate")){
|
||
|
|
if(key.contains("_")){
|
||
|
|
String milestoneObjId = key.substring(key.indexOf("_")+1);
|
||
|
|
String milestoneDate = CommonUtils.checkNull(paramMap.get(key));
|
||
|
|
|
||
|
|
Map milestoneParamMap = new HashMap();
|
||
|
|
milestoneParamMap.put("objId", CommonUtils.createObjId());
|
||
|
|
milestoneParamMap.put("targetObjId", CommonUtils.checkNull(paramMap.get("objId")));
|
||
|
|
milestoneParamMap.put("oemObjId", CommonUtils.checkNull(paramMap.get("oemObjId")));
|
||
|
|
milestoneParamMap.put("milestoneObjId", milestoneObjId);
|
||
|
|
milestoneParamMap.put("milestoneDate", milestoneDate);
|
||
|
|
|
||
|
|
System.out.println("milestoneParamMap : "+milestoneParamMap);
|
||
|
|
|
||
|
|
//milestone 정보 저장
|
||
|
|
sqlSession.update("projectConcept.mergeProjectConceptMilestoneInfo", milestoneParamMap);
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/** 영업활동등록
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map savePartMgmtTempInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
Map resultList = null;
|
||
|
|
Map sqlMap = new HashMap();
|
||
|
|
Map specMap = new HashMap();
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
//PART TEMP 수정
|
||
|
|
int cnt = sqlSession.update("part.updatePartTempInfo", paramMap);
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
public List structureAscendingList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map<String,Object>> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("partMng.structureAscendingList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return CommonUtils.toUpperCaseMapKey(resultList);
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* PART 역전개 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List structureDescendingList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map<String,Object>> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("partMng.structureDescendingList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return CommonUtils.toUpperCaseMapKey(resultList);
|
||
|
|
}
|
||
|
|
public List structureDescendingListPopup(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map<String,Object>> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("partMng.structureDescendingListPopup", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return CommonUtils.toUpperCaseMapKey(resultList);
|
||
|
|
}
|
||
|
|
public List structureAscendingListPopup(HttpServletRequest request,Map paramMap){
|
||
|
|
|
||
|
|
List colNameList = new ArrayList();
|
||
|
|
List<Map<String,Object>> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
int maxLevel = 0;
|
||
|
|
|
||
|
|
try{
|
||
|
|
|
||
|
|
List<Map<String,Object>> tempList = new ArrayList();
|
||
|
|
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
tempList = (ArrayList)sqlSession.selectList("partMng.structureAscendingListPopup", paramMap);
|
||
|
|
|
||
|
|
tempList = CommonUtils.toUpperCaseMapKey(tempList);
|
||
|
|
|
||
|
|
if (null != tempList && 0 < tempList.size()) {
|
||
|
|
for (int i=0; i < tempList.size(); i++) {
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
resultMap = (HashMap)tempList.get(i);
|
||
|
|
|
||
|
|
int resultLevel = Integer.parseInt(CommonUtils.checkNull(resultMap.get("LEV"), "0"));
|
||
|
|
|
||
|
|
if (maxLevel < resultLevel) {
|
||
|
|
maxLevel = resultLevel;
|
||
|
|
|
||
|
|
Map colNameMap = new HashMap();
|
||
|
|
|
||
|
|
colNameMap.put("COL_NAME","LEV_COL_NAME"+resultLevel);
|
||
|
|
colNameMap.put("COL_VAL","LEV_"+resultLevel);
|
||
|
|
colNameMap.put("COL_HEADER_VAL",resultLevel);
|
||
|
|
|
||
|
|
colNameList.add(colNameMap);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
for (int i=0; i < tempList.size(); i++) {
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
resultMap = (HashMap) tempList.get(i);
|
||
|
|
|
||
|
|
int level = Integer.parseInt(CommonUtils.checkNull(resultMap.get("LEV"), "0"));
|
||
|
|
|
||
|
|
for ( int j = 0; j < maxLevel; j++) {
|
||
|
|
String levelSymbol = "";
|
||
|
|
|
||
|
|
if ((j+1) == level) {
|
||
|
|
levelSymbol = "*";
|
||
|
|
} else {
|
||
|
|
levelSymbol = "";
|
||
|
|
}
|
||
|
|
|
||
|
|
resultMap.put("LEV_"+Integer.toString((j+1)), levelSymbol);
|
||
|
|
resultMap.put("LEV_COL_NAME"+Integer.toString((j+1)),"LEV_"+Integer.toString((j+1)));
|
||
|
|
}
|
||
|
|
|
||
|
|
resultList.add(resultMap);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
System.out.println("colNameList:"+colNameList);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
request.setAttribute("COL_NAME_LIST", colNameList);
|
||
|
|
|
||
|
|
return CommonUtils.toUpperCaseMapKey(resultList);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/** PART복제
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map savePartCopyInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
Map resultList = null;
|
||
|
|
Map sqlMap = new HashMap();
|
||
|
|
Map specMap = new HashMap();
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
//PART COPY
|
||
|
|
int cnt = sqlSession.insert("part.insertPartCopy", paramMap);
|
||
|
|
|
||
|
|
//도면 복제
|
||
|
|
cnt = sqlSession.insert("part.insertPartCopyFile", paramMap);
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void savePartMaster(HttpServletRequest request,Map paramMap){
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
Map tempMap = new HashMap();
|
||
|
|
try{
|
||
|
|
String GridData = CommonUtils.checkNull(paramMap.get("jqGrid"));
|
||
|
|
System.out.println("GridData -------------------------->"+GridData);
|
||
|
|
System.out.println("CommonUtils.checkNull(paramMap.get(jqGrid)) -------------------------->"+CommonUtils.checkNull(paramMap.get("jqGrid")));
|
||
|
|
|
||
|
|
List<Map<String, Object>> gridDataList = JsonUtil.JsonToList(GridData);
|
||
|
|
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
byte[] buf = new byte[1024];
|
||
|
|
System.out.println("gridDataSIZE : " + gridDataList.size());
|
||
|
|
for(int i=0; i<gridDataList.size(); i++){
|
||
|
|
Map insertMap = gridDataList.get(i);
|
||
|
|
Map fileMap = new HashMap();
|
||
|
|
String PART_MGMT_OBJID = CommonUtils.createObjId();
|
||
|
|
|
||
|
|
insertMap.put("OBJID", PART_MGMT_OBJID);
|
||
|
|
insertMap.put("CONNECTUSERID", (String)paramMap.get("CONNECTUSERID"));
|
||
|
|
insertMap.put("PRODUCT_MGMT_OBJID", (String)paramMap.get("product_mgmt_objid"));
|
||
|
|
insertMap.put("UPG_NO", (String)paramMap.get("upg_no"));
|
||
|
|
|
||
|
|
String CNT = CommonUtils.checkNull((String)insertMap.get("CNT"));
|
||
|
|
String PART_NO = CommonUtils.checkNull((String)insertMap.get("PART_NO"));
|
||
|
|
String PARENT_PART_NO = CommonUtils.checkNull((String)insertMap.get("PARENT_PART_NO"));
|
||
|
|
String ORI_PART_NO = CommonUtils.checkNull((String)insertMap.get("PART_NO"));
|
||
|
|
String PART_NAME = CommonUtils.checkNull((String)insertMap.get("PART_NAME"));
|
||
|
|
String SPEC = CommonUtils.checkNull((String)insertMap.get("SPEC"));
|
||
|
|
String WEIGHT = CommonUtils.checkNull((String)insertMap.get("WEIGHT"));
|
||
|
|
String MATERIAL = CommonUtils.checkNull((String)insertMap.get("MATERIAL"));
|
||
|
|
String SUB_MATERIAL = CommonUtils.checkNull((String)insertMap.get("SUB_MATERIAL"));
|
||
|
|
String REMARK = CommonUtils.checkNull((String)insertMap.get("REMARK"));
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
insertMap.put("PART_NO", PART_NO.replace("§", "&"));
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO.replace("§", "&"));
|
||
|
|
insertMap.put("PART_NAME", PART_NAME.replace("§", "&"));
|
||
|
|
insertMap.put("SPEC", SPEC.replace("§", "&"));
|
||
|
|
insertMap.put("WEIGHT", WEIGHT.replace("§", "&"));
|
||
|
|
insertMap.put("MATERIAL", MATERIAL.replace("§", "&"));
|
||
|
|
insertMap.put("SUB_MATERIAL", MATERIAL.replace("§", "&"));
|
||
|
|
insertMap.put("REMARK", REMARK.replace("§", "&"));
|
||
|
|
|
||
|
|
insertMap.put("PART_NO", PART_NO.replace("※", "%"));
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO.replace("※", "%"));
|
||
|
|
insertMap.put("PART_NAME", PART_NAME.replace("※", "%"));
|
||
|
|
insertMap.put("SPEC", SPEC.replace("※", "%"));
|
||
|
|
insertMap.put("WEIGHT", WEIGHT.replace("※", "%"));
|
||
|
|
insertMap.put("MATERIAL", MATERIAL.replace("※", "%"));
|
||
|
|
insertMap.put("SUB_MATERIAL", MATERIAL.replace("※", "%"));
|
||
|
|
insertMap.put("REMARK", REMARK.replace("※", "%"));
|
||
|
|
|
||
|
|
|
||
|
|
PART_NO = CommonUtils.checkNull((String)insertMap.get("PART_NO"));
|
||
|
|
String PART_NO_CK = PART_NO.substring(PART_NO.length()-3, PART_NO.length());
|
||
|
|
String PART_NO_CK_ = PART_NO.substring(PART_NO.length()-2, PART_NO.length());
|
||
|
|
System.out.println("PART_NO_CK :: " + PART_NO_CK);
|
||
|
|
|
||
|
|
insertMap.put("REVISION", "");
|
||
|
|
String RVCheck = "";
|
||
|
|
if("R0".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R1".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R01");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R2".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R02");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R3".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R03");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R4".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R04");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R5".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R05");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R6".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R06");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R7".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R07");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R8".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R08");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R9".equals(PART_NO_CK_)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-2);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R09");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if(!"Y".equals(RVCheck)){
|
||
|
|
|
||
|
|
if("R00".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
|
||
|
|
}else if("R01".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R01");
|
||
|
|
|
||
|
|
}else if("R02".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R02");
|
||
|
|
|
||
|
|
}else if("R03".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R03");
|
||
|
|
|
||
|
|
}else if("R04".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R04");
|
||
|
|
|
||
|
|
}else if("R05".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R05");
|
||
|
|
|
||
|
|
}else if("R06".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R06");
|
||
|
|
|
||
|
|
}else if("R07".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R07");
|
||
|
|
|
||
|
|
}else if("R08".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R08");
|
||
|
|
|
||
|
|
}else if("R09".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R09");
|
||
|
|
|
||
|
|
}else if("R10".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R10");
|
||
|
|
|
||
|
|
}else if("R11".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R11");
|
||
|
|
|
||
|
|
}else if("R12".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R12");
|
||
|
|
|
||
|
|
}else if("R13".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R13");
|
||
|
|
|
||
|
|
}else if("R14".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R14");
|
||
|
|
|
||
|
|
}else if("R15".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R15");
|
||
|
|
|
||
|
|
}else if("R16".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R16");
|
||
|
|
|
||
|
|
}else if("R17".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R17");
|
||
|
|
|
||
|
|
}else if("R18".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R18");
|
||
|
|
|
||
|
|
}else if("R19".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R19");
|
||
|
|
|
||
|
|
}else if("R20".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R20");
|
||
|
|
|
||
|
|
}else if("R21".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R21");
|
||
|
|
|
||
|
|
}else if("R22".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R22");
|
||
|
|
|
||
|
|
}else if("R23".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R23");
|
||
|
|
|
||
|
|
}else if("R24".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R24");
|
||
|
|
|
||
|
|
}else if("R25".equals(PART_NO_CK)){
|
||
|
|
PART_NO = PART_NO.substring(0,PART_NO.length()-3);
|
||
|
|
insertMap.put("PART_NO", PART_NO);
|
||
|
|
insertMap.put("REVISION", "R25");
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
PARENT_PART_NO = CommonUtils.checkNull((String)insertMap.get("PARENT_PART_NO"));
|
||
|
|
insertMap.put("PARENT_REVISION", "");
|
||
|
|
|
||
|
|
if(!"".equals(PARENT_PART_NO)){
|
||
|
|
|
||
|
|
String PARENT_PART_NO_CK = PARENT_PART_NO.substring(PARENT_PART_NO.length()-3, PARENT_PART_NO.length());
|
||
|
|
String PARENT_PART_NO_CK_ = PARENT_PART_NO.substring(PARENT_PART_NO.length()-2, PARENT_PART_NO.length());
|
||
|
|
System.out.println("PARENT_PART_NO_CK :: " + PARENT_PART_NO_CK);
|
||
|
|
|
||
|
|
|
||
|
|
String PARENT_RVCheck = "";
|
||
|
|
if("R0".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R1".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R01");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R2".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R02");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R3".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R03");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R4".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R04");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R5".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R05");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R6".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R06");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R7".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R07");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}else if("R8".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R08");
|
||
|
|
RVCheck = "Y";
|
||
|
|
}else if("R9".equals(PARENT_PART_NO_CK_)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-2);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R09");
|
||
|
|
PARENT_RVCheck = "Y";
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if(!"Y".equals(PARENT_RVCheck)){
|
||
|
|
|
||
|
|
if("R00".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
|
||
|
|
}else if("R01".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R01");
|
||
|
|
|
||
|
|
}else if("R02".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R02");
|
||
|
|
|
||
|
|
}else if("R03".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R03");
|
||
|
|
|
||
|
|
}else if("R04".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R04");
|
||
|
|
|
||
|
|
}else if("R05".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R05");
|
||
|
|
|
||
|
|
}else if("R06".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R06");
|
||
|
|
|
||
|
|
}else if("R07".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R07");
|
||
|
|
|
||
|
|
}else if("R08".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R08");
|
||
|
|
|
||
|
|
}else if("R09".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R09");
|
||
|
|
|
||
|
|
}else if("R10".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R10");
|
||
|
|
|
||
|
|
}else if("R11".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R11");
|
||
|
|
|
||
|
|
}else if("R12".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R12");
|
||
|
|
|
||
|
|
}else if("R13".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R13");
|
||
|
|
|
||
|
|
}else if("R14".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R14");
|
||
|
|
|
||
|
|
}else if("R15".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R15");
|
||
|
|
|
||
|
|
}else if("R16".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R16");
|
||
|
|
|
||
|
|
}else if("R17".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R17");
|
||
|
|
|
||
|
|
}else if("R18".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R18");
|
||
|
|
|
||
|
|
}else if("R19".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R19");
|
||
|
|
|
||
|
|
}else if("R20".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R20");
|
||
|
|
|
||
|
|
}else if("R21".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R21");
|
||
|
|
|
||
|
|
}else if("R22".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R22");
|
||
|
|
|
||
|
|
}else if("R23".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R23");
|
||
|
|
|
||
|
|
}else if("R24".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R24");
|
||
|
|
|
||
|
|
}else if("R25".equals(PARENT_PART_NO_CK)){
|
||
|
|
PARENT_PART_NO = PARENT_PART_NO.substring(0,PARENT_PART_NO.length()-3);
|
||
|
|
insertMap.put("PARENT_PART_NO", PARENT_PART_NO);
|
||
|
|
insertMap.put("PARENT_REVISION", "R25");
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if("0".equals(CNT)){
|
||
|
|
//part 저장
|
||
|
|
sqlSession.insert("part.insertpartMngInfo", insertMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
//tempMap = sqlSession.selectOne("part.getProduct_model_code", paramMap);
|
||
|
|
|
||
|
|
//System.out.println("tempMap :: " + tempMap);
|
||
|
|
String filepath = Constants.FILE_STORAGE+"\\PART_DATA\\"+(String)paramMap.get("product_name")+(String)paramMap.get("model_name");
|
||
|
|
System.out.println("filepath :: " + filepath);
|
||
|
|
|
||
|
|
//폴더생성
|
||
|
|
File storage = new File(filepath);
|
||
|
|
|
||
|
|
if(!storage.exists()) storage.mkdirs();
|
||
|
|
|
||
|
|
fileMap.put("FILE_PATH",filepath);
|
||
|
|
fileMap.put("WRITER",(String)paramMap.get("CONNECTUSERID"));
|
||
|
|
|
||
|
|
|
||
|
|
//dwg
|
||
|
|
fileMap.put("OBJID", CommonUtils.createObjId());
|
||
|
|
fileMap.put("TARGET_OBJID", PART_MGMT_OBJID);
|
||
|
|
fileMap.put("SAVED_FILE_NAME", ORI_PART_NO+".dwg");
|
||
|
|
fileMap.put("REAL_FILE_NAME",ORI_PART_NO+".dwg");
|
||
|
|
fileMap.put("DOC_TYPE" ,"2D_DRAWING_CAD");
|
||
|
|
fileMap.put("DOC_TYPE_NAME","2D(Drawing) CAD 첨부파일");
|
||
|
|
|
||
|
|
fileMap.put("FILE_SIZE","167941");
|
||
|
|
fileMap.put("FILE_EXT","DWG");
|
||
|
|
|
||
|
|
System.out.println("fileMap --->"+ fileMap);
|
||
|
|
//처부파일 가져오기
|
||
|
|
File file = new File(filepath+File.separator+ORI_PART_NO+".dwg");
|
||
|
|
|
||
|
|
System.out.println("file --->"+ file.getName());
|
||
|
|
System.out.println("checkBeforeFile(file)" +checkBeforeFile(file));
|
||
|
|
if(checkBeforeFile(file)){
|
||
|
|
//첨부저장이 존재 할때만 DWG 저장
|
||
|
|
sqlSession.insert("part.insertpartfileInfo", fileMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//pdf
|
||
|
|
file = new File(filepath+File.separator+ORI_PART_NO+".pdf");
|
||
|
|
|
||
|
|
if(checkBeforeFile(file)){
|
||
|
|
fileMap.isEmpty();
|
||
|
|
//첨부저장이 존재 할때만 PDF 저장
|
||
|
|
|
||
|
|
fileMap.put("OBJID", CommonUtils.createObjId());
|
||
|
|
fileMap.put("TARGET_OBJID", PART_MGMT_OBJID);
|
||
|
|
fileMap.put("SAVED_FILE_NAME", ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("REAL_FILE_NAME",ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("DOC_TYPE" ,"2D_PDF_CAD");
|
||
|
|
fileMap.put("DOC_TYPE_NAME","2D(PDF) CAD 첨부파일");
|
||
|
|
|
||
|
|
fileMap.put("FILE_SIZE","167941");
|
||
|
|
fileMap.put("FILE_EXT","PDF");
|
||
|
|
|
||
|
|
//첨부저장이 존재 할때만 DWG 저장
|
||
|
|
sqlSession.insert("part.insertpartfileInfo", fileMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//3d 문서 시작
|
||
|
|
file = new File(filepath+File.separator+ORI_PART_NO+".ipt");
|
||
|
|
|
||
|
|
if(checkBeforeFile(file)){
|
||
|
|
fileMap.isEmpty();
|
||
|
|
//첨부저장이 존재 할때만 PDF 저장
|
||
|
|
|
||
|
|
fileMap.put("OBJID", CommonUtils.createObjId());
|
||
|
|
fileMap.put("TARGET_OBJID", PART_MGMT_OBJID);
|
||
|
|
fileMap.put("SAVED_FILE_NAME", ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("REAL_FILE_NAME",ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("DOC_TYPE" ,"3D_CAD");
|
||
|
|
fileMap.put("DOC_TYPE_NAME","3D CAD 첨부파일");
|
||
|
|
|
||
|
|
fileMap.put("FILE_SIZE","167941");
|
||
|
|
fileMap.put("FILE_EXT","IPT");
|
||
|
|
|
||
|
|
//첨부저장이 존재 할때만 DWG 저장
|
||
|
|
sqlSession.insert("part.insertpartfileInfo", fileMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
file = new File(filepath+File.separator+ORI_PART_NO+".iam");
|
||
|
|
|
||
|
|
if(checkBeforeFile(file)){
|
||
|
|
fileMap.isEmpty();
|
||
|
|
//첨부저장이 존재 할때만 PDF 저장
|
||
|
|
|
||
|
|
fileMap.put("OBJID", CommonUtils.createObjId());
|
||
|
|
fileMap.put("TARGET_OBJID", PART_MGMT_OBJID);
|
||
|
|
fileMap.put("SAVED_FILE_NAME", ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("REAL_FILE_NAME",ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("DOC_TYPE" ,"3D_CAD");
|
||
|
|
fileMap.put("DOC_TYPE_NAME","3D CAD 첨부파일");
|
||
|
|
|
||
|
|
fileMap.put("FILE_SIZE","167941");
|
||
|
|
fileMap.put("FILE_EXT","IAM");
|
||
|
|
|
||
|
|
//첨부저장이 존재 할때만 DWG 저장
|
||
|
|
sqlSession.insert("part.insertpartfileInfo", fileMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
file = new File(filepath+File.separator+ORI_PART_NO+".sldpart");
|
||
|
|
|
||
|
|
if(checkBeforeFile(file)){
|
||
|
|
fileMap.isEmpty();
|
||
|
|
//첨부저장이 존재 할때만 PDF 저장
|
||
|
|
|
||
|
|
fileMap.put("OBJID", CommonUtils.createObjId());
|
||
|
|
fileMap.put("TARGET_OBJID", PART_MGMT_OBJID);
|
||
|
|
fileMap.put("SAVED_FILE_NAME", ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("REAL_FILE_NAME",ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("DOC_TYPE" ,"3D_CAD");
|
||
|
|
fileMap.put("DOC_TYPE_NAME","3D CAD 첨부파일");
|
||
|
|
|
||
|
|
fileMap.put("FILE_SIZE","167941");
|
||
|
|
fileMap.put("FILE_EXT","SLDPART");
|
||
|
|
|
||
|
|
//첨부저장이 존재 할때만 DWG 저장
|
||
|
|
sqlSession.insert("part.insertpartfileInfo", fileMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
file = new File(filepath+File.separator+ORI_PART_NO+".sldasm");
|
||
|
|
|
||
|
|
if(checkBeforeFile(file)){
|
||
|
|
fileMap.isEmpty();
|
||
|
|
//첨부저장이 존재 할때만 PDF 저장
|
||
|
|
fileMap.put("OBJID", CommonUtils.createObjId());
|
||
|
|
fileMap.put("TARGET_OBJID", PART_MGMT_OBJID);
|
||
|
|
fileMap.put("SAVED_FILE_NAME", ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("REAL_FILE_NAME",ORI_PART_NO+".pdf");
|
||
|
|
fileMap.put("DOC_TYPE" ,"3D_CAD");
|
||
|
|
fileMap.put("DOC_TYPE_NAME","3D CAD 첨부파일");
|
||
|
|
|
||
|
|
fileMap.put("FILE_SIZE","167941");
|
||
|
|
fileMap.put("FILE_EXT","SLDASM");
|
||
|
|
|
||
|
|
//첨부저장이 존재 할때만 DWG 저장
|
||
|
|
sqlSession.insert("part.insertpartfileInfo", fileMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static boolean checkBeforeFile(File file){
|
||
|
|
//파일이 존재하고
|
||
|
|
if(file.exists()){
|
||
|
|
//그 파일이 파일이고, 읽을 수 있다면 true를 리턴한다.
|
||
|
|
if(file.isFile() && file.canRead()){
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/** 목표등록
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map savegoalMgmtInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
int cnt = 0;
|
||
|
|
|
||
|
|
PersonBean person = (PersonBean)request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||
|
|
|
||
|
|
String Year = request.getParameter("Year");
|
||
|
|
String[] objId = request.getParameterValues("objId");
|
||
|
|
String[] user_id = request.getParameterValues("user_id");
|
||
|
|
|
||
|
|
String[] month1 = request.getParameterValues("month1");
|
||
|
|
String[] month2 = request.getParameterValues("month2");
|
||
|
|
String[] month3 = request.getParameterValues("month3");
|
||
|
|
String[] month4 = request.getParameterValues("month4");
|
||
|
|
String[] month5 = request.getParameterValues("month5");
|
||
|
|
String[] month6 = request.getParameterValues("month6");
|
||
|
|
String[] month7 = request.getParameterValues("month7");
|
||
|
|
String[] month8 = request.getParameterValues("month8");
|
||
|
|
String[] month9 = request.getParameterValues("month9");
|
||
|
|
String[] month10 = request.getParameterValues("month10");
|
||
|
|
String[] month11 = request.getParameterValues("month11");
|
||
|
|
String[] month12 = request.getParameterValues("month12");
|
||
|
|
String[] total = request.getParameterValues("total");
|
||
|
|
|
||
|
|
if(null != objId && 0 < objId.length){
|
||
|
|
for(int i=0;i<objId.length;i++){
|
||
|
|
HashMap sqlParamMap = new HashMap();
|
||
|
|
String objid = CommonUtils.checkNull(objId[i]);
|
||
|
|
if("".equals(objid)){
|
||
|
|
objid = CommonUtils.createObjId();
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlParamMap.put("Year", Year);
|
||
|
|
sqlParamMap.put("objId", objid);
|
||
|
|
sqlParamMap.put("user_id", user_id[i]);
|
||
|
|
sqlParamMap.put("month1", month1[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month2", month2[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month3", month3[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month4", month4[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month5", month5[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month6", month6[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month7", month7[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month8", month8[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month9", month9[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month10", month10[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month11", month11[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("month12", month12[i].replaceAll(",", ""));
|
||
|
|
sqlParamMap.put("writer", person.getUserId());
|
||
|
|
cnt = sqlSession.update("projectConcept.mergegoalMgmtInfo", sqlParamMap);
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/** 영업활동등록
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map mergeOrderMgmtSubInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
int cnt = 0;
|
||
|
|
|
||
|
|
String[] parentObjId = request.getParameterValues("parentObjId");
|
||
|
|
String[] objId = request.getParameterValues("objId");
|
||
|
|
String[] model_name = request.getParameterValues("model_name");
|
||
|
|
String[] spec_cd = request.getParameterValues("spec_cd");
|
||
|
|
String[] contract_amount = request.getParameterValues("contract_amount");
|
||
|
|
String[] delivery_date = request.getParameterValues("delivery_date");
|
||
|
|
String[] sch_date = request.getParameterValues("sch_date");
|
||
|
|
String[] count = request.getParameterValues("count");
|
||
|
|
|
||
|
|
if(null != parentObjId && 0 < parentObjId.length){
|
||
|
|
for(int i=0;i<parentObjId.length;i++){
|
||
|
|
HashMap sqlParamMap = new HashMap();
|
||
|
|
String objid = CommonUtils.checkNull(objId[i]);
|
||
|
|
if("".equals(objid)){
|
||
|
|
objid = CommonUtils.createObjId();
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlParamMap.put("objId", objid);
|
||
|
|
sqlParamMap.put("parentObjId", CommonUtils.checkNull(parentObjId[i]));
|
||
|
|
|
||
|
|
sqlParamMap.put("model_name", CommonUtils.checkNull(model_name[i]));
|
||
|
|
sqlParamMap.put("spec_cd", CommonUtils.checkNull(spec_cd[i]));
|
||
|
|
sqlParamMap.put("count", CommonUtils.checkNull(count[i]));
|
||
|
|
sqlParamMap.put("contract_amount", CommonUtils.checkNull(contract_amount[i]));
|
||
|
|
sqlParamMap.put("delivery_date", CommonUtils.checkNull(delivery_date[i]));
|
||
|
|
sqlParamMap.put("delivery_date", CommonUtils.checkNull(delivery_date[i]));
|
||
|
|
sqlParamMap.put("sch_date", CommonUtils.checkNull(sch_date[i]));
|
||
|
|
|
||
|
|
//선택된 기변항목의 목록을 가져와 파트와 연결한다.
|
||
|
|
cnt = sqlSession.update("projectConcept.mergeOrderMgmtSubInfo", sqlParamMap);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/** 영업품목 상세 삭제
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map delOrderMgmttSubInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
Map sqlMap = new HashMap();
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
PersonBean person = (PersonBean)request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||
|
|
paramMap.put("userId", person.getUserId());
|
||
|
|
|
||
|
|
System.out.println("paramMap : "+paramMap);
|
||
|
|
String Key = (String) paramMap.get("delKey");
|
||
|
|
String [] delKey = Key.split(",");
|
||
|
|
|
||
|
|
sqlMap.put("delObjKeyarr", delKey);
|
||
|
|
int cnt = sqlSession.delete("projectConcept.deleteordermgmttsubinfo", sqlMap);
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.DELETE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.DELETE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동에 연결된 제품갯수 반환
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public int getProjectConceptProductCnt(Map paramMap){
|
||
|
|
int result = 0;
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
Map map = sqlSession.selectOne("projectConcept.getProjectConceptProductCnt", paramMap);
|
||
|
|
if(map != null){
|
||
|
|
result = Integer.parseInt(CommonUtils.checkNull(map.get("CNT"), "0"));
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동별 제품 삭제
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map deleteProjectConceptProductInfo(Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
//1. 수주활동 제품별 협력부서정보 삭제
|
||
|
|
int cnt1 = sqlSession.delete("projectConcept.deleteProjectConceptProductDeptInfo", paramMap);
|
||
|
|
|
||
|
|
//2. 수주활동별 제품정보 삭제
|
||
|
|
int cnt2 = sqlSession.delete("projectConcept.deleteProjectConceptProductInfo", paramMap);
|
||
|
|
|
||
|
|
if((cnt1+cnt2) > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.DELETE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.DELETE_FAILED);
|
||
|
|
sqlSession.rollback();
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 제품별 협조부서 삭제
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map deleteProjectConceptProductDeptInfo_byEach(Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
//수주활동 제품별 협력부서정보 삭제
|
||
|
|
int cnt = sqlSession.delete("projectConcept.deleteProjectConceptProductDeptInfo_byEach", paramMap);
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.DELETE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.DELETE_FAILED);
|
||
|
|
sqlSession.rollback();
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 목록조회(제품별로 Row 구성)
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getProjectConceptProductList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
System.out.println("getProjectConceptProductList"+paramMap);
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
String countPerPage = CommonUtils.checkNull(request.getParameter("countPerPage"), Constants.ADMIN_COUNT_PER_PAGE+"");
|
||
|
|
paramMap.put("COUNT_PER_PAGE", Integer.parseInt(countPerPage));
|
||
|
|
|
||
|
|
Map pageMap = (HashMap)sqlSession.selectOne("projectConcept.getProjectConceptProductListCnt", paramMap);
|
||
|
|
pageMap = (HashMap)CommonUtils.setPagingInfo(request, pageMap);
|
||
|
|
|
||
|
|
paramMap.put("PAGE_END", CommonUtils.checkNull(pageMap.get("PAGE_END")));
|
||
|
|
paramMap.put("PAGE_START", CommonUtils.checkNull(pageMap.get("PAGE_START")));
|
||
|
|
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getProjectConceptProductList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 등록된 엑셀 데이터를 part와 비교하여 리턴
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List parsingExcelData(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("partMng.getPartTempList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return CommonUtils.keyChangeUpperList(resultList);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 업로드된 Excel File을 통해 데이터를 Parsing 한다.
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public ArrayList parsingExcelFile(HttpServletRequest request,Map paramMap)throws Exception{
|
||
|
|
ArrayList resultList = new ArrayList();
|
||
|
|
ArrayList fileList = commonService.getFileList(paramMap);
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
if(null != fileList && 1 == fileList.size()){
|
||
|
|
HashMap fileMap = (HashMap)fileList.get(0);
|
||
|
|
|
||
|
|
String path = CommonUtils.checkNull(fileMap.get("FILE_PATH"));
|
||
|
|
String fileName = CommonUtils.checkNull(fileMap.get("SAVED_FILE_NAME"));
|
||
|
|
|
||
|
|
|
||
|
|
FileInputStream fis = new FileInputStream(path+"\\"+fileName);
|
||
|
|
XSSFWorkbook workBook = new XSSFWorkbook(fis);
|
||
|
|
FormulaEvaluator formulaEval = workBook.getCreationHelper().createFormulaEvaluator();
|
||
|
|
XSSFSheet sheet = workBook.getSheetAt(0);
|
||
|
|
// 데이터 포멧터
|
||
|
|
DataFormatter formatter = new DataFormatter();
|
||
|
|
int rows = sheet.getPhysicalNumberOfRows();
|
||
|
|
for(int rowIndex= 2 ; rowIndex < rows ; rowIndex++){
|
||
|
|
XSSFRow row = sheet.getRow(rowIndex);
|
||
|
|
if(null != row){
|
||
|
|
HashMap partMap = new HashMap();
|
||
|
|
HashMap sqlMap = new HashMap();
|
||
|
|
for(int columnIndex = 0 ; columnIndex < 11 ; columnIndex++){
|
||
|
|
XSSFCell cell = row.getCell(columnIndex);
|
||
|
|
//데이버 유형별 get date
|
||
|
|
String cellValue = "";
|
||
|
|
|
||
|
|
if(null == cell){
|
||
|
|
cellValue = "";
|
||
|
|
}else{
|
||
|
|
switch(cell.getCellType()){
|
||
|
|
case XSSFCell.CELL_TYPE_FORMULA:
|
||
|
|
CellValue evaluate = formulaEval.evaluate(cell);
|
||
|
|
|
||
|
|
if(6 == columnIndex){
|
||
|
|
System.out.println("****************************");
|
||
|
|
cellValue = Integer.toString((int)cell.getNumericCellValue());
|
||
|
|
System.out.println("cellValue1:"+cellValue);
|
||
|
|
}else{
|
||
|
|
cellValue = evaluate.formatAsString();
|
||
|
|
if(!"#N/A".equals(cellValue)){
|
||
|
|
cellValue = cell.getStringCellValue();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_FORMULA_____:"+cellValue);
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_NUMERIC:
|
||
|
|
cellValue = formatter.formatCellValue(cell);
|
||
|
|
/* if(7 == columnIndex){
|
||
|
|
cellValue = cell.getNumericCellValue()+"";
|
||
|
|
//cellValue = String.format("%.2f", Double.parseDouble(cellValue));
|
||
|
|
System.out.println("cellValue1:"+cellValue);
|
||
|
|
}else{
|
||
|
|
cellValue = cell.getNumericCellValue()+"";
|
||
|
|
System.out.println("cellValue2:"+cellValue);
|
||
|
|
}*/
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_NUMERIC:"+cellValue);
|
||
|
|
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_STRING:
|
||
|
|
cellValue = cell.getStringCellValue()+"";
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_STRING:"+cellValue);
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_BLANK:
|
||
|
|
cellValue = cell.getBooleanCellValue()+"";
|
||
|
|
// System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_BLANK:"+cellValue);
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_ERROR:
|
||
|
|
cellValue = cell.getErrorCellValue()+"";
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_ERROR:"+cellValue);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if("false".equals(cellValue)){
|
||
|
|
cellValue = "";
|
||
|
|
}
|
||
|
|
|
||
|
|
//품번
|
||
|
|
/*if(0 == columnIndex){
|
||
|
|
int duplicateCnt = 0;
|
||
|
|
if(null != cellValue){
|
||
|
|
paramMap.put("PART_NAME", cellValue);
|
||
|
|
paramMap.put("targetObjId", "");
|
||
|
|
ArrayList duplicateList = new ArrayList();
|
||
|
|
duplicateList = (ArrayList)getDuplicatePartList(request, paramMap);
|
||
|
|
if(0 < duplicateList.size()){
|
||
|
|
for(int i=0;i<duplicateList.size();i++){
|
||
|
|
HashMap duplicateMap = (HashMap)duplicateList.get(i);
|
||
|
|
String status = CommonUtils.checkNull(duplicateMap.get("STATUS"));
|
||
|
|
*//**
|
||
|
|
* 상태가 complete인 것이 있는 경우 Revision을 통해 등록해야하며
|
||
|
|
* Revision의 경우 Revision code등 일부 정보를 제외하고 수정 할 수 없다.
|
||
|
|
*//*
|
||
|
|
if(status.equals("complete") || status.equals("revision")){
|
||
|
|
duplicateCnt++;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
partMap.put("partDuplicate", duplicateCnt);
|
||
|
|
partMap.put("partNo", cellValue);
|
||
|
|
}*/
|
||
|
|
|
||
|
|
//0품명
|
||
|
|
if(0 == columnIndex){
|
||
|
|
if("".equals(cellValue)){
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
sqlMap.put("PART_NO", cellValue.trim());
|
||
|
|
partMap.put("PART_NO", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//품번
|
||
|
|
if(1 == columnIndex){
|
||
|
|
sqlMap.put("PART_NAME", cellValue.trim());
|
||
|
|
partMap.put("PART_NAME", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//모품번
|
||
|
|
if(2 == columnIndex){
|
||
|
|
sqlMap.put("PARENT_PART_NO", cellValue.trim());
|
||
|
|
partMap.put("PARENT_PART_NO", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//UNIT
|
||
|
|
if(3 == columnIndex){
|
||
|
|
if("EA".equals(cellValue.trim())){
|
||
|
|
cellValue ="0000060";
|
||
|
|
}else if("SET".equals(cellValue.trim())){
|
||
|
|
cellValue ="0000061";
|
||
|
|
}
|
||
|
|
sqlMap.put("UNIT", cellValue.trim());
|
||
|
|
partMap.put("UNIT", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
if(4 == columnIndex){
|
||
|
|
sqlMap.put("QTY", cellValue.trim());
|
||
|
|
partMap.put("QTY", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//spec
|
||
|
|
if(5 == columnIndex){
|
||
|
|
sqlMap.put("SPEC", cellValue.trim());
|
||
|
|
partMap.put("SPEC", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//MATERIAL
|
||
|
|
if(6 == columnIndex){
|
||
|
|
sqlMap.put("MATERIAL", cellValue.trim());
|
||
|
|
partMap.put("MATERIAL", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//MATERIAL
|
||
|
|
if(7 == columnIndex){
|
||
|
|
sqlMap.put("SUB_MATERIAL", cellValue.trim());
|
||
|
|
partMap.put("SUB_MATERIAL", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//사이즈
|
||
|
|
if(8 == columnIndex){
|
||
|
|
sqlMap.put("WEIGHT", cellValue.trim());
|
||
|
|
partMap.put("WEIGHT", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//PART TYPE
|
||
|
|
if(9 == columnIndex){
|
||
|
|
if("구매품".equals(cellValue.trim())){
|
||
|
|
cellValue ="0000063";
|
||
|
|
}else if("가공품".equals(cellValue.trim())){
|
||
|
|
cellValue ="0000064";
|
||
|
|
}else if("사급품".equals(cellValue.trim())){
|
||
|
|
cellValue ="0000065";
|
||
|
|
}
|
||
|
|
sqlMap.put("PART_TYPE", cellValue.trim());
|
||
|
|
partMap.put("PART_TYPE", cellValue.trim());
|
||
|
|
}
|
||
|
|
|
||
|
|
//
|
||
|
|
if(10 == columnIndex){
|
||
|
|
sqlMap.put("REMARK", cellValue.trim());
|
||
|
|
partMap.put("REMARK", cellValue.trim());
|
||
|
|
|
||
|
|
sqlMap.put("PART_REPORT_OBJID", CommonUtils.checkNull((String)paramMap.get("targetObjId")));
|
||
|
|
sqlMap.put("OBJID", CommonUtils.createObjId());
|
||
|
|
|
||
|
|
sqlSession.insert("partMng.InsertPartTemp", sqlMap);
|
||
|
|
resultList.add(partMap);
|
||
|
|
|
||
|
|
System.out.println("partMap:"+partMap);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
try{
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주관리 목록조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getPartMgntList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
String countPerPage = CommonUtils.checkNull(request.getParameter("countPerPage"), Constants.ADMIN_COUNT_PER_PAGE+"");
|
||
|
|
paramMap.put("COUNT_PER_PAGE", Integer.parseInt(countPerPage));
|
||
|
|
|
||
|
|
Map pageMap = (HashMap)sqlSession.selectOne("part.partMgmtListCnt", paramMap);
|
||
|
|
|
||
|
|
|
||
|
|
pageMap = (HashMap)CommonUtils.setPagingInfo(request, pageMap);
|
||
|
|
|
||
|
|
paramMap.put("PAGE_END", CommonUtils.checkNull(pageMap.get("PAGE_END")));
|
||
|
|
paramMap.put("PAGE_START", CommonUtils.checkNull(pageMap.get("PAGE_START")));
|
||
|
|
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("part.partMgmtList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주관리 목록조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getPartMgntTempList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
String countPerPage = CommonUtils.checkNull(request.getParameter("countPerPage"), Constants.ADMIN_COUNT_PER_PAGE+"");
|
||
|
|
paramMap.put("COUNT_PER_PAGE", Integer.parseInt(countPerPage));
|
||
|
|
|
||
|
|
Map pageMap = (HashMap)sqlSession.selectOne("part.partMgmtTempListCnt", paramMap);
|
||
|
|
|
||
|
|
|
||
|
|
pageMap = (HashMap)CommonUtils.setPagingInfo(request, pageMap);
|
||
|
|
|
||
|
|
paramMap.put("PAGE_END", CommonUtils.checkNull(pageMap.get("PAGE_END")));
|
||
|
|
paramMap.put("PAGE_START", CommonUtils.checkNull(pageMap.get("PAGE_START")));
|
||
|
|
|
||
|
|
resultList = CommonUtils.keyChangeUpperList((ArrayList)sqlSession.selectList("part.partMgmtTempList", paramMap));
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* part 배포전 리스트
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getPartMgntTempFormList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("part.partMgmtTempFormList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* PART 성세 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map getPartMgmtInfo(Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultMap = sqlSession.selectOne("part.getpartMgmtInfo", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 파트를 확정상태로 변경한다.
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map changeMultiPartStatus(HttpServletRequest request,Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
try{
|
||
|
|
|
||
|
|
String partCheckBoxList[] = request.getParameterValues("partCheckBox");
|
||
|
|
|
||
|
|
if(null != partCheckBoxList && 0 < partCheckBoxList.length){
|
||
|
|
for(int i=0;i<partCheckBoxList.length;i++){
|
||
|
|
String partObjid = CommonUtils.checkNull(partCheckBoxList[i]);
|
||
|
|
HashMap sqlParamMap = new HashMap();
|
||
|
|
|
||
|
|
sqlParamMap.put("targetObjId", partObjid);
|
||
|
|
Map revMap = sqlSession.selectOne("part.getpartRev", sqlParamMap);
|
||
|
|
revMap = CommonUtils.keyChangeUpperMap(revMap);
|
||
|
|
String REV = revMap.get("REV").toString();
|
||
|
|
|
||
|
|
|
||
|
|
//동일 Part No를 가진 Part의 is_last를 0으로 변경한다.
|
||
|
|
sqlSession.update("part.changeSamePartNoIsLast",sqlParamMap);
|
||
|
|
|
||
|
|
//확정대상 Part의 is_last를 1로 변경한다.
|
||
|
|
sqlParamMap.put("isLast", "1");
|
||
|
|
sqlParamMap.put("REV", REV);
|
||
|
|
sqlSession.update("part.changePartStatus",sqlParamMap);
|
||
|
|
}
|
||
|
|
sqlSession.commit();
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
sqlSession.rollback();
|
||
|
|
throw e;
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 파트를 확정상태로 변경한다.(단건)
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map changePartStatus(HttpServletRequest request,Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
try{
|
||
|
|
String part_mgmt_objid = (String)paramMap.get("objId");
|
||
|
|
String REV = CommonUtils.checkNull((String)paramMap.get("rev"),"RE");
|
||
|
|
|
||
|
|
HashMap sqlParamMap = new HashMap();
|
||
|
|
sqlParamMap.put("targetObjId", part_mgmt_objid);
|
||
|
|
|
||
|
|
sqlSession.update("part.changeSamePartNoIsLast",sqlParamMap);
|
||
|
|
|
||
|
|
sqlParamMap.put("REV", REV);
|
||
|
|
sqlParamMap.put("isLast", "1");
|
||
|
|
|
||
|
|
sqlSession.update("part.changeOnePartStatus",paramMap);
|
||
|
|
sqlSession.commit();
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||
|
|
}catch(Exception e){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.SAVE_FAILED);
|
||
|
|
sqlSession.rollback();
|
||
|
|
throw e;
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 파트 설계 변경
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map changePartInfo(HttpServletRequest request,Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
try{
|
||
|
|
String part_mgmt_objid = (String)paramMap.get("objId");
|
||
|
|
HashMap sqlParamMap = new HashMap();
|
||
|
|
|
||
|
|
String REV = (String)paramMap.get("rev");
|
||
|
|
/*if(REV.equals("0")){
|
||
|
|
sqlParamMap.put("rev", "A");
|
||
|
|
}else{
|
||
|
|
sqlParamMap.put("rev", CommonUtils.getNextRevision(REV));
|
||
|
|
}*/
|
||
|
|
int paramRev = Integer.parseInt(REV)+1;
|
||
|
|
sqlParamMap.put("rev", String.valueOf(paramRev));
|
||
|
|
|
||
|
|
String objId = CommonUtils.createObjId();
|
||
|
|
sqlParamMap.put("part_mgmt_objid", part_mgmt_objid);
|
||
|
|
|
||
|
|
sqlParamMap.put("objId", objId);
|
||
|
|
|
||
|
|
sqlSession.insert("part.insertNewPartRevision",sqlParamMap);
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("objId", objId);
|
||
|
|
}catch(Exception e){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("objId", null);
|
||
|
|
sqlSession.rollback();
|
||
|
|
throw e;
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* PART 삭제 상태값 업데이트
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map deletePartInfo(HttpServletRequest request,Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
try{
|
||
|
|
/*String part_mgmt_objid = (String)paramMap.get("objId");*/
|
||
|
|
|
||
|
|
sqlSession.update("part.updatedeletePartInfo",paramMap);
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
resultMap.put("result", true);
|
||
|
|
}catch(Exception e){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
sqlSession.rollback();
|
||
|
|
throw e;
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 파트 물리적 삭제
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map deletePart(HttpServletRequest request,Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
try{
|
||
|
|
|
||
|
|
String partCheckBoxList[] = request.getParameterValues("partCheckBox");
|
||
|
|
|
||
|
|
if(null != partCheckBoxList && 0 < partCheckBoxList.length){
|
||
|
|
for(int i=0;i<partCheckBoxList.length;i++){
|
||
|
|
String partObjid = CommonUtils.checkNull(partCheckBoxList[i]);
|
||
|
|
HashMap sqlParamMap = new HashMap();
|
||
|
|
sqlParamMap.put("partObjid", partObjid);
|
||
|
|
|
||
|
|
sqlSession.delete("part.deleteRealPart",sqlParamMap);
|
||
|
|
}
|
||
|
|
sqlSession.commit();
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.DELETE_SUCCESS);
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.DELETE_FAILED);
|
||
|
|
sqlSession.rollback();
|
||
|
|
throw e;
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 정전개 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getStructureAscendingList(Map paramMap){
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
List resultListSet1 = new ArrayList();
|
||
|
|
List resultListSet2 = new ArrayList();
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
try{
|
||
|
|
if(paramMap != null && !paramMap.isEmpty()){
|
||
|
|
String search_partName = CommonUtils.checkNull(paramMap.get("search_partName"));
|
||
|
|
String search_partNo = CommonUtils.checkNull(paramMap.get("search_partNo"));
|
||
|
|
String search_oemObjId = CommonUtils.checkNull(paramMap.get("search_oemObjId"));
|
||
|
|
String search_carObjId = CommonUtils.checkNull(paramMap.get("search_carObjId"));
|
||
|
|
/*String search_productGroupObjId = CommonUtils.checkNull(paramMap.get("search_productGroupObjId"));*/
|
||
|
|
String search_productObjId = CommonUtils.checkNull(paramMap.get("search_productObjId"));
|
||
|
|
|
||
|
|
if((search_partName != null && !search_partName.isEmpty()) || (search_partNo != null && !search_partNo.isEmpty())){
|
||
|
|
resultList = sqlSession.selectList("part.aaaaa", paramMap);
|
||
|
|
|
||
|
|
for(int i = 0; i<resultList.size(); i++) {
|
||
|
|
Map temp1 = new HashMap();
|
||
|
|
Map temp2 = new HashMap();
|
||
|
|
|
||
|
|
temp1 = (Map)resultList.get(i);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
temp2.put("projectno", temp1.get("PROJECT_MGMT_OBJID"));
|
||
|
|
temp2.put("search_partNo", (String)temp1.get("PART_NO"));
|
||
|
|
temp2.put("search_partName", (String)temp1.get("PART_NAME"));
|
||
|
|
temp2.put("objid", temp1.get("PART_MGMT_OBJID"));
|
||
|
|
temp2.put("parent_objid", temp1.get("PART_MGMT_PARENT_OBJID"));
|
||
|
|
temp2.put("search_partLevel", temp1.get("LEVEL"));
|
||
|
|
|
||
|
|
System.out.println("PART_NAME : " + temp1.get("PART_NO"));
|
||
|
|
System.out.println("PART_NAME : " + temp1.get("PART_NAME"));
|
||
|
|
System.out.println("OBJID : " + temp1.get("OBJID"));
|
||
|
|
System.out.println("PARENT_OBJID : " + temp1.get("PART_MGMT_PARENT_OBJID"));
|
||
|
|
System.out.println("LEVEL : " + temp1.get("LEVEL"));
|
||
|
|
|
||
|
|
resultListSet1 = sqlSession.selectList("part.bbbbb", temp2);
|
||
|
|
resultListSet2.addAll(resultListSet1);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
else{
|
||
|
|
resultListSet2 = sqlSession.selectList("part.selectStructureAscendingList", paramMap);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultListSet2;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 역전개 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getStructureDescendingList(Map paramMap){
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
try{
|
||
|
|
if(paramMap != null && !paramMap.isEmpty()){
|
||
|
|
String partNo = CommonUtils.checkNull(paramMap.get("search_partNo"));
|
||
|
|
String partName = CommonUtils.checkNull(paramMap.get("search_partName"));
|
||
|
|
if(!"".equals(partNo) || !"".equals(partName)){
|
||
|
|
paramMap.put("isStartDevPart", "1");
|
||
|
|
resultList = sqlSession.selectList("part.selectStructureDescendingList", paramMap);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/** 영업활동삭제
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map delOrderMgmt(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
Map sqlMap = new HashMap();
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
String Key = (String) paramMap.get("delKey");
|
||
|
|
String [] delKey = Key.split(",");
|
||
|
|
|
||
|
|
sqlMap.put("delObjKeyarr", delKey);
|
||
|
|
int cnt = sqlSession.delete("projectConcept.deleteOrdermgmt", sqlMap);
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.DELETE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.DELETE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 상세 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map getProjectConceptInfo(Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultMap = sqlSession.selectOne("orderMgmt.getOrderMgmtInfo", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
*영업정보 엑셀저장
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @throws Exception
|
||
|
|
*/
|
||
|
|
public void UploadOrderMgmt(HttpServletRequest request,Map paramMap) throws Exception{
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
try{
|
||
|
|
|
||
|
|
ArrayList fileList = commonService.getFileList(paramMap);
|
||
|
|
if(null != fileList && 1 == fileList.size()){
|
||
|
|
HashMap fileMap = (HashMap)fileList.get(0);
|
||
|
|
|
||
|
|
String path = CommonUtils.checkNull(fileMap.get("FILE_PATH"));
|
||
|
|
String fileName = CommonUtils.checkNull(fileMap.get("SAVED_FILE_NAME"));
|
||
|
|
|
||
|
|
FileInputStream fis = new FileInputStream(path+"\\"+fileName);
|
||
|
|
XSSFWorkbook workBook = new XSSFWorkbook(fis);
|
||
|
|
XSSFSheet sheet = workBook.getSheetAt(0);
|
||
|
|
HashMap partMap = new HashMap();
|
||
|
|
int rows = sheet.getPhysicalNumberOfRows();
|
||
|
|
|
||
|
|
|
||
|
|
System.out.println("*****************************" +rows);
|
||
|
|
System.out.println("*****************************" +rows);
|
||
|
|
System.out.println("*****************************" +rows);
|
||
|
|
System.out.println("*****************************" +rows);
|
||
|
|
for(int rowIndex= 1 ; rowIndex < rows ; rowIndex++){
|
||
|
|
String column ="false";
|
||
|
|
XSSFRow row = sheet.getRow(rowIndex);
|
||
|
|
if(null != row && rowIndex <= 15){
|
||
|
|
|
||
|
|
for(int columnIndex = 0 ; columnIndex < 47 ; columnIndex++){
|
||
|
|
XSSFCell cell = row.getCell(columnIndex);
|
||
|
|
//데이버 유형별 get date
|
||
|
|
String cellValue = "";
|
||
|
|
|
||
|
|
if(null == cell){
|
||
|
|
cellValue = "";
|
||
|
|
}else{
|
||
|
|
switch(cell.getCellType()){
|
||
|
|
case XSSFCell.CELL_TYPE_FORMULA:
|
||
|
|
cellValue = cell.getCellFormula();
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_FORMULA:"+cellValue);
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_NUMERIC:
|
||
|
|
cellValue = cell.getNumericCellValue()+"";
|
||
|
|
//cellValue = String.format("%.2f", Double.parseDouble(cellValue));
|
||
|
|
cellValue = String.format("%.0f", Double.parseDouble(cellValue));
|
||
|
|
System.out.println("cellValue1:"+cellValue);
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_NUMERIC:"+cellValue);
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_STRING:
|
||
|
|
cellValue = cell.getStringCellValue()+"";
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_STRING:"+cellValue);
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_BLANK:
|
||
|
|
cellValue = cell.getBooleanCellValue()+"";
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_BLANK:"+cellValue);
|
||
|
|
break;
|
||
|
|
case XSSFCell.CELL_TYPE_ERROR:
|
||
|
|
cellValue = cell.getErrorCellValue()+"";
|
||
|
|
System.out.println(columnIndex+":"+"XSSFCell.CELL_TYPE_ERROR:"+cellValue);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if("false".equals(cellValue)){
|
||
|
|
cellValue = "";
|
||
|
|
}
|
||
|
|
|
||
|
|
//obj생성
|
||
|
|
String ObjId = CommonUtils.createObjId();
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//수주번호
|
||
|
|
if(0 == columnIndex){
|
||
|
|
if("".equals(cellValue)){
|
||
|
|
column ="false";
|
||
|
|
}else{
|
||
|
|
column ="true";
|
||
|
|
partMap.put("obtain_no", cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//OBJID
|
||
|
|
partMap.put("ObjId", ObjId);
|
||
|
|
|
||
|
|
|
||
|
|
//프로젝트 넘버
|
||
|
|
if(1 == columnIndex){
|
||
|
|
partMap.put("project_no", cellValue);
|
||
|
|
}
|
||
|
|
//구분코드
|
||
|
|
if(2 == columnIndex){
|
||
|
|
partMap.put("region_high_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//국가코드
|
||
|
|
if(4 == columnIndex){
|
||
|
|
partMap.put("region_mid_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//지역코드
|
||
|
|
if(6 == columnIndex){
|
||
|
|
partMap.put("region_low_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//거래처코드
|
||
|
|
if(8 == columnIndex){
|
||
|
|
partMap.put("customer_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//사업자 등록번호
|
||
|
|
if(10 == columnIndex){
|
||
|
|
partMap.put("bus_lic_num",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//담당자
|
||
|
|
if(11 == columnIndex){
|
||
|
|
partMap.put("customer_person",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//연락처
|
||
|
|
if(12 == columnIndex){
|
||
|
|
partMap.put("customer_phone",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//e-mail
|
||
|
|
if(13 == columnIndex){
|
||
|
|
partMap.put("customer_email",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//부서(학과)
|
||
|
|
if(14 == columnIndex){
|
||
|
|
partMap.put("customer_div",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//주소
|
||
|
|
if(15 == columnIndex){
|
||
|
|
partMap.put("customer_addr",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//계약유형
|
||
|
|
if(16 == columnIndex){
|
||
|
|
partMap.put("c_type_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//계약기관
|
||
|
|
if(18 == columnIndex){
|
||
|
|
partMap.put("c_agency_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//계약구분
|
||
|
|
if(20 == columnIndex){
|
||
|
|
partMap.put("c_class_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//계약구분
|
||
|
|
if(22 == columnIndex){
|
||
|
|
partMap.put("spec_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//수주명
|
||
|
|
if(24 == columnIndex){
|
||
|
|
partMap.put("order_title",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//담당자ID
|
||
|
|
if(25 == columnIndex){
|
||
|
|
partMap.put("writer",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//접수일
|
||
|
|
if(26 == columnIndex){
|
||
|
|
partMap.put("regdate",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//진행상황
|
||
|
|
if(27 == columnIndex){
|
||
|
|
partMap.put("status_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//계약결과
|
||
|
|
if(29 == columnIndex){
|
||
|
|
partMap.put("result_cd",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//이탈원인
|
||
|
|
if(31 == columnIndex){
|
||
|
|
partMap.put("reason",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//비고
|
||
|
|
if(32 == columnIndex){
|
||
|
|
partMap.put("content",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//매출일자(매출예정)
|
||
|
|
if(33 == columnIndex){
|
||
|
|
partMap.put("sales_p_date",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/* //소계(매출예정)
|
||
|
|
if(34 == columnIndex){
|
||
|
|
partMap.put("sub_p_sum",cellValue);
|
||
|
|
} */
|
||
|
|
|
||
|
|
|
||
|
|
//제품(매출예정)
|
||
|
|
if(34 == columnIndex){
|
||
|
|
partMap.put("dev_p_product",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//상품(매출예정)
|
||
|
|
if(35 == columnIndex){
|
||
|
|
partMap.put("sale_p_product",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//출고예정일
|
||
|
|
if(36 == columnIndex){
|
||
|
|
partMap.put("sch_date",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/* //소계(제조원가)
|
||
|
|
if(38 == columnIndex){
|
||
|
|
partMap.put("sub_ps_sum",cellValue);
|
||
|
|
}*/
|
||
|
|
|
||
|
|
|
||
|
|
//제품(제조원가)
|
||
|
|
if(37 == columnIndex){
|
||
|
|
partMap.put("dev_ps_product",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//상품(제조원가)
|
||
|
|
if(38 == columnIndex){
|
||
|
|
partMap.put("sale_ps_product",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//매출일(매출실적)
|
||
|
|
if(39 == columnIndex){
|
||
|
|
partMap.put("sales_r_date",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
/*//소계(매출실적)
|
||
|
|
if(42 == columnIndex){
|
||
|
|
partMap.put("sub_r_sum",cellValue);
|
||
|
|
}*/
|
||
|
|
|
||
|
|
//제품(매출실적)
|
||
|
|
if(40 == columnIndex){
|
||
|
|
partMap.put("dev_r_product",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//상품(매출실적)
|
||
|
|
if(41 == columnIndex){
|
||
|
|
partMap.put("sale_r_product",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//수금일
|
||
|
|
if(42 == columnIndex){
|
||
|
|
partMap.put("recv_date",cellValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
//달성율
|
||
|
|
if(43 == columnIndex){
|
||
|
|
partMap.put("achievement_rate",cellValue);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
System.out.println("***********************"+column);
|
||
|
|
System.out.println("***********************"+column);
|
||
|
|
System.out.println("***********************"+column);
|
||
|
|
if("true".equals(column)){
|
||
|
|
sqlSession.insert("projectConcept.orderExcelupload", partMap);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
|
||
|
|
throw e;
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 main 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
|
||
|
|
public List obtainmainStatusList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.obtainmainStatusList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 계약현황 main 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
|
||
|
|
public List orderCntList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.orderCntList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 프로젝트 목록을 가져온다.
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getGoalList(HttpServletRequest request, Map paramMap){
|
||
|
|
SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
try{
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getmainchartList",paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
throw e;
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 목표등록 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getgoalMgmtList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
|
||
|
|
HttpSession session = request.getSession();
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||
|
|
Map info = person.getLoginInfo();
|
||
|
|
|
||
|
|
//접속자
|
||
|
|
String userId = CommonUtils.checkNull(info.get("userId"));
|
||
|
|
|
||
|
|
paramMap.put("writer", userId);
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getgoalMgmtList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 목표등록 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getgoalMgmtTeamList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
|
||
|
|
HttpSession session = request.getSession();
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||
|
|
Map info = person.getLoginInfo();
|
||
|
|
|
||
|
|
//접속자
|
||
|
|
String userId = CommonUtils.checkNull(info.get("userId"));
|
||
|
|
|
||
|
|
paramMap.put("writer", userId);
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getgoalMgmtTeamList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/** 목표등록 삭제
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map delgoalEnroll(HttpServletRequest request, Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
Map sqlMap = new HashMap();
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
String Key = (String) paramMap.get("delKey");
|
||
|
|
String [] delKey = Key.split(",");
|
||
|
|
|
||
|
|
sqlMap.put("delObjKeyarr", delKey);
|
||
|
|
int cnt = sqlSession.delete("projectConcept.delgoalEnroll", sqlMap);
|
||
|
|
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", true);
|
||
|
|
resultMap.put("msg", Message.DELETE_SUCCESS);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
resultMap.put("result", false);
|
||
|
|
resultMap.put("msg", Message.DELETE_FAILED);
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 목표등록 합계
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getgoalMgmtAverage(HttpServletRequest request,Map paramMap){
|
||
|
|
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
|
||
|
|
HttpSession session = request.getSession();
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||
|
|
Map info = person.getLoginInfo();
|
||
|
|
|
||
|
|
//접속자
|
||
|
|
String userId = CommonUtils.checkNull(info.get("userId"));
|
||
|
|
|
||
|
|
paramMap.put("writer", userId);
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getgoalMgmtAverage", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 목표등록 합계
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getgoalMgmtTeamAverage(HttpServletRequest request,Map paramMap){
|
||
|
|
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
|
||
|
|
HttpSession session = request.getSession();
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||
|
|
Map info = person.getLoginInfo();
|
||
|
|
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getgoalMgmtTeamAverage", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 영업현황 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
/**
|
||
|
|
* 수주관리 목록조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getOrderMgntSubList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getorderMgmtSubList", paramMap);
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동의 Milestone 목록 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getProjectConceptMilestoneList(Map paramMap){
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
if("edit".equals(CommonUtils.checkNull(paramMap.get("mode")))){
|
||
|
|
resultList = sqlSession.selectList("projectConcept.getProjectConceptMilestoneList", paramMap);
|
||
|
|
}else{
|
||
|
|
resultList = sqlSession.selectList("projectConcept.getProjectConceptMilestoneList2", paramMap);
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 제품별 정보 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map getProjectConceptProductInfo(Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultMap = sqlSession.selectOne("projectConcept.getProjectConceptProductInfo", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 제품별 수주결과 수정
|
||
|
|
* @param paramMap
|
||
|
|
*/
|
||
|
|
public void updateProjectConceptProdBiddingResult(Map paramMap){
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
sqlSession.update("projectConcept.updateProjectConceptProdBiddingResult", paramMap);
|
||
|
|
|
||
|
|
//입찰결과 등록시 해당 값 완료로 변경
|
||
|
|
String biddingResult = CommonUtils.checkNull(paramMap.get("biddingResult"));
|
||
|
|
if(!"".equals(biddingResult)) paramMap.put("changeStatus", "complete");
|
||
|
|
else paramMap.put("changeStatus", "create");
|
||
|
|
|
||
|
|
sqlSession.update("projectConcept.updateProjectConceptStatusComplete", paramMap);
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 메일 발송.
|
||
|
|
* 지정된 인원에게 메일을 발송한다.
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
*/
|
||
|
|
public void sendMailProjectConceptInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
String[] receivers = request.getParameterValues("chk");
|
||
|
|
System.out.println("paramMap : "+paramMap);
|
||
|
|
System.out.println("receivers.length : "+receivers.length);
|
||
|
|
|
||
|
|
PersonBean person = (PersonBean)request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||
|
|
Map userInfo = person.getLoginInfo();
|
||
|
|
|
||
|
|
//1. project concept의 입찰제품 정보 조회
|
||
|
|
Map info = sqlSession.selectOne("projectConcept.getProjectConceptInfo", paramMap);
|
||
|
|
|
||
|
|
//2. 해당 내용을 담은 htmlBody 생성
|
||
|
|
// String bodyContents = MailUtil.getHTMLContents("", info);
|
||
|
|
|
||
|
|
|
||
|
|
//mail body contents 구성
|
||
|
|
Map mailParamMap = new HashMap();
|
||
|
|
|
||
|
|
//제품정보조회
|
||
|
|
Map productInfo = sqlSession.selectOne("mail.getProjectConceptProductInfo", paramMap);
|
||
|
|
mailParamMap.putAll(productInfo);
|
||
|
|
|
||
|
|
//제품별 협조부서 목록조회
|
||
|
|
List<Map> productRelDeptList = sqlSession.selectList("mail.getProjectConceptProductRelDeptList", paramMap);
|
||
|
|
|
||
|
|
String subject = "["+CommonUtils.checkNull(productInfo.get("CAR_CODE"))+" ("+CommonUtils.checkNull(productInfo.get("CAR_NAME"))+")] "+Message.MAIL_SUBJECT_PROJECT_CONCEPT_REQ_FILE;
|
||
|
|
mailParamMap.put("SUBJECT", subject);
|
||
|
|
|
||
|
|
String deptList = "";
|
||
|
|
deptList += "<table border='1' class='table' style='width:450px;'>";
|
||
|
|
deptList += "<colgroup>";
|
||
|
|
deptList += "<col width='30%'>";
|
||
|
|
deptList += "<col width='*%'>";
|
||
|
|
deptList += "</colgroup>";
|
||
|
|
for(Map map : productRelDeptList){
|
||
|
|
String deptCode = CommonUtils.checkNull(map.get("DEPT_CODE"));
|
||
|
|
String deptName = CommonUtils.checkNull(map.get("DEPT_NAME"));
|
||
|
|
String replyReqDate = CommonUtils.checkNull(map.get("REPLY_REQ_DATE"));
|
||
|
|
|
||
|
|
deptList += "<tr>";
|
||
|
|
deptList += "<td>"+deptName+"</td>";
|
||
|
|
deptList += "<td>"+replyReqDate+"</td>";
|
||
|
|
deptList += "</tr>";
|
||
|
|
}
|
||
|
|
deptList += "</table>";
|
||
|
|
|
||
|
|
mailParamMap.put("DEPT_LIST", deptList);
|
||
|
|
|
||
|
|
String bodyContents = MailUtil.getHTMLContents("projectConceptMailTemplate", mailParamMap);
|
||
|
|
|
||
|
|
//3. 메일 발송 대상 조회
|
||
|
|
for(String receiver : receivers){
|
||
|
|
if(receiver.contains(":")){
|
||
|
|
String[] receiverSplit = receiver.split(":");
|
||
|
|
|
||
|
|
String receiverId = CommonUtils.checkNull(receiverSplit[0]);
|
||
|
|
String receiverEmail = CommonUtils.checkNull(receiverSplit[1]);
|
||
|
|
|
||
|
|
//4. 메일 발송
|
||
|
|
MailUtil.sendMail(CommonUtils.checkNull(productInfo.get("WRITER")), CommonUtils.checkNull(productInfo.get("WRITER_EMAIL")), receiverId, receiverEmail, null, subject, bodyContents, Constants.MAIL_TYPE_PROJECT_CONCEPT);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 QNA 메일 발송.
|
||
|
|
* 지정된 인원에게 메일을 발송한다.
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
*/
|
||
|
|
public void sendMailProjectConceptQNAInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
String[] receivers = request.getParameterValues("chk");
|
||
|
|
System.out.println("paramMap : "+paramMap);
|
||
|
|
System.out.println("receivers.length : "+receivers.length);
|
||
|
|
|
||
|
|
PersonBean person = (PersonBean)request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||
|
|
Map userInfo = person.getLoginInfo();
|
||
|
|
|
||
|
|
//1. project concept QNA 정보조회
|
||
|
|
Map info = sqlSession.selectOne("mail.getProjectConceptQNAInfo", paramMap);
|
||
|
|
|
||
|
|
//2. 해당 내용을 담은 htmlBody 생성
|
||
|
|
// String bodyContents = MailUtil.getHTMLContents("", info);
|
||
|
|
|
||
|
|
//mail body contents 구성
|
||
|
|
Map mailParamMap = new HashMap();
|
||
|
|
|
||
|
|
String subject = "["+CommonUtils.checkNull(info.get("CAR_CODE"))+" ("+CommonUtils.checkNull(info.get("CAR_NAME"))+")] "+Message.MAIL_SUBJECT_PROJECT_CONCEPT_QNA;
|
||
|
|
mailParamMap.put("SUBJECT", subject);
|
||
|
|
mailParamMap.putAll(info);
|
||
|
|
|
||
|
|
String bodyContents = MailUtil.getHTMLContents("projectConceptQNAMailTemplate", mailParamMap);
|
||
|
|
|
||
|
|
//3. 메일 발송 대상 조회
|
||
|
|
for(String receiver : receivers){
|
||
|
|
if(receiver.contains(":")){
|
||
|
|
String[] receiverSplit = receiver.split(":");
|
||
|
|
|
||
|
|
String receiverId = CommonUtils.checkNull(receiverSplit[0]);
|
||
|
|
String receiverEmail = CommonUtils.checkNull(receiverSplit[1]);
|
||
|
|
|
||
|
|
//4. 메일 발송
|
||
|
|
MailUtil.sendMail(CommonUtils.checkNull(info.get("WRITER")), CommonUtils.checkNull(info.get("WRITER_EMAIL")), receiverId, receiverEmail, null, subject, bodyContents, Constants.MAIL_TYPE_PROJECT_CONCEPT);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 제품별 확정.
|
||
|
|
* 모든 제품이 확정되었을경우 수주활동을 종료시킨다.
|
||
|
|
* @param request
|
||
|
|
* @param paramMap
|
||
|
|
*/
|
||
|
|
public void completeProjectConceptProductInfo(HttpServletRequest request, Map paramMap){
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
System.out.println("paramMap : "+paramMap);
|
||
|
|
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||
|
|
|
||
|
|
//입찰품목 상태 complete으로 변경
|
||
|
|
sqlSession.update("projectConcept.completeProjectConceptProductInfo", paramMap);
|
||
|
|
|
||
|
|
//입찰품목의 상태가 create인 CNT 조회
|
||
|
|
Map cntMap = sqlSession.selectOne("projectConcept.getProjectConceptProductCreateCnt", paramMap);
|
||
|
|
System.out.println("cntMap : "+cntMap);
|
||
|
|
|
||
|
|
int cnt = Integer.parseInt(CommonUtils.checkNull(cntMap.get("CNT"), "0"));
|
||
|
|
System.out.println("cnt : "+cnt);
|
||
|
|
if(cnt == 0){
|
||
|
|
//수주활동 상태 complete으로 변경.
|
||
|
|
sqlSession.update("projectConcept.completeProjectConceptInfo", paramMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
sqlSession.commit();
|
||
|
|
}catch(Exception e){
|
||
|
|
sqlSession.rollback();
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 수주활동 중복 등록체크 (false : 중복있음, true : 중복없음)
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map getProjectConceptDuplicateCnt(Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
Map map = sqlSession.selectOne("projectConcept.getProjectConceptDuplicateCnt", paramMap);
|
||
|
|
if(map != null){
|
||
|
|
int cnt = Integer.parseInt(CommonUtils.checkNull(map.get("CNT"), "0"));
|
||
|
|
if(cnt > 0){
|
||
|
|
resultMap.put("result", false);
|
||
|
|
}else{
|
||
|
|
resultMap.put("result", true);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/*jmpark end*/
|
||
|
|
/*************************************************************************************************************************/
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*************************************************************************************************************************/
|
||
|
|
/*edhwang start*/
|
||
|
|
|
||
|
|
/*edhwang end*/
|
||
|
|
/*************************************************************************************************************************/
|
||
|
|
|
||
|
|
|
||
|
|
/*************************************************************************************************************************/
|
||
|
|
/*dhchoi start*/
|
||
|
|
/**
|
||
|
|
* 수주활동 저장
|
||
|
|
* @param paramMap
|
||
|
|
*/
|
||
|
|
public void saveQnAProjectConcept(Map paramMap){
|
||
|
|
SqlSession sqlSession =null;
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
System.out.println(paramMap);
|
||
|
|
sqlSession.update("projectConcept.saveQnaProjectConceptInfo", paramMap);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* QnaListPage 목록
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List qnaListPage(HttpServletRequest request,Map paramMap){
|
||
|
|
List resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
String countPerPage = CommonUtils.checkNull(request.getParameter("countPerPage"), Constants.ADMIN_COUNT_PER_PAGE+"");
|
||
|
|
|
||
|
|
paramMap.put("COUNT_PER_PAGE", Integer.parseInt(countPerPage));
|
||
|
|
|
||
|
|
Map pageMap = (HashMap)sqlSession.selectOne("projectConcept.getQnaListCnt", paramMap);
|
||
|
|
pageMap = (HashMap)CommonUtils.setPagingInfo(request, pageMap);
|
||
|
|
|
||
|
|
paramMap.put("PAGE_END", CommonUtils.checkNull(pageMap.get("PAGE_END")));
|
||
|
|
paramMap.put("PAGE_START", CommonUtils.checkNull(pageMap.get("PAGE_START")));
|
||
|
|
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("projectConcept.getQnaListPage", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultList;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Qna 수정페이지
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map getQnADetailInfo(Map paramMap){
|
||
|
|
HashMap resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
System.out.println("getQnADetailInfo"+paramMap);
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultMap = (HashMap)sqlSession.selectOne("projectConcept.getQnaInfo", paramMap);
|
||
|
|
if(null != resultMap){
|
||
|
|
resultMap.put("CONTENTS", CommonUtils.getClobToString((Clob)resultMap.get("CONTENTS")));
|
||
|
|
}
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/*dhchoi end*/
|
||
|
|
/*************************************************************************************************************************/
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* PART 조회및 배포
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public List getPartDetailList(HttpServletRequest request,Map paramMap){
|
||
|
|
List<Map<String,Object>> resultList = new ArrayList();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
|
||
|
|
resultList = (ArrayList)sqlSession.selectList("part.getPartDetailList", paramMap);
|
||
|
|
System.out.println("resultList :: " + resultList);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
return CommonUtils.toUpperCaseMapKey(resultList);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* PART 성세 조회
|
||
|
|
* @param paramMap
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map countExcelpart(Map paramMap){
|
||
|
|
Map resultMap = new HashMap();
|
||
|
|
SqlSession sqlSession = null;
|
||
|
|
|
||
|
|
try{
|
||
|
|
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||
|
|
resultMap = sqlSession.selectOne("partMng.countExcelpart", paramMap);
|
||
|
|
}catch(Exception e){
|
||
|
|
e.printStackTrace();
|
||
|
|
}finally{
|
||
|
|
sqlSession.close();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
return resultMap;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|