故障码业务实现
parent
5d5537cb37
commit
5a964fa9f5
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -36,7 +36,7 @@ spring:
|
|||
ds1:
|
||||
nacos:
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
dataId: sentinel-zhilian-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
package com.zhilian.business.controller;
|
||||
|
||||
import com.zhilian.business.domain.Break;
|
||||
import com.zhilian.business.domain.BreakVo;
|
||||
import com.zhilian.business.service.BreakService;
|
||||
import com.zhilian.common.core.domain.Result;
|
||||
import com.zhilian.common.core.web.page.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @ClassName BreakController
|
||||
* @Description 故障业务实现
|
||||
* @Author YuanYongH
|
||||
* @Date 2024/4/4 9:40
|
||||
*/
|
||||
@RestController
|
||||
public class BreakController {
|
||||
|
||||
@Autowired
|
||||
private BreakService breakService;
|
||||
|
||||
/**
|
||||
* @Description // 故障列表
|
||||
* @Date 2024/4/4
|
||||
* @param breakVo
|
||||
* @return com.zhilian.common.core.domain.Result<com.zhilian.common.core.web.page.PageResult<com.zhilian.business.domain.Break>>
|
||||
**/
|
||||
@PostMapping("breakList")
|
||||
public Result<PageResult<Break>> breakList(@RequestBody BreakVo breakVo) {
|
||||
PageResult<Break> pageResult = breakService.breakList(breakVo);
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description // 故障添加
|
||||
* @Date 2024/4/4
|
||||
* @param break1
|
||||
* @return com.zhilian.common.core.domain.Result
|
||||
**/
|
||||
@PostMapping("breakAdd")
|
||||
public Result breakAdd(@RequestBody Break break1) {
|
||||
int i = breakService.breakAdd(break1);
|
||||
Result<Integer> success = Result.success(i);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description // 故障修改
|
||||
* @Date 2024/4/4
|
||||
* @param break1
|
||||
* @return com.zhilian.common.core.domain.Result
|
||||
**/
|
||||
@PostMapping("breakUpd")
|
||||
public Result breadUpd(@RequestBody Break break1) {
|
||||
int i = breakService.breakUpd(break1);
|
||||
Result<Integer> success = Result.success(i);
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description // 故障删除
|
||||
* @Date 2024/4/4
|
||||
* @param breakId
|
||||
* @return com.zhilian.common.core.domain.Result
|
||||
**/
|
||||
@PostMapping("breakDel/{breakId}")
|
||||
public Result delFirm(@PathVariable Integer breakId){
|
||||
int i = breakService.breakDel(breakId);
|
||||
Result<Integer> success = Result.success(i);
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.zhilian.business.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName Break
|
||||
* @Description 故障实体类
|
||||
* @Author YuanYongH
|
||||
* @Date 2024/4/4 9:40
|
||||
*/
|
||||
@Data
|
||||
public class Break {
|
||||
/**
|
||||
* 故障id
|
||||
**/
|
||||
private Integer breakId;
|
||||
/**
|
||||
* 故障码
|
||||
**/
|
||||
private String breakCode;
|
||||
/**
|
||||
* 车牌号
|
||||
**/
|
||||
private String breakCar;
|
||||
/**
|
||||
* 车辆VIN码
|
||||
**/
|
||||
private String breakVin;
|
||||
/**
|
||||
* 故障时间
|
||||
**/
|
||||
private Date breakTime;
|
||||
/**
|
||||
* 故障类型
|
||||
**/
|
||||
private String breakType;
|
||||
/**
|
||||
* 故障级别
|
||||
**/
|
||||
private Integer breakRank;
|
||||
/**
|
||||
* 故障状态
|
||||
**/
|
||||
private Integer breakState;
|
||||
/**
|
||||
* 故障设备
|
||||
**/
|
||||
private String breakDevice;
|
||||
/**
|
||||
* 故障描述
|
||||
**/
|
||||
private String breakDesc;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.zhilian.business.domain;
|
||||
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName BreakVo
|
||||
* @Description TODO
|
||||
* @Author YuanYongH
|
||||
* @Date 2024/4/4 9:51
|
||||
*/
|
||||
@Data
|
||||
public class BreakVo {
|
||||
/**
|
||||
* 故障id
|
||||
**/
|
||||
private Integer breakId;
|
||||
/**
|
||||
* 车辆VIN码
|
||||
**/
|
||||
private String breakVin;
|
||||
/**
|
||||
* 故障状态
|
||||
**/
|
||||
private Integer breakState;
|
||||
|
||||
|
||||
/**
|
||||
* 分页
|
||||
**/
|
||||
private Integer pageNum = 1;
|
||||
private Integer pageSize = 3;
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.zhilian.business.mapper;
|
||||
|
||||
import com.zhilian.business.domain.Break;
|
||||
import com.zhilian.business.domain.BreakVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName BreakMapper
|
||||
* @Description TODO
|
||||
* @Author YuanYongH
|
||||
* @Date 2024/4/4 9:59
|
||||
*/
|
||||
@Mapper
|
||||
public interface BreakMapper {
|
||||
List<Break> breakList(BreakVo breakVo);
|
||||
|
||||
int breakAdd(Break break1);
|
||||
|
||||
int breakUpd(Break break1);
|
||||
|
||||
int breakDel(Integer breakId);
|
||||
|
||||
Integer addBreak(String breakCar, String breakVin, String breakType, Integer breakRank, Integer breakState);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.zhilian.business.service;
|
||||
|
||||
import com.zhilian.business.domain.Break;
|
||||
import com.zhilian.business.domain.BreakVo;
|
||||
import com.zhilian.common.core.web.page.PageResult;
|
||||
|
||||
/**
|
||||
* @ClassName BreakService
|
||||
* @Description TODO
|
||||
* @Author YuanYongH
|
||||
* @Date 2024/4/4 9:54
|
||||
*/
|
||||
public interface BreakService {
|
||||
PageResult<Break> breakList(BreakVo breakVo);
|
||||
|
||||
int breakAdd(Break break1);
|
||||
|
||||
int breakUpd(Break break1);
|
||||
|
||||
int breakDel(Integer breakId);
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.zhilian.business.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zhilian.business.domain.Break;
|
||||
import com.zhilian.business.domain.BreakVo;
|
||||
import com.zhilian.business.mapper.BreakMapper;
|
||||
import com.zhilian.business.service.BreakService;
|
||||
import com.zhilian.common.core.web.page.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName BreakServiceImpl
|
||||
* @Description TODO
|
||||
* @Author YuanYongH
|
||||
* @Date 2024/4/4 9:54
|
||||
*/
|
||||
@Service
|
||||
public class BreakServiceImpl implements BreakService {
|
||||
@Autowired
|
||||
private BreakMapper breakMapper;
|
||||
@Override
|
||||
public PageResult<Break> breakList(BreakVo breakVo) {
|
||||
PageHelper.startPage(breakVo.getPageNum(),breakVo.getPageSize());
|
||||
List<Break> list = breakMapper.breakList(breakVo);
|
||||
PageInfo<Break> info = new PageInfo<>(list);
|
||||
return PageResult.toResult(info.getTotal(),list).getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int breakAdd(Break break1) {
|
||||
int i = breakMapper.breakAdd(break1);
|
||||
if (i>0){
|
||||
breakMapper.addBreak(break1.getBreakCar(),break1.getBreakVin(),break1.getBreakType(),break1.getBreakRank(),break1.getBreakState());
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int breakUpd(Break break1) {
|
||||
return breakMapper.breakUpd(break1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int breakDel(Integer breakId) {
|
||||
return breakMapper.breakDel(breakId);
|
||||
}
|
||||
}
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhilian.business.mapper.BreakMapper">
|
||||
<insert id="breakAdd">
|
||||
insert into business_breakdown(break_device,break_type,break_rank,break_state,break_time,break_desc,break_id,break_car,break_vin)
|
||||
values(#{breakDevice},#{breakType},#{breakRank},#{breakState},#{breakTime},#{breakDesc},#{breakId},#{breakCar},#{breakVin})
|
||||
</insert>
|
||||
<insert id="addBreak">
|
||||
insert into business_breakdown(break_device,break_type,break_rank,break_state,break_time,break_desc,break_id,break_car,break_vin)
|
||||
values(#{breakCar},#{breakType},#{breakRank},#{breakState},#{breakTime},#{breakDesc},#{breakId},#{breakCar},#{breakVin})
|
||||
</insert>
|
||||
|
||||
<update id="breakUpd">
|
||||
|
||||
</update>
|
||||
<update id="breakDel">
|
||||
delete from business_breakdown where break_id = #{breakId}
|
||||
</update>
|
||||
<select id="breakList" resultType="com.zhilian.business.domain.Break">
|
||||
select * from business_break
|
||||
</select>
|
||||
</mapper>
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
package com.zhilian.resolver;
|
||||
import com.zhilian.common.security.annotation.EnableMyFeignClients;
|
||||
import com.zhilian.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@EnableCustomSwagger2
|
||||
@EnableScheduling
|
||||
@EnableMyFeignClients
|
||||
@MapperScan({"com.zhilian.resolver.mapper", "com.zhilian.resolver.resolverReport"})
|
||||
@SpringBootApplication
|
||||
public class ZhiLianResolverApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ZhiLianResolverApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -19,11 +19,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.10.25.2:8848
|
||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
||||
namespace: c854844c-45ce-4328-876c-51d85b7bab48
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue