|
@@ -1,5 +1,10 @@
|
|
|
package com.idea.oa.apply.controller;
|
|
|
|
|
|
+import cn.hutool.core.codec.Base64;
|
|
|
+import cn.hutool.core.util.CharsetUtil;
|
|
|
+import cn.hutool.crypto.SecureUtil;
|
|
|
+import cn.hutool.crypto.symmetric.AES;
|
|
|
+import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
@@ -31,6 +36,7 @@ import com.rockstar.shiro.util.ShiroUtils;
|
|
|
import com.rockstar.util.UUIDUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.codec.digest.DigestUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -75,6 +81,9 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
|
|
|
@Value("${serverUrl}")
|
|
|
private String serverUrl;
|
|
|
+ @Value("${ssoKey}")
|
|
|
+ private String ssoKey;
|
|
|
+
|
|
|
@Autowired
|
|
|
private FramePermissionService framePermissionService;
|
|
|
|
|
@@ -144,7 +153,6 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
String flowId = flowMain.getId();
|
|
|
// 进行审核操作后 就要处理待办 清除数据
|
|
|
String param = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
|
|
|
- HandleTypeEnum.FK.setUrl(waitUrl);
|
|
|
parkWaitHandleService.userHandle(HandleTypeEnum.FK, param, ShiroUtils.getUserId());
|
|
|
|
|
|
Boolean isEnd = false;//是否结束
|
|
@@ -159,43 +167,6 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
} else {
|
|
|
|
|
|
try {
|
|
|
- // TODO: 2024/11/21 和泛微对接 推送信息
|
|
|
-
|
|
|
- String syscode = "AJ";
|
|
|
- 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);
|
|
|
-
|
|
|
-
|
|
|
FlowMainPushExample flowMainPushExample = new FlowMainPushExample();
|
|
|
flowMainPushExample.createCriteria().andFlowMainIdEqualTo(flowId).andStatusEqualTo(0);
|
|
|
List<FlowMainPush> flowMainPushes = flowMainPushService.selectByExample(flowMainPushExample);
|
|
@@ -220,7 +191,46 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
String srcUserName = ShiroUtils.getUser().getTruename();
|
|
|
String receiveUserId = push.getPushUser();
|
|
|
String routeParam = "id=" + flowId + "&flowMainPushId=" + push.getId() + "&applyUser=" + flowMain.getApplyUser();
|
|
|
+ HandleTypeEnum.FK.setUrl(waitUrl);
|
|
|
parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName, receiveUserId, routeParam);
|
|
|
+
|
|
|
+ // TODO: 2024/11/21 和泛微对接 推送信息
|
|
|
+ FrameUser receiveUser = frameUserService.selectByPrimaryKey(receiveUserId);
|
|
|
+ String username = encryptUsername(receiveUser.getUsername());
|
|
|
+ String syscode = "AJ";
|
|
|
+ String requestname = flowMain.getApplyTheme();
|
|
|
+ String workflowname = ConstantFlowType.PAYMENT_NAME;
|
|
|
+ String nodeName = flowMainPush.getNodeName();
|
|
|
+ String pcurl = serverUrl + "&loginid=" + username;
|
|
|
+ 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);
|
|
|
+
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("推送异常", e);
|
|
@@ -311,21 +321,8 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
|
|
|
try {
|
|
|
|
|
|
- // TODO: 2024/11/21 和泛OA对接 推送待办
|
|
|
- String syscode = "AJ";
|
|
|
String flowId = "";
|
|
|
- String requestname = applyTheme;
|
|
|
- String workflowname = ConstantFlowType.PAYMENT_NAME;
|
|
|
String nodeName = "";
|
|
|
- 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() + "";
|
|
|
|
|
|
FlowMainExample flowMainExample = new FlowMainExample();
|
|
|
flowMainExample.createCriteria().andFormIdEqualTo(id).andFlowTypeEqualTo(ConstantFlowType.PAYMENT);
|
|
@@ -341,26 +338,6 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
FlowMainPush flowMainPush = flowMainPushes.get(0);
|
|
|
nodeName = flowMainPush.getNodeName();
|
|
|
|
|
|
- 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);
|
|
|
-
|
|
|
// 给本系统下一个节点的人推送待办
|
|
|
/**
|
|
|
* 添加待办
|
|
@@ -372,6 +349,24 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
* @param receiveUserId 接收用户id or 0=全部 or 角色id
|
|
|
* @param routeParam 跳转携带参数,例: id=***&type=**
|
|
|
*/
|
|
|
+
|
|
|
+ String waitUrl = "";
|
|
|
+ // 查询待办页面的 菜单id
|
|
|
+ FramePermissionExample framePermissionExample = new FramePermissionExample();
|
|
|
+ framePermissionExample.createCriteria().andNameEqualTo("流程审批");
|
|
|
+ List<FramePermission> framePermissions = framePermissionService.selectByExample(framePermissionExample);
|
|
|
+ if (CollectionUtils.isNotEmpty(framePermissions)) {
|
|
|
+ String menuIndex = framePermissions.get(0).getId();
|
|
|
+ FramePermissionExample permissionExample = new FramePermissionExample();
|
|
|
+ permissionExample.createCriteria().andNameEqualTo("付款审批流程");
|
|
|
+ List<FramePermission> permissions = framePermissionService.selectByExample(framePermissionExample);
|
|
|
+ if (CollectionUtils.isNotEmpty(permissions)){
|
|
|
+ String subMenu = permissions.get(0).getId();
|
|
|
+ waitUrl = "/backstage?menuIndex=" + menuIndex + "&subMenu=" + subMenu;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
String title = applyTheme;
|
|
|
HandleTypeEnum typeEnum = HandleTypeEnum.FK;
|
|
|
Integer srcUserType = 0;//来源用户类型 0管理,1企业
|
|
@@ -379,9 +374,44 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
String srcUserName = ShiroUtils.getUser().getTruename();
|
|
|
String receiveUserId = flowMainPush.getPushUser();
|
|
|
String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
|
|
|
- ;
|
|
|
+ HandleTypeEnum.FK.setUrl(waitUrl);
|
|
|
parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName, receiveUserId, routeParam);
|
|
|
|
|
|
+ // TODO: 2024/11/21 和泛OA对接 推送待办
|
|
|
+ FrameUser receiveUser = frameUserService.selectByPrimaryKey(receiveUserId);
|
|
|
+ String username = encryptUsername(receiveUser.getUsername());
|
|
|
+ String syscode = "AJ";
|
|
|
+ String requestname = applyTheme;
|
|
|
+ String workflowname = ConstantFlowType.PAYMENT_NAME;
|
|
|
+ String pcurl = serverUrl + "&loginid=" + username;
|
|
|
+ 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);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -531,4 +561,20 @@ public class ApplyPaymentSettleController extends BaseController {
|
|
|
// }
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 加密用户名
|
|
|
+ * @param username
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public String encryptUsername(String username){
|
|
|
+
|
|
|
+ byte[] key = Base64.decode(ssoKey);
|
|
|
+ // 构建
|
|
|
+ AES aes = SecureUtil.aes(key);
|
|
|
+ return aes.encryptHex(username);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|