新增校验
This commit is contained in:
parent
7b0c928309
commit
e8faf72541
|
|
@ -93,7 +93,8 @@ public class MaLabelBindController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MaLabelBindVO maLabelBindVO)
|
||||
{
|
||||
return toAjax(maLabelBindService.insertMaLabelBind(maLabelBindVO));
|
||||
|
||||
return maLabelBindService.insertMaLabelBind(maLabelBindVO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.base.service;
|
|||
|
||||
|
||||
import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ public interface IMaLabelBindService
|
|||
* @param maLabelBindVO 机具设备标签ma_label_bind
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMaLabelBind(MaLabelBindVO maLabelBindVO);
|
||||
public AjaxResult insertMaLabelBind(MaLabelBindVO maLabelBindVO);
|
||||
|
||||
/**
|
||||
* 修改机具设备标签ma_label_bind
|
||||
|
|
|
|||
|
|
@ -4,12 +4,10 @@ import com.bonus.sgzb.base.api.domain.MaMachine;
|
|||
import com.bonus.sgzb.base.mapper.MaLabelBindMapper;
|
||||
import com.bonus.sgzb.base.service.IMaLabelBindService;
|
||||
import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import lombok.extern.flogger.Flogger;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -66,13 +64,13 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMaLabelBind(MaLabelBindVO maLabelBind)
|
||||
public AjaxResult insertMaLabelBind(MaLabelBindVO maLabelBind)
|
||||
{
|
||||
int i = 0;
|
||||
int b =0;
|
||||
MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode());
|
||||
if(null != bean){
|
||||
return b;
|
||||
return AjaxResult.error("设备编码已绑定!!!");
|
||||
}else {
|
||||
MaMachine maMachine =new MaMachine();
|
||||
maMachine.setMaCode(maLabelBind.getMaCode());
|
||||
|
|
@ -84,7 +82,7 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService
|
|||
b=maLabelBindMapper.updateMaLabelBindMaIds(maLabelBind);
|
||||
i = maLabelBindMapper.insertMaLabelBindS(maLabelBind);
|
||||
}
|
||||
return i;
|
||||
return AjaxResult.error("绑定成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue