| | |
| | | messageDTO.setContent(msg); |
| | | messageDTO.setCategory(roleDictItem); |
| | | messageDTO.setFromUser("自主维护点检标准签审消息提醒提醒小助手"); |
| | | messageDTO.setToUser(user.getUsername()); |
| | | if(user != null){ |
| | | messageDTO.setToUser(user.getUsername()); |
| | | } |
| | | sysBaseApi.sendSysAnnouncement(messageDTO); |
| | | } |
| | | } |
| | |
| | | * 若果原标准原周期发生变化,删除原工单明细 重新维护 |
| | | */ |
| | | if (!oldMaintenanceStandardId.equals(maintenanceStandardId) || !oldMaintenanceCycleId.equals(maintenanceCycleId)) { |
| | | List<DailyMaintenanceOrderDetail> dailyMaintenanceOrderDetails = dailyMaintenanceOrderDetailService.lambdaQuery().eq(DailyMaintenanceOrderDetail::getDailyMaintenanceOrderId, orderId).eq(DailyMaintenanceOrderDetail::getDelFlag, 0).list(); |
| | | List<DailyMaintenanceOrderDetail> dailyMaintenanceOrderDetails = dailyMaintenanceOrderDetailService |
| | | .lambdaQuery().eq(DailyMaintenanceOrderDetail::getDailyMaintenanceOrderId, orderId) |
| | | .eq(DailyMaintenanceOrderDetail::getDelFlag, 0).list(); |
| | | for (DailyMaintenanceOrderDetail dailyMaintenanceOrderDetail : dailyMaintenanceOrderDetails) { |
| | | dailyMaintenanceOrderDetailService.removeById(dailyMaintenanceOrderDetail); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value="mom_eam_equipment-分页列表查询", notes="mom_eam_equipment-分页列表查询") |
| | | @GetMapping(value = "/queryEquipmentList") |
| | | public Result<IPage<Equipment>> queryEquipmentList(Equipment equipment, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>(); |
| | | if(StringUtils.isNotBlank(equipment.getNum())){ |
| | | queryWrapper.like("num",equipment.getNum()); |
| | | } |
| | | if(StringUtils.isNotBlank(equipment.getName())){ |
| | | queryWrapper.like("name",equipment.getName()); |
| | | } |
| | | queryWrapper.eq("use_id",equipment.getUseId()); |
| | | queryWrapper.eq("del_flag",0); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | |
| | | Page<Equipment> page = new Page<Equipment>(pageNo, pageSize); |
| | | IPage<Equipment> pageList = equipmentService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设备保修 获取设备列表组件 |
| | | * qsw 2023-7-14 |
| | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param operationCertificateApplyPage |
| | | * @param operationCertificateApply |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "操作证申请表-编辑") |
| | | @ApiOperation(value="操作证申请表-编辑", notes="操作证申请表-编辑") |
| | | //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_operation_certificate_apply:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody OperationCertificateApplyPage operationCertificateApplyPage) { |
| | | OperationCertificateApply operationCertificateApply = new OperationCertificateApply(); |
| | | BeanUtils.copyProperties(operationCertificateApplyPage, operationCertificateApply); |
| | | public Result<String> edit(@RequestBody OperationCertificateApply operationCertificateApply) { |
| | | // OperationCertificateApply operationCertificateApply = new OperationCertificateApply(); |
| | | // BeanUtils.copyProperties(operationCertificateApplyPage, operationCertificateApply); |
| | | OperationCertificateApply operationCertificateApplyEntity = operationCertificateApplyService.getById(operationCertificateApply.getId()); |
| | | if(operationCertificateApplyEntity==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | operationCertificateApplyService.updateMain(operationCertificateApply, operationCertificateApplyPage.getOperationCertificateApplyDetailList()); |
| | | return Result.OK("编辑成功!"); |
| | | operationCertificateApplyService.updateMain(operationCertificateApply, operationCertificateApply.getOperationCertificateApplyDetailList()); |
| | | return Result.OK("审核成功!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @param operationCertificatePage |
| | | * @param operationCertificate |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "操作证书管理-编辑") |
| | | @ApiOperation(value="操作证书管理-编辑", notes="操作证书管理-编辑") |
| | | //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_operation_certificate:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody OperationCertificatePage operationCertificatePage) { |
| | | OperationCertificate operationCertificate = new OperationCertificate(); |
| | | BeanUtils.copyProperties(operationCertificatePage, operationCertificate); |
| | | public Result<String> edit(@RequestBody OperationCertificate operationCertificate) { |
| | | // OperationCertificate operationCertificate = new OperationCertificate(); |
| | | // BeanUtils.copyProperties(operationCertificatePage, operationCertificate); |
| | | OperationCertificate operationCertificateEntity = operationCertificateService.getById(operationCertificate.getId()); |
| | | if(operationCertificateEntity==null) { |
| | | return Result.error("未找到对应数据"); |
| | | } |
| | | operationCertificateService.updateMain(operationCertificate, operationCertificatePage.getOperationCertificateDetailList()); |
| | | return Result.OK("编辑成功!"); |
| | | operationCertificateService.updateMain(operationCertificate, operationCertificate.getOperationCertificateDetailList()); |
| | | return Result.OK("操作证扣分成功!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | HttpServletRequest req) { |
| | | Page<RepairOrder> page = new Page<RepairOrder>(pageNo, pageSize); |
| | | IPage<RepairOrder> pageList = repairOrderService.getRepairOrderList(page, repairOrder); |
| | | List<RepairOrder> records = pageList.getRecords(); |
| | | for (RepairOrder record : records) { |
| | | record.setFaultCauseCount("故障原因统计"); |
| | | List<Map<String, Object>> allFaultCause = repairOrderService.getAllFaultCause(); |
| | | record.setAllFaultCause(allFaultCause); |
| | | |
| | | String equipmentId = record.getEquipmentId(); |
| | | List<Map<String, Object>> faultCause = repairOrderService.getFaultCause(equipmentId); |
| | | record.setEquipmentFaultCause(faultCause); |
| | | } |
| | | // for(RepairOrder repairOrder1 : pageList.getRecords()){ |
| | | // if(StringUtils.isNotBlank(repairOrder1.getReportRepairId())){ |
| | | // EquipmentReportRepair equipmentReportRepair = equipmentReportRepairService.getById(repairOrder1.getReportRepairId()); |
| | |
| | | repairOrder.getFaultEndTime(), |
| | | repairOrder.getCreateStartTime(), |
| | | repairOrder.getCreateEndTime(), |
| | | repairOrder.getEquipmentImportanceId()); |
| | | repairOrder.getEquipmentImportanceId(), |
| | | repairOrder.getFaultCause()); |
| | | |
| | | // Step.3 AutoPoi 导出Excel |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | |
| | | jsonObject.put("data",list); |
| | | return jsonObject; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设备维修柱状图 |
| | | * qsw 2024-7-11 |
| | | */ |
| | | @GetMapping("getFaultCausePie") |
| | | public Result<?> getFaultCausePie(@RequestParam Map<String, Object> params) { |
| | | List<Map<String, Object>> faultCausePie = repairOrderService.getFaultCausePie(params); |
| | | return Result.ok(faultCausePie); |
| | | } |
| | | |
| | | /** |
| | | * 设备维修扇形图 |
| | | * qsw 2024-7-11 |
| | | */ |
| | | @GetMapping("getFaultCauseBar") |
| | | public Result<?> getFaultCauseBar(@RequestParam Map<String, Object> params) { |
| | | List<Map<String, Object>> faultCauseBar = repairOrderService.getFaultCauseBar(params); |
| | | return Result.ok(faultCauseBar); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * MTPF |
| | | * qsw 2024-7-11 |
| | | */ |
| | | @GetMapping("getMTPF") |
| | | public Result<?> getMTPF(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> mtpf = repairOrderService.getMTPF(pageNo, pageSize, params); |
| | | return Result.ok(mtpf); |
| | | } |
| | | |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.ExcelCollection; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | |
| | | @Excel(name = "技能等级", width = 15) |
| | | @ApiModelProperty(value = "技能等级") |
| | | private String technicalLevel; |
| | | |
| | | @ExcelCollection(name="操作证管理明细") |
| | | @ApiModelProperty(value = "操作证管理明细") |
| | | @TableField(exist = false) |
| | | private List<OperationCertificateDetail> operationCertificateDetailList; |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.ExcelCollection; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | |
| | | @Excel(name = "属性字段5", width = 15) |
| | | @ApiModelProperty(value = "属性字段5") |
| | | private String uda5; |
| | | |
| | | @ExcelCollection(name="操作证申请明细表") |
| | | @ApiModelProperty(value = "操作证申请明细表") |
| | | @TableField(exist = false) |
| | | private List<OperationCertificateApplyDetail> operationCertificateApplyDetailList; |
| | | |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | |
| | | private String responsibilityName; |
| | | @TableField(exist = false) |
| | | private String teamName; |
| | | @TableField(exist = false) |
| | | private String faultCause; |
| | | |
| | | @TableField(exist = false) |
| | | @Dict(dicCode = "specific_equipment") |
| | |
| | | @Excel(name = "ABC标识", width = 15,orderNum = "1") |
| | | private String equipmentImportanceId; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Map<String, Object>> allFaultCause; |
| | | |
| | | @TableField(exist = false) |
| | | private String faultCauseCount; |
| | | |
| | | @TableField(exist = false) |
| | | private List<Map<String, Object>> equipmentFaultCause; |
| | | |
| | | |
| | | } |
| | |
| | | @Select("select t1.id as value,concat(t1.code, '/', t1.name) as text,concat(t1.code, '/', t1.name) as title from mom_eam_maintenance_cycle t1 where t1.del_flag = '0' and t1.version_status = '2'") |
| | | List<MaintenanceCycleVo> getMaintenanceCycle(); |
| | | |
| | | @Select("select t1.id as value,t1.name as text,t1.name as title from mom_eam_maintenance_cycle t1 where t1.del_flag = '0' and t1.version_status = '2' and t1.equipment_importance_id like concat('%',#{importanceFlag},'%')") |
| | | @Select("select t1.id as value,t1.name as text,t1.name as title from mom_eam_maintenance_cycle t1 where t1.del_flag = '0' and t1.version_status = '2' and t1.equipment_importance_id = #{importanceFlag}") |
| | | List<MaintenanceCycleVo> getPeriodicMaintenanceCycle(String importanceFlag); |
| | | |
| | | @Select(" SELECT item_value as value, item_text as text,item_text as title FROM v_sys_dict WHERE dict_code = 'maintenance_method'") |
| | |
| | | |
| | | IPage<Map<String, Object>> getMaintenanceStandard3List(IPage<Map> pageData, @Param("params") Map<String,Object> params); |
| | | |
| | | @Select("select t1.id as value,t1.name as text,t1.name as title from mom_eam_maintenance_cycle t1 where t1.del_flag = '0' and t1.version_status = '2' and t1.maintenance_type = #{maintenanceType} and t1.equipment_importance_id like concat('%',#{importanceFlag},'%')") |
| | | @Select("select t1.id as value,t1.name as text,t1.name as title from mom_eam_maintenance_cycle t1 where t1.del_flag = '0' and t1.version_status = '2' and t1.maintenance_type = #{maintenanceType} and t1.equipment_importance_id = #{importanceFlag}") |
| | | List<MaintenanceCycleVo> getPeriodicMaintenanceCycle(String importanceFlag,String maintenanceType); |
| | | } |
| | |
| | | @Param("faultEndTime")Date faultEndTime, |
| | | @Param("createStartTime")Date createStartTime, |
| | | @Param("createEndTime")Date createEndTime, |
| | | @Param("equipmentImportanceId")String equipmentImportanceId |
| | | @Param("equipmentImportanceId")String equipmentImportanceId, |
| | | @Param("faultCause")String faultCause |
| | | |
| | | |
| | | ); |
| | |
| | | |
| | | |
| | | IPage<Map<String, Object>> getMaterialSpareList(IPage<Map> pageData, @Param("num") String num,@Param("status") String status); |
| | | |
| | | List<Map<String, Object>> getFaultCause(@Param("equipmentId")String equipmentId); |
| | | |
| | | List<Map<String, Object>> getAllFaultCause(); |
| | | |
| | | List<Map<String, Object>> getFaultCausePie(@Param("params") Map<String,Object> params); |
| | | |
| | | List<Map<String, Object>> getFaultCauseBar(@Param("params") Map<String,Object> params); |
| | | |
| | | IPage<Map<String, Object>> getMTPF(IPage<Map> pageData,@Param("params") Map<String,Object> params); |
| | | } |
| | |
| | | and t2.name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="versionStatus != 'null' and versionStatus != ''"> |
| | | and t1.version_status like concat('%',#{versionStatus},'%') |
| | | and t1.version_status = #{versionStatus} |
| | | </if> |
| | | <if test="versionStatus == 'null' "> |
| | | and t1.version_status='2' |
| | |
| | | t1.line_id lineId, |
| | | t1.is_meta isMeta, |
| | | t1.id showId, |
| | | t1.is_line isLine, |
| | | t1.is_line_equip isLineEquip, |
| | | t1.is_judging isJudging, |
| | | t1.area_id areaId, |
| | |
| | | t3.id as maintenanceCycleId, |
| | | t3.NAME AS maintenanceCycleName, |
| | | t5.NAME AS maintenanceSpecialtyName, |
| | | t7.item_text as maintenanceRole |
| | | t7.item_value as maintenanceRole |
| | | FROM |
| | | mom_eam_maintenance_standard_detail t1 |
| | | LEFT JOIN mom_eam_maintenance_project t2 ON t1.maintenance_project_id = t2.id |
| | |
| | | t2.username username, |
| | | t2.realname as realname, |
| | | -- t4.name as teamName, |
| | | concat(t6.num, '/', t6.name, '/', t6.model) as equipmentId |
| | | (t6.num + '/'+ t6.name+ '/'+ t6.model) as equipmentId |
| | | FROM mom_eam_repair_order_actual_work_hours t1 |
| | | LEFT JOIN sys_user t2 on t2.id = t1.user_id |
| | | -- LEFT JOIN mom_base_team_class t3 on t3.id = t2.team_class_id |
| | |
| | | t2.name as faultCauseName, |
| | | t3.name as faultTypeName, |
| | | t4.num as num, |
| | | concat(t5.num, '/', t5.name,'/',t5.model) as equipmentId |
| | | (t5.num+ '/'+ t5.name+'/'+t5.model) as equipmentId |
| | | FROM mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_fault_cause t2 on t2.id =t1.fault_cause_id |
| | | LEFT JOIN mom_eam_fault_type t3 on t3.id =t1.fault_type_id |
| | |
| | | t2.name as faultCauseName, |
| | | t3.name as faultTypeName, |
| | | t4.num as num, |
| | | concat(t5.num, '/', t5.name,'/',t5.model) as equipmentId |
| | | (t5.num+ '/'+ t5.name+'/'+t5.model) as equipmentId |
| | | FROM mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_fault_cause t2 on t2.id =t1.fault_cause_id |
| | | LEFT JOIN mom_eam_fault_type t3 on t3.id =t1.fault_type_id |
| | |
| | | left join mom_base_supplier t4 on t1.outsourcing_unit = t4.id |
| | | left join sys_user t5 on t5.id = t1.responsibility_id |
| | | left join mom_base_team t6 on t6.id=t1.team_id |
| | | left join mom_eam_repair_order_fault_analysis t7 on t7.repair_order_id=t1.id |
| | | where t1.del_flag = 0 |
| | | <if test="id != null and id != ''"> |
| | | and t1.id = #{id} |
| | |
| | | and t2.specific_equipment = #{specificEquipment} |
| | | </if> |
| | | <if test="equipmentImportanceId != null and equipmentImportanceId != ''"> |
| | | and t2. equipment_importance_id = #{equipmentImportanceId} |
| | | and t2.equipment_importance_id = #{equipmentImportanceId} |
| | | </if> |
| | | <if test="faultCause != null and faultCause != ''"> |
| | | and t7.repair_order_fault_analysis_uda2 = #{faultCause} |
| | | </if> |
| | | <if test="teamId != null and teamId != ''"> |
| | | and t1.team_id = #{teamId} |
| | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getAllFaultCause" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2, |
| | | COUNT ( t1.repair_order_fault_analysis_uda2 ) AS total, |
| | | t2.item_text AS faultCause |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t2 |
| | | LEFT JOIN mom_eam_repair_order_fault_analysis t1 ON t1.repair_order_fault_analysis_uda2 = t2.item_value |
| | | WHERE |
| | | del_flag = '0' |
| | | GROUP BY |
| | | t1.repair_order_fault_analysis_uda2, |
| | | t2.item_text |
| | | |
| | | </select> |
| | | |
| | | <select id="getFaultCause" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as faultCause, |
| | | count(t4.repair_order_fault_analysis_uda2) as total |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | AND t2.equipment_id = #{equipmentId} |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | |
| | | <select id="getFaultCausePie" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as x, |
| | | count(t4.repair_order_fault_analysis_uda2) as y |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | left join mom_eam_equipment t11 on t2.equipment_id = t11.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | <if test="params.equipmentNum != null and params.equipmentNum != ''"> |
| | | and t11.num = #{params.equipmentNum} |
| | | </if> |
| | | <if test="params.faultStartTime != null"> |
| | | and t2.create_time >= #{params.faultStartTime} |
| | | </if> |
| | | <if test="params.faultEndTime != null"> |
| | | and t2.create_time <= #{params.faultEndTime} |
| | | </if> |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | |
| | | <select id="getFaultCauseBar" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as item, |
| | | count(t4.repair_order_fault_analysis_uda2) as count |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | left join mom_eam_equipment t11 on t2.equipment_id = t11.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | <if test="params.equipmentNum != null and params.equipmentNum != ''"> |
| | | and t11.num = #{params.equipmentNum} |
| | | </if> |
| | | <if test="params.faultStartTime != null"> |
| | | and t2.create_time >= #{params.faultStartTime} |
| | | </if> |
| | | <if test="params.faultEndTime != null"> |
| | | and t2.create_time <= #{params.faultEndTime} |
| | | </if> |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | |
| | | <select id="getMTPF" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as item, |
| | | count(t4.repair_order_fault_analysis_uda2) as count |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | left join mom_eam_equipment t11 on t2.equipment_id = t11.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | <if test="params.equipmentNum != null and params.equipmentNum != ''"> |
| | | and t11.num = #{params.equipmentNum} |
| | | </if> |
| | | <if test="params.faultStartTime != null"> |
| | | and t2.create_time >= #{params.faultStartTime} |
| | | </if> |
| | | <if test="params.faultEndTime != null"> |
| | | and t2.create_time <= #{params.faultEndTime} |
| | | </if> |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | </mapper> |
| | |
| | | and t2.area_id = '-1' |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public List<EquipmentAvailabilityVo> equipmentAvailability(Map<String, String> query) throws ParseException; |
| | | |
| | | public List<EquipmentAvailabilityVo> getStartRate(Map<String, String> query) throws ParseException; |
| | | |
| | | List<Map<String, Object>> getFaultCause(String equipmentId); |
| | | |
| | | List<Map<String, Object>> getAllFaultCause( ); |
| | | |
| | | List<Map<String, Object>> getFaultCausePie(Map<String, Object> params); |
| | | |
| | | List<Map<String, Object>> getFaultCauseBar(Map<String, Object> params); |
| | | |
| | | IPage<Map<String, Object>> getMTPF(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | } |
| | |
| | | import org.jeecg.modules.eam.entity.OperationCertificateApplyDetail; |
| | | import org.jeecg.modules.eam.mapper.OperationCertificateApplyDetailMapper; |
| | | import org.jeecg.modules.eam.mapper.OperationCertificateApplyMapper; |
| | | import org.jeecg.modules.eam.service.IOperationCertificateApplyDetailService; |
| | | import org.jeecg.modules.eam.service.IOperationCertificateApplyService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | private OperationCertificateApplyMapper operationCertificateApplyMapper; |
| | | @Autowired |
| | | private OperationCertificateApplyDetailMapper operationCertificateApplyDetailMapper; |
| | | |
| | | @Autowired |
| | | private IOperationCertificateApplyDetailService operationCertificateApplyDetailService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveMain(OperationCertificateApply operationCertificateApply, List<OperationCertificateApplyDetail> operationCertificateApplyDetailList) { |
| | | operationCertificateApplyMapper.insert(operationCertificateApply); |
| | | // operationCertificateApplyMapper.insert(operationCertificateApply); |
| | | super.save(operationCertificateApply); |
| | | if(operationCertificateApplyDetailList!=null && operationCertificateApplyDetailList.size()>0) { |
| | | for(OperationCertificateApplyDetail entity:operationCertificateApplyDetailList) { |
| | | //外键设置 |
| | | entity.setOperationCertificateApplyId(operationCertificateApply.getId()); |
| | | operationCertificateApplyDetailMapper.insert(entity); |
| | | operationCertificateApplyDetailService.save(entity); |
| | | // operationCertificateApplyDetailMapper.insert(entity); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateMain(OperationCertificateApply operationCertificateApply,List<OperationCertificateApplyDetail> operationCertificateApplyDetailList) { |
| | | operationCertificateApplyMapper.updateById(operationCertificateApply); |
| | | // operationCertificateApplyMapper.updateById(operationCertificateApply); |
| | | super.updateById(operationCertificateApply); |
| | | |
| | | //1.先删除子表数据 |
| | | operationCertificateApplyDetailMapper.deleteByMainId(operationCertificateApply.getId()); |
| | |
| | | for(OperationCertificateApplyDetail entity:operationCertificateApplyDetailList) { |
| | | //外键设置 |
| | | entity.setOperationCertificateApplyId(operationCertificateApply.getId()); |
| | | operationCertificateApplyDetailMapper.insert(entity); |
| | | // operationCertificateApplyDetailMapper.insert(entity); |
| | | operationCertificateApplyDetailService.save(entity); |
| | | } |
| | | } |
| | | } |
| | |
| | | repairOrder.getFaultEndTime(), |
| | | repairOrder.getCreateStartTime(), |
| | | repairOrder.getCreateEndTime(), |
| | | repairOrder.getEquipmentImportanceId())); |
| | | repairOrder.getEquipmentImportanceId(), |
| | | repairOrder.getFaultCause() |
| | | )); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getFaultCause(String equipmentId) { |
| | | return this.baseMapper.getFaultCause(equipmentId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getAllFaultCause() { |
| | | return this.baseMapper.getAllFaultCause(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getFaultCausePie( Map<String, Object> params) { |
| | | return this.baseMapper.getFaultCausePie(params); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getFaultCauseBar(Map<String, Object> params) { |
| | | return this.baseMapper.getFaultCauseBar(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); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.DailyInspectionStandard; |
| | | import org.jeecg.modules.eam.entity.DailyInspectionStandardDetail; |
| | | import org.jeecg.modules.eam.entity.Equipment; |
| | | import org.jeecg.modules.eam.entity.EquipmentChange; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.spare.entity.*; |
| | | import org.jeecg.modules.spare.service.*; |
| | | import org.jeecg.modules.spare.vo.SparePartRequirementDeatilPage; |
| | |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description: 备件需求 |
| | |
| | | private ISparePartRequirementService sparePartScrapRequirementService; |
| | | @Autowired |
| | | private ISparePartRequirementDeatilService sparePartScrapRequirementDetailService; |
| | | |
| | | @Autowired |
| | | private IEamEquipmentService equipmentService; |
| | | |
| | | |
| | | /** |
| | |
| | | QueryWrapper<SparePartRequirement> queryWrapper = QueryGenerator.initQueryWrapper(sparePartScrap, req.getParameterMap()); |
| | | Page<SparePartRequirement> page = new Page<SparePartRequirement>(pageNo, pageSize); |
| | | IPage<SparePartRequirement> pageList = sparePartScrapRequirementService.page(page, queryWrapper); |
| | | for (SparePartRequirement record : pageList.getRecords()) { |
| | | String equipmentId = record.getEquipmentId(); |
| | | String id = record.getId(); |
| | | List<SparePartRequirementDeatil> sparePartRequirementDeatils = sparePartScrapRequirementDetailService.lambdaQuery() |
| | | .eq(SparePartRequirementDeatil::getSparePartRequirementId, id).eq(SparePartRequirementDeatil::getDelFlag, 0).list(); |
| | | record.setSparePartRequirementDeatilList(sparePartRequirementDeatils); |
| | | |
| | | if(StringUtils.isNotBlank(equipmentId)){ |
| | | Equipment equipment = equipmentService.getById(equipmentId); |
| | | record.setEquipmentNumNameModel(equipment.getNum()+"/"+equipment.getName()+"/"+equipment.getModel()); |
| | | } |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value = "备件需求-分页列表查询", notes = "备件需求-分页列表查询") |
| | | @GetMapping(value = "/getSparePartRequirementDetails") |
| | | public Result<IPage<SparePartRequirementDeatil>> getSparePartRequirementDetails(SparePartRequirementDeatil sparePartRequirementDeatil, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<SparePartRequirementDeatil> queryWrapper = QueryGenerator.initQueryWrapper(sparePartRequirementDeatil, req.getParameterMap()); |
| | | Page<SparePartRequirementDeatil> page = new Page<SparePartRequirementDeatil>(pageNo, pageSize); |
| | | IPage<SparePartRequirementDeatil> pageList = sparePartScrapRequirementDetailService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | SparePartRequirement sparePartRequirement = new SparePartRequirement(); |
| | | BeanUtils.copyProperties(sparePartRequirementDeatilPage, sparePartRequirement); |
| | | sparePartScrapRequirementService.saveMain(sparePartRequirement, sparePartRequirementDeatilPage.getSparePartRequirementDeatilList()); |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添 |
| | | */ |
| | | @AutoLog(value = "备件需求-添加") |
| | | @ApiOperation(value = "备件需求-添加", notes = "备件需求-添加") |
| | | @PostMapping(value = "/addNew") |
| | | public Result<String> addNew(@RequestBody SparePartRequirement sparePartRequirement) { |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | sparePartRequirement.setPerson(sysUser.getRealname()); |
| | | sparePartScrapRequirementService.save(sparePartRequirement); |
| | | List<SparePartRequirementDeatil> sparePartRequirementDeatilList = sparePartRequirement.getSparePartRequirementDeatilList(); |
| | | for (SparePartRequirementDeatil sparePartRequirementDeatil : sparePartRequirementDeatilList) { |
| | | sparePartRequirementDeatil.setSparePartRequirementId(sparePartRequirement.getId()); |
| | | sparePartScrapRequirementDetailService.save(sparePartRequirementDeatil); |
| | | } |
| | | return Result.OK("添加成功!"); |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | */ |
| | | @AutoLog(value = "备件需求-编辑") |
| | | @ApiOperation(value = "备件需求-编辑", notes = "备件需求-编辑") |
| | | @RequestMapping(value = "/editNew", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> editNew(@RequestBody SparePartRequirement sparePartRequirement) { |
| | | sparePartScrapRequirementService.updateById(sparePartRequirement); |
| | | //1.删除备件明细 |
| | | List<SparePartRequirementDeatil> sparePartRequirementDeatils = sparePartScrapRequirementDetailService.lambdaQuery() |
| | | .eq(SparePartRequirementDeatil::getSparePartRequirementId, sparePartRequirement.getId()) |
| | | .eq(SparePartRequirementDeatil::getDelFlag, 0).list(); |
| | | for (SparePartRequirementDeatil sparePartRequirementDeatil : sparePartRequirementDeatils) { |
| | | sparePartScrapRequirementDetailService.removeById(sparePartRequirementDeatil); |
| | | } |
| | | //2.重新持久备件明细 |
| | | List<SparePartRequirementDeatil> sparePartRequirementDeatilList = sparePartRequirement.getSparePartRequirementDeatilList(); |
| | | for (SparePartRequirementDeatil sparePartRequirementDeatil : sparePartRequirementDeatilList) { |
| | | sparePartRequirementDeatil.setId(""); |
| | | sparePartRequirementDeatil.setSparePartRequirementId(sparePartRequirement.getId()); |
| | | sparePartScrapRequirementDetailService.save(sparePartRequirementDeatil); |
| | | } |
| | | return Result.OK("编辑成功!"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除 |
| | | * |
| | |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | sparePartScrapRequirementService.delMain(id); |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | | @AutoLog(value = "备件需求-通过id删除") |
| | | @ApiOperation(value = "备件需求-通过id删除", notes = "备件需求-通过id删除") |
| | | @DeleteMapping(value = "/deleteNew") |
| | | public Result<String> deleteNew(@RequestParam(name = "id", required = true) String id) { |
| | | sparePartScrapRequirementService.removeById(id); |
| | | List<SparePartRequirementDeatil> sparePartRequirementDeatils = sparePartScrapRequirementDetailService.lambdaQuery() |
| | | .eq(SparePartRequirementDeatil::getSparePartRequirementId, id).list(); |
| | | for (SparePartRequirementDeatil sparePartRequirementDeatil : sparePartRequirementDeatils) { |
| | | sparePartScrapRequirementDetailService.removeById(sparePartRequirementDeatil); |
| | | } |
| | | return Result.OK("删除成功!"); |
| | | } |
| | | |
| | |
| | | sparePartScrapRequirementService.submit(id); |
| | | |
| | | return Result.OK("提交成功!"); |
| | | } |
| | | |
| | | /** |
| | | * 签审流程 |
| | | */ |
| | | @RequestMapping(value = "/auditApproval", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | @Transactional(rollbackFor = { Exception.class }) |
| | | public Result<String> auditApproval(@RequestBody SparePartRequirement sparePartRequirement) { |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | sparePartRequirement.setAuditPerson(sysUser.getRealname()); |
| | | sparePartRequirement.setAuditTime(new Date()); |
| | | boolean b = sparePartScrapRequirementService.updateById(sparePartRequirement); |
| | | if (b){ |
| | | return Result.OK("审核成功!"); |
| | | }else{ |
| | | return Result.error("审核失败!"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | return Result.OK("文件导入失败!"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.spare.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecg.modules.eam.entity.DailyInspectionStandard; |
| | | import org.jeecg.modules.eam.entity.DailyInspectionStandardDetail; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: 备件需求 |
| | |
| | | /**删除状态(0-正常,1-已删除)*/ |
| | | @Excel(name = "删除状态(0-正常,1-已删除)", width = 15) |
| | | @ApiModelProperty(value = "删除状态(0-正常,1-已删除)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | @ApiModelProperty(value = "请购人") |
| | | private String person; |
| | | |
| | | @ApiModelProperty(value = "设备台账") |
| | | private String equipmentId; |
| | | |
| | | @ApiModelProperty(value = "审批人") |
| | | private String auditPerson; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "审批时间") |
| | | @Excel(name = "审批时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private java.util.Date auditTime; |
| | | |
| | | @TableField(exist = false) |
| | | private String equipmentNumNameModel; |
| | | |
| | | @TableField(exist = false) |
| | | private List<SparePartRequirementDeatil> sparePartRequirementDeatilList; |
| | | |
| | | // @TableField(exist = false) |
| | | // private List<DailyInspectionStandard> dailyInspectionStandardlist; |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.spare.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | */ |
| | | @Excel(name = "删除状态(0-正常,1-已删除)", width = 15) |
| | | @ApiModelProperty(value = "删除状态(0-正常,1-已删除)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | |
| | | @ApiModelProperty(value = "备件编号") |
| | | private String spartPartNum; |
| | | |
| | | @ApiModelProperty(value = "备件名称") |
| | | private String spartPartName; |
| | | |
| | | @ApiModelProperty(value = "型号") |
| | | private String spartPartModel; |
| | | |
| | | @ApiModelProperty(value = "数量") |
| | | private String quantity; |
| | | |
| | | @ApiModelProperty(value = "单位名称") |
| | | private String unitName; |
| | | |
| | | } |
| | |
| | | public Result<?> listByType(SysUpload upload, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { |
| | | QueryWrapper<SysUpload> queryWrapper = QueryGenerator.initQueryWrapper(upload, req.getParameterMap()); |
| | | queryWrapper.in("type","inspection","threeMaintenance","twoMaintenance"); |
| | | queryWrapper.in("type","inspection","threeMaintenance","twoMaintenance","equipment"); |
| | | Page<SysUpload> page = new Page<SysUpload>(pageNo, pageSize); |
| | | IPage<SysUpload> pageList = uploadService.page(page, queryWrapper); |
| | | return Result.ok(pageList); |