feat:硬件分组查询
This commit is contained in:
1 parent
4dfd2bcc75
commit
ac830c925e
11 files changed
+76
-7
No files matched your search
+4
@@ -3,7 +3,11 @@ package com.bsd.pjcloud.hard.api.dto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardGroupDto extends HardGroupEntity {
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
||||
+6
@@ -31,6 +31,12 @@ public class HardManagerEntity extends Model<HardManagerEntity> {
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@Schema(description="分组id")
|
||||
private Long hardGroupId;
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
|
||||
+13
@@ -5,8 +5,10 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.hard.api.dto.code.QRCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardGroupEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseHardGroupInterface;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseHardInterface;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseOrderInterface;
|
||||
import lombok.experimental.UtilityClass;
|
||||
@@ -79,4 +81,15 @@ public class HardUtil {
|
||||
return v;
|
||||
}
|
||||
|
||||
public <T extends BaseHardGroupInterface> List<T> convertHardGroupList(List<T> list, Map<Long, HardGroupEntity> map) {
|
||||
return CollectionUtils.convertList(list, v -> convertHardGroup(v, map.get(v.getHardGroupId())));
|
||||
}
|
||||
|
||||
public <T extends BaseHardGroupInterface> T convertHardGroup(T v, HardGroupEntity entity) {
|
||||
if (ObjectUtil.isEmpty(entity)) return v;
|
||||
v.setHardGroupId(entity.getId());
|
||||
v.setHardGroupName(entity.getName());
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
+9
-1
@@ -2,11 +2,12 @@ package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseHardGroupInterface;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseMchInterface;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardManagerVo extends HardManagerEntity implements BaseDeptInterface, BaseMchInterface {
|
||||
public class HardManagerVo extends HardManagerEntity implements BaseDeptInterface, BaseMchInterface, BaseHardGroupInterface {
|
||||
|
||||
/**
|
||||
* android重点使用
|
||||
@@ -19,4 +20,11 @@ public class HardManagerVo extends HardManagerEntity implements BaseDeptInterfac
|
||||
|
||||
private String logoPic;
|
||||
|
||||
/**
|
||||
* 分类相关
|
||||
*/
|
||||
private Long hardGroupId;
|
||||
|
||||
private String hardGroupName;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.base;
|
||||
|
||||
public interface BaseHardGroupInterface {
|
||||
|
||||
Long getHardGroupId();
|
||||
|
||||
void setHardGroupId(Long hardGroupId);
|
||||
|
||||
String getHardGroupName();
|
||||
|
||||
void setHardGroupName(String hardGroupName);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user