생산관리_M-BOM관리페이지 e-bom까지 완료
This commit is contained in:
@@ -904,4 +904,70 @@ public class ProductionPlanningController extends BaseService {
|
||||
commonService.selectListPagingNew("productionplanning.mBomMgmtGridList", request, paramMap);
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* M-BOM E-BOM 선택 팝업
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/productionplanning/mBomEbomSelectPopup.do")
|
||||
public String mBomEbomSelectPopup(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
try {
|
||||
// 필요한 코드 맵 설정 (structureList.jsp 참고)
|
||||
Map<String, Object> codeMap = new HashMap<>();
|
||||
// 제품구분 코드 - structureList와 동일하게 설정
|
||||
codeMap.put("product_cd", commonService.bizMakeOptionList("0000001", CommonUtils.nullToEmpty((String)paramMap.get("product_cd")), "common.getCodeselect"));
|
||||
request.setAttribute("code_map", codeMap);
|
||||
|
||||
// 현재 할당된 E-BOM 정보 조회
|
||||
String bomReportObjid = CommonUtils.checkNull(paramMap.get("bomReportObjid"));
|
||||
if(!"".equals(bomReportObjid)) {
|
||||
// E-BOM 정보 조회
|
||||
Map<String, Object> ebomInfo = productionPlanningService.getEbomInfo(bomReportObjid);
|
||||
request.setAttribute("currentEbom", ebomInfo);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/productionplanning/mBomEbomSelectPopup";
|
||||
}
|
||||
|
||||
/**
|
||||
* E-BOM을 M-BOM(PROJECT_MGMT)에 할당
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/productionplanning/assignEbomToMbom.do")
|
||||
public Map<String, Object> assignEbomToMbom(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
try {
|
||||
String projectMgmtObjid = CommonUtils.checkNull(paramMap.get("projectMgmtObjid"));
|
||||
String bomReportObjid = CommonUtils.checkNull(paramMap.get("bomReportObjid"));
|
||||
|
||||
if(projectMgmtObjid.isEmpty() || bomReportObjid.isEmpty()) {
|
||||
resultMap.put("success", false);
|
||||
resultMap.put("message", "필수 파라미터가 누락되었습니다.");
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
// PROJECT_MGMT 테이블의 PART_OBJID 업데이트
|
||||
int updateResult = productionPlanningService.assignEbomToProject(projectMgmtObjid, bomReportObjid);
|
||||
|
||||
if(updateResult > 0) {
|
||||
resultMap.put("success", true);
|
||||
resultMap.put("message", "E-BOM이 할당되었습니다.");
|
||||
} else {
|
||||
resultMap.put("success", false);
|
||||
resultMap.put("message", "할당에 실패했습니다.");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
resultMap.put("success", false);
|
||||
resultMap.put("message", "오류가 발생했습니다: " + e.getMessage());
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user