材料站
This commit is contained in:
parent
802001f039
commit
d70a67e46f
|
|
@ -11,6 +11,7 @@ import javax.validation.constraints.Size;
|
|||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退料任务对象 back_apply_info
|
||||
|
|
@ -190,4 +191,9 @@ public class MaterialBackApplyInfo implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "实施单位id")
|
||||
private String impUnit;
|
||||
|
||||
/**
|
||||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import lombok.experimental.Accessors;
|
|||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退料任务对象 back_apply_info
|
||||
|
|
@ -156,4 +157,9 @@ public class MaterialBackApplyTotalInfo implements Serializable {
|
|||
@ApiModelProperty(value = "实施单位id")
|
||||
private String impUnit;
|
||||
|
||||
/**
|
||||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 领料任务详细对象 lease_apply_details
|
||||
|
|
@ -158,4 +159,9 @@ public class LeaseApplyDetailsInfo extends BaseEntity {
|
|||
|
||||
@ApiModelProperty(value = "实施单位id")
|
||||
private String impUnit;
|
||||
|
||||
/**
|
||||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,4 +305,9 @@ public class MaterialLeaseApplyInfo extends BaseEntity {
|
|||
* 班组长身份证号
|
||||
*/
|
||||
private String teamLeaderIdCard;
|
||||
|
||||
/**
|
||||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -214,4 +214,9 @@ public class MaterialRetainedEquipmentInfo {
|
|||
|
||||
@ApiModelProperty(value = "实施单位id")
|
||||
private String impUnit;
|
||||
|
||||
/**
|
||||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工器具领料记录详情
|
||||
|
|
@ -96,4 +97,9 @@ public class LeaseTotalInfo {
|
|||
|
||||
@ApiModelProperty(value = "身份证号码")
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,19 +81,28 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
*/
|
||||
@Override
|
||||
public List<MaterialBackApplyInfo> selectBackApplyInfoList(MaterialBackApplyInfo backApplyInfo) {
|
||||
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)) {
|
||||
backApplyInfo.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
List<MaterialBackApplyInfo> list = materialBackInfoMapper.selectBackApplyInfoList(backApplyInfo);
|
||||
// 如果列表为空,直接返回空列表
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list) && deptId != null) {
|
||||
// 删除元素
|
||||
list.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
|
||||
// 班组长权限
|
||||
if (teamData != null) {
|
||||
|
|
@ -101,10 +110,10 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
list = list.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
// 材料员权限
|
||||
list = filterList(list, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
// 提取关键字
|
||||
|
|
@ -177,14 +186,23 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
@Override
|
||||
public List<MaterialBackApplyInfo> getTotalList(MaterialBackApplyInfo backApplyInfo) {
|
||||
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)) {
|
||||
backApplyInfo.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
List<MaterialBackApplyInfo> list = materialBackInfoMapper.getTotalList(backApplyInfo);
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list) && deptId != null) {
|
||||
// 删除元素
|
||||
list.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
|
||||
// 班组长权限
|
||||
if (teamData != null) {
|
||||
|
|
@ -192,10 +210,10 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
list = list.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
// 材料员权限
|
||||
list = filterList(list, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
// 如果关键字不为空,进行过滤
|
||||
|
|
@ -519,6 +537,17 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
@Override
|
||||
public List<MaterialBackApplyTotalInfo> getBackInfoDetails(MaterialBackApplyTotalInfo info) {
|
||||
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)) {
|
||||
info.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
BigDecimal backNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
List<MaterialBackApplyTotalInfo> list = materialBackInfoMapper.getBackInfoDetails(info);
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
|
|
@ -526,8 +555,6 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
// 删除元素
|
||||
list.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
|
||||
// 班组长权限
|
||||
if (teamData != null) {
|
||||
|
|
@ -535,10 +562,10 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
list = list.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
// 材料员权限
|
||||
list = filterInfo(list, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (MaterialBackApplyTotalInfo backApplyTotalInfo : list) {
|
||||
|
|
|
|||
|
|
@ -100,6 +100,17 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
@Override
|
||||
public List<MaterialLeaseApplyInfo> selectLeaseApplyInfoList(MaterialLeaseApplyInfo leaseApplyInfo) {
|
||||
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 (!CollectionUtils.isEmpty(projectIdList)) {
|
||||
leaseApplyInfo.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
List<MaterialLeaseApplyInfo> list = materialLeaseInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||
// 利用Stream API进行降序排序
|
||||
List<MaterialLeaseApplyInfo> sortedList = list.stream()
|
||||
|
|
@ -111,17 +122,15 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
// 删除元素
|
||||
sortedList.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
sortedList = sortedList.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getTeamLeaderIdCard()) || username.equals(item.getTeamLeaderIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
sortedList = filterByDataPermission(sortedList);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// 处理剩余数据
|
||||
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||
|
|
@ -226,6 +235,17 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
@Override
|
||||
public List<MaterialLeaseApplyInfo> getTotalList(MaterialLeaseApplyInfo leaseApplyInfo) {
|
||||
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 (!CollectionUtils.isEmpty(projectIdList)) {
|
||||
leaseApplyInfo.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
// 领料数据
|
||||
List<MaterialLeaseApplyInfo> list = materialLeaseInfoMapper.getTotalList(leaseApplyInfo);
|
||||
// 查询领用数据
|
||||
|
|
@ -252,8 +272,6 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
// 删除元素
|
||||
sortedList.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||
// 班组数据权限
|
||||
if (teamData != null) {
|
||||
|
|
@ -261,9 +279,6 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
sortedList = sortedList.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
// 材料员数据权限
|
||||
sortedList = filterByDataPermission(sortedList);
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||
|
|
@ -691,6 +706,17 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
@Override
|
||||
public List<LeaseApplyDetailsInfo> getLeaseInfo(LeaseApplyDetailsInfo dto) {
|
||||
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 (!CollectionUtils.isEmpty(projectIdList)) {
|
||||
dto.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
BigDecimal preNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal alNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal outNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
|
|
@ -700,18 +726,16 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
// 删除元素
|
||||
list.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
if (teamData != null) {
|
||||
// 将list中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
// 材料员权限
|
||||
list = filterList(list, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
String keyWord = dto.getKeyWord();
|
||||
|
|
@ -1105,6 +1129,17 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
@Override
|
||||
public List<LeaseTotalInfo> getLeaseInfoDetails(LeaseTotalInfo info) {
|
||||
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)) {
|
||||
info.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
BigDecimal preNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal outNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal pendingNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
|
|
@ -1114,8 +1149,6 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
// 删除元素
|
||||
list.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
// 班组长权限
|
||||
if (teamData != null) {
|
||||
|
|
@ -1123,10 +1156,10 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
list = list.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
// 材料员权限
|
||||
list = filterListInfo(list, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// 处理数据并计算总和
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
|
|
|
|||
|
|
@ -53,6 +53,17 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
@Override
|
||||
public List<Machine> getMachineInfo(Machine machine) {
|
||||
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)) {
|
||||
machine.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
// 查询slt_agreement_info数据
|
||||
List<Machine> primaryList = materialMachineMapper.getMachineInfo(machine);
|
||||
|
||||
|
|
@ -79,8 +90,6 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
// 删除元素
|
||||
mergedList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(mergedList)) {
|
||||
// 班组权限
|
||||
if (teamData != null) {
|
||||
|
|
@ -141,7 +150,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
}
|
||||
List<Machine> newList = new ArrayList<>();
|
||||
for (Machine info : list) {
|
||||
if (com.bonus.common.core.utils.StringUtils.isBlank(info.getExternalId())) {
|
||||
if (StringUtils.isBlank(info.getExternalId())) {
|
||||
continue;
|
||||
}
|
||||
// 根据i8工程id查询项目部id
|
||||
|
|
@ -311,23 +320,32 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getTeamUseNumList(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);
|
||||
}
|
||||
}
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getTeamUseNumList(bean);
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!CollectionUtils.isEmpty(list) && deptId != null) {
|
||||
// 删除元素
|
||||
list.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
|
||||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
} /*else {
|
||||
list = filterInfo(list, username);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (MaterialRetainedEquipmentInfo retainedEquipmentInfo : list) {
|
||||
|
|
@ -510,12 +528,23 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
*/
|
||||
@Override
|
||||
public MaterialRetainedEquipmentInfo getToolsLedgerDetailsList(MaterialRetainedEquipmentInfo bean) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
try {
|
||||
// 根据用户名判断用户是否为班组长
|
||||
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);
|
||||
}
|
||||
}
|
||||
// 查询slt_agreement_info数据
|
||||
List<MaterialRetainedEquipmentInfo> primaryList = materialMachineMapper.getToolsLedgerDetailsList(bean);
|
||||
// 查询clz_slt_agreement_info数据
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getTeamUseNumDetailsList(bean);
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!CollectionUtils.isEmpty(primaryList) && deptId != null) {
|
||||
// 删除元素
|
||||
|
|
@ -524,8 +553,6 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
if (CollectionUtils.isEmpty(primaryList)) {
|
||||
return new MaterialRetainedEquipmentInfo();
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
|
||||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
|
|
|
|||
|
|
@ -258,4 +258,9 @@ public class Machine extends BaseEntity
|
|||
|
||||
@ApiModelProperty(value = "i8工程id")
|
||||
private String externalId;
|
||||
|
||||
/**
|
||||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,6 +260,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="idCard != null and idCard != ''">
|
||||
and bt.bzz_idcard = #{idCard}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY bai.`code`
|
||||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
|
|
@ -321,6 +327,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="status != null">
|
||||
and tt.task_status = #{status}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY bai.`code`
|
||||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
|
|
@ -581,6 +593,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( bcd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
|
|
|
|||
|
|
@ -376,6 +376,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="idCard != null and idCard != ''">
|
||||
AND bt.bzz_idcard = #{idCard}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY lai.id
|
||||
ORDER BY tt.task_status,tt.create_time desc
|
||||
|
|
@ -427,6 +433,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[ AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
|
|
@ -666,6 +678,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
lai.`code`,mt.type_id
|
||||
</select>
|
||||
|
|
@ -743,6 +761,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maModel != null and maModel != ''">
|
||||
and mt.type_name like concat('%', #{maModel}, '%')
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
mm.ma_id
|
||||
</select>
|
||||
|
|
@ -248,6 +254,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
OR bt.unit_name LIKE concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
bt.unit_name,
|
||||
mt2.type_name;
|
||||
|
|
@ -441,6 +453,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maCode != null and maCode != ''">
|
||||
AND mm.ma_code like concat('%',#{maCode},'%')
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
mt.type_name,
|
||||
mt1.type_name,
|
||||
|
|
@ -578,6 +596,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="maModel != null and maModel != ''">
|
||||
and mt.type_name like concat('%', #{maModel}, '%')
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and bp.external_id in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
mm.ma_id
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue