Merge branch 'master' of http://14.103.246.124:16000/bonus/Bonus-Cloud-Material
This commit is contained in:
commit
f5bfd5c199
|
|
@ -242,4 +242,6 @@ public class MaterialRetainedEquipmentInfo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "结束时间")
|
@ApiModelProperty(value = "结束时间")
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
|
private String unitValue;
|
||||||
}
|
}
|
||||||
|
|
@ -828,9 +828,9 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
// 获取项目部总数
|
// 获取项目部总数
|
||||||
Integer departNum = materialMachineMapper.selectDepartNum(bean);
|
Integer departNum = materialMachineMapper.selectDepartNum(bean);
|
||||||
// 获取工程总数
|
// 获取工程总数
|
||||||
Integer projectNum = materialMachineMapper.selectProjectNum(bean);
|
//Integer projectNum = materialMachineMapper.selectProjectNum(bean);
|
||||||
// 获取班组总数
|
// 获取班组总数
|
||||||
Integer teamNum = materialMachineMapper.selectTeamNum(bean);
|
//Integer teamNum = materialMachineMapper.selectTeamNum(bean);
|
||||||
// 获取在用量
|
// 获取在用量
|
||||||
MaterialRetainedEquipmentInfo useInfo = materialMachineMapper.getRetainTotalInfo(bean);
|
MaterialRetainedEquipmentInfo useInfo = materialMachineMapper.getRetainTotalInfo(bean);
|
||||||
BigDecimal useNum = (useInfo != null && useInfo.getUsNum() != null) ?
|
BigDecimal useNum = (useInfo != null && useInfo.getUsNum() != null) ?
|
||||||
|
|
@ -842,18 +842,38 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
if (CollectionUtils.isNotEmpty(recordList)) {
|
if (CollectionUtils.isNotEmpty(recordList)) {
|
||||||
// 将recordList中storeNum大于0的数据过滤出来,并对总数求和
|
// 将recordList中storeNum大于0的数据过滤出来,并对总数求和
|
||||||
storeNum = recordList.stream()
|
storeNum = recordList.stream()
|
||||||
.map(MaterialRetainedEquipmentInfo::getStoreNum)
|
.map(MaterialRetainedEquipmentInfo::getAllNum)
|
||||||
.filter(num -> num.compareTo(BigDecimal.ZERO) > 0)
|
.filter(num -> num.compareTo(BigDecimal.ZERO) > 0)
|
||||||
.reduce(BigDecimal::add)
|
.reduce(BigDecimal::add)
|
||||||
.orElse(BigDecimal.ZERO);
|
.orElse(BigDecimal.ZERO);
|
||||||
|
// 获取到recordList中externalId不为null且去重的总数(转换为Integer类型)
|
||||||
|
long externalIdNum = recordList.stream()
|
||||||
|
.map(MaterialRetainedEquipmentInfo::getProName)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.count();
|
||||||
|
// 将externalIdNum转换为Integer类型
|
||||||
|
info.setProNum((int) externalIdNum);
|
||||||
|
} else {
|
||||||
|
info.setProNum(0);
|
||||||
|
}
|
||||||
|
// 查询目前在用的设备信息
|
||||||
|
List<MaterialRetainedEquipmentInfo> usList = materialMachineMapper.getUsInfoList(bean);
|
||||||
|
if (CollectionUtils.isNotEmpty(usList)) {
|
||||||
|
// 获取usList中的班组id,且去重的数量
|
||||||
|
long teamNum = usList.stream()
|
||||||
|
.map(MaterialRetainedEquipmentInfo::getTeamId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.count();
|
||||||
|
info.setTeamNum((int) teamNum);
|
||||||
|
} else {
|
||||||
|
info.setTeamNum(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置结果
|
// 设置结果
|
||||||
info.setInNum(storeNum);
|
info.setInNum(storeNum);
|
||||||
info.setUseNum(useNum);
|
info.setUseNum(useNum);
|
||||||
info.setDepartNum(departNum);
|
info.setDepartNum(departNum);
|
||||||
info.setProNum(projectNum);
|
|
||||||
info.setTeamNum(teamNum);
|
|
||||||
info.setAllNum(storeNum.add(useNum));
|
info.setAllNum(storeNum.add(useNum));
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1285,9 +1285,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
subquery1.externalId AS externalId,
|
subquery1.externalId AS externalId,
|
||||||
subquery1.impUnit AS impUnit,
|
subquery1.impUnit AS impUnit,
|
||||||
subquery1.idCard AS idCard,
|
subquery1.idCard AS idCard,
|
||||||
IFNULL(subquery1.usNum, 0) - IFNULL(subquery3.usNum, 0) AS storeNum,
|
IFNULL(subquery1.usNum, 0) - IFNULL(subquery3.usNum, 0) AS allNum,
|
||||||
IFNULL(subquery3.usNum, 0) AS usNum,
|
|
||||||
IFNULL(subquery1.usNum, 0) AS allNum,
|
|
||||||
subquery1.proCenter AS departName,
|
subquery1.proCenter AS departName,
|
||||||
subquery1.departName AS impUnitName,
|
subquery1.departName AS impUnitName,
|
||||||
CASE mt.manage_type
|
CASE mt.manage_type
|
||||||
|
|
@ -1297,7 +1295,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
'数量'
|
'数量'
|
||||||
END manageType,
|
END manageType,
|
||||||
'站内库存' AS teamName,
|
'站内库存' AS teamName,
|
||||||
'/' AS subUnitName
|
'/' AS subUnitName,
|
||||||
|
mt.unit_value AS unitValue
|
||||||
FROM ma_type mt
|
FROM ma_type mt
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -1334,6 +1333,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND sai.is_slt = '0'
|
AND sai.is_slt = '0'
|
||||||
AND sai.end_time IS NULL
|
AND sai.end_time IS NULL
|
||||||
AND sai.back_id IS NULL
|
AND sai.back_id IS NULL
|
||||||
|
AND bp.external_id IS NOT NULL
|
||||||
<if test="impUnitName != null and impUnitName != ''">
|
<if test="impUnitName != null and impUnitName != ''">
|
||||||
AND sd.dept_name like concat('%',#{impUnitName},'%')
|
AND sd.dept_name like concat('%',#{impUnitName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -1361,7 +1361,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="impUnit != null and impUnit != ''">
|
<if test="impUnit != null and impUnit != ''">
|
||||||
and bp.imp_unit = #{impUnit}
|
and bp.imp_unit = #{impUnit}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY mt.type_id
|
GROUP BY mt.type_id,
|
||||||
|
bp.pro_id
|
||||||
) AS subquery1 ON mt.type_id = subquery1.type_id
|
) AS subquery1 ON mt.type_id = subquery1.type_id
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -1424,15 +1425,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="impUnit != null and impUnit != ''">
|
<if test="impUnit != null and impUnit != ''">
|
||||||
and bp.imp_unit = #{impUnit}
|
and bp.imp_unit = #{impUnit}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY mt.type_id
|
GROUP BY mt.type_id,
|
||||||
|
bp.pro_id
|
||||||
) AS subquery3
|
) AS subquery3
|
||||||
ON mt.type_id = subquery3.type_id
|
ON mt.type_id = subquery3.type_id
|
||||||
|
AND subquery1.proId = subquery3.proId
|
||||||
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
|
||||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||||
WHERE mt.`level` = 4 and mt.del_flag = '0'
|
WHERE mt.`level` = 4 and mt.del_flag = '0'
|
||||||
AND IFNULL(subquery1.usNum, 0) - IFNULL(subquery3.usNum, 0) > 0
|
AND IFNULL(subquery1.usNum, 0) - IFNULL(subquery3.usNum, 0) > 0
|
||||||
GROUP BY mt.type_id
|
GROUP BY mt.type_id,
|
||||||
|
subquery1.proId
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getUsInfoList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
<select id="getUsInfoList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||||
|
|
@ -1461,7 +1465,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
'编码'
|
'编码'
|
||||||
ELSE
|
ELSE
|
||||||
'数量'
|
'数量'
|
||||||
END manageType
|
END manageType,
|
||||||
|
mt.unit_value AS unitValue
|
||||||
FROM
|
FROM
|
||||||
clz_slt_agreement_info sai
|
clz_slt_agreement_info sai
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue