| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.jeecg.modules.dnc.mapper.PartsInfoMapper; |
| | | import org.jeecg.modules.dnc.mapper.ProcessSpecVersionMapper; |
| | | import org.jeecg.modules.dnc.mapper.ProductInfoMapper; |
| | | import org.jeecg.modules.dnc.request.DocInfoQueryRequest; |
| | | import org.jeecg.modules.dnc.request.TreeInfoRequest; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class ProcessSpecVersionServiceImpl extends ServiceImpl<ProcessSpecVersionMapper, ProcessSpecVersion> implements IProcessSpecVersionService{ |
| | |
| | | private IWorkStepService workStepService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | @Autowired |
| | | @Lazy |
| | | private IDocInfoService docInfoService; |
| | | /** |
| | | * 根据用户id获取授权的工艺规程版本表信息 |
| | | * @param userId |
| | |
| | | List<WorkStep> workStepList=workStepService.list(new LambdaQueryWrapper<WorkStep>().eq(WorkStep::getPsvId,processSpecId)); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 通过零件号、材质等查询对应电子样板 |
| | | * @param treeInfoRequest |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DocInfo> getByProcessSpecVersion(TreeInfoRequest treeInfoRequest){ |
| | | LambdaQueryWrapper<ProcessSpecVersion> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (treeInfoRequest.getProductIds() != null && !treeInfoRequest.getProductIds().isEmpty()) { |
| | | queryWrapper.in(ProcessSpecVersion::getProductId, treeInfoRequest.getProductIds()); |
| | | } |
| | | if (treeInfoRequest.getComponentIds() != null && !treeInfoRequest.getComponentIds().isEmpty()) { |
| | | queryWrapper.in(ProcessSpecVersion::getComponentId, treeInfoRequest.getComponentIds()); |
| | | } |
| | | if (treeInfoRequest.getPartsIds() != null && !treeInfoRequest.getPartsIds().isEmpty()) { |
| | | queryWrapper.in(ProcessSpecVersion::getPartsId, treeInfoRequest.getPartsIds()); |
| | | } |
| | | if (treeInfoRequest.getAttributionType()==4){ |
| | | queryWrapper.eq(StrUtil.isNotEmpty(treeInfoRequest.getAttributionId()),ProcessSpecVersion::getId,treeInfoRequest.getAttributionId()); |
| | | } |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeName()),ProcessSpecVersion::getProcessSpecVersionName, treeInfoRequest.getTreeName()); |
| | | queryWrapper.like(StrUtil.isNotEmpty(treeInfoRequest.getTreeCode()),ProcessSpecVersion::getProcessSpecVersionCode, treeInfoRequest.getTreeName()); |
| | | queryWrapper.orderByDesc(ProcessSpecVersion::getCreateTime); |
| | | List<ProcessSpecVersion> list = super.list(queryWrapper); |
| | | if (list == null || list.isEmpty()){ |
| | | return new ArrayList<>(); |
| | | }else { |
| | | String ids=list.stream().map(ProcessSpecVersion::getId).collect(Collectors.joining(",")); |
| | | DocInfoQueryRequest docQuery = new DocInfoQueryRequest(); |
| | | BeanUtil.copyProperties(treeInfoRequest,docQuery); |
| | | docQuery.setAttributionIds(ids); |
| | | docQuery.setDocClassCode("OTHER"); |
| | | docQuery.setAttributionType(4); |
| | | return docInfoService.findListByDocQuery(docQuery); |
| | | } |
| | | } |
| | | } |