| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.eam.entity.DailyInspectionStandardDetail; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.EquipmentCategory; |
| | |
| | | import org.jeecg.modules.eam.mapper.EamEquipmentMapper; |
| | | import org.jeecg.modules.eam.model.DepartVo; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | */ |
| | | @Service |
| | | public class EamEquipmentServiceImpl extends ServiceImpl<EamEquipmentMapper, Equipment> implements IEamEquipmentService { |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Override |
| | | public List<DepartVo> getSysDeparts() { |
| | |
| | | |
| | | @Override |
| | | public Page<Equipment> getEquipmentList(Page<Equipment> page, Equipment equipment) { |
| | | |
| | | String sql = equipment.getEquipmentCategoryUda1(); |
| | | List<String> equipNums = new ArrayList<>(); |
| | | if(StringUtils.isNotBlank(equipment.getNums())){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<Equipment> getEquipmentTZList(Page<Equipment> page, Equipment equipment) { |
| | | LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | SysUser sysUser = sysUserService.getById(user.getId()); |
| | | String areaId = sysUser.getAreaId(); |
| | | List<String> workCenterIds = null; |
| | | if(StringUtils.isNotBlank(areaId)){ |
| | | // strings = new ArrayList<>(); |
| | | String[] split = areaId.split(","); |
| | | workCenterIds = Arrays.asList(split); |
| | | } |
| | | String sql = equipment.getEquipmentCategoryUda1(); |
| | | List<String> equipNums = new ArrayList<>(); |
| | | if(StringUtils.isNotBlank(equipment.getNums())){ |
| | | equipNums = Arrays.asList(equipment.getNums().trim().split("\n")).stream().filter(num->!num.equals("\n")).collect(Collectors.toList()); |
| | | } |
| | | return page.setRecords(baseMapper.getEquipmentTZList( |
| | | page, |
| | | equipment.getNum(), |
| | | equipment.getName(), |
| | | equipment.getModel(), |
| | | workCenterIds, |
| | | equipment.getFactoryModelId(), |
| | | equipment.getAreaId(), |
| | | equipment.getManageId(), |
| | | equipment.getUseId(), |
| | | equipment.getEquipmentImportanceId(), |
| | | equipment.getTechnologyStatus(), |
| | | equipment.getEquipmentStatus(), |
| | | equipment.getSpecificEquipment(), |
| | | equipment.getWarrantyStart(), |
| | | equipment.getWarrantyEnd(), |
| | | equipment.getLineId(), |
| | | equipment.getIsLineEquip(), |
| | | equipment.getIsLine(), |
| | | equipment.getEquipmentCategoryId(), |
| | | equipNums, |
| | | sql |
| | | |
| | | )); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<DailyInspectionStandardDetail> getStandardList(Page<DailyInspectionStandardDetail> page, String mainId,String type) { |
| | | return page.setRecords(baseMapper.getStandardList(page,mainId,type)); |
| | | } |