zhanghl
2025-05-23 8bcbb0b65dbb0a59f4c588be624912410fc1fcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package com.aps.core.service.impl.ApsPlate;
 
import com.aps.common.security.utils.SecurityUtils;
import com.aps.core.domain.ApsPlate.ApsPlateOrderPlanDate;
import com.aps.core.domain.ApsPlate.ApsPlateOrderPlanManager;
import com.aps.core.domain.ApsPlate.ApsPlateOrderPlanRequireDate;
import com.aps.core.domain.ApsPlate.ApsPlateStandardRequire;
import com.aps.core.enums.PLAN_TASK_STATUS;
import com.aps.core.mapper.ApsPlateOrderPlanManagerMapper;
import com.aps.core.service.ApsPlanTaskService;
import com.aps.core.service.ApsPlate.IApsPlateOrderPlanManagerService;
import com.aps.core.service.ApsPlate.IApsPlateStandardRequireBatchService;
import com.aps.core.service.ApsPlate.IApsPlateStandardRequireService;
import com.aps.core.service.ApsPlateStandardRequireOrderEndDayService;
import jakarta.annotation.Resource;
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;
 
    @Autowired
    private IApsPlateStandardRequireService apsPlateStandardRequireService;
    @Resource
    IApsPlateStandardRequireBatchService requireBatchService;
    @Resource
    ApsPlanTaskService planTaskService;
    @Resource
    ApsPlateStandardRequireOrderEndDayService  orderEndDayService;
 
    /**
     * 查询钣金工单计划管理
     *
     * @param apsPlateOrderPlanManager 钣金工单计划管理
     * @return 钣金工单计划管理
     */
    @Override
    public List<ApsPlateOrderPlanManager> selectApsPlanOrderManager(ApsPlateOrderPlanManager apsPlateOrderPlanManager) {
        return apsPlateOrderPlanManagerMapper.selectApsPlanOrderManager(apsPlateOrderPlanManager);
    }
 
    /**
     * 查询钣金工单计划标准需求
     *
     * @param workOrderNo 工单号
     * @return
     */
    @Override
    public List<ApsPlateStandardRequire> selectApsPlanStandardRequire(String workOrderNo) {
        return apsPlateOrderPlanManagerMapper.selectApsPlanStandardRequire(workOrderNo);
    }
 
    /**
     * 批量更新计划时间
     *
     * @param apsPlateOrderPlanDate
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void updatePlanDate(ApsPlateOrderPlanDate apsPlateOrderPlanDate) {
        if (apsPlateOrderPlanDate.getIsCustom()) {
            apsPlateOrderPlanDate.setUpdateBy(SecurityUtils.getUsername());
            apsPlateOrderPlanManagerMapper.updatePlanDateByCustom(apsPlateOrderPlanDate);
        } else {
            List<Long> planIds = apsPlateOrderPlanDate.getPlanIds();
            orderEndDayService.saveBatch(planIds);
 
            /*List<ApsPlateOrderPlanRequireDate> planRequireDates = apsPlateOrderPlanManagerMapper.selectPlanRequireIds(planIds);
            planRequireDates.forEach(planRequireDate -> {
                planRequireDate.setUpdateBy(SecurityUtils.getUsername());
                apsPlateOrderPlanManagerMapper.updatePlanDateByBatch(planRequireDate);
            });*/
        }
/*        String batchNum= requireBatchService.getNewBatchNumber();
        planTaskService.savePlanTask(batchNum);
        apsPlateStandardRequireService.generatorPlan(batchNum);
        planTaskService.updateTaskStatus(batchNum, PLAN_TASK_STATUS.FINISHED);*/
    }
}