판매관리, 매출관리완성
This commit is contained in:
@@ -58,7 +58,7 @@ public class SalesNcollectMgmtController {
|
||||
|
||||
/** 매출수금 Service */
|
||||
@Autowired
|
||||
private SalesNcollectMgmtService salseNcollectMgmtService;
|
||||
private SalesNcollectMgmtService salesNcollectMgmtService;
|
||||
|
||||
/** 영업관리 공통 Service */
|
||||
@Autowired
|
||||
@@ -200,16 +200,33 @@ public class SalesNcollectMgmtController {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
List<Map<String, Object>> list = salseNcollectMgmtService.getSalesMgmtGridList(request, paramMap);
|
||||
int totalCount = salseNcollectMgmtService.getSalesMgmtGridListCount(paramMap);
|
||||
System.out.println("===== revenueGridList.do 파라미터 =====");
|
||||
System.out.println("paramMap: " + paramMap);
|
||||
|
||||
List<Map<String, Object>> list = salesNcollectMgmtService.getSalesMgmtGridList(request, paramMap);
|
||||
int totalCount = salesNcollectMgmtService.getSalesMgmtGridListCount(paramMap);
|
||||
Map<String, Object> totals = salesNcollectMgmtService.getSalesMgmtTotals(paramMap);
|
||||
|
||||
System.out.println("list size: " + list.size());
|
||||
System.out.println("totalCount: " + totalCount);
|
||||
System.out.println("totals: " + totals);
|
||||
|
||||
resultMap.put("RESULTLIST", list);
|
||||
resultMap.put("last_page", (int) Math.ceil((double)totalCount / Integer.parseInt(CommonUtils.checkNull(request.getParameter("size"), "10"))));
|
||||
resultMap.put("TOTALS", totals); // Total 공급가액, 부가세, 총액
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
// Tabulator는 에러 발생 시 빈 배열을 기대합니다.
|
||||
resultMap.put("RESULTLIST", new java.util.ArrayList<>());
|
||||
resultMap.put("last_page", 0);
|
||||
|
||||
// Total 초기화
|
||||
Map<String, Object> emptyTotals = new HashMap<String, Object>();
|
||||
|
||||
emptyTotals.put("TOTAL_SUPPLY_PRICE", 0);
|
||||
emptyTotals.put("TOTAL_VAT", 0);
|
||||
emptyTotals.put("TOTAL_AMOUNT", 0);
|
||||
resultMap.put("TOTALS", emptyTotals);
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
@@ -232,6 +249,12 @@ public class SalesNcollectMgmtController {
|
||||
codeMap.put("managerList",
|
||||
salesMgmtCommonService.bizMakeOptionList("", "", "salesMgmtCommon.getSalesmanList"));
|
||||
|
||||
// 기존 판매 정보 조회
|
||||
if(paramMap.get("orderNo") != null && !paramMap.get("orderNo").equals("")) {
|
||||
Map<String, Object> saleInfo = salesNcollectMgmtService.getSaleInfo(paramMap);
|
||||
request.setAttribute("saleInfo", saleInfo);
|
||||
}
|
||||
|
||||
request.setAttribute("codeMap", codeMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -239,6 +262,87 @@ public class SalesNcollectMgmtController {
|
||||
return "/salesmgmt/salesMgmt/salesRegForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/salesMgmt/salesMgmtGridList.do", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> getSalesMgmtGridList(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
List<Map<String, Object>> list = salesNcollectMgmtService.getSalesMgmtGridList(request, paramMap);
|
||||
int totalCount = salesNcollectMgmtService.getSalesMgmtGridListCount(paramMap);
|
||||
|
||||
resultMap.put("RESULTLIST", list);
|
||||
resultMap.put("last_page", (int) Math.ceil((double)totalCount / Integer.parseInt(CommonUtils.checkNull(request.getParameter("size"), "10"))));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
// Tabulator는 에러 발생 시 빈 배열을 기대합니다.
|
||||
resultMap.put("RESULTLIST", new java.util.ArrayList<>());
|
||||
resultMap.put("last_page", 0);
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/salesMgmt/saveSales.do", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveSales(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
try {
|
||||
resultMap = salesNcollectMgmtService.saveSaleRegistration(request, paramMap);
|
||||
} catch (Exception e) {
|
||||
resultMap.put("result", false);
|
||||
resultMap.put("msg", "저장 중 오류가 발생했습니다.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 분할출하 팝업 폼
|
||||
* </pre>
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return String
|
||||
*/
|
||||
@RequestMapping(value = "/salesMgmt/splitShipmentForm.do", method = RequestMethod.GET)
|
||||
public String showSplitShipmentForm(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
try {
|
||||
Map<String, Object> codeMap = new HashMap<String, Object>();
|
||||
|
||||
// 담당자
|
||||
codeMap.put("managerList",
|
||||
salesMgmtCommonService.bizMakeOptionList("", "", "salesMgmtCommon.getSalesmanList"));
|
||||
|
||||
request.setAttribute("codeMap", codeMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/salesmgmt/salesMgmt/splitShipmentForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 분할출하 저장 처리
|
||||
* </pre>
|
||||
* @param request
|
||||
* @param paramMap - 분할출하 정보
|
||||
* @return Map
|
||||
*/
|
||||
@RequestMapping(value = "/salesMgmt/saveSplitShipment.do", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveSplitShipment(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
try {
|
||||
resultMap = salesNcollectMgmtService.splitShipment(request, paramMap);
|
||||
} catch (Exception e) {
|
||||
resultMap.put("result", false);
|
||||
resultMap.put("msg", "분할출하 처리 중 오류가 발생했습니다.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 계약관리 목록 조회
|
||||
@@ -299,7 +403,7 @@ public class SalesNcollectMgmtController {
|
||||
public String sales(HttpServletRequest request
|
||||
, @RequestParam Map<String, Object> paramMap) {
|
||||
try {
|
||||
List<Map<String,Object>> list = salseNcollectMgmtService.getSalseAllByOrderNo(request, paramMap);
|
||||
List<Map<String,Object>> list = salesNcollectMgmtService.getSalseAllByOrderNo(request, paramMap);
|
||||
|
||||
request.setAttribute("LIST", list);
|
||||
} catch(Exception e) {
|
||||
@@ -335,7 +439,7 @@ public class SalesNcollectMgmtController {
|
||||
try {
|
||||
if(StringUtils.isNotBlank(saleNo)) {
|
||||
// 매출관리 조회
|
||||
info = salseNcollectMgmtService.getSalesMgmt(paramMap);
|
||||
info = salesNcollectMgmtService.getSalesMgmt(paramMap);
|
||||
} else {
|
||||
info = new HashMap<String, Object>();
|
||||
}
|
||||
@@ -388,7 +492,7 @@ public class SalesNcollectMgmtController {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
resultMap.put("RESULT", salseNcollectMgmtService.saveSalesMgmt(request, paramMap));
|
||||
resultMap.put("RESULT", salesNcollectMgmtService.saveSalesMgmt(request, paramMap));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -409,7 +513,7 @@ public class SalesNcollectMgmtController {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
resultMap.put("RESULT", salseNcollectMgmtService.deleteSalesMgmt(request, paramMap));
|
||||
resultMap.put("RESULT", salesNcollectMgmtService.deleteSalesMgmt(request, paramMap));
|
||||
|
||||
|
||||
|
||||
@@ -450,7 +554,7 @@ public class SalesNcollectMgmtController {
|
||||
, @RequestParam Map<String, Object> paramMap) {
|
||||
|
||||
try {
|
||||
List<Map<String,Object>> list = salseNcollectMgmtService.getCollectAllByOrderNo(request, paramMap);
|
||||
List<Map<String,Object>> list = salesNcollectMgmtService.getCollectAllByOrderNo(request, paramMap);
|
||||
|
||||
request.setAttribute("LIST", list);
|
||||
} catch(Exception e) {
|
||||
@@ -491,7 +595,7 @@ public class SalesNcollectMgmtController {
|
||||
System.out.println("paramMap##################### " + paramMap);
|
||||
if(StringUtils.isNotBlank(saleNo)) {
|
||||
// 수금관리 조회
|
||||
info = salseNcollectMgmtService.getCollectMgmt(paramMap);
|
||||
info = salesNcollectMgmtService.getCollectMgmt(paramMap);
|
||||
} else {
|
||||
info = new HashMap<String, Object>();
|
||||
}
|
||||
@@ -540,7 +644,7 @@ public class SalesNcollectMgmtController {
|
||||
*/
|
||||
|
||||
//하단 그리드를 위한 수금 목록 조회
|
||||
List<Map<String,Object>> list = salseNcollectMgmtService.getCollectAllByOrderNo(request, paramMap);
|
||||
List<Map<String,Object>> list = salesNcollectMgmtService.getCollectAllByOrderNo(request, paramMap);
|
||||
request.setAttribute("LIST", list);
|
||||
|
||||
request.setAttribute("info", info);
|
||||
@@ -577,7 +681,7 @@ public class SalesNcollectMgmtController {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
System.out.println("ctr::paramMap##################### " + paramMap);
|
||||
try {
|
||||
resultMap.put("RESULT", salseNcollectMgmtService.saveCollectMgmt(request, paramMap));
|
||||
resultMap.put("RESULT", salesNcollectMgmtService.saveCollectMgmt(request, paramMap));
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -599,7 +703,7 @@ public class SalesNcollectMgmtController {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
resultMap.put("RESULT", salseNcollectMgmtService.deleteCollectMgmt(request, paramMap));
|
||||
resultMap.put("RESULT", salesNcollectMgmtService.deleteCollectMgmt(request, paramMap));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user