|
@@ -15,6 +15,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.modules.system.app.entity.AppDevice;
|
|
|
+import org.jeecg.modules.system.app.entity.AppSite;
|
|
|
import org.jeecg.modules.system.app.mapper.AppSiteMapper;
|
|
|
import org.jeecg.modules.system.app.service.IAppDeviceService;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -105,10 +106,12 @@ public class AppDeviceController extends JeecgController<AppDevice, IAppDeviceSe
|
|
|
@PostMapping(value = "/edit")
|
|
|
@Transactional
|
|
|
public Result<String> edit(@RequestBody AppDevice appDevice) {
|
|
|
- appDevice.setOrgCode(appSiteMapper.selectById(appDevice.getSiteId()).getOrgCode());
|
|
|
+ AppSite appSite = appSiteMapper.selectById(appDevice.getSiteId());
|
|
|
+ appDevice.setOrgCode(appSite.getOrgCode());
|
|
|
if(AppDeviceService.getOne(Wrappers.<AppDevice>lambdaQuery()
|
|
|
.eq(AppDevice::getDeviceSerial,appDevice.getDeviceSerial())
|
|
|
.eq(AppDevice::getDeviceNo,appDevice.getDeviceNo())
|
|
|
+ .eq(AppDevice::getSiteId,appDevice.getSiteId())
|
|
|
.eq(AppDevice::getDeviceType,appDevice.getDeviceType())) != null) {
|
|
|
return Result.error("设备已存在!");
|
|
|
}
|