|
|
@@ -29,125 +29,126 @@ import java.util.Map;
|
|
|
@RequestMapping(value = "business/catenary/bus/jcb/jcxc")
|
|
|
public class BusJcbJcxcController extends BaseController {
|
|
|
|
|
|
- private final IBusJcbJcxcService busJcbJcxcService;
|
|
|
- private final ISysFileService sysFileService;
|
|
|
-
|
|
|
- public BusJcbJcxcController(IBusJcbJcxcService busJcbJcxcService,
|
|
|
- ISysFileService sysFileService) {
|
|
|
- this.busJcbJcxcService = busJcbJcxcService;
|
|
|
- this.sysFileService = sysFileService;
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "新增")
|
|
|
- @PostMapping("/add")
|
|
|
- public AjaxResult add(@Validated @RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
- return toAjax(busJcbJcxcService.create(busJcbJcxc));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "删除")
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult delete(@RequestParam String[] ids) {
|
|
|
- return toAjax(busJcbJcxcService.delete(ids));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "更新")
|
|
|
- @PutMapping("/update")
|
|
|
- public AjaxResult update(@RequestBody @Valid BusJcbJcxc busJcbJcxc) {
|
|
|
- return toAjax(busJcbJcxcService.update(busJcbJcxc));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "单个")
|
|
|
- @GetMapping(value = {"/", "/{id}"})
|
|
|
- public AjaxResult getInfo(String id) {
|
|
|
- BusJcbJcxc info = busJcbJcxcService.getInfo(id);
|
|
|
- AjaxResult ajax = AjaxResult.success();
|
|
|
- ajax.put("info",info);
|
|
|
- return ajax;
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "列表")
|
|
|
- @GetMapping(value = "list")
|
|
|
- public TableDataInfo getList(BusJcbJcxc busJcbJcxc) {
|
|
|
- startPage();
|
|
|
- List<BusJcbJcxc> list = busJcbJcxcService.getList(busJcbJcxc);
|
|
|
- return getDataTable(list);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "获取上次检测值")
|
|
|
- @GetMapping(value = "/getLastOne")
|
|
|
- public AjaxResult getLastOne() {
|
|
|
- BusJcbJcxc info = busJcbJcxcService.getLastRecord();
|
|
|
- AjaxResult ajax = AjaxResult.success();
|
|
|
- ajax.put("info",info);
|
|
|
- return ajax;
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "提交")
|
|
|
- @PutMapping("/submit")
|
|
|
- public AjaxResult submit(@RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
- return toAjax(busJcbJcxcService.submit(busJcbJcxc));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "退回")
|
|
|
- @PutMapping("/reject")
|
|
|
- public AjaxResult reject(@RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
- return toAjax(busJcbJcxcService.reject(busJcbJcxc));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "确认")
|
|
|
- @PutMapping("/confirm")
|
|
|
- public AjaxResult confirm(@RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
- return toAjax(busJcbJcxcService.confirm(busJcbJcxc));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "导出")
|
|
|
- @GetMapping("/export/{id}")
|
|
|
- public AjaxResult export(@PathVariable(value = "id") String id) {
|
|
|
- BusJcbJcxc info = busJcbJcxcService.getInfo(id);
|
|
|
- WordUtils wordUtil = new WordUtils();
|
|
|
- //填充变量
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("${xch}", info.getXch());
|
|
|
- params.put("${qj}", info.getStationName());
|
|
|
- params.put("${wendu}", info.getTemperature() == null ? "" : info.getTemperature());
|
|
|
- params.put("${jcrq}", DateUtils.parseCheckDate(info.getCheckDate()));
|
|
|
- params.put("${gz1lcz}", info.getGz1lcz().toString());
|
|
|
- params.put("${gz2lcz}", info.getGz2lcz().toString());
|
|
|
- params.put("${zglcz}", info.getZglcz().toString());
|
|
|
- params.put("${qglcz}", info.getQglcz().toString());
|
|
|
- params.put("${ngj}", info.getNgj().toString());
|
|
|
- params.put("${plz}", info.getPlz().toString());
|
|
|
- params.put("${xcxzgazlg}", StringUtils.yesOrNo(info.getXcxzgazlg()));
|
|
|
- params.put("${hdjx}", StringUtils.yesOrNo(info.getHdjx()));
|
|
|
- params.put("${fhzzsq}", StringUtils.yesOrNo(info.getFhzzsq()));
|
|
|
- params.put("${dqssxx}", StringUtils.yesOrNo(info.getDqssxx()));
|
|
|
- params.put("${lswst}", StringUtils.yesOrNo(info.getLswst()));
|
|
|
- params.put("${xzgldydx}", StringUtils.yesOrNo(info.getXzgldydx()));
|
|
|
- params.put("${dxztlh}", StringUtils.yesOrNo(info.getDxztlh()));
|
|
|
- params.put("${czjj}", info.getCzjj().toString());
|
|
|
- params.put("${lgzzgc}", info.getLgzzgc().toString());
|
|
|
- params.put("${gzyfzgc}", info.getGzyfzgc().toString());
|
|
|
- params.put("${wxj}", StringUtils.yesOrNo(info.getWxj()));
|
|
|
- params.put("${hddxxjzt}", StringUtils.yesOrNo(info.getHddxxjzt()));
|
|
|
- params.put("${jcdxzt}", StringUtils.yesOrNo(info.getJcdxzt()));
|
|
|
- params.put("${dljxzt}", StringUtils.yesOrNo(info.getDljxzt()));
|
|
|
- params.put("${jcr}", info.getCheckUser());
|
|
|
- params.put("${sbzt}", StringUtils.YES_VALUE.equals(info.getSbzt()) ? "合格" : "不合格");
|
|
|
- params.put("${qrr}", info.getConfirmUser() == null ? "" : info.getConfirmUser());
|
|
|
- params.put("${czwt}", info.getCzwt() == null ? "" : info.getCzwt());
|
|
|
-
|
|
|
- //生成word文件的文件名
|
|
|
- String fileName = "交叉线岔高速手册.docx";
|
|
|
- String template = "word/template/交叉线岔高速手册.docx";
|
|
|
- String localFilePath = wordUtil.getWord(params, template, fileName);
|
|
|
- return sysFileService.uploadFile(localFilePath);
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "导出excel")
|
|
|
- @GetMapping(value = "exportExcel")
|
|
|
- public AjaxResult exportExcel(JcebQueryVo query) {
|
|
|
- String localFilePath = busJcbJcxcService.exportExcel(query);
|
|
|
- return sysFileService.uploadFile(localFilePath);
|
|
|
- }
|
|
|
+ private final IBusJcbJcxcService busJcbJcxcService;
|
|
|
+ private final ISysFileService sysFileService;
|
|
|
+
|
|
|
+ public BusJcbJcxcController(IBusJcbJcxcService busJcbJcxcService,
|
|
|
+ ISysFileService sysFileService) {
|
|
|
+ this.busJcbJcxcService = busJcbJcxcService;
|
|
|
+ this.sysFileService = sysFileService;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "新增")
|
|
|
+ @PostMapping("/add")
|
|
|
+ public AjaxResult add(@Validated @RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
+ return toAjax(busJcbJcxcService.create(busJcbJcxc));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除")
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult delete(@RequestParam String[] ids) {
|
|
|
+ return toAjax(busJcbJcxcService.delete(ids));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "更新")
|
|
|
+ @PutMapping("/update")
|
|
|
+ public AjaxResult update(@RequestBody @Valid BusJcbJcxc busJcbJcxc) {
|
|
|
+ busJcbJcxcService.update(busJcbJcxc);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "单个")
|
|
|
+ @GetMapping(value = {"/", "/{id}"})
|
|
|
+ public AjaxResult getInfo(String id) {
|
|
|
+ BusJcbJcxc info = busJcbJcxcService.getInfo(id);
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("info", info);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "列表")
|
|
|
+ @GetMapping(value = "list")
|
|
|
+ public TableDataInfo getList(BusJcbJcxc busJcbJcxc) {
|
|
|
+ startPage();
|
|
|
+ List<BusJcbJcxc> list = busJcbJcxcService.getList(busJcbJcxc);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取上次检测值")
|
|
|
+ @GetMapping(value = "/getLastOne")
|
|
|
+ public AjaxResult getLastOne() {
|
|
|
+ BusJcbJcxc info = busJcbJcxcService.getLastRecord();
|
|
|
+ AjaxResult ajax = AjaxResult.success();
|
|
|
+ ajax.put("info", info);
|
|
|
+ return ajax;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "提交")
|
|
|
+ @PutMapping("/submit")
|
|
|
+ public AjaxResult submit(@RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
+ return toAjax(busJcbJcxcService.submit(busJcbJcxc));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "退回")
|
|
|
+ @PutMapping("/reject")
|
|
|
+ public AjaxResult reject(@RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
+ return toAjax(busJcbJcxcService.reject(busJcbJcxc));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "确认")
|
|
|
+ @PutMapping("/confirm")
|
|
|
+ public AjaxResult confirm(@RequestBody BusJcbJcxc busJcbJcxc) {
|
|
|
+ return toAjax(busJcbJcxcService.confirm(busJcbJcxc));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "导出")
|
|
|
+ @GetMapping("/export/{id}")
|
|
|
+ public AjaxResult export(@PathVariable(value = "id") String id) {
|
|
|
+ BusJcbJcxc info = busJcbJcxcService.getInfo(id);
|
|
|
+ WordUtils wordUtil = new WordUtils();
|
|
|
+ //填充变量
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("${xch}", info.getXch());
|
|
|
+ params.put("${qj}", info.getStationName());
|
|
|
+ params.put("${wendu}", info.getTemperature() == null ? "" : info.getTemperature());
|
|
|
+ params.put("${jcrq}", DateUtils.parseCheckDate(info.getCheckDate()));
|
|
|
+ params.put("${gz1lcz}", info.getGz1lcz().toString());
|
|
|
+ params.put("${gz2lcz}", info.getGz2lcz().toString());
|
|
|
+ params.put("${zglcz}", info.getZglcz().toString());
|
|
|
+ params.put("${qglcz}", info.getQglcz().toString());
|
|
|
+ params.put("${ngj}", info.getNgj().toString());
|
|
|
+ params.put("${plz}", info.getPlz().toString());
|
|
|
+ params.put("${xcxzgazlg}", StringUtils.yesOrNo(info.getXcxzgazlg()));
|
|
|
+ params.put("${hdjx}", StringUtils.yesOrNo(info.getHdjx()));
|
|
|
+ params.put("${fhzzsq}", StringUtils.yesOrNo(info.getFhzzsq()));
|
|
|
+ params.put("${dqssxx}", StringUtils.yesOrNo(info.getDqssxx()));
|
|
|
+ params.put("${lswst}", StringUtils.yesOrNo(info.getLswst()));
|
|
|
+ params.put("${xzgldydx}", StringUtils.yesOrNo(info.getXzgldydx()));
|
|
|
+ params.put("${dxztlh}", StringUtils.yesOrNo(info.getDxztlh()));
|
|
|
+ params.put("${czjj}", info.getCzjj().toString());
|
|
|
+ params.put("${lgzzgc}", info.getLgzzgc().toString());
|
|
|
+ params.put("${gzyfzgc}", info.getGzyfzgc().toString());
|
|
|
+ params.put("${wxj}", StringUtils.yesOrNo(info.getWxj()));
|
|
|
+ params.put("${hddxxjzt}", StringUtils.yesOrNo(info.getHddxxjzt()));
|
|
|
+ params.put("${jcdxzt}", StringUtils.yesOrNo(info.getJcdxzt()));
|
|
|
+ params.put("${dljxzt}", StringUtils.yesOrNo(info.getDljxzt()));
|
|
|
+ params.put("${jcr}", info.getCheckUser());
|
|
|
+ params.put("${sbzt}", StringUtils.YES_VALUE.equals(info.getSbzt()) ? "合格" : "不合格");
|
|
|
+ params.put("${qrr}", info.getConfirmUser() == null ? "" : info.getConfirmUser());
|
|
|
+ params.put("${czwt}", info.getCzwt() == null ? "" : info.getCzwt());
|
|
|
+
|
|
|
+ //生成word文件的文件名
|
|
|
+ String fileName = "交叉线岔高速手册.docx";
|
|
|
+ String template = "word/template/交叉线岔高速手册.docx";
|
|
|
+ String localFilePath = wordUtil.getWord(params, template, fileName);
|
|
|
+ return sysFileService.uploadFile(localFilePath);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "导出excel")
|
|
|
+ @GetMapping(value = "exportExcel")
|
|
|
+ public AjaxResult exportExcel(JcebQueryVo query) {
|
|
|
+ String localFilePath = busJcbJcxcService.exportExcel(query);
|
|
|
+ return sysFileService.uploadFile(localFilePath);
|
|
|
+ }
|
|
|
|
|
|
}
|