装备新增必填项去掉

This commit is contained in:
liang.chao 2024-12-03 16:41:08 +08:00
parent c5cc430b1e
commit b16cb9f59b
2 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,6 @@ public class DevInfo extends BaseEntity {
/** 设备编码 */ /** 设备编码 */
@Excel(name = "设备编码") @Excel(name = "设备编码")
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")
@NotBlank
private String code; private String code;
@ApiModelProperty(value = "装备名称") @ApiModelProperty(value = "装备名称")

View File

@ -1,5 +1,6 @@
package com.bonus.material.order.service.impl; package com.bonus.material.order.service.impl;
import com.bonus.common.biz.enums.MaStatusEnum;
import com.bonus.common.security.utils.SecurityUtils; import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.device.domain.DevInfo; import com.bonus.material.device.domain.DevInfo;
import com.bonus.material.order.domain.OrderDetailDto; import com.bonus.material.order.domain.OrderDetailDto;
@ -38,7 +39,7 @@ public class OrderServiceImpl implements OrderService {
DevInfo devInfo = orderMapper.getdeviceCount(orderDetailDto); DevInfo devInfo = orderMapper.getdeviceCount(orderDetailDto);
if (devInfo.getDeviceCount() == 0) { if (devInfo.getDeviceCount() == 0) {
// 查询库存是否为0是的话让它下架 // 查询库存是否为0是的话让它下架
orderDetailDto.setMaStatus("1"); orderDetailDto.setMaStatus(MaStatusEnum.ON_HIRE.getCode().toString());
orderMapper.updateDeviceStatus(orderDetailDto); orderMapper.updateDeviceStatus(orderDetailDto);
throw new RuntimeException(devInfo.getDeviceName() + "已下架,无法下单"); throw new RuntimeException(devInfo.getDeviceName() + "已下架,无法下单");
} else if (devInfo.getDeviceCount() < orderDetailDto.getNum()) { } else if (devInfo.getDeviceCount() < orderDetailDto.getNum()) {
@ -49,7 +50,7 @@ public class OrderServiceImpl implements OrderService {
} }
} else { } else {
//如果是编码设备改设备状态为在租 //如果是编码设备改设备状态为在租
orderDetailDto.setMaStatus("3"); orderDetailDto.setMaStatus(MaStatusEnum.UNDER_RENT.getCode().toString());
orderMapper.updateDeviceStatus(orderDetailDto); orderMapper.updateDeviceStatus(orderDetailDto);
} }
// 更改购物车状态为已下单 // 更改购物车状态为已下单