zhanghl
2025-05-19 8cd4e3664cc33705b9c68ac278f40e40cf258ecb
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsPlate/ApsPlatePlanController.java
@@ -10,10 +10,15 @@
import com.aps.common.security.utils.DictUtils;
import com.aps.core.domain.ApsPlate.ApsPlatePlan;
import com.aps.core.domain.ApsPlate.ApsPlatePlanTemp;
import com.aps.core.domain.ApsPlate.ApsPlateRequireDate;
import com.aps.core.domain.export.ApsPlatePlanExport;
import com.aps.core.service.ApsPlate.ApsPlateRequireDateService;
import com.aps.core.service.ApsPlate.IApsPlatePlanService;
import com.aps.core.service.ApsPlate.IApsPlatePlanTempService;
import com.aps.system.api.domain.SysDictData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +35,7 @@
 * @author ruoyi
 * @date 2025-04-08
 */
@Tag(name = "钣金计划列表", description = "钣金计划列表")
@RestController
@RequestMapping("/apsPlatePlan")
public class ApsPlatePlanController extends BaseController {
@@ -37,6 +43,9 @@
    private IApsPlatePlanService apsPlatePlanService;
    @Autowired
    private IApsPlatePlanTempService apsPlatePlanTempService;
    @Resource
    private ApsPlateRequireDateService apsPlateRequireDateService;
    /**
     * 查询钣金计划管理列表
     */
@@ -229,4 +238,29 @@
        }
    }
    /**
     * 导入Excel数据
     * @param file
     * @return
     * @throws Exception
     */
    @Operation(summary = "导入工单需求日期", description = "导入工单需求日期")
    //@RequiresPermissions("apsPlatePlan:import")
    @Log(title = "导入工单需求日期", businessType = BusinessType.IMPORT)
    @PostMapping("/importRequireDate")
    public AjaxResult importRequireDate(MultipartFile file) throws Exception {
        ExcelUtil<ApsPlateRequireDate> util = new ExcelUtil<ApsPlateRequireDate>(ApsPlateRequireDate.class);
        List<ApsPlateRequireDate> plateRequireDateList = util.importExcel(file.getInputStream());
        if (!plateRequireDateList.isEmpty()) {
            try {
                apsPlateRequireDateService.batchSave(plateRequireDateList);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        } else {
            return AjaxResult.error("模板内容为空");
        }
        return AjaxResult.success("导入成功!");
    }
}