admin
2024-09-27 4e91ae3c1ff41d0bf9f65d444c90c2583e69cdb7
提交 | 用户 | 时间
b78728 1 package com.jcdm.main.da.paramCollection.controller;
A 2
3 import com.jcdm.common.annotation.Log;
4 import com.jcdm.common.core.controller.BaseController;
5 import com.jcdm.common.core.domain.AjaxResult;
6 import com.jcdm.common.core.page.TableDataInfo;
7 import com.jcdm.common.enums.BusinessType;
8 import com.jcdm.common.utils.DateUtils;
9 import com.jcdm.common.utils.poi.ExcelUtil;
4e91ae 10 import com.jcdm.main.bs.formulaChild.domain.PrintOfflineReportInfo;
b78728 11 import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
A 12 import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.security.access.prepost.PreAuthorize;
15 import org.springframework.web.bind.annotation.*;
16
17 import javax.servlet.http.HttpServletResponse;
4e91ae 18 import java.time.LocalDate;
A 19 import java.time.format.DateTimeFormatter;
b78728 20 import java.util.List;
4e91ae 21 import java.util.Map;
b78728 22
A 23 /**
24  * 设备产品过程参数采集Controller
25  * 
26  * @author yyt
27  * @date 2023-12-13
28  */
29 @RestController
30 @RequestMapping("/main/paramCollection")
31 public class DaParamCollectionController extends BaseController
32 {
33     @Autowired
34     private IDaParamCollectionService daParamCollectionService;
35
36     /**
37      * 查询设备产品过程参数采集列表
38      */
4e91ae 39     @GetMapping("/getPrintOfflineReportInfo")
A 40     public AjaxResult getPrintOfflineReportInfo(DaParamCollection daParamCollection)
41     {
42         PrintOfflineReportInfo info = new PrintOfflineReportInfo();
43         info.setParam18(">500");
44         info.setParam19("0.3%,0%,0.5%");
45         info.setParam20(">600");
46         info.setParam21(">700");
47         info.setParam22("0.22");
48         info.setParam23("362");
49         info.setParam24("8.18");
50         info.setParam25("0.1");
51         info.setParam26("21.53,42.33,42.19");
52         info.setParam27("49.20,49.34,49.15");
53         info.setParam28("0.061%,0.163%,0.223%");
54         info.setParam29("35.1,35.0,35.1");
55         info.setParam30("√");
56         info.setParam31("0.0041");
57         info.setParam32("3.06");
58         info.setParam33("o.48");
59         info.setParam34("4.7uA");
60         info.setParam35("562.1");
61         info.setParam36("-137.1");
62         info.setParam37("√");
63         info.setInspectionDate(getInspectionDate());
64         return AjaxResult.success(info);
65     }
66
67     public static String getInspectionDate(){
68         // 获取当前日期
69         LocalDate today = LocalDate.now();
70         // 定义日期格式(年.月.日)
71         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.M.d");
72         // 格式化当前日期
73         return today.format(formatter);
74     }
75
76     public static void main(String[] args) {
77         System.out.println(getInspectionDate());
78     }
79
80     /**
81      * 查询设备产品过程参数采集列表
82      */
b78728 83     @PreAuthorize("@ss.hasPermi('main:paramCollection:list')")
A 84     @GetMapping("/list")
85     public TableDataInfo list(DaParamCollection daParamCollection)
86     {
87         startPage();
88         List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection);
89         return getDataTable(list);
90     }
91
92     /**
93      * 查询设备产品过程参数采集列表
94      */
95     @PostMapping("/sendIMesData")
96     public void sendIMesData(@RequestBody DaParamCollection daParamCollection)
97     {
98         daParamCollectionService.pushGeelycvMesFeedback(daParamCollection.getSfcCode(),daParamCollection.getLocationCode());
99     }
100
101     /**
102      * 导出设备产品过程参数采集列表
103      */
104     @PreAuthorize("@ss.hasPermi('main:paramCollection:export')")
105     @Log(title = "设备产品过程参数采集", businessType = BusinessType.EXPORT)
106     @PostMapping("/export")
107     public void export(HttpServletResponse response, DaParamCollection daParamCollection)
108     {
109         List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection);
110         ExcelUtil<DaParamCollection> util = new ExcelUtil<DaParamCollection>(DaParamCollection.class);
111         util.exportExcel(response, list, "设备产品过程参数采集数据");
112     }
113
114     /**
115      * 获取设备产品过程参数采集详细信息
116      */
117     @PreAuthorize("@ss.hasPermi('main:paramCollection:query')")
118     @GetMapping(value = "/{id}")
119     public AjaxResult getInfo(@PathVariable("id") Long id)
120     {
121         return success(daParamCollectionService.selectDaParamCollectionById(id));
122     }
123
124     /**
125      * 新增设备产品过程参数采集
126      */
127     @PreAuthorize("@ss.hasPermi('main:paramCollection:add')")
128     @Log(title = "设备产品过程参数采集", businessType = BusinessType.INSERT)
129     @PostMapping
130     public AjaxResult add(@RequestBody DaParamCollection daParamCollection)
131     {
132         daParamCollection.setCreateBy(getUsername());
133         daParamCollection.setCreateTime(DateUtils.getNowDate());
134         return toAjax(daParamCollectionService.insertDaParamCollection(daParamCollection));
135     }
136
137     /**
138      * 基础参数增加
139      */
140     @PostMapping("/addBasicParameters")
141     public void addBasicParameters(@RequestBody DaParamCollection daParamCollection)
142     {
143         daParamCollectionService.addBasicParameters(daParamCollection);
144     }
145
146     /**
147      * 基础参数增加
148      */
149     @PostMapping("/yzAddBasicParameters")
150     public void yzAddBasicParameters(@RequestBody DaParamCollection daParamCollection)
151     {
152         daParamCollectionService.yzAddBasicParameters(daParamCollection);
153     }
154
155     /**
156      * 拧紧参数增加
157      */
158     @PostMapping("/addTighteningParameters")
159     public void addTighteningParameters(@RequestBody DaParamCollection daParamCollection)
160     {
161         daParamCollectionService.addTighteningParameters(daParamCollection);
162     }
163
164     /**
165      * 出战时间参数增加
166      */
167     @PostMapping("/saveCampaignTimeParameters")
168     public void saveCampaignTimeParameters(@RequestBody DaParamCollection daParamCollection)
169     {
170         daParamCollectionService.saveCampaignTimeParameters(daParamCollection);
171     }
172
173     /**
174      * 出战时间参数增加
175      */
176     @PostMapping("/preInstallOut")
177     public void preInstallOut(@RequestBody DaParamCollection daParamCollection)
178     {
179         daParamCollectionService.preInstallOut(daParamCollection);
180     }
181
182     /**
183      * 出战时间参数增加
184      */
185     @PostMapping("/checkRecordDataDone")
186     public AjaxResult checkRecordDataDone(@RequestBody DaParamCollection daParamCollection)
187     {
188         return daParamCollectionService.checkRecordDataDone(daParamCollection);
189     }
190
191     /**
192      * 出战时间参数增加
193      */
194     @PostMapping("/jrmSaveCampaignTimeParameters")
195     public void jrmSaveCampaignTimeParameters(@RequestBody DaParamCollection daParamCollection)
196     {
197         daParamCollectionService.jrmSaveCampaignTimeParameters(daParamCollection);
198     }
199
200
201     /**
202      * 更换总成号
203      */
204     @PostMapping("/replaceAssemblyCode")
205     public void replaceAssemblyCode(@RequestBody DaParamCollection daParamCollection)
206     {
207         daParamCollectionService.replaceAssemblyCode(daParamCollection);
208     }
209
210     /**
211      * 更换总成号
212      */
213     @PostMapping("/enterWeighing")
214     public void enterWeighing(@RequestBody DaParamCollection daParamCollection)
215     {
216         daParamCollectionService.enterWeighing(daParamCollection);
217     }
218
219     /**
220      * 修改设备产品过程参数采集
221      */
222     @PreAuthorize("@ss.hasPermi('main:paramCollection:edit')")
223     @Log(title = "设备产品过程参数采集", businessType = BusinessType.UPDATE)
224     @PutMapping
225     public AjaxResult edit(@RequestBody DaParamCollection daParamCollection)
226     {
227         daParamCollection.setUpdateBy(getUsername());
228         daParamCollection.setUpdateTime(DateUtils.getNowDate());
229         return toAjax(daParamCollectionService.updateDaParamCollection(daParamCollection));
230     }
231
232     /**
233      * 删除设备产品过程参数采集
234      */
235     @PreAuthorize("@ss.hasPermi('main:paramCollection:remove')")
236     @Log(title = "设备产品过程参数采集", businessType = BusinessType.DELETE)
237     @DeleteMapping("/{ids}")
238     public AjaxResult remove(@PathVariable Long[] ids)
239     {
240         return toAjax(daParamCollectionService.deleteDaParamCollectionByIds(ids));
241     }
242
243 }