파트 재고단위, 관리단위 관련 수정

This commit is contained in:
2026-03-11 10:49:03 +09:00
parent 30b5f76010
commit c856a9b4ad
8 changed files with 196 additions and 28 deletions

View File

@@ -38,6 +38,7 @@ $(document).ready(function(){
var part_type = $.parseJSON($("#part_type").val()); //jqGrid 구분
var acctfg_code = $.parseJSON($("#acctfg_code").val()); //jqGrid 계정구분
var sup_code = $.parseJSON($("#sup_code").val()); //jqGrid 구분
var unit_dc_code = $("#unit_dc_code").val() ? $.parseJSON($("#unit_dc_code").val()) : {}; //jqGrid 단위
//Excel File Upload된 파일 목록 부분을 초기화 한다.
$("#excelImportList").hide();
@@ -187,16 +188,24 @@ $(document).ready(function(){
}
}
}
,{name:"UNIT_DC",index:"UNIT_DC", width: 70, align:"center", hidden: false, sortable:false, editable:true
,{name:"UNIT_DC",index:"UNIT_DC", width: 80, align:"center", hidden: false, sortable:false, editable:true
,edittype :"select"
,formatter :"select"
,editoptions:{
dataInit : function(e){
value: unit_dc_code
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
}
,{name:"UNITMANG_DC",index:"UNITMANG_DC", width: 70, align:"center", hidden: false, sortable:false, editable:true
,{name:"UNITMANG_DC",index:"UNITMANG_DC", width: 80, align:"center", hidden: false, sortable:false, editable:true
,edittype :"select"
,formatter :"select"
,editoptions:{
dataInit : function(e){
value: unit_dc_code
,dataInit : function(e){
e.style.width = "92%";
e.style.fontSize = 13;
}
}
@@ -293,7 +302,7 @@ $(document).ready(function(){
,height : 530 //'auto' //520
,multiselect : false
,shrinkToFit : false
,autowidth : true
,autowidth : false
,sortable : false
,rowNum : 5000
,forceFit : false //컬럼의 width를 변화시킬때 그리드의 width를 고정 여부
@@ -1084,6 +1093,7 @@ function fn_save(){
<textarea style="width:0px; height:0px; visibility: hidden;" id="part_type">${code_map.part_type}</textarea><!-- 코드동적설정 -->
<textarea style="width:0px; height:0px; visibility: hidden;" id="acctfg_code">${code_map.acctfg_code}</textarea><!-- 계정구분 코드동적설정 -->
<textarea style="width:0px; height:0px; visibility: hidden;" id="sup_code">${code_map.sup_code}</textarea><!-- 코드동적설정 -->
<textarea style="width:0px; height:0px; visibility: hidden;" id="unit_dc_code">${code_map.unit_dc_code}</textarea><!-- 단위 코드동적설정 -->
</form>
</body>
</html>

View File

@@ -461,9 +461,19 @@ section {
}
.plm_btn_wrap_center {
flex-direction: row !important;
display: flex !important;
justify-content: center !important;
position: relative !important;
left: auto !important;
transform: none !important;
}
.plm_btns, .btns {
width: auto !important;
float: none !important;
}
.btn_wrap {
padding: 10px 5px !important;
height: auto !important;
}
}
@@ -609,13 +619,13 @@ section {
<label for="">재고단위</label>
</td>
<td class="input_sub_title" colspan="2">
<input type="text" name="UNIT_DC" id="UNIT_DC" value="${resultMap.UNIT_DC}" maxlength="4" disabled>
<select name="UNIT_DC" id="UNIT_DC" class="select2" style="width:100%;" disabled>${code_map.unit_dc_cd}</select>
</td>
<td class="input_title">
<label for="">관리단위</label>
</td>
<td class="input_sub_title">
<input type="text" name="UNITMANG_DC" id="UNITMANG_DC" value="${resultMap.UNITMANG_DC}" maxlength="4" disabled>
<select name="UNITMANG_DC" id="UNITMANG_DC" class="select2" style="width:100%;" disabled>${code_map.unitmang_dc_cd}</select>
</td>
</tr>
<tr>

View File

@@ -293,6 +293,31 @@ function fn_overlapPartMng(){
.input_title {border-left:1px solid #ccc;}
.input_sub_title {border-left:1px solid #ccc;}
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
@media (max-width: 768px) {
.pmsPopupForm td {
display: table-cell !important;
width: auto !important;
}
.input_title {
border-right: 1px solid #ccc !important;
}
.plm_btn_wrap_center {
flex-direction: row !important;
display: flex !important;
justify-content: center !important;
position: relative !important;
left: auto !important;
transform: none !important;
}
.plm_btns, .btns {
width: auto !important;
float: none !important;
}
.btn_wrap {
padding: 10px 5px !important;
height: auto !important;
}
}
</style>
<body>
<form name="form1" id="form1" action="" method="post">
@@ -405,7 +430,7 @@ function fn_overlapPartMng(){
<td class="input_title">
<label for="">계정구분<span class="text-danger">*</span></label>
</td>
<td class="input_sub_title">
<td class="input_sub_title" colspan="2">
<select name="ACCTFG" id="ACCTFG" class="" type="select" required reqTitle="계정구분"></select>
</td>
<td class="input_title">
@@ -426,13 +451,19 @@ function fn_overlapPartMng(){
<label for="">재고단위<span class="text-danger">*</span></label>
</td>
<td class="input_sub_title" colspan="2">
<input type="text" name="UNIT_DC" id="UNIT_DC" value="${resultMap.UNIT_DC}" maxlength="4" required reqTitle="재고단위">
<select name="UNIT_DC" id="UNIT_DC" class="select2" style="width:100%;" required reqTitle="재고단위">
<option value="">선택</option>
${code_map.unit_dc_cd}
</select>
</td>
<td class="input_title">
<label for="">관리단위<span class="text-danger">*</span></label>
</td>
<td class="input_sub_title">
<input type="text" name="UNITMANG_DC" id="UNITMANG_DC" value="${resultMap.UNITMANG_DC}" maxlength="4" required reqTitle="관리단위">
<select name="UNITMANG_DC" id="UNITMANG_DC" class="select2" style="width:100%;" required reqTitle="관리단위">
<option value="">선택</option>
${code_map.unitmang_dc_cd}
</select>
</td>
</tr>
<tr>

View File

@@ -219,8 +219,8 @@ String connector = person.getUserId();
{headerHozAlign : 'center', hozAlign : 'left', width : '100', title : '규격', field : 'SPEC' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '계정구분', field : 'ACCTFG_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '조달구분', field : 'ODRFG_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '재고단위', field : 'UNIT_DC' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '관리단위', field : 'UNITMANG_DC' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '재고단위', field : 'UNIT_DC_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '관리단위', field : 'UNITMANG_DC_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '환산수량', field : 'UNITCHNG_NB' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : 'LOT구분', field : 'LOT_FG_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '사용여부', field : 'USE_YN_NM' },

View File

@@ -189,8 +189,8 @@ ui-jqgrid tr.jqgrow td {
{headerHozAlign : 'center', hozAlign : 'left', width : '100', title : '규격', field : 'SPEC' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '계정구분', field : 'ACCTFG_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '조달구분', field : 'ODRFG_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '재고단위', field : 'UNIT_DC' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '관리단위', field : 'UNITMANG_DC' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '재고단위', field : 'UNIT_DC_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '관리단위', field : 'UNITMANG_DC_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '환산수량', field : 'UNITCHNG_NB' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : 'LOT구분', field : 'LOT_FG_NM' },
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '사용여부', field : 'USE_YN_NM' },

View File

@@ -401,12 +401,16 @@ public class PartMngController {
}
// 단위 코드 셀렉트박스
code_map.put("unit_dc_cd", commonService.bizMakeOptionList("0001399", CommonUtils.nullToEmpty((String)resultMap.get("UNIT_DC")), "common.getCodeselect"));
code_map.put("unitmang_dc_cd", commonService.bizMakeOptionList("0001399", CommonUtils.nullToEmpty((String)resultMap.get("UNITMANG_DC")), "common.getCodeselect"));
}catch(Exception e){
e.printStackTrace();
}
request.setAttribute("code_map", code_map);
request.setAttribute("resultMap", resultMap);
return "/partMng/partMngFormPopUp";
}
@@ -456,6 +460,10 @@ public class PartMngController {
resultMap.put("OBJID", objId);
}
// 단위 코드 셀렉트박스
code_map.put("unit_dc_cd", commonService.bizMakeOptionList("0001399", CommonUtils.nullToEmpty((String)resultMap.get("UNIT_DC")), "common.getCodeselect"));
code_map.put("unitmang_dc_cd", commonService.bizMakeOptionList("0001399", CommonUtils.nullToEmpty((String)resultMap.get("UNITMANG_DC")), "common.getCodeselect"));
}catch(Exception e){
e.printStackTrace();
}
@@ -676,7 +684,12 @@ public class PartMngController {
Map acctfgParam = new HashMap();
acctfgParam.put("codeId", Constants.ACCTFG_CODE);
code_map.put("acctfg_code", commonService.getJqGridSelectBoxJsonData("common.getCodeList", acctfgParam, "선택"));
// 단위(UNIT_DC) 공통코드 조회 - jqGrid selectBox용 JSON
Map unitDcParam = new HashMap();
unitDcParam.put("codeId", "0001399");
code_map.put("unit_dc_code", commonService.getJqGridSelectBoxJsonData("common.getCodeList", unitDcParam, "선택"));
/*
code_map.put("customer_cd",commonService.bizMakeOptionList("", (String)paramMap.get("customer_cd"),"common.getsupplyselect"));
code_map.put("project_name",commonService.bizMakeOptionList("", (String)paramMap.get("project_name"),"common.getProjectNameList"));

View File

@@ -162,7 +162,9 @@
P.ODRFG,
CASE WHEN P.ODRFG = '0' THEN '구매' WHEN P.ODRFG = '1' THEN '생산' WHEN P.ODRFG = '8' THEN 'Phantom' ELSE '' END AS ODRFG_NM,
P.UNIT_DC,
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = P.UNIT_DC) AS UNIT_DC_NM,
P.UNITMANG_DC,
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = P.UNITMANG_DC) AS UNITMANG_DC_NM,
P.UNITCHNG_NB,
P.LOT_FG,
CASE WHEN P.LOT_FG = '1' THEN '사용' WHEN P.LOT_FG = '0' THEN '미사용' ELSE '' END AS LOT_FG_NM,
@@ -7925,12 +7927,21 @@ SELECT PM.OBJID
<!-- 계정구분 코드 조회 (한글명 → ERP 코드값) -->
<select id="getAcctfgCode" parameterType="map" resultType="map">
SELECT
SELECT
CODE_ID
FROM COMM_CODE
WHERE CODE_NAME = #{CODE_NAME}
WHERE CODE_NAME = #{CODE_NAME}
AND PARENT_CODE_ID = '0900213'
</select>
<!-- 단위 코드 조회 (코드명 → 코드값) -->
<select id="getUnitDcCode" parameterType="map" resultType="map">
SELECT
CODE_ID
FROM COMM_CODE
WHERE UPPER(TRIM(CODE_NAME)) = UPPER(TRIM(#{CODE_NAME}))
AND PARENT_CODE_ID = '0001399'
</select>
<!-- 공급업체명으로 OBJID 조회 -->
<select id="getSupplyCodeByName" parameterType="map" resultType="map">

View File

@@ -3106,10 +3106,40 @@ public class PartMngService extends BaseService {
}
// ERP 연동 필드 파싱
String unitDc = getCellValue(row, columnIndex++, formatter, emptyColCnt);
partMap.put("UNIT_DC", unitDc.trim());
if(!StringUtils.isBlank(unitDc)){
if(unitDc.trim().matches("\\d+")){
partMap.put("UNIT_DC", unitDc.trim());
} else {
Map unitDcParam = new HashMap();
unitDcParam.put("CODE_NAME", unitDc.trim());
Map unitDcResult = sqlSession.selectOne("partMng.getUnitDcCode", unitDcParam);
if(unitDcResult != null && !StringUtils.isBlank((String)unitDcResult.get("code_id"))){
partMap.put("UNIT_DC", unitDcResult.get("code_id"));
} else {
partMap.put("UNIT_DC", unitDc.trim());
}
}
} else {
partMap.put("UNIT_DC", "");
}
String unitmangDc = getCellValue(row, columnIndex++, formatter, emptyColCnt);
partMap.put("UNITMANG_DC", unitmangDc.trim());
if(!StringUtils.isBlank(unitmangDc)){
if(unitmangDc.trim().matches("\\d+")){
partMap.put("UNITMANG_DC", unitmangDc.trim());
} else {
Map unitmangParam = new HashMap();
unitmangParam.put("CODE_NAME", unitmangDc.trim());
Map unitmangResult = sqlSession.selectOne("partMng.getUnitDcCode", unitmangParam);
if(unitmangResult != null && !StringUtils.isBlank((String)unitmangResult.get("code_id"))){
partMap.put("UNITMANG_DC", unitmangResult.get("code_id"));
} else {
partMap.put("UNITMANG_DC", unitmangDc.trim());
}
}
} else {
partMap.put("UNITMANG_DC", "");
}
String unitchngNb = getCellValue(row, columnIndex++, formatter, emptyColCnt);
partMap.put("UNITCHNG_NB", unitchngNb.trim());
@@ -3678,9 +3708,40 @@ public class PartMngService extends BaseService {
} else {
partMap.put("ODRFG", "");
}
// ERP 연동 필드
partMap.put("UNIT_DC", unitDc.trim());
partMap.put("UNITMANG_DC", unitmangDc.trim());
// 재고단위(UNIT_DC) - 코드명 입력 시 코드값으로 변환
if(!StringUtils.isBlank(unitDc)){
if(unitDc.trim().matches("\\d+")){
partMap.put("UNIT_DC", unitDc.trim());
} else {
Map unitDcParam = new HashMap();
unitDcParam.put("CODE_NAME", unitDc.trim());
Map unitDcResult = sqlSession.selectOne("partMng.getUnitDcCode", unitDcParam);
if(unitDcResult != null && !StringUtils.isBlank((String)unitDcResult.get("code_id"))){
partMap.put("UNIT_DC", unitDcResult.get("code_id"));
} else {
partMap.put("UNIT_DC", unitDc.trim());
}
}
} else {
partMap.put("UNIT_DC", "");
}
// 관리단위(UNITMANG_DC) - 코드명 입력 시 코드값으로 변환
if(!StringUtils.isBlank(unitmangDc)){
if(unitmangDc.trim().matches("\\d+")){
partMap.put("UNITMANG_DC", unitmangDc.trim());
} else {
Map unitmangParam = new HashMap();
unitmangParam.put("CODE_NAME", unitmangDc.trim());
Map unitmangResult = sqlSession.selectOne("partMng.getUnitDcCode", unitmangParam);
if(unitmangResult != null && !StringUtils.isBlank((String)unitmangResult.get("code_id"))){
partMap.put("UNITMANG_DC", unitmangResult.get("code_id"));
} else {
partMap.put("UNITMANG_DC", unitmangDc.trim());
}
}
} else {
partMap.put("UNITMANG_DC", "");
}
partMap.put("UNITCHNG_NB", unitchngNb.trim());
// LOT구분 - 한글명 입력 시 코드값으로 변환 (0:미사용, 1:사용)
if(!CommonUtils.isBlank(lotFg)){
@@ -4198,7 +4259,7 @@ public class PartMngService extends BaseService {
int emptyRowCnt = 0;
AtomicInteger emptyColCnt = new AtomicInteger(0);
Map partNoUniqueMap = new HashMap();
for(int rowIndex= 1 ; rowIndex < rows ; rowIndex++){ // 2번째 행(index 1)부터 시작 (헤더 1줄 건너뜀)
Row row = sheet.getRow(rowIndex);
if(null != row){
@@ -4390,9 +4451,40 @@ public class PartMngService extends BaseService {
partMap.put("ODRFG", "");
}
// ERP 연동 필드
partMap.put("UNIT_DC", unitDc);
partMap.put("UNITMANG_DC", unitmangDc);
// 재고단위(UNIT_DC) - 코드명 입력 시 코드값으로 변환
if(!StringUtils.isBlank(unitDc)){
if(unitDc.trim().matches("\\d+")){
partMap.put("UNIT_DC", unitDc.trim());
} else {
Map unitDcParam = new HashMap();
unitDcParam.put("CODE_NAME", unitDc.trim());
Map unitDcResult = sqlSession.selectOne("partMng.getUnitDcCode", unitDcParam);
if(unitDcResult != null && !StringUtils.isBlank((String)unitDcResult.get("code_id"))){
partMap.put("UNIT_DC", unitDcResult.get("code_id"));
} else {
partMap.put("UNIT_DC", unitDc.trim());
}
}
} else {
partMap.put("UNIT_DC", "");
}
// 관리단위(UNITMANG_DC) - 코드명 입력 시 코드값으로 변환
if(!StringUtils.isBlank(unitmangDc)){
if(unitmangDc.trim().matches("\\d+")){
partMap.put("UNITMANG_DC", unitmangDc.trim());
} else {
Map unitmangParam = new HashMap();
unitmangParam.put("CODE_NAME", unitmangDc.trim());
Map unitmangResult = sqlSession.selectOne("partMng.getUnitDcCode", unitmangParam);
if(unitmangResult != null && !StringUtils.isBlank((String)unitmangResult.get("code_id"))){
partMap.put("UNITMANG_DC", unitmangResult.get("code_id"));
} else {
partMap.put("UNITMANG_DC", unitmangDc.trim());
}
}
} else {
partMap.put("UNITMANG_DC", "");
}
partMap.put("UNITCHNG_NB", unitchngNb);
// LOT구분 - 한글명 입력 시 코드값으로 변환
@@ -5789,4 +5881,5 @@ public class PartMngService extends BaseService {
}
}
}
}