wujian
2024-03-28 1e39c55183c1f54d1587bf3a86b4c2210bcd592e
提交 | 用户 | 时间
e57a89 1 package com.jcdm.main.da.passingStationCollection.service.impl;
2
0ce25f 3 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
e57a89 4 import com.jcdm.common.utils.DateUtils;
5 //import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling;
6 //import com.jcdm.main.bs.orderScheduling.mapper.BsOrderSchedulingMapper;
7 //import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService;
8 import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
9 import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper;
10 import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
11 import com.jcdm.main.rm.repairRecord.domain.RmRepairRecord;
12 import com.jcdm.main.rm.repairRecord.mapper.RmRepairRecordMapper;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Service;
15
16 import java.time.LocalDate;
17 import java.time.LocalDateTime;
18 import java.time.format.DateTimeFormatter;
19 import java.util.List;
20
21 /**
22  * 产品过站采集Service业务层处理
23  * 
24  * @author yyt
25  * @date 2023-12-12
26  */
27 @Service
0ce25f 28 public class DaPassingStationCollectionServiceImpl extends ServiceImpl<DaPassingStationCollectionMapper,DaPassingStationCollection> implements IDaPassingStationCollectionService
e57a89 29 {
30     @Autowired
31     private DaPassingStationCollectionMapper daPassingStationCollectionMapper;
32
33     @Autowired
34     private RmRepairRecordMapper rmRepairRecordMapper;
35
36 //    @Autowired
37 //    private BsOrderSchedulingMapper bsOrderSchedulingMapper;
38 //
39 //    @Autowired
40 //    private IBsOrderSchedulingService bsOrderSchedulingService;
41
42     /**
43      * 查询产品过站采集
44      * 
45      * @param id 产品过站采集主键
46      * @return 产品过站采集
47      */
48     @Override
49     public DaPassingStationCollection selectDaPassingStationCollectionById(Long id)
50     {
51         return daPassingStationCollectionMapper.selectDaPassingStationCollectionById(id);
52     }
53
54     /**
55      * 查询产品过站采集列表
56      * 
57      * @param daPassingStationCollection 产品过站采集
58      * @return 产品过站采集
59      */
60     @Override
61     public List<DaPassingStationCollection> selectDaPassingStationCollectionList(DaPassingStationCollection daPassingStationCollection)
62     {
63         return daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection);
64     }
65
66 //    /**
67 //     * 获取首页单日累计量产数据
68 //     * @param fieldName bs
69 //     * @return list
70 //     */
71 //    @Override
72 //    public Integer getProduceNumToday(String fieldName) {
73 //
74 //        BsOrderScheduling bsOrderScheduling = new BsOrderScheduling();
75 //        bsOrderScheduling.setQueryField(fieldName);
76 //        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
77 //        LocalDateTime startTime = LocalDate.now().atStartOfDay();
78 //        LocalDateTime endTime = LocalDate.now().plusDays(1).atStartOfDay();
79 //        String s1 = startTime.format(formatter);
80 //        String s2 = endTime.format(formatter);
81 //        bsOrderScheduling.setStartTime(s1);
82 //        bsOrderScheduling.setEndTime(s2);
83 //        return bsOrderSchedulingMapper.getProduceNumToday(bsOrderScheduling);
84 //    }
85
86     /**
87      * 新增产品过站采集
88      * 
89      * @param daPassingStationCollection 产品过站采集
90      * @return 结果
91      */
92     @Override
93     public int insertDaPassingStationCollection(DaPassingStationCollection daPassingStationCollection)
94     {
95         daPassingStationCollection.setCreateTime(DateUtils.getNowDate());
96         return daPassingStationCollectionMapper.insertDaPassingStationCollection(daPassingStationCollection);
97     }
98
99     /**
100      * 修改产品过站采集
101      * 
102      * @param daPassingStationCollection 产品过站采集
103      * @return 结果
104      */
105     @Override
106     public int updateDaPassingStationCollection(DaPassingStationCollection daPassingStationCollection)
107     {
108         daPassingStationCollection.setUpdateTime(DateUtils.getNowDate());
109         return daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollection);
110     }
111
112     /**
113      * 批量删除产品过站采集
114      * 
115      * @param ids 需要删除的产品过站采集主键
116      * @return 结果
117      */
118     @Override
119     public int deleteDaPassingStationCollectionByIds(Long[] ids)
120     {
121         return daPassingStationCollectionMapper.deleteDaPassingStationCollectionByIds(ids);
122     }
123
124     /**
125      * 删除产品过站采集信息
126      * 
127      * @param id 产品过站采集主键
128      * @return 结果
129      */
130     @Override
131     public int deleteDaPassingStationCollectionById(Long id)
132     {
133         return daPassingStationCollectionMapper.deleteDaPassingStationCollectionById(id);
134     }
135
136     @Override
137     public void insertRepairRecordByIds(DaPassingStationCollection daPassingStationCollection) {
138         Long[] conditions = daPassingStationCollection.getIds();
139         for (int i = 0; i < conditions.length; i++) {
140             DaPassingStationCollection result = daPassingStationCollectionMapper.selectDaPassingStationCollectionById(conditions[i]);
141             RmRepairRecord rmRepairRecord = new RmRepairRecord();
142             rmRepairRecord.setBoxCode(result.getSfcCode());
143             rmRepairRecord.setProcessesCode(result.getLocationCode());
144             rmRepairRecord.setOriginalResult(result.getOutRsSign());
145             rmRepairRecordMapper.insertRmRepairRecord(rmRepairRecord);
146         }
147     }
148 }