관리자 환불등록 작업중

This commit is contained in:
itn 2023-06-26 16:33:43 +09:00
parent 761a305ae7
commit 48d78bf3ed
2 changed files with 109 additions and 1 deletions

View File

@ -929,7 +929,7 @@ public class RefundController {
* 결제취소 등록
* @param RefundVO
* @param model
* @return "/uss/ion/pay/RefundRegist"
* @return "/uss/ion/pay/cancelRegist"
* @throws Exception
*/
@RequestMapping(value="/uss/ion/pay/cancelRegist.do")
@ -937,6 +937,18 @@ public class RefundController {
return "/uss/ion/pay/cancelRegist";
}
/**
* 환불 등록
* @param RefundVO
* @param model
* @return "/uss/ion/pay/RefundRegist"
* @throws Exception
*/
@RequestMapping(value="/uss/ion/pay/refundRegist.do")
public String refundRegist(@ModelAttribute("refundVO") RefundVO refundVO) throws Exception{
return "/uss/ion/pay/RefundRegist";
}
/**
* 결제취소 페이지
* @param refundVO
@ -1000,6 +1012,91 @@ public class RefundController {
return ResponseEntity.ok().body(refundService.insertPayCanAjax(userInfoAdd(refundVO)));
}
/**
* 환불요청 등록 Ajax
* @param RefundVO
* @param model
* @return modelAndView
* @throws Exception
*/
@RequestMapping(value = {"/uss/ion/pay/refMonInsAjax.do"})
public ModelAndView refMonInsAjax(final MultipartHttpServletRequest multiRequest
, RefundVO refundVO , HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
try {
String atchFileId = "";
final Map<String, MultipartFile> files = multiRequest.getFileMap();
if (!files.isEmpty()) {
if(files.containsKey("bank")){
Map<String, MultipartFile> tmpMap = new LinkedHashMap<>();
tmpMap.put("bank", files.get("bank"));
List<FileVO> result = fileUtil.parseFileInf(tmpMap, "REFUND_", 0, "", "", "");
atchFileId = fileMngService.insertFileInfs(result);
refundVO.setBankAtchFileId(atchFileId);
}
if(files.containsKey("docu")){
Map<String, MultipartFile> tmpMap = new LinkedHashMap<>();
tmpMap.put("docu", files.get("docu"));
List<FileVO> result = fileUtil.parseFileInf(tmpMap, "REFUND_", 0, "", "", "");
atchFileId = fileMngService.insertFileInfs(result);
refundVO.setDocuAtchFileId(atchFileId);
}
}
refundVO.setFrstRegisterId(refundVO.getMberId());
refundVO.setRefundStatus("1");
refundService.insertRefund(refundVO);
modelAndView.addObject("status", "success");
}catch (Exception e) {
System.out.println("REFUND ERROR : " + e.getMessage());
modelAndView.addObject("status", "fail");
}
return modelAndView;
}
/**
* 환불신청금액(환불요청 상태) Ajax
* @param RefundVO
* @param model
* @return modelAndView
* @throws Exception
*/
@RequestMapping(value = {"/uss/ion/pay/refMonSumAjax.do"})
public ModelAndView refMonSumAjax(RefundVO refundVO, HttpServletRequest request) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
boolean isSuccess = true;
String msg = "";
int refundMoneySum = 0;
int userMoney = 0;
try {
refundVO = refundService.selectRefundMberInfo(refundVO);
userMoney = (int)Double.parseDouble(refundVO.getMberMoney()); // 보유Cash
refundMoneySum = refundService.selectRefundMoneySum(refundVO); // 환불신청금액(환불요청 상태)
} catch (Exception e) {
isSuccess = false;
msg = e.getMessage();
}
modelAndView.addObject("isSuccess", isSuccess);
modelAndView.addObject("msg", msg);
modelAndView.addObject("userMoney", userMoney);
modelAndView.addObject("refundMoneySum", refundMoneySum);
return modelAndView;
}
/**
* 캐쉬 환불 처리
* @param refundVO

View File

@ -64,6 +64,14 @@ function fn_insert(){
frm.submit();
}
// 환불 등록
function fn_refundRegist(){
frm = document.listForm;
frm.action = "<c:url value='/uss/ion/pay/refundRegist.do' />";
frm.submit();
}
/* 수정 화면*/
function fn_modify(moid){
var frm = document.modiForm ;
@ -314,6 +322,9 @@ function fnSelectMber(mberId) {
</table>
</div>
<div class="btnWrap">
<%--
<input type="button" class="btnType1" value="환불 등록" onclick="fn_refundRegist(); return false;" >
--%>
<input type="button" class="btnType1" value="결제취소 등록" onclick="fn_insert(); return false;" >
<input type="button" class="btnType2" value="삭제" onclick="fn_delete(); return false;">
</div>