Update LogAccService
Penggunaan jsonobject untuk set request body put log presensi pegawai
This commit is contained in:
parent
bb2ed467af
commit
d45b91e6cb
@ -84,11 +84,19 @@ public class LogAccServiceImpl extends BaseVoServiceImpl implements LogAccServic
|
|||||||
con.setDoOutput(true);
|
con.setDoOutput(true);
|
||||||
|
|
||||||
OutputStream os = con.getOutputStream();
|
OutputStream os = con.getOutputStream();
|
||||||
String jsonOutputString = "{\"tr_no\":" + vo.getTr_no() + ",\"pegawaifk\":\"" + vo.getPegawai().getId()
|
JSONObject jsonObject = new JSONObject();
|
||||||
+ ",\"empl_code\":\"" + vo.getEmpl_code() + "\",\"ip_addr\":\"" + vo.getIp_addr()
|
try {
|
||||||
+ "\",\"client_ip_addr\":\"" + vo.getClientIPAddress() + "\"}";
|
jsonObject.put("tr_no", vo.getTr_no());
|
||||||
|
jsonObject.put("pegawaifk",
|
||||||
|
CommonUtil.isNotNullOrEmpty(vo.getPegawai()) ? vo.getPegawai().getId() : "");
|
||||||
|
jsonObject.put("empl_code", vo.getEmpl_code());
|
||||||
|
jsonObject.put("ip_addr", vo.getIp_addr());
|
||||||
|
jsonObject.put("client_ip_addr", vo.getClientIPAddress());
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
byte[] requestBody = jsonOutputString.getBytes("UTF-8");
|
byte[] requestBody = jsonObject.toString().getBytes("UTF-8");
|
||||||
os.write(requestBody, 0, requestBody.length);
|
os.write(requestBody, 0, requestBody.length);
|
||||||
|
|
||||||
InputStream in = new BufferedInputStream(con.getInputStream());
|
InputStream in = new BufferedInputStream(con.getInputStream());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user