订单界面
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
Some checks are pending
Java CI with Maven / build (11) (push) Waiting to run
Java CI with Maven / build (17) (push) Waiting to run
Java CI with Maven / build (8) (push) Waiting to run
yudao-ui-admin CI / build (14.x) (push) Waiting to run
yudao-ui-admin CI / build (16.x) (push) Waiting to run
This commit is contained in:
parent
50921bdbef
commit
eb61f7afce
@ -24,6 +24,12 @@ public class OrderPageReqVO extends PageParam {
|
||||
@Schema(description = "套餐ID", example = "6734")
|
||||
private Long comboid;
|
||||
|
||||
@Schema(description = "设备ID", example = "1")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "心电设备")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String orderno;
|
||||
|
||||
|
||||
@ -24,6 +24,14 @@ public class OrderRespVO {
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userid;
|
||||
|
||||
@Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("设备ID")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "心电设备")
|
||||
@ExcelProperty("设备名称")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "套餐ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6734")
|
||||
@ExcelProperty("套餐ID")
|
||||
private Long comboid;
|
||||
|
||||
@ -19,9 +19,15 @@ public class OrderSaveReqVO {
|
||||
private Long orgid;
|
||||
|
||||
@Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11032")
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Long userid;
|
||||
|
||||
@Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "设备ID不能为空")
|
||||
private String deviceid;
|
||||
|
||||
@Schema(description = "设备名称", example = "心电设备")
|
||||
private String devicename;
|
||||
|
||||
@Schema(description = "套餐ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6734")
|
||||
@NotNull(message = "套餐ID不能为空")
|
||||
private Long comboid;
|
||||
|
||||
@ -39,6 +39,16 @@ public class OrderDO {
|
||||
*/
|
||||
@TableField("userid")
|
||||
private Long userid;
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@TableField("deviceid")
|
||||
private String deviceid;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@TableField("devicename")
|
||||
private String devicename;
|
||||
/**
|
||||
* 套餐ID
|
||||
*/
|
||||
|
||||
@ -20,6 +20,7 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
default PageResult<OrderDO> selectPage(OrderPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OrderDO>()
|
||||
.eqIfPresent(OrderDO::getOrgid, reqVO.getOrgid())
|
||||
.eqIfPresent(OrderDO::getDeviceid, reqVO.getDeviceid())
|
||||
.eqIfPresent(OrderDO::getUserid, reqVO.getUserid())
|
||||
.eqIfPresent(OrderDO::getComboid, reqVO.getComboid())
|
||||
.eqIfPresent(OrderDO::getOrderno, reqVO.getOrderno())
|
||||
|
||||
@ -11,6 +11,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.deviceuser.DeviceuserMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.person.PersonMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.person.PersonDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -29,6 +32,9 @@ public class DeviceuserServiceImpl implements DeviceuserService {
|
||||
@Resource
|
||||
private DeviceuserMapper deviceuserMapper;
|
||||
|
||||
@Resource
|
||||
private PersonMapper personMapper;
|
||||
|
||||
@Override
|
||||
public Integer createDeviceuser(DeviceuserSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@ -76,8 +82,27 @@ public class DeviceuserServiceImpl implements DeviceuserService {
|
||||
|
||||
@Override
|
||||
public List<DeviceuserDO> getDeviceuserByDeviceId(String deviceid) {
|
||||
return deviceuserMapper.selectList(new LambdaQueryWrapper<DeviceuserDO>()
|
||||
// 先查询设备用户关联记录
|
||||
List<DeviceuserDO> deviceusers = deviceuserMapper.selectList(new LambdaQueryWrapper<DeviceuserDO>()
|
||||
.eq(DeviceuserDO::getDeviceid, deviceid));
|
||||
|
||||
// 批量更新username字段
|
||||
for (DeviceuserDO deviceuser : deviceusers) {
|
||||
if (deviceuser.getUserid() != null) {
|
||||
// 根据userid查询tb_user表的name字段
|
||||
PersonDO person = personMapper.selectById(deviceuser.getUserid());
|
||||
if (person != null && person.getName() != null) {
|
||||
// 更新username字段
|
||||
deviceuserMapper.update(null, new LambdaUpdateWrapper<DeviceuserDO>()
|
||||
.eq(DeviceuserDO::getId, deviceuser.getId())
|
||||
.set(DeviceuserDO::getUsername, person.getName()));
|
||||
// 同步更新内存中的对象
|
||||
deviceuser.setUsername(person.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return deviceusers;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user