등급제 일괄변경 작업중
@26326c5d6c64f421fff32259634f12e55ec3bca1
--- src/main/java/itn/let/sym/grd/service/MberGrdVO.java
+++ src/main/java/itn/let/sym/grd/service/MberGrdVO.java
... | ... | @@ -1,26 +1,31 @@ |
| 1 | 1 |
package itn.let.sym.grd.service; |
| 2 | 2 |
|
| 3 |
-public class MberGrdVO {
|
|
| 3 |
+import java.util.List; |
|
| 4 | 4 |
|
| 5 |
- /** |
|
| 6 |
- * serialVersionUID |
|
| 7 |
- */ |
|
| 8 |
- @SuppressWarnings("unused")
|
|
| 9 |
- private static final long serialVersionUID = 1L; |
|
| 5 |
+public class MberGrdVO {
|
|
| 10 | 6 |
|
| 11 | 7 |
private int grdSetNo; // 등급설정번호 |
| 12 | 8 |
private String grdSetNm; // 등급설정명 |
| 9 |
+ private long totAmt; // 누적결제액 |
|
| 10 |
+ private String totAmtComma; // 누적결제액(콤마) |
|
| 13 | 11 |
private float shortPrice; // 단문 단가 |
| 14 | 12 |
private float longPrice; //장문 단가 |
| 15 | 13 |
private float picturePrice; // 그림 단가 |
| 16 | 14 |
private float picture2Price; // 그림 2장단가 |
| 17 | 15 |
private float picture3Price; // 그림 3장단가 |
| 18 |
- private float totAmt; // 누적결제액 |
|
| 19 | 16 |
private String regId; // 최초등록자 아이디 |
| 20 | 17 |
private String regDate; // 최초등록 일자 |
| 21 | 18 |
private String editId; // 수정등록자 아이디 |
| 22 | 19 |
private String editDate; // 수정등록 일자 |
| 23 | 20 |
|
| 21 |
+ private List<String> grdSetNos; |
|
| 22 |
+ private List<String> totAmts; |
|
| 23 |
+ private List<String> shortPrices; |
|
| 24 |
+ private List<String> longPrices; |
|
| 25 |
+ private List<String> picturePrices; |
|
| 26 |
+ private List<String> picture2Prices; |
|
| 27 |
+ private List<String> picture3Prices; |
|
| 28 |
+ |
|
| 24 | 29 |
public int getGrdSetNo() {
|
| 25 | 30 |
return grdSetNo; |
| 26 | 31 |
} |
... | ... | @@ -33,6 +38,18 @@ |
| 33 | 38 |
public void setGrdSetNm(String grdSetNm) {
|
| 34 | 39 |
this.grdSetNm = grdSetNm; |
| 35 | 40 |
} |
| 41 |
+ public long getTotAmt() {
|
|
| 42 |
+ return totAmt; |
|
| 43 |
+ } |
|
| 44 |
+ public void setTotAmt(long totAmt) {
|
|
| 45 |
+ this.totAmt = totAmt; |
|
| 46 |
+ } |
|
| 47 |
+ public String getTotAmtComma() {
|
|
| 48 |
+ return totAmtComma; |
|
| 49 |
+ } |
|
| 50 |
+ public void setTotAmtComma(String totAmtComma) {
|
|
| 51 |
+ this.totAmtComma = totAmtComma; |
|
| 52 |
+ } |
|
| 36 | 53 |
public float getShortPrice() {
|
| 37 | 54 |
return shortPrice; |
| 38 | 55 |
} |
... | ... | @@ -63,12 +80,6 @@ |
| 63 | 80 |
public void setPicture3Price(float picture3Price) {
|
| 64 | 81 |
this.picture3Price = picture3Price; |
| 65 | 82 |
} |
| 66 |
- public float getTotAmt() {
|
|
| 67 |
- return totAmt; |
|
| 68 |
- } |
|
| 69 |
- public void setTotAmt(float totAmt) {
|
|
| 70 |
- this.totAmt = totAmt; |
|
| 71 |
- } |
|
| 72 | 83 |
public String getRegId() {
|
| 73 | 84 |
return regId; |
| 74 | 85 |
} |
... | ... | @@ -93,9 +104,48 @@ |
| 93 | 104 |
public void setEditDate(String editDate) {
|
| 94 | 105 |
this.editDate = editDate; |
| 95 | 106 |
} |
| 96 |
- public static long getSerialversionuid() {
|
|
| 97 |
- return serialVersionUID; |
|
| 107 |
+ |
|
| 108 |
+ public List<String> getGrdSetNos() {
|
|
| 109 |
+ return grdSetNos; |
|
| 98 | 110 |
} |
| 99 |
- |
|
| 111 |
+ public void setGrdSetNos(List<String> grdSetNos) {
|
|
| 112 |
+ this.grdSetNos = grdSetNos; |
|
| 113 |
+ } |
|
| 114 |
+ public List<String> getTotAmts() {
|
|
| 115 |
+ return totAmts; |
|
| 116 |
+ } |
|
| 117 |
+ public void setTotAmts(List<String> totAmts) {
|
|
| 118 |
+ this.totAmts = totAmts; |
|
| 119 |
+ } |
|
| 120 |
+ public List<String> getShortPrices() {
|
|
| 121 |
+ return shortPrices; |
|
| 122 |
+ } |
|
| 123 |
+ public void setShortPrices(List<String> shortPrices) {
|
|
| 124 |
+ this.shortPrices = shortPrices; |
|
| 125 |
+ } |
|
| 126 |
+ public List<String> getLongPrices() {
|
|
| 127 |
+ return longPrices; |
|
| 128 |
+ } |
|
| 129 |
+ public void setLongPrices(List<String> longPrices) {
|
|
| 130 |
+ this.longPrices = longPrices; |
|
| 131 |
+ } |
|
| 132 |
+ public List<String> getPicturePrices() {
|
|
| 133 |
+ return picturePrices; |
|
| 134 |
+ } |
|
| 135 |
+ public void setPicturePrices(List<String> picturePrices) {
|
|
| 136 |
+ this.picturePrices = picturePrices; |
|
| 137 |
+ } |
|
| 138 |
+ public List<String> getPicture2Prices() {
|
|
| 139 |
+ return picture2Prices; |
|
| 140 |
+ } |
|
| 141 |
+ public void setPicture2Prices(List<String> picture2Prices) {
|
|
| 142 |
+ this.picture2Prices = picture2Prices; |
|
| 143 |
+ } |
|
| 144 |
+ public List<String> getPicture3Prices() {
|
|
| 145 |
+ return picture3Prices; |
|
| 146 |
+ } |
|
| 147 |
+ public void setPicture3Prices(List<String> picture3Prices) {
|
|
| 148 |
+ this.picture3Prices = picture3Prices; |
|
| 149 |
+ } |
|
| 100 | 150 |
|
| 101 | 151 |
} |
--- src/main/java/itn/let/sym/grd/web/MberGrdController.java
+++ src/main/java/itn/let/sym/grd/web/MberGrdController.java
... | ... | @@ -6,8 +6,12 @@ |
| 6 | 6 |
|
| 7 | 7 |
import org.springframework.stereotype.Controller; |
| 8 | 8 |
import org.springframework.ui.ModelMap; |
| 9 |
+import org.springframework.web.bind.annotation.ModelAttribute; |
|
| 9 | 10 |
import org.springframework.web.bind.annotation.RequestMapping; |
| 11 |
+import org.springframework.web.servlet.ModelAndView; |
|
| 10 | 12 |
|
| 13 |
+import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; |
|
| 14 |
+import itn.com.cmm.LoginVO; |
|
| 11 | 15 |
import itn.let.sym.grd.service.MberGrdService; |
| 12 | 16 |
import itn.let.sym.grd.service.MberGrdVO; |
| 13 | 17 |
|
... | ... | @@ -18,7 +22,7 @@ |
| 18 | 22 |
MberGrdService mberGrdService; |
| 19 | 23 |
|
| 20 | 24 |
/** |
| 21 |
- * 사용자 등급별 단가조정 화면 |
|
| 25 |
+ * 등급제 관리 화면 |
|
| 22 | 26 |
* |
| 23 | 27 |
* @param mberGrdVO |
| 24 | 28 |
* @param model |
... | ... | @@ -35,4 +39,35 @@ |
| 35 | 39 |
return "/sym/grd/mberGrdSetting"; |
| 36 | 40 |
} |
| 37 | 41 |
|
| 42 |
+ // 등급제 일괄 저장 |
|
| 43 |
+ @RequestMapping(value = "/sym/grd/mberGrdSettingMassUpdateAjax.do") |
|
| 44 |
+ public ModelAndView mberGrdSettingMassUpdateAjax( |
|
| 45 |
+ @ModelAttribute("mberGrdVO") MberGrdVO mberGrdVO) throws Exception {
|
|
| 46 |
+ |
|
| 47 |
+ ModelAndView modelAndView = new ModelAndView(); |
|
| 48 |
+ modelAndView.setViewName("jsonView");
|
|
| 49 |
+ |
|
| 50 |
+ boolean isSuccess = true; |
|
| 51 |
+ String msg = ""; |
|
| 52 |
+ |
|
| 53 |
+ // 로그인VO에서 사용자 정보 가져오기 |
|
| 54 |
+ LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); |
|
| 55 |
+ String frstRegisterId = loginVO == null ? "" : loginVO.getId(); |
|
| 56 |
+ mberGrdVO.setRegId(frstRegisterId); // 최초등록자ID |
|
| 57 |
+ |
|
| 58 |
+ try{
|
|
| 59 |
+ // 등급제 업데이트 |
|
| 60 |
+ //mberGrdService.updateHashTagList(mberGrdVO); |
|
| 61 |
+ } |
|
| 62 |
+ catch(Exception e) {
|
|
| 63 |
+ isSuccess = false; |
|
| 64 |
+ msg = e.getMessage(); |
|
| 65 |
+ } |
|
| 66 |
+ |
|
| 67 |
+ modelAndView.addObject("isSuccess", isSuccess);
|
|
| 68 |
+ modelAndView.addObject("msg", msg);
|
|
| 69 |
+ |
|
| 70 |
+ return modelAndView; |
|
| 71 |
+ } |
|
| 72 |
+ |
|
| 38 | 73 |
} |
--- src/main/resources/egovframework/sqlmap/let/sym/grd/MberGrd_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/sym/grd/MberGrd_SQL_Mysql.xml
... | ... | @@ -9,7 +9,8 @@ |
| 9 | 9 |
SELECT |
| 10 | 10 |
A.GRD_SET_NO AS grdSetNo |
| 11 | 11 |
, A.GRD_SET_NM AS grdSetNm |
| 12 |
- , A.TOT_AMT AS totAmt |
|
| 12 |
+ , FLOOR(A.TOT_AMT) AS totAmt |
|
| 13 |
+ , FORMAT(FLOOR(A.TOT_AMT),0) AS totAmtComma |
|
| 13 | 14 |
, A.SHORT_PRICE AS shortPrice |
| 14 | 15 |
, A.LONG_PRICE AS longPrice |
| 15 | 16 |
, A.PICTURE_PRICE AS picturePrice |
--- src/main/webapp/WEB-INF/jsp/sym/grd/mberGrdSetting.jsp
+++ src/main/webapp/WEB-INF/jsp/sym/grd/mberGrdSetting.jsp
... | ... | @@ -14,6 +14,39 @@ |
| 14 | 14 |
|
| 15 | 15 |
} |
| 16 | 16 |
|
| 17 |
+ // 등급제 일괄변경 |
|
| 18 |
+ function setMassEdit() {
|
|
| 19 |
+ if(!confirm("등급별 단가를 변경 하시겠습니까?")) {
|
|
| 20 |
+ return; |
|
| 21 |
+ } |
|
| 22 |
+ |
|
| 23 |
+ // 콤마 제거 |
|
| 24 |
+ $('input[name=totAmt]').each(function(index,item){
|
|
| 25 |
+ $(this).val($(this).val().replace(/,/gi, "")); |
|
| 26 |
+ }); |
|
| 27 |
+ |
|
| 28 |
+ $.ajax({
|
|
| 29 |
+ type: "POST", |
|
| 30 |
+ url: "/sym/grd/mberGrdSettingMassUpdateAjax.do", |
|
| 31 |
+ data: $("#listForm").serialize(),
|
|
| 32 |
+ dataType:'json', |
|
| 33 |
+ async: false, |
|
| 34 |
+ success: function (data) {
|
|
| 35 |
+ console.log(data); |
|
| 36 |
+ if (data.isSuccess) {
|
|
| 37 |
+ alert("저장 완료했습니다.");
|
|
| 38 |
+ location.reload(); |
|
| 39 |
+ } |
|
| 40 |
+ else {
|
|
| 41 |
+ alert("Msg : " + data.msg);
|
|
| 42 |
+ } |
|
| 43 |
+ }, |
|
| 44 |
+ error: function (e) {
|
|
| 45 |
+ alert("ERROR : " + JSON.stringify(e));
|
|
| 46 |
+ } |
|
| 47 |
+ }); |
|
| 48 |
+ } |
|
| 49 |
+ |
|
| 17 | 50 |
</script> |
| 18 | 51 |
</head> |
| 19 | 52 |
<body> |
... | ... | @@ -24,7 +57,7 @@ |
| 24 | 57 |
<p class="tType6 c_999999">등급제 관리 페이지 입니다.</p> |
| 25 | 58 |
</div> |
| 26 | 59 |
<div class="pageCont"> |
| 27 |
- <form name="form" id="form" method="post"> |
|
| 60 |
+ <form id="listForm" name="listForm" method="post"> |
|
| 28 | 61 |
<div class="tableWrap"> |
| 29 | 62 |
<table class="tbType1"> |
| 30 | 63 |
<colgroup> |
... | ... | @@ -49,14 +82,15 @@ |
| 49 | 82 |
</thead> |
| 50 | 83 |
<tbody> |
| 51 | 84 |
<c:forEach var="result" items="${mberGrdSettingList}" varStatus="status">
|
| 85 |
+ <input type="hidden" name="grdSetNo" value="${result.grdSetNo}"/>
|
|
| 52 | 86 |
<tr> |
| 53 | 87 |
<td><c:out value="${result.grdSetNm}"/></td>
|
| 54 |
- <td><c:out value="${result.totAmt}"/></td>
|
|
| 55 |
- <td><c:out value="${result.shortPrice}"/></td>
|
|
| 56 |
- <td><c:out value="${result.longPrice}"/></td>
|
|
| 57 |
- <td><c:out value="${result.picturePrice}"/></td>
|
|
| 58 |
- <td><c:out value="${result.picture2Price}"/></td>
|
|
| 59 |
- <td><c:out value="${result.picture3Price}"/></td>
|
|
| 88 |
+ <td><input type="text" name="totAmt" value="<c:out value="${result.totAmtComma}"/>" style="height: 20px; width: 150px; padding: 5px 5px 5px 5px;" /></td>
|
|
| 89 |
+ <td><input type="text" name="shortPrice" value="<c:out value="${result.shortPrice}"/>" style="height: 20px; width: 100px; padding: 5px 5px 5px 5px;" /></td>
|
|
| 90 |
+ <td><input type="text" name="longPrice" value="<c:out value="${result.longPrice}"/>" style="height: 20px; width: 100px; padding: 5px 5px 5px 5px;" /></td>
|
|
| 91 |
+ <td><input type="text" name="picturePrice" value="<c:out value="${result.picturePrice}"/>" style="height: 20px; width: 100px; padding: 5px 5px 5px 5px;" /></td>
|
|
| 92 |
+ <td><input type="text" name="picture2Price" value="<c:out value="${result.picture2Price}"/>" style="height: 20px; width: 100px; padding: 5px 5px 5px 5px;" /></td>
|
|
| 93 |
+ <td><input type="text" name="picture3Price" value="<c:out value="${result.picture3Price}"/>" style="height: 20px; width: 100px; padding: 5px 5px 5px 5px;" /></td>
|
|
| 60 | 94 |
</tr> |
| 61 | 95 |
</c:forEach> |
| 62 | 96 |
</tbody> |
... | ... | @@ -64,7 +98,7 @@ |
| 64 | 98 |
</div> |
| 65 | 99 |
</form> |
| 66 | 100 |
<div class="btnWrap"> |
| 67 |
- <input type="button" class="btnType1" value="수정" onclick="javascript:doUpdate(); return false;"> |
|
| 101 |
+ <input type="button" class="btnType1" value="수정" onclick="javascript:setMassEdit(); return false;"> |
|
| 68 | 102 |
</div> |
| 69 | 103 |
</div> |
| 70 | 104 |
</div> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?