|
@@ -103,11 +103,56 @@ public class StockBackDetailsServiceImpl extends ServiceImpl<StockBackDetailsMap
|
|
|
// 物料名称
|
|
|
.and(ObjectUtil.isNotEmpty(materialName), q ->
|
|
|
q.eq("m.Name", materialName).or().likeRight("m.Name", materialName + "-"))
|
|
|
- .eq("uu.IsDelete", 0)
|
|
|
.notIn("m.CategoryCode", Arrays.asList(configMap.get("issue").getNotCategoryCodeSet().split(",")))
|
|
|
+ .eq("uu.IsDelete", 0)
|
|
|
.isNotNull("uu.JobNo");
|
|
|
|
|
|
return baseMapper.getPickingList(wrapper, tech, beginTime, endTime);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> returnMaterial(Condition condition) {
|
|
|
+ // 开始时间
|
|
|
+ Date beginTime = condition.getBeginTime();
|
|
|
+ // 结束时间
|
|
|
+ Date endTime = condition.getEndTime();
|
|
|
+
|
|
|
+ Assert.notEmpty(beginTime, "开始时间不能为空");
|
|
|
+ Assert.notEmpty(endTime, "结束时间不能为空");
|
|
|
+
|
|
|
+ // 人员
|
|
|
+ String userId = condition.getStr("userId");
|
|
|
+ // 物料名称
|
|
|
+ String materialName = condition.getStr("materialName");
|
|
|
+ // 工艺
|
|
|
+ String tech = condition.getStr("tech");
|
|
|
+
|
|
|
+ Map<String, PlanConfig> configMap = planConfigService.list().stream()
|
|
|
+ .collect(Collectors.toMap(PlanConfig::getCode, item -> item));
|
|
|
+
|
|
|
+ QueryWrapper<Object> wrapper = Wrappers.query()
|
|
|
+ .between("sb.statistics_date", beginTime, endTime)
|
|
|
+ .eq("uu.IsDelete", 0)
|
|
|
+ .func(q -> {
|
|
|
+ // 用户id不为空
|
|
|
+ if (ObjectUtil.isNotEmpty(userId)) {
|
|
|
+ q.eq("uu.ID", userId);
|
|
|
+ }
|
|
|
+ // 用户id为空,查询指定部门全部人员
|
|
|
+ else {
|
|
|
+ List<String> deptIdList = new ArrayList<>();
|
|
|
+ deptIdList.addAll(Arrays.asList(configMap.get("returnWarehouse").getDeptIdSet().split(",")));
|
|
|
+ deptIdList.addAll(Arrays.asList(configMap.get("returnWarehouseA008").getDeptIdSet().split(",")));
|
|
|
+ q.in("uu.DepartmentID", deptIdList);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 物料名称
|
|
|
+ .and(ObjectUtil.isNotEmpty(materialName), q ->
|
|
|
+ q.eq("m.Name", materialName).or().likeRight("m.Name", materialName + "-"))
|
|
|
+ .notIn("m.CategoryCode", Arrays.asList(configMap.get("issue").getNotCategoryCodeSet().split(",")))
|
|
|
+ .isNotNull("uu.JobNo");
|
|
|
+
|
|
|
+ return baseMapper.getReturnMaterialList(wrapper, tech, beginTime, endTime);
|
|
|
+ }
|
|
|
+
|
|
|
}
|