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>
<artifactId>cloud-modules-wechat</artifactId>
<description>
cloud-modules-wechat 微信公众号模块
</description>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

View File

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

View File

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

View File

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

View File

@ -11,7 +11,7 @@ import java.util.Date;
/**
* sys_car_fault_message
* @author YuanZiLong
* @author
* @package: com.muyu.breakdown.domain
* @name: SysCarFaultMessage
* @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.utils.SecurityUtils;
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.servlet.http.HttpServletResponse;
import org.springframework.validation.annotation.Validated;
@ -18,24 +20,26 @@ import java.util.Arrays;
import java.util.List;
/**
*
* @author YuanZiLong
*
* @author
* @package: com.muyu.breakdown.controller
* @name: SysCarFaultController
* @date: 2024/9/20 11:00
*/
@RestController
@RequestMapping("/breakdown")
@Tag(name = "车辆故障码",description = "车辆故障码管理")
public class SysCarFaultController extends BaseController
{
@Resource
private SysCarFaultService sysCarFaultService;
/**
*
*
*/
@RequiresPermissions("breakdown:breakdown:list")
@GetMapping("/list")
@Operation(summary = "查询车辆故障码管理列表",description ="查询车辆故障码管理列表")
public Result<TableDataInfo<SysCarFault>> list(SysCarFault sysCarFault)
{
startPage();
@ -46,10 +50,11 @@ public class SysCarFaultController extends BaseController
/**
*
*
*/
@RequiresPermissions("breakdown:breakdown:export")
@PostMapping("/export")
@Operation(summary = "导出车辆故障码管理列表",description = "导出车辆故障码管理列表")
public void export(HttpServletResponse response, SysCarFault sysCarFault)
{
List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault);
@ -58,20 +63,22 @@ public class SysCarFaultController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("breakdown:breakdown:query")
@GetMapping(value = "/{id}")
@Operation(summary = "获取车辆故障码管理详细信息")
public Result<List<SysCarFault>> getInfo(@PathVariable("id") Long id)
{
return success(sysCarFaultService.selectSysCarFaultById(id));
}
/**
*
*
*/
@RequiresPermissions("breakdown:breakdown:add")
@PostMapping
@Operation(summary = "新增车辆故障码管理")
public Result<Integer> add(
@Validated @RequestBody SysCarFault sysCarFault)
{
@ -80,18 +87,17 @@ public class SysCarFaultController extends BaseController
if (selectFaultByFaultCode!=null){
return error("新增车辆故障 ,故障码已存在");
}
sysCarFault.setCreateBy(SecurityUtils.getUsername());
return toAjax(sysCarFaultService.save(sysCarFault));
}
/**
*
*
*/
@RequiresPermissions("breakdown:breakdown:edit")
@PutMapping
@Operation(summary = "修改车辆故障码管理")
public Result<Integer> edit(
@Validated @RequestBody SysCarFault sysCarFault)
{
@ -101,10 +107,11 @@ public class SysCarFaultController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("breakdown:breakdown:remove")
@DeleteMapping("/{ids}")
@Operation(summary = "删除车辆故障码管理")
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
{
sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
@ -112,10 +119,11 @@ public class SysCarFaultController extends BaseController
}
/**
*
*
* @param id
*/
@PutMapping("/enableWarningsById/{id}")
@Operation(summary = "启用故障码警告")
public void enableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id);
@ -123,10 +131,11 @@ public class SysCarFaultController extends BaseController
sysCarFaultService.update(wrapper);
}
/**
*
*
* @param id
*/
@PutMapping("/disableWarningsById/{id}")
@Operation(summary = "禁用故障码告警")
public void disableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
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.domain.SysCarFaultLog;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -16,25 +18,38 @@ import java.util.List;
/**
*
* @author YuanZiLong
* @author
* @package: com.muyu.breakdown.controller
* @name: SysCarFaultLogController
* @date: 2024/9/22 21:08
*/
@RestController
@RequestMapping("/log")
@Tag(name = "车辆故障记录",description = "车辆故障记录管理")
public class SysCarFaultLogController extends BaseController {
@Autowired
private SysCarFaultLogService service;
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/list")
@Operation(summary = "查询故障记录列表")
public Result<TableDataInfo<SysCarFaultLog>> list(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
return getDataTable(list);
}
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusIgnore")
@Operation(summary = "查询故障记录状态为忽略的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusIgnore(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.listStatusIgnore(sysCarFaultLog);
@ -42,29 +57,51 @@ public class SysCarFaultLogController extends BaseController {
}
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusSolve")
@Operation(summary = "查询故障记录状态为已解决的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusSolve(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.listStatusSolve(sysCarFaultLog);
return getDataTable(list);
}
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusProcess")
@Operation(summary = "查询故障记录状态为处理中的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusProcess(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage();
List<SysCarFaultLog> list = service.listStatusProcess(sysCarFaultLog);
return getDataTable(list);
}
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/add")
@Operation(summary = "新增故障记录")
public Result<Integer> add(@RequestBody SysCarFaultLog sysCarFaultLog){
return toAjax(service.save(sysCarFaultLog));
}
/**
*
* @param response
* @param sysCarFaultLog
*/
@PostMapping("/export")
@Operation(summary = "导出故障记录")
public void export(HttpServletResponse response, SysCarFaultLog sysCarFaultLog){
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
ExcelUtil<SysCarFaultLog> util = new ExcelUtil<SysCarFaultLog>(SysCarFaultLog.class);
@ -72,11 +109,12 @@ public class SysCarFaultLogController extends BaseController {
}
/**
*
*
* @param idsStr
* @return
*/
@PutMapping("/updateStatusById/{ids}")
@Operation(summary = "把处理中的数据修改为忽略")
public Result updateStatusById(@PathVariable("ids")String idsStr){
Long[] ids = Arrays.stream(idsStr.split(","))
.map(Long::valueOf)

View File

@ -14,7 +14,7 @@ import java.util.List;
/**
*
* @author YuanZiLong
* @author
* @package: com.muyu.breakdown.controller
* @name: SysCarFaultMessageController
* @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.RestController;
import java.util.List;
/**
*
* @author
* @package: com.muyu.breakdown.controller
* @name: SysCarLogController
* @date: 2024/9/22 14:39
*/
@RestController
@RequestMapping("/sysCarLog")

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ import java.util.List;
/**
*
* @author YuanZiLong
* @author
* @package: com.muyu.breakdown.service
* @name : SysCarFaultService
* @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
* @name: sysCarFaultLogServiceImpl
* @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
* @name: SysCarFaultMessageServiceImpl
* @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
* @name: SysCarFaultServiceImpl
* @date: 2024/9/20 10:58

View File

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