退料库管权限限制
This commit is contained in:
parent
539c46bbab
commit
86547bba1b
|
|
@ -238,4 +238,14 @@ public class BackApplyInfo {
|
||||||
|
|
||||||
/** 操作后库存 */
|
/** 操作后库存 */
|
||||||
private int postStoreNum;
|
private int postStoreNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库管id字符集
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库管id集合
|
||||||
|
*/
|
||||||
|
private List<Long> userIds;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.sgzb.app.service.impl;
|
package com.bonus.sgzb.app.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||||
import com.bonus.sgzb.app.domain.TmTask;
|
import com.bonus.sgzb.app.domain.TmTask;
|
||||||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||||
|
|
@ -17,10 +18,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
import java.util.stream.Collectors;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hay
|
* @author hay
|
||||||
|
|
@ -61,9 +60,27 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BackApplyInfo> receiveView(BackApplyInfo record) {
|
public List<BackApplyInfo> receiveView(BackApplyInfo record) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
List<BackApplyInfo> list = new ArrayList<>();
|
||||||
|
List<Long> longs = new ArrayList<>();
|
||||||
List<BackApplyInfo> backApplyInfoList = backReceiveMapper.receiveView(record);
|
List<BackApplyInfo> backApplyInfoList = backReceiveMapper.receiveView(record);
|
||||||
|
if (SecurityUtils.getLoginUser().getRoles().contains("admin")) {
|
||||||
return backApplyInfoList;
|
return backApplyInfoList;
|
||||||
}
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(backApplyInfoList)) {
|
||||||
|
for (BackApplyInfo backApplyInfo : backApplyInfoList) {
|
||||||
|
if (StringUtils.isNotBlank(backApplyInfo.getUserId())) {
|
||||||
|
List<String> strings = Arrays.asList(backApplyInfo.getUserId().split(","));
|
||||||
|
//转换为long类型
|
||||||
|
longs = strings.stream().map(Long::parseLong).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if (longs.contains(userId)) {
|
||||||
|
list.add(backApplyInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
public List<BackApplyInfo> receiveView2(BackApplyInfo record) {
|
public List<BackApplyInfo> receiveView2(BackApplyInfo record) {
|
||||||
List<BackApplyInfo> backApplyInfoList = backReceiveMapper.receiveView2(record);
|
List<BackApplyInfo> backApplyInfoList = backReceiveMapper.receiveView2(record);
|
||||||
|
|
|
||||||
|
|
@ -719,7 +719,8 @@
|
||||||
bb.finished_back_num,
|
bb.finished_back_num,
|
||||||
mt.manage_type as manageType,
|
mt.manage_type as manageType,
|
||||||
mt.company_id as companyId,
|
mt.company_id as companyId,
|
||||||
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`
|
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`,
|
||||||
|
mtk.userId as userId
|
||||||
FROM
|
FROM
|
||||||
back_apply_details bad
|
back_apply_details bad
|
||||||
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id
|
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id
|
||||||
|
|
@ -746,6 +747,14 @@
|
||||||
parent_id=#{id} and is_finished = 1
|
parent_id=#{id} and is_finished = 1
|
||||||
GROUP BY type_id
|
GROUP BY type_id
|
||||||
) bb on bb.typeId=bad.type_id
|
) bb on bb.typeId=bad.type_id
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
type_id as typeId,
|
||||||
|
GROUP_CONCAT(user_id) as userId
|
||||||
|
FROM
|
||||||
|
ma_type_keeper
|
||||||
|
GROUP BY type_id
|
||||||
|
) mtk ON mtk.typeId = bad.type_id
|
||||||
WHERE
|
WHERE
|
||||||
bai.id=#{id}
|
bai.id=#{id}
|
||||||
<if test="typeId != null and typeId != ''">
|
<if test="typeId != null and typeId != ''">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue