#出差、补班、公出流程推送数据Action
parent
5b0f51fc5e
commit
f71da2b364
@ -0,0 +1,110 @@
|
||||
package weaver.interfaces.kr.workflow.action;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.kr.entity.kq.KqActionBO;
|
||||
import com.engine.kr.entity.kq.KqGlobal;
|
||||
import com.engine.kr.enums.KqInteractiveEnum;
|
||||
import com.engine.kr.service.impl.KqInteractiveServiceImpl;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 康瑞-出差申请流程-Action
|
||||
*
|
||||
* @author wangj
|
||||
* @version 1.00版本
|
||||
* @Date 2023/6/5
|
||||
*/
|
||||
public class KrCCLeaveCreateAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
String personId = "";
|
||||
String startDate = "";
|
||||
String startTime = "";
|
||||
String endDate = "";
|
||||
String endTime = "";
|
||||
String leaveDuration = "";
|
||||
String leaveReason = "";
|
||||
String billNo = "";
|
||||
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
String value = property.getValue();
|
||||
switch (name) {
|
||||
case "resourceId":
|
||||
personId = value;
|
||||
break;
|
||||
case "lcbh":
|
||||
billNo = value;
|
||||
break;
|
||||
case "ksrq":
|
||||
startDate = value;
|
||||
break;
|
||||
case "kssj":
|
||||
startTime = value;
|
||||
break;
|
||||
case "jsrq":
|
||||
endDate = value;
|
||||
break;
|
||||
case "jssj":
|
||||
endTime = value;
|
||||
break;
|
||||
case "ccsc":
|
||||
leaveDuration = value;
|
||||
break;
|
||||
case "ccsy":
|
||||
leaveReason = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
Map<String, String> operateDateTime = KqActionBO.getOperateDateTime(requestInfo.getRequestid());
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("token", new KqInteractiveServiceImpl().getToken());
|
||||
params.put("personId", KqActionBO.getWorkCode(personId));
|
||||
params.put("billNo", billNo);
|
||||
params.put("dayoffType", KqActionBO.getLeaveTypeCode("13"));
|
||||
params.put("beginDate", startDate);
|
||||
params.put("beginTime", startTime);
|
||||
params.put("endDate", endDate);
|
||||
params.put("endTime", endTime);
|
||||
params.put("billHours", leaveDuration);
|
||||
params.put("runsNo", null);
|
||||
params.put("inout", null);
|
||||
params.put("incHoli", null);
|
||||
params.put("dayoffReason", leaveReason);
|
||||
params.put("addBy", requestInfo.getCreatorid());
|
||||
params.put("addDay", operateDateTime.get("addDay"));
|
||||
params.put("cfmBy", KqActionBO.getUserName(requestInfo.getLastoperator()));
|
||||
params.put("cfmDay", operateDateTime.get("addDay"));
|
||||
// 1新增、2变动、3取消
|
||||
params.put("billStat", 1);
|
||||
|
||||
new BaseBean().writeLog("########出差流程,requestid={" + requestInfo.getRequestid() + "],传参:"+ JSON.toJSONString(params));
|
||||
|
||||
String returnStr = HttpUtil.post(KqGlobal.POST_URL + KqInteractiveEnum.LEAVE_CREATE.getPostPath(), params);
|
||||
new BaseBean().writeLog("########出差流程,requestid={" + requestInfo.getRequestid() + "],接口响应数据:"+ returnStr);
|
||||
JSONObject jsonObject = JSONObject.parseObject(returnStr);
|
||||
String code = jsonObject.getString("code");
|
||||
if (KqGlobal.SUC_CODE.equals(code)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
requestInfo.getRequestManager().setMessagecontent(jsonObject.getString("msg"));
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package weaver.interfaces.kr.workflow.action;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.kr.entity.kq.KqActionBO;
|
||||
import com.engine.kr.entity.kq.KqGlobal;
|
||||
import com.engine.kr.enums.KqInteractiveEnum;
|
||||
import com.engine.kr.service.impl.KqInteractiveServiceImpl;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 康瑞-公出申请流程-Action
|
||||
*
|
||||
* @author wangj
|
||||
* @version 1.00版本
|
||||
* @Date 2023/6/5
|
||||
*/
|
||||
public class KrGCLeaveCreateAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
String personId = "";
|
||||
String startDate = "";
|
||||
String startTime = "";
|
||||
String endDate = "";
|
||||
String endTime = "";
|
||||
String leaveDuration = "";
|
||||
String leaveReason = "";
|
||||
String billNo = "";
|
||||
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
String value = property.getValue();
|
||||
switch (name) {
|
||||
case "resourceId":
|
||||
personId = value;
|
||||
break;
|
||||
case "lcbh":
|
||||
billNo = value;
|
||||
break;
|
||||
case "fromDate":
|
||||
startDate = value;
|
||||
break;
|
||||
case "fromTime":
|
||||
startTime = value;
|
||||
break;
|
||||
case "toDate":
|
||||
endDate = value;
|
||||
break;
|
||||
case "toTime":
|
||||
endTime = value;
|
||||
break;
|
||||
case "duration":
|
||||
leaveDuration = value;
|
||||
break;
|
||||
case "gcsy":
|
||||
leaveReason = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
Map<String, String> operateDateTime = KqActionBO.getOperateDateTime(requestInfo.getRequestid());
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("token", new KqInteractiveServiceImpl().getToken());
|
||||
params.put("personId", KqActionBO.getWorkCode(personId));
|
||||
params.put("billNo", billNo);
|
||||
params.put("dayoffType", KqActionBO.getLeaveTypeCode("14"));
|
||||
params.put("beginDate", startDate);
|
||||
params.put("beginTime", startTime);
|
||||
params.put("endDate", endDate);
|
||||
params.put("endTime", endTime);
|
||||
params.put("billHours", leaveDuration);
|
||||
params.put("runsNo", null);
|
||||
params.put("inout", null);
|
||||
params.put("incHoli", null);
|
||||
params.put("dayoffReason", leaveReason);
|
||||
params.put("addBy", requestInfo.getCreatorid());
|
||||
params.put("addDay", operateDateTime.get("addDay"));
|
||||
params.put("cfmBy", KqActionBO.getUserName(requestInfo.getLastoperator()));
|
||||
params.put("cfmDay", operateDateTime.get("addDay"));
|
||||
// 1新增、2变动、3取消
|
||||
params.put("billStat", 1);
|
||||
|
||||
new BaseBean().writeLog("########公出流程,requestid={" + requestInfo.getRequestid() + "],传参:"+ JSON.toJSONString(params));
|
||||
|
||||
String returnStr = HttpUtil.post(KqGlobal.POST_URL + KqInteractiveEnum.LEAVE_CREATE.getPostPath(), params);
|
||||
new BaseBean().writeLog("########公出流程,requestid={" + requestInfo.getRequestid() + "],接口响应数据:"+ returnStr);
|
||||
JSONObject jsonObject = JSONObject.parseObject(returnStr);
|
||||
String code = jsonObject.getString("code");
|
||||
if (KqGlobal.SUC_CODE.equals(code)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
requestInfo.getRequestManager().setMessagecontent(jsonObject.getString("msg"));
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package weaver.interfaces.kr.workflow.action;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.kr.entity.kq.KqActionBO;
|
||||
import com.engine.kr.entity.kq.KqGlobal;
|
||||
import com.engine.kr.enums.KqInteractiveEnum;
|
||||
import com.engine.kr.service.impl.KqInteractiveServiceImpl;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 康瑞-补卡申请流程-推送签卡数据Action
|
||||
*
|
||||
* @author wangj
|
||||
* @version 1.00版本
|
||||
* @Date 2023/6/5
|
||||
*/
|
||||
|
||||
public class KrSignCreateAction implements Action {
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
//单据编号
|
||||
String billNo = "";
|
||||
//申请人id
|
||||
String personId = "";
|
||||
//主表数据
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
for (Property property : properties) {
|
||||
String name = property.getName();
|
||||
String value = property.getValue();
|
||||
switch (name) {
|
||||
case "resourceId":
|
||||
personId = KqActionBO.getWorkCode(value);
|
||||
break;
|
||||
case "lcbh":
|
||||
billNo = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
String token = new KqInteractiveServiceImpl().getToken();
|
||||
String cfmBy = KqActionBO.getUserName(requestInfo.getLastoperator());
|
||||
Map<String, String> operateDateTime = KqActionBO.getOperateDateTime(requestInfo.getRequestid());
|
||||
|
||||
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
|
||||
DetailTable detailTable = detailTableInfo.getDetailTable()[0];
|
||||
Row[] rows = detailTable.getRow();
|
||||
boolean isRun = true;
|
||||
int index = 1;
|
||||
for (Row row : rows) {
|
||||
if (!isRun) {
|
||||
break;
|
||||
}
|
||||
String signDate = "";
|
||||
String signTime1 = "";
|
||||
|
||||
String signReason = "";
|
||||
|
||||
Cell[] cells = row.getCell();
|
||||
for (Cell cell : cells) {
|
||||
String name = cell.getName();
|
||||
String value = cell.getValue();
|
||||
switch (name) {
|
||||
case "detail_signdate":
|
||||
signDate = value;
|
||||
break;
|
||||
case "detail_signtime":
|
||||
signTime1 = value;
|
||||
break;
|
||||
case "bksm":
|
||||
signReason = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 每一行发起一次请求
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("token", token);
|
||||
params.put("personId", personId);
|
||||
params.put("billNo", billNo + "-" + index);
|
||||
params.put("signDate", signDate);
|
||||
params.put("signTime1", signTime1);
|
||||
params.put("signTime2", null);
|
||||
params.put("signTime3", null);
|
||||
params.put("signTime4", null);
|
||||
params.put("signTime5", null);
|
||||
params.put("signTime6", null);
|
||||
|
||||
params.put("signReason", signReason);
|
||||
params.put("addBy", requestInfo.getCreatorid());
|
||||
params.put("addDay", operateDateTime.get("addDay"));
|
||||
params.put("cfmBy", cfmBy);
|
||||
params.put("cfmDay", operateDateTime.get("cfmDay"));
|
||||
// 1新增、2变动、3取消
|
||||
params.put("billStat", 1);
|
||||
new BaseBean().writeLog("########批量补卡申请流程,requestid={" + requestInfo.getRequestid() + "],传参:" + JSON.toJSONString(params));
|
||||
|
||||
String returnStr = HttpUtil.post(KqGlobal.POST_URL + KqInteractiveEnum.SIGN_CREATE.getPostPath(), params);
|
||||
new BaseBean().writeLog("########批量补卡申请流程,requestid={" + requestInfo.getRequestid() + "],接口响应数据:" + returnStr);
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(returnStr);
|
||||
String code = jsonObject.getString("code");
|
||||
if (!KqGlobal.SUC_CODE.equals(code)) {
|
||||
requestInfo.getRequestManager().setMessagecontent(jsonObject.getString("msg"));
|
||||
isRun = false;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
if (isRun) {
|
||||
return SUCCESS;
|
||||
}
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue