품질관리_고객CS관리
This commit is contained in:
@@ -956,6 +956,86 @@ public class QualityService extends BaseService{
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 고객 불량 저장
|
||||
*/
|
||||
public Map saveCustomerCsDefect(HttpServletRequest request, Map paramMap){
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try{
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
|
||||
PersonBean person = (PersonBean) request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||||
String writer = person != null ? person.getUserId() : "";
|
||||
|
||||
String objId = CommonUtils.checkNull(paramMap.get("OBJID"));
|
||||
String isNew = CommonUtils.checkNull(paramMap.get("IS_NEW"));
|
||||
paramMap.put("WRITER", writer);
|
||||
|
||||
// IS_NEW 플래그로 신규/수정 구분 (JSP에서 전달)
|
||||
if("true".equals(isNew)){
|
||||
// 신규 등록
|
||||
if(objId.isEmpty()){
|
||||
objId = CommonUtils.checkNull(CommonUtils.createObjId());
|
||||
paramMap.put("OBJID", objId);
|
||||
}
|
||||
|
||||
// 접수번호 생성 (CS-YYYYMMDD-SEQ)
|
||||
String today = new java.text.SimpleDateFormat("yyyyMMdd").format(new java.util.Date());
|
||||
String receiptNo = "CS-" + today + "-" + String.format("%03d", sqlSession.selectOne("quality.getCustomerCsSeq"));
|
||||
paramMap.put("RECEIPT_NO", receiptNo);
|
||||
|
||||
sqlSession.insert("quality.insertCustomerCs", paramMap);
|
||||
} else {
|
||||
// 수정
|
||||
sqlSession.update("quality.updateCustomerCs", paramMap);
|
||||
}
|
||||
|
||||
resultMap.put("RESULT", "SUCCESS");
|
||||
resultMap.put("OBJID", objId);
|
||||
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
resultMap.put("RESULT", "FAIL");
|
||||
resultMap.put("MESSAGE", e.getMessage());
|
||||
}finally{
|
||||
if(sqlSession != null) sqlSession.close();
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 조치결과 저장
|
||||
*/
|
||||
public Map saveCustomerCsAction(HttpServletRequest request, Map paramMap){
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try{
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
|
||||
PersonBean person = (PersonBean) request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||||
String actionUserId = person != null ? person.getUserId() : "";
|
||||
|
||||
paramMap.put("ACTION_USER_ID", actionUserId);
|
||||
|
||||
sqlSession.update("quality.updateCustomerCsAction", paramMap);
|
||||
|
||||
resultMap.put("RESULT", "SUCCESS");
|
||||
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
resultMap.put("RESULT", "FAIL");
|
||||
resultMap.put("MESSAGE", e.getMessage());
|
||||
}finally{
|
||||
if(sqlSession != null) sqlSession.close();
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
// =====================================================
|
||||
// ECR 관리
|
||||
// =====================================================
|
||||
|
||||
Reference in New Issue
Block a user