From def6d34ac1b82ddd9be505b8a1556b5cdb224d0a Mon Sep 17 00:00:00 2001 From: liuyiliang Date: Mon, 15 Jul 2024 18:56:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EquipmentLedgerController.java | 1 + .../modules/smart/entity/WorkOrder.java | 6 +- .../modules/smart/excel/WorkOrderExcel.java | 2 +- .../modules/smart/mapper/WorkOrderMapper.xml | 23 +- .../energy/modules/smart/vo/WorkOrderVO.java | 2 +- .../ManufacturerInfoController.java | 204 +++++++++++++++++ .../MaterialClassificationController.java | 170 ++++++++++++++ .../controller/SupplierInfoController.java | 205 +++++++++++++++++ .../controller/WarehouseController.java | 211 ++++++++++++++++++ .../spares/dto/ManufacturerInfoDTO.java | 18 ++ .../spares/dto/MaterialClassificationDTO.java | 18 ++ .../modules/spares/dto/SupplierInfoDTO.java | 18 ++ .../modules/spares/dto/WarehouseDTO.java | 18 ++ .../spares/entity/ManufacturerInfo.java | 76 +++++++ .../spares/entity/MaterialClassification.java | 46 ++++ .../modules/spares/entity/SupplierInfo.java | 86 +++++++ .../modules/spares/entity/Warehouse.java | 72 ++++++ .../spares/excel/ManufacturerInfoExcel.java | 90 ++++++++ .../spares/excel/MaterialClassExcel.java | 57 +++++ .../spares/excel/SupplierInfoExcel.java | 99 ++++++++ .../modules/spares/excel/WarehouseExcel.java | 66 ++++++ .../spares/mapper/ManufacturerInfoMapper.java | 30 +++ .../spares/mapper/ManufacturerInfoMapper.xml | 51 +++++ .../mapper/MaterialClassificationMapper.java | 30 +++ .../mapper/MaterialClassificationMapper.xml | 43 ++++ .../spares/mapper/SupplierInfoMapper.java | 31 +++ .../spares/mapper/SupplierInfoMapper.xml | 54 +++++ .../spares/mapper/WarehouseMapper.java | 30 +++ .../modules/spares/mapper/WarehouseMapper.xml | 56 +++++ .../service/IManufacturerInfoService.java | 29 +++ .../IMaterialClassificationService.java | 30 +++ .../spares/service/ISupplierInfoService.java | 29 +++ .../spares/service/IWarehouseService.java | 30 +++ .../impl/ManufacturerInfoServiceImpl.java | 45 ++++ .../MaterialClassificationServiceImpl.java | 44 ++++ .../service/impl/SupplierInfoServiceImpl.java | 44 ++++ .../service/impl/WarehouseServiceImpl.java | 45 ++++ .../modules/spares/vo/ManufacturerInfoVO.java | 20 ++ .../spares/vo/MaterialClassificationVO.java | 20 ++ .../modules/spares/vo/SupplierInfoVO.java | 20 ++ .../energy/modules/spares/vo/WarehouseVO.java | 20 ++ 41 files changed, 2175 insertions(+), 14 deletions(-) create mode 100644 src/main/java/org/energy/modules/spares/controller/ManufacturerInfoController.java create mode 100644 src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java create mode 100644 src/main/java/org/energy/modules/spares/controller/SupplierInfoController.java create mode 100644 src/main/java/org/energy/modules/spares/controller/WarehouseController.java create mode 100644 src/main/java/org/energy/modules/spares/dto/ManufacturerInfoDTO.java create mode 100644 src/main/java/org/energy/modules/spares/dto/MaterialClassificationDTO.java create mode 100644 src/main/java/org/energy/modules/spares/dto/SupplierInfoDTO.java create mode 100644 src/main/java/org/energy/modules/spares/dto/WarehouseDTO.java create mode 100644 src/main/java/org/energy/modules/spares/entity/ManufacturerInfo.java create mode 100644 src/main/java/org/energy/modules/spares/entity/MaterialClassification.java create mode 100644 src/main/java/org/energy/modules/spares/entity/SupplierInfo.java create mode 100644 src/main/java/org/energy/modules/spares/entity/Warehouse.java create mode 100644 src/main/java/org/energy/modules/spares/excel/ManufacturerInfoExcel.java create mode 100644 src/main/java/org/energy/modules/spares/excel/MaterialClassExcel.java create mode 100644 src/main/java/org/energy/modules/spares/excel/SupplierInfoExcel.java create mode 100644 src/main/java/org/energy/modules/spares/excel/WarehouseExcel.java create mode 100644 src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.java create mode 100644 src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.xml create mode 100644 src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.java create mode 100644 src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml create mode 100644 src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.java create mode 100644 src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.xml create mode 100644 src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.java create mode 100644 src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.xml create mode 100644 src/main/java/org/energy/modules/spares/service/IManufacturerInfoService.java create mode 100644 src/main/java/org/energy/modules/spares/service/IMaterialClassificationService.java create mode 100644 src/main/java/org/energy/modules/spares/service/ISupplierInfoService.java create mode 100644 src/main/java/org/energy/modules/spares/service/IWarehouseService.java create mode 100644 src/main/java/org/energy/modules/spares/service/impl/ManufacturerInfoServiceImpl.java create mode 100644 src/main/java/org/energy/modules/spares/service/impl/MaterialClassificationServiceImpl.java create mode 100644 src/main/java/org/energy/modules/spares/service/impl/SupplierInfoServiceImpl.java create mode 100644 src/main/java/org/energy/modules/spares/service/impl/WarehouseServiceImpl.java create mode 100644 src/main/java/org/energy/modules/spares/vo/ManufacturerInfoVO.java create mode 100644 src/main/java/org/energy/modules/spares/vo/MaterialClassificationVO.java create mode 100644 src/main/java/org/energy/modules/spares/vo/SupplierInfoVO.java create mode 100644 src/main/java/org/energy/modules/spares/vo/WarehouseVO.java diff --git a/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java b/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java index 32063b7..808c59a 100644 --- a/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java +++ b/src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java @@ -271,6 +271,7 @@ public class EquipmentLedgerController extends DafController { if (StringUtils.isNotEmpty(coding)) { queryWrapper.lambda().like(EquipmentLedger::getKksEncoding, coding); } + queryWrapper.lambda().eq(EquipmentLedger::getIsDeleted, DafConstant.DB_NOT_DELETED); queryWrapper.lambda().orderByDesc(EquipmentLedger::getKksEncoding); queryWrapper.lambda().last(" LIMIT 50"); List list = equipmentLedgerService.list(queryWrapper); diff --git a/src/main/java/org/energy/modules/smart/entity/WorkOrder.java b/src/main/java/org/energy/modules/smart/entity/WorkOrder.java index 0d532fb..a906147 100644 --- a/src/main/java/org/energy/modules/smart/entity/WorkOrder.java +++ b/src/main/java/org/energy/modules/smart/entity/WorkOrder.java @@ -48,6 +48,7 @@ public class WorkOrder extends BaseEntity { /** * 工单类型 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "工单类型") private Integer workOrderType; /** @@ -60,7 +61,7 @@ public class WorkOrder extends BaseEntity { */ @JsonSerialize(using = ToStringSerializer.class) @ApiModelProperty(value = "负责人") - private Long responsibleUserId; + private Long managerUserId; /** * 责任班组 */ @@ -74,11 +75,13 @@ public class WorkOrder extends BaseEntity { /** * 维护作业类型 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "维护作业类型") private Integer maintenanceTaskType; /** * 用户状态 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "用户状态") private Integer userStatus; /** @@ -114,6 +117,7 @@ public class WorkOrder extends BaseEntity { /** * 处理结果 */ + @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "处理结果") private Integer handlingResult; /** diff --git a/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java b/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java index 2564ebf..a9d8bc9 100644 --- a/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java +++ b/src/main/java/org/energy/modules/smart/excel/WorkOrderExcel.java @@ -60,7 +60,7 @@ public class WorkOrderExcel implements Serializable { @ColumnWidth(20) @ExcelProperty(value = "负责人") - private String responsibleUserName; + private String managerUserName; @ColumnWidth(20) @ExcelProperty(value = "责任班组") diff --git a/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml b/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml index f5fd997..ca5bdf9 100644 --- a/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml +++ b/src/main/java/org/energy/modules/smart/mapper/WorkOrderMapper.xml @@ -16,7 +16,7 @@ - + @@ -33,20 +33,20 @@ - + diff --git a/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java b/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java index 25ae0c9..adfce8c 100644 --- a/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java +++ b/src/main/java/org/energy/modules/smart/vo/WorkOrderVO.java @@ -23,7 +23,7 @@ public class WorkOrderVO extends WorkOrder { private Integer station; - private String responsibleUserName; + private String managerUserName; } diff --git a/src/main/java/org/energy/modules/spares/controller/ManufacturerInfoController.java b/src/main/java/org/energy/modules/spares/controller/ManufacturerInfoController.java new file mode 100644 index 0000000..0a0ba02 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/ManufacturerInfoController.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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.spares.controller; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dayu.daf.core.log.annotation.ApiLog; +import com.dayu.daf.core.tool.constant.DafConstant; +import io.micrometer.core.instrument.util.StringUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import com.dayu.daf.core.mp.support.Condition; +import com.dayu.daf.core.mp.support.Query; +import com.dayu.daf.core.tool.api.R; +import com.dayu.daf.core.tool.utils.Func; +import lombok.SneakyThrows; +import org.apache.commons.codec.Charsets; +import org.energy.modules.spares.excel.ManufacturerInfoExcel; +import org.energy.modules.system.util.DataUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestParam; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.energy.modules.spares.entity.ManufacturerInfo; +import org.energy.modules.spares.vo.ManufacturerInfoVO; +import org.energy.modules.spares.service.IManufacturerInfoService; +import com.dayu.daf.core.boot.ctrl.DafController; +import springfox.documentation.annotations.ApiIgnore; + +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * spt_manufacturer_info 控制器 + * + * @author Daf + * @since 2024-07-15 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/manufacturerinfo") +@Api(value = "spt_manufacturer_info", tags = "spt_manufacturer_info接口") +public class ManufacturerInfoController extends DafController { + + private IManufacturerInfoService manufacturerInfoService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入manufacturerInfo") + public R detail(ManufacturerInfo manufacturerInfo) { + ManufacturerInfo detail = manufacturerInfoService.getOne(Condition.getQueryWrapper(manufacturerInfo)); + return R.data(detail); + } + + /** + * 分页 spt_manufacturer_info + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入manufacturerInfo") + public R> list(ManufacturerInfo manufacturerInfo, Query query) { + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotEmpty(manufacturerInfo.getCreditCode())) { + qw.lambda().like(ManufacturerInfo::getCreditCode, manufacturerInfo.getCreditCode()); + } + if (StringUtils.isNotEmpty(manufacturerInfo.getManufacturerName())) { + qw.lambda().like(ManufacturerInfo::getManufacturerName, manufacturerInfo.getManufacturerName()); + } + qw.lambda().eq(ManufacturerInfo::getIsDeleted, DafConstant.DB_NOT_DELETED); + qw.lambda().orderByDesc(ManufacturerInfo::getUpdateTime); + IPage pages = manufacturerInfoService.page(Condition.getPage(query), qw); + return R.data(pages); + } + + /** + * 自定义分页 spt_manufacturer_info + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入manufacturerInfo") + public R> page(ManufacturerInfoVO manufacturerInfo, Query query) { + IPage pages = manufacturerInfoService.selectManufacturerInfoPage(Condition.getPage(query), manufacturerInfo); + return R.data(pages); + } + + /** + * 新增 spt_manufacturer_info + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入manufacturerInfo") + public R save(@Valid @RequestBody ManufacturerInfo manufacturerInfo) { + return R.status(manufacturerInfoService.save(manufacturerInfo)); + } + + /** + * 修改 spt_manufacturer_info + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入manufacturerInfo") + public R update(@Valid @RequestBody ManufacturerInfo manufacturerInfo) { + return R.status(manufacturerInfoService.updateById(manufacturerInfo)); + } + + /** + * 新增或修改 spt_manufacturer_info + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入manufacturerInfo") + public R submit(@Valid @RequestBody ManufacturerInfo manufacturerInfo) { + return R.status(manufacturerInfoService.saveOrUpdate(manufacturerInfo)); + } + + + /** + * 删除 spt_manufacturer_info + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(manufacturerInfoService.deleteLogic(Func.toLongList(ids))); + } + + /** + * 审核 + */ + @PostMapping("/auditing") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "更新", notes = "传入ids") + public R auditing(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return this.approve(2,ids); + } + + /** + * 驳回 + */ + @PostMapping("/reject") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "更新", notes = "传入ids") + public R reject(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return this.approve(3,ids); + } + + /** + * 驳回OR审核 + */ + public R approve(Integer status, String ids) { + List list = new ArrayList<>(); + for (String id : ids.split(",")) { + ManufacturerInfo manufacturerInfo = new ManufacturerInfo(); + manufacturerInfo.setId(Long.parseLong(id)); + manufacturerInfo.setApprovalStatus(status); + list.add(manufacturerInfo); + } + return R.status(manufacturerInfoService.updateBatchById(list)); + } + + /** + * 导出 + */ + @SneakyThrows + @GetMapping("export") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "导出", notes = "传入") + @ApiLog + public void exportUser(@ApiIgnore @RequestParam Map entity, HttpServletResponse response) { + entity.remove("daf-auth"); + ManufacturerInfoVO vo = DataUtils.mapToEntity(entity, ManufacturerInfoVO::new); + List list = manufacturerInfoService.export(vo); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding(Charsets.UTF_8.name()); + String fileName = URLEncoder.encode("制造商信息管理数据导出", Charsets.UTF_8.name()); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + EasyExcel.write(response.getOutputStream(), ManufacturerInfoExcel.class).sheet("制造商信息管理").doWrite(list); + } + +} diff --git a/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java b/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java new file mode 100644 index 0000000..a9a3efb --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/MaterialClassificationController.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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.spares.controller; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dayu.daf.core.log.annotation.ApiLog; +import com.dayu.daf.core.tool.constant.DafConstant; +import io.micrometer.core.instrument.util.StringUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import com.dayu.daf.core.mp.support.Condition; +import com.dayu.daf.core.mp.support.Query; +import com.dayu.daf.core.tool.api.R; +import com.dayu.daf.core.tool.utils.Func; +import lombok.SneakyThrows; +import org.apache.commons.codec.Charsets; +import org.energy.modules.spares.excel.MaterialClassExcel; +import org.energy.modules.system.util.DataUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestParam; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.energy.modules.spares.entity.MaterialClassification; +import org.energy.modules.spares.vo.MaterialClassificationVO; +import org.energy.modules.spares.service.IMaterialClassificationService; +import com.dayu.daf.core.boot.ctrl.DafController; +import springfox.documentation.annotations.ApiIgnore; + +import java.net.URLEncoder; +import java.util.List; +import java.util.Map; + +/** + * spt_material_classification 控制器 + * + * @author Daf + * @since 2024-07-15 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/materialclassification") +@Api(value = "spt_material_classification", tags = "spt_material_classification接口") +public class MaterialClassificationController extends DafController { + + private IMaterialClassificationService materialClassificationService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入materialClassification") + public R detail(MaterialClassification materialClassification) { + MaterialClassification detail = materialClassificationService.getOne(Condition.getQueryWrapper(materialClassification)); + return R.data(detail); + } + + /** + * 分页 spt_material_classification + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入materialClassification") + public R> list(MaterialClassification materialClassification, Query query) { + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotEmpty(materialClassification.getCode())) { + qw.lambda().like(MaterialClassification::getCode, materialClassification.getCode()); + } + if (materialClassification.getType() != null) { + qw.lambda().eq(MaterialClassification::getType, materialClassification.getType()); + } + qw.lambda().eq(MaterialClassification::getIsDeleted, DafConstant.DB_NOT_DELETED); + qw.lambda().orderByDesc(MaterialClassification::getUpdateTime); + IPage pages = materialClassificationService.page(Condition.getPage(query), qw); + return R.data(pages); + } + + /** + * 自定义分页 spt_material_classification + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入materialClassification") + public R> page(MaterialClassificationVO materialClassification, Query query) { + IPage pages = materialClassificationService.selectMaterialClassificationPage(Condition.getPage(query), materialClassification); + return R.data(pages); + } + + /** + * 新增 spt_material_classification + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入materialClassification") + public R save(@Valid @RequestBody MaterialClassification materialClassification) { + return R.status(materialClassificationService.save(materialClassification)); + } + + /** + * 修改 spt_material_classification + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入materialClassification") + public R update(@Valid @RequestBody MaterialClassification materialClassification) { + return R.status(materialClassificationService.updateById(materialClassification)); + } + + /** + * 新增或修改 spt_material_classification + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入materialClassification") + public R submit(@Valid @RequestBody MaterialClassification materialClassification) { + return R.status(materialClassificationService.saveOrUpdate(materialClassification)); + } + + + /** + * 删除 spt_material_classification + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(materialClassificationService.deleteLogic(Func.toLongList(ids))); + } + + /** + * 导出 + */ + @SneakyThrows + @GetMapping("export") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "导出", notes = "传入") + @ApiLog + public void exportUser(@ApiIgnore @RequestParam Map entity, HttpServletResponse response) { + entity.remove("daf-auth"); + MaterialClassificationVO vo = DataUtils.mapToEntity(entity, MaterialClassificationVO::new); + List list = materialClassificationService.export(vo); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding(Charsets.UTF_8.name()); + String fileName = URLEncoder.encode("物资分类码数据导出", Charsets.UTF_8.name()); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + EasyExcel.write(response.getOutputStream(), MaterialClassExcel.class).sheet("物资分类码").doWrite(list); + } + + +} diff --git a/src/main/java/org/energy/modules/spares/controller/SupplierInfoController.java b/src/main/java/org/energy/modules/spares/controller/SupplierInfoController.java new file mode 100644 index 0000000..f57bf4b --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/SupplierInfoController.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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.spares.controller; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dayu.daf.core.log.annotation.ApiLog; +import com.dayu.daf.core.tool.constant.DafConstant; +import io.micrometer.core.instrument.util.StringUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import com.dayu.daf.core.mp.support.Condition; +import com.dayu.daf.core.mp.support.Query; +import com.dayu.daf.core.tool.api.R; +import com.dayu.daf.core.tool.utils.Func; +import lombok.SneakyThrows; +import org.apache.commons.codec.Charsets; +import org.energy.modules.spares.excel.SupplierInfoExcel; +import org.energy.modules.system.util.DataUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestParam; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.energy.modules.spares.entity.SupplierInfo; +import org.energy.modules.spares.vo.SupplierInfoVO; +import org.energy.modules.spares.service.ISupplierInfoService; +import com.dayu.daf.core.boot.ctrl.DafController; +import springfox.documentation.annotations.ApiIgnore; + +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * spt_supplier_info 控制器 + * + * @author Daf + * @since 2024-07-15 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/supplierinfo") +@Api(value = "spt_supplier_info", tags = "spt_supplier_info接口") +public class SupplierInfoController extends DafController { + + private ISupplierInfoService supplierInfoService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入supplierInfo") + public R detail(SupplierInfo supplierInfo) { + SupplierInfo detail = supplierInfoService.getOne(Condition.getQueryWrapper(supplierInfo)); + return R.data(detail); + } + + /** + * 分页 spt_supplier_info + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入supplierInfo") + public R> list(SupplierInfo supplierInfo, Query query) { + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotEmpty(supplierInfo.getCreditCode())) { + qw.lambda().like(SupplierInfo::getCreditCode, supplierInfo.getCreditCode()); + } + if (StringUtils.isNotEmpty(supplierInfo.getSupplierName())) { + qw.lambda().like(SupplierInfo::getSupplierName, supplierInfo.getSupplierName()); + } + qw.lambda().eq(SupplierInfo::getIsDeleted, DafConstant.DB_NOT_DELETED); + qw.lambda().orderByDesc(SupplierInfo::getUpdateTime); + IPage pages = supplierInfoService.page(Condition.getPage(query), qw); + return R.data(pages); + } + + /** + * 自定义分页 spt_supplier_info + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入supplierInfo") + public R> page(SupplierInfoVO supplierInfo, Query query) { + IPage pages = supplierInfoService.selectSupplierInfoPage(Condition.getPage(query), supplierInfo); + return R.data(pages); + } + + /** + * 新增 spt_supplier_info + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入supplierInfo") + public R save(@Valid @RequestBody SupplierInfo supplierInfo) { + return R.status(supplierInfoService.save(supplierInfo)); + } + + /** + * 修改 spt_supplier_info + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入supplierInfo") + public R update(@Valid @RequestBody SupplierInfo supplierInfo) { + return R.status(supplierInfoService.updateById(supplierInfo)); + } + + /** + * 新增或修改 spt_supplier_info + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入supplierInfo") + public R submit(@Valid @RequestBody SupplierInfo supplierInfo) { + return R.status(supplierInfoService.saveOrUpdate(supplierInfo)); + } + + + /** + * 删除 spt_supplier_info + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(supplierInfoService.deleteLogic(Func.toLongList(ids))); + } + + /** + * 审核 + */ + @PostMapping("/auditing") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "更新", notes = "传入ids") + public R auditing(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return this.approve(2,ids); + } + + /** + * 驳回 + */ + @PostMapping("/reject") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "更新", notes = "传入ids") + public R reject(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return this.approve(3,ids); + } + + /** + * 驳回OR审核 + */ + public R approve(Integer status, String ids) { + List list = new ArrayList<>(); + for (String id : ids.split(",")) { + SupplierInfo supplierInfo = new SupplierInfo(); + supplierInfo.setId(Long.parseLong(id)); + supplierInfo.setApprovalStatus(status); + list.add(supplierInfo); + } + return R.status(supplierInfoService.updateBatchById(list)); + } + + /** + * 导出 + */ + @SneakyThrows + @GetMapping("export") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "导出", notes = "传入") + @ApiLog + public void exportUser(@ApiIgnore @RequestParam Map entity, HttpServletResponse response) { + entity.remove("daf-auth"); + SupplierInfoVO vo = DataUtils.mapToEntity(entity, SupplierInfoVO::new); + List list = supplierInfoService.export(vo); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding(Charsets.UTF_8.name()); + String fileName = URLEncoder.encode("供应商信息管理数据导出", Charsets.UTF_8.name()); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + EasyExcel.write(response.getOutputStream(), SupplierInfoExcel.class).sheet("供应商信息管理").doWrite(list); + } + + +} diff --git a/src/main/java/org/energy/modules/spares/controller/WarehouseController.java b/src/main/java/org/energy/modules/spares/controller/WarehouseController.java new file mode 100644 index 0000000..415798a --- /dev/null +++ b/src/main/java/org/energy/modules/spares/controller/WarehouseController.java @@ -0,0 +1,211 @@ +/** + * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). + *

+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.gnu.org/licenses/lgpl.html + *

+ * 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.spares.controller; + +import com.alibaba.excel.EasyExcel; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dayu.daf.core.log.annotation.ApiLog; +import com.dayu.daf.core.tool.constant.DafConstant; +import io.micrometer.core.instrument.util.StringUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import com.dayu.daf.core.mp.support.Condition; +import com.dayu.daf.core.mp.support.Query; +import com.dayu.daf.core.tool.api.R; +import com.dayu.daf.core.tool.utils.Func; +import lombok.SneakyThrows; +import org.apache.commons.codec.Charsets; +import org.energy.modules.spares.entity.ManufacturerInfo; +import org.energy.modules.spares.excel.WarehouseExcel; +import org.energy.modules.system.util.DataUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.RequestParam; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.energy.modules.spares.entity.Warehouse; +import org.energy.modules.spares.vo.WarehouseVO; +import org.energy.modules.spares.service.IWarehouseService; +import com.dayu.daf.core.boot.ctrl.DafController; +import springfox.documentation.annotations.ApiIgnore; + +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * spt_warehouse 控制器 + * + * @author Daf + * @since 2024-07-15 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/warehouse") +@Api(value = "spt_warehouse", tags = "spt_warehouse接口") +public class WarehouseController extends DafController { + + private IWarehouseService warehouseService; + + /** + * 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "详情", notes = "传入warehouse") + public R detail(Warehouse warehouse) { + Warehouse detail = warehouseService.getOne(Condition.getQueryWrapper(warehouse)); + return R.data(detail); + } + + /** + * 分页 spt_warehouse + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入warehouse") + public R> list(Warehouse warehouse, Query query) { + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotEmpty(warehouse.getCode())) { + qw.lambda().like(Warehouse::getCode, warehouse.getCode()); + } + if (StringUtils.isNotEmpty(warehouse.getName())) { + qw.lambda().like(Warehouse::getName, warehouse.getName()); + } + if (StringUtils.isNotEmpty(warehouse.getAddress())) { + qw.lambda().like(Warehouse::getAddress, warehouse.getAddress()); + } + if (warehouse.getType() != null) { + qw.lambda().eq(Warehouse::getType, warehouse.getType()); + } + qw.lambda().eq(Warehouse::getIsDeleted, DafConstant.DB_NOT_DELETED); + qw.lambda().orderByDesc(Warehouse::getUpdateTime); + IPage pages = warehouseService.page(Condition.getPage(query), qw); + return R.data(pages); + } + + /** + * 自定义分页 spt_warehouse + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "分页", notes = "传入warehouse") + public R> page(WarehouseVO warehouse, Query query) { + IPage pages = warehouseService.selectWarehousePage(Condition.getPage(query), warehouse); + return R.data(pages); + } + + /** + * 新增 spt_warehouse + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @ApiOperation(value = "新增", notes = "传入warehouse") + public R save(@Valid @RequestBody Warehouse warehouse) { + return R.status(warehouseService.save(warehouse)); + } + + /** + * 修改 spt_warehouse + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "修改", notes = "传入warehouse") + public R update(@Valid @RequestBody Warehouse warehouse) { + return R.status(warehouseService.updateById(warehouse)); + } + + /** + * 新增或修改 spt_warehouse + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "新增或修改", notes = "传入warehouse") + public R submit(@Valid @RequestBody Warehouse warehouse) { + return R.status(warehouseService.saveOrUpdate(warehouse)); + } + + + /** + * 删除 spt_warehouse + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(warehouseService.deleteLogic(Func.toLongList(ids))); + } + + /** + * 审核 + */ + @PostMapping("/auditing") + @ApiOperationSupport(order = 8) + @ApiOperation(value = "更新", notes = "传入ids") + public R auditing(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return this.approve(2,ids); + } + + /** + * 驳回 + */ + @PostMapping("/reject") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "更新", notes = "传入ids") + public R reject(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return this.approve(3,ids); + } + + /** + * 驳回OR审核 + */ + public R approve(Integer status, String ids) { + List list = new ArrayList<>(); + for (String id : ids.split(",")) { + Warehouse warehouse = new Warehouse(); + warehouse.setId(Long.parseLong(id)); + warehouse.setApprovalStatus(status); + list.add(warehouse); + } + return R.status(warehouseService.updateBatchById(list)); + } + + /** + * 导出 + */ + @SneakyThrows + @GetMapping("export") + @ApiOperationSupport(order = 10) + @ApiOperation(value = "导出", notes = "传入") + @ApiLog + public void exportUser(@ApiIgnore @RequestParam Map entity, HttpServletResponse response) { + entity.remove("daf-auth"); + WarehouseVO vo = DataUtils.mapToEntity(entity, WarehouseVO::new); + List list = warehouseService.export(vo); + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding(Charsets.UTF_8.name()); + String fileName = URLEncoder.encode("仓库数据导出", Charsets.UTF_8.name()); + response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); + EasyExcel.write(response.getOutputStream(), WarehouseExcel.class).sheet("仓库").doWrite(list); + } + +} diff --git a/src/main/java/org/energy/modules/spares/dto/ManufacturerInfoDTO.java b/src/main/java/org/energy/modules/spares/dto/ManufacturerInfoDTO.java new file mode 100644 index 0000000..96df777 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/ManufacturerInfoDTO.java @@ -0,0 +1,18 @@ +package org.energy.modules.spares.dto; + +import org.energy.modules.spares.entity.ManufacturerInfo; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * spt_manufacturer_info数据传输对象实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class ManufacturerInfoDTO extends ManufacturerInfo { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/spares/dto/MaterialClassificationDTO.java b/src/main/java/org/energy/modules/spares/dto/MaterialClassificationDTO.java new file mode 100644 index 0000000..c6ea37c --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/MaterialClassificationDTO.java @@ -0,0 +1,18 @@ +package org.energy.modules.spares.dto; + +import org.energy.modules.spares.entity.MaterialClassification; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * spt_material_classification数据传输对象实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class MaterialClassificationDTO extends MaterialClassification { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/spares/dto/SupplierInfoDTO.java b/src/main/java/org/energy/modules/spares/dto/SupplierInfoDTO.java new file mode 100644 index 0000000..eeca2b0 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/SupplierInfoDTO.java @@ -0,0 +1,18 @@ +package org.energy.modules.spares.dto; + +import org.energy.modules.spares.entity.SupplierInfo; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * spt_supplier_info数据传输对象实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class SupplierInfoDTO extends SupplierInfo { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/spares/dto/WarehouseDTO.java b/src/main/java/org/energy/modules/spares/dto/WarehouseDTO.java new file mode 100644 index 0000000..0445acb --- /dev/null +++ b/src/main/java/org/energy/modules/spares/dto/WarehouseDTO.java @@ -0,0 +1,18 @@ +package org.energy.modules.spares.dto; + +import org.energy.modules.spares.entity.Warehouse; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * spt_warehouse数据传输对象实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class WarehouseDTO extends Warehouse { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/spares/entity/ManufacturerInfo.java b/src/main/java/org/energy/modules/spares/entity/ManufacturerInfo.java new file mode 100644 index 0000000..5c2f52c --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/ManufacturerInfo.java @@ -0,0 +1,76 @@ +package org.energy.modules.spares.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dayu.daf.core.mp.base.BaseEntity; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * spt_manufacturer_info实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@TableName("spt_manufacturer_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ManufacturerInfo对象", description = "spt_manufacturer_info") +public class ManufacturerInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + private Long id; + /** + * 统一社会信用代码/组织机构 + */ + @ApiModelProperty(value = "统一社会信用代码/组织机构") + private String creditCode; + /** + * 制造商名称 + */ + @ApiModelProperty(value = "制造商名称") + private String manufacturerName; + /** + * 注册地址 + */ + @ApiModelProperty(value = "注册地址") + private String registeredAddress; + /** + * 生产地址 + */ + @ApiModelProperty(value = "生产地址") + private String productionAddress; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private String contactNumber; + /** + * 电子邮箱 + */ + @ApiModelProperty(value = "电子邮箱") + private String email; + /** + * 经营范围 + */ + @ApiModelProperty(value = "经营范围") + private String businessScope; + /** + * 执行标准 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @ApiModelProperty(value = "执行标准") + private Integer approvalStatus; + + +} diff --git a/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java b/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java new file mode 100644 index 0000000..fa670e1 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/MaterialClassification.java @@ -0,0 +1,46 @@ +package org.energy.modules.spares.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dayu.daf.core.mp.base.BaseEntity; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * spt_material_classification实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@TableName("spt_material_classification") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "MaterialClassification对象", description = "spt_material_classification") +public class MaterialClassification extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + private Long id; + /** + * 物资分配码 + */ + @ApiModelProperty(value = "物资分配码") + private String code; + /** + * 物资类型 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @ApiModelProperty(value = "物资类型") + private Integer type; + + +} diff --git a/src/main/java/org/energy/modules/spares/entity/SupplierInfo.java b/src/main/java/org/energy/modules/spares/entity/SupplierInfo.java new file mode 100644 index 0000000..753abff --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/SupplierInfo.java @@ -0,0 +1,86 @@ +package org.energy.modules.spares.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dayu.daf.core.mp.base.BaseEntity; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * spt_supplier_info实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@TableName("spt_supplier_info") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SupplierInfo对象", description = "spt_supplier_info") +public class SupplierInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + private Long id; + /** + * 统一社会信用代码/组织机构 + */ + @ApiModelProperty(value = "统一社会信用代码/组织机构") + private String creditCode; + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + /** + * 注册地址 + */ + @ApiModelProperty(value = "注册地址") + private String registeredAddress; + /** + * 生产地址 + */ + @ApiModelProperty(value = "生产地址") + private String productionAddress; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private String contactNumber; + /** + * 电子邮箱 + */ + @ApiModelProperty(value = "电子邮箱") + private String email; + /** + * 经营范围 + */ + @ApiModelProperty(value = "经营范围") + private String businessScope; + /** + * 执行标准 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @ApiModelProperty(value = "执行标准") + private Integer approvalStatus; + /** + * 付款条约 + */ + @ApiModelProperty(value = "付款条约") + private String paymentTerms; + /** + * 价格条款 + */ + @ApiModelProperty(value = "价格条款") + private String priceTerms; + + +} diff --git a/src/main/java/org/energy/modules/spares/entity/Warehouse.java b/src/main/java/org/energy/modules/spares/entity/Warehouse.java new file mode 100644 index 0000000..171ab2c --- /dev/null +++ b/src/main/java/org/energy/modules/spares/entity/Warehouse.java @@ -0,0 +1,72 @@ +package org.energy.modules.spares.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.dayu.daf.core.mp.base.BaseEntity; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * spt_warehouse实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@TableName("spt_warehouse") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "Warehouse对象", description = "spt_warehouse") +public class Warehouse extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + private Long id; + /** + * 仓库编号 + */ + @ApiModelProperty(value = "仓库编号") + private String code; + /** + * 仓库名称 + */ + @ApiModelProperty(value = "仓库名称") + private String name; + /** + * 仓库地址 + */ + @ApiModelProperty(value = "仓库地址") + private String address; + /** + * 仓库类型 + */ + @ApiModelProperty(value = "仓库类型") + private Integer type; + /** + * 仓库负责人 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "仓库负责人") + private Long managerUserId; + /** + * 联系电话 + */ + @ApiModelProperty(value = "联系电话") + private String contactNumber; + /** + * 审批状态 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @ApiModelProperty(value = "审批状态") + private Integer approvalStatus; + + +} diff --git a/src/main/java/org/energy/modules/spares/excel/ManufacturerInfoExcel.java b/src/main/java/org/energy/modules/spares/excel/ManufacturerInfoExcel.java new file mode 100644 index 0000000..51ee610 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/ManufacturerInfoExcel.java @@ -0,0 +1,90 @@ +/** + * 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.spares.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * Warehouse model export + * @author edwong + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(16) +public class ManufacturerInfoExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 统一社会信用代码/组织机构 + */ + @ColumnWidth(20) + @ExcelProperty(value = "统一社会信用代码/组织机构") + private String creditCode; + /** + * 制造商名称 + */ + @ColumnWidth(20) + @ExcelProperty(value = "制造商名称") + private String manufacturerName; + /** + * 注册地址 + */ + @ColumnWidth(20) + @ExcelProperty(value = "注册地址") + private String registeredAddress; + /** + * 生产地址 + */ + @ColumnWidth(20) + @ExcelProperty(value = "生产地址") + private String productionAddress; + /** + * 联系电话 + */ + @ColumnWidth(20) + @ExcelProperty(value = "联系电话") + private String contactNumber; + /** + * 电子邮箱 + */ + @ColumnWidth(20) + @ExcelProperty(value = "电子邮箱") + private String email; + /** + * 经营范围 + */ + @ColumnWidth(20) + @ExcelProperty(value = "经营范围") + private String businessScope; + /** + * 执行标准 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @ColumnWidth(20) + @ExcelProperty(value = "执行标准") + private String approvalStatus; + +} diff --git a/src/main/java/org/energy/modules/spares/excel/MaterialClassExcel.java b/src/main/java/org/energy/modules/spares/excel/MaterialClassExcel.java new file mode 100644 index 0000000..c0c71c7 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/MaterialClassExcel.java @@ -0,0 +1,57 @@ +/** + * 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.spares.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serializable; + +/** + * Warehouse model export + * @author edwong + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(16) +public class MaterialClassExcel implements Serializable { + private static final long serialVersionUID = 1L; + + @ColumnWidth(20) + @ExcelProperty(value = "物资分类码") + private String code; + + @ColumnWidth(20) + @ExcelProperty(value = "物资类型") + private String type; + + @ColumnWidth(20) + @ExcelProperty(value = "创建时间") + private String createTime; + + @ColumnWidth(20) + @ExcelProperty(value = "创建人") + private String createUserName; + + @ColumnWidth(20) + @ExcelProperty(value = "审批状态") + private String approvalStatus; + +} diff --git a/src/main/java/org/energy/modules/spares/excel/SupplierInfoExcel.java b/src/main/java/org/energy/modules/spares/excel/SupplierInfoExcel.java new file mode 100644 index 0000000..4c00fa6 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/SupplierInfoExcel.java @@ -0,0 +1,99 @@ +/** + * 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.spares.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * SupplierInfo model export + * @author edwong + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(16) +public class SupplierInfoExcel implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 统一社会信用代码/组织机构 + */ + @ColumnWidth(20) + @ExcelProperty(value = "统一社会信用代码/组织机构") + private String creditCode; + /** + * 供应商名称 + */ + @ColumnWidth(20) + @ExcelProperty(value = "供应商名称") + private String supplierName; + /** + * 注册地址 + */ + /** + * 生产地址 + */ + @ColumnWidth(20) + @ExcelProperty(value = "生产地址") + private String productionAddress; + /** + * 联系电话 + */ + @ColumnWidth(20) + @ExcelProperty(value = "联系电话") + private String contactNumber; + /** + * 电子邮箱 + */ + @ColumnWidth(20) + @ExcelProperty(value = "电子邮箱") + private String email; + /** + * 经营范围 + */ + @ColumnWidth(20) + @ExcelProperty(value = "经营范围") + private String businessScope; + /** + * 执行标准 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @ColumnWidth(20) + @ExcelProperty(value = "执行标准") + private String approvalStatus; + /** + * 付款条约 + */ + @ColumnWidth(20) + @ExcelProperty(value = "付款条约") + private String paymentTerms; + /** + * 价格条款 + */ + @ColumnWidth(20) + @ExcelProperty(value = "价格条款") + private String priceTerms; + +} diff --git a/src/main/java/org/energy/modules/spares/excel/WarehouseExcel.java b/src/main/java/org/energy/modules/spares/excel/WarehouseExcel.java new file mode 100644 index 0000000..9084c2a --- /dev/null +++ b/src/main/java/org/energy/modules/spares/excel/WarehouseExcel.java @@ -0,0 +1,66 @@ +/** + * 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.spares.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; + +import java.io.Serializable; + +/** + * Warehouse model export + * @author edwong + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(16) +public class WarehouseExcel implements Serializable { + private static final long serialVersionUID = 1L; + + @ColumnWidth(20) + @ExcelProperty(value = "仓库编号") + private String code; + + @ColumnWidth(20) + @ExcelProperty(value = "仓库名称") + private String name; + + @ColumnWidth(20) + @ExcelProperty(value = "仓库地址") + private String address; + + @ColumnWidth(20) + @ExcelProperty(value = "仓库类型") + private String type; + + @ColumnWidth(20) + @ExcelProperty(value = "仓库负责人") + private String managerUserName; + + @ColumnWidth(20) + @ExcelProperty(value = "联系电话") + private String contactNumber; + + @ColumnWidth(20) + @ExcelProperty(value = "审批状态") + private String approvalStatus; + + +} diff --git a/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.java b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.java new file mode 100644 index 0000000..f1f1784 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.java @@ -0,0 +1,30 @@ +package org.energy.modules.spares.mapper; + +import org.apache.ibatis.annotations.Param; +import org.energy.modules.spares.entity.ManufacturerInfo; +import org.energy.modules.spares.excel.ManufacturerInfoExcel; +import org.energy.modules.spares.vo.ManufacturerInfoVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_manufacturer_info Mapper 接口 + * + * @author Daf + * @since 2024-07-15 + */ +public interface ManufacturerInfoMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param manufacturerInfo + * @return + */ + List selectManufacturerInfoPage(IPage page, ManufacturerInfoVO manufacturerInfo); + + List exportData(@Param("vo") ManufacturerInfoVO manufacturerInfo); +} diff --git a/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.xml b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.xml new file mode 100644 index 0000000..b9a40e0 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/ManufacturerInfoMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.java b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.java new file mode 100644 index 0000000..0c5040e --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.java @@ -0,0 +1,30 @@ +package org.energy.modules.spares.mapper; + +import org.apache.ibatis.annotations.Param; +import org.energy.modules.spares.entity.MaterialClassification; +import org.energy.modules.spares.excel.MaterialClassExcel; +import org.energy.modules.spares.vo.MaterialClassificationVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_material_classification Mapper 接口 + * + * @author Daf + * @since 2024-07-15 + */ +public interface MaterialClassificationMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param materialClassification + * @return + */ + List selectMaterialClassificationPage(IPage page, MaterialClassificationVO materialClassification); + + List exportData(@Param("vo") MaterialClassificationVO materialClassification); +} diff --git a/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml new file mode 100644 index 0000000..c6e99d9 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/MaterialClassificationMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.java b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.java new file mode 100644 index 0000000..aa94acb --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.java @@ -0,0 +1,31 @@ +package org.energy.modules.spares.mapper; + +import org.apache.ibatis.annotations.Param; +import org.energy.modules.spares.entity.SupplierInfo; +import org.energy.modules.spares.excel.SupplierInfoExcel; +import org.energy.modules.spares.vo.SupplierInfoVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_supplier_info Mapper 接口 + * + * @author Daf + * @since 2024-07-15 + */ +public interface SupplierInfoMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param supplierInfo + * @return + */ + List selectSupplierInfoPage(IPage page, SupplierInfoVO supplierInfo); + + List exportData(@Param("vo") SupplierInfoVO supplierInfo); + +} diff --git a/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.xml b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.xml new file mode 100644 index 0000000..514bf1e --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/SupplierInfoMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.java b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.java new file mode 100644 index 0000000..0d2d4de --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.java @@ -0,0 +1,30 @@ +package org.energy.modules.spares.mapper; + +import org.apache.ibatis.annotations.Param; +import org.energy.modules.spares.entity.Warehouse; +import org.energy.modules.spares.excel.WarehouseExcel; +import org.energy.modules.spares.vo.WarehouseVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import java.util.List; + +/** + * spt_warehouse Mapper 接口 + * + * @author Daf + * @since 2024-07-15 + */ +public interface WarehouseMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param warehouse + * @return + */ + List selectWarehousePage(IPage page, WarehouseVO warehouse); + + List exportData(@Param("vo") WarehouseVO warehouseVO); + +} diff --git a/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.xml b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.xml new file mode 100644 index 0000000..3330ed9 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/mapper/WarehouseMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/energy/modules/spares/service/IManufacturerInfoService.java b/src/main/java/org/energy/modules/spares/service/IManufacturerInfoService.java new file mode 100644 index 0000000..8fa394d --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/IManufacturerInfoService.java @@ -0,0 +1,29 @@ +package org.energy.modules.spares.service; + +import org.energy.modules.spares.entity.ManufacturerInfo; +import org.energy.modules.spares.excel.ManufacturerInfoExcel; +import org.energy.modules.spares.vo.ManufacturerInfoVO; +import com.dayu.daf.core.mp.base.BaseService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_manufacturer_info 服务类 + * + * @author Daf + * @since 2024-07-15 + */ +public interface IManufacturerInfoService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param manufacturerInfo + * @return + */ + IPage selectManufacturerInfoPage(IPage page, ManufacturerInfoVO manufacturerInfo); + + List export(ManufacturerInfoVO manufacturerInfoVO); +} diff --git a/src/main/java/org/energy/modules/spares/service/IMaterialClassificationService.java b/src/main/java/org/energy/modules/spares/service/IMaterialClassificationService.java new file mode 100644 index 0000000..1008333 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/IMaterialClassificationService.java @@ -0,0 +1,30 @@ +package org.energy.modules.spares.service; + +import org.energy.modules.spares.entity.MaterialClassification; +import org.energy.modules.spares.excel.MaterialClassExcel; +import org.energy.modules.spares.vo.MaterialClassificationVO; +import com.dayu.daf.core.mp.base.BaseService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_material_classification 服务类 + * + * @author Daf + * @since 2024-07-15 + */ +public interface IMaterialClassificationService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param materialClassification + * @return + */ + IPage selectMaterialClassificationPage(IPage page, MaterialClassificationVO materialClassification); + + List export(MaterialClassificationVO materialClassificationVO); + +} diff --git a/src/main/java/org/energy/modules/spares/service/ISupplierInfoService.java b/src/main/java/org/energy/modules/spares/service/ISupplierInfoService.java new file mode 100644 index 0000000..8c44d09 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/ISupplierInfoService.java @@ -0,0 +1,29 @@ +package org.energy.modules.spares.service; + +import org.energy.modules.spares.entity.SupplierInfo; +import org.energy.modules.spares.excel.SupplierInfoExcel; +import org.energy.modules.spares.vo.SupplierInfoVO; +import com.dayu.daf.core.mp.base.BaseService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_supplier_info 服务类 + * + * @author Daf + * @since 2024-07-15 + */ +public interface ISupplierInfoService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param supplierInfo + * @return + */ + IPage selectSupplierInfoPage(IPage page, SupplierInfoVO supplierInfo); + + List export(SupplierInfoVO supplierInfo); +} diff --git a/src/main/java/org/energy/modules/spares/service/IWarehouseService.java b/src/main/java/org/energy/modules/spares/service/IWarehouseService.java new file mode 100644 index 0000000..fec7262 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/IWarehouseService.java @@ -0,0 +1,30 @@ +package org.energy.modules.spares.service; + +import org.energy.modules.spares.entity.Warehouse; +import org.energy.modules.spares.excel.WarehouseExcel; +import org.energy.modules.spares.vo.WarehouseVO; +import com.dayu.daf.core.mp.base.BaseService; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_warehouse 服务类 + * + * @author Daf + * @since 2024-07-15 + */ +public interface IWarehouseService extends BaseService { + + /** + * 自定义分页 + * + * @param page + * @param warehouse + * @return + */ + IPage selectWarehousePage(IPage page, WarehouseVO warehouse); + + List export(WarehouseVO warehouseVO); + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/ManufacturerInfoServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/ManufacturerInfoServiceImpl.java new file mode 100644 index 0000000..51c9053 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/ManufacturerInfoServiceImpl.java @@ -0,0 +1,45 @@ +package org.energy.modules.spares.service.impl; + +import io.micrometer.core.instrument.util.StringUtils; +import org.energy.modules.spares.entity.ManufacturerInfo; +import org.energy.modules.spares.excel.ManufacturerInfoExcel; +import org.energy.modules.spares.excel.MaterialClassExcel; +import org.energy.modules.spares.vo.ManufacturerInfoVO; +import org.energy.modules.spares.mapper.ManufacturerInfoMapper; +import org.energy.modules.spares.service.IManufacturerInfoService; +import com.dayu.daf.core.mp.base.BaseServiceImpl; +import org.energy.modules.system.service.IDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_manufacturer_info 服务实现类 + * + * @author Daf + * @since 2024-07-15 + */ +@Service +public class ManufacturerInfoServiceImpl extends BaseServiceImpl implements IManufacturerInfoService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectManufacturerInfoPage(IPage page, ManufacturerInfoVO manufacturerInfo) { + return page.setRecords(baseMapper.selectManufacturerInfoPage(page, manufacturerInfo)); + } + + @Override + public List export(ManufacturerInfoVO manufacturerInfoVO) { + List list = baseMapper.exportData(manufacturerInfoVO); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/MaterialClassificationServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/MaterialClassificationServiceImpl.java new file mode 100644 index 0000000..241416f --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/MaterialClassificationServiceImpl.java @@ -0,0 +1,44 @@ +package org.energy.modules.spares.service.impl; + +import io.micrometer.core.instrument.util.StringUtils; +import org.energy.modules.spares.entity.MaterialClassification; +import org.energy.modules.spares.excel.MaterialClassExcel; +import org.energy.modules.spares.vo.MaterialClassificationVO; +import org.energy.modules.spares.mapper.MaterialClassificationMapper; +import org.energy.modules.spares.service.IMaterialClassificationService; +import com.dayu.daf.core.mp.base.BaseServiceImpl; +import org.energy.modules.system.service.IDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_material_classification 服务实现类 + * + * @author Daf + * @since 2024-07-15 + */ +@Service +public class MaterialClassificationServiceImpl extends BaseServiceImpl implements IMaterialClassificationService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectMaterialClassificationPage(IPage page, MaterialClassificationVO materialClassification) { + return page.setRecords(baseMapper.selectMaterialClassificationPage(page, materialClassification)); + } + + @Override + public List export(MaterialClassificationVO materialClassificationVO) { + List list = baseMapper.exportData(materialClassificationVO); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/SupplierInfoServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/SupplierInfoServiceImpl.java new file mode 100644 index 0000000..0cb74ae --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/SupplierInfoServiceImpl.java @@ -0,0 +1,44 @@ +package org.energy.modules.spares.service.impl; + +import io.micrometer.core.instrument.util.StringUtils; +import org.energy.modules.spares.entity.SupplierInfo; +import org.energy.modules.spares.excel.SupplierInfoExcel; +import org.energy.modules.spares.vo.SupplierInfoVO; +import org.energy.modules.spares.mapper.SupplierInfoMapper; +import org.energy.modules.spares.service.ISupplierInfoService; +import com.dayu.daf.core.mp.base.BaseServiceImpl; +import org.energy.modules.system.service.IDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_supplier_info 服务实现类 + * + * @author Daf + * @since 2024-07-15 + */ +@Service +public class SupplierInfoServiceImpl extends BaseServiceImpl implements ISupplierInfoService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectSupplierInfoPage(IPage page, SupplierInfoVO supplierInfo) { + return page.setRecords(baseMapper.selectSupplierInfoPage(page, supplierInfo)); + } + + @Override + public List export(SupplierInfoVO supplierInfo) { + List list = baseMapper.exportData(supplierInfo); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/service/impl/WarehouseServiceImpl.java b/src/main/java/org/energy/modules/spares/service/impl/WarehouseServiceImpl.java new file mode 100644 index 0000000..486ed4e --- /dev/null +++ b/src/main/java/org/energy/modules/spares/service/impl/WarehouseServiceImpl.java @@ -0,0 +1,45 @@ +package org.energy.modules.spares.service.impl; + +import io.micrometer.core.instrument.util.StringUtils; +import org.energy.modules.smart.excel.WorkOrderExcel; +import org.energy.modules.spares.entity.Warehouse; +import org.energy.modules.spares.excel.WarehouseExcel; +import org.energy.modules.spares.vo.WarehouseVO; +import org.energy.modules.spares.mapper.WarehouseMapper; +import org.energy.modules.spares.service.IWarehouseService; +import com.dayu.daf.core.mp.base.BaseServiceImpl; +import org.energy.modules.system.service.IDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.metadata.IPage; + +import java.util.List; + +/** + * spt_warehouse 服务实现类 + * + * @author Daf + * @since 2024-07-15 + */ +@Service +public class WarehouseServiceImpl extends BaseServiceImpl implements IWarehouseService { + + @Autowired + IDictService dictService; + + @Override + public IPage selectWarehousePage(IPage page, WarehouseVO warehouse) { + return page.setRecords(baseMapper.selectWarehousePage(page, warehouse)); + } + + @Override + public List export(WarehouseVO warehouseVO) { + List list = baseMapper.exportData(warehouseVO); + list.forEach(item -> { + if (StringUtils.isNotEmpty(item.getApprovalStatus())) + item.setApprovalStatus(dictService.getValue("check_status", Integer.parseInt(item.getApprovalStatus()))); + }); + return list; + } + +} diff --git a/src/main/java/org/energy/modules/spares/vo/ManufacturerInfoVO.java b/src/main/java/org/energy/modules/spares/vo/ManufacturerInfoVO.java new file mode 100644 index 0000000..573e29d --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/ManufacturerInfoVO.java @@ -0,0 +1,20 @@ +package org.energy.modules.spares.vo; + +import org.energy.modules.spares.entity.ManufacturerInfo; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * spt_manufacturer_info视图实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "ManufacturerInfoVO对象", description = "spt_manufacturer_info") +public class ManufacturerInfoVO extends ManufacturerInfo { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/spares/vo/MaterialClassificationVO.java b/src/main/java/org/energy/modules/spares/vo/MaterialClassificationVO.java new file mode 100644 index 0000000..82d9dcd --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/MaterialClassificationVO.java @@ -0,0 +1,20 @@ +package org.energy.modules.spares.vo; + +import org.energy.modules.spares.entity.MaterialClassification; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * spt_material_classification视图实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "MaterialClassificationVO对象", description = "spt_material_classification") +public class MaterialClassificationVO extends MaterialClassification { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/spares/vo/SupplierInfoVO.java b/src/main/java/org/energy/modules/spares/vo/SupplierInfoVO.java new file mode 100644 index 0000000..26005b2 --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/SupplierInfoVO.java @@ -0,0 +1,20 @@ +package org.energy.modules.spares.vo; + +import org.energy.modules.spares.entity.SupplierInfo; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * spt_supplier_info视图实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "SupplierInfoVO对象", description = "spt_supplier_info") +public class SupplierInfoVO extends SupplierInfo { + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/energy/modules/spares/vo/WarehouseVO.java b/src/main/java/org/energy/modules/spares/vo/WarehouseVO.java new file mode 100644 index 0000000..a66909a --- /dev/null +++ b/src/main/java/org/energy/modules/spares/vo/WarehouseVO.java @@ -0,0 +1,20 @@ +package org.energy.modules.spares.vo; + +import org.energy.modules.spares.entity.Warehouse; +import lombok.Data; +import lombok.EqualsAndHashCode; +import io.swagger.annotations.ApiModel; + +/** + * spt_warehouse视图实体类 + * + * @author Daf + * @since 2024-07-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "WarehouseVO对象", description = "spt_warehouse") +public class WarehouseVO extends Warehouse { + private static final long serialVersionUID = 1L; + +}