二级库bug修改

This commit is contained in:
wcy 2024-08-28 16:08:36 +08:00
parent 6abd590b97
commit bed8fadba7
4 changed files with 62 additions and 11 deletions

View File

@ -107,7 +107,7 @@ public class SecondaryWarehouse {
* 租赁类型 0工程1长期
*/
@Excel(name = "租赁类型")
private String leaseType;
private Integer leaseType;
/**
* 领用数量

View File

@ -13,6 +13,7 @@ import java.util.List;
@Mapper
public interface SecondaryWarehouseMapper {
List<SecondaryWarehouse> getList(SecondaryWarehouse bean);
List<SecondaryWarehouse> getList1(SecondaryWarehouse bean);
int addOperate(TeamLeaseInfo bean);

View File

@ -1,6 +1,5 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.SecondaryWarehouse;
import com.bonus.sgzb.material.domain.TeamLeaseInfo;
@ -12,8 +11,6 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import static com.bonus.sgzb.common.core.utils.GlobalConstants.*;
/**
* @author c liu
* @date 2024/2/29
@ -25,7 +22,9 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
@Override
public List<SecondaryWarehouse> getList(SecondaryWarehouse bean) {
List<SecondaryWarehouse> list = mapper.getList(bean);
List<SecondaryWarehouse> list = new ArrayList<>();
if (bean.getLeaseType().equals(1)){
list = mapper.getList(bean);
for (SecondaryWarehouse secondaryWarehouse : list) {
Integer warehouse = mapper.selectStockNum(secondaryWarehouse);
if (warehouse == null) {
@ -34,6 +33,9 @@ public class SecondaryWarehouseServiceImpl implements SecondaryWarehouseService
secondaryWarehouse.setReceiveNum(warehouse);
secondaryWarehouse.setStockNum(secondaryWarehouse.getNum() - secondaryWarehouse.getReceiveNum());
}
}else {
list = mapper.getList1(bean);
}
return list;
}

View File

@ -9,6 +9,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<select id="getList" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse">
SELECT
bui.unit_id AS unitId,
lod.id as id,
tta.agreement_id AS agreementId,
bui.unit_name AS unitName,
bp.lot_name AS proName,
mt1.type_name AS typeName,
mt.type_name AS modelName,
mt.unit_name AS nuitName,
lod.type_id AS typeId,
IFNULL(SUM( lod.out_num ),0) AS Num
from lease_out_details lod
left join lease_apply_info lai on lod.parent_id=lai.id
left join tm_task_agreement tta on lai.task_id=tta.task_id
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
WHERE 1=1
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="proId != null and proId != ''">
and bp.lot_id = #{proId}
</if>
<if test="typeId != null and typeId != ''">
and mt1.type_id = #{typeId}
</if>
<if test="modelId != null and modelId != ''">
and mt.type_id = #{modelId}
</if>
<if test="leaseType != null">
and lai.lease_type = #{leaseType}
</if>
<if test="keyword != null and keyword != ''">
and (bui.unit_name like concat('%', #{keyword}, '%') or
bp.lot_name like concat('%', #{keyword}, '%') or
mt1.type_name like concat('%', #{keyword}, '%') or
mt.type_name like concat('%', #{keyword}, '%')
)
</if>
GROUP BY
tta.agreement_id,
lod.type_id
</select>
<select id="getList1" resultType="com.bonus.sgzb.material.domain.SecondaryWarehouse">
SELECT
bui.unit_id AS unitId,
lod.id as id,