优化仓库权限
This commit is contained in:
@@ -206,9 +206,13 @@ public class DepotHeadController {
|
||||
Supplier supplier = supplierService.getSupplier(organId);
|
||||
BigDecimal beginNeed = BigDecimal.ZERO;
|
||||
if (("客户").equals(supType)) {
|
||||
beginNeed = supplier.getBeginNeedGet();
|
||||
if(supplier.getBeginNeedGet()!=null) {
|
||||
beginNeed = supplier.getBeginNeedGet();
|
||||
}
|
||||
} else if (("供应商").equals(supType)) {
|
||||
beginNeed = supplier.getBeginNeedPay();
|
||||
if(supplier.getBeginNeedPay()!=null) {
|
||||
beginNeed = supplier.getBeginNeedPay();
|
||||
}
|
||||
}
|
||||
BigDecimal firstMoney = depotHeadService.findTotalPay(organId, beginTime, supType)
|
||||
.subtract(accountHeadService.findTotalPay(organId, beginTime, supType)).add(beginNeed);
|
||||
|
||||
@@ -282,16 +282,29 @@ public class DepotService {
|
||||
//开始拼接json数据
|
||||
if (null != dataList) {
|
||||
boolean depotFlag = systemConfigService.getDepotFlag();
|
||||
for (Depot depot : dataList) {
|
||||
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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!depotFlag || flag) {
|
||||
} else {
|
||||
for (Depot depot : dataList) {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("id", depot.getId());
|
||||
item.put("depotName", depot.getName());
|
||||
item.put("isDefault", depot.getIsDefault());
|
||||
|
||||
Reference in New Issue
Block a user