fix (farm): 租户初始化

- 初始化数据null异常
This commit is contained in:
达富斌
2025-09-21 20:58:46 +08:00
parent 62d8c25f6f
commit 63b9c8f4f1
6 changed files with 14 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.farm.controller.admin.deviceinfo.vo.v2;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -13,7 +14,7 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DeviceInfoPageV2ReqVO {
public class DeviceInfoPageV2ReqVO extends PageParam {
@Schema(description = "基地ID")
private String baseId;

View File

@@ -68,7 +68,11 @@ public class DeviceInfoDO extends BaseDO {
/**
* 设备状态
*/
private Integer status;
private Integer deviceState;
/**
* 绑定状态:1: 绑定; 0: 未绑定
*/
private Integer bindingState;
/**
* 设备类型
*/
@@ -162,15 +166,6 @@ public class DeviceInfoDO extends BaseDO {
@TableField(value = "data_image")
private String dataImage;
/**
* 设备状态:0-未激活,1-在线,2-离线,3-维护中,4-故障
*/
private Integer deviceState;
/**
* 绑定状态:1: 绑定; 0: 未绑定
*/
private Integer bindingState;
/**
* 设备激活时间
*/

View File

@@ -31,7 +31,8 @@ public interface DeviceInfoMapper extends BaseMapperX<DeviceInfoDO> {
.eqIfPresent(DeviceInfoDO::getLpProductKey, reqVO.getLpProductKey())
.likeIfPresent(DeviceInfoDO::getLpProductName, reqVO.getLpProductName())
.eqIfPresent(DeviceInfoDO::getLpProductUniqueId, reqVO.getLpProductUniqueId())
.eqIfPresent(DeviceInfoDO::getStatus, reqVO.getDeviceState())
.eqIfPresent(DeviceInfoDO::getDeviceName, reqVO.getDeviceState())
.eqIfPresent(DeviceInfoDO::getBindingState, reqVO.getBindingState())
.eqIfPresent(DeviceInfoDO::getDeviceType, reqVO.getDeviceType())
.eqIfPresent(DeviceInfoDO::getType, reqVO.getType())
.eqIfPresent(DeviceInfoDO::getVendor, reqVO.getVendor())

View File

@@ -258,7 +258,8 @@ public class BaseInfoServiceImpl implements BaseInfoService {
}
// 租户公司名称
CompanyInfoDO companyInfo = companyInfoService.getCompanyInfo();
return new TenantInfoRespVO.TenantInfo(companyInfo.getName(),baseCount, cropCount, areaCount, employeeCount);
String compName = ObjectUtils.isEmpty(companyInfo) ? "" : companyInfo.getName();
return new TenantInfoRespVO.TenantInfo(compName,baseCount, cropCount, areaCount, employeeCount);
}
private void packageBaseInfo(long tenantId, List<BaseInfoRespVO> respVOS, Map<String, String> employeeMap) {

View File

@@ -146,6 +146,7 @@ public class PersonnelManagementServiceImpl implements PersonnelManagementServic
@Override
public PageResult<PersonnelManagementDO> getPersonnelManagementPage(PersonnelManagementPageReqVO pageReqVO) {
pageReqVO.setTenantId(getLoginUser().getTenantId().toString());
PageResult<PersonnelManagementDO> pageResult = personnelManagementMapper.selectPage(pageReqVO);
if (pageResult.getList() != null) {
// 触发图片集合转换,确保分页结果中的每个DO对象都包含转换后的图片集合

View File

@@ -10,7 +10,8 @@
-->
<select id="selectSum" parameterType="Long" resultType="java.lang.Long">
select sum(quote_count)
select
COALESCE(sum(quote_count),0)
from farm_model_management
where tenant_id = #{tenantId}
and deleted = 0