|
|
|
@ -1951,7 +1951,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// Integer maindeparment = userByPort.getMaindeparment();
|
|
|
|
|
|
|
|
if (!flagForFirst) { |
|
|
|
// if (Integer.compare(361, maindeparment) == 0) {
|
|
|
|
|
|
|
|
String depositoryManagerTime = recordP.getDepositoryManagerTime(); |
|
|
|
if ("0".equals(depositoryManagerTime)) { |
|
|
|
@ -1979,29 +1978,34 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
StringBuilder minRecordByMain = new StringBuilder("[]"); |
|
|
|
|
|
|
|
// 根据仓库分类明细
|
|
|
|
Map<String, Object> minIdByDepository = new HashMap<>(); |
|
|
|
// 根据物料类型分类明细
|
|
|
|
Map<String, Object> minIdByMaterialType = new HashMap<>(); |
|
|
|
// 定义仓库列表
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
List<Long> materialTypeIdList = new ArrayList<>(); |
|
|
|
// 获取所有详情
|
|
|
|
List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(recordP.getId()); |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
// 获取子单信息
|
|
|
|
|
|
|
|
// 获取对应的物料编号
|
|
|
|
Integer mid = applicationOutRecordMin.getMid(); |
|
|
|
// 获取物料信息
|
|
|
|
Inventory inventory = materialMapper.findInventoryById(mid); |
|
|
|
|
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Integer depositoryId = applicationOutRecordMin.getDepositoryId(); |
|
|
|
if (!findThisIdIsExist(depositoryIdList, depositoryId)) { |
|
|
|
Long materialTypeId = inventory.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExist(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
depositoryIdList.add(depositoryId); |
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByDepository.get("depository" + depositoryId); |
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByDepository.put("depository" + depositoryId, minIdList); |
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
|
|
|
|
//设置子订单在redis中的主键
|
|
|
|
String minRecordKey = "minRecord:" + applicationOutRecordMin.getId(); |
|
|
|
@ -2013,13 +2017,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Map<String, Object> minRecord = new HashMap<>(); |
|
|
|
minRecord.put("parentId", recordP.getId().toString()); // 当前子订单主订单
|
|
|
|
minRecord.put("state", "1"); // 当前子订单状态 1待处理2处理
|
|
|
|
// 获取对应的物料编号
|
|
|
|
Integer mid = applicationOutRecordMin.getMid(); |
|
|
|
// 获取物料信息
|
|
|
|
Inventory inventory = materialMapper.findInventoryById(mid); |
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByDid(inventory.getDepositoryId()); |
|
|
|
userIdByDid = roleService.findUserIdByMtId(inventory.getMaterialTypeId()); |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
// 获取仓库管理员信息
|
|
|
|
@ -2566,31 +2567,34 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 获取主单下的所有子单
|
|
|
|
|
|
|
|
// 根据仓库分类明细
|
|
|
|
Map<String, Object> minIdByDepository = new HashMap<>(); |
|
|
|
Map<String, Object> minIdByMaterialType = new HashMap<>(); |
|
|
|
// 定义仓库列表
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
List<Long> materialTypeIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
StringBuilder minRecordByMain = new StringBuilder("[]"); |
|
|
|
List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(record.getId()); |
|
|
|
for (int i = 0; i < applicationOutRecordMinByParent.size(); i++) { |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
// 获取子单信息
|
|
|
|
ApplicationOutRecordMin applicationOutRecordMin = applicationOutRecordMinByParent.get(i); |
|
|
|
// 获取对应的物料编号
|
|
|
|
Integer mid = applicationOutRecordMin.getMid(); |
|
|
|
// 获取物料信息
|
|
|
|
Inventory inventory = materialMapper.findInventoryById(mid); |
|
|
|
|
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Integer depositoryId = applicationOutRecordMin.getDepositoryId(); |
|
|
|
if (!findThisIdIsExist(depositoryIdList, depositoryId)) { |
|
|
|
Long materialTypeId = inventory.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExist(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
depositoryIdList.add(depositoryId); |
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByDepository.get("depository" + depositoryId); |
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByDepository.put("depository" + depositoryId, minIdList); |
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
|
|
|
|
//设置子订单在redis中的主键
|
|
|
|
String minRecordKey = "minRecord:" + applicationOutRecordMin.getId(); |
|
|
|
@ -2601,13 +2605,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Map<String, Object> minRecord = new HashMap<>(); |
|
|
|
minRecord.put("parentId", record.getId().toString()); // 当前子订单主订单
|
|
|
|
minRecord.put("state", "1"); // 当前子订单状态 1待处理2处理
|
|
|
|
// 获取对应的物料编号
|
|
|
|
Integer mid = applicationOutRecordMin.getMid(); |
|
|
|
// 获取物料信息
|
|
|
|
Inventory inventory = materialMapper.findInventoryById(mid); |
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByDid(inventory.getDepositoryId()); |
|
|
|
userIdByDid = roleService.findUserIdByMtId(inventory.getMaterialTypeId()); |
|
|
|
// 用于保存仓库管理员的企业微信openid
|
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (Integer integer : userIdByDid) { |
|
|
|
@ -2902,29 +2903,32 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
map.put("depositoryManagerPass", 1); |
|
|
|
|
|
|
|
// 根据仓库分类明细
|
|
|
|
Map<String, Object> minIdByDepository = new HashMap<>(); |
|
|
|
Map<String, Object> minIdByMaterialType = new HashMap<>(); |
|
|
|
// 定义仓库列表
|
|
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
|
List<Long> materialTypeIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
StringBuilder minRecordByMain = new StringBuilder("[]"); |
|
|
|
List<ApplicationOutRecordMin> applicationOutRecordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(recordP.getId()); |
|
|
|
for (int i = 0; i < applicationOutRecordMinByParent.size(); i++) { |
|
|
|
for (ApplicationOutRecordMin applicationOutRecordMin : applicationOutRecordMinByParent) { |
|
|
|
// 获取子单信息
|
|
|
|
ApplicationOutRecordMin applicationOutRecordMin = applicationOutRecordMinByParent.get(i); |
|
|
|
// 获取对应的物料编号
|
|
|
|
Integer mid = applicationOutRecordMin.getMid(); |
|
|
|
// 获取物料信息
|
|
|
|
Inventory materialById = materialMapper.findInventoryById(mid); |
|
|
|
// 获取当前仓库下的子订单
|
|
|
|
Integer depositoryId = applicationOutRecordMin.getDepositoryId(); |
|
|
|
if (!findThisIdIsExist(depositoryIdList, depositoryId)) { |
|
|
|
Long materialTypeId = materialById.getMaterialTypeId(); |
|
|
|
if (!findThisIdIsExist(materialTypeIdList, materialTypeId)) { |
|
|
|
// 如果当前仓库id没有存入过
|
|
|
|
depositoryIdList.add(depositoryId); |
|
|
|
materialTypeIdList.add(materialTypeId); |
|
|
|
} |
|
|
|
List<Integer> minIdList = new ArrayList<>(); |
|
|
|
Object o = minIdByDepository.get("depository" + depositoryId); |
|
|
|
Object o = minIdByMaterialType.get("materialType" + materialTypeId); |
|
|
|
if (o != null) { |
|
|
|
minIdList = (List<Integer>) o; |
|
|
|
} |
|
|
|
// 将当前子订单添加到该仓库下的子订单列表中
|
|
|
|
minIdList.add(applicationOutRecordMin.getId()); |
|
|
|
minIdByDepository.put("depository" + depositoryId, minIdList); |
|
|
|
minIdByMaterialType.put("materialType" + materialTypeId, minIdList); |
|
|
|
//设置子订单在redis中的主键
|
|
|
|
String minRecordKey = "minRecord:" + applicationOutRecordMin.getId(); |
|
|
|
minRecordByMain.insert(1, minRecordKey + ","); // 将子订单主键插入到主订单的子订单列表
|
|
|
|
@ -2934,13 +2938,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Map<String, Object> minRecord = new HashMap<>(); |
|
|
|
minRecord.put("parentId", recordP.getId().toString()); // 当前子订单主订单
|
|
|
|
minRecord.put("state", "1"); // 当前子订单状态 1待处理2处理
|
|
|
|
// 获取对应的物料编号
|
|
|
|
Integer mid = applicationOutRecordMin.getMid(); |
|
|
|
// 获取物料信息
|
|
|
|
Material materialById = materialMapper.findMaterialById(mid); |
|
|
|
|
|
|
|
// 获取该物料所处仓库的仓库管理员
|
|
|
|
List<Integer> userIdByDid = new ArrayList<>(); |
|
|
|
userIdByDid = roleService.findUserIdByDid(materialById.getDepositoryId()); |
|
|
|
userIdByDid = roleService.findUserIdByMtId(materialById.getMaterialTypeId()); |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (int j = 0; j < userIdByDid.size(); j++) { |
|
|
|
// 获取仓库管理员信息
|
|
|
|
@ -4652,10 +4653,10 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
* @param id |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Boolean findThisIdIsExist(List<Integer> ids, Integer id) { |
|
|
|
for (Integer depositoryId : |
|
|
|
public Boolean findThisIdIsExist(List<Long> ids, Long id) { |
|
|
|
for (Long mtId : |
|
|
|
ids) { |
|
|
|
if (Integer.compare(id, depositoryId) == 0) { |
|
|
|
if (Long.compare(id, mtId) == 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|