材料站

This commit is contained in:
mashuai 2025-07-16 11:35:04 +08:00
parent 831d8057c7
commit 4353aeda95
3 changed files with 28 additions and 7 deletions

View File

@ -16,6 +16,7 @@ import com.bonus.material.clz.service.BmTeamService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -135,7 +136,10 @@ public class BmTeamServiceImpl implements BmTeamService {
// 根据i8工程id查询班组信息 // 根据i8工程id查询班组信息
List<String> ids = Collections.singletonList(tbTeam.getProjectId()); List<String> ids = Collections.singletonList(tbTeam.getProjectId());
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids); iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
return AjaxResult.success(iwsTeamUserVos); if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
return AjaxResult.success(iwsTeamUserVos);
}
return AjaxResult.success(new ArrayList<>());
} }
/** /**

View File

@ -177,6 +177,17 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
@Override @Override
public List<MaterialRetainedEquipmentInfo> getRetainedEquipmentList(MaterialRetainedEquipmentInfo bean) { public List<MaterialRetainedEquipmentInfo> getRetainedEquipmentList(MaterialRetainedEquipmentInfo bean) {
String username = SecurityUtils.getLoginUser().getUsername(); String username = SecurityUtils.getLoginUser().getUsername();
// 根据用户名判断用户是否为班组长
BmTeam teamData = materialMachineMapper.getTeamData(username);
if (teamData == null) {
// 根据用户名查询项目部信息
String departId = mapper.getDepartId(username);
// 根据项目部id查询工程信息
List<String> projectIdList = mapper.getProjectId(departId);
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
bean.setProjectIdList(projectIdList);
}
}
BigDecimal totalPrice = BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP); BigDecimal totalPrice = BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP);
BigDecimal totalStoreNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalStoreNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
BigDecimal totalUsNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalUsNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
@ -184,14 +195,11 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
BigDecimal totalRepairInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalRepairInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
BigDecimal totalAllNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); BigDecimal totalAllNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainedEquipmentList(bean);
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (!CollectionUtils.isEmpty(recordList) && deptId != null) { if (deptId != null) {
// 删除元素 bean.setImpUnit(deptId.toString());
recordList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
} }
// 根据用户名判断用户是否为班组长 List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainedEquipmentList(bean);
BmTeam teamData = materialMachineMapper.getTeamData(username);
if (!org.springframework.util.CollectionUtils.isEmpty(recordList)) { if (!org.springframework.util.CollectionUtils.isEmpty(recordList)) {
if (teamData != null) { if (teamData != null) {
// 将sortedList中班组身份证号与username相同的元素过滤处理 // 将sortedList中班组身份证号与username相同的元素过滤处理

View File

@ -169,6 +169,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeModelName != null and typeModelName != ''"> <if test="typeModelName != null and typeModelName != ''">
and mt.type_name like concat('%',#{typeModelName},'%') and mt.type_name like concat('%',#{typeModelName},'%')
</if> </if>
<if test="impUnit != null and impUnit != ''">
and subquery1.impUnit = #{impUnit}
</if>
<if test="projectIdList != null and projectIdList.size() > 0">
and subquery1.externalId in
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY GROUP BY
mt.type_id, mt.type_id,
subquery1.proId subquery1.proId