발주기관 건설현장 삭제처리
parent
737d44674b
commit
7f0392f989
|
|
@ -455,4 +455,83 @@ public class DrillingInputController {
|
||||||
|
|
||||||
return jsonResult; // @ResponseBody이므로 반환 값은 필요 없습니다.
|
return jsonResult; // @ResponseBody이므로 반환 값은 필요 없습니다.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 발주기관 건설현장 삭제처리
|
||||||
|
* @param request
|
||||||
|
* @param strJSON
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/drilling/input/delete.do", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public JSONObject drillingInputDelete(HttpServletRequest request,@RequestParam HashMap<String,Object> params, HttpServletResponse response) {
|
||||||
|
|
||||||
|
JSONObject jSONOResponse = new JSONObject();
|
||||||
|
|
||||||
|
System.out.println(
|
||||||
|
"\n--------------------------------------------------------------\n" +
|
||||||
|
request.getRequestURI() + " IN:" +
|
||||||
|
"\n--------------------------------------------------------------\n" +
|
||||||
|
// "jstrJSON: \n" + strJSON + "\n" +
|
||||||
|
"params: \n" + params + "\n" +
|
||||||
|
"\n--------------------------------------------------------------\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
JSONParser jsonParser = new JSONParser();
|
||||||
|
JSONArray jsonArr = null;
|
||||||
|
boolean isFail = false;
|
||||||
|
String failMsg = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
// HashMap<String, Object> hashMap = drillingInputService.drillingInputDel(request, response, params);
|
||||||
|
drillingInputService.drillingInputDel(request, response, params);
|
||||||
|
int nRetCode = MyUtil.getIntegerFromObject(params.get("v_RetCode"));
|
||||||
|
String lpszRetMsg = MyUtil.getStringFromObject(params.get("v_RetMsg"));
|
||||||
|
|
||||||
|
if( nRetCode == 100 ) {
|
||||||
|
jSONOResponse.put("resultCode", nRetCode);
|
||||||
|
jSONOResponse.put("result", "true");
|
||||||
|
jSONOResponse.put("message", "삭제가 완료되었습니다.");
|
||||||
|
} else {
|
||||||
|
jSONOResponse.put("resultCode", nRetCode);
|
||||||
|
jSONOResponse.put("result", "false");
|
||||||
|
jSONOResponse.put("message", lpszRetMsg);
|
||||||
|
|
||||||
|
isFail = true;
|
||||||
|
failMsg = lpszRetMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
String strTxt =
|
||||||
|
"---------- BUG REPORTING START ----------" + "\n" +
|
||||||
|
"에러 문구:[" + request.getRequestURI() + " " + "]" + "\n" +
|
||||||
|
"params:[\n" + params + "\n]\n" +
|
||||||
|
"e.getMessage():[\n" + e.getMessage() + "\n]\n" + "\n" +
|
||||||
|
"new Date().toString():[" + new Date().toString() + "]\n" + "\n" +
|
||||||
|
"---------- BUG REPORTING END ----------" + "\n" +
|
||||||
|
"";
|
||||||
|
System.out.println(strTxt);
|
||||||
|
jSONOResponse.put("resultCode", -1);
|
||||||
|
jSONOResponse.put("result", "false");
|
||||||
|
jSONOResponse.put("message", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if( isFail ) {
|
||||||
|
jSONOResponse.put("resultCode", -2);
|
||||||
|
jSONOResponse.put("result", "false");
|
||||||
|
jSONOResponse.put("message", failMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("\n--------------------------------------------------------------\n" +
|
||||||
|
request.getRequestURI() + " OUT:" +
|
||||||
|
"\n--------------------------------------------------------------\n" +
|
||||||
|
"jSONOResponse.toJSONString():[" + jSONOResponse.toJSONString() + "]\n" +
|
||||||
|
"\n--------------------------------------------------------------\n");
|
||||||
|
|
||||||
|
return jSONOResponse;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||||
@Mapper("drillingInputMapper")
|
@Mapper("drillingInputMapper")
|
||||||
public interface DrillingInputMapper {
|
public interface DrillingInputMapper {
|
||||||
public HashMap<String, Object> spAddTblCsi(HashMap<String, Object> params) throws SQLException;
|
public HashMap<String, Object> spAddTblCsi(HashMap<String, Object> params) throws SQLException;
|
||||||
|
public HashMap<String, Object> spDelTblCsi(HashMap<String, Object> params) throws SQLException;
|
||||||
public String test(HashMap<String, Object> params) throws SQLException;
|
public String test(HashMap<String, Object> params) throws SQLException;
|
||||||
public Long findConstCompanyCodeByConstCompanyName(HashMap<String, Object> params) throws SQLException;
|
public Long findConstCompanyCodeByConstCompanyName(HashMap<String, Object> params) throws SQLException;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||||
public interface DrillingInputService {
|
public interface DrillingInputService {
|
||||||
HashMap<String, Object> getOrganizationUserGlGmGsGfCodes(String userId) throws Exception;
|
HashMap<String, Object> getOrganizationUserGlGmGsGfCodes(String userId) throws Exception;
|
||||||
HashMap<String, Object> drillingInputAdd(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception;
|
HashMap<String, Object> drillingInputAdd(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception;
|
||||||
|
HashMap<String, Object> drillingInputDel(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception;
|
||||||
List<EgovMap> selectConstructCompanyList(HashMap<String, Object> params) throws Exception;
|
List<EgovMap> selectConstructCompanyList(HashMap<String, Object> params) throws Exception;
|
||||||
Map<String, Object> selectConstructUserInfo(HashMap<String, Object> params) throws Exception;
|
Map<String, Object> selectConstructUserInfo(HashMap<String, Object> params) throws Exception;
|
||||||
void getDepartments(HttpServletRequest request, HashMap<String, Object> params, JSONObject jsonResponse) throws Exception;
|
void getDepartments(HttpServletRequest request, HashMap<String, Object> params, JSONObject jsonResponse) throws Exception;
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,31 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> drillingInputDel(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception {
|
||||||
|
params.put("CID", params.get("cid"));
|
||||||
|
|
||||||
|
JSONObject tempConstructSiteInfo = drillingInquiryService.drillingInquiryOneItem(request, params);
|
||||||
|
// JSONObject를 HashMap으로 변환
|
||||||
|
ArrayList<EgovMap> arrayList = (ArrayList<EgovMap>) MyUtil.JSONObjectToHashMap( tempConstructSiteInfo ).get("datas");
|
||||||
|
HashMap<String, Object> oldTempConstructSiteInfo = new HashMap<String, Object>(arrayList.get(0));
|
||||||
|
|
||||||
|
// 기업사용자 입력 진행 여부: !NULL -> 입력 전, NULL -> 입력 중(삭제불가)
|
||||||
|
EgovMap constCompanyProjectWriting = drillingInputMapper.selectConstructCompanyProjectWriting(oldTempConstructSiteInfo);
|
||||||
|
if (!"0".equals(oldTempConstructSiteInfo.get("projectStateCode")) && constCompanyProjectWriting == null) { // 5-1)
|
||||||
|
params.put("v_RetCode", 11);
|
||||||
|
params.put("v_RetMsg", "해당 프로젝트는 기업 사용자가 입력을 시작하였으므로 삭제가 불가합니다.");
|
||||||
|
return params;
|
||||||
|
} else { // 5-2)
|
||||||
|
deleteTempMetaInfo(oldTempConstructSiteInfo);
|
||||||
|
deleteTempProjectInfo(oldTempConstructSiteInfo);
|
||||||
|
oldTempConstructSiteInfo.put("PROJECT_STATE_CODE", "0");
|
||||||
|
updateTempConstructSiteInfoSetPROJECT_CODE_NULL(oldTempConstructSiteInfo);
|
||||||
|
params = drillingInputMapper.spDelTblCsi(params);
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EgovMap> selectConstructCompanyList(HashMap<String, Object> params) throws Exception {
|
public List<EgovMap> selectConstructCompanyList(HashMap<String, Object> params) throws Exception {
|
||||||
List<EgovMap> list = new ArrayList<EgovMap>();
|
List<EgovMap> list = new ArrayList<EgovMap>();
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,14 @@
|
||||||
#{v_RetMsg, mode=OUT, jdbcType=VARCHAR}
|
#{v_RetMsg, mode=OUT, jdbcType=VARCHAR}
|
||||||
) }
|
) }
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="spDelTblCsi" parameterType="map" statementType="CALLABLE" resultMap="spAddTblCsiResult">
|
||||||
|
{ CALL SP_DEL_TBL_CSI(
|
||||||
|
#{cid},
|
||||||
|
#{v_RetCode, mode=OUT, jdbcType=INTEGER},
|
||||||
|
#{v_RetMsg, mode=OUT, jdbcType=VARCHAR}
|
||||||
|
) }
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="test" parameterType="map" resultType="string">
|
<select id="test" parameterType="map" resultType="string">
|
||||||
SELECT 'Hello, ' || 'World!' AS Greeting FROM DUAL
|
SELECT 'Hello, ' || 'World!' AS Greeting FROM DUAL
|
||||||
|
|
@ -229,6 +237,9 @@
|
||||||
,CONST_COMPANY_ADMIN = NULL
|
,CONST_COMPANY_ADMIN = NULL
|
||||||
,CONST_COMPANY_TEL = NULL
|
,CONST_COMPANY_TEL = NULL
|
||||||
,CONST_USERID = NULL
|
,CONST_USERID = NULL
|
||||||
|
<if test='PROJECT_STATE_CODE != null and PROJECT_STATE_CODE !=""'>
|
||||||
|
,PROJECT_STATE_CODE = '0'
|
||||||
|
</if>
|
||||||
WHERE PROJECT_CODE = #{projectCode}
|
WHERE PROJECT_CODE = #{projectCode}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -484,29 +484,6 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
||||||
if (!confirm("건설사에서 입력중인 경우 입력내용이 삭제됩니다. 건설사를 미지정하시겠습니까?")) {
|
if (!confirm("건설사에서 입력중인 경우 입력내용이 삭제됩니다. 건설사를 미지정하시겠습니까?")) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// $.ajax({
|
|
||||||
// type: 'POST',
|
|
||||||
// url: '/drilling/input/uncheckConstCompany.do',
|
|
||||||
// dataType: 'json',
|
|
||||||
// data: {
|
|
||||||
// projectCode: orgPrjCd,
|
|
||||||
// encUserId: orgConstUsr
|
|
||||||
// },
|
|
||||||
// success: function (json) {
|
|
||||||
// if(json.result == "SUCCESS") {
|
|
||||||
// alert(json.message);
|
|
||||||
// orgConstUsr = "";
|
|
||||||
// document.getElementById('const-user-id-1').value = ''
|
|
||||||
// } else { //json.result == "FAIL"
|
|
||||||
// alert(json.message);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }, error: function(res) {
|
|
||||||
// alert(res);
|
|
||||||
// console.log(res);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
document.getElementById('const-user-id-1').value = ''
|
document.getElementById('const-user-id-1').value = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -535,6 +512,31 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 건설현장 삭제처리
|
||||||
|
*/
|
||||||
|
document.getElementById('btn-delete').addEventListener('click', function() {
|
||||||
|
if (!confirm("건설현장 정보를 삭제하시겠습니까?")) return;
|
||||||
|
const cid = getQueryString('CID');
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: '/drilling/input/delete.do',
|
||||||
|
data: {
|
||||||
|
cid: cid
|
||||||
|
},
|
||||||
|
success: function (json) {
|
||||||
|
console.log(json)
|
||||||
|
var result = json;
|
||||||
|
if (result.resultCode == 100) {
|
||||||
|
alert(result.message);
|
||||||
|
window.location.href='/drilling/inquiry.do';
|
||||||
|
} else {
|
||||||
|
alert(result.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
// 사업 등록 처리
|
// 사업 등록 처리
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue