farm模块-企业图片互转,新增大屏接口
This commit is contained in:
@@ -0,0 +1,95 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BaseAreaStatRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BaseBasicInfoRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BaseCountStatRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BasePlotStatRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.PlantingDistributionPieItemVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.YieldCompareBarItemVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.YieldDistributionPieItemVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.bigscreen.BigScreenService;
|
||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏接口
|
||||||
|
*/
|
||||||
|
@Tag(name = "管理后台 - 大屏")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/farm/big-screen")
|
||||||
|
@Validated
|
||||||
|
public class BigScreenController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BigScreenService bigScreenService;
|
||||||
|
|
||||||
|
// 基地板块 —— 基础信息
|
||||||
|
@Operation(summary = "基地板块-基础信息")
|
||||||
|
@Parameter(name = "baseId", description = "基地ID", required = true)
|
||||||
|
@GetMapping("/base/basic-info")
|
||||||
|
public CommonResult<BaseBasicInfoRespVO> getBaseBasicInfo(@RequestParam("baseId") String baseId) {
|
||||||
|
return success(bigScreenService.getBaseBasicInfo(baseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 基地板块 —— 基地面积统计
|
||||||
|
@Operation(summary = "基地板块-基地面积统计")
|
||||||
|
@Parameter(name = "baseId", description = "基地ID", required = true)
|
||||||
|
@GetMapping("/base/area-stats")
|
||||||
|
public CommonResult<BaseAreaStatRespVO> getBaseAreaStats(@RequestParam("baseId") String baseId) {
|
||||||
|
return success(bigScreenService.getBaseAreaStats(baseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 基地板块 —— 基地数量统计(地块、设施等数量)
|
||||||
|
@Operation(summary = "基地板块-基地数量统计")
|
||||||
|
@Parameter(name = "baseId", description = "基地ID", required = true)
|
||||||
|
@GetMapping("/base/count-stats")
|
||||||
|
public CommonResult<BaseCountStatRespVO> getBaseCountStats(@RequestParam("baseId") String baseId) {
|
||||||
|
return success(bigScreenService.getBaseCountStats(baseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 基地板块 —— 地块统计
|
||||||
|
@Operation(summary = "基地板块-地块统计")
|
||||||
|
@Parameter(name = "baseId", description = "基地ID", required = true)
|
||||||
|
@GetMapping("/base/plot-stats")
|
||||||
|
public CommonResult<List<BasePlotStatRespVO>> getBasePlotStats(@RequestParam("baseId") String baseId) {
|
||||||
|
return success(bigScreenService.getBasePlotStats(baseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 种植统计 —— 种植分布(饼图)
|
||||||
|
@Operation(summary = "种植统计-种植分布饼图")
|
||||||
|
@Parameter(name = "baseId", description = "基地ID", required = true)
|
||||||
|
@GetMapping("/planting/distribution-pie")
|
||||||
|
public CommonResult<List<PlantingDistributionPieItemVO>> getPlantingDistributionPie(@RequestParam("baseId") String baseId) {
|
||||||
|
return success(bigScreenService.getPlantingDistributionPie(baseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 种植统计 —— 产量分布(饼图)
|
||||||
|
@Operation(summary = "种植统计-产量分布饼图")
|
||||||
|
@Parameter(name = "baseId", description = "基地ID", required = true)
|
||||||
|
@GetMapping("/planting/yield-distribution-pie")
|
||||||
|
public CommonResult<List<YieldDistributionPieItemVO>> getYieldDistributionPie(@RequestParam("baseId") String baseId) {
|
||||||
|
return success(bigScreenService.getYieldDistributionPie(baseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 种植统计 —— 实际/预计产量对比(柱状图)
|
||||||
|
@Operation(summary = "种植统计-实际预计产量对比柱状图")
|
||||||
|
@Parameter(name = "baseId", description = "基地ID", required = true)
|
||||||
|
@GetMapping("/planting/yield-compare-bar")
|
||||||
|
public CommonResult<List<YieldCompareBarItemVO>> getYieldCompareBar(@RequestParam("baseId") String baseId) {
|
||||||
|
return success(bigScreenService.getYieldCompareBar(baseId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BaseAreaStatRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "基地ID")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "总面积(亩)")
|
||||||
|
private Double totalAreaMu;
|
||||||
|
|
||||||
|
@Schema(description = "已种植面积(亩)")
|
||||||
|
private Double plantedAreaMu;
|
||||||
|
|
||||||
|
@Schema(description = "未种植面积(亩)")
|
||||||
|
private Double idleAreaMu;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BaseBasicInfoRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "基地ID")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "基地名称")
|
||||||
|
private String baseName;
|
||||||
|
|
||||||
|
@Schema(description = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "负责人")
|
||||||
|
private String principalName;
|
||||||
|
|
||||||
|
@Schema(description = "联系方式")
|
||||||
|
private String principalMobile;
|
||||||
|
|
||||||
|
@Schema(description = "总面积(亩)")
|
||||||
|
private Double totalAreaMu;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BaseCountStatRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "基地ID")
|
||||||
|
private String baseId;
|
||||||
|
|
||||||
|
@Schema(description = "地块数量")
|
||||||
|
private Integer plotCount;
|
||||||
|
|
||||||
|
@Schema(description = "设施数量")
|
||||||
|
private Integer facilityCount;
|
||||||
|
|
||||||
|
@Schema(description = "品种数量")
|
||||||
|
private Integer varietyCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BasePlotStatRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "地块ID")
|
||||||
|
private String plotId;
|
||||||
|
|
||||||
|
@Schema(description = "地块名称")
|
||||||
|
private String plotName;
|
||||||
|
|
||||||
|
@Schema(description = "面积(亩)")
|
||||||
|
private Double areaMu;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PlantingDistributionPieItemVO {
|
||||||
|
|
||||||
|
@Schema(description = "品种")
|
||||||
|
private String varietyName;
|
||||||
|
|
||||||
|
@Schema(description = "品种面积(亩)")
|
||||||
|
private Double varietyAreaMu;
|
||||||
|
|
||||||
|
@Schema(description = "面积占比(0-1)")
|
||||||
|
private Double areaRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class YieldCompareBarItemVO {
|
||||||
|
|
||||||
|
@Schema(description = "品种")
|
||||||
|
private String varietyName;
|
||||||
|
|
||||||
|
@Schema(description = "实际产量(吨)")
|
||||||
|
private Double actualYieldTon;
|
||||||
|
|
||||||
|
@Schema(description = "预计产量(吨)")
|
||||||
|
private Double expectedYieldTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class YieldDistributionPieItemVO {
|
||||||
|
|
||||||
|
@Schema(description = "品种")
|
||||||
|
private String varietyName;
|
||||||
|
|
||||||
|
@Schema(description = "品种产量(吨)")
|
||||||
|
private Double varietyYieldTon;
|
||||||
|
|
||||||
|
@Schema(description = "产量占比(0-1)")
|
||||||
|
private Double yieldRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -61,5 +61,5 @@ public class CompanyInfoPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "租户id", example = "9295")
|
@Schema(description = "租户id", example = "9295")
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
private String introduction;
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.farm.controller.admin.companyinfo.vo;
|
package cn.iocoder.yudao.module.farm.controller.admin.companyinfo.vo;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import cn.idev.excel.annotation.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 企业信息 Response VO")
|
@Schema(description = "管理后台 - 企业信息 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@@ -49,17 +49,9 @@ public class CompanyInfoRespVO {
|
|||||||
@ExcelProperty("网店地址")
|
@ExcelProperty("网店地址")
|
||||||
private String introduce;
|
private String introduce;
|
||||||
|
|
||||||
@Schema(description = "宣传图片(逗号分隔的字符串)")
|
|
||||||
@ExcelProperty("宣传图片")
|
|
||||||
private String publicityImage;
|
|
||||||
|
|
||||||
@Schema(description = "宣传图片集合")
|
@Schema(description = "宣传图片集合")
|
||||||
private List<String> publicityImageList;
|
private List<String> publicityImageList;
|
||||||
|
|
||||||
@Schema(description = "企业logo(逗号分隔的字符串)")
|
|
||||||
@ExcelProperty("企业logo")
|
|
||||||
private String logoImage;
|
|
||||||
|
|
||||||
@Schema(description = "企业logo集合")
|
@Schema(description = "企业logo集合")
|
||||||
private List<String> logoImageList;
|
private List<String> logoImageList;
|
||||||
|
|
||||||
@@ -86,5 +78,5 @@ public class CompanyInfoRespVO {
|
|||||||
@Schema(description = "租户id", example = "9295")
|
@Schema(description = "租户id", example = "9295")
|
||||||
@ExcelProperty("租户id")
|
@ExcelProperty("租户id")
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
private String introduction;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,15 +36,9 @@ public class CompanyInfoSaveReqVO {
|
|||||||
@Schema(description = "网店地址")
|
@Schema(description = "网店地址")
|
||||||
private String introduce;
|
private String introduce;
|
||||||
|
|
||||||
@Schema(description = "宣传图片(逗号分隔的字符串)")
|
|
||||||
private String publicityImage;
|
|
||||||
|
|
||||||
@Schema(description = "宣传图片集合")
|
@Schema(description = "宣传图片集合")
|
||||||
private List<String> publicityImageList;
|
private List<String> publicityImageList;
|
||||||
|
|
||||||
@Schema(description = "企业logo(逗号分隔的字符串)")
|
|
||||||
private String logoImage;
|
|
||||||
|
|
||||||
@Schema(description = "企业logo集合")
|
@Schema(description = "企业logo集合")
|
||||||
private List<String> logoImageList;
|
private List<String> logoImageList;
|
||||||
|
|
||||||
@@ -62,5 +56,5 @@ public class CompanyInfoSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "租户id", example = "9295")
|
@Schema(description = "租户id", example = "9295")
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
private String introduction;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.farm.controller.admin.varietydata.vo;
|
package cn.iocoder.yudao.module.farm.controller.admin.varietydata.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
@@ -45,4 +45,5 @@ public class VarietyDataSaveReqVO {
|
|||||||
@Schema(description = "租户id")
|
@Schema(description = "租户id")
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
|
||||||
|
private String cultivsrId;
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ public class CompanyInfoDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String introduce;
|
private String introduce;
|
||||||
/**
|
/**
|
||||||
* 宣传图片(数据库存储为逗号分隔的字符串)
|
* 宣传图片
|
||||||
*/
|
*/
|
||||||
@TableField(value = "publicity_image")
|
@TableField(value = "publicity_image")
|
||||||
private String publicityImage;
|
private String publicityImage;
|
||||||
@@ -103,7 +103,7 @@ public class CompanyInfoDO extends BaseDO {
|
|||||||
private String plotName;
|
private String plotName;
|
||||||
|
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
private String introduction;
|
||||||
/**
|
/**
|
||||||
* 获取宣传图片集合
|
* 获取宣传图片集合
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -73,4 +73,7 @@ public class VarietyDataDO extends BaseDO {
|
|||||||
private String plotName;
|
private String plotName;
|
||||||
|
|
||||||
private String tenantId;
|
private String tenantId;
|
||||||
|
|
||||||
|
private String cultivsrId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.bigscreen;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BaseAreaStatRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BaseBasicInfoRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BaseCountStatRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.BasePlotStatRespVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.PlantingDistributionPieItemVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.YieldCompareBarItemVO;
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.YieldDistributionPieItemVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface BigScreenService {
|
||||||
|
|
||||||
|
BaseBasicInfoRespVO getBaseBasicInfo(String baseId);
|
||||||
|
|
||||||
|
BaseAreaStatRespVO getBaseAreaStats(String baseId);
|
||||||
|
|
||||||
|
BaseCountStatRespVO getBaseCountStats(String baseId);
|
||||||
|
|
||||||
|
List<BasePlotStatRespVO> getBasePlotStats(String baseId);
|
||||||
|
|
||||||
|
List<PlantingDistributionPieItemVO> getPlantingDistributionPie(String baseId);
|
||||||
|
|
||||||
|
List<YieldDistributionPieItemVO> getYieldDistributionPie(String baseId);
|
||||||
|
|
||||||
|
List<YieldCompareBarItemVO> getYieldCompareBar(String baseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package cn.iocoder.yudao.module.farm.service.bigscreen.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.farm.controller.admin.bigscreen.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.farm.service.bigscreen.BigScreenService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BigScreenServiceImpl implements BigScreenService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseBasicInfoRespVO getBaseBasicInfo(String baseId) {
|
||||||
|
BaseBasicInfoRespVO vo = new BaseBasicInfoRespVO();
|
||||||
|
vo.setBaseId(baseId);
|
||||||
|
vo.setBaseName("演示基地");
|
||||||
|
vo.setAddress("演示地址");
|
||||||
|
vo.setPrincipalName("负责人");
|
||||||
|
vo.setPrincipalMobile("13800000000");
|
||||||
|
vo.setTotalAreaMu(1000D);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseAreaStatRespVO getBaseAreaStats(String baseId) {
|
||||||
|
BaseAreaStatRespVO vo = new BaseAreaStatRespVO();
|
||||||
|
vo.setBaseId(baseId);
|
||||||
|
vo.setTotalAreaMu(1000D);
|
||||||
|
vo.setPlantedAreaMu(650D);
|
||||||
|
vo.setIdleAreaMu(350D);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseCountStatRespVO getBaseCountStats(String baseId) {
|
||||||
|
BaseCountStatRespVO vo = new BaseCountStatRespVO();
|
||||||
|
vo.setBaseId(baseId);
|
||||||
|
vo.setPlotCount(120);
|
||||||
|
vo.setFacilityCount(45);
|
||||||
|
vo.setVarietyCount(18);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BasePlotStatRespVO> getBasePlotStats(String baseId) {
|
||||||
|
List<BasePlotStatRespVO> list = new ArrayList<>();
|
||||||
|
BasePlotStatRespVO a = new BasePlotStatRespVO();
|
||||||
|
a.setPlotId("A");
|
||||||
|
a.setPlotName("一区");
|
||||||
|
a.setAreaMu(200D);
|
||||||
|
list.add(a);
|
||||||
|
BasePlotStatRespVO b = new BasePlotStatRespVO();
|
||||||
|
b.setPlotId("B");
|
||||||
|
b.setPlotName("二区");
|
||||||
|
b.setAreaMu(150D);
|
||||||
|
list.add(b);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PlantingDistributionPieItemVO> getPlantingDistributionPie(String baseId) {
|
||||||
|
List<PlantingDistributionPieItemVO> list = new ArrayList<>();
|
||||||
|
PlantingDistributionPieItemVO v1 = new PlantingDistributionPieItemVO();
|
||||||
|
v1.setVarietyName("水稻");
|
||||||
|
v1.setVarietyAreaMu(260D);
|
||||||
|
v1.setAreaRatio(0.4D);
|
||||||
|
list.add(v1);
|
||||||
|
PlantingDistributionPieItemVO v2 = new PlantingDistributionPieItemVO();
|
||||||
|
v2.setVarietyName("小麦");
|
||||||
|
v2.setVarietyAreaMu(195D);
|
||||||
|
v2.setAreaRatio(0.3D);
|
||||||
|
list.add(v2);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<YieldDistributionPieItemVO> getYieldDistributionPie(String baseId) {
|
||||||
|
List<YieldDistributionPieItemVO> list = new ArrayList<>();
|
||||||
|
YieldDistributionPieItemVO y1 = new YieldDistributionPieItemVO();
|
||||||
|
y1.setVarietyName("水稻");
|
||||||
|
y1.setVarietyYieldTon(520D);
|
||||||
|
y1.setYieldRatio(0.5D);
|
||||||
|
list.add(y1);
|
||||||
|
YieldDistributionPieItemVO y2 = new YieldDistributionPieItemVO();
|
||||||
|
y2.setVarietyName("小麦");
|
||||||
|
y2.setVarietyYieldTon(312D);
|
||||||
|
y2.setYieldRatio(0.3D);
|
||||||
|
list.add(y2);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<YieldCompareBarItemVO> getYieldCompareBar(String baseId) {
|
||||||
|
List<YieldCompareBarItemVO> list = new ArrayList<>();
|
||||||
|
YieldCompareBarItemVO c1 = new YieldCompareBarItemVO();
|
||||||
|
c1.setVarietyName("水稻");
|
||||||
|
c1.setActualYieldTon(520D);
|
||||||
|
c1.setExpectedYieldTon(500D);
|
||||||
|
list.add(c1);
|
||||||
|
YieldCompareBarItemVO c2 = new YieldCompareBarItemVO();
|
||||||
|
c2.setVarietyName("小麦");
|
||||||
|
c2.setActualYieldTon(300D);
|
||||||
|
c2.setExpectedYieldTon(320D);
|
||||||
|
list.add(c2);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class CompanyInfoServiceImpl implements CompanyInfoService {
|
|||||||
companyInfo.setId(IdUtil.fastUUID());
|
companyInfo.setId(IdUtil.fastUUID());
|
||||||
companyInfo.setTenantId(String.valueOf(user.getTenantId()));
|
companyInfo.setTenantId(String.valueOf(user.getTenantId()));
|
||||||
|
|
||||||
// 处理图片集合转换
|
// 处理图片集合转换(仅使用集合字段)
|
||||||
handleImageConversion(companyInfo, createReqVO);
|
handleImageConversion(companyInfo, createReqVO);
|
||||||
|
|
||||||
companyInfoMapper.insert(companyInfo);
|
companyInfoMapper.insert(companyInfo);
|
||||||
@@ -55,7 +55,7 @@ public class CompanyInfoServiceImpl implements CompanyInfoService {
|
|||||||
// 更新
|
// 更新
|
||||||
CompanyInfoDO updateObj = BeanUtils.toBean(updateReqVO, CompanyInfoDO.class);
|
CompanyInfoDO updateObj = BeanUtils.toBean(updateReqVO, CompanyInfoDO.class);
|
||||||
|
|
||||||
// 处理图片集合转换
|
// 处理图片集合转换(仅使用集合字段)
|
||||||
handleImageConversion(updateObj, updateReqVO);
|
handleImageConversion(updateObj, updateReqVO);
|
||||||
|
|
||||||
companyInfoMapper.updateById(updateObj);
|
companyInfoMapper.updateById(updateObj);
|
||||||
@@ -111,21 +111,14 @@ public class CompanyInfoServiceImpl implements CompanyInfoService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理图片集合转换
|
* 处理图片集合转换
|
||||||
* 优先使用图片集合,如果图片集合为空则使用字符串
|
* 仅使用集合字段,由 DO 的 setter 负责字符串字段赋值
|
||||||
*/
|
*/
|
||||||
private void handleImageConversion(CompanyInfoDO companyInfo, CompanyInfoSaveReqVO reqVO) {
|
private void handleImageConversion(CompanyInfoDO companyInfo, CompanyInfoSaveReqVO reqVO) {
|
||||||
// 处理宣传图片
|
if (reqVO.getPublicityImageList() != null) {
|
||||||
if (reqVO.getPublicityImageList() != null && !reqVO.getPublicityImageList().isEmpty()) {
|
|
||||||
companyInfo.setPublicityImageList(reqVO.getPublicityImageList());
|
companyInfo.setPublicityImageList(reqVO.getPublicityImageList());
|
||||||
} else if (reqVO.getPublicityImage() != null) {
|
|
||||||
companyInfo.setPublicityImage(reqVO.getPublicityImage());
|
|
||||||
}
|
}
|
||||||
|
if (reqVO.getLogoImageList() != null) {
|
||||||
// 处理企业logo
|
|
||||||
if (reqVO.getLogoImageList() != null && !reqVO.getLogoImageList().isEmpty()) {
|
|
||||||
companyInfo.setLogoImageList(reqVO.getLogoImageList());
|
companyInfo.setLogoImageList(reqVO.getLogoImageList());
|
||||||
} else if (reqVO.getLogoImage() != null) {
|
|
||||||
companyInfo.setLogoImage(reqVO.getLogoImage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user