This commit is contained in:
parent
4bc97b87ac
commit
513d96dca7
|
|
@ -61,6 +61,9 @@ public class MaterialStorageInfo {
|
||||||
@ApiModelProperty(value = "关键字")
|
@ApiModelProperty(value = "关键字")
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班组id")
|
||||||
|
private String teamId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "班组名称")
|
@ApiModelProperty(value = "班组名称")
|
||||||
private String teamName;
|
private String teamName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,4 +214,11 @@ public interface MaterialMachineMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<MaterialRetainedEquipmentInfo> getUsInfoList(MaterialRetainedEquipmentInfo bean);
|
List<MaterialRetainedEquipmentInfo> getUsInfoList(MaterialRetainedEquipmentInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取材料站设备详情
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MaterialStorageInfo> getMaCodeDetails(MaterialStorageInfo bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import com.bonus.material.clz.domain.machine.MaterialStorageInfo;
|
||||||
import com.bonus.material.clz.mapper.MaterialMachineMapper;
|
import com.bonus.material.clz.mapper.MaterialMachineMapper;
|
||||||
import com.bonus.material.clz.service.MaterialMachineService;
|
import com.bonus.material.clz.service.MaterialMachineService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.hibernate.validator.internal.util.StringHelper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -173,16 +174,26 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
String subUnitName = iwsTeamUserMapper.getTeamName(materialRetainedEquipmentInfo.getTeamName());
|
String subUnitName = iwsTeamUserMapper.getTeamName(materialRetainedEquipmentInfo.getTeamName());
|
||||||
materialRetainedEquipmentInfo.setSubUnitName(subUnitName);
|
materialRetainedEquipmentInfo.setSubUnitName(subUnitName);
|
||||||
}
|
}
|
||||||
// 数据合并
|
}
|
||||||
if (!CollectionUtils.isEmpty(recordList)) {
|
// 数据合并
|
||||||
usList.addAll(recordList);
|
if (!CollectionUtils.isEmpty(recordList)) {
|
||||||
}
|
usList.addAll(recordList);
|
||||||
if (teamData != null) {
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(usList)){
|
||||||
|
if (teamData != null){
|
||||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||||
usList = usList.stream()
|
usList = usList.stream()
|
||||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
String subUnitName = bean.getSubUnitName();
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(usList)) {
|
||||||
|
usList = usList.stream()
|
||||||
|
.filter(item -> StringUtils.isBlank(subUnitName)
|
||||||
|
|| (item.getSubUnitName() != null && item.getSubUnitName().contains(subUnitName)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return usList;
|
return usList;
|
||||||
}
|
}
|
||||||
|
|
@ -226,23 +237,31 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
@Override
|
@Override
|
||||||
public List<MaterialStorageInfo> getMaCodeList(MaterialStorageInfo bean) {
|
public List<MaterialStorageInfo> getMaCodeList(MaterialStorageInfo bean) {
|
||||||
try {
|
try {
|
||||||
// 查询库管员
|
// // 查询库管员
|
||||||
List<MaterialStorageInfo> list = materialMachineMapper.getMaCodeList(bean);
|
// List<MaterialStorageInfo> list = materialMachineMapper.getMaCodeList(bean);
|
||||||
MaterialUseStorageInfo materialUseStorageInfo = new MaterialUseStorageInfo();
|
// MaterialUseStorageInfo materialUseStorageInfo = new MaterialUseStorageInfo();
|
||||||
materialUseStorageInfo.setProId(StringUtils.isNotBlank(bean.getProId()) ? bean.getProId() : null);
|
// materialUseStorageInfo.setProId(StringUtils.isNotBlank(bean.getProId()) ? bean.getProId() : null);
|
||||||
materialUseStorageInfo.setTypeId(bean.getTypeId() != null ? bean.getTypeId() : null);
|
// materialUseStorageInfo.setTypeId(bean.getTypeId() != null ? bean.getTypeId() : null);
|
||||||
List<MaterialUseStorageInfo> userList = materialMachineMapper.getUserRecords(materialUseStorageInfo);
|
// List<MaterialUseStorageInfo> userList = materialMachineMapper.getUserRecords(materialUseStorageInfo);
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
// if (CollectionUtils.isNotEmpty(list)) {
|
||||||
if (CollectionUtils.isNotEmpty(userList)) {
|
// if (CollectionUtils.isNotEmpty(userList)) {
|
||||||
list.removeIf(info -> {
|
// list.removeIf(info -> {
|
||||||
for (MaterialUseStorageInfo useStorageInfo : userList) {
|
// for (MaterialUseStorageInfo useStorageInfo : userList) {
|
||||||
if (info.getMaId().equals(useStorageInfo.getMaId())) {
|
// if (info.getMaId()!=null && useStorageInfo.getMaId()!=null){
|
||||||
return true;
|
// if (info.getMaId().equals(useStorageInfo.getMaId())) {
|
||||||
}
|
// return true;
|
||||||
}
|
// }
|
||||||
return false;
|
// }
|
||||||
});
|
// }
|
||||||
}
|
// return false;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
List<MaterialStorageInfo> list = new ArrayList<>();
|
||||||
|
if (!StringHelper.isNullOrEmptyString(bean.getTeamId())){
|
||||||
|
list = materialMachineMapper.getMaCodeDetails(bean);
|
||||||
|
} else {
|
||||||
|
list = materialMachineMapper.getMaCodeList(bean);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
for (MaterialStorageInfo useStorageInfo : list) {
|
for (MaterialStorageInfo useStorageInfo : list) {
|
||||||
|
|
|
||||||
|
|
@ -1197,7 +1197,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
IFNULL(subquery3.usNum, 0) AS usNum,
|
IFNULL(subquery3.usNum, 0) AS usNum,
|
||||||
IFNULL(subquery1.usNum, 0) AS allNum,
|
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
|
||||||
|
WHEN 0 THEN
|
||||||
|
'编码'
|
||||||
|
ELSE
|
||||||
|
'数量'
|
||||||
|
END manageType
|
||||||
FROM ma_type mt
|
FROM ma_type mt
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -1278,19 +1284,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
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
|
||||||
<if test="impUnitName != null and impUnitName != ''">
|
<if test="impUnitName != null and impUnitName != ''">
|
||||||
AND subquery1.departName = #{impUnitName}
|
AND subquery1.departName like concat('%',#{impUnitName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="proName != null and proName != ''">
|
<if test="proName != null and proName != ''">
|
||||||
AND subquery1.proName = #{proName}
|
AND subquery1.proName like concat('%',#{proName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="departName != null and departName != ''">
|
<if test="departName != null and departName != ''">
|
||||||
AND subquery1.proCenter = #{departName}
|
AND subquery1.proCenter like concat('%',#{departName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="typeName != null and typeName != ''">
|
<if test="typeName != null and typeName != ''">
|
||||||
AND mt2.type_name = #{typeName}
|
AND mt2.type_name like concat('%',#{typeName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="typeModelName != null and typeModelName != ''">
|
<if test="typeModelName != null and typeModelName != ''">
|
||||||
AND mt.type_name = #{typeModelName}
|
AND mt.type_name like concat('%',#{typeModelName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||||
and subquery1.externalId in
|
and subquery1.externalId in
|
||||||
|
|
@ -1306,7 +1312,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="getUsInfoList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
<select id="getUsInfoList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id,
|
mt.type_id as typeId,
|
||||||
mt4.type_name AS constructionType,
|
mt4.type_name AS constructionType,
|
||||||
mt4.type_id AS firstTypeId,
|
mt4.type_id AS firstTypeId,
|
||||||
mt3.type_name AS materialType,
|
mt3.type_name AS materialType,
|
||||||
|
|
@ -1315,6 +1321,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt2.type_id AS thirdTypeId,
|
mt2.type_id AS thirdTypeId,
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(IFNULL( sai.num, 0 )) AS allNum,
|
SUM(IFNULL( sai.num, 0 )) AS allNum,
|
||||||
|
bu.unit_id as teamId,
|
||||||
bu.unit_name AS teamName,
|
bu.unit_name AS teamName,
|
||||||
bp.pro_name as proName,
|
bp.pro_name as proName,
|
||||||
bp.pro_id as proId,
|
bp.pro_id as proId,
|
||||||
|
|
@ -1323,7 +1330,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bu.bzz_idcard AS idCard,
|
bu.bzz_idcard AS idCard,
|
||||||
bp.pro_center AS departName,
|
bp.pro_center AS departName,
|
||||||
mt.unit_name AS unit,
|
mt.unit_name AS unit,
|
||||||
sd.dept_name AS impUnitName
|
sd.dept_name AS impUnitName,
|
||||||
|
CASE mt.manage_type
|
||||||
|
WHEN 0 THEN
|
||||||
|
'编码'
|
||||||
|
ELSE
|
||||||
|
'数量'
|
||||||
|
END manageType
|
||||||
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
|
||||||
|
|
@ -1341,22 +1354,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND bu.unit_name is not null
|
AND bu.unit_name is not null
|
||||||
AND bp.external_id is not NULL
|
AND bp.external_id is not NULL
|
||||||
<if test="impUnitName != null and impUnitName != ''">
|
<if test="impUnitName != null and impUnitName != ''">
|
||||||
AND sd.dept_name = #{impUnitName}
|
AND sd.dept_name like concat('%',#{impUnitName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="proName != null and proName != ''">
|
<if test="proName != null and proName != ''">
|
||||||
AND bp.pro_name = #{proName}
|
AND bp.pro_name like concat('%',#{proName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="departName != null and departName != ''">
|
<if test="departName != null and departName != ''">
|
||||||
AND bp.pro_center = #{departName}
|
AND bp.pro_center like concat('%',#{departName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="teamName != null and teamName != ''">
|
<if test="teamName != null and teamName != ''">
|
||||||
AND bu.unit_name = #{teamName}
|
AND bu.unit_name like concat('%',#{teamName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="typeName != null and typeName != ''">
|
<if test="typeName != null and typeName != ''">
|
||||||
AND mt2.type_name = #{typeName}
|
AND mt2.type_name like concat('%',#{typeName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="typeModelName != null and typeModelName != ''">
|
<if test="typeModelName != null and typeModelName != ''">
|
||||||
AND mt.type_name = #{typeModelName}
|
AND mt.type_name like concat('%',#{typeModelName},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||||
and bp.external_id in
|
and bp.external_id in
|
||||||
|
|
@ -1371,5 +1384,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bu.unit_name,
|
bu.unit_name,
|
||||||
bp.pro_name
|
bp.pro_name
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getMaCodeDetails" resultType="com.bonus.material.clz.domain.machine.MaterialStorageInfo">
|
||||||
|
SELECT mt2.type_name AS typeName,
|
||||||
|
mt.type_name AS typeModelName,
|
||||||
|
mt.lease_price AS buyPrice,
|
||||||
|
sai.num AS storeNum,
|
||||||
|
mm.ma_code AS maCode,
|
||||||
|
bt.unit_name AS teamName,
|
||||||
|
sai.lease_id AS leaseId,
|
||||||
|
sai.type_id AS typeId,
|
||||||
|
lai.code AS code,
|
||||||
|
sai.ma_id AS maId
|
||||||
|
FROM clz_slt_agreement_info sai
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||||
|
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
|
||||||
|
LEFT JOIN clz_bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
||||||
|
LEFT JOIN bm_unit bt ON bai.unit_id = bt.unit_id AND bt.del_flag = '0'
|
||||||
|
LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
|
||||||
|
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||||
|
WHERE sai.status = '0'
|
||||||
|
AND sai.end_time IS NULL
|
||||||
|
AND sai.back_id IS NULL
|
||||||
|
<if test="typeId !=null ">
|
||||||
|
AND sai.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
<if test="proId !=null ">
|
||||||
|
AND bp.pro_id = #{proId}
|
||||||
|
</if>
|
||||||
|
<if test="teamId !=null ">
|
||||||
|
AND bt.unit_id = #{teamId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue