| | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.EquipmentReportRepair; |
| | |
| | | import org.jeecg.modules.eam.vo.EquipmentAvailabilityVo; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.mapper.SysUserMapper; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | private IEquipmentReportRepairService equipmentReportRepairService; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | }else{ |
| | | repairOrder.setTeamId(""); |
| | | } |
| | | |
| | | LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | SysUser sysUser = sysUserService.getById(user.getId()); |
| | | String areaId = sysUser.getAreaId(); |
| | | List<String> workCenterIds = null; |
| | | if(StringUtils.isNotBlank(areaId)){ |
| | | String[] split = areaId.split(","); |
| | | workCenterIds = Arrays.asList(split); |
| | | } |
| | | |
| | | List<String> equipNums = new ArrayList<>(); |
| | | if(StringUtils.isNotBlank(repairOrder.getNums())){ |
| | | equipNums = Arrays.asList(repairOrder.getNums().trim().split("\n")).stream().filter(num->!num.equals("\n")).collect(Collectors.toList()); |
| | |
| | | repairOrder.getCreateStartTime(), |
| | | repairOrder.getCreateEndTime(), |
| | | repairOrder.getEquipmentImportanceId(), |
| | | repairOrder.getFaultCause() |
| | | repairOrder.getFaultCause(), |
| | | workCenterIds |
| | | )); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getEquipmentFaultCause(Map<String, Object> params) { |
| | | return this.baseMapper.getEquipmentFaultCause(params); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> getMTPF(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return this.baseMapper.getMTPF(pageData,params); |