更新代码
parent
38bd0be5aa
commit
5b79b33a25
|
@ -44,6 +44,11 @@
|
|||
<artifactId>february-common-datasource</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-common-core</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.february</groupId>-->
|
||||
<!-- <artifactId>february-common-log</artifactId>-->
|
||||
|
@ -55,6 +60,7 @@
|
|||
<artifactId>february-fault-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
|
|
|
@ -8,9 +8,15 @@ package com.february.fault.controller;
|
|||
**/
|
||||
|
||||
import com.february.common.core.domain.Result;
|
||||
import com.february.common.core.domain.FaultCode;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.february.fault.aspect.WebLog;
|
||||
import com.february.fault.domain.FaultCode;
|
||||
|
||||
|
||||
//import com.february.fault.domain.FaultCode;
|
||||
import com.february.fault.service.FaultCodeService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -53,8 +59,24 @@ public class FaultCodeController {
|
|||
Result<String> result=faultCodeService.addFaultCode(faultCode);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆故障码信息
|
||||
* @param faultCode
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public Result updateFaultCode(@RequestBody FaultCode faultCode){
|
||||
return faultCodeService.updateFaultCode(faultCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障信息
|
||||
* @param faultCodeId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public Result delFaultCode(@RequestParam Integer faultCodeId){
|
||||
return faultCodeService.delFaultCode(faultCodeId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,11 +14,9 @@ import com.february.fault.domain.FaultCode;
|
|||
import com.february.fault.domain.FaultLog;
|
||||
import com.february.fault.service.FaultLogService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
@ -58,4 +56,23 @@ public class FaultLogController {
|
|||
return faultLogService.addFaultLog(faultLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对故障日志信息进行修改
|
||||
* @param faultLog
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public Result updateFaultLog(@RequestBody FaultLog faultLog){
|
||||
return faultLogService.updateFaultLog(faultLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对故障日志信息进行删除
|
||||
* @param faultLogId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/del")
|
||||
public Result delFaultLog(@RequestParam Integer faultLogId){
|
||||
return faultLogService.delFaultLog(faultLogId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.february.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.february.fault.domain.FaultCode;
|
||||
import com.february.common.core.domain.FaultCode;
|
||||
|
||||
/**
|
||||
* @program: february-fault-information
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.february.fault.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.february.common.core.domain.Result;
|
||||
import com.february.fault.domain.FaultCode;
|
||||
import com.february.common.core.domain.FaultCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,4 +20,6 @@ public interface FaultCodeService extends IService<FaultCode> {
|
|||
Result<String> addFaultCode(FaultCode faultCode);
|
||||
|
||||
Result updateFaultCode(FaultCode faultCode);
|
||||
|
||||
Result delFaultCode(Integer faultCodeId);
|
||||
}
|
||||
|
|
|
@ -16,4 +16,8 @@ public interface FaultLogService extends IService<FaultLog> {
|
|||
Result<List<FaultLog>> faultLogList(FaultLog faultLog);
|
||||
|
||||
Result addFaultLog(FaultLog faultLog);
|
||||
|
||||
Result updateFaultLog(FaultLog faultLog);
|
||||
|
||||
Result delFaultLog(Integer faultLogId);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.february.common.core.domain.Result;
|
||||
import com.february.fault.domain.FaultCode;
|
||||
import com.february.common.core.domain.FaultCode;
|
||||
import com.february.fault.domain.FaultType;
|
||||
import com.february.fault.mapper.FaultCodeMapper;
|
||||
import com.february.fault.mapper.FaultTypeMapper;
|
||||
|
@ -80,5 +80,21 @@ public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCode
|
|||
return Result.error(faultCode1,"修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除单个故障码信息
|
||||
* @param faultCodeId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result delFaultCode(Integer faultCodeId) {
|
||||
QueryWrapper<FaultCode> faultCodeQueryWrapper = new QueryWrapper<>();
|
||||
faultCodeQueryWrapper.eq("fault_code_id",faultCodeId);
|
||||
int delete = faultCodeMapper.delete(faultCodeQueryWrapper);
|
||||
if(delete>0){
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
return Result.error("删除失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,12 @@ import java.util.Objects;
|
|||
public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> implements FaultLogService {
|
||||
@Autowired
|
||||
private FaultLogMapper faultLogMapper;
|
||||
|
||||
/**
|
||||
* 故障日志列表信息
|
||||
* @param faultLog
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<List<FaultLog>> faultLogList(FaultLog faultLog) {
|
||||
QueryWrapper<FaultLog> faultLogQueryWrapper = new QueryWrapper<>();
|
||||
|
@ -45,6 +51,11 @@ public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> i
|
|||
return Result.success(records,"故障日志列表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障日志添加操作
|
||||
* @param faultLog
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result addFaultLog(FaultLog faultLog) {
|
||||
int insert = faultLogMapper.insert(faultLog);
|
||||
|
@ -53,4 +64,37 @@ public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> i
|
|||
}
|
||||
return Result.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障日志修改
|
||||
* @param faultLog
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result updateFaultLog(FaultLog faultLog) {
|
||||
QueryWrapper<FaultLog> faultLogQueryWrapper = new QueryWrapper<>();
|
||||
faultLogQueryWrapper.eq("fault_log_id",faultLog.getFaultLogId());
|
||||
int update = faultLogMapper.update(faultLog, faultLogQueryWrapper);
|
||||
FaultLog faultLog1 = faultLogMapper.selectOne(faultLogQueryWrapper);
|
||||
if(update>0){
|
||||
return Result.success(faultLog1,"修改成功");
|
||||
}
|
||||
return Result.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障日志信息
|
||||
* @param faultLogId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result delFaultLog(Integer faultLogId) {
|
||||
QueryWrapper<FaultLog> faultLogQueryWrapper = new QueryWrapper<>();
|
||||
faultLogQueryWrapper.eq("fault_log_id",faultLogId);
|
||||
int delete = faultLogMapper.delete(faultLogQueryWrapper);
|
||||
if(delete>0){
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
return Result.error("删除失败");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue