|
@@ -8,6 +8,7 @@ import cn.ezhizao.framework.web.domain.AjaxResult;
|
|
|
import cn.ezhizao.framework.web.page.TableDataInfo;
|
|
|
import cn.ezhizao.project.business.product.domain.*;
|
|
|
import cn.ezhizao.project.business.product.service.IBizDayworkService;
|
|
|
+import cn.ezhizao.project.business.product.service.IBizLotService;
|
|
|
import cn.ezhizao.project.business.product.service.IBizProductionPlanDetailService;
|
|
|
import cn.ezhizao.project.business.resourceGroup.domain.BizProductionResourceGroup;
|
|
|
import cn.ezhizao.project.business.resourceGroup.domain.BizProductionResourceGroupDetail;
|
|
@@ -47,6 +48,8 @@ public class BizProductionPlanDetailController extends BaseController {
|
|
|
|
|
|
@Resource
|
|
|
private IBizDayworkService dayworkService;
|
|
|
+ @Resource
|
|
|
+ private IBizLotService bizLotService;
|
|
|
|
|
|
|
|
|
|
|
@@ -151,18 +154,32 @@ public class BizProductionPlanDetailController extends BaseController {
|
|
|
if (planDetailIds.isEmpty()){
|
|
|
return null;
|
|
|
}
|
|
|
-
|
|
|
- QueryWrapper<BizProductionPlanDetail> productionPlanDetailQueryWrapper = new QueryWrapper<>();
|
|
|
- String keywords = bizProductionPlanDetail.getKeywords();
|
|
|
- productionPlanDetailQueryWrapper.in("id", planDetailIds);
|
|
|
- if (!Objects.equals(keywords, "")) {
|
|
|
- productionPlanDetailQueryWrapper.and(item ->
|
|
|
- item.like("product_description", keywords)
|
|
|
- .or()
|
|
|
- .like("production_plan_no", keywords)
|
|
|
- );
|
|
|
- }
|
|
|
- List<BizProductionPlanDetail> list = bizProductionPlanDetailService.list(productionPlanDetailQueryWrapper);
|
|
|
+ //去掉已完成的计划单
|
|
|
+ List<Long> detailIds = new ArrayList<>();
|
|
|
+ List<BizLot> bizLotList = bizLotService.query().in("production_plan_detail_id", planDetailIds).eq("deleted", 0).list();
|
|
|
+ List<BizDaywork> dayworkList = dayworkService.query().in("production_plan_detail_id", planDetailIds).eq("status", 2).list();
|
|
|
+ planDetailIds.forEach(id -> {
|
|
|
+ long lotCount = bizLotList.stream().filter(item -> item.getProductionPlanDetailId().equals(id)).count();
|
|
|
+ long dayworkCount = dayworkList.stream().filter(item -> item.getProductionPlanDetailId().equals(id)).count();
|
|
|
+ if(lotCount > dayworkCount) {
|
|
|
+ detailIds.add(id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ BizProductionPlanDetail detail = new BizProductionPlanDetail();
|
|
|
+ detail.setPlanDetailIds(detailIds);
|
|
|
+ detail.setKeywords(bizProductionPlanDetail.getKeywords());
|
|
|
+ List<BizProductionPlanDetail> list = bizProductionPlanDetailService.selectNotComplatedList(detail);
|
|
|
+// QueryWrapper<BizProductionPlanDetail> productionPlanDetailQueryWrapper = new QueryWrapper<>();
|
|
|
+// String keywords = bizProductionPlanDetail.getKeywords();
|
|
|
+// productionPlanDetailQueryWrapper.in("id", planDetailIds);
|
|
|
+// if (!Objects.equals(keywords, "")) {
|
|
|
+// productionPlanDetailQueryWrapper.and(item ->
|
|
|
+// item.like("product_description", keywords)
|
|
|
+// .or()
|
|
|
+// .like("production_plan_no", keywords)
|
|
|
+// );
|
|
|
+// }
|
|
|
+// List<BizProductionPlanDetail> list = bizProductionPlanDetailService.list(productionPlanDetailQueryWrapper);
|
|
|
// 将获取到的ProductionPlanDetail集合的id提取到集合中
|
|
|
List<Long> tempPlanDetailIds = list.stream()
|
|
|
.map(BizProductionPlanDetail::getId)
|