Browse Source

修改入库审批功能

lwx_dev
erdanergou 3 years ago
parent
commit
32c866f149
  1. 48
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

48
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -453,14 +453,36 @@ public class DepositoryRecordController {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (RoleAndMaterialType mt : materialTypeIdForIn for (RoleAndMaterialType mt : materialTypeIdForIn
) { ) {
int classes = mt.getClasses();
Integer uid = mt.getUid();
if (classes == 1) {
// 如果是个人
// 获取管理员数据 // 获取管理员数据
UserByPort userByPort = LinkInterfaceUtil.FindUserById(mt.getUid(), finalUserKey, finalToken); UserByPort userByPort = LinkInterfaceUtil.FindUserById(uid, finalUserKey, finalToken);
String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat();
}
sb.append(workwechat).append(",");
} else {
// 如果是岗位
// 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = LinkInterfaceUtil.FindUserByMap(paramForGetUserByPost, null, null);
for (UserByPort userByPort : userByPortList) {
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();
} }
sb.append(workwechat).append(","); sb.append(workwechat).append(",");
} }
}
}
JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserKey, finalToken); JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserKey, finalToken);
String sp_no = jsonObject.getString("sp_no"); String sp_no = jsonObject.getString("sp_no");
Map<String, Object> QyWxApprovalMap = new HashMap<>(); Map<String, Object> QyWxApprovalMap = new HashMap<>();
@ -484,14 +506,36 @@ public class DepositoryRecordController {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (RoleAndDepository mt : materialTypeIdForIn for (RoleAndDepository mt : materialTypeIdForIn
) { ) {
int classes = mt.getClasses();
Integer uid = mt.getUserId();
if (classes == 1) {
// 如果是个人
// 获取管理员数据 // 获取管理员数据
UserByPort userByPort = LinkInterfaceUtil.FindUserById(mt.getUserId(), finalUserKey, finalToken); UserByPort userByPort = LinkInterfaceUtil.FindUserById(uid, finalUserKey, finalToken);
String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat();
}
sb.append(workwechat).append(",");
} else {
// 如果是岗位
// 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = LinkInterfaceUtil.FindUserByMap(paramForGetUserByPost, finalUserKey, finalToken);
for (UserByPort userByPort : userByPortList) {
String workwechat = userByPort.getWorkwechat(); String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) { if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat(); workwechat = userByPort.getWechat();
} }
sb.append(workwechat).append(","); sb.append(workwechat).append(",");
} }
}
}
JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserKey, finalToken); JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserKey, finalToken);
String sp_no = jsonObject.getString("sp_no"); String sp_no = jsonObject.getString("sp_no");
Map<String, Object> QyWxApprovalMap = new HashMap<>(); Map<String, Object> QyWxApprovalMap = new HashMap<>();

Loading…
Cancel
Save