|
|
|
|
@ -112,45 +112,56 @@ public class ApplyController extends BladeController { |
|
|
|
|
public Map<String, Integer> getEveryStatusAndCount(String isGetAll) { |
|
|
|
|
Map<String, Integer> map = new HashMap<>(6); |
|
|
|
|
QueryWrapper<Apply> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
List<String> roles = Arrays.asList(AuthUtil.getUserRole().split(",")); |
|
|
|
|
List<Long> deptIds = new ArrayList<>(); |
|
|
|
|
boolean flag = false; |
|
|
|
|
if(!roles.contains("admin") && !roles.contains("政府")){ |
|
|
|
|
flag = true; |
|
|
|
|
List<Dept> depts = SysCache.getDeptChild(Long.parseLong(AuthUtil.getDeptId())); |
|
|
|
|
if(CollectionUtils.isNotEmpty(depts)){ |
|
|
|
|
deptIds = depts.stream().map(Dept::getId).collect(Collectors.toList()); |
|
|
|
|
} |
|
|
|
|
deptIds.add(Long.parseLong(AuthUtil.getDeptId())); |
|
|
|
|
} |
|
|
|
|
// 驳回
|
|
|
|
|
queryWrapper.eq("status", -1); |
|
|
|
|
if (!"1".equals(isGetAll)) { |
|
|
|
|
queryWrapper.eq("create_dept", AuthUtil.getDeptId()); |
|
|
|
|
if (flag) { |
|
|
|
|
queryWrapper.in("create_dept",deptIds); |
|
|
|
|
} |
|
|
|
|
map.put("bh", applyService.count(queryWrapper)); |
|
|
|
|
queryWrapper.clear(); |
|
|
|
|
// 待审核
|
|
|
|
|
queryWrapper.eq("status", 0); |
|
|
|
|
if (!"1".equals(isGetAll)) { |
|
|
|
|
queryWrapper.eq("create_dept", AuthUtil.getDeptId()); |
|
|
|
|
if (flag) { |
|
|
|
|
queryWrapper.in("create_dept",deptIds); |
|
|
|
|
} |
|
|
|
|
map.put("dsh", applyService.count(queryWrapper)); |
|
|
|
|
queryWrapper.clear(); |
|
|
|
|
// 待出库
|
|
|
|
|
queryWrapper.eq("status", 1); |
|
|
|
|
if (!"1".equals(isGetAll)) { |
|
|
|
|
queryWrapper.eq("create_dept", AuthUtil.getDeptId()); |
|
|
|
|
if (flag) { |
|
|
|
|
queryWrapper.in("create_dept",deptIds); |
|
|
|
|
} |
|
|
|
|
map.put("dck", applyService.count(queryWrapper)); |
|
|
|
|
queryWrapper.clear(); |
|
|
|
|
// 待确定
|
|
|
|
|
queryWrapper.eq("status", 2); |
|
|
|
|
if (!"1".equals(isGetAll)) { |
|
|
|
|
queryWrapper.eq("create_dept", AuthUtil.getDeptId()); |
|
|
|
|
if (flag) { |
|
|
|
|
queryWrapper.in("create_dept",deptIds); |
|
|
|
|
} |
|
|
|
|
map.put("dqd", applyService.count(queryWrapper)); |
|
|
|
|
queryWrapper.clear(); |
|
|
|
|
// 待归还
|
|
|
|
|
queryWrapper.eq("status", 3); |
|
|
|
|
if (!"1".equals(isGetAll)) { |
|
|
|
|
queryWrapper.eq("create_dept", AuthUtil.getDeptId()); |
|
|
|
|
if (flag) { |
|
|
|
|
queryWrapper.in("create_dept",deptIds); |
|
|
|
|
} |
|
|
|
|
map.put("dgh", applyService.count(queryWrapper)); |
|
|
|
|
queryWrapper.clear(); |
|
|
|
|
// 申领完成
|
|
|
|
|
queryWrapper.eq("status", 4); |
|
|
|
|
if (!"1".equals(isGetAll)) { |
|
|
|
|
queryWrapper.eq("create_dept", AuthUtil.getDeptId()); |
|
|
|
|
if (flag) { |
|
|
|
|
queryWrapper.in("create_dept",deptIds); |
|
|
|
|
} |
|
|
|
|
map.put("slwc", applyService.count(queryWrapper)); |
|
|
|
|
queryWrapper.clear(); |
|
|
|
|
@ -282,6 +293,13 @@ public class ApplyController extends BladeController { |
|
|
|
|
goods.setNum(goods.getNum() + applyDetail.getApplyNum()); |
|
|
|
|
goodsService.updateById(goods); |
|
|
|
|
} |
|
|
|
|
String[] strings = applyDetail.getBatchNum().split(":"); |
|
|
|
|
LambdaQueryWrapper<ProductStoreDetial> wrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper1.eq(ProductStoreDetial::getPNum,strings[0]); |
|
|
|
|
wrapper1.eq(ProductStoreDetial::getGoodsId,goods.getId()); |
|
|
|
|
ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper1); |
|
|
|
|
productStoreDetial.setNum(productStoreDetial.getNum() + Integer.parseInt(strings[1])); |
|
|
|
|
productStoreDetialService.updateById(productStoreDetial); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|