fix (farm): 租户初始化
- 初始化数据null异常
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.farm.controller.admin.deviceinfo.vo.v2;
|
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -13,7 +14,7 @@ import lombok.NoArgsConstructor;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DeviceInfoPageV2ReqVO {
|
public class DeviceInfoPageV2ReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "基地ID")
|
@Schema(description = "基地ID")
|
||||||
private String baseId;
|
private String baseId;
|
||||||
|
|||||||
@@ -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")
|
@TableField(value = "data_image")
|
||||||
private String dataImage;
|
private String dataImage;
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备状态:0-未激活,1-在线,2-离线,3-维护中,4-故障
|
|
||||||
*/
|
|
||||||
private Integer deviceState;
|
|
||||||
/**
|
|
||||||
* 绑定状态:1: 绑定; 0: 未绑定
|
|
||||||
*/
|
|
||||||
private Integer bindingState;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备激活时间
|
* 设备激活时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ public interface DeviceInfoMapper extends BaseMapperX<DeviceInfoDO> {
|
|||||||
.eqIfPresent(DeviceInfoDO::getLpProductKey, reqVO.getLpProductKey())
|
.eqIfPresent(DeviceInfoDO::getLpProductKey, reqVO.getLpProductKey())
|
||||||
.likeIfPresent(DeviceInfoDO::getLpProductName, reqVO.getLpProductName())
|
.likeIfPresent(DeviceInfoDO::getLpProductName, reqVO.getLpProductName())
|
||||||
.eqIfPresent(DeviceInfoDO::getLpProductUniqueId, reqVO.getLpProductUniqueId())
|
.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::getDeviceType, reqVO.getDeviceType())
|
||||||
.eqIfPresent(DeviceInfoDO::getType, reqVO.getType())
|
.eqIfPresent(DeviceInfoDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(DeviceInfoDO::getVendor, reqVO.getVendor())
|
.eqIfPresent(DeviceInfoDO::getVendor, reqVO.getVendor())
|
||||||
|
|||||||
@@ -258,7 +258,8 @@ public class BaseInfoServiceImpl implements BaseInfoService {
|
|||||||
}
|
}
|
||||||
// 租户公司名称
|
// 租户公司名称
|
||||||
CompanyInfoDO companyInfo = companyInfoService.getCompanyInfo();
|
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) {
|
private void packageBaseInfo(long tenantId, List<BaseInfoRespVO> respVOS, Map<String, String> employeeMap) {
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ public class PersonnelManagementServiceImpl implements PersonnelManagementServic
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<PersonnelManagementDO> getPersonnelManagementPage(PersonnelManagementPageReqVO pageReqVO) {
|
public PageResult<PersonnelManagementDO> getPersonnelManagementPage(PersonnelManagementPageReqVO pageReqVO) {
|
||||||
|
pageReqVO.setTenantId(getLoginUser().getTenantId().toString());
|
||||||
PageResult<PersonnelManagementDO> pageResult = personnelManagementMapper.selectPage(pageReqVO);
|
PageResult<PersonnelManagementDO> pageResult = personnelManagementMapper.selectPage(pageReqVO);
|
||||||
if (pageResult.getList() != null) {
|
if (pageResult.getList() != null) {
|
||||||
// 触发图片集合转换,确保分页结果中的每个DO对象都包含转换后的图片集合
|
// 触发图片集合转换,确保分页结果中的每个DO对象都包含转换后的图片集合
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<select id="selectSum" parameterType="Long" resultType="java.lang.Long">
|
<select id="selectSum" parameterType="Long" resultType="java.lang.Long">
|
||||||
select sum(quote_count)
|
select
|
||||||
|
COALESCE(sum(quote_count),0)
|
||||||
from farm_model_management
|
from farm_model_management
|
||||||
where tenant_id = #{tenantId}
|
where tenant_id = #{tenantId}
|
||||||
and deleted = 0
|
and deleted = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user