huangjiayang
2025-05-15 dbcc9f8992c97b84aa6ae0a381c807ba6239ae2c
aps-modules/aps-core/src/main/java/com/aps/core/controller/ApsPlatePlanController.java
@@ -8,17 +8,19 @@
import com.aps.common.log.enums.BusinessType;
import com.aps.common.security.annotation.RequiresPermissions;
import com.aps.common.security.utils.DictUtils;
import com.aps.core.domain.ApsGasPipingPlan;
import com.aps.core.domain.ApsPlatePlan;
import com.aps.core.domain.ApsPlatePlanTemp;
import com.aps.core.domain.export.ApsPlatePlanExport;
import com.aps.core.service.IApsPlatePlanService;
import com.aps.core.service.IApsPlatePlanTempService;
import com.aps.system.api.domain.SysDictData;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@@ -164,8 +166,9 @@
     * @param planTemp 包含部分计划信息的临时对象,用于确认计划
     * @return 返回操作结果的AjaxResult对象
     */
    @RequiresPermissions("apsPlatePlan:confirm")
    @PostMapping("/confirmPart")
    public AjaxResult confirmPart(ApsPlatePlanTemp planTemp) {
    public AjaxResult confirmPart(@RequestBody ApsPlatePlanTemp planTemp) {
        return toAjax(apsPlatePlanService.confirmPlan(planTemp));
    }
    /**
@@ -177,4 +180,53 @@
        List<ApsPlatePlanTemp> list = apsPlatePlanTempService.selectApsPlatePlanTempList(apsPlatePlanTemp);
        return getDataTable(list);
    }
    /**
     * 钣金冗余工单报表
     * @param apsPlatePlan
     * @return
     */
    @RequiresPermissions("Aps:apsPlatePlan:redundantOrderList")
    @GetMapping("/redundantOrderList")
    public TableDataInfo redundantOrderList(ApsPlatePlan apsPlatePlan) {
        startPage();
        List<ApsPlatePlan> list = apsPlatePlanService.selectPlateRedundantOrderList(apsPlatePlan);
        return getDataTable(list);
    }
    /**
     * 钣金冗余工单报表导出
     * @param apsPlatePlan
     * @return
     */
    @RequiresPermissions("Aps:apsPlatePlan:redundantOrderListExport")
    @Log(title = "钣金冗余工单报表", businessType = BusinessType.EXPORT)
    @PostMapping("/redundantOrderListExport")
    public void redundantOrderListExport(HttpServletResponse response, ApsPlatePlan apsPlatePlan) {
        List<ApsPlatePlan> planList = apsPlatePlanService.selectPlateRedundantOrderList(apsPlatePlan);
        List<ApsPlatePlanExport> planListExport = new ArrayList<>();
        for (ApsPlatePlan plan : planList) {
            ApsPlatePlanExport planExport = new ApsPlatePlanExport();
            BeanUtils.copyProperties(plan, planExport);
            planListExport.add(planExport);
        }
        ExcelUtil<ApsPlatePlanExport> util = new ExcelUtil<ApsPlatePlanExport>(ApsPlatePlanExport.class);
        util.exportExcel(response, planListExport, "钣金冗余工单报表数据");
    }
    /**
     * 将钣金子单数据存到redis中
     * @return
     */
    @PostMapping("/setPlateSubPlansToRedis")
    public AjaxResult setPlateSubPlansToRedis() {
        try {
            apsPlatePlanService.setSubPlansToRedis();
            return success();
        } catch (Exception e) {
            e.printStackTrace();
            return error();
        }
    }
}