Merge branch 'main' of http://10.dbnt.co.kr:50501/DBNT/geoinfo_eGov_work
commit
c5a8096ee0
|
|
@ -189,7 +189,10 @@ public class DrillingInputController {
|
|||
jsonObject.put("result", new JSONObject().put("list", jsonListObject));
|
||||
} else {
|
||||
JSONObject result = new JSONObject();
|
||||
long start = System.currentTimeMillis();
|
||||
result.put("list", drillingInputService.selectConstructCompanyList(params));
|
||||
long end = System.currentTimeMillis();
|
||||
LOGGER.info("(CONTROLLER) selectConstructCompanyList 실행시간: {} ms", (end - start));
|
||||
|
||||
jsonObject.put("resultMessage", "OK");
|
||||
jsonObject.put("resultCode", 200);
|
||||
|
|
@ -214,7 +217,7 @@ public class DrillingInputController {
|
|||
JSONObject jsonObject = new JSONObject();
|
||||
strUtil sUtil = new strUtil();
|
||||
|
||||
String userid = sUtil.checkNull((String)params.get("encUserid"));
|
||||
String userid = sUtil.checkNull((String)params.get("userid"));
|
||||
|
||||
JSONArray jsonListObject = new JSONArray();
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -17,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import geoinfo.com.CryptoUtil;
|
||||
import geoinfo.drilling.input.DrillingInputController;
|
||||
import geoinfo.drilling.input.service.DrillingInputMapper;
|
||||
import geoinfo.drilling.input.service.DrillingInputService;
|
||||
import geoinfo.drilling.inquiry.service.DrillingInquiryService;
|
||||
|
|
@ -29,6 +31,7 @@ import ictway.comm.util.strUtil;
|
|||
|
||||
@Service("drillingInputService")
|
||||
public class DrillingInputServiceImpl implements DrillingInputService {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DrillingInputServiceImpl.class);
|
||||
|
||||
@Resource(name="drillingInputMapper")
|
||||
private DrillingInputMapper drillingInputMapper;
|
||||
|
|
@ -79,6 +82,7 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
public HashMap<String, Object> drillingInputAdd(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception {
|
||||
|
||||
String userId = (String)request.getSession().getAttribute("USERID");
|
||||
String addConstUserid = MyUtil.getStringFromObject( params.get("constUserid") );
|
||||
|
||||
HashMap<String, Object> spGetMasterCompanyDistrictParams = getOrganizationUserGlGmGsGfCodes(userId);
|
||||
|
||||
|
|
@ -89,12 +93,6 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
params.put("masterCompanyThCode", MyUtil.getStringFromObject( spGetMasterCompanyDistrictParams.get("v_gs") ));
|
||||
params.put("masterCompanyName", MyUtil.getStringFromObject( spGetMasterCompanyDistrictParams.get("v_gf") ));
|
||||
|
||||
// 건설사 계정 연결(암호화된 userid 복호화)
|
||||
String encryptId = MyUtil.getStringFromObject( params.get("encUserid") );
|
||||
String decryptId = CryptoUtil.decryptQuickAES(encryptId);
|
||||
|
||||
params.put("constUserid", decryptId);
|
||||
|
||||
|
||||
try {
|
||||
Long constCompanyCode = drillingInputMapper.findConstCompanyCodeByConstCompanyName(params);
|
||||
|
|
@ -106,9 +104,8 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
* @constUserId 복호화된 기업 사용자 아이디
|
||||
* @holeNumber 시추공 수(기업사용자 프로젝트 등록시 필수입력값으로, 신규생성임을 표시하기 위해 -999 입력)
|
||||
*/
|
||||
if (!"".equals(encryptId)) {
|
||||
String constUserId = decryptId;
|
||||
params.put("constUserId", constUserId);
|
||||
if (!"".equals(addConstUserid)) {
|
||||
params.put("constUserId", addConstUserid);
|
||||
params.put("holeNumber", -999);
|
||||
saveAndInsertMeta(params, request, response);
|
||||
}
|
||||
|
|
@ -146,26 +143,11 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
|
||||
@Override
|
||||
public List<EgovMap> selectConstructCompanyList(HashMap<String, Object> params) throws Exception {
|
||||
long start = System.currentTimeMillis();
|
||||
List<EgovMap> list = new ArrayList<EgovMap>();
|
||||
list = drillingInputMapper.selectConstructCompanyList(params);
|
||||
|
||||
for (EgovMap map : list) {
|
||||
|
||||
String userid = (String) map.get("userid");
|
||||
if (userid == null) continue;
|
||||
|
||||
// 암호화
|
||||
// String encryptId = CryptoUtil.encryptAES256(userid, secret_key);
|
||||
String encryptId = CryptoUtil.encryptQuickAES(userid);
|
||||
// userid 제거
|
||||
map.remove("userid");
|
||||
|
||||
// 복호화 (검증 or 필요 시)
|
||||
// String decryptId = CryptoUtil.decryptAES256(encryptId, secret_key);
|
||||
|
||||
map.put("encryptId", encryptId);
|
||||
// map.put("decryptId", decryptId);
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
LOGGER.info("( SERVICE ) selectConstructCompanyList 실행시간: {} ms", (end - start));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
@ -173,10 +155,6 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
@Override
|
||||
public Map<String, Object> selectConstructUserInfo(HashMap<String, Object> params) throws Exception {
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
// 건설사 계정 연결(암호화된 userid 복호화)
|
||||
String encryptId = MyUtil.getStringFromObject( params.get("encUserid") );
|
||||
String decryptId = CryptoUtil.decryptQuickAES(encryptId);
|
||||
params.put("userid", decryptId);
|
||||
|
||||
Map<String, Object> infoData = loginMapper.selectWebMemberIn(params);
|
||||
|
||||
|
|
@ -360,10 +338,8 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
findConstCompanyCodeByConstCompanyNameParams.put("masterCompanyName", MyUtil.getStringFromObject( findConstCompanyCodeByConstCompanyNameParams.get("v_gf") ));
|
||||
|
||||
// 건설사 계정 연결(암호화된 userid 복호화)
|
||||
String encryptId = MyUtil.getStringFromObject( params.get("encUserid") );
|
||||
String decryptId = CryptoUtil.decryptQuickAES(encryptId);
|
||||
|
||||
params.put("constUserid", decryptId);
|
||||
String addConstUserid = MyUtil.getStringFromObject( params.get("constUserid") );
|
||||
params.put("constUserid", addConstUserid);
|
||||
|
||||
try {
|
||||
|
||||
|
|
@ -411,7 +387,7 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
if (oldTempConstructSiteInfo.get("constUserid") != null && !"".equals(oldTempConstructSiteInfo.get("constUserid"))) {
|
||||
orgConstUserid = sUtil.checkNull((String) oldTempConstructSiteInfo.get("constUserid"));
|
||||
}
|
||||
/** encryptId 값 여부: 수정하면서 건설사 지정 처리 여부
|
||||
/** addConstUserid 값 여부: 수정하면서 건설사 지정 처리 여부
|
||||
* 1) encryptId == "" && orgConstUserid == "" : 기지정 하지 않았고 새로 지정하지 않음 -> spUdtTblCsi 호출
|
||||
* 2) encryptId == "" && orgConstUserid != "" : 기지정했는데 미선정으로 수정 -> TEMP_META_~, TEMP_PROJECT_~ 삭제 그리고 TEMP_CONSTRUCT_~ UPDATE 완료 후 spUdtTblCsi 호출
|
||||
* 3) encryptId != "" && orgConstUserid == "" : 기지정 하지 않았는데 새로 지정함 -> SaveAndInsertMeta 호출. (기존에 생성된 PROJECT_CODE 없음, TEMP_META~, TEMP_PROJECT~에 추가) 그리고 spUdtTblCsi 호출
|
||||
|
|
@ -421,7 +397,7 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
* 5-2) orgConstUser가 입력을 전임 -> 기지정계정 삭제하고 SaveAndInsertMeta 호출. (기존에 생성된 PROJECT_CODE 없음, TEMP_META~, TEMP_PROJECT~에 추가) 그리고 spUdtTblCsi 호출
|
||||
*/
|
||||
|
||||
if ("".equals(encryptId)) {
|
||||
if ("".equals(addConstUserid)) {
|
||||
if ("".equals(orgConstUserid)) { // 1)
|
||||
// drillingInputMapper.spUdtTblCsi(spUdtTblCsiParams);
|
||||
} else { // 2)
|
||||
|
|
@ -433,7 +409,7 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
} else { // !"".equals(encryptId)
|
||||
if (orgConstUserid != null && "".equals(orgConstUserid)) { // 3)
|
||||
EgovMap tbl = null; // cid로 발주기관 등록 건설현장 정보 조회(PROJECT_CODE 취득)
|
||||
String constUserId = decryptId;
|
||||
String constUserId = addConstUserid;
|
||||
params.put("constUserId", constUserId);
|
||||
tbl = drillingInputMapper.getItemByCid( params );
|
||||
if (tbl.get("projectCode") != null && !"".equals(tbl.get("projectCode"))) { // PROJECT_CODE가 존재하면 입력중인 프로젝트.
|
||||
|
|
@ -446,7 +422,7 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
saveAndInsertMeta(params, request, response);
|
||||
drillingInputMapper.spUdtTblCsi(spUdtTblCsiParams);
|
||||
} else { // !"".equals(orgConstUserId)
|
||||
if (encryptId.equals(orgConstUserid)) { // 4)
|
||||
if (addConstUserid.equals(orgConstUserid)) { // 4)
|
||||
} else { // !encryptId.equals(orgConstUserid) 5)
|
||||
// 기업사용자 입력 진행 여부: !NULL -> 입력 전, NULL -> 입력 중(삭제불가)
|
||||
EgovMap constCompanyProjectWriting = drillingInputMapper.selectConstructCompanyProjectWriting(oldTempConstructSiteInfo);
|
||||
|
|
@ -459,7 +435,7 @@ public class DrillingInputServiceImpl implements DrillingInputService {
|
|||
deleteTempProjectInfo(oldTempConstructSiteInfo);
|
||||
params.put("holeNumber", -999);
|
||||
params.put("constProjectCode", oldTempConstructSiteInfo.get("projectCode")); // 기존에 부여된 PROJECT_CODE 유지
|
||||
params.put("constUserId", decryptId); // 새로 선정한 건설사계정
|
||||
params.put("constUserId", addConstUserid); // 새로 선정한 건설사계정
|
||||
saveAndInsertMeta(params, request, response);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,11 +290,6 @@ public class DrillingInquiryServiceImpl implements DrillingInquiryService {
|
|||
data.put("orgConstUserId", orgConstUserId);
|
||||
}
|
||||
|
||||
String encryptId = "";
|
||||
if (data.get("constUserid")!= null /*&& !"".equals(data.get("constUserid"))*/) {
|
||||
encryptId = CryptoUtil.encryptQuickAES((String) data.get("constUserid"));
|
||||
data.put("constUserid", encryptId);
|
||||
}
|
||||
Long nConstCompanyCodeKey = MyUtil.getLongFromObject(data.get("constCompanyCode"));
|
||||
if( nConstCompanyCodeKey != null ) {
|
||||
params.put("constCompanyCode", nConstCompanyCodeKey);
|
||||
|
|
|
|||
|
|
@ -74,10 +74,8 @@
|
|||
SELECT
|
||||
TRIM(wmi.COMPANY_NAME) AS COMPANY_NAME,
|
||||
wmi.USERID,
|
||||
SUBSTR(wmi.USERID, 1, 2) || '****' || SUBSTR(wmi.USERID, LENGTH(wmi.USERID)-1, 2) AS MaskedID,
|
||||
TRIM(wmi.NEW_ADDRESS) AS NEW_ADDRESS,
|
||||
TRIM(wmi.PART_NAME) AS PART_NAME,
|
||||
wmi.COMPANY_REGIST_NO
|
||||
wmi.EMAIL
|
||||
FROM
|
||||
web_member_in wmi
|
||||
WHERE
|
||||
|
|
@ -85,6 +83,45 @@
|
|||
and wmi.COMPANY_NAME NOT IN ('111', 'a')
|
||||
and wmi.COMPANY_NAME is not NULL
|
||||
and wmi.COMPANY_NAME LIKE '%' || #{companyName} || '%'
|
||||
UNION
|
||||
SELECT
|
||||
TRIM(wmi.COMPANY_NAME) AS COMPANY_NAME,
|
||||
wmi.USERID,
|
||||
TRIM(wmi.PART_NAME) AS PART_NAME,
|
||||
wmi.EMAIL
|
||||
FROM
|
||||
web_member_in wmi
|
||||
WHERE
|
||||
wmi.CLS = 1
|
||||
and wmi.COMPANY_NAME NOT IN ('111', 'a')
|
||||
and wmi.COMPANY_NAME is not NULL
|
||||
and wmi.USER_NAME like '%' || #{companyName} || '%'
|
||||
UNION
|
||||
SELECT
|
||||
TRIM(wmi.COMPANY_NAME) AS COMPANY_NAME,
|
||||
wmi.USERID,
|
||||
TRIM(wmi.PART_NAME) AS PART_NAME,
|
||||
wmi.EMAIL
|
||||
FROM
|
||||
web_member_in wmi
|
||||
WHERE
|
||||
wmi.CLS = 1
|
||||
and wmi.COMPANY_NAME NOT IN ('111', 'a')
|
||||
and wmi.COMPANY_NAME is not NULL
|
||||
and wmi.USERID like '%' || #{companyName} || '%'
|
||||
UNION
|
||||
SELECT
|
||||
TRIM(wmi.COMPANY_NAME) AS COMPANY_NAME,
|
||||
wmi.USERID,
|
||||
TRIM(wmi.PART_NAME) AS PART_NAME,
|
||||
wmi.EMAIL
|
||||
FROM
|
||||
web_member_in wmi
|
||||
WHERE
|
||||
wmi.CLS = 1
|
||||
and wmi.COMPANY_NAME NOT IN ('111', 'a')
|
||||
and wmi.COMPANY_NAME is not NULL
|
||||
and wmi.EMAIL like '%' || #{companyName} || '%'
|
||||
</select>
|
||||
|
||||
<select id="getDepartments" parameterType="map" resultType="egovMap">
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
<th>건설사</th>
|
||||
<td colspan="3" class="info-row">
|
||||
<input type="hidden" value="" id="const-user-id-` + tableId + `" name="const-user-id" />
|
||||
<input type="text" value="" class="input-box information1 const-company-dept" id="const-company-dept-` + tableId + `" placeholder="건설사명">
|
||||
<input type="text" value="" class="input-box information1 const-company-dept" id="const-company-dept-` + tableId + `" placeholder="건설사명, 이름, 아이디 또는 이메일">
|
||||
<input type="text" value="" class="input-box information2" id="const-company-admin-` + tableId + `" placeholder="담당자">
|
||||
<input type="text" value="010-0000-0000" class="input-box information3" id="const-company-tel-` + tableId + `" placeholder="담당자 연락처">
|
||||
<label class="check-box unselected-constructor-label" for="unselected-constructor-` + tableId + `"><input type="checkbox" id="unselected-constructor-` + tableId + `">
|
||||
|
|
@ -417,12 +417,12 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
list.forEach(function (item) {
|
||||
|
||||
const suggestionItem = document.createElement('div');
|
||||
let maskedid = '';
|
||||
let userid = '';
|
||||
let partName = '';
|
||||
let newAddress = '';
|
||||
if (item.maskedid) maskedid = item.maskedid;
|
||||
let email = '';
|
||||
if (item.userid) userid = item.userid;
|
||||
if (item.partName) partName = item.partName;
|
||||
if (item.newAddress) newAddress = item.newAddress;
|
||||
if (item.email) email = item.email;
|
||||
|
||||
const keyword = companyName;
|
||||
const regex = new RegExp(keyword, 'gi');
|
||||
|
|
@ -430,17 +430,25 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
regex,
|
||||
'<b style="background:yellow">' + keyword + '</b>'
|
||||
);
|
||||
const boldConstUserid = item.userid.replace(
|
||||
regex,
|
||||
'<b style="background:yellow; color:red">' + keyword + '</b>'
|
||||
);
|
||||
const boldEmail = item.email.replace(
|
||||
regex,
|
||||
'<b style="background:yellow; color:red">' + keyword + '</b>'
|
||||
);
|
||||
|
||||
suggestionItem.innerHTML =
|
||||
'<span class="organizational-structure">' + boldCompanyName + '</span><br />' +
|
||||
'<span>' + maskedid + '(' + partName + ')' + '/' + newAddress
|
||||
'<span>' + boldConstUserid + '(' + partName + ')' + '/' + boldEmail
|
||||
'</span>';
|
||||
|
||||
suggestionItem.addEventListener('click', function () {
|
||||
companyNameInput.value = item.companyName;
|
||||
hiddenUserIdInput.value = item.encryptId;
|
||||
hiddenUserIdInput.value = item.userid;
|
||||
suggestionListDiv.style.display = 'none';
|
||||
setConstInfo(item.encryptId, tableContainerDiv); // 건설사 계정 선택시 이름, 연락처 자동 셋팅
|
||||
setConstInfo(userid, tableContainerDiv); // 건설사 계정 선택시 이름, 연락처 자동 셋팅
|
||||
});
|
||||
|
||||
suggestionListDiv.appendChild(suggestionItem);
|
||||
|
|
@ -604,8 +612,8 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
}
|
||||
|
||||
// 건설사 - 선택한 건설사 userid
|
||||
var hiddenUseridEle = document.getElementById('const-user-id-' + dataIndexValue);
|
||||
jsonItem.encUserid = hiddenUseridEle.value;
|
||||
var useridEle = document.getElementById('const-user-id-' + dataIndexValue);
|
||||
jsonItem.constUserid = useridEle.value;
|
||||
if (cid) {
|
||||
jsonItem.cid=cid;
|
||||
}
|
||||
|
|
@ -786,7 +794,7 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
url: '/const-user-info.json',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
encUserid: encId
|
||||
userid: encId
|
||||
},
|
||||
success: function (json) {
|
||||
// console.log(json)
|
||||
|
|
@ -933,7 +941,7 @@ if (request.getSession().getAttribute("CLS") == null || "2".equals(request.getSe
|
|||
<th>건설사</th>
|
||||
<td colspan="3" class="info-row">
|
||||
<input type="hidden" value="" id="const-user-id-` + tableId + `" name="const-user-id" />
|
||||
<input type="text" value="` + const_company_dept + `" class="input-box information1 const-company-dept" id="const-company-dept-` + tableId + `" placeholder="건설사명">
|
||||
<input type="text" value="` + const_company_dept + `" class="input-box information1 const-company-dept" id="const-company-dept-` + tableId + `" placeholder="건설사명, 이름, 아이디 또는 이메일">
|
||||
<input type="text" value="` + const_company_name + `" class="input-box information2" id="const-company-admin-` + tableId + `" placeholder="담당자">
|
||||
<input type="text" value="` + const_company_tel + `" class="input-box information3" id="const-company-tel-` + tableId + `" placeholder="담당자 연락처">
|
||||
<label class="check-box unselected-constructor-label" for="unselected-constructor-` + tableId + `"><input type="checkbox" id="unselected-constructor-` + tableId + `" ` + fin_const_company + `>
|
||||
|
|
|
|||
Loading…
Reference in New Issue