|
|
|
@ -65,6 +65,15 @@ public class EquFaultTypeServiceImpl implements IEquFaultTypeService {
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public AjaxResult insertEquFaultType(EquFaultType equFaultType) {
|
|
|
|
|
|
|
|
|
|
// 检验
|
|
|
|
|
EquFaultType checkQuery = new EquFaultType();
|
|
|
|
|
checkQuery.setFaultType(equFaultType.getFaultType());
|
|
|
|
|
checkQuery.setFaultSubclass(equFaultType.getFaultSubclass());
|
|
|
|
|
List<EquFaultType> check = equFaultTypeMapper.selectEquFaultTypeList(checkQuery);
|
|
|
|
|
if (check.size() > 0) {
|
|
|
|
|
return error(500,"故障子类已存在!不可添加!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取当前所选工厂
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
|
|
String key = "#header.poolName";
|
|
|
|
@ -98,9 +107,24 @@ public class EquFaultTypeServiceImpl implements IEquFaultTypeService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public int updateEquFaultType(EquFaultType equFaultType) {
|
|
|
|
|
public AjaxResult updateEquFaultType(EquFaultType equFaultType) {
|
|
|
|
|
|
|
|
|
|
// 检验
|
|
|
|
|
EquFaultType checkQuery = new EquFaultType();
|
|
|
|
|
checkQuery.setFaultType(equFaultType.getFaultType());
|
|
|
|
|
checkQuery.setFaultSubclass(equFaultType.getFaultSubclass());
|
|
|
|
|
List<EquFaultType> check = equFaultTypeMapper.selectEquFaultTypeList(checkQuery);
|
|
|
|
|
if (check.size() > 0) {
|
|
|
|
|
if (!check.get(0).equals(equFaultType.getFaultCode())) {
|
|
|
|
|
return error(500,"故障子类已存在!修改失败!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
equFaultType.setUpdateBy(SecurityContextHolder.getUserName());
|
|
|
|
|
equFaultType.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
return equFaultTypeMapper.updateEquFaultType(equFaultType);
|
|
|
|
|
// 插入数据库
|
|
|
|
|
equFaultTypeMapper.updateEquFaultType(equFaultType);
|
|
|
|
|
|
|
|
|
|
return success("修改成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|