领料接口优化
This commit is contained in:
parent
ca1eda6280
commit
fec7be742c
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
|
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
||||||
import com.bonus.common.biz.enums.MaTypeManageTypeEnum;
|
import com.bonus.common.biz.enums.MaTypeManageTypeEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
|
@ -176,7 +177,6 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
||||||
|
|
||||||
// 判断库存是否足够
|
// 判断库存是否足够
|
||||||
private boolean checkStorageIsEnough(LeaseOutDetails record) {
|
private boolean checkStorageIsEnough(LeaseOutDetails record) {
|
||||||
String maStatus = "1";
|
|
||||||
if (record.getManageType() == MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId() || record.getManageType() == MaTypeManageTypeEnum.SET_DEVICE.getTypeId()) {
|
if (record.getManageType() == MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId() || record.getManageType() == MaTypeManageTypeEnum.SET_DEVICE.getTypeId()) {
|
||||||
LeaseApplyDetails details = leaseOutDetailsMapper.getOutboundNum(record);
|
LeaseApplyDetails details = leaseOutDetailsMapper.getOutboundNum(record);
|
||||||
if (details == null) {
|
if (details == null) {
|
||||||
|
|
@ -185,7 +185,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
||||||
} else if (record.getManageType() == MaTypeManageTypeEnum.CODE_DEVICE.getTypeId()) {
|
} else if (record.getManageType() == MaTypeManageTypeEnum.CODE_DEVICE.getTypeId()) {
|
||||||
if (!(Objects.equals(0, record.getMaId()) || record.getMaId() == null)) {
|
if (!(Objects.equals(0, record.getMaId()) || record.getMaId() == null)) {
|
||||||
String status = leaseOutDetailsMapper.getMachineStatus(record);
|
String status = leaseOutDetailsMapper.getMachineStatus(record);
|
||||||
if (!maStatus.equals(status)) {
|
if (String.valueOf(MaMachineStatusEnum.IN_STORE.getStatus()).equals(status)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class Machine extends BaseEntity
|
||||||
private String preCode;
|
private String preCode;
|
||||||
|
|
||||||
/** 机具状态(数据字典) */
|
/** 机具状态(数据字典) */
|
||||||
@Excel(name = "机具状态", readConverterExp = "数=据字典")
|
@Excel(name = "机具状态")
|
||||||
private String maStatus;
|
private String maStatus;
|
||||||
|
|
||||||
/** 二维码 */
|
/** 二维码 */
|
||||||
|
|
|
||||||
|
|
@ -125,9 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where ma_id = #{maId}
|
where ma_id = #{maId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getOutboundNum" resultType="com.bonus.material.lease.domain.LeaseOutDetails">
|
<select id="getOutboundNum" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
SELECT pre_num AS preNum,
|
SELECT id, parent_id as parentId, type_id as typeId, pre_num as preNum, al_num as alNum, `status`, remark
|
||||||
pre_num - IFNULL(al_num, 0) AS nums
|
|
||||||
FROM lease_apply_details
|
FROM lease_apply_details
|
||||||
WHERE id = #{id} AND (pre_num - IFNULL(al_num, 0)) > 0
|
WHERE id = #{id} AND (pre_num - IFNULL(al_num, 0)) > 0
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue