|
|
|
@ -1976,10 +1976,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
// 根据物料类型分类明细
|
|
|
|
Map<String, Object> minIdByMaterialType = new HashMap<>(); |
|
|
|
// 定义仓库列表
|
|
|
|
// 定义类型列表
|
|
|
|
List<Long> materialTypeIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
// 根据仓库分类明细
|
|
|
|
Map<String, Object> minIdByDepository = new HashMap<>(); |
|
|
|
// 定义类型列表
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
// 获取所有详情
|
|
|
|
List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(recordP.getId()); |
|
|
|
List<Depository> depositoryAll = depositoryMapper.findDepositoryAll(); |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
// 获取子单信息
|
|
|
|
|
|
|
|
@ -1988,20 +1994,19 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 获取物料信息
|
|
|
|
Inventory inventory = materialMapper.findInventoryById(mid); |
|
|
|
|
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Long materialTypeId = inventory.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExist(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
// 用于标志出库人员通过物料类型还说仓库获取 // 默认是仓库
|
|
|
|
boolean flagForMtOrDepository = true; |
|
|
|
|
|
|
|
// 获取出库仓库
|
|
|
|
Integer depositoryId = applicationOutRecordMin.getDepositoryId(); |
|
|
|
Depository depositoryById = depositoryMapper.findDepositoryById(depositoryId); |
|
|
|
Depository parentDepository = findParentDepository(depositoryById, depositoryAll); |
|
|
|
if (!parentDepository.getDname().contains("前置仓")) { |
|
|
|
// 如果不是前置仓下的仓库
|
|
|
|
flagForMtOrDepository = false; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置子订单在redis中的主键
|
|
|
|
String minRecordKey = "minRecord:" + applicationOutRecordMin.getId(); |
|
|
|
@ -2014,40 +2019,114 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
minRecord.put("parentId", recordP.getId().toString()); // 当前子订单主订单
|
|
|
|
minRecord.put("state", "1"); // 当前子订单状态 1待处理2处理
|
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByMtId(inventory.getMaterialTypeId()); |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
// 获取仓库管理员信息
|
|
|
|
UserByPort manager = LinkInterfaceUtil.FindUserById(integer, null); |
|
|
|
// 仓库管理员订单信息
|
|
|
|
Map<String, Object> userRecord = new HashMap<>(); |
|
|
|
// 用户当前子订单
|
|
|
|
String userMinRecord = (String) redisTemplate.opsForHash().get("user:" + integer, "minRecord"); |
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
|
userRecord.put("minRecord", "[" + minRecordKey + "," + "]"); // 插入一条子订单
|
|
|
|
} else { // 如果当前用户已经有子订单
|
|
|
|
StringBuilder minRecordList = new StringBuilder(userMinRecord); // 转为stringbuilder类型
|
|
|
|
minRecordList.insert(1, minRecordKey + ",");// 将当前子订单插入头部
|
|
|
|
userRecord.put("minRecord", minRecordList.toString()); |
|
|
|
|
|
|
|
if (!flagForMtOrDepository) { |
|
|
|
// 如果是通过类型
|
|
|
|
|
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Long materialTypeId = inventory.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExistForMaterialType(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
// 更新redis中用户记录
|
|
|
|
redisTemplate.opsForHash().putAll("user:" + integer, userRecord); |
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByMtId(inventory.getMaterialTypeId()); |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
// 获取仓库管理员信息
|
|
|
|
UserByPort manager = LinkInterfaceUtil.FindUserById(integer, null); |
|
|
|
// 仓库管理员订单信息
|
|
|
|
Map<String, Object> userRecord = new HashMap<>(); |
|
|
|
// 用户当前子订单
|
|
|
|
String userMinRecord = (String) redisTemplate.opsForHash().get("user:" + integer, "minRecord"); |
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
|
userRecord.put("minRecord", "[" + minRecordKey + "," + "]"); // 插入一条子订单
|
|
|
|
} else { // 如果当前用户已经有子订单
|
|
|
|
StringBuilder minRecordList = new StringBuilder(userMinRecord); // 转为stringbuilder类型
|
|
|
|
minRecordList.insert(1, minRecordKey + ",");// 将当前子订单插入头部
|
|
|
|
userRecord.put("minRecord", minRecordList.toString()); |
|
|
|
} |
|
|
|
// 更新redis中用户记录
|
|
|
|
redisTemplate.opsForHash().putAll("user:" + integer, userRecord); |
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
// QyWxUid.append(manager.getWorkwechat()+",");
|
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
// 添加子订单到redis中
|
|
|
|
redisTemplate.opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
// 添加子订单到redis中
|
|
|
|
redisTemplate.opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); |
|
|
|
else{ |
|
|
|
// 如果是通过仓库
|
|
|
|
|
|
|
|
|
|
|
|
if (!findThisIdIsExistForDepository(depositoryIdList, depositoryId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
depositoryIdList.add(depositoryId); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByMaterialType.get("depository" + depositoryId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByMaterialType.put("depository" + depositoryId, minIdList); |
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByDid(depositoryId); |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
// 获取仓库管理员信息
|
|
|
|
UserByPort manager = LinkInterfaceUtil.FindUserById(integer, null); |
|
|
|
// 仓库管理员订单信息
|
|
|
|
Map<String, Object> userRecord = new HashMap<>(); |
|
|
|
// 用户当前子订单
|
|
|
|
String userMinRecord = (String) redisTemplate.opsForHash().get("user:" + integer, "minRecord"); |
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
|
userRecord.put("minRecord", "[" + minRecordKey + "," + "]"); // 插入一条子订单
|
|
|
|
} else { // 如果当前用户已经有子订单
|
|
|
|
StringBuilder minRecordList = new StringBuilder(userMinRecord); // 转为stringbuilder类型
|
|
|
|
minRecordList.insert(1, minRecordKey + ",");// 将当前子订单插入头部
|
|
|
|
userRecord.put("minRecord", minRecordList.toString()); |
|
|
|
} |
|
|
|
// 更新redis中用户记录
|
|
|
|
redisTemplate.opsForHash().putAll("user:" + integer, userRecord); |
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
// QyWxUid.append(manager.getWorkwechat()+",");
|
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
// 添加子订单到redis中
|
|
|
|
redisTemplate.opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -2536,7 +2615,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toInteger(id), s, userAgent, 1); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} else { |
|
|
|
} |
|
|
|
else { |
|
|
|
String result = ""; |
|
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
@ -2567,9 +2647,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 定义仓库列表
|
|
|
|
List<Long> materialTypeIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
// 根据仓库分类明细
|
|
|
|
Map<String, Object> minIdByDepository = new HashMap<>(); |
|
|
|
// 定义类型列表
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
StringBuilder minRecordByMain = new StringBuilder("[]"); |
|
|
|
List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(record.getId()); |
|
|
|
List<Depository> depositoryAll = depositoryMapper.findDepositoryAll(); |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
// 获取子单信息
|
|
|
|
// 获取对应的物料编号
|
|
|
|
@ -2577,21 +2661,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 获取物料信息
|
|
|
|
Inventory inventory = materialMapper.findInventoryById(mid); |
|
|
|
|
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Long materialTypeId = inventory.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExist(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
|
|
|
|
//设置子订单在redis中的主键
|
|
|
|
String minRecordKey = "minRecord:" + applicationOutRecordMin.getId(); |
|
|
|
minRecordByMain.insert(1, minRecordKey + ","); // 将子订单主键插入到主订单的子订单列表
|
|
|
|
@ -2602,43 +2671,124 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
minRecord.put("parentId", record.getId().toString()); // 当前子订单主订单
|
|
|
|
minRecord.put("state", "1"); // 当前子订单状态 1待处理2处理
|
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByMtId(inventory.getMaterialTypeId()); |
|
|
|
// 用于保存仓库管理员的企业微信openid
|
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
|
|
|
|
// 仓库管理员订单信息
|
|
|
|
Map<String, Object> userRecord = new HashMap<>(); |
|
|
|
// 用户当前子订单
|
|
|
|
String userMinRecord = (String) redisTemplate.opsForHash().get("user:" + integer, "minRecord"); |
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
|
userRecord.put("minRecord", "[" + minRecordKey + "," + "]"); // 插入一条子订单
|
|
|
|
} else { // 如果当前用户已经有子订单
|
|
|
|
StringBuilder minRecordList = new StringBuilder(userMinRecord); // 转为stringbuilder类型
|
|
|
|
minRecordList.insert(1, minRecordKey + ",");// 将当前子订单插入头部
|
|
|
|
userRecord.put("minRecord", minRecordList.toString()); |
|
|
|
|
|
|
|
// 获取出库仓库
|
|
|
|
Integer depositoryId = applicationOutRecordMin.getDepositoryId(); |
|
|
|
Depository depositoryById = depositoryMapper.findDepositoryById(depositoryId); |
|
|
|
// 用于标志出库人员通过物料类型还说仓库获取 // 默认是仓库
|
|
|
|
boolean flagForMtOrDepository = true; |
|
|
|
Depository parentDepository = findParentDepository(depositoryById, depositoryAll); |
|
|
|
if (!parentDepository.getDname().contains("前置仓")) { |
|
|
|
// 如果不是前置仓下的仓库
|
|
|
|
flagForMtOrDepository = false; |
|
|
|
} |
|
|
|
|
|
|
|
if (!flagForMtOrDepository) { |
|
|
|
// 如果是通过类型
|
|
|
|
|
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Long materialTypeId = inventory.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExistForMaterialType(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
// 更新redis中用户记录
|
|
|
|
redisTemplate.opsForHash().putAll("user:" + integer, userRecord); |
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
UserByPort userByPort = LinkInterfaceUtil.FindUserById(integer, userToken); |
|
|
|
// QyWxUid.append(userByPort.getWorkwechat() + ",");
|
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByMtId(inventory.getMaterialTypeId()); |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
// 获取仓库管理员信息
|
|
|
|
UserByPort manager = LinkInterfaceUtil.FindUserById(integer, null); |
|
|
|
// 仓库管理员订单信息
|
|
|
|
Map<String, Object> userRecord = new HashMap<>(); |
|
|
|
// 用户当前子订单
|
|
|
|
String userMinRecord = (String) redisTemplate.opsForHash().get("user:" + integer, "minRecord"); |
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
|
userRecord.put("minRecord", "[" + minRecordKey + "," + "]"); // 插入一条子订单
|
|
|
|
} else { // 如果当前用户已经有子订单
|
|
|
|
StringBuilder minRecordList = new StringBuilder(userMinRecord); // 转为stringbuilder类型
|
|
|
|
minRecordList.insert(1, minRecordKey + ",");// 将当前子订单插入头部
|
|
|
|
userRecord.put("minRecord", minRecordList.toString()); |
|
|
|
} |
|
|
|
// 更新redis中用户记录
|
|
|
|
redisTemplate.opsForHash().putAll("user:" + integer, userRecord); |
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
// QyWxUid.append(manager.getWorkwechat()+",");
|
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
// 添加子订单到redis中
|
|
|
|
redisTemplate.opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
// 添加子订单到redis中
|
|
|
|
redisTemplate.opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
else{ |
|
|
|
// 如果是通过仓库
|
|
|
|
|
|
|
|
|
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); |
|
|
|
if (!findThisIdIsExistForDepository(depositoryIdList, depositoryId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
depositoryIdList.add(depositoryId); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByMaterialType.get("depository" + depositoryId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByMaterialType.put("depository" + depositoryId, minIdList); |
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByDid(depositoryId); |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
// 获取仓库管理员信息
|
|
|
|
UserByPort manager = LinkInterfaceUtil.FindUserById(integer, null); |
|
|
|
// 仓库管理员订单信息
|
|
|
|
Map<String, Object> userRecord = new HashMap<>(); |
|
|
|
// 用户当前子订单
|
|
|
|
String userMinRecord = (String) redisTemplate.opsForHash().get("user:" + integer, "minRecord"); |
|
|
|
if (userMinRecord == null) { // 如果当前用户没有子订单
|
|
|
|
userRecord.put("minRecord", "[" + minRecordKey + "," + "]"); // 插入一条子订单
|
|
|
|
} else { // 如果当前用户已经有子订单
|
|
|
|
StringBuilder minRecordList = new StringBuilder(userMinRecord); // 转为stringbuilder类型
|
|
|
|
minRecordList.insert(1, minRecordKey + ",");// 将当前子订单插入头部
|
|
|
|
userRecord.put("minRecord", minRecordList.toString()); |
|
|
|
} |
|
|
|
// 更新redis中用户记录
|
|
|
|
redisTemplate.opsForHash().putAll("user:" + integer, userRecord); |
|
|
|
minRecordManage.append(integer).append(","); |
|
|
|
// QyWxUid.append(manager.getWorkwechat()+",");
|
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
|
minRecord.put("manager", minRecordManage.toString()); |
|
|
|
// 添加子订单到redis中
|
|
|
|
redisTemplate.opsForHash().putAll(minRecordKey, minRecord); |
|
|
|
// 开启线程向仓库管理员发送消息
|
|
|
|
new Thread(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); |
|
|
|
} |
|
|
|
}).start(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -2675,7 +2825,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
map.put("departmentheadPass", 1); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} |
|
|
|
else { |
|
|
|
updateInventoryForOutRefused(record); |
|
|
|
result = "驳回"; |
|
|
|
map.put("pass", 2); |
|
|
|
@ -2913,7 +3064,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Inventory materialById = materialMapper.findInventoryById(mid); |
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Long materialTypeId = materialById.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExist(materialTypeIdList, materialTypeId)) { |
|
|
|
if (!findThisIdIsExistForMaterialType(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
@ -4649,7 +4800,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Boolean findThisIdIsExist(List<Long> ids, Long id) { |
|
|
|
public Boolean findThisIdIsExistForMaterialType(List<Long> ids, Long id) { |
|
|
|
for (Long mtId : |
|
|
|
ids) { |
|
|
|
if (Long.compare(id, mtId) == 0) { |
|
|
|
@ -4659,6 +4810,23 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断当前id是否在ids中 |
|
|
|
* |
|
|
|
* @param ids |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Boolean findThisIdIsExistForDepository(List<Integer> ids, Integer id) { |
|
|
|
for (Integer did : |
|
|
|
ids) { |
|
|
|
if (Integer.compare(id, did) == 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于获取当前仓库的最顶级仓库 |
|
|
|
* |
|
|
|
|