| | |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.base.model.FactoryIdModel; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; |
| | | import org.jeecg.modules.mdc.model.MdcEquipmentTree; |
| | | import org.jeecg.modules.mdc.model.ProductionIdModel; |
| | | import org.jeecg.modules.mdc.service.IFactoryEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentDepartService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.service.IMdcProductionEquipmentService; |
| | |
| | | private IMdcEquipmentDepartService mdcEquipmentDepartService; |
| | | |
| | | @Resource |
| | | private IMdcProductionEquipmentService mdcProductionEquipmentService; |
| | | private IFactoryEquipmentService factoryEquipmentService; |
| | | |
| | | // @Resource |
| | | // private IMdcProductionEquipmentService mdcProductionEquipmentService; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | public Result<MdcEquipment> add(@RequestBody MdcEquipment mdcEquipment) { |
| | | Result<MdcEquipment> result = new Result<>(); |
| | | String selectedDeparts = mdcEquipment.getSelectedDeparts(); |
| | | String selectedProduction = mdcEquipment.getSelectedProduction(); |
| | | String selectedProduction = mdcEquipment.getSelectedFactory(); |
| | | mdcEquipment.setEquipmentStatus(CommonConstant.STATUS_NORMAL); |
| | | try { |
| | | mdcEquipmentService.saveMdcEquipment(mdcEquipment, selectedDeparts, selectedProduction); |
| | |
| | | */ |
| | | @AutoLog(value = "设备表-查询指定设备和产线关联的数据") |
| | | @ApiOperation(value = "设备表-查询指定设备和产线关联的数据", notes = "设备表-查询指定设备和产线关联的数据") |
| | | @GetMapping(value = "/equipmentProductionList") |
| | | public Result<List<ProductionIdModel>> getEquipmentProductionList(@RequestParam(name = "equipmentId", required = true) String equipmentId) { |
| | | Result<List<ProductionIdModel>> result = new Result<>(); |
| | | @GetMapping(value = "/equipmentFactoryList") |
| | | public Result<List<FactoryIdModel>> equipmentFactoryList(@RequestParam(name = "equipmentId", required = true) String equipmentId) { |
| | | Result<List<FactoryIdModel>> result = new Result<>(); |
| | | try { |
| | | List<ProductionIdModel> proIdModelList = this.mdcProductionEquipmentService.queryProductionIdsOfEquipment(equipmentId); |
| | | List<FactoryIdModel> proIdModelList = this.factoryEquipmentService.queryFactoryIdsOfEquipment(equipmentId); |
| | | if (proIdModelList != null && !proIdModelList.isEmpty()) { |
| | | result.setSuccess(true); |
| | | result.setMessage("查找成功"); |
| | |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 查询指定设备和产线关联的数据 |
| | | // */ |
| | | // @AutoLog(value = "设备表-查询指定设备和产线关联的数据") |
| | | // @ApiOperation(value = "设备表-查询指定设备和产线关联的数据", notes = "设备表-查询指定设备和产线关联的数据") |
| | | // @GetMapping(value = "/equipmentProductionList") |
| | | // public Result<List<ProductionIdModel>> getEquipmentProductionList(@RequestParam(name = "equipmentId", required = true) String equipmentId) { |
| | | // Result<List<ProductionIdModel>> result = new Result<>(); |
| | | // try { |
| | | // List<ProductionIdModel> proIdModelList = this.mdcProductionEquipmentService.queryProductionIdsOfEquipment(equipmentId); |
| | | // if (proIdModelList != null && !proIdModelList.isEmpty()) { |
| | | // result.setSuccess(true); |
| | | // result.setMessage("查找成功"); |
| | | // result.setResult(proIdModelList); |
| | | // } else { |
| | | // result.setSuccess(false); |
| | | // result.setMessage("查找失败"); |
| | | // } |
| | | // return result; |
| | | // } catch (Exception e) { |
| | | // log.error(e.getMessage(), e); |
| | | // result.setSuccess(false); |
| | | // result.setMessage("查找过程中出现了异常: " + e.getMessage()); |
| | | // return result; |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * 加载部门设备树 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 加载产线设备树 |
| | | */ |
| | | @AutoLog(value = "设备表-加载产线设备树") |
| | | @ApiOperation(value = "设备表-加载产线设备树", notes = "设备表-加载产线设备树") |
| | | @GetMapping(value = "/queryTreeListByFactory") |
| | | public Result<List<MdcEquipmentTree>> queryTreeListByFactory() { |
| | | Result<List<MdcEquipmentTree>> result = new Result<>(); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | try { |
| | | List<MdcEquipmentTree> mdcEquipmentTreeList = mdcEquipmentService.loadTreeListByProduction(userId); |
| | | result.setSuccess(true); |
| | | result.setResult(mdcEquipmentTreeList); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |
| | | * @param request |