Kaynağa Gözat

特殊报工分支

wangxin 10 ay önce
ebeveyn
işleme
8ee4e8f762

+ 39 - 21
src/main/java/cn/ezhizao/project/business/controller/BizSpecialDayworkController.java

@@ -7,6 +7,7 @@ import cn.ezhizao.framework.web.domain.AjaxResult;
 import cn.ezhizao.framework.web.page.TableDataInfo;
 import cn.ezhizao.project.business.domain.*;
 import cn.ezhizao.project.business.service.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
@@ -35,6 +36,9 @@ public class BizSpecialDayworkController extends BaseController {
     @Resource
     private IBizLotTechnologicalProcessDetailService bizTechnologicalAmendDetailService;
 
+    @Resource
+    private IBizLotTechnologicalProcessDetailService bizLotTechnologicalProcessDetailService;
+
     @Resource
     private IBizDayworkCarrierService bizDayworkCarrierService;
 
@@ -130,9 +134,9 @@ public class BizSpecialDayworkController extends BaseController {
     /**
      * 查询deptProcess列表
      */
-//    @PreAuthorize("@ss.hasPermi('business:deptProcess:list')")
+    @Log(title = "特殊报工首序报工查询工段内工序信息", businessType = BusinessType.SELECT)
     @PostMapping("/selectDeptProcessList")
-    public AjaxResult list(@RequestBody Map<String, Object> data) throws NoSuchFieldException, IllegalAccessException {
+    public AjaxResult deptProcessList(@RequestBody Map<String, Object> data) throws NoSuchFieldException, IllegalAccessException {
         List<String> statusList = Arrays.asList("0", "1", "2");
         Long deptId = Long.parseLong(data.get("deptId").toString());
         List<BizDeptProcess> deptProcesses = bizDeptProcessService.query().eq("dept_id", deptId).list();
@@ -157,28 +161,42 @@ public class BizSpecialDayworkController extends BaseController {
 
             return success(technologicalProcessDetails);
         }
-        /* 当一个工序未工序完成,再开始报工时,只能做当前工序,不允许做其它工序
-        if (dayworkId > 0){
-            List<BizDayworkItem> itemList = bizDayworkItemService.query()
-                    .eq("daywork_id", dayworkId)
-                    .in("status", statusList)
-                    .orderByDesc("create_time")
-                    .list();
-            //如果当前批次有未完成的工序,那么只能做这一道工序
-            for (BizDeptProcess item : list) {
-                if (!itemList.isEmpty()){
-                    //保留工段下和他相同的那一条工序
-                    if(itemList.get(0).getProcessId().equals(item.getProcessId())){
-                        returnList.add(item);
-                        return success(returnList);
-                    }
-                }
-            }
-        }
-        */
         return success(deptProcesses);
     }
 
+    /**
+     * 查询该批次对应的工序
+     */
+    @Log(title = "特殊报工首序报工查询批次工序信息", businessType = BusinessType.SELECT)
+    @GetMapping("/getProcessListByLot")
+    public AjaxResult getProcessListByLot(BizLot bizLot) throws NoSuchFieldException, IllegalAccessException {
+        //该批是否废品回用
+        if(bizLot.getIsWasteRecycling() == 1 || bizLot.getIsAmend() == 1 ) {
+//                QueryWrapper<BizLotTechnologicalProcess> queryWrapper = new QueryWrapper<>();
+//                queryWrapper.eq("lot_id",bizLot.getId());
+//                queryWrapper.eq("is_stop",0);
+//                BizLotTechnologicalProcess wasteRecycling = bizLotTechnologicalProcessService.getOne(queryWrapper);
+            QueryWrapper<BizLotTechnologicalProcessDetail> wrapper = new QueryWrapper<>();
+            wrapper.eq("lot_technological_process_id",bizLot.getTechnologicalProcessId());
+            //去掉备料的序
+            wrapper.ne("process_id",0);
+            wrapper.ne("process_id",1);
+            wrapper.orderByAsc("process_step_number");
+            List<BizLotTechnologicalProcessDetail> list = bizLotTechnologicalProcessDetailService.list(wrapper);
+            return success(list);
+        }
+        //查原始工艺工序表
+        else {
+            QueryWrapper<BizTechnologicalProcessDetail> wrapper = new QueryWrapper<>();
+            wrapper.eq("technological_process_id",bizLot.getTechnologicalProcessId());
+            wrapper.ne("process_id",0);
+            wrapper.ne("process_id",1);
+            wrapper.ne("tenant_id", 9);
+            wrapper.orderByAsc("process_step_number");
+            return success(bizTechnologicalProcessDetailService.list(wrapper));
+        }
+    }
+
     @Log(title = "特殊报工首序报工查询批次信息", businessType = BusinessType.SELECT)
     @GetMapping("/selectLotList")
     public AjaxResult selectLotList(BizLot bizLot) {