생산관리_M-BOM관리쪽 e-bom팝업완성

This commit is contained in:
Johngreen
2025-10-29 11:58:56 +09:00
parent 91b97be376
commit 8954ae559e
5 changed files with 134 additions and 0 deletions

View File

@@ -970,4 +970,41 @@ public class ProductionPlanningController extends BaseService {
}
return resultMap;
}
/**
* M-BOM에서 E-BOM 제거
* @param request
* @param paramMap
* @return
*/
@ResponseBody
@RequestMapping("/productionplanning/removeEbomFromMbom.do")
public Map<String, Object> removeEbomFromMbom(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
Map<String, Object> resultMap = new HashMap<>();
try {
String projectMgmtObjid = CommonUtils.checkNull(paramMap.get("projectMgmtObjid"));
if(projectMgmtObjid.isEmpty()) {
resultMap.put("success", false);
resultMap.put("message", "필수 파라미터가 누락되었습니다.");
return resultMap;
}
// PROJECT_MGMT 테이블의 PART_OBJID를 null로 업데이트
int updateResult = productionPlanningService.removeEbomFromProject(projectMgmtObjid);
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;
}
}

View File

@@ -2985,6 +2985,14 @@
WHERE OBJID = #{projectMgmtObjid}
</update>
<!-- M-BOM에서 E-BOM 제거 -->
<update id="removeEbomFromProject" parameterType="map">
UPDATE PROJECT_MGMT
SET
PART_OBJID = NULL
WHERE OBJID = #{projectMgmtObjid}
</update>
<!-- E-BOM 정보 조회 -->
<select id="getEbomInfo" parameterType="map" resultType="com.pms.common.UpperKeyMap">
SELECT

View File

@@ -725,6 +725,36 @@ public class ProductionPlanningService {
}
}
/**
* PROJECT_MGMT에서 E-BOM 제거 (PART_OBJID를 null로 설정)
* @param projectMgmtObjid
* @return
* @throws Exception
*/
public int removeEbomFromProject(String projectMgmtObjid) throws Exception {
SqlSession sqlSession = null;
try {
sqlSession = SqlMapConfig.getInstance().getSqlSession();
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("projectMgmtObjid", projectMgmtObjid);
int result = sqlSession.update("productionplanning.removeEbomFromProject", paramMap);
sqlSession.commit();
return result;
} catch(Exception e) {
if(sqlSession != null) {
sqlSession.rollback();
}
throw e;
} finally {
if(sqlSession != null) {
sqlSession.close();
}
}
}
/**
* E-BOM 정보 조회
* @param bomReportObjid