objidList = Arrays.asList(originalObjids.split(","));
+
Map partParam = new HashMap();
- partParam.put("OBJID", partObjid);
- Map partInfo = (Map)sqlSession.selectOne("salesMng.getSalesRequestPartInfo", partParam);
+ partParam.put("OBJID_LIST", objidList);
+ Map partInfo = (Map)sqlSession.selectOne("salesMng.getGroupedSalesRequestPartInfo", partParam);
if(partInfo != null) {
Map detailParam = new HashMap();
detailParam.put("OBJID", CommonUtils.createObjId());
detailParam.put("QUOTATION_REQUEST_MASTER_OBJID", quotationMasterObjid);
- detailParam.put("SALES_REQUEST_PART_OBJID", partObjid); // MBOM_DETAIL.OBJID
+ detailParam.put("SALES_REQUEST_PART_OBJID", partInfo.get("OBJID"));
detailParam.put("PART_OBJID", partInfo.get("PART_OBJID"));
- // 업체유형에 따라 다른 정보 저장 (단가는 0으로, 견적 수신 후 입력)
if("PROCESSING".equals(vendorType)) {
- // 가공업체: 품번, 품명, 제작수량
detailParam.put("PART_NO", partInfo.get("PART_NO"));
detailParam.put("PART_NAME", partInfo.get("PART_NAME"));
detailParam.put("RAW_MATERIAL", "");
detailParam.put("SIZE", "");
detailParam.put("QTY", partInfo.get("PRODUCTION_QTY"));
- } else {
- // 공급업체: 소재품번 유무에 따라 분기
- String rawMaterialNo = CommonUtils.checkNull(partInfo.get("RAW_MATERIAL_NO"));
-
- if(!rawMaterialNo.isEmpty()) {
- // 소재품번이 있는 경우: 소재품번, 소재재질, 규격, 발주수량
- detailParam.put("PART_NO", partInfo.get("RAW_MATERIAL_NO"));
- detailParam.put("PART_NAME", partInfo.get("RAW_MATERIAL"));
- detailParam.put("RAW_MATERIAL", partInfo.get("RAW_MATERIAL"));
- detailParam.put("SIZE", partInfo.get("SIZE"));
- detailParam.put("QTY", partInfo.get("PO_QTY"));
} else {
- // 소재품번이 없는 경우: 부품품번, 부품명, 제작수량
- detailParam.put("PART_NO", partInfo.get("PART_NO"));
- detailParam.put("PART_NAME", partInfo.get("PART_NAME"));
- detailParam.put("RAW_MATERIAL", "");
- detailParam.put("SIZE", "");
- detailParam.put("QTY", partInfo.get("PRODUCTION_QTY"));
+ String rawMaterialNo = CommonUtils.checkNull(partInfo.get("RAW_MATERIAL_NO"));
+
+ if(!rawMaterialNo.isEmpty()) {
+ detailParam.put("PART_NO", partInfo.get("RAW_MATERIAL_NO"));
+ detailParam.put("PART_NAME", partInfo.get("RAW_MATERIAL"));
+ detailParam.put("RAW_MATERIAL", partInfo.get("RAW_MATERIAL"));
+ detailParam.put("SIZE", partInfo.get("SIZE"));
+ detailParam.put("QTY", partInfo.get("PO_QTY"));
+ } else {
+ detailParam.put("PART_NO", partInfo.get("PART_NO"));
+ detailParam.put("PART_NAME", partInfo.get("PART_NAME"));
+ detailParam.put("RAW_MATERIAL", "");
+ detailParam.put("SIZE", "");
+ detailParam.put("QTY", partInfo.get("PRODUCTION_QTY"));
+ }
}
- }
- detailParam.put("UNIT_PRICE", 0); // 단가는 견적 수신 후 입력
+ detailParam.put("UNIT_PRICE", 0);
detailParam.put("REMARK", "");
sqlSession.insert("salesMng.insertQuotationRequestDetail", detailParam);
diff --git a/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java b/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java
index 895f547..7d5966e 100644
--- a/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java
+++ b/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java
@@ -29,6 +29,7 @@ import com.pms.common.SqlMapConfig;
import com.pms.common.bean.PersonBean;
import com.pms.common.utils.CommonUtils;
import com.pms.common.utils.Constants;
+import com.pms.api.SalesSlipApiClient;
/**
*
@@ -983,74 +984,341 @@ public Map saveSaleRegistration(HttpServletRequest request, Map<
* @param paramMap
* @return
*/
- public Map salesDeadlineConfirm(HttpServletRequest request,Map paramMap){
+ public Map salesDeadlineConfirm(HttpServletRequest request, Map paramMap) {
Map resultMap = new HashMap();
- SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
- try{
- System.out.println("===== 매출마감 처리 시작 =====");
- System.out.println("paramMap: " + paramMap);
-
+ SqlSession sqlSession = null;
+ try {
+ System.out.println("===== 매출마감 + 아마란스 전표연동 시작 =====");
+
String objIdListStr = CommonUtils.checkNull(paramMap.get("objIdList"));
String deadlineDate = CommonUtils.checkNull(paramMap.get("deadlineDate"));
-
- System.out.println("objIdListStr: " + objIdListStr);
- System.out.println("deadlineDate: " + deadlineDate);
-
- if(objIdListStr == null || objIdListStr.isEmpty()){
+
+ if (objIdListStr == null || objIdListStr.isEmpty()) {
resultMap.put("result", false);
resultMap.put("msg", "선택된 항목이 없습니다.");
- System.out.println("에러: 선택된 항목 없음");
return resultMap;
}
-
- if(deadlineDate == null || deadlineDate.isEmpty()){
+ if (deadlineDate == null || deadlineDate.isEmpty()) {
resultMap.put("result", false);
resultMap.put("msg", "매출마감일을 입력해주세요.");
- System.out.println("에러: 매출마감일 없음");
return resultMap;
}
-
+
String[] targetObjIdList = objIdListStr.split(",");
- System.out.println("targetObjIdList 길이: " + targetObjIdList.length);
-
- if(null != targetObjIdList && 0 < targetObjIdList.length){
- HttpSession session = request.getSession();
- sqlSession = SqlMapConfig.getInstance().getSqlSession();
- PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
-
- String userId = person.getUserId();
- System.out.println("userId: " + userId);
-
- for(int i=0; i> slipDataList = new ArrayList