guoyujia 6 月之前
父節點
當前提交
0935e97741

+ 8 - 8
src/main/java/cn/ezhizao/project/business/product/controller/BizCarrierController.java

@@ -201,25 +201,25 @@ public class BizCarrierController extends BaseController {
             if(!processInspectionList.isEmpty()) {
             if(!processInspectionList.isEmpty()) {
                     //巡检
                     //巡检
                     List<BizProcessInspecion> patrolInspectionList = processInspectionList.stream()
                     List<BizProcessInspecion> patrolInspectionList = processInspectionList.stream()
-                            .filter(item -> item.getType().equals("patrolInspection") && item.getStatus() != 1 && item.getProcessStepNumber().equals(bizDaywork.getCurrentProcess().getProcessStepNumber()))
+                            .filter(item -> item.getType().equals("patrolInspection")  && item.getProcessStepNumber().equals(bizDaywork.getCurrentProcess().getProcessStepNumber()))
                             .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                             .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                             .collect(Collectors.toList());
                             .collect(Collectors.toList());
                     if (!patrolInspectionList.isEmpty()) {
                     if (!patrolInspectionList.isEmpty()) {
                        if(patrolInspectionList.get(0).getStatus().equals(0)) {
                        if(patrolInspectionList.get(0).getStatus().equals(0)) {
                            return AjaxResult.error("该批次巡检未完成,不能周转。");
                            return AjaxResult.error("该批次巡检未完成,不能周转。");
-                       }else {
+                       }if(patrolInspectionList.get(0).getStatus().equals(2)) {
                            return AjaxResult.error("该批次巡检未合格,不能周转。");
                            return AjaxResult.error("该批次巡检未合格,不能周转。");
                        }
                        }
                     }
                     }
                     //交检
                     //交检
                 List<BizProcessInspecion> deliveryInspectionList = processInspectionList.stream()
                 List<BizProcessInspecion> deliveryInspectionList = processInspectionList.stream()
-                        .filter(item -> item.getType().equals("deliveryInspection") && item.getAdoptStatus() != 1 && item.getProcessStepNumber().equals(bizDaywork.getCurrentProcess().getProcessStepNumber()))
+                        .filter(item -> item.getType().equals("deliveryInspection")  && item.getProcessStepNumber().equals(bizDaywork.getCurrentProcess().getProcessStepNumber()))
                         .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                         .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                         .collect(Collectors.toList());
                         .collect(Collectors.toList());
                 if (!deliveryInspectionList.isEmpty()) {
                 if (!deliveryInspectionList.isEmpty()) {
                     if(deliveryInspectionList.get(0).getAdoptStatus().equals(0)) {
                     if(deliveryInspectionList.get(0).getAdoptStatus().equals(0)) {
                         return AjaxResult.error("该批次交检审核未完成,不能周转。");
                         return AjaxResult.error("该批次交检审核未完成,不能周转。");
-                    }else {
+                    }if(deliveryInspectionList.get(0).getAdoptStatus().equals(2)) {
                         return AjaxResult.error("该批次交检审核未合格,不能周转。");
                         return AjaxResult.error("该批次交检审核未合格,不能周转。");
                     }
                     }
                 }
                 }
@@ -257,25 +257,25 @@ public class BizCarrierController extends BaseController {
                     BizDayworkItem lastDayworkItem = bizDayworkItems.stream().filter(item -> item.getDayworkId().equals(bizDaywork.getId())).sorted(Comparator.comparing(BizDayworkItem::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
                     BizDayworkItem lastDayworkItem = bizDayworkItems.stream().filter(item -> item.getDayworkId().equals(bizDaywork.getId())).sorted(Comparator.comparing(BizDayworkItem::getCreateTime).reversed()).collect(Collectors.toList()).get(0);
                     //巡检
                     //巡检
                     List<BizProcessInspecion> patrolInspectionList = processInspectionList.stream()
                     List<BizProcessInspecion> patrolInspectionList = processInspectionList.stream()
-                            .filter(item -> item.getDayworkId().equals(daywork.getId()) && item.getType().equals("patrolInspection") &&  item.getStatus() != 1 && item.getProcessStepNumber().equals(lastDayworkItem.getProcessStepNumber()))
+                            .filter(item -> item.getDayworkId().equals(daywork.getId()) && item.getType().equals("patrolInspection") && item.getProcessStepNumber().equals(lastDayworkItem.getProcessStepNumber()))
                             .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                             .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                             .collect(Collectors.toList());
                             .collect(Collectors.toList());
                     if (!patrolInspectionList.isEmpty()) {
                     if (!patrolInspectionList.isEmpty()) {
                         if (patrolInspectionList.get(0).getStatus().equals(0)) {
                         if (patrolInspectionList.get(0).getStatus().equals(0)) {
                             return AjaxResult.error("该周转箱存在巡检未完成的批次,不能周转。");
                             return AjaxResult.error("该周转箱存在巡检未完成的批次,不能周转。");
-                        } else {
+                        } if(patrolInspectionList.get(0).getStatus().equals(2)) {
                             return AjaxResult.error("该周转箱存在巡检未合格的批次,不能周转。");
                             return AjaxResult.error("该周转箱存在巡检未合格的批次,不能周转。");
                         }
                         }
                     }
                     }
                     //交检
                     //交检
                     List<BizProcessInspecion> deliveryInspectionList = processInspectionList.stream()
                     List<BizProcessInspecion> deliveryInspectionList = processInspectionList.stream()
-                            .filter(item -> item.getType().equals("deliveryInspection") && item.getAdoptStatus() != 1 && item.getProcessStepNumber().equals(bizDaywork.getCurrentProcess().getProcessStepNumber()))
+                            .filter(item -> item.getType().equals("deliveryInspection") && item.getProcessStepNumber().equals(bizDaywork.getCurrentProcess().getProcessStepNumber()))
                             .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                             .sorted(Comparator.comparing(BizProcessInspecion::getCreateTime).reversed())
                             .collect(Collectors.toList());
                             .collect(Collectors.toList());
                     if (!deliveryInspectionList.isEmpty()) {
                     if (!deliveryInspectionList.isEmpty()) {
                         if (deliveryInspectionList.get(0).getAdoptStatus().equals(0)) {
                         if (deliveryInspectionList.get(0).getAdoptStatus().equals(0)) {
                             return AjaxResult.error("该周转箱存在交检审核未合格的批次,不能周转。");
                             return AjaxResult.error("该周转箱存在交检审核未合格的批次,不能周转。");
-                        } else {
+                        }if (deliveryInspectionList.get(0).getAdoptStatus().equals(2)) {
                             return AjaxResult.error("该周转箱存在交检审核未合格的批次,不能周转。");
                             return AjaxResult.error("该周转箱存在交检审核未合格的批次,不能周转。");
                         }
                         }
                     }
                     }

+ 2 - 2
src/main/resources/mybatis/system/SysDeptMapper.xml

@@ -165,7 +165,7 @@
               FROM biz_technological_process_detail btpd
               FROM biz_technological_process_detail btpd
                        INNER JOIN biz_production_plan_detail bppd
                        INNER JOIN biz_production_plan_detail bppd
                                   ON bppd.technological_process_id = btpd.technological_process_id
                                   ON bppd.technological_process_id = btpd.technological_process_id
-              WHERE bppd.id = #{productionPlanDetailId} and btpd.tenant_id !=9) AS m ON m.process_id = dp.process_id AND d.is_work_section = 1 AND d.tenant_id = #{tenantId}
+              WHERE bppd.id = #{productionPlanDetailId} and btpd.tenant_id !=9) AS m ON m.process_id = dp.process_id AND d.is_work_section = 1 AND d.tenant_id = #{tenantId} and d.del_flag = '0'
     </select>
     </select>
 	<select id="selectDeptListByTechnologyWasteRecyclingId" resultType="cn.ezhizao.project.system.domain.SysDept">
 	<select id="selectDeptListByTechnologyWasteRecyclingId" resultType="cn.ezhizao.project.system.domain.SysDept">
 		SELECT DISTINCT dp.dept_id, d.dept_name, d.workshop_id,d.is_sort_packaging
 		SELECT DISTINCT dp.dept_id, d.dept_name, d.workshop_id,d.is_sort_packaging
@@ -174,7 +174,7 @@
 		INNER JOIN
 		INNER JOIN
 		(SELECT DISTINCT btwrd.process_id
 		(SELECT DISTINCT btwrd.process_id
 		FROM biz_lot_technological_process_detail btwrd
 		FROM biz_lot_technological_process_detail btwrd
-		WHERE btwrd.lot_technological_process_id = #{lotTechnologicalProcessId}) AS m ON m.process_id = dp.process_id AND d.is_work_section = 1 AND d.tenant_id = #{tenantId}
+		WHERE btwrd.lot_technological_process_id = #{lotTechnologicalProcessId}) AS m ON m.process_id = dp.process_id AND d.is_work_section = 1 AND d.tenant_id = #{tenantId} and d.del_flag = '0'
 	</select>
 	</select>
 	<select id="selectDeptListByPlanDetailsInfo" resultType="cn.ezhizao.project.system.domain.SysDept">
 	<select id="selectDeptListByPlanDetailsInfo" resultType="cn.ezhizao.project.system.domain.SysDept">
 		SELECT DISTINCT dp.dept_id, d.dept_name, d.workshop_id,d.is_sort_packaging
 		SELECT DISTINCT dp.dept_id, d.dept_name, d.workshop_id,d.is_sort_packaging