#EC_HJ160# 最新的代码
parent
816f0c3fa2
commit
9329602bea
@ -0,0 +1,176 @@
|
|||||||
|
package com.customization.dito.at;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
public class DoSave2CurrentDataRunnable implements Runnable{
|
||||||
|
|
||||||
|
|
||||||
|
private String requestid;
|
||||||
|
private List<String> addUsers;
|
||||||
|
private String nodeid;
|
||||||
|
private String isremark;
|
||||||
|
|
||||||
|
public DoSave2CurrentDataRunnable(String requestid, List<String> addUsers, String nodeid, String isremark){
|
||||||
|
this.requestid = requestid;
|
||||||
|
this.addUsers = addUsers;
|
||||||
|
this.nodeid = nodeid;
|
||||||
|
this.isremark = isremark;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Thread.sleep(2000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
insertCurrentData(requestid,addUsers,nodeid,isremark);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void insertCurrentData(String requestid, List<String> addUsers, String nodeid, String isremark) {
|
||||||
|
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-insert");
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("HH:mm:ss");
|
||||||
|
Date date = new Date();
|
||||||
|
String receivedate = simpleDateFormat.format(date);
|
||||||
|
String receivetime = simpleDateFormat1.format(date);
|
||||||
|
|
||||||
|
int showOrder = 0;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
int groupid = 0 ;
|
||||||
|
String workflowid = "";
|
||||||
|
String workflowtype = "";
|
||||||
|
String currentNodeid = "";
|
||||||
|
String needwfback = "";
|
||||||
|
|
||||||
|
String sql =" select requestid,userid,groupid,workflowid,workflowtype,usertype,nodeid,agentorbyagentid,agenttype,showorder,receivedate,receivetime," +
|
||||||
|
" viewtype,iscomplete,islasttimes,groupdetailid,needwfback,isremark,preisremark,multiTakLevel " +
|
||||||
|
" from workflow_currentoperator where requestid=? and nodeid=? order by groupid desc" ;
|
||||||
|
rs.executeQuery(sql, requestid, nodeid);
|
||||||
|
if (rs.next()) {
|
||||||
|
groupid = Util.getIntValue(rs.getString("groupid"));
|
||||||
|
showOrder = rs.getInt("showorder") + 1;
|
||||||
|
workflowid = rs.getString("workflowid");
|
||||||
|
workflowtype = rs.getString("workflowtype");
|
||||||
|
currentNodeid = rs.getString("nodeid");
|
||||||
|
needwfback = rs.getString("needwfback");
|
||||||
|
}
|
||||||
|
// bb.writeLog("groupid:"+groupid);
|
||||||
|
// bb.writeLog("showOrder:"+showOrder);
|
||||||
|
// bb.writeLog("workflowid:"+workflowid);
|
||||||
|
// bb.writeLog("workflowtype:"+workflowtype);
|
||||||
|
// bb.writeLog("currentNodeid:"+currentNodeid);
|
||||||
|
// bb.writeLog("needwfback:"+needwfback);
|
||||||
|
|
||||||
|
try {
|
||||||
|
int errcount = 0;
|
||||||
|
for (String addUser : addUsers) {
|
||||||
|
groupid++;
|
||||||
|
|
||||||
|
String userIdTemp = addUser;
|
||||||
|
String agentorbyagentid = "-1";
|
||||||
|
String agenttype = "0";
|
||||||
|
int islasttimes = queryCurrentoperator(requestid,userIdTemp);
|
||||||
|
bb.writeLog("islasttimes:"+islasttimes);
|
||||||
|
String usertype = "0";
|
||||||
|
String viewtype = "0";
|
||||||
|
String groupdetailid = "0";
|
||||||
|
String preisremark = "98";
|
||||||
|
String is_complete = "0";
|
||||||
|
// String newCurrentId = "";
|
||||||
|
String insertSql = " insert into workflow_currentoperator(requestid,userid,groupid,workflowid,workflowtype,usertype,nodeid,agentorbyagentid,agenttype,showorder,receivedate,receivetime,viewtype,iscomplete,groupdetailid,needwfback,isremark,preisremark,islasttimes) " +
|
||||||
|
" values('"+requestid+"','"+userIdTemp+"','"+groupid+"','"+workflowid+"','"+workflowtype+"','"+usertype+"','"+currentNodeid+"','"+agentorbyagentid+"','"+agenttype+"','"+showOrder+"','"+receivedate+"','"+receivetime+"','"+viewtype+"','"+is_complete+"','"+groupdetailid+"','"+needwfback+"','2','"+preisremark+"','"+islasttimes+"') ";
|
||||||
|
bb.writeLog("insertSql22:"+insertSql);
|
||||||
|
boolean isTrue = rs.execute(insertSql);
|
||||||
|
bb.writeLog("isTrue:"+isTrue);
|
||||||
|
if(isTrue) {
|
||||||
|
// String cs_islasttimes = "";
|
||||||
|
// sql = " select id,islasttimes from workflow_currentoperator where requestid = '"+requestid+"' and userid ='"+userIdTemp+"' and isremark ='"+isremark+"' and preisremark ='"+preisremark+"' order by id desc" ;
|
||||||
|
// bb.writeLog("sql:"+sql);
|
||||||
|
// rs.executeQuery(sql);
|
||||||
|
// if (rs.next()) {
|
||||||
|
// newCurrentId = rs.getString("id");
|
||||||
|
// cs_islasttimes = rs.getString("islasttimes");
|
||||||
|
// }
|
||||||
|
// bb.writeLog("newCurrentId:"+newCurrentId);
|
||||||
|
// bb.writeLog("cs_islasttimes:"+cs_islasttimes);
|
||||||
|
// if("".equals(newCurrentId)){
|
||||||
|
// errcount++;
|
||||||
|
// }else{
|
||||||
|
// sql = " update workflow_currentoperator set islasttimes = '"+islasttimes+"' where requestid = '"+requestid+"' and userid = '"+userIdTemp+"' and id = '"+newCurrentId+"'" ;
|
||||||
|
// bb.writeLog("sql:"+sql);
|
||||||
|
// boolean isTrue2 = rs.execute(sql);
|
||||||
|
// bb.writeLog("isTrue22:"+isTrue2);
|
||||||
|
// if(isTrue2) {
|
||||||
|
// String cs_islasttimes2 = "";
|
||||||
|
// sql = " select id,islasttimes from workflow_currentoperator where requestid ='"+requestid+"' and userid ='"+userIdTemp+"' and isremark ='"+isremark+"' and preisremark ='"+preisremark+"' order by id desc" ;
|
||||||
|
// rs.executeQuery(sql);
|
||||||
|
// bb.writeLog("sql:"+sql);
|
||||||
|
// if (rs.next()) {
|
||||||
|
// cs_islasttimes2 = rs.getString("islasttimes");
|
||||||
|
// }
|
||||||
|
// bb.writeLog("cs_islasttimes2:"+cs_islasttimes2);
|
||||||
|
// }else{
|
||||||
|
// errcount++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}else {
|
||||||
|
errcount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
bb.writeLog("errcount:"+errcount);
|
||||||
|
|
||||||
|
// if("1".equals(islasttimes)){
|
||||||
|
// rs3.executeUpdate("update workflow_currentoperator set islasttimes = 0 where requestid = ? and userid = ?", requestid, userIdTemp);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
bb.writeLog("e:"+e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int queryCurrentoperator(String requestid, String addUser){
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
int islasttimes = 0;
|
||||||
|
try{
|
||||||
|
int count = 0;
|
||||||
|
String sql = " select id from workflow_currentoperator where requestid = "+requestid+" and userid = "+addUser;
|
||||||
|
bb.writeLog("sql3:"+sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
bb.writeLog("count:"+count);
|
||||||
|
if(count > 0){
|
||||||
|
String selectsql = " select userid, isremark,id from workflow_currentoperator where requestid=" + requestid + " and isremark in(0,1,5,7,11,8,9) and userid = '"+addUser+"' ";
|
||||||
|
bb.writeLog("sql4:"+sql);
|
||||||
|
rs.executeQuery(selectsql);
|
||||||
|
if (rs.next()) {
|
||||||
|
islasttimes = 0;
|
||||||
|
}else{
|
||||||
|
islasttimes = 1;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
islasttimes = 1;
|
||||||
|
}
|
||||||
|
bb.writeLog("islasttimes33:"+islasttimes);
|
||||||
|
}catch (Exception e){
|
||||||
|
bb.writeLog("e:"+e);
|
||||||
|
}
|
||||||
|
return islasttimes;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,309 @@
|
|||||||
|
package com.customization.dito.at;
|
||||||
|
|
||||||
|
//import com.customization.wfTodoCard.util.CheckSendCardUtil;
|
||||||
|
import com.customization.dito.sendtodo.SendPortalErrorUtilRunnable;
|
||||||
|
import com.engine.core.cfg.annotation.CommandDynamicProxy;
|
||||||
|
import com.engine.core.interceptor.AbstractCommandProxy;
|
||||||
|
import com.engine.core.interceptor.Command;
|
||||||
|
import com.engine.workflow.cmd.requestForm.communication.DoSaveContentCmd;
|
||||||
|
import org.apache.commons.lang3.StringEscapeUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jsoup.Jsoup;
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.nodes.Element;
|
||||||
|
import org.jsoup.select.Elements;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.general.BaseBean;
|
||||||
|
import weaver.general.Util;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关交流提交
|
||||||
|
*
|
||||||
|
* @author wangj
|
||||||
|
* @version 1.00版本
|
||||||
|
* @Date 2022/10/11
|
||||||
|
*/
|
||||||
|
@CommandDynamicProxy(target = DoSaveContentCmd.class, desc = "相关交流提交")
|
||||||
|
public class DoSaveContent2CurrentOperatorCmd extends AbstractCommandProxy<Map<String, Object>> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(Command<Map<String, Object>> targetCommand) {
|
||||||
|
//获取到被代理对象
|
||||||
|
DoSaveContentCmd doSaveContentCmd = (DoSaveContentCmd) targetCommand;
|
||||||
|
//获取被代理对象的参数
|
||||||
|
//对参数做预处理
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
|
||||||
|
Map<String,Object> paramMap = doSaveContentCmd.getParams();
|
||||||
|
User user = doSaveContentCmd.getUser();
|
||||||
|
|
||||||
|
String requestid = Util.null2String(paramMap.get("requestid"));
|
||||||
|
String nodeid = Util.null2String(paramMap.get("nodeid"));
|
||||||
|
String workflowid = Util.null2String(paramMap.get("workflowid"));
|
||||||
|
String remark = Util.null2String(paramMap.get("remark"));
|
||||||
|
String isSelectValue = Util.null2String(paramMap.get("isSelectValue"));
|
||||||
|
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-requestid:"+requestid);
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-nodeid:"+nodeid);
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-workflowid:"+workflowid);
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-remark:"+remark);
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-isSelectValue:"+isSelectValue);
|
||||||
|
|
||||||
|
//参数回写
|
||||||
|
//执行标准的业务处理
|
||||||
|
Map<String, Object> result = nextExecute(targetCommand);
|
||||||
|
|
||||||
|
sendDate(result,workflowid,requestid,nodeid,remark,isSelectValue,user);
|
||||||
|
bb.writeLog("-----------DoSaveContent2CurrentOperatorCmd------end--");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendDate(Map<String, Object> result, String workflowid, String requestid, String nodeid, String remark,String isSelectValue,User user) {
|
||||||
|
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd--isSelectValue:" + isSelectValue);
|
||||||
|
try{
|
||||||
|
List<String> userList = new ArrayList<String>();
|
||||||
|
String title = "";
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(remark)){
|
||||||
|
Document doc = Jsoup.parse(remark);
|
||||||
|
Elements uidElements = doc.select("[atsome-uid]");
|
||||||
|
Iterator<Element> uidIt = uidElements.iterator();
|
||||||
|
while(uidIt.hasNext()) {
|
||||||
|
Element element = uidIt.next();
|
||||||
|
String atsomeUid = element.attr("atsome-uid");
|
||||||
|
if(!userList.contains(atsomeUid)){
|
||||||
|
userList.add(atsomeUid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择所有的 <p> 标签
|
||||||
|
Elements pTags = doc.select("p");
|
||||||
|
Iterator<Element> pIt = pTags.iterator();
|
||||||
|
while(pIt.hasNext()) {
|
||||||
|
Element element = pIt.next();
|
||||||
|
title += element.text();
|
||||||
|
}
|
||||||
|
new BaseBean().writeLog("DoSaveContent2CurrentOperatorCmd-title11:"+title);
|
||||||
|
try{
|
||||||
|
if(title.contains("ñ")){
|
||||||
|
title = StringEscapeUtils.unescapeHtml4(title);
|
||||||
|
}
|
||||||
|
if(title.contains("ñ")){
|
||||||
|
title = title.replace("ñ", "ñ");
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
new BaseBean().writeLog("e1:"+e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("1".equals(isSelectValue) || "true".equals(isSelectValue)) {
|
||||||
|
if(userList.size() > 0){
|
||||||
|
for(int i= 0;i<userList.size();i++){
|
||||||
|
String receiverId = userList.get(i);
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-receiverId:"+receiverId);
|
||||||
|
if(StringUtils.isNotBlank(receiverId)){
|
||||||
|
String lastname = "";
|
||||||
|
String sql = "select lastname,workcode,systemlanguage from hrmresource where id=?" ;
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-sql:"+sql);
|
||||||
|
rs.executeQuery(sql, new Object[] { receiverId });
|
||||||
|
if (rs.next()){
|
||||||
|
lastname = rs.getString("lastname");
|
||||||
|
}
|
||||||
|
new BaseBean().writeLog("DoSaveContent2CurrentOperatorCmd-lastname:"+lastname);
|
||||||
|
|
||||||
|
if(StringUtils.isNotBlank(lastname)){
|
||||||
|
title = title.replace(lastname,lastname+" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String requestname = "";
|
||||||
|
String sql = "select requestname from workflow_requestbase where requestid = '"+requestid+"'" ;
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
requestname = Util.null2String(rs.getString("requestname"));
|
||||||
|
}
|
||||||
|
|
||||||
|
String warnColor = "";
|
||||||
|
String warnMsg = "";
|
||||||
|
sql = " select atys,atbt from uf_banner where xzlc='"+workflowid+"' ";
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-sql:"+sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
warnMsg = Util.null2String(rs.getString("atbt"));
|
||||||
|
warnColor = Util.null2String(rs.getString("atys"));
|
||||||
|
}
|
||||||
|
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-warnMsg:"+warnMsg);
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-warnColor:"+warnColor);
|
||||||
|
|
||||||
|
if(userList.size() > 0){
|
||||||
|
for(int i= 0;i<userList.size();i++){
|
||||||
|
String atResourceid = userList.get(i);
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-atResourceid:"+atResourceid);
|
||||||
|
|
||||||
|
// new CheckSendCardUtil().sendShareCard(""+user.getUID(), atResourceid, String.valueOf(requestid),requestname,title,warnMsg,warnColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-userList:"+userList.size());
|
||||||
|
if(userList.size() > 0){
|
||||||
|
// insertCurrentData(requestid + "", userList, nodeid, "8");
|
||||||
|
|
||||||
|
DoSave2CurrentDataRunnable doSave2CurrentDataRunnable = new DoSave2CurrentDataRunnable(requestid + "", userList, nodeid, "8");
|
||||||
|
new Thread(doSave2CurrentDataRunnable).start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
bb.writeLog("e:"+e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertCurrentData(String requestid, List<String> addUsers,String nodeid, String isremark) {
|
||||||
|
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
|
||||||
|
bb.writeLog("DoSaveContent2CurrentOperatorCmd-insert");
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("HH:mm:ss");
|
||||||
|
Date date = new Date();
|
||||||
|
String receivedate = simpleDateFormat.format(date);
|
||||||
|
String receivetime = simpleDateFormat1.format(date);
|
||||||
|
|
||||||
|
int showOrder = 0;
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
int groupid = 0 ;
|
||||||
|
String workflowid = "";
|
||||||
|
String workflowtype = "";
|
||||||
|
String currentNodeid = "";
|
||||||
|
String needwfback = "";
|
||||||
|
|
||||||
|
String sql = " select requestid,userid,groupid,workflowid,workflowtype,usertype,nodeid,agentorbyagentid,agenttype,showorder,receivedate,receivetime," +
|
||||||
|
" viewtype,iscomplete,islasttimes,groupdetailid,needwfback,isremark,preisremark,multiTakLevel " +
|
||||||
|
" from workflow_currentoperator where requestid=? and nodeid=? order by groupid desc" ;
|
||||||
|
rs.executeQuery(sql, requestid, nodeid);
|
||||||
|
if (rs.next()) {
|
||||||
|
groupid = Util.getIntValue(rs.getString("groupid"));
|
||||||
|
showOrder = rs.getInt("showorder") + 1;
|
||||||
|
workflowid = rs.getString("workflowid");
|
||||||
|
workflowtype = rs.getString("workflowtype");
|
||||||
|
currentNodeid = rs.getString("nodeid");
|
||||||
|
needwfback = rs.getString("needwfback");
|
||||||
|
}
|
||||||
|
bb.writeLog("groupid:"+groupid);
|
||||||
|
bb.writeLog("showOrder:"+showOrder);
|
||||||
|
bb.writeLog("workflowid:"+workflowid);
|
||||||
|
bb.writeLog("workflowtype:"+workflowtype);
|
||||||
|
bb.writeLog("currentNodeid:"+currentNodeid);
|
||||||
|
bb.writeLog("needwfback:"+needwfback);
|
||||||
|
|
||||||
|
try {
|
||||||
|
int errcount = 0;
|
||||||
|
for (String addUser : addUsers) {
|
||||||
|
groupid++;
|
||||||
|
|
||||||
|
String userIdTemp = addUser;
|
||||||
|
String agentorbyagentid = "-1";
|
||||||
|
String agenttype = "0";
|
||||||
|
int islasttimes = queryCurrentoperator(requestid,userIdTemp);
|
||||||
|
bb.writeLog("islasttimes:"+islasttimes);
|
||||||
|
String usertype = "0";
|
||||||
|
String viewtype = "0";
|
||||||
|
String groupdetailid = "0";
|
||||||
|
String preisremark = "98";
|
||||||
|
String is_complete = "0";
|
||||||
|
String newCurrentId = "";
|
||||||
|
String insertSql = " insert into workflow_currentoperator(requestid,userid,groupid,workflowid,workflowtype,usertype,nodeid,agentorbyagentid,agenttype,showorder,receivedate,receivetime,viewtype,iscomplete,groupdetailid,needwfback,isremark,preisremark,islasttimes) " +
|
||||||
|
" values('"+requestid+"','"+userIdTemp+"','"+groupid+"','"+workflowid+"','"+workflowtype+"','"+usertype+"','"+currentNodeid+"','"+agentorbyagentid+"','"+agenttype+"','"+showOrder+"','"+receivedate+"','"+receivetime+"','"+viewtype+"','"+is_complete+"','"+groupdetailid+"','"+needwfback+"','2','"+preisremark+"','"+islasttimes+"') ";
|
||||||
|
bb.writeLog("insertSql22:"+insertSql);
|
||||||
|
boolean isTrue = rs.execute(insertSql);
|
||||||
|
bb.writeLog("isTrue:"+isTrue);
|
||||||
|
if(isTrue) {
|
||||||
|
String cs_islasttimes = "";
|
||||||
|
sql = " select id,islasttimes from workflow_currentoperator where requestid = '"+requestid+"' and userid ='"+userIdTemp+"' and isremark ='"+isremark+"' and preisremark ='"+preisremark+"' order by id desc" ;
|
||||||
|
bb.writeLog("sql:"+sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if (rs.next()) {
|
||||||
|
newCurrentId = rs.getString("id");
|
||||||
|
cs_islasttimes = rs.getString("islasttimes");
|
||||||
|
}
|
||||||
|
bb.writeLog("newCurrentId:"+newCurrentId);
|
||||||
|
bb.writeLog("cs_islasttimes:"+cs_islasttimes);
|
||||||
|
if("".equals(newCurrentId)){
|
||||||
|
errcount++;
|
||||||
|
}else{
|
||||||
|
sql = " update workflow_currentoperator set islasttimes = '"+islasttimes+"' where requestid = '"+requestid+"' and userid = '"+userIdTemp+"' and id = '"+newCurrentId+"'" ;
|
||||||
|
bb.writeLog("sql:"+sql);
|
||||||
|
boolean isTrue2 = rs.execute(sql);
|
||||||
|
bb.writeLog("isTrue22:"+isTrue2);
|
||||||
|
if(isTrue2) {
|
||||||
|
String cs_islasttimes2 = "";
|
||||||
|
sql = " select id,islasttimes from workflow_currentoperator where requestid ='"+requestid+"' and userid ='"+userIdTemp+"' and isremark ='"+isremark+"' and preisremark ='"+preisremark+"' order by id desc" ;
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
bb.writeLog("sql:"+sql);
|
||||||
|
if (rs.next()) {
|
||||||
|
cs_islasttimes2 = rs.getString("islasttimes");
|
||||||
|
}
|
||||||
|
bb.writeLog("cs_islasttimes2:"+cs_islasttimes2);
|
||||||
|
}else{
|
||||||
|
errcount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
errcount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
bb.writeLog("errcount:"+errcount);
|
||||||
|
|
||||||
|
// if("1".equals(islasttimes)){
|
||||||
|
// rs3.executeUpdate("update workflow_currentoperator set islasttimes = 0 where requestid = ? and userid = ?", requestid, userIdTemp);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}catch (Exception e) {
|
||||||
|
bb.writeLog("e:"+e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int queryCurrentoperator(String requestid, String addUser){
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
BaseBean bb = new BaseBean();
|
||||||
|
int islasttimes = 0;
|
||||||
|
try{
|
||||||
|
int count = 0;
|
||||||
|
String sql = " select id from workflow_currentoperator where requestid = "+requestid+" and userid = "+addUser;
|
||||||
|
bb.writeLog("sql3:"+sql);
|
||||||
|
rs.executeQuery(sql);
|
||||||
|
if(rs.next()){
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
bb.writeLog("count:"+count);
|
||||||
|
if(count > 0){
|
||||||
|
String selectsql = " select userid, isremark,id from workflow_currentoperator where requestid=" + requestid + " and isremark in(0,1,5,7,11,8,9) and userid = '"+addUser+"' ";
|
||||||
|
bb.writeLog("sql4:"+sql);
|
||||||
|
rs.executeQuery(selectsql);
|
||||||
|
if (rs.next()) {
|
||||||
|
islasttimes = 0;
|
||||||
|
}else{
|
||||||
|
islasttimes = 1;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
islasttimes = 1;
|
||||||
|
}
|
||||||
|
bb.writeLog("islasttimes33:"+islasttimes);
|
||||||
|
}catch (Exception e){
|
||||||
|
bb.writeLog("e:"+e);
|
||||||
|
}
|
||||||
|
return islasttimes;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue