Compare commits
2 Commits
352ec3c2fb
...
1726130093
| Author | SHA1 | Date |
|---|---|---|
|
|
1726130093 | |
|
|
b16cb9f59b |
|
|
@ -43,7 +43,6 @@ public class DevInfo extends BaseEntity {
|
|||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
@NotBlank
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "装备名称")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.order.service.impl;
|
||||
|
||||
import com.bonus.common.biz.enums.MaStatusEnum;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.device.domain.DevInfo;
|
||||
import com.bonus.material.order.domain.OrderDetailDto;
|
||||
|
|
@ -38,7 +39,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
DevInfo devInfo = orderMapper.getdeviceCount(orderDetailDto);
|
||||
if (devInfo.getDeviceCount() == 0) {
|
||||
// 查询库存是否为0,是的话让它下架
|
||||
orderDetailDto.setMaStatus("1");
|
||||
orderDetailDto.setMaStatus(MaStatusEnum.ON_HIRE.getCode().toString());
|
||||
orderMapper.updateDeviceStatus(orderDetailDto);
|
||||
throw new RuntimeException(devInfo.getDeviceName() + "已下架,无法下单");
|
||||
} else if (devInfo.getDeviceCount() < orderDetailDto.getNum()) {
|
||||
|
|
@ -49,7 +50,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
} else {
|
||||
//如果是编码设备,改设备状态为在租
|
||||
orderDetailDto.setMaStatus("3");
|
||||
orderDetailDto.setMaStatus(MaStatusEnum.UNDER_RENT.getCode().toString());
|
||||
orderMapper.updateDeviceStatus(orderDetailDto);
|
||||
}
|
||||
// 更改购物车状态为已下单
|
||||
|
|
|
|||
Loading…
Reference in New Issue