|
|
@ -232,12 +232,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 根据id删除出库记录 |
|
|
* 根据id删除出库记录 |
|
|
* @return 受影响的行数 |
|
|
* |
|
|
* @param id |
|
|
* @param id |
|
|
|
|
|
* @return 受影响的行数 |
|
|
*/ |
|
|
*/ |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Override |
|
|
@Override |
|
|
public Integer deleteApplicationOutRecordById(Integer id,UserByPort userByPort) { |
|
|
public Integer deleteApplicationOutRecordById(Integer id, UserByPort userByPort) { |
|
|
// 删除主单
|
|
|
// 删除主单
|
|
|
Integer integer = depositoryRecordMapper.deleteApplicationOutRecordById(id); |
|
|
Integer integer = depositoryRecordMapper.deleteApplicationOutRecordById(id); |
|
|
|
|
|
|
|
|
@ -289,7 +290,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Override |
|
|
@Override |
|
|
public Integer deleteApplicationOutRecordByIds(List<Integer> list,UserByPort userByPort) { |
|
|
public Integer deleteApplicationOutRecordByIds(List<Integer> list, UserByPort userByPort) { |
|
|
Integer integer = depositoryRecordMapper.deleteApplicationOutRecordByIds(list); |
|
|
Integer integer = depositoryRecordMapper.deleteApplicationOutRecordByIds(list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -324,7 +325,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Integer value : list) { |
|
|
for (Integer value : list) { |
|
|
String redisMainRecordKey = "record:" + value; // 设置redis中主订单键值
|
|
|
String redisMainRecordKey = "record:" + value; // 设置redis中主订单键值
|
|
|
redisTemplate.delete(redisMainRecordKey); |
|
|
redisTemplate.delete(redisMainRecordKey); |
|
|
@ -974,8 +974,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
restResponse.setData(""); |
|
|
restResponse.setData(""); |
|
|
restResponse.setStatusInfo(new StatusInfo("出库失败", "出库失败,库存不足")); |
|
|
restResponse.setStatusInfo(new StatusInfo("出库失败", "出库失败,库存不足")); |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果是拆单后的出库
|
|
|
// 如果是拆单后的出库
|
|
|
|
|
|
|
|
|
// 用于获取对应的拆单记录
|
|
|
// 用于获取对应的拆单记录
|
|
|
@ -1711,7 +1710,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Integer reviewByQyWxApproval(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo,boolean flagForFirst) { |
|
|
public Integer reviewByQyWxApproval(String mainId, ApprovalInfo_Details approvalInfo_details, String userAgent, String spStatus, String spNo, boolean flagForFirst) { |
|
|
|
|
|
|
|
|
// 用于更新订单
|
|
|
// 用于更新订单
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
@ -1733,7 +1732,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 获取当前审批所在部门
|
|
|
// 获取当前审批所在部门
|
|
|
// Integer maindeparment = userByPort.getMaindeparment();
|
|
|
// Integer maindeparment = userByPort.getMaindeparment();
|
|
|
|
|
|
|
|
|
if(!flagForFirst){ |
|
|
if (!flagForFirst) { |
|
|
// if (Integer.compare(361, maindeparment) == 0) {
|
|
|
// if (Integer.compare(361, maindeparment) == 0) {
|
|
|
|
|
|
|
|
|
String depositoryManagerTime = recordP.getDepositoryManagerTime(); |
|
|
String depositoryManagerTime = recordP.getDepositoryManagerTime(); |
|
|
@ -1751,7 +1750,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
String departmentheadTime = recordP.getDepartmentheadTime(); |
|
|
String departmentheadTime = recordP.getDepartmentheadTime(); |
|
|
// 定义标志位为部门负责人已经审批
|
|
|
// 定义标志位为部门负责人已经审批
|
|
|
boolean flagForDepartmentHeadPass = false; |
|
|
boolean flagForDepartmentHeadPass = false; |
|
|
if("0".equals(departmentheadTime)){ |
|
|
if ("0".equals(departmentheadTime)) { |
|
|
// 如果没有审批
|
|
|
// 如果没有审批
|
|
|
flagForDepartmentHeadPass = true; |
|
|
flagForDepartmentHeadPass = true; |
|
|
} |
|
|
} |
|
|
@ -1831,7 +1830,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
new Thread(new Runnable() { |
|
|
new Thread(new Runnable() { |
|
|
@Override |
|
|
@Override |
|
|
public void run() { |
|
|
public void run() { |
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(),userAgent); |
|
|
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent); |
|
|
} |
|
|
} |
|
|
}).start(); |
|
|
}).start(); |
|
|
|
|
|
|
|
|
@ -1858,9 +1857,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("minIdList", sb.toString()); |
|
|
QyWxApprovalMap.put("minIdList", sb.toString()); |
|
|
redisTemplate.opsForHash().putAll("wms_out_"+recordP.getId(), QyWxApprovalMap); |
|
|
redisTemplate.opsForHash().putAll("wms_out_" + recordP.getId(), QyWxApprovalMap); |
|
|
// 设置过期时间为7天
|
|
|
// 设置过期时间为7天
|
|
|
redisTemplate.expire("wms_out_"+recordP.getId(), 7, TimeUnit.DAYS); |
|
|
redisTemplate.expire("wms_out_" + recordP.getId(), 7, TimeUnit.DAYS); |
|
|
} else { |
|
|
} else { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
@ -1869,7 +1868,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 将主订单插入到redis中
|
|
|
// 将主订单插入到redis中
|
|
|
redisTemplate.opsForHash().put("record:" + recordP.getId(), "minRecord", minRecordByMain.toString()); |
|
|
redisTemplate.opsForHash().put("record:" + recordP.getId(), "minRecord", minRecordByMain.toString()); |
|
|
map.put("state", "仓储中心负责人审核通过"); |
|
|
map.put("state", "仓储中心负责人审核通过"); |
|
|
if(flagForDepartmentHeadPass){ |
|
|
if (flagForDepartmentHeadPass) { |
|
|
map.put("state", "部门负责人审核通过"); |
|
|
map.put("state", "部门负责人审核通过"); |
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
map.put("depositoryManagerTime", "0"); |
|
|
map.put("depositoryManagerTime", "0"); |
|
|
@ -1877,14 +1876,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
map.put("departmentheadPass", 1); |
|
|
map.put("departmentheadPass", 1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果是不通过
|
|
|
// 如果是不通过
|
|
|
updateInventoryForOutRefused(recordP); |
|
|
updateInventoryForOutRefused(recordP); |
|
|
map.put("depositoryManagerPass", 2); |
|
|
map.put("depositoryManagerPass", 2); |
|
|
map.put("pass", 2); |
|
|
map.put("pass", 2); |
|
|
map.put("state", "仓储中心负责人审核未通过"); |
|
|
map.put("state", "仓储中心负责人审核未通过"); |
|
|
if(flagForDepartmentHeadPass){ |
|
|
if (flagForDepartmentHeadPass) { |
|
|
map.put("departmentheadPass", 2); |
|
|
map.put("departmentheadPass", 2); |
|
|
map.put("state", "部门负责人审核未通过"); |
|
|
map.put("state", "部门负责人审核未通过"); |
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
@ -1894,8 +1892,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 将当前redis中存储的spno删除
|
|
|
// 将当前redis中存储的spno删除
|
|
|
redisTemplate.delete(spNo); |
|
|
redisTemplate.delete(spNo); |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果是部门负责人
|
|
|
// 如果是部门负责人
|
|
|
|
|
|
|
|
|
String departmentheadTime = recordP.getDepartmentheadTime(); |
|
|
String departmentheadTime = recordP.getDepartmentheadTime(); |
|
|
@ -1922,8 +1919,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
QyWxUid.append("PangFuZhen" + ","); |
|
|
QyWxUid.append("PangFuZhen" + ","); |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果点击的是驳回
|
|
|
// 如果点击的是驳回
|
|
|
updateInventoryForOutRefused(recordP); |
|
|
updateInventoryForOutRefused(recordP); |
|
|
map.put("pass", 2); |
|
|
map.put("pass", 2); |
|
|
@ -1945,6 +1941,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 判断当前出库记录运行状态是否可以直接删除 |
|
|
* 判断当前出库记录运行状态是否可以直接删除 |
|
|
|
|
|
* |
|
|
* @param id |
|
|
* @param id |
|
|
* @return true:可以直接删除,false:流程暂未完成 |
|
|
* @return true:可以直接删除,false:流程暂未完成 |
|
|
*/ |
|
|
*/ |
|
|
@ -1953,17 +1950,17 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 获取当前出库记录
|
|
|
// 获取当前出库记录
|
|
|
ApplicationOutRecordP recordPById = depositoryRecordMapper.findApplicationOutRecordPById(id); |
|
|
ApplicationOutRecordP recordPById = depositoryRecordMapper.findApplicationOutRecordPById(id); |
|
|
Integer pass = recordPById.getPass(); |
|
|
Integer pass = recordPById.getPass(); |
|
|
if(Integer.compare(pass,2) == 0){ |
|
|
if (Integer.compare(pass, 2) == 0) { |
|
|
// 如果审核未通过
|
|
|
// 如果审核未通过
|
|
|
|
|
|
|
|
|
// 可以直接删除
|
|
|
// 可以直接删除
|
|
|
return true; |
|
|
return true; |
|
|
}else{ |
|
|
} else { |
|
|
// 获取所有子订单
|
|
|
// 获取所有子订单
|
|
|
List<ApplicationOutRecordMin> recordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(id); |
|
|
List<ApplicationOutRecordMin> recordMinByParent = depositoryRecordMapper.findApplicationOutRecordMinByParent(id); |
|
|
for (ApplicationOutRecordMin recordMin : |
|
|
for (ApplicationOutRecordMin recordMin : |
|
|
recordMinByParent) { |
|
|
recordMinByParent) { |
|
|
if(Integer.compare(recordMin.getTrueOut(),0) != 0){ |
|
|
if (Integer.compare(recordMin.getTrueOut(), 0) != 0) { |
|
|
// 如果已经出库数量不为0
|
|
|
// 如果已经出库数量不为0
|
|
|
return false; // 不允许删除
|
|
|
return false; // 不允许删除
|
|
|
} |
|
|
} |
|
|
@ -2076,7 +2073,26 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
ApplicationOutRecordP record = depositoryRecordMapper.findApplicationOutRecordPById(ObjectFormatUtil.toInteger(map.get("id"))); |
|
|
ApplicationOutRecordP record = depositoryRecordMapper.findApplicationOutRecordPById(ObjectFormatUtil.toInteger(map.get("id"))); |
|
|
Object id = map.get("id"); // 主订单编号
|
|
|
Object id = map.get("id"); // 主订单编号
|
|
|
map.remove("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 result = ""; |
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
String simpleTime = DateUtil.getSimpleTime(new Date()); |
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime)); |
|
|
@ -2093,7 +2109,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
StringBuilder QyWxUid = new StringBuilder(); |
|
|
for (int i = 0; i < departmentHeadByUser.size(); i++) { |
|
|
for (int i = 0; i < departmentHeadByUser.size(); i++) { |
|
|
depositoryManager.append(departmentHeadByUser.get(i).getId() + ","); |
|
|
depositoryManager.append(departmentHeadByUser.get(i).getId() + ","); |
|
|
// QyWxUid.append(departmentHeadByUser.get(i).getWorkwechat() + ",");
|
|
|
QyWxUid.append(departmentHeadByUser.get(i).getWorkwechat() + ","); |
|
|
} |
|
|
} |
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
QyWxUid.append("PangFuZhen,"); |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
map.put("depositoryManager", depositoryManager.toString()); |
|
|
@ -2275,9 +2291,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("minIdList", sb.toString()); |
|
|
QyWxApprovalMap.put("minIdList", sb.toString()); |
|
|
redisTemplate.opsForHash().putAll("wms_out_"+record.getId(), QyWxApprovalMap); |
|
|
redisTemplate.opsForHash().putAll("wms_out_" + record.getId(), QyWxApprovalMap); |
|
|
// 设置过期时间为7天
|
|
|
// 设置过期时间为7天
|
|
|
redisTemplate.expire("wms_out_"+record.getId(), 7, TimeUnit.DAYS); |
|
|
redisTemplate.expire("wms_out_" + record.getId(), 7, TimeUnit.DAYS); |
|
|
} else { |
|
|
} else { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
@ -2307,11 +2323,22 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 将主订单插入到redis中
|
|
|
// 将主订单插入到redis中
|
|
|
redisTemplate.opsForHash().put("record:" + record.getId(), "minRecord", minRecordByMain.toString()); |
|
|
redisTemplate.opsForHash().put("record:" + record.getId(), "minRecord", minRecordByMain.toString()); |
|
|
map.put("state", "仓储中心负责人审核通过"); |
|
|
map.put("state", "仓储中心负责人审核通过"); |
|
|
} else { |
|
|
if(!flagForHasOtherDepository){ |
|
|
|
|
|
map.put("state", "部门负责人审核通过"); |
|
|
|
|
|
map.put("departmenthead", userid); |
|
|
|
|
|
map.put("departmentheadPass", 1); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
updateInventoryForOutRefused(record); |
|
|
updateInventoryForOutRefused(record); |
|
|
result = "驳回"; |
|
|
result = "驳回"; |
|
|
map.put("pass", 2); |
|
|
map.put("pass", 2); |
|
|
map.put("state", "仓储中心负责人审核未通过"); |
|
|
map.put("state", "仓储中心负责人审核未通过"); |
|
|
|
|
|
if(!flagForHasOtherDepository){ |
|
|
|
|
|
map.put("state", "部门负责人审核未通过"); |
|
|
|
|
|
map.put("departmenthead", userid); |
|
|
|
|
|
map.put("departmentheadPass", 2); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
// 开启线程更改其他用户卡片模板样式
|
|
|
String finalResult = result; |
|
|
String finalResult = result; |
|
|
@ -2507,9 +2534,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("sp_no", sp_no); |
|
|
QyWxApprovalMap.put("minIdList", sb.toString()); |
|
|
QyWxApprovalMap.put("minIdList", sb.toString()); |
|
|
redisTemplate.opsForHash().putAll("wms_out_"+recordP.getId(), QyWxApprovalMap); |
|
|
redisTemplate.opsForHash().putAll("wms_out_" + recordP.getId(), QyWxApprovalMap); |
|
|
// 设置过期时间为7天
|
|
|
// 设置过期时间为7天
|
|
|
redisTemplate.expire("wms_out_"+recordP.getId(), 7, TimeUnit.DAYS); |
|
|
redisTemplate.expire("wms_out_" + recordP.getId(), 7, TimeUnit.DAYS); |
|
|
} else { |
|
|
} else { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
@ -2568,8 +2595,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
// 进行入库操作
|
|
|
// 进行入库操作
|
|
|
applicationInPlace(map); |
|
|
applicationInPlace(map); |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果不在该仓库,插入一条新记录
|
|
|
// 如果不在该仓库,插入一条新记录
|
|
|
Map<String, Object> insert = new HashMap<>(); |
|
|
Map<String, Object> insert = new HashMap<>(); |
|
|
// 转移数量
|
|
|
// 转移数量
|
|
|
@ -2619,8 +2645,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
placeMapper.updateMaterialAndPlace(toMaterialAndPlace); |
|
|
placeMapper.updateMaterialAndPlace(toMaterialAndPlace); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果是拆单单位
|
|
|
// 如果是拆单单位
|
|
|
|
|
|
|
|
|
// 用于获取当前拆单记录
|
|
|
// 用于获取当前拆单记录
|
|
|
@ -2670,8 +2695,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
splitInventory.setInQuantity(splitInventory.getInQuantity() + quantity); |
|
|
splitInventory.setInQuantity(splitInventory.getInQuantity() + quantity); |
|
|
// 修改当前拆单库存处理记录
|
|
|
// 修改当前拆单库存处理记录
|
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
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 userByPort 待查询用户 |
|
|
* @param map 查询条件 |
|
|
* @param map 查询条件 |
|
|
* @return |
|
|
* @return |
|
|
@ -3072,18 +3096,18 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
for (RoleAndDepository depository: depositoryAndRole |
|
|
for (RoleAndDepository depository : depositoryAndRole |
|
|
) { |
|
|
) { |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
} |
|
|
} |
|
|
if(depositoryIdList.size() == 0){ |
|
|
if (depositoryIdList.size() == 0) { |
|
|
depositoryIdList = null; |
|
|
depositoryIdList = null; |
|
|
} |
|
|
} |
|
|
map.put("depositoryIdList",depositoryIdList); |
|
|
map.put("depositoryIdList", depositoryIdList); |
|
|
map.put("applicantId",userByPort.getId()); |
|
|
map.put("applicantId", userByPort.getId()); |
|
|
List<ApplicationInRecordP> list = depositoryRecordMapper.findApplicationInRecordPByUser(map); |
|
|
List<ApplicationInRecordP> list = depositoryRecordMapper.findApplicationInRecordPByUser(map); |
|
|
for (ApplicationInRecordP applicationInRecordP : list) { |
|
|
for (ApplicationInRecordP applicationInRecordP : list) { |
|
|
UserByPort userByPortById = LinkInterfaceUtil.FindUserById(applicationInRecordP.getApplicantId(),userByPort); |
|
|
UserByPort userByPortById = LinkInterfaceUtil.FindUserById(applicationInRecordP.getApplicantId(), userByPort); |
|
|
String time = DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordP.getApplicantTime())); |
|
|
String time = DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordP.getApplicantTime())); |
|
|
applicationInRecordP.setApplicantName(userByPortById.getName()); |
|
|
applicationInRecordP.setApplicantName(userByPortById.getName()); |
|
|
applicationInRecordP.setApplicantTime(time); |
|
|
applicationInRecordP.setApplicantTime(time); |
|
|
@ -3110,21 +3134,22 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
for (RoleAndDepository depository: depositoryAndRole |
|
|
for (RoleAndDepository depository : depositoryAndRole |
|
|
) { |
|
|
) { |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
} |
|
|
} |
|
|
if(depositoryIdList.size() == 0){ |
|
|
if (depositoryIdList.size() == 0) { |
|
|
depositoryIdList = null; |
|
|
depositoryIdList = null; |
|
|
} |
|
|
} |
|
|
map.put("depositoryIdList",depositoryIdList); |
|
|
map.put("depositoryIdList", depositoryIdList); |
|
|
map.put("applicantId",userByPort.getId()); |
|
|
map.put("applicantId", userByPort.getId()); |
|
|
return depositoryRecordMapper.findApplicationInRecordPCountByUser(map); |
|
|
return depositoryRecordMapper.findApplicationInRecordPCountByUser(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 查询当前用户出库记录及其管理仓库的出库记录 |
|
|
* 查询当前用户出库记录及其管理仓库的出库记录 |
|
|
|
|
|
* |
|
|
* @param userByPort 待查询用户 |
|
|
* @param userByPort 待查询用户 |
|
|
* @param map 查询条件 |
|
|
* @param map 查询条件 |
|
|
* @return |
|
|
* @return |
|
|
@ -3137,15 +3162,15 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
for (RoleAndDepository depository: depositoryAndRole |
|
|
for (RoleAndDepository depository : depositoryAndRole |
|
|
) { |
|
|
) { |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
} |
|
|
} |
|
|
if(depositoryIdList.size() == 0){ |
|
|
if (depositoryIdList.size() == 0) { |
|
|
depositoryIdList = null; |
|
|
depositoryIdList = null; |
|
|
} |
|
|
} |
|
|
map.put("depositoryIdList",depositoryIdList); |
|
|
map.put("depositoryIdList", depositoryIdList); |
|
|
map.put("applicantId",userByPort.getId()); |
|
|
map.put("applicantId", userByPort.getId()); |
|
|
List<ApplicationOutRecordP> list = depositoryRecordMapper.findApplicationOutRecordPByUser(map); |
|
|
List<ApplicationOutRecordP> list = depositoryRecordMapper.findApplicationOutRecordPByUser(map); |
|
|
for (ApplicationOutRecordP recordP : list) { |
|
|
for (ApplicationOutRecordP recordP : list) { |
|
|
UserByPort userByPortById = LinkInterfaceUtil.FindUserById(recordP.getApplicantId(), userByPort); |
|
|
UserByPort userByPortById = LinkInterfaceUtil.FindUserById(recordP.getApplicantId(), userByPort); |
|
|
@ -3159,6 +3184,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 查询当前用户出库记录及其管理仓库的出库记录数目 |
|
|
* 查询当前用户出库记录及其管理仓库的出库记录数目 |
|
|
|
|
|
* |
|
|
* @param map 查询条件 |
|
|
* @param map 查询条件 |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@ -3170,15 +3196,15 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<RoleAndDepository> depositoryAndRole = roleService.findDepositoryAndRole(userByPort.getId()); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
List<Integer> depositoryIdList = new ArrayList<>(); |
|
|
for (RoleAndDepository depository: depositoryAndRole |
|
|
for (RoleAndDepository depository : depositoryAndRole |
|
|
) { |
|
|
) { |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
depositoryIdList.add(depository.getDepositoryId()); |
|
|
} |
|
|
} |
|
|
if(depositoryIdList.size() == 0){ |
|
|
if (depositoryIdList.size() == 0) { |
|
|
depositoryIdList = null; |
|
|
depositoryIdList = null; |
|
|
} |
|
|
} |
|
|
map.put("depositoryIdList",depositoryIdList); |
|
|
map.put("depositoryIdList", depositoryIdList); |
|
|
map.put("applicantId",userByPort.getId()); |
|
|
map.put("applicantId", userByPort.getId()); |
|
|
return depositoryRecordMapper.findApplicationOutRecordPCountByUser(map); |
|
|
return depositoryRecordMapper.findApplicationOutRecordPCountByUser(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -3833,6 +3859,27 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
return false; |
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于计算当前主记录下的总额与数量 |
|
|
* 用于计算当前主记录下的总额与数量 |
|
|
*/ |
|
|
*/ |
|
|
|