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