Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4375cbe920
|
|
@ -63,9 +63,10 @@ public class MaterialMachineController extends BaseController {
|
||||||
List<MaterialRetainedEquipmentInfo> pageList = materialMachineService.getRetainedEquipmentList(bean);
|
List<MaterialRetainedEquipmentInfo> pageList = materialMachineService.getRetainedEquipmentList(bean);
|
||||||
return AjaxResult.success(pageList);
|
return AjaxResult.success(pageList);
|
||||||
}
|
}
|
||||||
startPage();
|
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||||
List<MaterialRetainedEquipmentInfo> pageList = materialMachineService.getRetainedEquipmentList(bean);
|
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||||
return AjaxResult.success(getDataTable(pageList));
|
List<MaterialRetainedEquipmentInfo> list = materialMachineService.getRetainedEquipmentList(bean);
|
||||||
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -183,4 +183,7 @@ public class MaterialBackApplyInfo implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "身份证号码")
|
@ApiModelProperty(value = "身份证号码")
|
||||||
private String idCard;
|
private String idCard;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "i8工程id")
|
||||||
|
private String externalId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,4 +147,7 @@ public class MaterialBackApplyTotalInfo implements Serializable {
|
||||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||||
private String manageType;
|
private String manageType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "i8工程id")
|
||||||
|
private String externalId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -281,4 +281,10 @@ public class MaterialLeaseApplyInfo extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "协议id集合")
|
@ApiModelProperty(value = "协议id集合")
|
||||||
private List<Long> agreementIdList;
|
private List<Long> agreementIdList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "i8工程id")
|
||||||
|
private String externalId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "项目部id")
|
||||||
|
private Long departId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,4 +69,10 @@ public class MaterialStorageInfo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "领料编码")
|
@ApiModelProperty(value = "领料编码")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程id")
|
||||||
|
private String proId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "编码ID")
|
||||||
|
private String maId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,4 +68,10 @@ public class MaterialUseStorageInfo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "关键字")
|
@ApiModelProperty(value = "关键字")
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程id")
|
||||||
|
private String proId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "编码ID")
|
||||||
|
private String maId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,13 @@ public class MaterialRetainedEquipmentInfo {
|
||||||
@ApiModelProperty(value = "仓库信息")
|
@ApiModelProperty(value = "仓库信息")
|
||||||
private String whHouseName;
|
private String whHouseName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程id")
|
||||||
|
private String proId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程名称")
|
||||||
|
@Excel(name = "工程名称")
|
||||||
|
private String proName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "施工类型")
|
@ApiModelProperty(value = "施工类型")
|
||||||
@Excel(name = "施工类型")
|
@Excel(name = "施工类型")
|
||||||
private String constructionType;
|
private String constructionType;
|
||||||
|
|
@ -199,10 +206,6 @@ public class MaterialRetainedEquipmentInfo {
|
||||||
*/
|
*/
|
||||||
private String teamLeaderIdCard;
|
private String teamLeaderIdCard;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程id")
|
@ApiModelProperty(value = "i8工程id")
|
||||||
private String proId;
|
private String externalId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "工程名称")
|
|
||||||
@Excel(name = "工程名称")
|
|
||||||
private String proName;
|
|
||||||
}
|
}
|
||||||
|
|
@ -87,4 +87,7 @@ public class LeaseTotalInfo {
|
||||||
|
|
||||||
@ApiModelProperty(value = "管理模式")
|
@ApiModelProperty(value = "管理模式")
|
||||||
private String manageType;
|
private String manageType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "i8工程id")
|
||||||
|
private String externalId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.back.domain.MaCodeDto;
|
import com.bonus.material.back.domain.MaCodeDto;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
|
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||||
import com.bonus.material.common.mapper.SelectMapper;
|
import com.bonus.material.common.mapper.SelectMapper;
|
||||||
import com.bonus.material.ma.mapper.MachineMapper;
|
import com.bonus.material.ma.mapper.MachineMapper;
|
||||||
import com.bonus.material.clz.domain.back.MaterialBackApplyDetails;
|
import com.bonus.material.clz.domain.back.MaterialBackApplyDetails;
|
||||||
|
|
@ -81,30 +82,44 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
// 提取关键字
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
String keyWord = backApplyInfo.getKeyWord();
|
list.removeIf(info -> {
|
||||||
// 如果关键字不为空,进行过滤
|
if (StringUtils.isBlank(info.getExternalId())) {
|
||||||
if (!StringUtils.isBlank(keyWord)) {
|
return true;
|
||||||
list = list.stream()
|
}
|
||||||
.filter(item -> containsKeyword(item, keyWord))
|
MaterialLeaseApplyInfo i8ProjectInfo = mapper.selectI8ProjectInfo(info.getExternalId());
|
||||||
.collect(Collectors.toList());
|
if (i8ProjectInfo == null || i8ProjectInfo.getDepartId() == null) {
|
||||||
}
|
return true;
|
||||||
// 如果需要导出
|
}
|
||||||
if (backApplyInfo.getIsExport()) {
|
List<String> userNameList = mapper.getUserNameList(i8ProjectInfo);
|
||||||
for (MaterialBackApplyInfo applyInfo : list) {
|
return CollectionUtils.isEmpty(userNameList) || !userNameList.contains(username);
|
||||||
applyInfo.setPrintStatus("0".equals(applyInfo.getPrintStatus()) ? "未打印" : "已打印");
|
});
|
||||||
switch (applyInfo.getStatus()) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
case "0":
|
// 提取关键字
|
||||||
applyInfo.setStatus("退料未完成");
|
String keyWord = backApplyInfo.getKeyWord();
|
||||||
break;
|
// 如果关键字不为空,进行过滤
|
||||||
case "1":
|
if (!StringUtils.isBlank(keyWord)) {
|
||||||
applyInfo.setStatus("维修驳回");
|
list = list.stream()
|
||||||
break;
|
.filter(item -> containsKeyword(item, keyWord))
|
||||||
case "2":
|
.collect(Collectors.toList());
|
||||||
applyInfo.setStatus("退料已完成");
|
}
|
||||||
break;
|
// 如果需要导出
|
||||||
default:
|
if (backApplyInfo.getIsExport()) {
|
||||||
break;
|
for (MaterialBackApplyInfo applyInfo : list) {
|
||||||
|
applyInfo.setPrintStatus("0".equals(applyInfo.getPrintStatus()) ? "未打印" : "已打印");
|
||||||
|
switch (applyInfo.getStatus()) {
|
||||||
|
case "0":
|
||||||
|
applyInfo.setStatus("退料未完成");
|
||||||
|
break;
|
||||||
|
case "1":
|
||||||
|
applyInfo.setStatus("维修驳回");
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
applyInfo.setStatus("退料已完成");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -119,6 +134,21 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
@Override
|
@Override
|
||||||
public List<MaterialBackApplyInfo> getTotalList(MaterialBackApplyInfo backApplyInfo) {
|
public List<MaterialBackApplyInfo> getTotalList(MaterialBackApplyInfo backApplyInfo) {
|
||||||
List<MaterialBackApplyInfo> list = materialBackInfoMapper.getTotalList(backApplyInfo);
|
List<MaterialBackApplyInfo> list = materialBackInfoMapper.getTotalList(backApplyInfo);
|
||||||
|
// 安全过滤数据权限
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
list.removeIf(leaseTotalInfo -> {
|
||||||
|
if (StringUtils.isBlank(leaseTotalInfo.getExternalId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
MaterialLeaseApplyInfo i8ProjectInfo = mapper.selectI8ProjectInfo(leaseTotalInfo.getExternalId());
|
||||||
|
if (i8ProjectInfo == null || i8ProjectInfo.getDepartId() == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
List<String> userNameList = mapper.getUserNameList(i8ProjectInfo);
|
||||||
|
return org.springframework.util.CollectionUtils.isEmpty(userNameList) || !userNameList.contains(username);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
// 如果关键字不为空,进行过滤
|
// 如果关键字不为空,进行过滤
|
||||||
if (!StringUtils.isBlank(backApplyInfo.getKeyWord())) {
|
if (!StringUtils.isBlank(backApplyInfo.getKeyWord())) {
|
||||||
|
|
@ -444,6 +474,20 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
public List<MaterialBackApplyTotalInfo> getBackInfoDetails(MaterialBackApplyTotalInfo info) {
|
public List<MaterialBackApplyTotalInfo> getBackInfoDetails(MaterialBackApplyTotalInfo info) {
|
||||||
BigDecimal backNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
BigDecimal backNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||||
List<MaterialBackApplyTotalInfo> list = materialBackInfoMapper.getBackInfoDetails(info);
|
List<MaterialBackApplyTotalInfo> list = materialBackInfoMapper.getBackInfoDetails(info);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
list.removeIf(b -> {
|
||||||
|
if (StringUtils.isBlank(b.getExternalId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
MaterialLeaseApplyInfo i8ProjectInfo = mapper.selectI8ProjectInfo(b.getExternalId());
|
||||||
|
if (i8ProjectInfo == null || i8ProjectInfo.getDepartId() == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
List<String> userNameList = mapper.getUserNameList(i8ProjectInfo);
|
||||||
|
return CollectionUtils.isEmpty(userNameList) || !userNameList.contains(username);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
for (MaterialBackApplyTotalInfo backApplyTotalInfo : list) {
|
for (MaterialBackApplyTotalInfo backApplyTotalInfo : list) {
|
||||||
backNum = backNum.add(backApplyTotalInfo.getBackNum());
|
backNum = backNum.add(backApplyTotalInfo.getBackNum());
|
||||||
|
|
@ -635,7 +679,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
|
||||||
/**
|
/**
|
||||||
* 删除编码设备附件
|
* 删除编码设备附件
|
||||||
* @param maCodeList
|
* @param maCodeList
|
||||||
* @param id
|
* @param taskId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int deleteFileInfoForMaCodes(List<MaCodeVo> maCodeList, Long taskId) {
|
private int deleteFileInfoForMaCodes(List<MaCodeVo> maCodeList, Long taskId) {
|
||||||
|
|
|
||||||
|
|
@ -84,41 +84,32 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询领料任务列表
|
* 查询领料任务列表
|
||||||
|
*
|
||||||
* @param leaseApplyInfo
|
* @param leaseApplyInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MaterialLeaseApplyInfo> selectLeaseApplyInfoList(MaterialLeaseApplyInfo leaseApplyInfo) {
|
public List<MaterialLeaseApplyInfo> selectLeaseApplyInfoList(MaterialLeaseApplyInfo leaseApplyInfo) {
|
||||||
List<MaterialLeaseApplyInfo> list = materialLeaseInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
List<MaterialLeaseApplyInfo> list = materialLeaseInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||||
// 使用 Stream API 进行降序排序
|
// 利用Stream API进行降序排序
|
||||||
List<MaterialLeaseApplyInfo> sortedList = list.stream()
|
List<MaterialLeaseApplyInfo> sortedList = list.stream()
|
||||||
.sorted(Comparator.comparing(MaterialLeaseApplyInfo::getCreateTime).reversed())
|
.sorted(Comparator.comparing(MaterialLeaseApplyInfo::getCreateTime).reversed())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 数据权限划分
|
||||||
|
sortedList = filterByDataPermission(sortedList);
|
||||||
|
// 处理剩余数据
|
||||||
if (!CollectionUtils.isEmpty(sortedList)) {
|
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||||
for (MaterialLeaseApplyInfo applyInfo : sortedList) {
|
processLeaseApplyInfo(sortedList);
|
||||||
// 根据id查询已领料出库数据
|
// 关键字过滤
|
||||||
BigDecimal num = materialLeaseInfoMapper.getNumList(applyInfo);
|
|
||||||
if (num == null) {
|
|
||||||
num = BigDecimal.ZERO;
|
|
||||||
}
|
|
||||||
applyInfo.setAlNum(num);
|
|
||||||
applyInfo.setWaitCountNum(applyInfo.getPreCountNum().subtract(num).compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO : applyInfo.getPreCountNum().subtract(num));
|
|
||||||
if (StringUtils.isNotBlank(applyInfo.getLeaseSignUrl())) {
|
|
||||||
applyInfo.setIsElectronicSign(0);
|
|
||||||
} else {
|
|
||||||
applyInfo.setIsElectronicSign(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String keyWord = leaseApplyInfo.getKeyWord();
|
String keyWord = leaseApplyInfo.getKeyWord();
|
||||||
// 如果关键字不为空,进行过滤
|
|
||||||
if (!StringUtils.isBlank(keyWord)) {
|
if (!StringUtils.isBlank(keyWord)) {
|
||||||
sortedList = sortedList.stream()
|
sortedList = sortedList.stream()
|
||||||
.filter(item -> containsKeyword(item, keyWord))
|
.filter(item -> containsKeyword(item, keyWord))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
// 判断状态
|
// 状态过滤
|
||||||
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
||||||
// 将集合sortedList中状态taskStatus包含在leaseApplyInfo.getStatusList()中的元素
|
|
||||||
sortedList = sortedList.stream()
|
sortedList = sortedList.stream()
|
||||||
.filter(item -> leaseApplyInfo.getStatusList().contains(item.getTaskStatus()))
|
.filter(item -> leaseApplyInfo.getStatusList().contains(item.getTaskStatus()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
@ -127,8 +118,59 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
return sortedList;
|
return sortedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限过滤
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<MaterialLeaseApplyInfo> filterByDataPermission(List<MaterialLeaseApplyInfo> list) {
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
return list.stream()
|
||||||
|
.filter(info -> {
|
||||||
|
if (StringUtils.isBlank(info.getExternalId())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 根据i8工程id查询项目部id
|
||||||
|
MaterialLeaseApplyInfo i8ProjectInfo = mapper.selectI8ProjectInfo(info.getExternalId());
|
||||||
|
if (i8ProjectInfo == null || i8ProjectInfo.getDepartId() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
List<String> userNameList = mapper.getUserNameList(i8ProjectInfo);
|
||||||
|
return !CollectionUtils.isEmpty(userNameList) && userNameList.contains(username);
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理数据
|
||||||
|
*
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
private void processLeaseApplyInfo(List<MaterialLeaseApplyInfo> list) {
|
||||||
|
for (MaterialLeaseApplyInfo applyInfo : list) {
|
||||||
|
// 根据id查询已领料出库数据
|
||||||
|
BigDecimal num = materialLeaseInfoMapper.getNumList(applyInfo);
|
||||||
|
if (num == null) {
|
||||||
|
num = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
applyInfo.setAlNum(num);
|
||||||
|
applyInfo.setWaitCountNum(applyInfo.getPreCountNum().subtract(num).compareTo(BigDecimal.ZERO) <= 0 ?
|
||||||
|
BigDecimal.ZERO : applyInfo.getPreCountNum().subtract(num));
|
||||||
|
if (StringUtils.isNotBlank(applyInfo.getLeaseSignUrl())) {
|
||||||
|
applyInfo.setIsElectronicSign(0);
|
||||||
|
} else {
|
||||||
|
applyInfo.setIsElectronicSign(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关键字搜索
|
* 关键字搜索
|
||||||
|
*
|
||||||
* @param item
|
* @param item
|
||||||
* @param keyWord
|
* @param keyWord
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -147,6 +189,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询总站点领料记录数据
|
* 查询总站点领料记录数据
|
||||||
|
*
|
||||||
* @param leaseApplyInfo
|
* @param leaseApplyInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -173,6 +216,21 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
.sorted(Comparator.comparing(MaterialLeaseApplyInfo::getCreateTime,
|
.sorted(Comparator.comparing(MaterialLeaseApplyInfo::getCreateTime,
|
||||||
Comparator.nullsLast(Comparator.naturalOrder())).reversed())
|
Comparator.nullsLast(Comparator.naturalOrder())).reversed())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
// 安全过滤数据权限
|
||||||
|
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
sortedList.removeIf(leaseTotalInfo -> {
|
||||||
|
if (StringUtils.isBlank(leaseTotalInfo.getExternalId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
MaterialLeaseApplyInfo i8ProjectInfo = mapper.selectI8ProjectInfo(leaseTotalInfo.getExternalId());
|
||||||
|
if (i8ProjectInfo == null || i8ProjectInfo.getDepartId() == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
List<String> userNameList = mapper.getUserNameList(i8ProjectInfo);
|
||||||
|
return CollectionUtils.isEmpty(userNameList) || !userNameList.contains(username);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (!CollectionUtils.isEmpty(sortedList)) {
|
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||||
// 如果关键字不为空,进行过滤
|
// 如果关键字不为空,进行过滤
|
||||||
if (!StringUtils.isBlank(leaseApplyInfo.getKeyWord())) {
|
if (!StringUtils.isBlank(leaseApplyInfo.getKeyWord())) {
|
||||||
|
|
@ -186,6 +244,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询总站点领料详情数据
|
* 查询总站点领料详情数据
|
||||||
|
*
|
||||||
* @param leaseApplyInfo
|
* @param leaseApplyInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -196,6 +255,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取领料任务详细信息
|
* 获取领料任务详细信息
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @param keyWord
|
* @param keyWord
|
||||||
* @param publishTask
|
* @param publishTask
|
||||||
|
|
@ -295,7 +355,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
}
|
}
|
||||||
msgBuilder.append("已被他人完成出库,请注意查看!");
|
msgBuilder.append("已被他人完成出库,请注意查看!");
|
||||||
String msg = msgBuilder.toString();
|
String msg = msgBuilder.toString();
|
||||||
msg = msg.replaceAll("\n","");
|
msg = msg.replaceAll("\n", "");
|
||||||
ajaxResult.put("msg", msg);
|
ajaxResult.put("msg", msg);
|
||||||
}
|
}
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
|
|
@ -308,6 +368,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取领料单详情
|
* 获取领料单详情
|
||||||
|
*
|
||||||
* @param leaseApplyDetails
|
* @param leaseApplyDetails
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -315,7 +376,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
public List<MaterialLeaseApplyDetails> getOutNum(MaterialLeaseApplyDetails leaseApplyDetails) {
|
public List<MaterialLeaseApplyDetails> getOutNum(MaterialLeaseApplyDetails leaseApplyDetails) {
|
||||||
List<MaterialLeaseApplyDetails> list = materialLeaseInfoMapper.getOutNum(leaseApplyDetails);
|
List<MaterialLeaseApplyDetails> list = materialLeaseInfoMapper.getOutNum(leaseApplyDetails);
|
||||||
// 根据id去出库表查询数据,进行数据拼接
|
// 根据id去出库表查询数据,进行数据拼接
|
||||||
List<MaterialLeaseApplyDetails> outNumList = materialLeaseInfoMapper.getOutNumList(leaseApplyDetails);
|
List<MaterialLeaseApplyDetails> outNumList = materialLeaseInfoMapper.getOutNumList(leaseApplyDetails);
|
||||||
// 构建typeId到LeaseApplyDetails的映射,用于快速查找
|
// 构建typeId到LeaseApplyDetails的映射,用于快速查找
|
||||||
Map<Long, MaterialLeaseApplyDetails> outNumMap = outNumList.stream()
|
Map<Long, MaterialLeaseApplyDetails> outNumMap = outNumList.stream()
|
||||||
.collect(Collectors.toMap(MaterialLeaseApplyDetails::getTypeId, details -> details, (existing, replacement) -> existing));
|
.collect(Collectors.toMap(MaterialLeaseApplyDetails::getTypeId, details -> details, (existing, replacement) -> existing));
|
||||||
|
|
@ -324,7 +385,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
list.forEach(applyDetails -> {
|
list.forEach(applyDetails -> {
|
||||||
if (outNumMap.containsKey(applyDetails.getTypeId())) {
|
if (outNumMap.containsKey(applyDetails.getTypeId())) {
|
||||||
outNumMap.remove(applyDetails.getTypeId());// 移除已匹配的项
|
outNumMap.remove(applyDetails.getTypeId());// 移除已匹配的项
|
||||||
if (applyDetails.getOutNum().compareTo(BigDecimal.ZERO) == 0){
|
if (applyDetails.getOutNum().compareTo(BigDecimal.ZERO) == 0) {
|
||||||
applyDetails.setStatus("1");
|
applyDetails.setStatus("1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -344,6 +405,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取领料单详情
|
* 获取领料单详情
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -378,6 +440,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出工器具领料出库详情
|
* 导出工器具领料出库详情
|
||||||
|
*
|
||||||
* @param leaseApplyInfo
|
* @param leaseApplyInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -404,6 +467,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工器具领料记录数据
|
* 工器具领料记录数据
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -440,6 +504,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加工器具领料
|
* 添加工器具领料
|
||||||
|
*
|
||||||
* @param leaseApplyRequestVo
|
* @param leaseApplyRequestVo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -477,12 +542,12 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
if (leaseApplyRequestVo.getLeaseApplyInfo().getIsOut() == 1) {
|
if (leaseApplyRequestVo.getLeaseApplyInfo().getIsOut() == 1) {
|
||||||
tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_MATERIAL_LEASE.getTaskTypeId(),
|
tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_MATERIAL_LEASE.getTaskTypeId(),
|
||||||
LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus(),
|
LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus(),
|
||||||
leaseApplyRequestVo.getLeaseApplyInfo().getCompanyId(),thisMonthMaxOrder + 1, taskCode);
|
leaseApplyRequestVo.getLeaseApplyInfo().getCompanyId(), thisMonthMaxOrder + 1, taskCode);
|
||||||
} else {
|
} else {
|
||||||
tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_MATERIAL_LEASE.getTaskTypeId(),
|
tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_MATERIAL_LEASE.getTaskTypeId(),
|
||||||
// 待出库
|
// 待出库
|
||||||
LeaseTaskStatusEnum.LEASE_TASK_TO_PUBLISHED.getStatus(),
|
LeaseTaskStatusEnum.LEASE_TASK_TO_PUBLISHED.getStatus(),
|
||||||
leaseApplyRequestVo.getLeaseApplyInfo().getCompanyId(),thisMonthMaxOrder + 1, taskCode);
|
leaseApplyRequestVo.getLeaseApplyInfo().getCompanyId(), thisMonthMaxOrder + 1, taskCode);
|
||||||
}
|
}
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTask.setCreateBy(createBy);
|
tmTask.setCreateBy(createBy);
|
||||||
|
|
@ -531,7 +596,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
return insertPurchaseCheckDetails(createBy, tmTask.getTaskId(),leaseApplyRequestVo.getLeaseApplyDetailsList(), leaseApplyRequestVo.getLeaseApplyInfo().getId(), leaseApplyRequestVo.getLeaseApplyInfo().getIsOut());
|
return insertPurchaseCheckDetails(createBy, tmTask.getTaskId(), leaseApplyRequestVo.getLeaseApplyDetailsList(), leaseApplyRequestVo.getLeaseApplyInfo().getId(), leaseApplyRequestVo.getLeaseApplyInfo().getIsOut());
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("新增任务失败,lease_apply_info表插入0条");
|
return AjaxResult.error("新增任务失败,lease_apply_info表插入0条");
|
||||||
}
|
}
|
||||||
|
|
@ -544,6 +609,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取协议编号
|
* 获取协议编号
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String getAgreementCode() {
|
private String getAgreementCode() {
|
||||||
|
|
@ -557,6 +623,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改领料任务
|
* 修改领料任务
|
||||||
|
*
|
||||||
* @param leaseApplyRequestVo
|
* @param leaseApplyRequestVo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -642,6 +709,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料任务电子签名
|
* 领料任务电子签名
|
||||||
|
*
|
||||||
* @param leaseApplyInfo
|
* @param leaseApplyInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -654,6 +722,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 二维码出库:根据qrcode查询在库机具信息
|
* 二维码出库:根据qrcode查询在库机具信息
|
||||||
|
*
|
||||||
* @param bmQrcodeInfo
|
* @param bmQrcodeInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -668,7 +737,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
recordList = recordList.stream().filter(item -> item.getMaStatus().equals(MaMachineStatusEnum.IN_STORE.getStatus().toString())).collect(Collectors.toList());
|
recordList = recordList.stream().filter(item -> item.getMaStatus().equals(MaMachineStatusEnum.IN_STORE.getStatus().toString())).collect(Collectors.toList());
|
||||||
if (recordList.size() > 0) {
|
if (recordList.size() > 0) {
|
||||||
msg = "监测到" + bmQrcodeInfo.getQrCode() + "符合出库条件,请确认是否出库!";
|
msg = "监测到" + bmQrcodeInfo.getQrCode() + "符合出库条件,请确认是否出库!";
|
||||||
}else{
|
} else {
|
||||||
msg = "监测到" + bmQrcodeInfo.getQrCode() + "编码不符合出库条件,请检查后重新提交!";
|
msg = "监测到" + bmQrcodeInfo.getQrCode() + "编码不符合出库条件,请检查后重新提交!";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -683,6 +752,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* app领料出库提交
|
* app领料出库提交
|
||||||
|
*
|
||||||
* @param leaseApplyDetails
|
* @param leaseApplyDetails
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -692,7 +762,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
if (leaseApplyDetails.getIsSubmit() != null && leaseApplyDetails.getIsSubmit() == 0) {
|
if (leaseApplyDetails.getIsSubmit() != null && leaseApplyDetails.getIsSubmit() == 0) {
|
||||||
List<MaterialLeaseApplyDetails> list = materialLeaseInfoMapper.getOutNum(leaseApplyDetails);
|
List<MaterialLeaseApplyDetails> list = materialLeaseInfoMapper.getOutNum(leaseApplyDetails);
|
||||||
// 根据id去出库表查询数据,进行数据拼接
|
// 根据id去出库表查询数据,进行数据拼接
|
||||||
List<MaterialLeaseApplyDetails> outNumList = materialLeaseInfoMapper.getOutNumList(leaseApplyDetails);
|
List<MaterialLeaseApplyDetails> outNumList = materialLeaseInfoMapper.getOutNumList(leaseApplyDetails);
|
||||||
// 构建typeId到LeaseApplyDetails的映射,用于快速查找
|
// 构建typeId到LeaseApplyDetails的映射,用于快速查找
|
||||||
Map<Long, MaterialLeaseApplyDetails> outNumMap = outNumList.stream()
|
Map<Long, MaterialLeaseApplyDetails> outNumMap = outNumList.stream()
|
||||||
.collect(Collectors.toMap(MaterialLeaseApplyDetails::getTypeId, details -> details, (existing, replacement) -> existing));
|
.collect(Collectors.toMap(MaterialLeaseApplyDetails::getTypeId, details -> details, (existing, replacement) -> existing));
|
||||||
|
|
@ -724,6 +794,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除领料任务
|
* 删除领料任务
|
||||||
|
*
|
||||||
* @param ids
|
* @param ids
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -741,6 +812,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工器具领料记录
|
* 工器具领料记录
|
||||||
|
*
|
||||||
* @param info
|
* @param info
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -750,25 +822,47 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
||||||
BigDecimal outNum = 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);
|
BigDecimal pendingNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||||
List<LeaseTotalInfo> list = materialLeaseInfoMapper.getLeaseInfoDetails(info);
|
List<LeaseTotalInfo> list = materialLeaseInfoMapper.getLeaseInfoDetails(info);
|
||||||
|
// 安全过滤数据权限
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
list.removeIf(leaseTotalInfo -> {
|
||||||
|
if (StringUtils.isBlank(leaseTotalInfo.getExternalId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
MaterialLeaseApplyInfo i8ProjectInfo = mapper.selectI8ProjectInfo(leaseTotalInfo.getExternalId());
|
||||||
|
if (i8ProjectInfo == null || i8ProjectInfo.getDepartId() == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
List<String> userNameList = mapper.getUserNameList(i8ProjectInfo);
|
||||||
|
return CollectionUtils.isEmpty(userNameList) || !userNameList.contains(username);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 处理数据并计算总和
|
||||||
if (!CollectionUtils.isEmpty(list)) {
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
for (LeaseTotalInfo leaseTotalInfo : list) {
|
for (LeaseTotalInfo leaseTotalInfo : list) {
|
||||||
// 根据typeId和parentId查询领料数量
|
// 根据typeId和parentId查询领料数量
|
||||||
LeaseTotalInfo totalInfo = materialLeaseInfoMapper.getTotalInfo(leaseTotalInfo);
|
LeaseTotalInfo totalInfo = materialLeaseInfoMapper.getTotalInfo(leaseTotalInfo);
|
||||||
if (totalInfo != null) {
|
if (totalInfo != null) {
|
||||||
leaseTotalInfo.setPreNum(totalInfo.getPreNum());
|
leaseTotalInfo.setPreNum(totalInfo.getPreNum());
|
||||||
leaseTotalInfo.setPendingNum(leaseTotalInfo.getPreNum().subtract(leaseTotalInfo.getOutNum()));
|
// 安全计算pendingNum,避免NPE
|
||||||
|
BigDecimal outNumValue = leaseTotalInfo.getOutNum() != null ? leaseTotalInfo.getOutNum() : BigDecimal.ZERO;
|
||||||
|
leaseTotalInfo.setPendingNum(leaseTotalInfo.getPreNum().subtract(outNumValue));
|
||||||
}
|
}
|
||||||
preNum = preNum.add(leaseTotalInfo.getPreNum());
|
|
||||||
outNum = outNum.add(leaseTotalInfo.getOutNum());
|
// 累加统计值,确保不处理null值
|
||||||
pendingNum = pendingNum.add(leaseTotalInfo.getPendingNum());
|
preNum = preNum.add(leaseTotalInfo.getPreNum() != null ? leaseTotalInfo.getPreNum() : BigDecimal.ZERO);
|
||||||
|
outNum = outNum.add(leaseTotalInfo.getOutNum() != null ? leaseTotalInfo.getOutNum() : BigDecimal.ZERO);
|
||||||
|
pendingNum = pendingNum.add(leaseTotalInfo.getPendingNum() != null ? leaseTotalInfo.getPendingNum() : BigDecimal.ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加合计行
|
||||||
if (info.getIsExport() == 0) {
|
if (info.getIsExport() == 0) {
|
||||||
LeaseTotalInfo info1 = new LeaseTotalInfo();
|
LeaseTotalInfo summary = new LeaseTotalInfo();
|
||||||
info1.setUnitName("合计");
|
summary.setUnitName("合计");
|
||||||
info1.setPreNum(preNum);
|
summary.setPreNum(preNum.setScale(3, RoundingMode.HALF_UP));
|
||||||
info1.setOutNum(outNum);
|
summary.setOutNum(outNum.setScale(3, RoundingMode.HALF_UP));
|
||||||
info1.setPendingNum(pendingNum);
|
summary.setPendingNum(pendingNum.setScale(3, RoundingMode.HALF_UP));
|
||||||
list.add(0, info1);
|
list.add(0, summary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
import com.alibaba.nacos.common.utils.StringUtils;
|
import com.alibaba.nacos.common.utils.StringUtils;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.material.basic.domain.UseStorageInfo;
|
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||||
import com.bonus.material.clz.domain.machine.MaterialUseStorageInfo;
|
import com.bonus.material.clz.domain.machine.MaterialUseStorageInfo;
|
||||||
import com.bonus.material.clz.domain.vo.MaterialSltAgreementInfo;
|
import com.bonus.material.clz.domain.vo.MaterialSltAgreementInfo;
|
||||||
|
import com.bonus.material.common.mapper.SelectMapper;
|
||||||
import com.bonus.material.ma.domain.Machine;
|
import com.bonus.material.ma.domain.Machine;
|
||||||
import com.bonus.material.clz.domain.BmTeam;
|
import com.bonus.material.clz.domain.BmTeam;
|
||||||
import com.bonus.material.clz.domain.machine.MaterialStorageInfo;
|
import com.bonus.material.clz.domain.machine.MaterialStorageInfo;
|
||||||
|
|
@ -41,6 +42,9 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
@Resource
|
@Resource
|
||||||
private BmTeamMapper bmTeamMapper;
|
private BmTeamMapper bmTeamMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SelectMapper mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取机具追溯管理数据
|
* 获取机具追溯管理数据
|
||||||
* @param machine
|
* @param machine
|
||||||
|
|
@ -100,6 +104,20 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
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);
|
List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainedEquipmentList(bean);
|
||||||
|
if (CollectionUtils.isNotEmpty(recordList)) {
|
||||||
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
recordList.removeIf(info -> {
|
||||||
|
if (com.bonus.common.core.utils.StringUtils.isBlank(info.getExternalId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
MaterialLeaseApplyInfo i8ProjectInfo = mapper.selectI8ProjectInfo(info.getExternalId());
|
||||||
|
if (i8ProjectInfo == null || i8ProjectInfo.getDepartId() == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
List<String> userNameList = mapper.getUserNameList(i8ProjectInfo);
|
||||||
|
return CollectionUtils.isEmpty(userNameList) || !userNameList.contains(username);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (CollectionUtils.isNotEmpty(recordList)) {
|
if (CollectionUtils.isNotEmpty(recordList)) {
|
||||||
for (MaterialRetainedEquipmentInfo retainedEquipmentInfo : recordList) {
|
for (MaterialRetainedEquipmentInfo retainedEquipmentInfo : recordList) {
|
||||||
totalStoreNum = totalStoreNum.add(retainedEquipmentInfo.getStoreNum());
|
totalStoreNum = totalStoreNum.add(retainedEquipmentInfo.getStoreNum());
|
||||||
|
|
@ -137,6 +155,22 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
||||||
try {
|
try {
|
||||||
// 查询库管员
|
// 查询库管员
|
||||||
List<MaterialStorageInfo> list = materialMachineMapper.getMaCodeList(bean);
|
List<MaterialStorageInfo> list = materialMachineMapper.getMaCodeList(bean);
|
||||||
|
MaterialUseStorageInfo materialUseStorageInfo = new MaterialUseStorageInfo();
|
||||||
|
materialUseStorageInfo.setProId(StringUtils.isNotBlank(bean.getProId()) ? bean.getProId() : null);
|
||||||
|
materialUseStorageInfo.setTypeId(bean.getTypeId() != null ? bean.getTypeId() : null);
|
||||||
|
List<MaterialUseStorageInfo> userList = materialMachineMapper.getUserRecords(materialUseStorageInfo);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
if (CollectionUtils.isNotEmpty(userList)) {
|
||||||
|
list.removeIf(info -> {
|
||||||
|
for (MaterialUseStorageInfo useStorageInfo : userList) {
|
||||||
|
if (info.getMaId().equals(useStorageInfo.getMaId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
for (MaterialStorageInfo useStorageInfo : list) {
|
for (MaterialStorageInfo useStorageInfo : list) {
|
||||||
// 查询出库信息
|
// 查询出库信息
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.bonus.common.biz.domain.TypeTreeNode;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.basic.domain.BmProject;
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
|
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||||
import com.bonus.material.common.domain.dto.SelectDto;
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
import com.bonus.material.common.domain.vo.AgreementVo;
|
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||||
import com.bonus.material.common.domain.vo.SelectVo;
|
import com.bonus.material.common.domain.vo.SelectVo;
|
||||||
|
|
@ -219,4 +220,18 @@ public interface SelectMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BmUnit> getUnitListLeasePerson(BmUnit bmUnit);
|
List<BmUnit> getUnitListLeasePerson(BmUnit bmUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据i8工程id查询项目部id
|
||||||
|
* @param externalId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
MaterialLeaseApplyInfo selectI8ProjectInfo(String externalId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据i8工程id查询用户名
|
||||||
|
* @param i8ProjectInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getUserNameList(MaterialLeaseApplyInfo i8ProjectInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
GROUP_CONCAT(DISTINCT mt2.type_name) AS typeName,
|
GROUP_CONCAT(DISTINCT mt2.type_name) AS typeName,
|
||||||
bai.`status` AS status,
|
bai.`status` AS status,
|
||||||
bai.print_status as printStatus,
|
bai.print_status as printStatus,
|
||||||
SUM(IFNULL(bad.pre_num, 0)) AS backNum
|
SUM(IFNULL(bad.pre_num, 0)) AS backNum,
|
||||||
|
bp.external_id AS externalId
|
||||||
FROM
|
FROM
|
||||||
clz_back_apply_info bai
|
clz_back_apply_info bai
|
||||||
LEFT JOIN clz_back_apply_details bad on bad.parent_id = bai.id
|
LEFT JOIN clz_back_apply_details bad on bad.parent_id = bai.id
|
||||||
|
|
@ -551,7 +552,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bp.pro_name AS proName,
|
bp.pro_name AS proName,
|
||||||
bai.back_person AS backPerson,
|
bai.back_person AS backPerson,
|
||||||
bai.create_by AS createBy,
|
bai.create_by AS createBy,
|
||||||
bai.`code` AS code
|
bai.`code` AS code,
|
||||||
|
bp.external_id AS externalId
|
||||||
FROM
|
FROM
|
||||||
clz_back_check_details bcd
|
clz_back_check_details bcd
|
||||||
LEFT JOIN ma_type mt ON bcd.type_id = mt.type_id
|
LEFT JOIN ma_type mt ON bcd.type_id = mt.type_id
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="leaseSignUrl" column="lease_sign_url" />
|
<result property="leaseSignUrl" column="lease_sign_url" />
|
||||||
<result property="leaseSignType" column="lease_sign_type" />
|
<result property="leaseSignType" column="lease_sign_type" />
|
||||||
<result property="agreementId" column="agreement_id" />
|
<result property="agreementId" column="agreement_id" />
|
||||||
|
<result property="externalId" column="external_id" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap type="com.bonus.material.clz.domain.lease.MaterialLeaseApplyDetails" id="LeaseApplyDetailsResult">
|
<resultMap type="com.bonus.material.clz.domain.lease.MaterialLeaseApplyDetails" id="LeaseApplyDetailsResult">
|
||||||
|
|
@ -76,7 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
|
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
|
||||||
bp.contract_part as contractPart,
|
bp.contract_part as contractPart,
|
||||||
sd.dept_name as impUnitName,
|
sd.dept_name as impUnitName,
|
||||||
tta.agreement_id
|
tta.agreement_id,
|
||||||
|
bp.external_id
|
||||||
from
|
from
|
||||||
clz_lease_apply_info lai
|
clz_lease_apply_info lai
|
||||||
left join tm_task tt on lai.task_id = tt.task_id
|
left join tm_task tt on lai.task_id = tt.task_id
|
||||||
|
|
@ -733,6 +735,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
lai.create_time as leaseDate,
|
lai.create_time as leaseDate,
|
||||||
lod.create_time as outDate,
|
lod.create_time as outDate,
|
||||||
bt.unit_name as teamName,
|
bt.unit_name as teamName,
|
||||||
|
bp.external_id as externalId,
|
||||||
bp.pro_name as projectName,
|
bp.pro_name as projectName,
|
||||||
lai.lease_person as leasePerson,
|
lai.lease_person as leasePerson,
|
||||||
lod.create_by as outPerson,
|
lod.create_by as outPerson,
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
mt.unit_name AS unit,
|
mt.unit_name AS unit,
|
||||||
IFNULL(mt.lease_price, 0) AS buyPrice,
|
IFNULL(mt.lease_price, 0) AS buyPrice,
|
||||||
subquery3.proId AS proId,
|
subquery1.proId AS proId,
|
||||||
subquery3.proName AS proName,
|
subquery1.proName AS proName,
|
||||||
IFNULL(subquery1.usNum, 0) AS storeNum,
|
subquery1.externalId AS externalId,
|
||||||
|
IFNULL(subquery1.usNum, 0) - IFNULL(subquery3.usNum, 0) AS storeNum,
|
||||||
IFNULL(subquery3.usNum, 0) AS usNum,
|
IFNULL(subquery3.usNum, 0) AS usNum,
|
||||||
IFNULL(subquery1.usNum, 0) + IFNULL(subquery3.usNum, 0)
|
IFNULL(subquery1.usNum, 0) AS allNum,
|
||||||
AS allNum,
|
|
||||||
CASE mt.manage_type
|
CASE mt.manage_type
|
||||||
WHEN 0 THEN
|
WHEN 0 THEN
|
||||||
'编码'
|
'编码'
|
||||||
|
|
@ -84,7 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(IFNULL( sai.num, 0 )) AS usNum,
|
SUM(IFNULL( sai.num, 0 )) AS usNum,
|
||||||
bp.pro_name as proName,
|
bp.pro_name as proName,
|
||||||
bp.pro_id as proId
|
bp.pro_id as proId,
|
||||||
|
bp.external_id as externalId
|
||||||
FROM
|
FROM
|
||||||
slt_agreement_info sai
|
slt_agreement_info sai
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
|
@ -112,7 +113,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt.type_name AS typeModelName,
|
mt.type_name AS typeModelName,
|
||||||
SUM(IFNULL( sai.num, 0 )) AS usNum,
|
SUM(IFNULL( sai.num, 0 )) AS usNum,
|
||||||
bp.pro_name as proName,
|
bp.pro_name as proName,
|
||||||
bp.pro_id as proId
|
bp.pro_id as proId,
|
||||||
|
bp.external_id as externalId
|
||||||
FROM
|
FROM
|
||||||
clz_slt_agreement_info sai
|
clz_slt_agreement_info sai
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
|
@ -128,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
GROUP BY mt.type_id, bp.pro_id
|
GROUP BY mt.type_id, bp.pro_id
|
||||||
) AS subquery3
|
) AS subquery3
|
||||||
ON mt.type_id = subquery3.type_id
|
ON mt.type_id = subquery3.type_id
|
||||||
|
AND subquery1.proId = subquery3.proId
|
||||||
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
|
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
|
||||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||||
|
|
@ -145,7 +148,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt4.type_name like concat('%',#{keyWord},'%') or
|
mt4.type_name like concat('%',#{keyWord},'%') or
|
||||||
mt3.type_name like concat('%',#{keyWord},'%') or
|
mt3.type_name like concat('%',#{keyWord},'%') or
|
||||||
mt2.type_name like concat('%',#{keyWord},'%') or
|
mt2.type_name like concat('%',#{keyWord},'%') or
|
||||||
mt.type_name like concat('%',#{keyWord},'%')
|
mt.type_name like concat('%',#{keyWord},'%') or
|
||||||
|
subquery1.proName like concat('%',#{keyWord},'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="typeName != null and typeName != ''">
|
<if test="typeName != null and typeName != ''">
|
||||||
|
|
@ -156,7 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
subquery3.proId
|
subquery1.proId
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMaCodeList"
|
<select id="getMaCodeList"
|
||||||
|
|
@ -170,7 +174,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bt.unit_name AS teamName,
|
bt.unit_name AS teamName,
|
||||||
sai.lease_id AS leaseId,
|
sai.lease_id AS leaseId,
|
||||||
sai.type_id AS typeId,
|
sai.type_id AS typeId,
|
||||||
lai.code AS code
|
lai.code AS code,
|
||||||
|
sai.ma_id AS maId
|
||||||
FROM
|
FROM
|
||||||
slt_agreement_info sai
|
slt_agreement_info sai
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
|
@ -179,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
||||||
LEFT JOIN bm_unit bt ON bai.unit_id = bt.unit_id
|
LEFT JOIN bm_unit bt ON bai.unit_id = bt.unit_id
|
||||||
LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
|
LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id
|
||||||
|
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||||
WHERE
|
WHERE
|
||||||
sai.status = '0'
|
sai.status = '0'
|
||||||
AND sai.end_time IS NULL
|
AND sai.end_time IS NULL
|
||||||
|
|
@ -186,6 +192,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="typeId != null">
|
<if test="typeId != null">
|
||||||
AND sai.type_id = #{typeId}
|
AND sai.type_id = #{typeId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="proId != null and proId != ''">
|
||||||
|
AND bp.pro_id = #{proId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectInFo" resultType="com.bonus.material.clz.domain.machine.MaterialStorageInfo">
|
<select id="selectInFo" resultType="com.bonus.material.clz.domain.machine.MaterialStorageInfo">
|
||||||
|
|
@ -672,7 +681,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bt.unit_name AS teamName,
|
bt.unit_name AS teamName,
|
||||||
sai.lease_id AS leaseId,
|
sai.lease_id AS leaseId,
|
||||||
sai.type_id AS typeId,
|
sai.type_id AS typeId,
|
||||||
lai.code AS code
|
lai.code AS code,
|
||||||
|
sai.ma_id AS maId
|
||||||
FROM
|
FROM
|
||||||
clz_slt_agreement_info sai
|
clz_slt_agreement_info sai
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
|
@ -681,6 +691,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN clz_bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
LEFT JOIN clz_bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
||||||
LEFT JOIN bm_unit bt ON bai.unit_id = bt.unit_id
|
LEFT JOIN bm_unit bt ON bai.unit_id = bt.unit_id
|
||||||
LEFT JOIN clz_lease_apply_info lai ON lai.id = sai.lease_id
|
LEFT JOIN clz_lease_apply_info lai ON lai.id = sai.lease_id
|
||||||
|
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||||
WHERE
|
WHERE
|
||||||
sai.status = '0'
|
sai.status = '0'
|
||||||
AND sai.end_time IS NULL
|
AND sai.end_time IS NULL
|
||||||
|
|
@ -688,6 +699,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="typeId != null">
|
<if test="typeId != null">
|
||||||
AND sai.type_id = #{typeId}
|
AND sai.type_id = #{typeId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="proId != null and proId != ''">
|
||||||
|
AND bp.pro_id = #{proId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUseInFo" resultType="com.bonus.material.clz.domain.machine.MaterialUseStorageInfo">
|
<select id="selectUseInFo" resultType="com.bonus.material.clz.domain.machine.MaterialUseStorageInfo">
|
||||||
|
|
|
||||||
|
|
@ -521,4 +521,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND pai.lease_id = #{leaseId}
|
AND pai.lease_id = #{leaseId}
|
||||||
and pai.team_id = #{teamId}
|
and pai.team_id = #{teamId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectI8ProjectInfo" resultType="com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo">
|
||||||
|
SELECT
|
||||||
|
id as externalId,
|
||||||
|
project_dept_id as departId
|
||||||
|
FROM
|
||||||
|
`data_center`.dx_fb_son
|
||||||
|
WHERE id = #{externalId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUserNameList" resultType="java.lang.String">
|
||||||
|
SELECT
|
||||||
|
cno
|
||||||
|
FROM `sbd_audit`.sg_project_post_personnel
|
||||||
|
WHERE post_id = '3de0eb390f3611efa1940242ac130004'
|
||||||
|
AND depart_id = #{departId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue