diff --git a/src/main/java/org/energy/modules/smart/controller/WorkOrderController.java b/src/main/java/org/energy/modules/smart/controller/WorkOrderController.java index 59be10f..e3371b5 100644 --- a/src/main/java/org/energy/modules/smart/controller/WorkOrderController.java +++ b/src/main/java/org/energy/modules/smart/controller/WorkOrderController.java @@ -130,7 +130,7 @@ public class WorkOrderController extends DafController { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(workOrderService.deleteLogic(Func.toLongList(ids))); + return R.status(workOrderService.removeByIds(Func.toLongList(ids))); } /** diff --git a/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java b/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java index a9a3efb..d00f9bb 100644 --- a/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java +++ b/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java @@ -87,7 +87,7 @@ public class MaterialClassificationController extends DafController { qw.lambda().like(MaterialClassification::getCode, materialClassification.getCode()); } if (materialClassification.getType() != null) { - qw.lambda().eq(MaterialClassification::getType, materialClassification.getType()); + qw.lambda().like(MaterialClassification::getType, materialClassification.getType()); } qw.lambda().eq(MaterialClassification::getIsDeleted, DafConstant.DB_NOT_DELETED); qw.lambda().orderByDesc(MaterialClassification::getUpdateTime); diff --git a/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java b/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java index fa670e1..fb1e859 100644 --- a/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java +++ b/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java @@ -31,16 +31,15 @@ public class MaterialClassification extends BaseEntity { @ApiModelProperty(value = "主键") private Long id; /** - * 物资分配码 + * 物资分类码 */ - @ApiModelProperty(value = "物资分配码") + @ApiModelProperty(value = "物资分类码") private String code; /** * 物资类型 */ - @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "物资类型") - private Integer type; + private String type; } diff --git a/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml index 8921849..ba22a3e 100644 --- a/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml +++ b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml @@ -34,7 +34,7 @@ and a.code LIKE CONCAT('%', #{vo.code}, '%') - and a.type = #{vo.type} + and a.type LIKE CONCAT('%', #{vo.type}, '%') order by a.update_time desc diff --git a/src/main/java/org/energy/modules/system/controller/RoleController.java b/src/main/java/org/energy/modules/system/controller/RoleController.java index 7f3f404..2d3cc6d 100644 --- a/src/main/java/org/energy/modules/system/controller/RoleController.java +++ b/src/main/java/org/energy/modules/system/controller/RoleController.java @@ -29,8 +29,10 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.*; import lombok.AllArgsConstructor; import org.energy.modules.system.entity.Role; +import org.energy.modules.system.service.IRoleDataService; import org.energy.modules.system.service.IRoleService; import org.energy.modules.system.vo.GrantVO; +import org.energy.modules.system.vo.HomePageVO; import org.energy.modules.system.vo.RoleVO; import org.energy.modules.system.wrapper.RoleWrapper; import org.springframework.web.bind.annotation.*; @@ -56,6 +58,8 @@ public class RoleController extends DafController { private IRoleService roleService; + private IRoleDataService roleDataService; + /** * 详情 */ @@ -153,4 +157,11 @@ public class RoleController extends DafController { return R.status(temp); } + @GetMapping("/honePageData") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "首页数据", notes = "传入") + public R honePageData() { + return R.data(roleDataService.findCurrHomePageInfo()); + } + } diff --git a/src/main/java/org/energy/modules/system/service/IRoleDataService.java b/src/main/java/org/energy/modules/system/service/IRoleDataService.java new file mode 100644 index 0000000..5351ff9 --- /dev/null +++ b/src/main/java/org/energy/modules/system/service/IRoleDataService.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.energy.modules.system.service; + +import org.energy.modules.system.vo.HomePageVO; + +/** + * 服务类 + * + * @author DafX + */ +public interface IRoleDataService { + + HomePageVO findCurrHomePageInfo(); + +} diff --git a/src/main/java/org/energy/modules/system/service/impl/RoleDataServiceImpl.java b/src/main/java/org/energy/modules/system/service/impl/RoleDataServiceImpl.java new file mode 100644 index 0000000..94c11be --- /dev/null +++ b/src/main/java/org/energy/modules/system/service/impl/RoleDataServiceImpl.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.energy.modules.system.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dayu.daf.core.tool.constant.DafConstant; +import org.energy.modules.leger.entity.EquipmentLedger; +import org.energy.modules.leger.entity.ToolInventoryRecord; +import org.energy.modules.leger.service.IEquipmentLedgerService; +import org.energy.modules.leger.service.IToolInventoryRecordService; +import org.energy.modules.smart.entity.OperationTicket; +import org.energy.modules.smart.entity.WorkOrder; +import org.energy.modules.smart.entity.WorkPermit; +import org.energy.modules.smart.service.IOperationTicketService; +import org.energy.modules.smart.service.IWorkOrderService; +import org.energy.modules.smart.service.IWorkPermitService; +import org.energy.modules.spares.entity.ManufacturerInfo; +import org.energy.modules.spares.entity.Material; +import org.energy.modules.spares.entity.SupplierInfo; +import org.energy.modules.spares.entity.Warehouse; +import org.energy.modules.spares.service.IManufacturerInfoService; +import org.energy.modules.spares.service.IMaterialService; +import org.energy.modules.spares.service.ISupplierInfoService; +import org.energy.modules.spares.service.IWarehouseService; +import org.energy.modules.system.service.IRoleDataService; +import org.energy.modules.system.vo.HomePageVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 服务实现类 + * + * @author DafX + */ +@Service +public class RoleDataServiceImpl implements IRoleDataService { + + @Autowired + private IEquipmentLedgerService equipmentLedgerService; + @Autowired + private IToolInventoryRecordService toolInventoryRecordService; + @Autowired + private IOperationTicketService operationTicketService; + @Autowired + private IWorkPermitService workPermitService; + @Autowired + private IWarehouseService warehouseService; + @Autowired + private IManufacturerInfoService manufacturerInfoService; + @Autowired + private ISupplierInfoService supplierInfoService; + @Autowired + private IMaterialService materialService; + @Autowired + private IWorkOrderService workOrderService; + + @Override + public HomePageVO findCurrHomePageInfo() { + HomePageVO hp = new HomePageVO(); + + // Equipment Ledger Service + QueryWrapper qw1 = new QueryWrapper<>(); + qw1.lambda().eq(EquipmentLedger::getCheckStatus, 1); + qw1.lambda().eq(EquipmentLedger::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setEquipmentLedgerAudit(equipmentLedgerService.list(qw1)); + + // Tool Inventory Record Service + QueryWrapper qw2 = new QueryWrapper<>(); + qw2.lambda().eq(ToolInventoryRecord::getCheckStatus, 1); + qw2.lambda().eq(ToolInventoryRecord::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setToolInventoryRecordsAudit(toolInventoryRecordService.list(qw2)); + + // Operation Ticket Service + QueryWrapper qw3 = new QueryWrapper<>(); + qw3.lambda().eq(OperationTicket::getReviewStatus, 1); + qw3.lambda().eq(OperationTicket::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setOperationTicketAudit(operationTicketService.list(qw3)); + + // Work Permit Service + QueryWrapper qw4 = new QueryWrapper<>(); + qw4.lambda().eq(WorkPermit::getCheckStatus, 1); + qw4.lambda().eq(WorkPermit::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setWorkPermitAudit(workPermitService.list(qw4)); + + // Warehouse Service + QueryWrapper qw5 = new QueryWrapper<>(); + qw5.lambda().eq(Warehouse::getApprovalStatus, 1); + qw5.lambda().eq(Warehouse::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setWarehouseAudit(warehouseService.list(qw5)); + + // Manufacturer Info Service + QueryWrapper qw6 = new QueryWrapper<>(); + qw6.lambda().eq(ManufacturerInfo::getApprovalStatus, 1); + qw6.lambda().eq(ManufacturerInfo::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setManufacturerInfoAudit(manufacturerInfoService.list(qw6)); + + // Supplier Info Service + QueryWrapper qw7 = new QueryWrapper<>(); + qw7.lambda().eq(SupplierInfo::getApprovalStatus, 1); + qw7.lambda().eq(SupplierInfo::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setSupplierInfoAudit(supplierInfoService.list(qw7)); + + // Material Service + QueryWrapper qw8 = new QueryWrapper<>(); + qw8.lambda().eq(Material::getIstatus, 1L); + qw8.lambda().eq(Material::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setMaterialAudit(materialService.list(qw8)); + + // Work Order Service (already implemented) + QueryWrapper qw9 = new QueryWrapper<>(); + qw9.lambda().eq(WorkOrder::getApprovalStatus, 1); + qw9.lambda().eq(WorkOrder::getIsDeleted, DafConstant.DB_NOT_DELETED); + hp.setWorkOrderAudit(workOrderService.list(qw9)); + + return hp; + } + +} diff --git a/src/main/java/org/energy/modules/system/vo/HomePageVO.java b/src/main/java/org/energy/modules/system/vo/HomePageVO.java new file mode 100644 index 0000000..17a9e6c --- /dev/null +++ b/src/main/java/org/energy/modules/system/vo/HomePageVO.java @@ -0,0 +1,32 @@ +package org.energy.modules.system.vo; + +import lombok.Data; +import org.energy.modules.leger.entity.EquipmentLedger; +import org.energy.modules.leger.entity.ToolInventoryRecord; +import org.energy.modules.smart.entity.OperationTicket; +import org.energy.modules.smart.entity.WorkOrder; +import org.energy.modules.smart.entity.WorkPermit; +import org.energy.modules.spares.entity.ManufacturerInfo; +import org.energy.modules.spares.entity.Material; +import org.energy.modules.spares.entity.SupplierInfo; +import org.energy.modules.spares.entity.Warehouse; + +import java.util.List; + +@Data +public class HomePageVO { + + // 设备台账 + private List equipmentLedgerAudit; + private List toolInventoryRecordsAudit; + // 智能两票 + private List operationTicketAudit; + private List workPermitAudit; + // 备件管理 + private List warehouseAudit; + private List manufacturerInfoAudit; + private List supplierInfoAudit; + private List materialAudit; + // 工单 + private List workOrderAudit; +}