|
|
|
@ -232,8 +232,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据id删除出库记录 |
|
|
|
* @return 受影响的行数 |
|
|
|
* |
|
|
|
* @param id |
|
|
|
* @return 受影响的行数 |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
@ -324,7 +325,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Integer value : list) { |
|
|
|
String redisMainRecordKey = "record:" + value; // 设置redis中主订单键值
|
|
|
|
redisTemplate.delete(redisMainRecordKey); |
|
|
|
@ -974,8 +974,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
restResponse.setData(""); |
|
|
|
restResponse.setStatusInfo(new StatusInfo("出库失败", "出库失败,库存不足")); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果是拆单后的出库
|
|
|
|
|
|
|
|
// 用于获取对应的拆单记录
|
|
|
|
@ -1877,8 +1876,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
map.put("departmentheadPass", 1); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果是不通过
|
|
|
|
updateInventoryForOutRefused(recordP); |
|
|
|
map.put("depositoryManagerPass", 2); |
|
|
|
@ -1894,8 +1892,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 将当前redis中存储的spno删除
|
|
|
|
redisTemplate.delete(spNo); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果是部门负责人
|
|
|
|
|
|
|
|
String departmentheadTime = recordP.getDepartmentheadTime(); |
|
|
|
@ -1922,8 +1919,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen" + ","); |
|
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果点击的是驳回
|
|
|
|
updateInventoryForOutRefused(recordP); |
|
|
|
map.put("pass", 2); |
|
|
|
@ -1945,6 +1941,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断当前出库记录运行状态是否可以直接删除 |
|
|
|
* |
|
|
|
* @param id |
|
|
|
* @return true:可以直接删除,false:流程暂未完成 |
|
|
|
*/ |
|
|
|
@ -2076,7 +2073,26 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
ApplicationOutRecordP record = depositoryRecordMapper.findApplicationOutRecordPById(ObjectFormatUtil.toInteger(map.get("id"))); |
|
|
|
Object id = map.get("id"); // 主订单编号
|
|
|
|
map.remove("id"); |
|
|
|
if (map.containsKey("departmentheadPass")) { |
|
|
|
|
|
|
|
List<ApplicationOutRecordMin> minByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(record.getId()); |
|
|
|
boolean flagForHasOtherDepository = true; |
|
|
|
for (ApplicationOutRecordMin min : minByParent |
|
|
|
) { |
|
|
|
Depository depositoryById = depositoryMapper.findDepositoryById(min.getId()); |
|
|
|
if (Integer.compare(depositoryById.getParentId(), 0) != 0) { |
|
|
|
// 如果不是
|
|
|
|
List<Depository> depositoryAll = depositoryMapper.findDepositoryAll(); |
|
|
|
depositoryById = findParentDepository(depositoryById, depositoryAll); |
|
|
|
} |
|
|
|
|
|
|
|
if (!depositoryById.getDname().contains("前置仓")) { |
|
|
|
// 如果不是前置仓下的仓库
|
|
|
|
flagForHasOtherDepository = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (map.containsKey("departmentheadPass") && flagForHasOtherDepository) { |
|
|
|
String result = ""; |
|
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
|
@ -2093,7 +2109,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
|
for (int i = 0; i < departmentHeadByUser.size(); i++) { |
|
|
|
depositoryManager.append(departmentHeadByUser.get(i).getId() + ","); |
|
|
|
// QyWxUid.append(departmentHeadByUser.get(i).getWorkwechat() + ",");
|
|
|
|
QyWxUid.append(departmentHeadByUser.get(i).getWorkwechat() + ","); |
|
|
|
} |
|
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
|
@ -2307,11 +2323,22 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 将主订单插入到redis中
|
|
|
|
redisTemplate.opsForHash().put("record:" + record.getId(), "minRecord", minRecordByMain.toString()); |
|
|
|
map.put("state", "仓储中心负责人审核通过"); |
|
|
|
} else { |
|
|
|
if(!flagForHasOtherDepository){ |
|
|
|
map.put("state", "部门负责人审核通过"); |
|
|
|
map.put("departmenthead", userid); |
|
|
|
map.put("departmentheadPass", 1); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
updateInventoryForOutRefused(record); |
|
|
|
result = "驳回"; |
|
|
|
map.put("pass", 2); |
|
|
|
map.put("state", "仓储中心负责人审核未通过"); |
|
|
|
if(!flagForHasOtherDepository){ |
|
|
|
map.put("state", "部门负责人审核未通过"); |
|
|
|
map.put("departmenthead", userid); |
|
|
|
map.put("departmentheadPass", 2); |
|
|
|
} |
|
|
|
} |
|
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
|
String finalResult = result; |
|
|
|
@ -2568,8 +2595,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
// 进行入库操作
|
|
|
|
applicationInPlace(map); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果不在该仓库,插入一条新记录
|
|
|
|
Map<String, Object> insert = new HashMap<>(); |
|
|
|
// 转移数量
|
|
|
|
@ -2619,8 +2645,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
placeMapper.updateMaterialAndPlace(toMaterialAndPlace); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果是拆单单位
|
|
|
|
|
|
|
|
// 用于获取当前拆单记录
|
|
|
|
@ -2670,8 +2695,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
splitInventory.setInQuantity(splitInventory.getInQuantity() + quantity); |
|
|
|
// 修改当前拆单库存处理记录
|
|
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果大于当前进制数量(需要进行进位)
|
|
|
|
|
|
|
|
|
|
|
|
@ -2831,8 +2855,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
// 如果在转入的仓库中不存在该物料的库存记录
|
|
|
|
|
|
|
|
// 用于添加一条库存记录
|
|
|
|
@ -3046,6 +3069,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询当前用户入库记录及其管理仓库的入库记录 |
|
|
|
* |
|
|
|
* @param userByPort 待查询用户 |
|
|
|
* @param map 查询条件 |
|
|
|
* @return |
|
|
|
@ -3125,6 +3149,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询当前用户出库记录及其管理仓库的出库记录 |
|
|
|
* |
|
|
|
* @param userByPort 待查询用户 |
|
|
|
* @param map 查询条件 |
|
|
|
* @return |
|
|
|
@ -3159,6 +3184,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询当前用户出库记录及其管理仓库的出库记录数目 |
|
|
|
* |
|
|
|
* @param map 查询条件 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@ -3833,6 +3859,27 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于获取当前仓库的最顶级仓库 |
|
|
|
* |
|
|
|
* @param depository 仓库 |
|
|
|
* @param depositoryList 所有仓库 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
Depository findParentDepository(Depository depository, List<Depository> depositoryList) { |
|
|
|
for (Depository d : depositoryList |
|
|
|
) { |
|
|
|
if (Integer.compare(depository.getParentId(), d.getId()) == 0) { |
|
|
|
if (Integer.compare(0, d.getParentId()) == 0) { |
|
|
|
return d; |
|
|
|
} else { |
|
|
|
return findParentDepository(d, depositoryList); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 用于计算当前主记录下的总额与数量 |
|
|
|
*/ |
|
|
|
|