Browse Source

修改批量出入库申请bug

lwx_dev
erdanergou 3 years ago
parent
commit
76153ef2fd
  1. 94
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 4
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

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

@ -1576,13 +1576,38 @@ public class DepositoryRecordController {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (RoleAndMaterialType mt : materialTypeIdForIn for (RoleAndMaterialType mt : materialTypeIdForIn
) { ) {
// 获取权限类型
int classes = mt.getClasses();
// 获取权限赋值的uid
Integer uid = mt.getUid();
if (classes == 1) {
// 如果是针对人
// 获取管理员数据 // 获取管理员数据
UserByPort userByPort = LinkInterfaceUtil.FindUserById(mt.getUid(), finalUserkey, finalUsertoken); UserByPort userByPort = LinkInterfaceUtil.FindUserById(uid, finalUserkey, finalUsertoken);
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(",");
} else {
// 如果是对岗位
// 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = LinkInterfaceUtil.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) {
String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat();
}
sb.append(workwechat).append(",");
}
}
} }
JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken); JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken);
String sp_no = jsonObject.getString("sp_no"); String sp_no = jsonObject.getString("sp_no");
@ -1607,13 +1632,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, finalUsertoken); UserByPort userByPort = LinkInterfaceUtil.FindUserById(uid, finalUserkey, finalUsertoken);
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(",");
} else {
// 如果是岗位
// 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = LinkInterfaceUtil.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) {
String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat();
}
sb.append(workwechat).append(",");
}
}
} }
JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken); JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken);
String sp_no = jsonObject.getString("sp_no"); String sp_no = jsonObject.getString("sp_no");
@ -1819,13 +1867,32 @@ 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, finalUsertoken); UserByPort userByPort = LinkInterfaceUtil.FindUserById(uid, finalUserkey, finalUsertoken);
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(",");
} else {
// 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = LinkInterfaceUtil.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) {
String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat();
}
sb.append(workwechat).append(",");
}
}
} }
JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken); JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken);
String sp_no = jsonObject.getString("sp_no"); String sp_no = jsonObject.getString("sp_no");
@ -1850,13 +1917,32 @@ 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, finalUsertoken); UserByPort userByPort = LinkInterfaceUtil.FindUserById(uid, finalUserkey, finalUsertoken);
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(",");
} else {
// 定义用于获取当前岗位下的人的参数map
Map<String, Object> paramForGetUserByPost = new HashMap<>();
paramForGetUserByPost.put("position", uid);
List<UserByPort> userByPortList = LinkInterfaceUtil.FindUserByMap(paramForGetUserByPost, finalUserkey, finalUsertoken);
for (UserByPort userByPort : userByPortList) {
String workwechat = userByPort.getWorkwechat();
if (workwechat == null || "".equals(workwechat)) {
workwechat = userByPort.getWechat();
}
sb.append(workwechat).append(",");
}
}
} }
JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken); JSONObject jsonObject = qyWxOperationService.sendApprovalTemplateIn(crypt, userToken, integerList, sb.toString(), finalUserkey, finalUsertoken);
String sp_no = jsonObject.getString("sp_no"); String sp_no = jsonObject.getString("sp_no");

4
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -229,7 +229,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
public Integer insertApplicationOutRecord(Map<String, Object> map, UserByPort userToken, String userKey, String token) { public Integer insertApplicationOutRecord(Map<String, Object> map, UserByPort userToken, String userKey, String token) {
String placeId = ""; String placeId = "";
Object temp = map.get("placeId"); Object temp = map.get("placeId");
String depositoryId = (String) map.get("depositoryId"); String depositoryId = map.get("depositoryId").toString();
if (depositoryId == null || "".equals(depositoryId)) { if (depositoryId == null || "".equals(depositoryId)) {
map.put("flagForOpenDepository", 1); map.put("flagForOpenDepository", 1);
map.remove("depositoryId"); map.remove("depositoryId");
@ -918,7 +918,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
public Integer insertApplicationOutMin(Map<String, Object> map) { public Integer insertApplicationOutMin(Map<String, Object> map) {
// 获取当前出库库存id // 获取当前出库库存id
Integer mid = ObjectFormatUtil.toInteger(map.get("mid")); Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
String depositoryId = (String) map.get("depositoryId"); String depositoryId = map.get("depositoryId").toString();
// 获取当前出库库存记录 // 获取当前出库库存记录
Inventory inventoryById = materialMapper.findInventoryById(mid); Inventory inventoryById = materialMapper.findInventoryById(mid);
if (depositoryId == null || "".equals(depositoryId)) { if (depositoryId == null || "".equals(depositoryId)) {

Loading…
Cancel
Save