package com.aps.core.service.impl; import com.aps.common.security.utils.SecurityUtils; import com.aps.core.domain.ApsPlateOrderPlanDate; import com.aps.core.domain.ApsPlateOrderPlanManager; import com.aps.core.domain.ApsPlateOrderPlanRequireDate; import com.aps.core.domain.ApsPlateStandardRequire; import com.aps.core.mapper.ApsPlateOrderPlanManagerMapper; import com.aps.core.service.IApsPlateOrderPlanManagerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * 钣金工单计划管理接口 Service业务层处理 * * @author ruoyi * @date 2025-04-14 */ @Service public class ApsPlateOrderPlanManagerServiceImpl implements IApsPlateOrderPlanManagerService { @Autowired private ApsPlateOrderPlanManagerMapper apsPlateOrderPlanManagerMapper; /** * 查询钣金工单计划管理 * * @param apsPlateOrderPlanManager 钣金工单计划管理 * @return 钣金工单计划管理 */ @Override public List selectApsPlanOrderManager(ApsPlateOrderPlanManager apsPlateOrderPlanManager) { return apsPlateOrderPlanManagerMapper.selectApsPlanOrderManager(apsPlateOrderPlanManager); } @Override public List selectApsPlanStandardRequire(String workOrderNo) { return apsPlateOrderPlanManagerMapper.selectApsPlanStandardRequire(workOrderNo); } @Transactional(rollbackFor = Exception.class) @Override public void updatePlanDate(ApsPlateOrderPlanDate apsPlateOrderPlanDate) { if (apsPlateOrderPlanDate.getIsCustom()){ apsPlateOrderPlanManagerMapper.updatePlanDateByCustom(apsPlateOrderPlanDate); }else{ List planRequireDates = apsPlateOrderPlanManagerMapper.selectPlanRequireIds(apsPlateOrderPlanDate.getPlanIds()); planRequireDates.forEach(planRequireDate -> { planRequireDate.setUpdateBy(SecurityUtils.getUsername()); apsPlateOrderPlanManagerMapper.updatePlanDateByBatch(planRequireDate); }); } } }