材料站
This commit is contained in:
parent
831d8057c7
commit
4353aeda95
|
|
@ -16,6 +16,7 @@ import com.bonus.material.clz.service.BmTeamService;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -135,8 +136,11 @@ public class BmTeamServiceImpl implements BmTeamService {
|
|||
// 根据i8工程id查询班组信息
|
||||
List<String> ids = Collections.singletonList(tbTeam.getProjectId());
|
||||
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
||||
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
||||
return AjaxResult.success(iwsTeamUserVos);
|
||||
}
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班组信息
|
||||
|
|
|
|||
|
|
@ -177,6 +177,17 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getRetainedEquipmentList(MaterialRetainedEquipmentInfo bean) {
|
||||
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 totalStoreNum = 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 totalRepairInputNum = 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();
|
||||
if (!CollectionUtils.isEmpty(recordList) && deptId != null) {
|
||||
// 删除元素
|
||||
recordList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
if (deptId != null) {
|
||||
bean.setImpUnit(deptId.toString());
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainedEquipmentList(bean);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(recordList)) {
|
||||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
|
|
|
|||
|
|
@ -169,6 +169,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeModelName != null and typeModelName != ''">
|
||||
and mt.type_name like concat('%',#{typeModelName},'%')
|
||||
</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
|
||||
mt.type_id,
|
||||
subquery1.proId
|
||||
|
|
|
|||
Loading…
Reference in New Issue