Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
@@ -29,6 +29,7 @@ import com.pms.common.utils.CommonUtils;
|
||||
import com.pms.salesmgmt.service.ContractMgmtService;
|
||||
import com.pms.salesmgmt.service.SalesMgmtCommonService;
|
||||
import com.pms.salesmgmt.service.SalesNcollectMgmtService;
|
||||
import com.pms.service.CommonService;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@@ -63,6 +64,117 @@ public class SalesNcollectMgmtController {
|
||||
@Autowired
|
||||
private SalesMgmtCommonService salesMgmtCommonService;
|
||||
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 매출관리 메인 페이지 (메뉴 진입점)
|
||||
* </pre>
|
||||
* @param request
|
||||
* @param paramMap - 검색 정보
|
||||
* @return String
|
||||
*
|
||||
* <pre>
|
||||
* << 개정 이력 >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------------- --------------------- ----------------------------------------------------------
|
||||
* 2025.10.15 수정 메뉴 URL 매핑 추가
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@RequestMapping(value = "/salesMgmt/salesMgmtList.do", method = RequestMethod.GET)
|
||||
public String salesMgmtList(HttpServletRequest request
|
||||
, @RequestParam Map<String, Object> paramMap) {
|
||||
// /salesNcollectMgmt/contractList.do로 리다이렉트
|
||||
return salesContractList(request, paramMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 매출관리 목록 페이지
|
||||
* </pre>
|
||||
* @param request
|
||||
* @param paramMap - 검색 정보
|
||||
* @return String
|
||||
*/
|
||||
@RequestMapping(value = "/contractMgmt/salesMgmtList.do", method = RequestMethod.GET)
|
||||
public String showSalesMgmtList(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
try {
|
||||
// 코드정보
|
||||
Map<String, Object> codeMap = new HashMap<String, Object>();
|
||||
|
||||
// 주문유형
|
||||
codeMap.put("orderTypeList",
|
||||
salesMgmtCommonService.bizMakeOptionList("GE", "", "salesMgmtCommon.getCodeList"));
|
||||
// 제품구분
|
||||
codeMap.put("productTypeList",
|
||||
salesMgmtCommonService.bizMakeOptionList("", "", "salesMgmtCommon.getGoodsList"));
|
||||
// 국내/해외
|
||||
codeMap.put("nationList",
|
||||
salesMgmtCommonService.bizMakeOptionList("AR", "", "salesMgmtCommon.getCodeList"));
|
||||
/*
|
||||
// 유/무상
|
||||
codeMap.put("paymentTypeList",
|
||||
salesMgmtCommonService.bizMakeOptionList("0000156", "", "salesMgmtCommon.getCodeList"));
|
||||
*/
|
||||
// 수주상태
|
||||
codeMap.put("orderStatusList",
|
||||
commonService.bizMakeOptionList("0000932", "", "common.getCodeselect"));
|
||||
// 출하대기 상태
|
||||
codeMap.put("shippingStatusList",
|
||||
salesMgmtCommonService.bizMakeOptionList("SH", "", "salesMgmtCommon.getCodeList"));
|
||||
/*
|
||||
// 출고방법
|
||||
codeMap.put("shippingMethodList",
|
||||
salesMgmtCommonService.bizMakeOptionList("SM", "", "salesMgmtCommon.getCodeList"));
|
||||
*/
|
||||
// 담당자
|
||||
codeMap.put("managerList",
|
||||
salesMgmtCommonService.bizMakeOptionList("", "", "salesMgmtCommon.getSalesmanList"));
|
||||
/*
|
||||
// 인도조건
|
||||
codeMap.put("incotermsList",
|
||||
salesMgmtCommonService.bizMakeOptionList("IT", "", "salesMgmtCommon.getCodeList"));
|
||||
*/
|
||||
|
||||
request.setAttribute("codeMap", codeMap);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/salesmgmt/salesMgmt/salesMgmtList";
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 매출관리 그리드 데이터 조회 (Tabulator용)
|
||||
* </pre>
|
||||
* @param request
|
||||
* @param paramMap - 검색 정보
|
||||
* @return Map
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/salesMgmt/salesMgmtGridList.do", method = RequestMethod.POST)
|
||||
public Map<String, Object> salesMgmtGridList(HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
List<Map<String, Object>> list = salseNcollectMgmtService.getSalesMgmtGridList(request, paramMap);
|
||||
int totalCount = salseNcollectMgmtService.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;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 계약관리 목록 조회
|
||||
|
||||
@@ -812,5 +812,188 @@
|
||||
,editEmpNo = #{cretEmpNo} /* 수정자 */
|
||||
</update>
|
||||
|
||||
<!-- 매출관리 그리드 목록 -->
|
||||
<select id="getSalesMgmtGridList" parameterType="map" resultType="map">
|
||||
/* salesNcollectMgmt.getSalesMgmtGridList */
|
||||
SELECT
|
||||
B.OrderNo AS PROJECT_NO, /* 프로젝트번호를 계약번호로 우선 사용 */
|
||||
(SELECT CdNm FROM SWSA050A_TBL WHERE MajorCd = 'GE' AND MinorCd = B.SaleType) AS ORDER_TYPE,
|
||||
CASE WHEN C.c_class IS NOT NULL THEN
|
||||
CONCAT(
|
||||
(SELECT ltrim(rtrim(DTL_NM)) from SWSA999A_TBL where COMM_CD = 'S110' AND SUBSTRING(DTL_CD,1,1) = SUBSTRING(C.c_class,1,1)),
|
||||
'-',
|
||||
(SELECT ltrim(rtrim(DTL_NM)) from SWSA999A_TBL where COMM_CD = 'S120' AND SUBSTRING(DTL_CD,1,3) = SUBSTRING(C.c_class,1,3)),
|
||||
'-',
|
||||
(SELECT ltrim(rtrim(DTL_NM)) from SWSA999A_TBL where COMM_CD = 'S130' AND DTL_CD = C.c_class )
|
||||
)
|
||||
ELSE '' END AS PRODUCT_TYPE,
|
||||
(SELECT CdNm FROM SWSA050A_TBL WHERE MAjorCd = 'NA' AND MinorCd = B.nationGB) AS NATION,
|
||||
COALESCE(A.WrtYmd, B.OrderDate) AS RECEIPT_DATE,
|
||||
D.custNm AS CUSTOMER,
|
||||
(CASE B.freeyn WHEN 'Y' THEN '무상' ELSE '유상' END) AS PAYMENT_TYPE,
|
||||
C.GoodsCd AS PRODUCT_NO,
|
||||
C.GoodsNm AS PRODUCT_NAME,
|
||||
A.serialno AS SERIAL_NO,
|
||||
COALESCE(A.SupplyQty, B.goodsqty) AS QUANTITY,
|
||||
B.custreq AS REQUEST_DATE,
|
||||
COALESCE(A.Remark, B.bigo) AS CUSTOMER_REQUEST,
|
||||
(SELECT CdNm FROM SWSA050A_TBL WHERE MajorCd = 'SS' AND MinorCd = B.endsale) AS ORDER_STATUS,
|
||||
B.OrderNo AS PO_NO,
|
||||
B.OrderDate AS ORDER_DATE,
|
||||
B.orderattachpath AS ORDER_ATTACH,
|
||||
COALESCE(A.SupplyPrice, B.saleprice) AS UNIT_PRICE,
|
||||
COALESCE(A.SupplyAmt, B.saleamt) AS SUPPLY_PRICE,
|
||||
COALESCE(A.SupplyVat, B.vatamt) AS VAT,
|
||||
COALESCE((A.SupplyAmt + A.SupplyVat), (B.saleamt + B.vatamt)) AS TOTAL_AMOUNT,
|
||||
COALESCE(A.NoWonSymbol, B.nowonsymbol) AS CURRENCY,
|
||||
COALESCE(A.NoWonExChange, B.nowonexchange) AS EXCHANGE_RATE,
|
||||
B.shippingstatus AS SHIPPING_STATUS,
|
||||
B.shippingdate AS SHIPPING_DATE,
|
||||
B.shippingmethod AS SHIPPING_METHOD,
|
||||
(SELECT user_name FROM USER_INFO WHERE user_id = D.SalesMan) AS MANAGER,
|
||||
B.saleQty AS SALES_QUANTITY,
|
||||
(SELECT CdNm FROM SWSA050A_TBL WHERE MajorCd = 'IT' AND MinorCd = B.incoterms) AS INCOTERMS,
|
||||
B.salesstatus AS SALES_STATUS
|
||||
FROM SWSC110A_TBL B
|
||||
LEFT JOIN SWSD010A_TBL A ON A.orderNo = B.orderNo
|
||||
INNER JOIN SWSB110A_TBL C ON B.goodsCd = C.goodsCd
|
||||
INNER JOIN SWSB210A_TBL D ON B.custCd = D.custCd
|
||||
WHERE 1 = 1
|
||||
<if test="orderType != null and orderType != ''">
|
||||
AND B.SaleType = #{orderType}
|
||||
</if>
|
||||
<if test="productType != null and productType != ''">
|
||||
AND C.c_class = #{productType}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
AND B.nationGB = #{nation}
|
||||
</if>
|
||||
<if test="customer != null and customer != ''">
|
||||
AND D.custNm LIKE CONCAT('%', #{customer}, '%')
|
||||
</if>
|
||||
<if test="paymentType != null and paymentType != ''">
|
||||
AND B.freeyn = #{paymentType}
|
||||
</if>
|
||||
<if test="productNo != null and productNo != ''">
|
||||
AND C.GoodsCd LIKE CONCAT('%', #{productNo}, '%')
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
AND C.GoodsNm LIKE CONCAT('%', #{productName}, '%')
|
||||
</if>
|
||||
<if test="serialNo != null and serialNo != ''">
|
||||
AND A.serialno LIKE CONCAT('%', #{serialNo}, '%')
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">
|
||||
AND B.endsale = #{orderStatus}
|
||||
</if>
|
||||
<if test="poNo != null and poNo != ''">
|
||||
AND B.OrderNo LIKE CONCAT('%', #{poNo}, '%')
|
||||
</if>
|
||||
<if test="requestDateFrom != null and requestDateFrom != ''">
|
||||
AND B.custreq <![CDATA[>=]]> #{requestDateFrom}
|
||||
</if>
|
||||
<if test="requestDateTo != null and requestDateTo != ''">
|
||||
AND B.custreq <![CDATA[<=]]> #{requestDateTo}
|
||||
</if>
|
||||
<if test="orderDateFrom != null and orderDateFrom != ''">
|
||||
AND B.OrderDate <![CDATA[>=]]> #{orderDateFrom}
|
||||
</if>
|
||||
<if test="orderDateTo != null and orderDateTo != ''">
|
||||
AND B.OrderDate <![CDATA[<=]]> #{orderDateTo}
|
||||
</if>
|
||||
<if test="shippingStatus != null and shippingStatus != ''">
|
||||
AND B.shippingstatus = #{shippingStatus}
|
||||
</if>
|
||||
<if test="shippingDateFrom != null and shippingDateFrom != ''">
|
||||
AND B.shippingdate <![CDATA[>=]]> #{shippingDateFrom}
|
||||
</if>
|
||||
<if test="shippingDateTo != null and shippingDateTo != ''">
|
||||
AND B.shippingdate <![CDATA[<=]]> #{shippingDateTo}
|
||||
</if>
|
||||
<if test="shippingMethod != null and shippingMethod != ''">
|
||||
AND B.outGb = #{shippingMethod}
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
AND B.bEmpNo = #{manager}
|
||||
</if>
|
||||
<if test="incoterms != null and incoterms != ''">
|
||||
AND B.incoterms = #{incoterms}
|
||||
</if>
|
||||
ORDER BY B.CRET_DATE DESC
|
||||
LIMIT #{COUNT_PER_PAGE} OFFSET #{PAGE_START}
|
||||
</select>
|
||||
|
||||
<!-- 매출관리 그리드 목록 개수 -->
|
||||
<select id="getSalesMgmtGridListCount" parameterType="map" resultType="int">
|
||||
/* salesNcollectMgmt.getSalesMgmtGridListCount */
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM SWSC110A_TBL B
|
||||
LEFT JOIN SWSD010A_TBL A ON A.orderNo = B.orderNo
|
||||
INNER JOIN SWSB110A_TBL C ON B.goodsCd = C.goodsCd
|
||||
INNER JOIN SWSB210A_TBL D ON B.custCd = D.custCd
|
||||
WHERE 1 = 1
|
||||
<if test="orderType != null and orderType != ''">
|
||||
AND B.SaleType = #{orderType}
|
||||
</if>
|
||||
<if test="productType != null and productType != ''">
|
||||
AND C.c_class = #{productType}
|
||||
</if>
|
||||
<if test="nation != null and nation != ''">
|
||||
AND B.nationGB = #{nation}
|
||||
</if>
|
||||
<if test="customer != null and customer != ''">
|
||||
AND D.custNm LIKE CONCAT('%', #{customer}, '%')
|
||||
</if>
|
||||
<if test="paymentType != null and paymentType != ''">
|
||||
AND B.freeyn = #{paymentType}
|
||||
</if>
|
||||
<if test="productNo != null and productNo != ''">
|
||||
AND C.GoodsCd LIKE CONCAT('%', #{productNo}, '%')
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
AND C.GoodsNm LIKE CONCAT('%', #{productName}, '%')
|
||||
</if>
|
||||
<if test="serialNo != null and serialNo != ''">
|
||||
AND A.serialno LIKE CONCAT('%', #{serialNo}, '%')
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">
|
||||
AND B.endsale = #{orderStatus}
|
||||
</if>
|
||||
<if test="poNo != null and poNo != ''">
|
||||
AND B.OrderNo LIKE CONCAT('%', #{poNo}, '%')
|
||||
</if>
|
||||
<if test="requestDateFrom != null and requestDateFrom != ''">
|
||||
AND B.custreq <![CDATA[>=]]> #{requestDateFrom}
|
||||
</if>
|
||||
<if test="requestDateTo != null and requestDateTo != ''">
|
||||
AND B.custreq <![CDATA[<=]]> #{requestDateTo}
|
||||
</if>
|
||||
<if test="orderDateFrom != null and orderDateFrom != ''">
|
||||
AND B.OrderDate <![CDATA[>=]]> #{orderDateFrom}
|
||||
</if>
|
||||
<if test="orderDateTo != null and orderDateTo != ''">
|
||||
AND B.OrderDate <![CDATA[<=]]> #{orderDateTo}
|
||||
</if>
|
||||
<if test="shippingStatus != null and shippingStatus != ''">
|
||||
AND B.shippingstatus = #{shippingStatus}
|
||||
</if>
|
||||
<if test="shippingDateFrom != null and shippingDateFrom != ''">
|
||||
AND B.shippingdate <![CDATA[>=]]> #{shippingDateFrom}
|
||||
</if>
|
||||
<if test="shippingDateTo != null and shippingDateTo != ''">
|
||||
AND B.shippingdate <![CDATA[<=]]> #{shippingDateTo}
|
||||
</if>
|
||||
<if test="shippingMethod != null and shippingMethod != ''">
|
||||
AND B.outGb = #{shippingMethod}
|
||||
</if>
|
||||
<if test="manager != null and manager != ''">
|
||||
AND B.bEmpNo = #{manager}
|
||||
</if>
|
||||
<if test="incoterms != null and incoterms != ''">
|
||||
AND B.incoterms = #{incoterms}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@@ -129,6 +129,70 @@ public class SalesNcollectMgmtService {
|
||||
return CommonUtils.toUpperCaseMapKey(resultMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 매출 목록 조회 (Tabulator Grid)
|
||||
* </pre>
|
||||
* @param request
|
||||
* @param paramMap - 매출관리 검색 정보
|
||||
* @return List<Map<String,Object>>
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public List<Map<String,Object>> getSalesMgmtGridList(HttpServletRequest request
|
||||
, Map<String, Object> paramMap) {
|
||||
|
||||
List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
|
||||
// Tabulator는 page, size 파라미터를 사용
|
||||
String page = CommonUtils.checkNull(request.getParameter("page"), "1");
|
||||
String size = CommonUtils.checkNull(request.getParameter("size"), Constants.ADMIN_COUNT_PER_PAGE+"");
|
||||
int pageNum = Integer.parseInt(page);
|
||||
int sizeNum = Integer.parseInt(size);
|
||||
|
||||
paramMap.put("PAGE_START", (pageNum - 1) * sizeNum);
|
||||
paramMap.put("COUNT_PER_PAGE", sizeNum);
|
||||
|
||||
resultList = (ArrayList) sqlSession.selectList("salesNcollectMgmt.getSalesMgmtGridList", paramMap);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(sqlSession != null) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return CommonUtils.toUpperCaseMapKey(resultList);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 매출 목록 카운트 조회 (Tabulator Grid)
|
||||
* </pre>
|
||||
* @param paramMap
|
||||
* @return int
|
||||
*/
|
||||
public int getSalesMgmtGridListCount(Map<String, Object> paramMap) {
|
||||
int totalCount = 0;
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
totalCount = sqlSession.selectOne("salesNcollectMgmt.getSalesMgmtGridListCount", paramMap);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(sqlSession != null) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 매출관리 등록
|
||||
|
||||
Reference in New Issue
Block a user