|
|
@ -104,10 +104,14 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public AjaxResult insertEquCheckItem(EquCheckItemDTO equCheckItemDTO) {
|
|
|
|
public AjaxResult insertEquCheckItem(EquCheckItemDTO equCheckItemDTO) {
|
|
|
|
// 检验重复
|
|
|
|
// 检验重复
|
|
|
|
EquCheckItem checkItem = equCheckItemMapper.selectEquCheckItemByItemName(equCheckItemDTO.getItemName());
|
|
|
|
EquCheckItem checkItem = new EquCheckItem();
|
|
|
|
if (checkItem != null) {
|
|
|
|
checkItem.setItemType(equCheckItemDTO.getItemType());
|
|
|
|
return error("检查项已存在!新增失败!");
|
|
|
|
checkItem.setItemName(equCheckItemDTO.getItemName());
|
|
|
|
|
|
|
|
List<EquCheckItem> check = equCheckItemMapper.selectEquCheckItemList(checkItem);
|
|
|
|
|
|
|
|
if (check.size() > 0) {
|
|
|
|
|
|
|
|
return error(500,"检查项已存在!新增失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 创建检查项对象
|
|
|
|
// 创建检查项对象
|
|
|
|
EquCheckItem equCheckItem = new EquCheckItem();
|
|
|
|
EquCheckItem equCheckItem = new EquCheckItem();
|
|
|
|
BeanUtils.copyProperties(equCheckItemDTO, equCheckItem);
|
|
|
|
BeanUtils.copyProperties(equCheckItemDTO, equCheckItem);
|
|
|
@ -195,6 +199,18 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@DS("#header.poolName")
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public AjaxResult updateEquCheckItem(EquCheckItemDTO equCheckItemDTO) {
|
|
|
|
public AjaxResult updateEquCheckItem(EquCheckItemDTO equCheckItemDTO) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 检验
|
|
|
|
|
|
|
|
EquCheckItem checkQuery = new EquCheckItem();
|
|
|
|
|
|
|
|
checkQuery.setItemType(equCheckItemDTO.getItemType());
|
|
|
|
|
|
|
|
checkQuery.setItemName(equCheckItemDTO.getItemName());
|
|
|
|
|
|
|
|
List<EquCheckItem> check = equCheckItemMapper.selectEquCheckItemList(checkQuery);
|
|
|
|
|
|
|
|
if (check.size()>0) {
|
|
|
|
|
|
|
|
if (!check.get(0).getItemCode().equals(equCheckItemDTO.getItemCode())) {
|
|
|
|
|
|
|
|
return error(500,"检查项已存在!不可修改!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EquCheckItem equCheckItem = new EquCheckItem();
|
|
|
|
EquCheckItem equCheckItem = new EquCheckItem();
|
|
|
|
BeanUtils.copyProperties(equCheckItemDTO, equCheckItem);
|
|
|
|
BeanUtils.copyProperties(equCheckItemDTO, equCheckItem);
|
|
|
|
|
|
|
|
|
|
|
|