Browse Source

为出库审批完成后添加抄送人

lwx_dev
erdanergou 2 years ago
parent
commit
36bc59174f
  1. 33
      src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java

33
src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java

@ -1422,6 +1422,11 @@ public class QyWxOperationService {
// 事先定义其他部门负责人列表
List<String> otherDepartmentIdList = new ArrayList<>();
// 设置抄送人id列表
List<String> notifyerList = new ArrayList<>();
// 获取当前出库明细
List<ApplicationOutRecordMin> minRecordList = depositoryRecordMapper.findApplicationOutRecordMinByParent(mainId);
// 定义审批模板
@ -1432,6 +1437,10 @@ public class QyWxOperationService {
if (workwechat == null || "".equals(workwechat)) {
workwechat = applicantUser.getWechat();
}
// 将申请人添加到抄送列表
notifyerList.add(workwechat);
// 设置申请人
approvalTemplate.setCreator_userid(workwechat);
@ -1789,14 +1798,17 @@ public class QyWxOperationService {
departmentHeadWorkwechat = departmentHead.getWechat();
}
userIdList.add(departmentHeadWorkwechat);
notifyerList.add(departmentHeadWorkwechat);
}
} else if (flag == 12) {
}
else if (flag == 12) {
// 如果是备品备件库
// 获取申请用户所在部门的设备员
List<UserByPort> userByPortList = PublicConfig.findUserByAdminorgAndPosition(applicantUser.getMaindeparment(), "设备员", userKey, token);
List<UserByPort> departmentHeadForUserToken = PublicConfig.findDepartmentHeadByUser(applicantUser.getMaindeparment(), userKey, token);
if (userByPortList.size() > 0) {
// 如果有设备员
for (UserByPort userByPort : userByPortList) {
@ -1804,23 +1816,40 @@ public class QyWxOperationService {
if (other_workwechat == null || "".equals(other_workwechat)) {
other_workwechat = userByPort.getWechat();
}
// 添加到审批节点
userIdList.add(other_workwechat);
// 添加到抄送节点
notifyerList.add(other_workwechat);
}
for (UserByPort departmentHead : departmentHeadForUserToken
) {
String departmentHeadWorkwechat = departmentHead.getWorkwechat();
if (departmentHeadWorkwechat == null || "".equals(departmentHeadWorkwechat)) {
departmentHeadWorkwechat = departmentHead.getWechat();
}
// 添加到抄送节点
notifyerList.add(departmentHeadWorkwechat);
}
} else {
// 如果没有
List<UserByPort> departmentHeadForUserToken = PublicConfig.findDepartmentHeadByUser(applicantUser.getMaindeparment(), userKey, token);
for (UserByPort departmentHead : departmentHeadForUserToken
) {
String departmentHeadWorkwechat = departmentHead.getWorkwechat();
if (departmentHeadWorkwechat == null || "".equals(departmentHeadWorkwechat)) {
departmentHeadWorkwechat = departmentHead.getWechat();
}
// 添加到审批节点
userIdList.add(departmentHeadWorkwechat);
// 添加到抄送节点
notifyerList.add(departmentHeadWorkwechat);
}
}
}
approvalTemplate.setNotifyer(notifyerList);
// 用于设置第一个节点流程
Approval_template_approver approval_template_approver_departMentHeader = new Approval_template_approver();
approval_template_approver_departMentHeader.setAttr(1);

Loading…
Cancel
Save