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