refactor:重构

dev.event
袁子龙 2024-09-29 10:32:28 +08:00
parent 9747b41b34
commit 52453e089b
19 changed files with 95 additions and 32 deletions

View File

@ -11,6 +11,10 @@
</parent> </parent>
<artifactId>cloud-modules-wechat</artifactId> <artifactId>cloud-modules-wechat</artifactId>
<description>
cloud-modules-wechat 微信公众号模块
</description>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>

View File

@ -9,7 +9,7 @@ import lombok.*;
/** /**
* sys_car_enterprise * sys_car_enterprise
* @author YuanZiLong * @author
* @package com.muyu.breakdown.domain * @package com.muyu.breakdown.domain
* @name: SysCarEnterprise * @name: SysCarEnterprise
* @date: 2024/9/26 19:54 * @date: 2024/9/26 19:54

View File

@ -12,7 +12,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* sys_car_fault * sys_car_fault
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.domain * @package: com.muyu.breakdown.domain
* @name: SysCarFault * @name: SysCarFault
* @date: 2024/9/20 10:56 * @date: 2024/9/20 10:56

View File

@ -12,7 +12,7 @@ import java.util.Date;
/** /**
* sys_car_fault_log * sys_car_fault_log
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.domain * @package: com.muyu.breakdown.domain
* @name: SysCarFaultLog * @name: SysCarFaultLog
* @date: 2024/9/22 20:17 * @date: 2024/9/22 20:17

View File

@ -11,7 +11,7 @@ import java.util.Date;
/** /**
* sys_car_fault_message * sys_car_fault_message
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.domain * @package: com.muyu.breakdown.domain
* @name: SysCarFaultMessage * @name: SysCarFaultMessage
* @date: 2024/9/22 11:57 * @date: 2024/9/22 11:57

View File

@ -9,6 +9,8 @@ import com.muyu.common.domain.SysCarFault;
import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.server.service.SysCarFaultService; import com.muyu.server.service.SysCarFaultService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -18,24 +20,26 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.controller * @package: com.muyu.breakdown.controller
* @name: SysCarFaultController * @name: SysCarFaultController
* @date: 2024/9/20 11:00 * @date: 2024/9/20 11:00
*/ */
@RestController @RestController
@RequestMapping("/breakdown") @RequestMapping("/breakdown")
@Tag(name = "车辆故障码",description = "车辆故障码管理")
public class SysCarFaultController extends BaseController public class SysCarFaultController extends BaseController
{ {
@Resource @Resource
private SysCarFaultService sysCarFaultService; private SysCarFaultService sysCarFaultService;
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:list") @RequiresPermissions("breakdown:breakdown:list")
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "查询车辆故障码管理列表",description ="查询车辆故障码管理列表")
public Result<TableDataInfo<SysCarFault>> list(SysCarFault sysCarFault) public Result<TableDataInfo<SysCarFault>> list(SysCarFault sysCarFault)
{ {
startPage(); startPage();
@ -46,10 +50,11 @@ public class SysCarFaultController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:export") @RequiresPermissions("breakdown:breakdown:export")
@PostMapping("/export") @PostMapping("/export")
@Operation(summary = "导出车辆故障码管理列表",description = "导出车辆故障码管理列表")
public void export(HttpServletResponse response, SysCarFault sysCarFault) public void export(HttpServletResponse response, SysCarFault sysCarFault)
{ {
List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault); List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault);
@ -58,20 +63,22 @@ public class SysCarFaultController extends BaseController
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:query") @RequiresPermissions("breakdown:breakdown:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@Operation(summary = "获取车辆故障码管理详细信息")
public Result<List<SysCarFault>> getInfo(@PathVariable("id") Long id) public Result<List<SysCarFault>> getInfo(@PathVariable("id") Long id)
{ {
return success(sysCarFaultService.selectSysCarFaultById(id)); return success(sysCarFaultService.selectSysCarFaultById(id));
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:add") @RequiresPermissions("breakdown:breakdown:add")
@PostMapping @PostMapping
@Operation(summary = "新增车辆故障码管理")
public Result<Integer> add( public Result<Integer> add(
@Validated @RequestBody SysCarFault sysCarFault) @Validated @RequestBody SysCarFault sysCarFault)
{ {
@ -80,18 +87,17 @@ public class SysCarFaultController extends BaseController
if (selectFaultByFaultCode!=null){ if (selectFaultByFaultCode!=null){
return error("新增车辆故障 ,故障码已存在"); return error("新增车辆故障 ,故障码已存在");
} }
sysCarFault.setCreateBy(SecurityUtils.getUsername()); sysCarFault.setCreateBy(SecurityUtils.getUsername());
return toAjax(sysCarFaultService.save(sysCarFault)); return toAjax(sysCarFaultService.save(sysCarFault));
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:edit") @RequiresPermissions("breakdown:breakdown:edit")
@PutMapping @PutMapping
@Operation(summary = "修改车辆故障码管理")
public Result<Integer> edit( public Result<Integer> edit(
@Validated @RequestBody SysCarFault sysCarFault) @Validated @RequestBody SysCarFault sysCarFault)
{ {
@ -101,10 +107,11 @@ public class SysCarFaultController extends BaseController
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:remove") @RequiresPermissions("breakdown:breakdown:remove")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
@Operation(summary = "删除车辆故障码管理")
public Result<Integer> remove(@PathVariable("ids") Long[] ids) public Result<Integer> remove(@PathVariable("ids") Long[] ids)
{ {
sysCarFaultService.removeBatchByIds(Arrays.asList(ids)); sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
@ -112,21 +119,23 @@ public class SysCarFaultController extends BaseController
} }
/** /**
* *
* @param id * @param id
*/ */
@PutMapping("/enableWarningsById/{id}") @PutMapping("/enableWarningsById/{id}")
@Operation(summary = "启用故障码警告")
public void enableWarningsById(@PathVariable("id")Long id){ public void enableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>(); UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id); wrapper.eq("id",id);
wrapper.set("warn_status",0); wrapper.set("warn_status",0);
sysCarFaultService.update(wrapper); sysCarFaultService.update(wrapper);
} }
/** /**
* *
* @param id * @param id
*/ */
@PutMapping("/disableWarningsById/{id}") @PutMapping("/disableWarningsById/{id}")
@Operation(summary = "禁用故障码告警")
public void disableWarningsById(@PathVariable("id")Long id){ public void disableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>(); UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id); wrapper.eq("id",id);

View File

@ -7,6 +7,8 @@ import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.domain.SysCarFaultLog; import com.muyu.common.domain.SysCarFaultLog;
import com.muyu.server.service.SysCarFaultLogService; import com.muyu.server.service.SysCarFaultLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -16,25 +18,38 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.controller * @package: com.muyu.breakdown.controller
* @name: SysCarFaultLogController * @name: SysCarFaultLogController
* @date: 2024/9/22 21:08 * @date: 2024/9/22 21:08
*/ */
@RestController @RestController
@RequestMapping("/log") @RequestMapping("/log")
@Tag(name = "车辆故障记录",description = "车辆故障记录管理")
public class SysCarFaultLogController extends BaseController { public class SysCarFaultLogController extends BaseController {
@Autowired @Autowired
private SysCarFaultLogService service; private SysCarFaultLogService service;
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/list") @PostMapping("/list")
@Operation(summary = "查询故障记录列表")
public Result<TableDataInfo<SysCarFaultLog>> list(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>> list(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog); List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
return getDataTable(list); return getDataTable(list);
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusIgnore") @PostMapping("/listStatusIgnore")
@Operation(summary = "查询故障记录状态为忽略的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusIgnore(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>>listStatusIgnore(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.listStatusIgnore(sysCarFaultLog); List<SysCarFaultLog> list = service.listStatusIgnore(sysCarFaultLog);
@ -42,29 +57,51 @@ public class SysCarFaultLogController extends BaseController {
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusSolve") @PostMapping("/listStatusSolve")
@Operation(summary = "查询故障记录状态为已解决的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusSolve(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>>listStatusSolve(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.listStatusSolve(sysCarFaultLog); List<SysCarFaultLog> list = service.listStatusSolve(sysCarFaultLog);
return getDataTable(list); return getDataTable(list);
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusProcess") @PostMapping("/listStatusProcess")
@Operation(summary = "查询故障记录状态为处理中的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusProcess(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>>listStatusProcess(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.listStatusProcess(sysCarFaultLog); List<SysCarFaultLog> list = service.listStatusProcess(sysCarFaultLog);
return getDataTable(list); return getDataTable(list);
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "新增故障记录")
public Result<Integer> add(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<Integer> add(@RequestBody SysCarFaultLog sysCarFaultLog){
return toAjax(service.save(sysCarFaultLog)); return toAjax(service.save(sysCarFaultLog));
} }
/**
*
* @param response
* @param sysCarFaultLog
*/
@PostMapping("/export") @PostMapping("/export")
@Operation(summary = "导出故障记录")
public void export(HttpServletResponse response, SysCarFaultLog sysCarFaultLog){ public void export(HttpServletResponse response, SysCarFaultLog sysCarFaultLog){
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog); List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
ExcelUtil<SysCarFaultLog> util = new ExcelUtil<SysCarFaultLog>(SysCarFaultLog.class); ExcelUtil<SysCarFaultLog> util = new ExcelUtil<SysCarFaultLog>(SysCarFaultLog.class);
@ -72,11 +109,12 @@ public class SysCarFaultLogController extends BaseController {
} }
/** /**
* *
* @param idsStr * @param idsStr
* @return * @return
*/ */
@PutMapping("/updateStatusById/{ids}") @PutMapping("/updateStatusById/{ids}")
@Operation(summary = "把处理中的数据修改为忽略")
public Result updateStatusById(@PathVariable("ids")String idsStr){ public Result updateStatusById(@PathVariable("ids")String idsStr){
Long[] ids = Arrays.stream(idsStr.split(",")) Long[] ids = Arrays.stream(idsStr.split(","))
.map(Long::valueOf) .map(Long::valueOf)

View File

@ -14,7 +14,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.controller * @package: com.muyu.breakdown.controller
* @name: SysCarFaultMessageController * @name: SysCarFaultMessageController
* @date: 2024/9/22 14:39 * @date: 2024/9/22 14:39

View File

@ -12,7 +12,13 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; /**
*
* @author
* @package: com.muyu.breakdown.controller
* @name: SysCarLogController
* @date: 2024/9/22 14:39
*/
@RestController @RestController
@RequestMapping("/sysCarLog") @RequestMapping("/sysCarLog")

View File

@ -8,7 +8,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package com.muyu.breakdown.mapper * @package com.muyu.breakdown.mapper
* @name: SysCarFaultLogMapper * @name: SysCarFaultLogMapper
* @date: 2024/9/22 21:06 * @date: 2024/9/22 21:06

View File

@ -9,7 +9,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @Package: com.muyu.breakdown.mapper * @Package: com.muyu.breakdown.mapper
* @Name: SysCarFaultMapper * @Name: SysCarFaultMapper
* @Date: 2024/9/20 10:57 * @Date: 2024/9/20 10:57

View File

@ -9,7 +9,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @packer: com.muyu.breakdown.mapper * @packer: com.muyu.breakdown.mapper
* @name: SysCarFaultMessageMapper * @name: SysCarFaultMessageMapper
* @date: 2024/9/22 11:59 * @date: 2024/9/22 11:59

View File

@ -7,7 +7,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service * @package: com.muyu.breakdown.service
* @name: SysCarFaultLogService * @name: SysCarFaultLogService
* @date: 2024/9/22 21:07 * @date: 2024/9/22 21:07

View File

@ -7,7 +7,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service * @package: com.muyu.breakdown.service
* @name: SysCarFaultMessageService * @name: SysCarFaultMessageService
* @date: 2024/9/22 14:35 * @date: 2024/9/22 14:35

View File

@ -7,7 +7,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service * @package: com.muyu.breakdown.service
* @name : SysCarFaultService * @name : SysCarFaultService
* @date: 2024/9/20 10:57 * @date: 2024/9/20 10:57

View File

@ -11,7 +11,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service.impl * @package: com.muyu.breakdown.service.impl
* @name: sysCarFaultLogServiceImpl * @name: sysCarFaultLogServiceImpl
* @date: 2024/9/22 21:07 * @date: 2024/9/22 21:07

View File

@ -12,7 +12,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service.impl * @package: com.muyu.breakdown.service.impl
* @name: SysCarFaultMessageServiceImpl * @name: SysCarFaultMessageServiceImpl
* @date: 2024/9/22 14:36 * @date: 2024/9/22 14:36

View File

@ -14,7 +14,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service.impl * @package: com.muyu.breakdown.service.impl
* @name: SysCarFaultServiceImpl * @name: SysCarFaultServiceImpl
* @date: 2024/9/20 10:58 * @date: 2024/9/20 10:58

View File

@ -278,6 +278,11 @@
<artifactId>cloud-common-saas</artifactId> <artifactId>cloud-common-saas</artifactId>
<version>${muyu.version}</version> <version>${muyu.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-swagger</artifactId>
<version>${muyu.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -287,6 +292,7 @@
<module>cloud-visual</module> <module>cloud-visual</module>
<module>cloud-modules</module> <module>cloud-modules</module>
<module>cloud-common</module> <module>cloud-common</module>
<module>cloud-common</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>