Selaa lähdekoodia

Merge remote-tracking branch 'origin/20250121-分批还原,快速报工权限修改等。' into 20250121-分批还原,快速报工权限修改等。

wangxin 4 kuukautta sitten
vanhempi
commit
d94fecf802

+ 13 - 6
src/main/java/cn/ezhizao/project/business/controller/BizDayworkController.java

@@ -121,14 +121,21 @@ public class BizDayworkController extends BaseController {
         startPage();
 
         //查询当前生产子计划的批次报工列表
-        List<BizDaywork> dayworkList = bizDayworkService.getList(bizDaywork);
-        for (BizDaywork daywork : dayworkList) {
-            if (daywork.getTotalWorkingHours() == null) {
-                daywork.setTotalWorkingHours(Long.valueOf(0));
+        try {
+            List<BizDaywork> dayworkList = bizDayworkService.getList(bizDaywork);
+            for (BizDaywork daywork : dayworkList) {
+                if (daywork.getTotalWorkingHours() == null) {
+                    daywork.setTotalWorkingHours(Long.valueOf(0));
+                }
             }
+            //最终返回当前子计划中批次报工的工序是这个人员负责的工序
+            return getDataTable(dayworkList);
+        } catch(Exception e) {
+            TableDataInfo error = new TableDataInfo();
+            error.setCode(500);
+            error.setMsg("报工数据异常,请联系管理员");
+            return error;
         }
-        //最终返回当前子计划中批次报工的工序是这个人员负责的工序
-        return getDataTable(dayworkList);
     }
 
     @GetMapping("/lotList")

+ 2 - 0
src/main/java/cn/ezhizao/project/business/controller/BizOutsourcedOrderController.java

@@ -1096,6 +1096,7 @@ public class BizOutsourcedOrderController extends BaseController {
             daywork.setIsWasteRecycling(lot != null ? lot.getIsWasteRecycling() : null);
             daywork.setId(snowflakeIdWorker.nextId());
             daywork.setTenantId(SecurityUtils.getLoginUser().getTenantId());
+            daywork.setStatus(1);
             dayworks.add(daywork);
             BizOutsourcedRecords record = new BizOutsourcedRecords();
             record.setMasterId(bizOutsourcedOrder.getId());
@@ -1777,6 +1778,7 @@ public class BizOutsourcedOrderController extends BaseController {
             daywork.setIsWasteRecycling(lot != null ? lot.getIsWasteRecycling() : null);
             daywork.setTenantId(SecurityUtils.getLoginUser().getTenantId());
             daywork.setId(snowflakeIdWorker.nextId());
+            daywork.setStatus(1);
             dayworks.add(daywork);
             BizOutsourcedRecords record = new BizOutsourcedRecords();
             record.setMasterId(finalBizOutsourcedOrder.getId());

+ 5 - 0
src/main/java/cn/ezhizao/project/business/controller/BizProductionPlanDetailController.java

@@ -169,6 +169,11 @@ public class BizProductionPlanDetailController extends BaseController {
     @Log(title = "追加批次", businessType = BusinessType.SELECT)
     public AjaxResult addLot(@RequestBody BizProductionPlanDetail bizProductionPlanDetail) throws NoSuchFieldException, IllegalAccessException {
         List<BizLot> oldList = bizLotService.query().eq("production_plan_detail_id", bizProductionPlanDetail.getId()).eq("is_superaddition", 1).list();
+        bizProductionPlanDetail.getLotList().forEach(l -> {
+            if (l.getTenantId() ==null) {
+                l.setTenantId(getLoginUser().getUser().getTenantId());
+            }
+        });
         saveOrUpdateBatch(bizLotService,bizProductionPlanDetail.getLotList(),oldList);
        return success(bizProductionPlanDetailService.updateById(bizProductionPlanDetail));
     }