|
|
|
@ -1409,6 +1409,17 @@ public class QyWxOperationService { |
|
|
|
// 获取当前出库单是2代表是通过开放仓库申请1代表不是
|
|
|
|
Integer flagForOpenDepository = mainRecord.getFlagForOpenDepository(); |
|
|
|
|
|
|
|
// 获取当前出库单是否为代领(1是2不是)
|
|
|
|
int flagForAgency = mainRecord.getFlagForAgency(); |
|
|
|
|
|
|
|
// 定义申请人(默认为发起人)
|
|
|
|
UserByPort applicantUser = userToken; |
|
|
|
|
|
|
|
if (flagForAgency == 1) { |
|
|
|
// 如果是代领
|
|
|
|
applicantUser = LinkInterfaceUtil.FindUserById(mainRecord.getApplicantId(), userKey, token); |
|
|
|
|
|
|
|
} |
|
|
|
// 事先定义其他部门负责人列表
|
|
|
|
List<String> otherDepartmentIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
@ -1418,9 +1429,9 @@ public class QyWxOperationService { |
|
|
|
ApprovalTemplate approvalTemplate = new ApprovalTemplate(); |
|
|
|
|
|
|
|
// 获取申请人的userId
|
|
|
|
String workwechat = userToken.getWorkwechat(); |
|
|
|
String workwechat = applicantUser.getWorkwechat(); |
|
|
|
if (workwechat == null || "".equals(workwechat)) { |
|
|
|
workwechat = userToken.getWechat(); |
|
|
|
workwechat = applicantUser.getWechat(); |
|
|
|
} |
|
|
|
// 设置申请人
|
|
|
|
approvalTemplate.setCreator_userid(workwechat); |
|
|
|
@ -1437,7 +1448,7 @@ public class QyWxOperationService { |
|
|
|
|
|
|
|
|
|
|
|
List<String> userIdList = new ArrayList<>(); |
|
|
|
List<UserByPort> departmentHeadForUserToken = PublicConfig.findDepartmentHeadByUser(userToken.getMaindeparment(), userKey, token); |
|
|
|
List<UserByPort> departmentHeadForUserToken = PublicConfig.findDepartmentHeadByUser(applicantUser.getMaindeparment(), userKey, token); |
|
|
|
for (UserByPort departmentHead : departmentHeadForUserToken |
|
|
|
) { |
|
|
|
String departmentHeadWorkwechat = departmentHead.getWorkwechat(); |
|
|
|
@ -1448,7 +1459,7 @@ public class QyWxOperationService { |
|
|
|
} |
|
|
|
|
|
|
|
// 获取当前登录用户部门与企业微信部门对照
|
|
|
|
JSONObject userPortByQyWx = PublicConfig.getUserPortByQyWx(userToken.getMaindeparment()); |
|
|
|
JSONObject userPortByQyWx = PublicConfig.getUserPortByQyWx(applicantUser.getMaindeparment()); |
|
|
|
String portName = userPortByQyWx.getString("name"); |
|
|
|
Integer portByQyWxInteger = userPortByQyWx.getInteger("wechatorganizationid"); |
|
|
|
|
|
|
|
|