hyingbo
2025-06-06 a3cb768d958e64625786857e0db69335875f5d8e
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/ProjectMaintenanceOrderController.java
@@ -1,5 +1,6 @@
package org.jeecg.modules.eam.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -21,6 +22,7 @@
import org.jeecg.modules.eam.model.UserVo;
import org.jeecg.modules.eam.service.IProjectMaintenanceOrderDetailService;
import org.jeecg.modules.eam.service.IProjectMaintenanceOrderService;
import org.jeecg.modules.eam.service.IdentityService;
import org.jeecg.modules.eam.vo.EquipmentDisposalPage;
import org.jeecg.modules.eam.vo.EquipmentSealPage;
import org.jeecg.modules.eam.vo.ProjectMaintenanceOrderPage;
@@ -31,6 +33,7 @@
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -66,6 +69,10 @@
//    @Autowired
//    private IFlowMyBusinessService flowMyBusinessService;
    /*---------------------------------主表处理-begin-------------------------------------*/
    @Autowired
    @Lazy
    private IdentityService sysIdentityService;
    /**
     * 分页列表查询
@@ -107,6 +114,9 @@
    public Result<String> add(@RequestBody ProjectMaintenanceOrderPage projectMaintenanceOrderPage) {
        ProjectMaintenanceOrder projectMaintenanceOrder = new ProjectMaintenanceOrder();
        BeanUtils.copyProperties(projectMaintenanceOrderPage, projectMaintenanceOrder);
        //计划编号自动生成
        String num = sysIdentityService.getNumByTypeAndLength("ProjectMaintenanceOrder", 4);
        projectMaintenanceOrder.setNum(num);
        projectMaintenanceOrderService.saveMain(projectMaintenanceOrder, projectMaintenanceOrderPage.getProjectMaintenanceOrderDetailList());
        return Result.OK("添加成功!");
    }
@@ -233,9 +243,16 @@
     */
    @ApiOperation(value = "项目性维修明细主表ID查询", notes = "项目性维修明细-通主表ID查询")
    @GetMapping(value = "/queryProjectMaintenanceOrderDetailByMainId")
    public Result<List<ProjectMaintenanceOrderDetail>> queryProjectMaintenanceOrderDetailByMainId(@RequestParam(name = "id", required = true) String id) {
        List<ProjectMaintenanceOrderDetail> projectMaintenanceOrderDetailList = projectMaintenanceOrderDetailService.selectByMainId(id);
        return Result.OK(projectMaintenanceOrderDetailList);
    public Result<?> queryProjectMaintenanceOrderDetailByMainId(@RequestParam(name = "id", required = true) String id) {
//        List<ProjectMaintenanceOrderDetail> projectMaintenanceOrderDetailList = projectMaintenanceOrderDetailService.selectByMainId(id);
        //字典转换
        LambdaQueryWrapper<ProjectMaintenanceOrderDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ProjectMaintenanceOrderDetail::getProjectMaintenanceOrderId, id);
        queryWrapper.orderByDesc(ProjectMaintenanceOrderDetail::getId);
        //分页 默认一次大修或项修不会超过100台设备
        Page<ProjectMaintenanceOrderDetail> page = new Page<ProjectMaintenanceOrderDetail>(1, 100);
        Page<ProjectMaintenanceOrderDetail> page1 = projectMaintenanceOrderDetailService.page(page, queryWrapper);
        return Result.OK(page1);
    }
    /**