farm模块-基础代码提交
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.baseinfo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.baseinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.baseinfo.BaseInfoDO;
|
||||
import cn.iocoder.yudao.module.farm.service.baseinfo.BaseInfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 基地")
|
||||
@RestController
|
||||
@RequestMapping("/farm/base-info")
|
||||
@Validated
|
||||
public class BaseInfoController {
|
||||
|
||||
@Resource
|
||||
private BaseInfoService baseInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建基地")
|
||||
@PreAuthorize("@ss.hasPermission('farm:base-info:create')")
|
||||
public CommonResult<String> createBaseInfo(@Valid @RequestBody BaseInfoSaveReqVO createReqVO) {
|
||||
return success(baseInfoService.createBaseInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新基地")
|
||||
@PreAuthorize("@ss.hasPermission('farm:base-info:update')")
|
||||
public CommonResult<Boolean> updateBaseInfo(@Valid @RequestBody BaseInfoSaveReqVO updateReqVO) {
|
||||
baseInfoService.updateBaseInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除基地")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:base-info:delete')")
|
||||
public CommonResult<Boolean> deleteBaseInfo(@RequestParam("id") String id) {
|
||||
baseInfoService.deleteBaseInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除基地")
|
||||
@PreAuthorize("@ss.hasPermission('farm:base-info:delete')")
|
||||
public CommonResult<Boolean> deleteBaseInfoList(@RequestParam("ids") List<String> ids) {
|
||||
baseInfoService.deleteBaseInfoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得基地")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:base-info:query')")
|
||||
public CommonResult<BaseInfoRespVO> getBaseInfo(@RequestParam("id") String id) {
|
||||
BaseInfoDO baseInfo = baseInfoService.getBaseInfo(id);
|
||||
return success(BeanUtils.toBean(baseInfo, BaseInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得基地分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:base-info:query')")
|
||||
public CommonResult<PageResult<BaseInfoRespVO>> getBaseInfoPage(@Valid BaseInfoPageReqVO pageReqVO) {
|
||||
PageResult<BaseInfoDO> pageResult = baseInfoService.getBaseInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BaseInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出基地 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:base-info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBaseInfoExcel(@Valid BaseInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BaseInfoDO> list = baseInfoService.getBaseInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "基地.xls", "数据", BaseInfoRespVO.class,
|
||||
BeanUtils.toBean(list, BaseInfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.baseinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 基地分页 Request VO")
|
||||
@Data
|
||||
public class BaseInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基地名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "用户id用,隔开")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "面积")
|
||||
private BigDecimal area;
|
||||
|
||||
@Schema(description = "json字符串保存")
|
||||
private String point;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "租户编号", example = "27629")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.baseinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 基地 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BaseInfoRespVO {
|
||||
|
||||
@Schema(description = "基地id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189")
|
||||
@ExcelProperty("基地id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基地名称", example = "张三")
|
||||
@ExcelProperty("基地名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "用户id用,隔开")
|
||||
@ExcelProperty("用户id用,隔开")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "面积")
|
||||
@ExcelProperty("面积")
|
||||
private BigDecimal area;
|
||||
|
||||
@Schema(description = "json字符串保存")
|
||||
@ExcelProperty("json字符串保存")
|
||||
private String point;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "租户编号", example = "27629")
|
||||
@ExcelProperty("租户编号")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.baseinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 基地新增/修改 Request VO")
|
||||
@Data
|
||||
public class BaseInfoSaveReqVO {
|
||||
|
||||
@Schema(description = "基地id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基地名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "用户id用,隔开")
|
||||
private String manager;
|
||||
|
||||
@Schema(description = "面积")
|
||||
private BigDecimal area;
|
||||
|
||||
@Schema(description = "json字符串保存")
|
||||
private String point;
|
||||
|
||||
@Schema(description = "租户编号", example = "27629")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.companyinfo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.companyinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.companyinfo.CompanyInfoDO;
|
||||
import cn.iocoder.yudao.module.farm.service.companyinfo.CompanyInfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 企业信息")
|
||||
@RestController
|
||||
@RequestMapping("/farm/company-info")
|
||||
@Validated
|
||||
public class CompanyInfoController {
|
||||
|
||||
@Resource
|
||||
private CompanyInfoService companyInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建企业信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:company-info:create')")
|
||||
public CommonResult<String> createCompanyInfo(@Valid @RequestBody CompanyInfoSaveReqVO createReqVO) {
|
||||
return success(companyInfoService.createCompanyInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新企业信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:company-info:update')")
|
||||
public CommonResult<Boolean> updateCompanyInfo(@Valid @RequestBody CompanyInfoSaveReqVO updateReqVO) {
|
||||
companyInfoService.updateCompanyInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除企业信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:company-info:delete')")
|
||||
public CommonResult<Boolean> deleteCompanyInfo(@RequestParam("id") String id) {
|
||||
companyInfoService.deleteCompanyInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除企业信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:company-info:delete')")
|
||||
public CommonResult<Boolean> deleteCompanyInfoList(@RequestParam("ids") List<String> ids) {
|
||||
companyInfoService.deleteCompanyInfoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得企业信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:company-info:query')")
|
||||
public CommonResult<CompanyInfoRespVO> getCompanyInfo(@RequestParam("id") String id) {
|
||||
CompanyInfoDO companyInfo = companyInfoService.getCompanyInfo(id);
|
||||
return success(BeanUtils.toBean(companyInfo, CompanyInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得企业信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:company-info:query')")
|
||||
public CommonResult<PageResult<CompanyInfoRespVO>> getCompanyInfoPage(@Valid CompanyInfoPageReqVO pageReqVO) {
|
||||
PageResult<CompanyInfoDO> pageResult = companyInfoService.getCompanyInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CompanyInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出企业信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:company-info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCompanyInfoExcel(@Valid CompanyInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<CompanyInfoDO> list = companyInfoService.getCompanyInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "企业信息.xls", "数据", CompanyInfoRespVO.class,
|
||||
BeanUtils.toBean(list, CompanyInfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.companyinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 企业信息分页 Request VO")
|
||||
@Data
|
||||
public class CompanyInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "企业名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "负责人")
|
||||
private String director;
|
||||
|
||||
@Schema(description = "企业电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "所在地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "详细地址")
|
||||
private String detailedAddress;
|
||||
|
||||
@Schema(description = "网店名称", example = "张三")
|
||||
private String storeName;
|
||||
|
||||
@Schema(description = "网店名称")
|
||||
private String storeAddress;
|
||||
|
||||
@Schema(description = "网店地址")
|
||||
private String introduce;
|
||||
|
||||
@Schema(description = "宣传图片")
|
||||
private String publicityImage;
|
||||
|
||||
@Schema(description = "企业logo")
|
||||
private String logoImage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "25213")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "8291")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "9295")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.companyinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 企业信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CompanyInfoRespVO {
|
||||
|
||||
@Schema(description = "企业id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22365")
|
||||
@ExcelProperty("企业id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "企业名称", example = "赵六")
|
||||
@ExcelProperty("企业名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "负责人")
|
||||
@ExcelProperty("负责人")
|
||||
private String director;
|
||||
|
||||
@Schema(description = "企业电话")
|
||||
@ExcelProperty("企业电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "所在地址")
|
||||
@ExcelProperty("所在地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "详细地址")
|
||||
@ExcelProperty("详细地址")
|
||||
private String detailedAddress;
|
||||
|
||||
@Schema(description = "网店名称", example = "张三")
|
||||
@ExcelProperty("网店名称")
|
||||
private String storeName;
|
||||
|
||||
@Schema(description = "网店名称")
|
||||
@ExcelProperty("网店名称")
|
||||
private String storeAddress;
|
||||
|
||||
@Schema(description = "网店地址")
|
||||
@ExcelProperty("网店地址")
|
||||
private String introduce;
|
||||
|
||||
@Schema(description = "宣传图片")
|
||||
@ExcelProperty("宣传图片")
|
||||
private String publicityImage;
|
||||
|
||||
@Schema(description = "企业logo")
|
||||
@ExcelProperty("企业logo")
|
||||
private String logoImage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "25213")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "8291")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "9295")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.companyinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 企业信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class CompanyInfoSaveReqVO {
|
||||
|
||||
@Schema(description = "企业id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22365")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "企业名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "负责人")
|
||||
private String director;
|
||||
|
||||
@Schema(description = "企业电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "所在地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "详细地址")
|
||||
private String detailedAddress;
|
||||
|
||||
@Schema(description = "网店名称", example = "张三")
|
||||
private String storeName;
|
||||
|
||||
@Schema(description = "网店名称")
|
||||
private String storeAddress;
|
||||
|
||||
@Schema(description = "网店地址")
|
||||
private String introduce;
|
||||
|
||||
@Schema(description = "宣传图片")
|
||||
private String publicityImage;
|
||||
|
||||
@Schema(description = "企业logo")
|
||||
private String logoImage;
|
||||
|
||||
@Schema(description = "基地id", example = "25213")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "8291")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "9295")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.cultivationarea;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.cultivationarea.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.cultivationarea.CultivationAreaDO;
|
||||
import cn.iocoder.yudao.module.farm.service.cultivationarea.CultivationAreaService;
|
||||
|
||||
@Tag(name = "管理后台 - 种植区域")
|
||||
@RestController
|
||||
@RequestMapping("/farm/cultivation-area")
|
||||
@Validated
|
||||
public class CultivationAreaController {
|
||||
|
||||
@Resource
|
||||
private CultivationAreaService cultivationAreaService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建种植区域")
|
||||
@PreAuthorize("@ss.hasPermission('farm:cultivation-area:create')")
|
||||
public CommonResult<String> createCultivationArea(@Valid @RequestBody CultivationAreaSaveReqVO createReqVO) {
|
||||
return success(cultivationAreaService.createCultivationArea(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新种植区域")
|
||||
@PreAuthorize("@ss.hasPermission('farm:cultivation-area:update')")
|
||||
public CommonResult<Boolean> updateCultivationArea(@Valid @RequestBody CultivationAreaSaveReqVO updateReqVO) {
|
||||
cultivationAreaService.updateCultivationArea(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除种植区域")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:cultivation-area:delete')")
|
||||
public CommonResult<Boolean> deleteCultivationArea(@RequestParam("id") String id) {
|
||||
cultivationAreaService.deleteCultivationArea(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除种植区域")
|
||||
@PreAuthorize("@ss.hasPermission('farm:cultivation-area:delete')")
|
||||
public CommonResult<Boolean> deleteCultivationAreaList(@RequestParam("ids") List<String> ids) {
|
||||
cultivationAreaService.deleteCultivationAreaListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得种植区域")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:cultivation-area:query')")
|
||||
public CommonResult<CultivationAreaRespVO> getCultivationArea(@RequestParam("id") String id) {
|
||||
CultivationAreaDO cultivationArea = cultivationAreaService.getCultivationArea(id);
|
||||
return success(BeanUtils.toBean(cultivationArea, CultivationAreaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得种植区域分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:cultivation-area:query')")
|
||||
public CommonResult<PageResult<CultivationAreaRespVO>> getCultivationAreaPage(@Valid CultivationAreaPageReqVO pageReqVO) {
|
||||
PageResult<CultivationAreaDO> pageResult = cultivationAreaService.getCultivationAreaPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CultivationAreaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出种植区域 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:cultivation-area:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCultivationAreaExcel(@Valid CultivationAreaPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<CultivationAreaDO> list = cultivationAreaService.getCultivationAreaPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "种植区域.xls", "数据", CultivationAreaRespVO.class,
|
||||
BeanUtils.toBean(list, CultivationAreaRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.cultivationarea.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 种植区域分页 Request VO")
|
||||
@Data
|
||||
public class CultivationAreaPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基地id", example = "20870")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "1564")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "计划面积")
|
||||
private BigDecimal planArea;
|
||||
|
||||
@Schema(description = "总面积")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@Schema(description = "剩余面积")
|
||||
private BigDecimal surplusArea;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "租户id", example = "11840")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.cultivationarea.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 种植区域 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CultivationAreaRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8369")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基地id", example = "20870")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "1564")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "计划面积")
|
||||
@ExcelProperty("计划面积")
|
||||
private BigDecimal planArea;
|
||||
|
||||
@Schema(description = "总面积")
|
||||
@ExcelProperty("总面积")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@Schema(description = "剩余面积")
|
||||
@ExcelProperty("剩余面积")
|
||||
private BigDecimal surplusArea;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
@ExcelProperty("逻辑删除标识符")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "租户id", example = "11840")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.cultivationarea.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 种植区域新增/修改 Request VO")
|
||||
@Data
|
||||
public class CultivationAreaSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8369")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基地id", example = "20870")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "1564")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "计划面积")
|
||||
private BigDecimal planArea;
|
||||
|
||||
@Schema(description = "总面积")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@Schema(description = "剩余面积")
|
||||
private BigDecimal surplusArea;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "租户id", example = "11840")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceinfo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.deviceinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.deviceinfo.DeviceInfoDO;
|
||||
import cn.iocoder.yudao.module.farm.service.deviceinfo.DeviceInfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备信息")
|
||||
@RestController
|
||||
@RequestMapping("/farm/device-info")
|
||||
@Validated
|
||||
public class DeviceInfoController {
|
||||
|
||||
@Resource
|
||||
private DeviceInfoService deviceInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-info:create')")
|
||||
public CommonResult<String> createDeviceInfo(@Valid @RequestBody DeviceInfoSaveReqVO createReqVO) {
|
||||
return success(deviceInfoService.createDeviceInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-info:update')")
|
||||
public CommonResult<Boolean> updateDeviceInfo(@Valid @RequestBody DeviceInfoSaveReqVO updateReqVO) {
|
||||
deviceInfoService.updateDeviceInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-info:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceInfo(@RequestParam("id") String id) {
|
||||
deviceInfoService.deleteDeviceInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除设备信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-info:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceInfoList(@RequestParam("ids") List<String> ids) {
|
||||
deviceInfoService.deleteDeviceInfoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-info:query')")
|
||||
public CommonResult<DeviceInfoRespVO> getDeviceInfo(@RequestParam("id") String id) {
|
||||
DeviceInfoDO deviceInfo = deviceInfoService.getDeviceInfo(id);
|
||||
return success(BeanUtils.toBean(deviceInfo, DeviceInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-info:query')")
|
||||
public CommonResult<PageResult<DeviceInfoRespVO>> getDeviceInfoPage(@Valid DeviceInfoPageReqVO pageReqVO) {
|
||||
PageResult<DeviceInfoDO> pageResult = deviceInfoService.getDeviceInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceInfoExcel(@Valid DeviceInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceInfoDO> list = deviceInfoService.getDeviceInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "设备信息.xls", "数据", DeviceInfoRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceInfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备信息分页 Request VO")
|
||||
@Data
|
||||
public class DeviceInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备名称", example = "赵六")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "LP设备名称", example = "李四")
|
||||
private String lpDeviceName;
|
||||
|
||||
@Schema(description = "设备分类编码")
|
||||
private String categoryCode;
|
||||
|
||||
@Schema(description = "设备分类名称", example = "芋艿")
|
||||
private String deviceCategoryName;
|
||||
|
||||
@Schema(description = "设备分类ID", example = "15366")
|
||||
private String deviceCategoryUniqueId;
|
||||
|
||||
@Schema(description = "隔离标识", example = "29422")
|
||||
private String farmIsolationId;
|
||||
|
||||
@Schema(description = "LP产品标识")
|
||||
private String lpProductKey;
|
||||
|
||||
@Schema(description = "LP产品名称", example = "李四")
|
||||
private String lpProductName;
|
||||
|
||||
@Schema(description = "LP产品唯一ID", example = "10175")
|
||||
private String lpProductUniqueId;
|
||||
|
||||
@Schema(description = "设备状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "设备类型", example = "2")
|
||||
private String deviceType;
|
||||
|
||||
@Schema(description = "预留类型字段", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "设备厂商")
|
||||
private String vendor;
|
||||
|
||||
@Schema(description = "设备描述", example = "随便")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "分类描述类型", example = "1")
|
||||
private String categoryDescType;
|
||||
|
||||
@Schema(description = "创建时间戳")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "记录创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "记录更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "设备图片")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "告警状态图片")
|
||||
private String alarmImage;
|
||||
|
||||
@Schema(description = "离线状态图片")
|
||||
private String offlineImage;
|
||||
|
||||
@Schema(description = "分类图标")
|
||||
private String categoryIcon;
|
||||
|
||||
@Schema(description = "电池电量(0-100)")
|
||||
private Integer battery;
|
||||
|
||||
@Schema(description = "信号强度")
|
||||
private Short rssi;
|
||||
|
||||
@Schema(description = "物联网卡过期时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] iotCardExpireTime;
|
||||
|
||||
@Schema(description = "是否存在物联网卡")
|
||||
private Boolean isIotCardExisted;
|
||||
|
||||
@Schema(description = "边缘实例ID", example = "13311")
|
||||
private String edgeInstanceUniqueId;
|
||||
|
||||
@Schema(description = "数据快照")
|
||||
private String dataImage;
|
||||
|
||||
@Schema(description = "基地id", example = "9675")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "22883")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "11502")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceInfoRespVO {
|
||||
|
||||
@Schema(description = "设备全局唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "9620")
|
||||
@ExcelProperty("设备全局唯一标识")
|
||||
private String deviceUniqueId;
|
||||
|
||||
@Schema(description = "设备名称", example = "赵六")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "LP设备名称", example = "李四")
|
||||
@ExcelProperty("LP设备名称")
|
||||
private String lpDeviceName;
|
||||
|
||||
@Schema(description = "设备分类编码")
|
||||
@ExcelProperty("设备分类编码")
|
||||
private String categoryCode;
|
||||
|
||||
@Schema(description = "设备分类名称", example = "芋艿")
|
||||
@ExcelProperty("设备分类名称")
|
||||
private String deviceCategoryName;
|
||||
|
||||
@Schema(description = "设备分类ID", example = "15366")
|
||||
@ExcelProperty("设备分类ID")
|
||||
private String deviceCategoryUniqueId;
|
||||
|
||||
@Schema(description = "隔离标识", example = "29422")
|
||||
@ExcelProperty("隔离标识")
|
||||
private String farmIsolationId;
|
||||
|
||||
@Schema(description = "LP产品标识")
|
||||
@ExcelProperty("LP产品标识")
|
||||
private String lpProductKey;
|
||||
|
||||
@Schema(description = "LP产品名称", example = "李四")
|
||||
@ExcelProperty("LP产品名称")
|
||||
private String lpProductName;
|
||||
|
||||
@Schema(description = "LP产品唯一ID", example = "10175")
|
||||
@ExcelProperty("LP产品唯一ID")
|
||||
private String lpProductUniqueId;
|
||||
|
||||
@Schema(description = "设备状态", example = "2")
|
||||
@ExcelProperty("设备状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "设备类型", example = "2")
|
||||
@ExcelProperty("设备类型")
|
||||
private String deviceType;
|
||||
|
||||
@Schema(description = "预留类型字段", example = "1")
|
||||
@ExcelProperty("预留类型字段")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "设备厂商")
|
||||
@ExcelProperty("设备厂商")
|
||||
private String vendor;
|
||||
|
||||
@Schema(description = "设备描述", example = "随便")
|
||||
@ExcelProperty("设备描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "分类描述类型", example = "1")
|
||||
@ExcelProperty("分类描述类型")
|
||||
private String categoryDescType;
|
||||
|
||||
@Schema(description = "创建时间戳")
|
||||
@ExcelProperty("创建时间戳")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "记录创建时间")
|
||||
@ExcelProperty("记录创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "记录更新时间")
|
||||
@ExcelProperty("记录更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "设备图片")
|
||||
@ExcelProperty("设备图片")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "告警状态图片")
|
||||
@ExcelProperty("告警状态图片")
|
||||
private String alarmImage;
|
||||
|
||||
@Schema(description = "离线状态图片")
|
||||
@ExcelProperty("离线状态图片")
|
||||
private String offlineImage;
|
||||
|
||||
@Schema(description = "分类图标")
|
||||
@ExcelProperty("分类图标")
|
||||
private String categoryIcon;
|
||||
|
||||
@Schema(description = "电池电量(0-100)")
|
||||
@ExcelProperty("电池电量(0-100)")
|
||||
private Integer battery;
|
||||
|
||||
@Schema(description = "信号强度")
|
||||
@ExcelProperty("信号强度")
|
||||
private Short rssi;
|
||||
|
||||
@Schema(description = "物联网卡过期时间")
|
||||
@ExcelProperty("物联网卡过期时间")
|
||||
private LocalDateTime iotCardExpireTime;
|
||||
|
||||
@Schema(description = "是否存在物联网卡")
|
||||
@ExcelProperty("是否存在物联网卡")
|
||||
private Boolean isIotCardExisted;
|
||||
|
||||
@Schema(description = "边缘实例ID", example = "13311")
|
||||
@ExcelProperty("边缘实例ID")
|
||||
private String edgeInstanceUniqueId;
|
||||
|
||||
@Schema(description = "数据快照")
|
||||
@ExcelProperty("数据快照")
|
||||
private String dataImage;
|
||||
|
||||
@Schema(description = "基地id", example = "9675")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "22883")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "11502")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 设备信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceInfoSaveReqVO {
|
||||
|
||||
@Schema(description = "设备全局唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "9620")
|
||||
private String deviceUniqueId;
|
||||
|
||||
@Schema(description = "设备名称", example = "赵六")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "LP设备名称", example = "李四")
|
||||
private String lpDeviceName;
|
||||
|
||||
@Schema(description = "设备分类编码")
|
||||
private String categoryCode;
|
||||
|
||||
@Schema(description = "设备分类名称", example = "芋艿")
|
||||
private String deviceCategoryName;
|
||||
|
||||
@Schema(description = "设备分类ID", example = "15366")
|
||||
private String deviceCategoryUniqueId;
|
||||
|
||||
@Schema(description = "隔离标识", example = "29422")
|
||||
private String farmIsolationId;
|
||||
|
||||
@Schema(description = "LP产品标识")
|
||||
private String lpProductKey;
|
||||
|
||||
@Schema(description = "LP产品名称", example = "李四")
|
||||
private String lpProductName;
|
||||
|
||||
@Schema(description = "LP产品唯一ID", example = "10175")
|
||||
private String lpProductUniqueId;
|
||||
|
||||
@Schema(description = "设备状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "设备类型", example = "2")
|
||||
private String deviceType;
|
||||
|
||||
@Schema(description = "预留类型字段", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "设备厂商")
|
||||
private String vendor;
|
||||
|
||||
@Schema(description = "设备描述", example = "随便")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "分类描述类型", example = "1")
|
||||
private String categoryDescType;
|
||||
|
||||
@Schema(description = "记录创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "记录更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "设备图片")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "告警状态图片")
|
||||
private String alarmImage;
|
||||
|
||||
@Schema(description = "离线状态图片")
|
||||
private String offlineImage;
|
||||
|
||||
@Schema(description = "分类图标")
|
||||
private String categoryIcon;
|
||||
|
||||
@Schema(description = "电池电量(0-100)")
|
||||
private Integer battery;
|
||||
|
||||
@Schema(description = "信号强度")
|
||||
private Short rssi;
|
||||
|
||||
@Schema(description = "物联网卡过期时间")
|
||||
private LocalDateTime iotCardExpireTime;
|
||||
|
||||
@Schema(description = "是否存在物联网卡")
|
||||
private Boolean isIotCardExisted;
|
||||
|
||||
@Schema(description = "边缘实例ID", example = "13311")
|
||||
private String edgeInstanceUniqueId;
|
||||
|
||||
@Schema(description = "数据快照")
|
||||
private String dataImage;
|
||||
|
||||
@Schema(description = "基地id", example = "9675")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "22883")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "11502")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceplotrelation;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.deviceplotrelation.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.deviceplotrelation.DevicePlotRelationDO;
|
||||
import cn.iocoder.yudao.module.farm.service.deviceplotrelation.DevicePlotRelationService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备与地块关联")
|
||||
@RestController
|
||||
@RequestMapping("/farm/device-plot-relation")
|
||||
@Validated
|
||||
public class DevicePlotRelationController {
|
||||
|
||||
@Resource
|
||||
private DevicePlotRelationService devicePlotRelationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备与地块关联")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-plot-relation:create')")
|
||||
public CommonResult<String> createDevicePlotRelation(@Valid @RequestBody DevicePlotRelationSaveReqVO createReqVO) {
|
||||
return success(devicePlotRelationService.createDevicePlotRelation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备与地块关联")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-plot-relation:update')")
|
||||
public CommonResult<Boolean> updateDevicePlotRelation(@Valid @RequestBody DevicePlotRelationSaveReqVO updateReqVO) {
|
||||
devicePlotRelationService.updateDevicePlotRelation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备与地块关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-plot-relation:delete')")
|
||||
public CommonResult<Boolean> deleteDevicePlotRelation(@RequestParam("id") String id) {
|
||||
devicePlotRelationService.deleteDevicePlotRelation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除设备与地块关联")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-plot-relation:delete')")
|
||||
public CommonResult<Boolean> deleteDevicePlotRelationList(@RequestParam("ids") List<String> ids) {
|
||||
devicePlotRelationService.deleteDevicePlotRelationListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备与地块关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-plot-relation:query')")
|
||||
public CommonResult<DevicePlotRelationRespVO> getDevicePlotRelation(@RequestParam("id") String id) {
|
||||
DevicePlotRelationDO devicePlotRelation = devicePlotRelationService.getDevicePlotRelation(id);
|
||||
return success(BeanUtils.toBean(devicePlotRelation, DevicePlotRelationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备与地块关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-plot-relation:query')")
|
||||
public CommonResult<PageResult<DevicePlotRelationRespVO>> getDevicePlotRelationPage(@Valid DevicePlotRelationPageReqVO pageReqVO) {
|
||||
PageResult<DevicePlotRelationDO> pageResult = devicePlotRelationService.getDevicePlotRelationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DevicePlotRelationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备与地块关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:device-plot-relation:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDevicePlotRelationExcel(@Valid DevicePlotRelationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DevicePlotRelationDO> list = devicePlotRelationService.getDevicePlotRelationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "设备与地块关联.xls", "数据", DevicePlotRelationRespVO.class,
|
||||
BeanUtils.toBean(list, DevicePlotRelationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceplotrelation.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备与地块关联分页 Request VO")
|
||||
@Data
|
||||
public class DevicePlotRelationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备ID", example = "19588")
|
||||
private String deviceUniqueId;
|
||||
|
||||
@Schema(description = "设备厂商")
|
||||
private String vendor;
|
||||
|
||||
@Schema(description = "设备名称", example = "赵六")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "LP产品标识")
|
||||
private String lpProductKey;
|
||||
|
||||
@Schema(description = "用户id", example = "30466")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "是否存在物联网卡")
|
||||
private Boolean isIotCardExisted;
|
||||
|
||||
@Schema(description = "基地id", example = "30062")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "20813")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8518")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceplotrelation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备与地块关联 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DevicePlotRelationRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7806")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "设备ID", example = "19588")
|
||||
@ExcelProperty("设备ID")
|
||||
private String deviceUniqueId;
|
||||
|
||||
@Schema(description = "设备厂商")
|
||||
@ExcelProperty("设备厂商")
|
||||
private String vendor;
|
||||
|
||||
@Schema(description = "设备名称", example = "赵六")
|
||||
@ExcelProperty("设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "LP产品标识")
|
||||
@ExcelProperty("LP产品标识")
|
||||
private String lpProductKey;
|
||||
|
||||
@Schema(description = "用户id", example = "30466")
|
||||
@ExcelProperty("用户id")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "是否存在物联网卡")
|
||||
@ExcelProperty("是否存在物联网卡")
|
||||
private Boolean isIotCardExisted;
|
||||
|
||||
@Schema(description = "基地id", example = "30062")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "20813")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8518")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceplotrelation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备与地块关联新增/修改 Request VO")
|
||||
@Data
|
||||
public class DevicePlotRelationSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7806")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "设备ID", example = "19588")
|
||||
private String deviceUniqueId;
|
||||
|
||||
@Schema(description = "设备厂商")
|
||||
private String vendor;
|
||||
|
||||
@Schema(description = "设备名称", example = "赵六")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "LP产品标识")
|
||||
private String lpProductKey;
|
||||
|
||||
@Schema(description = "用户id", example = "30466")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "是否存在物联网卡")
|
||||
private Boolean isIotCardExisted;
|
||||
|
||||
@Schema(description = "基地id", example = "30062")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "20813")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8518")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.disasterdata;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO;
|
||||
import cn.iocoder.yudao.module.farm.service.disasterdata.DisasterDataService;
|
||||
|
||||
@Tag(name = "管理后台 - 灾害数据")
|
||||
@RestController
|
||||
@RequestMapping("/farm/disaster-data")
|
||||
@Validated
|
||||
public class DisasterDataController {
|
||||
|
||||
@Resource
|
||||
private DisasterDataService disasterDataService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建灾害数据")
|
||||
@PreAuthorize("@ss.hasPermission('farm:disaster-data:create')")
|
||||
public CommonResult<String> createDisasterData(@Valid @RequestBody DisasterDataSaveReqVO createReqVO) {
|
||||
return success(disasterDataService.createDisasterData(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新灾害数据")
|
||||
@PreAuthorize("@ss.hasPermission('farm:disaster-data:update')")
|
||||
public CommonResult<Boolean> updateDisasterData(@Valid @RequestBody DisasterDataSaveReqVO updateReqVO) {
|
||||
disasterDataService.updateDisasterData(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除灾害数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:disaster-data:delete')")
|
||||
public CommonResult<Boolean> deleteDisasterData(@RequestParam("id") String id) {
|
||||
disasterDataService.deleteDisasterData(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除灾害数据")
|
||||
@PreAuthorize("@ss.hasPermission('farm:disaster-data:delete')")
|
||||
public CommonResult<Boolean> deleteDisasterDataList(@RequestParam("ids") List<String> ids) {
|
||||
disasterDataService.deleteDisasterDataListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得灾害数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:disaster-data:query')")
|
||||
public CommonResult<DisasterDataRespVO> getDisasterData(@RequestParam("id") String id) {
|
||||
DisasterDataDO disasterData = disasterDataService.getDisasterData(id);
|
||||
return success(BeanUtils.toBean(disasterData, DisasterDataRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得灾害数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:disaster-data:query')")
|
||||
public CommonResult<PageResult<DisasterDataRespVO>> getDisasterDataPage(@Valid DisasterDataPageReqVO pageReqVO) {
|
||||
PageResult<DisasterDataDO> pageResult = disasterDataService.getDisasterDataPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DisasterDataRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出灾害数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:disaster-data:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDisasterDataExcel(@Valid DisasterDataPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DisasterDataDO> list = disasterDataService.getDisasterDataPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "灾害数据.xls", "数据", DisasterDataRespVO.class,
|
||||
BeanUtils.toBean(list, DisasterDataRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 灾害数据分页 Request VO")
|
||||
@Data
|
||||
public class DisasterDataPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基础id", example = "3322")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "基地id", example = "21300")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "发生月份")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] disasterTime;
|
||||
|
||||
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
||||
private Integer category;
|
||||
|
||||
@Schema(description = "灾害名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "发生次数", example = "17530")
|
||||
private Integer disasterCount;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "地块ID", example = "21827")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "20422")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 灾害数据 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DisasterDataRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26665")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基础id", example = "3322")
|
||||
@ExcelProperty("基础id")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "基地id", example = "21300")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称", example = "芋艿")
|
||||
@ExcelProperty("基地名称")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "发生月份")
|
||||
@ExcelProperty("发生月份")
|
||||
private String disasterTime;
|
||||
|
||||
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
||||
@ExcelProperty("灾害类型1=环境,2=病害,3=虫害,4=草害")
|
||||
private Integer category;
|
||||
|
||||
@Schema(description = "灾害名称", example = "赵六")
|
||||
@ExcelProperty("灾害名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "发生次数", example = "17530")
|
||||
@ExcelProperty("发生次数")
|
||||
private Integer disasterCount;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "地块ID", example = "21827")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "20422")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 灾害数据新增/修改 Request VO")
|
||||
@Data
|
||||
public class DisasterDataSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26665")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基础id", example = "3322")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "基地id", example = "21300")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地名称", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "发生月份")
|
||||
private String disasterTime;
|
||||
|
||||
@Schema(description = "灾害类型1=环境,2=病害,3=虫害,4=草害")
|
||||
private Integer category;
|
||||
|
||||
@Schema(description = "灾害名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "发生次数", example = "17530")
|
||||
private Integer disasterCount;
|
||||
|
||||
@Schema(description = "地块ID", example = "21827")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "20422")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.environmentindexconfig;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.environmentindexconfig.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.environmentindexconfig.EnvironmentIndexConfigDO;
|
||||
import cn.iocoder.yudao.module.farm.service.environmentindexconfig.EnvironmentIndexConfigService;
|
||||
|
||||
@Tag(name = "管理后台 - 环境指标配置")
|
||||
@RestController
|
||||
@RequestMapping("/farm/environment-index-config")
|
||||
@Validated
|
||||
public class EnvironmentIndexConfigController {
|
||||
|
||||
@Resource
|
||||
private EnvironmentIndexConfigService environmentIndexConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建环境指标配置")
|
||||
@PreAuthorize("@ss.hasPermission('farm:environment-index-config:create')")
|
||||
public CommonResult<String> createEnvironmentIndexConfig(@Valid @RequestBody EnvironmentIndexConfigSaveReqVO createReqVO) {
|
||||
return success(environmentIndexConfigService.createEnvironmentIndexConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新环境指标配置")
|
||||
@PreAuthorize("@ss.hasPermission('farm:environment-index-config:update')")
|
||||
public CommonResult<Boolean> updateEnvironmentIndexConfig(@Valid @RequestBody EnvironmentIndexConfigSaveReqVO updateReqVO) {
|
||||
environmentIndexConfigService.updateEnvironmentIndexConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除环境指标配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:environment-index-config:delete')")
|
||||
public CommonResult<Boolean> deleteEnvironmentIndexConfig(@RequestParam("id") String id) {
|
||||
environmentIndexConfigService.deleteEnvironmentIndexConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除环境指标配置")
|
||||
@PreAuthorize("@ss.hasPermission('farm:environment-index-config:delete')")
|
||||
public CommonResult<Boolean> deleteEnvironmentIndexConfigList(@RequestParam("ids") List<String> ids) {
|
||||
environmentIndexConfigService.deleteEnvironmentIndexConfigListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得环境指标配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:environment-index-config:query')")
|
||||
public CommonResult<EnvironmentIndexConfigRespVO> getEnvironmentIndexConfig(@RequestParam("id") String id) {
|
||||
EnvironmentIndexConfigDO environmentIndexConfig = environmentIndexConfigService.getEnvironmentIndexConfig(id);
|
||||
return success(BeanUtils.toBean(environmentIndexConfig, EnvironmentIndexConfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得环境指标配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:environment-index-config:query')")
|
||||
public CommonResult<PageResult<EnvironmentIndexConfigRespVO>> getEnvironmentIndexConfigPage(@Valid EnvironmentIndexConfigPageReqVO pageReqVO) {
|
||||
PageResult<EnvironmentIndexConfigDO> pageResult = environmentIndexConfigService.getEnvironmentIndexConfigPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, EnvironmentIndexConfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出环境指标配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:environment-index-config:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportEnvironmentIndexConfigExcel(@Valid EnvironmentIndexConfigPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<EnvironmentIndexConfigDO> list = environmentIndexConfigService.getEnvironmentIndexConfigPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "环境指标配置.xls", "数据", EnvironmentIndexConfigRespVO.class,
|
||||
BeanUtils.toBean(list, EnvironmentIndexConfigRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.environmentindexconfig.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 环境指标配置分页 Request VO")
|
||||
@Data
|
||||
public class EnvironmentIndexConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "物种名称", example = "赵六")
|
||||
private String cultivarName;
|
||||
|
||||
@Schema(description = "物种分类", example = "张三")
|
||||
private String speciesName;
|
||||
|
||||
@Schema(description = "指标名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "指标描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "17727")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "22327")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "7829")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.environmentindexconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 环境指标配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EnvironmentIndexConfigRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14247")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "物种名称", example = "赵六")
|
||||
@ExcelProperty("物种名称")
|
||||
private String cultivarName;
|
||||
|
||||
@Schema(description = "物种分类", example = "张三")
|
||||
@ExcelProperty("物种分类")
|
||||
private String speciesName;
|
||||
|
||||
@Schema(description = "指标名称", example = "张三")
|
||||
@ExcelProperty("指标名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "指标描述", example = "你说的对")
|
||||
@ExcelProperty("指标描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "17727")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "22327")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "7829")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.environmentindexconfig.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 环境指标配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class EnvironmentIndexConfigSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "14247")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "物种名称", example = "赵六")
|
||||
private String cultivarName;
|
||||
|
||||
@Schema(description = "物种分类", example = "张三")
|
||||
private String speciesName;
|
||||
|
||||
@Schema(description = "指标名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "指标描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "基地id", example = "17727")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "22327")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "7829")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingnamemaintenance.FarmingNameMaintenanceDO;
|
||||
import cn.iocoder.yudao.module.farm.service.farmingnamemaintenance.FarmingNameMaintenanceService;
|
||||
|
||||
@Tag(name = "管理后台 - 农事名称维护")
|
||||
@RestController
|
||||
@RequestMapping("/farm/ing-name-maintenance")
|
||||
@Validated
|
||||
public class FarmingNameMaintenanceController {
|
||||
|
||||
@Resource
|
||||
private FarmingNameMaintenanceService ingNameMaintenanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建农事名称维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-name-maintenance:create')")
|
||||
public CommonResult<String> createingNameMaintenance(@Valid @RequestBody FarmingNameMaintenanceSaveReqVO createReqVO) {
|
||||
return success(ingNameMaintenanceService.createingNameMaintenance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新农事名称维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-name-maintenance:update')")
|
||||
public CommonResult<Boolean> updateingNameMaintenance(@Valid @RequestBody FarmingNameMaintenanceSaveReqVO updateReqVO) {
|
||||
ingNameMaintenanceService.updateingNameMaintenance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除农事名称维护")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-name-maintenance:delete')")
|
||||
public CommonResult<Boolean> deleteingNameMaintenance(@RequestParam("id") String id) {
|
||||
ingNameMaintenanceService.deleteingNameMaintenance(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除农事名称维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-name-maintenance:delete')")
|
||||
public CommonResult<Boolean> deleteingNameMaintenanceList(@RequestParam("ids") List<String> ids) {
|
||||
ingNameMaintenanceService.deleteingNameMaintenanceListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得农事名称维护")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-name-maintenance:query')")
|
||||
public CommonResult<FarmingNameMaintenanceRespVO> getingNameMaintenance(@RequestParam("id") String id) {
|
||||
FarmingNameMaintenanceDO ingNameMaintenance = ingNameMaintenanceService.getingNameMaintenance(id);
|
||||
return success(BeanUtils.toBean(ingNameMaintenance, FarmingNameMaintenanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得农事名称维护分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-name-maintenance:query')")
|
||||
public CommonResult<PageResult<FarmingNameMaintenanceRespVO>> getingNameMaintenancePage(@Valid FarmingNameMaintenancePageReqVO pageReqVO) {
|
||||
PageResult<FarmingNameMaintenanceDO> pageResult = ingNameMaintenanceService.getingNameMaintenancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FarmingNameMaintenanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出农事名称维护 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-name-maintenance:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportingNameMaintenanceExcel(@Valid FarmingNameMaintenancePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FarmingNameMaintenanceDO> list = ingNameMaintenanceService.getingNameMaintenancePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "农事名称维护.xls", "数据", FarmingNameMaintenanceRespVO.class,
|
||||
BeanUtils.toBean(list, FarmingNameMaintenanceRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 农事名称维护分页 Request VO")
|
||||
@Data
|
||||
public class FarmingNameMaintenancePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "农事名称", example = "李四")
|
||||
private String farmingName;
|
||||
|
||||
@Schema(description = "农事类型", example = "1")
|
||||
private String farmingType;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "23381")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "赵六")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "20315")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "15178")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 农事名称维护 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FarmingNameMaintenanceRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31981")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事名称", example = "李四")
|
||||
@ExcelProperty("农事名称")
|
||||
private String farmingName;
|
||||
|
||||
@Schema(description = "农事类型", example = "1")
|
||||
@ExcelProperty("农事类型")
|
||||
private String farmingType;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
@ExcelProperty("0=启用,1=停用")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "23381")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "赵六")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "20315")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "15178")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingnamemaintenance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 农事名称维护新增/修改 Request VO")
|
||||
@Data
|
||||
public class FarmingNameMaintenanceSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31981")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事名称", example = "李四")
|
||||
private String farmingName;
|
||||
|
||||
@Schema(description = "农事类型", example = "1")
|
||||
private String farmingType;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "23381")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "赵六")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "20315")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "15178")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecord;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingrecord.FarmingRecordDO;
|
||||
import cn.iocoder.yudao.module.farm.service.farmingrecord.FarmingRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 种植中心-农事基地-农事记录")
|
||||
@RestController
|
||||
@RequestMapping("/farm/ing-record")
|
||||
@Validated
|
||||
public class FarmingRecordController {
|
||||
|
||||
@Resource
|
||||
private FarmingRecordService ingRecordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建种植中心-农事基地-农事记录")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record:create')")
|
||||
public CommonResult<String> createingRecord(@Valid @RequestBody FarmingRecordSaveReqVO createReqVO) {
|
||||
return success(ingRecordService.createingRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新种植中心-农事基地-农事记录")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record:update')")
|
||||
public CommonResult<Boolean> updateingRecord(@Valid @RequestBody FarmingRecordSaveReqVO updateReqVO) {
|
||||
ingRecordService.updateingRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除种植中心-农事基地-农事记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record:delete')")
|
||||
public CommonResult<Boolean> deleteingRecord(@RequestParam("id") String id) {
|
||||
ingRecordService.deleteingRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除种植中心-农事基地-农事记录")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record:delete')")
|
||||
public CommonResult<Boolean> deleteingRecordList(@RequestParam("ids") List<String> ids) {
|
||||
ingRecordService.deleteingRecordListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得种植中心-农事基地-农事记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record:query')")
|
||||
public CommonResult<FarmingRecordRespVO> getingRecord(@RequestParam("id") String id) {
|
||||
FarmingRecordDO ingRecord = ingRecordService.getingRecord(id);
|
||||
return success(BeanUtils.toBean(ingRecord, FarmingRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得种植中心-农事基地-农事记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record:query')")
|
||||
public CommonResult<PageResult<FarmingRecordRespVO>> getingRecordPage(@Valid FarmingRecordPageReqVO pageReqVO) {
|
||||
PageResult<FarmingRecordDO> pageResult = ingRecordService.getingRecordPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FarmingRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出种植中心-农事基地-农事记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportingRecordExcel(@Valid FarmingRecordPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FarmingRecordDO> list = ingRecordService.getingRecordPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "种植中心-农事基地-农事记录.xls", "数据", FarmingRecordRespVO.class,
|
||||
BeanUtils.toBean(list, FarmingRecordRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 种植中心-农事基地-农事记录分页 Request VO")
|
||||
@Data
|
||||
public class FarmingRecordPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "任务类型", example = "1")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "任务名称", example = "芋艿")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务范围")
|
||||
private String taskScope;
|
||||
|
||||
@Schema(description = "任务时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] taskTime;
|
||||
|
||||
@Schema(description = "所属地块", example = "10480")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "生产计划ID", example = "24782")
|
||||
private String productionPlanId;
|
||||
|
||||
@Schema(description = "执行人")
|
||||
private String executor;
|
||||
|
||||
@Schema(description = "实际用工")
|
||||
private Integer actualLaborCost;
|
||||
|
||||
@Schema(description = "实际投入品ID", example = "5691")
|
||||
private String actualInputId;
|
||||
|
||||
@Schema(description = "执行反馈-备注")
|
||||
private String feedbackNotes;
|
||||
|
||||
@Schema(description = "执行反馈-图片URL", example = "https://www.iocoder.cn")
|
||||
private String feedbackImageUrl;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "28798")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "23744")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 种植中心-农事基地-农事记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FarmingRecordRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22116")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "任务类型", example = "1")
|
||||
@ExcelProperty("任务类型")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "任务名称", example = "芋艿")
|
||||
@ExcelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务范围")
|
||||
@ExcelProperty("任务范围")
|
||||
private String taskScope;
|
||||
|
||||
@Schema(description = "任务时间")
|
||||
@ExcelProperty("任务时间")
|
||||
private LocalDateTime taskTime;
|
||||
|
||||
@Schema(description = "所属地块", example = "10480")
|
||||
@ExcelProperty("所属地块")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "生产计划ID", example = "24782")
|
||||
@ExcelProperty("生产计划ID")
|
||||
private String productionPlanId;
|
||||
|
||||
@Schema(description = "执行人")
|
||||
@ExcelProperty("执行人")
|
||||
private String executor;
|
||||
|
||||
@Schema(description = "实际用工")
|
||||
@ExcelProperty("实际用工")
|
||||
private Integer actualLaborCost;
|
||||
|
||||
@Schema(description = "实际投入品ID", example = "5691")
|
||||
@ExcelProperty("实际投入品ID")
|
||||
private String actualInputId;
|
||||
|
||||
@Schema(description = "执行反馈-备注")
|
||||
@ExcelProperty("执行反馈-备注")
|
||||
private String feedbackNotes;
|
||||
|
||||
@Schema(description = "执行反馈-图片URL", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("执行反馈-图片URL")
|
||||
private String feedbackImageUrl;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
@ExcelProperty("逻辑删除标识符")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "28798")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "23744")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 种植中心-农事基地-农事记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class FarmingRecordSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22116")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "任务类型", example = "1")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "任务名称", example = "芋艿")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务范围")
|
||||
private String taskScope;
|
||||
|
||||
@Schema(description = "任务时间")
|
||||
private LocalDateTime taskTime;
|
||||
|
||||
@Schema(description = "所属地块", example = "10480")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "生产计划ID", example = "24782")
|
||||
private String productionPlanId;
|
||||
|
||||
@Schema(description = "执行人")
|
||||
private String executor;
|
||||
|
||||
@Schema(description = "实际用工")
|
||||
private Integer actualLaborCost;
|
||||
|
||||
@Schema(description = "实际投入品ID", example = "5691")
|
||||
private String actualInputId;
|
||||
|
||||
@Schema(description = "执行反馈-备注")
|
||||
private String feedbackNotes;
|
||||
|
||||
@Schema(description = "执行反馈-图片URL", example = "https://www.iocoder.cn")
|
||||
private String feedbackImageUrl;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "28798")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "23744")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecordinput;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingrecordinput.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingrecordinput.FarmingRecordInputDO;
|
||||
import cn.iocoder.yudao.module.farm.service.farmingrecordinput.FarmingRecordInputService;
|
||||
|
||||
@Tag(name = "管理后台 - 种植中心-农事基地-农事记录-投入品")
|
||||
@RestController
|
||||
@RequestMapping("/farm/ing-record-input")
|
||||
@Validated
|
||||
public class FarmingRecordInputController {
|
||||
|
||||
@Resource
|
||||
private FarmingRecordInputService ingRecordInputService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建种植中心-农事基地-农事记录-投入品")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record-input:create')")
|
||||
public CommonResult<String> createingRecordInput(@Valid @RequestBody FarmingRecordInputSaveReqVO createReqVO) {
|
||||
return success(ingRecordInputService.createingRecordInput(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新种植中心-农事基地-农事记录-投入品")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record-input:update')")
|
||||
public CommonResult<Boolean> updateingRecordInput(@Valid @RequestBody FarmingRecordInputSaveReqVO updateReqVO) {
|
||||
ingRecordInputService.updateingRecordInput(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除种植中心-农事基地-农事记录-投入品")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record-input:delete')")
|
||||
public CommonResult<Boolean> deleteingRecordInput(@RequestParam("id") String id) {
|
||||
ingRecordInputService.deleteingRecordInput(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除种植中心-农事基地-农事记录-投入品")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record-input:delete')")
|
||||
public CommonResult<Boolean> deleteingRecordInputList(@RequestParam("ids") List<String> ids) {
|
||||
ingRecordInputService.deleteingRecordInputListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得种植中心-农事基地-农事记录-投入品")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record-input:query')")
|
||||
public CommonResult<FarmingRecordInputRespVO> getingRecordInput(@RequestParam("id") String id) {
|
||||
FarmingRecordInputDO ingRecordInput = ingRecordInputService.getingRecordInput(id);
|
||||
return success(BeanUtils.toBean(ingRecordInput, FarmingRecordInputRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得种植中心-农事基地-农事记录-投入品分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record-input:query')")
|
||||
public CommonResult<PageResult<FarmingRecordInputRespVO>> getingRecordInputPage(@Valid FarmingRecordInputPageReqVO pageReqVO) {
|
||||
PageResult<FarmingRecordInputDO> pageResult = ingRecordInputService.getingRecordInputPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FarmingRecordInputRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出种植中心-农事基地-农事记录-投入品 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-record-input:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportingRecordInputExcel(@Valid FarmingRecordInputPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FarmingRecordInputDO> list = ingRecordInputService.getingRecordInputPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "种植中心-农事基地-农事记录-投入品.xls", "数据", FarmingRecordInputRespVO.class,
|
||||
BeanUtils.toBean(list, FarmingRecordInputRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecordinput.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 种植中心-农事基地-农事记录-投入品分页 Request VO")
|
||||
@Data
|
||||
public class FarmingRecordInputPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "农事记录ID", example = "11421")
|
||||
private String farmRecordId;
|
||||
|
||||
@Schema(description = "投入品-父类")
|
||||
private String inputParentCategory;
|
||||
|
||||
@Schema(description = "投入品-子类")
|
||||
private String inputChildCategory;
|
||||
|
||||
@Schema(description = "稀释倍液 (如为: 药物时需展示输入框)")
|
||||
private String dilutionRatio;
|
||||
|
||||
@Schema(description = "单用用量 (如为: 肥料选项时)")
|
||||
private String singleUseOption;
|
||||
|
||||
@Schema(description = "单用用量-值")
|
||||
private BigDecimal singleUseValue;
|
||||
|
||||
@Schema(description = "单用用量-单位")
|
||||
private String singleUseUnit;
|
||||
|
||||
@Schema(description = "施用范围")
|
||||
private String applicationScope;
|
||||
|
||||
@Schema(description = "用量")
|
||||
private BigDecimal dosage;
|
||||
|
||||
@Schema(description = "用法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "17710")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "10042")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "1677")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecordinput.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 种植中心-农事基地-农事记录-投入品 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FarmingRecordInputRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16612")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事记录ID", example = "11421")
|
||||
@ExcelProperty("农事记录ID")
|
||||
private String farmRecordId;
|
||||
|
||||
@Schema(description = "投入品-父类")
|
||||
@ExcelProperty("投入品-父类")
|
||||
private String inputParentCategory;
|
||||
|
||||
@Schema(description = "投入品-子类")
|
||||
@ExcelProperty("投入品-子类")
|
||||
private String inputChildCategory;
|
||||
|
||||
@Schema(description = "稀释倍液 (如为: 药物时需展示输入框)")
|
||||
@ExcelProperty("稀释倍液 (如为: 药物时需展示输入框)")
|
||||
private String dilutionRatio;
|
||||
|
||||
@Schema(description = "单用用量 (如为: 肥料选项时)")
|
||||
@ExcelProperty("单用用量 (如为: 肥料选项时)")
|
||||
private String singleUseOption;
|
||||
|
||||
@Schema(description = "单用用量-值")
|
||||
@ExcelProperty("单用用量-值")
|
||||
private BigDecimal singleUseValue;
|
||||
|
||||
@Schema(description = "单用用量-单位")
|
||||
@ExcelProperty("单用用量-单位")
|
||||
private String singleUseUnit;
|
||||
|
||||
@Schema(description = "施用范围")
|
||||
@ExcelProperty("施用范围")
|
||||
private String applicationScope;
|
||||
|
||||
@Schema(description = "用量")
|
||||
@ExcelProperty("用量")
|
||||
private BigDecimal dosage;
|
||||
|
||||
@Schema(description = "用法")
|
||||
@ExcelProperty("用法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
@ExcelProperty("逻辑删除标识符")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "17710")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "10042")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "1677")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingrecordinput.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 种植中心-农事基地-农事记录-投入品新增/修改 Request VO")
|
||||
@Data
|
||||
public class FarmingRecordInputSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16612")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事记录ID", example = "11421")
|
||||
private String farmRecordId;
|
||||
|
||||
@Schema(description = "投入品-父类")
|
||||
private String inputParentCategory;
|
||||
|
||||
@Schema(description = "投入品-子类")
|
||||
private String inputChildCategory;
|
||||
|
||||
@Schema(description = "稀释倍液 (如为: 药物时需展示输入框)")
|
||||
private String dilutionRatio;
|
||||
|
||||
@Schema(description = "单用用量 (如为: 肥料选项时)")
|
||||
private String singleUseOption;
|
||||
|
||||
@Schema(description = "单用用量-值")
|
||||
private BigDecimal singleUseValue;
|
||||
|
||||
@Schema(description = "单用用量-单位")
|
||||
private String singleUseUnit;
|
||||
|
||||
@Schema(description = "施用范围")
|
||||
private String applicationScope;
|
||||
|
||||
@Schema(description = "用量")
|
||||
private BigDecimal dosage;
|
||||
|
||||
@Schema(description = "用法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "逻辑删除标识符", example = "1")
|
||||
private Boolean delStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "17710")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "10042")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "1677")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.farmingtypemaintenance.FarmingTypeMaintenanceDO;
|
||||
import cn.iocoder.yudao.module.farm.service.farmingtypemaintenance.FarmingTypeMaintenanceService;
|
||||
|
||||
@Tag(name = "管理后台 - 农事类型维护")
|
||||
@RestController
|
||||
@RequestMapping("/farm/ing-type-maintenance")
|
||||
@Validated
|
||||
public class FarmingTypeMaintenanceController {
|
||||
|
||||
@Resource
|
||||
private FarmingTypeMaintenanceService ingTypeMaintenanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建农事类型维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-type-maintenance:create')")
|
||||
public CommonResult<String> createingTypeMaintenance(@Valid @RequestBody FarmingTypeMaintenanceSaveReqVO createReqVO) {
|
||||
return success(ingTypeMaintenanceService.createingTypeMaintenance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新农事类型维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-type-maintenance:update')")
|
||||
public CommonResult<Boolean> updateingTypeMaintenance(@Valid @RequestBody FarmingTypeMaintenanceSaveReqVO updateReqVO) {
|
||||
ingTypeMaintenanceService.updateingTypeMaintenance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除农事类型维护")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-type-maintenance:delete')")
|
||||
public CommonResult<Boolean> deleteingTypeMaintenance(@RequestParam("id") String id) {
|
||||
ingTypeMaintenanceService.deleteingTypeMaintenance(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除农事类型维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-type-maintenance:delete')")
|
||||
public CommonResult<Boolean> deleteingTypeMaintenanceList(@RequestParam("ids") List<String> ids) {
|
||||
ingTypeMaintenanceService.deleteingTypeMaintenanceListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得农事类型维护")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-type-maintenance:query')")
|
||||
public CommonResult<FarmingTypeMaintenanceRespVO> getingTypeMaintenance(@RequestParam("id") String id) {
|
||||
FarmingTypeMaintenanceDO ingTypeMaintenance = ingTypeMaintenanceService.getingTypeMaintenance(id);
|
||||
return success(BeanUtils.toBean(ingTypeMaintenance, FarmingTypeMaintenanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得农事类型维护分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-type-maintenance:query')")
|
||||
public CommonResult<PageResult<FarmingTypeMaintenanceRespVO>> getingTypeMaintenancePage(@Valid FarmingTypeMaintenancePageReqVO pageReqVO) {
|
||||
PageResult<FarmingTypeMaintenanceDO> pageResult = ingTypeMaintenanceService.getingTypeMaintenancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FarmingTypeMaintenanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出农事类型维护 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:ing-type-maintenance:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportingTypeMaintenanceExcel(@Valid FarmingTypeMaintenancePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FarmingTypeMaintenanceDO> list = ingTypeMaintenanceService.getingTypeMaintenancePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "农事类型维护.xls", "数据", FarmingTypeMaintenanceRespVO.class,
|
||||
BeanUtils.toBean(list, FarmingTypeMaintenanceRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 农事类型维护分页 Request VO")
|
||||
@Data
|
||||
public class FarmingTypeMaintenancePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "农事类型", example = "1")
|
||||
private String farmingType;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "29265")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "28838")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "6207")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 农事类型维护 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FarmingTypeMaintenanceRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29520")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事类型", example = "1")
|
||||
@ExcelProperty("农事类型")
|
||||
private String farmingType;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
@ExcelProperty("0=启用,1=停用")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "29265")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "28838")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "6207")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.farmingtypemaintenance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 农事类型维护新增/修改 Request VO")
|
||||
@Data
|
||||
public class FarmingTypeMaintenanceSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29520")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事类型", example = "1")
|
||||
private String farmingType;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "29265")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "28838")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "6207")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.fertilizerindex;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.fertilizerindex.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.fertilizerindex.FertilizerIndexDO;
|
||||
import cn.iocoder.yudao.module.farm.service.fertilizerindex.FertilizerIndexService;
|
||||
|
||||
@Tag(name = "管理后台 - 化肥指标")
|
||||
@RestController
|
||||
@RequestMapping("/farm/fertilizer-index")
|
||||
@Validated
|
||||
public class FertilizerIndexController {
|
||||
|
||||
@Resource
|
||||
private FertilizerIndexService fertilizerIndexService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建化肥指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:fertilizer-index:create')")
|
||||
public CommonResult<String> createFertilizerIndex(@Valid @RequestBody FertilizerIndexSaveReqVO createReqVO) {
|
||||
return success(fertilizerIndexService.createFertilizerIndex(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新化肥指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:fertilizer-index:update')")
|
||||
public CommonResult<Boolean> updateFertilizerIndex(@Valid @RequestBody FertilizerIndexSaveReqVO updateReqVO) {
|
||||
fertilizerIndexService.updateFertilizerIndex(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除化肥指标")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:fertilizer-index:delete')")
|
||||
public CommonResult<Boolean> deleteFertilizerIndex(@RequestParam("id") String id) {
|
||||
fertilizerIndexService.deleteFertilizerIndex(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除化肥指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:fertilizer-index:delete')")
|
||||
public CommonResult<Boolean> deleteFertilizerIndexList(@RequestParam("ids") List<String> ids) {
|
||||
fertilizerIndexService.deleteFertilizerIndexListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得化肥指标")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:fertilizer-index:query')")
|
||||
public CommonResult<FertilizerIndexRespVO> getFertilizerIndex(@RequestParam("id") String id) {
|
||||
FertilizerIndexDO fertilizerIndex = fertilizerIndexService.getFertilizerIndex(id);
|
||||
return success(BeanUtils.toBean(fertilizerIndex, FertilizerIndexRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得化肥指标分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:fertilizer-index:query')")
|
||||
public CommonResult<PageResult<FertilizerIndexRespVO>> getFertilizerIndexPage(@Valid FertilizerIndexPageReqVO pageReqVO) {
|
||||
PageResult<FertilizerIndexDO> pageResult = fertilizerIndexService.getFertilizerIndexPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FertilizerIndexRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出化肥指标 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:fertilizer-index:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportFertilizerIndexExcel(@Valid FertilizerIndexPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FertilizerIndexDO> list = fertilizerIndexService.getFertilizerIndexPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "化肥指标.xls", "数据", FertilizerIndexRespVO.class,
|
||||
BeanUtils.toBean(list, FertilizerIndexRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.fertilizerindex.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 化肥指标分页 Request VO")
|
||||
@Data
|
||||
public class FertilizerIndexPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基础id", example = "26503")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "项目名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "国家标准")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "检验结果")
|
||||
private String checkResults;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "19443")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "25475")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8699")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.fertilizerindex.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 化肥指标 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FertilizerIndexRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27638")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基础id", example = "26503")
|
||||
@ExcelProperty("基础id")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "项目名称", example = "张三")
|
||||
@ExcelProperty("项目名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "国家标准")
|
||||
@ExcelProperty("国家标准")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "检验结果")
|
||||
@ExcelProperty("检验结果")
|
||||
private String checkResults;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "19443")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "25475")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8699")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.fertilizerindex.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 化肥指标新增/修改 Request VO")
|
||||
@Data
|
||||
public class FertilizerIndexSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27638")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基础id", example = "26503")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "项目名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "国家标准")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "检验结果")
|
||||
private String checkResults;
|
||||
|
||||
@Schema(description = "基地id", example = "19443")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "25475")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8699")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.foundationinfo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.foundationinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.foundationinfo.FoundationInfoDO;
|
||||
import cn.iocoder.yudao.module.farm.service.foundationinfo.FoundationInfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 基础信息")
|
||||
@RestController
|
||||
@RequestMapping("/farm/foundation-info")
|
||||
@Validated
|
||||
public class FoundationInfoController {
|
||||
|
||||
@Resource
|
||||
private FoundationInfoService foundationInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建基础信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:foundation-info:create')")
|
||||
public CommonResult<String> createFoundationInfo(@Valid @RequestBody FoundationInfoSaveReqVO createReqVO) {
|
||||
return success(foundationInfoService.createFoundationInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新基础信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:foundation-info:update')")
|
||||
public CommonResult<Boolean> updateFoundationInfo(@Valid @RequestBody FoundationInfoSaveReqVO updateReqVO) {
|
||||
foundationInfoService.updateFoundationInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除基础信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:foundation-info:delete')")
|
||||
public CommonResult<Boolean> deleteFoundationInfo(@RequestParam("id") String id) {
|
||||
foundationInfoService.deleteFoundationInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除基础信息")
|
||||
@PreAuthorize("@ss.hasPermission('farm:foundation-info:delete')")
|
||||
public CommonResult<Boolean> deleteFoundationInfoList(@RequestParam("ids") List<String> ids) {
|
||||
foundationInfoService.deleteFoundationInfoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得基础信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:foundation-info:query')")
|
||||
public CommonResult<FoundationInfoRespVO> getFoundationInfo(@RequestParam("id") String id) {
|
||||
FoundationInfoDO foundationInfo = foundationInfoService.getFoundationInfo(id);
|
||||
return success(BeanUtils.toBean(foundationInfo, FoundationInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得基础信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:foundation-info:query')")
|
||||
public CommonResult<PageResult<FoundationInfoRespVO>> getFoundationInfoPage(@Valid FoundationInfoPageReqVO pageReqVO) {
|
||||
PageResult<FoundationInfoDO> pageResult = foundationInfoService.getFoundationInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FoundationInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出基础信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:foundation-info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportFoundationInfoExcel(@Valid FoundationInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<FoundationInfoDO> list = foundationInfoService.getFoundationInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "基础信息.xls", "数据", FoundationInfoRespVO.class,
|
||||
BeanUtils.toBean(list, FoundationInfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.foundationinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 基础信息分页 Request VO")
|
||||
@Data
|
||||
public class FoundationInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "农场名称", example = "芋艿")
|
||||
private String farmName;
|
||||
|
||||
@Schema(description = "农场Logo")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "农场介绍", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "企业人员总数", example = "1057")
|
||||
private Integer employeeCount;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "21166")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "27402")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "12964")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.foundationinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 基础信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class FoundationInfoRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22602")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "标题")
|
||||
@ExcelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "农场名称", example = "芋艿")
|
||||
@ExcelProperty("农场名称")
|
||||
private String farmName;
|
||||
|
||||
@Schema(description = "农场Logo")
|
||||
@ExcelProperty("农场Logo")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "农场介绍", example = "你猜")
|
||||
@ExcelProperty("农场介绍")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "企业人员总数", example = "1057")
|
||||
@ExcelProperty("企业人员总数")
|
||||
private Integer employeeCount;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "21166")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "27402")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "12964")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.foundationinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 基础信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class FoundationInfoSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22602")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "农场名称", example = "芋艿")
|
||||
private String farmName;
|
||||
|
||||
@Schema(description = "农场Logo")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "农场介绍", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "企业人员总数", example = "1057")
|
||||
private Integer employeeCount;
|
||||
|
||||
@Schema(description = "基地id", example = "21166")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "27402")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "12964")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.inputlibrary;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.inputlibrary.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.inputlibrary.InputLibraryDO;
|
||||
import cn.iocoder.yudao.module.farm.service.inputlibrary.InputLibraryService;
|
||||
|
||||
@Tag(name = "管理后台 - 投入品库维护")
|
||||
@RestController
|
||||
@RequestMapping("/farm/input-library")
|
||||
@Validated
|
||||
public class InputLibraryController {
|
||||
|
||||
@Resource
|
||||
private InputLibraryService inputLibraryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建投入品库维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:input-library:create')")
|
||||
public CommonResult<String> createInputLibrary(@Valid @RequestBody InputLibrarySaveReqVO createReqVO) {
|
||||
return success(inputLibraryService.createInputLibrary(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新投入品库维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:input-library:update')")
|
||||
public CommonResult<Boolean> updateInputLibrary(@Valid @RequestBody InputLibrarySaveReqVO updateReqVO) {
|
||||
inputLibraryService.updateInputLibrary(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除投入品库维护")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:input-library:delete')")
|
||||
public CommonResult<Boolean> deleteInputLibrary(@RequestParam("id") String id) {
|
||||
inputLibraryService.deleteInputLibrary(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除投入品库维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:input-library:delete')")
|
||||
public CommonResult<Boolean> deleteInputLibraryList(@RequestParam("ids") List<String> ids) {
|
||||
inputLibraryService.deleteInputLibraryListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得投入品库维护")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:input-library:query')")
|
||||
public CommonResult<InputLibraryRespVO> getInputLibrary(@RequestParam("id") String id) {
|
||||
InputLibraryDO inputLibrary = inputLibraryService.getInputLibrary(id);
|
||||
return success(BeanUtils.toBean(inputLibrary, InputLibraryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得投入品库维护分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:input-library:query')")
|
||||
public CommonResult<PageResult<InputLibraryRespVO>> getInputLibraryPage(@Valid InputLibraryPageReqVO pageReqVO) {
|
||||
PageResult<InputLibraryDO> pageResult = inputLibraryService.getInputLibraryPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, InputLibraryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出投入品库维护 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:input-library:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportInputLibraryExcel(@Valid InputLibraryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<InputLibraryDO> list = inputLibraryService.getInputLibraryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "投入品库维护.xls", "数据", InputLibraryRespVO.class,
|
||||
BeanUtils.toBean(list, InputLibraryRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.inputlibrary.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 投入品库维护分页 Request VO")
|
||||
@Data
|
||||
public class InputLibraryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "投入品类型", example = "2")
|
||||
private String assetType;
|
||||
|
||||
@Schema(description = "投入品名称", example = "王五")
|
||||
private String assetName;
|
||||
|
||||
@Schema(description = "用量")
|
||||
private BigDecimal dose;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "单件")
|
||||
private String packageUnit;
|
||||
|
||||
@Schema(description = "单价", example = "23806")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "登记证号")
|
||||
private String registration;
|
||||
|
||||
@Schema(description = "提供厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@Schema(description = "药物类型", example = "2")
|
||||
private String drugType;
|
||||
|
||||
@Schema(description = "有效成分")
|
||||
private String activePrinciple;
|
||||
|
||||
@Schema(description = "安全间隔期")
|
||||
private Integer safetyInterval;
|
||||
|
||||
@Schema(description = "稀释倍液")
|
||||
private String diluted;
|
||||
|
||||
@Schema(description = "防治对象及使用方法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "21613")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "14573")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "6773")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.inputlibrary.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 投入品库维护 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class InputLibraryRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12085")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "投入品类型", example = "2")
|
||||
@ExcelProperty("投入品类型")
|
||||
private String assetType;
|
||||
|
||||
@Schema(description = "投入品名称", example = "王五")
|
||||
@ExcelProperty("投入品名称")
|
||||
private String assetName;
|
||||
|
||||
@Schema(description = "用量")
|
||||
@ExcelProperty("用量")
|
||||
private BigDecimal dose;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "单件")
|
||||
@ExcelProperty("单件")
|
||||
private String packageUnit;
|
||||
|
||||
@Schema(description = "单价", example = "23806")
|
||||
@ExcelProperty("单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "登记证号")
|
||||
@ExcelProperty("登记证号")
|
||||
private String registration;
|
||||
|
||||
@Schema(description = "提供厂商")
|
||||
@ExcelProperty("提供厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@Schema(description = "药物类型", example = "2")
|
||||
@ExcelProperty("药物类型")
|
||||
private String drugType;
|
||||
|
||||
@Schema(description = "有效成分")
|
||||
@ExcelProperty("有效成分")
|
||||
private String activePrinciple;
|
||||
|
||||
@Schema(description = "安全间隔期")
|
||||
@ExcelProperty("安全间隔期")
|
||||
private Integer safetyInterval;
|
||||
|
||||
@Schema(description = "稀释倍液")
|
||||
@ExcelProperty("稀释倍液")
|
||||
private String diluted;
|
||||
|
||||
@Schema(description = "防治对象及使用方法")
|
||||
@ExcelProperty("防治对象及使用方法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
@ExcelProperty("0=启用,1=停用")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "21613")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "14573")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "6773")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.inputlibrary.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 投入品库维护新增/修改 Request VO")
|
||||
@Data
|
||||
public class InputLibrarySaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12085")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "投入品类型", example = "2")
|
||||
private String assetType;
|
||||
|
||||
@Schema(description = "投入品名称", example = "王五")
|
||||
private String assetName;
|
||||
|
||||
@Schema(description = "用量")
|
||||
private BigDecimal dose;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "单件")
|
||||
private String packageUnit;
|
||||
|
||||
@Schema(description = "单价", example = "23806")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "登记证号")
|
||||
private String registration;
|
||||
|
||||
@Schema(description = "提供厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@Schema(description = "药物类型", example = "2")
|
||||
private String drugType;
|
||||
|
||||
@Schema(description = "有效成分")
|
||||
private String activePrinciple;
|
||||
|
||||
@Schema(description = "安全间隔期")
|
||||
private Integer safetyInterval;
|
||||
|
||||
@Schema(description = "稀释倍液")
|
||||
private String diluted;
|
||||
|
||||
@Schema(description = "防治对象及使用方法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "21613")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "14573")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "6773")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.messagecenter;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.messagecenter.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.messagecenter.MessageCenterDO;
|
||||
import cn.iocoder.yudao.module.farm.service.messagecenter.MessageCenterService;
|
||||
|
||||
@Tag(name = "管理后台 - 消息中心")
|
||||
@RestController
|
||||
@RequestMapping("/farm/message-center")
|
||||
@Validated
|
||||
public class MessageCenterController {
|
||||
|
||||
@Resource
|
||||
private MessageCenterService messageCenterService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建消息中心")
|
||||
@PreAuthorize("@ss.hasPermission('farm:message-center:create')")
|
||||
public CommonResult<String> createMessageCenter(@Valid @RequestBody MessageCenterSaveReqVO createReqVO) {
|
||||
return success(messageCenterService.createMessageCenter(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新消息中心")
|
||||
@PreAuthorize("@ss.hasPermission('farm:message-center:update')")
|
||||
public CommonResult<Boolean> updateMessageCenter(@Valid @RequestBody MessageCenterSaveReqVO updateReqVO) {
|
||||
messageCenterService.updateMessageCenter(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除消息中心")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:message-center:delete')")
|
||||
public CommonResult<Boolean> deleteMessageCenter(@RequestParam("id") String id) {
|
||||
messageCenterService.deleteMessageCenter(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除消息中心")
|
||||
@PreAuthorize("@ss.hasPermission('farm:message-center:delete')")
|
||||
public CommonResult<Boolean> deleteMessageCenterList(@RequestParam("ids") List<String> ids) {
|
||||
messageCenterService.deleteMessageCenterListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得消息中心")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:message-center:query')")
|
||||
public CommonResult<MessageCenterRespVO> getMessageCenter(@RequestParam("id") String id) {
|
||||
MessageCenterDO messageCenter = messageCenterService.getMessageCenter(id);
|
||||
return success(BeanUtils.toBean(messageCenter, MessageCenterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得消息中心分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:message-center:query')")
|
||||
public CommonResult<PageResult<MessageCenterRespVO>> getMessageCenterPage(@Valid MessageCenterPageReqVO pageReqVO) {
|
||||
PageResult<MessageCenterDO> pageResult = messageCenterService.getMessageCenterPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MessageCenterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出消息中心 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:message-center:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMessageCenterExcel(@Valid MessageCenterPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MessageCenterDO> list = messageCenterService.getMessageCenterPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "消息中心.xls", "数据", MessageCenterRespVO.class,
|
||||
BeanUtils.toBean(list, MessageCenterRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.messagecenter.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 消息中心分页 Request VO")
|
||||
@Data
|
||||
public class MessageCenterPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "1=报警,2=预警,3=消息", example = "2")
|
||||
private Integer messageType;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "0=未读,1=已读", example = "2")
|
||||
private Integer readStatus;
|
||||
|
||||
@Schema(description = "0=未解除,1=已解除,2=无报警", example = "1")
|
||||
private Integer alarmStatus;
|
||||
|
||||
@Schema(description = "推送次数")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "已读时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] readTime;
|
||||
|
||||
@Schema(description = "基地id", example = "3475")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "7249")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.messagecenter.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 消息中心 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MessageCenterRespVO {
|
||||
|
||||
@Schema(description = "消息id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28598")
|
||||
@ExcelProperty("消息id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "1=报警,2=预警,3=消息", example = "2")
|
||||
@ExcelProperty("1=报警,2=预警,3=消息")
|
||||
private Integer messageType;
|
||||
|
||||
@Schema(description = "标题")
|
||||
@ExcelProperty("标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "内容")
|
||||
@ExcelProperty("内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "0=未读,1=已读", example = "2")
|
||||
@ExcelProperty("0=未读,1=已读")
|
||||
private Integer readStatus;
|
||||
|
||||
@Schema(description = "0=未解除,1=已解除,2=无报警", example = "1")
|
||||
@ExcelProperty("0=未解除,1=已解除,2=无报警")
|
||||
private Integer alarmStatus;
|
||||
|
||||
@Schema(description = "推送次数")
|
||||
@ExcelProperty("推送次数")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "已读时间")
|
||||
@ExcelProperty("已读时间")
|
||||
private LocalDateTime readTime;
|
||||
|
||||
@Schema(description = "基地id", example = "3475")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "7249")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.messagecenter.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 消息中心新增/修改 Request VO")
|
||||
@Data
|
||||
public class MessageCenterSaveReqVO {
|
||||
|
||||
@Schema(description = "消息id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28598")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "1=报警,2=预警,3=消息", example = "2")
|
||||
private Integer messageType;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "0=未读,1=已读", example = "2")
|
||||
private Integer readStatus;
|
||||
|
||||
@Schema(description = "0=未解除,1=已解除,2=无报警", example = "1")
|
||||
private Integer alarmStatus;
|
||||
|
||||
@Schema(description = "推送次数")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "已读时间")
|
||||
private LocalDateTime readTime;
|
||||
|
||||
@Schema(description = "基地id", example = "3475")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "7249")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelcycle;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.modelcycle.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.modelcycle.ModelCycleDO;
|
||||
import cn.iocoder.yudao.module.farm.service.modelcycle.ModelCycleService;
|
||||
|
||||
@Tag(name = "管理后台 - 模型管理-管理周期")
|
||||
@RestController
|
||||
@RequestMapping("/farm/model-cycle")
|
||||
@Validated
|
||||
public class ModelCycleController {
|
||||
|
||||
@Resource
|
||||
private ModelCycleService modelCycleService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模型管理-管理周期")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-cycle:create')")
|
||||
public CommonResult<String> createModelCycle(@Valid @RequestBody ModelCycleSaveReqVO createReqVO) {
|
||||
return success(modelCycleService.createModelCycle(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模型管理-管理周期")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-cycle:update')")
|
||||
public CommonResult<Boolean> updateModelCycle(@Valid @RequestBody ModelCycleSaveReqVO updateReqVO) {
|
||||
modelCycleService.updateModelCycle(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模型管理-管理周期")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-cycle:delete')")
|
||||
public CommonResult<Boolean> deleteModelCycle(@RequestParam("id") String id) {
|
||||
modelCycleService.deleteModelCycle(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除模型管理-管理周期")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-cycle:delete')")
|
||||
public CommonResult<Boolean> deleteModelCycleList(@RequestParam("ids") List<String> ids) {
|
||||
modelCycleService.deleteModelCycleListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模型管理-管理周期")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-cycle:query')")
|
||||
public CommonResult<ModelCycleRespVO> getModelCycle(@RequestParam("id") String id) {
|
||||
ModelCycleDO modelCycle = modelCycleService.getModelCycle(id);
|
||||
return success(BeanUtils.toBean(modelCycle, ModelCycleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模型管理-管理周期分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-cycle:query')")
|
||||
public CommonResult<PageResult<ModelCycleRespVO>> getModelCyclePage(@Valid ModelCyclePageReqVO pageReqVO) {
|
||||
PageResult<ModelCycleDO> pageResult = modelCycleService.getModelCyclePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ModelCycleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模型管理-管理周期 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-cycle:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportModelCycleExcel(@Valid ModelCyclePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ModelCycleDO> list = modelCycleService.getModelCyclePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模型管理-管理周期.xls", "数据", ModelCycleRespVO.class,
|
||||
BeanUtils.toBean(list, ModelCycleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelcycle.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-管理周期分页 Request VO")
|
||||
@Data
|
||||
public class ModelCyclePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "模型id", example = "441")
|
||||
private String modelId;
|
||||
|
||||
@Schema(description = "管理周期名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "阶段天数")
|
||||
private Integer stage;
|
||||
|
||||
@Schema(description = "物候期描述", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "阶段图片")
|
||||
private String stageImage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "3265")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "赵六")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "19671")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "338")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelcycle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-管理周期 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ModelCycleRespVO {
|
||||
|
||||
@Schema(description = "周期id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8266")
|
||||
@ExcelProperty("周期id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "模型id", example = "441")
|
||||
@ExcelProperty("模型id")
|
||||
private String modelId;
|
||||
|
||||
@Schema(description = "管理周期名称", example = "张三")
|
||||
@ExcelProperty("管理周期名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "阶段天数")
|
||||
@ExcelProperty("阶段天数")
|
||||
private Integer stage;
|
||||
|
||||
@Schema(description = "物候期描述", example = "你猜")
|
||||
@ExcelProperty("物候期描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "阶段图片")
|
||||
@ExcelProperty("阶段图片")
|
||||
private String stageImage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "3265")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "赵六")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "19671")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "338")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelcycle.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-管理周期新增/修改 Request VO")
|
||||
@Data
|
||||
public class ModelCycleSaveReqVO {
|
||||
|
||||
@Schema(description = "周期id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8266")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "模型id", example = "441")
|
||||
private String modelId;
|
||||
|
||||
@Schema(description = "管理周期名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "阶段天数")
|
||||
private Integer stage;
|
||||
|
||||
@Schema(description = "物候期描述", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "阶段图片")
|
||||
private String stageImage;
|
||||
|
||||
@Schema(description = "基地id", example = "3265")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "赵六")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "19671")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "338")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelenvironmentindex;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.modelenvironmentindex.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.modelenvironmentindex.ModelEnvironmentIndexDO;
|
||||
import cn.iocoder.yudao.module.farm.service.modelenvironmentindex.ModelEnvironmentIndexService;
|
||||
|
||||
@Tag(name = "管理后台 - 模型管理-环境指标")
|
||||
@RestController
|
||||
@RequestMapping("/farm/model-environment-index")
|
||||
@Validated
|
||||
public class ModelEnvironmentIndexController {
|
||||
|
||||
@Resource
|
||||
private ModelEnvironmentIndexService modelEnvironmentIndexService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模型管理-环境指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-environment-index:create')")
|
||||
public CommonResult<String> createModelEnvironmentIndex(@Valid @RequestBody ModelEnvironmentIndexSaveReqVO createReqVO) {
|
||||
return success(modelEnvironmentIndexService.createModelEnvironmentIndex(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模型管理-环境指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-environment-index:update')")
|
||||
public CommonResult<Boolean> updateModelEnvironmentIndex(@Valid @RequestBody ModelEnvironmentIndexSaveReqVO updateReqVO) {
|
||||
modelEnvironmentIndexService.updateModelEnvironmentIndex(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模型管理-环境指标")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-environment-index:delete')")
|
||||
public CommonResult<Boolean> deleteModelEnvironmentIndex(@RequestParam("id") String id) {
|
||||
modelEnvironmentIndexService.deleteModelEnvironmentIndex(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除模型管理-环境指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-environment-index:delete')")
|
||||
public CommonResult<Boolean> deleteModelEnvironmentIndexList(@RequestParam("ids") List<String> ids) {
|
||||
modelEnvironmentIndexService.deleteModelEnvironmentIndexListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模型管理-环境指标")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-environment-index:query')")
|
||||
public CommonResult<ModelEnvironmentIndexRespVO> getModelEnvironmentIndex(@RequestParam("id") String id) {
|
||||
ModelEnvironmentIndexDO modelEnvironmentIndex = modelEnvironmentIndexService.getModelEnvironmentIndex(id);
|
||||
return success(BeanUtils.toBean(modelEnvironmentIndex, ModelEnvironmentIndexRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模型管理-环境指标分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-environment-index:query')")
|
||||
public CommonResult<PageResult<ModelEnvironmentIndexRespVO>> getModelEnvironmentIndexPage(@Valid ModelEnvironmentIndexPageReqVO pageReqVO) {
|
||||
PageResult<ModelEnvironmentIndexDO> pageResult = modelEnvironmentIndexService.getModelEnvironmentIndexPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ModelEnvironmentIndexRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模型管理-环境指标 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-environment-index:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportModelEnvironmentIndexExcel(@Valid ModelEnvironmentIndexPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ModelEnvironmentIndexDO> list = modelEnvironmentIndexService.getModelEnvironmentIndexPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模型管理-环境指标.xls", "数据", ModelEnvironmentIndexRespVO.class,
|
||||
BeanUtils.toBean(list, ModelEnvironmentIndexRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelenvironmentindex.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-环境指标分页 Request VO")
|
||||
@Data
|
||||
public class ModelEnvironmentIndexPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "周期id", example = "26426")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "设备分类")
|
||||
private String deviceClass;
|
||||
|
||||
@Schema(description = "环境指标")
|
||||
private String indicators;
|
||||
|
||||
@Schema(description = "最低值")
|
||||
private BigDecimal minimum;
|
||||
|
||||
@Schema(description = "最高值")
|
||||
private BigDecimal maximum;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "23126")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "26021")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "20667")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelenvironmentindex.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-环境指标 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ModelEnvironmentIndexRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "704")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "26426")
|
||||
@ExcelProperty("周期id")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "设备分类")
|
||||
@ExcelProperty("设备分类")
|
||||
private String deviceClass;
|
||||
|
||||
@Schema(description = "环境指标")
|
||||
@ExcelProperty("环境指标")
|
||||
private String indicators;
|
||||
|
||||
@Schema(description = "最低值")
|
||||
@ExcelProperty("最低值")
|
||||
private BigDecimal minimum;
|
||||
|
||||
@Schema(description = "最高值")
|
||||
@ExcelProperty("最高值")
|
||||
private BigDecimal maximum;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你猜")
|
||||
@ExcelProperty("预警摘要说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "23126")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "26021")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "20667")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelenvironmentindex.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-环境指标新增/修改 Request VO")
|
||||
@Data
|
||||
public class ModelEnvironmentIndexSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "704")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "26426")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "设备分类")
|
||||
private String deviceClass;
|
||||
|
||||
@Schema(description = "环境指标")
|
||||
private String indicators;
|
||||
|
||||
@Schema(description = "最低值")
|
||||
private BigDecimal minimum;
|
||||
|
||||
@Schema(description = "最高值")
|
||||
private BigDecimal maximum;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "基地id", example = "23126")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "26021")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "20667")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperation;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperation.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.modelfarmingoperation.ModelFarmingOperationDO;
|
||||
import cn.iocoder.yudao.module.farm.service.modelfarmingoperation.ModelFarmingOperationService;
|
||||
|
||||
@Tag(name = "管理后台 - 模型管理-农事操作")
|
||||
@RestController
|
||||
@RequestMapping("/farm/model-farming-operation")
|
||||
@Validated
|
||||
public class ModelFarmingOperationController {
|
||||
|
||||
@Resource
|
||||
private ModelFarmingOperationService modelFarmingOperationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模型管理-农事操作")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation:create')")
|
||||
public CommonResult<String> createModelFarmingOperation(@Valid @RequestBody ModelFarmingOperationSaveReqVO createReqVO) {
|
||||
return success(modelFarmingOperationService.createModelFarmingOperation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模型管理-农事操作")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation:update')")
|
||||
public CommonResult<Boolean> updateModelFarmingOperation(@Valid @RequestBody ModelFarmingOperationSaveReqVO updateReqVO) {
|
||||
modelFarmingOperationService.updateModelFarmingOperation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模型管理-农事操作")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation:delete')")
|
||||
public CommonResult<Boolean> deleteModelFarmingOperation(@RequestParam("id") String id) {
|
||||
modelFarmingOperationService.deleteModelFarmingOperation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除模型管理-农事操作")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation:delete')")
|
||||
public CommonResult<Boolean> deleteModelFarmingOperationList(@RequestParam("ids") List<String> ids) {
|
||||
modelFarmingOperationService.deleteModelFarmingOperationListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模型管理-农事操作")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation:query')")
|
||||
public CommonResult<ModelFarmingOperationRespVO> getModelFarmingOperation(@RequestParam("id") String id) {
|
||||
ModelFarmingOperationDO modelFarmingOperation = modelFarmingOperationService.getModelFarmingOperation(id);
|
||||
return success(BeanUtils.toBean(modelFarmingOperation, ModelFarmingOperationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模型管理-农事操作分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation:query')")
|
||||
public CommonResult<PageResult<ModelFarmingOperationRespVO>> getModelFarmingOperationPage(@Valid ModelFarmingOperationPageReqVO pageReqVO) {
|
||||
PageResult<ModelFarmingOperationDO> pageResult = modelFarmingOperationService.getModelFarmingOperationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ModelFarmingOperationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模型管理-农事操作 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportModelFarmingOperationExcel(@Valid ModelFarmingOperationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ModelFarmingOperationDO> list = modelFarmingOperationService.getModelFarmingOperationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模型管理-农事操作.xls", "数据", ModelFarmingOperationRespVO.class,
|
||||
BeanUtils.toBean(list, ModelFarmingOperationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperation.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-农事操作分页 Request VO")
|
||||
@Data
|
||||
public class ModelFarmingOperationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "周期id", example = "2363")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "农事名称id", example = "赵六")
|
||||
private String farmingName;
|
||||
|
||||
@Schema(description = "操作开始时期(天)")
|
||||
private Integer startingPeriod;
|
||||
|
||||
@Schema(description = "用时(天)")
|
||||
private Integer used;
|
||||
|
||||
@Schema(description = "人工数(人)")
|
||||
private Integer workersNumber;
|
||||
|
||||
@Schema(description = "操作方式说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "操作示意图")
|
||||
private String sketch;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "20985")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "13119")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "芋艿")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "31485")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-农事操作 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ModelFarmingOperationRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2386")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "2363")
|
||||
@ExcelProperty("周期id")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "农事名称id", example = "赵六")
|
||||
@ExcelProperty("农事名称id")
|
||||
private String farmingName;
|
||||
|
||||
@Schema(description = "操作开始时期(天)")
|
||||
@ExcelProperty("操作开始时期(天)")
|
||||
private Integer startingPeriod;
|
||||
|
||||
@Schema(description = "用时(天)")
|
||||
@ExcelProperty("用时(天)")
|
||||
private Integer used;
|
||||
|
||||
@Schema(description = "人工数(人)")
|
||||
@ExcelProperty("人工数(人)")
|
||||
private Integer workersNumber;
|
||||
|
||||
@Schema(description = "操作方式说明", example = "你猜")
|
||||
@ExcelProperty("操作方式说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "操作示意图")
|
||||
@ExcelProperty("操作示意图")
|
||||
private String sketch;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "20985")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "13119")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "芋艿")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "31485")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-农事操作新增/修改 Request VO")
|
||||
@Data
|
||||
public class ModelFarmingOperationSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2386")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "2363")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "农事名称id", example = "赵六")
|
||||
private String farmingName;
|
||||
|
||||
@Schema(description = "操作开始时期(天)")
|
||||
private Integer startingPeriod;
|
||||
|
||||
@Schema(description = "用时(天)")
|
||||
private Integer used;
|
||||
|
||||
@Schema(description = "人工数(人)")
|
||||
private Integer workersNumber;
|
||||
|
||||
@Schema(description = "操作方式说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "操作示意图")
|
||||
private String sketch;
|
||||
|
||||
@Schema(description = "基地id", example = "20985")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "13119")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "芋艿")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "31485")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperationinput;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperationinput.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.modelfarmingoperationinput.ModelFarmingOperationInputDO;
|
||||
import cn.iocoder.yudao.module.farm.service.modelfarmingoperationinput.ModelFarmingOperationInputService;
|
||||
|
||||
@Tag(name = "管理后台 - 模型管理-农事操作-已选择投入品列")
|
||||
@RestController
|
||||
@RequestMapping("/farm/model-farming-operation-input")
|
||||
@Validated
|
||||
public class ModelFarmingOperationInputController {
|
||||
|
||||
@Resource
|
||||
private ModelFarmingOperationInputService modelFarmingOperationInputService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模型管理-农事操作-已选择投入品列")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation-input:create')")
|
||||
public CommonResult<String> createModelFarmingOperationInput(@Valid @RequestBody ModelFarmingOperationInputSaveReqVO createReqVO) {
|
||||
return success(modelFarmingOperationInputService.createModelFarmingOperationInput(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模型管理-农事操作-已选择投入品列")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation-input:update')")
|
||||
public CommonResult<Boolean> updateModelFarmingOperationInput(@Valid @RequestBody ModelFarmingOperationInputSaveReqVO updateReqVO) {
|
||||
modelFarmingOperationInputService.updateModelFarmingOperationInput(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模型管理-农事操作-已选择投入品列")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation-input:delete')")
|
||||
public CommonResult<Boolean> deleteModelFarmingOperationInput(@RequestParam("id") String id) {
|
||||
modelFarmingOperationInputService.deleteModelFarmingOperationInput(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除模型管理-农事操作-已选择投入品列")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation-input:delete')")
|
||||
public CommonResult<Boolean> deleteModelFarmingOperationInputList(@RequestParam("ids") List<String> ids) {
|
||||
modelFarmingOperationInputService.deleteModelFarmingOperationInputListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模型管理-农事操作-已选择投入品列")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation-input:query')")
|
||||
public CommonResult<ModelFarmingOperationInputRespVO> getModelFarmingOperationInput(@RequestParam("id") String id) {
|
||||
ModelFarmingOperationInputDO modelFarmingOperationInput = modelFarmingOperationInputService.getModelFarmingOperationInput(id);
|
||||
return success(BeanUtils.toBean(modelFarmingOperationInput, ModelFarmingOperationInputRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模型管理-农事操作-已选择投入品列分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation-input:query')")
|
||||
public CommonResult<PageResult<ModelFarmingOperationInputRespVO>> getModelFarmingOperationInputPage(@Valid ModelFarmingOperationInputPageReqVO pageReqVO) {
|
||||
PageResult<ModelFarmingOperationInputDO> pageResult = modelFarmingOperationInputService.getModelFarmingOperationInputPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ModelFarmingOperationInputRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模型管理-农事操作-已选择投入品列 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-farming-operation-input:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportModelFarmingOperationInputExcel(@Valid ModelFarmingOperationInputPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ModelFarmingOperationInputDO> list = modelFarmingOperationInputService.getModelFarmingOperationInputPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模型管理-农事操作-已选择投入品列.xls", "数据", ModelFarmingOperationInputRespVO.class,
|
||||
BeanUtils.toBean(list, ModelFarmingOperationInputRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperationinput.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-农事操作-已选择投入品列分页 Request VO")
|
||||
@Data
|
||||
public class ModelFarmingOperationInputPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "农事id", example = "26361")
|
||||
private String farmingId;
|
||||
|
||||
@Schema(description = "投入品id", example = "5852")
|
||||
private String inputsId;
|
||||
|
||||
@Schema(description = "用量")
|
||||
private BigDecimal dose;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "稀释倍液")
|
||||
private String diluted;
|
||||
|
||||
@Schema(description = "用法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "21363")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "26067")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "3440")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperationinput.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-农事操作-已选择投入品列 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ModelFarmingOperationInputRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13911")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事id", example = "26361")
|
||||
@ExcelProperty("农事id")
|
||||
private String farmingId;
|
||||
|
||||
@Schema(description = "投入品id", example = "5852")
|
||||
@ExcelProperty("投入品id")
|
||||
private String inputsId;
|
||||
|
||||
@Schema(description = "用量")
|
||||
@ExcelProperty("用量")
|
||||
private BigDecimal dose;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "稀释倍液")
|
||||
@ExcelProperty("稀释倍液")
|
||||
private String diluted;
|
||||
|
||||
@Schema(description = "用法")
|
||||
@ExcelProperty("用法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "21363")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "26067")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "3440")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelfarmingoperationinput.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-农事操作-已选择投入品列新增/修改 Request VO")
|
||||
@Data
|
||||
public class ModelFarmingOperationInputSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13911")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "农事id", example = "26361")
|
||||
private String farmingId;
|
||||
|
||||
@Schema(description = "投入品id", example = "5852")
|
||||
private String inputsId;
|
||||
|
||||
@Schema(description = "用量")
|
||||
private BigDecimal dose;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "稀释倍液")
|
||||
private String diluted;
|
||||
|
||||
@Schema(description = "用法")
|
||||
private String usage;
|
||||
|
||||
@Schema(description = "基地id", example = "21363")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "26067")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "张三")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "3440")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelpestdiseaseweed;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.modelpestdiseaseweed.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.modelpestdiseaseweed.ModelPestDiseaseWeedDO;
|
||||
import cn.iocoder.yudao.module.farm.service.modelpestdiseaseweed.ModelPestDiseaseWeedService;
|
||||
|
||||
@Tag(name = "管理后台 - 模型管理-病虫草害")
|
||||
@RestController
|
||||
@RequestMapping("/farm/model-pest-disease-weed")
|
||||
@Validated
|
||||
public class ModelPestDiseaseWeedController {
|
||||
|
||||
@Resource
|
||||
private ModelPestDiseaseWeedService modelPestDiseaseWeedService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模型管理-病虫草害")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-pest-disease-weed:create')")
|
||||
public CommonResult<String> createModelPestDiseaseWeed(@Valid @RequestBody ModelPestDiseaseWeedSaveReqVO createReqVO) {
|
||||
return success(modelPestDiseaseWeedService.createModelPestDiseaseWeed(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模型管理-病虫草害")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-pest-disease-weed:update')")
|
||||
public CommonResult<Boolean> updateModelPestDiseaseWeed(@Valid @RequestBody ModelPestDiseaseWeedSaveReqVO updateReqVO) {
|
||||
modelPestDiseaseWeedService.updateModelPestDiseaseWeed(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模型管理-病虫草害")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-pest-disease-weed:delete')")
|
||||
public CommonResult<Boolean> deleteModelPestDiseaseWeed(@RequestParam("id") String id) {
|
||||
modelPestDiseaseWeedService.deleteModelPestDiseaseWeed(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除模型管理-病虫草害")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-pest-disease-weed:delete')")
|
||||
public CommonResult<Boolean> deleteModelPestDiseaseWeedList(@RequestParam("ids") List<String> ids) {
|
||||
modelPestDiseaseWeedService.deleteModelPestDiseaseWeedListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模型管理-病虫草害")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-pest-disease-weed:query')")
|
||||
public CommonResult<ModelPestDiseaseWeedRespVO> getModelPestDiseaseWeed(@RequestParam("id") String id) {
|
||||
ModelPestDiseaseWeedDO modelPestDiseaseWeed = modelPestDiseaseWeedService.getModelPestDiseaseWeed(id);
|
||||
return success(BeanUtils.toBean(modelPestDiseaseWeed, ModelPestDiseaseWeedRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模型管理-病虫草害分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-pest-disease-weed:query')")
|
||||
public CommonResult<PageResult<ModelPestDiseaseWeedRespVO>> getModelPestDiseaseWeedPage(@Valid ModelPestDiseaseWeedPageReqVO pageReqVO) {
|
||||
PageResult<ModelPestDiseaseWeedDO> pageResult = modelPestDiseaseWeedService.getModelPestDiseaseWeedPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ModelPestDiseaseWeedRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模型管理-病虫草害 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-pest-disease-weed:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportModelPestDiseaseWeedExcel(@Valid ModelPestDiseaseWeedPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ModelPestDiseaseWeedDO> list = modelPestDiseaseWeedService.getModelPestDiseaseWeedPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模型管理-病虫草害.xls", "数据", ModelPestDiseaseWeedRespVO.class,
|
||||
BeanUtils.toBean(list, ModelPestDiseaseWeedRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelpestdiseaseweed.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-病虫草害分页 Request VO")
|
||||
@Data
|
||||
public class ModelPestDiseaseWeedPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "周期id", example = "11935")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "病虫草害类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "病虫草害名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "病虫草害id", example = "20996")
|
||||
private String pestsId;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "22440")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "17998")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "31930")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelpestdiseaseweed.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-病虫草害 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ModelPestDiseaseWeedRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2957")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "11935")
|
||||
@ExcelProperty("周期id")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "病虫草害类型", example = "2")
|
||||
@ExcelProperty("病虫草害类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "病虫草害名称", example = "芋艿")
|
||||
@ExcelProperty("病虫草害名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "病虫草害id", example = "20996")
|
||||
@ExcelProperty("病虫草害id")
|
||||
private String pestsId;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你说的对")
|
||||
@ExcelProperty("预警摘要说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "22440")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "17998")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "31930")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelpestdiseaseweed.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-病虫草害新增/修改 Request VO")
|
||||
@Data
|
||||
public class ModelPestDiseaseWeedSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2957")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "11935")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "病虫草害类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "病虫草害名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "病虫草害id", example = "20996")
|
||||
private String pestsId;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "基地id", example = "22440")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "张三")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "17998")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "赵六")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "31930")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.modelweatherdisaster.ModelWeatherDisasterDO;
|
||||
import cn.iocoder.yudao.module.farm.service.modelweatherdisaster.ModelWeatherDisasterService;
|
||||
|
||||
@Tag(name = "管理后台 - 模型管理-气象灾害")
|
||||
@RestController
|
||||
@RequestMapping("/farm/model-weather-disaster")
|
||||
@Validated
|
||||
public class ModelWeatherDisasterController {
|
||||
|
||||
@Resource
|
||||
private ModelWeatherDisasterService modelWeatherDisasterService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模型管理-气象灾害")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-weather-disaster:create')")
|
||||
public CommonResult<String> createModelWeatherDisaster(@Valid @RequestBody ModelWeatherDisasterSaveReqVO createReqVO) {
|
||||
return success(modelWeatherDisasterService.createModelWeatherDisaster(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模型管理-气象灾害")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-weather-disaster:update')")
|
||||
public CommonResult<Boolean> updateModelWeatherDisaster(@Valid @RequestBody ModelWeatherDisasterSaveReqVO updateReqVO) {
|
||||
modelWeatherDisasterService.updateModelWeatherDisaster(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模型管理-气象灾害")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-weather-disaster:delete')")
|
||||
public CommonResult<Boolean> deleteModelWeatherDisaster(@RequestParam("id") String id) {
|
||||
modelWeatherDisasterService.deleteModelWeatherDisaster(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除模型管理-气象灾害")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-weather-disaster:delete')")
|
||||
public CommonResult<Boolean> deleteModelWeatherDisasterList(@RequestParam("ids") List<String> ids) {
|
||||
modelWeatherDisasterService.deleteModelWeatherDisasterListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模型管理-气象灾害")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-weather-disaster:query')")
|
||||
public CommonResult<ModelWeatherDisasterRespVO> getModelWeatherDisaster(@RequestParam("id") String id) {
|
||||
ModelWeatherDisasterDO modelWeatherDisaster = modelWeatherDisasterService.getModelWeatherDisaster(id);
|
||||
return success(BeanUtils.toBean(modelWeatherDisaster, ModelWeatherDisasterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模型管理-气象灾害分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-weather-disaster:query')")
|
||||
public CommonResult<PageResult<ModelWeatherDisasterRespVO>> getModelWeatherDisasterPage(@Valid ModelWeatherDisasterPageReqVO pageReqVO) {
|
||||
PageResult<ModelWeatherDisasterDO> pageResult = modelWeatherDisasterService.getModelWeatherDisasterPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ModelWeatherDisasterRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模型管理-气象灾害 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:model-weather-disaster:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportModelWeatherDisasterExcel(@Valid ModelWeatherDisasterPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ModelWeatherDisasterDO> list = modelWeatherDisasterService.getModelWeatherDisasterPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模型管理-气象灾害.xls", "数据", ModelWeatherDisasterRespVO.class,
|
||||
BeanUtils.toBean(list, ModelWeatherDisasterRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-气象灾害分页 Request VO")
|
||||
@Data
|
||||
public class ModelWeatherDisasterPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "周期id", example = "26687")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "气象灾害名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "气象灾害id", example = "20911")
|
||||
private String weatherId;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "气象灾害图片")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "28186")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "29489")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "3725")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-气象灾害 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ModelWeatherDisasterRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5402")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "26687")
|
||||
@ExcelProperty("周期id")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "气象灾害名称", example = "李四")
|
||||
@ExcelProperty("气象灾害名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "气象灾害id", example = "20911")
|
||||
@ExcelProperty("气象灾害id")
|
||||
private String weatherId;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你猜")
|
||||
@ExcelProperty("预警摘要说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "气象灾害图片")
|
||||
@ExcelProperty("气象灾害图片")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "28186")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "29489")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "3725")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模型管理-气象灾害新增/修改 Request VO")
|
||||
@Data
|
||||
public class ModelWeatherDisasterSaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5402")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "周期id", example = "26687")
|
||||
private String cycleId;
|
||||
|
||||
@Schema(description = "气象灾害名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "气象灾害id", example = "20911")
|
||||
private String weatherId;
|
||||
|
||||
@Schema(description = "预警摘要说明", example = "你猜")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "气象灾害图片")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "基地id", example = "28186")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "29489")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "李四")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "3725")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.personnelmanagement;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.personnelmanagement.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.personnelmanagement.PersonnelManagementDO;
|
||||
import cn.iocoder.yudao.module.farm.service.personnelmanagement.PersonnelManagementService;
|
||||
|
||||
@Tag(name = "管理后台 - 人员管理")
|
||||
@RestController
|
||||
@RequestMapping("/farm/personnel-management")
|
||||
@Validated
|
||||
public class PersonnelManagementController {
|
||||
|
||||
@Resource
|
||||
private PersonnelManagementService personnelManagementService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建人员管理")
|
||||
@PreAuthorize("@ss.hasPermission('farm:personnel-management:create')")
|
||||
public CommonResult<String> createPersonnelManagement(@Valid @RequestBody PersonnelManagementSaveReqVO createReqVO) {
|
||||
return success(personnelManagementService.createPersonnelManagement(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新人员管理")
|
||||
@PreAuthorize("@ss.hasPermission('farm:personnel-management:update')")
|
||||
public CommonResult<Boolean> updatePersonnelManagement(@Valid @RequestBody PersonnelManagementSaveReqVO updateReqVO) {
|
||||
personnelManagementService.updatePersonnelManagement(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除人员管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:personnel-management:delete')")
|
||||
public CommonResult<Boolean> deletePersonnelManagement(@RequestParam("id") String id) {
|
||||
personnelManagementService.deletePersonnelManagement(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除人员管理")
|
||||
@PreAuthorize("@ss.hasPermission('farm:personnel-management:delete')")
|
||||
public CommonResult<Boolean> deletePersonnelManagementList(@RequestParam("ids") List<String> ids) {
|
||||
personnelManagementService.deletePersonnelManagementListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得人员管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:personnel-management:query')")
|
||||
public CommonResult<PersonnelManagementRespVO> getPersonnelManagement(@RequestParam("id") String id) {
|
||||
PersonnelManagementDO personnelManagement = personnelManagementService.getPersonnelManagement(id);
|
||||
return success(BeanUtils.toBean(personnelManagement, PersonnelManagementRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得人员管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:personnel-management:query')")
|
||||
public CommonResult<PageResult<PersonnelManagementRespVO>> getPersonnelManagementPage(@Valid PersonnelManagementPageReqVO pageReqVO) {
|
||||
PageResult<PersonnelManagementDO> pageResult = personnelManagementService.getPersonnelManagementPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PersonnelManagementRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出人员管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:personnel-management:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPersonnelManagementExcel(@Valid PersonnelManagementPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PersonnelManagementDO> list = personnelManagementService.getPersonnelManagementPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "人员管理.xls", "数据", PersonnelManagementRespVO.class,
|
||||
BeanUtils.toBean(list, PersonnelManagementRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.personnelmanagement.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 人员管理分页 Request VO")
|
||||
@Data
|
||||
public class PersonnelManagementPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户姓名", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String department;
|
||||
|
||||
@Schema(description = "电话号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "角色id用,隔开")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String picture;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer accountStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "30077")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "13706")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "24704")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.personnelmanagement.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 人员管理 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PersonnelManagementRespVO {
|
||||
|
||||
@Schema(description = "人员id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9882")
|
||||
@ExcelProperty("人员id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "用户姓名", example = "芋艿")
|
||||
@ExcelProperty("用户姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String department;
|
||||
|
||||
@Schema(description = "电话号")
|
||||
@ExcelProperty("电话号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "角色id用,隔开")
|
||||
@ExcelProperty("角色id用,隔开")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@ExcelProperty("头像")
|
||||
private String picture;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
@ExcelProperty("0=启用,1=停用")
|
||||
private Integer accountStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "30077")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "13706")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "24704")
|
||||
@ExcelProperty("租户id")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.personnelmanagement.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 人员管理新增/修改 Request VO")
|
||||
@Data
|
||||
public class PersonnelManagementSaveReqVO {
|
||||
|
||||
@Schema(description = "人员id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9882")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "用户姓名", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String department;
|
||||
|
||||
@Schema(description = "电话号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "角色id用,隔开")
|
||||
private String role;
|
||||
|
||||
@Schema(description = "头像")
|
||||
private String picture;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "2")
|
||||
private Integer accountStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "30077")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "李四")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "13706")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "24704")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pestdiseaseweedlibrary;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.pestdiseaseweedlibrary.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.pestdiseaseweedlibrary.PestDiseaseWeedLibraryDO;
|
||||
import cn.iocoder.yudao.module.farm.service.pestdiseaseweedlibrary.PestDiseaseWeedLibraryService;
|
||||
|
||||
@Tag(name = "管理后台 - 病虫草害库维护")
|
||||
@RestController
|
||||
@RequestMapping("/farm/pest-disease-weed-library")
|
||||
@Validated
|
||||
public class PestDiseaseWeedLibraryController {
|
||||
|
||||
@Resource
|
||||
private PestDiseaseWeedLibraryService pestDiseaseWeedLibraryService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建病虫草害库维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pest-disease-weed-library:create')")
|
||||
public CommonResult<String> createPestDiseaseWeedLibrary(@Valid @RequestBody PestDiseaseWeedLibrarySaveReqVO createReqVO) {
|
||||
return success(pestDiseaseWeedLibraryService.createPestDiseaseWeedLibrary(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新病虫草害库维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pest-disease-weed-library:update')")
|
||||
public CommonResult<Boolean> updatePestDiseaseWeedLibrary(@Valid @RequestBody PestDiseaseWeedLibrarySaveReqVO updateReqVO) {
|
||||
pestDiseaseWeedLibraryService.updatePestDiseaseWeedLibrary(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除病虫草害库维护")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:pest-disease-weed-library:delete')")
|
||||
public CommonResult<Boolean> deletePestDiseaseWeedLibrary(@RequestParam("id") String id) {
|
||||
pestDiseaseWeedLibraryService.deletePestDiseaseWeedLibrary(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除病虫草害库维护")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pest-disease-weed-library:delete')")
|
||||
public CommonResult<Boolean> deletePestDiseaseWeedLibraryList(@RequestParam("ids") List<String> ids) {
|
||||
pestDiseaseWeedLibraryService.deletePestDiseaseWeedLibraryListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得病虫草害库维护")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pest-disease-weed-library:query')")
|
||||
public CommonResult<PestDiseaseWeedLibraryRespVO> getPestDiseaseWeedLibrary(@RequestParam("id") String id) {
|
||||
PestDiseaseWeedLibraryDO pestDiseaseWeedLibrary = pestDiseaseWeedLibraryService.getPestDiseaseWeedLibrary(id);
|
||||
return success(BeanUtils.toBean(pestDiseaseWeedLibrary, PestDiseaseWeedLibraryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得病虫草害库维护分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pest-disease-weed-library:query')")
|
||||
public CommonResult<PageResult<PestDiseaseWeedLibraryRespVO>> getPestDiseaseWeedLibraryPage(@Valid PestDiseaseWeedLibraryPageReqVO pageReqVO) {
|
||||
PageResult<PestDiseaseWeedLibraryDO> pageResult = pestDiseaseWeedLibraryService.getPestDiseaseWeedLibraryPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PestDiseaseWeedLibraryRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出病虫草害库维护 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pest-disease-weed-library:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPestDiseaseWeedLibraryExcel(@Valid PestDiseaseWeedLibraryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PestDiseaseWeedLibraryDO> list = pestDiseaseWeedLibraryService.getPestDiseaseWeedLibraryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "病虫草害库维护.xls", "数据", PestDiseaseWeedLibraryRespVO.class,
|
||||
BeanUtils.toBean(list, PestDiseaseWeedLibraryRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pestdiseaseweedlibrary.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 病虫草害库维护分页 Request VO")
|
||||
@Data
|
||||
public class PestDiseaseWeedLibraryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "灾害类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "灾害名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "灾害描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "防治建议")
|
||||
private String propose;
|
||||
|
||||
@Schema(description = "图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "1")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "427")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "27747")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "芋艿")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "27978")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pestdiseaseweedlibrary.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 病虫草害库维护 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PestDiseaseWeedLibraryRespVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "521")
|
||||
@ExcelProperty("基础id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "灾害类型", example = "2")
|
||||
@ExcelProperty("灾害类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "灾害名称", example = "李四")
|
||||
@ExcelProperty("灾害名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "灾害描述", example = "你说的对")
|
||||
@ExcelProperty("灾害描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "防治建议")
|
||||
@ExcelProperty("防治建议")
|
||||
private String propose;
|
||||
|
||||
@Schema(description = "图片")
|
||||
@ExcelProperty("图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "1")
|
||||
@ExcelProperty("0=启用,1=停用")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "427")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "27747")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "芋艿")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pestdiseaseweedlibrary.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 病虫草害库维护新增/修改 Request VO")
|
||||
@Data
|
||||
public class PestDiseaseWeedLibrarySaveReqVO {
|
||||
|
||||
@Schema(description = "基础id", requiredMode = Schema.RequiredMode.REQUIRED, example = "521")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "灾害类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "灾害名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "灾害描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "防治建议")
|
||||
private String propose;
|
||||
|
||||
@Schema(description = "图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description = "0=启用,1=停用", example = "1")
|
||||
private Integer useStatus;
|
||||
|
||||
@Schema(description = "基地id", example = "427")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "王五")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "27747")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "芋艿")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "27978")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pesticideresidueindex;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.pesticideresidueindex.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.pesticideresidueindex.PesticideResidueIndexDO;
|
||||
import cn.iocoder.yudao.module.farm.service.pesticideresidueindex.PesticideResidueIndexService;
|
||||
|
||||
@Tag(name = "管理后台 - 农残指标")
|
||||
@RestController
|
||||
@RequestMapping("/farm/pesticide-residue-index")
|
||||
@Validated
|
||||
public class PesticideResidueIndexController {
|
||||
|
||||
@Resource
|
||||
private PesticideResidueIndexService pesticideResidueIndexService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建农残指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pesticide-residue-index:create')")
|
||||
public CommonResult<String> createPesticideResidueIndex(@Valid @RequestBody PesticideResidueIndexSaveReqVO createReqVO) {
|
||||
return success(pesticideResidueIndexService.createPesticideResidueIndex(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新农残指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pesticide-residue-index:update')")
|
||||
public CommonResult<Boolean> updatePesticideResidueIndex(@Valid @RequestBody PesticideResidueIndexSaveReqVO updateReqVO) {
|
||||
pesticideResidueIndexService.updatePesticideResidueIndex(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除农残指标")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:pesticide-residue-index:delete')")
|
||||
public CommonResult<Boolean> deletePesticideResidueIndex(@RequestParam("id") String id) {
|
||||
pesticideResidueIndexService.deletePesticideResidueIndex(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除农残指标")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pesticide-residue-index:delete')")
|
||||
public CommonResult<Boolean> deletePesticideResidueIndexList(@RequestParam("ids") List<String> ids) {
|
||||
pesticideResidueIndexService.deletePesticideResidueIndexListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得农残指标")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pesticide-residue-index:query')")
|
||||
public CommonResult<PesticideResidueIndexRespVO> getPesticideResidueIndex(@RequestParam("id") String id) {
|
||||
PesticideResidueIndexDO pesticideResidueIndex = pesticideResidueIndexService.getPesticideResidueIndex(id);
|
||||
return success(BeanUtils.toBean(pesticideResidueIndex, PesticideResidueIndexRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得农残指标分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pesticide-residue-index:query')")
|
||||
public CommonResult<PageResult<PesticideResidueIndexRespVO>> getPesticideResidueIndexPage(@Valid PesticideResidueIndexPageReqVO pageReqVO) {
|
||||
PageResult<PesticideResidueIndexDO> pageResult = pesticideResidueIndexService.getPesticideResidueIndexPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PesticideResidueIndexRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出农残指标 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:pesticide-residue-index:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPesticideResidueIndexExcel(@Valid PesticideResidueIndexPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PesticideResidueIndexDO> list = pesticideResidueIndexService.getPesticideResidueIndexPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "农残指标.xls", "数据", PesticideResidueIndexRespVO.class,
|
||||
BeanUtils.toBean(list, PesticideResidueIndexRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pesticideresidueindex.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 农残指标分页 Request VO")
|
||||
@Data
|
||||
public class PesticideResidueIndexPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "基础id", example = "14095")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "项目名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "国家标准")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "检验结果")
|
||||
private String checkResults;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "25138")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "16223")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8881")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pesticideresidueindex.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 农残指标 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PesticideResidueIndexRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30168")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基础id", example = "14095")
|
||||
@ExcelProperty("基础id")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "项目名称", example = "张三")
|
||||
@ExcelProperty("项目名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "国家标准")
|
||||
@ExcelProperty("国家标准")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "检验结果")
|
||||
@ExcelProperty("检验结果")
|
||||
private String checkResults;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "基地id", example = "25138")
|
||||
@ExcelProperty("基地id")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
@ExcelProperty("基地")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "16223")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
@ExcelProperty("地块")
|
||||
private String plotName;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.pesticideresidueindex.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 农残指标新增/修改 Request VO")
|
||||
@Data
|
||||
public class PesticideResidueIndexSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30168")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "基础id", example = "14095")
|
||||
private String foundationId;
|
||||
|
||||
@Schema(description = "项目名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "国家标准")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "检验结果")
|
||||
private String checkResults;
|
||||
|
||||
@Schema(description = "基地id", example = "25138")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "基地", example = "芋艿")
|
||||
private String baseName;
|
||||
|
||||
@Schema(description = "地块ID", example = "16223")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "租户id", example = "8881")
|
||||
private String tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.plotinfo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.farm.dal.dataobject.plotinfo.PlotInfoDO;
|
||||
import cn.iocoder.yudao.module.farm.service.plotinfo.PlotInfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 地块")
|
||||
@RestController
|
||||
@RequestMapping("/farm/plot-info")
|
||||
@Validated
|
||||
public class PlotInfoController {
|
||||
|
||||
@Resource
|
||||
private PlotInfoService plotInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建地块")
|
||||
@PreAuthorize("@ss.hasPermission('farm:plot-info:create')")
|
||||
public CommonResult<String> createPlotInfo(@Valid @RequestBody PlotInfoSaveReqVO createReqVO) {
|
||||
return success(plotInfoService.createPlotInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新地块")
|
||||
@PreAuthorize("@ss.hasPermission('farm:plot-info:update')")
|
||||
public CommonResult<Boolean> updatePlotInfo(@Valid @RequestBody PlotInfoSaveReqVO updateReqVO) {
|
||||
plotInfoService.updatePlotInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除地块")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('farm:plot-info:delete')")
|
||||
public CommonResult<Boolean> deletePlotInfo(@RequestParam("id") String id) {
|
||||
plotInfoService.deletePlotInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除地块")
|
||||
@PreAuthorize("@ss.hasPermission('farm:plot-info:delete')")
|
||||
public CommonResult<Boolean> deletePlotInfoList(@RequestParam("ids") List<String> ids) {
|
||||
plotInfoService.deletePlotInfoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得地块")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('farm:plot-info:query')")
|
||||
public CommonResult<PlotInfoRespVO> getPlotInfo(@RequestParam("id") String id) {
|
||||
PlotInfoDO plotInfo = plotInfoService.getPlotInfo(id);
|
||||
return success(BeanUtils.toBean(plotInfo, PlotInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得地块分页")
|
||||
@PreAuthorize("@ss.hasPermission('farm:plot-info:query')")
|
||||
public CommonResult<PageResult<PlotInfoRespVO>> getPlotInfoPage(@Valid PlotInfoPageReqVO pageReqVO) {
|
||||
PageResult<PlotInfoDO> pageResult = plotInfoService.getPlotInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PlotInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出地块 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('farm:plot-info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPlotInfoExcel(@Valid PlotInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PlotInfoDO> list = plotInfoService.getPlotInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "地块.xls", "数据", PlotInfoRespVO.class,
|
||||
BeanUtils.toBean(list, PlotInfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 地块分页 Request VO")
|
||||
@Data
|
||||
public class PlotInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "所属基地ID", example = "1431")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "地块ID", example = "4027")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块名称", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "地块面积")
|
||||
private BigDecimal plotArea;
|
||||
|
||||
@Schema(description = "地块颜色")
|
||||
private String plotColor;
|
||||
|
||||
@Schema(description = "地块经纬度 (json字符串保存)")
|
||||
private String point;
|
||||
|
||||
@Schema(description = "技术员ID", example = "653")
|
||||
private String employeeId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 地块 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PlotInfoRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11262")
|
||||
@ExcelProperty("id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "所属基地ID", example = "1431")
|
||||
@ExcelProperty("所属基地ID")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "地块ID", example = "4027")
|
||||
@ExcelProperty("地块ID")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块名称", example = "王五")
|
||||
@ExcelProperty("地块名称")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "地块面积")
|
||||
@ExcelProperty("地块面积")
|
||||
private BigDecimal plotArea;
|
||||
|
||||
@Schema(description = "地块颜色")
|
||||
@ExcelProperty("地块颜色")
|
||||
private String plotColor;
|
||||
|
||||
@Schema(description = "地块经纬度 (json字符串保存)")
|
||||
@ExcelProperty("地块经纬度 (json字符串保存)")
|
||||
private String point;
|
||||
|
||||
@Schema(description = "技术员ID", example = "653")
|
||||
@ExcelProperty("技术员ID")
|
||||
private String employeeId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.farm.controller.admin.plotinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 地块新增/修改 Request VO")
|
||||
@Data
|
||||
public class PlotInfoSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11262")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "所属基地ID", example = "1431")
|
||||
private String baseId;
|
||||
|
||||
@Schema(description = "地块ID", example = "4027")
|
||||
private String plotId;
|
||||
|
||||
@Schema(description = "地块名称", example = "王五")
|
||||
private String plotName;
|
||||
|
||||
@Schema(description = "地块面积")
|
||||
private BigDecimal plotArea;
|
||||
|
||||
@Schema(description = "地块颜色")
|
||||
private String plotColor;
|
||||
|
||||
@Schema(description = "地块经纬度 (json字符串保存)")
|
||||
private String point;
|
||||
|
||||
@Schema(description = "技术员ID", example = "653")
|
||||
private String employeeId;
|
||||
@Schema(description = "租户id")
|
||||
private String tenantId;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user