优化仓库权限

This commit is contained in:
季圣华
2021-07-12 01:01:20 +08:00
parent a3c36a5562
commit c6a1a7b4de
2 changed files with 28 additions and 11 deletions

View File

@@ -206,10 +206,14 @@ public class DepotHeadController {
Supplier supplier = supplierService.getSupplier(organId); Supplier supplier = supplierService.getSupplier(organId);
BigDecimal beginNeed = BigDecimal.ZERO; BigDecimal beginNeed = BigDecimal.ZERO;
if (("客户").equals(supType)) { if (("客户").equals(supType)) {
if(supplier.getBeginNeedGet()!=null) {
beginNeed = supplier.getBeginNeedGet(); beginNeed = supplier.getBeginNeedGet();
}
} else if (("供应商").equals(supType)) { } else if (("供应商").equals(supType)) {
if(supplier.getBeginNeedPay()!=null) {
beginNeed = supplier.getBeginNeedPay(); beginNeed = supplier.getBeginNeedPay();
} }
}
BigDecimal firstMoney = depotHeadService.findTotalPay(organId, beginTime, supType) BigDecimal firstMoney = depotHeadService.findTotalPay(organId, beginTime, supType)
.subtract(accountHeadService.findTotalPay(organId, beginTime, supType)).add(beginNeed); .subtract(accountHeadService.findTotalPay(organId, beginTime, supType)).add(beginNeed);
BigDecimal lastMoney = depotHeadService.findTotalPay(organId, endTime, supType) BigDecimal lastMoney = depotHeadService.findTotalPay(organId, endTime, supType)

View File

@@ -282,16 +282,29 @@ public class DepotService {
//开始拼接json数据 //开始拼接json数据
if (null != dataList) { if (null != dataList) {
boolean depotFlag = systemConfigService.getDepotFlag(); boolean depotFlag = systemConfigService.getDepotFlag();
if(depotFlag) {
List<UserBusiness> list = userBusinessService.getBasicData(userId.toString(), type);
if(list!=null && list.size()>0) {
String depotStr = list.get(0).getValue();
if(StringUtil.isNotEmpty(depotStr)){
depotStr = depotStr.replaceAll("\\[", "").replaceAll("]", ",");
String[] depotArr = depotStr.split(",");
for(String depotId: depotArr) {
JSONObject item = new JSONObject();
item.put("id", depotId);
for (Depot depot : dataList) {
if(depot.getId() == Integer.parseInt(depotId)){
item.put("depotName", depot.getName());
item.put("isDefault", depot.getIsDefault());
}
}
arr.add(item);
}
}
}
} else {
for (Depot depot : dataList) { for (Depot depot : dataList) {
JSONObject item = new JSONObject(); JSONObject item = new JSONObject();
//勾选判断1
Boolean flag = false;
try {
flag = userBusinessService.checkIsUserBusinessExist(type, userId.toString(), "[" + depot.getId().toString() + "]");
} catch (DataAccessException e) {
logger.error(">>>>>>>>>>>>>>>>>查询用户对应的仓库:类型" + type + " KeyId为 " + userId + " 存在异常!");
}
if (!depotFlag || flag) {
item.put("id", depot.getId()); item.put("id", depot.getId());
item.put("depotName", depot.getName()); item.put("depotName", depot.getName());
item.put("isDefault", depot.getIsDefault()); item.put("isDefault", depot.getIsDefault());