|
|
|
@ -2,7 +2,9 @@ package cokr.xit.interfaces.saeol.service.bean;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
@ -19,18 +21,27 @@ public class MinwonBean extends SaeolBean {
|
|
|
|
|
@Resource(name = "fileBean")
|
|
|
|
|
private FileBean fileBean;
|
|
|
|
|
|
|
|
|
|
public void getMinwons(String deptCode, String startDate, String endDate) {
|
|
|
|
|
public Map<String, Object> getMinwons(String deptCode, String startDate, String endDate) {
|
|
|
|
|
log().debug("Getting minwons: '{}', {} ~ {}", deptCode, startDate, endDate);
|
|
|
|
|
SOHNN00004.Req00004 req00004 = new SOHNN00004.Req00004();
|
|
|
|
|
req00004.setDep_code(deptCode);
|
|
|
|
|
req00004.setStart_reg_ymd(startDate);
|
|
|
|
|
req00004.setEnd_reg_ymd(endDate);
|
|
|
|
|
SOHNN00004.Resp00004 resp00004 = getSOHNN00004(req00004).getResponse();
|
|
|
|
|
if (resp00004.error()) return;
|
|
|
|
|
if (resp00004.error())
|
|
|
|
|
return resp00004.getFault().toMap();
|
|
|
|
|
|
|
|
|
|
LinkedHashMap<String, Object> result = new LinkedHashMap<>();
|
|
|
|
|
result.put("success", true);
|
|
|
|
|
result.put("minwonsReceived", resp00004.getResult().size());
|
|
|
|
|
|
|
|
|
|
for (SOHNN00004.Item item: resp00004.getResult()) {
|
|
|
|
|
getSOHNN00011(item.getCnsl_qna_no(), item.getDetail());
|
|
|
|
|
String cnsl_qna_no = item.getCnsl_qna_no();
|
|
|
|
|
SOHNN00011 sohnn00011 = getSOHNN00011(cnsl_qna_no, item.getDetail());
|
|
|
|
|
result.put(cnsl_qna_no, !sohnn00011.getResponse().error() ? "success" : "fail");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SOHNN00004 getSOHNN00004(SOHNN00004.Req00004 req) {
|
|
|
|
@ -40,16 +51,17 @@ public class MinwonBean extends SaeolBean {
|
|
|
|
|
req.setLink_yn("y");
|
|
|
|
|
SOHNN00004 msg = new SOHNN00004();
|
|
|
|
|
SOHNN00004.Resp00004 resp = sendMessage(msg.setRequest(req));
|
|
|
|
|
if (!resp.error()) {
|
|
|
|
|
log(msg);
|
|
|
|
|
save(resp);
|
|
|
|
|
}
|
|
|
|
|
if (!resp.error())
|
|
|
|
|
save(msg);
|
|
|
|
|
|
|
|
|
|
return msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SOHNN00004.Resp00004 save(SOHNN00004.Resp00004 resp) {
|
|
|
|
|
if (!resp.error())
|
|
|
|
|
saeolMapper.insert(resp);
|
|
|
|
|
SOHNN00004.Resp00004 save(SOHNN00004 msg) {
|
|
|
|
|
SOHNN00004.Resp00004 resp = msg.getResponse();
|
|
|
|
|
int affected = saeolMapper.insert(resp);
|
|
|
|
|
if (affected > 0)
|
|
|
|
|
log(msg);
|
|
|
|
|
return resp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,20 +74,21 @@ public class MinwonBean extends SaeolBean {
|
|
|
|
|
req.setCnsl_qna_no(cnsl_qna_no);
|
|
|
|
|
SOHNN00011 msg = new SOHNN00011();
|
|
|
|
|
SOHNN00011.Resp00011 resp = sendMessage(msg.setRequest(req));
|
|
|
|
|
if (!resp.error()) {
|
|
|
|
|
log(msg);
|
|
|
|
|
save(resp, detail);
|
|
|
|
|
}
|
|
|
|
|
if (!resp.error())
|
|
|
|
|
save(msg, detail);
|
|
|
|
|
|
|
|
|
|
return msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SOHNN00011.Resp00011 save(SOHNN00011.Resp00011 resp, String detail) {
|
|
|
|
|
SOHNN00011.Resp00011 save(SOHNN00011 msg, String detail) {
|
|
|
|
|
SOHNN00011.Resp00011 resp = msg.getResponse();
|
|
|
|
|
SOHNN00011.Item result = resp.getResult();
|
|
|
|
|
if (result == null)
|
|
|
|
|
return resp;
|
|
|
|
|
|
|
|
|
|
saeolMapper.insert(resp, detail);
|
|
|
|
|
int affected = saeolMapper.insert(resp, detail);
|
|
|
|
|
if (affected > 0)
|
|
|
|
|
log(msg);
|
|
|
|
|
|
|
|
|
|
if (SOHNN00004.Item.GET.equals(detail)) {
|
|
|
|
|
String phoneNo = ifEmpty(result.getTelno_m(), result::getHpno_m);
|
|
|
|
|