员工上下班配置
This commit is contained in:
parent
8c05a17824
commit
499cfe461d
@ -196,15 +196,17 @@
|
||||
var phaseName=routeJson.route[i].phaseName;
|
||||
var userInfo=routeJson.route[i].userInfo;
|
||||
var flowOperatorType=routeJson.route[i].flowUserOperatorType;
|
||||
var vUser=userInfo.split("@");
|
||||
actionSet.append("<div style='margin-top:10px;margin-left:15px;font-size:12px;'><font color='#000000'><b>ÇëÑ¡Ôñ"+phaseName+"Óû§£º</b></font></div><div id='phaseaction"+cindex+"' style='margin-top:10px;margin-left:10px;font-size:12px;border:1px solid lightgray;padding:5px;'></div>");
|
||||
var userarr = AsControl.RunJavaMethodTrans("com.tenwa.voucher.CreateVoucherProcess.CommutingToWork","FilterUserinfo","userinfo="+userInfo);
|
||||
var vUser=userarr.split("@");
|
||||
console.log("==============",userInfo,userarr,vUser);
|
||||
actionSet.append("<div style='margin-top:10px;margin-left:15px;font-size:12px;'><font color='#000000'><b>ÇëÑ¡Ôñ"+phaseName+"Óû§£º</b></font></div><div id='phaseaction"+cindex+"' style='margin-top:10px;margin-left:10px;font-size:12px;border:1px solid lightgray;padding:5px;'></div>");
|
||||
var phaseAction = $("#phaseaction"+cindex);
|
||||
var type = "radio";
|
||||
|
||||
if(flowOperatorType!="01"){type="checkbox";}
|
||||
for(var i=0;i<vUser.length;i++){
|
||||
var vUserinfo=vUser[i].split(" ");
|
||||
phaseAction.append("<a class='opinion-style' style='width:100' href='javascript:void(0)' ><label><input type='"+type+"' name='phaseaction"+cindex+"' value='"+vUser[i]+"'>"+vUserinfo[1]+"</input></label></a>");
|
||||
phaseAction.append("<a class='opinion-style' style='width:100' href='javascript:void(0)' ><label><input type='"+type+"' name='phaseaction"+cindex+"' value='"+vUser[i]+"'>"+vUserinfo[1]+"</input></label></a>");
|
||||
}
|
||||
if(vUser.length==1&&type=="radio"){
|
||||
$("input[name=phaseaction"+cindex+"]:first").attr("checked",true);
|
||||
|
||||
@ -68,9 +68,11 @@ for(String role : roles) {
|
||||
var user=$($('#main_userinfo td').eq(3).html()).val();
|
||||
var card = "";
|
||||
card ='<a href="javascript:void(0)" onclick="return false;">'+user+'</a>';
|
||||
var but = " <a onclick=gotowork()>上班</a> <a onclick=afterwork()>下班</a>";
|
||||
//var button = "<button style=background-color:#DDFFFF; type='button' onclick='AsButton.run(this, function(){ModifyPass();}, event);return false;'>上班</button><button style=background-color:#00FF00; type='button' onclick='AsButton.run(this, function(){ModifyPass();}, event);return false;'>下班</button>"
|
||||
// $('#main_userinfo a').remove();
|
||||
$('#main_userinfo').children().first().remove();
|
||||
$('#main_userinfo').append(card);
|
||||
$('#main_userinfo').append(card).append(but);
|
||||
trs.css("display","none");
|
||||
});
|
||||
function setFlowOperatorUser(){
|
||||
@ -92,6 +94,23 @@ for(String role : roles) {
|
||||
$("#messageNumber").text("消息("+cnumber+")");
|
||||
}
|
||||
}
|
||||
|
||||
function gotowork(){
|
||||
var res = AsControl.RunJavaMethodTrans("com.tenwa.voucher.CreateVoucherProcess.CommutingToWork","CommutingToWorkMethod","userid=<%=CurUser.getUserID()%>,type = 1");
|
||||
if(res=="true"){
|
||||
alert("开始上班");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function afterwork(){
|
||||
var res = AsControl.RunJavaMethodTrans("com.tenwa.voucher.CreateVoucherProcess.CommutingToWork","CommutingToWorkMethod","userid=<%=CurUser.getUserID()%>,type = 2");
|
||||
if(res=="true"){
|
||||
alert("工作结束");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
<!-- 暂时不提供站内信 by zhulh 2018/07/17 -->
|
||||
/* $(function(){
|
||||
setInterval("getMessageNumber()",10000);
|
||||
|
||||
@ -0,0 +1,111 @@
|
||||
package com.tenwa.voucher.CreateVoucherProcess;
|
||||
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.SqlObject;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.tenwa.reckon.util.Conn;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class CommutingToWork {
|
||||
|
||||
private String userid;
|
||||
|
||||
public String getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
|
||||
public void setUserid(String userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
private String userinfo;
|
||||
|
||||
public String getUserinfo() {
|
||||
return userinfo;
|
||||
}
|
||||
|
||||
|
||||
public void setUserinfo(String userinfo) {
|
||||
this.userinfo = userinfo;
|
||||
}
|
||||
|
||||
private static String REGEX_CHINESE = "[\u4e00-\u9fa5]";
|
||||
|
||||
|
||||
public String CommutingToWorkMethod(JBOTransaction tx) throws Exception{
|
||||
|
||||
try {
|
||||
tx= JBOFactory.createJBOTransaction();
|
||||
Transaction sqlca = Transaction.createTransaction(tx);
|
||||
String sql = "";
|
||||
if(type.equals("1")){
|
||||
sql = "update USER_TASK_INFO set induction_state = 'induction_state01' where userid = '"+userid+"'";
|
||||
}else {
|
||||
sql = "update USER_TASK_INFO set induction_state = 'induction_state02' where userid = '"+userid+"'";
|
||||
}
|
||||
SqlObject sqlObject = new SqlObject(sql);
|
||||
sqlca.executeSQL(sqlObject);
|
||||
tx.commit();
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return "falser";
|
||||
}
|
||||
|
||||
return "true";
|
||||
}
|
||||
|
||||
|
||||
public String FilterUserinfo(JBOTransaction tx) throws Exception{
|
||||
|
||||
List<String> userlist = new ArrayList<>(Arrays.asList(userinfo.split("@")));
|
||||
|
||||
String userarr = "";
|
||||
List<String> userarry = new ArrayList<>();
|
||||
Conn conn = new Conn(tx);
|
||||
|
||||
for(int i = userlist.size() - 1; i >= 0; i--){
|
||||
String user = userlist.get(i);
|
||||
Matcher matcher = Pattern.compile(REGEX_CHINESE).matcher(user);
|
||||
String userid = matcher.replaceAll("");
|
||||
String sql = "select case when instr(GROUP_CONCAT(induction_state),'induction_state02')>0 then 'false' else 'true' end as bo from USER_TASK_INFO where userid = '"+userid+"'";
|
||||
List<Map<String, String>> info = conn.executeQuery(sql);
|
||||
if(info.get(0).get("bo").equals("false")){
|
||||
userlist.remove(user);
|
||||
}else {
|
||||
userarry.add(user);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = userarry.size()-1; i >= 0; i--) {
|
||||
if(i==0){
|
||||
userarr = userarr + userarry.get(i);
|
||||
}else{
|
||||
userarr = userarr + userarry.get(i) + "@";
|
||||
}
|
||||
}
|
||||
|
||||
return userarr;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user