@ -83,4 +83,15 @@ public class ModevController extends BasicController {
}
@PostMapping("bindicd")
@ApiOperation("详情")
public Response<String> bindicd(@Validated @NotNull(message = "ID不能为空!") @Param("id") Integer id,@Validated @NotNull(message = "icdid不能为空!") @Param("icdid") Integer icdid) {
try {
service.bindicd(id,icdid);
return Response.success("OK");
} catch (Exception ex) {
return Response.fail(ex.getMessage());
@ -107,6 +107,9 @@ public class Modev {
@Column(name = "secondEid")
private Integer secondEid;
@Column(name = "icdid")
private Integer icdid;
@ApiModelProperty("主设备名称")
@Transient
private String zsbname;
@ -15,4 +15,6 @@ public interface ModevService {
void delete(Integer id);
Modev detail(Integer id) throws Exception;
void bindicd(Integer id, Integer icdid) throws Exception;
@ -83,4 +83,16 @@ public class ModevServiceImpl implements ModevService {
return optional.get();
@Override
public void bindicd(Integer id, Integer icdid) throws Exception {
Modev entity = repository.findById(id).orElse(null);
if (entity != null) {
entity.setIcdid(icdid);
repository.save(entity);
} else {
throw new Exception("未找到对应的检测装置");