pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/crop/CropCtrl.java
@@ -8,7 +8,9 @@
import com.dy.pipIrrGlobal.pojoIr.IrCrop;
import com.dy.pipIrrGlobal.pojoIr.IrProject;
import com.dy.pipIrrGlobal.voIr.VoCrop;
import com.dy.pipIrrGlobal.voIr.VoCropOne;
import com.dy.pipIrrGlobal.voIr.VoProject;
import com.dy.pipIrrGlobal.voIr.VoProjectOne;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrIrrigate.crop.QueryVo;
import com.dy.pipIrrIrrigate.result.IrrigateResultCode;
@@ -72,7 +74,7 @@
        try {
            Integer rec = Optional.ofNullable(cropSv.addCrop(po)).orElse(0);
            if (rec == 0) {
                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_PROJECT_FAIL.getMessage());
                return BaseResponseUtils.buildFail(IrrigateResultCode.ADD_CROP_FAIL.getMessage());
            }
        } catch (Exception e) {
            log.error("添加作物异常", e);
@@ -100,13 +102,13 @@
    @SsoAop()
    public BaseResponse<Boolean> delete(@RequestBody Map map) {
        if (map == null || map.size() <= 0) {
            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage());
            BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_CROP_ID.getMessage());
        }
        Long cropId = Long.parseLong(map.get("id").toString());
        try {
            Integer rows = cropSv.deleteCrop(cropId);
            if (rows == 0) {
                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage());
                return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_CROP_FAIL.getMessage());
            }
        } catch (Exception e) {
            log.error("删除作物异常", e);
@@ -140,7 +142,7 @@
        try {
            Integer rec = Optional.ofNullable(cropSv.updateCrop(po)).orElse(0);
            if (rec == 0) {
                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_PROJECT_FAIL.getMessage());
                return BaseResponseUtils.buildFail(IrrigateResultCode.UPDATE_CROP_FAIL.getMessage());
            }
        } catch (Exception e) {
            log.error("修改作物异常", e);
@@ -174,4 +176,27 @@
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
    /**
     * 获取一个作物数据
     *
     * @return 获取一个作物数据
     */
    @Operation(summary = "获取一个作物数据", description = "获取一个作物数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "获取一个作物数据(BaseResponse.content:{})",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = IrProject.class))}
            )
    })
    @GetMapping(path = "one")
    @SsoAop()
    public BaseResponse<VoCropOne> one(@RequestParam Long id) {
        VoCropOne irCrop = this.cropSv.selectById(id);
        return BaseResponseUtils.buildSuccess(irCrop);
    }
}