| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.DataBaseConstant; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | | import org.jeecg.modules.eam.constant.AssetStatusEnum; |
| | | import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus; |
| | |
| | | if(sysUser == null){ |
| | | return page; |
| | | } |
| | | if(StringUtils.isNotBlank(sysUser.getEquipmentIds())){ |
| | | //选择了设备,根据设备id过滤设备 |
| | | List<String> equipArr = Arrays.asList(sysUser.getEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | }else { |
| | | //没有选择设备,根据车间过滤设备 |
| | | queryWrapper.exists("select 1 from mdc_user_production t where t.user_id=? and t.pro_id=e.org_id", sysUser.getId()); |
| | | } |
| | | //查询条件过滤 |
| | | if(eamEquipment != null){ |
| | | if(StringUtils.isNotBlank(eamEquipment.getEquipmentCode())){ |
| | | queryWrapper.like("e.equipment_code", eamEquipment.getEquipmentCode()); |
| | |
| | | //排序 |
| | | if(StringUtils.isNotBlank(eamEquipment.getColumn()) && StringUtils.isNotBlank(eamEquipment.getOrder())){ |
| | | //queryWrapper.like("column", eamEquipment.getColumn()); |
| | | queryWrapper.orderByDesc("e.create_time"); |
| | | String column = eamEquipment.getColumn(); |
| | | if(column.endsWith(CommonConstant.DICT_TEXT_SUFFIX)) { |
| | | column = column.substring(0, column.lastIndexOf(CommonConstant.DICT_TEXT_SUFFIX)); |
| | | } |
| | | if(DataBaseConstant.SQL_ASC.equalsIgnoreCase(eamEquipment.getOrder())){ |
| | | queryWrapper.orderByAsc("e." + oConvertUtils.camelToUnderline(column)); |
| | | }else { |
| | | queryWrapper.orderByDesc("e." + oConvertUtils.camelToUnderline(column)); |
| | | } |
| | | }else { |
| | | queryWrapper.orderByDesc("e.create_time"); |
| | | } |