Commit f94d69c4 by TongZuu

complete feature

parent a4625ed8
......@@ -7,8 +7,6 @@ import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Vector;
import koala.dynamicjava.tree.ThisExpression;
import org.apache.commons.lang.StringUtils;
import com.csc.entity.CSC_Quque;
......@@ -243,7 +241,6 @@ public class GenProcessQuque extends ThreadProcess {
public String createQuque(UProfile upf, String engName, String thaiName, String className, String screenName, String remark, String priority, HashMap condition,String export_type,String process_group,String process_type,String conName) throws Exception {
DbRecord db = new InitialRecord(upf).getDbRecord("com.csc.entity.CSC_Quque");
this.param.put(conName, condition);
CscCalendar d = new CscCalendar();
......@@ -328,7 +325,7 @@ public class GenProcessQuque extends ThreadProcess {
}
public String createImmediateQueue(UProfile upf, HashMap paramdata,String engName, String thaiName, String screenName, String remark,String classname,String process_type,String referkey) throws RemoteException {
if( this.isDuplicateProcessWorkflow(upf , param , process_type) ){
if( this.isDuplicateProcessWorkflow(upf , paramdata , process_type, referkey) ){
return "";
}
DbRecord db = new InitialRecord(upf).getDbRecord("com.csc.entity.CSC_Quque");
......@@ -369,33 +366,35 @@ public class GenProcessQuque extends ThreadProcess {
return processID;
}
private boolean isDuplicateProcessWorkflow(UProfile up , HashMap param , String processType){
private boolean isDuplicateProcessWorkflow(UProfile up , HashMap param , String processType, String referkey){
if(processType.equalsIgnoreCase("W")){
if(param.containsKey("wf_seq_no") && param.containsKey("step_id")){
String wf_seq_no = param.get("wf_seq_no").toString();
if(param.containsKey("runno") && param.containsKey("step_id")){
String wf_seq_no = param.get("runno").toString();
String step_id = param.get("step_id").toString();
String referkey = up.getEmployee()+"$"+wf_seq_no+"$"+step_id;
//String referkey = up.getEmployee()+"$"+wf_seq_no+"$"+step_id;
String filter = "referkey='"+referkey+"'";
if(param.containsKey("transfer_id")){
filter = "("+referkey+" or TR"+param.get("transfer_id").toString()+"$"+wf_seq_no+"$"+step_id+")";
}
DbInquiry inqQ = null;
try{
inqQ = new InitialInquiry(this.getUProfile()).getDbInquiry("com.csc.entity.CSC_Quque");
inqQ = new InitialInquiry(up).getDbInquiry("com.csc.entity.CSC_Quque");
inqQ.setColumn("ququeid,referkey,companyid");
inqQ.setFilter(filter);
DbRecord workflow_data = new InitialRecord(this.getUProfile()).getDbRecord("Workflow_data_notrigger");
DbRecord workflow_data = new InitialRecord(up).getDbRecord("Workflow_data_notrigger");
workflow_data.setWFOff();
workflow_data.setColumn(workflow_data.getListKey() + ",q_status");
workflow_data.set("runno", wf_seq_no);
if(workflow_data.search("runno") == 1){
if( workflow_data.getString("q_status").equalsIgnoreCase("F") && inqQ.recCount() == 0){
if( (!workflow_data.getString("q_status").equalsIgnoreCase("R") && !workflow_data.getString("q_status").equalsIgnoreCase("W") && !workflow_data.getString("q_status").equalsIgnoreCase("E")) && inqQ.recCount() == 0){// óշ͡ ͡ʶҹоӧҹ q ѧӧҹ
workflow_data.set("q_status", "W");
workflow_data.setWFOff();
if(workflow_data.save() > 0){
return false;
}
}else{// ó͡ ͡ӧҹ Q ӧҹ
return true;
}
}
}catch(Exception e){
......@@ -406,9 +405,9 @@ public class GenProcessQuque extends ThreadProcess {
}
}
}
}else{
return false;
}else{// óշ Workflow
return true;
}
return true;
return false;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment