¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.eam.entity.MaintenanceOrderActualWorkingHour; |
| | | import org.jeecg.modules.eam.entity.SpecialtyMaintenanceOrder; |
| | | import org.jeecg.modules.eam.service.IMaintenanceOrderActualWorkingHourService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkOrderService; |
| | | import org.jeecg.modules.eam.service.ISpecialtyMaintenanceOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/eam/predictiveworkorder") |
| | | @Slf4j |
| | | public class PredictiveWorkOrderController extends JeecgController<SpecialtyMaintenanceOrder, ISpecialtyMaintenanceOrderService> { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkOrderService predictiveWorkOrderService; |
| | | |
| | | @Autowired |
| | | private IMaintenanceOrderActualWorkingHourService maintenanceOrderActualWorkingHourService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param specialtyMaintenanceOrder |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "mom_eam_specialty_maintenance_order-å页å表æ¥è¯¢") |
| | | // @ApiOperation(value = "mom_eam_specialty_maintenance_order-å页å表æ¥è¯¢", notes = "mom_eam_specialty_maintenance_order-å页å表æ¥è¯¢") |
| | | // @GetMapping(value = "/list") |
| | | // public Result<IPage<SpecialtyMaintenanceOrder>> queryPageList(SpecialtyMaintenanceOrder specialtyMaintenanceOrder, |
| | | // @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | // @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | // HttpServletRequest req) { |
| | | // QueryWrapper<SpecialtyMaintenanceOrder> queryWrapper = QueryGenerator.initQueryWrapper(specialtyMaintenanceOrder, req.getParameterMap()); |
| | | // Page<SpecialtyMaintenanceOrder> page = new Page<SpecialtyMaintenanceOrder>(pageNo, pageSize); |
| | | // IPage<SpecialtyMaintenanceOrder> pageList = specialtyMaintenanceOrderService.page(page, queryWrapper); |
| | | // return Result.OK(pageList); |
| | | // } |
| | | |
| | | /** |
| | | * è·åä¸ä¸ä¿å
Ȍᴌ |
| | | * 2023-4-25 qsw |
| | | */ |
| | | @GetMapping(value = "/pageOrderList") |
| | | public Result<?> pageOrderList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> specialtyMaintenanceOrderList = predictiveWorkOrderService.pageOrderList(pageNo, pageSize, params); |
| | | // for (Map<String, Object> record : specialtyMaintenanceOrderList.getRecords()) { |
| | | // String id = (String) record.get("id"); |
| | | // |
| | | // QueryWrapper<MaintenanceOrderActualWorkingHour> actualWorkingHourWrapper = new QueryWrapper<>(); |
| | | // actualWorkingHourWrapper.eq("maintenance_order_id", id) |
| | | // .eq("del_flag", 0); |
| | | // actualWorkingHourWrapper.select("sum(actual_working_hour_quota) as actualQuantity"); |
| | | // Map<String, Object> map = maintenanceOrderActualWorkingHourService.getMap(actualWorkingHourWrapper); |
| | | // BigDecimal actualQuantity = new BigDecimal(0); |
| | | // if (map != null) { |
| | | // actualQuantity = (BigDecimal) map.get("actualQuantity"); |
| | | // } |
| | | // record.put("actualWorkingHourQuota", actualQuantity); |
| | | // |
| | | // String status = (String) record.get("status"); |
| | | // if ("2".equals(status)) { |
| | | // record.put("distable", false); |
| | | // } else { |
| | | // record.put("distable", true); |
| | | // } |
| | | // } |
| | | return Result.ok(specialtyMaintenanceOrderList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param specialtyMaintenanceOrder |
| | | * @return |
| | | */ |
| | | // @AutoLog(value = "mom_eam_specialty_maintenance_order-æ·»å ") |
| | | // @ApiOperation(value = "mom_eam_specialty_maintenance_order-æ·»å ", notes = "mom_eam_specialty_maintenance_order-æ·»å ") |
| | | // //@RequiresPermissions("org.jeecg.modules:mom_eam_specialty_maintenance_order:add") |
| | | // @PostMapping(value = "/add") |
| | | // public Result<String> add(@RequestBody SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // boolean b = specialtyMaintenanceOrderService.add(specialtyMaintenanceOrder); |
| | | // if (b) { |
| | | // return Result.OK("æ·»å æåï¼"); |
| | | // } |
| | | // return Result.error("æ·»å 失败ï¼"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * ç¼è¾ |
| | | // * |
| | | // * @param specialtyMaintenanceOrder |
| | | // * @return |
| | | // */ |
| | | // @AutoLog(value = "mom_eam_specialty_maintenance_order-ç¼è¾") |
| | | // @ApiOperation(value = "mom_eam_specialty_maintenance_order-ç¼è¾", notes = "mom_eam_specialty_maintenance_order-ç¼è¾") |
| | | // //@RequiresPermissions("org.jeecg.modules:mom_eam_specialty_maintenance_order:edit") |
| | | // @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | // public Result<String> edit(@RequestBody SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // boolean b = specialtyMaintenanceOrderService.edit(specialtyMaintenanceOrder); |
| | | // if (b) { |
| | | // return Result.OK("ç¼è¾æåï¼"); |
| | | // } |
| | | // return Result.error("ç¼è¾å¤±è´¥ï¼"); |
| | | // } |
| | | // |
| | | // |
| | | // @RequestMapping(value = "/editStatus", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | // public Result<String> editStatus(@RequestBody SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // specialtyMaintenanceOrder.setActualStartTime(new Date()); |
| | | // boolean b = specialtyMaintenanceOrderService.updateById(specialtyMaintenanceOrder); |
| | | // if (b) { |
| | | // return Result.OK("ä¸åæå!"); |
| | | // } else { |
| | | // return Result.error("ä¸å失败!"); |
| | | // } |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/report", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | // public Result<String> report(@RequestBody SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // specialtyMaintenanceOrder.setActualEndTime(new Date()); |
| | | // boolean b = specialtyMaintenanceOrderService.updateById(specialtyMaintenanceOrder); |
| | | // if (!b) { |
| | | // return Result.error("æ¥å·¥å¤±è´¥!"); |
| | | // } else { |
| | | // return Result.ok("æ¥å·¥æå!"); |
| | | // } |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/revocation", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | // public Result<String> revocation(@RequestBody SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // String id = specialtyMaintenanceOrder.getId(); |
| | | // SpecialtyMaintenanceOrder maintenanceOrder = specialtyMaintenanceOrderService.getById(id); |
| | | // String status = maintenanceOrder.getStatus(); |
| | | // if ("5".equals(status)) { |
| | | // maintenanceOrder.setActualEndTime(null); |
| | | // boolean b = specialtyMaintenanceOrderService.updateById(specialtyMaintenanceOrder); |
| | | // if (b) { |
| | | // return Result.OK("æ¤éæå!"); |
| | | // } else { |
| | | // return Result.error("æ¤é失败!"); |
| | | // } |
| | | // } else { |
| | | // return Result.error("ä»
éå·²å®å·¥ç¶ææ¤é宿æä½!"); |
| | | // } |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderGet", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | // public Result<String> orderGet(@RequestBody SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | // String userId = sysUser.getId(); |
| | | // specialtyMaintenanceOrder.setRecipientUserId(userId); |
| | | // specialtyMaintenanceOrder.setMaintenanceUserId(userId); |
| | | // specialtyMaintenanceOrder.setStatus("3"); |
| | | // boolean b = specialtyMaintenanceOrderService.updateById(specialtyMaintenanceOrder); |
| | | // if (b) { |
| | | // return Result.OK("é¢åæå!"); |
| | | // } else { |
| | | // return Result.error("é¢å失败!"); |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * éè¿idå é¤ |
| | | // * |
| | | // * @param id |
| | | // * @return |
| | | // */ |
| | | // @AutoLog(value = "mom_eam_specialty_maintenance_order-éè¿idå é¤") |
| | | // @ApiOperation(value = "mom_eam_specialty_maintenance_order-éè¿idå é¤", notes = "mom_eam_specialty_maintenance_order-éè¿idå é¤") |
| | | // //@RequiresPermissions("org.jeecg.modules:mom_eam_specialty_maintenance_order:delete") |
| | | // @DeleteMapping(value = "/delete") |
| | | // public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | // specialtyMaintenanceOrderService.removeById(id); |
| | | // return Result.OK("å 餿å!"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ¹éå é¤ |
| | | // * |
| | | // * @param ids |
| | | // * @return |
| | | // */ |
| | | // @AutoLog(value = "mom_eam_specialty_maintenance_order-æ¹éå é¤") |
| | | // @ApiOperation(value = "mom_eam_specialty_maintenance_order-æ¹éå é¤", notes = "mom_eam_specialty_maintenance_order-æ¹éå é¤") |
| | | // //@RequiresPermissions("org.jeecg.modules:mom_eam_specialty_maintenance_order:deleteBatch") |
| | | // @DeleteMapping(value = "/deleteBatch") |
| | | // public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | // this.specialtyMaintenanceOrderService.removeByIds(Arrays.asList(ids.split(","))); |
| | | // return Result.OK("æ¹éå 餿å!"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * éè¿idæ¥è¯¢ |
| | | // * |
| | | // * @param id |
| | | // * @return |
| | | // */ |
| | | // //@AutoLog(value = "mom_eam_specialty_maintenance_order-éè¿idæ¥è¯¢") |
| | | // @ApiOperation(value = "mom_eam_specialty_maintenance_order-éè¿idæ¥è¯¢", notes = "mom_eam_specialty_maintenance_order-éè¿idæ¥è¯¢") |
| | | // @GetMapping(value = "/queryById") |
| | | // public Result<SpecialtyMaintenanceOrder> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | // SpecialtyMaintenanceOrder specialtyMaintenanceOrder = specialtyMaintenanceOrderService.getById(id); |
| | | // if (specialtyMaintenanceOrder == null) { |
| | | // return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | // } |
| | | // return Result.OK(specialtyMaintenanceOrder); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 导åºexcel |
| | | // * |
| | | // * @param request |
| | | // * @param specialtyMaintenanceOrder |
| | | // */ |
| | | // //@RequiresPermissions("org.jeecg.modules:mom_eam_specialty_maintenance_order:exportXls") |
| | | // @RequestMapping(value = "/exportXls") |
| | | // public ModelAndView exportXls(HttpServletRequest request, SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // return super.exportXls(request, specialtyMaintenanceOrder, SpecialtyMaintenanceOrder.class, "mom_eam_specialty_maintenance_order"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * éè¿excel导å
¥æ°æ® |
| | | // * |
| | | // * @param request |
| | | // * @param response |
| | | // * @return |
| | | // */ |
| | | // //@RequiresPermissions("mom_eam_specialty_maintenance_order:importExcel") |
| | | // @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | // public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | // return super.importExcel(request, response, SpecialtyMaintenanceOrder.class); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/assign", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | // public Result<String> assign(@RequestBody SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // boolean b = specialtyMaintenanceOrderService.assign(specialtyMaintenanceOrder); |
| | | // if (b) { |
| | | // return Result.OK("æ¹æ´¾æå!"); |
| | | // } else { |
| | | // return Result.error("æ¹æ´¾å¤±è´¥!"); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.dto.message.MessageDTO; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.api.ISysBaseAPI; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.base.entity.SysUpload; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.model.DepartVo; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | 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 org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/eam/predictiveworkplan") |
| | | @Slf4j |
| | | public class PredictiveWorkPlanController extends JeecgController<PredictiveWorkPlan, IPredictiveWorkPlanService> { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanService predictiveWorkPlanService; |
| | | |
| | | |
| | | /** |
| | | * 颿µæ§ç»´æ¤æ¹æ¡ å表 |
| | | */ |
| | | @GetMapping(value = "/pagePredictiveWorkPlan") |
| | | public Result<IPage<Map<String, Object>>> pagePredictiveWorkPlan(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> maintenanceStandardList = predictiveWorkPlanService.pagePredictiveWorkPlan(pageNo, pageSize, params); |
| | | return Result.OK(maintenanceStandardList); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | */ |
| | | @AutoLog(value = "predictive_work_plan-æ·»å ") |
| | | @ApiOperation(value = "predictive_work_plan-æ·»å ", notes = "predictive_work_plan-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<String> add(@RequestBody PredictiveWorkPlan predictiveWorkPlan) { |
| | | predictiveWorkPlanService.save(predictiveWorkPlan); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | */ |
| | | @AutoLog(value = "predictive_work_plan-ç¼è¾") |
| | | @ApiOperation(value = "predictive_work_plan-ç¼è¾", notes = "predictive_work_plan-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<String> edit(@RequestBody PredictiveWorkPlan predictiveWorkPlan) { |
| | | predictiveWorkPlanService.updateById(predictiveWorkPlan); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | // /** |
| | | // * éè¿idå é¤ |
| | | // * |
| | | // * @param id |
| | | // * @return |
| | | // */ |
| | | // @AutoLog(value = "mom_eam_equipment-éè¿idå é¤") |
| | | // @ApiOperation(value="mom_eam_equipment-éè¿idå é¤", notes="mom_eam_equipment-éè¿idå é¤") |
| | | // //@RequiresPermissions("org.jeecg.modules.demo:mom_eam_equipment:delete") |
| | | // @DeleteMapping(value = "/delete") |
| | | // public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | // Equipment equipment = equipmentService.getById(id); |
| | | // equipment.setDelFlag(1); |
| | | // equipmentService.updateById(equipment); |
| | | // return Result.OK("å 餿å!"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ¹éå é¤ |
| | | // * |
| | | // * @param ids |
| | | // * @return |
| | | // */ |
| | | // @AutoLog(value = "mom_eam_equipment-æ¹éå é¤") |
| | | // @ApiOperation(value="mom_eam_equipment-æ¹éå é¤", notes="mom_eam_equipment-æ¹éå é¤") |
| | | // //@RequiresPermissions("org.jeecg.modules.demo:mom_eam_equipment:deleteBatch") |
| | | // @DeleteMapping(value = "/deleteBatch") |
| | | // public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | // List<String> stringList = Arrays.asList(ids.split(",")); |
| | | // for (String id : stringList) { |
| | | // Equipment equipment = equipmentService.getById(id); |
| | | // equipment.setDelFlag(1); |
| | | // equipmentService.updateById(equipment); |
| | | // } |
| | | //// this.equipmentService.removeByIds(Arrays.asList(ids.split(","))); |
| | | // return Result.OK("æ¹éå 餿å!"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * éè¿idæ¥è¯¢ |
| | | // * |
| | | // * @param id |
| | | // * @return |
| | | // */ |
| | | // //@AutoLog(value = "mom_eam_equipment-éè¿idæ¥è¯¢") |
| | | // @ApiOperation(value="mom_eam_equipment-éè¿idæ¥è¯¢", notes="mom_eam_equipment-éè¿idæ¥è¯¢") |
| | | // @GetMapping(value = "/queryById") |
| | | // public Result<Equipment> queryById(@RequestParam(name="id",required=true) String id) { |
| | | // Equipment equipment = equipmentService.getById(id); |
| | | // if(equipment==null) { |
| | | // return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | // } |
| | | // return Result.OK(equipment); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 导åºexcel |
| | | // * |
| | | // * @param request |
| | | // * @param equipment |
| | | // */ |
| | | // //@RequiresPermissions("org.jeecg.modules.demo:mom_eam_equipment:exportXls") |
| | | // @RequestMapping(value = "/exportXls") |
| | | // public ModelAndView exportXls(HttpServletRequest request, Equipment equipment) { |
| | | // return super.exportXls(request, equipment, Equipment.class, "mom_eam_equipment"); |
| | | // } |
| | | // |
| | | //// /** |
| | | //// * éè¿excel导å
¥æ°æ® |
| | | //// * |
| | | //// * @param request |
| | | //// * @param response |
| | | //// * @return |
| | | //// */ |
| | | //// //@RequiresPermissions("mom_eam_equipment:importExcel") |
| | | //// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | //// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | //// return super.importExcel(request, response, Equipment.class); |
| | | //// } |
| | | // |
| | | // |
| | | // /** |
| | | // * 设å¤å»ºè´¦ è·åç»ç»é¨é¨ |
| | | // * qsw 2023-4-28 |
| | | // */ |
| | | // @GetMapping("getSysDeparts") |
| | | // public Result<?> getSysDeparts() { |
| | | // List<DepartVo> sysDeparts = equipmentService.getSysDeparts(); |
| | | // return Result.ok(sysDeparts); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // *设å¤å±¥å è·å设å¤ä½¿ç¨è®°å½ |
| | | // * qsw 2023-7-28 |
| | | // */ |
| | | // @GetMapping(value = "/getResumeUseRecordList") |
| | | // public Result<?> getResumeUseRecordList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | // IPage<Map<String, Object>> resumeUseRecordList = equipmentService.getResumeUseRecordList(pageNo, pageSize, params); |
| | | // return Result.ok(resumeUseRecordList); |
| | | // } |
| | | // |
| | | // /** |
| | | // *设å¤å±¥å è·å设å¤ç¹æ£è®°å½ |
| | | // * qsw 2023-7-28 |
| | | // */ |
| | | // @GetMapping(value = "/getResumeInspectionRecordList") |
| | | // public Result<?> getResumeInspectionRecordList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | // IPage<Map<String, Object>> resumeInspectionRecordList = equipmentService.getResumeInspectionRecordList(pageNo, pageSize, params); |
| | | // LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | // for (Map<String, Object> record : resumeInspectionRecordList.getRecords()) { |
| | | // String id = (String)record.get("id"); |
| | | // String inspectionType = (String)record.get("inspectionType"); |
| | | // if("æ¥å¸¸ç¹æ£".equals(inspectionType)){ |
| | | // List<InspectionOrderDetail> failCount = inspectionOrderDetailService.lambdaQuery() |
| | | // .eq(InspectionOrderDetail::getInspectionOrderId, id) |
| | | // .eq(InspectionOrderDetail::getJudgmentResult, "fail") |
| | | // .eq(InspectionOrderDetail::getDelFlag, 0).list(); |
| | | // |
| | | // List<InspectionOrderDetail> passCount = inspectionOrderDetailService.lambdaQuery() |
| | | // .eq(InspectionOrderDetail::getInspectionOrderId, id) |
| | | // .eq(InspectionOrderDetail::getJudgmentResult,"pass") |
| | | // .eq(InspectionOrderDetail::getDelFlag, 0).list(); |
| | | // record.put("result","æ£å¸¸:"+passCount.size()+"ï¼"+"å¼å¸¸:"+failCount.size()); |
| | | // }else{ |
| | | // List<SpecialtyInspectionOrderDetail> failCount = specialtyInspectionOrderDetailService.lambdaQuery() |
| | | // .eq(SpecialtyInspectionOrderDetail::getSpecialtyInspectionOrderId, id) |
| | | // .eq(SpecialtyInspectionOrderDetail::getJudgmentResult,"fail") |
| | | // .eq(SpecialtyInspectionOrderDetail::getDelFlag, 0).list(); |
| | | // |
| | | // List<SpecialtyInspectionOrderDetail> passCount = specialtyInspectionOrderDetailService.lambdaQuery() |
| | | // .eq(SpecialtyInspectionOrderDetail::getSpecialtyInspectionOrderId, id) |
| | | // .eq(SpecialtyInspectionOrderDetail::getJudgmentResult,"pass") |
| | | // .eq(SpecialtyInspectionOrderDetail::getDelFlag, 0).list(); |
| | | // record.put("result","æ£å¸¸:"+passCount.size()+"ï¼"+"å¼å¸¸:"+failCount.size()); |
| | | // } |
| | | // } |
| | | // return Result.ok(resumeInspectionRecordList); |
| | | // } |
| | | // |
| | | // /** |
| | | // *设å¤å±¥å è·å设å¤ä¿å
»è®°å½ |
| | | // * qsw 2023-7-31 |
| | | // */ |
| | | // @GetMapping(value = "/getResumeMaintenanceRecordList") |
| | | // public Result<?> getResumeMaintenanceRecordList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | // IPage<Map<String, Object>> resumeMaintenanceRecordList = equipmentService.getResumeMaintenanceRecordList(pageNo, pageSize, params); |
| | | // return Result.ok(resumeMaintenanceRecordList); |
| | | // } |
| | | // |
| | | // /** |
| | | // *设å¤å±¥å è·å设å¤ç»´ä¿®è®°å½ |
| | | // * qsw 2023-7-31 |
| | | // */ |
| | | // @GetMapping(value = "/getResumeRepairRecordList") |
| | | // public Result<?> getResumeRepairRecordList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | // IPage<Map<String, Object>> resumeRepairRecordList = equipmentService.getResumeRepairRecordList(pageNo, pageSize, params); |
| | | // return Result.ok(resumeRepairRecordList); |
| | | // } |
| | | // |
| | | // /** |
| | | // *设å¤å±¥å è·åè®¾å¤æ£å®è®°å½ |
| | | // * qsw 2023-7-31 |
| | | // */ |
| | | // @GetMapping(value = "/getResumeCalibrationRecordList") |
| | | // public Result<?> getResumeCalibrationRecordList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | // IPage<Map<String, Object>> resumeCalibrationRecordList = equipmentService.getResumeCalibrationRecordList(pageNo, pageSize, params); |
| | | // for (Map<String, Object> record : resumeCalibrationRecordList.getRecords()) { |
| | | // String id = (String)record.get("id"); |
| | | // String status = (String)record.get("status"); |
| | | // String managementMode = (String)record.get("managementMode"); |
| | | // if("4".equals(status)){ |
| | | // if("data".equals(managementMode)){ |
| | | // List<CalibrationOrderDetail> calibrationOrderDetails = calibrationOrderDetailService.lambdaQuery() |
| | | // .eq(CalibrationOrderDetail::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderDetail::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderDetail::getDelFlag,"0").list(); |
| | | // if(calibrationOrderDetails.size()>0){ |
| | | // record.put("calibrationResult","å¼å¸¸"); |
| | | // }else{ |
| | | // record.put("calibrationResult","æ£å¸¸å¸¸"); |
| | | // } |
| | | // }else{ |
| | | // List<CalibrationOrderReport> calibrationOrderReports = calibrationOrderReportService.lambdaQuery() |
| | | // .eq(CalibrationOrderReport::getCalibrationOrderId, id) |
| | | // .eq(CalibrationOrderReport::getJudgmentResult, "fail") |
| | | // .eq(CalibrationOrderReport::getDelFlag, "0").list(); |
| | | // if(calibrationOrderReports.size()>0){ |
| | | // record.put("calibrationResult","å¼å¸¸"); |
| | | // }else{ |
| | | // record.put("calibrationResult","æ£å¸¸å¸¸"); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return Result.ok(resumeCalibrationRecordList); |
| | | // } |
| | | // |
| | | // /** |
| | | // *设å¤å±¥å è·å设å¤å¤ç½®è®°å½ |
| | | // * qsw 2023-7-31 |
| | | // */ |
| | | // @GetMapping(value = "/getResumeChangeRecordList") |
| | | // public Result<?> getResumeChangeRecordList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | // IPage<Map<String, Object>> resumeChangeRecordList = equipmentService.getResumeChangeRecordList(pageNo, pageSize, params); |
| | | // return Result.ok(resumeChangeRecordList); |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ ¹æ®ç¶ææ¥è¯¢è®¾å¤å表 |
| | | // */ |
| | | // @GetMapping(value = "/getEquipmentListByStatus") |
| | | // public Result<IPage<Equipment>> getEquipmentList(Equipment equipment,String status, |
| | | // @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | // @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | // HttpServletRequest req) { |
| | | // QueryWrapper<Equipment> queryWrapper = QueryGenerator.initQueryWrapper(equipment, req.getParameterMap()); |
| | | // List<String> statusList = Arrays.asList(status.split(",")); |
| | | // Page<Equipment> page = new Page<Equipment>(pageNo, pageSize); |
| | | // queryWrapper.in("equipment_status",statusList); |
| | | // IPage<Equipment> pageList = equipmentService.page(page, queryWrapper); |
| | | // return Result.OK(pageList); |
| | | // }/** |
| | | // * 导å
¥ |
| | | // * @return |
| | | // */ |
| | | // @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | // @Transactional(rollbackFor = Exception.class) |
| | | // public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | // MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | // LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | // Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); |
| | | // String exceptionInfo = ""; |
| | | // int exceptionNum = 0; |
| | | // for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { |
| | | // MultipartFile file = entity.getValue(); |
| | | // ImportParams params = new ImportParams(); |
| | | // params.setNeedSave(true); |
| | | // try { |
| | | // List<EquipmentImportVo> list = ExcelImportUtil.importExcel(file.getInputStream(), EquipmentImportVo.class, params); |
| | | // for(int i = 0;i<list.size();i++){ |
| | | // EquipmentImportVo equipmentImportVo = list.get(i); |
| | | // EquipmentCategory equipmentCategory = equipmentCategoryService.getOne(new QueryWrapper<EquipmentCategory>().eq("name",equipmentImportVo.getEquipmentCategoryName()),false); |
| | | // if( |
| | | // StringUtils.isBlank(equipmentImportVo.getNum()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getName()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getUseId()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getEquipmentUda1()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getManageId()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getTeamId()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getEquipmentImportanceId()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getEquipmentCategoryName()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getEquipmentStatus()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getEquipmentUda3()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getEquipmentUda5()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getEquipmentUda2()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getProjectApprovalNo()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getFundSource()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getAcceptanceCheckDate()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getLeaveFactoryDate()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getFactoryNo()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getConstructorId()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getSourceCountry()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getModel()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getSpecification()) |
| | | // || StringUtils.isBlank(equipmentImportVo.getGpo()) |
| | | // ){ |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :æ°æ®ææªå¡«é¡¹,请填åå¿
填项åå导å
¥;"; |
| | | // exceptionNum++; |
| | | // }else if(ObjectUtils.isNull(equipmentCategory)) |
| | | // { |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥,åå :è¯¥è®¾å¤æå±ç±»å«ä¸åå¨ï¼è¯·å
ç»´æ¤è®¾å¤ç±»å«;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // else{ |
| | | // Equipment oriEquipment = equipmentService.getOne(new QueryWrapper<Equipment>().eq("num",equipmentImportVo.getNum()),false); |
| | | // if(ObjectUtils.isNull(oriEquipment)){ |
| | | // Equipment equipment = new Equipment(); |
| | | // equipment.setNum(equipmentImportVo.getNum()) |
| | | // .setName(equipmentImportVo.getName()) |
| | | // .setUseId(equipmentImportVo.getUseId()) |
| | | // .setEquipmentUda1(equipmentImportVo.getEquipmentUda1()) |
| | | // .setManageId(equipmentImportVo.getManageId()) |
| | | // .setTeamId(equipmentImportVo.getTeamId()) |
| | | // .setEquipmentImportanceId(equipmentImportVo.getEquipmentImportanceId()) |
| | | // .setEquipmentCategoryId(equipmentCategory.getId()) |
| | | // .setSpecificEquipment(equipmentImportVo.getKeyEquipmentIdentification()) |
| | | // .setSecurityConfiguration(equipmentImportVo.getSecurityConfiguration()) |
| | | // .setCoolingSystem(equipmentImportVo.getCoolingSystem()) |
| | | // .setFireExtinguisher(equipmentImportVo.getFireExtinguisher()) |
| | | // .setFireExtinguisherValidityPeriod(equipmentImportVo.getFireExtinguisherValidityPeriod()) |
| | | // .setOperatingSystem(equipmentImportVo.getOperatingSystem()) |
| | | // .setSystem(equipmentImportVo.getSystem()) |
| | | // .setPort(equipmentImportVo.getPort()) |
| | | // .setCoordinateNum(equipmentImportVo.getCoordinateNum()) |
| | | // .setEquipmentStatus(equipmentImportVo.getEquipmentStatus()) |
| | | // .setEquipmentUda3(equipmentImportVo.getEquipmentUda3()) |
| | | // .setEquipmentUda4(equipmentImportVo.getEquipmentUda4()) |
| | | // .setEquipmentUda5(equipmentImportVo.getEquipmentUda5()) |
| | | // .setLocation(equipmentImportVo.getEquipmentUda2()) |
| | | // .setLastVerificationDate(equipmentImportVo.getLeaveFactoryDate()) |
| | | // .setProjectApprovalNo(equipmentImportVo.getProjectApprovalNo()) |
| | | // .setFundSource(equipmentImportVo.getFundSource()) |
| | | // .setAcceptanceCheckDate(equipmentImportVo.getAcceptanceCheckDate()) |
| | | // .setFactoryNumber(equipmentImportVo.getFactoryNo()) |
| | | // .setConstructorId(equipmentImportVo.getConstructorId()) |
| | | // .setSourceCountry(equipmentImportVo.getSourceCountry()) |
| | | // .setModel(equipmentImportVo.getModel()) |
| | | // .setSpecification(equipmentImportVo.getSpecification()) |
| | | // .setGpo(equipmentImportVo.getGpo()); |
| | | // equipmentService.save(equipment); |
| | | // }else { |
| | | // exceptionInfo = exceptionInfo+"第"+(i+2)+"è¡å¯¼å
¥å¤±è´¥ï¼åå ï¼ç»ä¸ç¼ç å·²åå¨ï¼æ°æ®éå¤å¯¼å
¥;"; |
| | | // exceptionNum++; |
| | | // } |
| | | // } |
| | | // } |
| | | // if(exceptionNum!=0){ |
| | | // String headInfo = "å°å¯¼æéæ¨!设å¤å°è´¦ï¼å¯¼å
¥æå"+(list.size()-exceptionNum)+"æ¡,失败"+exceptionNum+"æ¡"; |
| | | // MessageDTO messageDTO = new MessageDTO(); |
| | | // messageDTO.setTitle(headInfo); |
| | | // messageDTO.setFromUser("æ°æ®å¯¼å
¥å°å©æ-å°å¯¼"); |
| | | // messageDTO.setCategory("导å
¥æä½éå ä¿¡æ¯"); |
| | | // messageDTO.setContent(exceptionInfo); |
| | | // messageDTO.setToUser(user.getUsername()); |
| | | // sysBaseApi.sendSysAnnouncement(messageDTO); |
| | | // return Result.OK(headInfo+",å¯å¨-ç³»ç»æ¶æ¯-æ¥ç导å
¥è¯¦æ
"); |
| | | // } |
| | | // return Result.OK("导å
¥æåï¼å·²å¯¼å
¥å
¨é¨æ°æ®ã"); |
| | | // } catch (Exception e) { |
| | | // log.error(e.getMessage(), e); |
| | | // return Result.error("æä»¶å¯¼å
¥å¤±è´¥:" + e.getMessage()); |
| | | // } |
| | | // } |
| | | // return Result.error("æä»¶å¯¼å
¥å¤±è´¥ï¼"); |
| | | // } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameter; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanParameterService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanSparePartService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/eam/predictiveworkplanparameter") |
| | | @Slf4j |
| | | public class PredictiveWorkPlanParameterController extends JeecgController<PredictiveWorkPlanParameter, IPredictiveWorkPlanParameterService> { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanParameterService predictiveWorkPlanParameterService; |
| | | |
| | | /** |
| | | * åæ°å表 |
| | | */ |
| | | @GetMapping("listPredictiveWorkPlanParameter") |
| | | public Result<?> listPredictiveWorkPlanParameter(@RequestParam Map<String, Object> params) { |
| | | List<PredictiveWorkPlanParameter> materials = predictiveWorkPlanParameterService.listPredictiveWorkPlanParameter(params); |
| | | return Result.ok(materials); |
| | | } |
| | | |
| | | /** |
| | | * åæ°æ§å¶å表 |
| | | */ |
| | | @GetMapping("pagePredictiveWorkPlanParameter") |
| | | public Result<?> pagePredictiveWorkPlanParameter(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> materials = predictiveWorkPlanParameterService.pagePredictiveWorkPlanParameter(pageNo, pageSize, params); |
| | | return Result.ok(materials); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody PredictiveWorkPlanParameter predictiveWorkPlanParameter) { |
| | | predictiveWorkPlanParameterService.save(predictiveWorkPlanParameter); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | */ |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody PredictiveWorkPlanParameter predictiveWorkPlanParameter) { |
| | | predictiveWorkPlanParameterService.updateById(predictiveWorkPlanParameter); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | predictiveWorkPlanParameterService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.entity.MaintenanceStandardPlanningMaterial; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanSparePartService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/eam/predictiveworkplansparepart") |
| | | @Slf4j |
| | | public class PredictiveWorkPlanSparePartController extends JeecgController<PredictiveWorkPlanSparePart, IPredictiveWorkPlanSparePartService> { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanSparePartService predictiveWorkPlanSparePartService; |
| | | |
| | | /** |
| | | * å¤ä»¶æ§å¶å表 |
| | | */ |
| | | @GetMapping("pagePredictiveWorkPlanSparePart") |
| | | public Result<?> pagePredictiveWorkPlanSparePart(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> materials = predictiveWorkPlanSparePartService.pagePredictiveWorkPlanSparePart(pageNo, pageSize, params); |
| | | return Result.ok(materials); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ·»å |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody PredictiveWorkPlanSparePart predictiveWorkPlanSparePart) { |
| | | predictiveWorkPlanSparePartService.save(predictiveWorkPlanSparePart); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | */ |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody PredictiveWorkPlanSparePart predictiveWorkPlanSparePart) { |
| | | predictiveWorkPlanSparePartService.updateById(predictiveWorkPlanSparePart); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | predictiveWorkPlanSparePartService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarn; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanWarnService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/eam/predictiveworkplanwarn") |
| | | @Slf4j |
| | | public class PredictiveWorkPlanWarnController extends JeecgController<PredictiveWorkPlanWarn, IPredictiveWorkPlanWarnService> { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanWarnService predictiveWorkPlanWarnService; |
| | | |
| | | /** |
| | | * æ¥è¦å表 |
| | | */ |
| | | @GetMapping("listPredictiveWorkPlanWarn") |
| | | public Result<?> listPredictiveWorkPlanWarn(@RequestParam Map<String, Object> params) { |
| | | List<PredictiveWorkPlanWarn> materials = predictiveWorkPlanWarnService.listPredictiveWorkPlanWarn(params); |
| | | return Result.ok(materials); |
| | | } |
| | | |
| | | @GetMapping("pagePredictiveWorkPlanWarn") |
| | | public Result<?> pagePredictiveWorkPlanParameter(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> materials = predictiveWorkPlanWarnService.pagePredictiveWorkPlanWarn(pageNo, pageSize, params); |
| | | return Result.ok(materials); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ·»å |
| | | */ |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody PredictiveWorkPlanWarn predictiveWorkPlanWarn) { |
| | | predictiveWorkPlanWarnService.save(predictiveWorkPlanWarn); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | */ |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody PredictiveWorkPlanWarn predictiveWorkPlanWarn) { |
| | | predictiveWorkPlanWarnService.updateById(predictiveWorkPlanWarn); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name = "id", required = true) String id) { |
| | | predictiveWorkPlanWarnService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | } |
| | |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | @GetMapping(value = "/pageRepairOrderDetailByMainId") |
| | | public Result<IPage<RepairOrderDetail>> pageRepairOrderDetailByMainId(@RequestParam("pageNo") Integer pageNo, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | @RequestParam Map<String, Object> params) { |
| | | IPage<RepairOrderDetail> pageList = repairOrderDetailService.pageRepairOrderDetailByMainId(pageNo, pageSize, params); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * @param repairOrderDetail |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**ä¿å
»æ åid*/ |
| | | @Excel(name = "ä¿å
»æ åid", width = 15) |
| | | @ApiModelProperty(value = "ä¿å
»æ åid") |
| | | @Excel(name = "ä¿å
»æ åid/ä¸å¡è¡¨ä¸»é®ID", width = 15) |
| | | @ApiModelProperty(value = "ä¿å
»æ åid/ä¸å¡è¡¨ä¸»é®ID") |
| | | private String maintenanceStandardId; |
| | | /**ç©æid*/ |
| | | @Excel(name = "ç©æid", width = 15) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | 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 lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("mom_eam_predictive_work_order") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class PredictiveWorkOrder extends JeecgEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸ä¸ä¿å
»å·¥åå· |
| | | */ |
| | | @Excel(name = "颿µæ§ç»´æ¤å·¥åå·", width = 15) |
| | | @ApiModelProperty(value = "颿µæ§ç»´æ¤å·¥åå·") |
| | | private String num; |
| | | |
| | | /** |
| | | * å®é
å¼å§æ¶é´ |
| | | */ |
| | | @Excel(name = "å®é
å¼å§æ¶é´", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å®é
å¼å§æ¶é´") |
| | | private Date actualStartTime; |
| | | /** |
| | | * å®é
ç»ææ¶é´ |
| | | */ |
| | | @Excel(name = "å®é
ç»ææ¶é´", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å®é
ç»ææ¶é´") |
| | | private Date actualEndTime; |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | @Excel(name = "ä¿å
»äºº", width = 15) |
| | | @ApiModelProperty(value = "ä¿å
»äºº") |
| | | private String maintenanceUserId; |
| | | /** |
| | | * 计åå¼å§æ¶é´ |
| | | */ |
| | | @Excel(name = "计åå¼å§æ¶é´", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "计åå¼å§æ¶é´") |
| | | private Date planStartTime; |
| | | /** |
| | | * 计åç»ææ¶é´ |
| | | */ |
| | | @Excel(name = "计åç»ææ¶é´", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "计åç»ææ¶é´") |
| | | private Date planEndTime; |
| | | /** |
| | | * é¢å人id |
| | | */ |
| | | @Excel(name = "é¢å人id", width = 15) |
| | | @ApiModelProperty(value = "é¢å人id") |
| | | private String recipientUserId; |
| | | |
| | | /** |
| | | * å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤) |
| | | */ |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Excel(name = "ç¶æ", width = 15) |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | private String status = CommonConstant.STATUS_1; |
| | | /** |
| | | * å¤ç¨å段1 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段1", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段1") |
| | | private String maintenanceOrderUda1; |
| | | /** |
| | | * å¤ç¨å段2 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段2", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段2") |
| | | private String maintenanceOrderUda2; |
| | | /** |
| | | * å¤ç¨å段3 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段3", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段3") |
| | | private String maintenanceOrderUda3; |
| | | /** |
| | | * å¤ç¨å段4 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段4", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段4") |
| | | private String maintenanceOrderUda4; |
| | | /** |
| | | * å¤ç¨å段5 |
| | | */ |
| | | @Excel(name = "å¤ç¨å段5", width = 15) |
| | | @ApiModelProperty(value = "å¤ç¨å段5") |
| | | private String maintenanceOrderUda5; |
| | | /** |
| | | * å建类åï¼1æå¨å建ï¼2èªå¨åå»ºï¼ |
| | | */ |
| | | @Excel(name = "å建类åï¼1æå¨å建ï¼2èªå¨å建ï¼", width = 15) |
| | | @ApiModelProperty(value = "å建类åï¼1æå¨å建ï¼2èªå¨å建ï¼") |
| | | private String createType; |
| | | |
| | | @Excel(name = "ç»´æ¤æ¹æ¡ID", width = 15) |
| | | @ApiModelProperty(value = "ç»´æ¤æ¹æ¡ID") |
| | | private String workPlanId; |
| | | |
| | | @Excel(name = "设å¤ID", width = 36) |
| | | @ApiModelProperty(value = "设å¤ID") |
| | | private String equipmentId; |
| | | |
| | | private String itemId; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | //颿µæ§ç»´æ¤æ¹æ¡ |
| | | @Data |
| | | @TableName("mom_eam_predictive_work_plan") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class PredictiveWorkPlan extends JeecgEntity implements Serializable { |
| | | |
| | | @Excel(name = "æ¹æ¡ç¼ç ", width = 30) |
| | | @ApiModelProperty(value = "æ¹æ¡ç¼ç ") |
| | | private String num; |
| | | |
| | | @Excel(name = "æ¹æ¡åç§°", width = 30) |
| | | @ApiModelProperty(value = "æ¹æ¡åç§°") |
| | | private String name; |
| | | |
| | | @Excel(name = "设å¤ID", width = 36) |
| | | @ApiModelProperty(value = "设å¤ID") |
| | | private String equipmentId; |
| | | |
| | | @Excel(name = "çæ¬", width = 30) |
| | | @ApiModelProperty(value = "çæ¬") |
| | | private String planVersion; |
| | | |
| | | @Excel(name = "ç»´ä¿æ¹å¼", width = 15) |
| | | @ApiModelProperty(value = "ç»´ä¿æ¹å¼") |
| | | private String maintenanceMethod; |
| | | |
| | | @Excel(name = "çæ§ç±»å", width = 15) |
| | | @ApiModelProperty(value = "çæ§ç±»å") |
| | | private String monitorType; |
| | | |
| | | @Excel(name = "派工æ¹å¼", width = 15) |
| | | @ApiModelProperty(value = "派工æ¹å¼") |
| | | private String assignMode; |
| | | |
| | | @Excel(name = "责任çç»", width = 15) |
| | | @ApiModelProperty(value = "责任çç»") |
| | | @Dict(dicCode = "id",dictTable="mom_base_team",dicText="name") |
| | | private String teamId; |
| | | |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | @Excel(name = "ç¶æï¼1æªçæï¼2å·²çæï¼3已失æï¼", width = 15) |
| | | @ApiModelProperty(value = "ç¶æï¼1æªçæï¼2å·²çæï¼3已失æï¼") |
| | | private String status; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶åæ° |
| | | @Data |
| | | @TableName("mom_eam_predictive_work_plan_parameter") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class PredictiveWorkPlanParameter extends JeecgEntity implements Serializable { |
| | | |
| | | @Excel(name = "ç»´æ¤æ¹æ¡ID", width = 15) |
| | | @ApiModelProperty(value = "ç»´æ¤æ¹æ¡ID") |
| | | private String workPlanId; |
| | | |
| | | @Excel(name = "åæ°ID", width = 30) |
| | | @ApiModelProperty(value = "åæ°ID") |
| | | private String parameterId; |
| | | |
| | | @Excel(name = "忰代ç ", width = 36) |
| | | @ApiModelProperty(value = "忰代ç ") |
| | | private String parameterCode; |
| | | |
| | | @Excel(name = "åæ°åç§°", width = 30) |
| | | @ApiModelProperty(value = "åæ°åç§°") |
| | | private String parameterName; |
| | | |
| | | @Excel(name = "åä½", width = 15) |
| | | @ApiModelProperty(value = "åä½") |
| | | private String parameterUnit; |
| | | |
| | | @Excel(name = "æ¡ä»¶", width = 15) |
| | | @ApiModelProperty(value = "æ¡ä»¶") |
| | | private String parameterCondition; |
| | | |
| | | @Excel(name = "ä¸éå¼", width = 15) |
| | | @ApiModelProperty(value = "ä¸éå¼") |
| | | private float upperLimitValue; |
| | | |
| | | @Excel(name = "ä¸éå¼", width = 15) |
| | | @ApiModelProperty(value = "ä¸éå¼") |
| | | private float lowerLimitValue; |
| | | |
| | | private String saveTableName; |
| | | |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | @TableField(exist = false) |
| | | private float actualValue; |
| | | @TableField(exist = false) |
| | | private Date collectTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("mom_eam_predictive_work_plan_parameter_history") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class PredictiveWorkPlanParameterHistory extends JeecgEntity implements Serializable { |
| | | |
| | | @Excel(name = "ç»´æ¤æ¹æ¡ID", width = 15) |
| | | @ApiModelProperty(value = "ç»´æ¤æ¹æ¡ID") |
| | | private String workPlanId; |
| | | |
| | | @Excel(name = "åæ°ID", width = 30) |
| | | @ApiModelProperty(value = "åæ°ID") |
| | | private String parameterId; |
| | | |
| | | @Excel(name = "忰代ç ", width = 30) |
| | | @ApiModelProperty(value = "忰代ç ") |
| | | private String parameterCode; |
| | | |
| | | @Excel(name = "åæ°åç§°", width = 30) |
| | | @ApiModelProperty(value = "åæ°åç§°") |
| | | private String parameterName; |
| | | |
| | | @Excel(name = "ä¸éå¼", width = 15) |
| | | @ApiModelProperty(value = "ä¸éå¼") |
| | | private float upperLimitValue; |
| | | |
| | | @Excel(name = "ä¸éå¼", width = 15) |
| | | @ApiModelProperty(value = "ä¸éå¼") |
| | | private float lowerLimitValue; |
| | | |
| | | @Excel(name = "å®é
å¼", width = 15) |
| | | @ApiModelProperty(value = "å®é
å¼") |
| | | private float actualValue; |
| | | |
| | | @Excel(name = "æ¡ä»¶", width = 15) |
| | | @ApiModelProperty(value = "æ¡ä»¶") |
| | | private String parameterCondition; |
| | | |
| | | @Excel(name = "çæµæ¶é´", width = 15) |
| | | @ApiModelProperty(value = "çæµæ¶é´") |
| | | private Date collectTime; |
| | | |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶å¯¿å½ |
| | | @Data |
| | | @TableName("mom_eam_predictive_work_plan_spare_part") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class PredictiveWorkPlanSparePart extends JeecgEntity implements Serializable { |
| | | |
| | | @Excel(name = "å¤ä»¶ID", width = 30) |
| | | @ApiModelProperty(value = "å¤ä»¶ID") |
| | | private String sparePartId; |
| | | |
| | | @Excel(name = "é
奿°é", width = 30) |
| | | @ApiModelProperty(value = "é
奿°é") |
| | | private float supportingQuantity; |
| | | |
| | | @Excel(name = "é¢å®å¯¿å½/å°æ¶", width = 36) |
| | | @ApiModelProperty(value = "é¢å®å¯¿å½/å°æ¶") |
| | | private float ratedLife; |
| | | |
| | | @Excel(name = "å¯¿å½æ§å¶é", width = 30) |
| | | @ApiModelProperty(value = "å¯¿å½æ§å¶é") |
| | | private float lifeWarning; |
| | | |
| | | @Excel(name = "å®é
寿å½", width = 15) |
| | | @ApiModelProperty(value = "å®é
寿å½") |
| | | private float actualLife; |
| | | |
| | | @Excel(name = "ç»´æ¤æ¹æ¡ID", width = 15) |
| | | @ApiModelProperty(value = "ç»´æ¤æ¹æ¡ID") |
| | | private String workPlanId; |
| | | |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | @TableField(exist = false) |
| | | private String equipmentId; |
| | | @TableField(exist = false) |
| | | private String mdcEquipmentId; |
| | | @TableField(exist = false) |
| | | private Date replacementTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶åè¦ |
| | | @Data |
| | | @TableName("mom_eam_predictive_work_plan_warn") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class PredictiveWorkPlanWarn extends JeecgEntity implements Serializable { |
| | | |
| | | @Excel(name = "ç»´æ¤æ¹æ¡ID", width = 15) |
| | | @ApiModelProperty(value = "ç»´æ¤æ¹æ¡ID") |
| | | private String workPlanId; |
| | | |
| | | @Excel(name = "mdc设å¤ID", width = 15) |
| | | @ApiModelProperty(value = "mdc设å¤ID") |
| | | private String mdcEquipmentId; |
| | | |
| | | @Excel(name = "æ¡ä»¶", width = 15) |
| | | @ApiModelProperty(value = "æ¡ä»¶") |
| | | private String parameterCondition; |
| | | |
| | | @Excel(name = "æ¥è¦ID", width = 30) |
| | | @ApiModelProperty(value = "æ¥è¦ID") |
| | | private String warnId; |
| | | |
| | | @Excel(name = "æ¥è¦ä»£ç ", width = 36) |
| | | @ApiModelProperty(value = "æ¥è¦ä»£ç ") |
| | | private String warnCode; |
| | | |
| | | @Excel(name = "æ¥è¦åç§°", width = 30) |
| | | @ApiModelProperty(value = "æ¥è¦åç§°") |
| | | private String warnName; |
| | | |
| | | @Excel(name = "æ¥è¦å¨æ", width = 15) |
| | | @ApiModelProperty(value = "æ¥è¦å¨æ") |
| | | private int warnCycle; |
| | | |
| | | @Excel(name = "æ¥è¦å¨æåä½", width = 15) |
| | | @ApiModelProperty(value = "æ¥è¦å¨æåä½") |
| | | private String cycleUnit; |
| | | |
| | | @Excel(name = "æ¥è¦æ¬¡æ°", width = 15) |
| | | @ApiModelProperty(value = "æ¥è¦æ¬¡æ°") |
| | | private int times; |
| | | |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("mom_eam_predictive_work_plan_warn_history") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class PredictiveWorkPlanWarnHistory extends JeecgEntity implements Serializable { |
| | | |
| | | @Excel(name = "ç»´æ¤æ¹æ¡ID", width = 15) |
| | | @ApiModelProperty(value = "ç»´æ¤æ¹æ¡ID") |
| | | private String workPlanId; |
| | | |
| | | @Excel(name = "æ¡ä»¶", width = 15) |
| | | @ApiModelProperty(value = "æ¡ä»¶") |
| | | private String parameterCondition; |
| | | |
| | | @Excel(name = "æ¥è¦ID", width = 30) |
| | | @ApiModelProperty(value = "æ¥è¦ID") |
| | | private String warnId; |
| | | |
| | | @Excel(name = "æ¥è¦ä»£ç ", width = 36) |
| | | @ApiModelProperty(value = "æ¥è¦ä»£ç ") |
| | | private String warnCode; |
| | | |
| | | @Excel(name = "æ¥è¦åç§°", width = 30) |
| | | @ApiModelProperty(value = "æ¥è¦åç§°") |
| | | private String warnName; |
| | | |
| | | @Excel(name = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)", width = 15) |
| | | @ApiModelProperty(value = "å é¤ç¶æ(0-æ£å¸¸,1-å·²å é¤)") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | |
| | | @Excel(name = "çæµæ¶é´", width = 15) |
| | | @ApiModelProperty(value = "çæµæ¶é´") |
| | | private Date collectTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.job; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanSparePartService; |
| | | import org.quartz.Job; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * å¤ä»¶å¯¿å½æ£æ¥ï¼çæé¢æµå·¥å |
| | | */ |
| | | @Slf4j |
| | | public class PredictiveWorkPlanSparePartJob implements Job { |
| | | |
| | | @Resource |
| | | private IPredictiveWorkPlanSparePartService predictiveWorkPlanSparePartService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { |
| | | log.info("å¤ä»¶å¯¿å½æ£æ¥ï¼çæé¢æµå·¥åä»»å¡ PredictiveWorkPlanSparePartJob start! æ¶é´:" + DateUtils.now()); |
| | | try { |
| | | predictiveWorkPlanSparePartService.createSparePartWorkPlan(); |
| | | log.info("å¤ä»¶å¯¿å½æ£æ¥ï¼çæé¢æµå·¥åä»»å¡ PredictiveWorkPlanSparePartJob æ§è¡æå!"); |
| | | } catch (Exception e) { |
| | | log.error("å¤ä»¶å¯¿å½æ£æ¥ï¼çæé¢æµå·¥åä»»å¡ PredictiveWorkPlanSparePartJob æ§è¡å¤±è´¥!"); |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkOrder; |
| | | import org.jeecg.modules.eam.entity.SpecialtyMaintenanceOrder; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PredictiveWorkOrderMapper extends BaseMapper<PredictiveWorkOrder> { |
| | | |
| | | public IPage<Map<String, Object>> pageOrderList(IPage<Map> pageData,@Param("params") Map<String, Object> params); |
| | | |
| | | @Select("<script> select dbo.F_GET_SEQ_ID('${predictiveWorkOrder}') </script>") |
| | | public String getOrderNum(@Param("predictiveWorkOrder")String predictiveWorkOrder); |
| | | |
| | | // List<Map<String,Object>> getMaintenanceProjectList(@Param("maintenanceCycleId") String maintenanceCycleId, @Param("maintenanceMode") String maintenanceMode, @Param("maintenanceStandardId") String maintenanceStandardId); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ |
| | | public interface PredictiveWorkPlanMapper extends BaseMapper<PredictiveWorkPlan> { |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlan(IPage<Map> pageData, @Param("params") Map<String, Object> params); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameterHistory; |
| | | |
| | | public interface PredictiveWorkPlanParameterHistoryMapper extends BaseMapper<PredictiveWorkPlanParameterHistory> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameter; |
| | | import org.jeecg.modules.eam.model.ParameterVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶åæ° |
| | | public interface PredictiveWorkPlanParameterMapper extends BaseMapper<PredictiveWorkPlanParameter> { |
| | | |
| | | public List<PredictiveWorkPlanParameter> listPredictiveWorkPlanParameter(@Param("params") Map<String, Object> params); |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanParameter(IPage<Map> pageData, @Param("params") Map<String, Object> params); |
| | | |
| | | public List<PredictiveWorkPlanParameter> listParameter(@Param("predictiveWorkPlanId") String predictiveWorkPlanId); |
| | | |
| | | public ParameterVo findParameterInfo(@Param("saveTableName") String saveTableName, @Param("lowerLimitValue") float lowerLimitValue, |
| | | @Param("upperLimitValue") float upperLimitValue, @Param("parameterCode") String parameterCode); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.MaintenanceOrderActualMaterial; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart; |
| | | import org.jeecg.modules.eam.model.MdcEquipmentRunningSectionVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶å¯¿å½ |
| | | public interface PredictiveWorkPlanSparePartMapper extends BaseMapper<PredictiveWorkPlanSparePart> { |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanSparePart(IPage<Map> pageData, @Param("params") Map<String, Object> params); |
| | | |
| | | |
| | | public List<PredictiveWorkPlanSparePart> listPredictiveWorkPlanSparePart(@Param("predictiveWorkPlanId") String predictiveWorkPlanId); |
| | | |
| | | public List<MaintenanceOrderActualMaterial> listMaintenanceOrderActualMaterial( @Param("equipmentId") String equipmentId, @Param("sparePartId") String sparePartId); |
| | | |
| | | public List<MdcEquipmentRunningSectionVo> listMdcEquipmentRunningSectionVo( @Param("mdcEquipmentId") String mdcEquipmentId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarnHistory; |
| | | |
| | | public interface PredictiveWorkPlanWarnHistoryMapper extends BaseMapper<PredictiveWorkPlanWarnHistory> { |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarn; |
| | | import org.jeecg.modules.eam.model.MdcEquipmentAlarmVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶æ¥è¦ |
| | | public interface PredictiveWorkPlanWarnMapper extends BaseMapper<PredictiveWorkPlanWarn> { |
| | | |
| | | public List<PredictiveWorkPlanWarn> listPredictiveWorkPlanWarn(@Param("params") Map<String, Object> params); |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanWarn(IPage<Map> pageData, @Param("params") Map<String, Object> params); |
| | | |
| | | public List<PredictiveWorkPlanWarn> listWarn(@Param("predictiveWorkPlanId") String predictiveWorkPlanId); |
| | | |
| | | public List<MdcEquipmentAlarmVo> findWarnInfo(@Param("mdcEquipmentId") String mdcEquipmentId, @Param("times") int times, @Param("warnCode") String warnCode); |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.jeecg.modules.eam.entity.RepairOrderDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | */ |
| | | public List<RepairOrderDetail> selectByMainId(@Param("mainId") String mainId); |
| | | |
| | | public IPage<RepairOrderDetail> pageRepairOrderDetailByMainId(IPage<Map> pageData, @Param("params") Map<String, Object> params); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.PredictiveWorkOrderMapper"> |
| | | |
| | | <select id="getSpecialtyMaintenanceOrderList" parameterType="Map" resultType="Map"> |
| | | SELECT DISTINCT |
| | | t1.id, |
| | | t1.num, |
| | | t1.status, |
| | | t1.maintenance_user_id maintenanceUserId, |
| | | t12.realname maintenanceUserName, |
| | | t2.id as specialtyMaintenancePlanId, |
| | | t2.num AS specialtyMaintenancePlanNum, |
| | | t2.assign_mode assignMode, |
| | | t11.item_text assignModeName, |
| | | t7.item_text AS statusName, |
| | | t5.item_text AS maintenanceMode, |
| | | t4.depart_name AS departName, |
| | | t2.team_id teamId, |
| | | t6.name AS teamName, |
| | | concat(t8.code, '/', t8.name) AS maintenanceCycleName, |
| | | t9.NAME AS maintenanceTypeName, |
| | | t1.plan_start_time as planStartTime, |
| | | t1.plan_end_time as planEndTime, |
| | | t1.actual_start_time as actualStartTime, |
| | | t1.actual_end_time as actualEndTime, |
| | | t10.realname, |
| | | t1.create_time as createTime, |
| | | t1.create_by as createBy |
| | | FROM |
| | | mom_eam_specialty_maintenance_order t1 |
| | | LEFT JOIN mom_eam_specialty_maintenance_plan t2 ON t1.specialty_maintenance_plan_id = t2.id |
| | | LEFT JOIN sys_depart t4 ON t2.depart_id = t4.id |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'maintenance_method' ) t5 ON t5.item_value = t2.maintenance_mode |
| | | LEFT JOIN mom_base_team t6 ON t2.team_id = t6.id |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'maintenance_order_status' ) t7 ON t7.item_value = t1.STATUS |
| | | left join (select * from v_sys_dict where dict_code = 'assign_mode') t11 on t2.assign_mode = t11.item_value |
| | | LEFT JOIN mom_eam_maintenance_cycle t8 ON t8.id = t2.maintenance_cycle_id |
| | | LEFT JOIN mom_eam_maintenance_type t9 ON t9.id = t2.maintenance_type_id |
| | | left join sys_user t10 on t1.recipient_user_id = t10.id |
| | | left join sys_user t12 on t1.maintenance_user_id = t12.id |
| | | WHERE t1.del_flag = 0 and t2.del_flag = 0 and t8.del_flag = 0 and t9.del_flag = 0 |
| | | <if test="params.num != null and params.num != ''"> |
| | | and t1.num like concat('%',#{params.num},'%') |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.PredictiveWorkPlanMapper"> |
| | | |
| | | <select id="pagePredictiveWorkPlan" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.*, |
| | | t2.num deviceNum, |
| | | t2.name deviceName, |
| | | t2.model deviceModel, |
| | | t3.item_text assignModeName, |
| | | t4.item_text maintenanceMethodName, |
| | | t5.name teamName, |
| | | t6.item_text statusName, |
| | | t7.item_text monitorTypeName, |
| | | t1.plan_version planVersion, |
| | | t1.create_by createBy, |
| | | t1.create_time createTime |
| | | FROM |
| | | mom_eam_predictive_work_plan t1 |
| | | LEFT JOIN mom_eam_equipment t2 on t1.equipment_id = t2.id |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'assign_mode' ) t3 ON t3.item_value = t1.assign_mode |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'maintenance_method' ) t4 ON t4.item_value = t1.maintenance_method |
| | | LEFT JOIN mom_base_team t5 ON t5.id = t2.team_id |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'version_status' ) t6 ON t6.item_value = t1.status |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'monitor_type' ) t7 ON t7.item_value = t1.monitor_type |
| | | WHERE t1.del_flag = 0 and t2.del_flag = 0 |
| | | <if test="params.planNum != null and params.planNum != ''"> |
| | | and t1.num = concat('%',#{params.planNum},'%') |
| | | </if> |
| | | <if test="params.deviceName != null and params.deviceName != ''"> |
| | | and t2.name = concat('%',#{params.deviceName},'%') |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.PredictiveWorkPlanParameterMapper"> |
| | | |
| | | <select id="listPredictiveWorkPlanParameter" parameterType="Map" resultType="org.jeecg.modules.eam.entity.PredictiveWorkPlanParameter"> |
| | | SELECT |
| | | t1.id parameterId, |
| | | t1.chinese_name parameterName, |
| | | t1.english_name parameterCode, |
| | | t2.saveTableName |
| | | FROM |
| | | mdc_drive_type_param_config t1 |
| | | LEFT JOIN Equipment t2 ON t2.controlSystem = t1.control_system_type |
| | | LEFT JOIN mom_eam_equipment t3 ON t3.num = t2.EquipmentID |
| | | WHERE t3.id = #{params.equipmentId} |
| | | <if test="params.parameterCode != null and params.parameterCode != ''"> |
| | | and t1.english_name = concat('%',#{params.parameterCode},'%') |
| | | </if> |
| | | <if test="params.parameterName != null and params.parameterName != ''"> |
| | | and t1.chinese_name = concat('%',#{params.parameterName},'%') |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="pagePredictiveWorkPlanParameter" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.*, |
| | | t1.parameter_code parameterCode, |
| | | t1.parameter_name parameterName, |
| | | t1.upper_limit_value upperLimitValue, |
| | | t1.lower_limit_value lowerLimitValue, |
| | | t2.name unitName, |
| | | t3.item_text conditionalRelationName |
| | | FROM |
| | | mom_eam_predictive_work_plan_parameter t1 |
| | | LEFT JOIN mom_base_unit t2 ON t2.id = t1.parameter_unit |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'conditional_relation' ) t3 ON t3.item_value = t1.parameter_condition |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | <if test="params.planId != null and params.planId != ''"> |
| | | and t1.work_plan_id = #{params.planId} |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="listParameter" parameterType="Map" resultType="org.jeecg.modules.eam.entity.PredictiveWorkPlanParameter"> |
| | | SELECT |
| | | t1.work_plan_id workPlanId, |
| | | t1.parameter_id parameterId, |
| | | t1.parameter_code parameterCode, |
| | | t1.parameter_name parameterName, |
| | | t1.upper_limit_value upperLimitValue, |
| | | t1.lower_limit_value lowerLimitValue, |
| | | t1.parameter_condition parameterCondition, |
| | | t1.save_table_name saveTableName |
| | | FROM |
| | | mom_eam_predictive_work_plan_parameter t1 |
| | | WHERE t1.del_flag = 0 |
| | | <if test="params.planId != null and params.planId != ''"> |
| | | and t1.work_plan_id = #{params.planId} |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="findParameterInfo" parameterType="Map" resultType="org.jeecg.modules.eam.model.ParameterVo"> |
| | | SELECT TOP 1 |
| | | t1.CollectTime collectTime, |
| | | t1.${parameterCode} actualValue |
| | | FROM |
| | | [${saveTableName}] t1 |
| | | WHERE |
| | | t1.${parameterCode} <![CDATA[ < ]]> #{lowerLimitValue} |
| | | OR t1.${parameterCode} > #{upperLimitValue} |
| | | ORDER BY |
| | | t1.CollectTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.PredictiveWorkPlanSparePartMapper"> |
| | | |
| | | <select id="pagePredictiveWorkPlanSparePart" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.*, |
| | | t1.actual_life actualLife, |
| | | t1.create_by createBy, |
| | | t1.life_warning lifeWarning, |
| | | t1.rated_life ratedLife, |
| | | t1.work_plan_id workPlanId, |
| | | t1.supporting_quantity supportingQuantity, |
| | | t1.spare_part_id sparePartId, |
| | | t2.num sparePartNum, |
| | | t2.name sparePartName, |
| | | t2.model sparePartModel, |
| | | t2.specification sparePartSpecification, |
| | | t3.name mainUnitName, |
| | | t2.constructor_id constructorId, |
| | | t4.name constructorName |
| | | FROM mom_eam_predictive_work_plan_spare_part t1 |
| | | LEFT JOIN mom_eam_spare_part t2 ON t1.spare_part_id = t2.id |
| | | LEFT JOIN mom_base_unit t3 ON t2.main_unit_id = t3.id |
| | | LEFT JOIN mom_base_constructor t4 ON t4.id = t2.constructor_id |
| | | WHERE t1.del_flag = 0 and t2.del_flag = 0 |
| | | <if test="params.planId != null and params.planId != ''"> |
| | | and t1.work_plan_id = #{params.planId} |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="listPredictiveWorkPlanSparePart" resultType="org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart"> |
| | | SELECT |
| | | t1.id, |
| | | t1.spare_part_id sparePartId, |
| | | t1.supporting_quantity supportingQuantity, |
| | | t1.rated_life ratedLife, |
| | | t1.life_warning lifeWarning, |
| | | t1.actual_life actualLife, |
| | | t1.work_plan_id workPlanId, |
| | | t2.equipment_id equipmentId, |
| | | t3.num mdcEquipmentId |
| | | FROM |
| | | mom_eam_predictive_work_plan_spare_part t1 |
| | | LEFT JOIN mom_eam_predictive_work_plan t2 ON t1.work_plan_id = t2.id |
| | | LEFT JOIN mom_eam_equipment t3 ON t3.id = t2.equipment_id |
| | | WHERE |
| | | t1.del_flag = 0 and t1.work_plan_id = #{predictiveWorkPlanId} |
| | | </select> |
| | | |
| | | <select id="listMaintenanceOrderActualMaterial" |
| | | resultType="org.jeecg.modules.eam.entity.MaintenanceOrderActualMaterial"> |
| | | SELECT |
| | | t1.id, |
| | | t1.create_time createTime |
| | | FROM |
| | | mom_eam_maintenance_order_actual_material t1 |
| | | WHERE |
| | | t1.equipment_id = #{equipmentId} |
| | | AND t1.spare_part_id = #{sparePartId} |
| | | AND t1.del_flag = 0 |
| | | ORDER BY |
| | | t1.create_time DESC |
| | | </select> |
| | | |
| | | <select id="listMdcEquipmentRunningSectionVo" resultType="org.jeecg.modules.eam.model.MdcEquipmentRunningSectionVo"> |
| | | select t1.equipment_id equipmentId, |
| | | t1.duration, |
| | | t1.start_time startTime, |
| | | t1.start_long startLong, |
| | | t1.start_time startTime, |
| | | t1.start_long startLong |
| | | -- ç¶æ,0:å
³æº,1:弿º,2:å¾
æº,3:å·¥ä½,22:æ¥è¦ |
| | | from mdc_equipment_running_section t1 where t1.status IN (1,2,3,22) t1.equipment_id = #{mdcEquipmentId} order by start_time desc |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.PredictiveWorkPlanWarnMapper"> |
| | | |
| | | <select id="listPredictiveWorkPlanWarn" parameterType="Map" |
| | | resultType="org.jeecg.modules.eam.entity.PredictiveWorkPlanWarn"> |
| | | SELECT MAX(t1.AlarmNo) warnCode, |
| | | MAX (t1.AlarmContent) warnName, |
| | | max(t1.EquipmentID) mdcEquipmentId |
| | | FROM |
| | | EquipmentAlarm t1 |
| | | LEFT JOIN Equipment t2 ON t2.EquipmentID = t1.EquipmentID |
| | | LEFT JOIN mom_eam_equipment t3 ON t3.num = t2.EquipmentID |
| | | WHERE t3.id = #{params.equipmentId} AND t1.AlarmNo <![CDATA[ <> ]]> '' |
| | | <if test="params.warnCode != null and params.warnCode != ''"> |
| | | and t1.AlarmNo = concat('%',#{params.warnCode},'%') |
| | | </if> |
| | | <if test="params.warnName != null and params.warnName != ''"> |
| | | and t1.AlarmContent = concat('%',#{params.warnName},'%') |
| | | </if> |
| | | GROUP BY t1.AlarmNo, t1.AlarmContent, t1.EquipmentID |
| | | </select> |
| | | |
| | | <select id="pagePredictiveWorkPlanWarn" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.id, |
| | | t1.work_plan_id workPlanId, |
| | | t1.parameter_condition parameterCondition, |
| | | t1.warn_id warnId, |
| | | t1.warn_code warnCode, |
| | | t1.warn_name warnName, |
| | | t1.warn_cycle warnCycle, |
| | | t1.cycle_unit cycleUnit, |
| | | t1.times, |
| | | t2.item_text conditionalRelationName, |
| | | t3.item_text cycleUnitName |
| | | FROM |
| | | mom_eam_predictive_work_plan_warn t1 |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'conditional_relation' ) t2 ON t2.item_value = |
| | | t1.parameter_condition |
| | | LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'warn_cycle_unit' ) t3 ON t3.item_value = t1.cycle_unit |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | <if test="params.planId != null and params.planId != ''"> |
| | | and t1.work_plan_id = #{params.planId} |
| | | </if> |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="listWarn" resultType="org.jeecg.modules.eam.entity.PredictiveWorkPlanWarn"> |
| | | SELECT |
| | | t1.id, |
| | | t1.work_plan_id workPlanId, |
| | | t1.parameter_condition parameterCondition, |
| | | t1.warn_id warnId, |
| | | t1.warn_code warnCode, |
| | | t1.warn_name warnName, |
| | | t1.warn_cycle warnCycle, |
| | | t1.cycle_unit cycleUnit, |
| | | t1.times, |
| | | t1.mdc_equipment_id mdcEquipmentId |
| | | FROM |
| | | mom_eam_predictive_work_plan_warn t1 |
| | | WHERE |
| | | t1.del_flag = 0 and t1.work_plan_id = #{predictiveWorkPlanId} |
| | | ORDER BY t1.create_time desc |
| | | </select> |
| | | |
| | | <select id="findWarnInfo" resultType="org.jeecg.modules.eam.model.MdcEquipmentAlarmVo"> |
| | | SELECT TOP ${times} |
| | | t1.EquipmentID equipmentId, |
| | | t1.collectTime, |
| | | t1.AlarmNo, |
| | | t1.AlarmContent |
| | | FROM |
| | | EquipmentAlarm t1 |
| | | WHERE |
| | | t1.EquipmentID = #{mdcEquipmentId} |
| | | AND t1.AlarmNo = #{warnCode} |
| | | ORDER BY |
| | | t1.collectTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | WHERE |
| | | repair_order_id = #{mainId} |
| | | </select> |
| | | |
| | | <select id="pageRepairOrderDetailByMainId" resultType="org.jeecg.modules.eam.entity.RepairOrderDetail"> |
| | | SELECT * |
| | | FROM mom_eam_repair_order_detail |
| | | WHERE |
| | | repair_order_id = #{params.mainId} |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class MdcEquipmentAlarmVo { |
| | | private String equipmentId; |
| | | private Date collectTime; |
| | | private String alarmNo; |
| | | private String alarmContent; |
| | | private String isexamine; |
| | | private String iseffective; |
| | | private Date examinetime; |
| | | private String examineperson; |
| | | private String remark; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class MdcEquipmentRunningSectionVo { |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentId; |
| | | |
| | | /** |
| | | * æ¶é¿ |
| | | */ |
| | | @Excel(name = "æ¶é¿", width = 15) |
| | | @ApiModelProperty(value = "æ¶é¿") |
| | | private Long duration; |
| | | /** |
| | | * ç¶æ,0:å
³æº,1:弿º,2:å¾
æº,3:å·¥ä½,22:æ¥è¦ |
| | | */ |
| | | @Excel(name = "ç¶æ,0:å
³æº,1:弿º,2:å¾
æº,3:å·¥ä½,22:æ¥è¦", width = 15) |
| | | @ApiModelProperty(value = "ç¶æ,0:å
³æº,1:弿º,2:å¾
æº,3:å·¥ä½,22:æ¥è¦") |
| | | private Integer status; |
| | | /** |
| | | * ç¨åºå· |
| | | */ |
| | | @Excel(name = "ç¨åºå·", width = 15) |
| | | @ApiModelProperty(value = "ç¨åºå·") |
| | | private String sequenceNumber; |
| | | /** |
| | | * beltLine |
| | | */ |
| | | @Excel(name = "beltLine", width = 15) |
| | | @ApiModelProperty(value = "beltLine") |
| | | private String beltLine; |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @Excel(name = "å¼å§æ¶é´", width = 20, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | | private Date startTime; |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @Excel(name = "ç»ææ¶é´", width = 20, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç»ææ¶é´") |
| | | private Date endTime; |
| | | /** |
| | | * å¼å§æ¶é´æ³ |
| | | */ |
| | | @Excel(name = "å¼å§æ¶é´æ³", width = 15) |
| | | @ApiModelProperty(value = "å¼å§æ¶é´æ³") |
| | | private Long startLong; |
| | | /** |
| | | * ç»ææ¶é´æ³ |
| | | */ |
| | | @Excel(name = "ç»ææ¶é´æ³", width = 15) |
| | | @ApiModelProperty(value = "ç»ææ¶é´æ³") |
| | | private Long endLong; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ParameterVo { |
| | | |
| | | private String workPlanId; |
| | | |
| | | private String parameterId; |
| | | |
| | | private String parameterCode; |
| | | |
| | | private String parameterName; |
| | | |
| | | private float upperLimitValue; |
| | | |
| | | private float lowerLimitValue; |
| | | |
| | | private float actualValue; |
| | | |
| | | private String parameterCondition; |
| | | |
| | | private String saveTableName; |
| | | |
| | | private Date collectTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkOrder; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public interface IPredictiveWorkOrderService extends IService<PredictiveWorkOrder> { |
| | | |
| | | public IPage<Map<String, Object>> pageOrderList(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | /** |
| | | *æ°å¢ å·¥å |
| | | */ |
| | | public boolean add(PredictiveWorkOrder predictiveWorkOrder); |
| | | |
| | | // /** |
| | | // *ç¼è¾ ä¸ä¸ä¿å
Ȍᴌ |
| | | // */ |
| | | // boolean edit(SpecialtyMaintenanceOrder specialtyMaintenanceOrder); |
| | | |
| | | // /** |
| | | // *æ¹æ´¾ ä¸ä¸ä¿å·¥å |
| | | // */ |
| | | // boolean assign(SpecialtyMaintenanceOrder specialtyMaintenanceOrder); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameterHistory; |
| | | |
| | | public interface IPredictiveWorkPlanParameterHistoryService extends IService<PredictiveWorkPlanParameterHistory> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameter; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶åæ° |
| | | public interface IPredictiveWorkPlanParameterService extends IService<PredictiveWorkPlanParameter> { |
| | | |
| | | public List<PredictiveWorkPlanParameter> listPredictiveWorkPlanParameter(Map<String, Object> params); |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanParameter(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | public void createParameterWorkPlan(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ |
| | | public interface IPredictiveWorkPlanService extends IService<PredictiveWorkPlan> { |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlan(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | public List<PredictiveWorkPlan> listWorkPlan(String monitorType); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart; |
| | | |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶å¯¿å½ |
| | | public interface IPredictiveWorkPlanSparePartService extends IService<PredictiveWorkPlanSparePart> { |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanSparePart(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | public void createSparePartWorkPlan(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarnHistory; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public interface IPredictiveWorkPlanWarnHistoryService extends IService<PredictiveWorkPlanWarnHistory> { |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarn; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | //颿µæ§ç»´æ¤æ¹æ¡ è§¦åæ¡ä»¶æ¥è¦ |
| | | public interface IPredictiveWorkPlanWarnService extends IService<PredictiveWorkPlanWarn> { |
| | | |
| | | public List<PredictiveWorkPlanWarn> listPredictiveWorkPlanWarn(Map<String, Object> params); |
| | | |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanWarn(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | |
| | | public void createWarnWorkPlan(); |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.jeecg.modules.eam.entity.RepairOrderDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: ç»´ä¿®å
容 |
| | |
| | | * @return List<RepairOrderDetail> |
| | | */ |
| | | public List<RepairOrderDetail> selectByMainId(String mainId); |
| | | |
| | | public IPage<RepairOrderDetail> pageRepairOrderDetailByMainId(Integer pageNo, Integer pageSize, Map<String, Object> params); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.mapper.InspectionCycleMapper; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkOrderMapper; |
| | | import org.jeecg.modules.eam.mapper.SpecialtyMaintenanceOrderMapper; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PredictiveWorkOrderServiceImpl extends ServiceImpl<PredictiveWorkOrderMapper, PredictiveWorkOrder> implements IPredictiveWorkOrderService { |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pageOrderList(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return super.getBaseMapper().pageOrderList(pageData, params) ; |
| | | } |
| | | |
| | | // @Autowired |
| | | // private ISpecialtyMaintenancePlanService specialtyMaintenancePlanService; |
| | | // |
| | | // @Autowired |
| | | // private IMaintenanceCycleService maintenanceCycleService; |
| | | // |
| | | // @Autowired |
| | | // private ISpecialtyMaintenancePlanDetailService specialtyMaintenancePlanDetailService; |
| | | // |
| | | // @Autowired |
| | | // private ISpecialtyMaintenanceOrderDetailService specialtyMaintenanceOrderDetailService; |
| | | // |
| | | @Override |
| | | public boolean add(PredictiveWorkOrder predictiveWorkOrder) { |
| | | String predictiveWorkOrderStr = super.getBaseMapper().getOrderNum("PredictiveWorkOrder") ; |
| | | String num = "YCWH" + DateUtils.date2Str(DateUtils.yyyyMMdd.get()) + predictiveWorkOrderStr; |
| | | predictiveWorkOrder.setNum(num); |
| | | predictiveWorkOrder.setCreateType("2"); |
| | | return super.save(predictiveWorkOrder); |
| | | // |
| | | // Date planStartTime = specialtyMaintenanceOrder.getPlanStartTime(); |
| | | // String specialtyMaintenancePlanId = specialtyMaintenanceOrder.getSpecialtyMaintenancePlanId(); |
| | | // SpecialtyMaintenancePlan specialtyMaintenancePlan = specialtyMaintenancePlanService.getById(specialtyMaintenancePlanId); |
| | | //// String departId = specialtyMaintenancePlan.getDepartId(); |
| | | // String maintenanceMode = specialtyMaintenancePlan.getMaintenanceMode(); |
| | | // String maintenanceCycleId = specialtyMaintenancePlan.getMaintenanceCycleId(); |
| | | // MaintenanceCycle maintenanceCycle = maintenanceCycleService.getById(maintenanceCycleId); |
| | | // String unit = maintenanceCycle.getUnit(); |
| | | // BigDecimal effectiveTime = maintenanceCycle.getEffectiveTime(); |
| | | // |
| | | // Date date = null; |
| | | // if("min".equals(unit)){ |
| | | // date = DateUtils.getMinAfter(planStartTime, effectiveTime.intValue()); |
| | | // }else if("hour".equals(unit)){ |
| | | // date = DateUtils.getHourAfter(planStartTime, effectiveTime.intValue()); |
| | | // }else if("day".equals(unit)){ |
| | | // date = DateUtils.getDayAfter(planStartTime, effectiveTime.intValue()); |
| | | // } |
| | | // |
| | | // specialtyMaintenanceOrder.setPlanEndTime(date); |
| | | // specialtyMaintenanceOrder.setCreateType("1");//å建类åï¼1æå¨å建ï¼2èªå¨åå»ºï¼ |
| | | // boolean b = super.save(specialtyMaintenanceOrder); |
| | | // if(!b){ |
| | | // return false; |
| | | // } |
| | | |
| | | // List<SpecialtyMaintenancePlanDetail> specialtyMaintenancePlanDetails = specialtyMaintenancePlanDetailService.lambdaQuery() |
| | | // .eq(SpecialtyMaintenancePlanDetail::getSpecialtyMaintenancePlanId, specialtyMaintenancePlanId) |
| | | // .eq(SpecialtyMaintenancePlanDetail::getDelFlag, 0).list(); |
| | | // |
| | | // for (SpecialtyMaintenancePlanDetail specialtyMaintenancePlanDetail : specialtyMaintenancePlanDetails) { |
| | | // String specialtyMaintenancePlanDetailId = specialtyMaintenancePlanDetail.getId(); |
| | | // String equipmentId = specialtyMaintenancePlanDetail.getEquipmentId(); |
| | | // String maintenanceStandardId = specialtyMaintenancePlanDetail.getMaintenanceStandardId(); |
| | | // |
| | | // SpecialtyMaintenanceOrderDetail specialtyMaintenanceOrderDetail = null; |
| | | // List<Map<String, Object>> maintenanceProjectList = this.baseMapper.getMaintenanceProjectList(maintenanceCycleId,maintenanceMode,maintenanceStandardId); |
| | | // for (Map<String, Object> maintenanceProject : maintenanceProjectList) { |
| | | // specialtyMaintenanceOrderDetail = new SpecialtyMaintenanceOrderDetail(); |
| | | // specialtyMaintenanceOrderDetail.setSpecialtyMaintenanceOrderId(specialtyMaintenanceOrder.getId()); |
| | | // specialtyMaintenanceOrderDetail.setMaintenanceStandardId(maintenanceStandardId); |
| | | // specialtyMaintenanceOrderDetail.setMaintenanceStandardDetailId((String)maintenanceProject.get("id")); |
| | | // specialtyMaintenanceOrderDetail.setEquipmentId(equipmentId); |
| | | // specialtyMaintenanceOrderDetail.setSpecialtyMaintenancePlanDetailId(specialtyMaintenancePlanDetailId); |
| | | // specialtyMaintenanceOrderDetail.setMaintenanceProjectId((String)maintenanceProject.get("maintenanceProjectId")); |
| | | // specialtyMaintenanceOrderDetailService.save(specialtyMaintenanceOrderDetail); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | // @Override |
| | | // @Transactional(rollbackFor = { Exception.class }) |
| | | // public boolean edit(SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // |
| | | // Date planStartTime = specialtyMaintenanceOrder.getPlanStartTime(); |
| | | // String specialtyMaintenancePlanId = specialtyMaintenanceOrder.getSpecialtyMaintenancePlanId(); |
| | | // SpecialtyMaintenancePlan specialtyMaintenancePlan = specialtyMaintenancePlanService.getById(specialtyMaintenancePlanId); |
| | | // String maintenanceMode = specialtyMaintenancePlan.getMaintenanceMode(); |
| | | // String maintenanceCycleId = specialtyMaintenancePlan.getMaintenanceCycleId(); |
| | | // MaintenanceCycle maintenanceCycle = maintenanceCycleService.getById(maintenanceCycleId); |
| | | // String unit = maintenanceCycle.getUnit(); |
| | | // BigDecimal effectiveTime = maintenanceCycle.getEffectiveTime(); |
| | | // |
| | | // Date date = null; |
| | | // if("min".equals(unit)){ |
| | | // date = DateUtils.getMinAfter(planStartTime, effectiveTime.intValue()); |
| | | // }else if("hour".equals(unit)){ |
| | | // date = DateUtils.getHourAfter(planStartTime, effectiveTime.intValue()); |
| | | // }else if("day".equals(unit)){ |
| | | // date = DateUtils.getDayAfter(planStartTime, effectiveTime.intValue()); |
| | | // } |
| | | // |
| | | // specialtyMaintenanceOrder.setPlanEndTime(date); |
| | | // specialtyMaintenanceOrder.setCreateType("1");//å建类åï¼1æå¨å建ï¼2èªå¨åå»ºï¼ |
| | | // boolean b = super.updateById(specialtyMaintenanceOrder); |
| | | // if(!b){ |
| | | // return false; |
| | | // } |
| | | // |
| | | // List<SpecialtyMaintenanceOrderDetail> specialtyMaintenanceOrderDetails = specialtyMaintenanceOrderDetailService.lambdaQuery().eq(SpecialtyMaintenanceOrderDetail::getSpecialtyMaintenanceOrderId, specialtyMaintenanceOrder.getId()).eq(SpecialtyMaintenanceOrderDetail::getDelFlag, 0).list(); |
| | | // for (SpecialtyMaintenanceOrderDetail specialtyMaintenanceOrderDetail : specialtyMaintenanceOrderDetails) { |
| | | // specialtyMaintenanceOrderDetailService.removeById(specialtyMaintenanceOrderDetail); |
| | | // } |
| | | // |
| | | // List<SpecialtyMaintenancePlanDetail> specialtyMaintenancePlanDetails = specialtyMaintenancePlanDetailService.lambdaQuery() |
| | | // .eq(SpecialtyMaintenancePlanDetail::getSpecialtyMaintenancePlanId, specialtyMaintenancePlanId) |
| | | // .eq(SpecialtyMaintenancePlanDetail::getDelFlag, 0).list(); |
| | | // |
| | | // for (SpecialtyMaintenancePlanDetail specialtyMaintenancePlanDetail : specialtyMaintenancePlanDetails) { |
| | | // String specialtyMaintenancePlanDetailId = specialtyMaintenancePlanDetail.getId(); |
| | | // String equipmentId = specialtyMaintenancePlanDetail.getEquipmentId(); |
| | | // String maintenanceStandardId = specialtyMaintenancePlanDetail.getMaintenanceStandardId(); |
| | | // |
| | | // SpecialtyMaintenanceOrderDetail specialtyMaintenanceOrderDetail = null; |
| | | // List<Map<String, Object>> maintenanceProjectList = this.baseMapper.getMaintenanceProjectList(maintenanceCycleId,maintenanceMode,maintenanceStandardId); |
| | | // for (Map<String, Object> maintenanceProject : maintenanceProjectList) { |
| | | // specialtyMaintenanceOrderDetail = new SpecialtyMaintenanceOrderDetail(); |
| | | // specialtyMaintenanceOrderDetail.setSpecialtyMaintenanceOrderId(specialtyMaintenanceOrder.getId()); |
| | | // specialtyMaintenanceOrderDetail.setMaintenanceStandardId(maintenanceStandardId); |
| | | // specialtyMaintenanceOrderDetail.setMaintenanceStandardDetailId((String)maintenanceProject.get("id")); |
| | | // specialtyMaintenanceOrderDetail.setEquipmentId(equipmentId); |
| | | // specialtyMaintenanceOrderDetail.setSpecialtyMaintenancePlanDetailId(specialtyMaintenancePlanDetailId); |
| | | // specialtyMaintenanceOrderDetail.setMaintenanceProjectId((String)maintenanceProject.get("maintenanceProjectId")); |
| | | // specialtyMaintenanceOrderDetailService.save(specialtyMaintenanceOrderDetail); |
| | | // } |
| | | // } |
| | | // |
| | | // return true; |
| | | // } |
| | | |
| | | // @Override |
| | | // public boolean assign(SpecialtyMaintenanceOrder specialtyMaintenanceOrder) { |
| | | // specialtyMaintenanceOrder.setStatus("3"); |
| | | // boolean b1 = super.updateById(specialtyMaintenanceOrder); |
| | | // if(!b1){ |
| | | // return false; |
| | | // } |
| | | // return true; |
| | | // } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameterHistory; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkPlanParameterHistoryMapper; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanParameterHistoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class PredictiveWorkPlanParameterHistoryServiceImpl extends ServiceImpl<PredictiveWorkPlanParameterHistoryMapper, PredictiveWorkPlanParameterHistory> |
| | | implements IPredictiveWorkPlanParameterHistoryService { |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkOrder; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameter; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanParameterHistory; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkPlanParameterMapper; |
| | | import org.jeecg.modules.eam.model.ParameterVo; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkOrderService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanParameterHistoryService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanParameterService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanService; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PredictiveWorkPlanParameterServiceImpl extends ServiceImpl<PredictiveWorkPlanParameterMapper, PredictiveWorkPlanParameter> implements IPredictiveWorkPlanParameterService { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanService predictiveWorkPlanService; |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanParameterHistoryService predictiveWorkPlanParameterHistoryService; |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkOrderService predictiveWorkOrderService; |
| | | |
| | | @Override |
| | | public List<PredictiveWorkPlanParameter> listPredictiveWorkPlanParameter(Map<String, Object> params) { |
| | | return super.baseMapper.listPredictiveWorkPlanParameter(params); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanParameter(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return super.baseMapper.pagePredictiveWorkPlanParameter(pageData, params); |
| | | } |
| | | |
| | | // 1.æ¥è¯¢é
ç½®ç åæ°è§¦åæ¡ä»¶ |
| | | // 2.æ¥è¯¢è®¾å¤çåæ° |
| | | // 3.çæç»´æ¤å·¥å |
| | | @Override |
| | | public void createParameterWorkPlan() { |
| | | List<PredictiveWorkPlan> PredictiveWorkPlanList = predictiveWorkPlanService.listWorkPlan("cskz"); |
| | | for (PredictiveWorkPlan predictiveWorkPlan : PredictiveWorkPlanList) { |
| | | //æ¹æ¡å¯¹åºçåæ°ä¿¡æ¯ |
| | | List<PredictiveWorkPlanParameter> predictiveWorkPlanParameterList = listParameter(predictiveWorkPlan.getId()); |
| | | boolean needCreateFlag = false; |
| | | int needCreateFlagTimes = 0; |
| | | //å¤çæ¯ä¸ä¸ªé
ç½® |
| | | for (PredictiveWorkPlanParameter predictiveWorkPlanParameter : predictiveWorkPlanParameterList) { |
| | | ParameterVo parameterVo = this.findParameterInfo(predictiveWorkPlanParameter.getSaveTableName(), predictiveWorkPlanParameter.getLowerLimitValue(), |
| | | predictiveWorkPlanParameter.getUpperLimitValue(), predictiveWorkPlanParameter.getParameterCode()); |
| | | if (isNewParameter(predictiveWorkPlan.getId(), parameterVo.getCollectTime())) { |
| | | predictiveWorkPlanParameter.setActualValue(parameterVo.getActualValue()); |
| | | predictiveWorkPlanParameter.setCollectTime(parameterVo.getCollectTime()); |
| | | needCreateFlagTimes++; |
| | | } |
| | | } |
| | | if ("and".equals(predictiveWorkPlanParameterList.get(0).getParameterCondition())) { |
| | | if (needCreateFlagTimes == predictiveWorkPlanParameterList.size()) { |
| | | needCreateFlag = true; |
| | | } |
| | | } else if ("or".equals(predictiveWorkPlanParameterList.get(0).getParameterCondition())) { |
| | | if (needCreateFlagTimes > 0) { |
| | | needCreateFlag = true; |
| | | } |
| | | } |
| | | if (needCreateFlag) { |
| | | //çæå·¥å ,å°åæ°ä¿¡æ¯å¤ä»½ |
| | | this.createOrder(predictiveWorkPlan.getId(), predictiveWorkPlan.getEquipmentId()); |
| | | this.backInfo(predictiveWorkPlan.getId(), predictiveWorkPlanParameterList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void createOrder(String workPlanId, String equipmentId) { |
| | | PredictiveWorkOrder predictiveWorkOrder = new PredictiveWorkOrder(); |
| | | predictiveWorkOrder.setWorkPlanId(workPlanId); |
| | | predictiveWorkOrder.setEquipmentId(equipmentId); |
| | | predictiveWorkOrderService.add(predictiveWorkOrder); |
| | | } |
| | | |
| | | private void backInfo(String workPlanId, List<PredictiveWorkPlanParameter> predictiveWorkPlanParameterList) { |
| | | List<PredictiveWorkPlanParameterHistory> list = new ArrayList<>(); |
| | | for (PredictiveWorkPlanParameter predictiveWorkPlanParameter : predictiveWorkPlanParameterList) { |
| | | PredictiveWorkPlanParameterHistory predictiveWorkPlanParameterHistory = new PredictiveWorkPlanParameterHistory(); |
| | | predictiveWorkPlanParameterHistory.setWorkPlanId(workPlanId); |
| | | predictiveWorkPlanParameterHistory.setParameterId(predictiveWorkPlanParameter.getParameterId()); |
| | | predictiveWorkPlanParameterHistory.setParameterCode(predictiveWorkPlanParameter.getParameterCode()); |
| | | predictiveWorkPlanParameterHistory.setParameterName(predictiveWorkPlanParameter.getParameterName()); |
| | | predictiveWorkPlanParameterHistory.setUpperLimitValue(predictiveWorkPlanParameter.getUpperLimitValue()); |
| | | predictiveWorkPlanParameterHistory.setLowerLimitValue(predictiveWorkPlanParameter.getLowerLimitValue()); |
| | | predictiveWorkPlanParameterHistory.setActualValue(predictiveWorkPlanParameter.getActualValue()); |
| | | predictiveWorkPlanParameterHistory.setParameterCondition(predictiveWorkPlanParameter.getParameterCondition()); |
| | | predictiveWorkPlanParameterHistory.setCollectTime(predictiveWorkPlanParameter.getCollectTime()); |
| | | list.add(predictiveWorkPlanParameterHistory); |
| | | } |
| | | predictiveWorkPlanParameterHistoryService.saveBatch(list); |
| | | } |
| | | |
| | | |
| | | private boolean isNewParameter(String workPlanId, Date collectTime) { |
| | | LambdaQueryChainWrapper<PredictiveWorkPlanParameterHistory> lambdaQuery = predictiveWorkPlanParameterHistoryService.lambdaQuery(); |
| | | lambdaQuery.eq(PredictiveWorkPlanParameterHistory::getWorkPlanId, workPlanId); |
| | | lambdaQuery.eq(PredictiveWorkPlanParameterHistory::getCollectTime, collectTime); |
| | | List<PredictiveWorkPlanParameterHistory> list = lambdaQuery.list(); |
| | | if (list != null && list.size() > 0) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private ParameterVo findParameterInfo(String saveTableName, float lowerLimitValue, float upperLimitValue, String parameterCode) { |
| | | return this.getBaseMapper().findParameterInfo(saveTableName, lowerLimitValue, upperLimitValue, parameterCode); |
| | | } |
| | | |
| | | private List<PredictiveWorkPlanParameter> listParameter(String predictiveWorkPlanId) { |
| | | return this.getBaseMapper().listParameter(predictiveWorkPlanId); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkPlanMapper; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PredictiveWorkPlanServiceImpl extends ServiceImpl<PredictiveWorkPlanMapper, PredictiveWorkPlan> implements IPredictiveWorkPlanService { |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlan(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return super.baseMapper.pagePredictiveWorkPlan(pageData,params); |
| | | } |
| | | |
| | | @Override |
| | | public List<PredictiveWorkPlan> listWorkPlan(String monitorType) { |
| | | LambdaQueryChainWrapper<PredictiveWorkPlan> lambdaQuery = this.lambdaQuery(); |
| | | lambdaQuery.eq(PredictiveWorkPlan::getDelFlag,0); |
| | | lambdaQuery.eq(PredictiveWorkPlan::getMonitorType,monitorType); |
| | | return lambdaQuery.list(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.eam.entity.MaintenanceOrderActualMaterial; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkOrder; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanSparePart; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkPlanSparePartMapper; |
| | | import org.jeecg.modules.eam.model.MdcEquipmentRunningSectionVo; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkOrderService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanSparePartService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import sun.reflect.generics.tree.ArrayTypeSignature; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class PredictiveWorkPlanSparePartServiceImpl extends ServiceImpl<PredictiveWorkPlanSparePartMapper, PredictiveWorkPlanSparePart> implements IPredictiveWorkPlanSparePartService { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanService predictiveWorkPlanService; |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkOrderService predictiveWorkOrderService; |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanSparePart(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return super.getBaseMapper().pagePredictiveWorkPlanSparePart(pageData, params); |
| | | } |
| | | |
| | | // 1.æ¥è¯¢é
ç½®ç å¤ä»¶è§¦åæ¡ä»¶ |
| | | // 2.è·åå¤ä»¶ççå®é
å¯¿å½ è®¾å¤å¼æºæ¶é´ - æ¢ä»¶æ¶é´ ï¼è®¾å¤å¼æºæ¶é´ä¿¡æ¯æªæ¢å°æ¨æ¥ï¼ |
| | | // 3.夿å®é
å¯¿å½æ¯å¦å¤§äºæ§å¶å¯¿å½ï¼å¹¶çæç»´æ¤å·¥å |
| | | @Override |
| | | public void createSparePartWorkPlan() { |
| | | List<PredictiveWorkPlan> predictiveWorkPlanList = predictiveWorkPlanService.listWorkPlan("bjkz"); |
| | | for (PredictiveWorkPlan predictiveWorkPlan : predictiveWorkPlanList) { |
| | | List<PredictiveWorkPlanSparePart> predictiveWorkPlanSparePartList = listPredictiveWorkPlanSparePart(predictiveWorkPlan.getId()); |
| | | for (PredictiveWorkPlanSparePart predictiveWorkPlanSparePart : predictiveWorkPlanSparePartList) { |
| | | Date replacementTime = findReplacementTime(predictiveWorkPlanSparePart.getEquipmentId(), predictiveWorkPlanSparePart.getSparePartId()); |
| | | predictiveWorkPlanSparePart.setReplacementTime(replacementTime); |
| | | long actualLife = findActualLife(predictiveWorkPlanSparePart.getMdcEquipmentId(), replacementTime); |
| | | predictiveWorkPlanSparePart.setActualLife(actualLife); |
| | | if (actualLife > predictiveWorkPlanSparePart.getLifeWarning()) { |
| | | //1.夿æ¯å¦çæç»´æ¤å·¥åï¼ 2.çæç»´æ¤å·¥å |
| | | this.createOrder(predictiveWorkPlan.getId(), predictiveWorkPlan.getEquipmentId(), predictiveWorkPlanSparePart.getId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //没æå¯¹åºçç»´æ¤å·¥åå°±çæå·¥å |
| | | private void createOrder(String workPlanId, String equipmentId, String itemId) { |
| | | LambdaQueryChainWrapper<PredictiveWorkOrder> lambdaQuery = predictiveWorkOrderService.lambdaQuery(); |
| | | lambdaQuery.eq(PredictiveWorkOrder::getEquipmentId, equipmentId).eq(PredictiveWorkOrder::getItemId, itemId).eq(PredictiveWorkOrder::getWorkPlanId, workPlanId); |
| | | //å·²å建 0 å·²ä¸å 1 æªå¼å§ 2 æ§è¡ä¸ 3 |
| | | lambdaQuery.in(PredictiveWorkOrder::getStatus, Arrays.asList(new String[]{"0", "1", "2", "3"})); |
| | | lambdaQuery.eq(PredictiveWorkOrder::getDelFlag, 0); |
| | | List<PredictiveWorkOrder> list = lambdaQuery.list(); |
| | | if (list == null || list.size() == 0) { |
| | | PredictiveWorkOrder predictiveWorkOrder = new PredictiveWorkOrder(); |
| | | predictiveWorkOrder.setItemId(itemId); |
| | | predictiveWorkOrder.setEquipmentId(equipmentId); |
| | | predictiveWorkOrder.setWorkPlanId(workPlanId); |
| | | predictiveWorkOrderService.add(predictiveWorkOrder); |
| | | } |
| | | } |
| | | |
| | | //æ¥è¯¢é
ç½®ç å¤ä»¶è§¦åæ¡ä»¶ |
| | | public List<PredictiveWorkPlanSparePart> listPredictiveWorkPlanSparePart(String predictiveWorkPlanId) { |
| | | return super.getBaseMapper().listPredictiveWorkPlanSparePart(predictiveWorkPlanId); |
| | | } |
| | | |
| | | //æåæ¢ä»¶æ¶é´ |
| | | public Date findReplacementTime(String equipmentId, String sparePartId) { |
| | | List<MaintenanceOrderActualMaterial> maintenanceOrderActualMaterialList = super.getBaseMapper().listMaintenanceOrderActualMaterial(equipmentId, sparePartId); |
| | | if (maintenanceOrderActualMaterialList.size() > 0) { |
| | | return maintenanceOrderActualMaterialList.get(0).getCreateTime(); |
| | | } |
| | | return new Date(); |
| | | } |
| | | |
| | | //å®é
å¯¿å½ |
| | | //1.ååºè®¾å¤ç¶æ |
| | | //2.ç´¯å 设å¤éå
³æºçæ¶é´ å½è®¾å¤ç¶æçå¼å§æ¶é´å°äºæ¢ä»¶æ¶é´ æè
æ¢ä»¶æ¶é´ä»äºè®¾å¤ç¶æçå¼å§æ¶é´åç»ææ¶é´ä¹é´çæ°æ®åï¼åæ¢ç´¯å |
| | | //3.æ¢ç®åä½ä¸ºå°æ¶ |
| | | public long findActualLife(String mdcEquipmentId, Date replacementTime) { |
| | | long actualLife = 0l; |
| | | long replacementTimeLong = replacementTime.getTime(); |
| | | List<MdcEquipmentRunningSectionVo> mdcEquipmentRunningSectionVoList = super.getBaseMapper().listMdcEquipmentRunningSectionVo(mdcEquipmentId); |
| | | for (MdcEquipmentRunningSectionVo temp : mdcEquipmentRunningSectionVoList) { |
| | | if (replacementTimeLong < temp.getStartLong()) { |
| | | actualLife = actualLife + temp.getDuration(); |
| | | } else if (replacementTimeLong >= temp.getStartLong() && replacementTimeLong <= temp.getEndLong()) { |
| | | actualLife = actualLife + (temp.getEndLong() - replacementTimeLong); |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | return actualLife / 60 / 60; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarnHistory; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkPlanWarnHistoryMapper; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanWarnHistoryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class PredictiveWorkPlanWarnHistoryServiceImpl extends ServiceImpl<PredictiveWorkPlanWarnHistoryMapper, PredictiveWorkPlanWarnHistory> implements IPredictiveWorkPlanWarnHistoryService { |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkOrder; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarn; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlanWarnHistory; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkPlanWarnMapper; |
| | | import org.jeecg.modules.eam.model.MdcEquipmentAlarmVo; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkOrderService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanWarnHistoryService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanWarnService; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | public class PredictiveWorkPlanWarnServiceImpl extends ServiceImpl<PredictiveWorkPlanWarnMapper, PredictiveWorkPlanWarn> implements IPredictiveWorkPlanWarnService { |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanService predictiveWorkPlanService; |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkOrderService predictiveWorkOrderService; |
| | | |
| | | @Autowired |
| | | private IPredictiveWorkPlanWarnHistoryService predictiveWorkPlanWarnHistoryService; |
| | | |
| | | @Override |
| | | public List<PredictiveWorkPlanWarn> listPredictiveWorkPlanWarn(Map<String, Object> params) { |
| | | return super.baseMapper.listPredictiveWorkPlanWarn(params); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlanWarn(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return super.baseMapper.pagePredictiveWorkPlanWarn(pageData, params); |
| | | } |
| | | |
| | | // 1.éè¿é¢æµæ§æ¹æ¡ æ¥è¯¢é
ç½®ç æ¥è¦è§¦åæ¡ä»¶ |
| | | // 2.ååºåNæ¡æ°æ®ï¼å¤æé¦å°¾ä¸¤æ¡æ°æ®æ¯å¦å¨æ¥è¦æ¡ä»¶å¨æå
|
| | | // 3.夿æ¯å¦ç产维æ¤å·¥åï¼å¹¶çæç»´æ¤å·¥å |
| | | @Override |
| | | public void createWarnWorkPlan() { |
| | | List<PredictiveWorkPlan> predictiveWorkPlanList = predictiveWorkPlanService.listWorkPlan("bjkz"); |
| | | for (PredictiveWorkPlan predictiveWorkPlan : predictiveWorkPlanList) { |
| | | List<PredictiveWorkPlanWarn> predictiveWorkPlanWarnList = listPredictiveWorkPlanWarn(predictiveWorkPlan.getId()); |
| | | //æ¹æ¡å¯¹åºçåè¦ä¿¡æ¯ |
| | | boolean needWarnFlag = false; |
| | | int needWarnFlagTimes = 0; |
| | | List<MdcEquipmentAlarmVo> insertList = new ArrayList<>(); |
| | | for (PredictiveWorkPlanWarn predictiveWorkPlanWarn : predictiveWorkPlanWarnList) { |
| | | List<MdcEquipmentAlarmVo> mdcEquipmentAlarmVoList = this.findWarnInfo(predictiveWorkPlanWarn.getMdcEquipmentId(), |
| | | predictiveWorkPlanWarn.getTimes(), predictiveWorkPlanWarn.getWarnCode()); |
| | | if (mdcEquipmentAlarmVoList.size() >= predictiveWorkPlanWarn.getTimes() && |
| | | isTimeInWarnCycle(predictiveWorkPlanWarn.getWarnCycle(), predictiveWorkPlanWarn.getCycleUnit(), |
| | | mdcEquipmentAlarmVoList.get(0).getCollectTime(), mdcEquipmentAlarmVoList.get(mdcEquipmentAlarmVoList.size() - 1).getCollectTime())) { |
| | | insertList.addAll(mdcEquipmentAlarmVoList); |
| | | needWarnFlagTimes++; |
| | | } |
| | | } |
| | | if ("and".equals(predictiveWorkPlanWarnList.get(0).getParameterCondition())) { |
| | | if (needWarnFlagTimes == predictiveWorkPlanWarnList.size()) { |
| | | needWarnFlag = true; |
| | | } |
| | | } else if ("or".equals(predictiveWorkPlanWarnList.get(0).getParameterCondition())) { |
| | | if (needWarnFlagTimes > 0) { |
| | | needWarnFlag = true; |
| | | } |
| | | } |
| | | if (needWarnFlag) { |
| | | //夿æ¯å¦çæå·¥å ,å°æ¥è¦ä¿¡æ¯å¤ä»½ |
| | | boolean flag = this.createOrder(predictiveWorkPlan.getId(), predictiveWorkPlan.getEquipmentId()); |
| | | if (flag) { |
| | | this.backInfo(predictiveWorkPlan.getId(), insertList); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void backInfo(String workPlanId, List<MdcEquipmentAlarmVo> predictiveWorkPlanWarnList) { |
| | | List<PredictiveWorkPlanWarnHistory> list = new ArrayList<>(); |
| | | for (MdcEquipmentAlarmVo mdcEquipmentAlarmVo : predictiveWorkPlanWarnList) { |
| | | PredictiveWorkPlanWarnHistory predictiveWorkPlanWarnHistory = new PredictiveWorkPlanWarnHistory(); |
| | | predictiveWorkPlanWarnHistory.setWorkPlanId(workPlanId); |
| | | predictiveWorkPlanWarnHistory.setWarnId(mdcEquipmentAlarmVo.getAlarmNo()); |
| | | predictiveWorkPlanWarnHistory.setWarnCode(mdcEquipmentAlarmVo.getAlarmNo()); |
| | | predictiveWorkPlanWarnHistory.setWarnName(mdcEquipmentAlarmVo.getAlarmContent()); |
| | | predictiveWorkPlanWarnHistory.setCollectTime(mdcEquipmentAlarmVo.getCollectTime()); |
| | | list.add(predictiveWorkPlanWarnHistory); |
| | | } |
| | | predictiveWorkPlanWarnHistoryService.saveBatch(list); |
| | | } |
| | | |
| | | private boolean createOrder(String workPlanId, String equipmentId) { |
| | | LambdaQueryChainWrapper<PredictiveWorkOrder> lambdaQuery = predictiveWorkOrderService.lambdaQuery(); |
| | | lambdaQuery.eq(PredictiveWorkOrder::getWorkPlanId, workPlanId).eq(PredictiveWorkOrder::getEquipmentId, equipmentId); |
| | | //å·²å建 0 å·²ä¸å 1 æªå¼å§ 2 æ§è¡ä¸ 3 |
| | | lambdaQuery.in(PredictiveWorkOrder::getStatus, Arrays.asList(new String[]{"0", "1", "2", "3"})); |
| | | lambdaQuery.eq(PredictiveWorkOrder::getDelFlag, 0); |
| | | List<PredictiveWorkOrder> list = lambdaQuery.list(); |
| | | if (list == null || list.size() == 0) { |
| | | PredictiveWorkOrder predictiveWorkOrder = new PredictiveWorkOrder(); |
| | | predictiveWorkOrder.setEquipmentId(equipmentId); |
| | | predictiveWorkOrder.setWorkPlanId(workPlanId); |
| | | predictiveWorkOrderService.add(predictiveWorkOrder); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //åä½ç»ä¸æ¢ç®ä¸ºç§ |
| | | private boolean isTimeInWarnCycle(int warnCycle, String cycleUnit, Date endCollectTime, Date startCollectTime) { |
| | | long warnCycleSecond = 0l; |
| | | if ("minute".equals(cycleUnit)) { |
| | | warnCycleSecond = warnCycle * 60; |
| | | } else if ("hour".equals(cycleUnit)) { |
| | | warnCycleSecond = warnCycle * 60 * 60; |
| | | } else if ("day".equals(cycleUnit)) { |
| | | warnCycleSecond = warnCycle * 60 * 60 * 24; |
| | | } |
| | | long startCollectTimeLong = startCollectTime.getTime(); |
| | | long endCollectTimeLong = endCollectTime.getTime(); |
| | | if ((endCollectTimeLong - startCollectTimeLong) <= warnCycleSecond) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private List<MdcEquipmentAlarmVo> findWarnInfo(String mdcEquipmentId, int times, String warnCode) { |
| | | return this.getBaseMapper().findWarnInfo(mdcEquipmentId, times, warnCode); |
| | | } |
| | | |
| | | //æ¹æ¡å¯¹åºçåè¦æ¡ä»¶é
ç½® |
| | | private List<PredictiveWorkPlanWarn> listPredictiveWorkPlanWarn(String predictiveWorkPlanId) { |
| | | return this.getBaseMapper().listWarn(predictiveWorkPlanId); |
| | | } |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.modules.eam.entity.RepairOrderDetail; |
| | | import org.jeecg.modules.eam.mapper.RepairOrderDetailMapper; |
| | | import org.jeecg.modules.eam.service.IRepairOrderDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | |
| | | public List<RepairOrderDetail> selectByMainId(String mainId) { |
| | | return repairOrderDetailMapper.selectByMainId(mainId); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<RepairOrderDetail> pageRepairOrderDetailByMainId(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | return super.baseMapper.pageRepairOrderDetailByMainId(pageData, params); |
| | | } |
| | | } |