knu project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

480 lines
11 KiB

package kr.co.kihyun.beans.entity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.jdo.JDOObjectNotFoundException;
import javax.jdo.PersistenceManager;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.NullValue;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import kr.co.kihyun.beans.entity.ecross.IRemotePersistable;
import kr.co.kihyun.io.IUploadable;
import javax.jdo.annotations.Serialized;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class TotReportVersion extends AbstractPublicDocument implements IRemotePersistable {
/**
*
*/
private static final long serialVersionUID = 8955275337415625177L;
private static final Logger LOG = LoggerFactory.getLogger(TotReportVersion.class);
public static final String COL_DELIMITER = "!#";
public static final String ROW_DELIMITER = "!%";
public static final String TABLE_DELIMITER = "!`!";
public static final int PROCESS_ACCEPT = TotReportProcess.ACCEPT.ordinal();
public static final int PROCESS_REASSIGN = TotReportProcess.REASSIGN.ordinal();
public static final int PROCESS_ASSIGN = TotReportProcess.ASSIGN.ordinal();
public static final int PROCESS_RETURN = TotReportProcess.RETURN.ordinal();
public static final int PROCESS_TEMP = TotReportProcess.TEMP.ordinal();
public static final int PROCESS_APPROVE = TotReportProcess.APPROVE.ordinal();
public static final int PROCESS_COMP = TotReportProcess.COMP.ordinal();
public static final int PROCESS_END = TotReportProcess.END.ordinal();
public static final int PROCESS_READ = TotReportProcess.READ.ordinal();
public static final int PROCESS_CANCEL = TotReportProcess.CANCEL.ordinal();
public static final int PROCESS_ALL = TotReportProcess.ALL.ordinal();
public static final int PROCESS_NOT = TotReportProcess.NOT.ordinal();
public static final int PROCESS_NOTE = TotReportProcess.NOTE.ordinal(); //자료회수
public static final int TYPE_REPORT = TotReportType.REPORT.ordinal();
public static final int TYPE_NOT_REPORT = TotReportType.NOT_REPORT.ordinal();
public static final int TYPE_NOT_REPORT_REQ = TotReportType.NOT_REPORT_REQ.ordinal();
public static final int RECOG_NOT = Recog.NOT_RECOG.ordinal();
public static final int RECOG_PRSS = Recog.PRSS.ordinal();
public static final int RECOG_COMP = Recog.COMP.ordinal();
public static final int RECOG_RETURN = Recog.RETURN_RECOG.ordinal();
public static final int RECOG_ARBITRARY = Recog.ARBITRARY.ordinal();
public static final int RECOG_FINAL_RECOG = Recog.FINAL_RECOG.ordinal();
@Persistent(nullValue = NullValue.EXCEPTION)
private Long totDoc;
@Persistent
private String acceptanceCode;
@Persistent
private String acptDoc;
@Persistent(nullValue = NullValue.EXCEPTION)
private Integer tableNum = 1;
@Persistent
private int num = 0;
/*@Persistent
private String mDept;*/
@Persistent
private MDept mDept;
@Persistent
private String mUser;
@Persistent(customValueStrategy = "timestamp")
private Date regDate;
@Persistent
private Date submitDate;
@Persistent
private String data;
@Persistent
private String totData;
@Persistent
private String attachments;
@Persistent
private String attachmentsPath;
@Persistent
private int appro = 0;
@Persistent
private int recog =0;
@Persistent
private String note;
@Persistent(nullValue = NullValue.EXCEPTION)
private String isDeleted = "N"; // COLUMN: del_type
@Persistent(nullValue = NullValue.EXCEPTION)
private int type = 0; // COLUMN: type
@Persistent(nullValue = NullValue.EXCEPTION)
private int process = 0;
@Persistent
private Long slaveTotDoc; // COLUMN: down_doc_id
@Persistent
private Long repTotDoc; // COLUMN: rep_doc_id
@Persistent
private int assignType = 0; // COLUMN: doc_type
@Persistent
private String currentRepoadm;
@Persistent
private String modifyId;
@Persistent
private String modifyNm;
@Persistent
private String modifyDeptId;
@Persistent
private String modifyDeptNm;
@Persistent
private Long reportId;
@Persistent
private String tempLateHtml;
@Persistent(nullValue = NullValue.DEFAULT)
private String secuYn = "N"; // COLUMN: secu_yn(보안문서여부), 기본값:N.비보안
private String fileCheck = "N"; // COLUMN: file_check(파일첨부여부 확인), 기본값:N.미첨부
public TotReportVersion() {
}
public String getFileCheck() {
return fileCheck;
}
public void setFileCheck(String fileCheck) {
this.fileCheck = fileCheck;
}
public String getSecuYn() {
return secuYn;
}
public void setSecuYn(String secuYn) {
this.secuYn = secuYn;
}
public String getModifyId() {
return modifyId;
}
public void setModifyId(String modifyId) {
this.modifyId = modifyId;
}
public String getModifyNm() {
return modifyNm;
}
public void setModifyNm(String modifyNm) {
this.modifyNm = modifyNm;
}
public String getModifyDeptId() {
return modifyDeptId;
}
public void setModifyDeptId(String modifyDeptId) {
this.modifyDeptId = modifyDeptId;
}
public String getModifyDeptNm() {
return modifyDeptNm;
}
public void setModifyDeptNm(String modifyDeptNm) {
this.modifyDeptNm = modifyDeptNm;
}
public Long getTotDoc() {
return this.totDoc;
}
public void setTotDoc(Long doc) {
this.totDoc = doc;
}
public final AcceptanceCode getAcceptanceCode() {
try {
if (acceptanceCode != null)
return AcceptanceCode.valueOf(acceptanceCode);
else
return new AcceptanceCode(acceptanceCode, null);
} catch (Exception e) {
LOG.error("Unable to parse acceptance code for {}", acceptanceCode);
return new AcceptanceCode(acceptanceCode, null);
}
}
public final void setAcceptanceCode(AcceptanceCode acceptanceCode) {
this.acceptanceCode = acceptanceCode == null ? null : acceptanceCode.toString();
}
//문서번호
public final AcptDoc getActDoc() {
try {
if (acptDoc != null)
return AcptDoc.valueOf(acptDoc);
else
return new AcptDoc(acptDoc, null);
} catch (Exception e) {
LOG.error("Unable to parse acptDoc code for {}", acptDoc);
return new AcptDoc(acptDoc, null);
}
}
public final void setAcptDoc(AcptDoc acptDoc) {
this.acptDoc = acptDoc == null ? null : acptDoc.toString();
}
public int getTableNum() {
return this.tableNum;
}
public void setTableNum(int num) {
this.tableNum = num;
}
public int getNum() {
return this.num;
}
public void setNum(int num) {
this.num = num;
}
public String getDept() {
return this.mDept.getId();
}
public MDept getDept(PersistenceManager pm) {
try {
//LOG.debug("mDept: {}", this.mDept);
return pm.getObjectById(MDept.class, this.mDept.getId());
} catch (JDOObjectNotFoundException jonfe) {
return null;
}
}
public final void setDept(MDept mDept) {
if (mDept == null)
this.mDept = null;
else
this.mDept = mDept;
}
public MUser getUser(PersistenceManager pm) {
try {
return pm.getObjectById(MUser.class, this.mUser);
} catch (JDOObjectNotFoundException jonfe) {
MUser nullUser = new MUser();
nullUser.setId(this.mUser);
return nullUser;
}
}
public String getUser()
{
return mUser;
}
public void setUser(MUser mUser) {
if (mUser == null) {
this.mUser = null;
setOwnerEmail(null);
setOwnerName(null);
setOwnerPhone(null);
} else {
this.mUser = mUser.getId();
setOwnerEmail(mUser.getEmail());
setOwnerName(mUser.getEncName());
setOwnerPhone(mUser.getPhone());
}
}
public Date getRegDate() {
return this.regDate == null ? null : new Date(this.regDate.getTime());
}
public void setRegDate(Date regDate) {
this.regDate = regDate == null ? null : new Date(regDate.getTime());
}
public Date getSubmitDate() {
return this.submitDate == null ? null : new Date(this.submitDate.getTime());
}
public void setSubmitDate(Date submitDate) {
this.submitDate = submitDate == null ? null : new Date(submitDate.getTime());
}
public String getData() {
return this.data;
}
public void setData(String data) {
this.data = data;
}
public String getTotData() {
return this.totData;
}
public void setTotData(String data) {
this.totData = data;
}
public String getAttachments() {
return this.attachments;
}
public void setAttachment(String attachments)
{
this.attachments = attachments;
}
public String getAttachmentsPath(){
return this.attachmentsPath;
}
public void setAttachmentsPath(String attachmentsPath){
this.attachmentsPath = attachmentsPath;
}
public int getAppro() {
return this.appro;
}
public void setAppro(int a) {
this.appro = a;
}
public int getRecog() {
return this.recog;
}
public void setRecog(int recog) {
this.recog = recog;
}
public String getNote() {
return this.note;
}
public void setNote(String note) {
this.note = note;
}
public String isDeleted() {
return this.isDeleted;
}
public void setDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
public int getType() {
return this.type;
}
public void setType(int type) {
this.type = type;
}
public int getProcess() {
return this.process;
}
public void setProcess(int process) {
this.process = process;
}
public Long getSlaveTotDoc() {
return this.slaveTotDoc;
}
public void setSlaveTotDoc(Long doc) {
this.slaveTotDoc = doc;
}
public Long getRepTotDoc() {
return this.repTotDoc;
}
public void setRepTotDoc(Long doc) {
this.repTotDoc = doc;
}
public int getAssignType() {
return this.assignType;
}
public void setAssignType(int assignType) {
this.assignType = assignType;
}
public void setCurrentRepoadm(String currentRepoadm) {
this.currentRepoadm = currentRepoadm;
}
public String getCurrentRepoadm() {
return currentRepoadm;
}
public int getRowCount() {
return (getData().length() - getData().replaceAll(ROW_DELIMITER, "").length()) / ROW_DELIMITER.length();
}
@Override
public String toString() {
List<String> fieldList = new ArrayList<String>();
if (totDoc != null)
fieldList.add(totDoc.toString());
if (mDept != null)
fieldList.add(mDept.toString());
if (mUser != null)
fieldList.add(mUser.toString());
if (slaveTotDoc != null)
fieldList.add("slaveTotDoc::" + slaveTotDoc);
if (repTotDoc != null)
fieldList.add("repTotDoc::" + repTotDoc);
StringBuilder str = new StringBuilder(100).append(super.toString()).append(fieldList);
return str.toString();
}
@Override
public MDept getOwnerParty(PersistenceManager pm) {
// TODO Auto-generated method stub
return null;
}
}