diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceInstallController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceInstallController.java index dc8a6be..3299c89 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceInstallController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseDeviceInstallController.java @@ -3,7 +3,10 @@ package com.hw.dms.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import com.hw.dms.domain.DmsBaseDeviceLedger; +import com.hw.dms.service.IDmsBaseDeviceLedgerService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -35,6 +38,9 @@ public class DmsBaseDeviceInstallController extends BaseController @Autowired private IDmsBaseDeviceInstallService dmsBaseDeviceInstallService; + @Autowired + private IDmsBaseDeviceLedgerService dmsBaseDeviceLedgerService; + /** * 查询设备安装信息列表 */ @@ -76,8 +82,14 @@ public class DmsBaseDeviceInstallController extends BaseController @RequiresPermissions("dms:install:add") @Log(title = "设备安装信息", businessType = BusinessType.INSERT) @PostMapping + @Transactional public AjaxResult add(@RequestBody DmsBaseDeviceInstall dmsBaseDeviceInstall) { + //添加设备安装记录时,也会更新设备台账中的设备位置 + DmsBaseDeviceLedger dmsBaseDeviceLedger = new DmsBaseDeviceLedger(); + dmsBaseDeviceLedger.setDeviceLocation(dmsBaseDeviceInstall.getInstallPosition()); + dmsBaseDeviceLedger.setDeviceId(dmsBaseDeviceInstall.getDeviceId()); + dmsBaseDeviceLedgerService.updateDmsBaseDeviceLedger(dmsBaseDeviceLedger); return toAjax(dmsBaseDeviceInstallService.insertDmsBaseDeviceInstall(dmsBaseDeviceInstall)); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectProjectController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectProjectController.java index 82d5efc..7c013e9 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectProjectController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectProjectController.java @@ -3,6 +3,7 @@ package com.hw.dms.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import com.hw.dms.domain.DmsBaseInspectRoute; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -47,6 +48,16 @@ public class DmsBaseInspectProjectController extends BaseController return getDataTable(list); } + /** + * 查询巡检线路项目 + */ + @GetMapping("/getdmsBaseInspectProjectList") + public AjaxResult getdmsBaseInspectProjectList(DmsBaseInspectProject dmsBaseInspectProject) + { + List list = dmsBaseInspectProjectService + .selectDmsBaseInspectProjectList(dmsBaseInspectProject); + return success(list); + } /** * 导出巡检项目信息列表 */ diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectRouteController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectRouteController.java index b5fd87d..727a3a3 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectRouteController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseInspectRouteController.java @@ -3,6 +3,7 @@ package com.hw.dms.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import com.hw.dms.domain.DmsBaseLubeStandard; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -47,6 +48,17 @@ public class DmsBaseInspectRouteController extends BaseController return getDataTable(list); } + /** + * 查询巡检线路列表 + */ + @GetMapping("/getdmsBaseInspectRouteList") + public AjaxResult getdmsBaseInspectRouteList(DmsBaseInspectRoute dmsBaseInspectRoute) + { + List list = dmsBaseInspectRouteService + .selectDmsBaseInspectRouteList(dmsBaseInspectRoute); + return success(list); + } + /** * 导出巡检线路信息列表 */ diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseLubeStandardController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseLubeStandardController.java index 414d66e..d5a886f 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseLubeStandardController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseLubeStandardController.java @@ -3,6 +3,7 @@ package com.hw.dms.controller; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import com.hw.dms.domain.DmsBaseMaintStandard; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -60,6 +61,17 @@ public class DmsBaseLubeStandardController extends BaseController util.exportExcel(response, list, "润滑标准信息数据"); } + /** + * 查询润滑标准列表 + */ + @GetMapping("/getLueStandardList") + public AjaxResult getLueStandardList(DmsBaseLubeStandard dmsBaseLubeStandard) + { + List list = dmsBaseLubeStandardService + .selectDmsBaseLubeStandardList(dmsBaseLubeStandard); + return success(list); + } + /** * 获取润滑标准信息详细信息 */ diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseMaintStandardController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseMaintStandardController.java index 7dbafb9..ae1f84d 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseMaintStandardController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseMaintStandardController.java @@ -61,6 +61,17 @@ public class DmsBaseMaintStandardController extends BaseController } /** + * 查询保养标准列表 + */ + @GetMapping("/getMaintStandardlist") + public AjaxResult getMaintStandardlist(DmsBaseMaintStandard dmsBaseMaintStandard) + { + List list = dmsBaseMaintStandardService + .selectDmsBaseMaintStandardList(dmsBaseMaintStandard); + return success(list); + } + + /** * 获取保养标准信息详细信息 */ @RequiresPermissions("dms:standard:query") @@ -70,6 +81,7 @@ public class DmsBaseMaintStandardController extends BaseController return success(dmsBaseMaintStandardService.selectDmsBaseMaintStandardByMaintStandardId(maintStandardId)); } + /** * 新增保养标准信息 */ diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseTransferInfoController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseTransferInfoController.java index 0895915..789162f 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseTransferInfoController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBaseTransferInfoController.java @@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse; import com.hw.dms.domain.DmsBaseDeviceLedger; import com.hw.dms.service.IDmsBaseDeviceLedgerService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -47,7 +48,6 @@ public class DmsBaseTransferInfoController extends BaseController @GetMapping("/list") public TableDataInfo list(DmsBaseTransferInfo dmsBaseTransferInfo) { - startPage(); List list = dmsBaseTransferInfoService.selectDmsBaseTransferInfoList(dmsBaseTransferInfo); return getDataTable(list); } @@ -81,6 +81,7 @@ public class DmsBaseTransferInfoController extends BaseController @RequiresPermissions("dms:info:add") @Log(title = "设备转移信息", businessType = BusinessType.INSERT) @PostMapping + @Transactional public AjaxResult add(@RequestBody DmsBaseTransferInfo dmsBaseTransferInfo) { //转移时修改设备信息 diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java index 9d4e289..ba89edb 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java @@ -106,9 +106,10 @@ public class DmsBillsInspectInstanceController extends BaseController @PostMapping("/autoAdd") public AjaxResult autoAdd(@RequestBody String dmsBillsInstanceId) { - String s = dmsBillsInstanceId.replaceAll("\"", ""); + // 使用 replaceAll 方法将双引号替换为空字符串 + String result = dmsBillsInstanceId.replaceAll("\"", ""); - DmsPlanInspect dmsPlanInspect = dmsPlanInspectService.selectDmsPlanInspectByPlanInspectId(Long.valueOf(s)); + DmsPlanInspect dmsPlanInspect = dmsPlanInspectService.selectDmsPlanInspectByPlanInspectId(Long.valueOf(result)); DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance(); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseDeviceParam.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseDeviceParam.java index b1f4276..c8948a0 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseDeviceParam.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBaseDeviceParam.java @@ -44,7 +44,7 @@ public class DmsBaseDeviceParam extends BaseEntity /** 读取频率(S) */ @Excel(name = "读取频率", readConverterExp = "S=") - private Long readFrequency; + private int readFrequency; /** 是否标识:1-是;2-否 */ @Excel(name = "是否标识:1-是;2-否") @@ -122,12 +122,12 @@ public class DmsBaseDeviceParam extends BaseEntity { return paramType; } - public void setReadFrequency(Long readFrequency) + public void setReadFrequency(int readFrequency) { this.readFrequency = readFrequency; } - public Long getReadFrequency() + public int getReadFrequency() { return readFrequency; } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceBomServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceBomServiceImpl.java index d84c18d..90eb33d 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceBomServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceBomServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; @@ -63,15 +64,38 @@ public class DmsBaseDeviceBomServiceImpl implements IDmsBaseDeviceBomService if (dmsBaseDeviceBom.getParentId()==0){ dmsBaseDeviceBom.setAncestors("0"); } - else{ - DmsBaseDeviceBom dmsBaseDeviceBom1 = new DmsBaseDeviceBom(); - dmsBaseDeviceBom1.setDeviceBomId(dmsBaseDeviceBom.getParentId()); - String ancestors = dmsBaseDeviceBomMapper.selectDmsBaseDeviceBomList(dmsBaseDeviceBom1).get(0).getAncestors(); - dmsBaseDeviceBom.setAncestors(ancestors+","+dmsBaseDeviceBom.getParentId()); + else { + DmsBaseDeviceBom selectDeviceBom = new DmsBaseDeviceBom(); + selectDeviceBom.setDeviceBomId(dmsBaseDeviceBom.getParentId()); + String ancestors = dmsBaseDeviceBomMapper.selectDmsBaseDeviceBomList(selectDeviceBom).get(0).getAncestors(); + dmsBaseDeviceBom.setAncestors(ancestors + "," + dmsBaseDeviceBom.getParentId()); + //遍历所有祖先节点,检查设备ID是否重复,设备的bom不能包含其设备本身 + String ancestorsNode = dmsBaseDeviceBom.getAncestors(); + for (String ancestorsOne : ancestorsNode.split(",")) { + if (ancestorsOne.equals("0")) { + continue; + } + DmsBaseDeviceBom DeviceBomUpdate = dmsBaseDeviceBomMapper. + selectDmsBaseDeviceBomByDeviceBomId(Long.parseLong(ancestorsOne)); + if (dmsBaseDeviceBom.getDeviceId().equals(DeviceBomUpdate.getDeviceId())) { + throw new ServiceException("不能添加与祖先节点相同的设备编号"); + } + } + //同一双亲节点的设备ID不能重复,不同双亲结点同一层级的兄弟节点可以重复 + //顶级节点可以重复,顶级节点不进else + DmsBaseDeviceBom query = new DmsBaseDeviceBom(); + query.setParentId(dmsBaseDeviceBom.getParentId()); + // 查询父节点的所有子节点,即兄弟节点,都放到列表sibling中 + List siblings = dmsBaseDeviceBomMapper.selectDmsBaseDeviceBomList(query); + // 遍历兄弟节点,检查设备ID是否重复 + for (DmsBaseDeviceBom sibling : siblings) { + if (dmsBaseDeviceBom.getDeviceId().equals(sibling.getDeviceId())) { + throw new ServiceException("不能添加与兄弟节点相同的设备编号: " + dmsBaseDeviceBom.getDeviceId()); + } + } } return dmsBaseDeviceBomMapper.insertDmsBaseDeviceBom(dmsBaseDeviceBom); } - /** * 修改设备BOM信息 * @@ -86,10 +110,34 @@ public class DmsBaseDeviceBomServiceImpl implements IDmsBaseDeviceBomService dmsBaseDeviceBom.setAncestors("0"); } else{ - DmsBaseDeviceBom dmsBaseDeviceBom1 = new DmsBaseDeviceBom(); - dmsBaseDeviceBom1.setDeviceBomId(dmsBaseDeviceBom.getParentId()); - String ancestors = dmsBaseDeviceBomMapper.selectDmsBaseDeviceBomList(dmsBaseDeviceBom1).get(0).getAncestors(); + DmsBaseDeviceBom DeviceBom = new DmsBaseDeviceBom(); + DeviceBom.setDeviceBomId(dmsBaseDeviceBom.getParentId()); + String ancestors = dmsBaseDeviceBomMapper.selectDmsBaseDeviceBomList(DeviceBom).get(0).getAncestors(); dmsBaseDeviceBom.setAncestors(ancestors+","+dmsBaseDeviceBom.getParentId()); + //遍历所有祖先节点,检查设备ID是否重复,设备的bom不能包含其设备本身 + String ancestorsNode = dmsBaseDeviceBom.getAncestors(); + for (String ancestorsOne : ancestorsNode.split(",")) { + if (ancestorsOne.equals("0")) { + continue; + } + DmsBaseDeviceBom DeviceBomUpdate = dmsBaseDeviceBomMapper. + selectDmsBaseDeviceBomByDeviceBomId(Long.parseLong(ancestorsOne)); + if (dmsBaseDeviceBom.getDeviceId().equals(DeviceBomUpdate.getDeviceId())) { + throw new ServiceException("不能添加与祖先节点相同的设备编号"); + } + } + //同一双亲节点的设备ID不能重复,不同双亲结点同一层级的兄弟节点可以重复 + //顶级节点可以重复,顶级节点不进else + DmsBaseDeviceBom query = new DmsBaseDeviceBom(); + query.setParentId(dmsBaseDeviceBom.getParentId()); + // 查询父节点的所有子节点 + List siblings = dmsBaseDeviceBomMapper.selectDmsBaseDeviceBomList(query); + // 查询父节点的所有子节点,即兄弟节点,都放到列表sibling中 + for (DmsBaseDeviceBom sibling : siblings) { + if (dmsBaseDeviceBom.getDeviceId().equals(sibling.getDeviceId())) { + throw new ServiceException("不能添加与兄弟节点相同的设备编号: " + dmsBaseDeviceBom.getDeviceId()); + } + } } dmsBaseDeviceBom.setUpdateTime(DateUtils.getNowDate()); return dmsBaseDeviceBomMapper.updateDmsBaseDeviceBom(dmsBaseDeviceBom); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDebuggingServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDebuggingServiceImpl.java index eda540f..c69ff81 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDebuggingServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDebuggingServiceImpl.java @@ -1,7 +1,9 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,7 +56,12 @@ public class DmsBaseDeviceDebuggingServiceImpl implements IDmsBaseDeviceDebuggin @Override public int insertDmsBaseDeviceDebugging(DmsBaseDeviceDebugging dmsBaseDeviceDebugging) { - LoginUser loginUser = new LoginUser(); + DmsBaseDeviceDebugging DeviceDebugging = new DmsBaseDeviceDebugging(); + DeviceDebugging.setWorkOrder(dmsBaseDeviceDebugging.getWorkOrder()); + List DmsBaseDeviceDebugginglist = dmsBaseDeviceDebuggingMapper + .selectDmsBaseDeviceDebuggingList(DeviceDebugging); + if (DmsBaseDeviceDebugginglist.size() > 0)throw new ServiceException("设备调试信息已存在"); + LoginUser loginUser = SecurityUtils.getLoginUser(); dmsBaseDeviceDebugging.setCreateBy(loginUser.getUsername()); dmsBaseDeviceDebugging.setCreateTime(DateUtils.getNowDate()); return dmsBaseDeviceDebuggingMapper.insertDmsBaseDeviceDebugging(dmsBaseDeviceDebugging); @@ -68,8 +75,15 @@ public class DmsBaseDeviceDebuggingServiceImpl implements IDmsBaseDeviceDebuggin */ @Override public int updateDmsBaseDeviceDebugging(DmsBaseDeviceDebugging dmsBaseDeviceDebugging) - { - LoginUser loginUser = new LoginUser(); + { DmsBaseDeviceDebugging DeviceDebugging = new DmsBaseDeviceDebugging(); + DeviceDebugging.setWorkOrder(dmsBaseDeviceDebugging.getWorkOrder()); + List DeviceDebugginglist = dmsBaseDeviceDebuggingMapper + .selectDmsBaseDeviceDebuggingList(DeviceDebugging); + if (DeviceDebugginglist.size() > 0 && !dmsBaseDeviceDebugging.getDeviceDebuggingId() + .equals(DeviceDebugginglist.get(0).getDeviceDebuggingId())){ + throw new ServiceException("设备调试信息已存在"); + } + LoginUser loginUser = SecurityUtils.getLoginUser(); dmsBaseDeviceDebugging.setUpdateBy(loginUser.getUsername()); dmsBaseDeviceDebugging.setUpdateTime(DateUtils.getNowDate()); return dmsBaseDeviceDebuggingMapper.updateDmsBaseDeviceDebugging(dmsBaseDeviceDebugging); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDepreciationServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDepreciationServiceImpl.java index 04d5b1b..a110af9 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDepreciationServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceDepreciationServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,11 @@ public class DmsBaseDeviceDepreciationServiceImpl implements IDmsBaseDeviceDepre @Override public int insertDmsBaseDeviceDepreciation(DmsBaseDeviceDepreciation dmsBaseDeviceDepreciation) { + DmsBaseDeviceDepreciation DeviceDepreciation = new DmsBaseDeviceDepreciation(); + DeviceDepreciation.setDeviceId(dmsBaseDeviceDepreciation.getDeviceId()); + List list = dmsBaseDeviceDepreciationMapper + .selectDmsBaseDeviceDepreciationList(DeviceDepreciation); + if (list.size()>0)throw new ServiceException("该设备折旧记录已存在"); LoginUser user = SecurityUtils.getLoginUser(); dmsBaseDeviceDepreciation.setCreateBy(user.getUsername()); dmsBaseDeviceDepreciation.setIsFlag(1l); @@ -71,6 +77,14 @@ public class DmsBaseDeviceDepreciationServiceImpl implements IDmsBaseDeviceDepre @Override public int updateDmsBaseDeviceDepreciation(DmsBaseDeviceDepreciation dmsBaseDeviceDepreciation) { + DmsBaseDeviceDepreciation DeviceDepreciation = new DmsBaseDeviceDepreciation(); + DeviceDepreciation.setDeviceId(dmsBaseDeviceDepreciation.getDeviceId()); + List DeviceDepreciationlist = dmsBaseDeviceDepreciationMapper + .selectDmsBaseDeviceDepreciationList(DeviceDepreciation); + if (DeviceDepreciationlist.size()>0&& ! DeviceDepreciationlist.get(0).getDeviceDepreciationId() + .equals(dmsBaseDeviceDepreciation.getDeviceDepreciationId())){ + throw new ServiceException("该设备折旧记录已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseDeviceDepreciation.setUpdateBy(user.getUsername()); dmsBaseDeviceDepreciation.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceFilesServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceFilesServiceImpl.java index 8a29f02..0e9cb78 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceFilesServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceFilesServiceImpl.java @@ -3,6 +3,7 @@ package com.hw.dms.service.impl; import java.util.List; import java.util.Map; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -57,7 +58,11 @@ public class DmsBaseDeviceFilesServiceImpl implements IDmsBaseDeviceFilesService @Override public int insertDmsBaseDeviceFiles(DmsBaseDeviceFiles dmsBaseDeviceFiles) { - + DmsBaseDeviceFiles DeviceFiles = new DmsBaseDeviceFiles(); + DeviceFiles.setFilesCode(dmsBaseDeviceFiles.getFilesCode()); + List dmsBaseDeviceFilesList = dmsBaseDeviceFilesMapper + .selectDmsBaseDeviceFilesList(DeviceFiles); + if(dmsBaseDeviceFilesList.size()>0 ) {throw new ServiceException("设备档案编号已存在");} String url = dmsBaseDeviceFiles.getFilesPath(); int index = url.lastIndexOf("/"); String name = url.substring(index+1); @@ -79,8 +84,14 @@ public class DmsBaseDeviceFilesServiceImpl implements IDmsBaseDeviceFilesService @Override public int updateDmsBaseDeviceFiles(DmsBaseDeviceFiles dmsBaseDeviceFiles) { - - + DmsBaseDeviceFiles DeviceFiles = new DmsBaseDeviceFiles(); + DeviceFiles.setFilesCode(dmsBaseDeviceFiles.getFilesCode()); + List dmsBaseDeviceFilesList = dmsBaseDeviceFilesMapper + .selectDmsBaseDeviceFilesList(DeviceFiles); + if(dmsBaseDeviceFilesList.size()>0 && !dmsBaseDeviceFiles.getDeviceFilesId() + .equals(dmsBaseDeviceFilesList.get(0).getDeviceFilesId())) { + throw new ServiceException("设备档案编号已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); int index = dmsBaseDeviceFiles.getFilesPath().lastIndexOf("/"); String name = dmsBaseDeviceFiles.getFilesPath().substring(index+1); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceInstallServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceInstallServiceImpl.java index a3ef9e7..24c5b75 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceInstallServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceInstallServiceImpl.java @@ -1,7 +1,9 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,8 +56,14 @@ public class DmsBaseDeviceInstallServiceImpl implements IDmsBaseDeviceInstallSer @Override public int insertDmsBaseDeviceInstall(DmsBaseDeviceInstall dmsBaseDeviceInstall) { - - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); + DmsBaseDeviceInstall DeviceInstall = new DmsBaseDeviceInstall(); + DeviceInstall.setDeviceId(dmsBaseDeviceInstall.getDeviceId()); + List dmsBaseDeviceInstallList = dmsBaseDeviceInstallMapper + .selectDmsBaseDeviceInstallList(DeviceInstall); + if (dmsBaseDeviceInstallList.size()>0){ + throw new ServiceException("该设备已安装,只能有一条安装记录"); + } dmsBaseDeviceInstall.setCreateBy(loginUser.getUsername()); dmsBaseDeviceInstall.setCreateTime(DateUtils.getNowDate()); return dmsBaseDeviceInstallMapper.insertDmsBaseDeviceInstall(dmsBaseDeviceInstall); @@ -69,9 +77,15 @@ public class DmsBaseDeviceInstallServiceImpl implements IDmsBaseDeviceInstallSer */ @Override public int updateDmsBaseDeviceInstall(DmsBaseDeviceInstall dmsBaseDeviceInstall) - { - - LoginUser loginUser = new LoginUser(); + { DmsBaseDeviceInstall DeviceInstall = new DmsBaseDeviceInstall(); + DeviceInstall.setDeviceId(dmsBaseDeviceInstall.getDeviceId()); + List dmsBaseDeviceInstallList = dmsBaseDeviceInstallMapper + .selectDmsBaseDeviceInstallList(DeviceInstall); + if (dmsBaseDeviceInstallList.size()>0&&!dmsBaseDeviceInstallList.get(0).getDeviceInstallId() + .equals(dmsBaseDeviceInstall.getDeviceInstallId())){ + throw new ServiceException("该设备已安装,只能有一条安装记录"); + } + LoginUser loginUser = SecurityUtils.getLoginUser(); dmsBaseDeviceInstall.setUpdateBy(loginUser.getUsername()); dmsBaseDeviceInstall.setUpdateTime(DateUtils.getNowDate()); return dmsBaseDeviceInstallMapper.updateDmsBaseDeviceInstall(dmsBaseDeviceInstall); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java index cb0a941..bb47cc8 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceLedgerServiceImpl.java @@ -4,6 +4,7 @@ import java.util.List; import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -53,7 +54,15 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi @Override public int insertDmsBaseDeviceLedger(DmsBaseDeviceLedger dmsBaseDeviceLedger) { dmsBaseDeviceLedger.setIsFlag(1l); - LoginUser loginUser = new LoginUser(); + + LoginUser loginUser = SecurityUtils.getLoginUser(); + DmsBaseDeviceLedger DeviceLedger = new DmsBaseDeviceLedger(); + DeviceLedger.setDeviceCode(dmsBaseDeviceLedger.getDeviceCode()); + List dmsBaseDeviceLedgerList = dmsBaseDeviceLedgerMapper. + selectDmsBaseDeviceLedgerList(DeviceLedger); + if (dmsBaseDeviceLedgerList.size()>0) { + throw new ServiceException("设备编号已存在"); + } dmsBaseDeviceLedger.setCreateBy(loginUser.getUsername()); dmsBaseDeviceLedger.setCreateTime(DateUtils.getNowDate()); return dmsBaseDeviceLedgerMapper.insertDmsBaseDeviceLedger(dmsBaseDeviceLedger); @@ -67,7 +76,18 @@ public class DmsBaseDeviceLedgerServiceImpl implements IDmsBaseDeviceLedgerServi */ @Override public int updateDmsBaseDeviceLedger(DmsBaseDeviceLedger dmsBaseDeviceLedger) { - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); + //先判断DeviceCode是否为空,设备转移时转入的实体是没有DeviceCode,不会触发这个方法 + if (dmsBaseDeviceLedger.getDeviceCode() != null) { + DmsBaseDeviceLedger DeviceLedger = new DmsBaseDeviceLedger(); + DeviceLedger.setDeviceCode(dmsBaseDeviceLedger.getDeviceCode()); + List dmsBaseDeviceLedgerList = dmsBaseDeviceLedgerMapper + .selectDmsBaseDeviceLedgerList(DeviceLedger); + if (!dmsBaseDeviceLedgerList.isEmpty() && !dmsBaseDeviceLedgerList.get(0).getDeviceId() + .equals(dmsBaseDeviceLedger.getDeviceId())) { + throw new ServiceException(dmsBaseDeviceLedger.getDeviceCode() + "编号已存在"); + } + } dmsBaseDeviceLedger.setUpdateBy(loginUser.getUsername()); dmsBaseDeviceLedger.setUpdateTime(DateUtils.getNowDate()); return dmsBaseDeviceLedgerMapper.updateDmsBaseDeviceLedger(dmsBaseDeviceLedger); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceParamServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceParamServiceImpl.java index c75681d..bf36147 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceParamServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceParamServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,11 @@ public class DmsBaseDeviceParamServiceImpl implements IDmsBaseDeviceParamService @Override public int insertDmsBaseDeviceParam(DmsBaseDeviceParam dmsBaseDeviceParam) { + DmsBaseDeviceParam DeviceParam =new DmsBaseDeviceParam(); + DeviceParam.setParamCode(dmsBaseDeviceParam.getParamCode()); + List dmsBaseDeviceParamList = dmsBaseDeviceParamMapper + .selectDmsBaseDeviceParamList(DeviceParam); + if (dmsBaseDeviceParamList.size()>0) throw new ServiceException("参数编码重复"); LoginUser user = SecurityUtils.getLoginUser(); dmsBaseDeviceParam.setCreateBy(user.getUsername()); dmsBaseDeviceParam.setIsFlag(1l); @@ -71,6 +77,14 @@ public class DmsBaseDeviceParamServiceImpl implements IDmsBaseDeviceParamService @Override public int updateDmsBaseDeviceParam(DmsBaseDeviceParam dmsBaseDeviceParam) { + DmsBaseDeviceParam DeviceParam =new DmsBaseDeviceParam(); + DeviceParam.setParamCode(dmsBaseDeviceParam.getParamCode()); + List dmsBaseDeviceParamList = dmsBaseDeviceParamMapper + .selectDmsBaseDeviceParamList(DeviceParam); + if (dmsBaseDeviceParamList.size()>0 && !dmsBaseDeviceParamList.get(0).getDeviceParamId() + .equals(dmsBaseDeviceParam.getDeviceParamId())) { + throw new ServiceException("参数编码重复"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseDeviceParam.setUpdateBy(user.getUsername()); dmsBaseDeviceParam.setIsFlag(1l); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDevicePurchaseServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDevicePurchaseServiceImpl.java index 0a377a0..41d1863 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDevicePurchaseServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDevicePurchaseServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -53,6 +54,11 @@ public class DmsBaseDevicePurchaseServiceImpl implements IDmsBaseDevicePurchaseS @Override public int insertDmsBaseDevicePurchase(DmsBaseDevicePurchase dmsBaseDevicePurchase) { + DmsBaseDevicePurchase DevicePurchase = new DmsBaseDevicePurchase(); + DevicePurchase.setWorkOrder(dmsBaseDevicePurchase.getWorkOrder()); + List dmsBaseDevicePurchaseS = dmsBaseDevicePurchaseMapper + .selectDmsBaseDevicePurchaseList(DevicePurchase); + if (dmsBaseDevicePurchaseS.size() > 0){throw new ServiceException("工单号已存在");} dmsBaseDevicePurchase.setCreateTime(DateUtils.getNowDate()); return dmsBaseDevicePurchaseMapper.insertDmsBaseDevicePurchase(dmsBaseDevicePurchase); } @@ -66,6 +72,14 @@ public class DmsBaseDevicePurchaseServiceImpl implements IDmsBaseDevicePurchaseS @Override public int updateDmsBaseDevicePurchase(DmsBaseDevicePurchase dmsBaseDevicePurchase) { + DmsBaseDevicePurchase DevicePurchase = new DmsBaseDevicePurchase(); + DevicePurchase.setWorkOrder(dmsBaseDevicePurchase.getWorkOrder()); + List dmsBaseDevicePurchaseList= dmsBaseDevicePurchaseMapper + .selectDmsBaseDevicePurchaseList(DevicePurchase); + if (dmsBaseDevicePurchaseList.size() > 0 && !dmsBaseDevicePurchase.getDevicePurchaseId() + .equals(dmsBaseDevicePurchaseList.get(0).getDevicePurchaseId())){ + throw new ServiceException("采购计划编号已存在"); + } dmsBaseDevicePurchase.setUpdateTime(DateUtils.getNowDate()); return dmsBaseDevicePurchaseMapper.updateDmsBaseDevicePurchase(dmsBaseDevicePurchase); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceSuplierServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceSuplierServiceImpl.java index 7d0a696..d4db50c 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceSuplierServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceSuplierServiceImpl.java @@ -1,7 +1,9 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,7 +56,14 @@ public class DmsBaseDeviceSuplierServiceImpl implements IDmsBaseDeviceSuplierSer @Override public int insertDmsBaseDeviceSuplier(DmsBaseDeviceSuplier dmsBaseDeviceSuplier) { - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); + DmsBaseDeviceSuplier DeviceSuplier = new DmsBaseDeviceSuplier(); + DeviceSuplier.setSuplierCode(dmsBaseDeviceSuplier.getSuplierCode()); + List dmsBaseDeviceSuplierList = dmsBaseDeviceSuplierMapper. + selectDmsBaseDeviceSuplierList(DeviceSuplier); + if (dmsBaseDeviceSuplierList.size() > 0){ + throw new ServiceException("供应商编号已存在"); + } dmsBaseDeviceSuplier.setCreateBy(loginUser.getUsername()); //添加标识 dmsBaseDeviceSuplier.setIsFlag(1l); @@ -71,7 +80,15 @@ public class DmsBaseDeviceSuplierServiceImpl implements IDmsBaseDeviceSuplierSer @Override public int updateDmsBaseDeviceSuplier(DmsBaseDeviceSuplier dmsBaseDeviceSuplier) { - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); + DmsBaseDeviceSuplier DeviceSuplier = new DmsBaseDeviceSuplier(); + DeviceSuplier.setSuplierCode(dmsBaseDeviceSuplier.getSuplierCode()); + List dmsBaseDeviceSuplierList = dmsBaseDeviceSuplierMapper. + selectDmsBaseDeviceSuplierList(DeviceSuplier); + if (dmsBaseDeviceSuplierList.size() > 0 && !dmsBaseDeviceSuplierList.get(0).getSupplierId() + .equals(dmsBaseDeviceSuplier.getSupplierId())){ + throw new ServiceException("供应商编号已存在"); + } dmsBaseDeviceSuplier.setUpdateBy(loginUser.getUsername()); dmsBaseDeviceSuplier.setUpdateTime(DateUtils.getNowDate()); return dmsBaseDeviceSuplierMapper.updateDmsBaseDeviceSuplier(dmsBaseDeviceSuplier); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceTypeServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceTypeServiceImpl.java index 8ae27c9..439ca0e 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceTypeServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseDeviceTypeServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.dms.domain.DmsBaseDeviceBom; @@ -56,6 +57,11 @@ public class DmsBaseDeviceTypeServiceImpl implements IDmsBaseDeviceTypeService @Override public int insertDmsBaseDeviceType(DmsBaseDeviceType dmsBaseDeviceType) { + DmsBaseDeviceType DeviceType = new DmsBaseDeviceType(); + DeviceType.setTypeCode(dmsBaseDeviceType.getTypeCode()); + List dmsBaseDeviceTypeList = dmsBaseDeviceTypeMapper. + selectDmsBaseDeviceTypeList(DeviceType); + if(dmsBaseDeviceTypeList.size()>0){throw new ServiceException("设备类型编码已存在");} LoginUser user = SecurityUtils.getLoginUser(); dmsBaseDeviceType.setCreateBy(user.getUsername()); dmsBaseDeviceType.setIsFlag(1l); @@ -82,6 +88,14 @@ public class DmsBaseDeviceTypeServiceImpl implements IDmsBaseDeviceTypeService @Override public int updateDmsBaseDeviceType(DmsBaseDeviceType dmsBaseDeviceType) { + DmsBaseDeviceType DeviceType = new DmsBaseDeviceType(); + DeviceType.setTypeCode(dmsBaseDeviceType.getTypeCode()); + List dmsBaseDeviceTypeList = dmsBaseDeviceTypeMapper. + selectDmsBaseDeviceTypeList(DeviceType); + if(dmsBaseDeviceTypeList.size()>0 && !dmsBaseDeviceTypeList.get(0).getDeviceTypeId(). + equals(dmsBaseDeviceType.getDeviceTypeId())){ + throw new ServiceException("设备类型编码已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseDeviceType.setUpdateBy(user.getUsername()); dmsBaseDeviceType.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectProjectServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectProjectServiceImpl.java index 2eec8d5..24ad275 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectProjectServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectProjectServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,13 @@ public class DmsBaseInspectProjectServiceImpl implements IDmsBaseInspectProjectS @Override public int insertDmsBaseInspectProject(DmsBaseInspectProject dmsBaseInspectProject) { + DmsBaseInspectProject InspectProject = new DmsBaseInspectProject(); + InspectProject.setInspectProjectCode(dmsBaseInspectProject.getInspectProjectCode()); + List DmsBaseInspectProjectList = dmsBaseInspectProjectMapper + .selectDmsBaseInspectProjectList(InspectProject); + if (DmsBaseInspectProjectList.size()>0){ + throw new ServiceException("巡检项目编号已存在"); + } if (dmsBaseInspectProject.getInspectType()==null){ dmsBaseInspectProject.setInspectType("1"); } @@ -74,6 +82,14 @@ public class DmsBaseInspectProjectServiceImpl implements IDmsBaseInspectProjectS @Override public int updateDmsBaseInspectProject(DmsBaseInspectProject dmsBaseInspectProject) { + DmsBaseInspectProject InspectProject = new DmsBaseInspectProject(); + InspectProject.setInspectProjectCode(dmsBaseInspectProject.getInspectProjectCode()); + List DmsBaseInspectProjectList = dmsBaseInspectProjectMapper + .selectDmsBaseInspectProjectList(InspectProject); + if (DmsBaseInspectProjectList.size()>0 && !DmsBaseInspectProjectList.get(0).getInspectProjectId() + .equals(dmsBaseInspectProject.getInspectProjectId())){ + throw new ServiceException("巡检项目编号已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseInspectProject.setUpdateBy(user.getUsername()); dmsBaseInspectProject.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectRouteServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectRouteServiceImpl.java index 232d910..0396dc1 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectRouteServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectRouteServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.log.annotation.Log; import com.hw.common.security.utils.SecurityUtils; @@ -59,6 +60,11 @@ public class DmsBaseInspectRouteServiceImpl implements IDmsBaseInspectRouteServi if (dmsBaseInspectRoute.getInspectType()==null){ dmsBaseInspectRoute.setInspectType("1"); } + DmsBaseInspectRoute InspectRoute = new DmsBaseInspectRoute(); + InspectRoute.setRouteCode(dmsBaseInspectRoute.getRouteCode()); + List InspectRoutelist = dmsBaseInspectRouteMapper. + selectDmsBaseInspectRouteList(InspectRoute); + if (InspectRoutelist.size()>0)throw new ServiceException("该路线已存在"); LoginUser user = SecurityUtils.getLoginUser(); dmsBaseInspectRoute.setCreateBy(user.getUsername()); dmsBaseInspectRoute.setIsFlag("1"); @@ -75,6 +81,14 @@ public class DmsBaseInspectRouteServiceImpl implements IDmsBaseInspectRouteServi @Override public int updateDmsBaseInspectRoute(DmsBaseInspectRoute dmsBaseInspectRoute) { + DmsBaseInspectRoute InspectRoute = new DmsBaseInspectRoute(); + InspectRoute.setRouteCode(dmsBaseInspectRoute.getRouteCode()); + List InspectRoutelist = dmsBaseInspectRouteMapper. + selectDmsBaseInspectRouteList(InspectRoute); + if (InspectRoutelist.size()>0 && !dmsBaseInspectRoute.getInspectRouteId() + .equals(InspectRoutelist.get(0).getInspectRouteId())){ + throw new ServiceException("该路线已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseInspectRoute.setUpdateBy(user.getUsername()); dmsBaseInspectRoute.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectStandardServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectStandardServiceImpl.java index d395d94..508b19f 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectStandardServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseInspectStandardServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,11 @@ public class DmsBaseInspectStandardServiceImpl implements IDmsBaseInspectStandar @Override public int insertDmsBaseInspectStandard(DmsBaseInspectStandard dmsBaseInspectStandard) { + DmsBaseInspectStandard InspectStandard = new DmsBaseInspectStandard(); + InspectStandard.setStandardCode(dmsBaseInspectStandard.getStandardCode()); + List dmsBaseInspectStandardList = dmsBaseInspectStandardMapper. + selectDmsBaseInspectStandardList(InspectStandard); + if (dmsBaseInspectStandardList.size() > 0){throw new ServiceException("巡检标准编号已存在");} dmsBaseInspectStandard.setIsFlag("1"); LoginUser user = SecurityUtils.getLoginUser(); dmsBaseInspectStandard.setCreateBy(user.getUsername()); @@ -71,6 +77,14 @@ public class DmsBaseInspectStandardServiceImpl implements IDmsBaseInspectStandar @Override public int updateDmsBaseInspectStandard(DmsBaseInspectStandard dmsBaseInspectStandard) { + DmsBaseInspectStandard InspectStandard = new DmsBaseInspectStandard(); + InspectStandard.setStandardCode(dmsBaseInspectStandard.getStandardCode()); + List dmsBaseInspectStandardList = dmsBaseInspectStandardMapper. + selectDmsBaseInspectStandardList(InspectStandard); + if (dmsBaseInspectStandardList.size() > 0 && !dmsBaseInspectStandardList.get(0).getInspectStandardId() + .equals(dmsBaseInspectStandard.getInspectStandardId())){ + throw new ServiceException("巡检标准编号已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseInspectStandard.setUpdateBy(user.getUsername()); dmsBaseInspectStandard.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStandardServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStandardServiceImpl.java index 3427f87..64b6a3c 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStandardServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStandardServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,12 @@ public class DmsBaseLubeStandardServiceImpl implements IDmsBaseLubeStandardServi @Override public int insertDmsBaseLubeStandard(DmsBaseLubeStandard dmsBaseLubeStandard) { + //ZCH + DmsBaseLubeStandard LubeStandard = new DmsBaseLubeStandard(); + LubeStandard.setLubeStandardCode(dmsBaseLubeStandard.getLubeStandardCode()); + List dmsBaseLubeStandardList = dmsBaseLubeStandardMapper. + selectDmsBaseLubeStandardList(LubeStandard); + if (dmsBaseLubeStandardList.size()>0){throw new ServiceException("润滑标准编码已存在");} LoginUser user = SecurityUtils.getLoginUser(); dmsBaseLubeStandard.setIsFlag("1"); dmsBaseLubeStandard.setCreateBy(user.getUsername()); @@ -71,7 +78,15 @@ public class DmsBaseLubeStandardServiceImpl implements IDmsBaseLubeStandardServi @Override public int updateDmsBaseLubeStandard(DmsBaseLubeStandard dmsBaseLubeStandard) { - + //ZCH + DmsBaseLubeStandard LubeStandard = new DmsBaseLubeStandard(); + LubeStandard.setLubeStandardCode(dmsBaseLubeStandard.getLubeStandardCode()); + List dmsBaseLubeStandardList = dmsBaseLubeStandardMapper. + selectDmsBaseLubeStandardList(LubeStandard); + if (dmsBaseLubeStandardList.size()>0&&!dmsBaseLubeStandard.getLubeStandardId() + .equals(dmsBaseLubeStandardList.get(0).getLubeStandardId())){ + throw new ServiceException("润滑标准编码已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseLubeStandard.setUpdateBy(user.getUsername()); dmsBaseLubeStandard.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStationServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStationServiceImpl.java index 7c2eafa..11d1fb1 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStationServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseLubeStationServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,7 +56,14 @@ public class DmsBaseLubeStationServiceImpl implements IDmsBaseLubeStationService @Override public int insertDmsBaseLubeStation(DmsBaseLubeStation dmsBaseLubeStation) { - LoginUser user = new LoginUser(); + LoginUser user = SecurityUtils.getLoginUser(); + DmsBaseLubeStation BaseLubeStation = new DmsBaseLubeStation(); + BaseLubeStation.setLubeStationCode(dmsBaseLubeStation.getLubeStationCode()); + List dmsBaseLubeStationList = dmsBaseLubeStationMapper + .selectDmsBaseLubeStationList(BaseLubeStation); + if (dmsBaseLubeStationList.size() > 0){ + throw new ServiceException("润滑部位编码已存在"); + } dmsBaseLubeStation.setIsFlag("1"); dmsBaseLubeStation.setCreateBy(user.getUsername()); dmsBaseLubeStation.setCreateTime(DateUtils.getNowDate()); @@ -71,6 +79,15 @@ public class DmsBaseLubeStationServiceImpl implements IDmsBaseLubeStationService @Override public int updateDmsBaseLubeStation(DmsBaseLubeStation dmsBaseLubeStation) { + //ZCH + DmsBaseLubeStation BaseLubeStation = new DmsBaseLubeStation(); + BaseLubeStation.setLubeStationCode(dmsBaseLubeStation.getLubeStationCode()); + List dmsBaseLubeStationList = dmsBaseLubeStationMapper + .selectDmsBaseLubeStationList(BaseLubeStation); + if (dmsBaseLubeStationList.size() > 0 && !dmsBaseLubeStationList.get(0). + getLubeStationId().equals(dmsBaseLubeStation.getLubeStationId())){ + throw new ServiceException("润滑部位编码已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseLubeStation.setUpdateBy(user.getUsername()); dmsBaseLubeStation.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStandardServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStandardServiceImpl.java index 992fb34..b5f6989 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStandardServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStandardServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,7 +56,13 @@ public class DmsBaseMaintStandardServiceImpl implements IDmsBaseMaintStandardSer @Override public int insertDmsBaseMaintStandard(DmsBaseMaintStandard dmsBaseMaintStandard) { - + DmsBaseMaintStandard MaintStandard = new DmsBaseMaintStandard(); + MaintStandard.setMaintStandardCode(dmsBaseMaintStandard.getMaintStandardCode()); + List dmsBaseMaintStandardList = dmsBaseMaintStandardMapper + .selectDmsBaseMaintStandardList(MaintStandard); + if (dmsBaseMaintStandardList.size()>0 ) { + throw new ServiceException("保养标准编码已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseMaintStandard.setIsFlag(1l); dmsBaseMaintStandard.setDeviceTypeId(0l); @@ -73,6 +80,14 @@ public class DmsBaseMaintStandardServiceImpl implements IDmsBaseMaintStandardSer @Override public int updateDmsBaseMaintStandard(DmsBaseMaintStandard dmsBaseMaintStandard) { + DmsBaseMaintStandard MaintStandard = new DmsBaseMaintStandard(); + MaintStandard.setMaintStandardCode(dmsBaseMaintStandard.getMaintStandardCode()); + List dmsBaseMaintStandardList = dmsBaseMaintStandardMapper + .selectDmsBaseMaintStandardList(MaintStandard); + if (dmsBaseMaintStandardList.size()>0 && !dmsBaseMaintStandardList.get(0).getMaintStandardId() + .equals(dmsBaseMaintStandard.getMaintStandardId())) { + throw new ServiceException("保养标准编码已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseMaintStandard.setUpdateBy(user.getUsername()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStationServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStationServiceImpl.java index b582595..1899cb1 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStationServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseMaintStationServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,11 @@ public class DmsBaseMaintStationServiceImpl implements IDmsBaseMaintStationServi @Override public int insertDmsBaseMaintStation(DmsBaseMaintStation dmsBaseMaintStation) { + DmsBaseMaintStation MaintStation = new DmsBaseMaintStation(); + MaintStation.setMaintStationCode(dmsBaseMaintStation.getMaintStationCode()); + List dmsBaseMaintStationlist = dmsBaseMaintStationMapper + .selectDmsBaseMaintStationList(MaintStation); + if (dmsBaseMaintStationlist.size() > 0){throw new ServiceException("保养部位信息编码已存在");} LoginUser user = SecurityUtils.getLoginUser(); dmsBaseMaintStation.setIsFlag(1l); dmsBaseMaintStation.setCreateBy(user.getUsername()); @@ -71,6 +77,13 @@ public class DmsBaseMaintStationServiceImpl implements IDmsBaseMaintStationServi @Override public int updateDmsBaseMaintStation(DmsBaseMaintStation dmsBaseMaintStation) { + DmsBaseMaintStation MaintStation = new DmsBaseMaintStation(); + MaintStation.setMaintStationCode(dmsBaseMaintStation.getMaintStationCode()); + List dmsBaseMaintStationlist = dmsBaseMaintStationMapper + .selectDmsBaseMaintStationList(MaintStation); + if (dmsBaseMaintStationlist.size() > 0 && !dmsBaseMaintStationlist.get(0).getMaintStationId() + .equals(dmsBaseMaintStation.getMaintStationId())){ + throw new ServiceException("保养部位信息编码已存在");} LoginUser user = SecurityUtils.getLoginUser(); dmsBaseMaintStation.setUpdateBy(user.getUsername()); dmsBaseMaintStation.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseOutsrcInfoServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseOutsrcInfoServiceImpl.java index 435954d..ea3d6eb 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseOutsrcInfoServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseOutsrcInfoServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,13 @@ public class DmsBaseOutsrcInfoServiceImpl implements IDmsBaseOutsrcInfoService @Override public int insertDmsBaseOutsrcInfo(DmsBaseOutsrcInfo dmsBaseOutsrcInfo) { + DmsBaseOutsrcInfo OutsrcInfo = new DmsBaseOutsrcInfo(); + OutsrcInfo.setOutsrcCode(dmsBaseOutsrcInfo.getOutsrcCode()); + List dmsBaseOutsrcInfoList = dmsBaseOutsrcInfoMapper. + selectDmsBaseOutsrcInfoList(OutsrcInfo); + if (dmsBaseOutsrcInfoList.size()>0){ + throw new ServiceException("外协编号已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseOutsrcInfo.setIsFlag(1l); dmsBaseOutsrcInfo.setCreateBy(user.getUsername()); @@ -71,6 +79,14 @@ public class DmsBaseOutsrcInfoServiceImpl implements IDmsBaseOutsrcInfoService @Override public int updateDmsBaseOutsrcInfo(DmsBaseOutsrcInfo dmsBaseOutsrcInfo) { + DmsBaseOutsrcInfo OutsrcInfo = new DmsBaseOutsrcInfo(); + OutsrcInfo.setOutsrcCode(dmsBaseOutsrcInfo.getOutsrcCode()); + List dmsBaseOutsrcInfoList = dmsBaseOutsrcInfoMapper. + selectDmsBaseOutsrcInfoList(OutsrcInfo); + if (dmsBaseOutsrcInfoList.size()>0 && !dmsBaseOutsrcInfo.getOutsrcId() + .equals(dmsBaseOutsrcInfoList.get(0).getOutsrcId())){ + throw new ServiceException("外协编号已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseOutsrcInfo.setUpdateBy(user.getUsername()); dmsBaseOutsrcInfo.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutReasonServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutReasonServiceImpl.java index 2d8a525..7f109a4 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutReasonServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutReasonServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,11 @@ public class DmsBaseShutReasonServiceImpl implements IDmsBaseShutReasonService @Override public int insertDmsBaseShutReason(DmsBaseShutReason dmsBaseShutReason) { + DmsBaseShutReason ShutReason = new DmsBaseShutReason(); + ShutReason.setReasonCode(dmsBaseShutReason.getReasonCode()); + List dmsBaseShutReasonList = dmsBaseShutReasonMapper + .selectDmsBaseShutReasonList(ShutReason); + if (dmsBaseShutReasonList.size()>0){throw new ServiceException("停机原因编号已存在");} LoginUser user = SecurityUtils.getLoginUser(); dmsBaseShutReason.setIsFlag("1"); dmsBaseShutReason.setCreateBy(user.getUsername()); @@ -71,6 +77,14 @@ public class DmsBaseShutReasonServiceImpl implements IDmsBaseShutReasonService @Override public int updateDmsBaseShutReason(DmsBaseShutReason dmsBaseShutReason) { + DmsBaseShutReason ShutReason = new DmsBaseShutReason(); + ShutReason.setReasonCode(dmsBaseShutReason.getReasonCode()); + List dmsBaseShutReasonList = dmsBaseShutReasonMapper + .selectDmsBaseShutReasonList(ShutReason); + if (dmsBaseShutReasonList.size()>0 && !dmsBaseShutReason.getShutReasonId() + .equals(dmsBaseShutReasonList.get(0).getShutReasonId())){ + throw new ServiceException("停机原因编号已存在"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseShutReason.setUpdateBy(user.getUsername()); dmsBaseShutReason.setUpdateTime(DateUtils.getNowDate()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutTypeServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutTypeServiceImpl.java index 8291ac9..a4fffdb 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutTypeServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseShutTypeServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,6 +56,11 @@ public class DmsBaseShutTypeServiceImpl implements IDmsBaseShutTypeService @Override public int insertDmsBaseShutType(DmsBaseShutType dmsBaseShutType) { + DmsBaseShutType ShutType = new DmsBaseShutType(); + ShutType.setTypeCode(dmsBaseShutType.getTypeCode()); + List DmsBaseShutTypeList = dmsBaseShutTypeMapper + .selectDmsBaseShutTypeList(ShutType); + if (DmsBaseShutTypeList.size() > 0){throw new ServiceException("停机类型编码已存在");} LoginUser user = SecurityUtils.getLoginUser(); dmsBaseShutType.setIsFlag("1"); dmsBaseShutType.setCreateBy(user.getUsername()); @@ -71,7 +77,15 @@ public class DmsBaseShutTypeServiceImpl implements IDmsBaseShutTypeService @Override public int updateDmsBaseShutType(DmsBaseShutType dmsBaseShutType) { - LoginUser user = new LoginUser(); + LoginUser user = SecurityUtils.getLoginUser(); + DmsBaseShutType ShutType = new DmsBaseShutType(); + ShutType.setTypeCode(dmsBaseShutType.getTypeCode()); + List DmsBaseShutTypeList = dmsBaseShutTypeMapper + .selectDmsBaseShutTypeList(ShutType); + if (DmsBaseShutTypeList.size() > 0 && !dmsBaseShutType.getShutTypeId() + .equals(DmsBaseShutTypeList.get(0).getShutTypeId())){ + throw new ServiceException("停机类型编码已存在"); + } dmsBaseShutType.setUpdateBy(user.getUsername()); dmsBaseShutType.setUpdateTime(DateUtils.getNowDate()); return dmsBaseShutTypeMapper.updateDmsBaseShutType(dmsBaseShutType); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseSpecialdeviceParamServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseSpecialdeviceParamServiceImpl.java index 8201c09..2115656 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseSpecialdeviceParamServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseSpecialdeviceParamServiceImpl.java @@ -1,8 +1,11 @@ package com.hw.dms.service.impl; import java.util.List; + +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; +import com.hw.dms.domain.DmsBaseDeviceParam; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -55,6 +58,13 @@ public class DmsBaseSpecialdeviceParamServiceImpl implements IDmsBaseSpecialdevi @Override public int insertDmsBaseSpecialdeviceParam(DmsBaseSpecialdeviceParam dmsBaseSpecialdeviceParam) { + DmsBaseSpecialdeviceParam DeviceParam =new DmsBaseSpecialdeviceParam(); + DeviceParam.setParamCode(dmsBaseSpecialdeviceParam.getParamCode()); + List dmsBaseDeviceParamList = dmsBaseSpecialdeviceParamMapper + .selectDmsBaseSpecialdeviceParamList(DeviceParam); + if (dmsBaseDeviceParamList.size()>0 ) { + throw new ServiceException("参数编号重复"); + } LoginUser user = SecurityUtils.getLoginUser(); dmsBaseSpecialdeviceParam.setCreateBy(user.getUsername()); dmsBaseSpecialdeviceParam.setIsFlag(1l); @@ -71,7 +81,15 @@ public class DmsBaseSpecialdeviceParamServiceImpl implements IDmsBaseSpecialdevi @Override public int updateDmsBaseSpecialdeviceParam(DmsBaseSpecialdeviceParam dmsBaseSpecialdeviceParam) { - LoginUser user = new LoginUser(); + DmsBaseSpecialdeviceParam DeviceParam =new DmsBaseSpecialdeviceParam(); + DeviceParam.setParamCode(dmsBaseSpecialdeviceParam.getParamCode()); + List dmsBaseDeviceParamList = dmsBaseSpecialdeviceParamMapper + .selectDmsBaseSpecialdeviceParamList(DeviceParam); + if (dmsBaseDeviceParamList.size()>0 && !dmsBaseDeviceParamList.get(0).getSpecialdeviceParamId() + .equals(dmsBaseSpecialdeviceParam.getSpecialdeviceParamId())) { + throw new ServiceException("参数编号重复"); + } + LoginUser user = SecurityUtils.getLoginUser(); dmsBaseSpecialdeviceParam.setUpdateBy(user.getUsername()); dmsBaseSpecialdeviceParam.setUpdateTime(DateUtils.getNowDate()); return dmsBaseSpecialdeviceParamMapper.updateDmsBaseSpecialdeviceParam(dmsBaseSpecialdeviceParam); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseTransferInfoServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseTransferInfoServiceImpl.java index b47fd21..5d04ed8 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseTransferInfoServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBaseTransferInfoServiceImpl.java @@ -1,7 +1,10 @@ package com.hw.dms.service.impl; +import java.util.Date; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,7 +57,28 @@ public class DmsBaseTransferInfoServiceImpl implements IDmsBaseTransferInfoServi @Override public int insertDmsBaseTransferInfo(DmsBaseTransferInfo dmsBaseTransferInfo) { - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); + if (dmsBaseTransferInfo.getDevicePositionNew().equals(dmsBaseTransferInfo.getDevicePosition())){ + throw new ServiceException("新位置不能与原位置相同"); + } else if (dmsBaseTransferInfo.getDevicePosition() == null) { + throw new ServiceException("转移前必须有安装位置"); + } + //dmsBaseTransferInfoSave是数据库原有的时间,dmsBaseTransferInfo是要新插入的时间 + DmsBaseTransferInfo dmsBaseTransferInfoSave = new DmsBaseTransferInfo(); + dmsBaseTransferInfoSave.setDeviceId(dmsBaseTransferInfo.getDeviceId()); + dmsBaseTransferInfoSave.setDevicePositionNew(dmsBaseTransferInfo.getDevicePosition()); + List dmsBaseTransferInfoList = dmsBaseTransferInfoMapper + .selectDmsBaseTransferInfoList(dmsBaseTransferInfoSave); + if (dmsBaseTransferInfoList.size() > 0) { + for (DmsBaseTransferInfo dmsBaseTransferInfoDate : dmsBaseTransferInfoList) { + Date oldDate = dmsBaseTransferInfoDate.getDeviceTransferTime(); + Date newDate = dmsBaseTransferInfo.getDeviceTransferTime(); + int result = newDate.compareTo(oldDate); + if (result == -1) { + throw new ServiceException("设备转移时间不能小于之前记录的设备转移时间"); + } + } + } dmsBaseTransferInfo.setCreateBy(loginUser.getUsername()); dmsBaseTransferInfo.setCreateTime(DateUtils.getNowDate()); return dmsBaseTransferInfoMapper.insertDmsBaseTransferInfo(dmsBaseTransferInfo); @@ -69,7 +93,7 @@ public class DmsBaseTransferInfoServiceImpl implements IDmsBaseTransferInfoServi @Override public int updateDmsBaseTransferInfo(DmsBaseTransferInfo dmsBaseTransferInfo) { - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); dmsBaseTransferInfo.setUpdateBy(loginUser.getUsername()); dmsBaseTransferInfo.setUpdateTime(DateUtils.getNowDate()); return dmsBaseTransferInfoMapper.updateDmsBaseTransferInfo(dmsBaseTransferInfo); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFlowCheckplanDetailServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFlowCheckplanDetailServiceImpl.java index e0c9eb8..1bea931 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFlowCheckplanDetailServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsFlowCheckplanDetailServiceImpl.java @@ -3,6 +3,7 @@ package com.hw.dms.service.impl; import java.util.List; import com.hw.common.core.utils.DateUtils; +import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -55,7 +56,7 @@ public class DmsFlowCheckplanDetailServiceImpl implements IDmsFlowCheckplanDetai @Override public int insertDmsFlowCheckplanDetail(DmsFlowCheckplanDetail dmsFlowCheckplanDetail) { - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); dmsFlowCheckplanDetail.setCreateBy(loginUser.getUsername()); dmsFlowCheckplanDetail.setCreateTime(DateUtils.getNowDate()); return dmsFlowCheckplanDetailMapper.insertDmsFlowCheckplanDetail(dmsFlowCheckplanDetail); @@ -70,7 +71,7 @@ public class DmsFlowCheckplanDetailServiceImpl implements IDmsFlowCheckplanDetai @Override public int updateDmsFlowCheckplanDetail(DmsFlowCheckplanDetail dmsFlowCheckplanDetail) { - LoginUser loginUser = new LoginUser(); + LoginUser loginUser = SecurityUtils.getLoginUser(); dmsFlowCheckplanDetail.setUpdateBy(loginUser.getUsername()); dmsFlowCheckplanDetail.setUpdateTime(DateUtils.getNowDate()); return dmsFlowCheckplanDetailMapper.updateDmsFlowCheckplanDetail(dmsFlowCheckplanDetail); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeLubeServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeLubeServiceImpl.java index e249b47..27a7644 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeLubeServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeLubeServiceImpl.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.hw.common.core.constant.DmsConstants; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.dms.domain.BaseAttachInfo; import com.hw.dms.domain.DmsInstanceFile; @@ -77,6 +78,11 @@ public class DmsKnowledgeLubeServiceImpl implements IDmsKnowledgeLubeService @Override public int insertDmsKnowledgeLube(DmsKnowledgeLube dmsKnowledgeLube) { + DmsKnowledgeLube KnowledgeLube = new DmsKnowledgeLube(); + KnowledgeLube.setExperienceCode(dmsKnowledgeLube.getExperienceCode()); + List dmsKnowledgeLubeList = dmsKnowledgeLubeMapper + .selectDmsKnowledgeLubeList(KnowledgeLube); + if (dmsKnowledgeLubeList.size()>0){throw new ServiceException("该编号已存在");} dmsKnowledgeLube.setCreateTime(DateUtils.getNowDate()); dmsKnowledgeLube.setIsFlag("1"); @@ -98,6 +104,14 @@ public class DmsKnowledgeLubeServiceImpl implements IDmsKnowledgeLubeService @Override public int updateDmsKnowledgeLube(DmsKnowledgeLube dmsKnowledgeLube) { + DmsKnowledgeLube KnowledgeLube = new DmsKnowledgeLube(); + KnowledgeLube.setExperienceCode(dmsKnowledgeLube.getExperienceCode()); + List dmsKnowledgeLubeList = dmsKnowledgeLubeMapper + .selectDmsKnowledgeLubeList(KnowledgeLube); + if (dmsKnowledgeLubeList.size()>0 && !dmsKnowledgeLube.getKnowledgeLubeId() + .equals(dmsKnowledgeLubeList.get(0).getKnowledgeLubeId())){ + throw new ServiceException("该编号已存在"); + } dmsKnowledgeLube.setUpdateTime(DateUtils.getNowDate()); int i = dmsKnowledgeLubeMapper.updateDmsKnowledgeLube(dmsKnowledgeLube); baseAttachInfoMapper.deleteListBaseAttachInfos(DmsConstants.MES_BASE_ATTACH_INFO_KNOWLEDGELUBE,dmsKnowledgeLube.getKnowledgeLubeId()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java index dd25223..a1e88c9 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.hw.common.core.constant.DmsConstants; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.dms.domain.BaseAttachInfo; import com.hw.dms.domain.DmsBaseMaintStation; @@ -75,7 +76,11 @@ public class DmsKnowledgeMaintServiceImpl implements IDmsKnowledgeMaintService @Override public int insertDmsKnowledgeMaint(DmsKnowledgeMaint dmsKnowledgeMaint) { - + DmsKnowledgeMaint KnowledgeMaint = new DmsKnowledgeMaint(); + KnowledgeMaint.setExperienceCode(dmsKnowledgeMaint.getExperienceCode()); + List DmsKnowledgeMaintList = dmsKnowledgeMaintMapper + .selectDmsKnowledgeMaintList(KnowledgeMaint); + if (DmsKnowledgeMaintList.size()>0){throw new ServiceException("知识库编号已存在");} dmsKnowledgeMaint.setCreateTime(DateUtils.getNowDate()); dmsKnowledgeMaint.setIsFlag("1"); int i = dmsKnowledgeMaintMapper.insertDmsKnowledgeMaint(dmsKnowledgeMaint); @@ -94,6 +99,14 @@ public class DmsKnowledgeMaintServiceImpl implements IDmsKnowledgeMaintService @Override public int updateDmsKnowledgeMaint(DmsKnowledgeMaint dmsKnowledgeMaint) { + DmsKnowledgeMaint KnowledgeMaint = new DmsKnowledgeMaint(); + KnowledgeMaint.setExperienceCode(dmsKnowledgeMaint.getExperienceCode()); + List DmsKnowledgeMaintList = dmsKnowledgeMaintMapper + .selectDmsKnowledgeMaintList(KnowledgeMaint); + if (DmsKnowledgeMaintList.size()>0 && !dmsKnowledgeMaint.getKnowledgeMaintId() + .equals(DmsKnowledgeMaintList.get(0).getKnowledgeMaintId())){ + throw new ServiceException("知识库编号已存在"); + } dmsKnowledgeMaint.setUpdateTime(DateUtils.getNowDate()); int i = dmsKnowledgeMaintMapper.updateDmsKnowledgeMaint(dmsKnowledgeMaint); baseAttachInfoMapper.deleteListBaseAttachInfos(DmsConstants.MES_BASE_ATTACH_INFO_KNOWLEDGEMAINT,dmsKnowledgeMaint.getKnowledgeMaintId()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java index 74a998e..78fd461 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.hw.common.core.constant.DmsConstants; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.dms.domain.BaseAttachInfo; import com.hw.dms.mapper.BaseAttachInfoMapper; @@ -72,6 +73,11 @@ public class DmsKnowledgeRepairServiceImpl implements IDmsKnowledgeRepairService @Override public int insertDmsKnowledgeRepair(DmsKnowledgeRepair dmsKnowledgeRepair) { + DmsKnowledgeRepair KnowledgeRepair = new DmsKnowledgeRepair(); + KnowledgeRepair.setExperienceCode(dmsKnowledgeRepair.getExperienceCode()); + List dmsKnowledgeRepairList = dmsKnowledgeRepairMapper + .selectDmsKnowledgeRepairList(KnowledgeRepair); + if (dmsKnowledgeRepairList.size() > 0) {throw new ServiceException("知识库编号已存在");} dmsKnowledgeRepair.setCreateTime(DateUtils.getNowDate()); dmsKnowledgeRepair.setIsFlag("1"); int i = dmsKnowledgeRepairMapper.insertDmsKnowledgeRepair(dmsKnowledgeRepair); @@ -91,6 +97,14 @@ public class DmsKnowledgeRepairServiceImpl implements IDmsKnowledgeRepairService @Override public int updateDmsKnowledgeRepair(DmsKnowledgeRepair dmsKnowledgeRepair) { + DmsKnowledgeRepair ledgeRepair = new DmsKnowledgeRepair(); + ledgeRepair.setExperienceCode(dmsKnowledgeRepair.getExperienceCode()); + List dmsKnowledgeRepairList = dmsKnowledgeRepairMapper + .selectDmsKnowledgeRepairList(ledgeRepair); + if (dmsKnowledgeRepairList.size() > 0 && !dmsKnowledgeRepair.getKnowledgeRepairId() + .equals(dmsKnowledgeRepairList.get(0).getKnowledgeRepairId())) { + throw new ServiceException("知识库编号已存在"); + } dmsKnowledgeRepair.setUpdateTime(DateUtils.getNowDate()); int i = dmsKnowledgeRepairMapper.updateDmsKnowledgeRepair(dmsKnowledgeRepair); baseAttachInfoMapper.deleteListBaseAttachInfos(DmsConstants.MES_BASE_ATTACH_INFO_KNOWLEDGEREPAIR,dmsKnowledgeRepair.getKnowledgeRepairId()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java index caf41ef..e1f1471 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.List; +import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; import com.hw.system.api.model.LoginUser; @@ -55,7 +56,8 @@ public class DmsPlanMaintDetailServiceImpl implements IDmsPlanMaintDetailService @Override public int insertDmsPlanMaintDetail(DmsPlanMaintDetail dmsPlanMaintDetail) { - dmsPlanMaintDetail.setCreateBy(SecurityUtils.getUsername()); + if (dmsPlanMaintDetail.getDeviceId()==null){throw new ServiceException("设备名称不能为空");} + dmsPlanMaintDetail.setCreateBy(SecurityUtils.getUsername()); dmsPlanMaintDetail.setCreateTime(DateUtils.getNowDate()); dmsPlanMaintDetail.setIsFlag(1l); return dmsPlanMaintDetailMapper.insertDmsPlanMaintDetail(dmsPlanMaintDetail); diff --git a/hw-ui/src/api/dms/dmsBaseInspectProject.js b/hw-ui/src/api/dms/dmsBaseInspectProject.js index 6240664..effb088 100644 --- a/hw-ui/src/api/dms/dmsBaseInspectProject.js +++ b/hw-ui/src/api/dms/dmsBaseInspectProject.js @@ -9,6 +9,14 @@ export function listDmsBaseInspectProject(query) { }) } +// 查询巡检项目信息列表 +export function getdmsBaseInspectProjectList(query) { + return request({ + url: '/dms/dmsBaseInspectProject/getdmsBaseInspectProjectList', + method: 'get', + params: query + }) +} // 查询巡检项目信息详细 export function getDmsBaseInspectProject(inspectProjectId) { return request({ diff --git a/hw-ui/src/api/dms/dmsBaseInspectRoute.js b/hw-ui/src/api/dms/dmsBaseInspectRoute.js index 5b0f0b1..8760590 100644 --- a/hw-ui/src/api/dms/dmsBaseInspectRoute.js +++ b/hw-ui/src/api/dms/dmsBaseInspectRoute.js @@ -9,6 +9,14 @@ export function listDmsBaseInspectRoute(query) { }) } +// 查询巡检线路信息列表 +export function getdmsBaseInspectRouteList(query) { + return request({ + url: '/dms/dmsBaseInspectRoute/getdmsBaseInspectRouteList', + method: 'get', + params: query + }) +} // 查询巡检线路信息详细 export function getDmsBaseInspectRoute(inspectRouteId) { return request({ diff --git a/hw-ui/src/api/dms/lubeStandard.js b/hw-ui/src/api/dms/lubeStandard.js index d16ac2e..e53f986 100644 --- a/hw-ui/src/api/dms/lubeStandard.js +++ b/hw-ui/src/api/dms/lubeStandard.js @@ -9,6 +9,15 @@ export function listLubeStandard(query) { }) } +// 查询润滑标准信息列表 +export function getLueStandardList(query) { + return request({ + url: '/dms/lubeStandard/getLueStandardList', + method: 'get', + params: query + }) +} + // 查询润滑标准信息详细 export function getLubeStandard(lubeStandardId) { return request({ diff --git a/hw-ui/src/api/dms/standard.js b/hw-ui/src/api/dms/standard.js index a960d45..96eceed 100644 --- a/hw-ui/src/api/dms/standard.js +++ b/hw-ui/src/api/dms/standard.js @@ -8,7 +8,6 @@ export function listStandard(query) { params: query }) } - // 查询保养标准信息详细 export function getStandard(maintStandardId) { return request({ @@ -17,6 +16,15 @@ export function getStandard(maintStandardId) { }) } +// 查询保养标准信息详细 +export function getMaintStandardlist(query) { + return request({ + url: '/dms/standard/getMaintStandardlist', + method: 'get', + params: query + }) +} + // 新增保养标准信息 export function addStandard(data) { return request({ diff --git a/hw-ui/src/views/dms/activity/index.vue b/hw-ui/src/views/dms/activity/index.vue index b1841c9..c658d6b 100644 --- a/hw-ui/src/views/dms/activity/index.vue +++ b/hw-ui/src/views/dms/activity/index.vue @@ -297,12 +297,14 @@ - - - -
- 提 交 -
+ + + + + + 提 交 + + diff --git a/hw-ui/src/views/dms/base/devicetype/index.vue b/hw-ui/src/views/dms/base/devicetype/index.vue index 8b6c77d..062a3af 100644 --- a/hw-ui/src/views/dms/base/devicetype/index.vue +++ b/hw-ui/src/views/dms/base/devicetype/index.vue @@ -308,7 +308,7 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - this.$modal.confirm('是否确认删除设备类型信息编号为"' + row.deviceTypeId + '"的数据项?').then(function() { + this.$modal.confirm('是否确认删除设备类型编号为"' + row.typeCode + '"的数据项?').then(function() { return delDevicetype(row.deviceTypeId); }).then(() => { this.getList(); diff --git a/hw-ui/src/views/dms/bom/index.vue b/hw-ui/src/views/dms/bom/index.vue index 04cd788..0bb0b7c 100644 --- a/hw-ui/src/views/dms/bom/index.vue +++ b/hw-ui/src/views/dms/bom/index.vue @@ -216,7 +216,7 @@ import { listBom, getBom, delBom, addBom, updateBom ,selectBomByDeviceType} from "@/api/dms/bom"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import { listLedger } from '@/api/dms/ledger' +import {getDeviceLedgerList, listLedger} from '@/api/dms/ledger' import { listDevicetype } from '@/api/dms/devicetype' export default { @@ -302,8 +302,8 @@ export default { /** 查询设备台账信息列表 */ getDeviceLedger() { this.loading = true; - listLedger(this.queryParams).then(response => { - this.ledgerList = response.rows; + getDeviceLedgerList({}).then(response => { + this.ledgerList = response.data; }); }, /** 查询设备BOM信息列表 */ @@ -413,6 +413,7 @@ export default { this.form.parentId = row.deviceBomId; } else { this.form.parentId = 0; + this.change(); // 确保在设置 parentId 之后调用 change,顶级节点的bom数量直接赋予1 } this.open = true; this.title = "添加设备BOM信息"; diff --git a/hw-ui/src/views/dms/debugging/index.vue b/hw-ui/src/views/dms/debugging/index.vue index 82ce9e3..588e41f 100644 --- a/hw-ui/src/views/dms/debugging/index.vue +++ b/hw-ui/src/views/dms/debugging/index.vue @@ -196,7 +196,7 @@ - + import { listDebugging, getDebugging, delDebugging, addDebugging, updateDebugging } from "@/api/dms/debugging"; -import { listLedger } from '@/api/dms/ledger' +import {getDeviceLedgerList, listLedger} from '@/api/dms/ledger' export default { name: "Debugging", @@ -291,6 +291,9 @@ export default { status: [ { required: true, message: "调试状态(0未调试1调试中2已完成)不能为空", trigger: "change" } ], + workOrder: [ + { required: true, message: "调试单号不能为空", trigger: "blur" } + ], } }; }, @@ -302,8 +305,8 @@ export default { /** 查询设备台账信息列表 */ getDeviceLedger() { this.loading = true; - listLedger(this.queryParams).then(response => { - this.ledgerList = response.rows; + getDeviceLedgerList({}).then(response => { + this.ledgerList = response.data; }); }, /** 查询设备调试信息列表 */ @@ -394,10 +397,13 @@ export default { }); }, /** 删除按钮操作 */ - handleDelete(row) { + handleDelete(row) + { const deviceDebuggingIds = row.deviceDebuggingId || this.ids; - this.$modal.confirm('是否确认删除设备调试信息编号为"' + deviceDebuggingIds + '"的数据项?').then(function() { + const deviceId = row.deviceId || this.ids; + this.$modal.confirm('是否确认删除设备编号为"' + deviceId + '"的数据项?').then(function() { return delDebugging(deviceDebuggingIds); + }).then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); diff --git a/hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue b/hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue index 9481005..5d597b9 100644 --- a/hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue +++ b/hw-ui/src/views/dms/dmsBaseAlarmRule/index.vue @@ -331,7 +331,7 @@ export default { }; }, created() { - getDeviceLedgerList(null).then(response => { + getDeviceLedgerList({}).then(response => { this.deviceLedgerList = response.data }) this.getList(); diff --git a/hw-ui/src/views/dms/dmsBaseInspectProject/index.vue b/hw-ui/src/views/dms/dmsBaseInspectProject/index.vue index ef7b49f..b7856c2 100644 --- a/hw-ui/src/views/dms/dmsBaseInspectProject/index.vue +++ b/hw-ui/src/views/dms/dmsBaseInspectProject/index.vue @@ -361,7 +361,9 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const inspectProjectIds = row.inspectProjectId || this.ids; - this.$modal.confirm('是否确认删除巡检项目信息编号为"' + inspectProjectIds + '"的数据项?').then(function() { + inspectProjectCode + const inspectProjectCode = row.inspectProjectCode || this.ids; + this.$modal.confirm('是否确认删除巡检项目信息编号为"' + inspectProjectCode + '"的数据项?').then(function() { return delDmsBaseInspectProject(inspectProjectIds); }).then(() => { this.getList(); diff --git a/hw-ui/src/views/dms/dmsBaseInspectRoute/index.vue b/hw-ui/src/views/dms/dmsBaseInspectRoute/index.vue index e6990e8..378c6f0 100644 --- a/hw-ui/src/views/dms/dmsBaseInspectRoute/index.vue +++ b/hw-ui/src/views/dms/dmsBaseInspectRoute/index.vue @@ -284,7 +284,10 @@ export default { { required: true, message: "线路类型", trigger: "blur" } ], deviceTypeId: [ - { required: true, message: "设备类型ID,关联dms_base_device_type的device_type_id不能为空", trigger: "blur" } + { required: true, message: "设备类型ID不能为空", trigger: "blur" } + ], + routeCode:[ + { required: true, message: "线路编号不能为空", trigger: "blur" } ], // isFlag: [ // { required: true, message: "是否标识:1-是;0-否不能为空", trigger: "blur" } @@ -391,7 +394,8 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const inspectRouteIds = row.inspectRouteId || this.ids; - this.$modal.confirm('是否确认删除巡检线路信息编号为"' + inspectRouteIds + '"的数据项?').then(function() { + const routeCode = row.routeCode || this.ids; + this.$modal.confirm('是否确认删除巡检线路信息编号为"' + routeCode + '"的数据项?').then(function() { return delDmsBaseInspectRoute(inspectRouteIds); }).then(() => { this.getList(); diff --git a/hw-ui/src/views/dms/dmsBaseInspectStandard/index.vue b/hw-ui/src/views/dms/dmsBaseInspectStandard/index.vue index cca1223..4d5da31 100644 --- a/hw-ui/src/views/dms/dmsBaseInspectStandard/index.vue +++ b/hw-ui/src/views/dms/dmsBaseInspectStandard/index.vue @@ -196,7 +196,7 @@