退料联调

This commit is contained in:
mashuai 2025-05-22 17:53:08 +08:00
parent 44ee2888e1
commit 7946248e67
4 changed files with 36 additions and 1 deletions

View File

@ -222,6 +222,9 @@ public class LeaseApplyInfo extends BaseEntity{
@ApiModelProperty(value = "已出库数量") @ApiModelProperty(value = "已出库数量")
private BigDecimal alNum; private BigDecimal alNum;
@ApiModelProperty(value = "待领数量")
private BigDecimal waitCountNum;
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
private String startTime; private String startTime;

View File

@ -1,5 +1,6 @@
package com.bonus.material.lease.mapper; package com.bonus.material.lease.mapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo; import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.material.lease.domain.vo.LeaseTotalInfo; import com.bonus.material.lease.domain.vo.LeaseTotalInfo;
@ -104,4 +105,11 @@ public interface LeaseApplyInfoMapper {
List<LeaseTotalInfo> getLeaseInfoDetails(LeaseTotalInfo info); List<LeaseTotalInfo> getLeaseInfoDetails(LeaseTotalInfo info);
LeaseTotalInfo getTotalInfo(LeaseTotalInfo leaseTotalInfo); LeaseTotalInfo getTotalInfo(LeaseTotalInfo leaseTotalInfo);
/**
* 获取站点领料数量
* @param applyInfo
* @return
*/
BigDecimal getNumList(LeaseApplyInfo applyInfo);
} }

View File

@ -165,6 +165,15 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed()) .sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed())
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!CollectionUtils.isEmpty(sortedList)) { if (!CollectionUtils.isEmpty(sortedList)) {
for (LeaseApplyInfo applyInfo : sortedList) {
// 根据id查询已领料出库数据
BigDecimal num = leaseApplyInfoMapper.getNumList(applyInfo);
if (num == null) {
num = BigDecimal.ZERO;
}
applyInfo.setAlNum(num);
applyInfo.setWaitCountNum(applyInfo.getPreCountNum().subtract(num).compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO : applyInfo.getPreCountNum().subtract(num));
}
String keyWord = leaseApplyInfo.getKeyWord(); String keyWord = leaseApplyInfo.getKeyWord();
// 如果关键字不为空进行过滤 // 如果关键字不为空进行过滤
if (!StringUtils.isBlank(keyWord)) { if (!StringUtils.isBlank(keyWord)) {
@ -780,7 +789,12 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
*/ */
@Override @Override
public int deleteLeaseApplyInfoByIds(Long[] ids) { public int deleteLeaseApplyInfoByIds(Long[] ids) {
return leaseApplyInfoMapper.deleteLeaseApplyInfoByIds(ids); int result = leaseApplyInfoMapper.deleteLeaseApplyInfoByIds(ids);
if (result > 0) {
// 删除lease_apply_details表数据
result = leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids);
}
return result;
} }
/** /**

View File

@ -405,4 +405,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
type_id = #{typeId} type_id = #{typeId}
AND parent_id = #{parentId} AND parent_id = #{parentId}
</select> </select>
<select id="getNumList" resultType="java.math.BigDecimal">
SELECT
SUM(IFNULL( out_num, 0 ))
FROM
lease_out_details
WHERE
parent_id = #{id}
</select>
</mapper> </mapper>