材料站权限
This commit is contained in:
parent
492b4c4b92
commit
f16a59ce04
|
|
@ -120,4 +120,11 @@ public interface MaterialMachineMapper {
|
|||
* @return
|
||||
*/
|
||||
MaterialUseStorageInfo selectUseInFo(MaterialUseStorageInfo useStorageInfo);
|
||||
|
||||
/**
|
||||
* 获取设备状态
|
||||
* @param machine1
|
||||
* @return
|
||||
*/
|
||||
MaterialSltAgreementInfo selectStatusByUserId(Machine machine1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -520,7 +520,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
sortedList = sortedList.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -261,7 +261,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
sortedList = sortedList.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -523,7 +523,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
if (teamData != null) {
|
||||
// 将list中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -893,7 +893,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
if (teamData != null) {
|
||||
// 将list中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,8 +78,11 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
for (Machine machine1 : mergedList) {
|
||||
if (machine1.getMaId() != null) {
|
||||
MaterialSltAgreementInfo sltAgreementInfo = materialMachineMapper.selectStatusById(machine1);
|
||||
MaterialSltAgreementInfo materialSltAgreementInfo = materialMachineMapper.selectStatusByUserId(machine1);
|
||||
if (sltAgreementInfo != null) {
|
||||
machine1.setMaStatus("在用");
|
||||
} else if (materialSltAgreementInfo != null) {
|
||||
machine1.setMaStatus("退回");
|
||||
} else {
|
||||
machine1.setMaStatus("在库");
|
||||
}
|
||||
|
|
@ -130,7 +133,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
recordList = recordList.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -233,7 +236,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> bean.getTeamLeaderIdCard().equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -270,7 +273,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> bean.getTeamLeaderIdCard().equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -325,8 +328,6 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
*/
|
||||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getToolsLedgerList(MaterialRetainedEquipmentInfo bean) {
|
||||
//1、获取当前用户名
|
||||
String userName = SecurityUtils.getLoginUser().getUsername();
|
||||
List<MaterialRetainedEquipmentInfo> list1 =new ArrayList<>();
|
||||
try {
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getToolsLedgerList(bean);
|
||||
|
|
@ -336,15 +337,6 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
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 -> userName.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list1 = groupByThirdTypeId(list);
|
||||
}
|
||||
|
|
@ -376,7 +368,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
list = list.stream()
|
||||
.filter(item -> username.equals(item.getIdCard()))
|
||||
.filter(item -> StringUtils.isBlank(item.getIdCard()) || username.equals(item.getIdCard()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -439,21 +431,8 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getToolsDetailsList(MaterialRetainedEquipmentInfo bean) {
|
||||
try {
|
||||
//1、获取当前用户名
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
//2、判断用户是否为班组长,且对应的是否有班组
|
||||
BmTeam bmTeam = materialMachineMapper.getTeamData(username);
|
||||
List<MaterialRetainedEquipmentInfo> list = new ArrayList<>();
|
||||
if (bmTeam != null) {
|
||||
//不为空,则 是班组长且对应的有班组
|
||||
MaCodeVo bean1 = new MaCodeVo();
|
||||
bean1.setTeamId(bmTeam.getId());
|
||||
bean1.setTypeId(bean.getTypeId()+"");
|
||||
list = materialMachineMapper.getToolsDetailsListByTeam(bean1);
|
||||
} else {
|
||||
//没有班组,则查全部
|
||||
list = materialMachineMapper.getToolsDetailsList(bean);
|
||||
}
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineMapper.getToolsDetailsList(bean);
|
||||
if (!CollectionUtil.isEmpty(list)) {
|
||||
for (MaterialRetainedEquipmentInfo retainedEquipmentInfo : list) {
|
||||
if (StringUtils.isNotBlank(retainedEquipmentInfo.getNextCheckTime())) {
|
||||
|
|
|
|||
|
|
@ -246,4 +246,10 @@ public class Machine extends BaseEntity
|
|||
|
||||
@ApiModelProperty(value = "标准箱ID")
|
||||
private Long boxId;
|
||||
|
||||
@ApiModelProperty(value = "实施单位id")
|
||||
private String impUnit;
|
||||
|
||||
@ApiModelProperty(value = "身份证号码")
|
||||
private String idCard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mm.inspect_man AS checkMan,
|
||||
mm.out_fac_time AS outFacTime,
|
||||
mm.create_time AS inputTime,
|
||||
mm.ma_id AS maId
|
||||
mm.ma_id AS maId,
|
||||
bp.imp_unit AS impUnit,
|
||||
bu.bzz_idcard AS idCard
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
left join ma_machine mm ON sai.type_id = mm.type_id and mm.ma_id = sai.ma_id
|
||||
|
|
@ -25,6 +27,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0
|
||||
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0
|
||||
left join ma_type mt3 ON mt3.type_id = mt2.parent_id and mt3.del_flag = 0
|
||||
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
|
||||
WHERE sai.`status` = '0' and mm.ma_code is not NULL
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
|
|
@ -494,7 +499,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY
|
||||
mt.type_name,
|
||||
mt1.type_name,
|
||||
mm.ma_code
|
||||
mm.ma_id
|
||||
</select>
|
||||
|
||||
<select id="selectStatusById" resultType="com.bonus.material.clz.domain.vo.MaterialSltAgreementInfo">
|
||||
|
|
@ -593,4 +598,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY parent_id
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectStatusByUserId" resultType="com.bonus.material.clz.domain.vo.MaterialSltAgreementInfo">
|
||||
SELECT
|
||||
type_id as typeId,
|
||||
ma_id as maId,
|
||||
status as status
|
||||
FROM clz_slt_agreement_info
|
||||
WHERE status = '1' and ma_id = #{maId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue