Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -0,0 +1,102 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodeRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodeSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.traceabilitycode.TraceabilityCodeDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.traceabilitycode.TraceabilityCodeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 溯源-溯源码")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/farm/traceability-code")
|
||||||
|
@Validated
|
||||||
|
public class TraceabilityCodeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TraceabilityCodeService traceabilityCodeService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建溯源-溯源码")
|
||||||
|
public CommonResult<String> createTraceabilityCode(@Valid @RequestBody TraceabilityCodeSaveReqVO createReqVO) {
|
||||||
|
return success(traceabilityCodeService.createTraceabilityCode(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新溯源-溯源码")
|
||||||
|
public CommonResult<Boolean> updateTraceabilityCode(@Valid @RequestBody TraceabilityCodeSaveReqVO updateReqVO) {
|
||||||
|
traceabilityCodeService.updateTraceabilityCode(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除溯源-溯源码")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
public CommonResult<Boolean> deleteTraceabilityCode(@RequestParam("id") String id) {
|
||||||
|
traceabilityCodeService.deleteTraceabilityCode(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除溯源-溯源码")
|
||||||
|
public CommonResult<Boolean> deleteTraceabilityCodeList(@RequestParam("ids") List<String> ids) {
|
||||||
|
traceabilityCodeService.deleteTraceabilityCodeListByIds(ids);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得溯源-溯源码")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<TraceabilityCodeRespVO> getTraceabilityCode(@RequestParam("id") String id) {
|
||||||
|
TraceabilityCodeDO traceabilityCode = traceabilityCodeService.getTraceabilityCode(id);
|
||||||
|
return success(BeanUtils.toBean(traceabilityCode, TraceabilityCodeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得溯源-溯源码分页")
|
||||||
|
public CommonResult<PageResult<TraceabilityCodeRespVO>> getTraceabilityCodePage(@Valid TraceabilityCodePageReqVO pageReqVO) {
|
||||||
|
PageResult<TraceabilityCodeDO> pageResult = traceabilityCodeService.getTraceabilityCodePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, TraceabilityCodeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出溯源-溯源码 Excel")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTraceabilityCodeExcel(@Valid TraceabilityCodePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TraceabilityCodeDO> list = traceabilityCodeService.getTraceabilityCodePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "溯源-溯源码.xls", "数据", TraceabilityCodeRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TraceabilityCodeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/scan")
|
||||||
|
@Operation(summary = "扫码获取溯源码")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
public CommonResult<TraceabilityCodeRespVO> scanTraceabilityCode(@RequestParam("id") String id) {
|
||||||
|
TraceabilityCodeDO traceabilityCode = traceabilityCodeService.scanTraceabilityCode(id);
|
||||||
|
return success(BeanUtils.toBean(traceabilityCode, TraceabilityCodeRespVO.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.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 TraceabilityCodePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "物种分类code")
|
||||||
|
private String speciesCode;
|
||||||
|
|
||||||
|
@Schema(description = "物种分类名称", example = "李四")
|
||||||
|
private String speciesName;
|
||||||
|
|
||||||
|
@Schema(description = "基地id", example = "26184")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地", example = "赵六")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "地块ID", example = "30494")
|
||||||
|
private String plotId;
|
||||||
|
|
||||||
|
@Schema(description = "地块", example = "王五")
|
||||||
|
private String plotName;
|
||||||
|
|
||||||
|
@Schema(description = "租户id", example = "19700")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "采收时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] harvestDate;
|
||||||
|
|
||||||
|
@Schema(description = "农事记录", example = "24734")
|
||||||
|
private Long farmingInputCount;
|
||||||
|
|
||||||
|
@Schema(description = "商品id", example = "6627")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
@Schema(description = "商品名称", example = "李四")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@Schema(description = "商品规格")
|
||||||
|
private String packingSpec;
|
||||||
|
|
||||||
|
@Schema(description = "商品图片")
|
||||||
|
private String productImage;
|
||||||
|
|
||||||
|
@Schema(description = "商标名称", example = "芋艿")
|
||||||
|
private String brandName;
|
||||||
|
|
||||||
|
@Schema(description = "商品介绍")
|
||||||
|
private String introduce;
|
||||||
|
|
||||||
|
@Schema(description = "商品认证")
|
||||||
|
private String brandAuthentication;
|
||||||
|
|
||||||
|
@Schema(description = "企业id", example = "25407")
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
@Schema(description = "企业名称", example = "张三")
|
||||||
|
private String businessName;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业名称")
|
||||||
|
private Long isShowBusinessName;
|
||||||
|
|
||||||
|
@Schema(description = "联系电话")
|
||||||
|
private String businessPhone;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示联系电话")
|
||||||
|
private Long isShowBusinessPhone;
|
||||||
|
|
||||||
|
@Schema(description = "企业网店", example = "李四")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业网店")
|
||||||
|
private Long isShowStoreName;
|
||||||
|
|
||||||
|
@Schema(description = "企业地址")
|
||||||
|
private String businessAddress;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业地址")
|
||||||
|
private Long isShowBusinessAddress;
|
||||||
|
|
||||||
|
@Schema(description = "宣传图片")
|
||||||
|
private String publicityImage;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示宣传图片")
|
||||||
|
private Long isShowPublicityImage;
|
||||||
|
|
||||||
|
@Schema(description = "企业简介")
|
||||||
|
private String publicityProfile;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业简介")
|
||||||
|
private Long isShowPublicityProfile;
|
||||||
|
|
||||||
|
@Schema(description = "批次检验报告")
|
||||||
|
private String inspectionReport;
|
||||||
|
|
||||||
|
@Schema(description = "批次采收图片")
|
||||||
|
private String collectImages;
|
||||||
|
|
||||||
|
@Schema(description = "摄像头信息")
|
||||||
|
private String cameraInformation;
|
||||||
|
|
||||||
|
@Schema(description = "出码量", example = "6456")
|
||||||
|
private Long codeOutCount;
|
||||||
|
|
||||||
|
@Schema(description = "二维码")
|
||||||
|
private String qrCode;
|
||||||
|
|
||||||
|
@Schema(description = "状态 0=正常,1=废弃", example = "2")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
private String codeOutBatch;
|
||||||
|
private Long scanCodeCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.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 TraceabilityCodeRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29122")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "物种分类code")
|
||||||
|
@ExcelProperty("物种分类code")
|
||||||
|
private String speciesCode;
|
||||||
|
|
||||||
|
@Schema(description = "物种分类名称", example = "李四")
|
||||||
|
@ExcelProperty("物种分类名称")
|
||||||
|
private String speciesName;
|
||||||
|
|
||||||
|
@Schema(description = "基地id", example = "26184")
|
||||||
|
@ExcelProperty("基地id")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地", example = "赵六")
|
||||||
|
@ExcelProperty("基地")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "地块ID", example = "30494")
|
||||||
|
@ExcelProperty("地块ID")
|
||||||
|
private String plotId;
|
||||||
|
|
||||||
|
@Schema(description = "地块", example = "王五")
|
||||||
|
@ExcelProperty("地块")
|
||||||
|
private String plotName;
|
||||||
|
|
||||||
|
@Schema(description = "租户id", example = "19700")
|
||||||
|
@ExcelProperty("租户id")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "采收时间")
|
||||||
|
@ExcelProperty("采收时间")
|
||||||
|
private LocalDateTime harvestDate;
|
||||||
|
|
||||||
|
@Schema(description = "农事记录", example = "24734")
|
||||||
|
@ExcelProperty("农事记录")
|
||||||
|
private Long farmingInputCount;
|
||||||
|
|
||||||
|
@Schema(description = "商品id", example = "6627")
|
||||||
|
@ExcelProperty("商品id")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
@Schema(description = "商品名称", example = "李四")
|
||||||
|
@ExcelProperty("商品名称")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@Schema(description = "商品规格")
|
||||||
|
@ExcelProperty("商品规格")
|
||||||
|
private String packingSpec;
|
||||||
|
|
||||||
|
@Schema(description = "商品图片")
|
||||||
|
@ExcelProperty("商品图片")
|
||||||
|
private String productImage;
|
||||||
|
|
||||||
|
@Schema(description = "商标名称", example = "芋艿")
|
||||||
|
@ExcelProperty("商标名称")
|
||||||
|
private String brandName;
|
||||||
|
|
||||||
|
@Schema(description = "商品介绍")
|
||||||
|
@ExcelProperty("商品介绍")
|
||||||
|
private String introduce;
|
||||||
|
|
||||||
|
@Schema(description = "商品认证")
|
||||||
|
@ExcelProperty("商品认证")
|
||||||
|
private String brandAuthentication;
|
||||||
|
|
||||||
|
@Schema(description = "企业id", example = "25407")
|
||||||
|
@ExcelProperty("企业id")
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
@Schema(description = "企业名称", example = "张三")
|
||||||
|
@ExcelProperty("企业名称")
|
||||||
|
private String businessName;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业名称", example = "张三")
|
||||||
|
@ExcelProperty("是否显示企业名称")
|
||||||
|
private Long isShowBusinessName;
|
||||||
|
|
||||||
|
@Schema(description = "联系电话")
|
||||||
|
@ExcelProperty("联系电话")
|
||||||
|
private String businessPhone;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示联系电话")
|
||||||
|
@ExcelProperty("是否显示联系电话")
|
||||||
|
private Long isShowBusinessPhone;
|
||||||
|
|
||||||
|
@Schema(description = "企业网店", example = "李四")
|
||||||
|
@ExcelProperty("企业网店")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业网店", example = "张三")
|
||||||
|
@ExcelProperty("是否显示企业网店")
|
||||||
|
private Long isShowStoreName;
|
||||||
|
|
||||||
|
@Schema(description = "企业地址")
|
||||||
|
@ExcelProperty("企业地址")
|
||||||
|
private String businessAddress;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业地址")
|
||||||
|
@ExcelProperty("是否显示企业地址")
|
||||||
|
private Long isShowBusinessAddress;
|
||||||
|
|
||||||
|
@Schema(description = "宣传图片")
|
||||||
|
@ExcelProperty("宣传图片")
|
||||||
|
private String publicityImage;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示宣传图片")
|
||||||
|
@ExcelProperty("是否显示宣传图片")
|
||||||
|
private Long isShowPublicityImage;
|
||||||
|
|
||||||
|
@Schema(description = "企业简介")
|
||||||
|
@ExcelProperty("企业简介")
|
||||||
|
private String publicityProfile;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业简介")
|
||||||
|
@ExcelProperty("是否显示企业简介")
|
||||||
|
private Long isShowPublicityProfile;
|
||||||
|
|
||||||
|
@Schema(description = "批次检验报告")
|
||||||
|
@ExcelProperty("批次检验报告")
|
||||||
|
private String inspectionReport;
|
||||||
|
|
||||||
|
@Schema(description = "批次采收图片")
|
||||||
|
@ExcelProperty("批次采收图片")
|
||||||
|
private String collectImages;
|
||||||
|
|
||||||
|
@Schema(description = "摄像头信息")
|
||||||
|
@ExcelProperty("摄像头信息")
|
||||||
|
private String cameraInformation;
|
||||||
|
|
||||||
|
@Schema(description = "出码量", example = "6456")
|
||||||
|
@ExcelProperty("出码量")
|
||||||
|
private Long codeOutCount;
|
||||||
|
|
||||||
|
@Schema(description = "二维码")
|
||||||
|
@ExcelProperty("二维码")
|
||||||
|
private String qrCode;
|
||||||
|
|
||||||
|
@Schema(description = "状态 0=正常,1=废弃", example = "2")
|
||||||
|
@ExcelProperty("状态 0=正常,1=废弃")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
private String codeOutBatch;
|
||||||
|
private Long scanCodeCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.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 TraceabilityCodeSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "29122")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "物种分类code")
|
||||||
|
private String speciesCode;
|
||||||
|
|
||||||
|
@Schema(description = "物种分类名称", example = "李四")
|
||||||
|
private String speciesName;
|
||||||
|
|
||||||
|
@Schema(description = "基地id", example = "26184")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地", example = "赵六")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "地块ID", example = "30494")
|
||||||
|
private String plotId;
|
||||||
|
|
||||||
|
@Schema(description = "地块", example = "王五")
|
||||||
|
private String plotName;
|
||||||
|
|
||||||
|
@Schema(description = "租户id", example = "19700")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
@Schema(description = "采收时间")
|
||||||
|
private LocalDateTime harvestDate;
|
||||||
|
|
||||||
|
@Schema(description = "农事记录", example = "24734")
|
||||||
|
private Long farmingInputCount;
|
||||||
|
|
||||||
|
@Schema(description = "商品id", example = "6627")
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
@Schema(description = "商品名称", example = "李四")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@Schema(description = "商品规格")
|
||||||
|
private String packingSpec;
|
||||||
|
|
||||||
|
@Schema(description = "商品图片")
|
||||||
|
private String productImage;
|
||||||
|
|
||||||
|
@Schema(description = "商标名称", example = "芋艿")
|
||||||
|
private String brandName;
|
||||||
|
|
||||||
|
@Schema(description = "商品介绍")
|
||||||
|
private String introduce;
|
||||||
|
|
||||||
|
@Schema(description = "商品认证")
|
||||||
|
private String brandAuthentication;
|
||||||
|
|
||||||
|
@Schema(description = "企业id", example = "25407")
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
@Schema(description = "企业名称", example = "张三")
|
||||||
|
private String businessName;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业名称", example = "张三")
|
||||||
|
private Long isShowBusinessName;
|
||||||
|
|
||||||
|
@Schema(description = "联系电话")
|
||||||
|
private String businessPhone;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示联系电话")
|
||||||
|
private Long isShowBusinessPhone;
|
||||||
|
|
||||||
|
@Schema(description = "企业网店", example = "李四")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业网店", example = "张三")
|
||||||
|
private Long isShowStoreName;
|
||||||
|
|
||||||
|
@Schema(description = "企业地址")
|
||||||
|
private String businessAddress;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业地址")
|
||||||
|
private Long isShowBusinessAddress;
|
||||||
|
|
||||||
|
@Schema(description = "宣传图片")
|
||||||
|
private String publicityImage;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示宣传图片")
|
||||||
|
private Long isShowPublicityImage;
|
||||||
|
|
||||||
|
@Schema(description = "企业简介")
|
||||||
|
private String publicityProfile;
|
||||||
|
|
||||||
|
@Schema(description = "是否显示企业简介")
|
||||||
|
private Long isShowPublicityProfile;
|
||||||
|
|
||||||
|
@Schema(description = "批次检验报告")
|
||||||
|
private String inspectionReport;
|
||||||
|
|
||||||
|
@Schema(description = "批次采收图片")
|
||||||
|
private String collectImages;
|
||||||
|
|
||||||
|
@Schema(description = "摄像头信息")
|
||||||
|
private String cameraInformation;
|
||||||
|
|
||||||
|
@Schema(description = "出码量", example = "6456")
|
||||||
|
private Long codeOutCount;
|
||||||
|
|
||||||
|
@Schema(description = "二维码")
|
||||||
|
private String qrCode;
|
||||||
|
|
||||||
|
@Schema(description = "状态 0=正常,1=废弃", example = "2")
|
||||||
|
private Long status;
|
||||||
|
private String codeOutBatch;
|
||||||
|
private Long scanCodeCount;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.app.traceabilitycode;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodeRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.traceabilitycode.TraceabilityCodeDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.traceabilitycode.TraceabilityCodeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 溯源-溯源码")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app/traceability-code")
|
||||||
|
@Validated
|
||||||
|
public class TraceabilityCodeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TraceabilityCodeService traceabilityCodeService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/scan")
|
||||||
|
@Operation(summary = "扫码获取溯源")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
public CommonResult<TraceabilityCodeRespVO> scanTraceabilityCode(@RequestParam("id") String id) {
|
||||||
|
TraceabilityCodeDO traceabilityCode = traceabilityCodeService.scanTraceabilityCode(id);
|
||||||
|
return success(BeanUtils.toBean(traceabilityCode, TraceabilityCodeRespVO.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -88,4 +88,5 @@ public class ProductManagementDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String plotName;
|
private String plotName;
|
||||||
|
|
||||||
|
private String tenantId;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.dal.dataobject.traceabilitycode;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 溯源-溯源码 DO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@TableName("farm_traceability_code")
|
||||||
|
@KeySequence("farm_traceability_code_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TraceabilityCodeDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 物种分类code
|
||||||
|
*/
|
||||||
|
private String speciesCode;
|
||||||
|
/**
|
||||||
|
* 物种分类名称
|
||||||
|
*/
|
||||||
|
private String speciesName;
|
||||||
|
/**
|
||||||
|
* 基地id
|
||||||
|
*/
|
||||||
|
private String baseId;
|
||||||
|
/**
|
||||||
|
* 基地
|
||||||
|
*/
|
||||||
|
private String baseName;
|
||||||
|
/**
|
||||||
|
* 地块ID
|
||||||
|
*/
|
||||||
|
private String plotId;
|
||||||
|
/**
|
||||||
|
* 地块
|
||||||
|
*/
|
||||||
|
private String plotName;
|
||||||
|
/**
|
||||||
|
* 采收时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime harvestDate;
|
||||||
|
/**
|
||||||
|
* 农事记录
|
||||||
|
*/
|
||||||
|
private Long farmingInputCount;
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private String productId;
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String productName;
|
||||||
|
/**
|
||||||
|
* 商品规格
|
||||||
|
*/
|
||||||
|
private String packingSpec;
|
||||||
|
/**
|
||||||
|
* 商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 商标名称
|
||||||
|
*/
|
||||||
|
private String brandName;
|
||||||
|
/**
|
||||||
|
* 商品介绍
|
||||||
|
*/
|
||||||
|
private String introduce;
|
||||||
|
/**
|
||||||
|
* 商品认证
|
||||||
|
*/
|
||||||
|
private String brandAuthentication;
|
||||||
|
/**
|
||||||
|
* 企业id
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
/**
|
||||||
|
* 企业名称
|
||||||
|
*/
|
||||||
|
private String businessName;
|
||||||
|
/**
|
||||||
|
* 是否显示企业名称
|
||||||
|
*/
|
||||||
|
private Long isShowBusinessName;
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String businessPhone;
|
||||||
|
/**
|
||||||
|
* 是否显示联系电话
|
||||||
|
*/
|
||||||
|
private Long isShowBusinessPhone;
|
||||||
|
/**
|
||||||
|
* 企业网店
|
||||||
|
*/
|
||||||
|
private String storeName;
|
||||||
|
/**
|
||||||
|
* 是否显示企业网店
|
||||||
|
*/
|
||||||
|
private Long isShowStoreName;
|
||||||
|
/**
|
||||||
|
* 企业地址
|
||||||
|
*/
|
||||||
|
private String businessAddress;
|
||||||
|
/**
|
||||||
|
* 是否显示企业地址
|
||||||
|
*/
|
||||||
|
private Long isShowBusinessAddress;
|
||||||
|
/**
|
||||||
|
* 宣传图片
|
||||||
|
*/
|
||||||
|
private String publicityImage;
|
||||||
|
/**
|
||||||
|
* 是否显示宣传图片
|
||||||
|
*/
|
||||||
|
private Long isShowPublicityImage;
|
||||||
|
/**
|
||||||
|
* 企业简介
|
||||||
|
*/
|
||||||
|
private String publicityProfile;
|
||||||
|
/**
|
||||||
|
* 是否显示企业简介
|
||||||
|
*/
|
||||||
|
private Long isShowPublicityProfile;
|
||||||
|
/**
|
||||||
|
* 批次检验报告
|
||||||
|
*/
|
||||||
|
private String inspectionReport;
|
||||||
|
/**
|
||||||
|
* 批次采收图片
|
||||||
|
*/
|
||||||
|
private String collectImages;
|
||||||
|
/**
|
||||||
|
* 摄像头信息
|
||||||
|
*/
|
||||||
|
private String cameraInformation;
|
||||||
|
/**
|
||||||
|
* 出码量
|
||||||
|
*/
|
||||||
|
private Long codeOutCount;
|
||||||
|
/**
|
||||||
|
* 二维码
|
||||||
|
*/
|
||||||
|
private String qrCode;
|
||||||
|
/**
|
||||||
|
* 状态 0=正常,1=废弃
|
||||||
|
*/
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
private String codeOutBatch;
|
||||||
|
|
||||||
|
private Long scanCodeCount;
|
||||||
|
}
|
||||||
@@ -23,7 +23,7 @@ public interface BaseInfoMapper extends BaseMapperX<BaseInfoDO> {
|
|||||||
.eqIfPresent(BaseInfoDO::getPoint, reqVO.getPoint())
|
.eqIfPresent(BaseInfoDO::getPoint, reqVO.getPoint())
|
||||||
.betweenIfPresent(BaseInfoDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(BaseInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(BaseInfoDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(BaseInfoDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(BaseInfoDO::getId));
|
.orderByDesc(BaseInfoDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ public interface CompanyInfoMapper extends BaseMapperX<CompanyInfoDO> {
|
|||||||
.eqIfPresent(CompanyInfoDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(CompanyInfoDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(CompanyInfoDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(CompanyInfoDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(CompanyInfoDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(CompanyInfoDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(CompanyInfoDO::getId));
|
.orderByDesc(CompanyInfoDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public interface CultivationAreaMapper extends BaseMapperX<CultivationAreaDO> {
|
|||||||
.eqIfPresent(CultivationAreaDO::getDelStatus, reqVO.getDelStatus())
|
.eqIfPresent(CultivationAreaDO::getDelStatus, reqVO.getDelStatus())
|
||||||
.eqIfPresent(CultivationAreaDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(CultivationAreaDO::getTenantId, reqVO.getTenantId())
|
||||||
.betweenIfPresent(CultivationAreaDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(CultivationAreaDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(CultivationAreaDO::getId));
|
.orderByDesc(CultivationAreaDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ public interface DeviceInfoMapper extends BaseMapperX<DeviceInfoDO> {
|
|||||||
.eqIfPresent(DeviceInfoDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(DeviceInfoDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(DeviceInfoDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(DeviceInfoDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(DeviceInfoDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(DeviceInfoDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(DeviceInfoDO::getId));
|
.orderByDesc(DeviceInfoDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ public interface DevicePlotRelationMapper extends BaseMapperX<DevicePlotRelation
|
|||||||
.likeIfPresent(DevicePlotRelationDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(DevicePlotRelationDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(DevicePlotRelationDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(DevicePlotRelationDO::getTenantId, reqVO.getTenantId())
|
||||||
.betweenIfPresent(DevicePlotRelationDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(DevicePlotRelationDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(DevicePlotRelationDO::getId));
|
.orderByDesc(DevicePlotRelationDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ public interface DisasterDataMapper extends BaseMapperX<DisasterDataDO> {
|
|||||||
.eqIfPresent(DisasterDataDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(DisasterDataDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(DisasterDataDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(DisasterDataDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(DisasterDataDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(DisasterDataDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(DisasterDataDO::getId));
|
.orderByDesc(DisasterDataDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public interface EnvironmentIndexConfigMapper extends BaseMapperX<EnvironmentInd
|
|||||||
.eqIfPresent(EnvironmentIndexConfigDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(EnvironmentIndexConfigDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(EnvironmentIndexConfigDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(EnvironmentIndexConfigDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(EnvironmentIndexConfigDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(EnvironmentIndexConfigDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(EnvironmentIndexConfigDO::getId));
|
.orderByDesc(EnvironmentIndexConfigDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ public interface FarmingNameMaintenanceMapper extends BaseMapperX<FarmingNameMai
|
|||||||
.eqIfPresent(FarmingNameMaintenanceDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(FarmingNameMaintenanceDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(FarmingNameMaintenanceDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(FarmingNameMaintenanceDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(FarmingNameMaintenanceDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(FarmingNameMaintenanceDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(FarmingNameMaintenanceDO::getId));
|
.orderByDesc(FarmingNameMaintenanceDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ public interface FarmingRecordMapper extends BaseMapperX<FarmingRecordDO> {
|
|||||||
.likeIfPresent(FarmingRecordDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(FarmingRecordDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(FarmingRecordDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(FarmingRecordDO::getTenantId, reqVO.getTenantId())
|
||||||
.betweenIfPresent(FarmingRecordDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(FarmingRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(FarmingRecordDO::getId));
|
.orderByDesc(FarmingRecordDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ public interface FarmingRecordInputMapper extends BaseMapperX<FarmingRecordInput
|
|||||||
.likeIfPresent(FarmingRecordInputDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(FarmingRecordInputDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(FarmingRecordInputDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(FarmingRecordInputDO::getTenantId, reqVO.getTenantId())
|
||||||
.betweenIfPresent(FarmingRecordInputDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(FarmingRecordInputDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(FarmingRecordInputDO::getId));
|
.orderByDesc(FarmingRecordInputDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public interface FarmingTypeMaintenanceMapper extends BaseMapperX<FarmingTypeMai
|
|||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(FarmingTypeMaintenanceDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(FarmingTypeMaintenanceDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(FarmingTypeMaintenanceDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(FarmingTypeMaintenanceDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(FarmingTypeMaintenanceDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(FarmingTypeMaintenanceDO::getId));
|
.orderByDesc(FarmingTypeMaintenanceDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public interface FertilizerIndexMapper extends BaseMapperX<FertilizerIndexDO> {
|
|||||||
.eqIfPresent(FertilizerIndexDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(FertilizerIndexDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(FertilizerIndexDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(FertilizerIndexDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(FertilizerIndexDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(FertilizerIndexDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(FertilizerIndexDO::getId));
|
.orderByDesc(FertilizerIndexDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ public interface FoundationInfoMapper extends BaseMapperX<FoundationInfoDO> {
|
|||||||
.eqIfPresent(FoundationInfoDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(FoundationInfoDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(FoundationInfoDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(FoundationInfoDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(FoundationInfoDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(FoundationInfoDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(FoundationInfoDO::getId));
|
.orderByDesc(FoundationInfoDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ public interface InputLibraryMapper extends BaseMapperX<InputLibraryDO> {
|
|||||||
.eqIfPresent(InputLibraryDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(InputLibraryDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(InputLibraryDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(InputLibraryDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(InputLibraryDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(InputLibraryDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(InputLibraryDO::getId));
|
.orderByDesc(InputLibraryDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ public interface MessageCenterMapper extends BaseMapperX<MessageCenterDO> {
|
|||||||
.likeIfPresent(MessageCenterDO::getBaseName, reqVO.getBaseName())
|
.likeIfPresent(MessageCenterDO::getBaseName, reqVO.getBaseName())
|
||||||
.eqIfPresent(MessageCenterDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(MessageCenterDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(MessageCenterDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(MessageCenterDO::getPlotName, reqVO.getPlotName())
|
||||||
.orderByDesc(MessageCenterDO::getId));
|
.orderByDesc(MessageCenterDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ public interface ModelCycleMapper extends BaseMapperX<ModelCycleDO> {
|
|||||||
.eqIfPresent(ModelCycleDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ModelCycleDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ModelCycleDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ModelCycleDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(ModelCycleDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(ModelCycleDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(ModelCycleDO::getId));
|
.orderByDesc(ModelCycleDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ModelCycleDO> selectListByModelId(String modelId);
|
List<ModelCycleDO> selectListByModelId(String modelId);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public interface ModelEnvironmentIndexMapper extends BaseMapperX<ModelEnvironmen
|
|||||||
.eqIfPresent(ModelEnvironmentIndexDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ModelEnvironmentIndexDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ModelEnvironmentIndexDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ModelEnvironmentIndexDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(ModelEnvironmentIndexDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(ModelEnvironmentIndexDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(ModelEnvironmentIndexDO::getId));
|
.orderByDesc(ModelEnvironmentIndexDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ModelEnvironmentIndexDO> selectByCycleId(String cycleId);
|
List<ModelEnvironmentIndexDO> selectByCycleId(String cycleId);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public interface ModelFarmingOperationMapper extends BaseMapperX<ModelFarmingOpe
|
|||||||
.eqIfPresent(ModelFarmingOperationDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ModelFarmingOperationDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ModelFarmingOperationDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ModelFarmingOperationDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(ModelFarmingOperationDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(ModelFarmingOperationDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(ModelFarmingOperationDO::getId));
|
.orderByDesc(ModelFarmingOperationDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ModelFarmingOperationDO> selectByCycleId(String cycleId);
|
List<ModelFarmingOperationDO> selectByCycleId(String cycleId);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public interface ModelFarmingOperationInputMapper extends BaseMapperX<ModelFarmi
|
|||||||
.eqIfPresent(ModelFarmingOperationInputDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ModelFarmingOperationInputDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ModelFarmingOperationInputDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ModelFarmingOperationInputDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(ModelFarmingOperationInputDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(ModelFarmingOperationInputDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(ModelFarmingOperationInputDO::getId));
|
.orderByDesc(ModelFarmingOperationInputDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ModelFarmingOperationInputDO> selectByFarmingId(String farmingId);
|
List<ModelFarmingOperationInputDO> selectByFarmingId(String farmingId);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public interface ModelManagementMapper extends BaseMapperX<ModelManagementDO> {
|
|||||||
.eqIfPresent(ModelManagementDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ModelManagementDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ModelManagementDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ModelManagementDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(ModelManagementDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(ModelManagementDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(ModelManagementDO::getId)
|
.orderByDesc(ModelManagementDO::getCreateTime)
|
||||||
// 连表:物种库
|
// 连表:物种库
|
||||||
.leftJoin(SpeciesLibraryDO.class, SpeciesLibraryDO::getId, ModelManagementDO::getSpeciesId)
|
.leftJoin(SpeciesLibraryDO.class, SpeciesLibraryDO::getId, ModelManagementDO::getSpeciesId)
|
||||||
.selectAs(SpeciesLibraryDO::getCultivarName, ModelManagementDO::getSpeciesName)
|
.selectAs(SpeciesLibraryDO::getCultivarName, ModelManagementDO::getSpeciesName)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public interface ModelPestDiseaseWeedMapper extends BaseMapperX<ModelPestDisease
|
|||||||
.eqIfPresent(ModelPestDiseaseWeedDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ModelPestDiseaseWeedDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ModelPestDiseaseWeedDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ModelPestDiseaseWeedDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(ModelPestDiseaseWeedDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(ModelPestDiseaseWeedDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(ModelPestDiseaseWeedDO::getId));
|
.orderByDesc(ModelPestDiseaseWeedDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ModelPestDiseaseWeedDO> selectByCycleId(String cycleId);
|
List<ModelPestDiseaseWeedDO> selectByCycleId(String cycleId);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public interface ModelWeatherDisasterMapper extends BaseMapperX<ModelWeatherDisa
|
|||||||
.eqIfPresent(ModelWeatherDisasterDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ModelWeatherDisasterDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ModelWeatherDisasterDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ModelWeatherDisasterDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(ModelWeatherDisasterDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(ModelWeatherDisasterDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(ModelWeatherDisasterDO::getId));
|
.orderByDesc(ModelWeatherDisasterDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ModelWeatherDisasterDO> selectByCycleId(String cycleId);
|
List<ModelWeatherDisasterDO> selectByCycleId(String cycleId);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public interface PersonnelManagementMapper extends BaseMapperX<PersonnelManageme
|
|||||||
.eqIfPresent(PersonnelManagementDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(PersonnelManagementDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(PersonnelManagementDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(PersonnelManagementDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(PersonnelManagementDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(PersonnelManagementDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(PersonnelManagementDO::getId));
|
.orderByDesc(PersonnelManagementDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ public interface PestDiseaseWeedLibraryMapper extends BaseMapperX<PestDiseaseWee
|
|||||||
.eqIfPresent(PestDiseaseWeedLibraryDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(PestDiseaseWeedLibraryDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(PestDiseaseWeedLibraryDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(PestDiseaseWeedLibraryDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(PestDiseaseWeedLibraryDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(PestDiseaseWeedLibraryDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(PestDiseaseWeedLibraryDO::getId));
|
.orderByDesc(PestDiseaseWeedLibraryDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public interface PesticideResidueIndexMapper extends BaseMapperX<PesticideResidu
|
|||||||
.eqIfPresent(PesticideResidueIndexDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(PesticideResidueIndexDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(PesticideResidueIndexDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(PesticideResidueIndexDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(PesticideResidueIndexDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(PesticideResidueIndexDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(PesticideResidueIndexDO::getId));
|
.orderByDesc(PesticideResidueIndexDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public interface PlotInfoMapper extends BaseMapperX<PlotInfoDO> {
|
|||||||
.eqIfPresent(PlotInfoDO::getPoint, reqVO.getPoint())
|
.eqIfPresent(PlotInfoDO::getPoint, reqVO.getPoint())
|
||||||
.eqIfPresent(PlotInfoDO::getEmployeeId, reqVO.getEmployeeId())
|
.eqIfPresent(PlotInfoDO::getEmployeeId, reqVO.getEmployeeId())
|
||||||
.betweenIfPresent(PlotInfoDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(PlotInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(PlotInfoDO::getId));
|
.orderByDesc(PlotInfoDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ public interface ProductionPlanMapper extends BaseMapperX<ProductionPlanDO> {
|
|||||||
.eqIfPresent(ProductionPlanDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ProductionPlanDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ProductionPlanDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ProductionPlanDO::getPlotName, reqVO.getPlotName())
|
||||||
.betweenIfPresent(ProductionPlanDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(ProductionPlanDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(ProductionPlanDO::getId));
|
.orderByDesc(ProductionPlanDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ public interface ProductManagementMapper extends BaseMapperX<ProductManagementDO
|
|||||||
.likeIfPresent(ProductManagementDO::getBaseName, reqVO.getBaseName())
|
.likeIfPresent(ProductManagementDO::getBaseName, reqVO.getBaseName())
|
||||||
.eqIfPresent(ProductManagementDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(ProductManagementDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(ProductManagementDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(ProductManagementDO::getPlotName, reqVO.getPlotName())
|
||||||
.orderByDesc(ProductManagementDO::getId));
|
.orderByDesc(ProductManagementDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ public interface SpeciesLibraryMapper extends BaseMapperX<SpeciesLibraryDO> {
|
|||||||
.eqIfPresent(SpeciesLibraryDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(SpeciesLibraryDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(SpeciesLibraryDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(SpeciesLibraryDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(SpeciesLibraryDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(SpeciesLibraryDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(SpeciesLibraryDO::getId));
|
.orderByDesc(SpeciesLibraryDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.dal.mysql.traceabilitycode;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.traceabilitycode.TraceabilityCodeDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 溯源-溯源码 Mapper
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TraceabilityCodeMapper extends BaseMapperX<TraceabilityCodeDO> {
|
||||||
|
|
||||||
|
default PageResult<TraceabilityCodeDO> selectPage(TraceabilityCodePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<TraceabilityCodeDO>()
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getSpeciesCode, reqVO.getSpeciesCode())
|
||||||
|
.likeIfPresent(TraceabilityCodeDO::getSpeciesName, reqVO.getSpeciesName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getBaseId, reqVO.getBaseId())
|
||||||
|
.likeIfPresent(TraceabilityCodeDO::getBaseName, reqVO.getBaseName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getPlotId, reqVO.getPlotId())
|
||||||
|
.likeIfPresent(TraceabilityCodeDO::getPlotName, reqVO.getPlotName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getTenantId, reqVO.getTenantId())
|
||||||
|
.betweenIfPresent(TraceabilityCodeDO::getHarvestDate, reqVO.getHarvestDate())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getFarmingInputCount, reqVO.getFarmingInputCount())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getProductId, reqVO.getProductId())
|
||||||
|
.likeIfPresent(TraceabilityCodeDO::getProductName, reqVO.getProductName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getPackingSpec, reqVO.getPackingSpec())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getProductImage, reqVO.getProductImage())
|
||||||
|
.likeIfPresent(TraceabilityCodeDO::getBrandName, reqVO.getBrandName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getIntroduce, reqVO.getIntroduce())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getBrandAuthentication, reqVO.getBrandAuthentication())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getBusinessId, reqVO.getBusinessId())
|
||||||
|
.likeIfPresent(TraceabilityCodeDO::getBusinessName, reqVO.getBusinessName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getIsShowBusinessName, reqVO.getIsShowBusinessName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getBusinessPhone, reqVO.getBusinessPhone())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getIsShowBusinessPhone, reqVO.getIsShowBusinessPhone())
|
||||||
|
.likeIfPresent(TraceabilityCodeDO::getStoreName, reqVO.getStoreName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getIsShowStoreName, reqVO.getIsShowStoreName())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getBusinessAddress, reqVO.getBusinessAddress())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getIsShowBusinessAddress, reqVO.getIsShowBusinessAddress())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getPublicityImage, reqVO.getPublicityImage())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getIsShowPublicityImage, reqVO.getIsShowPublicityImage())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getPublicityProfile, reqVO.getPublicityProfile())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getIsShowPublicityProfile, reqVO.getIsShowPublicityProfile())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getInspectionReport, reqVO.getInspectionReport())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getCollectImages, reqVO.getCollectImages())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getCameraInformation, reqVO.getCameraInformation())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getCodeOutCount, reqVO.getCodeOutCount())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getQrCode, reqVO.getQrCode())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getCodeOutBatch, reqVO.getCodeOutBatch())
|
||||||
|
.eqIfPresent(TraceabilityCodeDO::getScanCodeCount, reqVO.getScanCodeCount())
|
||||||
|
.betweenIfPresent(TraceabilityCodeDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(TraceabilityCodeDO::getCreateTime));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -29,7 +29,7 @@ public interface VarietyDataMapper extends BaseMapperX<VarietyDataDO> {
|
|||||||
.eqIfPresent(VarietyDataDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(VarietyDataDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(VarietyDataDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(VarietyDataDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(VarietyDataDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(VarietyDataDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(VarietyDataDO::getId));
|
.orderByDesc(VarietyDataDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ public interface WeatherDisasterLibraryMapper extends BaseMapperX<WeatherDisaste
|
|||||||
.eqIfPresent(WeatherDisasterLibraryDO::getPlotId, reqVO.getPlotId())
|
.eqIfPresent(WeatherDisasterLibraryDO::getPlotId, reqVO.getPlotId())
|
||||||
.likeIfPresent(WeatherDisasterLibraryDO::getPlotName, reqVO.getPlotName())
|
.likeIfPresent(WeatherDisasterLibraryDO::getPlotName, reqVO.getPlotName())
|
||||||
.eqIfPresent(WeatherDisasterLibraryDO::getTenantId, reqVO.getTenantId())
|
.eqIfPresent(WeatherDisasterLibraryDO::getTenantId, reqVO.getTenantId())
|
||||||
.orderByDesc(WeatherDisasterLibraryDO::getId));
|
.orderByDesc(WeatherDisasterLibraryDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,4 +101,7 @@ public interface ErrorCodeConstants {
|
|||||||
|
|
||||||
// ========== 模型管理 1-050-030-000 ==========
|
// ========== 模型管理 1-050-030-000 ==========
|
||||||
ErrorCode MODEL_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_050_030_000, "模型不存在");
|
ErrorCode MODEL_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_050_030_000, "模型不存在");
|
||||||
|
|
||||||
|
// ========== 模型管理 1_050_031_000 ==========
|
||||||
|
ErrorCode TRACEABILITY_CODE_NOT_EXISTS = new ErrorCode(1_050_031_000, "溯源码不存在");
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.farm.service.modelweatherdisaster;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo.ModelWeatherDisasterPageReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo.ModelWeatherDisasterPageReqVO;
|
||||||
import cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo.ModelWeatherDisasterSaveReqVO;
|
import cn.iocoder.yudao.module.farm.controller.admin.modelweatherdisaster.vo.ModelWeatherDisasterSaveReqVO;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.traceabilitycode;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodeSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.traceabilitycode.TraceabilityCodeDO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 溯源-溯源码 Service 接口
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public interface TraceabilityCodeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建溯源-溯源码
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
String createTraceabilityCode(@Valid TraceabilityCodeSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新溯源-溯源码
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateTraceabilityCode(@Valid TraceabilityCodeSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除溯源-溯源码
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteTraceabilityCode(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除溯源-溯源码
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteTraceabilityCodeListByIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得溯源-溯源码
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 溯源-溯源码
|
||||||
|
*/
|
||||||
|
TraceabilityCodeDO getTraceabilityCode(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得溯源-溯源码分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 溯源-溯源码分页
|
||||||
|
*/
|
||||||
|
PageResult<TraceabilityCodeDO> getTraceabilityCodePage(TraceabilityCodePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
TraceabilityCodeDO scanTraceabilityCode(String id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.traceabilitycode;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.traceabilitycode.vo.TraceabilityCodeSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.dataobject.traceabilitycode.TraceabilityCodeDO;
|
||||||
|
import cn.iocoder.yudao.module.farm.dal.mysql.traceabilitycode.TraceabilityCodeMapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
|
import static cn.iocoder.yudao.module.farm.enums.ErrorCodeConstants.TRACEABILITY_CODE_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 溯源-溯源码 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class TraceabilityCodeServiceImpl implements TraceabilityCodeService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TraceabilityCodeMapper traceabilityCodeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createTraceabilityCode(TraceabilityCodeSaveReqVO createReqVO) {
|
||||||
|
LoginUser user = getLoginUser();
|
||||||
|
// 插入
|
||||||
|
TraceabilityCodeDO traceabilityCode = BeanUtils.toBean(createReqVO, TraceabilityCodeDO.class);
|
||||||
|
Long count = traceabilityCode.getCodeOutCount();
|
||||||
|
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
|
String dateStr = sf.format(new Date());
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
traceabilityCode.setId(IdUtil.fastUUID());
|
||||||
|
traceabilityCode.setTenantId(String.valueOf(user.getTenantId()));
|
||||||
|
traceabilityCode.setCodeOutBatch(dateStr);
|
||||||
|
traceabilityCodeMapper.insert(traceabilityCode);
|
||||||
|
}
|
||||||
|
// 返回
|
||||||
|
return traceabilityCode.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTraceabilityCode(TraceabilityCodeSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateTraceabilityCodeExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
TraceabilityCodeDO updateObj = BeanUtils.toBean(updateReqVO, TraceabilityCodeDO.class);
|
||||||
|
traceabilityCodeMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTraceabilityCode(String id) {
|
||||||
|
// 校验存在
|
||||||
|
validateTraceabilityCodeExists(id);
|
||||||
|
// 删除
|
||||||
|
traceabilityCodeMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTraceabilityCodeListByIds(List<String> ids) {
|
||||||
|
// 删除
|
||||||
|
traceabilityCodeMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void validateTraceabilityCodeExists(String id) {
|
||||||
|
if (traceabilityCodeMapper.selectById(id) == null) {
|
||||||
|
throw exception(TRACEABILITY_CODE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TraceabilityCodeDO getTraceabilityCode(String id) {
|
||||||
|
return traceabilityCodeMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<TraceabilityCodeDO> getTraceabilityCodePage(TraceabilityCodePageReqVO pageReqVO) {
|
||||||
|
return traceabilityCodeMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TraceabilityCodeDO scanTraceabilityCode(String id) {
|
||||||
|
TraceabilityCodeDO traceabilityCodeDO = traceabilityCodeMapper.selectById(id);
|
||||||
|
traceabilityCodeDO.setScanCodeCount(traceabilityCodeDO.getScanCodeCount() + 1);
|
||||||
|
traceabilityCodeMapper.updateById(traceabilityCodeDO);
|
||||||
|
return traceabilityCodeDO;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.farm.dal.mysql.traceabilitycode.TraceabilityCodeMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user