|
@@ -16,6 +16,7 @@ import com.idea.oa.flow2.service.FlowMainCcService;
|
|
|
import com.idea.oa.flow2.service.FlowMainPushService;
|
|
|
import com.idea.oa.flow2.service.FlowMainService;
|
|
|
import com.idea.util.DateUtils;
|
|
|
+import com.idea.util.OAUtil;
|
|
|
import com.idea.workPanel.enume.HandleTypeEnum;
|
|
|
import com.idea.workPanel.service.ParkWaitHandleService;
|
|
|
import com.rockstar.common.base.BaseController;
|
|
@@ -73,10 +74,9 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
private String serverUrl;
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 付款记录编号 : 付款领用单20240401-002
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping(value = "getMaxNum", produces = {"application/json;charset=UTF-8"})
|
|
@@ -107,8 +107,6 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
FlowMainPush flowMainPush = flowMainPushService.selectByPrimaryKey(addConfirmResult.getFlowMainPushId());
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
String isOkString = null;
|
|
|
{//进行审核判断
|
|
|
|
|
@@ -131,77 +129,82 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
if ("ok_end".equals(isOkString)) {
|
|
|
isEnd = true;
|
|
|
isAgree = true;
|
|
|
- }else {
|
|
|
- // TODO: 2024/11/21 和泛OA对接 推送信息
|
|
|
- FlowMain flowMain = flowMainService.selectByPrimaryKey(flowMainPush.getFlowMainId());
|
|
|
-
|
|
|
- String syscode = "CESHI";
|
|
|
- String flowId = flowMain.getId();
|
|
|
- String requestname = flowMain.getApplyTheme();
|
|
|
- String workflowname = ConstantFlowType.PAYMENT_NAME;
|
|
|
- String nodeName = flowMainPush.getNodeName();
|
|
|
- String pcurl = serverUrl;
|
|
|
- String appurl = "";
|
|
|
- String isremark = "0";
|
|
|
- String viewtype = "0";
|
|
|
- // TODO: 2024/11/15 创建者和接收者需求oa协商
|
|
|
- String creator = "";
|
|
|
- String receiver = "";
|
|
|
- String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
- String receivets = System.currentTimeMillis()+ "";
|
|
|
-
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("syscode",syscode);
|
|
|
- json.put("flowId",flowId);
|
|
|
- json.put("requestname",requestname);
|
|
|
- json.put("workflowname",workflowname);
|
|
|
- json.put("nodeName",nodeName);
|
|
|
- json.put("pcurl",pcurl);
|
|
|
- json.put("appurl",appurl);
|
|
|
- json.put("isremark",isremark);
|
|
|
- json.put("viewtype",viewtype);
|
|
|
- json.put("creator",creator);
|
|
|
- json.put("receiver",receiver);
|
|
|
- json.put("date",date);
|
|
|
- json.put("receivets",receivets);
|
|
|
-
|
|
|
-
|
|
|
- // 先处理待办
|
|
|
- String param = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId()
|
|
|
- + "&applyUser=" + flowMain.getApplyUser();
|
|
|
- parkWaitHandleService.userHandle(HandleTypeEnum.FK, param, ShiroUtils.getUserId());
|
|
|
-
|
|
|
- FlowMainPushExample flowMainPushExample = new FlowMainPushExample();
|
|
|
- flowMainPushExample.createCriteria().andFlowMainIdEqualTo(flowId).andStatusEqualTo(0);
|
|
|
- List<FlowMainPush> flowMainPushes = flowMainPushService.selectByExample(flowMainPushExample);
|
|
|
- if(CollectionUtils.isNotEmpty(flowMainPushes)){
|
|
|
- FlowMainPush push = flowMainPushes.get(0);
|
|
|
-
|
|
|
- // 给本系统下一个节点的人推送待办
|
|
|
- /**
|
|
|
- * 添加待办
|
|
|
- * @param title 显示标题
|
|
|
- * @param typeEnum 处理类型枚举
|
|
|
- * @param srcUserType 来源用户类型 0管理,1企业
|
|
|
- * @param srcUserId 来源用户id
|
|
|
- * @param srcUserName 来源用户名称
|
|
|
- * @param receiveUserId 接收用户id or 0=全部 or 角色id
|
|
|
- * @param routeParam 跳转携带参数,例: id=***&type=**
|
|
|
- */
|
|
|
- String title = flowMain.getApplyTheme();;
|
|
|
- HandleTypeEnum typeEnum = HandleTypeEnum.FK;
|
|
|
- Integer srcUserType = 0;//来源用户类型 0管理,1企业
|
|
|
- String srcUserId = ShiroUtils.getUserId();
|
|
|
- String srcUserName = ShiroUtils.getLoginName();
|
|
|
- String receiveUserId = push.getId();
|
|
|
- String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId()
|
|
|
- + "&applyUser=" + flowMain.getApplyUser();
|
|
|
- parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName,
|
|
|
- receiveUserId, routeParam);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ try {
|
|
|
+ // TODO: 2024/11/21 和泛微对接 推送信息
|
|
|
+ FlowMain flowMain = flowMainService.selectByPrimaryKey(flowMainPush.getFlowMainId());
|
|
|
+
|
|
|
+ String syscode = "AJ";
|
|
|
+ String flowId = flowMain.getId();
|
|
|
+ String requestname = flowMain.getApplyTheme();
|
|
|
+ String workflowname = ConstantFlowType.PAYMENT_NAME;
|
|
|
+ String nodeName = flowMainPush.getNodeName();
|
|
|
+ String pcurl = serverUrl;
|
|
|
+ String appurl = "";
|
|
|
+ String isremark = "0";
|
|
|
+ String viewtype = "0";
|
|
|
+ // TODO: 2024/11/15 创建者和接收者需求oa协商
|
|
|
+ String creator = "ceshi";
|
|
|
+ String receiver = "ceshi";
|
|
|
+ String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
+ String receivets = System.currentTimeMillis() + "";
|
|
|
+
|
|
|
+ Map map = new HashMap<String, Object>();
|
|
|
+ map.put("syscode", syscode);
|
|
|
+ map.put("flowid", flowId);
|
|
|
+ map.put("requestname", requestname);
|
|
|
+ map.put("workflowname", workflowname);
|
|
|
+ map.put("nodeName", nodeName);
|
|
|
+ map.put("pcurl", pcurl);
|
|
|
+ map.put("appurl", appurl);
|
|
|
+ map.put("creator", creator);
|
|
|
+ map.put("createdatetime", date);
|
|
|
+ map.put("receiver", receiver);
|
|
|
+ map.put("receivedatetime", date);
|
|
|
+ map.put("isremark", isremark);
|
|
|
+ map.put("viewtype", viewtype);
|
|
|
+ map.put("receivets", receivets);
|
|
|
+
|
|
|
+ log.info("泛微推送详情:{}", map);
|
|
|
+ String result = OAUtil.receiveRequestInfoByJson(map);
|
|
|
+ log.info("泛微推送结果:{}", result);
|
|
|
+
|
|
|
+ // 先处理待办
|
|
|
+ String param = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
|
|
|
+ parkWaitHandleService.userHandle(HandleTypeEnum.FK, param, ShiroUtils.getUserId());
|
|
|
+
|
|
|
+ FlowMainPushExample flowMainPushExample = new FlowMainPushExample();
|
|
|
+ flowMainPushExample.createCriteria().andFlowMainIdEqualTo(flowId).andStatusEqualTo(0);
|
|
|
+ List<FlowMainPush> flowMainPushes = flowMainPushService.selectByExample(flowMainPushExample);
|
|
|
+ if (CollectionUtils.isNotEmpty(flowMainPushes)) {
|
|
|
+ FlowMainPush push = flowMainPushes.get(0);
|
|
|
+
|
|
|
+ // 给本系统下一个节点的人推送待办
|
|
|
+ /**
|
|
|
+ * 添加待办
|
|
|
+ * @param title 显示标题
|
|
|
+ * @param typeEnum 处理类型枚举
|
|
|
+ * @param srcUserType 来源用户类型 0管理,1企业
|
|
|
+ * @param srcUserId 来源用户id
|
|
|
+ * @param srcUserName 来源用户名称
|
|
|
+ * @param receiveUserId 接收用户id or 0=全部 or 角色id
|
|
|
+ * @param routeParam 跳转携带参数,例: id=***&type=**
|
|
|
+ */
|
|
|
+ String title = flowMain.getApplyTheme();
|
|
|
+ HandleTypeEnum typeEnum = HandleTypeEnum.FK;
|
|
|
+ Integer srcUserType = 0;//来源用户类型 0管理,1企业
|
|
|
+ String srcUserId = ShiroUtils.getUserId();
|
|
|
+ String srcUserName = ShiroUtils.getLoginName();
|
|
|
+ String receiveUserId = push.getId();
|
|
|
+ String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
|
|
|
+ parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName, receiveUserId, routeParam);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("推送异常", e);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
//添加业务信息(将请假信息中的修改掉,剩余年假,剩余调休,冻结年假,冻结调休都修改掉)
|
|
@@ -213,8 +216,6 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 发起付款申请流程
|
|
|
*
|
|
@@ -230,7 +231,7 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
if (false) {
|
|
|
return AjaxResult.error("这是一个错误测试信息");
|
|
|
}
|
|
|
- return myaddApplyPayment(record,null);
|
|
|
+ return myaddApplyPayment(record, null);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -257,7 +258,7 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
flowMain1.setUpdatedBy(ShiroUtils.getUser().getId());
|
|
|
flowMainService.updateByPrimaryKeySelective(flowMain1);
|
|
|
}
|
|
|
- return myaddApplyPayment(record,"重新发起申请[" + record.getFlowMainId() + "],");
|
|
|
+ return myaddApplyPayment(record, "重新发起申请[" + record.getFlowMainId() + "],");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -266,7 +267,7 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
* @param record
|
|
|
* @return
|
|
|
*/
|
|
|
- public AjaxResult myaddApplyPayment(ApplyPaymentSettleIn record,String addSystemRemark) throws FlowException {
|
|
|
+ public AjaxResult myaddApplyPayment(ApplyPaymentSettleIn record, String addSystemRemark) throws FlowException {
|
|
|
|
|
|
|
|
|
String id = UUIDUtils.middleUUID();
|
|
@@ -284,14 +285,12 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
|
|
|
HashMap<String, Object> feeMoneyTotalMap = null;//new HashMap<>();
|
|
|
String applyTheme = "" + ShiroUtils.getUser().getTruename() + "的付款申请单";
|
|
|
- AjaxResult ajaxResult = flowMainService.doFlowMain(applyTheme, record.getId(), addSystemRemark, record.getCcList(),
|
|
|
- ConstantFlowType.PAYMENT_PROCESSDEFINE, ConstantFlowType.PAYMENT_DEPLOYMENTID,
|
|
|
- feeMoneyTotalMap, ConstantFlowType.PAYMENT_NAME, ConstantFlowType.PAYMENT,ShiroUtils.getUser());
|
|
|
+ AjaxResult ajaxResult = flowMainService.doFlowMain(applyTheme, record.getId(), addSystemRemark, record.getCcList(), ConstantFlowType.PAYMENT_PROCESSDEFINE, ConstantFlowType.PAYMENT_DEPLOYMENTID, feeMoneyTotalMap, ConstantFlowType.PAYMENT_NAME, ConstantFlowType.PAYMENT, ShiroUtils.getUser());
|
|
|
|
|
|
try {
|
|
|
|
|
|
// TODO: 2024/11/21 和泛OA对接 推送待办
|
|
|
- String syscode = "CESHI";
|
|
|
+ String syscode = "AJ";
|
|
|
String flowId = "";
|
|
|
String requestname = applyTheme;
|
|
|
String workflowname = ConstantFlowType.PAYMENT_NAME;
|
|
@@ -301,39 +300,44 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
String isremark = "0";
|
|
|
String viewtype = "0";
|
|
|
// TODO: 2024/11/15 创建者和接收者需求oa协商
|
|
|
- String creator = "";
|
|
|
- String receiver = "";
|
|
|
+ String creator = "ceshi";
|
|
|
+ String receiver = "ceshi";
|
|
|
String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
|
|
|
- String receivets = System.currentTimeMillis()+ "";
|
|
|
+ String receivets = System.currentTimeMillis() + "";
|
|
|
|
|
|
FlowMainExample flowMainExample = new FlowMainExample();
|
|
|
flowMainExample.createCriteria().andFormIdEqualTo(id).andFlowTypeEqualTo(ConstantFlowType.PAYMENT);
|
|
|
List<FlowMain> flowMains = flowMainService.selectByExample(flowMainExample);
|
|
|
- if(CollectionUtils.isNotEmpty(flowMains)){
|
|
|
+ if (CollectionUtils.isNotEmpty(flowMains)) {
|
|
|
FlowMain flowMain = flowMains.get(0);
|
|
|
flowId = flowMain.getId();
|
|
|
|
|
|
FlowMainPushExample flowMainPushExample = new FlowMainPushExample();
|
|
|
flowMainPushExample.createCriteria().andFlowMainIdEqualTo(flowId).andStatusEqualTo(0);
|
|
|
List<FlowMainPush> flowMainPushes = flowMainPushService.selectByExample(flowMainPushExample);
|
|
|
- if(CollectionUtils.isNotEmpty(flowMainPushes)){
|
|
|
+ if (CollectionUtils.isNotEmpty(flowMainPushes)) {
|
|
|
FlowMainPush flowMainPush = flowMainPushes.get(0);
|
|
|
nodeName = flowMainPush.getNodeName();
|
|
|
|
|
|
- JSONObject json = new JSONObject();
|
|
|
- json.put("syscode",syscode);
|
|
|
- json.put("flowId",flowId);
|
|
|
- json.put("requestname",requestname);
|
|
|
- json.put("workflowname",workflowname);
|
|
|
- json.put("nodeName",nodeName);
|
|
|
- json.put("pcurl",pcurl);
|
|
|
- json.put("appurl",appurl);
|
|
|
- json.put("isremark",isremark);
|
|
|
- json.put("viewtype",viewtype);
|
|
|
- json.put("creator",creator);
|
|
|
- json.put("receiver",receiver);
|
|
|
- json.put("date",date);
|
|
|
- json.put("receivets",receivets);
|
|
|
+ Map map = new HashMap<String, Object>();
|
|
|
+ map.put("syscode", syscode);
|
|
|
+ map.put("flowid", flowId);
|
|
|
+ map.put("requestname", requestname);
|
|
|
+ map.put("workflowname", workflowname);
|
|
|
+ map.put("nodeName", nodeName);
|
|
|
+ map.put("pcurl", pcurl);
|
|
|
+ map.put("appurl", appurl);
|
|
|
+ map.put("creator", creator);
|
|
|
+ map.put("createdatetime", date);
|
|
|
+ map.put("receiver", receiver);
|
|
|
+ map.put("receivedatetime", date);
|
|
|
+ map.put("isremark", isremark);
|
|
|
+ map.put("viewtype", viewtype);
|
|
|
+ map.put("receivets", receivets);
|
|
|
+
|
|
|
+ log.info("泛微推送详情:{}", map);
|
|
|
+ String result = OAUtil.receiveRequestInfoByJson(map);
|
|
|
+ log.info("泛微推送结果:{}", result);
|
|
|
|
|
|
// 给本系统下一个节点的人推送待办
|
|
|
/**
|
|
@@ -352,24 +356,19 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
String srcUserId = ShiroUtils.getUserId();
|
|
|
String srcUserName = ShiroUtils.getLoginName();
|
|
|
String receiveUserId = flowMainPush.getPushUser();
|
|
|
- String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();;
|
|
|
- parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName,
|
|
|
- receiveUserId, routeParam);
|
|
|
+ String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
|
|
|
+ ;
|
|
|
+ parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName, receiveUserId, routeParam);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
- log.error("发起流程后续报错",e);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("推送异常", e);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
if (ajaxResult.get("code").equals(1688)) {
|
|
|
// //表成功了 且已经审核完成
|
|
|
//// 需要进行后续的处理
|
|
@@ -424,7 +423,6 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 根据主表的FlowMainId获取信息
|
|
|
*
|