- pembuatan service logging kegiatan user
- pemasangan service logging kegiatan user di skoring tindakan medis
This commit is contained in:
parent
579aaba0c5
commit
a0c797ca30
@ -0,0 +1,11 @@
|
|||||||
|
package com.jasamedika.medifirst2000.dao;
|
||||||
|
|
||||||
|
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.jasamedika.medifirst2000.entities.LoggingUser;
|
||||||
|
|
||||||
|
@Repository("loggingUserDao")
|
||||||
|
public interface LoggingUserDao extends PagingAndSortingRepository<LoggingUser, String> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -10,9 +10,12 @@ import org.springframework.orm.jpa.JpaSystemException;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
|
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
|
||||||
|
import com.jasamedika.medifirst2000.dao.LoggingUserDao;
|
||||||
import com.jasamedika.medifirst2000.dao.ProdukDao;
|
import com.jasamedika.medifirst2000.dao.ProdukDao;
|
||||||
import com.jasamedika.medifirst2000.dao.SettingDataFixedDao;
|
import com.jasamedika.medifirst2000.dao.SettingDataFixedDao;
|
||||||
import com.jasamedika.medifirst2000.dao.SkoringTindakanMedisDao;
|
import com.jasamedika.medifirst2000.dao.SkoringTindakanMedisDao;
|
||||||
|
import com.jasamedika.medifirst2000.entities.LoggingUser;
|
||||||
|
import com.jasamedika.medifirst2000.entities.LoginUser;
|
||||||
import com.jasamedika.medifirst2000.entities.Produk;
|
import com.jasamedika.medifirst2000.entities.Produk;
|
||||||
import com.jasamedika.medifirst2000.entities.SkoringTindakanMedis;
|
import com.jasamedika.medifirst2000.entities.SkoringTindakanMedis;
|
||||||
import com.jasamedika.medifirst2000.entities.SubUnitKerjaPegawai;
|
import com.jasamedika.medifirst2000.entities.SubUnitKerjaPegawai;
|
||||||
@ -44,6 +47,26 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SettingDataFixedDao settingDataFixedDao;
|
private SettingDataFixedDao settingDataFixedDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private LoggingUserDao loggingUserDao;
|
||||||
|
|
||||||
|
public void addLoggingUser(Integer idLoginUser, String idReferensi, String keterangan) {
|
||||||
|
LoggingUser loggingUser = new LoggingUser();
|
||||||
|
LoginUser loginUser = new LoginUser();
|
||||||
|
|
||||||
|
loggingUser.setKdProfile((short) 0);
|
||||||
|
loggingUser.setStatusEnabled(true);
|
||||||
|
loggingUser.setTanggal(new Date());
|
||||||
|
loginUser.setId(idLoginUser);
|
||||||
|
loggingUser.setLoginUser(loginUser);
|
||||||
|
loggingUser.setJenisLog("Skoring Tindakan Medis");
|
||||||
|
loggingUser.setReferensiId(idReferensi);
|
||||||
|
loggingUser.setReferensi("sdm_skoringtindakanmedis_t");
|
||||||
|
loggingUser.setKeterangan(keterangan);
|
||||||
|
|
||||||
|
loggingUserDao.save(loggingUser);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SkoringTindakanMedisVO add(SkoringTindakanMedisVO vo) throws JpaSystemException, ServiceVOException {
|
public SkoringTindakanMedisVO add(SkoringTindakanMedisVO vo) throws JpaSystemException, ServiceVOException {
|
||||||
Produk produk = produkConverter.transferVOToModel(vo.getProduk(), new Produk());
|
Produk produk = produkConverter.transferVOToModel(vo.getProduk(), new Produk());
|
||||||
@ -56,6 +79,8 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
|
|||||||
skoringTindakanMedis.setKelompokKerja(kelompokKerja);
|
skoringTindakanMedis.setKelompokKerja(kelompokKerja);
|
||||||
SkoringTindakanMedis resultModel = skoringTindakanMedisDao.save(skoringTindakanMedis);
|
SkoringTindakanMedis resultModel = skoringTindakanMedisDao.save(skoringTindakanMedis);
|
||||||
|
|
||||||
|
addLoggingUser(vo.getLoginUserId(), resultModel.getNoRec(), "Buat data");
|
||||||
|
|
||||||
SkoringTindakanMedisVO resultVO = new SkoringTindakanMedisVO();
|
SkoringTindakanMedisVO resultVO = new SkoringTindakanMedisVO();
|
||||||
resultVO = skoringTindakanMedisConverter.transferModelToVO(resultModel, resultVO);
|
resultVO = skoringTindakanMedisConverter.transferModelToVO(resultModel, resultVO);
|
||||||
|
|
||||||
@ -76,6 +101,12 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
|
|||||||
skoringTindakanMedisBaru.setKelompokKerja(kelompokKerja);
|
skoringTindakanMedisBaru.setKelompokKerja(kelompokKerja);
|
||||||
SkoringTindakanMedis resultModel = skoringTindakanMedisDao.save(skoringTindakanMedisBaru);
|
SkoringTindakanMedis resultModel = skoringTindakanMedisDao.save(skoringTindakanMedisBaru);
|
||||||
|
|
||||||
|
if (vo.getStatusEnabled()) {
|
||||||
|
addLoggingUser(vo.getLoginUserId(), resultModel.getNoRec(), "Edit data");
|
||||||
|
} else if (!vo.getStatusEnabled()) {
|
||||||
|
addLoggingUser(vo.getLoginUserId(), resultModel.getNoRec(), "Hapus data");
|
||||||
|
}
|
||||||
|
|
||||||
SkoringTindakanMedisVO resultVO = new SkoringTindakanMedisVO();
|
SkoringTindakanMedisVO resultVO = new SkoringTindakanMedisVO();
|
||||||
resultVO = skoringTindakanMedisConverter.transferModelToVO(resultModel, resultVO);
|
resultVO = skoringTindakanMedisConverter.transferModelToVO(resultModel, resultVO);
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,107 @@
|
|||||||
|
package com.jasamedika.medifirst2000.entities;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
import com.jasamedika.medifirst2000.base.BaseTransaction;
|
||||||
|
import com.jasamedika.medifirst2000.helper.Caption;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "userloggingactivity_t")
|
||||||
|
public class LoggingUser extends BaseTransaction {
|
||||||
|
|
||||||
|
@Caption(value = "Tanggal")
|
||||||
|
@Column(name = "tanggal", nullable = false)
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date tanggal;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@NotNull(message = "User tidak boleh kosong")
|
||||||
|
@JoinColumn(name = "objectloginuserfk")
|
||||||
|
@Caption(value = "User")
|
||||||
|
private LoginUser loginUser;
|
||||||
|
|
||||||
|
@Column(name = "objectloginuserfk", insertable = false, updatable = false, nullable = true)
|
||||||
|
private Integer loginUserId;
|
||||||
|
|
||||||
|
@Column(name = "jenislog", nullable = false)
|
||||||
|
@Caption(value = "Jenis Log")
|
||||||
|
private String jenisLog;
|
||||||
|
|
||||||
|
@Column(name = "objectreferensifk", nullable = false)
|
||||||
|
@Caption(value = "Id Referensi")
|
||||||
|
private String referensiId;
|
||||||
|
|
||||||
|
@Column(name = "referensi", nullable = false)
|
||||||
|
@Caption(value = "Referensi")
|
||||||
|
private String referensi;
|
||||||
|
|
||||||
|
@Column(name = "keterangan", nullable = true)
|
||||||
|
@Caption(value = "Keterangan")
|
||||||
|
private String keterangan;
|
||||||
|
|
||||||
|
public Date getTanggal() {
|
||||||
|
return tanggal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTanggal(Date tanggal) {
|
||||||
|
this.tanggal = tanggal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginUser getLoginUser() {
|
||||||
|
return loginUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginUser(LoginUser loginUser) {
|
||||||
|
this.loginUser = loginUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLoginUserId() {
|
||||||
|
return loginUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginUserId(Integer loginUserId) {
|
||||||
|
this.loginUserId = loginUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJenisLog() {
|
||||||
|
return jenisLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJenisLog(String jenisLog) {
|
||||||
|
this.jenisLog = jenisLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReferensiId() {
|
||||||
|
return referensiId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReferensiId(String referensiId) {
|
||||||
|
this.referensiId = referensiId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReferensi() {
|
||||||
|
return referensi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReferensi(String referensi) {
|
||||||
|
this.referensi = referensi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeterangan() {
|
||||||
|
return keterangan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeterangan(String keterangan) {
|
||||||
|
this.keterangan = keterangan;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
package com.jasamedika.medifirst2000.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
import com.jasamedika.medifirst2000.base.vo.BaseTransactionVO;
|
||||||
|
import com.jasamedika.medifirst2000.entities.LoginUser;
|
||||||
|
import com.jasamedika.medifirst2000.helper.Caption;
|
||||||
|
|
||||||
|
public class LoggingUserVO extends BaseTransactionVO {
|
||||||
|
|
||||||
|
@NotNull(message = "Tanggal tidak boleh kosong")
|
||||||
|
@Caption(value = "Tanggal")
|
||||||
|
private Date tanggal;
|
||||||
|
|
||||||
|
@NotNull(message = "User tidak boleh kosong")
|
||||||
|
@Caption(value = "User")
|
||||||
|
private LoginUser loginUser;
|
||||||
|
|
||||||
|
private Integer loginUserId;
|
||||||
|
|
||||||
|
@NotNull(message = "Jenis log tidak boleh kosong")
|
||||||
|
@Caption(value = "Jenis Log")
|
||||||
|
private String jenisLog;
|
||||||
|
|
||||||
|
@NotNull(message = "Nomor referensi tidak boleh kosong")
|
||||||
|
@Caption(value = "Nomor Referensi")
|
||||||
|
private String noref;
|
||||||
|
|
||||||
|
@NotNull(message = "Objek Referensi tidak boleh kosong")
|
||||||
|
@Caption(value = "Referensi")
|
||||||
|
private String referensi;
|
||||||
|
|
||||||
|
@Caption(value = "Keterangan")
|
||||||
|
private String keterangan;
|
||||||
|
|
||||||
|
public Date getTanggal() {
|
||||||
|
return tanggal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTanggal(Date tanggal) {
|
||||||
|
this.tanggal = tanggal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginUser getLoginUser() {
|
||||||
|
return loginUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginUser(LoginUser loginUser) {
|
||||||
|
this.loginUser = loginUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLoginUserId() {
|
||||||
|
return loginUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginUserId(Integer loginUserId) {
|
||||||
|
this.loginUserId = loginUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJenisLog() {
|
||||||
|
return jenisLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJenisLog(String jenisLog) {
|
||||||
|
this.jenisLog = jenisLog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNoref() {
|
||||||
|
return noref;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoref(String noref) {
|
||||||
|
this.noref = noref;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReferensi() {
|
||||||
|
return referensi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReferensi(String referensi) {
|
||||||
|
this.referensi = referensi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeterangan() {
|
||||||
|
return keterangan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeterangan(String keterangan) {
|
||||||
|
this.keterangan = keterangan;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -29,6 +29,8 @@ public class SkoringTindakanMedisVO extends BaseTransactionVO {
|
|||||||
|
|
||||||
private Integer kelompokKerjaId;
|
private Integer kelompokKerjaId;
|
||||||
|
|
||||||
|
private Integer loginUserId;
|
||||||
|
|
||||||
public String getDetailProduk() {
|
public String getDetailProduk() {
|
||||||
return detailProduk;
|
return detailProduk;
|
||||||
}
|
}
|
||||||
@ -93,4 +95,12 @@ public class SkoringTindakanMedisVO extends BaseTransactionVO {
|
|||||||
this.kelompokKerjaId = kelompokKerjaId;
|
this.kelompokKerjaId = kelompokKerjaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getLoginUserId() {
|
||||||
|
return loginUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginUserId(Integer loginUserId) {
|
||||||
|
this.loginUserId = loginUserId;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user