auto commit
This commit is contained in:
@@ -292,13 +292,14 @@ public class SalesNcollectMgmtController {
|
||||
System.out.println("salesCurrency: " + paramMap.get("salesCurrency"));
|
||||
System.out.println("salesExchangeRate: " + paramMap.get("salesExchangeRate"));
|
||||
|
||||
saleInfo = salesNcollectMgmtService.getSaleInfo(paramMap);
|
||||
salesCurrency = CommonUtils.nullToEmpty((String)saleInfo.get("SALES_CURRENCY"));
|
||||
|
||||
System.out.println("=== DB에서 조회한 saleInfo ===");
|
||||
System.out.println("SALES_QUANTITY: " + saleInfo.get("SALES_QUANTITY"));
|
||||
System.out.println("SALES_UNIT_PRICE: " + saleInfo.get("SALES_UNIT_PRICE"));
|
||||
System.out.println("SALES_SUPPLY_PRICE: " + saleInfo.get("SALES_SUPPLY_PRICE"));
|
||||
saleInfo = salesNcollectMgmtService.getSaleInfo(paramMap);
|
||||
salesCurrency = CommonUtils.nullToEmpty((String)saleInfo.get("SALES_CURRENCY"));
|
||||
|
||||
System.out.println("=== DB에서 조회한 saleInfo ===");
|
||||
System.out.println("ORDER_QUANTITY: " + saleInfo.get("ORDER_QUANTITY"));
|
||||
System.out.println("SALES_QUANTITY: " + saleInfo.get("SALES_QUANTITY"));
|
||||
System.out.println("SALES_UNIT_PRICE: " + saleInfo.get("SALES_UNIT_PRICE"));
|
||||
System.out.println("SALES_SUPPLY_PRICE: " + saleInfo.get("SALES_SUPPLY_PRICE"));
|
||||
|
||||
// URL 파라미터로 그리드 데이터가 전달된 경우 우선 사용
|
||||
if(paramMap.get("salesQuantity") != null && !paramMap.get("salesQuantity").equals("")) {
|
||||
@@ -359,10 +360,13 @@ public class SalesNcollectMgmtController {
|
||||
int totalSoldQuantity = 0;
|
||||
try {
|
||||
Map<String, Object> totalResult = salesNcollectMgmtService.getTotalSalesQuantity(paramMap);
|
||||
System.out.println("getTotalSalesQuantity 결과: " + totalResult);
|
||||
if(totalResult != null && totalResult.get("total") != null) {
|
||||
System.out.println("total 값: " + totalResult.get("total"));
|
||||
totalSoldQuantity = Integer.parseInt(String.valueOf(totalResult.get("total")).split("\\.")[0]);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
System.out.println("getTotalSalesQuantity 에러 발생!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -1490,6 +1490,11 @@ ORDER BY T.REGDATE DESC, T.PROJECT_NO DESC
|
||||
-- 판매 관련 필드들 (sales_registration 테이블에서 가져오기)
|
||||
SR.sale_no AS SALE_NO,
|
||||
COALESCE(SR.shipping_order_status, '') AS SHIPPING_ORDER_STATUS,
|
||||
|
||||
-- 주문수량 (PROJECT_MGMT에서 가져오기) - 잔량 계산용
|
||||
COALESCE(T.QUANTITY::NUMERIC, 0) AS ORDER_QUANTITY,
|
||||
|
||||
-- 판매수량 (sales_registration에서 가져오기) - 이미 판매한 수량
|
||||
COALESCE(SR.sales_quantity, 0) AS SALES_QUANTITY,
|
||||
COALESCE(SR.sales_unit_price, 0) AS SALES_UNIT_PRICE,
|
||||
COALESCE(SR.sales_supply_price, 0) AS SALES_SUPPLY_PRICE,
|
||||
@@ -1625,7 +1630,7 @@ ORDER BY T.REGDATE DESC, T.PROJECT_NO DESC
|
||||
<!-- 모든 분할 출하의 총 판매 수량 조회 -->
|
||||
<select id="getTotalSalesQuantity" parameterType="map" resultType="map">
|
||||
/* salesNcollectMgmt.getTotalSalesQuantity - project_no로 시작하는 모든 레코드의 판매 수량 합계 */
|
||||
SELECT COALESCE(SUM(sales_quantity), 0) as total
|
||||
SELECT COALESCE(SUM(NULLIF(sales_quantity, '')::NUMERIC), 0) as total
|
||||
FROM sales_registration
|
||||
WHERE project_no LIKE #{orderNo} || '%'
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user