1512 lines
50 KiB
Java
1512 lines
50 KiB
Java
package com.pms.controller;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import com.pms.common.JsonUtil;
|
|
import com.pms.common.bean.PersonBean;
|
|
import com.pms.common.utils.Constants;
|
|
import com.pms.service.CommonService;
|
|
import com.pms.service.MaterialMgmtService;
|
|
import com.pms.common.utils.CommonUtils;
|
|
|
|
@Controller
|
|
public class MaterialMgmtController {
|
|
|
|
@Autowired
|
|
MaterialMgmtService materialMgmtService = null;
|
|
|
|
@Autowired
|
|
CommonService commonService;
|
|
|
|
|
|
@Autowired
|
|
public void setMaterialMgmtService(MaterialMgmtService service){
|
|
this.materialMgmtService = service;
|
|
}
|
|
|
|
/**
|
|
* 발주 현황
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/matermgmtInfoList.do")
|
|
public String matermgmtInfoList(HttpServletRequest request, @RequestParam Map paramMap){
|
|
List<Map<String,Object>> list = new ArrayList();
|
|
List<Map<String,Object>> supCDList = new ArrayList();
|
|
|
|
try{
|
|
list = materialMgmtService.matermgmttotalList(request,paramMap);
|
|
|
|
supCDList = (List)commonService.getSupCdList2(paramMap);
|
|
supCDList = CommonUtils.toUpperCaseMapKey(supCDList);
|
|
|
|
System.out.println("/materMgmt/matermgmtInfoList.do(paramMap):"+paramMap);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
request.setAttribute("LIST", list);
|
|
request.setAttribute("supCDList", supCDList);
|
|
return "/materMgmt/matermgmtInfoList";
|
|
}
|
|
|
|
/**
|
|
* 발주 현황
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/dashboardMatermgmtInfoList.do")
|
|
public String dashboardMatermgmtInfoList(HttpServletRequest request, @RequestParam Map paramMap){
|
|
List<Map<String,Object>> list = new ArrayList();
|
|
List<Map<String,Object>> supCDList = new ArrayList();
|
|
|
|
try{
|
|
list = materialMgmtService.dashboardMatermgmttotalList(request,paramMap);
|
|
|
|
supCDList = (List)commonService.getSupCdList2(paramMap);
|
|
supCDList = CommonUtils.toUpperCaseMapKey(supCDList);
|
|
|
|
System.out.println("/materMgmt/matermgmtInfoList.do(paramMap):"+paramMap);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
request.setAttribute("LIST", list);
|
|
request.setAttribute("supCDList", supCDList);
|
|
return "/dashboard/dashboardMatermgmtInfoList";
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주항목의 파일을 압축하여 다운 받는다
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/packgeingPartFile.do")
|
|
public String packgeingPartFile(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
HashMap fileMap = new HashMap();
|
|
try{
|
|
fileMap = materialMgmtService.packgeingPartFile(request, paramMap);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
request.setAttribute("FILE_MAP", fileMap);
|
|
return "/common/download";
|
|
}
|
|
|
|
|
|
/**
|
|
* PART 삭제
|
|
*/
|
|
@RequestMapping("/materMgmt/materDelete.do")
|
|
@ResponseBody
|
|
public String materDelete(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map result_map = new HashMap();
|
|
String result = "";
|
|
try{
|
|
result_map.put("RESULT", materialMgmtService.materDelete(request, paramMap));
|
|
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* 발주 관리
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/matermgmtList.do")
|
|
public String matermgmtList(HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
|
|
paramMap.put("search_isLast", CommonUtils.nvl((String)paramMap.get("search_isLast"),"1"));
|
|
List list = materialMgmtService.matermgmtList(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
//code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
//부품구분
|
|
//code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//구매구분
|
|
//code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", (String)paramMap.get("pur_cd"),"common.getCodeselect"));
|
|
|
|
//발주번호
|
|
code_map.put("order_no",commonService.bizMakeOptionList("", (String)paramMap.get("order_no"),"common.getOrderNoList"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getmatersupplyselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("reg_user_id", commonService.bizMakeOptionList("", (String)paramMap.get("reg_user_id"),"common.getUserselect"));
|
|
|
|
//발주상태
|
|
code_map.put("status_cd",commonService.bizMakeOptionList("PURSTCD90000", (String)paramMap.get("status_cd"),"common.getCodeselect"));
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
request.setAttribute("cu01_file", Constants.CUSTOMER_CODE01);
|
|
request.setAttribute("cu02_file", Constants.CUSTOMER_CODE02);
|
|
request.setAttribute("LIST", list);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
String page ="/materMgmt/matermgmtList";
|
|
/* if("excel".equals(actionType)){
|
|
page ="/materMgmt/partmgmtListExcel";
|
|
}
|
|
*/ return page;
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주 관리
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/matermgmtList2.do")
|
|
public String matermgmtList2(HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
|
|
paramMap.put("search_isLast", CommonUtils.nvl((String)paramMap.get("search_isLast"),"1"));
|
|
paramMap.put("status_cd", "PURSTCD00700");
|
|
|
|
List list = materialMgmtService.matermgmtList(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
//code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
//부품구분
|
|
//code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//구매구분
|
|
//code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", (String)paramMap.get("pur_cd"),"common.getCodeselect"));
|
|
|
|
//발주번호
|
|
code_map.put("order_no",commonService.bizMakeOptionList("", (String)paramMap.get("order_no"),"common.getOrderNoList"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getsupplyselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("reg_user_id", commonService.bizMakeOptionList("", (String)paramMap.get("reg_user_id"),"common.getUserselect"));
|
|
|
|
//발주상태
|
|
code_map.put("status_cd",commonService.bizMakeOptionList("PURSTCD90000", (String)paramMap.get("status_cd"),"common.getCodeselect"));
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
request.setAttribute("cu01_file", Constants.CUSTOMER_CODE01);
|
|
request.setAttribute("cu02_file", Constants.CUSTOMER_CODE02);
|
|
request.setAttribute("LIST", list);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
String page ="/materMgmt/matermgmtList2";
|
|
/* if("excel".equals(actionType)){
|
|
page ="/materMgmt/partmgmtListExcel";
|
|
}
|
|
*/ return page;
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 발주 관리
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/matermgmtListPopUp.do")
|
|
public String matermgmtListPopUp(HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
|
|
paramMap.put("search_isLast", CommonUtils.nvl((String)paramMap.get("search_isLast"),"1"));
|
|
List list = materialMgmtService.matermgmtList(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
//code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
//부품구분
|
|
//code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//구매구분
|
|
//code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", (String)paramMap.get("pur_cd"),"common.getCodeselect"));
|
|
|
|
//발주번호
|
|
code_map.put("order_no",commonService.bizMakeOptionList("", (String)paramMap.get("order_no"),"common.getOrderNoList"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getsupplyselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("reg_user_id", commonService.bizMakeOptionList("", (String)paramMap.get("reg_user_id"),"common.getUserselect"));
|
|
|
|
//발주상태
|
|
code_map.put("status_cd",commonService.bizMakeOptionList("PURSTCD90000", (String)paramMap.get("status_cd"),"common.getCodeselect"));
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
request.setAttribute("cu01_file", Constants.CUSTOMER_CODE01);
|
|
request.setAttribute("cu02_file", Constants.CUSTOMER_CODE02);
|
|
request.setAttribute("LIST", list);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
String page ="/materMgmt/matermgmtListPopUp";
|
|
/* if("excel".equals(actionType)){
|
|
page ="/materMgmt/partmgmtListExcel";
|
|
}
|
|
*/ return page;
|
|
}
|
|
|
|
|
|
/**
|
|
* 입고 현황
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materDetailList.do")
|
|
public String materDetailList(HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
|
|
paramMap.put("search_isLast", CommonUtils.nvl((String)paramMap.get("search_isLast"),"1"));
|
|
List list = materialMgmtService.materDetailList(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
//부품구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getsupplyselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("recv_userid", commonService.bizMakeOptionList("", (String)paramMap.get("recv_userid"),"common.getUserselect"));
|
|
|
|
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
|
|
request.setAttribute("LIST", list);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
String page ="/materMgmt/materDetailList";
|
|
/* if("excel".equals(actionType)){
|
|
page ="/materMgmt/partmgmtListExcel";
|
|
}
|
|
*/ return page;
|
|
}
|
|
|
|
|
|
/**
|
|
* 입고 상세 현황 (팝업)
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materDetailInfoList.do")
|
|
public String materDetailInfoList(HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
|
|
paramMap.put("search_isLast", CommonUtils.nvl((String)paramMap.get("search_isLast"),"1"));
|
|
List list = materialMgmtService.materPartDetailList(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
//부품구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getsupplyselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("recv_userid", commonService.bizMakeOptionList("", (String)paramMap.get("recv_userid"),"common.getUserselect"));
|
|
|
|
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
|
|
request.setAttribute("LIST", list);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
String page ="/materMgmt/materDetailInfoList";
|
|
/* if("excel".equals(actionType)){
|
|
page ="/materMgmt/partmgmtListExcel";
|
|
}
|
|
*/ return page;
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주 /입고/ 건수 팝업 리스트
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materDetailList2.do")
|
|
public String materDetailList2(HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
|
|
Map qtysum = materialMgmtService.recsum(paramMap);
|
|
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
String page ="/materMgmt/materDetailList2";
|
|
if("excel".equals(actionType)){
|
|
page ="/materMgmt/materDetailListExcel";
|
|
}
|
|
|
|
|
|
paramMap.put("search_isLast", CommonUtils.nvl((String)paramMap.get("search_isLast"),"1"));
|
|
List list = materialMgmtService.materDetailList2(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
//부품구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getsupplyselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("recv_userid", commonService.bizMakeOptionList("", (String)paramMap.get("recv_userid"),"common.getUserselect"));
|
|
|
|
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
|
|
|
|
request.setAttribute("qtysum", qtysum);
|
|
request.setAttribute("LIST", list);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return page;
|
|
}
|
|
|
|
/**
|
|
* 발주 현황
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materList.do")
|
|
public String materList(HttpSession session,HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
|
|
Map code_map = new HashMap();
|
|
|
|
try{
|
|
|
|
Map info = materialMgmtService.openmaterModify(paramMap);
|
|
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
//부품구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
Map param = new HashMap();
|
|
|
|
code_map.put("gridpur_userid", commonService.getJqGridSelectBoxJsonData("common.getUserselect3", param, "선택")); //프로젝트 No.
|
|
code_map.put("griddes_userid", commonService.getJqGridSelectBoxJsonData("common.getUserselect3", param, "선택")); //프로젝트 No.
|
|
code_map.put("gridrecv_userid", commonService.getJqGridSelectBoxJsonData("common.getUserselect3", param, "선택")); //프로젝트 No.
|
|
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
request.setAttribute("writer", CommonUtils.checkNull(person.getUserId()));
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String page ="/materMgmt/materList";
|
|
/* if("excel".equals(actionType)){
|
|
page ="/materMgmt/partmgmtListExcel";
|
|
}
|
|
*/ return page;
|
|
}
|
|
|
|
/**
|
|
* 재고관리
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/invenmgmtList.do")
|
|
public String invenmgmtList(HttpServletRequest request, @RequestParam Map paramMap){
|
|
|
|
List list = materialMgmtService.invenmgmtList(request,paramMap);
|
|
Map qtysum = materialMgmtService.qtysum(paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
|
|
//규격(재질)
|
|
code_map.put("spec_cd",commonService.bizMakeOptionList(Constants.SPEC_CD, (String)paramMap.get("spec_cd"),"common.getCodeselect"));
|
|
|
|
//팀
|
|
code_map.put("dept_cd",commonService.bizMakeOptionList("", (String)paramMap.get("dept_cd"),"common.getDeptselect"));
|
|
|
|
|
|
//제조사
|
|
code_map.put("mfa_cd",commonService.bizMakeOptionList("MFA90000", (String)paramMap.get("mfa_cd"),"common.getCodeselect"));
|
|
|
|
//구매구분
|
|
code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", (String)paramMap.get("pur_cd"),"common.getCodeselect"));
|
|
|
|
//구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList("IVSOR90000", (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//사유
|
|
code_map.put("reason_cd",commonService.bizMakeOptionList("IVREA90000", (String)paramMap.get("reason_cd"),"common.getCodeselect"));
|
|
|
|
//위치
|
|
code_map.put("local_cd",commonService.bizMakeOptionList("IVLOC90000", (String)paramMap.get("local_cd"),"common.getCodeselect"));
|
|
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
request.setAttribute("LIST", list);
|
|
request.setAttribute("qtysum", qtysum);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
String page ="/materMgmt/invenmgmtList";
|
|
/* if("excel".equals(actionType)){
|
|
page ="/materMgmt/partmgmtListExcel";
|
|
}
|
|
*/ return page;
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 자재등록 수정 폼
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materMgmtUpdateFormPopup.do")
|
|
public String materMgmtUpdateFormPopup(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
String objId = CommonUtils.checkNull(paramMap.get("objId"));
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
Map code_map = new HashMap();
|
|
try{
|
|
// 영업활동 조회
|
|
Map info = null;
|
|
|
|
if(paramMap.get("objId")!=null){
|
|
info = materialMgmtService.getmaterMgmtUpdateFormInfo(paramMap);
|
|
//규격(재질)
|
|
code_map.put("spec_cd",commonService.bizMakeOptionList(Constants.SPEC_CD, CommonUtils.nullToEmpty((String)info.get("SPEC_CD")),"common.getCodeselect"));
|
|
|
|
//팀
|
|
code_map.put("dept_cd",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("DEPT_CD")),"common.getDeptselect"));
|
|
//제조사
|
|
code_map.put("mfa_cd",commonService.bizMakeOptionList("MFA90000", CommonUtils.nullToEmpty((String)info.get("MFA_CD")),"common.getCodeselect"));
|
|
|
|
//구매구분
|
|
code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", CommonUtils.nullToEmpty((String)info.get("INV_PUR_CD")),"common.getCodeselect"));
|
|
|
|
//구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList("IVSOR90000", CommonUtils.nullToEmpty((String)info.get("INV_CD")),"common.getCodeselect"));
|
|
|
|
//사유
|
|
code_map.put("reason_cd",commonService.bizMakeOptionList("IVREA90000", CommonUtils.nullToEmpty((String)info.get("INV_REA_CD")),"common.getCodeselect"));
|
|
|
|
//위치
|
|
code_map.put("local_cd",commonService.bizMakeOptionList("IVLOC90000", CommonUtils.nullToEmpty((String)info.get("INV_LOC_CD")),"common.getCodeselect"));
|
|
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("PROJECT_MGMT_OBJID")),"common.getProjectNoselect"));
|
|
|
|
}else{
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", "","common.getProjectNoselect"));
|
|
//규격(재질)
|
|
code_map.put("spec_cd",commonService.bizMakeOptionList(Constants.SPEC_CD, "","common.getCodeselect"));
|
|
//제조사
|
|
code_map.put("mfa_cd",commonService.bizMakeOptionList("MFA90000", "","common.getCodeselect"));
|
|
//팀
|
|
code_map.put("dept_cd",commonService.bizMakeOptionList("", "","common.getDeptselect"));
|
|
//구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList("IVSOR90000", "","common.getCodeselect"));
|
|
//사유
|
|
code_map.put("reason_cd",commonService.bizMakeOptionList("IVREA90000", "","common.getCodeselect"));
|
|
//구매구분
|
|
code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", "","common.getCodeselect"));
|
|
//위치
|
|
code_map.put("local_cd",commonService.bizMakeOptionList("IVLOC90000", "","common.getCodeselect"));
|
|
}
|
|
//차종별 프로젝트 수주활동 object id
|
|
if("".equals(objId)) objId = CommonUtils.createObjId();
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("objId", objId);
|
|
request.setAttribute("actionType", actionType);
|
|
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String writer = CommonUtils.checkNull(person.getUserId());
|
|
request.setAttribute("writer", writer);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materMgmtUpdateFormPopup";
|
|
}
|
|
|
|
|
|
/**
|
|
* 자재등록 수정 폼
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/openreleaseFormPopup.do")
|
|
public String openreleaseFormPopup(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
try{
|
|
// 영업활동 조회
|
|
Map info = materialMgmtService.openreleaseFormPopup(paramMap);
|
|
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("PROJECT_MGMT_OBJID")),"common.getProjectNoselect"));
|
|
|
|
//projectNo
|
|
code_map.put("rel_pur_cd",commonService.bizMakeOptionList("RELPUR00100", CommonUtils.nullToEmpty((String)info.get("REL_PUR_CD")),"common.getCodeselect"));
|
|
|
|
//projectNo
|
|
code_map.put("rel_user_id", commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("REL_USER_ID")),"common.getUserselect"));
|
|
|
|
|
|
Map param = new HashMap();
|
|
|
|
|
|
|
|
code_map.put("gridProjectNo", commonService.getJqGridSelectBoxJsonData("common.getProjectNoselect2", param, "선택")); //프로젝트 No.
|
|
|
|
param.put("parentCodeId", "RELPUR00100");
|
|
code_map.put("gridrelCd", commonService.getJqGridSelectBoxJsonData("common.getCodeList2", param, "선택")); //용도
|
|
|
|
code_map.put("griduserid", commonService.getJqGridSelectBoxJsonData("common.getUserselect3", param, "선택")); //인수자
|
|
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("info", info);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/openreleaseFormPopup";
|
|
}
|
|
|
|
|
|
/**
|
|
* 자재 등록 수정
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
@ResponseBody
|
|
@RequestMapping("/materMgmt/savematerMgmtInfo.do")
|
|
public Map<String, Object> savematerMgmtInfo(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map result_map = new HashMap();
|
|
try {
|
|
result_map.put("RESULT", materialMgmtService.savematerMgmtInfo(request, paramMap));
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
return result_map;
|
|
}
|
|
|
|
/**
|
|
* 자재 불출 등록 수정
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
@RequestMapping("/materMgmt/saverelmaterMgmtInfo.do")
|
|
@ResponseBody
|
|
public String saverelmaterMgmtInfo(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap){
|
|
String result = "";
|
|
try{
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
paramMap.put("connectUserId", CommonUtils.checkNull(person.getUserId()));
|
|
|
|
materialMgmtService.saverelmaterMgmtInfo(request, paramMap);
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
@RequestMapping("/materMgmt/searchreleaseList.do")
|
|
@ResponseBody
|
|
public HashMap<String, Object> searchreleaseList(HttpServletRequest request, @RequestParam Map paramMap){
|
|
HashMap<String, Object> resMap = new HashMap<String, Object>();
|
|
try{
|
|
List list = materialMgmtService.searchreleaseList(request, paramMap);
|
|
|
|
resMap.put("records", 1);
|
|
resMap.put("page", 1);
|
|
resMap.put("total", 1);
|
|
resMap.put("rows", list);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
return resMap;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/materMgmt/searchPartMgmt.do")
|
|
@ResponseBody
|
|
public HashMap<String, Object> searchPartMgmt(HttpServletRequest request, @RequestParam Map paramMap){
|
|
HashMap<String, Object> resMap = new HashMap<String, Object>();
|
|
try{
|
|
List list = null;
|
|
|
|
/*if("SRT00020".equals(paramMap.get("sort_cd"))){
|
|
list = materialMgmtService.searchSupMgmt(request, paramMap);
|
|
|
|
}else {//if("SRT00020".equals(paramMap.get("sort_cd"))){
|
|
|
|
list = materialMgmtService.searchPartMgmt(request, paramMap);
|
|
}*/
|
|
|
|
list = materialMgmtService.searchPartMgmt(request, paramMap);
|
|
resMap.put("records", 1);
|
|
resMap.put("page", 1);
|
|
resMap.put("total", 1);
|
|
resMap.put("rows", list);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
return resMap;
|
|
}
|
|
|
|
@RequestMapping("/materMgmt/searchPartSupMgmt.do")
|
|
@ResponseBody
|
|
public HashMap<String, Object> searchPartSupMgmt(HttpServletRequest request, @RequestParam Map paramMap){
|
|
HashMap<String, Object> resMap = new HashMap<String, Object>();
|
|
try{
|
|
List list = null;
|
|
|
|
list = materialMgmtService.searchPartSupMgmt(request, paramMap);
|
|
resMap.put("records", 1);
|
|
resMap.put("page", 1);
|
|
resMap.put("total", 1);
|
|
resMap.put("rows", list);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
return resMap;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/materMgmt/modifysearchPartMgmt.do")
|
|
@ResponseBody
|
|
public HashMap<String, Object> modifysearchPartMgmt(HttpServletRequest request, @RequestParam Map paramMap){
|
|
HashMap<String, Object> resMap = new HashMap<String, Object>();
|
|
try{
|
|
List list = null;
|
|
|
|
list = materialMgmtService.modifysearchPartMgmt(request, paramMap);
|
|
resMap.put("records", 1);
|
|
resMap.put("page", 1);
|
|
resMap.put("total", 1);
|
|
resMap.put("rows", list);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
return resMap;
|
|
}
|
|
|
|
//신규 발주현황 그리드 조회
|
|
@RequestMapping("/materMgmt/searchMaterPartMgmt.do")
|
|
@ResponseBody
|
|
public HashMap<String, Object> searchMaterPartMgmt(HttpServletRequest request, @RequestParam Map paramMap){
|
|
HashMap<String, Object> resMap = new HashMap<String, Object>();
|
|
try{
|
|
List list = null;
|
|
|
|
list = materialMgmtService.searchMaterPartMgmt(request, paramMap);
|
|
resMap.put("records", 1);
|
|
resMap.put("page", 1);
|
|
resMap.put("total", 1);
|
|
resMap.put("rows", list);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
return resMap;
|
|
}
|
|
|
|
|
|
/**
|
|
* 자재관리 - 발주관리 -입고결과 등록 저장
|
|
*/
|
|
@RequestMapping("/materMgmt/materRecSaveDetail.do")
|
|
@ResponseBody
|
|
public String MgmtRecSaveDetail(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap){
|
|
String result = "";
|
|
try{
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
paramMap.put("connectUserId", CommonUtils.checkNull(person.getUserId()));
|
|
|
|
materialMgmtService.savematerMgmtRecSaveDetail(request, paramMap);
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 자재관리 - 발주관리 -발주서 저장
|
|
*/
|
|
@RequestMapping("/materMgmt/materMgmtSave.do")
|
|
@ResponseBody
|
|
public String materMgmtSave(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap){
|
|
String result = "";
|
|
try{
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
paramMap.put("connectUserId", CommonUtils.checkNull(person.getUserId()));
|
|
|
|
materialMgmtService.savematerMgmtSaveMaster(request, paramMap);
|
|
//materialMgmtService.savematerMgmtSaveDetail(request, paramMap);
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* 자재관리 - 발주관리 -발주서 저장
|
|
*/
|
|
@RequestMapping("/materMgmt/materMgmtRegSave.do")
|
|
@ResponseBody
|
|
public String materMgmtRegSave(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap){
|
|
String result = "";
|
|
try{
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
paramMap.put("connectUserId", CommonUtils.checkNull(person.getUserId()));
|
|
|
|
materialMgmtService.savematerMgmtSaveRegMaster(request, paramMap);
|
|
materialMgmtService.savematerMgmtSaveDetail(request, paramMap);
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 자재관리 - 공급업체 -공급업체 저장
|
|
*/
|
|
@RequestMapping("/materMgmt/materMgmtSupSave.do")
|
|
@ResponseBody
|
|
public String materMgmtSupSave(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap){
|
|
String result = "";
|
|
try{
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
paramMap.put("connectUserId", CommonUtils.checkNull(person.getUserId()));
|
|
|
|
materialMgmtService.savematerMgmtSupSave(request, paramMap);
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주 등록 폼
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materWrite.do")
|
|
public String materWrite(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
try{
|
|
|
|
/* //프로젝트 No.
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
|
|
//발주서구분
|
|
code_map.put("rels_cd",commonService.bizMakeOptionList("RELS10000", (String)paramMap.get("rels_cd"),"common.getCodeselect"));
|
|
|
|
//PART상태
|
|
code_map.put("part_stcd",commonService.bizMakeOptionList("PRTS10000", (String)paramMap.get("part_stcd"),"common.getCodeselect"));
|
|
|
|
//공정No1.
|
|
code_map.put("process1_cd",commonService.bizMakeOptionList("PROCECD100000", (String)paramMap.get("process1_cd"),"common.getCodeselect"));
|
|
|
|
//공정No2
|
|
code_map.put("process2_cd",commonService.bizMakeOptionList("PROCECD100000", (String)paramMap.get("process2_cd"),"common.getCodeselect"));
|
|
|
|
//부품구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));*/
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getsupplyselect"));
|
|
|
|
/*//구매구분
|
|
code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", (String)paramMap.get("pur_cd"),"common.getCodeselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("recv_userid", commonService.bizMakeOptionList("", (String)paramMap.get("recv_userid"),"common.getUserselect"));
|
|
|
|
//결재방식
|
|
code_map.put("payment_cd",commonService.bizMakeOptionList("PAYMCD100000", (String)paramMap.get("payment_cd"),"common.getCodeselect"));*/
|
|
|
|
|
|
|
|
|
|
//jqGrid내에서 사용할 코드
|
|
Map param = new HashMap();
|
|
|
|
code_map.put("gridResource", commonService.getJqGridSelectBoxJsonData("common.getresourceList", param, "선택")); //계정과목
|
|
code_map.put("gridStandCd", commonService.getJsonSqlInfoList("common.getStandList",param)); //적요
|
|
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
//차종별 프로젝트 수주활동 object id
|
|
String objId = CommonUtils.createObjId();
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("objId", objId);
|
|
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String writer = CommonUtils.checkNull(person.getUserId());
|
|
request.setAttribute("writer", writer);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materWriteFormPopup";
|
|
}
|
|
/**
|
|
* 발주서 등록수정
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/matermgmtFormPopup.do")
|
|
public String materFormPopup(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
Map info = null;
|
|
List detailList = new ArrayList();
|
|
|
|
try{
|
|
String objId = CommonUtils.checkNull(paramMap.get("objId"), "");
|
|
if(objId.equals("")){
|
|
request.setAttribute("actType", "C"); //등록 Create
|
|
objId = CommonUtils.createObjId();
|
|
}else{
|
|
info = materialMgmtService.openmaterModify(paramMap);
|
|
paramMap.put("supply_cd", (String)info.get("SUP_CD"));
|
|
|
|
//Map gridMap = new HashMap();
|
|
//gridMap.put("records", 1);
|
|
//gridMap.put("page", 1);
|
|
//gridMap.put("total", 1);
|
|
//gridMap.put("rows", );
|
|
|
|
detailList = CommonUtils.keyChangeUpperArrayList(materialMgmtService.getListMATERIAL_DETAIL_MGMT(paramMap));
|
|
}
|
|
|
|
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd", commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"), "common.getmatersupplyselect"));
|
|
|
|
// //jqGrid내에서 사용할 코드
|
|
// Map param = new HashMap();
|
|
// code_map.put("gridResource", commonService.getJqGridSelectBoxJsonData("common.getresourceList", param, "선택")); //계정과목
|
|
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("gridDetailList", JsonUtil.ListToJson(detailList));
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("objId", objId);
|
|
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String writer = CommonUtils.checkNull(person.getUserId());
|
|
request.setAttribute("writer", writer);
|
|
request.setAttribute("writerName", person.getUserName());
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/matermgmtFormPopup";
|
|
}
|
|
|
|
/**
|
|
* 발주 등록 폼
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materSupWrite.do")
|
|
public String materSupWrite(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
try{
|
|
|
|
//프로젝트 No.
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
|
|
//공정No1.
|
|
code_map.put("process1_cd",commonService.bizMakeOptionList("PROCECD100000", (String)paramMap.get("process1_cd"),"common.getCodeselect"));
|
|
|
|
//공정No2
|
|
code_map.put("process2_cd",commonService.bizMakeOptionList("PROCECD100000", (String)paramMap.get("process2_cd"),"common.getCodeselect"));
|
|
|
|
//부품구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, (String)paramMap.get("sort_cd"),"common.getCodeselect"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", (String)paramMap.get("supply_cd"),"common.getsupplyselect"));
|
|
|
|
//구매구분
|
|
code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", (String)paramMap.get("pur_cd"),"common.getCodeselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("recv_userid", commonService.bizMakeOptionList("", (String)paramMap.get("recv_userid"),"common.getUserselect"));
|
|
|
|
//결재방식
|
|
code_map.put("payment_cd",commonService.bizMakeOptionList("PAYMCD100000", (String)paramMap.get("payment_cd"),"common.getCodeselect"));
|
|
|
|
|
|
Map param = new HashMap();
|
|
|
|
code_map.put("gridsupply_cd", commonService.getJqGridSelectBoxJsonData("common.getsupplyselect", param, "선택")); //프로젝트 No.
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
//차종별 프로젝트 수주활동 object id
|
|
String objId = CommonUtils.createObjId();
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("objId", objId);
|
|
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String writer = CommonUtils.checkNull(person.getUserId());
|
|
request.setAttribute("writer", writer);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materSupWriteFormPopup";
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주 등록 폼
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materModify.do")
|
|
public String materModify(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
|
|
try{
|
|
|
|
Map info = materialMgmtService.openmaterModify(paramMap);
|
|
|
|
//발주서구분
|
|
//code_map.put("rels_cd",commonService.bizMakeOptionList("RELS10000", CommonUtils.nullToEmpty((String)info.get("RELS_CD")),"common.getCodeselect"));
|
|
|
|
//프로젝트 No.
|
|
//code_map.put("projectno",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("PROJECT_MGMT_OBJID")),"common.getProjectNoselect"));
|
|
|
|
//부품구분
|
|
//code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, CommonUtils.nullToEmpty((String)info.get("SORT_CD")),"common.getCodeselect"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("SUP_CD")),"common.getsupplyselect"));
|
|
|
|
//구매구분
|
|
//code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", CommonUtils.nullToEmpty((String)info.get("PUR_CD")),"common.getCodeselect"));
|
|
|
|
//구매담당자
|
|
//code_map.put("recv_userid", commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("RECV_USERID")),"common.getUserselect"));
|
|
|
|
//결재방식
|
|
//code_map.put("payment_cd",commonService.bizMakeOptionList("PAYMCD100000", CommonUtils.nullToEmpty((String)info.get("PAYMENT_CD")),"common.getCodeselect"));
|
|
|
|
Map param = new HashMap();
|
|
|
|
code_map.put("gridResource", commonService.getJqGridSelectBoxJsonData("common.getresourceList", param, "선택")); //계정과목
|
|
code_map.put("gridStandCd", commonService.getJsonSqlInfoList("common.getStandList",param)); //적요
|
|
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("objId", paramMap.get("objId"));
|
|
|
|
String writer = CommonUtils.checkNull(CommonUtils.nullToEmpty((String)info.get("REG_USER_ID")));
|
|
|
|
request.setAttribute("writer", writer);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materModifyFormPopup";
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주 등록 폼
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materViwer.do")
|
|
public String materViwer(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
|
|
try{
|
|
|
|
Map info = materialMgmtService.openmaterModify(paramMap);
|
|
|
|
//프로젝트 No.
|
|
//code_map.put("projectno",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("PROJECT_MGMT_OBJID")),"common.getProjectNoselect"));
|
|
|
|
|
|
//발주서구분
|
|
//code_map.put("rels_cd",commonService.bizMakeOptionList("RELS10000", CommonUtils.nullToEmpty((String)info.get("RELS_CD")),"common.getCodeselect"));
|
|
|
|
//부품구분
|
|
//code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, CommonUtils.nullToEmpty((String)info.get("SORT_CD")),"common.getCodeselect"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("SUP_CD")),"common.getsupplyselect"));
|
|
|
|
//구매구분
|
|
//code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", CommonUtils.nullToEmpty((String)info.get("PUR_CD")),"common.getCodeselect"));
|
|
|
|
//구매담당자
|
|
//code_map.put("recv_userid", commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("RECV_USERID")),"common.getUserselect"));
|
|
|
|
//결재방식
|
|
//code_map.put("payment_cd",commonService.bizMakeOptionList("PAYMCD100000", CommonUtils.nullToEmpty((String)info.get("PAYMENT_CD")),"common.getCodeselect"));
|
|
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("objId", paramMap.get("objId"));
|
|
|
|
String writer = CommonUtils.checkNull(CommonUtils.nullToEmpty((String)info.get("REG_USER_ID")));
|
|
|
|
request.setAttribute("writer", writer);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materViwerFormPopup";
|
|
}
|
|
|
|
/**
|
|
* 입고등록
|
|
|
|
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materRecSave.do")
|
|
public String materRecSave(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
|
|
try{
|
|
|
|
Map info = materialMgmtService.openmaterModify(paramMap);
|
|
Map param = new HashMap();
|
|
|
|
code_map.put("gridresult", commonService.getJqGridSelectBoxJsonData("common.getResult", param, "선택")); //입고결과
|
|
param.put("codeId", "0001568");
|
|
code_map.put("locationCd", commonService.getJqGridSelectBoxJsonData("common.getCodeList", param, "선택")); //공장
|
|
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("objId", paramMap.get("objId"));
|
|
|
|
String writer = CommonUtils.checkNull(CommonUtils.nullToEmpty((String)info.get("REG_USER_ID")));
|
|
|
|
request.setAttribute("writer", writer);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materRecSave";
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 입고등록
|
|
|
|
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/surtaxInfoSave.do")
|
|
public String surtaxInfoSave(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
String objId = CommonUtils.checkNull(paramMap.get("objId"));
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
try{
|
|
// 영업활동 조회
|
|
Map info = null;
|
|
if(paramMap.get("objId")!=null){
|
|
info = materialMgmtService.getsurtaxInfo(paramMap);
|
|
code_map.put("region_cd",commonService.bizMakeOptionList(Constants.REGION_H_CD, CommonUtils.nullToEmpty((String)info.get("REGION_CD")),"common.getCodeselect")); //지역
|
|
code_map.put("customer_cd",commonService.bizMakeOptionList(Constants.CUSTOMER_CD, CommonUtils.nullToEmpty((String)info.get("CUSTOMER_CD")),"common.getCodeselect")); //고객사
|
|
code_map.put("project_no",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("ORDER_MGMT_OBJID")),"common.getProjectNoselect"));
|
|
}else{
|
|
code_map.put("region_cd",commonService.bizMakeOptionList(Constants.REGION_H_CD, "","common.getCodeselect")); //지역
|
|
code_map.put("customer_cd",commonService.bizMakeOptionList(Constants.CUSTOMER_CD, "","common.getCodeselect")); //고객사
|
|
code_map.put("project_no",commonService.bizMakeOptionList("", "","common.getProjectNoselect"));
|
|
}
|
|
//차종별 프로젝트 수주활동 object id
|
|
if("".equals(objId)) objId = CommonUtils.createObjId();
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("objId", objId);
|
|
request.setAttribute("actionType", actionType);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
return "/materMgmt/surtaxInfoSave";
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@ResponseBody
|
|
@RequestMapping("/materMgmt/getregioncd.do")
|
|
public Map<String, Object> getregioncd(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map result_map = new HashMap();
|
|
try {
|
|
result_map.put("RESULT", materialMgmtService.getregioncd(paramMap));
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
return result_map;
|
|
}
|
|
|
|
/**
|
|
* 발주 등록 폼
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materRegViwer.do")
|
|
public String materRegViwer(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
|
|
try{
|
|
|
|
Map info = materialMgmtService.openmaterModify(paramMap);
|
|
|
|
//프로젝트 No.
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("PROJECT_MGMT_OBJID")),"common.getProjectNoselect"));
|
|
|
|
//부품구분
|
|
code_map.put("sort_cd",commonService.bizMakeOptionList(Constants.SORT_CD, CommonUtils.nullToEmpty((String)info.get("SORT_CD")),"common.getCodeselect"));
|
|
|
|
//공급업체
|
|
code_map.put("supply_cd",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("SUP_CD")),"common.getsupplyselect"));
|
|
|
|
//구매구분
|
|
code_map.put("pur_cd",commonService.bizMakeOptionList("IVPUR90000", CommonUtils.nullToEmpty((String)info.get("PUR_CD")),"common.getCodeselect"));
|
|
|
|
//구매담당자
|
|
code_map.put("recv_userid", commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)info.get("RECV_USERID")),"common.getUserselect"));
|
|
|
|
//결재방식
|
|
code_map.put("payment_cd",commonService.bizMakeOptionList("PAYMCD100000", CommonUtils.nullToEmpty((String)info.get("PAYMENT_CD")),"common.getCodeselect"));
|
|
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("code_map",code_map);
|
|
request.setAttribute("objId", paramMap.get("objId"));
|
|
|
|
String writer = CommonUtils.checkNull(CommonUtils.nullToEmpty((String)info.get("REG_USER_ID")));
|
|
|
|
request.setAttribute("writer", writer);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materRegViwerFormPopup";
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주서 다운
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/materOrderDown.do")
|
|
public String materOrderDown(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map code_map = new HashMap();
|
|
List ApprList =null;
|
|
List detailinfo =null;
|
|
try{
|
|
/*
|
|
projectList = (ArrayList)service.getProjectList(request, paramMap);
|
|
code_map.put("cft_userid",commonService.bizMakeOptionList("", (String)paramMap.get("cft_userid"),"project.getProjectUser"));
|
|
|
|
request.setAttribute("projectList",projectList); */
|
|
|
|
Map info = materialMgmtService.openmaterModify(paramMap);
|
|
ApprList = materialMgmtService.getApprovalLine(paramMap);
|
|
|
|
String obbjId = CommonUtils.checkNull(paramMap.get("objId"));
|
|
paramMap.put("material_master_objid", obbjId);
|
|
detailinfo = materialMgmtService.modifysearchPartMgmt(request,paramMap);
|
|
|
|
//결재완료 상태 일때만 발주 상태로 업데이트
|
|
if("PURSTCD00600".equals(CommonUtils.checkNull(info.get("STATUS_CD")))){
|
|
//발주상태로 업데이트
|
|
materialMgmtService.changeMaterOrdOneStatus(request, paramMap);
|
|
|
|
}
|
|
request.setAttribute("info", info);
|
|
request.setAttribute("detailinfo", detailinfo);
|
|
request.setAttribute("ApprLine", ApprList);
|
|
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
|
|
return "/materMgmt/materOrderDown";
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 발주관리 상태를 접수로 변경한다.(다수)
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/changeMaterRegStatus.do")
|
|
@ResponseBody
|
|
public String changeMaterRegStatus(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap){
|
|
String result = "";
|
|
try{
|
|
materialMgmtService.changeMaterRegStatus(request, paramMap);
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 발주관리 상태를 발주완료 변경한다.(다수)
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/changeMaterOrdStatus.do")
|
|
@ResponseBody
|
|
public String changeMaterOrdStatus(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap){
|
|
String result = "";
|
|
try{
|
|
materialMgmtService.changeMaterOrdStatus(request, paramMap);
|
|
result = "SUCCESS";
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
result = "FAIL";
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 부가세 현황
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/surtaxInfo.do")
|
|
public String surtaxInfo(HttpSession session,HttpServletRequest request, @RequestParam Map paramMap){
|
|
List list = materialMgmtService.surtaxInfo(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
//projectNo
|
|
code_map.put("projectno",commonService.bizMakeOptionList("", (String)paramMap.get("projectno"),"common.getProjectNoselect"));
|
|
|
|
//공급업체
|
|
code_map.put("customer_cd",commonService.bizMakeOptionList(Constants.CUSTOMER_CD, (String)paramMap.get("customer_cd"),"common.getCodeselect")); //고객사
|
|
|
|
request.setAttribute("code_map",code_map);
|
|
|
|
request.setAttribute("LIST", list);
|
|
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
return "/materMgmt/surtaxInfoList";
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 부가세 현황
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@RequestMapping("/materMgmt/surtaxDetail.do")
|
|
public String surtaxDetail(HttpSession session,HttpServletRequest request, @RequestParam Map paramMap){
|
|
List list = materialMgmtService.surtaxDetail(request,paramMap);
|
|
Map code_map = new HashMap();
|
|
try{
|
|
request.setAttribute("LIST", list);
|
|
}catch(Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
|
return "/materMgmt/surtaxDetail";
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 부가세 저장
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
@ResponseBody
|
|
@RequestMapping("/materMgmt/saveSurtaxInfo.do")
|
|
public Map<String, Object> saveOrderMgmttInfo(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map result_map = new HashMap();
|
|
try {
|
|
result_map.put("RESULT", materialMgmtService.saveSurtaxInfo(request, paramMap));
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
return result_map;
|
|
}
|
|
|
|
|
|
/**
|
|
* 자재마스터 단가 가져오기
|
|
* @param request
|
|
* @param paramMap
|
|
* @return
|
|
*/
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@ResponseBody
|
|
@RequestMapping("/materMgmt/resourcePrice.do")
|
|
public Map<String, Object> resourcePrice(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
|
Map result_map = new HashMap();
|
|
try {
|
|
result_map.put("RESULT", commonService.resourcePrice(paramMap));
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
return result_map;
|
|
}
|
|
|
|
}
|