|
@@ -10,6 +10,7 @@ import com.ruoyi.common.log.enums.BusinessType;
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
import com.sooka.sponest.data.digitalwater.domain.CenterdataTHydraulicWaterProject;
|
|
import com.sooka.sponest.data.digitalwater.domain.CenterdataTHydraulicWaterProject;
|
|
import com.sooka.sponest.data.digitalwater.service.ICenterdataTHydraulicWaterProjectService;
|
|
import com.sooka.sponest.data.digitalwater.service.ICenterdataTHydraulicWaterProjectService;
|
|
|
|
+import com.sooka.sponest.data.utils.DataConstants;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -88,6 +89,12 @@ public class CenterdataTHydraulicWaterProjectController extends BaseController {
|
|
@Log(title = "水利工程资源", businessType = BusinessType.INSERT)
|
|
@Log(title = "水利工程资源", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
@PostMapping
|
|
public AjaxResult add(@Validated @RequestBody CenterdataTHydraulicWaterProject centerdataTHydraulicWaterProject) {
|
|
public AjaxResult add(@Validated @RequestBody CenterdataTHydraulicWaterProject centerdataTHydraulicWaterProject) {
|
|
|
|
+ String tableName = "centerdata_t_hydraulic_water_project";
|
|
|
|
+ String[] keys = {"name","dept_id"};
|
|
|
|
+ String[] values = {centerdataTHydraulicWaterProject.getName(),String.valueOf(centerdataTHydraulicWaterProject.getDeptId())};
|
|
|
|
+ if(!centerdataTHydraulicWaterProjectService.uniqueCheck(tableName, keys, values)){
|
|
|
|
+ return AjaxResult.error(DataConstants.ERROR_MSG);
|
|
|
|
+ }
|
|
return toAjax(centerdataTHydraulicWaterProjectService.insertCenterdataTHydraulicWaterProject(centerdataTHydraulicWaterProject));
|
|
return toAjax(centerdataTHydraulicWaterProjectService.insertCenterdataTHydraulicWaterProject(centerdataTHydraulicWaterProject));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -99,6 +106,12 @@ public class CenterdataTHydraulicWaterProjectController extends BaseController {
|
|
@Log(title = "水利工程资源", businessType = BusinessType.UPDATE)
|
|
@Log(title = "水利工程资源", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
@PutMapping
|
|
public AjaxResult edit(@Validated @RequestBody CenterdataTHydraulicWaterProject centerdataTHydraulicWaterProject) {
|
|
public AjaxResult edit(@Validated @RequestBody CenterdataTHydraulicWaterProject centerdataTHydraulicWaterProject) {
|
|
|
|
+ String tableName = "centerdata_t_hydraulic_water_project";
|
|
|
|
+ String[] keys = {"name" , "id","dept_id"};
|
|
|
|
+ String[] values = {centerdataTHydraulicWaterProject.getName() , centerdataTHydraulicWaterProject.getId(),String.valueOf(centerdataTHydraulicWaterProject.getDeptId())};
|
|
|
|
+ if(!centerdataTHydraulicWaterProjectService.uniqueCheck(tableName, keys, values)){
|
|
|
|
+ return AjaxResult.error(DataConstants.ERROR_MSG);
|
|
|
|
+ }
|
|
return toAjax(centerdataTHydraulicWaterProjectService.updateCenterdataTHydraulicWaterProject(centerdataTHydraulicWaterProject));
|
|
return toAjax(centerdataTHydraulicWaterProjectService.updateCenterdataTHydraulicWaterProject(centerdataTHydraulicWaterProject));
|
|
}
|
|
}
|
|
|
|
|