diff --git a/src/main/java/kcc/let/utl/fcc/service/VisitEduTransUtil.java b/src/main/java/kcc/let/utl/fcc/service/VisitEduTransUtil.java index d7ab6574..3351b8b3 100644 --- a/src/main/java/kcc/let/utl/fcc/service/VisitEduTransUtil.java +++ b/src/main/java/kcc/let/utl/fcc/service/VisitEduTransUtil.java @@ -21,6 +21,7 @@ import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import kcc.ve.cmm.VeConstants; import kcc.ve.instr.tngrVisitEdu.asgnmInfo.service.VEInstrAsgnmVO; /** * 숫자 데이터 처리 관련 유틸리티 @@ -63,8 +64,16 @@ public class VisitEduTransUtil { try { i_acmdtFee = Integer.parseInt(t.getAcmdtFee()); }catch(Exception ex) { i_acmdtFee = 0; System.out.println(ex.toString()); } i_feeSum4Dp = i_instrFee + i_specialWorkAllow + i_distanceAllow + i_trafficFee + i_acmdtFee; - - try { t.setFeeSum4Dp(Integer.toString(i_feeSum4Dp)); } catch (Exception e) { e.printStackTrace(); } + + try { + + System.out.println(t.getDivCd()); + System.out.println(t.getLrnTm()); + + if (i_feeSum4Dp<=0) i_feeSum4Dp = VisitEduTransUtil._calcInstrFee(t.getDivCd(), t.getLrnTm()); + + t.setFeeSum4Dp(Integer.toString(i_feeSum4Dp)); + } catch (Exception e) { e.printStackTrace(); } System.out.println("i_feeSum4Dp"); System.out.println(i_feeSum4Dp); @@ -74,4 +83,67 @@ public class VisitEduTransUtil { return p_vEInstrAsgnmVOList; } + + private static int _calcInstrFee( + String p_divCd + , String p_lrnTm + )throws Exception { + // 강사료 계산 (강의차시 * 강사 기본값) + //성인은 구분에 따라 강사료가 다르다 + String s_divCd = p_divCd; + int i_lrnTm = Integer.parseInt(p_lrnTm); + int i_lrnCnt = 0; + + System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ divCd : "+s_divCd); + System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ lrnTm : "+i_lrnTm); + /* + * (금액기준) + 10,60)입문은 시간당 150,000원(최초3시간까지, 이후 시간당 75,000원) - 2급 + 20,50)전문은 시간당 200,000원(최초3시간까지, 이후 시간당 100,000원) - 1급 + 30)내부는 시간당 100,000원(최초3시간까지, 이후 시간당 50,000원) + + 50)1급은 전문과 동일 + 60)2급은 입문과 동일 + + 40)청년은 청년강사만 해당 + + */ + int v_instrFee = 0; + + while(i_lrnTm>=30 && i_lrnCnt<3) { //비용 정산을 위한 시간이 남았음 + if ("10".equals(s_divCd) || "60".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A10); + + }else if ("20".equals(s_divCd) || "50".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A20); + + }else { //maybe 30 + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A30); + } + + i_lrnTm = i_lrnTm - 60; //기본 시간제외 + + i_lrnCnt = i_lrnCnt +1; + } + + + + //나머지 시간에 대한 강사 비용추가(3시간 이상은 시간수당이 다름) + while(i_lrnTm>=30) { //비용 정산을 위한 시간이 남았음 + //구분에 따라서 추가 비용 지급 + if ("10".equals(s_divCd) || "60".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A10_A); + + }else if ("20".equals(s_divCd) || "50".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A20_A); + + }else { //maybe 30 + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A30_A); + } + + i_lrnTm = i_lrnTm - 60; //기본 시간제외 + } + + return v_instrFee; + } } diff --git a/src/main/java/kcc/ve/cmm/VeConstants.java b/src/main/java/kcc/ve/cmm/VeConstants.java index 0c8c5e78..073bca98 100644 --- a/src/main/java/kcc/ve/cmm/VeConstants.java +++ b/src/main/java/kcc/ve/cmm/VeConstants.java @@ -79,8 +79,8 @@ public class VeConstants { public static final String BASE_INSTR_FEE_A20 = "200000";//성인 강사료 기본료 전문/1급 20,50 public static final String BASE_INSTR_FEE_A30 = "100000";//성인 강사료 기본료 내부 - public static final String BASE_INSTR_FEE_A10_A = "75000";//성인 강사료 추가 입문/2급 10,60 - public static final String BASE_INSTR_FEE_A20_A = "100000";//성인 강사료 추가 전문/1급 20,50 + public static final String BASE_INSTR_FEE_A10_A = "100000";//성인 강사료 추가 입문/2급 10,60 + public static final String BASE_INSTR_FEE_A20_A = "150000";//성인 강사료 추가 전문/1급 20,50 public static final String BASE_INSTR_FEE_A30_A = "50000";//성인 강사료 추가 내부 public static final String BASE_INSTR_FEE = "43000";//청소년 강사료 기본료 diff --git a/src/main/java/kcc/ve/cmm/VeInstrFeeMng.java b/src/main/java/kcc/ve/cmm/VeInstrFeeMng.java index 9fb8add5..0528059b 100644 --- a/src/main/java/kcc/ve/cmm/VeInstrFeeMng.java +++ b/src/main/java/kcc/ve/cmm/VeInstrFeeMng.java @@ -175,7 +175,15 @@ public class VeInstrFeeMng { return vEInstrFeeAcmdtVO; } - + + //성인강사용 강사료 계산 - just instrFee + public int VeInstrFeePreCalc4Adult(String p_divCd, String p_lrnTm) throws Exception { + int instrFee = 0; + + instrFee = this._calcInstrFee(p_divCd, p_lrnTm); + + return instrFee; + } //성인강사용 강사료 계산 public VEInstrFeeAcmdtVO VeInstrFeeMng4Adult(VEInstrFeeService vEInstrFeeService , String eduAplctOrd, String eduChasiOrd) throws Exception { @@ -210,7 +218,8 @@ public class VeInstrFeeMng { // 강사료 계산 (강의차시 * 강사 기본값) //성인은 구분에 따라 강사료가 다르다 String s_divCd = vEInstrFeeAcmdtVO.getDivCd(); - int i_lrnTm = Integer.parseInt(selectChasiList.get(0).getLrnTm()); + int i_lrnTm = Integer.parseInt(selectChasiList.get(0).getLrnTm()); + int i_lrnCnt = 0; System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ divCd : "+s_divCd); System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ lrnTm : "+i_lrnTm); @@ -228,20 +237,29 @@ public class VeInstrFeeMng { */ int instrFee = 0; - if ("10".equals(s_divCd) || "60".equals(s_divCd)) { - instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A10); + instrFee = this._calcInstrFee(vEInstrFeeAcmdtVO.getDivCd(), selectChasiList.get(0).getLrnTm()); + + /* + while(i_lrnTm>=30 && i_lrnCnt<3) { //비용 정산을 위한 시간이 남았음 + if ("10".equals(s_divCd) || "60".equals(s_divCd)) { + instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A10); + + }else if ("20".equals(s_divCd) || "50".equals(s_divCd)) { + instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A20); + + }else { //maybe 30 + instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A30); + } - }else if ("20".equals(s_divCd) || "50".equals(s_divCd)) { - instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A20); + i_lrnTm = i_lrnTm - 60; //기본 시간제외 - }else { //maybe 30 - instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A30); + i_lrnCnt = i_lrnCnt +1; } - i_lrnTm = i_lrnTm - 180; //기본 시간제외 - //나머지 시간에 대한 강사 비용추가 - while(i_lrnTm>0) { //비용 정산을 위한 시간이 남았음 + + //나머지 시간에 대한 강사 비용추가(3시간 이상은 시간수당이 다름) + while(i_lrnTm>=30) { //비용 정산을 위한 시간이 남았음 //구분에 따라서 추가 비용 지급 if ("10".equals(s_divCd) || "60".equals(s_divCd)) { instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A10_A); @@ -253,121 +271,14 @@ public class VeInstrFeeMng { instrFee = instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A30_A); } - i_lrnTm = i_lrnTm - 180; //기본 시간제외 + i_lrnTm = i_lrnTm - 60; //기본 시간제외 } + */ - //int instrFee = Integer.parseInt(vEInstrFeeAcmdtVO.getChasi()) * Integer.parseInt(VeConstants.BASE_INSTR_FEE); System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ instrFee : "+instrFee); vEInstrFeeAcmdtVO.setInstrFee(Integer.toString(instrFee)); - // 온라인 여부 확인(10:온라인, 20:오프라인) - /* - if("20".equals(vEInstrFeeAcmdtVO.getEduSlctCd())){ - - // 도서벽지수당 계산(강의 차시 * 15,000원) 22.06.15 도서벽지 수당 중복하도록 요청으로 인한 변경 - try { - if(vEInstrFeeAcmdtVO.getIsltnScholYn().equals("Y")) { - int isltnFee = Integer.parseInt(vEInstrFeeAcmdtVO.getChasi()) * Integer.parseInt(VeConstants.BASE_ISLTN_FEE); - vEInstrFeeAcmdtVO.setSpecialWorkAllow(Integer.toString(isltnFee)); - } - }catch(Exception ex) { - System.out.println(ex.getMessage()); - } - - - if(check) { - - - if(vEInstrFeeAcmdtVO.getOnewayDstnc() == null || vEInstrFeeAcmdtVO.getOnewayDstnc().equals("")) { - vEInstrFeeAcmdtVO.setOnewayDstnc("0"); - } - - // 거리비교 200Km 이상 : 40000원, 100Km 이상 : 30000원, 12Km 이상 : 20000원, 1Km 이상 10000원 - int dstnc = (Integer.parseInt(vEInstrFeeAcmdtVO.getOnewayDstnc()) * 2); - - String passCityList = "강원도,경기도,경상북도,경상남도,충청북도,충청남도,전라북도,전라남도,제주특별자치도"; - String[] passCityArray = passCityList.split(","); - - boolean passCity = true; - - try { - - String[] scholArea = vEInstrFeeAcmdtVO.getScholArea().split(" "); - String[] instrRsdnc = vEInstrFeeAcmdtVO.getInstrRsdnc().split(" "); - - - System.out.println("학교 : "+scholArea[0]+" "+scholArea[1]+" _강사 :"+instrRsdnc[0]+" "+instrRsdnc[1]+" _거리 :" + dstnc); - - - - - // 주소 앞자리 비교 - passCity = true; - if(scholArea[0].contains(instrRsdnc[0])){ - - for(int i=0; i < passCityArray.length; i++) { - if(passCityArray[i].equals(scholArea[0])) { - if(!scholArea[1].equals(instrRsdnc[1])){ - System.out.println("타지역 "); - passCity = false; - break; - }else { - System.out.println("거주지"); - break; - } - } - } - }else{ - // 다르면 끝 - passCity = false; - } - }catch(Exception ex) { - System.out.println(ex.getMessage()); - } - - - - // 장거리교육수당 확인(거주지 : 10000) - if(passCity || dstnc < 12){ // 거주지 인경우 - System.out.println("거주지"); - vEInstrFeeAcmdtVO.setDistanceAllow("10000"); - }else { // 타지역 인경우 - System.out.println("타지역 : " + vEInstrFeeAcmdtVO.getOnewayDstnc()); - - if(dstnc >= 200) { - vEInstrFeeAcmdtVO.setDistanceAllow("40000"); - }else if(dstnc >= 100 && dstnc < 200) { - vEInstrFeeAcmdtVO.setDistanceAllow("30000"); - }else if(dstnc >= 12 && dstnc < 100) { - vEInstrFeeAcmdtVO.setDistanceAllow("20000"); - }else { - vEInstrFeeAcmdtVO.setDistanceAllow("10000"); - } - - // 교통비 계산 (거리 * 교통비 기본값) - int trafficFee = (Integer.parseInt(vEInstrFeeAcmdtVO.getOnewayDstnc()) * 2) * Integer.parseInt(VeConstants.BASE_TRAFFIC_FEE); - vEInstrFeeAcmdtVO.setTrafficFee(Integer.toString(trafficFee)); - } - vEInstrFeeAcmdtVO.setLikeCheckYn("N"); - }else { - vEInstrFeeAcmdtVO.setDistanceAllow("0"); - vEInstrFeeAcmdtVO.setLikeCheckYn("Y"); - } - - // 수당 합계 - int sum = + Integer.parseInt(vEInstrFeeAcmdtVO.getSpecialWorkAllow()) - + Integer.parseInt(vEInstrFeeAcmdtVO.getDistanceAllow()); - vEInstrFeeAcmdtVO.setAllowance(sum); - - // 여비 합계 - sum = Integer.parseInt(vEInstrFeeAcmdtVO.getTrafficFee()) - + Integer.parseInt(vEInstrFeeAcmdtVO.getAcmdtFee()); - vEInstrFeeAcmdtVO.setSpareFee(String.format("%,d", sum)); - }else if("10".equals(vEInstrFeeAcmdtVO.getEduSlctCd())){ - - } - */ } @@ -599,4 +510,67 @@ public class VeInstrFeeMng { return vEInstrFeeAcmdtVO; } + + private int _calcInstrFee( + String p_divCd + , String p_lrnTm + )throws Exception { + // 강사료 계산 (강의차시 * 강사 기본값) + //성인은 구분에 따라 강사료가 다르다 + String s_divCd = p_divCd; + int i_lrnTm = Integer.parseInt(p_lrnTm); + int i_lrnCnt = 0; + + System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ divCd : "+s_divCd); + System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ lrnTm : "+i_lrnTm); + /* + * (금액기준) + 10,60)입문은 시간당 150,000원(최초3시간까지, 이후 시간당 75,000원) - 2급 + 20,50)전문은 시간당 200,000원(최초3시간까지, 이후 시간당 100,000원) - 1급 + 30)내부는 시간당 100,000원(최초3시간까지, 이후 시간당 50,000원) + + 50)1급은 전문과 동일 + 60)2급은 입문과 동일 + + 40)청년은 청년강사만 해당 + + */ + int v_instrFee = 0; + + while(i_lrnTm>=30 && i_lrnCnt<3) { //비용 정산을 위한 시간이 남았음 + if ("10".equals(s_divCd) || "60".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A10); + + }else if ("20".equals(s_divCd) || "50".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A20); + + }else { //maybe 30 + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A30); + } + + i_lrnTm = i_lrnTm - 60; //기본 시간제외 + + i_lrnCnt = i_lrnCnt +1; + } + + + + //나머지 시간에 대한 강사 비용추가(3시간 이상은 시간수당이 다름) + while(i_lrnTm>=30) { //비용 정산을 위한 시간이 남았음 + //구분에 따라서 추가 비용 지급 + if ("10".equals(s_divCd) || "60".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A10_A); + + }else if ("20".equals(s_divCd) || "50".equals(s_divCd)) { + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A20_A); + + }else { //maybe 30 + v_instrFee = v_instrFee + Integer.parseInt(VeConstants.BASE_INSTR_FEE_A30_A); + } + + i_lrnTm = i_lrnTm - 60; //기본 시간제외 + } + + return v_instrFee; + } }